summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2009-10-27 18:21:36 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2009-10-27 18:30:18 +1100
commit8b639e07efdb1b21ca60eeb3f8f5ac5038761200 (patch)
treedd326f297c6c26c65477eea299667cf2d481fdd8
parent3a647a6ce4006ea8b84e4eaa6e18204cd911ed99 (diff)
parent1f0f7a7df20bd69cb8553136613bda38dcddfcb1 (diff)
Merge branch 'quilt/staging'
Conflicts: drivers/net/wireless/Kconfig
-rw-r--r--drivers/net/wireless/Kconfig143
-rw-r--r--drivers/net/wireless/Makefile10
-rw-r--r--drivers/net/wireless/libertas/Kconfig2
-rw-r--r--drivers/staging/Kconfig20
-rw-r--r--drivers/staging/Makefile13
-rw-r--r--drivers/staging/android/Kconfig95
-rw-r--r--drivers/staging/android/Makefile6
-rw-r--r--drivers/staging/android/TODO10
-rw-r--r--drivers/staging/android/binder.c3767
-rw-r--r--drivers/staging/android/binder.h330
-rw-r--r--drivers/staging/android/logger.c607
-rw-r--r--drivers/staging/android/logger.h48
-rw-r--r--drivers/staging/android/lowmemorykiller.c173
-rw-r--r--drivers/staging/android/ram_console.c410
-rw-r--r--drivers/staging/android/timed_gpio.c166
-rw-r--r--drivers/staging/android/timed_gpio.h33
-rw-r--r--drivers/staging/android/timed_output.c121
-rw-r--r--drivers/staging/android/timed_output.h37
-rw-r--r--drivers/staging/arlan/Kconfig15
-rw-r--r--drivers/staging/arlan/Makefile3
-rw-r--r--drivers/staging/arlan/TODO7
-rw-r--r--drivers/staging/arlan/arlan-main.c (renamed from drivers/net/wireless/arlan-main.c)82
-rw-r--r--drivers/staging/arlan/arlan-proc.c (renamed from drivers/net/wireless/arlan-proc.c)10
-rw-r--r--drivers/staging/arlan/arlan.h (renamed from drivers/net/wireless/arlan.h)36
-rw-r--r--drivers/staging/b3dfg/b3dfg.c12
-rw-r--r--drivers/staging/comedi/comedi.h8
-rw-r--r--drivers/staging/comedi/comedi_compat32.c149
-rw-r--r--drivers/staging/comedi/comedi_compat32.h16
-rw-r--r--drivers/staging/comedi/comedi_fops.c15
-rw-r--r--drivers/staging/comedi/comedidev.h60
-rw-r--r--drivers/staging/comedi/drivers.c2
-rw-r--r--drivers/staging/comedi/drivers/8253.h3
-rw-r--r--drivers/staging/comedi/drivers/8255.c23
-rw-r--r--drivers/staging/comedi/drivers/acl7225b.c9
-rw-r--r--drivers/staging/comedi/drivers/adl_pci6208.c53
-rw-r--r--drivers/staging/comedi/drivers/adl_pci7296.c19
-rw-r--r--drivers/staging/comedi/drivers/adl_pci7432.c32
-rw-r--r--drivers/staging/comedi/drivers/amplc_pc263.c18
-rw-r--r--drivers/staging/comedi/drivers/cb_das16_cs.c2
-rw-r--r--drivers/staging/comedi/drivers/cb_pcidda.c2
-rw-r--r--drivers/staging/comedi/drivers/dmm32at.c2
-rw-r--r--drivers/staging/comedi/drivers/dt2814.c2
-rw-r--r--drivers/staging/comedi/drivers/dt282x.c4
-rw-r--r--drivers/staging/comedi/drivers/mite.c231
-rw-r--r--drivers/staging/comedi/drivers/mite.h7
-rw-r--r--drivers/staging/comedi/drivers/ni_at_ao.c6
-rw-r--r--drivers/staging/comedi/drivers/ni_atmio16d.c90
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc.h52
-rw-r--r--drivers/staging/comedi/drivers/ni_labpc_cs.c18
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_common.c2
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_cs.c15
-rw-r--r--drivers/staging/comedi/drivers/ni_pcidio.c2
-rw-r--r--drivers/staging/comedi/drivers/pcm_common.c4
-rw-r--r--drivers/staging/comedi/drivers/pcmmio.c231
-rw-r--r--drivers/staging/comedi/drivers/quatech_daqp_cs.c2
-rw-r--r--drivers/staging/comedi/drivers/rtd520.c2
-rw-r--r--drivers/staging/comedi/drivers/s626.c2
-rw-r--r--drivers/staging/comedi/drivers/s626.h8
-rw-r--r--drivers/staging/comedi/drivers/serial2002.c9
-rw-r--r--drivers/staging/comedi/drivers/skel.c2
-rw-r--r--drivers/staging/comedi/drivers/usbdux.c4
-rw-r--r--drivers/staging/comedi/drivers/vmk80xx.c24
-rw-r--r--drivers/staging/cx25821/cx25821-core.c4
-rw-r--r--drivers/staging/dream/Kconfig4
-rw-r--r--drivers/staging/dream/camera/msm_camera.c7
-rw-r--r--drivers/staging/dream/camera/msm_vfe7x.c1
-rw-r--r--drivers/staging/dream/gpio_event.c3
-rw-r--r--drivers/staging/dream/gpio_input.c7
-rw-r--r--drivers/staging/dream/gpio_matrix.c8
-rw-r--r--drivers/staging/dream/qdsp5/adsp.c5
-rw-r--r--drivers/staging/dream/qdsp5/audio_out.c4
-rw-r--r--drivers/staging/dream/smd/smd_qmi.c5
-rw-r--r--drivers/staging/dream/smd/smd_rpcrouter.c12
-rw-r--r--drivers/staging/dream/smd/smd_rpcrouter.h2
-rw-r--r--drivers/staging/dream/smd/smd_tty.c5
-rw-r--r--drivers/staging/dream/synaptics_i2c_rmi.c6
-rw-r--r--drivers/staging/et131x/et1310_address_map.h343
-rw-r--r--drivers/staging/et131x/et1310_eeprom.c436
-rw-r--r--drivers/staging/et131x/et1310_eeprom.h42
-rw-r--r--drivers/staging/et131x/et1310_mac.c102
-rw-r--r--drivers/staging/et131x/et1310_phy.c1167
-rw-r--r--drivers/staging/et131x/et1310_phy.h35
-rw-r--r--drivers/staging/et131x/et1310_rx.c539
-rw-r--r--drivers/staging/et131x/et1310_rx.h50
-rw-r--r--drivers/staging/et131x/et1310_tx.c620
-rw-r--r--drivers/staging/et131x/et1310_tx.h218
-rw-r--r--drivers/staging/et131x/et131x_adapter.h13
-rw-r--r--drivers/staging/et131x/et131x_defs.h1
-rw-r--r--drivers/staging/et131x/et131x_initpci.c596
-rw-r--r--drivers/staging/et131x/et131x_initpci.h2
-rw-r--r--drivers/staging/et131x/et131x_isr.c16
-rw-r--r--drivers/staging/et131x/et131x_netdev.c31
-rw-r--r--drivers/staging/iio/Kconfig10
-rw-r--r--drivers/staging/iio/chrdev.h4
-rw-r--r--drivers/staging/iio/iio.h36
-rw-r--r--drivers/staging/iio/ring_generic.h73
-rw-r--r--drivers/staging/iio/ring_sw.h68
-rw-r--r--drivers/staging/iio/sysfs.h114
-rw-r--r--drivers/staging/iio/trigger.h35
-rw-r--r--drivers/staging/iio/trigger/Kconfig6
-rw-r--r--drivers/staging/iio/trigger_consumer.h8
-rw-r--r--drivers/staging/line6/driver.c103
-rw-r--r--drivers/staging/netwave/Kconfig11
-rw-r--r--drivers/staging/netwave/Makefile1
-rw-r--r--drivers/staging/netwave/TODO7
-rw-r--r--drivers/staging/netwave/netwave_cs.c (renamed from drivers/net/wireless/netwave_cs.c)252
-rw-r--r--drivers/staging/octeon/ethernet-rgmii.c4
-rw-r--r--drivers/staging/p9auth/p9auth.c3
-rw-r--r--drivers/staging/phison/phison.c4
-rw-r--r--drivers/staging/poch/README124
-rw-r--r--drivers/staging/poch/poch.c198
-rw-r--r--drivers/staging/poch/poch.h16
-rw-r--r--drivers/staging/ramzswap/Kconfig21
-rw-r--r--drivers/staging/ramzswap/Makefile3
-rw-r--r--drivers/staging/ramzswap/TODO6
-rw-r--r--drivers/staging/ramzswap/ramzswap.txt51
-rw-r--r--drivers/staging/ramzswap/ramzswap_drv.c1435
-rw-r--r--drivers/staging/ramzswap/ramzswap_drv.h171
-rw-r--r--drivers/staging/ramzswap/ramzswap_ioctl.h49
-rw-r--r--drivers/staging/ramzswap/xvmalloc.c507
-rw-r--r--drivers/staging/ramzswap/xvmalloc.h30
-rw-r--r--drivers/staging/ramzswap/xvmalloc_int.h86
-rw-r--r--drivers/staging/rt2860/2860_main_dev.c1319
-rw-r--r--drivers/staging/rt2860/Kconfig5
-rw-r--r--drivers/staging/rt2860/Makefile31
-rw-r--r--drivers/staging/rt2860/aironet.h210
-rw-r--r--drivers/staging/rt2860/ap.h12
-rw-r--r--drivers/staging/rt2860/chip/mac_pci.h (renamed from drivers/staging/rt3090/mac_pci.h)87
-rw-r--r--drivers/staging/rt2860/chip/mac_usb.h365
-rw-r--r--drivers/staging/rt2860/chip/rt2860.h (renamed from drivers/staging/rt3090/netif_block.h)44
-rw-r--r--drivers/staging/rt2860/chip/rt2870.h (renamed from drivers/staging/rt3090/rt33xx.h)31
-rw-r--r--drivers/staging/rt2860/chip/rt3070.h (renamed from drivers/staging/rt3090/rt3370.h)20
-rw-r--r--drivers/staging/rt2860/chip/rt3090.h (renamed from drivers/staging/rt3090/rt3090.h)5
-rw-r--r--drivers/staging/rt2860/chip/rt30xx.h (renamed from drivers/staging/rt3090/rt30xx.h)0
-rw-r--r--drivers/staging/rt2860/chip/rtmp_mac.h (renamed from drivers/staging/rt2860/rt28xx.h)952
-rw-r--r--drivers/staging/rt2860/chip/rtmp_phy.h (renamed from drivers/staging/rt3090/rtmp_phy.h)77
-rw-r--r--drivers/staging/rt2860/chips/rt3070.c185
-rw-r--r--drivers/staging/rt2860/chips/rt3090.c (renamed from drivers/staging/rt3090/chips/rt3090.c)0
-rw-r--r--drivers/staging/rt2860/chips/rt30xx.c (renamed from drivers/staging/rt3090/chips/rt30xx.c)12
-rw-r--r--drivers/staging/rt2860/chlist.h1223
-rw-r--r--drivers/staging/rt2860/common/2860_rtmp_init.c897
-rw-r--r--drivers/staging/rt2860/common/action.c12
-rw-r--r--drivers/staging/rt2860/common/ba_action.c147
-rw-r--r--drivers/staging/rt2860/common/cmm_aes.c (renamed from drivers/staging/rt3090/common/cmm_aes.c)158
-rw-r--r--drivers/staging/rt2860/common/cmm_asic.c (renamed from drivers/staging/rt3090/common/cmm_asic.c)393
-rw-r--r--drivers/staging/rt2860/common/cmm_cfg.c (renamed from drivers/staging/rt3090/common/cmm_cfg.c)9
-rw-r--r--drivers/staging/rt2860/common/cmm_data.c906
-rw-r--r--drivers/staging/rt2860/common/cmm_data_pci.c (renamed from drivers/staging/rt3090/common/cmm_data_pci.c)459
-rw-r--r--drivers/staging/rt2860/common/cmm_data_usb.c (renamed from drivers/staging/rt2870/common/cmm_data_2870.c)256
-rw-r--r--drivers/staging/rt2860/common/cmm_info.c820
-rw-r--r--drivers/staging/rt2860/common/cmm_mac_pci.c (renamed from drivers/staging/rt3090/common/cmm_mac_pci.c)146
-rw-r--r--drivers/staging/rt2860/common/cmm_mac_usb.c1216
-rw-r--r--drivers/staging/rt2860/common/cmm_profile.c (renamed from drivers/staging/rt3090/common/cmm_profile.c)558
-rw-r--r--drivers/staging/rt2860/common/cmm_sanity.c233
-rw-r--r--drivers/staging/rt2860/common/cmm_sync.c57
-rw-r--r--drivers/staging/rt2860/common/cmm_tkip.c (renamed from drivers/staging/rt3090/common/cmm_tkip.c)86
-rw-r--r--drivers/staging/rt2860/common/cmm_wep.c (renamed from drivers/staging/rt3090/common/cmm_wep.c)3
-rw-r--r--drivers/staging/rt2860/common/cmm_wpa.c2428
-rw-r--r--drivers/staging/rt2860/common/crypt_hmac.c (renamed from drivers/staging/rt3090/common/crypt_hmac.c)16
-rw-r--r--drivers/staging/rt2860/common/crypt_md5.c (renamed from drivers/staging/rt3090/common/crypt_md5.c)1
-rw-r--r--drivers/staging/rt2860/common/crypt_sha2.c (renamed from drivers/staging/rt3090/common/crypt_sha2.c)7
-rw-r--r--drivers/staging/rt2860/common/dfs.c360
-rw-r--r--drivers/staging/rt2860/common/ee_efuse.c (renamed from drivers/staging/rt3090/common/ee_efuse.c)33
-rw-r--r--drivers/staging/rt2860/common/ee_prom.c (renamed from drivers/staging/rt3090/common/ee_prom.c)44
-rw-r--r--drivers/staging/rt2860/common/eeprom.c1460
-rw-r--r--drivers/staging/rt2860/common/firmware.h2
-rw-r--r--drivers/staging/rt2860/common/firmware_3070.h517
-rw-r--r--drivers/staging/rt2860/common/md5.c1415
-rw-r--r--drivers/staging/rt2860/common/mlme.c5182
-rw-r--r--drivers/staging/rt2860/common/rt_channel.c (renamed from drivers/staging/rt3090/common/rt_channel.c)7
-rw-r--r--drivers/staging/rt2860/common/rt_rf.c (renamed from drivers/staging/rt3090/common/rt_rf.c)23
-rw-r--r--drivers/staging/rt2860/common/rtmp_init.c2028
-rw-r--r--drivers/staging/rt2860/common/rtmp_mcu.c311
-rw-r--r--drivers/staging/rt2860/common/rtmp_timer.c (renamed from drivers/staging/rt3090/common/rtmp_timer.c)18
-rw-r--r--drivers/staging/rt2860/common/rtmp_tkip.c1586
-rw-r--r--drivers/staging/rt2860/common/rtmp_wep.c497
-rw-r--r--drivers/staging/rt2860/common/spectrum.c460
-rw-r--r--drivers/staging/rt2860/config.mk241
-rw-r--r--drivers/staging/rt2860/crypt_hmac.h (renamed from drivers/staging/rt3090/crypt_hmac.h)13
-rw-r--r--drivers/staging/rt2860/crypt_md5.h (renamed from drivers/staging/rt3090/crypt_md5.h)12
-rw-r--r--drivers/staging/rt2860/crypt_sha2.h (renamed from drivers/staging/rt3090/crypt_sha2.h)14
-rw-r--r--drivers/staging/rt2860/dfs.h47
-rw-r--r--drivers/staging/rt2860/eeprom.h (renamed from drivers/staging/rt3090/eeprom.h)31
-rw-r--r--drivers/staging/rt2860/iface/rtmp_pci.h (renamed from drivers/staging/rt3090/rtmp_pci.h)51
-rw-r--r--drivers/staging/rt2860/iface/rtmp_usb.h200
-rw-r--r--drivers/staging/rt2860/md5.h107
-rw-r--r--drivers/staging/rt2860/mlme.h89
-rw-r--r--drivers/staging/rt2860/oid.h135
-rw-r--r--drivers/staging/rt2860/pci_main_dev.c (renamed from drivers/staging/rt3090/pci_main_dev.c)161
-rw-r--r--drivers/staging/rt2860/rt2860.h333
-rw-r--r--drivers/staging/rt2860/rt_config.h32
-rw-r--r--drivers/staging/rt2860/rt_linux.c618
-rw-r--r--drivers/staging/rt2860/rt_linux.h973
-rw-r--r--drivers/staging/rt2860/rt_main_dev.c747
-rw-r--r--drivers/staging/rt2860/rt_pci_rbus.c (renamed from drivers/staging/rt3090/rt_pci_rbus.c)124
-rw-r--r--drivers/staging/rt2860/rt_profile.c1839
-rw-r--r--drivers/staging/rt2860/rt_usb.c828
-rw-r--r--drivers/staging/rt2860/rtmp.h2905
-rw-r--r--drivers/staging/rt2860/rtmp_chip.h (renamed from drivers/staging/rt3090/rtmp_chip.h)107
-rw-r--r--drivers/staging/rt2860/rtmp_def.h294
-rw-r--r--drivers/staging/rt2860/rtmp_dot11.h (renamed from drivers/staging/rt3090/rtmp_dot11.h)44
-rw-r--r--drivers/staging/rt2860/rtmp_iface.h (renamed from drivers/staging/rt3090/rtmp_iface.h)7
-rw-r--r--drivers/staging/rt2860/rtmp_mcu.h (renamed from drivers/staging/rt3090/rtmp_mcu.h)0
-rw-r--r--drivers/staging/rt2860/rtmp_os.h (renamed from drivers/staging/rt3090/rtmp_os.h)5
-rw-r--r--drivers/staging/rt2860/rtmp_timer.h (renamed from drivers/staging/rt3090/rtmp_timer.h)18
-rw-r--r--drivers/staging/rt2860/rtmp_type.h55
-rw-r--r--drivers/staging/rt2860/rtusb_io.h189
-rw-r--r--drivers/staging/rt2860/spectrum.h169
-rw-r--r--drivers/staging/rt2860/spectrum_def.h148
-rw-r--r--drivers/staging/rt2860/sta/aironet.c1312
-rw-r--r--drivers/staging/rt2860/sta/assoc.c315
-rw-r--r--drivers/staging/rt2860/sta/auth.c138
-rw-r--r--drivers/staging/rt2860/sta/auth_rsp.c12
-rw-r--r--drivers/staging/rt2860/sta/connect.c485
-rw-r--r--drivers/staging/rt2860/sta/rtmp_data.c258
-rw-r--r--drivers/staging/rt2860/sta/sanity.c44
-rw-r--r--drivers/staging/rt2860/sta/sync.c416
-rw-r--r--drivers/staging/rt2860/sta/wpa.c1944
-rw-r--r--drivers/staging/rt2860/sta_ioctl.c768
-rw-r--r--drivers/staging/rt2860/usb_main_dev.c897
-rw-r--r--drivers/staging/rt2860/wpa.h97
-rw-r--r--drivers/staging/rt2870/2870_main_dev.c1530
-rw-r--r--drivers/staging/rt2870/Makefile32
-rw-r--r--drivers/staging/rt2870/chips/rt3070.c1
-rw-r--r--drivers/staging/rt2870/chips/rt30xx.c1
-rw-r--r--drivers/staging/rt2870/common/2870_rtmp_init.c1730
-rw-r--r--drivers/staging/rt2870/common/acction.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_aes.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_asic.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_cfg.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_data_usb.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_mac_usb.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_profile.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_tkip.c1
-rw-r--r--drivers/staging/rt2870/common/cmm_wep.c1
-rw-r--r--drivers/staging/rt2870/common/crypt_hmac.c1
-rw-r--r--drivers/staging/rt2870/common/crypt_md5.c1
-rw-r--r--drivers/staging/rt2870/common/crypt_sha2.c1
-rw-r--r--drivers/staging/rt2870/common/ee_efuse.c1
-rw-r--r--drivers/staging/rt2870/common/rt_channel.c1
-rw-r--r--drivers/staging/rt2870/common/rt_rf.c1
-rw-r--r--drivers/staging/rt2870/common/rtmp_mcu.c1
-rw-r--r--drivers/staging/rt2870/common/rtmp_timer.c1
-rw-r--r--drivers/staging/rt2870/common/rtusb_bulk.c37
-rw-r--r--drivers/staging/rt2870/common/rtusb_data.c55
-rw-r--r--drivers/staging/rt2870/common/rtusb_io.c465
-rw-r--r--drivers/staging/rt2870/rt2870.h583
-rw-r--r--drivers/staging/rt2870/rt_usb.c1
-rw-r--r--drivers/staging/rt2870/usb_main_dev.c1
-rw-r--r--drivers/staging/rt3070/firmware.h2
-rw-r--r--drivers/staging/rt3090/Kconfig5
-rw-r--r--drivers/staging/rt3090/Makefile80
-rw-r--r--drivers/staging/rt3090/action.h66
-rw-r--r--drivers/staging/rt3090/ap.h512
-rw-r--r--drivers/staging/rt3090/ap_apcli.h276
-rw-r--r--drivers/staging/rt3090/ap_autoChSel.h79
-rw-r--r--drivers/staging/rt3090/ap_autoChSel_cmm.h66
-rw-r--r--drivers/staging/rt3090/ap_cfg.h118
-rw-r--r--drivers/staging/rt3090/ap_ids.h82
-rw-r--r--drivers/staging/rt3090/ap_mbss.h72
-rw-r--r--drivers/staging/rt3090/ap_uapsd.h636
-rw-r--r--drivers/staging/rt3090/ap_wds.h212
-rw-r--r--drivers/staging/rt3090/chips/rt3370.c121
-rw-r--r--drivers/staging/rt3090/chips/rt3390.c122
-rw-r--r--drivers/staging/rt3090/chips/rt33xx.c536
-rw-r--r--drivers/staging/rt3090/chlist.h130
-rw-r--r--drivers/staging/rt3090/common/action.c1057
-rw-r--r--drivers/staging/rt3090/common/ba_action.c1779
-rw-r--r--drivers/staging/rt3090/common/cmm_data.c2763
-rw-r--r--drivers/staging/rt3090/common/cmm_info.c3718
-rw-r--r--drivers/staging/rt3090/common/cmm_sanity.c1718
-rw-r--r--drivers/staging/rt3090/common/cmm_sync.c734
-rw-r--r--drivers/staging/rt3090/common/cmm_wpa.c3149
-rw-r--r--drivers/staging/rt3090/common/crypt_aes.c1007
-rw-r--r--drivers/staging/rt3090/common/crypt_biginteger.c1119
-rw-r--r--drivers/staging/rt3090/common/crypt_dh.c234
-rw-r--r--drivers/staging/rt3090/common/dfs.c481
-rw-r--r--drivers/staging/rt3090/common/eeprom.c98
-rw-r--r--drivers/staging/rt3090/common/igmp_snoop.c1365
-rw-r--r--drivers/staging/rt3090/common/mlme.c6550
-rw-r--r--drivers/staging/rt3090/common/mlme_ex.c215
-rw-r--r--drivers/staging/rt3090/common/netif_block.c147
-rw-r--r--drivers/staging/rt3090/common/rtmp_init.c3882
-rw-r--r--drivers/staging/rt3090/common/rtmp_mcu.c560
-rw-r--r--drivers/staging/rt3090/common/spectrum.c2221
-rw-r--r--drivers/staging/rt3090/config.mk187
-rw-r--r--drivers/staging/rt3090/dfs.h137
-rw-r--r--drivers/staging/rt3090/firmware.h2
-rw-r--r--drivers/staging/rt3090/igmp_snoop.h152
-rw-r--r--drivers/staging/rt3090/ipv6.h215
-rw-r--r--drivers/staging/rt3090/link_list.h133
-rw-r--r--drivers/staging/rt3090/mlme.h1360
-rw-r--r--drivers/staging/rt3090/mlme_ex.h83
-rw-r--r--drivers/staging/rt3090/mlme_ex_def.h53
-rw-r--r--drivers/staging/rt3090/oid.h1144
-rw-r--r--drivers/staging/rt3090/rt3390.h77
-rw-r--r--drivers/staging/rt3090/rt_ate.c6089
-rw-r--r--drivers/staging/rt3090/rt_ate.h314
-rw-r--r--drivers/staging/rt3090/rt_config.h126
-rw-r--r--drivers/staging/rt3090/rt_linux.c1624
-rw-r--r--drivers/staging/rt3090/rt_linux.h1034
-rw-r--r--drivers/staging/rt3090/rt_main_dev.c897
-rw-r--r--drivers/staging/rt3090/rt_profile.c101
-rw-r--r--drivers/staging/rt3090/rtmp.h6873
-rw-r--r--drivers/staging/rt3090/rtmp_def.h1650
-rw-r--r--drivers/staging/rt3090/rtmp_mac.h2304
-rw-r--r--drivers/staging/rt3090/rtmp_type.h147
-rw-r--r--drivers/staging/rt3090/spectrum.h234
-rw-r--r--drivers/staging/rt3090/spectrum_def.h257
-rw-r--r--drivers/staging/rt3090/sta/assoc.c1673
-rw-r--r--drivers/staging/rt3090/sta/auth.c491
-rw-r--r--drivers/staging/rt3090/sta/auth_rsp.c151
-rw-r--r--drivers/staging/rt3090/sta/connect.c2759
-rw-r--r--drivers/staging/rt3090/sta/dls.c2207
-rw-r--r--drivers/staging/rt3090/sta/rtmp_ckipmic.c579
-rw-r--r--drivers/staging/rt3090/sta/rtmp_data.c2661
-rw-r--r--drivers/staging/rt3090/sta/sanity.c382
-rw-r--r--drivers/staging/rt3090/sta/sync.c1840
-rw-r--r--drivers/staging/rt3090/sta/wpa.c396
-rw-r--r--drivers/staging/rt3090/sta_ioctl.c7557
-rw-r--r--drivers/staging/rt3090/vr_ikans.h71
-rw-r--r--drivers/staging/rt3090/wpa.h447
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c1
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c1
-rw-r--r--drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c1
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c1
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c1
-rw-r--r--drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c1
-rw-r--r--drivers/staging/slicoss/slicoss.c1
-rw-r--r--drivers/staging/stlc45xx/Kconfig8
-rw-r--r--drivers/staging/stlc45xx/Makefile1
-rw-r--r--drivers/staging/stlc45xx/stlc45xx.c2594
-rw-r--r--drivers/staging/stlc45xx/stlc45xx.h283
-rw-r--r--drivers/staging/stlc45xx/stlc45xx_lmac.h434
-rw-r--r--drivers/staging/strip/Kconfig22
-rw-r--r--drivers/staging/strip/Makefile1
-rw-r--r--drivers/staging/strip/TODO7
-rw-r--r--drivers/staging/strip/strip.c (renamed from drivers/net/wireless/strip.c)54
-rw-r--r--drivers/staging/vme/bridges/vme_ca91cx42.c1
-rw-r--r--drivers/staging/vme/bridges/vme_tsi148.c1
-rw-r--r--drivers/staging/vme/devices/vme_user.c1
-rw-r--r--drivers/staging/vme/vme.c1
-rw-r--r--drivers/staging/vt6656/device.h2
-rw-r--r--drivers/staging/wavelan/Kconfig38
-rw-r--r--drivers/staging/wavelan/Makefile2
-rw-r--r--drivers/staging/wavelan/TODO7
-rw-r--r--drivers/staging/wavelan/i82593.h (renamed from drivers/net/wireless/i82593.h)0
-rw-r--r--drivers/staging/wavelan/wavelan.c (renamed from drivers/net/wireless/wavelan.c)62
-rw-r--r--drivers/staging/wavelan/wavelan.h (renamed from drivers/net/wireless/wavelan.h)0
-rw-r--r--drivers/staging/wavelan/wavelan.p.h (renamed from drivers/net/wireless/wavelan.p.h)2
-rw-r--r--drivers/staging/wavelan/wavelan_cs.c (renamed from drivers/net/wireless/wavelan_cs.c)174
-rw-r--r--drivers/staging/wavelan/wavelan_cs.h (renamed from drivers/net/wireless/wavelan_cs.h)4
-rw-r--r--drivers/staging/wavelan/wavelan_cs.p.h (renamed from drivers/net/wireless/wavelan_cs.p.h)6
-rw-r--r--drivers/staging/wlags49_h2/Kconfig8
-rw-r--r--drivers/staging/wlags49_h2/Makefile81
-rw-r--r--drivers/staging/wlags49_h2/README.ubuntu180
-rw-r--r--drivers/staging/wlags49_h2/README.wlags49641
-rw-r--r--drivers/staging/wlags49_h2/WARNING.txt3
-rw-r--r--drivers/staging/wlags49_h2/ap_h2.c3337
-rw-r--r--drivers/staging/wlags49_h2/ap_h25.c4094
-rw-r--r--drivers/staging/wlags49_h2/debug.h229
-rw-r--r--drivers/staging/wlags49_h2/dhf.c390
-rw-r--r--drivers/staging/wlags49_h2/dhf.h226
-rw-r--r--drivers/staging/wlags49_h2/dhfcfg.h175
-rw-r--r--drivers/staging/wlags49_h2/hcf.c4881
-rw-r--r--drivers/staging/wlags49_h2/hcf.h405
-rw-r--r--drivers/staging/wlags49_h2/hcfcfg.h2344
-rw-r--r--drivers/staging/wlags49_h2/hcfdef.h809
-rw-r--r--drivers/staging/wlags49_h2/man/wlags49.4734
-rw-r--r--drivers/staging/wlags49_h2/mdd.h1156
-rw-r--r--drivers/staging/wlags49_h2/mmd.c251
-rw-r--r--drivers/staging/wlags49_h2/mmd.h78
-rw-r--r--drivers/staging/wlags49_h2/sta_h2.c4480
-rw-r--r--drivers/staging/wlags49_h2/sta_h25.c5255
-rw-r--r--drivers/staging/wlags49_h2/wl_cs.c715
-rw-r--r--drivers/staging/wlags49_h2/wl_cs.h112
-rw-r--r--drivers/staging/wlags49_h2/wl_enc.c248
-rw-r--r--drivers/staging/wlags49_h2/wl_enc.h135
-rw-r--r--drivers/staging/wlags49_h2/wl_if.h232
-rw-r--r--drivers/staging/wlags49_h2/wl_internal.h1073
-rw-r--r--drivers/staging/wlags49_h2/wl_main.c3878
-rw-r--r--drivers/staging/wlags49_h2/wl_main.h155
-rw-r--r--drivers/staging/wlags49_h2/wl_netdev.c2085
-rw-r--r--drivers/staging/wlags49_h2/wl_netdev.h171
-rw-r--r--drivers/staging/wlags49_h2/wl_pci.c1596
-rw-r--r--drivers/staging/wlags49_h2/wl_pci.h126
-rw-r--r--drivers/staging/wlags49_h2/wl_priv.c2095
-rw-r--r--drivers/staging/wlags49_h2/wl_priv.h138
-rw-r--r--drivers/staging/wlags49_h2/wl_profile.c1128
-rw-r--r--drivers/staging/wlags49_h2/wl_profile.h104
-rw-r--r--drivers/staging/wlags49_h2/wl_sysfs.c135
-rw-r--r--drivers/staging/wlags49_h2/wl_sysfs.h7
-rw-r--r--drivers/staging/wlags49_h2/wl_util.c1604
-rw-r--r--drivers/staging/wlags49_h2/wl_util.h119
-rw-r--r--drivers/staging/wlags49_h2/wl_version.h193
-rw-r--r--drivers/staging/wlags49_h2/wl_wext.c4138
-rw-r--r--drivers/staging/wlags49_h2/wl_wext.h113
-rw-r--r--drivers/staging/wlags49_h25/Kconfig8
-rw-r--r--drivers/staging/wlags49_h25/Makefile81
-rw-r--r--drivers/staging/wlags49_h25/README.txt30
-rw-r--r--drivers/staging/wlags49_h25/ap_h25.c2
-rw-r--r--drivers/staging/wlags49_h25/debug.h2
-rw-r--r--drivers/staging/wlags49_h25/dhf.c2
-rw-r--r--drivers/staging/wlags49_h25/dhf.h2
-rw-r--r--drivers/staging/wlags49_h25/dhfcfg.h2
-rw-r--r--drivers/staging/wlags49_h25/hcf.c2
-rw-r--r--drivers/staging/wlags49_h25/hcf.h2
-rw-r--r--drivers/staging/wlags49_h25/hcfcfg.h2
-rw-r--r--drivers/staging/wlags49_h25/hcfdef.h2
-rw-r--r--drivers/staging/wlags49_h25/mdd.h2
-rw-r--r--drivers/staging/wlags49_h25/mmd.c2
-rw-r--r--drivers/staging/wlags49_h25/mmd.h2
-rw-r--r--drivers/staging/wlags49_h25/sta_h25.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_cs.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_cs.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_enc.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_enc.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_if.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_internal.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_main.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_main.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_netdev.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_netdev.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_priv.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_priv.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_profile.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_profile.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_sysfs.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_sysfs.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_util.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_util.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_version.h2
-rw-r--r--drivers/staging/wlags49_h25/wl_wext.c2
-rw-r--r--drivers/staging/wlags49_h25/wl_wext.h2
434 files changed, 72039 insertions, 128246 deletions
diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 85f8bf4112c1..701e07aac810 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -8,126 +8,17 @@ menuconfig WLAN
select WIRELESS
default y
---help---
- This section contains all the pre 802.11 and 802.11 wireless
- device drivers. For a complete list of drivers and documentation
+ This section contains all the 802.11 wireless LAN device
+ drivers. For a complete list of drivers and documentation
on them refer to the wireless wiki:
http://wireless.kernel.org/en/users/Drivers
if WLAN
-menuconfig WLAN_PRE80211
- bool "Wireless LAN (pre-802.11)"
- depends on NETDEVICES
- ---help---
- Say Y if you have any pre-802.11 wireless LAN hardware.
-
- This option does not affect the kernel build, it only
- lets you choose drivers.
-
-config STRIP
- tristate "STRIP (Metricom starmode radio IP)"
- depends on INET && WLAN_PRE80211
- select WIRELESS_EXT
- ---help---
- Say Y if you have a Metricom radio and intend to use Starmode Radio
- IP. STRIP is a radio protocol developed for the MosquitoNet project
- to send Internet traffic using Metricom radios. Metricom radios are
- small, battery powered, 100kbit/sec packet radio transceivers, about
- the size and weight of a cellular telephone. (You may also have heard
- them called "Metricom modems" but we avoid the term "modem" because
- it misleads many people into thinking that you can plug a Metricom
- modem into a phone line and use it as a modem.)
-
- You can use STRIP on any Linux machine with a serial port, although
- it is obviously most useful for people with laptop computers. If you
- think you might get a Metricom radio in the future, there is no harm
- in saying Y to STRIP now, except that it makes the kernel a bit
- bigger.
-
- To compile this as a module, choose M here: the module will be
- called strip.
-
-config ARLAN
- tristate "Aironet Arlan 655 & IC2200 DS support"
- depends on ISA && !64BIT && WLAN_PRE80211
- select WIRELESS_EXT
- ---help---
- Aironet makes Arlan, a class of wireless LAN adapters. These use the
- www.Telxon.com chip, which is also used on several similar cards.
- This driver is tested on the 655 and IC2200 series cards. Look at
- <http://www.ylenurme.ee/~elmer/655/> for the latest information.
-
- The driver is built as two modules, arlan and arlan-proc. The latter
- is the /proc interface and is not needed most of time.
-
- On some computers the card ends up in non-valid state after some
- time. Use a ping-reset script to clear it.
-
-config WAVELAN
- tristate "AT&T/Lucent old WaveLAN & DEC RoamAbout DS ISA support"
- depends on ISA && WLAN_PRE80211
- select WIRELESS_EXT
- select WEXT_SPY
- select WEXT_PRIV
- ---help---
- The Lucent WaveLAN (formerly NCR and AT&T; or DEC RoamAbout DS) is
- a Radio LAN (wireless Ethernet-like Local Area Network) using the
- radio frequencies 900 MHz and 2.4 GHz.
-
- If you want to use an ISA WaveLAN card under Linux, say Y and read
- the Ethernet-HOWTO, available from
- <http://www.tldp.org/docs.html#howto>. Some more specific
- information is contained in
- <file:Documentation/networking/wavelan.txt> and in the source code
- <file:drivers/net/wireless/wavelan.p.h>.
-
- You will also need the wireless tools package available from
- <http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>.
- Please read the man pages contained therein.
-
- To compile this driver as a module, choose M here: the module will be
- called wavelan.
-
-config PCMCIA_WAVELAN
- tristate "AT&T/Lucent old WaveLAN Pcmcia wireless support"
- depends on PCMCIA && WLAN_PRE80211
- select WIRELESS_EXT
- select WEXT_SPY
- select WEXT_PRIV
- help
- Say Y here if you intend to attach an AT&T/Lucent Wavelan PCMCIA
- (PC-card) wireless Ethernet networking card to your computer. This
- driver is for the non-IEEE-802.11 Wavelan cards.
-
- To compile this driver as a module, choose M here: the module will be
- called wavelan_cs. If unsure, say N.
-
-config PCMCIA_NETWAVE
- tristate "Xircom Netwave AirSurfer Pcmcia wireless support"
- depends on PCMCIA && WLAN_PRE80211
- select WIRELESS_EXT
- select WEXT_PRIV
- help
- Say Y here if you intend to attach this type of PCMCIA (PC-card)
- wireless Ethernet networking card to your computer.
-
- To compile this driver as a module, choose M here: the module will be
- called netwave_cs. If unsure, say N.
-
-
-menuconfig WLAN_80211
- bool "Wireless LAN (IEEE 802.11)"
- depends on NETDEVICES
- ---help---
- Say Y if you have any 802.11 wireless LAN hardware.
-
- This option does not affect the kernel build, it only
- lets you choose drivers.
-
config PCMCIA_RAYCS
tristate "Aviator/Raytheon 2.4GHz wireless support"
- depends on PCMCIA && WLAN_80211
+ depends on PCMCIA
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
@@ -142,7 +33,7 @@ config PCMCIA_RAYCS
config LIBERTAS_THINFIRM
tristate "Marvell 8xxx Libertas WLAN driver support with thin firmware"
- depends on WLAN_80211 && MAC80211
+ depends on MAC80211
select FW_LOADER
---help---
A library for Marvell Libertas 8xxx devices using thinfirm.
@@ -155,7 +46,7 @@ config LIBERTAS_THINFIRM_USB
config AIRO
tristate "Cisco/Aironet 34X/35X/4500/4800 ISA and PCI cards"
- depends on ISA_DMA_API && WLAN_80211 && (PCI || BROKEN)
+ depends on ISA_DMA_API && (PCI || BROKEN)
select WIRELESS_EXT
select CRYPTO
select WEXT_SPY
@@ -175,7 +66,7 @@ config AIRO
config ATMEL
tristate "Atmel at76c50x chipset 802.11b support"
- depends on (PCI || PCMCIA) && WLAN_80211
+ depends on (PCI || PCMCIA)
select WIRELESS_EXT
select WEXT_PRIV
select FW_LOADER
@@ -210,7 +101,7 @@ config PCMCIA_ATMEL
config AT76C50X_USB
tristate "Atmel at76c503/at76c505/at76c505a USB cards"
- depends on MAC80211 && WLAN_80211 && USB
+ depends on MAC80211 && USB
select FW_LOADER
---help---
Enable support for USB Wireless devices using Atmel at76c503,
@@ -218,7 +109,7 @@ config AT76C50X_USB
config AIRO_CS
tristate "Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards"
- depends on PCMCIA && (BROKEN || !M32R) && WLAN_80211
+ depends on PCMCIA && (BROKEN || !M32R)
select WIRELESS_EXT
select CRYPTO
select CRYPTO_AES
@@ -238,7 +129,7 @@ config AIRO_CS
config PCMCIA_WL3501
tristate "Planet WL3501 PCMCIA cards"
- depends on EXPERIMENTAL && PCMCIA && WLAN_80211
+ depends on EXPERIMENTAL && PCMCIA
select WIRELESS_EXT
select WEXT_SPY
help
@@ -248,7 +139,7 @@ config PCMCIA_WL3501
config PRISM54
tristate 'Intersil Prism GT/Duette/Indigo PCI/Cardbus (DEPRECATED)'
- depends on PCI && EXPERIMENTAL && WLAN_80211
+ depends on PCI && EXPERIMENTAL
select WIRELESS_EXT
select WEXT_SPY
select WEXT_PRIV
@@ -272,7 +163,7 @@ config PRISM54
config USB_ZD1201
tristate "USB ZD1201 based Wireless device support"
- depends on USB && WLAN_80211
+ depends on USB
select WIRELESS_EXT
select WEXT_PRIV
select FW_LOADER
@@ -291,7 +182,7 @@ config USB_ZD1201
config USB_NET_RNDIS_WLAN
tristate "Wireless RNDIS USB support"
- depends on USB && WLAN_80211 && EXPERIMENTAL
+ depends on USB && EXPERIMENTAL
depends on CFG80211
select USB_USBNET
select USB_NET_CDCETHER
@@ -319,7 +210,7 @@ config USB_NET_RNDIS_WLAN
config RTL8180
tristate "Realtek 8180/8185 PCI support"
- depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL
+ depends on MAC80211 && PCI && EXPERIMENTAL
select EEPROM_93CX6
---help---
This is a driver for RTL8180 and RTL8185 based cards.
@@ -375,7 +266,7 @@ config RTL8180
config RTL8187
tristate "Realtek 8187 and 8187B USB support"
- depends on MAC80211 && USB && WLAN_80211
+ depends on MAC80211 && USB
select EEPROM_93CX6
---help---
This is a driver for RTL8187 and RTL8187B based cards.
@@ -404,7 +295,7 @@ config RTL8187_LEDS
config ADM8211
tristate "ADMtek ADM8211 support"
- depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL
+ depends on MAC80211 && PCI && EXPERIMENTAL
select CRC32
select EEPROM_93CX6
---help---
@@ -431,7 +322,7 @@ config ADM8211
config MAC80211_HWSIM
tristate "Simulated radio testing tool for mac80211"
- depends on MAC80211 && WLAN_80211
+ depends on MAC80211
---help---
This driver is a developer testing tool that can be used to test
IEEE 802.11 networking stack (mac80211) functionality. This is not
@@ -444,7 +335,7 @@ config MAC80211_HWSIM
config MWL8K
tristate "Marvell 88W8xxx PCI/PCIe Wireless support"
- depends on MAC80211 && PCI && WLAN_80211 && EXPERIMENTAL
+ depends on MAC80211 && PCI && EXPERIMENTAL
---help---
This driver supports Marvell TOPDOG 802.11 wireless cards.
diff --git a/drivers/net/wireless/Makefile b/drivers/net/wireless/Makefile
index 7a4647e78fd3..5d4ce4d2b32b 100644
--- a/drivers/net/wireless/Makefile
+++ b/drivers/net/wireless/Makefile
@@ -5,16 +5,6 @@
obj-$(CONFIG_IPW2100) += ipw2x00/
obj-$(CONFIG_IPW2200) += ipw2x00/
-obj-$(CONFIG_STRIP) += strip.o
-obj-$(CONFIG_ARLAN) += arlan.o
-
-arlan-objs := arlan-main.o arlan-proc.o
-
-# Obsolete cards
-obj-$(CONFIG_WAVELAN) += wavelan.o
-obj-$(CONFIG_PCMCIA_NETWAVE) += netwave_cs.o
-obj-$(CONFIG_PCMCIA_WAVELAN) += wavelan_cs.o
-
obj-$(CONFIG_HERMES) += orinoco/
obj-$(CONFIG_AIRO) += airo.o
diff --git a/drivers/net/wireless/libertas/Kconfig b/drivers/net/wireless/libertas/Kconfig
index 8f8d75b61ea9..30aa9d48d67e 100644
--- a/drivers/net/wireless/libertas/Kconfig
+++ b/drivers/net/wireless/libertas/Kconfig
@@ -1,6 +1,6 @@
config LIBERTAS
tristate "Marvell 8xxx Libertas WLAN driver support"
- depends on WLAN_80211 && CFG80211
+ depends on CFG80211
select WIRELESS_EXT
select WEXT_SPY
select LIB80211
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 7df3ba4f1f4d..5dccf6bfb0f9 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -65,8 +65,6 @@ source "drivers/staging/rt2860/Kconfig"
source "drivers/staging/rt2870/Kconfig"
-source "drivers/staging/rt3090/Kconfig"
-
source "drivers/staging/comedi/Kconfig"
source "drivers/staging/asus_oled/Kconfig"
@@ -85,16 +83,12 @@ source "drivers/staging/mimio/Kconfig"
source "drivers/staging/frontier/Kconfig"
-source "drivers/staging/android/Kconfig"
-
source "drivers/staging/dream/Kconfig"
source "drivers/staging/dst/Kconfig"
source "drivers/staging/pohmelfs/Kconfig"
-source "drivers/staging/stlc45xx/Kconfig"
-
source "drivers/staging/b3dfg/Kconfig"
source "drivers/staging/phison/Kconfig"
@@ -127,5 +121,19 @@ source "drivers/staging/sep/Kconfig"
source "drivers/staging/iio/Kconfig"
+source "drivers/staging/ramzswap/Kconfig"
+
+source "drivers/staging/wlags49_h2/Kconfig"
+
+source "drivers/staging/wlags49_h25/Kconfig"
+
+source "drivers/staging/strip/Kconfig"
+
+source "drivers/staging/arlan/Kconfig"
+
+source "drivers/staging/wavelan/Kconfig"
+
+source "drivers/staging/netwave/Kconfig"
+
endif # !STAGING_EXCLUDE_BUILD
endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 747571172269..94d771b72cfb 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -15,7 +15,6 @@ obj-$(CONFIG_POCH) += poch/
obj-$(CONFIG_OTUS) += otus/
obj-$(CONFIG_RT2860) += rt2860/
obj-$(CONFIG_RT2870) += rt2870/
-obj-$(CONFIG_RT3090) += rt3090/
obj-$(CONFIG_COMEDI) += comedi/
obj-$(CONFIG_ASUS_OLED) += asus_oled/
obj-$(CONFIG_PANEL) += panel/
@@ -25,11 +24,9 @@ obj-$(CONFIG_RTL8192SU) += rtl8192su/
obj-$(CONFIG_RTL8192E) += rtl8192e/
obj-$(CONFIG_INPUT_MIMIO) += mimio/
obj-$(CONFIG_TRANZPORT) += frontier/
-obj-$(CONFIG_ANDROID) += android/
-obj-$(CONFIG_ANDROID) += dream/
+obj-$(CONFIG_DREAM) += dream/
obj-$(CONFIG_DST) += dst/
obj-$(CONFIG_POHMELFS) += pohmelfs/
-obj-$(CONFIG_STLC45XX) += stlc45xx/
obj-$(CONFIG_B3DFG) += b3dfg/
obj-$(CONFIG_IDE_PHISON) += phison/
obj-$(CONFIG_PLAN9AUTH) += p9auth/
@@ -45,3 +42,11 @@ obj-$(CONFIG_VME_BUS) += vme/
obj-$(CONFIG_RAR_REGISTER) += rar/
obj-$(CONFIG_DX_SEP) += sep/
obj-$(CONFIG_IIO) += iio/
+obj-$(CONFIG_RAMZSWAP) += ramzswap/
+obj-$(CONFIG_WLAGS49_H2) += wlags49_h2/
+obj-$(CONFIG_WLAGS49_H25) += wlags49_h25/
+obj-$(CONFIG_STRIP) += strip/
+obj-$(CONFIG_ARLAN) += arlan/
+obj-$(CONFIG_WAVELAN) += wavelan/
+obj-$(CONFIG_PCMCIA_WAVELAN) += wavelan/
+obj-$(CONFIG_PCMCIA_NETWAVE) += netwave/
diff --git a/drivers/staging/android/Kconfig b/drivers/staging/android/Kconfig
deleted file mode 100644
index 247194992374..000000000000
--- a/drivers/staging/android/Kconfig
+++ /dev/null
@@ -1,95 +0,0 @@
-menu "Android"
-
-config ANDROID
- bool "Android Drivers"
- default N
- ---help---
- Enable support for various drivers needed on the Android platform
-
-if ANDROID
-
-config ANDROID_BINDER_IPC
- bool "Android Binder IPC Driver"
- default n
-
-config ANDROID_LOGGER
- tristate "Android log driver"
- default n
-
-config ANDROID_RAM_CONSOLE
- bool "Android RAM buffer console"
- default n
-
-config ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
- bool "Enable verbose console messages on Android RAM console"
- default y
- depends on ANDROID_RAM_CONSOLE
-
-menuconfig ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- bool "Android RAM Console Enable error correction"
- default n
- depends on ANDROID_RAM_CONSOLE
- depends on !ANDROID_RAM_CONSOLE_EARLY_INIT
- select REED_SOLOMON
- select REED_SOLOMON_ENC8
- select REED_SOLOMON_DEC8
-
-if ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-
-config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE
- int "Android RAM Console Data data size"
- default 128
- help
- Must be a power of 2.
-
-config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE
- int "Android RAM Console ECC size"
- default 16
-
-config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE
- int "Android RAM Console Symbol size"
- default 8
-
-config ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL
- hex "Android RAM Console Polynomial"
- default 0x19 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 4)
- default 0x29 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 5)
- default 0x61 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 6)
- default 0x89 if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 7)
- default 0x11d if (ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE = 8)
-
-endif # ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-
-config ANDROID_RAM_CONSOLE_EARLY_INIT
- bool "Start Android RAM console early"
- default n
- depends on ANDROID_RAM_CONSOLE
-
-config ANDROID_RAM_CONSOLE_EARLY_ADDR
- hex "Android RAM console virtual address"
- default 0
- depends on ANDROID_RAM_CONSOLE_EARLY_INIT
-
-config ANDROID_RAM_CONSOLE_EARLY_SIZE
- hex "Android RAM console buffer size"
- default 0
- depends on ANDROID_RAM_CONSOLE_EARLY_INIT
-
-config ANDROID_TIMED_OUTPUT
- bool "Timed output class driver"
- default y
-
-config ANDROID_TIMED_GPIO
- tristate "Android timed gpio driver"
- depends on GENERIC_GPIO && ANDROID_TIMED_OUTPUT
- default n
-
-config ANDROID_LOW_MEMORY_KILLER
- bool "Android Low Memory Killer"
- default N
- ---help---
- Register processes to be killed when memory is low
-
-endif # if ANDROID
-
-endmenu
diff --git a/drivers/staging/android/Makefile b/drivers/staging/android/Makefile
deleted file mode 100644
index 8e057e626d11..000000000000
--- a/drivers/staging/android/Makefile
+++ /dev/null
@@ -1,6 +0,0 @@
-obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o
-obj-$(CONFIG_ANDROID_LOGGER) += logger.o
-obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
-obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
-obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
-obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
diff --git a/drivers/staging/android/TODO b/drivers/staging/android/TODO
deleted file mode 100644
index e59c5be4be2b..000000000000
--- a/drivers/staging/android/TODO
+++ /dev/null
@@ -1,10 +0,0 @@
-TODO:
- - checkpatch.pl cleanups
- - sparse fixes
- - rename files to be not so "generic"
- - make sure things build as modules properly
- - add proper arch dependancies as needed
- - audit userspace interfaces to make sure they are sane
-
-Please send patches to Greg Kroah-Hartman <greg@kroah.com> and Cc:
-Brian Swetland <swetland@google.com>
diff --git a/drivers/staging/android/binder.c b/drivers/staging/android/binder.c
deleted file mode 100644
index 99010d4b3044..000000000000
--- a/drivers/staging/android/binder.c
+++ /dev/null
@@ -1,3767 +0,0 @@
-/* binder.c
- *
- * Android IPC Subsystem
- *
- * Copyright (C) 2007-2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <asm/cacheflush.h>
-#include <linux/fdtable.h>
-#include <linux/file.h>
-#include <linux/fs.h>
-#include <linux/list.h>
-#include <linux/miscdevice.h>
-#include <linux/mm.h>
-#include <linux/module.h>
-#include <linux/mutex.h>
-#include <linux/nsproxy.h>
-#include <linux/poll.h>
-#include <linux/proc_fs.h>
-#include <linux/rbtree.h>
-#include <linux/sched.h>
-#include <linux/uaccess.h>
-#include <linux/vmalloc.h>
-
-#include "binder.h"
-
-static DEFINE_MUTEX(binder_lock);
-static DEFINE_MUTEX(binder_deferred_lock);
-
-static HLIST_HEAD(binder_procs);
-static HLIST_HEAD(binder_deferred_list);
-static HLIST_HEAD(binder_dead_nodes);
-
-static struct proc_dir_entry *binder_proc_dir_entry_root;
-static struct proc_dir_entry *binder_proc_dir_entry_proc;
-static struct binder_node *binder_context_mgr_node;
-static uid_t binder_context_mgr_uid = -1;
-static int binder_last_id;
-
-static int binder_read_proc_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data);
-
-/* This is only defined in include/asm-arm/sizes.h */
-#ifndef SZ_1K
-#define SZ_1K 0x400
-#endif
-
-#ifndef SZ_4M
-#define SZ_4M 0x400000
-#endif
-
-#define FORBIDDEN_MMAP_FLAGS (VM_WRITE)
-
-#define BINDER_SMALL_BUF_SIZE (PAGE_SIZE * 64)
-
-enum {
- BINDER_DEBUG_USER_ERROR = 1U << 0,
- BINDER_DEBUG_FAILED_TRANSACTION = 1U << 1,
- BINDER_DEBUG_DEAD_TRANSACTION = 1U << 2,
- BINDER_DEBUG_OPEN_CLOSE = 1U << 3,
- BINDER_DEBUG_DEAD_BINDER = 1U << 4,
- BINDER_DEBUG_DEATH_NOTIFICATION = 1U << 5,
- BINDER_DEBUG_READ_WRITE = 1U << 6,
- BINDER_DEBUG_USER_REFS = 1U << 7,
- BINDER_DEBUG_THREADS = 1U << 8,
- BINDER_DEBUG_TRANSACTION = 1U << 9,
- BINDER_DEBUG_TRANSACTION_COMPLETE = 1U << 10,
- BINDER_DEBUG_FREE_BUFFER = 1U << 11,
- BINDER_DEBUG_INTERNAL_REFS = 1U << 12,
- BINDER_DEBUG_BUFFER_ALLOC = 1U << 13,
- BINDER_DEBUG_PRIORITY_CAP = 1U << 14,
- BINDER_DEBUG_BUFFER_ALLOC_ASYNC = 1U << 15,
-};
-static uint32_t binder_debug_mask = BINDER_DEBUG_USER_ERROR |
- BINDER_DEBUG_FAILED_TRANSACTION | BINDER_DEBUG_DEAD_TRANSACTION;
-module_param_named(debug_mask, binder_debug_mask, uint, S_IWUSR | S_IRUGO);
-
-static int binder_debug_no_lock;
-module_param_named(proc_no_lock, binder_debug_no_lock, bool, S_IWUSR | S_IRUGO);
-
-static DECLARE_WAIT_QUEUE_HEAD(binder_user_error_wait);
-static int binder_stop_on_user_error;
-
-static int binder_set_stop_on_user_error(const char *val,
- struct kernel_param *kp)
-{
- int ret;
- ret = param_set_int(val, kp);
- if (binder_stop_on_user_error < 2)
- wake_up(&binder_user_error_wait);
- return ret;
-}
-module_param_call(stop_on_user_error, binder_set_stop_on_user_error,
- param_get_int, &binder_stop_on_user_error, S_IWUSR | S_IRUGO);
-
-#define binder_debug(mask, x...) \
- do { \
- if (binder_debug_mask & mask) \
- printk(KERN_INFO x); \
- } while (0)
-
-#define binder_user_error(x...) \
- do { \
- if (binder_debug_mask & BINDER_DEBUG_USER_ERROR) \
- printk(KERN_INFO x); \
- if (binder_stop_on_user_error) \
- binder_stop_on_user_error = 2; \
- } while (0)
-
-enum binder_stat_types {
- BINDER_STAT_PROC,
- BINDER_STAT_THREAD,
- BINDER_STAT_NODE,
- BINDER_STAT_REF,
- BINDER_STAT_DEATH,
- BINDER_STAT_TRANSACTION,
- BINDER_STAT_TRANSACTION_COMPLETE,
- BINDER_STAT_COUNT
-};
-
-struct binder_stats {
- int br[_IOC_NR(BR_FAILED_REPLY) + 1];
- int bc[_IOC_NR(BC_DEAD_BINDER_DONE) + 1];
- int obj_created[BINDER_STAT_COUNT];
- int obj_deleted[BINDER_STAT_COUNT];
-};
-
-static struct binder_stats binder_stats;
-
-static inline void binder_stats_deleted(enum binder_stat_types type)
-{
- binder_stats.obj_deleted[type]++;
-}
-
-static inline void binder_stats_created(enum binder_stat_types type)
-{
- binder_stats.obj_created[type]++;
-}
-
-struct binder_transaction_log_entry {
- int debug_id;
- int call_type;
- int from_proc;
- int from_thread;
- int target_handle;
- int to_proc;
- int to_thread;
- int to_node;
- int data_size;
- int offsets_size;
-};
-struct binder_transaction_log {
- int next;
- int full;
- struct binder_transaction_log_entry entry[32];
-};
-static struct binder_transaction_log binder_transaction_log;
-static struct binder_transaction_log binder_transaction_log_failed;
-
-static struct binder_transaction_log_entry *binder_transaction_log_add(
- struct binder_transaction_log *log)
-{
- struct binder_transaction_log_entry *e;
- e = &log->entry[log->next];
- memset(e, 0, sizeof(*e));
- log->next++;
- if (log->next == ARRAY_SIZE(log->entry)) {
- log->next = 0;
- log->full = 1;
- }
- return e;
-}
-
-struct binder_work {
- struct list_head entry;
- enum {
- BINDER_WORK_TRANSACTION = 1,
- BINDER_WORK_TRANSACTION_COMPLETE,
- BINDER_WORK_NODE,
- BINDER_WORK_DEAD_BINDER,
- BINDER_WORK_DEAD_BINDER_AND_CLEAR,
- BINDER_WORK_CLEAR_DEATH_NOTIFICATION,
- } type;
-};
-
-struct binder_node {
- int debug_id;
- struct binder_work work;
- union {
- struct rb_node rb_node;
- struct hlist_node dead_node;
- };
- struct binder_proc *proc;
- struct hlist_head refs;
- int internal_strong_refs;
- int local_weak_refs;
- int local_strong_refs;
- void __user *ptr;
- void __user *cookie;
- unsigned has_strong_ref:1;
- unsigned pending_strong_ref:1;
- unsigned has_weak_ref:1;
- unsigned pending_weak_ref:1;
- unsigned has_async_transaction:1;
- unsigned accept_fds:1;
- unsigned min_priority:8;
- struct list_head async_todo;
-};
-
-struct binder_ref_death {
- struct binder_work work;
- void __user *cookie;
-};
-
-struct binder_ref {
- /* Lookups needed: */
- /* node + proc => ref (transaction) */
- /* desc + proc => ref (transaction, inc/dec ref) */
- /* node => refs + procs (proc exit) */
- int debug_id;
- struct rb_node rb_node_desc;
- struct rb_node rb_node_node;
- struct hlist_node node_entry;
- struct binder_proc *proc;
- struct binder_node *node;
- uint32_t desc;
- int strong;
- int weak;
- struct binder_ref_death *death;
-};
-
-struct binder_buffer {
- struct list_head entry; /* free and allocated entries by addesss */
- struct rb_node rb_node; /* free entry by size or allocated entry */
- /* by address */
- unsigned free:1;
- unsigned allow_user_free:1;
- unsigned async_transaction:1;
- unsigned debug_id:29;
-
- struct binder_transaction *transaction;
-
- struct binder_node *target_node;
- size_t data_size;
- size_t offsets_size;
- uint8_t data[0];
-};
-
-enum binder_deferred_state {
- BINDER_DEFERRED_PUT_FILES = 0x01,
- BINDER_DEFERRED_FLUSH = 0x02,
- BINDER_DEFERRED_RELEASE = 0x04,
-};
-
-struct binder_proc {
- struct hlist_node proc_node;
- struct rb_root threads;
- struct rb_root nodes;
- struct rb_root refs_by_desc;
- struct rb_root refs_by_node;
- int pid;
- struct vm_area_struct *vma;
- struct task_struct *tsk;
- struct files_struct *files;
- struct hlist_node deferred_work_node;
- int deferred_work;
- void *buffer;
- ptrdiff_t user_buffer_offset;
-
- struct list_head buffers;
- struct rb_root free_buffers;
- struct rb_root allocated_buffers;
- size_t free_async_space;
-
- struct page **pages;
- size_t buffer_size;
- uint32_t buffer_free;
- struct list_head todo;
- wait_queue_head_t wait;
- struct binder_stats stats;
- struct list_head delivered_death;
- int max_threads;
- int requested_threads;
- int requested_threads_started;
- int ready_threads;
- long default_priority;
-};
-
-enum {
- BINDER_LOOPER_STATE_REGISTERED = 0x01,
- BINDER_LOOPER_STATE_ENTERED = 0x02,
- BINDER_LOOPER_STATE_EXITED = 0x04,
- BINDER_LOOPER_STATE_INVALID = 0x08,
- BINDER_LOOPER_STATE_WAITING = 0x10,
- BINDER_LOOPER_STATE_NEED_RETURN = 0x20
-};
-
-struct binder_thread {
- struct binder_proc *proc;
- struct rb_node rb_node;
- int pid;
- int looper;
- struct binder_transaction *transaction_stack;
- struct list_head todo;
- uint32_t return_error; /* Write failed, return error code in read buf */
- uint32_t return_error2; /* Write failed, return error code in read */
- /* buffer. Used when sending a reply to a dead process that */
- /* we are also waiting on */
- wait_queue_head_t wait;
- struct binder_stats stats;
-};
-
-struct binder_transaction {
- int debug_id;
- struct binder_work work;
- struct binder_thread *from;
- struct binder_transaction *from_parent;
- struct binder_proc *to_proc;
- struct binder_thread *to_thread;
- struct binder_transaction *to_parent;
- unsigned need_reply:1;
- /* unsigned is_dead:1; */ /* not used at the moment */
-
- struct binder_buffer *buffer;
- unsigned int code;
- unsigned int flags;
- long priority;
- long saved_priority;
- uid_t sender_euid;
-};
-
-static void
-binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
-
-/*
- * copied from get_unused_fd_flags
- */
-int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
-{
- struct files_struct *files = proc->files;
- int fd, error;
- struct fdtable *fdt;
- unsigned long rlim_cur;
- unsigned long irqs;
-
- if (files == NULL)
- return -ESRCH;
-
- error = -EMFILE;
- spin_lock(&files->file_lock);
-
-repeat:
- fdt = files_fdtable(files);
- fd = find_next_zero_bit(fdt->open_fds->fds_bits, fdt->max_fds,
- files->next_fd);
-
- /*
- * N.B. For clone tasks sharing a files structure, this test
- * will limit the total number of files that can be opened.
- */
- rlim_cur = 0;
- if (lock_task_sighand(proc->tsk, &irqs)) {
- rlim_cur = proc->tsk->signal->rlim[RLIMIT_NOFILE].rlim_cur;
- unlock_task_sighand(proc->tsk, &irqs);
- }
- if (fd >= rlim_cur)
- goto out;
-
- /* Do we need to expand the fd array or fd set? */
- error = expand_files(files, fd);
- if (error < 0)
- goto out;
-
- if (error) {
- /*
- * If we needed to expand the fs array we
- * might have blocked - try again.
- */
- error = -EMFILE;
- goto repeat;
- }
-
- FD_SET(fd, fdt->open_fds);
- if (flags & O_CLOEXEC)
- FD_SET(fd, fdt->close_on_exec);
- else
- FD_CLR(fd, fdt->close_on_exec);
- files->next_fd = fd + 1;
-#if 1
- /* Sanity check */
- if (fdt->fd[fd] != NULL) {
- printk(KERN_WARNING "get_unused_fd: slot %d not NULL!\n", fd);
- fdt->fd[fd] = NULL;
- }
-#endif
- error = fd;
-
-out:
- spin_unlock(&files->file_lock);
- return error;
-}
-
-/*
- * copied from fd_install
- */
-static void task_fd_install(
- struct binder_proc *proc, unsigned int fd, struct file *file)
-{
- struct files_struct *files = proc->files;
- struct fdtable *fdt;
-
- if (files == NULL)
- return;
-
- spin_lock(&files->file_lock);
- fdt = files_fdtable(files);
- BUG_ON(fdt->fd[fd] != NULL);
- rcu_assign_pointer(fdt->fd[fd], file);
- spin_unlock(&files->file_lock);
-}
-
-/*
- * copied from __put_unused_fd in open.c
- */
-static void __put_unused_fd(struct files_struct *files, unsigned int fd)
-{
- struct fdtable *fdt = files_fdtable(files);
- __FD_CLR(fd, fdt->open_fds);
- if (fd < files->next_fd)
- files->next_fd = fd;
-}
-
-/*
- * copied from sys_close
- */
-static long task_close_fd(struct binder_proc *proc, unsigned int fd)
-{
- struct file *filp;
- struct files_struct *files = proc->files;
- struct fdtable *fdt;
- int retval;
-
- if (files == NULL)
- return -ESRCH;
-
- spin_lock(&files->file_lock);
- fdt = files_fdtable(files);
- if (fd >= fdt->max_fds)
- goto out_unlock;
- filp = fdt->fd[fd];
- if (!filp)
- goto out_unlock;
- rcu_assign_pointer(fdt->fd[fd], NULL);
- FD_CLR(fd, fdt->close_on_exec);
- __put_unused_fd(files, fd);
- spin_unlock(&files->file_lock);
- retval = filp_close(filp, files);
-
- /* can't restart close syscall because file table entry was cleared */
- if (unlikely(retval == -ERESTARTSYS ||
- retval == -ERESTARTNOINTR ||
- retval == -ERESTARTNOHAND ||
- retval == -ERESTART_RESTARTBLOCK))
- retval = -EINTR;
-
- return retval;
-
-out_unlock:
- spin_unlock(&files->file_lock);
- return -EBADF;
-}
-
-static void binder_set_nice(long nice)
-{
- long min_nice;
- if (can_nice(current, nice)) {
- set_user_nice(current, nice);
- return;
- }
- min_nice = 20 - current->signal->rlim[RLIMIT_NICE].rlim_cur;
- binder_debug(BINDER_DEBUG_PRIORITY_CAP,
- "binder: %d: nice value %ld not allowed use "
- "%ld instead\n", current->pid, nice, min_nice);
- set_user_nice(current, min_nice);
- if (min_nice < 20)
- return;
- binder_user_error("binder: %d RLIMIT_NICE not set\n", current->pid);
-}
-
-static size_t binder_buffer_size(struct binder_proc *proc,
- struct binder_buffer *buffer)
-{
- if (list_is_last(&buffer->entry, &proc->buffers))
- return proc->buffer + proc->buffer_size - (void *)buffer->data;
- else
- return (size_t)list_entry(buffer->entry.next,
- struct binder_buffer, entry) - (size_t)buffer->data;
-}
-
-static void binder_insert_free_buffer(struct binder_proc *proc,
- struct binder_buffer *new_buffer)
-{
- struct rb_node **p = &proc->free_buffers.rb_node;
- struct rb_node *parent = NULL;
- struct binder_buffer *buffer;
- size_t buffer_size;
- size_t new_buffer_size;
-
- BUG_ON(!new_buffer->free);
-
- new_buffer_size = binder_buffer_size(proc, new_buffer);
-
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: add free buffer, size %zd, "
- "at %p\n", proc->pid, new_buffer_size, new_buffer);
-
- while (*p) {
- parent = *p;
- buffer = rb_entry(parent, struct binder_buffer, rb_node);
- BUG_ON(!buffer->free);
-
- buffer_size = binder_buffer_size(proc, buffer);
-
- if (new_buffer_size < buffer_size)
- p = &parent->rb_left;
- else
- p = &parent->rb_right;
- }
- rb_link_node(&new_buffer->rb_node, parent, p);
- rb_insert_color(&new_buffer->rb_node, &proc->free_buffers);
-}
-
-static void binder_insert_allocated_buffer(struct binder_proc *proc,
- struct binder_buffer *new_buffer)
-{
- struct rb_node **p = &proc->allocated_buffers.rb_node;
- struct rb_node *parent = NULL;
- struct binder_buffer *buffer;
-
- BUG_ON(new_buffer->free);
-
- while (*p) {
- parent = *p;
- buffer = rb_entry(parent, struct binder_buffer, rb_node);
- BUG_ON(buffer->free);
-
- if (new_buffer < buffer)
- p = &parent->rb_left;
- else if (new_buffer > buffer)
- p = &parent->rb_right;
- else
- BUG();
- }
- rb_link_node(&new_buffer->rb_node, parent, p);
- rb_insert_color(&new_buffer->rb_node, &proc->allocated_buffers);
-}
-
-static struct binder_buffer *binder_buffer_lookup(struct binder_proc *proc,
- void __user *user_ptr)
-{
- struct rb_node *n = proc->allocated_buffers.rb_node;
- struct binder_buffer *buffer;
- struct binder_buffer *kern_ptr;
-
- kern_ptr = user_ptr - proc->user_buffer_offset
- - offsetof(struct binder_buffer, data);
-
- while (n) {
- buffer = rb_entry(n, struct binder_buffer, rb_node);
- BUG_ON(buffer->free);
-
- if (kern_ptr < buffer)
- n = n->rb_left;
- else if (kern_ptr > buffer)
- n = n->rb_right;
- else
- return buffer;
- }
- return NULL;
-}
-
-static int binder_update_page_range(struct binder_proc *proc, int allocate,
- void *start, void *end,
- struct vm_area_struct *vma)
-{
- void *page_addr;
- unsigned long user_page_addr;
- struct vm_struct tmp_area;
- struct page **page;
- struct mm_struct *mm;
-
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: %s pages %p-%p\n", proc->pid,
- allocate ? "allocate" : "free", start, end);
-
- if (end <= start)
- return 0;
-
- if (vma)
- mm = NULL;
- else
- mm = get_task_mm(proc->tsk);
-
- if (mm) {
- down_write(&mm->mmap_sem);
- vma = proc->vma;
- }
-
- if (allocate == 0)
- goto free_range;
-
- if (vma == NULL) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf failed to "
- "map pages in userspace, no vma\n", proc->pid);
- goto err_no_vma;
- }
-
- for (page_addr = start; page_addr < end; page_addr += PAGE_SIZE) {
- int ret;
- struct page **page_array_ptr;
- page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE];
-
- BUG_ON(*page);
- *page = alloc_page(GFP_KERNEL | __GFP_ZERO);
- if (*page == NULL) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
- "for page at %p\n", proc->pid, page_addr);
- goto err_alloc_page_failed;
- }
- tmp_area.addr = page_addr;
- tmp_area.size = PAGE_SIZE + PAGE_SIZE /* guard page? */;
- page_array_ptr = page;
- ret = map_vm_area(&tmp_area, PAGE_KERNEL, &page_array_ptr);
- if (ret) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
- "to map page at %p in kernel\n",
- proc->pid, page_addr);
- goto err_map_kernel_failed;
- }
- user_page_addr =
- (uintptr_t)page_addr + proc->user_buffer_offset;
- ret = vm_insert_page(vma, user_page_addr, page[0]);
- if (ret) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf failed "
- "to map page at %lx in userspace\n",
- proc->pid, user_page_addr);
- goto err_vm_insert_page_failed;
- }
- /* vm_insert_page does not seem to increment the refcount */
- }
- if (mm) {
- up_write(&mm->mmap_sem);
- mmput(mm);
- }
- return 0;
-
-free_range:
- for (page_addr = end - PAGE_SIZE; page_addr >= start;
- page_addr -= PAGE_SIZE) {
- page = &proc->pages[(page_addr - proc->buffer) / PAGE_SIZE];
- if (vma)
- zap_page_range(vma, (uintptr_t)page_addr +
- proc->user_buffer_offset, PAGE_SIZE, NULL);
-err_vm_insert_page_failed:
- unmap_kernel_range((unsigned long)page_addr, PAGE_SIZE);
-err_map_kernel_failed:
- __free_page(*page);
- *page = NULL;
-err_alloc_page_failed:
- ;
- }
-err_no_vma:
- if (mm) {
- up_write(&mm->mmap_sem);
- mmput(mm);
- }
- return -ENOMEM;
-}
-
-static struct binder_buffer *binder_alloc_buf(struct binder_proc *proc,
- size_t data_size,
- size_t offsets_size, int is_async)
-{
- struct rb_node *n = proc->free_buffers.rb_node;
- struct binder_buffer *buffer;
- size_t buffer_size;
- struct rb_node *best_fit = NULL;
- void *has_page_addr;
- void *end_page_addr;
- size_t size;
-
- if (proc->vma == NULL) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf, no vma\n",
- proc->pid);
- return NULL;
- }
-
- size = ALIGN(data_size, sizeof(void *)) +
- ALIGN(offsets_size, sizeof(void *));
-
- if (size < data_size || size < offsets_size) {
- binder_user_error("binder: %d: got transaction with invalid "
- "size %zd-%zd\n", proc->pid, data_size, offsets_size);
- return NULL;
- }
-
- if (is_async &&
- proc->free_async_space < size + sizeof(struct binder_buffer)) {
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: binder_alloc_buf size %zd"
- "failed, no async space left\n", proc->pid, size);
- return NULL;
- }
-
- while (n) {
- buffer = rb_entry(n, struct binder_buffer, rb_node);
- BUG_ON(!buffer->free);
- buffer_size = binder_buffer_size(proc, buffer);
-
- if (size < buffer_size) {
- best_fit = n;
- n = n->rb_left;
- } else if (size > buffer_size)
- n = n->rb_right;
- else {
- best_fit = n;
- break;
- }
- }
- if (best_fit == NULL) {
- printk(KERN_ERR "binder: %d: binder_alloc_buf size %zd failed, "
- "no address space\n", proc->pid, size);
- return NULL;
- }
- if (n == NULL) {
- buffer = rb_entry(best_fit, struct binder_buffer, rb_node);
- buffer_size = binder_buffer_size(proc, buffer);
- }
-
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: binder_alloc_buf size %zd got buff"
- "er %p size %zd\n", proc->pid, size, buffer, buffer_size);
-
- has_page_addr =
- (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK);
- if (n == NULL) {
- if (size + sizeof(struct binder_buffer) + 4 >= buffer_size)
- buffer_size = size; /* no room for other buffers */
- else
- buffer_size = size + sizeof(struct binder_buffer);
- }
- end_page_addr =
- (void *)PAGE_ALIGN((uintptr_t)buffer->data + buffer_size);
- if (end_page_addr > has_page_addr)
- end_page_addr = has_page_addr;
- if (binder_update_page_range(proc, 1,
- (void *)PAGE_ALIGN((uintptr_t)buffer->data), end_page_addr, NULL))
- return NULL;
-
- rb_erase(best_fit, &proc->free_buffers);
- buffer->free = 0;
- binder_insert_allocated_buffer(proc, buffer);
- if (buffer_size != size) {
- struct binder_buffer *new_buffer = (void *)buffer->data + size;
- list_add(&new_buffer->entry, &buffer->entry);
- new_buffer->free = 1;
- binder_insert_free_buffer(proc, new_buffer);
- }
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: binder_alloc_buf size %zd got "
- "%p\n", proc->pid, size, buffer);
- buffer->data_size = data_size;
- buffer->offsets_size = offsets_size;
- buffer->async_transaction = is_async;
- if (is_async) {
- proc->free_async_space -= size + sizeof(struct binder_buffer);
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
- "binder: %d: binder_alloc_buf size %zd "
- "async free %zd\n", proc->pid, size,
- proc->free_async_space);
- }
-
- return buffer;
-}
-
-static void *buffer_start_page(struct binder_buffer *buffer)
-{
- return (void *)((uintptr_t)buffer & PAGE_MASK);
-}
-
-static void *buffer_end_page(struct binder_buffer *buffer)
-{
- return (void *)(((uintptr_t)(buffer + 1) - 1) & PAGE_MASK);
-}
-
-static void binder_delete_free_buffer(struct binder_proc *proc,
- struct binder_buffer *buffer)
-{
- struct binder_buffer *prev, *next = NULL;
- int free_page_end = 1;
- int free_page_start = 1;
-
- BUG_ON(proc->buffers.next == &buffer->entry);
- prev = list_entry(buffer->entry.prev, struct binder_buffer, entry);
- BUG_ON(!prev->free);
- if (buffer_end_page(prev) == buffer_start_page(buffer)) {
- free_page_start = 0;
- if (buffer_end_page(prev) == buffer_end_page(buffer))
- free_page_end = 0;
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: merge free, buffer %p "
- "share page with %p\n", proc->pid, buffer, prev);
- }
-
- if (!list_is_last(&buffer->entry, &proc->buffers)) {
- next = list_entry(buffer->entry.next,
- struct binder_buffer, entry);
- if (buffer_start_page(next) == buffer_end_page(buffer)) {
- free_page_end = 0;
- if (buffer_start_page(next) ==
- buffer_start_page(buffer))
- free_page_start = 0;
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: merge free, buffer"
- " %p share page with %p\n", proc->pid,
- buffer, prev);
- }
- }
- list_del(&buffer->entry);
- if (free_page_start || free_page_end) {
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: merge free, buffer %p do "
- "not share page%s%s with with %p or %p\n",
- proc->pid, buffer, free_page_start ? "" : " end",
- free_page_end ? "" : " start", prev, next);
- binder_update_page_range(proc, 0, free_page_start ?
- buffer_start_page(buffer) : buffer_end_page(buffer),
- (free_page_end ? buffer_end_page(buffer) :
- buffer_start_page(buffer)) + PAGE_SIZE, NULL);
- }
-}
-
-static void binder_free_buf(struct binder_proc *proc,
- struct binder_buffer *buffer)
-{
- size_t size, buffer_size;
-
- buffer_size = binder_buffer_size(proc, buffer);
-
- size = ALIGN(buffer->data_size, sizeof(void *)) +
- ALIGN(buffer->offsets_size, sizeof(void *));
-
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder: %d: binder_free_buf %p size %zd buffer"
- "_size %zd\n", proc->pid, buffer, size, buffer_size);
-
- BUG_ON(buffer->free);
- BUG_ON(size > buffer_size);
- BUG_ON(buffer->transaction != NULL);
- BUG_ON((void *)buffer < proc->buffer);
- BUG_ON((void *)buffer > proc->buffer + proc->buffer_size);
-
- if (buffer->async_transaction) {
- proc->free_async_space += size + sizeof(struct binder_buffer);
-
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC_ASYNC,
- "binder: %d: binder_free_buf size %zd "
- "async free %zd\n", proc->pid, size,
- proc->free_async_space);
- }
-
- binder_update_page_range(proc, 0,
- (void *)PAGE_ALIGN((uintptr_t)buffer->data),
- (void *)(((uintptr_t)buffer->data + buffer_size) & PAGE_MASK),
- NULL);
- rb_erase(&buffer->rb_node, &proc->allocated_buffers);
- buffer->free = 1;
- if (!list_is_last(&buffer->entry, &proc->buffers)) {
- struct binder_buffer *next = list_entry(buffer->entry.next,
- struct binder_buffer, entry);
- if (next->free) {
- rb_erase(&next->rb_node, &proc->free_buffers);
- binder_delete_free_buffer(proc, next);
- }
- }
- if (proc->buffers.next != &buffer->entry) {
- struct binder_buffer *prev = list_entry(buffer->entry.prev,
- struct binder_buffer, entry);
- if (prev->free) {
- binder_delete_free_buffer(proc, buffer);
- rb_erase(&prev->rb_node, &proc->free_buffers);
- buffer = prev;
- }
- }
- binder_insert_free_buffer(proc, buffer);
-}
-
-static struct binder_node *binder_get_node(struct binder_proc *proc,
- void __user *ptr)
-{
- struct rb_node *n = proc->nodes.rb_node;
- struct binder_node *node;
-
- while (n) {
- node = rb_entry(n, struct binder_node, rb_node);
-
- if (ptr < node->ptr)
- n = n->rb_left;
- else if (ptr > node->ptr)
- n = n->rb_right;
- else
- return node;
- }
- return NULL;
-}
-
-static struct binder_node *binder_new_node(struct binder_proc *proc,
- void __user *ptr,
- void __user *cookie)
-{
- struct rb_node **p = &proc->nodes.rb_node;
- struct rb_node *parent = NULL;
- struct binder_node *node;
-
- while (*p) {
- parent = *p;
- node = rb_entry(parent, struct binder_node, rb_node);
-
- if (ptr < node->ptr)
- p = &(*p)->rb_left;
- else if (ptr > node->ptr)
- p = &(*p)->rb_right;
- else
- return NULL;
- }
-
- node = kzalloc(sizeof(*node), GFP_KERNEL);
- if (node == NULL)
- return NULL;
- binder_stats_created(BINDER_STAT_NODE);
- rb_link_node(&node->rb_node, parent, p);
- rb_insert_color(&node->rb_node, &proc->nodes);
- node->debug_id = ++binder_last_id;
- node->proc = proc;
- node->ptr = ptr;
- node->cookie = cookie;
- node->work.type = BINDER_WORK_NODE;
- INIT_LIST_HEAD(&node->work.entry);
- INIT_LIST_HEAD(&node->async_todo);
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d:%d node %d u%p c%p created\n",
- proc->pid, current->pid, node->debug_id,
- node->ptr, node->cookie);
- return node;
-}
-
-static int binder_inc_node(struct binder_node *node, int strong, int internal,
- struct list_head *target_list)
-{
- if (strong) {
- if (internal) {
- if (target_list == NULL &&
- node->internal_strong_refs == 0 &&
- !(node == binder_context_mgr_node &&
- node->has_strong_ref)) {
- printk(KERN_ERR "binder: invalid inc strong "
- "node for %d\n", node->debug_id);
- return -EINVAL;
- }
- node->internal_strong_refs++;
- } else
- node->local_strong_refs++;
- if (!node->has_strong_ref && target_list) {
- list_del_init(&node->work.entry);
- list_add_tail(&node->work.entry, target_list);
- }
- } else {
- if (!internal)
- node->local_weak_refs++;
- if (!node->has_weak_ref && list_empty(&node->work.entry)) {
- if (target_list == NULL) {
- printk(KERN_ERR "binder: invalid inc weak node "
- "for %d\n", node->debug_id);
- return -EINVAL;
- }
- list_add_tail(&node->work.entry, target_list);
- }
- }
- return 0;
-}
-
-static int binder_dec_node(struct binder_node *node, int strong, int internal)
-{
- if (strong) {
- if (internal)
- node->internal_strong_refs--;
- else
- node->local_strong_refs--;
- if (node->local_strong_refs || node->internal_strong_refs)
- return 0;
- } else {
- if (!internal)
- node->local_weak_refs--;
- if (node->local_weak_refs || !hlist_empty(&node->refs))
- return 0;
- }
- if (node->proc && (node->has_strong_ref || node->has_weak_ref)) {
- if (list_empty(&node->work.entry)) {
- list_add_tail(&node->work.entry, &node->proc->todo);
- wake_up_interruptible(&node->proc->wait);
- }
- } else {
- if (hlist_empty(&node->refs) && !node->local_strong_refs &&
- !node->local_weak_refs) {
- list_del_init(&node->work.entry);
- if (node->proc) {
- rb_erase(&node->rb_node, &node->proc->nodes);
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: refless node %d deleted\n",
- node->debug_id);
- } else {
- hlist_del(&node->dead_node);
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: dead node %d deleted\n",
- node->debug_id);
- }
- kfree(node);
- binder_stats_deleted(BINDER_STAT_NODE);
- }
- }
-
- return 0;
-}
-
-
-static struct binder_ref *binder_get_ref(struct binder_proc *proc,
- uint32_t desc)
-{
- struct rb_node *n = proc->refs_by_desc.rb_node;
- struct binder_ref *ref;
-
- while (n) {
- ref = rb_entry(n, struct binder_ref, rb_node_desc);
-
- if (desc < ref->desc)
- n = n->rb_left;
- else if (desc > ref->desc)
- n = n->rb_right;
- else
- return ref;
- }
- return NULL;
-}
-
-static struct binder_ref *binder_get_ref_for_node(struct binder_proc *proc,
- struct binder_node *node)
-{
- struct rb_node *n;
- struct rb_node **p = &proc->refs_by_node.rb_node;
- struct rb_node *parent = NULL;
- struct binder_ref *ref, *new_ref;
-
- while (*p) {
- parent = *p;
- ref = rb_entry(parent, struct binder_ref, rb_node_node);
-
- if (node < ref->node)
- p = &(*p)->rb_left;
- else if (node > ref->node)
- p = &(*p)->rb_right;
- else
- return ref;
- }
- new_ref = kzalloc(sizeof(*ref), GFP_KERNEL);
- if (new_ref == NULL)
- return NULL;
- binder_stats_created(BINDER_STAT_REF);
- new_ref->debug_id = ++binder_last_id;
- new_ref->proc = proc;
- new_ref->node = node;
- rb_link_node(&new_ref->rb_node_node, parent, p);
- rb_insert_color(&new_ref->rb_node_node, &proc->refs_by_node);
-
- new_ref->desc = (node == binder_context_mgr_node) ? 0 : 1;
- for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) {
- ref = rb_entry(n, struct binder_ref, rb_node_desc);
- if (ref->desc > new_ref->desc)
- break;
- new_ref->desc = ref->desc + 1;
- }
-
- p = &proc->refs_by_desc.rb_node;
- while (*p) {
- parent = *p;
- ref = rb_entry(parent, struct binder_ref, rb_node_desc);
-
- if (new_ref->desc < ref->desc)
- p = &(*p)->rb_left;
- else if (new_ref->desc > ref->desc)
- p = &(*p)->rb_right;
- else
- BUG();
- }
- rb_link_node(&new_ref->rb_node_desc, parent, p);
- rb_insert_color(&new_ref->rb_node_desc, &proc->refs_by_desc);
- if (node) {
- hlist_add_head(&new_ref->node_entry, &node->refs);
-
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d new ref %d desc %d for "
- "node %d\n", proc->pid, new_ref->debug_id,
- new_ref->desc, node->debug_id);
- } else {
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d new ref %d desc %d for "
- "dead node\n", proc->pid, new_ref->debug_id,
- new_ref->desc);
- }
- return new_ref;
-}
-
-static void binder_delete_ref(struct binder_ref *ref)
-{
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d delete ref %d desc %d for "
- "node %d\n", ref->proc->pid, ref->debug_id,
- ref->desc, ref->node->debug_id);
-
- rb_erase(&ref->rb_node_desc, &ref->proc->refs_by_desc);
- rb_erase(&ref->rb_node_node, &ref->proc->refs_by_node);
- if (ref->strong)
- binder_dec_node(ref->node, 1, 1);
- hlist_del(&ref->node_entry);
- binder_dec_node(ref->node, 0, 1);
- if (ref->death) {
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder: %d delete ref %d desc %d "
- "has death notification\n", ref->proc->pid,
- ref->debug_id, ref->desc);
- list_del(&ref->death->work.entry);
- kfree(ref->death);
- binder_stats_deleted(BINDER_STAT_DEATH);
- }
- kfree(ref);
- binder_stats_deleted(BINDER_STAT_REF);
-}
-
-static int binder_inc_ref(struct binder_ref *ref, int strong,
- struct list_head *target_list)
-{
- int ret;
- if (strong) {
- if (ref->strong == 0) {
- ret = binder_inc_node(ref->node, 1, 1, target_list);
- if (ret)
- return ret;
- }
- ref->strong++;
- } else {
- if (ref->weak == 0) {
- ret = binder_inc_node(ref->node, 0, 1, target_list);
- if (ret)
- return ret;
- }
- ref->weak++;
- }
- return 0;
-}
-
-
-static int binder_dec_ref(struct binder_ref *ref, int strong)
-{
- if (strong) {
- if (ref->strong == 0) {
- binder_user_error("binder: %d invalid dec strong, "
- "ref %d desc %d s %d w %d\n",
- ref->proc->pid, ref->debug_id,
- ref->desc, ref->strong, ref->weak);
- return -EINVAL;
- }
- ref->strong--;
- if (ref->strong == 0) {
- int ret;
- ret = binder_dec_node(ref->node, strong, 1);
- if (ret)
- return ret;
- }
- } else {
- if (ref->weak == 0) {
- binder_user_error("binder: %d invalid dec weak, "
- "ref %d desc %d s %d w %d\n",
- ref->proc->pid, ref->debug_id,
- ref->desc, ref->strong, ref->weak);
- return -EINVAL;
- }
- ref->weak--;
- }
- if (ref->strong == 0 && ref->weak == 0)
- binder_delete_ref(ref);
- return 0;
-}
-
-static void binder_pop_transaction(struct binder_thread *target_thread,
- struct binder_transaction *t)
-{
- if (target_thread) {
- BUG_ON(target_thread->transaction_stack != t);
- BUG_ON(target_thread->transaction_stack->from != target_thread);
- target_thread->transaction_stack =
- target_thread->transaction_stack->from_parent;
- t->from = NULL;
- }
- t->need_reply = 0;
- if (t->buffer)
- t->buffer->transaction = NULL;
- kfree(t);
- binder_stats_deleted(BINDER_STAT_TRANSACTION);
-}
-
-static void binder_send_failed_reply(struct binder_transaction *t,
- uint32_t error_code)
-{
- struct binder_thread *target_thread;
- BUG_ON(t->flags & TF_ONE_WAY);
- while (1) {
- target_thread = t->from;
- if (target_thread) {
- if (target_thread->return_error != BR_OK &&
- target_thread->return_error2 == BR_OK) {
- target_thread->return_error2 =
- target_thread->return_error;
- target_thread->return_error = BR_OK;
- }
- if (target_thread->return_error == BR_OK) {
- binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
- "binder: send failed reply for "
- "transaction %d to %d:%d\n",
- t->debug_id, target_thread->proc->pid,
- target_thread->pid);
-
- binder_pop_transaction(target_thread, t);
- target_thread->return_error = error_code;
- wake_up_interruptible(&target_thread->wait);
- } else {
- printk(KERN_ERR "binder: reply failed, target "
- "thread, %d:%d, has error code %d "
- "already\n", target_thread->proc->pid,
- target_thread->pid,
- target_thread->return_error);
- }
- return;
- } else {
- struct binder_transaction *next = t->from_parent;
-
- binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
- "binder: send failed reply "
- "for transaction %d, target dead\n",
- t->debug_id);
-
- binder_pop_transaction(target_thread, t);
- if (next == NULL) {
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder: reply failed,"
- " no target thread at root\n");
- return;
- }
- t = next;
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder: reply failed, no target "
- "thread -- retry %d\n", t->debug_id);
- }
- }
-}
-
-static void binder_transaction_buffer_release(struct binder_proc *proc,
- struct binder_buffer *buffer,
- size_t *failed_at)
-{
- size_t *offp, *off_end;
- int debug_id = buffer->debug_id;
-
- binder_debug(BINDER_DEBUG_TRANSACTION,
- "binder: %d buffer release %d, size %zd-%zd, failed at %p\n",
- proc->pid, buffer->debug_id,
- buffer->data_size, buffer->offsets_size, failed_at);
-
- if (buffer->target_node)
- binder_dec_node(buffer->target_node, 1, 0);
-
- offp = (size_t *)(buffer->data + ALIGN(buffer->data_size, sizeof(void *)));
- if (failed_at)
- off_end = failed_at;
- else
- off_end = (void *)offp + buffer->offsets_size;
- for (; offp < off_end; offp++) {
- struct flat_binder_object *fp;
- if (*offp > buffer->data_size - sizeof(*fp) ||
- buffer->data_size < sizeof(*fp) ||
- !IS_ALIGNED(*offp, sizeof(void *))) {
- printk(KERN_ERR "binder: transaction release %d bad"
- "offset %zd, size %zd\n", debug_id,
- *offp, buffer->data_size);
- continue;
- }
- fp = (struct flat_binder_object *)(buffer->data + *offp);
- switch (fp->type) {
- case BINDER_TYPE_BINDER:
- case BINDER_TYPE_WEAK_BINDER: {
- struct binder_node *node = binder_get_node(proc, fp->binder);
- if (node == NULL) {
- printk(KERN_ERR "binder: transaction release %d"
- " bad node %p\n", debug_id, fp->binder);
- break;
- }
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " node %d u%p\n",
- node->debug_id, node->ptr);
- binder_dec_node(node, fp->type == BINDER_TYPE_BINDER, 0);
- } break;
- case BINDER_TYPE_HANDLE:
- case BINDER_TYPE_WEAK_HANDLE: {
- struct binder_ref *ref = binder_get_ref(proc, fp->handle);
- if (ref == NULL) {
- printk(KERN_ERR "binder: transaction release %d"
- " bad handle %ld\n", debug_id,
- fp->handle);
- break;
- }
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " ref %d desc %d (node %d)\n",
- ref->debug_id, ref->desc, ref->node->debug_id);
- binder_dec_ref(ref, fp->type == BINDER_TYPE_HANDLE);
- } break;
-
- case BINDER_TYPE_FD:
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " fd %ld\n", fp->handle);
- if (failed_at)
- task_close_fd(proc, fp->handle);
- break;
-
- default:
- printk(KERN_ERR "binder: transaction release %d bad "
- "object type %lx\n", debug_id, fp->type);
- break;
- }
- }
-}
-
-static void binder_transaction(struct binder_proc *proc,
- struct binder_thread *thread,
- struct binder_transaction_data *tr, int reply)
-{
- struct binder_transaction *t;
- struct binder_work *tcomplete;
- size_t *offp, *off_end;
- struct binder_proc *target_proc;
- struct binder_thread *target_thread = NULL;
- struct binder_node *target_node = NULL;
- struct list_head *target_list;
- wait_queue_head_t *target_wait;
- struct binder_transaction *in_reply_to = NULL;
- struct binder_transaction_log_entry *e;
- uint32_t return_error;
-
- e = binder_transaction_log_add(&binder_transaction_log);
- e->call_type = reply ? 2 : !!(tr->flags & TF_ONE_WAY);
- e->from_proc = proc->pid;
- e->from_thread = thread->pid;
- e->target_handle = tr->target.handle;
- e->data_size = tr->data_size;
- e->offsets_size = tr->offsets_size;
-
- if (reply) {
- in_reply_to = thread->transaction_stack;
- if (in_reply_to == NULL) {
- binder_user_error("binder: %d:%d got reply transaction "
- "with no transaction stack\n",
- proc->pid, thread->pid);
- return_error = BR_FAILED_REPLY;
- goto err_empty_call_stack;
- }
- binder_set_nice(in_reply_to->saved_priority);
- if (in_reply_to->to_thread != thread) {
- binder_user_error("binder: %d:%d got reply transaction "
- "with bad transaction stack,"
- " transaction %d has target %d:%d\n",
- proc->pid, thread->pid, in_reply_to->debug_id,
- in_reply_to->to_proc ?
- in_reply_to->to_proc->pid : 0,
- in_reply_to->to_thread ?
- in_reply_to->to_thread->pid : 0);
- return_error = BR_FAILED_REPLY;
- in_reply_to = NULL;
- goto err_bad_call_stack;
- }
- thread->transaction_stack = in_reply_to->to_parent;
- target_thread = in_reply_to->from;
- if (target_thread == NULL) {
- return_error = BR_DEAD_REPLY;
- goto err_dead_binder;
- }
- if (target_thread->transaction_stack != in_reply_to) {
- binder_user_error("binder: %d:%d got reply transaction "
- "with bad target transaction stack %d, "
- "expected %d\n",
- proc->pid, thread->pid,
- target_thread->transaction_stack ?
- target_thread->transaction_stack->debug_id : 0,
- in_reply_to->debug_id);
- return_error = BR_FAILED_REPLY;
- in_reply_to = NULL;
- target_thread = NULL;
- goto err_dead_binder;
- }
- target_proc = target_thread->proc;
- } else {
- if (tr->target.handle) {
- struct binder_ref *ref;
- ref = binder_get_ref(proc, tr->target.handle);
- if (ref == NULL) {
- binder_user_error("binder: %d:%d got "
- "transaction to invalid handle\n",
- proc->pid, thread->pid);
- return_error = BR_FAILED_REPLY;
- goto err_invalid_target_handle;
- }
- target_node = ref->node;
- } else {
- target_node = binder_context_mgr_node;
- if (target_node == NULL) {
- return_error = BR_DEAD_REPLY;
- goto err_no_context_mgr_node;
- }
- }
- e->to_node = target_node->debug_id;
- target_proc = target_node->proc;
- if (target_proc == NULL) {
- return_error = BR_DEAD_REPLY;
- goto err_dead_binder;
- }
- if (!(tr->flags & TF_ONE_WAY) && thread->transaction_stack) {
- struct binder_transaction *tmp;
- tmp = thread->transaction_stack;
- if (tmp->to_thread != thread) {
- binder_user_error("binder: %d:%d got new "
- "transaction with bad transaction stack"
- ", transaction %d has target %d:%d\n",
- proc->pid, thread->pid, tmp->debug_id,
- tmp->to_proc ? tmp->to_proc->pid : 0,
- tmp->to_thread ?
- tmp->to_thread->pid : 0);
- return_error = BR_FAILED_REPLY;
- goto err_bad_call_stack;
- }
- while (tmp) {
- if (tmp->from && tmp->from->proc == target_proc)
- target_thread = tmp->from;
- tmp = tmp->from_parent;
- }
- }
- }
- if (target_thread) {
- e->to_thread = target_thread->pid;
- target_list = &target_thread->todo;
- target_wait = &target_thread->wait;
- } else {
- target_list = &target_proc->todo;
- target_wait = &target_proc->wait;
- }
- e->to_proc = target_proc->pid;
-
- /* TODO: reuse incoming transaction for reply */
- t = kzalloc(sizeof(*t), GFP_KERNEL);
- if (t == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_alloc_t_failed;
- }
- binder_stats_created(BINDER_STAT_TRANSACTION);
-
- tcomplete = kzalloc(sizeof(*tcomplete), GFP_KERNEL);
- if (tcomplete == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_alloc_tcomplete_failed;
- }
- binder_stats_created(BINDER_STAT_TRANSACTION_COMPLETE);
-
- t->debug_id = ++binder_last_id;
- e->debug_id = t->debug_id;
-
- if (reply)
- binder_debug(BINDER_DEBUG_TRANSACTION,
- "binder: %d:%d BC_REPLY %d -> %d:%d, "
- "data %p-%p size %zd-%zd\n",
- proc->pid, thread->pid, t->debug_id,
- target_proc->pid, target_thread->pid,
- tr->data.ptr.buffer, tr->data.ptr.offsets,
- tr->data_size, tr->offsets_size);
- else
- binder_debug(BINDER_DEBUG_TRANSACTION,
- "binder: %d:%d BC_TRANSACTION %d -> "
- "%d - node %d, data %p-%p size %zd-%zd\n",
- proc->pid, thread->pid, t->debug_id,
- target_proc->pid, target_node->debug_id,
- tr->data.ptr.buffer, tr->data.ptr.offsets,
- tr->data_size, tr->offsets_size);
-
- if (!reply && !(tr->flags & TF_ONE_WAY))
- t->from = thread;
- else
- t->from = NULL;
- t->sender_euid = proc->tsk->cred->euid;
- t->to_proc = target_proc;
- t->to_thread = target_thread;
- t->code = tr->code;
- t->flags = tr->flags;
- t->priority = task_nice(current);
- t->buffer = binder_alloc_buf(target_proc, tr->data_size,
- tr->offsets_size, !reply && (t->flags & TF_ONE_WAY));
- if (t->buffer == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_binder_alloc_buf_failed;
- }
- t->buffer->allow_user_free = 0;
- t->buffer->debug_id = t->debug_id;
- t->buffer->transaction = t;
- t->buffer->target_node = target_node;
- if (target_node)
- binder_inc_node(target_node, 1, 0, NULL);
-
- offp = (size_t *)(t->buffer->data + ALIGN(tr->data_size, sizeof(void *)));
-
- if (copy_from_user(t->buffer->data, tr->data.ptr.buffer, tr->data_size)) {
- binder_user_error("binder: %d:%d got transaction with invalid "
- "data ptr\n", proc->pid, thread->pid);
- return_error = BR_FAILED_REPLY;
- goto err_copy_data_failed;
- }
- if (copy_from_user(offp, tr->data.ptr.offsets, tr->offsets_size)) {
- binder_user_error("binder: %d:%d got transaction with invalid "
- "offsets ptr\n", proc->pid, thread->pid);
- return_error = BR_FAILED_REPLY;
- goto err_copy_data_failed;
- }
- if (!IS_ALIGNED(tr->offsets_size, sizeof(size_t))) {
- binder_user_error("binder: %d:%d got transaction with "
- "invalid offsets size, %zd\n",
- proc->pid, thread->pid, tr->offsets_size);
- return_error = BR_FAILED_REPLY;
- goto err_bad_offset;
- }
- off_end = (void *)offp + tr->offsets_size;
- for (; offp < off_end; offp++) {
- struct flat_binder_object *fp;
- if (*offp > t->buffer->data_size - sizeof(*fp) ||
- t->buffer->data_size < sizeof(*fp) ||
- !IS_ALIGNED(*offp, sizeof(void *))) {
- binder_user_error("binder: %d:%d got transaction with "
- "invalid offset, %zd\n",
- proc->pid, thread->pid, *offp);
- return_error = BR_FAILED_REPLY;
- goto err_bad_offset;
- }
- fp = (struct flat_binder_object *)(t->buffer->data + *offp);
- switch (fp->type) {
- case BINDER_TYPE_BINDER:
- case BINDER_TYPE_WEAK_BINDER: {
- struct binder_ref *ref;
- struct binder_node *node = binder_get_node(proc, fp->binder);
- if (node == NULL) {
- node = binder_new_node(proc, fp->binder, fp->cookie);
- if (node == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_binder_new_node_failed;
- }
- node->min_priority = fp->flags & FLAT_BINDER_FLAG_PRIORITY_MASK;
- node->accept_fds = !!(fp->flags & FLAT_BINDER_FLAG_ACCEPTS_FDS);
- }
- if (fp->cookie != node->cookie) {
- binder_user_error("binder: %d:%d sending u%p "
- "node %d, cookie mismatch %p != %p\n",
- proc->pid, thread->pid,
- fp->binder, node->debug_id,
- fp->cookie, node->cookie);
- goto err_binder_get_ref_for_node_failed;
- }
- ref = binder_get_ref_for_node(target_proc, node);
- if (ref == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_binder_get_ref_for_node_failed;
- }
- if (fp->type == BINDER_TYPE_BINDER)
- fp->type = BINDER_TYPE_HANDLE;
- else
- fp->type = BINDER_TYPE_WEAK_HANDLE;
- fp->handle = ref->desc;
- binder_inc_ref(ref, fp->type == BINDER_TYPE_HANDLE,
- &thread->todo);
-
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " node %d u%p -> ref %d desc %d\n",
- node->debug_id, node->ptr, ref->debug_id,
- ref->desc);
- } break;
- case BINDER_TYPE_HANDLE:
- case BINDER_TYPE_WEAK_HANDLE: {
- struct binder_ref *ref = binder_get_ref(proc, fp->handle);
- if (ref == NULL) {
- binder_user_error("binder: %d:%d got "
- "transaction with invalid "
- "handle, %ld\n", proc->pid,
- thread->pid, fp->handle);
- return_error = BR_FAILED_REPLY;
- goto err_binder_get_ref_failed;
- }
- if (ref->node->proc == target_proc) {
- if (fp->type == BINDER_TYPE_HANDLE)
- fp->type = BINDER_TYPE_BINDER;
- else
- fp->type = BINDER_TYPE_WEAK_BINDER;
- fp->binder = ref->node->ptr;
- fp->cookie = ref->node->cookie;
- binder_inc_node(ref->node, fp->type == BINDER_TYPE_BINDER, 0, NULL);
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " ref %d desc %d -> node %d u%p\n",
- ref->debug_id, ref->desc, ref->node->debug_id,
- ref->node->ptr);
- } else {
- struct binder_ref *new_ref;
- new_ref = binder_get_ref_for_node(target_proc, ref->node);
- if (new_ref == NULL) {
- return_error = BR_FAILED_REPLY;
- goto err_binder_get_ref_for_node_failed;
- }
- fp->handle = new_ref->desc;
- binder_inc_ref(new_ref, fp->type == BINDER_TYPE_HANDLE, NULL);
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " ref %d desc %d -> ref %d desc %d (node %d)\n",
- ref->debug_id, ref->desc, new_ref->debug_id,
- new_ref->desc, ref->node->debug_id);
- }
- } break;
-
- case BINDER_TYPE_FD: {
- int target_fd;
- struct file *file;
-
- if (reply) {
- if (!(in_reply_to->flags & TF_ACCEPT_FDS)) {
- binder_user_error("binder: %d:%d got reply with fd, %ld, but target does not allow fds\n",
- proc->pid, thread->pid, fp->handle);
- return_error = BR_FAILED_REPLY;
- goto err_fd_not_allowed;
- }
- } else if (!target_node->accept_fds) {
- binder_user_error("binder: %d:%d got transaction with fd, %ld, but target does not allow fds\n",
- proc->pid, thread->pid, fp->handle);
- return_error = BR_FAILED_REPLY;
- goto err_fd_not_allowed;
- }
-
- file = fget(fp->handle);
- if (file == NULL) {
- binder_user_error("binder: %d:%d got transaction with invalid fd, %ld\n",
- proc->pid, thread->pid, fp->handle);
- return_error = BR_FAILED_REPLY;
- goto err_fget_failed;
- }
- target_fd = task_get_unused_fd_flags(target_proc, O_CLOEXEC);
- if (target_fd < 0) {
- fput(file);
- return_error = BR_FAILED_REPLY;
- goto err_get_unused_fd_failed;
- }
- task_fd_install(target_proc, target_fd, file);
- binder_debug(BINDER_DEBUG_TRANSACTION,
- " fd %ld -> %d\n", fp->handle, target_fd);
- /* TODO: fput? */
- fp->handle = target_fd;
- } break;
-
- default:
- binder_user_error("binder: %d:%d got transactio"
- "n with invalid object type, %lx\n",
- proc->pid, thread->pid, fp->type);
- return_error = BR_FAILED_REPLY;
- goto err_bad_object_type;
- }
- }
- if (reply) {
- BUG_ON(t->buffer->async_transaction != 0);
- binder_pop_transaction(target_thread, in_reply_to);
- } else if (!(t->flags & TF_ONE_WAY)) {
- BUG_ON(t->buffer->async_transaction != 0);
- t->need_reply = 1;
- t->from_parent = thread->transaction_stack;
- thread->transaction_stack = t;
- } else {
- BUG_ON(target_node == NULL);
- BUG_ON(t->buffer->async_transaction != 1);
- if (target_node->has_async_transaction) {
- target_list = &target_node->async_todo;
- target_wait = NULL;
- } else
- target_node->has_async_transaction = 1;
- }
- t->work.type = BINDER_WORK_TRANSACTION;
- list_add_tail(&t->work.entry, target_list);
- tcomplete->type = BINDER_WORK_TRANSACTION_COMPLETE;
- list_add_tail(&tcomplete->entry, &thread->todo);
- if (target_wait)
- wake_up_interruptible(target_wait);
- return;
-
-err_get_unused_fd_failed:
-err_fget_failed:
-err_fd_not_allowed:
-err_binder_get_ref_for_node_failed:
-err_binder_get_ref_failed:
-err_binder_new_node_failed:
-err_bad_object_type:
-err_bad_offset:
-err_copy_data_failed:
- binder_transaction_buffer_release(target_proc, t->buffer, offp);
- t->buffer->transaction = NULL;
- binder_free_buf(target_proc, t->buffer);
-err_binder_alloc_buf_failed:
- kfree(tcomplete);
- binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
-err_alloc_tcomplete_failed:
- kfree(t);
- binder_stats_deleted(BINDER_STAT_TRANSACTION);
-err_alloc_t_failed:
-err_bad_call_stack:
-err_empty_call_stack:
-err_dead_binder:
-err_invalid_target_handle:
-err_no_context_mgr_node:
- binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
- "binder: %d:%d transaction failed %d, size %zd-%zd\n",
- proc->pid, thread->pid, return_error,
- tr->data_size, tr->offsets_size);
-
- {
- struct binder_transaction_log_entry *fe;
- fe = binder_transaction_log_add(&binder_transaction_log_failed);
- *fe = *e;
- }
-
- BUG_ON(thread->return_error != BR_OK);
- if (in_reply_to) {
- thread->return_error = BR_TRANSACTION_COMPLETE;
- binder_send_failed_reply(in_reply_to, return_error);
- } else
- thread->return_error = return_error;
-}
-
-int binder_thread_write(struct binder_proc *proc, struct binder_thread *thread,
- void __user *buffer, int size, signed long *consumed)
-{
- uint32_t cmd;
- void __user *ptr = buffer + *consumed;
- void __user *end = buffer + size;
-
- while (ptr < end && thread->return_error == BR_OK) {
- if (get_user(cmd, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (_IOC_NR(cmd) < ARRAY_SIZE(binder_stats.bc)) {
- binder_stats.bc[_IOC_NR(cmd)]++;
- proc->stats.bc[_IOC_NR(cmd)]++;
- thread->stats.bc[_IOC_NR(cmd)]++;
- }
- switch (cmd) {
- case BC_INCREFS:
- case BC_ACQUIRE:
- case BC_RELEASE:
- case BC_DECREFS: {
- uint32_t target;
- struct binder_ref *ref;
- const char *debug_string;
-
- if (get_user(target, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (target == 0 && binder_context_mgr_node &&
- (cmd == BC_INCREFS || cmd == BC_ACQUIRE)) {
- ref = binder_get_ref_for_node(proc,
- binder_context_mgr_node);
- if (ref->desc != target) {
- binder_user_error("binder: %d:"
- "%d tried to acquire "
- "reference to desc 0, "
- "got %d instead\n",
- proc->pid, thread->pid,
- ref->desc);
- }
- } else
- ref = binder_get_ref(proc, target);
- if (ref == NULL) {
- binder_user_error("binder: %d:%d refcou"
- "nt change on invalid ref %d\n",
- proc->pid, thread->pid, target);
- break;
- }
- switch (cmd) {
- case BC_INCREFS:
- debug_string = "IncRefs";
- binder_inc_ref(ref, 0, NULL);
- break;
- case BC_ACQUIRE:
- debug_string = "Acquire";
- binder_inc_ref(ref, 1, NULL);
- break;
- case BC_RELEASE:
- debug_string = "Release";
- binder_dec_ref(ref, 1);
- break;
- case BC_DECREFS:
- default:
- debug_string = "DecRefs";
- binder_dec_ref(ref, 0);
- break;
- }
- binder_debug(BINDER_DEBUG_USER_REFS,
- "binder: %d:%d %s ref %d desc %d s %d w %d for node %d\n",
- proc->pid, thread->pid, debug_string, ref->debug_id,
- ref->desc, ref->strong, ref->weak, ref->node->debug_id);
- break;
- }
- case BC_INCREFS_DONE:
- case BC_ACQUIRE_DONE: {
- void __user *node_ptr;
- void *cookie;
- struct binder_node *node;
-
- if (get_user(node_ptr, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
- if (get_user(cookie, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
- node = binder_get_node(proc, node_ptr);
- if (node == NULL) {
- binder_user_error("binder: %d:%d "
- "%s u%p no match\n",
- proc->pid, thread->pid,
- cmd == BC_INCREFS_DONE ?
- "BC_INCREFS_DONE" :
- "BC_ACQUIRE_DONE",
- node_ptr);
- break;
- }
- if (cookie != node->cookie) {
- binder_user_error("binder: %d:%d %s u%p node %d"
- " cookie mismatch %p != %p\n",
- proc->pid, thread->pid,
- cmd == BC_INCREFS_DONE ?
- "BC_INCREFS_DONE" : "BC_ACQUIRE_DONE",
- node_ptr, node->debug_id,
- cookie, node->cookie);
- break;
- }
- if (cmd == BC_ACQUIRE_DONE) {
- if (node->pending_strong_ref == 0) {
- binder_user_error("binder: %d:%d "
- "BC_ACQUIRE_DONE node %d has "
- "no pending acquire request\n",
- proc->pid, thread->pid,
- node->debug_id);
- break;
- }
- node->pending_strong_ref = 0;
- } else {
- if (node->pending_weak_ref == 0) {
- binder_user_error("binder: %d:%d "
- "BC_INCREFS_DONE node %d has "
- "no pending increfs request\n",
- proc->pid, thread->pid,
- node->debug_id);
- break;
- }
- node->pending_weak_ref = 0;
- }
- binder_dec_node(node, cmd == BC_ACQUIRE_DONE, 0);
- binder_debug(BINDER_DEBUG_USER_REFS,
- "binder: %d:%d %s node %d ls %d lw %d\n",
- proc->pid, thread->pid,
- cmd == BC_INCREFS_DONE ? "BC_INCREFS_DONE" : "BC_ACQUIRE_DONE",
- node->debug_id, node->local_strong_refs, node->local_weak_refs);
- break;
- }
- case BC_ATTEMPT_ACQUIRE:
- printk(KERN_ERR "binder: BC_ATTEMPT_ACQUIRE not supported\n");
- return -EINVAL;
- case BC_ACQUIRE_RESULT:
- printk(KERN_ERR "binder: BC_ACQUIRE_RESULT not supported\n");
- return -EINVAL;
-
- case BC_FREE_BUFFER: {
- void __user *data_ptr;
- struct binder_buffer *buffer;
-
- if (get_user(data_ptr, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
-
- buffer = binder_buffer_lookup(proc, data_ptr);
- if (buffer == NULL) {
- binder_user_error("binder: %d:%d "
- "BC_FREE_BUFFER u%p no match\n",
- proc->pid, thread->pid, data_ptr);
- break;
- }
- if (!buffer->allow_user_free) {
- binder_user_error("binder: %d:%d "
- "BC_FREE_BUFFER u%p matched "
- "unreturned buffer\n",
- proc->pid, thread->pid, data_ptr);
- break;
- }
- binder_debug(BINDER_DEBUG_FREE_BUFFER,
- "binder: %d:%d BC_FREE_BUFFER u%p found buffer %d for %s transaction\n",
- proc->pid, thread->pid, data_ptr, buffer->debug_id,
- buffer->transaction ? "active" : "finished");
-
- if (buffer->transaction) {
- buffer->transaction->buffer = NULL;
- buffer->transaction = NULL;
- }
- if (buffer->async_transaction && buffer->target_node) {
- BUG_ON(!buffer->target_node->has_async_transaction);
- if (list_empty(&buffer->target_node->async_todo))
- buffer->target_node->has_async_transaction = 0;
- else
- list_move_tail(buffer->target_node->async_todo.next, &thread->todo);
- }
- binder_transaction_buffer_release(proc, buffer, NULL);
- binder_free_buf(proc, buffer);
- break;
- }
-
- case BC_TRANSACTION:
- case BC_REPLY: {
- struct binder_transaction_data tr;
-
- if (copy_from_user(&tr, ptr, sizeof(tr)))
- return -EFAULT;
- ptr += sizeof(tr);
- binder_transaction(proc, thread, &tr, cmd == BC_REPLY);
- break;
- }
-
- case BC_REGISTER_LOOPER:
- binder_debug(BINDER_DEBUG_THREADS,
- "binder: %d:%d BC_REGISTER_LOOPER\n",
- proc->pid, thread->pid);
- if (thread->looper & BINDER_LOOPER_STATE_ENTERED) {
- thread->looper |= BINDER_LOOPER_STATE_INVALID;
- binder_user_error("binder: %d:%d ERROR:"
- " BC_REGISTER_LOOPER called "
- "after BC_ENTER_LOOPER\n",
- proc->pid, thread->pid);
- } else if (proc->requested_threads == 0) {
- thread->looper |= BINDER_LOOPER_STATE_INVALID;
- binder_user_error("binder: %d:%d ERROR:"
- " BC_REGISTER_LOOPER called "
- "without request\n",
- proc->pid, thread->pid);
- } else {
- proc->requested_threads--;
- proc->requested_threads_started++;
- }
- thread->looper |= BINDER_LOOPER_STATE_REGISTERED;
- break;
- case BC_ENTER_LOOPER:
- binder_debug(BINDER_DEBUG_THREADS,
- "binder: %d:%d BC_ENTER_LOOPER\n",
- proc->pid, thread->pid);
- if (thread->looper & BINDER_LOOPER_STATE_REGISTERED) {
- thread->looper |= BINDER_LOOPER_STATE_INVALID;
- binder_user_error("binder: %d:%d ERROR:"
- " BC_ENTER_LOOPER called after "
- "BC_REGISTER_LOOPER\n",
- proc->pid, thread->pid);
- }
- thread->looper |= BINDER_LOOPER_STATE_ENTERED;
- break;
- case BC_EXIT_LOOPER:
- binder_debug(BINDER_DEBUG_THREADS,
- "binder: %d:%d BC_EXIT_LOOPER\n",
- proc->pid, thread->pid);
- thread->looper |= BINDER_LOOPER_STATE_EXITED;
- break;
-
- case BC_REQUEST_DEATH_NOTIFICATION:
- case BC_CLEAR_DEATH_NOTIFICATION: {
- uint32_t target;
- void __user *cookie;
- struct binder_ref *ref;
- struct binder_ref_death *death;
-
- if (get_user(target, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (get_user(cookie, (void __user * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
- ref = binder_get_ref(proc, target);
- if (ref == NULL) {
- binder_user_error("binder: %d:%d %s "
- "invalid ref %d\n",
- proc->pid, thread->pid,
- cmd == BC_REQUEST_DEATH_NOTIFICATION ?
- "BC_REQUEST_DEATH_NOTIFICATION" :
- "BC_CLEAR_DEATH_NOTIFICATION",
- target);
- break;
- }
-
- binder_debug(BINDER_DEBUG_DEATH_NOTIFICATION,
- "binder: %d:%d %s %p ref %d desc %d s %d w %d for node %d\n",
- proc->pid, thread->pid,
- cmd == BC_REQUEST_DEATH_NOTIFICATION ?
- "BC_REQUEST_DEATH_NOTIFICATION" :
- "BC_CLEAR_DEATH_NOTIFICATION",
- cookie, ref->debug_id, ref->desc,
- ref->strong, ref->weak, ref->node->debug_id);
-
- if (cmd == BC_REQUEST_DEATH_NOTIFICATION) {
- if (ref->death) {
- binder_user_error("binder: %d:%"
- "d BC_REQUEST_DEATH_NOTI"
- "FICATION death notific"
- "ation already set\n",
- proc->pid, thread->pid);
- break;
- }
- death = kzalloc(sizeof(*death), GFP_KERNEL);
- if (death == NULL) {
- thread->return_error = BR_ERROR;
- binder_debug(BINDER_DEBUG_FAILED_TRANSACTION,
- "binder: %d:%d "
- "BC_REQUEST_DEATH_NOTIFICATION failed\n",
- proc->pid, thread->pid);
- break;
- }
- binder_stats_created(BINDER_STAT_DEATH);
- INIT_LIST_HEAD(&death->work.entry);
- death->cookie = cookie;
- ref->death = death;
- if (ref->node->proc == NULL) {
- ref->death->work.type = BINDER_WORK_DEAD_BINDER;
- if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
- list_add_tail(&ref->death->work.entry, &thread->todo);
- } else {
- list_add_tail(&ref->death->work.entry, &proc->todo);
- wake_up_interruptible(&proc->wait);
- }
- }
- } else {
- if (ref->death == NULL) {
- binder_user_error("binder: %d:%"
- "d BC_CLEAR_DEATH_NOTIFI"
- "CATION death notificat"
- "ion not active\n",
- proc->pid, thread->pid);
- break;
- }
- death = ref->death;
- if (death->cookie != cookie) {
- binder_user_error("binder: %d:%"
- "d BC_CLEAR_DEATH_NOTIFI"
- "CATION death notificat"
- "ion cookie mismatch "
- "%p != %p\n",
- proc->pid, thread->pid,
- death->cookie, cookie);
- break;
- }
- ref->death = NULL;
- if (list_empty(&death->work.entry)) {
- death->work.type = BINDER_WORK_CLEAR_DEATH_NOTIFICATION;
- if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
- list_add_tail(&death->work.entry, &thread->todo);
- } else {
- list_add_tail(&death->work.entry, &proc->todo);
- wake_up_interruptible(&proc->wait);
- }
- } else {
- BUG_ON(death->work.type != BINDER_WORK_DEAD_BINDER);
- death->work.type = BINDER_WORK_DEAD_BINDER_AND_CLEAR;
- }
- }
- } break;
- case BC_DEAD_BINDER_DONE: {
- struct binder_work *w;
- void __user *cookie;
- struct binder_ref_death *death = NULL;
- if (get_user(cookie, (void __user * __user *)ptr))
- return -EFAULT;
-
- ptr += sizeof(void *);
- list_for_each_entry(w, &proc->delivered_death, entry) {
- struct binder_ref_death *tmp_death = container_of(w, struct binder_ref_death, work);
- if (tmp_death->cookie == cookie) {
- death = tmp_death;
- break;
- }
- }
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder: %d:%d BC_DEAD_BINDER_DONE %p found %p\n",
- proc->pid, thread->pid, cookie, death);
- if (death == NULL) {
- binder_user_error("binder: %d:%d BC_DEAD"
- "_BINDER_DONE %p not found\n",
- proc->pid, thread->pid, cookie);
- break;
- }
-
- list_del_init(&death->work.entry);
- if (death->work.type == BINDER_WORK_DEAD_BINDER_AND_CLEAR) {
- death->work.type = BINDER_WORK_CLEAR_DEATH_NOTIFICATION;
- if (thread->looper & (BINDER_LOOPER_STATE_REGISTERED | BINDER_LOOPER_STATE_ENTERED)) {
- list_add_tail(&death->work.entry, &thread->todo);
- } else {
- list_add_tail(&death->work.entry, &proc->todo);
- wake_up_interruptible(&proc->wait);
- }
- }
- } break;
-
- default:
- printk(KERN_ERR "binder: %d:%d unknown command %d\n",
- proc->pid, thread->pid, cmd);
- return -EINVAL;
- }
- *consumed = ptr - buffer;
- }
- return 0;
-}
-
-void binder_stat_br(struct binder_proc *proc, struct binder_thread *thread,
- uint32_t cmd)
-{
- if (_IOC_NR(cmd) < ARRAY_SIZE(binder_stats.br)) {
- binder_stats.br[_IOC_NR(cmd)]++;
- proc->stats.br[_IOC_NR(cmd)]++;
- thread->stats.br[_IOC_NR(cmd)]++;
- }
-}
-
-static int binder_has_proc_work(struct binder_proc *proc,
- struct binder_thread *thread)
-{
- return !list_empty(&proc->todo) ||
- (thread->looper & BINDER_LOOPER_STATE_NEED_RETURN);
-}
-
-static int binder_has_thread_work(struct binder_thread *thread)
-{
- return !list_empty(&thread->todo) || thread->return_error != BR_OK ||
- (thread->looper & BINDER_LOOPER_STATE_NEED_RETURN);
-}
-
-static int binder_thread_read(struct binder_proc *proc,
- struct binder_thread *thread,
- void __user *buffer, int size,
- signed long *consumed, int non_block)
-{
- void __user *ptr = buffer + *consumed;
- void __user *end = buffer + size;
-
- int ret = 0;
- int wait_for_proc_work;
-
- if (*consumed == 0) {
- if (put_user(BR_NOOP, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- }
-
-retry:
- wait_for_proc_work = thread->transaction_stack == NULL &&
- list_empty(&thread->todo);
-
- if (thread->return_error != BR_OK && ptr < end) {
- if (thread->return_error2 != BR_OK) {
- if (put_user(thread->return_error2, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (ptr == end)
- goto done;
- thread->return_error2 = BR_OK;
- }
- if (put_user(thread->return_error, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- thread->return_error = BR_OK;
- goto done;
- }
-
-
- thread->looper |= BINDER_LOOPER_STATE_WAITING;
- if (wait_for_proc_work)
- proc->ready_threads++;
- mutex_unlock(&binder_lock);
- if (wait_for_proc_work) {
- if (!(thread->looper & (BINDER_LOOPER_STATE_REGISTERED |
- BINDER_LOOPER_STATE_ENTERED))) {
- binder_user_error("binder: %d:%d ERROR: Thread waiting "
- "for process work before calling BC_REGISTER_"
- "LOOPER or BC_ENTER_LOOPER (state %x)\n",
- proc->pid, thread->pid, thread->looper);
- wait_event_interruptible(binder_user_error_wait,
- binder_stop_on_user_error < 2);
- }
- binder_set_nice(proc->default_priority);
- if (non_block) {
- if (!binder_has_proc_work(proc, thread))
- ret = -EAGAIN;
- } else
- ret = wait_event_interruptible_exclusive(proc->wait, binder_has_proc_work(proc, thread));
- } else {
- if (non_block) {
- if (!binder_has_thread_work(thread))
- ret = -EAGAIN;
- } else
- ret = wait_event_interruptible(thread->wait, binder_has_thread_work(thread));
- }
- mutex_lock(&binder_lock);
- if (wait_for_proc_work)
- proc->ready_threads--;
- thread->looper &= ~BINDER_LOOPER_STATE_WAITING;
-
- if (ret)
- return ret;
-
- while (1) {
- uint32_t cmd;
- struct binder_transaction_data tr;
- struct binder_work *w;
- struct binder_transaction *t = NULL;
-
- if (!list_empty(&thread->todo))
- w = list_first_entry(&thread->todo, struct binder_work, entry);
- else if (!list_empty(&proc->todo) && wait_for_proc_work)
- w = list_first_entry(&proc->todo, struct binder_work, entry);
- else {
- if (ptr - buffer == 4 && !(thread->looper & BINDER_LOOPER_STATE_NEED_RETURN)) /* no data added */
- goto retry;
- break;
- }
-
- if (end - ptr < sizeof(tr) + 4)
- break;
-
- switch (w->type) {
- case BINDER_WORK_TRANSACTION: {
- t = container_of(w, struct binder_transaction, work);
- } break;
- case BINDER_WORK_TRANSACTION_COMPLETE: {
- cmd = BR_TRANSACTION_COMPLETE;
- if (put_user(cmd, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
-
- binder_stat_br(proc, thread, cmd);
- binder_debug(BINDER_DEBUG_TRANSACTION_COMPLETE,
- "binder: %d:%d BR_TRANSACTION_COMPLETE\n",
- proc->pid, thread->pid);
-
- list_del(&w->entry);
- kfree(w);
- binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
- } break;
- case BINDER_WORK_NODE: {
- struct binder_node *node = container_of(w, struct binder_node, work);
- uint32_t cmd = BR_NOOP;
- const char *cmd_name;
- int strong = node->internal_strong_refs || node->local_strong_refs;
- int weak = !hlist_empty(&node->refs) || node->local_weak_refs || strong;
- if (weak && !node->has_weak_ref) {
- cmd = BR_INCREFS;
- cmd_name = "BR_INCREFS";
- node->has_weak_ref = 1;
- node->pending_weak_ref = 1;
- node->local_weak_refs++;
- } else if (strong && !node->has_strong_ref) {
- cmd = BR_ACQUIRE;
- cmd_name = "BR_ACQUIRE";
- node->has_strong_ref = 1;
- node->pending_strong_ref = 1;
- node->local_strong_refs++;
- } else if (!strong && node->has_strong_ref) {
- cmd = BR_RELEASE;
- cmd_name = "BR_RELEASE";
- node->has_strong_ref = 0;
- } else if (!weak && node->has_weak_ref) {
- cmd = BR_DECREFS;
- cmd_name = "BR_DECREFS";
- node->has_weak_ref = 0;
- }
- if (cmd != BR_NOOP) {
- if (put_user(cmd, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (put_user(node->ptr, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
- if (put_user(node->cookie, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
-
- binder_stat_br(proc, thread, cmd);
- binder_debug(BINDER_DEBUG_USER_REFS,
- "binder: %d:%d %s %d u%p c%p\n",
- proc->pid, thread->pid, cmd_name, node->debug_id, node->ptr, node->cookie);
- } else {
- list_del_init(&w->entry);
- if (!weak && !strong) {
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d:%d node %d u%p c%p deleted\n",
- proc->pid, thread->pid, node->debug_id,
- node->ptr, node->cookie);
- rb_erase(&node->rb_node, &proc->nodes);
- kfree(node);
- binder_stats_deleted(BINDER_STAT_NODE);
- } else {
- binder_debug(BINDER_DEBUG_INTERNAL_REFS,
- "binder: %d:%d node %d u%p c%p state unchanged\n",
- proc->pid, thread->pid, node->debug_id, node->ptr,
- node->cookie);
- }
- }
- } break;
- case BINDER_WORK_DEAD_BINDER:
- case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
- case BINDER_WORK_CLEAR_DEATH_NOTIFICATION: {
- struct binder_ref_death *death;
- uint32_t cmd;
-
- death = container_of(w, struct binder_ref_death, work);
- if (w->type == BINDER_WORK_CLEAR_DEATH_NOTIFICATION)
- cmd = BR_CLEAR_DEATH_NOTIFICATION_DONE;
- else
- cmd = BR_DEAD_BINDER;
- if (put_user(cmd, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (put_user(death->cookie, (void * __user *)ptr))
- return -EFAULT;
- ptr += sizeof(void *);
- binder_debug(BINDER_DEBUG_DEATH_NOTIFICATION,
- "binder: %d:%d %s %p\n",
- proc->pid, thread->pid,
- cmd == BR_DEAD_BINDER ?
- "BR_DEAD_BINDER" :
- "BR_CLEAR_DEATH_NOTIFICATION_DONE",
- death->cookie);
-
- if (w->type == BINDER_WORK_CLEAR_DEATH_NOTIFICATION) {
- list_del(&w->entry);
- kfree(death);
- binder_stats_deleted(BINDER_STAT_DEATH);
- } else
- list_move(&w->entry, &proc->delivered_death);
- if (cmd == BR_DEAD_BINDER)
- goto done; /* DEAD_BINDER notifications can cause transactions */
- } break;
- }
-
- if (!t)
- continue;
-
- BUG_ON(t->buffer == NULL);
- if (t->buffer->target_node) {
- struct binder_node *target_node = t->buffer->target_node;
- tr.target.ptr = target_node->ptr;
- tr.cookie = target_node->cookie;
- t->saved_priority = task_nice(current);
- if (t->priority < target_node->min_priority &&
- !(t->flags & TF_ONE_WAY))
- binder_set_nice(t->priority);
- else if (!(t->flags & TF_ONE_WAY) ||
- t->saved_priority > target_node->min_priority)
- binder_set_nice(target_node->min_priority);
- cmd = BR_TRANSACTION;
- } else {
- tr.target.ptr = NULL;
- tr.cookie = NULL;
- cmd = BR_REPLY;
- }
- tr.code = t->code;
- tr.flags = t->flags;
- tr.sender_euid = t->sender_euid;
-
- if (t->from) {
- struct task_struct *sender = t->from->proc->tsk;
- tr.sender_pid = task_tgid_nr_ns(sender,
- current->nsproxy->pid_ns);
- } else {
- tr.sender_pid = 0;
- }
-
- tr.data_size = t->buffer->data_size;
- tr.offsets_size = t->buffer->offsets_size;
- tr.data.ptr.buffer = (void *)t->buffer->data +
- proc->user_buffer_offset;
- tr.data.ptr.offsets = tr.data.ptr.buffer +
- ALIGN(t->buffer->data_size,
- sizeof(void *));
-
- if (put_user(cmd, (uint32_t __user *)ptr))
- return -EFAULT;
- ptr += sizeof(uint32_t);
- if (copy_to_user(ptr, &tr, sizeof(tr)))
- return -EFAULT;
- ptr += sizeof(tr);
-
- binder_stat_br(proc, thread, cmd);
- binder_debug(BINDER_DEBUG_TRANSACTION,
- "binder: %d:%d %s %d %d:%d, cmd %d"
- "size %zd-%zd ptr %p-%p\n",
- proc->pid, thread->pid,
- (cmd == BR_TRANSACTION) ? "BR_TRANSACTION" :
- "BR_REPLY",
- t->debug_id, t->from ? t->from->proc->pid : 0,
- t->from ? t->from->pid : 0, cmd,
- t->buffer->data_size, t->buffer->offsets_size,
- tr.data.ptr.buffer, tr.data.ptr.offsets);
-
- list_del(&t->work.entry);
- t->buffer->allow_user_free = 1;
- if (cmd == BR_TRANSACTION && !(t->flags & TF_ONE_WAY)) {
- t->to_parent = thread->transaction_stack;
- t->to_thread = thread;
- thread->transaction_stack = t;
- } else {
- t->buffer->transaction = NULL;
- kfree(t);
- binder_stats_deleted(BINDER_STAT_TRANSACTION);
- }
- break;
- }
-
-done:
-
- *consumed = ptr - buffer;
- if (proc->requested_threads + proc->ready_threads == 0 &&
- proc->requested_threads_started < proc->max_threads &&
- (thread->looper & (BINDER_LOOPER_STATE_REGISTERED |
- BINDER_LOOPER_STATE_ENTERED)) /* the user-space code fails to */
- /*spawn a new thread if we leave this out */) {
- proc->requested_threads++;
- binder_debug(BINDER_DEBUG_THREADS,
- "binder: %d:%d BR_SPAWN_LOOPER\n",
- proc->pid, thread->pid);
- if (put_user(BR_SPAWN_LOOPER, (uint32_t __user *)buffer))
- return -EFAULT;
- }
- return 0;
-}
-
-static void binder_release_work(struct list_head *list)
-{
- struct binder_work *w;
- while (!list_empty(list)) {
- w = list_first_entry(list, struct binder_work, entry);
- list_del_init(&w->entry);
- switch (w->type) {
- case BINDER_WORK_TRANSACTION: {
- struct binder_transaction *t;
-
- t = container_of(w, struct binder_transaction, work);
- if (t->buffer->target_node && !(t->flags & TF_ONE_WAY))
- binder_send_failed_reply(t, BR_DEAD_REPLY);
- } break;
- case BINDER_WORK_TRANSACTION_COMPLETE: {
- kfree(w);
- binder_stats_deleted(BINDER_STAT_TRANSACTION_COMPLETE);
- } break;
- default:
- break;
- }
- }
-
-}
-
-static struct binder_thread *binder_get_thread(struct binder_proc *proc)
-{
- struct binder_thread *thread = NULL;
- struct rb_node *parent = NULL;
- struct rb_node **p = &proc->threads.rb_node;
-
- while (*p) {
- parent = *p;
- thread = rb_entry(parent, struct binder_thread, rb_node);
-
- if (current->pid < thread->pid)
- p = &(*p)->rb_left;
- else if (current->pid > thread->pid)
- p = &(*p)->rb_right;
- else
- break;
- }
- if (*p == NULL) {
- thread = kzalloc(sizeof(*thread), GFP_KERNEL);
- if (thread == NULL)
- return NULL;
- binder_stats_created(BINDER_STAT_THREAD);
- thread->proc = proc;
- thread->pid = current->pid;
- init_waitqueue_head(&thread->wait);
- INIT_LIST_HEAD(&thread->todo);
- rb_link_node(&thread->rb_node, parent, p);
- rb_insert_color(&thread->rb_node, &proc->threads);
- thread->looper |= BINDER_LOOPER_STATE_NEED_RETURN;
- thread->return_error = BR_OK;
- thread->return_error2 = BR_OK;
- }
- return thread;
-}
-
-static int binder_free_thread(struct binder_proc *proc,
- struct binder_thread *thread)
-{
- struct binder_transaction *t;
- struct binder_transaction *send_reply = NULL;
- int active_transactions = 0;
-
- rb_erase(&thread->rb_node, &proc->threads);
- t = thread->transaction_stack;
- if (t && t->to_thread == thread)
- send_reply = t;
- while (t) {
- active_transactions++;
- binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
- "binder: release %d:%d transaction %d "
- "%s, still active\n", proc->pid, thread->pid,
- t->debug_id,
- (t->to_thread == thread) ? "in" : "out");
-
- if (t->to_thread == thread) {
- t->to_proc = NULL;
- t->to_thread = NULL;
- if (t->buffer) {
- t->buffer->transaction = NULL;
- t->buffer = NULL;
- }
- t = t->to_parent;
- } else if (t->from == thread) {
- t->from = NULL;
- t = t->from_parent;
- } else
- BUG();
- }
- if (send_reply)
- binder_send_failed_reply(send_reply, BR_DEAD_REPLY);
- binder_release_work(&thread->todo);
- kfree(thread);
- binder_stats_deleted(BINDER_STAT_THREAD);
- return active_transactions;
-}
-
-static unsigned int binder_poll(struct file *filp,
- struct poll_table_struct *wait)
-{
- struct binder_proc *proc = filp->private_data;
- struct binder_thread *thread = NULL;
- int wait_for_proc_work;
-
- mutex_lock(&binder_lock);
- thread = binder_get_thread(proc);
-
- wait_for_proc_work = thread->transaction_stack == NULL &&
- list_empty(&thread->todo) && thread->return_error == BR_OK;
- mutex_unlock(&binder_lock);
-
- if (wait_for_proc_work) {
- if (binder_has_proc_work(proc, thread))
- return POLLIN;
- poll_wait(filp, &proc->wait, wait);
- if (binder_has_proc_work(proc, thread))
- return POLLIN;
- } else {
- if (binder_has_thread_work(thread))
- return POLLIN;
- poll_wait(filp, &thread->wait, wait);
- if (binder_has_thread_work(thread))
- return POLLIN;
- }
- return 0;
-}
-
-static long binder_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
-{
- int ret;
- struct binder_proc *proc = filp->private_data;
- struct binder_thread *thread;
- unsigned int size = _IOC_SIZE(cmd);
- void __user *ubuf = (void __user *)arg;
-
- /*printk(KERN_INFO "binder_ioctl: %d:%d %x %lx\n", proc->pid, current->pid, cmd, arg);*/
-
- ret = wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
- if (ret)
- return ret;
-
- mutex_lock(&binder_lock);
- thread = binder_get_thread(proc);
- if (thread == NULL) {
- ret = -ENOMEM;
- goto err;
- }
-
- switch (cmd) {
- case BINDER_WRITE_READ: {
- struct binder_write_read bwr;
- if (size != sizeof(struct binder_write_read)) {
- ret = -EINVAL;
- goto err;
- }
- if (copy_from_user(&bwr, ubuf, sizeof(bwr))) {
- ret = -EFAULT;
- goto err;
- }
- binder_debug(BINDER_DEBUG_READ_WRITE,
- "binder: %d:%d write %ld at %08lx, read %ld at %08lx\n",
- proc->pid, thread->pid, bwr.write_size, bwr.write_buffer,
- bwr.read_size, bwr.read_buffer);
-
- if (bwr.write_size > 0) {
- ret = binder_thread_write(proc, thread, (void __user *)bwr.write_buffer, bwr.write_size, &bwr.write_consumed);
- if (ret < 0) {
- bwr.read_consumed = 0;
- if (copy_to_user(ubuf, &bwr, sizeof(bwr)))
- ret = -EFAULT;
- goto err;
- }
- }
- if (bwr.read_size > 0) {
- ret = binder_thread_read(proc, thread, (void __user *)bwr.read_buffer, bwr.read_size, &bwr.read_consumed, filp->f_flags & O_NONBLOCK);
- if (!list_empty(&proc->todo))
- wake_up_interruptible(&proc->wait);
- if (ret < 0) {
- if (copy_to_user(ubuf, &bwr, sizeof(bwr)))
- ret = -EFAULT;
- goto err;
- }
- }
- binder_debug(BINDER_DEBUG_READ_WRITE,
- "binder: %d:%d wrote %ld of %ld, read return %ld of %ld\n",
- proc->pid, thread->pid, bwr.write_consumed, bwr.write_size,
- bwr.read_consumed, bwr.read_size);
- if (copy_to_user(ubuf, &bwr, sizeof(bwr))) {
- ret = -EFAULT;
- goto err;
- }
- break;
- }
- case BINDER_SET_MAX_THREADS:
- if (copy_from_user(&proc->max_threads, ubuf, sizeof(proc->max_threads))) {
- ret = -EINVAL;
- goto err;
- }
- break;
- case BINDER_SET_CONTEXT_MGR:
- if (binder_context_mgr_node != NULL) {
- printk(KERN_ERR "binder: BINDER_SET_CONTEXT_MGR already set\n");
- ret = -EBUSY;
- goto err;
- }
- if (binder_context_mgr_uid != -1) {
- if (binder_context_mgr_uid != current->cred->euid) {
- printk(KERN_ERR "binder: BINDER_SET_"
- "CONTEXT_MGR bad uid %d != %d\n",
- current->cred->euid,
- binder_context_mgr_uid);
- ret = -EPERM;
- goto err;
- }
- } else
- binder_context_mgr_uid = current->cred->euid;
- binder_context_mgr_node = binder_new_node(proc, NULL, NULL);
- if (binder_context_mgr_node == NULL) {
- ret = -ENOMEM;
- goto err;
- }
- binder_context_mgr_node->local_weak_refs++;
- binder_context_mgr_node->local_strong_refs++;
- binder_context_mgr_node->has_strong_ref = 1;
- binder_context_mgr_node->has_weak_ref = 1;
- break;
- case BINDER_THREAD_EXIT:
- binder_debug(BINDER_DEBUG_THREADS, "binder: %d:%d exit\n",
- proc->pid, thread->pid);
- binder_free_thread(proc, thread);
- thread = NULL;
- break;
- case BINDER_VERSION:
- if (size != sizeof(struct binder_version)) {
- ret = -EINVAL;
- goto err;
- }
- if (put_user(BINDER_CURRENT_PROTOCOL_VERSION, &((struct binder_version *)ubuf)->protocol_version)) {
- ret = -EINVAL;
- goto err;
- }
- break;
- default:
- ret = -EINVAL;
- goto err;
- }
- ret = 0;
-err:
- if (thread)
- thread->looper &= ~BINDER_LOOPER_STATE_NEED_RETURN;
- mutex_unlock(&binder_lock);
- wait_event_interruptible(binder_user_error_wait, binder_stop_on_user_error < 2);
- if (ret && ret != -ERESTARTSYS)
- printk(KERN_INFO "binder: %d:%d ioctl %x %lx returned %d\n", proc->pid, current->pid, cmd, arg, ret);
- return ret;
-}
-
-static void binder_vma_open(struct vm_area_struct *vma)
-{
- struct binder_proc *proc = vma->vm_private_data;
- binder_debug(BINDER_DEBUG_OPEN_CLOSE,
- "binder: %d open vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
- proc->pid, vma->vm_start, vma->vm_end,
- (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
- (unsigned long)pgprot_val(vma->vm_page_prot));
- dump_stack();
-}
-
-static void binder_vma_close(struct vm_area_struct *vma)
-{
- struct binder_proc *proc = vma->vm_private_data;
- binder_debug(BINDER_DEBUG_OPEN_CLOSE,
- "binder: %d close vm area %lx-%lx (%ld K) vma %lx pagep %lx\n",
- proc->pid, vma->vm_start, vma->vm_end,
- (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
- (unsigned long)pgprot_val(vma->vm_page_prot));
- proc->vma = NULL;
- binder_defer_work(proc, BINDER_DEFERRED_PUT_FILES);
-}
-
-static struct vm_operations_struct binder_vm_ops = {
- .open = binder_vma_open,
- .close = binder_vma_close,
-};
-
-static int binder_mmap(struct file *filp, struct vm_area_struct *vma)
-{
- int ret;
- struct vm_struct *area;
- struct binder_proc *proc = filp->private_data;
- const char *failure_string;
- struct binder_buffer *buffer;
-
- if ((vma->vm_end - vma->vm_start) > SZ_4M)
- vma->vm_end = vma->vm_start + SZ_4M;
-
- binder_debug(BINDER_DEBUG_OPEN_CLOSE,
- "binder_mmap: %d %lx-%lx (%ld K) vma %lx pagep %lx\n",
- proc->pid, vma->vm_start, vma->vm_end,
- (vma->vm_end - vma->vm_start) / SZ_1K, vma->vm_flags,
- (unsigned long)pgprot_val(vma->vm_page_prot));
-
- if (vma->vm_flags & FORBIDDEN_MMAP_FLAGS) {
- ret = -EPERM;
- failure_string = "bad vm_flags";
- goto err_bad_arg;
- }
- vma->vm_flags = (vma->vm_flags | VM_DONTCOPY) & ~VM_MAYWRITE;
-
- if (proc->buffer) {
- ret = -EBUSY;
- failure_string = "already mapped";
- goto err_already_mapped;
- }
-
- area = get_vm_area(vma->vm_end - vma->vm_start, VM_IOREMAP);
- if (area == NULL) {
- ret = -ENOMEM;
- failure_string = "get_vm_area";
- goto err_get_vm_area_failed;
- }
- proc->buffer = area->addr;
- proc->user_buffer_offset = vma->vm_start - (uintptr_t)proc->buffer;
-
-#ifdef CONFIG_CPU_CACHE_VIPT
- if (cache_is_vipt_aliasing()) {
- while (CACHE_COLOUR((vma->vm_start ^ (uint32_t)proc->buffer))) {
- printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p bad alignment\n", proc->pid, vma->vm_start, vma->vm_end, proc->buffer);
- vma->vm_start += PAGE_SIZE;
- }
- }
-#endif
- proc->pages = kzalloc(sizeof(proc->pages[0]) * ((vma->vm_end - vma->vm_start) / PAGE_SIZE), GFP_KERNEL);
- if (proc->pages == NULL) {
- ret = -ENOMEM;
- failure_string = "alloc page array";
- goto err_alloc_pages_failed;
- }
- proc->buffer_size = vma->vm_end - vma->vm_start;
-
- vma->vm_ops = &binder_vm_ops;
- vma->vm_private_data = proc;
-
- if (binder_update_page_range(proc, 1, proc->buffer, proc->buffer + PAGE_SIZE, vma)) {
- ret = -ENOMEM;
- failure_string = "alloc small buf";
- goto err_alloc_small_buf_failed;
- }
- buffer = proc->buffer;
- INIT_LIST_HEAD(&proc->buffers);
- list_add(&buffer->entry, &proc->buffers);
- buffer->free = 1;
- binder_insert_free_buffer(proc, buffer);
- proc->free_async_space = proc->buffer_size / 2;
- barrier();
- proc->files = get_files_struct(current);
- proc->vma = vma;
-
- /*printk(KERN_INFO "binder_mmap: %d %lx-%lx maps %p\n",
- proc->pid, vma->vm_start, vma->vm_end, proc->buffer);*/
- return 0;
-
-err_alloc_small_buf_failed:
- kfree(proc->pages);
- proc->pages = NULL;
-err_alloc_pages_failed:
- vfree(proc->buffer);
- proc->buffer = NULL;
-err_get_vm_area_failed:
-err_already_mapped:
-err_bad_arg:
- printk(KERN_ERR "binder_mmap: %d %lx-%lx %s failed %d\n",
- proc->pid, vma->vm_start, vma->vm_end, failure_string, ret);
- return ret;
-}
-
-static int binder_open(struct inode *nodp, struct file *filp)
-{
- struct binder_proc *proc;
-
- binder_debug(BINDER_DEBUG_OPEN_CLOSE, "binder_open: %d:%d\n",
- current->group_leader->pid, current->pid);
-
- proc = kzalloc(sizeof(*proc), GFP_KERNEL);
- if (proc == NULL)
- return -ENOMEM;
- get_task_struct(current);
- proc->tsk = current;
- INIT_LIST_HEAD(&proc->todo);
- init_waitqueue_head(&proc->wait);
- proc->default_priority = task_nice(current);
- mutex_lock(&binder_lock);
- binder_stats_created(BINDER_STAT_PROC);
- hlist_add_head(&proc->proc_node, &binder_procs);
- proc->pid = current->group_leader->pid;
- INIT_LIST_HEAD(&proc->delivered_death);
- filp->private_data = proc;
- mutex_unlock(&binder_lock);
-
- if (binder_proc_dir_entry_proc) {
- char strbuf[11];
- snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
- remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
- create_proc_read_entry(strbuf, S_IRUGO,
- binder_proc_dir_entry_proc,
- binder_read_proc_proc, proc);
- }
-
- return 0;
-}
-
-static int binder_flush(struct file *filp, fl_owner_t id)
-{
- struct binder_proc *proc = filp->private_data;
-
- binder_defer_work(proc, BINDER_DEFERRED_FLUSH);
-
- return 0;
-}
-
-static void binder_deferred_flush(struct binder_proc *proc)
-{
- struct rb_node *n;
- int wake_count = 0;
- for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n)) {
- struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node);
- thread->looper |= BINDER_LOOPER_STATE_NEED_RETURN;
- if (thread->looper & BINDER_LOOPER_STATE_WAITING) {
- wake_up_interruptible(&thread->wait);
- wake_count++;
- }
- }
- wake_up_interruptible_all(&proc->wait);
-
- binder_debug(BINDER_DEBUG_OPEN_CLOSE,
- "binder_flush: %d woke %d threads\n", proc->pid,
- wake_count);
-}
-
-static int binder_release(struct inode *nodp, struct file *filp)
-{
- struct binder_proc *proc = filp->private_data;
- if (binder_proc_dir_entry_proc) {
- char strbuf[11];
- snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
- remove_proc_entry(strbuf, binder_proc_dir_entry_proc);
- }
-
- binder_defer_work(proc, BINDER_DEFERRED_RELEASE);
-
- return 0;
-}
-
-static void binder_deferred_release(struct binder_proc *proc)
-{
- struct hlist_node *pos;
- struct binder_transaction *t;
- struct rb_node *n;
- int threads, nodes, incoming_refs, outgoing_refs, buffers, active_transactions, page_count;
-
- BUG_ON(proc->vma);
- BUG_ON(proc->files);
-
- hlist_del(&proc->proc_node);
- if (binder_context_mgr_node && binder_context_mgr_node->proc == proc) {
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder_release: %d context_mgr_node gone\n",
- proc->pid);
- binder_context_mgr_node = NULL;
- }
-
- threads = 0;
- active_transactions = 0;
- while ((n = rb_first(&proc->threads))) {
- struct binder_thread *thread = rb_entry(n, struct binder_thread, rb_node);
- threads++;
- active_transactions += binder_free_thread(proc, thread);
- }
- nodes = 0;
- incoming_refs = 0;
- while ((n = rb_first(&proc->nodes))) {
- struct binder_node *node = rb_entry(n, struct binder_node, rb_node);
-
- nodes++;
- rb_erase(&node->rb_node, &proc->nodes);
- list_del_init(&node->work.entry);
- if (hlist_empty(&node->refs)) {
- kfree(node);
- binder_stats_deleted(BINDER_STAT_NODE);
- } else {
- struct binder_ref *ref;
- int death = 0;
-
- node->proc = NULL;
- node->local_strong_refs = 0;
- node->local_weak_refs = 0;
- hlist_add_head(&node->dead_node, &binder_dead_nodes);
-
- hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
- incoming_refs++;
- if (ref->death) {
- death++;
- if (list_empty(&ref->death->work.entry)) {
- ref->death->work.type = BINDER_WORK_DEAD_BINDER;
- list_add_tail(&ref->death->work.entry, &ref->proc->todo);
- wake_up_interruptible(&ref->proc->wait);
- } else
- BUG();
- }
- }
- binder_debug(BINDER_DEBUG_DEAD_BINDER,
- "binder: node %d now dead, "
- "refs %d, death %d\n", node->debug_id,
- incoming_refs, death);
- }
- }
- outgoing_refs = 0;
- while ((n = rb_first(&proc->refs_by_desc))) {
- struct binder_ref *ref = rb_entry(n, struct binder_ref,
- rb_node_desc);
- outgoing_refs++;
- binder_delete_ref(ref);
- }
- binder_release_work(&proc->todo);
- buffers = 0;
-
- while ((n = rb_first(&proc->allocated_buffers))) {
- struct binder_buffer *buffer = rb_entry(n, struct binder_buffer,
- rb_node);
- t = buffer->transaction;
- if (t) {
- t->buffer = NULL;
- buffer->transaction = NULL;
- printk(KERN_ERR "binder: release proc %d, "
- "transaction %d, not freed\n",
- proc->pid, t->debug_id);
- /*BUG();*/
- }
- binder_free_buf(proc, buffer);
- buffers++;
- }
-
- binder_stats_deleted(BINDER_STAT_PROC);
-
- page_count = 0;
- if (proc->pages) {
- int i;
- for (i = 0; i < proc->buffer_size / PAGE_SIZE; i++) {
- if (proc->pages[i]) {
- binder_debug(BINDER_DEBUG_BUFFER_ALLOC,
- "binder_release: %d: "
- "page %d at %p not freed\n",
- proc->pid, i,
- proc->buffer + i * PAGE_SIZE);
- __free_page(proc->pages[i]);
- page_count++;
- }
- }
- kfree(proc->pages);
- vfree(proc->buffer);
- }
-
- put_task_struct(proc->tsk);
-
- binder_debug(BINDER_DEBUG_OPEN_CLOSE,
- "binder_release: %d threads %d, nodes %d (ref %d), "
- "refs %d, active transactions %d, buffers %d, "
- "pages %d\n",
- proc->pid, threads, nodes, incoming_refs, outgoing_refs,
- active_transactions, buffers, page_count);
-
- kfree(proc);
-}
-
-static void binder_deferred_func(struct work_struct *work)
-{
- struct binder_proc *proc;
- struct files_struct *files;
-
- int defer;
- do {
- mutex_lock(&binder_lock);
- mutex_lock(&binder_deferred_lock);
- if (!hlist_empty(&binder_deferred_list)) {
- proc = hlist_entry(binder_deferred_list.first,
- struct binder_proc, deferred_work_node);
- hlist_del_init(&proc->deferred_work_node);
- defer = proc->deferred_work;
- proc->deferred_work = 0;
- } else {
- proc = NULL;
- defer = 0;
- }
- mutex_unlock(&binder_deferred_lock);
-
- files = NULL;
- if (defer & BINDER_DEFERRED_PUT_FILES) {
- files = proc->files;
- if (files)
- proc->files = NULL;
- }
-
- if (defer & BINDER_DEFERRED_FLUSH)
- binder_deferred_flush(proc);
-
- if (defer & BINDER_DEFERRED_RELEASE)
- binder_deferred_release(proc); /* frees proc */
-
- mutex_unlock(&binder_lock);
- if (files)
- put_files_struct(files);
- } while (proc);
-}
-static DECLARE_WORK(binder_deferred_work, binder_deferred_func);
-
-static void
-binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer)
-{
- mutex_lock(&binder_deferred_lock);
- proc->deferred_work |= defer;
- if (hlist_unhashed(&proc->deferred_work_node)) {
- hlist_add_head(&proc->deferred_work_node,
- &binder_deferred_list);
- schedule_work(&binder_deferred_work);
- }
- mutex_unlock(&binder_deferred_lock);
-}
-
-static char *print_binder_transaction(char *buf, char *end, const char *prefix,
- struct binder_transaction *t)
-{
- buf += snprintf(buf, end - buf,
- "%s %d: %p from %d:%d to %d:%d code %x "
- "flags %x pri %ld r%d",
- prefix, t->debug_id, t,
- t->from ? t->from->proc->pid : 0,
- t->from ? t->from->pid : 0,
- t->to_proc ? t->to_proc->pid : 0,
- t->to_thread ? t->to_thread->pid : 0,
- t->code, t->flags, t->priority, t->need_reply);
- if (buf >= end)
- return buf;
- if (t->buffer == NULL) {
- buf += snprintf(buf, end - buf, " buffer free\n");
- return buf;
- }
- if (t->buffer->target_node) {
- buf += snprintf(buf, end - buf, " node %d",
- t->buffer->target_node->debug_id);
- if (buf >= end)
- return buf;
- }
- buf += snprintf(buf, end - buf, " size %zd:%zd data %p\n",
- t->buffer->data_size, t->buffer->offsets_size,
- t->buffer->data);
- return buf;
-}
-
-static char *print_binder_buffer(char *buf, char *end, const char *prefix,
- struct binder_buffer *buffer)
-{
- buf += snprintf(buf, end - buf, "%s %d: %p size %zd:%zd %s\n",
- prefix, buffer->debug_id, buffer->data,
- buffer->data_size, buffer->offsets_size,
- buffer->transaction ? "active" : "delivered");
- return buf;
-}
-
-static char *print_binder_work(char *buf, char *end, const char *prefix,
- const char *transaction_prefix,
- struct binder_work *w)
-{
- struct binder_node *node;
- struct binder_transaction *t;
-
- switch (w->type) {
- case BINDER_WORK_TRANSACTION:
- t = container_of(w, struct binder_transaction, work);
- buf = print_binder_transaction(buf, end, transaction_prefix, t);
- break;
- case BINDER_WORK_TRANSACTION_COMPLETE:
- buf += snprintf(buf, end - buf,
- "%stransaction complete\n", prefix);
- break;
- case BINDER_WORK_NODE:
- node = container_of(w, struct binder_node, work);
- buf += snprintf(buf, end - buf, "%snode work %d: u%p c%p\n",
- prefix, node->debug_id, node->ptr,
- node->cookie);
- break;
- case BINDER_WORK_DEAD_BINDER:
- buf += snprintf(buf, end - buf, "%shas dead binder\n", prefix);
- break;
- case BINDER_WORK_DEAD_BINDER_AND_CLEAR:
- buf += snprintf(buf, end - buf,
- "%shas cleared dead binder\n", prefix);
- break;
- case BINDER_WORK_CLEAR_DEATH_NOTIFICATION:
- buf += snprintf(buf, end - buf,
- "%shas cleared death notification\n", prefix);
- break;
- default:
- buf += snprintf(buf, end - buf, "%sunknown work: type %d\n",
- prefix, w->type);
- break;
- }
- return buf;
-}
-
-static char *print_binder_thread(char *buf, char *end,
- struct binder_thread *thread,
- int print_always)
-{
- struct binder_transaction *t;
- struct binder_work *w;
- char *start_buf = buf;
- char *header_buf;
-
- buf += snprintf(buf, end - buf, " thread %d: l %02x\n",
- thread->pid, thread->looper);
- header_buf = buf;
- t = thread->transaction_stack;
- while (t) {
- if (buf >= end)
- break;
- if (t->from == thread) {
- buf = print_binder_transaction(buf, end,
- " outgoing transaction", t);
- t = t->from_parent;
- } else if (t->to_thread == thread) {
- buf = print_binder_transaction(buf, end,
- " incoming transaction", t);
- t = t->to_parent;
- } else {
- buf = print_binder_transaction(buf, end,
- " bad transaction", t);
- t = NULL;
- }
- }
- list_for_each_entry(w, &thread->todo, entry) {
- if (buf >= end)
- break;
- buf = print_binder_work(buf, end, " ",
- " pending transaction", w);
- }
- if (!print_always && buf == header_buf)
- buf = start_buf;
- return buf;
-}
-
-static char *print_binder_node(char *buf, char *end, struct binder_node *node)
-{
- struct binder_ref *ref;
- struct hlist_node *pos;
- struct binder_work *w;
- int count;
-
- count = 0;
- hlist_for_each_entry(ref, pos, &node->refs, node_entry)
- count++;
-
- buf += snprintf(buf, end - buf,
- " node %d: u%p c%p hs %d hw %d ls %d lw %d "
- "is %d iw %d",
- node->debug_id, node->ptr, node->cookie,
- node->has_strong_ref, node->has_weak_ref,
- node->local_strong_refs, node->local_weak_refs,
- node->internal_strong_refs, count);
- if (buf >= end)
- return buf;
- if (count) {
- buf += snprintf(buf, end - buf, " proc");
- if (buf >= end)
- return buf;
- hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
- buf += snprintf(buf, end - buf, " %d", ref->proc->pid);
- if (buf >= end)
- return buf;
- }
- }
- buf += snprintf(buf, end - buf, "\n");
- list_for_each_entry(w, &node->async_todo, entry) {
- if (buf >= end)
- break;
- buf = print_binder_work(buf, end, " ",
- " pending async transaction", w);
- }
- return buf;
-}
-
-static char *print_binder_ref(char *buf, char *end, struct binder_ref *ref)
-{
- buf += snprintf(buf, end - buf,
- " ref %d: desc %d %snode %d s %d w %d d %p\n",
- ref->debug_id, ref->desc,
- ref->node->proc ? "" : "dead ", ref->node->debug_id,
- ref->strong, ref->weak, ref->death);
- return buf;
-}
-
-static char *print_binder_proc(char *buf, char *end,
- struct binder_proc *proc, int print_all)
-{
- struct binder_work *w;
- struct rb_node *n;
- char *start_buf = buf;
- char *header_buf;
-
- buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
- header_buf = buf;
-
- for (n = rb_first(&proc->threads);
- n != NULL && buf < end;
- n = rb_next(n))
- buf = print_binder_thread(buf, end,
- rb_entry(n, struct binder_thread,
- rb_node), print_all);
- for (n = rb_first(&proc->nodes);
- n != NULL && buf < end;
- n = rb_next(n)) {
- struct binder_node *node = rb_entry(n, struct binder_node,
- rb_node);
- if (print_all || node->has_async_transaction)
- buf = print_binder_node(buf, end, node);
- }
- if (print_all) {
- for (n = rb_first(&proc->refs_by_desc);
- n != NULL && buf < end;
- n = rb_next(n))
- buf = print_binder_ref(buf, end,
- rb_entry(n, struct binder_ref,
- rb_node_desc));
- }
- for (n = rb_first(&proc->allocated_buffers);
- n != NULL && buf < end;
- n = rb_next(n))
- buf = print_binder_buffer(buf, end, " buffer",
- rb_entry(n, struct binder_buffer,
- rb_node));
- list_for_each_entry(w, &proc->todo, entry) {
- if (buf >= end)
- break;
- buf = print_binder_work(buf, end, " ",
- " pending transaction", w);
- }
- list_for_each_entry(w, &proc->delivered_death, entry) {
- if (buf >= end)
- break;
- buf += snprintf(buf, end - buf,
- " has delivered dead binder\n");
- break;
- }
- if (!print_all && buf == header_buf)
- buf = start_buf;
- return buf;
-}
-
-static const char *binder_return_strings[] = {
- "BR_ERROR",
- "BR_OK",
- "BR_TRANSACTION",
- "BR_REPLY",
- "BR_ACQUIRE_RESULT",
- "BR_DEAD_REPLY",
- "BR_TRANSACTION_COMPLETE",
- "BR_INCREFS",
- "BR_ACQUIRE",
- "BR_RELEASE",
- "BR_DECREFS",
- "BR_ATTEMPT_ACQUIRE",
- "BR_NOOP",
- "BR_SPAWN_LOOPER",
- "BR_FINISHED",
- "BR_DEAD_BINDER",
- "BR_CLEAR_DEATH_NOTIFICATION_DONE",
- "BR_FAILED_REPLY"
-};
-
-static const char *binder_command_strings[] = {
- "BC_TRANSACTION",
- "BC_REPLY",
- "BC_ACQUIRE_RESULT",
- "BC_FREE_BUFFER",
- "BC_INCREFS",
- "BC_ACQUIRE",
- "BC_RELEASE",
- "BC_DECREFS",
- "BC_INCREFS_DONE",
- "BC_ACQUIRE_DONE",
- "BC_ATTEMPT_ACQUIRE",
- "BC_REGISTER_LOOPER",
- "BC_ENTER_LOOPER",
- "BC_EXIT_LOOPER",
- "BC_REQUEST_DEATH_NOTIFICATION",
- "BC_CLEAR_DEATH_NOTIFICATION",
- "BC_DEAD_BINDER_DONE"
-};
-
-static const char *binder_objstat_strings[] = {
- "proc",
- "thread",
- "node",
- "ref",
- "death",
- "transaction",
- "transaction_complete"
-};
-
-static char *print_binder_stats(char *buf, char *end, const char *prefix,
- struct binder_stats *stats)
-{
- int i;
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->bc) !=
- ARRAY_SIZE(binder_command_strings));
- for (i = 0; i < ARRAY_SIZE(stats->bc); i++) {
- if (stats->bc[i])
- buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
- binder_command_strings[i],
- stats->bc[i]);
- if (buf >= end)
- return buf;
- }
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->br) !=
- ARRAY_SIZE(binder_return_strings));
- for (i = 0; i < ARRAY_SIZE(stats->br); i++) {
- if (stats->br[i])
- buf += snprintf(buf, end - buf, "%s%s: %d\n", prefix,
- binder_return_strings[i], stats->br[i]);
- if (buf >= end)
- return buf;
- }
-
- BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
- ARRAY_SIZE(binder_objstat_strings));
- BUILD_BUG_ON(ARRAY_SIZE(stats->obj_created) !=
- ARRAY_SIZE(stats->obj_deleted));
- for (i = 0; i < ARRAY_SIZE(stats->obj_created); i++) {
- if (stats->obj_created[i] || stats->obj_deleted[i])
- buf += snprintf(buf, end - buf,
- "%s%s: active %d total %d\n", prefix,
- binder_objstat_strings[i],
- stats->obj_created[i] -
- stats->obj_deleted[i],
- stats->obj_created[i]);
- if (buf >= end)
- return buf;
- }
- return buf;
-}
-
-static char *print_binder_proc_stats(char *buf, char *end,
- struct binder_proc *proc)
-{
- struct binder_work *w;
- struct rb_node *n;
- int count, strong, weak;
-
- buf += snprintf(buf, end - buf, "proc %d\n", proc->pid);
- if (buf >= end)
- return buf;
- count = 0;
- for (n = rb_first(&proc->threads); n != NULL; n = rb_next(n))
- count++;
- buf += snprintf(buf, end - buf, " threads: %d\n", count);
- if (buf >= end)
- return buf;
- buf += snprintf(buf, end - buf, " requested threads: %d+%d/%d\n"
- " ready threads %d\n"
- " free async space %zd\n", proc->requested_threads,
- proc->requested_threads_started, proc->max_threads,
- proc->ready_threads, proc->free_async_space);
- if (buf >= end)
- return buf;
- count = 0;
- for (n = rb_first(&proc->nodes); n != NULL; n = rb_next(n))
- count++;
- buf += snprintf(buf, end - buf, " nodes: %d\n", count);
- if (buf >= end)
- return buf;
- count = 0;
- strong = 0;
- weak = 0;
- for (n = rb_first(&proc->refs_by_desc); n != NULL; n = rb_next(n)) {
- struct binder_ref *ref = rb_entry(n, struct binder_ref,
- rb_node_desc);
- count++;
- strong += ref->strong;
- weak += ref->weak;
- }
- buf += snprintf(buf, end - buf, " refs: %d s %d w %d\n",
- count, strong, weak);
- if (buf >= end)
- return buf;
-
- count = 0;
- for (n = rb_first(&proc->allocated_buffers); n != NULL; n = rb_next(n))
- count++;
- buf += snprintf(buf, end - buf, " buffers: %d\n", count);
- if (buf >= end)
- return buf;
-
- count = 0;
- list_for_each_entry(w, &proc->todo, entry) {
- switch (w->type) {
- case BINDER_WORK_TRANSACTION:
- count++;
- break;
- default:
- break;
- }
- }
- buf += snprintf(buf, end - buf, " pending transactions: %d\n", count);
- if (buf >= end)
- return buf;
-
- buf = print_binder_stats(buf, end, " ", &proc->stats);
-
- return buf;
-}
-
-
-static int binder_read_proc_state(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct binder_proc *proc;
- struct hlist_node *pos;
- struct binder_node *node;
- int len = 0;
- char *buf = page;
- char *end = page + PAGE_SIZE;
- int do_lock = !binder_debug_no_lock;
-
- if (off)
- return 0;
-
- if (do_lock)
- mutex_lock(&binder_lock);
-
- buf += snprintf(buf, end - buf, "binder state:\n");
-
- if (!hlist_empty(&binder_dead_nodes))
- buf += snprintf(buf, end - buf, "dead nodes:\n");
- hlist_for_each_entry(node, pos, &binder_dead_nodes, dead_node) {
- if (buf >= end)
- break;
- buf = print_binder_node(buf, end, node);
- }
-
- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
- if (buf >= end)
- break;
- buf = print_binder_proc(buf, end, proc, 1);
- }
- if (do_lock)
- mutex_unlock(&binder_lock);
- if (buf > page + PAGE_SIZE)
- buf = page + PAGE_SIZE;
-
- *start = page + off;
-
- len = buf - page;
- if (len > off)
- len -= off;
- else
- len = 0;
-
- return len < count ? len : count;
-}
-
-static int binder_read_proc_stats(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct binder_proc *proc;
- struct hlist_node *pos;
- int len = 0;
- char *p = page;
- int do_lock = !binder_debug_no_lock;
-
- if (off)
- return 0;
-
- if (do_lock)
- mutex_lock(&binder_lock);
-
- p += snprintf(p, PAGE_SIZE, "binder stats:\n");
-
- p = print_binder_stats(p, page + PAGE_SIZE, "", &binder_stats);
-
- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
- if (p >= page + PAGE_SIZE)
- break;
- p = print_binder_proc_stats(p, page + PAGE_SIZE, proc);
- }
- if (do_lock)
- mutex_unlock(&binder_lock);
- if (p > page + PAGE_SIZE)
- p = page + PAGE_SIZE;
-
- *start = page + off;
-
- len = p - page;
- if (len > off)
- len -= off;
- else
- len = 0;
-
- return len < count ? len : count;
-}
-
-static int binder_read_proc_transactions(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct binder_proc *proc;
- struct hlist_node *pos;
- int len = 0;
- char *buf = page;
- char *end = page + PAGE_SIZE;
- int do_lock = !binder_debug_no_lock;
-
- if (off)
- return 0;
-
- if (do_lock)
- mutex_lock(&binder_lock);
-
- buf += snprintf(buf, end - buf, "binder transactions:\n");
- hlist_for_each_entry(proc, pos, &binder_procs, proc_node) {
- if (buf >= end)
- break;
- buf = print_binder_proc(buf, end, proc, 0);
- }
- if (do_lock)
- mutex_unlock(&binder_lock);
- if (buf > page + PAGE_SIZE)
- buf = page + PAGE_SIZE;
-
- *start = page + off;
-
- len = buf - page;
- if (len > off)
- len -= off;
- else
- len = 0;
-
- return len < count ? len : count;
-}
-
-static int binder_read_proc_proc(char *page, char **start, off_t off,
- int count, int *eof, void *data)
-{
- struct binder_proc *proc = data;
- int len = 0;
- char *p = page;
- int do_lock = !binder_debug_no_lock;
-
- if (off)
- return 0;
-
- if (do_lock)
- mutex_lock(&binder_lock);
- p += snprintf(p, PAGE_SIZE, "binder proc state:\n");
- p = print_binder_proc(p, page + PAGE_SIZE, proc, 1);
- if (do_lock)
- mutex_unlock(&binder_lock);
-
- if (p > page + PAGE_SIZE)
- p = page + PAGE_SIZE;
- *start = page + off;
-
- len = p - page;
- if (len > off)
- len -= off;
- else
- len = 0;
-
- return len < count ? len : count;
-}
-
-static char *print_binder_transaction_log_entry(char *buf, char *end,
- struct binder_transaction_log_entry *e)
-{
- buf += snprintf(buf, end - buf,
- "%d: %s from %d:%d to %d:%d node %d handle %d "
- "size %d:%d\n",
- e->debug_id, (e->call_type == 2) ? "reply" :
- ((e->call_type == 1) ? "async" : "call "), e->from_proc,
- e->from_thread, e->to_proc, e->to_thread, e->to_node,
- e->target_handle, e->data_size, e->offsets_size);
- return buf;
-}
-
-static int binder_read_proc_transaction_log(
- char *page, char **start, off_t off, int count, int *eof, void *data)
-{
- struct binder_transaction_log *log = data;
- int len = 0;
- int i;
- char *buf = page;
- char *end = page + PAGE_SIZE;
-
- if (off)
- return 0;
-
- if (log->full) {
- for (i = log->next; i < ARRAY_SIZE(log->entry); i++) {
- if (buf >= end)
- break;
- buf = print_binder_transaction_log_entry(buf, end,
- &log->entry[i]);
- }
- }
- for (i = 0; i < log->next; i++) {
- if (buf >= end)
- break;
- buf = print_binder_transaction_log_entry(buf, end,
- &log->entry[i]);
- }
-
- *start = page + off;
-
- len = buf - page;
- if (len > off)
- len -= off;
- else
- len = 0;
-
- return len < count ? len : count;
-}
-
-static const struct file_operations binder_fops = {
- .owner = THIS_MODULE,
- .poll = binder_poll,
- .unlocked_ioctl = binder_ioctl,
- .mmap = binder_mmap,
- .open = binder_open,
- .flush = binder_flush,
- .release = binder_release,
-};
-
-static struct miscdevice binder_miscdev = {
- .minor = MISC_DYNAMIC_MINOR,
- .name = "binder",
- .fops = &binder_fops
-};
-
-static int __init binder_init(void)
-{
- int ret;
-
- binder_proc_dir_entry_root = proc_mkdir("binder", NULL);
- if (binder_proc_dir_entry_root)
- binder_proc_dir_entry_proc = proc_mkdir("proc",
- binder_proc_dir_entry_root);
- ret = misc_register(&binder_miscdev);
- if (binder_proc_dir_entry_root) {
- create_proc_read_entry("state",
- S_IRUGO,
- binder_proc_dir_entry_root,
- binder_read_proc_state,
- NULL);
- create_proc_read_entry("stats",
- S_IRUGO,
- binder_proc_dir_entry_root,
- binder_read_proc_stats,
- NULL);
- create_proc_read_entry("transactions",
- S_IRUGO,
- binder_proc_dir_entry_root,
- binder_read_proc_transactions,
- NULL);
- create_proc_read_entry("transaction_log",
- S_IRUGO,
- binder_proc_dir_entry_root,
- binder_read_proc_transaction_log,
- &binder_transaction_log);
- create_proc_read_entry("failed_transaction_log",
- S_IRUGO,
- binder_proc_dir_entry_root,
- binder_read_proc_transaction_log,
- &binder_transaction_log_failed);
- }
- return ret;
-}
-
-device_initcall(binder_init);
-
-MODULE_LICENSE("GPL v2");
diff --git a/drivers/staging/android/binder.h b/drivers/staging/android/binder.h
deleted file mode 100644
index 863ae1ad5d55..000000000000
--- a/drivers/staging/android/binder.h
+++ /dev/null
@@ -1,330 +0,0 @@
-/*
- * Copyright (C) 2008 Google, Inc.
- *
- * Based on, but no longer compatible with, the original
- * OpenBinder.org binder driver interface, which is:
- *
- * Copyright (c) 2005 Palmsource, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _LINUX_BINDER_H
-#define _LINUX_BINDER_H
-
-#include <linux/ioctl.h>
-
-#define B_PACK_CHARS(c1, c2, c3, c4) \
- ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4))
-#define B_TYPE_LARGE 0x85
-
-enum {
- BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
- BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
- BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
- BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
- BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
-};
-
-enum {
- FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
- FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
-};
-
-/*
- * This is the flattened representation of a Binder object for transfer
- * between processes. The 'offsets' supplied as part of a binder transaction
- * contains offsets into the data where these structures occur. The Binder
- * driver takes care of re-writing the structure type and data as it moves
- * between processes.
- */
-struct flat_binder_object {
- /* 8 bytes for large_flat_header. */
- unsigned long type;
- unsigned long flags;
-
- /* 8 bytes of data. */
- union {
- void *binder; /* local object */
- signed long handle; /* remote object */
- };
-
- /* extra data associated with local object */
- void *cookie;
-};
-
-/*
- * On 64-bit platforms where user code may run in 32-bits the driver must
- * translate the buffer (and local binder) addresses apropriately.
- */
-
-struct binder_write_read {
- signed long write_size; /* bytes to write */
- signed long write_consumed; /* bytes consumed by driver */
- unsigned long write_buffer;
- signed long read_size; /* bytes to read */
- signed long read_consumed; /* bytes consumed by driver */
- unsigned long read_buffer;
-};
-
-/* Use with BINDER_VERSION, driver fills in fields. */
-struct binder_version {
- /* driver protocol version -- increment with incompatible change */
- signed long protocol_version;
-};
-
-/* This is the current protocol version. */
-#define BINDER_CURRENT_PROTOCOL_VERSION 7
-
-#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
-#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, int64_t)
-#define BINDER_SET_MAX_THREADS _IOW('b', 5, size_t)
-#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, int)
-#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, int)
-#define BINDER_THREAD_EXIT _IOW('b', 8, int)
-#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
-
-/*
- * NOTE: Two special error codes you should check for when calling
- * in to the driver are:
- *
- * EINTR -- The operation has been interupted. This should be
- * handled by retrying the ioctl() until a different error code
- * is returned.
- *
- * ECONNREFUSED -- The driver is no longer accepting operations
- * from your process. That is, the process is being destroyed.
- * You should handle this by exiting from your process. Note
- * that once this error code is returned, all further calls to
- * the driver from any thread will return this same code.
- */
-
-enum transaction_flags {
- TF_ONE_WAY = 0x01, /* this is a one-way call: async, no return */
- TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */
- TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */
- TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */
-};
-
-struct binder_transaction_data {
- /* The first two are only used for bcTRANSACTION and brTRANSACTION,
- * identifying the target and contents of the transaction.
- */
- union {
- size_t handle; /* target descriptor of command transaction */
- void *ptr; /* target descriptor of return transaction */
- } target;
- void *cookie; /* target object cookie */
- unsigned int code; /* transaction command */
-
- /* General information about the transaction. */
- unsigned int flags;
- pid_t sender_pid;
- uid_t sender_euid;
- size_t data_size; /* number of bytes of data */
- size_t offsets_size; /* number of bytes of offsets */
-
- /* If this transaction is inline, the data immediately
- * follows here; otherwise, it ends with a pointer to
- * the data buffer.
- */
- union {
- struct {
- /* transaction data */
- const void *buffer;
- /* offsets from buffer to flat_binder_object structs */
- const void *offsets;
- } ptr;
- uint8_t buf[8];
- } data;
-};
-
-struct binder_ptr_cookie {
- void *ptr;
- void *cookie;
-};
-
-struct binder_pri_desc {
- int priority;
- int desc;
-};
-
-struct binder_pri_ptr_cookie {
- int priority;
- void *ptr;
- void *cookie;
-};
-
-enum BinderDriverReturnProtocol {
- BR_ERROR = _IOR('r', 0, int),
- /*
- * int: error code
- */
-
- BR_OK = _IO('r', 1),
- /* No parameters! */
-
- BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
- BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
- /*
- * binder_transaction_data: the received command.
- */
-
- BR_ACQUIRE_RESULT = _IOR('r', 4, int),
- /*
- * not currently supported
- * int: 0 if the last bcATTEMPT_ACQUIRE was not successful.
- * Else the remote object has acquired a primary reference.
- */
-
- BR_DEAD_REPLY = _IO('r', 5),
- /*
- * The target of the last transaction (either a bcTRANSACTION or
- * a bcATTEMPT_ACQUIRE) is no longer with us. No parameters.
- */
-
- BR_TRANSACTION_COMPLETE = _IO('r', 6),
- /*
- * No parameters... always refers to the last transaction requested
- * (including replies). Note that this will be sent even for
- * asynchronous transactions.
- */
-
- BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie),
- BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie),
- BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie),
- BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie),
- /*
- * void *: ptr to binder
- * void *: cookie for binder
- */
-
- BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie),
- /*
- * not currently supported
- * int: priority
- * void *: ptr to binder
- * void *: cookie for binder
- */
-
- BR_NOOP = _IO('r', 12),
- /*
- * No parameters. Do nothing and examine the next command. It exists
- * primarily so that we can replace it with a BR_SPAWN_LOOPER command.
- */
-
- BR_SPAWN_LOOPER = _IO('r', 13),
- /*
- * No parameters. The driver has determined that a process has no
- * threads waiting to service incomming transactions. When a process
- * receives this command, it must spawn a new service thread and
- * register it via bcENTER_LOOPER.
- */
-
- BR_FINISHED = _IO('r', 14),
- /*
- * not currently supported
- * stop threadpool thread
- */
-
- BR_DEAD_BINDER = _IOR('r', 15, void *),
- /*
- * void *: cookie
- */
- BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, void *),
- /*
- * void *: cookie
- */
-
- BR_FAILED_REPLY = _IO('r', 17),
- /*
- * The the last transaction (either a bcTRANSACTION or
- * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters.
- */
-};
-
-enum BinderDriverCommandProtocol {
- BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
- BC_REPLY = _IOW('c', 1, struct binder_transaction_data),
- /*
- * binder_transaction_data: the sent command.
- */
-
- BC_ACQUIRE_RESULT = _IOW('c', 2, int),
- /*
- * not currently supported
- * int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful.
- * Else you have acquired a primary reference on the object.
- */
-
- BC_FREE_BUFFER = _IOW('c', 3, int),
- /*
- * void *: ptr to transaction data received on a read
- */
-
- BC_INCREFS = _IOW('c', 4, int),
- BC_ACQUIRE = _IOW('c', 5, int),
- BC_RELEASE = _IOW('c', 6, int),
- BC_DECREFS = _IOW('c', 7, int),
- /*
- * int: descriptor
- */
-
- BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie),
- BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie),
- /*
- * void *: ptr to binder
- * void *: cookie for binder
- */
-
- BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc),
- /*
- * not currently supported
- * int: priority
- * int: descriptor
- */
-
- BC_REGISTER_LOOPER = _IO('c', 11),
- /*
- * No parameters.
- * Register a spawned looper thread with the device.
- */
-
- BC_ENTER_LOOPER = _IO('c', 12),
- BC_EXIT_LOOPER = _IO('c', 13),
- /*
- * No parameters.
- * These two commands are sent as an application-level thread
- * enters and exits the binder loop, respectively. They are
- * used so the binder can have an accurate count of the number
- * of looping threads it has available.
- */
-
- BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_ptr_cookie),
- /*
- * void *: ptr to binder
- * void *: cookie
- */
-
- BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_ptr_cookie),
- /*
- * void *: ptr to binder
- * void *: cookie
- */
-
- BC_DEAD_BINDER_DONE = _IOW('c', 16, void *),
- /*
- * void *: cookie
- */
-};
-
-#endif /* _LINUX_BINDER_H */
-
diff --git a/drivers/staging/android/logger.c b/drivers/staging/android/logger.c
deleted file mode 100644
index 6c10b456c6cc..000000000000
--- a/drivers/staging/android/logger.c
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * drivers/misc/logger.c
- *
- * A Logging Subsystem
- *
- * Copyright (C) 2007-2008 Google, Inc.
- *
- * Robert Love <rlove@google.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- */
-
-#include <linux/module.h>
-#include <linux/fs.h>
-#include <linux/miscdevice.h>
-#include <linux/uaccess.h>
-#include <linux/poll.h>
-#include <linux/time.h>
-#include "logger.h"
-
-#include <asm/ioctls.h>
-
-/*
- * struct logger_log - represents a specific log, such as 'main' or 'radio'
- *
- * This structure lives from module insertion until module removal, so it does
- * not need additional reference counting. The structure is protected by the
- * mutex 'mutex'.
- */
-struct logger_log {
- unsigned char *buffer;/* the ring buffer itself */
- struct miscdevice misc; /* misc device representing the log */
- wait_queue_head_t wq; /* wait queue for readers */
- struct list_head readers; /* this log's readers */
- struct mutex mutex; /* mutex protecting buffer */
- size_t w_off; /* current write head offset */
- size_t head; /* new readers start here */
- size_t size; /* size of the log */
-};
-
-/*
- * struct logger_reader - a logging device open for reading
- *
- * This object lives from open to release, so we don't need additional
- * reference counting. The structure is protected by log->mutex.
- */
-struct logger_reader {
- struct logger_log *log; /* associated log */
- struct list_head list; /* entry in logger_log's list */
- size_t r_off; /* current read head offset */
-};
-
-/* logger_offset - returns index 'n' into the log via (optimized) modulus */
-#define logger_offset(n) ((n) & (log->size - 1))
-
-/*
- * file_get_log - Given a file structure, return the associated log
- *
- * This isn't aesthetic. We have several goals:
- *
- * 1) Need to quickly obtain the associated log during an I/O operation
- * 2) Readers need to maintain state (logger_reader)
- * 3) Writers need to be very fast (open() should be a near no-op)
- *
- * In the reader case, we can trivially go file->logger_reader->logger_log.
- * For a writer, we don't want to maintain a logger_reader, so we just go
- * file->logger_log. Thus what file->private_data points at depends on whether
- * or not the file was opened for reading. This function hides that dirtiness.
- */
-static inline struct logger_log *file_get_log(struct file *file)
-{
- if (file->f_mode & FMODE_READ) {
- struct logger_reader *reader = file->private_data;
- return reader->log;
- } else
- return file->private_data;
-}
-
-/*
- * get_entry_len - Grabs the length of the payload of the next entry starting
- * from 'off'.
- *
- * Caller needs to hold log->mutex.
- */
-static __u32 get_entry_len(struct logger_log *log, size_t off)
-{
- __u16 val;
-
- switch (log->size - off) {
- case 1:
- memcpy(&val, log->buffer + off, 1);
- memcpy(((char *) &val) + 1, log->buffer, 1);
- break;
- default:
- memcpy(&val, log->buffer + off, 2);
- }
-
- return sizeof(struct logger_entry) + val;
-}
-
-/*
- * do_read_log_to_user - reads exactly 'count' bytes from 'log' into the
- * user-space buffer 'buf'. Returns 'count' on success.
- *
- * Caller must hold log->mutex.
- */
-static ssize_t do_read_log_to_user(struct logger_log *log,
- struct logger_reader *reader,
- char __user *buf,
- size_t count)
-{
- size_t len;
-
- /*
- * We read from the log in two disjoint operations. First, we read from
- * the current read head offset up to 'count' bytes or to the end of
- * the log, whichever comes first.
- */
- len = min(count, log->size - reader->r_off);
- if (copy_to_user(buf, log->buffer + reader->r_off, len))
- return -EFAULT;
-
- /*
- * Second, we read any remaining bytes, starting back at the head of
- * the log.
- */
- if (count != len)
- if (copy_to_user(buf + len, log->buffer, count - len))
- return -EFAULT;
-
- reader->r_off = logger_offset(reader->r_off + count);
-
- return count;
-}
-
-/*
- * logger_read - our log's read() method
- *
- * Behavior:
- *
- * - O_NONBLOCK works
- * - If there are no log entries to read, blocks until log is written to
- * - Atomically reads exactly one log entry
- *
- * Optimal read size is LOGGER_ENTRY_MAX_LEN. Will set errno to EINVAL if read
- * buffer is insufficient to hold next entry.
- */
-static ssize_t logger_read(struct file *file, char __user *buf,
- size_t count, loff_t *pos)
-{
- struct logger_reader *reader = file->private_data;
- struct logger_log *log = reader->log;
- ssize_t ret;
- DEFINE_WAIT(wait);
-
-start:
- while (1) {
- prepare_to_wait(&log->wq, &wait, TASK_INTERRUPTIBLE);
-
- mutex_lock(&log->mutex);
- ret = (log->w_off == reader->r_off);
- mutex_unlock(&log->mutex);
- if (!ret)
- break;
-
- if (file->f_flags & O_NONBLOCK) {
- ret = -EAGAIN;
- break;
- }
-
- if (signal_pending(current)) {
- ret = -EINTR;
- break;
- }
-
- schedule();
- }
-
- finish_wait(&log->wq, &wait);
- if (ret)
- return ret;
-
- mutex_lock(&log->mutex);
-
- /* is there still something to read or did we race? */
- if (unlikely(log->w_off == reader->r_off)) {
- mutex_unlock(&log->mutex);
- goto start;
- }
-
- /* get the size of the next entry */
- ret = get_entry_len(log, reader->r_off);
- if (count < ret) {
- ret = -EINVAL;
- goto out;
- }
-
- /* get exactly one entry from the log */
- ret = do_read_log_to_user(log, reader, buf, ret);
-
-out:
- mutex_unlock(&log->mutex);
-
- return ret;
-}
-
-/*
- * get_next_entry - return the offset of the first valid entry at least 'len'
- * bytes after 'off'.
- *
- * Caller must hold log->mutex.
- */
-static size_t get_next_entry(struct logger_log *log, size_t off, size_t len)
-{
- size_t count = 0;
-
- do {
- size_t nr = get_entry_len(log, off);
- off = logger_offset(off + nr);
- count += nr;
- } while (count < len);
-
- return off;
-}
-
-/*
- * clock_interval - is a < c < b in mod-space? Put another way, does the line
- * from a to b cross c?
- */
-static inline int clock_interval(size_t a, size_t b, size_t c)
-{
- if (b < a) {
- if (a < c || b >= c)
- return 1;
- } else {
- if (a < c && b >= c)
- return 1;
- }
-
- return 0;
-}
-
-/*
- * fix_up_readers - walk the list of all readers and "fix up" any who were
- * lapped by the writer; also do the same for the default "start head".
- * We do this by "pulling forward" the readers and start head to the first
- * entry after the new write head.
- *
- * The caller needs to hold log->mutex.
- */
-static void fix_up_readers(struct logger_log *log, size_t len)
-{
- size_t old = log->w_off;
- size_t new = logger_offset(old + len);
- struct logger_reader *reader;
-
- if (clock_interval(old, new, log->head))
- log->head = get_next_entry(log, log->head, len);
-
- list_for_each_entry(reader, &log->readers, list)
- if (clock_interval(old, new, reader->r_off))
- reader->r_off = get_next_entry(log, reader->r_off, len);
-}
-
-/*
- * do_write_log - writes 'len' bytes from 'buf' to 'log'
- *
- * The caller needs to hold log->mutex.
- */
-static void do_write_log(struct logger_log *log, const void *buf, size_t count)
-{
- size_t len;
-
- len = min(count, log->size - log->w_off);
- memcpy(log->buffer + log->w_off, buf, len);
-
- if (count != len)
- memcpy(log->buffer, buf + len, count - len);
-
- log->w_off = logger_offset(log->w_off + count);
-
-}
-
-/*
- * do_write_log_user - writes 'len' bytes from the user-space buffer 'buf' to
- * the log 'log'
- *
- * The caller needs to hold log->mutex.
- *
- * Returns 'count' on success, negative error code on failure.
- */
-static ssize_t do_write_log_from_user(struct logger_log *log,
- const void __user *buf, size_t count)
-{
- size_t len;
-
- len = min(count, log->size - log->w_off);
- if (len && copy_from_user(log->buffer + log->w_off, buf, len))
- return -EFAULT;
-
- if (count != len)
- if (copy_from_user(log->buffer, buf + len, count - len))
- return -EFAULT;
-
- log->w_off = logger_offset(log->w_off + count);
-
- return count;
-}
-
-/*
- * logger_aio_write - our write method, implementing support for write(),
- * writev(), and aio_write(). Writes are our fast path, and we try to optimize
- * them above all else.
- */
-ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov,
- unsigned long nr_segs, loff_t ppos)
-{
- struct logger_log *log = file_get_log(iocb->ki_filp);
- size_t orig = log->w_off;
- struct logger_entry header;
- struct timespec now;
- ssize_t ret = 0;
-
- now = current_kernel_time();
-
- header.pid = current->tgid;
- header.tid = current->pid;
- header.sec = now.tv_sec;
- header.nsec = now.tv_nsec;
- header.len = min_t(size_t, iocb->ki_left, LOGGER_ENTRY_MAX_PAYLOAD);
-
- /* null writes succeed, return zero */
- if (unlikely(!header.len))
- return 0;
-
- mutex_lock(&log->mutex);
-
- /*
- * Fix up any readers, pulling them forward to the first readable
- * entry after (what will be) the new write offset. We do this now
- * because if we partially fail, we can end up with clobbered log
- * entries that encroach on readable buffer.
- */
- fix_up_readers(log, sizeof(struct logger_entry) + header.len);
-
- do_write_log(log, &header, sizeof(struct logger_entry));
-
- while (nr_segs-- > 0) {
- size_t len;
- ssize_t nr;
-
- /* figure out how much of this vector we can keep */
- len = min_t(size_t, iov->iov_len, header.len - ret);
-
- /* write out this segment's payload */
- nr = do_write_log_from_user(log, iov->iov_base, len);
- if (unlikely(nr < 0)) {
- log->w_off = orig;
- mutex_unlock(&log->mutex);
- return nr;
- }
-
- iov++;
- ret += nr;
- }
-
- mutex_unlock(&log->mutex);
-
- /* wake up any blocked readers */
- wake_up_interruptible(&log->wq);
-
- return ret;
-}
-
-static struct logger_log *get_log_from_minor(int);
-
-/*
- * logger_open - the log's open() file operation
- *
- * Note how near a no-op this is in the write-only case. Keep it that way!
- */
-static int logger_open(struct inode *inode, struct file *file)
-{
- struct logger_log *log;
- int ret;
-
- ret = nonseekable_open(inode, file);
- if (ret)
- return ret;
-
- log = get_log_from_minor(MINOR(inode->i_rdev));
- if (!log)
- return -ENODEV;
-
- if (file->f_mode & FMODE_READ) {
- struct logger_reader *reader;
-
- reader = kmalloc(sizeof(struct logger_reader), GFP_KERNEL);
- if (!reader)
- return -ENOMEM;
-
- reader->log = log;
- INIT_LIST_HEAD(&reader->list);
-
- mutex_lock(&log->mutex);
- reader->r_off = log->head;
- list_add_tail(&reader->list, &log->readers);
- mutex_unlock(&log->mutex);
-
- file->private_data = reader;
- } else
- file->private_data = log;
-
- return 0;
-}
-
-/*
- * logger_release - the log's release file operation
- *
- * Note this is a total no-op in the write-only case. Keep it that way!
- */
-static int logger_release(struct inode *ignored, struct file *file)
-{
- if (file->f_mode & FMODE_READ) {
- struct logger_reader *reader = file->private_data;
- list_del(&reader->list);
- kfree(reader);
- }
-
- return 0;
-}
-
-/*
- * logger_poll - the log's poll file operation, for poll/select/epoll
- *
- * Note we always return POLLOUT, because you can always write() to the log.
- * Note also that, strictly speaking, a return value of POLLIN does not
- * guarantee that the log is readable without blocking, as there is a small
- * chance that the writer can lap the reader in the interim between poll()
- * returning and the read() request.
- */
-static unsigned int logger_poll(struct file *file, poll_table *wait)
-{
- struct logger_reader *reader;
- struct logger_log *log;
- unsigned int ret = POLLOUT | POLLWRNORM;
-
- if (!(file->f_mode & FMODE_READ))
- return ret;
-
- reader = file->private_data;
- log = reader->log;
-
- poll_wait(file, &log->wq, wait);
-
- mutex_lock(&log->mutex);
- if (log->w_off != reader->r_off)
- ret |= POLLIN | POLLRDNORM;
- mutex_unlock(&log->mutex);
-
- return ret;
-}
-
-static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
-{
- struct logger_log *log = file_get_log(file);
- struct logger_reader *reader;
- long ret = -ENOTTY;
-
- mutex_lock(&log->mutex);
-
- switch (cmd) {
- case LOGGER_GET_LOG_BUF_SIZE:
- ret = log->size;
- break;
- case LOGGER_GET_LOG_LEN:
- if (!(file->f_mode & FMODE_READ)) {
- ret = -EBADF;
- break;
- }
- reader = file->private_data;
- if (log->w_off >= reader->r_off)
- ret = log->w_off - reader->r_off;
- else
- ret = (log->size - reader->r_off) + log->w_off;
- break;
- case LOGGER_GET_NEXT_ENTRY_LEN:
- if (!(file->f_mode & FMODE_READ)) {
- ret = -EBADF;
- break;
- }
- reader = file->private_data;
- if (log->w_off != reader->r_off)
- ret = get_entry_len(log, reader->r_off);
- else
- ret = 0;
- break;
- case LOGGER_FLUSH_LOG:
- if (!(file->f_mode & FMODE_WRITE)) {
- ret = -EBADF;
- break;
- }
- list_for_each_entry(reader, &log->readers, list)
- reader->r_off = log->w_off;
- log->head = log->w_off;
- ret = 0;
- break;
- }
-
- mutex_unlock(&log->mutex);
-
- return ret;
-}
-
-static const struct file_operations logger_fops = {
- .owner = THIS_MODULE,
- .read = logger_read,
- .aio_write = logger_aio_write,
- .poll = logger_poll,
- .unlocked_ioctl = logger_ioctl,
- .compat_ioctl = logger_ioctl,
- .open = logger_open,
- .release = logger_release,
-};
-
-/*
- * Defines a log structure with name 'NAME' and a size of 'SIZE' bytes, which
- * must be a power of two, greater than LOGGER_ENTRY_MAX_LEN, and less than
- * LONG_MAX minus LOGGER_ENTRY_MAX_LEN.
- */
-#define DEFINE_LOGGER_DEVICE(VAR, NAME, SIZE) \
-static unsigned char _buf_ ## VAR[SIZE]; \
-static struct logger_log VAR = { \
- .buffer = _buf_ ## VAR, \
- .misc = { \
- .minor = MISC_DYNAMIC_MINOR, \
- .name = NAME, \
- .fops = &logger_fops, \
- .parent = NULL, \
- }, \
- .wq = __WAIT_QUEUE_HEAD_INITIALIZER(VAR .wq), \
- .readers = LIST_HEAD_INIT(VAR .readers), \
- .mutex = __MUTEX_INITIALIZER(VAR .mutex), \
- .w_off = 0, \
- .head = 0, \
- .size = SIZE, \
-};
-
-DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
-DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
-DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
-
-static struct logger_log *get_log_from_minor(int minor)
-{
- if (log_main.misc.minor == minor)
- return &log_main;
- if (log_events.misc.minor == minor)
- return &log_events;
- if (log_radio.misc.minor == minor)
- return &log_radio;
- return NULL;
-}
-
-static int __init init_log(struct logger_log *log)
-{
- int ret;
-
- ret = misc_register(&log->misc);
- if (unlikely(ret)) {
- printk(KERN_ERR "logger: failed to register misc "
- "device for log '%s'!\n", log->misc.name);
- return ret;
- }
-
- printk(KERN_INFO "logger: created %luK log '%s'\n",
- (unsigned long) log->size >> 10, log->misc.name);
-
- return 0;
-}
-
-static int __init logger_init(void)
-{
- int ret;
-
- ret = init_log(&log_main);
- if (unlikely(ret))
- goto out;
-
- ret = init_log(&log_events);
- if (unlikely(ret))
- goto out;
-
- ret = init_log(&log_radio);
- if (unlikely(ret))
- goto out;
-
-out:
- return ret;
-}
-device_initcall(logger_init);
diff --git a/drivers/staging/android/logger.h b/drivers/staging/android/logger.h
deleted file mode 100644
index a562434d7419..000000000000
--- a/drivers/staging/android/logger.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* include/linux/logger.h
- *
- * Copyright (C) 2007-2008 Google, Inc.
- * Author: Robert Love <rlove@android.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#ifndef _LINUX_LOGGER_H
-#define _LINUX_LOGGER_H
-
-#include <linux/types.h>
-#include <linux/ioctl.h>
-
-struct logger_entry {
- __u16 len; /* length of the payload */
- __u16 __pad; /* no matter what, we get 2 bytes of padding */
- __s32 pid; /* generating process's pid */
- __s32 tid; /* generating process's tid */
- __s32 sec; /* seconds since Epoch */
- __s32 nsec; /* nanoseconds */
- char msg[0]; /* the entry's payload */
-};
-
-#define LOGGER_LOG_RADIO "log_radio" /* radio-related messages */
-#define LOGGER_LOG_EVENTS "log_events" /* system/hardware events */
-#define LOGGER_LOG_MAIN "log_main" /* everything else */
-
-#define LOGGER_ENTRY_MAX_LEN (4*1024)
-#define LOGGER_ENTRY_MAX_PAYLOAD \
- (LOGGER_ENTRY_MAX_LEN - sizeof(struct logger_entry))
-
-#define __LOGGERIO 0xAE
-
-#define LOGGER_GET_LOG_BUF_SIZE _IO(__LOGGERIO, 1) /* size of log */
-#define LOGGER_GET_LOG_LEN _IO(__LOGGERIO, 2) /* used log len */
-#define LOGGER_GET_NEXT_ENTRY_LEN _IO(__LOGGERIO, 3) /* next entry len */
-#define LOGGER_FLUSH_LOG _IO(__LOGGERIO, 4) /* flush log */
-
-#endif /* _LINUX_LOGGER_H */
diff --git a/drivers/staging/android/lowmemorykiller.c b/drivers/staging/android/lowmemorykiller.c
deleted file mode 100644
index 935d281a201a..000000000000
--- a/drivers/staging/android/lowmemorykiller.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* drivers/misc/lowmemorykiller.c
- *
- * The lowmemorykiller driver lets user-space specify a set of memory thresholds
- * where processes with a range of oom_adj values will get killed. Specify the
- * minimum oom_adj values in /sys/module/lowmemorykiller/parameters/adj and the
- * number of free pages in /sys/module/lowmemorykiller/parameters/minfree. Both
- * files take a comma separated list of numbers in ascending order.
- *
- * For example, write "0,8" to /sys/module/lowmemorykiller/parameters/adj and
- * "1024,4096" to /sys/module/lowmemorykiller/parameters/minfree to kill processes
- * with a oom_adj value of 8 or higher when the free memory drops below 4096 pages
- * and kill processes with a oom_adj value of 0 or higher when the free memory
- * drops below 1024 pages.
- *
- * The driver considers memory used for caches to be free, but if a large
- * percentage of the cached memory is locked this can be very inaccurate
- * and processes may not get killed until the normal oom killer is triggered.
- *
- * Copyright (C) 2007-2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/module.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/oom.h>
-#include <linux/sched.h>
-
-static uint32_t lowmem_debug_level = 2;
-static int lowmem_adj[6] = {
- 0,
- 1,
- 6,
- 12,
-};
-static int lowmem_adj_size = 4;
-static size_t lowmem_minfree[6] = {
- 3 * 512, /* 6MB */
- 2 * 1024, /* 8MB */
- 4 * 1024, /* 16MB */
- 16 * 1024, /* 64MB */
-};
-static int lowmem_minfree_size = 4;
-
-#define lowmem_print(level, x...) \
- do { \
- if (lowmem_debug_level >= (level)) \
- printk(x); \
- } while (0)
-
-static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
-{
- struct task_struct *p;
- struct task_struct *selected = NULL;
- int rem = 0;
- int tasksize;
- int i;
- int min_adj = OOM_ADJUST_MAX + 1;
- int selected_tasksize = 0;
- int selected_oom_adj;
- int array_size = ARRAY_SIZE(lowmem_adj);
- int other_free = global_page_state(NR_FREE_PAGES);
- int other_file = global_page_state(NR_FILE_PAGES);
-
- if (lowmem_adj_size < array_size)
- array_size = lowmem_adj_size;
- if (lowmem_minfree_size < array_size)
- array_size = lowmem_minfree_size;
- for (i = 0; i < array_size; i++) {
- if (other_free < lowmem_minfree[i] &&
- other_file < lowmem_minfree[i]) {
- min_adj = lowmem_adj[i];
- break;
- }
- }
- if (nr_to_scan > 0)
- lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n",
- nr_to_scan, gfp_mask, other_free, other_file,
- min_adj);
- rem = global_page_state(NR_ACTIVE_ANON) +
- global_page_state(NR_ACTIVE_FILE) +
- global_page_state(NR_INACTIVE_ANON) +
- global_page_state(NR_INACTIVE_FILE);
- if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
- lowmem_print(5, "lowmem_shrink %d, %x, return %d\n",
- nr_to_scan, gfp_mask, rem);
- return rem;
- }
- selected_oom_adj = min_adj;
-
- read_lock(&tasklist_lock);
- for_each_process(p) {
- struct mm_struct *mm;
- int oom_adj;
-
- task_lock(p);
- mm = p->mm;
- if (!mm) {
- task_unlock(p);
- continue;
- }
- oom_adj = mm->oom_adj;
- if (oom_adj < min_adj) {
- task_unlock(p);
- continue;
- }
- tasksize = get_mm_rss(mm);
- task_unlock(p);
- if (tasksize <= 0)
- continue;
- if (selected) {
- if (oom_adj < selected_oom_adj)
- continue;
- if (oom_adj == selected_oom_adj &&
- tasksize <= selected_tasksize)
- continue;
- }
- selected = p;
- selected_tasksize = tasksize;
- selected_oom_adj = oom_adj;
- lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",
- p->pid, p->comm, oom_adj, tasksize);
- }
- if (selected) {
- lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
- selected->pid, selected->comm,
- selected_oom_adj, selected_tasksize);
- force_sig(SIGKILL, selected);
- rem -= selected_tasksize;
- }
- lowmem_print(4, "lowmem_shrink %d, %x, return %d\n",
- nr_to_scan, gfp_mask, rem);
- read_unlock(&tasklist_lock);
- return rem;
-}
-
-static struct shrinker lowmem_shrinker = {
- .shrink = lowmem_shrink,
- .seeks = DEFAULT_SEEKS * 16
-};
-
-static int __init lowmem_init(void)
-{
- register_shrinker(&lowmem_shrinker);
- return 0;
-}
-
-static void __exit lowmem_exit(void)
-{
- unregister_shrinker(&lowmem_shrinker);
-}
-
-module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
-module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
- S_IRUGO | S_IWUSR);
-module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
- S_IRUGO | S_IWUSR);
-module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
-
-module_init(lowmem_init);
-module_exit(lowmem_exit);
-
-MODULE_LICENSE("GPL");
-
diff --git a/drivers/staging/android/ram_console.c b/drivers/staging/android/ram_console.c
deleted file mode 100644
index 8f18a59744cd..000000000000
--- a/drivers/staging/android/ram_console.c
+++ /dev/null
@@ -1,410 +0,0 @@
-/* drivers/android/ram_console.c
- *
- * Copyright (C) 2007-2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/console.h>
-#include <linux/init.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/proc_fs.h>
-#include <linux/string.h>
-#include <linux/uaccess.h>
-#include <linux/io.h>
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-#include <linux/rslib.h>
-#endif
-
-struct ram_console_buffer {
- uint32_t sig;
- uint32_t start;
- uint32_t size;
- uint8_t data[0];
-};
-
-#define RAM_CONSOLE_SIG (0x43474244) /* DBGC */
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-static char __initdata
- ram_console_old_log_init_buffer[CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE];
-#endif
-static char *ram_console_old_log;
-static size_t ram_console_old_log_size;
-
-static struct ram_console_buffer *ram_console_buffer;
-static size_t ram_console_buffer_size;
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-static char *ram_console_par_buffer;
-static struct rs_control *ram_console_rs_decoder;
-static int ram_console_corrected_bytes;
-static int ram_console_bad_blocks;
-#define ECC_BLOCK_SIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_DATA_SIZE
-#define ECC_SIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_ECC_SIZE
-#define ECC_SYMSIZE CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_SYMBOL_SIZE
-#define ECC_POLY CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION_POLYNOMIAL
-#endif
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
-static void ram_console_encode_rs8(uint8_t *data, size_t len, uint8_t *ecc)
-{
- int i;
- uint16_t par[ECC_SIZE];
- /* Initialize the parity buffer */
- memset(par, 0, sizeof(par));
- encode_rs8(ram_console_rs_decoder, data, len, par, 0);
- for (i = 0; i < ECC_SIZE; i++)
- ecc[i] = par[i];
-}
-
-static int ram_console_decode_rs8(void *data, size_t len, uint8_t *ecc)
-{
- int i;
- uint16_t par[ECC_SIZE];
- for (i = 0; i < ECC_SIZE; i++)
- par[i] = ecc[i];
- return decode_rs8(ram_console_rs_decoder, data, par, len,
- NULL, 0, NULL, 0, NULL);
-}
-#endif
-
-static void ram_console_update(const char *s, unsigned int count)
-{
- struct ram_console_buffer *buffer = ram_console_buffer;
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- uint8_t *buffer_end = buffer->data + ram_console_buffer_size;
- uint8_t *block;
- uint8_t *par;
- int size = ECC_BLOCK_SIZE;
-#endif
- memcpy(buffer->data + buffer->start, s, count);
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- block = buffer->data + (buffer->start & ~(ECC_BLOCK_SIZE - 1));
- par = ram_console_par_buffer +
- (buffer->start / ECC_BLOCK_SIZE) * ECC_SIZE;
- do {
- if (block + ECC_BLOCK_SIZE > buffer_end)
- size = buffer_end - block;
- ram_console_encode_rs8(block, size, par);
- block += ECC_BLOCK_SIZE;
- par += ECC_SIZE;
- } while (block < buffer->data + buffer->start + count);
-#endif
-}
-
-static void ram_console_update_header(void)
-{
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- struct ram_console_buffer *buffer = ram_console_buffer;
- uint8_t *par;
- par = ram_console_par_buffer +
- DIV_ROUND_UP(ram_console_buffer_size, ECC_BLOCK_SIZE) * ECC_SIZE;
- ram_console_encode_rs8((uint8_t *)buffer, sizeof(*buffer), par);
-#endif
-}
-
-static void
-ram_console_write(struct console *console, const char *s, unsigned int count)
-{
- int rem;
- struct ram_console_buffer *buffer = ram_console_buffer;
-
- if (count > ram_console_buffer_size) {
- s += count - ram_console_buffer_size;
- count = ram_console_buffer_size;
- }
- rem = ram_console_buffer_size - buffer->start;
- if (rem < count) {
- ram_console_update(s, rem);
- s += rem;
- count -= rem;
- buffer->start = 0;
- buffer->size = ram_console_buffer_size;
- }
- ram_console_update(s, count);
-
- buffer->start += count;
- if (buffer->size < ram_console_buffer_size)
- buffer->size += count;
- ram_console_update_header();
-}
-
-static struct console ram_console = {
- .name = "ram",
- .write = ram_console_write,
- .flags = CON_PRINTBUFFER | CON_ENABLED,
- .index = -1,
-};
-
-static void __init
-ram_console_save_old(struct ram_console_buffer *buffer, char *dest)
-{
- size_t old_log_size = buffer->size;
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- uint8_t *block;
- uint8_t *par;
- char strbuf[80];
- int strbuf_len;
-
- block = buffer->data;
- par = ram_console_par_buffer;
- while (block < buffer->data + buffer->size) {
- int numerr;
- int size = ECC_BLOCK_SIZE;
- if (block + size > buffer->data + ram_console_buffer_size)
- size = buffer->data + ram_console_buffer_size - block;
- numerr = ram_console_decode_rs8(block, size, par);
- if (numerr > 0) {
-#if 0
- printk(KERN_INFO "ram_console: error in block %p, %d\n",
- block, numerr);
-#endif
- ram_console_corrected_bytes += numerr;
- } else if (numerr < 0) {
-#if 0
- printk(KERN_INFO "ram_console: uncorrectable error in "
- "block %p\n", block);
-#endif
- ram_console_bad_blocks++;
- }
- block += ECC_BLOCK_SIZE;
- par += ECC_SIZE;
- }
- if (ram_console_corrected_bytes || ram_console_bad_blocks)
- strbuf_len = snprintf(strbuf, sizeof(strbuf),
- "\n%d Corrected bytes, %d unrecoverable blocks\n",
- ram_console_corrected_bytes, ram_console_bad_blocks);
- else
- strbuf_len = snprintf(strbuf, sizeof(strbuf),
- "\nNo errors detected\n");
- if (strbuf_len >= sizeof(strbuf))
- strbuf_len = sizeof(strbuf) - 1;
- old_log_size += strbuf_len;
-#endif
-
- if (dest == NULL) {
- dest = kmalloc(old_log_size, GFP_KERNEL);
- if (dest == NULL) {
- printk(KERN_ERR
- "ram_console: failed to allocate buffer\n");
- return;
- }
- }
-
- ram_console_old_log = dest;
- ram_console_old_log_size = old_log_size;
- memcpy(ram_console_old_log,
- &buffer->data[buffer->start], buffer->size - buffer->start);
- memcpy(ram_console_old_log + buffer->size - buffer->start,
- &buffer->data[0], buffer->start);
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- memcpy(ram_console_old_log + old_log_size - strbuf_len,
- strbuf, strbuf_len);
-#endif
-}
-
-static int __init ram_console_init(struct ram_console_buffer *buffer,
- size_t buffer_size, char *old_buf)
-{
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- int numerr;
- uint8_t *par;
-#endif
- ram_console_buffer = buffer;
- ram_console_buffer_size =
- buffer_size - sizeof(struct ram_console_buffer);
-
- if (ram_console_buffer_size > buffer_size) {
- pr_err("ram_console: buffer %p, invalid size %zu, "
- "datasize %zu\n", buffer, buffer_size,
- ram_console_buffer_size);
- return 0;
- }
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
- ram_console_buffer_size -= (DIV_ROUND_UP(ram_console_buffer_size,
- ECC_BLOCK_SIZE) + 1) * ECC_SIZE;
-
- if (ram_console_buffer_size > buffer_size) {
- pr_err("ram_console: buffer %p, invalid size %zu, "
- "non-ecc datasize %zu\n",
- buffer, buffer_size, ram_console_buffer_size);
- return 0;
- }
-
- ram_console_par_buffer = buffer->data + ram_console_buffer_size;
-
-
- /* first consecutive root is 0
- * primitive element to generate roots = 1
- */
- ram_console_rs_decoder = init_rs(ECC_SYMSIZE, ECC_POLY, 0, 1, ECC_SIZE);
- if (ram_console_rs_decoder == NULL) {
- printk(KERN_INFO "ram_console: init_rs failed\n");
- return 0;
- }
-
- ram_console_corrected_bytes = 0;
- ram_console_bad_blocks = 0;
-
- par = ram_console_par_buffer +
- DIV_ROUND_UP(ram_console_buffer_size, ECC_BLOCK_SIZE) * ECC_SIZE;
-
- numerr = ram_console_decode_rs8(buffer, sizeof(*buffer), par);
- if (numerr > 0) {
- printk(KERN_INFO "ram_console: error in header, %d\n", numerr);
- ram_console_corrected_bytes += numerr;
- } else if (numerr < 0) {
- printk(KERN_INFO
- "ram_console: uncorrectable error in header\n");
- ram_console_bad_blocks++;
- }
-#endif
-
- if (buffer->sig == RAM_CONSOLE_SIG) {
- if (buffer->size > ram_console_buffer_size
- || buffer->start > buffer->size)
- printk(KERN_INFO "ram_console: found existing invalid "
- "buffer, size %d, start %d\n",
- buffer->size, buffer->start);
- else {
- printk(KERN_INFO "ram_console: found existing buffer, "
- "size %d, start %d\n",
- buffer->size, buffer->start);
- ram_console_save_old(buffer, old_buf);
- }
- } else {
- printk(KERN_INFO "ram_console: no valid data in buffer "
- "(sig = 0x%08x)\n", buffer->sig);
- }
-
- buffer->sig = RAM_CONSOLE_SIG;
- buffer->start = 0;
- buffer->size = 0;
-
- register_console(&ram_console);
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_ENABLE_VERBOSE
- console_verbose();
-#endif
- return 0;
-}
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-static int __init ram_console_early_init(void)
-{
- return ram_console_init((struct ram_console_buffer *)
- CONFIG_ANDROID_RAM_CONSOLE_EARLY_ADDR,
- CONFIG_ANDROID_RAM_CONSOLE_EARLY_SIZE,
- ram_console_old_log_init_buffer);
-}
-#else
-static int ram_console_driver_probe(struct platform_device *pdev)
-{
- struct resource *res = pdev->resource;
- size_t start;
- size_t buffer_size;
- void *buffer;
-
- if (res == NULL || pdev->num_resources != 1 ||
- !(res->flags & IORESOURCE_MEM)) {
- printk(KERN_ERR "ram_console: invalid resource, %p %d flags "
- "%lx\n", res, pdev->num_resources, res ? res->flags : 0);
- return -ENXIO;
- }
- buffer_size = res->end - res->start + 1;
- start = res->start;
- printk(KERN_INFO "ram_console: got buffer at %zx, size %zx\n",
- start, buffer_size);
- buffer = ioremap(res->start, buffer_size);
- if (buffer == NULL) {
- printk(KERN_ERR "ram_console: failed to map memory\n");
- return -ENOMEM;
- }
-
- return ram_console_init(buffer, buffer_size, NULL/* allocate */);
-}
-
-static struct platform_driver ram_console_driver = {
- .probe = ram_console_driver_probe,
- .driver = {
- .name = "ram_console",
- },
-};
-
-static int __init ram_console_module_init(void)
-{
- int err;
- err = platform_driver_register(&ram_console_driver);
- return err;
-}
-#endif
-
-static ssize_t ram_console_read_old(struct file *file, char __user *buf,
- size_t len, loff_t *offset)
-{
- loff_t pos = *offset;
- ssize_t count;
-
- if (pos >= ram_console_old_log_size)
- return 0;
-
- count = min(len, (size_t)(ram_console_old_log_size - pos));
- if (copy_to_user(buf, ram_console_old_log + pos, count))
- return -EFAULT;
-
- *offset += count;
- return count;
-}
-
-static const struct file_operations ram_console_file_ops = {
- .owner = THIS_MODULE,
- .read = ram_console_read_old,
-};
-
-static int __init ram_console_late_init(void)
-{
- struct proc_dir_entry *entry;
-
- if (ram_console_old_log == NULL)
- return 0;
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
- ram_console_old_log = kmalloc(ram_console_old_log_size, GFP_KERNEL);
- if (ram_console_old_log == NULL) {
- printk(KERN_ERR
- "ram_console: failed to allocate buffer for old log\n");
- ram_console_old_log_size = 0;
- return 0;
- }
- memcpy(ram_console_old_log,
- ram_console_old_log_init_buffer, ram_console_old_log_size);
-#endif
- entry = create_proc_entry("last_kmsg", S_IFREG | S_IRUGO, NULL);
- if (!entry) {
- printk(KERN_ERR "ram_console: failed to create proc entry\n");
- kfree(ram_console_old_log);
- ram_console_old_log = NULL;
- return 0;
- }
-
- entry->proc_fops = &ram_console_file_ops;
- entry->size = ram_console_old_log_size;
- return 0;
-}
-
-#ifdef CONFIG_ANDROID_RAM_CONSOLE_EARLY_INIT
-console_initcall(ram_console_early_init);
-#else
-module_init(ram_console_module_init);
-#endif
-late_initcall(ram_console_late_init);
-
diff --git a/drivers/staging/android/timed_gpio.c b/drivers/staging/android/timed_gpio.c
deleted file mode 100644
index be7cdaa783ae..000000000000
--- a/drivers/staging/android/timed_gpio.c
+++ /dev/null
@@ -1,166 +0,0 @@
-/* drivers/misc/timed_gpio.c
- *
- * Copyright (C) 2008 Google, Inc.
- * Author: Mike Lockwood <lockwood@android.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/hrtimer.h>
-#include <linux/err.h>
-#include <linux/gpio.h>
-
-#include "timed_output.h"
-#include "timed_gpio.h"
-
-
-struct timed_gpio_data {
- struct timed_output_dev dev;
- struct hrtimer timer;
- spinlock_t lock;
- unsigned gpio;
- int max_timeout;
- u8 active_low;
-};
-
-static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer)
-{
- struct timed_gpio_data *data =
- container_of(timer, struct timed_gpio_data, timer);
-
- gpio_direction_output(data->gpio, data->active_low ? 1 : 0);
- return HRTIMER_NORESTART;
-}
-
-static int gpio_get_time(struct timed_output_dev *dev)
-{
- struct timed_gpio_data *data =
- container_of(dev, struct timed_gpio_data, dev);
-
- if (hrtimer_active(&data->timer)) {
- ktime_t r = hrtimer_get_remaining(&data->timer);
- struct timeval t = ktime_to_timeval(r);
- return t.tv_sec * 1000 + t.tv_usec / 1000;
- } else
- return 0;
-}
-
-static void gpio_enable(struct timed_output_dev *dev, int value)
-{
- struct timed_gpio_data *data =
- container_of(dev, struct timed_gpio_data, dev);
- unsigned long flags;
-
- spin_lock_irqsave(&data->lock, flags);
-
- /* cancel previous timer and set GPIO according to value */
- hrtimer_cancel(&data->timer);
- gpio_direction_output(data->gpio, data->active_low ? !value : !!value);
-
- if (value > 0) {
- if (value > data->max_timeout)
- value = data->max_timeout;
-
- hrtimer_start(&data->timer,
- ktime_set(value / 1000, (value % 1000) * 1000000),
- HRTIMER_MODE_REL);
- }
-
- spin_unlock_irqrestore(&data->lock, flags);
-}
-
-static int timed_gpio_probe(struct platform_device *pdev)
-{
- struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
- struct timed_gpio *cur_gpio;
- struct timed_gpio_data *gpio_data, *gpio_dat;
- int i, j, ret = 0;
-
- if (!pdata)
- return -EBUSY;
-
- gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios,
- GFP_KERNEL);
- if (!gpio_data)
- return -ENOMEM;
-
- for (i = 0; i < pdata->num_gpios; i++) {
- cur_gpio = &pdata->gpios[i];
- gpio_dat = &gpio_data[i];
-
- hrtimer_init(&gpio_dat->timer, CLOCK_MONOTONIC,
- HRTIMER_MODE_REL);
- gpio_dat->timer.function = gpio_timer_func;
- spin_lock_init(&gpio_dat->lock);
-
- gpio_dat->dev.name = cur_gpio->name;
- gpio_dat->dev.get_time = gpio_get_time;
- gpio_dat->dev.enable = gpio_enable;
- ret = timed_output_dev_register(&gpio_dat->dev);
- if (ret < 0) {
- for (j = 0; j < i; j++)
- timed_output_dev_unregister(&gpio_data[i].dev);
- kfree(gpio_data);
- return ret;
- }
-
- gpio_dat->gpio = cur_gpio->gpio;
- gpio_dat->max_timeout = cur_gpio->max_timeout;
- gpio_dat->active_low = cur_gpio->active_low;
- gpio_direction_output(gpio_dat->gpio, gpio_dat->active_low);
- }
-
- platform_set_drvdata(pdev, gpio_data);
-
- return 0;
-}
-
-static int timed_gpio_remove(struct platform_device *pdev)
-{
- struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
- struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
- int i;
-
- for (i = 0; i < pdata->num_gpios; i++)
- timed_output_dev_unregister(&gpio_data[i].dev);
-
- kfree(gpio_data);
-
- return 0;
-}
-
-static struct platform_driver timed_gpio_driver = {
- .probe = timed_gpio_probe,
- .remove = timed_gpio_remove,
- .driver = {
- .name = TIMED_GPIO_NAME,
- .owner = THIS_MODULE,
- },
-};
-
-static int __init timed_gpio_init(void)
-{
- return platform_driver_register(&timed_gpio_driver);
-}
-
-static void __exit timed_gpio_exit(void)
-{
- platform_driver_unregister(&timed_gpio_driver);
-}
-
-module_init(timed_gpio_init);
-module_exit(timed_gpio_exit);
-
-MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-MODULE_DESCRIPTION("timed gpio driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/staging/android/timed_gpio.h b/drivers/staging/android/timed_gpio.h
deleted file mode 100644
index a0e15f8be3f7..000000000000
--- a/drivers/staging/android/timed_gpio.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* include/linux/timed_gpio.h
- *
- * Copyright (C) 2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
-*/
-
-#ifndef _LINUX_TIMED_GPIO_H
-#define _LINUX_TIMED_GPIO_H
-
-#define TIMED_GPIO_NAME "timed-gpio"
-
-struct timed_gpio {
- const char *name;
- unsigned gpio;
- int max_timeout;
- u8 active_low;
-};
-
-struct timed_gpio_platform_data {
- int num_gpios;
- struct timed_gpio *gpios;
-};
-
-#endif
diff --git a/drivers/staging/android/timed_output.c b/drivers/staging/android/timed_output.c
deleted file mode 100644
index 62e79180421b..000000000000
--- a/drivers/staging/android/timed_output.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/* drivers/misc/timed_output.c
- *
- * Copyright (C) 2009 Google, Inc.
- * Author: Mike Lockwood <lockwood@android.com>
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/module.h>
-#include <linux/types.h>
-#include <linux/device.h>
-#include <linux/fs.h>
-#include <linux/err.h>
-
-#include "timed_output.h"
-
-static struct class *timed_output_class;
-static atomic_t device_count;
-
-static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
- char *buf)
-{
- struct timed_output_dev *tdev = dev_get_drvdata(dev);
- int remaining = tdev->get_time(tdev);
-
- return sprintf(buf, "%d\n", remaining);
-}
-
-static ssize_t enable_store(
- struct device *dev, struct device_attribute *attr,
- const char *buf, size_t size)
-{
- struct timed_output_dev *tdev = dev_get_drvdata(dev);
- int value;
-
- sscanf(buf, "%d", &value);
- tdev->enable(tdev, value);
-
- return size;
-}
-
-static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, enable_show, enable_store);
-
-static int create_timed_output_class(void)
-{
- if (!timed_output_class) {
- timed_output_class = class_create(THIS_MODULE, "timed_output");
- if (IS_ERR(timed_output_class))
- return PTR_ERR(timed_output_class);
- atomic_set(&device_count, 0);
- }
-
- return 0;
-}
-
-int timed_output_dev_register(struct timed_output_dev *tdev)
-{
- int ret;
-
- if (!tdev || !tdev->name || !tdev->enable || !tdev->get_time)
- return -EINVAL;
-
- ret = create_timed_output_class();
- if (ret < 0)
- return ret;
-
- tdev->index = atomic_inc_return(&device_count);
- tdev->dev = device_create(timed_output_class, NULL,
- MKDEV(0, tdev->index), NULL, tdev->name);
- if (IS_ERR(tdev->dev))
- return PTR_ERR(tdev->dev);
-
- ret = device_create_file(tdev->dev, &dev_attr_enable);
- if (ret < 0)
- goto err_create_file;
-
- dev_set_drvdata(tdev->dev, tdev);
- tdev->state = 0;
- return 0;
-
-err_create_file:
- device_destroy(timed_output_class, MKDEV(0, tdev->index));
- printk(KERN_ERR "timed_output: Failed to register driver %s\n",
- tdev->name);
-
- return ret;
-}
-EXPORT_SYMBOL_GPL(timed_output_dev_register);
-
-void timed_output_dev_unregister(struct timed_output_dev *tdev)
-{
- device_remove_file(tdev->dev, &dev_attr_enable);
- device_destroy(timed_output_class, MKDEV(0, tdev->index));
- dev_set_drvdata(tdev->dev, NULL);
-}
-EXPORT_SYMBOL_GPL(timed_output_dev_unregister);
-
-static int __init timed_output_init(void)
-{
- return create_timed_output_class();
-}
-
-static void __exit timed_output_exit(void)
-{
- class_destroy(timed_output_class);
-}
-
-module_init(timed_output_init);
-module_exit(timed_output_exit);
-
-MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
-MODULE_DESCRIPTION("timed output class driver");
-MODULE_LICENSE("GPL");
diff --git a/drivers/staging/android/timed_output.h b/drivers/staging/android/timed_output.h
deleted file mode 100644
index ec907ab2ff54..000000000000
--- a/drivers/staging/android/timed_output.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* include/linux/timed_output.h
- *
- * Copyright (C) 2008 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
-*/
-
-#ifndef _LINUX_TIMED_OUTPUT_H
-#define _LINUX_TIMED_OUTPUT_H
-
-struct timed_output_dev {
- const char *name;
-
- /* enable the output and set the timer */
- void (*enable)(struct timed_output_dev *sdev, int timeout);
-
- /* returns the current number of milliseconds remaining on the timer */
- int (*get_time)(struct timed_output_dev *sdev);
-
- /* private data */
- struct device *dev;
- int index;
- int state;
-};
-
-extern int timed_output_dev_register(struct timed_output_dev *dev);
-extern void timed_output_dev_unregister(struct timed_output_dev *dev);
-
-#endif
diff --git a/drivers/staging/arlan/Kconfig b/drivers/staging/arlan/Kconfig
new file mode 100644
index 000000000000..0585ed8b4d3e
--- /dev/null
+++ b/drivers/staging/arlan/Kconfig
@@ -0,0 +1,15 @@
+config ARLAN
+ tristate "Aironet Arlan 655 & IC2200 DS support"
+ depends on ISA && !64BIT
+ select WIRELESS_EXT
+ ---help---
+ Aironet makes Arlan, a class of wireless LAN adapters. These use the
+ www.Telxon.com chip, which is also used on several similar cards.
+ This driver is tested on the 655 and IC2200 series cards. Look at
+ <http://www.ylenurme.ee/~elmer/655/> for the latest information.
+
+ The driver is built as two modules, arlan and arlan-proc. The latter
+ is the /proc interface and is not needed most of time.
+
+ On some computers the card ends up in non-valid state after some
+ time. Use a ping-reset script to clear it.
diff --git a/drivers/staging/arlan/Makefile b/drivers/staging/arlan/Makefile
new file mode 100644
index 000000000000..5a84d4402f21
--- /dev/null
+++ b/drivers/staging/arlan/Makefile
@@ -0,0 +1,3 @@
+obj-$(CONFIG_ARLAN) += arlan.o
+
+arlan-objs := arlan-main.o arlan-proc.o
diff --git a/drivers/staging/arlan/TODO b/drivers/staging/arlan/TODO
new file mode 100644
index 000000000000..9bd15a2f6d9e
--- /dev/null
+++ b/drivers/staging/arlan/TODO
@@ -0,0 +1,7 @@
+TODO:
+ - step up and maintain this driver to ensure that it continues
+ to work. Having the hardware for this is pretty much a
+ requirement. If this does not happen, the will be removed in
+ the 2.6.35 kernel release.
+
+Please send patches to Greg Kroah-Hartman <greg@kroah.com>.
diff --git a/drivers/net/wireless/arlan-main.c b/drivers/staging/arlan/arlan-main.c
index 921a082487a1..c321ecceeb39 100644
--- a/drivers/net/wireless/arlan-main.c
+++ b/drivers/staging/arlan/arlan-main.c
@@ -190,7 +190,7 @@ int arlan_command(struct net_device *dev, int command_p)
while (priv->waiting_command_mask & (ARLAN_COMMAND_LONG_WAIT_NOW | ARLAN_COMMAND_WAIT_NOW))
{
if (READSHMB(arlan->resetFlag) ||
- READSHMB(arlan->commandByte)) /* ||
+ READSHMB(arlan->commandByte)) /* ||
(readControlRegister(dev) & ARLAN_ACCESS))
*/
udelay(40);
@@ -303,7 +303,7 @@ int arlan_command(struct net_device *dev, int command_p)
priv->card_polling_interval = HZ / 4;
priv->waiting_command_mask &= ~ARLAN_COMMAND_RESET;
priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK;
-// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RENABLE;
+// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RENABLE;
// priv->waiting_command_mask |= ARLAN_COMMAND_RX;
}
else if (priv->waiting_command_mask & ARLAN_COMMAND_INT_RACK)
@@ -334,8 +334,8 @@ int arlan_command(struct net_device *dev, int command_p)
arlan_interrupt_lancpu(dev);
priv->waiting_command_mask &= ~ARLAN_COMMAND_CONF;
priv->card_polling_interval = HZ / 10;
-// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK;
-// priv->waiting_command_mask |= ARLAN_COMMAND_INT_ENABLE;
+// priv->waiting_command_mask |= ARLAN_COMMAND_INT_RACK;
+// priv->waiting_command_mask |= ARLAN_COMMAND_INT_ENABLE;
priv->waiting_command_mask |= ARLAN_COMMAND_CONF_WAIT;
}
else if (priv->waiting_command_mask & ARLAN_COMMAND_CONF_WAIT)
@@ -386,7 +386,7 @@ int arlan_command(struct net_device *dev, int command_p)
{
if (!test_and_set_bit(0, (void *) &priv->tx_command_given))
{
- if (time_after(jiffies,
+ if (time_after(jiffies,
priv->tx_last_sent + us2ticks(conf->rx_tweak1))
|| time_before(jiffies,
priv->last_rx_int_ack_time + us2ticks(conf->rx_tweak2)))
@@ -407,7 +407,7 @@ int arlan_command(struct net_device *dev, int command_p)
priv->tx_command_given = 0;
priv->card_polling_interval = 1;
}
- }
+ }
else if (arlan_debug & ARLAN_DEBUG_CHAIN_LOCKS)
printk(KERN_ERR "tx command when tx chain locked \n");
}
@@ -433,7 +433,7 @@ int arlan_command(struct net_device *dev, int command_p)
arlan_interrupt_lancpu(dev);
priv->waiting_command_mask &= ~ARLAN_COMMAND_SLOW_POLL;
priv->card_polling_interval = HZ / 3;
- }
+ }
else if (priv->waiting_command_mask & ARLAN_COMMAND_POWERDOWN)
{
setPowerOff(dev);
@@ -574,7 +574,7 @@ static void arlan_registration_timer(unsigned long data)
netif_wake_queue(dev);
if (time_after(priv->tx_last_sent,priv->tx_last_cleared) &&
time_after(jiffies, priv->tx_last_sent * 5*HZ) ){
- arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET);
+ arlan_command(dev, ARLAN_COMMAND_CLEAN_AND_RESET);
priv->tx_last_cleared = jiffies;
}
}
@@ -853,20 +853,20 @@ static int arlan_read_card_configuration(struct net_device *dev)
}
else
conf->radioNodeId = radioNodeId;
-
+
if (SID == SIDUNKNOWN)
{
READSHM(conf->SID, arlan->SID, u_int);
}
else conf->SID = SID;
-
+
if (spreadingCode == spreadingCodeUNKNOWN)
{
READSHM(conf->spreadingCode, arlan->spreadingCode, u_char);
}
else
conf->spreadingCode = spreadingCode;
-
+
if (channelSet == channelSetUNKNOWN)
{
READSHM(conf->channelSet, arlan->channelSet, u_char);
@@ -878,16 +878,16 @@ static int arlan_read_card_configuration(struct net_device *dev)
READSHM(conf->channelNumber, arlan->channelNumber, u_char);
}
else conf->channelNumber = channelNumber;
-
+
READSHM(conf->scramblingDisable, arlan->scramblingDisable, u_char);
READSHM(conf->txAttenuation, arlan->txAttenuation, u_char);
-
+
if (systemId == systemIdUNKNOWN)
{
READSHM(conf->systemId, arlan->systemId, u_int);
- }
+ }
else conf->systemId = systemId;
-
+
READSHM(conf->maxDatagramSize, arlan->maxDatagramSize, u_short);
READSHM(conf->maxFrameSize, arlan->maxFrameSize, u_short);
READSHM(conf->maxRetries, arlan->maxRetries, u_char);
@@ -900,13 +900,13 @@ static int arlan_read_card_configuration(struct net_device *dev)
READSHM(conf->SID, arlan->SID, u_int);
}
else conf->SID = SID;
-
+
if (registrationMode == registrationModeUNKNOWN)
{
READSHM(conf->registrationMode, arlan->registrationMode, u_char);
}
else conf->registrationMode = registrationMode;
-
+
READSHM(conf->registrationFill, arlan->registrationFill, u_char);
READSHM(conf->localTalkAddress, arlan->localTalkAddress, u_char);
READSHM(conf->codeFormat, arlan->codeFormat, u_char);
@@ -921,16 +921,16 @@ static int arlan_read_card_configuration(struct net_device *dev)
READSHM(conf->headerSize, arlan->headerSize, u_short);
READSHM(conf->hardwareType, arlan->hardwareType, u_char);
READSHM(conf->radioType, arlan->radioModule, u_char);
-
+
if (conf->radioType == 0)
conf->radioType = 0xc;
WRITESHM(arlan->configStatus, 0xA5, u_char);
READSHM(tlx415, arlan->configStatus, u_char);
-
+
if (tlx415 != 0xA5)
printk(KERN_INFO "%s tlx415 chip \n", dev->name);
-
+
conf->txClear = 0;
conf->txRetries = 1;
conf->txRouting = 1;
@@ -1054,7 +1054,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num)
dev->tx_queue_len = tx_queue_len;
dev->netdev_ops = &arlan_netdev_ops;
dev->watchdog_timeo = 3*HZ;
-
+
ap->irq_test_done = 0;
ap->Conf = &arlan_conf[num];
@@ -1065,7 +1065,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num)
err = register_netdev(dev);
if (err) {
- release_mem_region(virt_to_phys((void *) dev->mem_start),
+ release_mem_region(virt_to_phys((void *) dev->mem_start),
ARLAN_SHMEM_SIZE);
free_netdev(dev);
return err;
@@ -1075,7 +1075,7 @@ static int __init arlan_setup_device(struct net_device *dev, int num)
return 0;
}
-static int __init arlan_probe_here(struct net_device *dev,
+static int __init arlan_probe_here(struct net_device *dev,
unsigned long memaddr)
{
struct arlan_private *ap = netdev_priv(dev);
@@ -1085,7 +1085,7 @@ static int __init arlan_probe_here(struct net_device *dev,
if (arlan_check_fingerprint(memaddr))
return -ENODEV;
- printk(KERN_NOTICE "%s: Arlan found at %llx, \n ", dev->name,
+ printk(KERN_NOTICE "%s: Arlan found at %llx, \n ", dev->name,
(u64) virt_to_phys((void*)memaddr));
ap->card = (void *) memaddr;
@@ -1138,7 +1138,7 @@ static int arlan_open(struct net_device *dev)
priv->txLast = 0;
priv->tx_command_given = 0;
priv->rx_command_given = 0;
-
+
priv->reRegisterExp = 1;
priv->tx_last_sent = jiffies - 1;
priv->tx_last_cleared = jiffies;
@@ -1175,7 +1175,7 @@ static netdev_tx_t arlan_tx(struct sk_buff *skb, struct net_device *dev)
unsigned char *buf;
ARLAN_DEBUG_ENTRY("arlan_tx");
-
+
length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
buf = skb->data;
@@ -1299,7 +1299,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
}
}
break;
-
+
case 2:
{
IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
@@ -1320,7 +1320,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
RetryOrFail(dev);
}
break;
-
+
case 4:
{
IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
@@ -1343,7 +1343,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
case 6:
{
- IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
+ IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
printk("arlan intr: transmit destination full\n");
priv->bad += 1;
priv->reset = 0;
@@ -1361,7 +1361,7 @@ static void arlan_tx_done_interrupt(struct net_device *dev, int status)
arlan_queue_retransmit(dev);
}
break;
-
+
case 8:
{
IFDEBUG(ARLAN_DEBUG_TX_CHAIN)
@@ -1484,7 +1484,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
printk(KERN_ERR "%s: invalid multicast address length given.\n", dev->name);
dmi = dmi->next;
}
- /* we reach here if multicast filtering is on and packet
+ /* we reach here if multicast filtering is on and packet
* is multicast and not for receive */
goto end_of_interrupt;
}
@@ -1536,7 +1536,7 @@ static void arlan_rx_interrupt(struct net_device *dev, u_char rxStatus, u_short
dev->stats.rx_bytes += pkt_len;
}
break;
-
+
default:
printk(KERN_ERR "arlan intr: received unknown status\n");
dev->stats.rx_crc_errors++;
@@ -1571,7 +1571,7 @@ static void arlan_process_interrupt(struct net_device *dev)
arlan_command(dev, ARLAN_COMMAND_INT_ACK);
arlan_command(dev, ARLAN_COMMAND_INT_ENABLE);
-
+
IFDEBUG(ARLAN_DEBUG_INTERRUPT)
printk(KERN_ERR "%s: got IRQ rx %x tx %x comm %x rxOff %x rxLen %x \n",
dev->name, rxStatus, txStatus, READSHMB(arlan->commandByte),
@@ -1662,7 +1662,7 @@ static irqreturn_t arlan_interrupt(int irq, void *dev_id)
priv->interrupt_ack_requested++;
arlan_process_interrupt(dev);
-
+
priv->irq_test_done = 1;
ARLAN_DEBUG_EXIT("arlan_interrupt");
@@ -1780,7 +1780,7 @@ struct net_device * __init arlan_probe(int unit)
if (arlans_found == MAX_ARLANS)
return ERR_PTR(-ENODEV);
- /*
+ /*
* Reserve space for local data and a copy of the shared memory
* that is used by the /proc interface.
*/
@@ -1792,18 +1792,18 @@ struct net_device * __init arlan_probe(int unit)
if (unit >= 0) {
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
-
+
if (dev->mem_start) {
if (arlan_probe_here(dev, dev->mem_start) == 0)
goto found;
goto not_found;
}
-
+
}
- for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE;
- m <= (int)phys_to_virt(0xDE000);
+ for (m = (int)phys_to_virt(lastFoundAt) + ARLAN_SHMEM_SIZE;
+ m <= (int)phys_to_virt(0xDE000);
m += ARLAN_SHMEM_SIZE)
{
if (arlan_probe_here(dev, m) == 0)
@@ -1843,7 +1843,7 @@ int __init init_module(void)
for (i = 0; i < MAX_ARLANS; i++) {
struct net_device *dev = arlan_probe(i);
- if (IS_ERR(dev))
+ if (IS_ERR(dev))
return PTR_ERR(dev);
}
init_arlan_proc();
@@ -1872,7 +1872,7 @@ void __exit cleanup_module(void)
arlan_command(dev, ARLAN_COMMAND_POWERDOWN );
unregister_netdev(dev);
- release_mem_region(virt_to_phys((void *) dev->mem_start),
+ release_mem_region(virt_to_phys((void *) dev->mem_start),
ARLAN_SHMEM_SIZE);
free_netdev(dev);
arlan_device[i] = NULL;
diff --git a/drivers/net/wireless/arlan-proc.c b/drivers/staging/arlan/arlan-proc.c
index a8b689635a3b..71f890c1d22c 100644
--- a/drivers/net/wireless/arlan-proc.c
+++ b/drivers/staging/arlan/arlan-proc.c
@@ -233,7 +233,7 @@ static void arlan_print_diagnostic_info(struct net_device *dev)
printk("arlan: name= ");
IFDEBUG(1)
-
+
for (i = 0; i < 16; i++)
{
char c;
@@ -364,7 +364,7 @@ static int arlan_setup_card_by_book(struct net_device *dev)
IFDEBUG(50) printk("2nd Noop successfully executed !!\n");
READSHM(irqLevel, arlan->irqLevel, u_char)
-
+
if (irqLevel != dev->irq)
{
IFDEBUG(1) printk(KERN_WARNING "arlan dip switches set irq to %d\n", irqLevel);
@@ -602,11 +602,11 @@ static int arlan_sysctl_info(ctl_table * ctl, int write,
SARLUCN(dumpPtr, 4);
SARLUC(dumpVal);
SARLUC(wireTest);
-
+
/* next 4 seems too long for procfs, over single page ?
SARLUCN( _17, 0x86);
SARLUCN( txBuffer, 0x800);
- SARLUCN( rxBuffer, 0x800);
+ SARLUCN( rxBuffer, 0x800);
SARLUCN( _18, 0x0bff);
*/
@@ -829,7 +829,7 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\
{ .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\
.maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},
-#else
+#else
#define ARLAN_PROC_DEBUG_ENTRIES
#endif
diff --git a/drivers/net/wireless/arlan.h b/drivers/staging/arlan/arlan.h
index fb3ad51a1caf..cf7f5b547361 100644
--- a/drivers/net/wireless/arlan.h
+++ b/drivers/staging/arlan/arlan.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 1997 Cullen Jennings
- * Copyright (C) 1998 Elmer.Joandi@ut.ee, +37-255-13500
+ * Copyright (C) 1998 Elmer.Joandi@ut.ee, +37-255-13500
* GNU General Public License applies
*/
@@ -52,7 +52,7 @@ extern int arlan_entry_debug;
extern int arlan_exit_debug;
extern int testMemory;
extern int arlan_command(struct net_device * dev, int command);
-
+
#define SIDUNKNOWN -1
#define radioNodeIdUNKNOWN -1
#define irqUNKNOWN 0
@@ -65,22 +65,22 @@ extern int arlan_command(struct net_device * dev, int command);
#define registrationModeUNKNOWN -1
-#define IFDEBUG( L ) if ( (L) & arlan_debug )
-#define ARLAN_FAKE_HDR_LEN 12
+#define IFDEBUG( L ) if ( (L) & arlan_debug )
+#define ARLAN_FAKE_HDR_LEN 12
#ifdef ARLAN_DEBUGGING
#define DEBUG 1
#define ARLAN_ENTRY_EXIT_DEBUGGING 1
#define ARLAN_DEBUG(a,b) printk(KERN_DEBUG a, b)
#else
- #define ARLAN_DEBUG(a,b)
+ #define ARLAN_DEBUG(a,b)
#endif
#define ARLAN_SHMEM_SIZE 0x2000
struct arlan_shmem
{
- /* Header Signature */
+ /* Header Signature */
volatile char textRegion[48];
volatile u_char resetFlag;
volatile u_char diagnosticInfo;
@@ -94,7 +94,7 @@ struct arlan_shmem
volatile u_char radioModule;// shows EEPROM, can be overridden at 0x111
volatile u_char defaultChannelSet; // shows EEProm, can be overriiden at 0x10A
volatile u_char _2[47];
-
+
/* Control/Status Block - 0x0080 */
volatile u_char interruptInProgress; /* not used by lancpu */
volatile u_char cntrlRegImage; /* not used by lancpu */
@@ -113,7 +113,7 @@ struct arlan_shmem
volatile u_char rxQuality;
volatile u_char scrambled;
volatile u_char _4[1];
-
+
/* Transmit Status - 0x00b0 */
volatile u_char txStatus;
volatile u_char txAckQuality;
@@ -151,7 +151,7 @@ struct arlan_shmem
volatile u_short routerId;
volatile u_char _10[9];
volatile u_char txAttenuation;
- volatile u_char systemId[4];
+ volatile u_char systemId[4];
volatile u_short globalChecksum;
volatile u_char _11[4];
volatile u_short maxDatagramSize;
@@ -207,19 +207,19 @@ struct arlan_shmem
volatile u_char hostcpuLock;
volatile u_char lancpuLock;
volatile u_char resetTime[18];
-
+
volatile u_char numDatagramsTransmitted[4];
volatile u_char numReTransmissions[4];
volatile u_char numFramesDiscarded[4];
volatile u_char numDatagramsReceived[4];
volatile u_char numDuplicateReceivedFrames[4];
volatile u_char numDatagramsDiscarded[4];
-
+
volatile u_short maxNumReTransmitDatagram;
volatile u_short maxNumReTransmitFrames;
volatile u_short maxNumConsecutiveDuplicateFrames;
/* misaligned here so we have to go to characters */
-
+
volatile u_char numBytesTransmitted[4];
volatile u_char numBytesReceived[4];
volatile u_char numCRCErrors[4];
@@ -259,7 +259,7 @@ struct arlan_conf_stru {
int channelNumber;
int scramblingDisable;
int txAttenuation;
- int systemId;
+ int systemId;
int maxDatagramSize;
int maxFrameSize;
int maxRetries;
@@ -333,7 +333,7 @@ struct arlan_private {
struct arlan_shmem __iomem * card;
struct arlan_shmem * conf;
- struct arlan_conf_stru * Conf;
+ struct arlan_conf_stru * Conf;
int bad;
int reset;
unsigned long lastReset;
@@ -407,7 +407,7 @@ struct arlan_private {
#define TXBuffStart(dev) offsetof(struct arlan_shmem, txBuffer)
#define TXBuffEnd(dev) offsetof(struct arlan_shmem, xxBuffer)
-
+
#define READSHM(to,from,atype) {\
atype tmp;\
memcpy_fromio(&(tmp),&(from),sizeof(atype));\
@@ -491,7 +491,7 @@ struct arlan_private {
#define arlan_lock_card_access(dev){\
writeControlRegister(dev,readControlRegister(dev) & ~ARLAN_ACCESS);}
#define arlan_unlock_card_access(dev){\
- writeControlRegister(dev,readControlRegister(dev) | ARLAN_ACCESS ); }
+ writeControlRegister(dev,readControlRegister(dev) | ARLAN_ACCESS ); }
@@ -525,7 +525,7 @@ struct arlan_private {
| ARLAN_COMMAND_RESET)
-
+
#define ARLAN_DEBUG_CHAIN_LOCKS 0x00001
#define ARLAN_DEBUG_RESET 0x00002
#define ARLAN_DEBUG_TIMING 0x00004
@@ -536,4 +536,4 @@ struct arlan_private {
#define ARLAN_DEBUG_INTERRUPT 0x00080
#define ARLAN_DEBUG_STARTUP 0x00100
#define ARLAN_DEBUG_SHUTDOWN 0x00200
-
+
diff --git a/drivers/staging/b3dfg/b3dfg.c b/drivers/staging/b3dfg/b3dfg.c
index cda26bb493b3..4a43c51c172a 100644
--- a/drivers/staging/b3dfg/b3dfg.c
+++ b/drivers/staging/b3dfg/b3dfg.c
@@ -468,7 +468,6 @@ static int get_wand_status(struct b3dfg_dev *fgdev, int __user *arg)
static int enable_transmission(struct b3dfg_dev *fgdev)
{
- u16 command;
unsigned long flags;
struct device *dev = &fgdev->pdev->dev;
@@ -480,17 +479,6 @@ static int enable_transmission(struct b3dfg_dev *fgdev)
return -EINVAL;
}
- /*
- * Check we're a bus master.
- * TODO: I think we can remove this having added the pci_set_master call
- */
- pci_read_config_word(fgdev->pdev, PCI_COMMAND, &command);
- if (!(command & PCI_COMMAND_MASTER)) {
- dev_err(dev, "not a bus master, force-enabling\n");
- pci_write_config_word(fgdev->pdev, PCI_COMMAND,
- command | PCI_COMMAND_MASTER);
- }
-
spin_lock_irqsave(&fgdev->buffer_lock, flags);
/* Handle racing enable_transmission calls. */
diff --git a/drivers/staging/comedi/comedi.h b/drivers/staging/comedi/comedi.h
index 957b6405dfa7..ccc5cdc008c6 100644
--- a/drivers/staging/comedi/comedi.h
+++ b/drivers/staging/comedi/comedi.h
@@ -24,10 +24,6 @@
#ifndef _COMEDI_H
#define _COMEDI_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#define COMEDI_MAJORVERSION 0
#define COMEDI_MINORVERSION 7
#define COMEDI_MICROVERSION 76
@@ -871,8 +867,4 @@ INSN_CONFIG_ARM */
AMPLC_DIO_GAT_RESERVED7
};
-#ifdef __cplusplus
-}
-#endif
-
#endif /* _COMEDI_H */
diff --git a/drivers/staging/comedi/comedi_compat32.c b/drivers/staging/comedi/comedi_compat32.c
index 9810e37845c7..a9fdcda5db7a 100644
--- a/drivers/staging/comedi/comedi_compat32.c
+++ b/drivers/staging/comedi/comedi_compat32.c
@@ -27,16 +27,12 @@
#define __NO_VERSION__
#include "comedi.h"
#include <linux/smp_lock.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include "comedi_compat32.h"
#ifdef CONFIG_COMPAT
-#ifndef HAVE_COMPAT_IOCTL
-#include <linux/ioctl32.h> /* for (un)register_ioctl32_conversion */
-#endif
-
#define COMEDI32_CHANINFO _IOR(CIO, 3, struct comedi32_chaninfo_struct)
#define COMEDI32_RANGEINFO _IOR(CIO, 8, struct comedi32_rangeinfo_struct)
/* N.B. COMEDI32_CMD and COMEDI_CMD ought to use _IOWR, not _IOR.
@@ -101,22 +97,9 @@ static int translated_ioctl(struct file *file, unsigned int cmd,
if (!file->f_op)
return -ENOTTY;
-#ifdef HAVE_UNLOCKED_IOCTL
- if (file->f_op->unlocked_ioctl) {
- int rc = (int)(*file->f_op->unlocked_ioctl) (file, cmd, arg);
- if (rc == -ENOIOCTLCMD)
- rc = -ENOTTY;
- return rc;
- }
-#endif
- if (file->f_op->ioctl) {
- int rc;
- lock_kernel();
- rc = (*file->f_op->ioctl) (file->f_dentry->d_inode,
- file, cmd, arg);
- unlock_kernel();
- return rc;
- }
+ if (file->f_op->unlocked_ioctl)
+ return file->f_op->unlocked_ioctl(file, cmd, arg);
+
return -ENOTTY;
}
@@ -186,8 +169,8 @@ static int compat_rangeinfo(struct file *file, unsigned long arg)
}
/* Copy 32-bit cmd structure to native cmd structure. */
-static int get_compat_cmd(struct comedi_cmd __user * cmd,
- struct comedi32_cmd_struct __user * cmd32)
+static int get_compat_cmd(struct comedi_cmd __user *cmd,
+ struct comedi32_cmd_struct __user *cmd32)
{
int err;
union {
@@ -237,8 +220,8 @@ static int get_compat_cmd(struct comedi_cmd __user * cmd,
}
/* Copy native cmd structure to 32-bit cmd structure. */
-static int put_compat_cmd(struct comedi32_cmd_struct __user * cmd32,
- struct comedi_cmd __user * cmd)
+static int put_compat_cmd(struct comedi32_cmd_struct __user *cmd32,
+ struct comedi_cmd __user *cmd)
{
int err;
unsigned int temp;
@@ -328,8 +311,8 @@ static int compat_cmdtest(struct file *file, unsigned long arg)
}
/* Copy 32-bit insn structure to native insn structure. */
-static int get_compat_insn(struct comedi_insn __user * insn,
- struct comedi32_insn_struct __user * insn32)
+static int get_compat_insn(struct comedi_insn __user *insn,
+ struct comedi32_insn_struct __user *insn32)
{
int err;
union {
@@ -372,9 +355,9 @@ static int compat_insnlist(struct file *file, unsigned long arg)
insnlist32 = compat_ptr(arg);
/* Get 32-bit insnlist structure. */
- if (!access_ok(VERIFY_READ, insnlist32, sizeof(*insnlist32))) {
+ if (!access_ok(VERIFY_READ, insnlist32, sizeof(*insnlist32)))
return -EFAULT;
- }
+
err = 0;
err |= __get_user(n_insns, &insnlist32->n_insns);
err |= __get_user(uptr, &insnlist32->insns);
@@ -387,9 +370,9 @@ static int compat_insnlist(struct file *file, unsigned long arg)
insn[n_insns]));
/* Set native insnlist structure. */
- if (!access_ok(VERIFY_WRITE, &s->insnlist, sizeof(s->insnlist))) {
+ if (!access_ok(VERIFY_WRITE, &s->insnlist, sizeof(s->insnlist)))
return -EFAULT;
- }
+
err |= __put_user(n_insns, &s->insnlist.n_insns);
err |= __put_user(&s->insn[0], &s->insnlist.insns);
if (err)
@@ -472,8 +455,6 @@ static inline int raw_ioctl(struct file *file, unsigned int cmd,
return rc;
}
-#ifdef HAVE_COMPAT_IOCTL /* defined in <linux/fs.h> 2.6.11 onwards */
-
/* compat_ioctl file operation. */
/* Returns -ENOIOCTLCMD for unrecognised ioctl codes. */
long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
@@ -481,106 +462,4 @@ long comedi_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return raw_ioctl(file, cmd, arg);
}
-#else /* HAVE_COMPAT_IOCTL */
-
-/*
- * Brain-dead ioctl compatibility for 2.6.10 and earlier.
- *
- * It's brain-dead because cmd numbers need to be unique system-wide!
- * The comedi driver could end up attempting to execute ioctls for non-Comedi
- * devices because it registered the system-wide cmd code first. Similarly,
- * another driver could end up attempting to execute ioctls for a Comedi
- * device because it registered the cmd code first. Chaos ensues.
- */
-
-/* Handler for all 32-bit ioctl codes registered by this driver. */
-static int mapped_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg,
- struct file *file)
-{
- int rc;
-
- /* Make sure we are dealing with a Comedi device. */
- if (imajor(file->f_dentry->d_inode) != COMEDI_MAJOR)
- return -ENOTTY;
-
- rc = raw_ioctl(file, cmd, arg);
- /* Do not return -ENOIOCTLCMD. */
- if (rc == -ENOIOCTLCMD)
- rc = -ENOTTY;
-
- return rc;
-}
-
-struct ioctl32_map {
- unsigned int cmd;
- int (*handler) (unsigned int, unsigned int, unsigned long,
- struct file *);
- int registered;
-};
-
-static struct ioctl32_map comedi_ioctl32_map[] = {
- {COMEDI_DEVCONFIG, mapped_ioctl, 0},
- {COMEDI_DEVINFO, mapped_ioctl, 0},
- {COMEDI_SUBDINFO, mapped_ioctl, 0},
- {COMEDI_BUFCONFIG, mapped_ioctl, 0},
- {COMEDI_BUFINFO, mapped_ioctl, 0},
- {COMEDI_LOCK, mapped_ioctl, 0},
- {COMEDI_UNLOCK, mapped_ioctl, 0},
- {COMEDI_CANCEL, mapped_ioctl, 0},
- {COMEDI_POLL, mapped_ioctl, 0},
- {COMEDI32_CHANINFO, mapped_ioctl, 0},
- {COMEDI32_RANGEINFO, mapped_ioctl, 0},
- {COMEDI32_CMD, mapped_ioctl, 0},
- {COMEDI32_CMDTEST, mapped_ioctl, 0},
- {COMEDI32_INSNLIST, mapped_ioctl, 0},
- {COMEDI32_INSN, mapped_ioctl, 0},
-};
-
-#define NUM_IOCTL32_MAPS ARRAY_SIZE(comedi_ioctl32_map)
-
-/* Register system-wide 32-bit ioctl handlers. */
-void comedi_register_ioctl32(void)
-{
- int n, rc;
-
- for (n = 0; n < NUM_IOCTL32_MAPS; n++) {
- rc = register_ioctl32_conversion(comedi_ioctl32_map[n].cmd,
- comedi_ioctl32_map[n].handler);
- if (rc) {
- printk(KERN_WARNING
- "comedi: failed to register 32-bit "
- "compatible ioctl handler for 0x%X - "
- "expect bad things to happen!\n",
- comedi_ioctl32_map[n].cmd);
- }
- comedi_ioctl32_map[n].registered = !rc;
- }
-}
-
-/* Unregister system-wide 32-bit ioctl translations. */
-void comedi_unregister_ioctl32(void)
-{
- int n, rc;
-
- for (n = 0; n < NUM_IOCTL32_MAPS; n++) {
- if (comedi_ioctl32_map[n].registered) {
- rc = unregister_ioctl32_conversion(comedi_ioctl32_map
- [n].cmd,
- comedi_ioctl32_map
- [n].handler);
- if (rc) {
- printk(KERN_ERR
- "comedi: failed to unregister 32-bit "
- "compatible ioctl handler for 0x%X - "
- "expect kernel Oops!\n",
- comedi_ioctl32_map[n].cmd);
- } else {
- comedi_ioctl32_map[n].registered = 0;
- }
- }
- }
-}
-
-#endif /* HAVE_COMPAT_IOCTL */
-
#endif /* CONFIG_COMPAT */
diff --git a/drivers/staging/comedi/comedi_compat32.h b/drivers/staging/comedi/comedi_compat32.h
index fd0f8a3125a1..0340a8949c6b 100644
--- a/drivers/staging/comedi/comedi_compat32.h
+++ b/drivers/staging/comedi/comedi_compat32.h
@@ -28,30 +28,16 @@
#define _COMEDI_COMPAT32_H
#include <linux/compat.h>
-#include <linux/fs.h> /* For HAVE_COMPAT_IOCTL and HAVE_UNLOCKED_IOCTL */
+#include <linux/fs.h>
#ifdef CONFIG_COMPAT
-#ifdef HAVE_COMPAT_IOCTL
-
extern long comedi_compat_ioctl(struct file *file, unsigned int cmd,
unsigned long arg);
-#define comedi_register_ioctl32() do {} while (0)
-#define comedi_unregister_ioctl32() do {} while (0)
-
-#else /* HAVE_COMPAT_IOCTL */
-
-#define comedi_compat_ioctl 0 /* NULL */
-extern void comedi_register_ioctl32(void);
-extern void comedi_unregister_ioctl32(void);
-
-#endif /* HAVE_COMPAT_IOCTL */
#else /* CONFIG_COMPAT */
#define comedi_compat_ioctl 0 /* NULL */
-#define comedi_register_ioctl32() do {} while (0)
-#define comedi_unregister_ioctl32() do {} while (0)
#endif /* CONFIG_COMPAT */
diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index aaad76e0a76a..8117748ad5a5 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -110,13 +110,8 @@ static struct device_attribute dev_attr_read_buffer_kb;
static struct device_attribute dev_attr_max_write_buffer_kb;
static struct device_attribute dev_attr_write_buffer_kb;
-#ifdef HAVE_UNLOCKED_IOCTL
static long comedi_unlocked_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
-#else
-static int comedi_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
-#endif
{
const unsigned minor = iminor(file->f_dentry->d_inode);
struct comedi_device_file_info *dev_file_info =
@@ -1867,14 +1862,8 @@ static int comedi_fasync(int fd, struct file *file, int on)
const struct file_operations comedi_fops = {
.owner = THIS_MODULE,
-#ifdef HAVE_UNLOCKED_IOCTL
.unlocked_ioctl = comedi_unlocked_ioctl,
-#else
- .ioctl = comedi_ioctl,
-#endif
-#ifdef HAVE_COMPAT_IOCTL
.compat_ioctl = comedi_compat_ioctl,
-#endif
.open = comedi_open,
.release = comedi_close,
.read = comedi_read,
@@ -1959,8 +1948,6 @@ static int __init comedi_init(void)
}
}
- comedi_register_ioctl32();
-
return 0;
}
@@ -1977,8 +1964,6 @@ static void __exit comedi_cleanup(void)
unregister_chrdev_region(MKDEV(COMEDI_MAJOR, 0), COMEDI_NUM_MINORS);
comedi_proc_cleanup();
-
- comedi_unregister_ioctl32();
}
module_init(comedi_init);
diff --git a/drivers/staging/comedi/comedidev.h b/drivers/staging/comedi/comedidev.h
index e8a5f7d33e7a..ebdccfdf220e 100644
--- a/drivers/staging/comedi/comedidev.h
+++ b/drivers/staging/comedi/comedidev.h
@@ -49,7 +49,8 @@
} while (0)
#define COMEDI_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
-#define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, COMEDI_MINORVERSION, COMEDI_MICROVERSION)
+#define COMEDI_VERSION_CODE COMEDI_VERSION(COMEDI_MAJORVERSION, \
+ COMEDI_MINORVERSION, COMEDI_MICROVERSION)
#define COMEDI_RELEASE VERSION
#define COMEDI_INITCLEANUP_NOMODULE(x) \
@@ -58,12 +59,12 @@
static void __exit x ## _cleanup_module(void) \
{comedi_driver_unregister(&(x)); } \
module_init(x ## _init_module); \
- module_exit(x ## _cleanup_module); \
+ module_exit(x ## _cleanup_module);
#define COMEDI_MODULE_MACROS \
MODULE_AUTHOR("Comedi http://www.comedi.org"); \
MODULE_DESCRIPTION("Comedi low-level driver"); \
- MODULE_LICENSE("GPL"); \
+ MODULE_LICENSE("GPL");
#define COMEDI_INITCLEANUP(x) \
COMEDI_MODULE_MACROS \
@@ -75,7 +76,8 @@
{ \
return comedi_pci_auto_config(dev, comedi_driver.driver_name); \
} \
- static void __devexit comedi_driver ## _pci_remove(struct pci_dev *dev) \
+ static void __devexit comedi_driver ## _pci_remove(\
+ struct pci_dev *dev) \
{ \
comedi_pci_auto_unconfig(dev); \
} \
@@ -91,7 +93,8 @@
retval = comedi_driver_register(&comedi_driver); \
if (retval < 0) \
return retval; \
- comedi_driver ## _pci_driver.name = (char *)comedi_driver.driver_name; \
+ comedi_driver ## _pci_driver.name = \
+ (char *)comedi_driver.driver_name; \
return pci_register_driver(&comedi_driver ## _pci_driver); \
} \
static void __exit comedi_driver ## _cleanup_module(void) \
@@ -170,14 +173,15 @@ struct comedi_subdevice {
struct comedi_cmd *);
int (*poll) (struct comedi_device *, struct comedi_subdevice *);
int (*cancel) (struct comedi_device *, struct comedi_subdevice *);
- /* int (*do_lock)(struct comedi_device *,struct comedi_subdevice *); */
- /* int (*do_unlock)(struct comedi_device *,struct comedi_subdevice *); */
+ /* int (*do_lock)(struct comedi_device *, struct comedi_subdevice *); */
+ /* int (*do_unlock)(struct comedi_device *, \
+ struct comedi_subdevice *); */
/* called when the buffer changes */
- int (*buf_change) (struct comedi_device * dev,
- struct comedi_subdevice * s, unsigned long new_size);
+ int (*buf_change) (struct comedi_device *dev,
+ struct comedi_subdevice *s, unsigned long new_size);
- void (*munge) (struct comedi_device * dev, struct comedi_subdevice * s,
+ void (*munge) (struct comedi_device *dev, struct comedi_subdevice *s,
void *data, unsigned int num_bytes,
unsigned int start_chan_index);
enum dma_data_direction async_dma_dir;
@@ -198,16 +202,22 @@ struct comedi_async {
void *prealloc_buf; /* pre-allocated buffer */
unsigned int prealloc_bufsz; /* buffer size, in bytes */
- struct comedi_buf_page *buf_page_list; /* virtual and dma address of each page */
+ /* virtual and dma address of each page */
+ struct comedi_buf_page *buf_page_list;
unsigned n_buf_pages; /* num elements in buf_page_list */
unsigned int max_bufsize; /* maximum buffer size, bytes */
- unsigned int mmap_count; /* current number of mmaps of prealloc_buf */
-
- unsigned int buf_write_count; /* byte count for writer (write completed) */
- unsigned int buf_write_alloc_count; /* byte count for writer (allocated for writing) */
- unsigned int buf_read_count; /* byte count for reader (read completed) */
- unsigned int buf_read_alloc_count; /* byte count for reader (allocated for reading) */
+ /* current number of mmaps of prealloc_buf */
+ unsigned int mmap_count;
+
+ /* byte count for writer (write completed) */
+ unsigned int buf_write_count;
+ /* byte count for writer (allocated for writing) */
+ unsigned int buf_write_alloc_count;
+ /* byte count for reader (read completed) */
+ unsigned int buf_read_count;
+ /* byte count for reader (allocated for reading) */
+ unsigned int buf_read_alloc_count;
unsigned int buf_write_ptr; /* buffer marker for writer */
unsigned int buf_read_ptr; /* buffer marker for reader */
@@ -233,7 +243,7 @@ struct comedi_async {
int (*cb_func) (unsigned int flags, void *);
void *cb_arg;
- int (*inttrig) (struct comedi_device * dev, struct comedi_subdevice * s,
+ int (*inttrig) (struct comedi_device *dev, struct comedi_subdevice *s,
unsigned int x);
};
@@ -283,8 +293,8 @@ struct comedi_device {
struct fasync_struct *async_queue;
- void (*open) (struct comedi_device * dev);
- void (*close) (struct comedi_device * dev);
+ void (*open) (struct comedi_device *dev);
+ void (*close) (struct comedi_device *dev);
};
struct comedi_device_file_info {
@@ -318,9 +328,8 @@ static const unsigned COMEDI_SUBDEVICE_MINOR_OFFSET = 1;
struct comedi_device_file_info *comedi_get_device_file_info(unsigned minor);
-static inline struct comedi_subdevice *comedi_get_read_subdevice(const struct
- comedi_device_file_info
- *info)
+static inline struct comedi_subdevice *comedi_get_read_subdevice(
+ const struct comedi_device_file_info *info)
{
if (info->read_subdevice)
return info->read_subdevice;
@@ -329,9 +338,8 @@ static inline struct comedi_subdevice *comedi_get_read_subdevice(const struct
return info->device->read_subdev;
}
-static inline struct comedi_subdevice *comedi_get_write_subdevice(const struct
- comedi_device_file_info
- *info)
+static inline struct comedi_subdevice *comedi_get_write_subdevice(
+ const struct comedi_device_file_info *info)
{
if (info->write_subdevice)
return info->write_subdevice;
diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index dc53aeeac68f..c2a632d31c61 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -387,7 +387,7 @@ static int insn_rw_emulate_bits(struct comedi_device *dev,
return 1;
}
-static inline unsigned long uvirt_to_kva(pgd_t * pgd, unsigned long adr)
+static inline unsigned long uvirt_to_kva(pgd_t *pgd, unsigned long adr)
{
unsigned long ret = 0UL;
pmd_t *pmd;
diff --git a/drivers/staging/comedi/drivers/8253.h b/drivers/staging/comedi/drivers/8253.h
index c2ea2d96f1cc..0bb35db4ea3b 100644
--- a/drivers/staging/comedi/drivers/8253.h
+++ b/drivers/staging/comedi/drivers/8253.h
@@ -206,7 +206,8 @@ static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base,
}
*nanosec = div1 * div2 * i8253_osc_base;
- *d1 = div1 & 0xffff; /* masking is done since counter maps zero to 0x10000 */
+ /* masking is done since counter maps zero to 0x10000 */
+ *d1 = div1 & 0xffff;
*d2 = div2 & 0xffff;
return;
}
diff --git a/drivers/staging/comedi/drivers/8255.c b/drivers/staging/comedi/drivers/8255.c
index 0a50864767e4..10f488f0e5ee 100644
--- a/drivers/staging/comedi/drivers/8255.c
+++ b/drivers/staging/comedi/drivers/8255.c
@@ -132,6 +132,7 @@ void subdev_8255_interrupt(struct comedi_device *dev,
comedi_event(dev, s);
}
+EXPORT_SYMBOL(subdev_8255_interrupt);
static int subdev_8255_cb(int dir, int port, int data, unsigned long arg)
{
@@ -179,15 +180,14 @@ static int subdev_8255_insn_config(struct comedi_device *dev,
unsigned int bits;
mask = 1 << CR_CHAN(insn->chanspec);
- if (mask & 0x0000ff) {
+ if (mask & 0x0000ff)
bits = 0x0000ff;
- } else if (mask & 0x00ff00) {
+ else if (mask & 0x00ff00)
bits = 0x00ff00;
- } else if (mask & 0x0f0000) {
+ else if (mask & 0x0f0000)
bits = 0x0f0000;
- } else {
+ else
bits = 0xf00000;
- }
switch (data[0]) {
case INSN_CONFIG_DIO_INPUT:
@@ -333,11 +333,10 @@ int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
return -ENOMEM;
CALLBACK_ARG = arg;
- if (cb == NULL) {
+ if (cb == NULL)
CALLBACK_FUNC = subdev_8255_cb;
- } else {
+ else
CALLBACK_FUNC = cb;
- }
s->insn_bits = subdev_8255_insn;
s->insn_config = subdev_8255_insn_config;
@@ -347,6 +346,7 @@ int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
return 0;
}
+EXPORT_SYMBOL(subdev_8255_init);
int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long),
@@ -366,6 +366,7 @@ int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
return 0;
}
+EXPORT_SYMBOL(subdev_8255_init_irq);
void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice *s)
{
@@ -378,6 +379,7 @@ void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice *s)
kfree(s->private);
}
}
+EXPORT_SYMBOL(subdev_8255_cleanup);
/*
@@ -448,8 +450,3 @@ static int dev_8255_detach(struct comedi_device *dev)
return 0;
}
-
-EXPORT_SYMBOL(subdev_8255_init);
-EXPORT_SYMBOL(subdev_8255_init_irq);
-EXPORT_SYMBOL(subdev_8255_cleanup);
-EXPORT_SYMBOL(subdev_8255_interrupt);
diff --git a/drivers/staging/comedi/drivers/acl7225b.c b/drivers/staging/comedi/drivers/acl7225b.c
index c3652ef19a5f..e20c3542c069 100644
--- a/drivers/staging/comedi/drivers/acl7225b.c
+++ b/drivers/staging/comedi/drivers/acl7225b.c
@@ -94,10 +94,11 @@ static int acl7225b_attach(struct comedi_device *dev,
iobase = it->options[0];
iorange = this_board->io_range;
- printk("comedi%d: acl7225b: board=%s 0x%04x ", dev->minor,
+ printk(KERN_INFO "comedi%d: acl7225b: board=%s 0x%04x\n", dev->minor,
this_board->name, iobase);
if (!request_region(iobase, iorange, "acl7225b")) {
- printk("I/O port conflict\n");
+ printk(KERN_ERR "comedi%d: request_region failed - I/O port conflict\n",
+ dev->minor);
return -EIO;
}
dev->board_name = this_board->name;
@@ -137,14 +138,12 @@ static int acl7225b_attach(struct comedi_device *dev,
s->range_table = &range_digital;
s->private = (void *)ACL7225_DI_LO;
- printk("\n");
-
return 0;
}
static int acl7225b_detach(struct comedi_device *dev)
{
- printk("comedi%d: acl7225b: remove\n", dev->minor);
+ printk(KERN_INFO "comedi%d: acl7225b: remove\n", dev->minor);
if (dev->iobase)
release_region(dev->iobase, this_board->io_range);
diff --git a/drivers/staging/comedi/drivers/adl_pci6208.c b/drivers/staging/comedi/drivers/adl_pci6208.c
index 8e1befc448a3..6925faaf5293 100644
--- a/drivers/staging/comedi/drivers/adl_pci6208.c
+++ b/drivers/staging/comedi/drivers/adl_pci6208.c
@@ -133,9 +133,11 @@ static int pci6208_ao_winsn(struct comedi_device *dev,
static int pci6208_ao_rinsn(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data);
-/* static int pci6208_dio_insn_bits(struct comedi_device *dev,struct comedi_subdevice *s, */
+/* static int pci6208_dio_insn_bits (struct comedi_device *dev,
+ * struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data); */
-/* static int pci6208_dio_insn_config(struct comedi_device *dev,struct comedi_subdevice *s, */
+/* static int pci6208_dio_insn_config(struct comedi_device *dev,
+ * struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data); */
/*
@@ -151,7 +153,7 @@ static int pci6208_attach(struct comedi_device *dev,
int retval;
unsigned long io_base;
- printk("comedi%d: pci6208: ", dev->minor);
+ printk(KERN_INFO "comedi%d: pci6208: ", dev->minor);
retval = alloc_private(dev, sizeof(struct pci6208_private));
if (retval < 0)
@@ -195,7 +197,7 @@ static int pci6208_attach(struct comedi_device *dev,
/* s->insn_bits = pci6208_dio_insn_bits; */
/* s->insn_config = pci6208_dio_insn_config; */
- printk("attached\n");
+ printk(KERN_INFO "attached\n");
return 1;
}
@@ -210,12 +212,11 @@ static int pci6208_attach(struct comedi_device *dev,
*/
static int pci6208_detach(struct comedi_device *dev)
{
- printk("comedi%d: pci6208: remove\n", dev->minor);
+ printk(KERN_INFO "comedi%d: pci6208: remove\n", dev->minor);
if (devpriv && devpriv->pci_dev) {
- if (dev->iobase) {
+ if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
- }
pci_dev_put(devpriv->pci_dev);
}
@@ -266,7 +267,8 @@ static int pci6208_ao_rinsn(struct comedi_device *dev,
* useful to applications if you implement the insn_bits interface.
* This allows packed reading/writing of the DIO channels. The
* comedi core can convert between insn_bits and insn_read/write */
-/* static int pci6208_dio_insn_bits(struct comedi_device *dev,struct comedi_subdevice *s, */
+/* static int pci6208_dio_insn_bits(struct comedi_device *dev,
+ * struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data) */
/* { */
/* if(insn->n!=2)return -EINVAL; */
@@ -290,7 +292,8 @@ static int pci6208_ao_rinsn(struct comedi_device *dev,
/* return 2; */
/* } */
-/* static int pci6208_dio_insn_config(struct comedi_device *dev,struct comedi_subdevice *s, */
+/* static int pci6208_dio_insn_config(struct comedi_device *dev,
+ * struct comedi_subdevice *s, */
/* struct comedi_insn *insn,unsigned int *data) */
/* { */
/* int chan=CR_CHAN(insn->chanspec); */
@@ -320,10 +323,16 @@ static int pci6208_find_device(struct comedi_device *dev, int bus, int slot)
pci_dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pci_dev)) {
if (pci_dev->vendor == PCI_VENDOR_ID_ADLINK) {
for (i = 0; i < ARRAY_SIZE(pci6208_boards); i++) {
- if (pci6208_boards[i].dev_id == pci_dev->device) {
- /* was a particular bus/slot requested? */
+ if (pci6208_boards[i].dev_id ==
+ pci_dev->device) {
+ /*
+ * was a particular bus/slot requested?
+ */
if ((bus != 0) || (slot != 0)) {
- /* are we on the wrong bus/slot? */
+ /*
+ * are we on the
+ * wrong bus/slot?
+ */
if (pci_dev->bus->number
!= bus ||
PCI_SLOT(pci_dev->devfn)
@@ -338,8 +347,9 @@ static int pci6208_find_device(struct comedi_device *dev, int bus, int slot)
}
}
- printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
- dev->minor, bus, slot);
+ printk(KERN_ERR "comedi%d: no supported board found! "
+ "(req. bus/slot : %d/%d)\n",
+ dev->minor, bus, slot);
return -EIO;
found:
@@ -368,17 +378,20 @@ pci6208_pci_setup(struct pci_dev *pci_dev, unsigned long *io_base_ptr,
/* Enable PCI device and request regions */
if (comedi_pci_enable(pci_dev, PCI6208_DRIVER_NAME) < 0) {
- printk
- ("comedi%d: Failed to enable PCI device and request regions\n",
- dev_minor);
+ printk(KERN_ERR "comedi%d: Failed to enable PCI device "
+ "and request regions\n",
+ dev_minor);
return -EIO;
}
- /* Read local configuration register base address [PCI_BASE_ADDRESS #1]. */
+ /* Read local configuration register
+ * base address [PCI_BASE_ADDRESS #1].
+ */
lcr_io_base = pci_resource_start(pci_dev, 1);
lcr_io_range = pci_resource_len(pci_dev, 1);
- printk("comedi%d: local config registers at address 0x%4lx [0x%4lx]\n",
- dev_minor, lcr_io_base, lcr_io_range);
+ printk(KERN_INFO "comedi%d: local config registers at address"
+ " 0x%4lx [0x%4lx]\n",
+ dev_minor, lcr_io_base, lcr_io_range);
/* Read PCI6208 register base address [PCI_BASE_ADDRESS #2]. */
io_base = pci_resource_start(pci_dev, 2);
diff --git a/drivers/staging/comedi/drivers/adl_pci7296.c b/drivers/staging/comedi/drivers/adl_pci7296.c
index 4de6fadec78b..8602865ae6b7 100644
--- a/drivers/staging/comedi/drivers/adl_pci7296.c
+++ b/drivers/staging/comedi/drivers/adl_pci7296.c
@@ -82,8 +82,7 @@ static int adl_pci7296_attach(struct comedi_device *dev,
int bus, slot;
int ret;
- printk("comedi: attempt to attach...\n");
- printk("comedi%d: adl_pci7432\n", dev->minor);
+ printk(KERN_INFO "comedi%d: attach adl_pci7432\n", dev->minor);
dev->board_name = "pci7432";
bus = it->options[0];
@@ -110,14 +109,14 @@ static int adl_pci7296_attach(struct comedi_device *dev,
}
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7296") < 0) {
- printk
- ("comedi%d: Failed to enable PCI device and request regions\n",
+ printk(KERN_ERR "comedi%d: Failed to enable PCI device and request regions\n",
dev->minor);
return -EIO;
}
dev->iobase = pci_resource_start(pcidev, 2);
- printk("comedi: base addr %4lx\n", dev->iobase);
+ printk(KERN_INFO "comedi: base addr %4lx\n",
+ dev->iobase);
/* four 8255 digital io subdevices */
s = dev->subdevices + 0;
@@ -145,25 +144,25 @@ static int adl_pci7296_attach(struct comedi_device *dev,
if (ret < 0)
return ret;
- printk("attached\n");
+ printk(KERN_DEBUG "comedi%d: adl_pci7432 attached\n",
+ dev->minor);
return 1;
}
}
- printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
+ printk(KERN_ERR "comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
dev->minor, bus, slot);
return -EIO;
}
static int adl_pci7296_detach(struct comedi_device *dev)
{
- printk("comedi%d: pci7432: remove\n", dev->minor);
+ printk(KERN_INFO "comedi%d: pci7432: remove\n", dev->minor);
if (devpriv && devpriv->pci_dev) {
- if (dev->iobase) {
+ if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
- }
pci_dev_put(devpriv->pci_dev);
}
/* detach four 8255 digital io subdevices */
diff --git a/drivers/staging/comedi/drivers/adl_pci7432.c b/drivers/staging/comedi/drivers/adl_pci7432.c
index e0844c69be77..b5a9499e438c 100644
--- a/drivers/staging/comedi/drivers/adl_pci7432.c
+++ b/drivers/staging/comedi/drivers/adl_pci7432.c
@@ -90,8 +90,7 @@ static int adl_pci7432_attach(struct comedi_device *dev,
struct comedi_subdevice *s;
int bus, slot;
- printk("comedi: attempt to attach...\n");
- printk("comedi%d: adl_pci7432\n", dev->minor);
+ printk(KERN_INFO "comedi%d: attach adl_pci7432\n", dev->minor);
dev->board_name = "pci7432";
bus = it->options[0];
@@ -118,13 +117,13 @@ static int adl_pci7432_attach(struct comedi_device *dev,
}
devpriv->pci_dev = pcidev;
if (comedi_pci_enable(pcidev, "adl_pci7432") < 0) {
- printk
- ("comedi%d: Failed to enable PCI device and request regions\n",
+ printk(KERN_ERR "comedi%d: Failed to enable PCI device and request regions\n",
dev->minor);
return -EIO;
}
dev->iobase = pci_resource_start(pcidev, 2);
- printk("comedi: base addr %4lx\n", dev->iobase);
+ printk(KERN_INFO "comedi: base addr %4lx\n",
+ dev->iobase);
s = dev->subdevices + 0;
s->type = COMEDI_SUBD_DI;
@@ -148,25 +147,24 @@ static int adl_pci7432_attach(struct comedi_device *dev,
s->range_table = &range_digital;
s->insn_bits = adl_pci7432_do_insn_bits;
- printk("comedi: attached\n");
-
+ printk(KERN_DEBUG "comedi%d: adl_pci7432 attached\n",
+ dev->minor);
return 1;
}
}
- printk("comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
+ printk(KERN_ERR "comedi%d: no supported board found! (req. bus/slot : %d/%d)\n",
dev->minor, bus, slot);
return -EIO;
}
static int adl_pci7432_detach(struct comedi_device *dev)
{
- printk("comedi%d: pci7432: remove\n", dev->minor);
+ printk(KERN_INFO "comedi%d: pci7432: remove\n", dev->minor);
if (devpriv && devpriv->pci_dev) {
- if (dev->iobase) {
+ if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
- }
pci_dev_put(devpriv->pci_dev);
}
@@ -178,8 +176,8 @@ static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
- printk("comedi: pci7432_do_insn_bits called\n");
- printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
+ printk(KERN_DEBUG "comedi: pci7432_do_insn_bits called\n");
+ printk(KERN_DEBUG "comedi: data0: %8x data1: %8x\n", data[0], data[1]);
if (insn->n != 2)
return -EINVAL;
@@ -188,7 +186,7 @@ static int adl_pci7432_do_insn_bits(struct comedi_device *dev,
s->state &= ~data[0];
s->state |= (data[0] & data[1]);
- printk("comedi: out: %8x on iobase %4lx\n", s->state,
+ printk(KERN_DEBUG "comedi: out: %8x on iobase %4lx\n", s->state,
dev->iobase + PCI7432_DO);
outl(s->state & 0xffffffff, dev->iobase + PCI7432_DO);
}
@@ -200,14 +198,14 @@ static int adl_pci7432_di_insn_bits(struct comedi_device *dev,
struct comedi_insn *insn,
unsigned int *data)
{
- printk("comedi: pci7432_di_insn_bits called\n");
- printk("comedi: data0: %8x data1: %8x\n", data[0], data[1]);
+ printk(KERN_DEBUG "comedi: pci7432_di_insn_bits called\n");
+ printk(KERN_DEBUG "comedi: data0: %8x data1: %8x\n", data[0], data[1]);
if (insn->n != 2)
return -EINVAL;
data[1] = inl(dev->iobase + PCI7432_DI) & 0xffffffff;
- printk("comedi: data1 %8x\n", data[1]);
+ printk(KERN_DEBUG "comedi: data1 %8x\n", data[1]);
return 2;
}
diff --git a/drivers/staging/comedi/drivers/amplc_pc263.c b/drivers/staging/comedi/drivers/amplc_pc263.c
index c62a7e1f81bd..15808e95ceab 100644
--- a/drivers/staging/comedi/drivers/amplc_pc263.c
+++ b/drivers/staging/comedi/drivers/amplc_pc263.c
@@ -117,7 +117,8 @@ MODULE_DEVICE_TABLE(pci, pc263_pci_table);
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the struct comedi_device struct. */
+ feel free to suggest moving the variable to the struct comedi_device struct.
+*/
#ifdef CONFIG_COMEDI_PCI
struct pc263_private {
/* PCI device. */
@@ -281,7 +282,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME);
if (ret < 0) {
printk(KERN_ERR
- "comedi%d: error! cannot enable PCI device and request regions!\n",
+ "comedi%d: error! cannot enable PCI device and "
+ "request regions!\n",
dev->minor);
return ret;
}
@@ -290,9 +292,8 @@ static int pc263_attach(struct comedi_device *dev, struct comedi_devconfig *it)
#endif
{
ret = pc263_request_region(dev->minor, iobase, PC263_IO_SIZE);
- if (ret < 0) {
+ if (ret < 0)
return ret;
- }
}
dev->iobase = iobase;
@@ -350,21 +351,18 @@ static int pc263_detach(struct comedi_device *dev)
PC263_DRIVER_NAME);
#ifdef CONFIG_COMEDI_PCI
- if (devpriv)
+ if (devpriv) {
#endif
- {
#ifdef CONFIG_COMEDI_PCI
if (devpriv->pci_dev) {
- if (dev->iobase) {
+ if (dev->iobase)
comedi_pci_disable(devpriv->pci_dev);
- }
pci_dev_put(devpriv->pci_dev);
} else
#endif
{
- if (dev->iobase) {
+ if (dev->iobase)
release_region(dev->iobase, PC263_IO_SIZE);
- }
}
}
if (dev->board_name) {
diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 80c0df8656f3..d85b8dfd0ed8 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -395,7 +395,7 @@ static int das16cs_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c
index 7a5d46ef1b77..782357732eed 100644
--- a/drivers/staging/comedi/drivers/cb_pcidda.c
+++ b/drivers/staging/comedi/drivers/cb_pcidda.c
@@ -497,7 +497,7 @@ static int cb_pcidda_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER
&& cmd->scan_begin_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/dmm32at.c b/drivers/staging/comedi/drivers/dmm32at.c
index aeec1ee9ad6b..9db9a467c8f8 100644
--- a/drivers/staging/comedi/drivers/dmm32at.c
+++ b/drivers/staging/comedi/drivers/dmm32at.c
@@ -629,7 +629,7 @@ static int dmm32at_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/dt2814.c b/drivers/staging/comedi/drivers/dt2814.c
index 0364bbf178e1..e1b73752f607 100644
--- a/drivers/staging/comedi/drivers/dt2814.c
+++ b/drivers/staging/comedi/drivers/dt2814.c
@@ -175,7 +175,7 @@ static int dt2814_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->stop_src != TRIG_TIMER && cmd->stop_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/dt282x.c b/drivers/staging/comedi/drivers/dt282x.c
index a4c96c02fa2b..99ca294b1ec5 100644
--- a/drivers/staging/comedi/drivers/dt282x.c
+++ b/drivers/staging/comedi/drivers/dt282x.c
@@ -777,7 +777,7 @@ static int dt282x_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_FOLLOW &&
cmd->scan_begin_src != TRIG_EXT)
err++;
@@ -1050,7 +1050,7 @@ static int dt282x_ao_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->stop_src != TRIG_COUNT && cmd->stop_src != TRIG_NONE)
err++;
diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c
index e652f3b270b1..188f58042746 100644
--- a/drivers/staging/comedi/drivers/mite.c
+++ b/drivers/staging/comedi/drivers/mite.c
@@ -64,6 +64,7 @@
MODULE_LICENSE("GPL");
struct mite_struct *mite_devices;
+EXPORT_SYMBOL(mite_devices);
#define TOP_OF_PAGE(x) ((x)|(~(PAGE_MASK)))
@@ -80,7 +81,7 @@ void mite_init(void)
mite = kzalloc(sizeof(*mite), GFP_KERNEL);
if (!mite) {
- printk("mite: allocation failed\n");
+ printk(KERN_ERR "mite: allocation failed\n");
pci_dev_put(pcidev);
return;
}
@@ -99,14 +100,14 @@ void mite_init(void)
static void dump_chip_signature(u32 csigr_bits)
{
- printk
- ("mite: version = %i, type = %i, mite mode = %i, interface mode = %i\n",
- mite_csigr_version(csigr_bits), mite_csigr_type(csigr_bits),
- mite_csigr_mmode(csigr_bits), mite_csigr_imode(csigr_bits));
- printk
- ("mite: num channels = %i, write post fifo depth = %i, wins = %i, iowins = %i\n",
- mite_csigr_dmac(csigr_bits), mite_csigr_wpdep(csigr_bits),
- mite_csigr_wins(csigr_bits), mite_csigr_iowins(csigr_bits));
+ printk(KERN_INFO "mite: version = %i, type = %i, mite mode = %i,"
+ "interface mode = %i\n",
+ mite_csigr_version(csigr_bits), mite_csigr_type(csigr_bits),
+ mite_csigr_mmode(csigr_bits), mite_csigr_imode(csigr_bits));
+ printk(KERN_INFO "mite: num channels = %i, write post fifo depth = %i,"
+ "wins = %i, iowins = %i\n",
+ mite_csigr_dmac(csigr_bits), mite_csigr_wpdep(csigr_bits),
+ mite_csigr_wins(csigr_bits), mite_csigr_iowins(csigr_bits));
}
unsigned mite_fifo_size(struct mite_struct *mite, unsigned channel)
@@ -126,7 +127,7 @@ int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1)
unsigned unknown_dma_burst_bits;
if (comedi_pci_enable(mite->pcidev, "mite")) {
- printk("error enabling mite and requesting io regions\n");
+ printk(KERN_ERR "error enabling mite and requesting io regions\n");
return -EIO;
}
pci_set_master(mite->pcidev);
@@ -135,27 +136,30 @@ int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1)
mite->mite_phys_addr = addr;
mite->mite_io_addr = ioremap(addr, PCI_MITE_SIZE);
if (!mite->mite_io_addr) {
- printk("failed to remap mite io memory address\n");
+ printk(KERN_ERR "Failed to remap mite io memory address\n");
return -ENOMEM;
}
- printk("MITE:0x%08llx mapped to %p ",
+ printk(KERN_INFO "MITE:0x%08llx mapped to %p ",
(unsigned long long)mite->mite_phys_addr, mite->mite_io_addr);
addr = pci_resource_start(mite->pcidev, 1);
mite->daq_phys_addr = addr;
length = pci_resource_len(mite->pcidev, 1);
- /* In case of a 660x board, DAQ size is 8k instead of 4k (see as shown by lspci output) */
+ /*
+ * In case of a 660x board, DAQ size is 8k instead of 4k
+ * (see as shown by lspci output)
+ */
mite->daq_io_addr = ioremap(mite->daq_phys_addr, length);
if (!mite->daq_io_addr) {
- printk("failed to remap daq io memory address\n");
+ printk(KERN_ERR "Failed to remap daq io memory address\n");
return -ENOMEM;
}
- printk("DAQ:0x%08llx mapped to %p\n",
+ printk(KERN_INFO "DAQ:0x%08llx mapped to %p\n",
(unsigned long long)mite->daq_phys_addr, mite->daq_io_addr);
if (use_iodwbsr_1) {
writel(0, mite->mite_io_addr + MITE_IODWBSR);
- printk("mite: using I/O Window Base Size register 1\n");
+ printk(KERN_INFO "mite: using I/O Window Base Size register 1\n");
writel(mite->daq_phys_addr | WENAB |
MITE_IODWBSR_1_WSIZE_bits(length),
mite->mite_io_addr + MITE_IODWBSR_1);
@@ -164,11 +168,12 @@ int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1)
writel(mite->daq_phys_addr | WENAB,
mite->mite_io_addr + MITE_IODWBSR);
}
- /* make sure dma bursts work. I got this from running a bus analyzer
- on a pxi-6281 and a pxi-6713. 6713 powered up with register value
- of 0x61f and bursts worked. 6281 powered up with register value of
- 0x1f and bursts didn't work. The NI windows driver reads the register,
- then does a bitwise-or of 0x600 with it and writes it back.
+ /*
+ * make sure dma bursts work. I got this from running a bus analyzer
+ * on a pxi-6281 and a pxi-6713. 6713 powered up with register value
+ * of 0x61f and bursts worked. 6281 powered up with register value of
+ * 0x1f and bursts didn't work. The NI windows driver reads the
+ * register, then does a bitwise-or of 0x600 with it and writes it back.
*/
unknown_dma_burst_bits =
readl(mite->mite_io_addr + MITE_UNKNOWN_DMA_BURST_REG);
@@ -179,9 +184,9 @@ int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1)
csigr_bits = readl(mite->mite_io_addr + MITE_CSIGR);
mite->num_channels = mite_csigr_dmac(csigr_bits);
if (mite->num_channels > MAX_MITE_DMA_CHANNELS) {
- printk
- ("mite: bug? chip claims to have %i dma channels. Setting to %i.\n",
- mite->num_channels, MAX_MITE_DMA_CHANNELS);
+ printk(KERN_WARNING "mite: bug? chip claims to have %i dma "
+ "channels. Setting to %i.\n",
+ mite->num_channels, MAX_MITE_DMA_CHANNELS);
mite->num_channels = MAX_MITE_DMA_CHANNELS;
}
dump_chip_signature(csigr_bits);
@@ -194,16 +199,18 @@ int mite_setup2(struct mite_struct *mite, unsigned use_iodwbsr_1)
mite->mite_io_addr + MITE_CHCR(i));
}
mite->fifo_size = mite_fifo_size(mite, 0);
- printk("mite: fifo size is %i.\n", mite->fifo_size);
+ printk(KERN_INFO "mite: fifo size is %i.\n", mite->fifo_size);
mite->used = 1;
return 0;
}
+EXPORT_SYMBOL(mite_setup2);
int mite_setup(struct mite_struct *mite)
{
return mite_setup2(mite, 0);
}
+EXPORT_SYMBOL(mite_setup);
void mite_cleanup(void)
{
@@ -238,22 +245,23 @@ void mite_unsetup(struct mite_struct *mite)
mite->used = 0;
}
+EXPORT_SYMBOL(mite_unsetup);
void mite_list_devices(void)
{
struct mite_struct *mite, *next;
- printk("Available NI device IDs:");
+ printk(KERN_INFO "Available NI device IDs:");
if (mite_devices)
for (mite = mite_devices; mite; mite = next) {
next = mite->next;
- printk(" 0x%04x", mite_device_id(mite));
+ printk(KERN_INFO " 0x%04x", mite_device_id(mite));
if (mite->used)
- printk("(used)");
+ printk(KERN_INFO "(used)");
}
- printk("\n");
-
+ printk(KERN_INFO "\n");
}
+EXPORT_SYMBOL(mite_list_devices);
struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
struct
@@ -265,7 +273,9 @@ struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
unsigned long flags;
struct mite_channel *channel = NULL;
- /* spin lock so mite_release_channel can be called safely from interrupts */
+ /* spin lock so mite_release_channel can be called safely
+ * from interrupts
+ */
spin_lock_irqsave(&mite->lock, flags);
for (i = min_channel; i <= max_channel; ++i) {
if (mite->channel_allocated[i] == 0) {
@@ -278,6 +288,7 @@ struct mite_channel *mite_request_channel_in_range(struct mite_struct *mite,
spin_unlock_irqrestore(&mite->lock, flags);
return channel;
}
+EXPORT_SYMBOL(mite_request_channel_in_range);
void mite_release_channel(struct mite_channel *mite_chan)
{
@@ -289,8 +300,10 @@ void mite_release_channel(struct mite_channel *mite_chan)
if (mite->channel_allocated[mite_chan->channel]) {
mite_dma_disarm(mite_chan);
mite_dma_reset(mite_chan);
-/* disable all channel's interrupts (do it after disarm/reset so
-MITE_CHCR reg isn't changed while dma is still active!) */
+ /*
+ * disable all channel's interrupts (do it after disarm/reset so
+ * MITE_CHCR reg isn't changed while dma is still active!)
+ */
writel(CHCR_CLR_DMA_IE | CHCR_CLR_LINKP_IE |
CHCR_CLR_SAR_IE | CHCR_CLR_DONE_IE |
CHCR_CLR_MRDY_IE | CHCR_CLR_DRDY_IE |
@@ -302,6 +315,7 @@ MITE_CHCR reg isn't changed while dma is still active!) */
}
spin_unlock_irqrestore(&mite->lock, flags);
}
+EXPORT_SYMBOL(mite_release_channel);
void mite_dma_arm(struct mite_channel *mite_chan)
{
@@ -310,8 +324,10 @@ void mite_dma_arm(struct mite_channel *mite_chan)
unsigned long flags;
MDPRINTK("mite_dma_arm ch%i\n", channel);
- /* memory barrier is intended to insure any twiddling with the buffer
- is done before writing to the mite to arm dma transfer */
+ /*
+ * memory barrier is intended to insure any twiddling with the buffer
+ * is done before writing to the mite to arm dma transfer
+ */
smp_mb();
/* arm */
chor = CHOR_START;
@@ -322,6 +338,7 @@ void mite_dma_arm(struct mite_channel *mite_chan)
spin_unlock_irqrestore(&mite->lock, flags);
/* mite_dma_tcr(mite, channel); */
}
+EXPORT_SYMBOL(mite_dma_arm);
/**************************************/
@@ -354,7 +371,7 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring,
n_links * sizeof(struct mite_dma_descriptor),
&ring->descriptors_dma_addr, GFP_KERNEL);
if (!ring->descriptors) {
- printk("mite: ring buffer allocation failed\n");
+ printk(KERN_ERR "mite: ring buffer allocation failed\n");
return -ENOMEM;
}
ring->n_links = n_links;
@@ -370,11 +387,14 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring,
}
ring->descriptors[n_links - 1].next =
cpu_to_le32(ring->descriptors_dma_addr);
- /* barrier is meant to insure that all the writes to the dma descriptors
- have completed before the dma controller is commanded to read them */
+ /*
+ * barrier is meant to insure that all the writes to the dma descriptors
+ * have completed before the dma controller is commanded to read them
+ */
smp_wmb();
return 0;
}
+EXPORT_SYMBOL(mite_buf_change);
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits)
@@ -395,16 +415,19 @@ void mite_prep_dma(struct mite_channel *mite_chan,
* Link Complete Interrupt: interrupt every time a link
* in MITE_RING is completed. This can generate a lot of
* extra interrupts, but right now we update the values
- * of buf_int_ptr and buf_int_count at each interrupt. A
+ * of buf_int_ptr and buf_int_count at each interrupt. A
* better method is to poll the MITE before each user
* "read()" to calculate the number of bytes available.
*/
chcr |= CHCR_SET_LC_IE;
if (num_memory_bits == 32 && num_device_bits == 16) {
- /* Doing a combined 32 and 16 bit byteswap gets the 16 bit samples into the fifo in the right order.
- Tested doing 32 bit memory to 16 bit device transfers to the analog out of a pxi-6281,
- which has mite version = 1, type = 4. This also works for dma reads from the counters
- on e-series boards. */
+ /*
+ * Doing a combined 32 and 16 bit byteswap gets the 16 bit
+ * samples into the fifo in the right order. Tested doing 32 bit
+ * memory to 16 bit device transfers to the analog out of a
+ * pxi-6281, which has mite version = 1, type = 4. This also
+ * works for dma reads from the counters on e-series boards.
+ */
chcr |= CHCR_BYTE_SWAP_DEVICE | CHCR_BYTE_SWAP_MEMORY;
}
if (mite_chan->dir == COMEDI_INPUT)
@@ -425,7 +448,8 @@ void mite_prep_dma(struct mite_channel *mite_chan,
mcr |= CR_PSIZE32;
break;
default:
- printk("mite: bug! invalid mem bit width for dma transfer\n");
+ printk(KERN_WARNING "mite: bug! invalid mem bit width for dma "
+ "transfer\n");
break;
}
writel(mcr, mite->mite_io_addr + MITE_MCR(mite_chan->channel));
@@ -444,7 +468,8 @@ void mite_prep_dma(struct mite_channel *mite_chan,
dcr |= CR_PSIZE32;
break;
default:
- printk("mite: bug! invalid dev bit width for dma transfer\n");
+ printk(KERN_WARNING "mite: bug! invalid dev bit width for dma "
+ "transfer\n");
break;
}
writel(dcr, mite->mite_io_addr + MITE_DCR(mite_chan->channel));
@@ -462,6 +487,7 @@ void mite_prep_dma(struct mite_channel *mite_chan,
MDPRINTK("exit mite_prep_dma\n");
}
+EXPORT_SYMBOL(mite_prep_dma);
u32 mite_device_bytes_transferred(struct mite_channel *mite_chan)
{
@@ -469,48 +495,53 @@ u32 mite_device_bytes_transferred(struct mite_channel *mite_chan)
return readl(mite->mite_io_addr + MITE_DAR(mite_chan->channel));
}
-u32 mite_bytes_in_transit(struct mite_channel * mite_chan)
+u32 mite_bytes_in_transit(struct mite_channel *mite_chan)
{
struct mite_struct *mite = mite_chan->mite;
return readl(mite->mite_io_addr +
MITE_FCR(mite_chan->channel)) & 0x000000FF;
}
+EXPORT_SYMBOL(mite_bytes_in_transit);
-/* returns lower bound for number of bytes transferred from device to memory */
-u32 mite_bytes_written_to_memory_lb(struct mite_channel * mite_chan)
+/* returns lower bound for number of bytes transferred from device to memory */
+u32 mite_bytes_written_to_memory_lb(struct mite_channel *mite_chan)
{
u32 device_byte_count;
device_byte_count = mite_device_bytes_transferred(mite_chan);
return device_byte_count - mite_bytes_in_transit(mite_chan);
}
+EXPORT_SYMBOL(mite_bytes_written_to_memory_lb);
-/* returns upper bound for number of bytes transferred from device to memory */
-u32 mite_bytes_written_to_memory_ub(struct mite_channel * mite_chan)
+/* returns upper bound for number of bytes transferred from device to memory */
+u32 mite_bytes_written_to_memory_ub(struct mite_channel *mite_chan)
{
u32 in_transit_count;
in_transit_count = mite_bytes_in_transit(mite_chan);
return mite_device_bytes_transferred(mite_chan) - in_transit_count;
}
+EXPORT_SYMBOL(mite_bytes_written_to_memory_ub);
-/* returns lower bound for number of bytes read from memory for transfer to device */
-u32 mite_bytes_read_from_memory_lb(struct mite_channel * mite_chan)
+/* returns lower bound for number of bytes read from memory to device */
+u32 mite_bytes_read_from_memory_lb(struct mite_channel *mite_chan)
{
u32 device_byte_count;
device_byte_count = mite_device_bytes_transferred(mite_chan);
return device_byte_count + mite_bytes_in_transit(mite_chan);
}
+EXPORT_SYMBOL(mite_bytes_read_from_memory_lb);
-/* returns upper bound for number of bytes read from memory for transfer to device */
-u32 mite_bytes_read_from_memory_ub(struct mite_channel * mite_chan)
+/* returns upper bound for number of bytes read from memory to device */
+u32 mite_bytes_read_from_memory_ub(struct mite_channel *mite_chan)
{
u32 in_transit_count;
in_transit_count = mite_bytes_in_transit(mite_chan);
return mite_device_bytes_transferred(mite_chan) + in_transit_count;
}
+EXPORT_SYMBOL(mite_bytes_read_from_memory_ub);
unsigned mite_dma_tcr(struct mite_channel *mite_chan)
{
@@ -525,6 +556,7 @@ unsigned mite_dma_tcr(struct mite_channel *mite_chan)
return tcr;
}
+EXPORT_SYMBOL(mite_dma_tcr);
void mite_dma_disarm(struct mite_channel *mite_chan)
{
@@ -535,6 +567,7 @@ void mite_dma_disarm(struct mite_channel *mite_chan)
chor = CHOR_ABORT;
writel(chor, mite->mite_io_addr + MITE_CHOR(mite_chan->channel));
}
+EXPORT_SYMBOL(mite_dma_disarm);
int mite_sync_input_dma(struct mite_channel *mite_chan,
struct comedi_async *async)
@@ -544,7 +577,7 @@ int mite_sync_input_dma(struct mite_channel *mite_chan,
const unsigned bytes_per_scan = cfc_bytes_per_scan(async->subdevice);
old_alloc_count = async->buf_write_alloc_count;
- /* write alloc as much as we can */
+ /* write alloc as much as we can */
comedi_buf_write_alloc(async, async->prealloc_bufsz);
nbytes = mite_bytes_written_to_memory_lb(mite_chan);
@@ -571,6 +604,7 @@ int mite_sync_input_dma(struct mite_channel *mite_chan,
async->events |= COMEDI_CB_BLOCK;
return 0;
}
+EXPORT_SYMBOL(mite_sync_input_dma);
int mite_sync_output_dma(struct mite_channel *mite_chan,
struct comedi_async *async)
@@ -593,7 +627,7 @@ int mite_sync_output_dma(struct mite_channel *mite_chan,
(int)(nbytes_ub - stop_count) > 0)
nbytes_ub = stop_count;
if ((int)(nbytes_ub - old_alloc_count) > 0) {
- printk("mite: DMA underrun\n");
+ printk(KERN_ERR "mite: DMA underrun\n");
async->events |= COMEDI_CB_OVERFLOW;
return -1;
}
@@ -607,6 +641,7 @@ int mite_sync_output_dma(struct mite_channel *mite_chan,
}
return 0;
}
+EXPORT_SYMBOL(mite_sync_output_dma);
unsigned mite_get_status(struct mite_channel *mite_chan)
{
@@ -625,6 +660,7 @@ unsigned mite_get_status(struct mite_channel *mite_chan)
spin_unlock_irqrestore(&mite->lock, flags);
return status;
}
+EXPORT_SYMBOL(mite_get_status);
int mite_done(struct mite_channel *mite_chan)
{
@@ -638,6 +674,7 @@ int mite_done(struct mite_channel *mite_chan)
spin_unlock_irqrestore(&mite->lock, flags);
return done;
}
+EXPORT_SYMBOL(mite_done);
#ifdef DEBUG_MITE
@@ -719,46 +756,51 @@ void mite_dump_regs(struct mite_channel *mite_chan)
unsigned long addr = 0;
unsigned long temp = 0;
- printk("mite_dump_regs ch%i\n", mite_chan->channel);
- printk("mite address is =0x%08lx\n", mite_io_addr);
+ printk(KERN_DEBUG "mite_dump_regs ch%i\n", mite_chan->channel);
+ printk(KERN_DEBUG "mite address is =0x%08lx\n", mite_io_addr);
addr = mite_io_addr + MITE_CHOR(channel);
- printk("mite status[CHOR]at 0x%08lx =0x%08lx\n", addr, temp =
- readl(addr));
+ printk(KERN_DEBUG "mite status[CHOR]at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_CHOR_strings, temp);
addr = mite_io_addr + MITE_CHCR(channel);
- printk("mite status[CHCR]at 0x%08lx =0x%08lx\n", addr, temp =
- readl(addr));
+ printk(KERN_DEBUG "mite status[CHCR]at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_CHCR_strings, temp);
addr = mite_io_addr + MITE_TCR(channel);
- printk("mite status[TCR] at 0x%08lx =0x%08x\n", addr, readl(addr));
- addr = mite_io_addr + MITE_MCR(channel);
- printk("mite status[MCR] at 0x%08lx =0x%08lx\n", addr, temp =
+ printk(KERN_DEBUG "mite status[TCR] at 0x%08lx =0x%08x\n", addr,
readl(addr));
+ addr = mite_io_addr + MITE_MCR(channel);
+ printk(KERN_DEBUG "mite status[MCR] at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_MCR_strings, temp);
addr = mite_io_addr + MITE_MAR(channel);
- printk("mite status[MAR] at 0x%08lx =0x%08x\n", addr, readl(addr));
- addr = mite_io_addr + MITE_DCR(channel);
- printk("mite status[DCR] at 0x%08lx =0x%08lx\n", addr, temp =
+ printk(KERN_DEBUG "mite status[MAR] at 0x%08lx =0x%08x\n", addr,
readl(addr));
+ addr = mite_io_addr + MITE_DCR(channel);
+ printk(KERN_DEBUG "mite status[DCR] at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_DCR_strings, temp);
addr = mite_io_addr + MITE_DAR(channel);
- printk("mite status[DAR] at 0x%08lx =0x%08x\n", addr, readl(addr));
- addr = mite_io_addr + MITE_LKCR(channel);
- printk("mite status[LKCR]at 0x%08lx =0x%08lx\n", addr, temp =
+ printk(KERN_DEBUG "mite status[DAR] at 0x%08lx =0x%08x\n", addr,
readl(addr));
+ addr = mite_io_addr + MITE_LKCR(channel);
+ printk(KERN_DEBUG "mite status[LKCR]at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_LKCR_strings, temp);
addr = mite_io_addr + MITE_LKAR(channel);
- printk("mite status[LKAR]at 0x%08lx =0x%08x\n", addr, readl(addr));
-
- addr = mite_io_addr + MITE_CHSR(channel);
- printk("mite status[CHSR]at 0x%08lx =0x%08lx\n", addr, temp =
+ printk(KERN_DEBUG "mite status[LKAR]at 0x%08lx =0x%08x\n", addr,
readl(addr));
+ addr = mite_io_addr + MITE_CHSR(channel);
+ printk(KERN_DEBUG "mite status[CHSR]at 0x%08lx =0x%08lx\n", addr,
+ temp = readl(addr));
mite_decode(mite_CHSR_strings, temp);
addr = mite_io_addr + MITE_FCR(channel);
- printk("mite status[FCR] at 0x%08lx =0x%08x\n\n", addr, readl(addr));
+ printk(KERN_DEBUG "mite status[FCR] at 0x%08lx =0x%08x\n\n", addr,
+ readl(addr));
}
+EXPORT_SYMBOL(mite_dump_regs);
static void mite_decode(char **bit_str, unsigned int bits)
{
@@ -766,10 +808,11 @@ static void mite_decode(char **bit_str, unsigned int bits)
for (i = 31; i >= 0; i--) {
if (bits & (1 << i))
- printk(" %s", bit_str[i]);
+ printk(KERN_DEBUG " %s", bit_str[i]);
}
- printk("\n");
+ printk(KERN_DEBUG "\n");
}
+EXPORT_SYMBOL(mite_decode);
#endif
#ifdef MODULE
@@ -785,36 +828,4 @@ void __exit cleanup_module(void)
{
mite_cleanup();
}
-
-EXPORT_SYMBOL(mite_dma_tcr);
-EXPORT_SYMBOL(mite_dma_arm);
-EXPORT_SYMBOL(mite_dma_disarm);
-EXPORT_SYMBOL(mite_sync_input_dma);
-EXPORT_SYMBOL(mite_sync_output_dma);
-EXPORT_SYMBOL(mite_setup);
-EXPORT_SYMBOL(mite_setup2);
-EXPORT_SYMBOL(mite_unsetup);
-#if 0
-EXPORT_SYMBOL(mite_kvmem_segment_load);
-EXPORT_SYMBOL(mite_ll_from_kvmem);
-EXPORT_SYMBOL(mite_setregs);
-#endif
-EXPORT_SYMBOL(mite_devices);
-EXPORT_SYMBOL(mite_list_devices);
-EXPORT_SYMBOL(mite_request_channel_in_range);
-EXPORT_SYMBOL(mite_release_channel);
-EXPORT_SYMBOL(mite_prep_dma);
-EXPORT_SYMBOL(mite_buf_change);
-EXPORT_SYMBOL(mite_bytes_written_to_memory_lb);
-EXPORT_SYMBOL(mite_bytes_written_to_memory_ub);
-EXPORT_SYMBOL(mite_bytes_read_from_memory_lb);
-EXPORT_SYMBOL(mite_bytes_read_from_memory_ub);
-EXPORT_SYMBOL(mite_bytes_in_transit);
-EXPORT_SYMBOL(mite_get_status);
-EXPORT_SYMBOL(mite_done);
-#ifdef DEBUG_MITE
-EXPORT_SYMBOL(mite_decode);
-EXPORT_SYMBOL(mite_dump_regs);
-#endif
-
#endif
diff --git a/drivers/staging/comedi/drivers/mite.h b/drivers/staging/comedi/drivers/mite.h
index 0518fadc4daa..9d5049f8fa85 100644
--- a/drivers/staging/comedi/drivers/mite.h
+++ b/drivers/staging/comedi/drivers/mite.h
@@ -163,13 +163,6 @@ u32 mite_bytes_in_transit(struct mite_channel *mite_chan);
unsigned mite_get_status(struct mite_channel *mite_chan);
int mite_done(struct mite_channel *mite_chan);
-#if 0
-unsigned long mite_ll_from_kvmem(struct mite_struct *mite,
- struct comedi_async *async, int len);
-void mite_setregs(struct mite_struct *mite, unsigned long ll_start, int chan,
- int dir);
-#endif
-
void mite_prep_dma(struct mite_channel *mite_chan,
unsigned int num_device_bits, unsigned int num_memory_bits);
int mite_buf_change(struct mite_dma_descriptor_ring *ring,
diff --git a/drivers/staging/comedi/drivers/ni_at_ao.c b/drivers/staging/comedi/drivers/ni_at_ao.c
index 8adb23739846..3778565c1f6b 100644
--- a/drivers/staging/comedi/drivers/ni_at_ao.c
+++ b/drivers/staging/comedi/drivers/ni_at_ao.c
@@ -32,7 +32,8 @@ Configuration options:
[0] - I/O port base address
[1] - IRQ (unused)
[2] - DMA (unused)
- [3] - analog output range, set by jumpers on hardware (0 for -10 to 10V bipolar, 1 for 0V to 10V unipolar)
+ [3] - analog output range, set by jumpers on hardware (0 for -10 to 10V
+ bipolar, 1 for 0V to 10V unipolar)
*/
/*
@@ -431,9 +432,8 @@ static int atao_calib_insn_read(struct comedi_device *dev,
struct comedi_insn *insn, unsigned int *data)
{
int i;
- for (i = 0; i < insn->n; i++) {
+ for (i = 0; i < insn->n; i++)
data[i] = 0; /* XXX */
- }
return insn->n;
}
diff --git a/drivers/staging/comedi/drivers/ni_atmio16d.c b/drivers/staging/comedi/drivers/ni_atmio16d.c
index 901833d9b772..cf4f241f210a 100644
--- a/drivers/staging/comedi/drivers/ni_atmio16d.c
+++ b/drivers/staging/comedi/drivers/ni_atmio16d.c
@@ -200,8 +200,8 @@ struct atmio16d_private {
enum { dac_2comp, dac_straight } dac0_coding, dac1_coding;
const struct comedi_lrange *ao_range_type_list[2];
unsigned int ao_readback[2];
- unsigned int com_reg_1_state; /* current state of command register 1 */
- unsigned int com_reg_2_state; /* current state of command register 2 */
+ unsigned int com_reg_1_state; /* current state of command register 1 */
+ unsigned int com_reg_2_state; /* current state of command register 2 */
};
static void reset_counters(struct comedi_device *dev)
@@ -279,7 +279,9 @@ static irqreturn_t atmio16d_interrupt(int irq, void *d)
struct comedi_device *dev = d;
struct comedi_subdevice *s = dev->subdevices + 0;
-/* printk("atmio16d_interrupt!\n"); */
+#ifdef DEBUG1
+ printk(KERN_DEBUG "atmio16d_interrupt!\n");
+#endif
comedi_buf_put(s->async, inw(dev->iobase + AD_FIFO_REG));
@@ -293,7 +295,7 @@ static int atmio16d_ai_cmdtest(struct comedi_device *dev,
{
int err = 0, tmp;
#ifdef DEBUG1
- printk("atmio16d_ai_cmdtest\n");
+ printk(KERN_DEBUG "atmio16d_ai_cmdtest\n");
#endif
/* make sure triggers are valid */
tmp = cmd->start_src;
@@ -324,8 +326,8 @@ static int atmio16d_ai_cmdtest(struct comedi_device *dev,
if (err)
return 1;
- /* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* step 2: make sure trigger sources are unique & mutually compatible */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_FOLLOW &&
cmd->scan_begin_src != TRIG_EXT &&
cmd->scan_begin_src != TRIG_TIMER)
@@ -397,7 +399,7 @@ static int atmio16d_ai_cmd(struct comedi_device *dev,
unsigned int sample_count, tmp, chan, gain;
int i;
#ifdef DEBUG1
- printk("atmio16d_ai_cmd\n");
+ printk(KERN_DEBUG "atmio16d_ai_cmd\n");
#endif
/* This is slowly becoming a working command interface. *
* It is still uber-experimental */
@@ -436,10 +438,10 @@ static int atmio16d_ai_cmd(struct comedi_device *dev,
} else if (cmd->convert_arg < 655360000) {
base_clock = CLOCK_100_KHZ;
timer = cmd->convert_arg / 10000;
- } else if (cmd->convert_arg <= 0xffffffff /* 6553600000 */ ) {
+ } else if (cmd->convert_arg <= 0xffffffff /* 6553600000 */) {
base_clock = CLOCK_10_KHZ;
timer = cmd->convert_arg / 100000;
- } else if (cmd->convert_arg <= 0xffffffff /* 65536000000 */ ) {
+ } else if (cmd->convert_arg <= 0xffffffff /* 65536000000 */) {
base_clock = CLOCK_1_KHZ;
timer = cmd->convert_arg / 1000000;
}
@@ -504,10 +506,10 @@ static int atmio16d_ai_cmd(struct comedi_device *dev,
} else if (cmd->scan_begin_arg < 655360000) {
base_clock = CLOCK_100_KHZ;
timer = cmd->scan_begin_arg / 10000;
- } else if (cmd->scan_begin_arg < 0xffffffff /* 6553600000 */ ) {
+ } else if (cmd->scan_begin_arg < 0xffffffff /* 6553600000 */) {
base_clock = CLOCK_10_KHZ;
timer = cmd->scan_begin_arg / 100000;
- } else if (cmd->scan_begin_arg < 0xffffffff /* 65536000000 */ ) {
+ } else if (cmd->scan_begin_arg < 0xffffffff /* 65536000000 */) {
base_clock = CLOCK_1_KHZ;
timer = cmd->scan_begin_arg / 1000000;
}
@@ -559,7 +561,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
int status;
#ifdef DEBUG1
- printk("atmio16d_ai_insn_read\n");
+ printk(KERN_DEBUG "atmio16d_ai_insn_read\n");
#endif
chan = CR_CHAN(insn->chanspec);
gain = CR_RANGE(insn->chanspec);
@@ -580,19 +582,18 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
/* check conversion status */
status = inw(dev->iobase + STAT_REG);
#ifdef DEBUG1
- printk("status=%x\n", status);
+ printk(KERN_DEBUG "status=%x\n", status);
#endif
if (status & STAT_AD_CONVAVAIL) {
/* read the data now */
data[i] = inw(dev->iobase + AD_FIFO_REG);
/* change to two's complement if need be */
- if (devpriv->adc_coding == adc_2comp) {
+ if (devpriv->adc_coding == adc_2comp)
data[i] ^= 0x800;
- }
break;
}
if (status & STAT_AD_OVERFLOW) {
- printk("atmio16d: a/d FIFO overflow\n");
+ printk(KERN_INFO "atmio16d: a/d FIFO overflow\n");
outw(0, dev->iobase + AD_CLEAR_REG);
return -ETIME;
@@ -600,7 +601,7 @@ static int atmio16d_ai_insn_read(struct comedi_device *dev,
}
/* end waiting, now check if it timed out */
if (t == ATMIO16D_TIMEOUT) {
- printk("atmio16d: timeout\n");
+ printk(KERN_INFO "atmio16d: timeout\n");
return -ETIME;
}
@@ -615,13 +616,11 @@ static int atmio16d_ao_insn_read(struct comedi_device *dev,
{
int i;
#ifdef DEBUG1
- printk("atmio16d_ao_insn_read\n");
+ printk(KERN_DEBUG "atmio16d_ao_insn_read\n");
#endif
- for (i = 0; i < insn->n; i++) {
+ for (i = 0; i < insn->n; i++)
data[i] = devpriv->ao_readback[CR_CHAN(insn->chanspec)];
- }
-
return i;
}
@@ -633,7 +632,7 @@ static int atmio16d_ao_insn_write(struct comedi_device *dev,
int chan;
int d;
#ifdef DEBUG1
- printk("atmio16d_ao_insn_write\n");
+ printk(KERN_DEBUG "atmio16d_ao_insn_write\n");
#endif
chan = CR_CHAN(insn->chanspec);
@@ -642,15 +641,13 @@ static int atmio16d_ao_insn_write(struct comedi_device *dev,
d = data[i];
switch (chan) {
case 0:
- if (devpriv->dac0_coding == dac_2comp) {
+ if (devpriv->dac0_coding == dac_2comp)
d ^= 0x800;
- }
outw(d, dev->iobase + DAC0_REG);
break;
case 1:
- if (devpriv->dac1_coding == dac_2comp) {
+ if (devpriv->dac1_coding == dac_2comp)
d ^= 0x800;
- }
outw(d, dev->iobase + DAC1_REG);
break;
default:
@@ -705,29 +702,29 @@ static int atmio16d_dio_insn_config(struct comedi_device *dev,
/*
options[0] - I/O port
options[1] - MIO irq
- 0 == no irq
- N == irq N {3,4,5,6,7,9,10,11,12,14,15}
+ 0 == no irq
+ N == irq N {3,4,5,6,7,9,10,11,12,14,15}
options[2] - DIO irq
- 0 == no irq
- N == irq N {3,4,5,6,7,9}
+ 0 == no irq
+ N == irq N {3,4,5,6,7,9}
options[3] - DMA1 channel
- 0 == no DMA
- N == DMA N {5,6,7}
+ 0 == no DMA
+ N == DMA N {5,6,7}
options[4] - DMA2 channel
- 0 == no DMA
- N == DMA N {5,6,7}
+ 0 == no DMA
+ N == DMA N {5,6,7}
options[5] - a/d mux
- 0=differential, 1=single
+ 0=differential, 1=single
options[6] - a/d range
- 0=bipolar10, 1=bipolar5, 2=unipolar10
+ 0=bipolar10, 1=bipolar5, 2=unipolar10
options[7] - dac0 range
- 0=bipolar, 1=unipolar
+ 0=bipolar, 1=unipolar
options[8] - dac0 reference
- 0=internal, 1=external
+ 0=internal, 1=external
options[9] - dac0 coding
- 0=2's comp, 1=straight binary
+ 0=2's comp, 1=straight binary
options[10] - dac1 range
options[11] - dac1 reference
@@ -745,7 +742,7 @@ static int atmio16d_attach(struct comedi_device *dev,
/* make sure the address range is free and allocate it */
iobase = it->options[0];
- printk("comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase);
+ printk(KERN_INFO "comedi%d: atmio16d: 0x%04lx ", dev->minor, iobase);
if (!request_region(iobase, ATMIO16D_SIZE, "ni_atmio16d")) {
printk("I/O port conflict\n");
return -EIO;
@@ -772,13 +769,13 @@ static int atmio16d_attach(struct comedi_device *dev,
ret = request_irq(irq, atmio16d_interrupt, 0, "atmio16d", dev);
if (ret < 0) {
- printk("failed to allocate irq %u\n", irq);
+ printk(KERN_INFO "failed to allocate irq %u\n", irq);
return ret;
}
dev->irq = irq;
- printk("( irq = %u )\n", irq);
+ printk(KERN_INFO "( irq = %u )\n", irq);
} else {
- printk("( no irq )");
+ printk(KERN_INFO "( no irq )");
}
/* set device options */
@@ -855,11 +852,10 @@ static int atmio16d_attach(struct comedi_device *dev,
/* 8255 subdevice */
s++;
- if (boardtype->has_8255) {
+ if (boardtype->has_8255)
subdev_8255_init(dev, s, NULL, dev->iobase);
- } else {
+ else
s->type = COMEDI_SUBD_UNUSED;
- }
/* don't yet know how to deal with counter/timers */
#if 0
@@ -876,7 +872,7 @@ static int atmio16d_attach(struct comedi_device *dev,
static int atmio16d_detach(struct comedi_device *dev)
{
- printk("comedi%d: atmio16d: remove\n", dev->minor);
+ printk(KERN_INFO "comedi%d: atmio16d: remove\n", dev->minor);
if (dev->subdevices && boardtype->has_8255)
subdev_8255_cleanup(dev, dev->subdevices + 3);
diff --git a/drivers/staging/comedi/drivers/ni_labpc.h b/drivers/staging/comedi/drivers/ni_labpc.h
index 82596345dcf4..422cee58a967 100644
--- a/drivers/staging/comedi/drivers/ni_labpc.h
+++ b/drivers/staging/comedi/drivers/ni_labpc.h
@@ -38,19 +38,27 @@ struct labpc_board_struct {
int device_id; /* device id for pci and pcmcia boards */
int ai_speed; /* maximum input speed in nanoseconds */
enum labpc_bustype bustype; /* ISA/PCI/etc. */
- enum labpc_register_layout register_layout; /* 1200 has extra registers compared to pc+ */
+
+ /* 1200 has extra registers compared to pc+ */
+ enum labpc_register_layout register_layout;
int has_ao; /* has analog output true/false */
const struct comedi_lrange *ai_range_table;
const int *ai_range_code;
const int *ai_range_is_unipolar;
- unsigned ai_scan_up:1; /* board can auto scan up in ai channels, not just down */
- unsigned memory_mapped_io:1; /* uses memory mapped io instead of ioports */
+
+ /* board can auto scan up in ai channels, not just down */
+ unsigned ai_scan_up:1;
+
+ /* uses memory mapped io instead of ioports */
+ unsigned memory_mapped_io:1;
};
struct labpc_private {
struct mite_struct *mite; /* for mite chip on pci-1200 */
- volatile unsigned long long count; /* number of data points left to be taken */
- unsigned int ao_value[NUM_AO_CHAN]; /* software copy of analog output values */
+ /* number of data points left to be taken */
+ volatile unsigned long long count;
+ /* software copy of analog output values */
+ unsigned int ao_value[NUM_AO_CHAN];
/* software copys of bits written to command registers */
volatile unsigned int command1_bits;
volatile unsigned int command2_bits;
@@ -61,16 +69,34 @@ struct labpc_private {
/* store last read of board status registers */
volatile unsigned int status1_bits;
volatile unsigned int status2_bits;
- unsigned int divisor_a0; /* value to load into board's counter a0 (conversion pacing) for timed conversions */
- unsigned int divisor_b0; /* value to load into board's counter b0 (master) for timed conversions */
- unsigned int divisor_b1; /* value to load into board's counter b1 (scan pacing) for timed conversions */
+ /*
+ * value to load into board's counter a0 (conversion pacing) for timed
+ * conversions
+ */
+ unsigned int divisor_a0;
+ /*
+ * value to load into board's counter b0 (master) for timed conversions
+ */
+ unsigned int divisor_b0;
+ /*
+ * value to load into board's counter b1 (scan pacing) for timed
+ * conversions
+ */
+ unsigned int divisor_b1;
unsigned int dma_chan; /* dma channel to use */
u16 *dma_buffer; /* buffer ai will dma into */
- unsigned int dma_transfer_size; /* transfer size in bytes for current transfer */
- enum transfer_type current_transfer; /* we are using dma/fifo-half-full/etc. */
- unsigned int eeprom_data[EEPROM_SIZE]; /* stores contents of board's eeprom */
- unsigned int caldac[16]; /* stores settings of calibration dacs */
- /* function pointers so we can use inb/outb or readb/writeb as appropriate */
+ /* transfer size in bytes for current transfer */
+ unsigned int dma_transfer_size;
+ /* we are using dma/fifo-half-full/etc. */
+ enum transfer_type current_transfer;
+ /* stores contents of board's eeprom */
+ unsigned int eeprom_data[EEPROM_SIZE];
+ /* stores settings of calibration dacs */
+ unsigned int caldac[16];
+ /*
+ * function pointers so we can use inb/outb or readb/writeb as
+ * appropriate
+ */
unsigned int (*read_byte) (unsigned long address);
void (*write_byte) (unsigned int byte, unsigned long address);
};
diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index a3053b8da1c6..dfcf7160e8d1 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -59,8 +59,7 @@ NI manuals:
*/
-#undef LABPC_DEBUG
- /* #define LABPC_DEBUG *//* enable debugging messages */
+#undef LABPC_DEBUG /* debugging messages */
#include "../comedidev.h"
@@ -77,14 +76,15 @@ NI manuals:
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
-static struct pcmcia_device *pcmcia_cur_dev = NULL;
+static struct pcmcia_device *pcmcia_cur_dev;
static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static const struct labpc_board_struct labpc_cs_boards[] = {
{
.name = "daqcard-1200",
- .device_id = 0x103, /* 0x10b is manufacturer id, 0x103 is device id */
+ .device_id = 0x103, /* 0x10b is manufacturer id,
+ 0x103 is device id */
.ai_speed = 10000,
.bustype = pcmcia_bustype,
.register_layout = labpc_1200_layout,
@@ -163,7 +163,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
#ifdef PCMCIA_DEBUG
static int pc_debug = PCMCIA_DEBUG;
module_param(pc_debug, int, 0644);
-#define DEBUG(n, args...) if (pc_debug>(n)) printk(KERN_DEBUG args)
+#define DEBUG(n, args...) if (pc_debug > (n)) printk(KERN_DEBUG args)
static const char *version =
"ni_labpc.c, based on dummy_cs.c 1.31 2001/08/24 12:13:13";
#else
@@ -291,9 +291,8 @@ static void labpc_cs_detach(struct pcmcia_device *link)
labpc_release(link);
}
- /* This points to the parent local_info_t struct */
- if (link->priv)
- kfree(link->priv);
+ /* This points to the parent local_info_t struct (may be null) */
+ kfree(link->priv);
} /* labpc_cs_detach */
@@ -402,7 +401,8 @@ static void labpc_config(struct pcmcia_device *link)
link->io.BasePort2 = io->win[1].base;
link->io.NumPorts2 = io->win[1].len;
}
- /* This reserves IO space but doesn't actually enable it */
+ /* This reserves IO space but doesn't
+ actually enable it */
if (pcmcia_request_io(link, &link->io))
goto next_entry;
}
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 753ee0512342..d6d49c3bbf1c 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -2207,7 +2207,7 @@ static int ni_ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->start_src != TRIG_NOW &&
cmd->start_src != TRIG_INT && cmd->start_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/ni_mio_cs.c b/drivers/staging/comedi/drivers/ni_mio_cs.c
index 9aef87fc81dc..3a9c8b258b4b 100644
--- a/drivers/staging/comedi/drivers/ni_mio_cs.c
+++ b/drivers/staging/comedi/drivers/ni_mio_cs.c
@@ -250,9 +250,8 @@ static int mio_cs_detach(struct comedi_device *dev)
/* PCMCIA layer frees the IO region */
- if (dev->irq) {
+ if (dev->irq)
free_irq(dev->irq, dev);
- }
return 0;
}
@@ -294,9 +293,8 @@ static void cs_detach(struct pcmcia_device *link)
{
DPRINTK("cs_detach(link=%p)\n", link);
- if (link->dev_node) {
+ if (link->dev_node)
cs_release(link);
- }
}
static int mio_cs_suspend(struct pcmcia_device *link)
@@ -393,9 +391,8 @@ static void mio_cs_config(struct pcmcia_device *link)
link->irq.IRQInfo1 = parse.cftable_entry.irq.IRQInfo1;
link->irq.IRQInfo2 = parse.cftable_entry.irq.IRQInfo2;
ret = pcmcia_request_irq(link, &link->irq);
- if (ret) {
+ if (ret)
printk("pcmcia_request_irq() returned error: %i\n", ret);
- }
/* printk("RequestIRQ 0x%02x\n",ret); */
link->conf.ConfigIndex = 1;
@@ -437,9 +434,8 @@ static int mio_cs_attach(struct comedi_device *dev, struct comedi_devconfig *it)
}
printk("\n");
printk(" board fingerprint (windowed):");
- for (i = 0; i < 10; i++) {
+ for (i = 0; i < 10; i++)
printk(" 0x%04x", win_in(i));
- }
printk("\n");
}
#endif
@@ -503,9 +499,8 @@ static int ni_getboardtype(struct comedi_device *dev,
id = get_prodid(dev, link);
for (i = 0; i < n_ni_boards; i++) {
- if (ni_boards[i].device_id == id) {
+ if (ni_boards[i].device_id == id)
return i;
- }
}
printk("unknown board 0x%04x -- pretend it is a ", id);
diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c b/drivers/staging/comedi/drivers/ni_pcidio.c
index d544698f2414..2d88a5be65ff 100644
--- a/drivers/staging/comedi/drivers/ni_pcidio.c
+++ b/drivers/staging/comedi/drivers/ni_pcidio.c
@@ -795,7 +795,7 @@ static int ni_pcidio_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->start_src != TRIG_NOW && cmd->start_src != TRIG_INT)
err++;
if (cmd->scan_begin_src != TRIG_TIMER &&
diff --git a/drivers/staging/comedi/drivers/pcm_common.c b/drivers/staging/comedi/drivers/pcm_common.c
index ebd9838232af..52c2a6698214 100644
--- a/drivers/staging/comedi/drivers/pcm_common.c
+++ b/drivers/staging/comedi/drivers/pcm_common.c
@@ -41,7 +41,8 @@ int comedi_pcm_cmdtest(struct comedi_device *dev,
if (err)
return 1;
- /* step 2: make sure trigger sources are unique and mutually compatible */
+ /* step 2: make sure trigger sources are unique and
+ * mutually compatible */
/* these tests are true if more than one _src bit is set */
if ((cmd->start_src & (cmd->start_src - 1)) != 0)
@@ -107,5 +108,4 @@ int comedi_pcm_cmdtest(struct comedi_device *dev,
return 0;
}
-
EXPORT_SYMBOL(comedi_pcm_cmdtest);
diff --git a/drivers/staging/comedi/drivers/pcmmio.c b/drivers/staging/comedi/drivers/pcmmio.c
index d812c2c3af12..35ba93989a36 100644
--- a/drivers/staging/comedi/drivers/pcmmio.c
+++ b/drivers/staging/comedi/drivers/pcmmio.c
@@ -32,8 +32,10 @@ Winsystems. This board is a PC-104 based I/O board. It contains
four subdevices:
subdevice 0 - 16 channels of 16-bit AI
subdevice 1 - 8 channels of 16-bit AO
- subdevice 2 - first 24 channels of the 48 channel of DIO (with edge-triggered interrupt support)
- subdevice 3 - last 24 channels of the 48 channel DIO (no interrupt support for this bank of channels)
+ subdevice 2 - first 24 channels of the 48 channel of DIO
+ (with edge-triggered interrupt support)
+ subdevice 3 - last 24 channels of the 48 channel DIO
+ (no interrupt support for this bank of channels)
Some notes:
@@ -70,7 +72,8 @@ four subdevices:
Configuration Options:
[0] - I/O port base address
- [1] - IRQ (optional -- for edge-detect interrupt support only, leave out if you don't need this feature)
+ [1] - IRQ (optional -- for edge-detect interrupt support only,
+ leave out if you don't need this feature)
*/
#include <linux/interrupt.h>
@@ -115,9 +118,11 @@ Configuration Options:
#define REG_PORT4 0x4
#define REG_PORT5 0x5
#define REG_INT_PENDING 0x6
-#define REG_PAGELOCK 0x7 /* page selector register, upper 2 bits select a page
- and bits 0-5 are used to 'lock down' a particular
- port above to make it readonly. */
+#define REG_PAGELOCK 0x7 /*
+ * page selector register, upper 2 bits select
+ * a page and bits 0-5 are used to 'lock down'
+ * a particular port above to make it readonly.
+ */
#define REG_POL0 0x8
#define REG_POL1 0x9
#define REG_POL2 0xA
@@ -134,7 +139,7 @@ Configuration Options:
#define REG_PAGE_BITOFFSET 6
#define REG_LOCK_BITOFFSET 0
#define REG_PAGE_MASK (~((0x1<<REG_PAGE_BITOFFSET)-1))
-#define REG_LOCK_MASK ~(REG_PAGE_MASK)
+#define REG_LOCK_MASK (~(REG_PAGE_MASK))
#define PAGE_POL 1
#define PAGE_ENAB 2
#define PAGE_INT_ID 3
@@ -168,13 +173,12 @@ struct pcmmio_board {
comedi_insn_fn_t ai_rinsn, ao_rinsn, ao_winsn;
};
-static const struct comedi_lrange ranges_ai =
- { 4, {RANGE(-5., 5.), RANGE(-10., 10.), RANGE(0., 5.), RANGE(0.,
- 10.)}
+static const struct comedi_lrange ranges_ai = {
+ 4, {RANGE(-5., 5.), RANGE(-10., 10.), RANGE(0., 5.), RANGE(0., 10.)}
};
-static const struct comedi_lrange ranges_ao =
- { 6, {RANGE(0., 5.), RANGE(0., 10.), RANGE(-5., 5.), RANGE(-10., 10.),
+static const struct comedi_lrange ranges_ao = {
+ 6, {RANGE(0., 5.), RANGE(0., 10.), RANGE(-5., 5.), RANGE(-10., 10.),
RANGE(-2.5, 2.5), RANGE(-2.5, 7.5)}
};
@@ -204,7 +208,8 @@ static const struct pcmmio_board pcmmio_boards[] = {
struct pcmmio_subdev_private {
union {
- /* for DIO: mapping of halfwords (bytes) in port/chanarray to iobase */
+ /* for DIO: mapping of halfwords (bytes)
+ in port/chanarray to iobase */
unsigned long iobases[PORTS_PER_SUBDEV];
/* for AI/AO */
@@ -215,15 +220,31 @@ struct pcmmio_subdev_private {
/* The below is only used for intr subdevices */
struct {
- int asic; /* if non-negative, this subdev has an interrupt asic */
- int first_chan; /* if nonnegative, the first channel id for
- interrupts. */
- int num_asic_chans; /* the number of asic channels in this subdev
- that have interrutps */
- int asic_chan; /* if nonnegative, the first channel id with
- respect to the asic that has interrupts */
- int enabled_mask; /* subdev-relative channel mask for channels
- we are interested in */
+ /*
+ * if non-negative, this subdev has an
+ * interrupt asic
+ */
+ int asic;
+ /*
+ * if nonnegative, the first channel id for
+ * interrupts.
+ */
+ int first_chan;
+ /*
+ * the number of asic channels in this subdev
+ * that have interrutps
+ */
+ int num_asic_chans;
+ /*
+ * if nonnegative, the first channel id with
+ * respect to the asic that has interrupts
+ */
+ int asic_chan;
+ /*
+ * subdev-relative channel mask for channels
+ * we are interested in
+ */
+ int enabled_mask;
int active;
int stop_count;
int continuous;
@@ -231,20 +252,25 @@ struct pcmmio_subdev_private {
} intr;
} dio;
struct {
- unsigned int shadow_samples[8]; /* the last unsigned int data written */
+ /* the last unsigned int data written */
+ unsigned int shadow_samples[8];
} ao;
};
};
-/* this structure is for data unique to this hardware driver. If
- several hardware drivers keep similar information in this structure,
- feel free to suggest moving the variable to the struct comedi_device struct. */
+/*
+ * this structure is for data unique to this hardware driver. If
+ * several hardware drivers keep similar information in this structure,
+ * feel free to suggest moving the variable to the struct comedi_device struct.
+ */
struct pcmmio_private {
/* stuff for DIO */
struct {
unsigned char pagelock; /* current page and lock */
- unsigned char pol[NUM_PAGED_REGS]; /* shadow of POLx registers */
- unsigned char enab[NUM_PAGED_REGS]; /* shadow of ENABx registers */
+ /* shadow of POLx registers */
+ unsigned char pol[NUM_PAGED_REGS];
+ /* shadow of ENABx registers */
+ unsigned char enab[NUM_PAGED_REGS];
int num;
unsigned long iobase;
unsigned int irq;
@@ -312,7 +338,8 @@ static int pcmmio_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_cmd *cmd);
/* some helper functions to deal with specifics of this device's registers */
-static void init_asics(struct comedi_device *dev); /* sets up/clears ASIC chips to defaults */
+/* sets up/clears ASIC chips to defaults */
+static void init_asics(struct comedi_device *dev);
static void switch_page(struct comedi_device *dev, int asic, int page);
#ifdef notused
static void lock_port(struct comedi_device *dev, int asic, int port);
@@ -367,9 +394,11 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->asics[asic].num = asic;
devpriv->asics[asic].iobase =
dev->iobase + 16 + asic * ASIC_IOSIZE;
- devpriv->asics[asic].irq = 0; /* this gets actually set at the end of
- this function when we
- request_irqs */
+ /*
+ * this gets actually set at the end of this function when we
+ * request_irqs
+ */
+ devpriv->asics[asic].irq = 0;
spin_lock_init(&devpriv->asics[asic].spinlock);
}
@@ -463,7 +492,10 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
if (thisasic_chanct <
CHANS_PER_PORT * INTR_PORTS_PER_ASIC
&& subpriv->dio.intr.asic < 0) {
- /* this is an interrupt subdevice, so setup the struct */
+ /*
+ * this is an interrupt subdevice,
+ * so setup the struct
+ */
subpriv->dio.intr.asic = asic;
subpriv->dio.intr.active = 0;
subpriv->dio.intr.stop_count = 0;
@@ -484,7 +516,11 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
chans_left -= s->n_chan;
if (!chans_left) {
- asic = 0; /* reset the asic to our first asic, to do intr subdevs */
+ /*
+ * reset the asic to our first asic,
+ * to do intr subdevs
+ */
+ asic = 0;
port = 0;
}
@@ -507,8 +543,10 @@ static int pcmmio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
devpriv->asics[asic].irq = irq[asic];
}
- dev->irq = irq[0]; /* grr.. wish comedi dev struct supported multiple
- irqs.. */
+ dev->irq = irq[0]; /*
+ * grr.. wish comedi dev struct supported
+ * multiple irqs..
+ */
if (irq[0]) {
printk("irq: %u ", irq[0]);
@@ -604,9 +642,14 @@ static int pcmmio_dio_insn_bits(struct comedi_device *dev,
#endif
if (write_mask_byte) {
- /* this byte has some write_bits -- so set the output lines */
- byte &= ~write_mask_byte; /* clear bits for write mask */
- byte |= ~data_byte & write_mask_byte; /* set to inverted data_byte */
+ /*
+ * this byte has some write_bits
+ * -- so set the output lines
+ */
+ /* clear bits for write mask */
+ byte &= ~write_mask_byte;
+ /* set to inverted data_byte */
+ byte |= ~data_byte & write_mask_byte;
/* Write out the new digital output state */
outb(byte, ioaddr);
}
@@ -670,9 +713,11 @@ static int pcmmio_dio_insn_config(struct comedi_device *dev,
byte &= ~(1 << bit_no);
/**< set input channel to '0' */
- /* write out byte -- this is the only time we actually affect the
- hardware as all channels are implicitly output -- but input
- channels are set to float-high */
+ /*
+ * write out byte -- this is the only time we actually affect
+ * the hardware as all channels are implicitly output
+ * -- but input channels are set to float-high
+ */
outb(byte, ioaddr);
/* save to io_bits */
@@ -726,8 +771,8 @@ static void init_asics(struct comedi_device *dev)
outb(0xff, baseaddr + REG_ENAB0); */
/* END DEBUG */
- switch_page(dev, asic, 0); /* switch back to default page 0 */
-
+ /* switch back to default page 0 */
+ switch_page(dev, asic, 0);
}
}
@@ -806,7 +851,10 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
REG_INT_ID0 + port);
if (io_lines_with_edges)
- /* clear pending interrupt */
+ /*
+ * clear pending
+ * interrupt
+ */
outb(0, iobase +
REG_INT_ID0 +
port);
@@ -825,14 +873,21 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
if (triggered) {
struct comedi_subdevice *s;
- /* TODO here: dispatch io lines to subdevs with commands.. */
+ /*
+ * TODO here: dispatch io lines to subdevs
+ * with commands..
+ */
printk
("PCMMIO DEBUG: got edge detect interrupt %d asic %d which_chans: %06x\n",
irq, asic, triggered);
for (s = dev->subdevices + 2;
s < dev->subdevices + dev->n_subdevices;
++s) {
- if (subpriv->dio.intr.asic == asic) { /* this is an interrupt subdev, and it matches this asic! */
+ /*
+ * this is an interrupt subdev,
+ * and it matches this asic!
+ */
+ if (subpriv->dio.intr.asic == asic) {
unsigned long flags;
unsigned oldevents;
@@ -867,9 +922,8 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
n < len;
n++) {
ch = CR_CHAN(s->async->cmd.chanlist[n]);
- if (mytrig & (1U << ch)) {
+ if (mytrig & (1U << ch))
val |= (1U << n);
- }
}
/* Write the scan to the buffer. */
if (comedi_buf_put(s->async, ((short *)&val)[0])
@@ -877,8 +931,7 @@ static irqreturn_t interrupt_pcmmio(int irq, void *d)
comedi_buf_put
(s->async,
((short *)
- &val)[1]))
- {
+ &val)[1])) {
s->async->events |= (COMEDI_CB_BLOCK | COMEDI_CB_EOS);
} else {
/* Overflow! Stop acquisition!! */
@@ -981,9 +1034,16 @@ static int pcmmio_start_intr(struct comedi_device *dev,
1) << subpriv->dio.intr.first_chan;
subpriv->dio.intr.enabled_mask = bits;
- { /* the below code configures the board to use a specific IRQ from 0-15. */
+ {
+ /*
+ * the below code configures the board
+ * to use a specific IRQ from 0-15.
+ */
unsigned char b;
- /* set resource enable register to enable IRQ operation */
+ /*
+ * set resource enable register
+ * to enable IRQ operation
+ */
outb(1 << 4, dev->iobase + 3);
/* set bits 0-3 of b to the irq number from 0-15 */
b = dev->irq & ((1 << 4) - 1);
@@ -1037,14 +1097,12 @@ pcmmio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s,
spin_lock_irqsave(&subpriv->dio.intr.spinlock, flags);
s->async->inttrig = 0;
- if (subpriv->dio.intr.active) {
+ if (subpriv->dio.intr.active)
event = pcmmio_start_intr(dev, s);
- }
spin_unlock_irqrestore(&subpriv->dio.intr.spinlock, flags);
- if (event) {
+ if (event)
comedi_event(dev, s);
- }
return 1;
}
@@ -1086,9 +1144,8 @@ static int pcmmio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
}
spin_unlock_irqrestore(&subpriv->dio.intr.spinlock, flags);
- if (event) {
+ if (event)
comedi_event(dev, s);
- }
return 0;
}
@@ -1136,17 +1193,32 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
short sample, adc_adjust = 0;
if (chan > 7)
- chan -= 8, iooffset = 4; /* use the second dword for channels > 7 */
+ chan -= 8, iooffset = 4; /*
+ * use the second dword
+ * for channels > 7
+ */
if (aref != AREF_DIFF) {
aref = AREF_GROUND;
- command_byte |= 1 << 7; /* set bit 7 to indicate single-ended */
+ command_byte |= 1 << 7; /*
+ * set bit 7 to indicate
+ * single-ended
+ */
}
if (range < 2)
- adc_adjust = 0x8000; /* bipolar ranges (-5,5 .. -10,10 need to be adjusted -- that is.. they need to wrap around by adding 0x8000 */
+ adc_adjust = 0x8000; /*
+ * bipolar ranges
+ * (-5,5 .. -10,10 need to be
+ * adjusted -- that is.. they
+ * need to wrap around by
+ * adding 0x8000
+ */
if (chan % 2) {
- command_byte |= 1 << 6; /* odd-numbered channels have bit 6 set */
+ command_byte |= 1 << 6; /*
+ * odd-numbered channels
+ * have bit 6 set
+ */
}
/* select the channel, bits 4-5 == chan/2 */
@@ -1156,16 +1228,22 @@ static int ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
command_byte |= (range & 0x3) << 2;
/* need to do this twice to make sure mux settled */
- outb(command_byte, iobase + iooffset + 2); /* chan/range/aref select */
+ /* chan/range/aref select */
+ outb(command_byte, iobase + iooffset + 2);
- adc_wait_ready(iobase + iooffset); /* wait for the adc to say it finised the conversion */
+ /* wait for the adc to say it finised the conversion */
+ adc_wait_ready(iobase + iooffset);
- outb(command_byte, iobase + iooffset + 2); /* select the chan/range/aref AGAIN */
+ /* select the chan/range/aref AGAIN */
+ outb(command_byte, iobase + iooffset + 2);
adc_wait_ready(iobase + iooffset);
- sample = inb(iobase + iooffset + 0); /* read data lo byte */
- sample |= inb(iobase + iooffset + 1) << 8; /* read data hi byte */
+ /* read data lo byte */
+ sample = inb(iobase + iooffset + 0);
+
+ /* read data hi byte */
+ sample |= inb(iobase + iooffset + 1) << 8;
sample += adc_adjust; /* adjustment .. munge data */
data[n] = sample;
}
@@ -1227,15 +1305,24 @@ static int ao_winsn(struct comedi_device *dev, struct comedi_subdevice *s,
wait_dac_ready(iobase + iooffset);
- outb(data[n] & 0xff, iobase + iooffset + 0); /* low order byte */
- outb((data[n] >> 8) & 0xff, iobase + iooffset + 1); /* high order byte */
- command_byte = 0x70 | (chan << 1); /* set bit 4 of command byte to indicate data is loaded and trigger conversion */
+ /* low order byte */
+ outb(data[n] & 0xff, iobase + iooffset + 0);
+
+ /* high order byte */
+ outb((data[n] >> 8) & 0xff, iobase + iooffset + 1);
+
+ /*
+ * set bit 4 of command byte to indicate
+ * data is loaded and trigger conversion
+ */
+ command_byte = 0x70 | (chan << 1);
/* trigger converion */
outb(command_byte, iobase + iooffset + 2);
wait_dac_ready(iobase + iooffset);
- subpriv->ao.shadow_samples[chan] = data[n]; /* save to shadow register for ao_rinsn */
+ /* save to shadow register for ao_rinsn */
+ subpriv->ao.shadow_samples[chan] = data[n];
}
}
return n;
diff --git a/drivers/staging/comedi/drivers/quatech_daqp_cs.c b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
index 344b82353e08..9e1890b72e32 100644
--- a/drivers/staging/comedi/drivers/quatech_daqp_cs.c
+++ b/drivers/staging/comedi/drivers/quatech_daqp_cs.c
@@ -506,7 +506,7 @@ static int daqp_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_FOLLOW)
err++;
diff --git a/drivers/staging/comedi/drivers/rtd520.c b/drivers/staging/comedi/drivers/rtd520.c
index f35cce597140..8626658e778c 100644
--- a/drivers/staging/comedi/drivers/rtd520.c
+++ b/drivers/staging/comedi/drivers/rtd520.c
@@ -1768,7 +1768,7 @@ static int rtd_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique
and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_EXT) {
err++;
diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
index 80d2787d1063..fdd7ab954d8c 100644
--- a/drivers/staging/comedi/drivers/s626.c
+++ b/drivers/staging/comedi/drivers/s626.c
@@ -1926,7 +1926,7 @@ static int s626_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually
compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_EXT
&& cmd->scan_begin_src != TRIG_FOLLOW)
diff --git a/drivers/staging/comedi/drivers/s626.h b/drivers/staging/comedi/drivers/s626.h
index 1d04922ea16c..d02742a95294 100644
--- a/drivers/staging/comedi/drivers/s626.h
+++ b/drivers/staging/comedi/drivers/s626.h
@@ -76,14 +76,6 @@
#define FALSE (0)
#endif
-#if !defined(EXTERN)
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-#else
-#define EXTERN extern
-#endif
-#endif
-
#if !defined(INLINE)
#define INLINE static __inline
#endif
diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index 82aa86e718b2..e7c13eba983b 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -125,14 +125,9 @@ struct serial_data {
static long tty_ioctl(struct file *f, unsigned op, unsigned long param)
{
-#ifdef HAVE_UNLOCKED_IOCTL
- if (f->f_op->unlocked_ioctl) {
+ if (f->f_op->unlocked_ioctl)
return f->f_op->unlocked_ioctl(f, op, param);
- }
-#endif
- if (f->f_op->ioctl) {
- return f->f_op->ioctl(f->f_dentry->d_inode, f, op, param);
- }
+
return -ENOSYS;
}
diff --git a/drivers/staging/comedi/drivers/skel.c b/drivers/staging/comedi/drivers/skel.c
index 3dee62aa2d7b..aba57d93dd3d 100644
--- a/drivers/staging/comedi/drivers/skel.c
+++ b/drivers/staging/comedi/drivers/skel.c
@@ -399,7 +399,7 @@ static int skel_ai_cmdtest(struct comedi_device *dev,
/* step 2: make sure trigger sources are unique and mutually compatible */
- /* note that mutual compatiblity is not an issue here */
+ /* note that mutual compatibility is not an issue here */
if (cmd->scan_begin_src != TRIG_TIMER &&
cmd->scan_begin_src != TRIG_EXT)
err++;
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c
index cca4e869f0ec..cec028e0db13 100644
--- a/drivers/staging/comedi/drivers/usbdux.c
+++ b/drivers/staging/comedi/drivers/usbdux.c
@@ -979,7 +979,7 @@ static int usbdux_ai_cmdtest(struct comedi_device *dev,
/*
* step 2: make sure trigger sources are unique and mutually compatible
- * note that mutual compatiblity is not an issue here
+ * note that mutual compatibility is not an issue here
*/
if (cmd->scan_begin_src != TRIG_FOLLOW &&
cmd->scan_begin_src != TRIG_EXT &&
@@ -1557,7 +1557,7 @@ static int usbdux_ao_cmdtest(struct comedi_device *dev,
/*
* step 2: make sure trigger sources are unique and mutually compatible
- * note that mutual compatiblity is not an issue here
+ * note that mutual compatibility is not an issue here
*/
if (cmd->scan_begin_src != TRIG_FOLLOW &&
cmd->scan_begin_src != TRIG_EXT &&
diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
index c335040778f0..c34a0b9141e2 100644
--- a/drivers/staging/comedi/drivers/vmk80xx.c
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
@@ -76,18 +76,18 @@ enum {
};
static struct usb_device_id vmk80xx_id_table[] = {
- {USB_DEVICE(0x10cf, 0x5500),.driver_info = DEVICE_VMK8055},
- {USB_DEVICE(0x10cf, 0x5501),.driver_info = DEVICE_VMK8055},
- {USB_DEVICE(0x10cf, 0x5502),.driver_info = DEVICE_VMK8055},
- {USB_DEVICE(0x10cf, 0x5503),.driver_info = DEVICE_VMK8055},
- {USB_DEVICE(0x10cf, 0x8061),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8062),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8063),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8064),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8065),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8066),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8067),.driver_info = DEVICE_VMK8061},
- {USB_DEVICE(0x10cf, 0x8068),.driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x5500), .driver_info = DEVICE_VMK8055},
+ {USB_DEVICE(0x10cf, 0x5501), .driver_info = DEVICE_VMK8055},
+ {USB_DEVICE(0x10cf, 0x5502), .driver_info = DEVICE_VMK8055},
+ {USB_DEVICE(0x10cf, 0x5503), .driver_info = DEVICE_VMK8055},
+ {USB_DEVICE(0x10cf, 0x8061), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8062), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8063), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8064), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8065), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8066), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8067), .driver_info = DEVICE_VMK8061},
+ {USB_DEVICE(0x10cf, 0x8068), .driver_info = DEVICE_VMK8061},
{} /* terminating entry */
};
diff --git a/drivers/staging/cx25821/cx25821-core.c b/drivers/staging/cx25821/cx25821-core.c
index 8aceae5a072e..67f689de4daa 100644
--- a/drivers/staging/cx25821/cx25821-core.c
+++ b/drivers/staging/cx25821/cx25821-core.c
@@ -1521,7 +1521,7 @@ static struct pci_driver cx25821_pci_driver = {
.resume = NULL,
};
-static int cx25821_init(void)
+static int __init cx25821_init(void)
{
INIT_LIST_HEAD(&cx25821_devlist);
printk(KERN_INFO "cx25821 driver version %d.%d.%d loaded\n",
@@ -1530,7 +1530,7 @@ static int cx25821_init(void)
return pci_register_driver(&cx25821_pci_driver);
}
-static void cx25821_fini(void)
+static void __exit cx25821_fini(void)
{
pci_unregister_driver(&cx25821_pci_driver);
}
diff --git a/drivers/staging/dream/Kconfig b/drivers/staging/dream/Kconfig
index 52bd187de5a7..4afa081c870c 100644
--- a/drivers/staging/dream/Kconfig
+++ b/drivers/staging/dream/Kconfig
@@ -1,3 +1,7 @@
+config DREAM
+ tristate "HTC Dream support"
+ depends on BROKEN
+
source "drivers/staging/dream/smd/Kconfig"
source "drivers/staging/dream/camera/Kconfig"
diff --git a/drivers/staging/dream/camera/msm_camera.c b/drivers/staging/dream/camera/msm_camera.c
index 88165998698c..7d938772eacc 100644
--- a/drivers/staging/dream/camera/msm_camera.c
+++ b/drivers/staging/dream/camera/msm_camera.c
@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
+#include <linux/sched.h>
#include <mach/board.h>
#include <linux/fs.h>
@@ -1597,7 +1598,6 @@ static int __msm_release(struct msm_sync *sync)
MSM_DRAIN_QUEUE(sync, pict_frame_q);
sync->sctrl.s_release();
- wake_unlock(&sync->wake_lock);
sync->apps_id = NULL;
CDBG("msm_release completed!\n");
@@ -1806,7 +1806,6 @@ static int __msm_open(struct msm_sync *sync, const char *const apps_id)
sync->apps_id = apps_id;
if (!sync->opencnt) {
- wake_lock(&sync->wake_lock);
msm_camvfe_fn_init(&sync->vfefn, sync);
if (sync->vfefn.vfe_init) {
@@ -2044,8 +2043,6 @@ static int msm_sync_init(struct msm_sync *sync,
INIT_LIST_HEAD(&sync->pict_frame_q);
init_waitqueue_head(&sync->pict_frame_wait);
- wake_lock_init(&sync->wake_lock, WAKE_LOCK_IDLE, "msm_camera");
-
rc = msm_camio_probe_on(pdev);
if (rc < 0)
return rc;
@@ -2058,7 +2055,6 @@ static int msm_sync_init(struct msm_sync *sync,
if (rc < 0) {
pr_err("msm_camera: failed to initialize %s\n",
sync->sdata->sensor_name);
- wake_lock_destroy(&sync->wake_lock);
return rc;
}
@@ -2070,7 +2066,6 @@ static int msm_sync_init(struct msm_sync *sync,
static int msm_sync_destroy(struct msm_sync *sync)
{
- wake_lock_destroy(&sync->wake_lock);
return 0;
}
diff --git a/drivers/staging/dream/camera/msm_vfe7x.c b/drivers/staging/dream/camera/msm_vfe7x.c
index 5de96c5d6352..33ab3ac6ac57 100644
--- a/drivers/staging/dream/camera/msm_vfe7x.c
+++ b/drivers/staging/dream/camera/msm_vfe7x.c
@@ -5,6 +5,7 @@
#include <linux/msm_adsp.h>
#include <linux/uaccess.h>
#include <linux/fs.h>
+#include <linux/sched.h>
#include <linux/android_pmem.h>
#include <mach/msm_adsp.h>
#include <linux/delay.h>
diff --git a/drivers/staging/dream/gpio_event.c b/drivers/staging/dream/gpio_event.c
index 8b64c1e579ba..e60e2c0db9c0 100644
--- a/drivers/staging/dream/gpio_event.c
+++ b/drivers/staging/dream/gpio_event.c
@@ -13,7 +13,7 @@
*
*/
-#include <linux/earlysuspend.h>
+
#include <linux/module.h>
#include <linux/input.h>
#include <linux/gpio_event.h>
@@ -23,7 +23,6 @@
struct gpio_event {
struct input_dev *input_dev;
const struct gpio_event_platform_data *info;
- struct early_suspend early_suspend;
void *state[0];
};
diff --git a/drivers/staging/dream/gpio_input.c b/drivers/staging/dream/gpio_input.c
index 7e307f267a2a..0638ec43601a 100644
--- a/drivers/staging/dream/gpio_input.c
+++ b/drivers/staging/dream/gpio_input.c
@@ -19,7 +19,6 @@
#include <linux/hrtimer.h>
#include <linux/input.h>
#include <linux/interrupt.h>
-#include <linux/wakelock.h>
enum {
DEBOUNCE_UNSTABLE = BIT(0), /* Got irq, while debouncing */
@@ -44,7 +43,6 @@ struct gpio_input_state {
int use_irq;
int debounce_count;
spinlock_t irq_lock;
- struct wake_lock wake_lock;
struct gpio_key_state key_state[0];
};
@@ -143,8 +141,6 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
hrtimer_start(timer, ds->info->debounce_time, HRTIMER_MODE_REL);
else if (!ds->use_irq)
hrtimer_start(timer, ds->info->poll_time, HRTIMER_MODE_REL);
- else
- wake_unlock(&ds->wake_lock);
spin_unlock_irqrestore(&ds->irq_lock, irqflags);
@@ -170,7 +166,6 @@ static irqreturn_t gpio_event_input_irq_handler(int irq, void *dev_id)
if (ks->debounce & DEBOUNCE_WAIT_IRQ) {
ks->debounce = DEBOUNCE_UNKNOWN;
if (ds->debounce_count++ == 0) {
- wake_lock(&ds->wake_lock);
hrtimer_start(
&ds->timer, ds->info->debounce_time,
HRTIMER_MODE_REL);
@@ -277,7 +272,6 @@ int gpio_event_input_func(struct input_dev *input_dev,
ds->debounce_count = di->keymap_size;
ds->input_dev = input_dev;
ds->info = di;
- wake_lock_init(&ds->wake_lock, WAKE_LOCK_SUSPEND, "gpio_input");
spin_lock_init(&ds->irq_lock);
for (i = 0; i < di->keymap_size; i++) {
@@ -336,7 +330,6 @@ err_gpio_configure_failed:
err_gpio_request_failed:
;
}
- wake_lock_destroy(&ds->wake_lock);
kfree(ds);
err_ds_alloc_failed:
return ret;
diff --git a/drivers/staging/dream/gpio_matrix.c b/drivers/staging/dream/gpio_matrix.c
index c1f47651a493..796de4faf859 100644
--- a/drivers/staging/dream/gpio_matrix.c
+++ b/drivers/staging/dream/gpio_matrix.c
@@ -18,13 +18,11 @@
#include <linux/gpio_event.h>
#include <linux/hrtimer.h>
#include <linux/interrupt.h>
-#include <linux/wakelock.h>
struct gpio_kp {
struct input_dev *input_dev;
struct gpio_event_matrix_info *keypad_info;
struct hrtimer timer;
- struct wake_lock wake_lock;
int current_output;
unsigned int use_irq:1;
unsigned int key_state_changed:1;
@@ -199,7 +197,6 @@ static enum hrtimer_restart gpio_keypad_timer_func(struct hrtimer *timer)
}
for (in = 0; in < mi->ninputs; in++)
enable_irq(gpio_to_irq(mi->input_gpios[in]));
- wake_unlock(&kp->wake_lock);
return HRTIMER_NORESTART;
}
@@ -222,7 +219,6 @@ static irqreturn_t gpio_keypad_irq_handler(int irq_in, void *dev_id)
else
gpio_direction_input(mi->output_gpios[i]);
}
- wake_lock(&kp->wake_lock);
hrtimer_start(&kp->timer, ktime_set(0, 0), HRTIMER_MODE_REL);
return IRQ_HANDLED;
}
@@ -363,7 +359,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
hrtimer_init(&kp->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
kp->timer.function = gpio_keypad_timer_func;
- wake_lock_init(&kp->wake_lock, WAKE_LOCK_SUSPEND, "gpio_kp");
err = gpio_keypad_request_irqs(kp);
kp->use_irq = err == 0;
@@ -371,8 +366,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
"in %s mode\n", input_dev->name,
kp->use_irq ? "interrupt" : "polling");
- if (kp->use_irq)
- wake_lock(&kp->wake_lock);
hrtimer_start(&kp->timer, ktime_set(0, 0), HRTIMER_MODE_REL);
return 0;
@@ -386,7 +379,6 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
free_irq(gpio_to_irq(mi->input_gpios[i]), kp);
hrtimer_cancel(&kp->timer);
- wake_lock_destroy(&kp->wake_lock);
for (i = mi->noutputs - 1; i >= 0; i--) {
err_gpio_direction_input_failed:
gpio_free(mi->input_gpios[i]);
diff --git a/drivers/staging/dream/qdsp5/adsp.c b/drivers/staging/dream/qdsp5/adsp.c
index d096456688da..9069535fcaf1 100644
--- a/drivers/staging/dream/qdsp5/adsp.c
+++ b/drivers/staging/dream/qdsp5/adsp.c
@@ -32,16 +32,12 @@
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/wait.h>
-#include <linux/wakelock.h>
-static struct wake_lock adsp_wake_lock;
static inline void prevent_suspend(void)
{
- wake_lock(&adsp_wake_lock);
}
static inline void allow_suspend(void)
{
- wake_unlock(&adsp_wake_lock);
}
#include <linux/io.h>
@@ -1046,7 +1042,6 @@ static int msm_adsp_probe(struct platform_device *pdev)
pr_info("adsp: probe\n");
- wake_lock_init(&adsp_wake_lock, WAKE_LOCK_SUSPEND, "adsp");
#if CONFIG_MSM_AMSS_VERSION >= 6350
adsp_info.init_info_ptr = kzalloc(
(sizeof(struct adsp_rtos_mp_mtoa_init_info_type)), GFP_KERNEL);
diff --git a/drivers/staging/dream/qdsp5/audio_out.c b/drivers/staging/dream/qdsp5/audio_out.c
index d1adcf65f2bd..df87ca337b94 100644
--- a/drivers/staging/dream/qdsp5/audio_out.c
+++ b/drivers/staging/dream/qdsp5/audio_out.c
@@ -38,8 +38,6 @@
#include <mach/qdsp5/qdsp5audppcmdi.h>
#include <mach/qdsp5/qdsp5audppmsg.h>
-#include <mach/htc_pwrsink.h>
-
#include "evlog.h"
#define LOG_AUDIO_EVENTS 1
@@ -260,7 +258,6 @@ static int audio_enable(struct audio *audio)
}
audio->enabled = 1;
- htc_pwrsink_set(PWRSINK_AUDIO, 100);
return 0;
}
@@ -695,7 +692,6 @@ static int audio_release(struct inode *inode, struct file *file)
audio_flush(audio);
audio->opened = 0;
mutex_unlock(&audio->lock);
- htc_pwrsink_set(PWRSINK_AUDIO, 0);
return 0;
}
diff --git a/drivers/staging/dream/smd/smd_qmi.c b/drivers/staging/dream/smd/smd_qmi.c
index d4e7d8804626..687db142904c 100644
--- a/drivers/staging/dream/smd/smd_qmi.c
+++ b/drivers/staging/dream/smd/smd_qmi.c
@@ -24,7 +24,6 @@
#include <linux/wait.h>
#include <linux/miscdevice.h>
#include <linux/workqueue.h>
-#include <linux/wakelock.h>
#include <asm/uaccess.h>
#include <mach/msm_smd.h>
@@ -74,7 +73,6 @@ struct qmi_ctxt {
smd_channel_t *ch;
const char *ch_name;
- struct wake_lock wake_lock;
struct work_struct open_work;
struct work_struct read_work;
@@ -90,7 +88,6 @@ void qmi_ctxt_init(struct qmi_ctxt *ctxt, unsigned n)
mutex_init(&ctxt->lock);
INIT_WORK(&ctxt->read_work, qmi_read_work);
INIT_WORK(&ctxt->open_work, qmi_open_work);
- wake_lock_init(&ctxt->wake_lock, WAKE_LOCK_SUSPEND, ctxt->misc.name);
ctxt->ctl_txn_id = 1;
ctxt->wds_txn_id = 1;
ctxt->wds_busy = 1;
@@ -454,7 +451,6 @@ static void qmi_process_qmux(struct qmi_ctxt *ctxt,
break;
}
mutex_unlock(&ctxt->lock);
-
wake_up(&qmi_wait_queue);
}
@@ -509,7 +505,6 @@ static void qmi_notify(void *priv, unsigned event)
int sz;
sz = smd_cur_packet_size(ctxt->ch);
if ((sz > 0) && (sz <= smd_read_avail(ctxt->ch))) {
- wake_lock_timeout(&ctxt->wake_lock, HZ / 2);
queue_work(qmi_wq, &ctxt->read_work);
}
break;
diff --git a/drivers/staging/dream/smd/smd_rpcrouter.c b/drivers/staging/dream/smd/smd_rpcrouter.c
index d4a4a887e428..5ac2cd4a5978 100644
--- a/drivers/staging/dream/smd/smd_rpcrouter.c
+++ b/drivers/staging/dream/smd/smd_rpcrouter.c
@@ -33,7 +33,6 @@
#include <linux/err.h>
#include <linux/sched.h>
#include <linux/poll.h>
-#include <linux/wakelock.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
#include <linux/platform_device.h>
@@ -96,7 +95,6 @@ static DEFINE_SPINLOCK(server_list_lock);
static DEFINE_SPINLOCK(smd_lock);
static struct workqueue_struct *rpcrouter_workqueue;
-static struct wake_lock rpcrouter_wake_lock;
static int rpcrouter_need_len;
static atomic_t next_xid = ATOMIC_INIT(1);
@@ -290,7 +288,6 @@ struct msm_rpc_endpoint *msm_rpcrouter_create_local_endpoint(dev_t dev)
init_waitqueue_head(&ept->wait_q);
INIT_LIST_HEAD(&ept->read_q);
spin_lock_init(&ept->read_q_lock);
- wake_lock_init(&ept->read_q_wake_lock, WAKE_LOCK_SUSPEND, "rpc_read");
INIT_LIST_HEAD(&ept->incomplete);
spin_lock_irqsave(&local_endpoints_lock, flags);
@@ -313,7 +310,6 @@ int msm_rpcrouter_destroy_local_endpoint(struct msm_rpc_endpoint *ept)
if (rc < 0)
return rc;
- wake_lock_destroy(&ept->read_q_wake_lock);
list_del(&ept->list);
kfree(ept);
return 0;
@@ -540,8 +536,6 @@ static void rpcrouter_smdnotify(void *_dev, unsigned event)
if (event != SMD_EVENT_DATA)
return;
- if (smd_read_avail(smd_channel) >= rpcrouter_need_len)
- wake_lock(&rpcrouter_wake_lock);
wake_up(&smd_wait);
}
@@ -576,7 +570,6 @@ static int rr_read(void *data, int len)
return -EIO;
}
rpcrouter_need_len = len;
- wake_unlock(&rpcrouter_wake_lock);
spin_unlock_irqrestore(&smd_lock, flags);
// printk("rr_read: waiting (%d)\n", len);
@@ -676,7 +669,6 @@ static void do_read_data(struct work_struct *work)
packet_complete:
spin_lock_irqsave(&ept->read_q_lock, flags);
- wake_lock(&ept->read_q_wake_lock);
list_add_tail(&pkt->list, &ept->read_q);
wake_up(&ept->wait_q);
spin_unlock_irqrestore(&ept->read_q_lock, flags);
@@ -699,7 +691,6 @@ done:
fail_io:
fail_data:
printk(KERN_ERR "rpc_router has died\n");
- wake_unlock(&rpcrouter_wake_lock);
}
void msm_rpc_setup_req(struct rpc_request_hdr *hdr, uint32_t prog,
@@ -1061,8 +1052,6 @@ int __msm_rpc_read(struct msm_rpc_endpoint *ept,
return -ETOOSMALL;
}
list_del(&pkt->list);
- if (list_empty(&ept->read_q))
- wake_unlock(&ept->read_q_wake_lock);
spin_unlock_irqrestore(&ept->read_q_lock, flags);
rc = pkt->length;
@@ -1229,7 +1218,6 @@ static int msm_rpcrouter_probe(struct platform_device *pdev)
init_waitqueue_head(&newserver_wait);
init_waitqueue_head(&smd_wait);
- wake_lock_init(&rpcrouter_wake_lock, WAKE_LOCK_SUSPEND, "SMD_RPCCALL");
rpcrouter_workqueue = create_singlethread_workqueue("rpcrouter");
if (!rpcrouter_workqueue)
diff --git a/drivers/staging/dream/smd/smd_rpcrouter.h b/drivers/staging/dream/smd/smd_rpcrouter.h
index a7416a2ec58c..86ab997b1b79 100644
--- a/drivers/staging/dream/smd/smd_rpcrouter.h
+++ b/drivers/staging/dream/smd/smd_rpcrouter.h
@@ -22,7 +22,6 @@
#include <linux/list.h>
#include <linux/cdev.h>
#include <linux/platform_device.h>
-#include <linux/wakelock.h>
#include <mach/msm_smd.h>
#include <mach/msm_rpcrouter.h>
@@ -144,7 +143,6 @@ struct msm_rpc_endpoint {
/* complete packets waiting to be read */
struct list_head read_q;
spinlock_t read_q_lock;
- struct wake_lock read_q_wake_lock;
wait_queue_head_t wait_q;
unsigned flags;
diff --git a/drivers/staging/dream/smd/smd_tty.c b/drivers/staging/dream/smd/smd_tty.c
index 2edd9d1ec2dc..f40944958d44 100644
--- a/drivers/staging/dream/smd/smd_tty.c
+++ b/drivers/staging/dream/smd/smd_tty.c
@@ -19,7 +19,6 @@
#include <linux/cdev.h>
#include <linux/device.h>
#include <linux/wait.h>
-#include <linux/wakelock.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
@@ -34,7 +33,6 @@ static DEFINE_MUTEX(smd_tty_lock);
struct smd_tty_info {
smd_channel_t *ch;
struct tty_struct *tty;
- struct wake_lock wake_lock;
int open_count;
};
@@ -69,7 +67,6 @@ static void smd_tty_notify(void *priv, unsigned event)
printk(KERN_ERR "OOPS - smd_tty_buffer mismatch?!");
}
- wake_lock_timeout(&info->wake_lock, HZ / 2);
tty_flip_buffer_push(tty);
}
@@ -95,7 +92,6 @@ static int smd_tty_open(struct tty_struct *tty, struct file *f)
info = smd_tty + n;
mutex_lock(&smd_tty_lock);
- wake_lock_init(&info->wake_lock, WAKE_LOCK_SUSPEND, name);
tty->driver_data = info;
if (info->open_count++ == 0) {
@@ -122,7 +118,6 @@ static void smd_tty_close(struct tty_struct *tty, struct file *f)
if (--info->open_count == 0) {
info->tty = 0;
tty->driver_data = 0;
- wake_lock_destroy(&info->wake_lock);
if (info->ch) {
smd_close(info->ch);
info->ch = 0;
diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c
index ae696d3bc8e6..4de6bc917595 100644
--- a/drivers/staging/dream/synaptics_i2c_rmi.c
+++ b/drivers/staging/dream/synaptics_i2c_rmi.c
@@ -379,6 +379,12 @@ static int __devinit synaptics_ts_probe(
goto err_check_functionality_failed;
}
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) {
+ pr_err("synaptics_ts_probe: need I2C_FUNC_SMBUS_WORD_DATA\n");
+ ret = -ENODEV;
+ goto err_check_functionality_failed;
+ }
+
ts = kzalloc(sizeof(*ts), GFP_KERNEL);
if (ts == NULL) {
ret = -ENOMEM;
diff --git a/drivers/staging/et131x/et1310_address_map.h b/drivers/staging/et131x/et1310_address_map.h
index 2c3d65a622a7..d4652e9e1225 100644
--- a/drivers/staging/et131x/et1310_address_map.h
+++ b/drivers/staging/et131x/et1310_address_map.h
@@ -1308,157 +1308,77 @@ typedef struct _RXMAC_t { /* Location: */
/*
* structure for configuration #1 reg in mac address map.
* located at address 0x5000
- */
-typedef union _MAC_CFG1_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 soft_reset:1; /* bit 31 */
- u32 sim_reset:1; /* bit 30 */
- u32 reserved3:10; /* bits 20-29 */
- u32 reset_rx_mc:1; /* bit 19 */
- u32 reset_tx_mc:1; /* bit 18 */
- u32 reset_rx_fun:1; /* bit 17 */
- u32 reset_tx_fun:1; /* bit 16 */
- u32 reserved2:7; /* bits 9-15 */
- u32 loop_back:1; /* bit 8 */
- u32 reserved1:2; /* bits 6-7 */
- u32 rx_flow:1; /* bit 5 */
- u32 tx_flow:1; /* bit 4 */
- u32 syncd_rx_en:1; /* bit 3 */
- u32 rx_enable:1; /* bit 2 */
- u32 syncd_tx_en:1; /* bit 1 */
- u32 tx_enable:1; /* bit 0 */
-#else
- u32 tx_enable:1; /* bit 0 */
- u32 syncd_tx_en:1; /* bit 1 */
- u32 rx_enable:1; /* bit 2 */
- u32 syncd_rx_en:1; /* bit 3 */
- u32 tx_flow:1; /* bit 4 */
- u32 rx_flow:1; /* bit 5 */
- u32 reserved1:2; /* bits 6-7 */
- u32 loop_back:1; /* bit 8 */
- u32 reserved2:7; /* bits 9-15 */
- u32 reset_tx_fun:1; /* bit 16 */
- u32 reset_rx_fun:1; /* bit 17 */
- u32 reset_tx_mc:1; /* bit 18 */
- u32 reset_rx_mc:1; /* bit 19 */
- u32 reserved3:10; /* bits 20-29 */
- u32 sim_reset:1; /* bit 30 */
- u32 soft_reset:1; /* bit 31 */
-#endif
- } bits;
-} MAC_CFG1_t, *PMAC_CFG1_t;
+ *
+ * 31: soft reset
+ * 30: sim reset
+ * 29-20: reserved
+ * 19: reset rx mc
+ * 18: reset tx mc
+ * 17: reset rx func
+ * 16: reset tx fnc
+ * 15-9: reserved
+ * 8: loopback
+ * 7-6: reserved
+ * 5: rx flow
+ * 4: tx flow
+ * 3: syncd rx en
+ * 2: rx enable
+ * 1: syncd tx en
+ * 0: tx enable
+ */
+
+#define CFG1_LOOPBACK 0x00000100
+#define CFG1_RX_FLOW 0x00000020
+#define CFG1_TX_FLOW 0x00000010
+#define CFG1_RX_ENABLE 0x00000004
+#define CFG1_TX_ENABLE 0x00000001
+#define CFG1_WAIT 0x0000000A /* RX & TX syncd */
/*
* structure for configuration #2 reg in mac address map.
* located at address 0x5004
+ * 31-16: reserved
+ * 15-12: preamble
+ * 11-10: reserved
+ * 9-8: if mode
+ * 7-6: reserved
+ * 5: huge frame
+ * 4: length check
+ * 3: undefined
+ * 2: pad crc
+ * 1: crc enable
+ * 0: full duplex
*/
-typedef union _MAC_CFG2_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved3:16; /* bits 16-31 */
- u32 preamble_len:4; /* bits 12-15 */
- u32 reserved2:2; /* bits 10-11 */
- u32 if_mode:2; /* bits 8-9 */
- u32 reserved1:2; /* bits 6-7 */
- u32 huge_frame:1; /* bit 5 */
- u32 len_check:1; /* bit 4 */
- u32 undefined:1; /* bit 3 */
- u32 pad_crc:1; /* bit 2 */
- u32 crc_enable:1; /* bit 1 */
- u32 full_duplex:1; /* bit 0 */
-#else
- u32 full_duplex:1; /* bit 0 */
- u32 crc_enable:1; /* bit 1 */
- u32 pad_crc:1; /* bit 2 */
- u32 undefined:1; /* bit 3 */
- u32 len_check:1; /* bit 4 */
- u32 huge_frame:1; /* bit 5 */
- u32 reserved1:2; /* bits 6-7 */
- u32 if_mode:2; /* bits 8-9 */
- u32 reserved2:2; /* bits 10-11 */
- u32 preamble_len:4; /* bits 12-15 */
- u32 reserved3:16; /* bits 16-31 */
-#endif
- } bits;
-} MAC_CFG2_t, *PMAC_CFG2_t;
+
/*
* structure for Interpacket gap reg in mac address map.
* located at address 0x5008
- */
-typedef union _MAC_IPG_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:1; /* bit 31 */
- u32 non_B2B_ipg_1:7; /* bits 24-30 */
- u32 undefined2:1; /* bit 23 */
- u32 non_B2B_ipg_2:7; /* bits 16-22 */
- u32 min_ifg_enforce:8; /* bits 8-15 */
- u32 undefined1:1; /* bit 7 */
- u32 B2B_ipg:7; /* bits 0-6 */
-#else
- u32 B2B_ipg:7; /* bits 0-6 */
- u32 undefined1:1; /* bit 7 */
- u32 min_ifg_enforce:8; /* bits 8-15 */
- u32 non_B2B_ipg_2:7; /* bits 16-22 */
- u32 undefined2:1; /* bit 23 */
- u32 non_B2B_ipg_1:7; /* bits 24-30 */
- u32 reserved:1; /* bit 31 */
-#endif
- } bits;
-} MAC_IPG_t, *PMAC_IPG_t;
-
-/*
+ *
+ * 31: reserved
+ * 30-24: non B2B ipg 1
+ * 23: undefined
+ * 22-16: non B2B ipg 2
+ * 15-8: Min ifg enforce
+ * 7-0: B2B ipg
+ *
* structure for half duplex reg in mac address map.
* located at address 0x500C
+ * 31-24: reserved
+ * 23-20: Alt BEB trunc
+ * 19: Alt BEB enable
+ * 18: BP no backoff
+ * 17: no backoff
+ * 16: excess defer
+ * 15-12: re-xmit max
+ * 11-10: reserved
+ * 9-0: collision window
*/
-typedef union _MAC_HFDP_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved2:8; /* bits 24-31 */
- u32 alt_beb_trunc:4; /* bits 23-20 */
- u32 alt_beb_enable:1; /* bit 19 */
- u32 bp_no_backoff:1; /* bit 18 */
- u32 no_backoff:1; /* bit 17 */
- u32 excess_defer:1; /* bit 16 */
- u32 rexmit_max:4; /* bits 12-15 */
- u32 reserved1:2; /* bits 10-11 */
- u32 coll_window:10; /* bits 0-9 */
-#else
- u32 coll_window:10; /* bits 0-9 */
- u32 reserved1:2; /* bits 10-11 */
- u32 rexmit_max:4; /* bits 12-15 */
- u32 excess_defer:1; /* bit 16 */
- u32 no_backoff:1; /* bit 17 */
- u32 bp_no_backoff:1; /* bit 18 */
- u32 alt_beb_enable:1; /* bit 19 */
- u32 alt_beb_trunc:4; /* bits 23-20 */
- u32 reserved2:8; /* bits 24-31 */
-#endif
- } bits;
-} MAC_HFDP_t, *PMAC_HFDP_t;
/*
* structure for Maximum Frame Length reg in mac address map.
- * located at address 0x5010
+ * located at address 0x5010: bits 0-15 hold the length.
*/
-typedef union _MAC_MAX_FM_LEN_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:16; /* bits 16-31 */
- u32 max_len:16; /* bits 0-15 */
-#else
- u32 max_len:16; /* bits 0-15 */
- u32 reserved:16; /* bits 16-31 */
-#endif
- } bits;
-} MAC_MAX_FM_LEN_t, *PMAC_MAX_FM_LEN_t;
/*
* structure for Reserve 1 reg in mac address map.
@@ -1469,139 +1389,64 @@ typedef union _MAC_MAX_FM_LEN_t {
/*
* structure for Test reg in mac address map.
* located at address 0x501C
+ * test: bits 0-2, rest unused
*/
-typedef union _MAC_TEST_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 unused:29; /* bits 3-31 */
- u32 mac_test:3; /* bits 0-2 */
-#else
- u32 mac_test:3; /* bits 0-2 */
- u32 unused:29; /* bits 3-31 */
-#endif
- } bits;
-} MAC_TEST_t, *PMAC_TEST_t;
/*
* structure for MII Management Configuration reg in mac address map.
* located at address 0x5020
+ *
+ * 31: reset MII mgmt
+ * 30-6: unused
+ * 5: scan auto increment
+ * 4: preamble supress
+ * 3: undefined
+ * 2-0: mgmt clock reset
*/
-typedef union _MII_MGMT_CFG_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reset_mii_mgmt:1; /* bit 31 */
- u32 reserved:25; /* bits 6-30 */
- u32 scan_auto_incremt:1; /* bit 5 */
- u32 preamble_suppress:1; /* bit 4 */
- u32 undefined:1; /* bit 3 */
- u32 mgmt_clk_reset:3; /* bits 0-2 */
-#else
- u32 mgmt_clk_reset:3; /* bits 0-2 */
- u32 undefined:1; /* bit 3 */
- u32 preamble_suppress:1; /* bit 4 */
- u32 scan_auto_incremt:1; /* bit 5 */
- u32 reserved:25; /* bits 6-30 */
- u32 reset_mii_mgmt:1; /* bit 31 */
-#endif
- } bits;
-} MII_MGMT_CFG_t, *PMII_MGMT_CFG_t;
/*
* structure for MII Management Command reg in mac address map.
* located at address 0x5024
+ * bit 1: scan cycle
+ * bit 0: read cycle
*/
-typedef union _MII_MGMT_CMD_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:30; /* bits 2-31 */
- u32 scan_cycle:1; /* bit 1 */
- u32 read_cycle:1; /* bit 0 */
-#else
- u32 read_cycle:1; /* bit 0 */
- u32 scan_cycle:1; /* bit 1 */
- u32 reserved:30; /* bits 2-31 */
-#endif
- } bits;
-} MII_MGMT_CMD_t, *PMII_MGMT_CMD_t;
/*
* structure for MII Management Address reg in mac address map.
* located at address 0x5028
+ * 31-13: reserved
+ * 12-8: phy addr
+ * 7-5: reserved
+ * 4-0: register
*/
-typedef union _MII_MGMT_ADDR_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved2:19; /* bit 13-31 */
- u32 phy_addr:5; /* bits 8-12 */
- u32 reserved1:3; /* bits 5-7 */
- u32 reg_addr:5; /* bits 0-4 */
-#else
- u32 reg_addr:5; /* bits 0-4 */
- u32 reserved1:3; /* bits 5-7 */
- u32 phy_addr:5; /* bits 8-12 */
- u32 reserved2:19; /* bit 13-31 */
-#endif
- } bits;
-} MII_MGMT_ADDR_t, *PMII_MGMT_ADDR_t;
+
+#define MII_ADDR(phy,reg) ((phy) << 8 | (reg))
/*
* structure for MII Management Control reg in mac address map.
* located at address 0x502C
+ * 31-16: reserved
+ * 15-0: phy control
*/
-typedef union _MII_MGMT_CTRL_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:16; /* bits 16-31 */
- u32 phy_ctrl:16; /* bits 0-15 */
-#else
- u32 phy_ctrl:16; /* bits 0-15 */
- u32 reserved:16; /* bits 16-31 */
-#endif
- } bits;
-} MII_MGMT_CTRL_t, *PMII_MGMT_CTRL_t;
/*
* structure for MII Management Status reg in mac address map.
* located at address 0x5030
+ * 31-16: reserved
+ * 15-0: phy control
*/
-typedef union _MII_MGMT_STAT_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:16; /* bits 16-31 */
- u32 phy_stat:16; /* bits 0-15 */
-#else
- u32 phy_stat:16; /* bits 0-15 */
- u32 reserved:16; /* bits 16-31 */
-#endif
- } bits;
-} MII_MGMT_STAT_t, *PMII_MGMT_STAT_t;
/*
* structure for MII Management Indicators reg in mac address map.
* located at address 0x5034
+ * 31-3: reserved
+ * 2: not valid
+ * 1: scanning
+ * 0: busy
*/
-typedef union _MII_MGMT_INDICATOR_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 reserved:29; /* bits 3-31 */
- u32 not_valid:1; /* bit 2 */
- u32 scanning:1; /* bit 1 */
- u32 busy:1; /* bit 0 */
-#else
- u32 busy:1; /* bit 0 */
- u32 scanning:1; /* bit 1 */
- u32 not_valid:1; /* bit 2 */
- u32 reserved:29; /* bits 3-31 */
-#endif
- } bits;
-} MII_MGMT_INDICATOR_t, *PMII_MGMT_INDICATOR_t;
+
+#define MGMT_BUSY 0x00000001 /* busy */
+#define MGMT_WAIT 0x00000005 /* busy | not valid */
/*
* structure for Interface Control reg in mac address map.
@@ -1729,20 +1574,20 @@ typedef union _MAC_STATION_ADDR2_t {
* MAC Module of JAGCore Address Mapping
*/
typedef struct _MAC_t { /* Location: */
- MAC_CFG1_t cfg1; /* 0x5000 */
- MAC_CFG2_t cfg2; /* 0x5004 */
- MAC_IPG_t ipg; /* 0x5008 */
- MAC_HFDP_t hfdp; /* 0x500C */
- MAC_MAX_FM_LEN_t max_fm_len; /* 0x5010 */
+ u32 cfg1; /* 0x5000 */
+ u32 cfg2; /* 0x5004 */
+ u32 ipg; /* 0x5008 */
+ u32 hfdp; /* 0x500C */
+ u32 max_fm_len; /* 0x5010 */
u32 rsv1; /* 0x5014 */
u32 rsv2; /* 0x5018 */
- MAC_TEST_t mac_test; /* 0x501C */
- MII_MGMT_CFG_t mii_mgmt_cfg; /* 0x5020 */
- MII_MGMT_CMD_t mii_mgmt_cmd; /* 0x5024 */
- MII_MGMT_ADDR_t mii_mgmt_addr; /* 0x5028 */
- MII_MGMT_CTRL_t mii_mgmt_ctrl; /* 0x502C */
- MII_MGMT_STAT_t mii_mgmt_stat; /* 0x5030 */
- MII_MGMT_INDICATOR_t mii_mgmt_indicator; /* 0x5034 */
+ u32 mac_test; /* 0x501C */
+ u32 mii_mgmt_cfg; /* 0x5020 */
+ u32 mii_mgmt_cmd; /* 0x5024 */
+ u32 mii_mgmt_addr; /* 0x5028 */
+ u32 mii_mgmt_ctrl; /* 0x502C */
+ u32 mii_mgmt_stat; /* 0x5030 */
+ u32 mii_mgmt_indicator; /* 0x5034 */
MAC_IF_CTRL_t if_ctrl; /* 0x5038 */
MAC_IF_STAT_t if_stat; /* 0x503C */
MAC_STATION_ADDR1_t station_addr_1; /* 0x5040 */
diff --git a/drivers/staging/et131x/et1310_eeprom.c b/drivers/staging/et131x/et1310_eeprom.c
index c853a2c243a8..bcca1f86f516 100644
--- a/drivers/staging/et131x/et1310_eeprom.c
+++ b/drivers/staging/et131x/et1310_eeprom.c
@@ -95,198 +95,120 @@
#include "et1310_tx.h"
-/*
- * EEPROM Defines
- */
-/* LBCIF Register Groups (addressed via 32-bit offsets) */
-#define LBCIF_DWORD0_GROUP_OFFSET 0xAC
-#define LBCIF_DWORD1_GROUP_OFFSET 0xB0
-
-/* LBCIF Registers (addressed via 8-bit offsets) */
-#define LBCIF_ADDRESS_REGISTER_OFFSET 0xAC
-#define LBCIF_DATA_REGISTER_OFFSET 0xB0
-#define LBCIF_CONTROL_REGISTER_OFFSET 0xB1
-#define LBCIF_STATUS_REGISTER_OFFSET 0xB2
-
-/* LBCIF Control Register Bits */
-#define LBCIF_CONTROL_SEQUENTIAL_READ 0x01
-#define LBCIF_CONTROL_PAGE_WRITE 0x02
-#define LBCIF_CONTROL_UNUSED1 0x04
-#define LBCIF_CONTROL_EEPROM_RELOAD 0x08
-#define LBCIF_CONTROL_UNUSED2 0x10
-#define LBCIF_CONTROL_TWO_BYTE_ADDR 0x20
-#define LBCIF_CONTROL_I2C_WRITE 0x40
-#define LBCIF_CONTROL_LBCIF_ENABLE 0x80
-
-/* LBCIF Status Register Bits */
-#define LBCIF_STATUS_PHY_QUEUE_AVAIL 0x01
-#define LBCIF_STATUS_I2C_IDLE 0x02
-#define LBCIF_STATUS_ACK_ERROR 0x04
-#define LBCIF_STATUS_GENERAL_ERROR 0x08
-#define LBCIF_STATUS_UNUSED 0x30
-#define LBCIF_STATUS_CHECKSUM_ERROR 0x40
-#define LBCIF_STATUS_EEPROM_PRESENT 0x80
-
-/* Miscellaneous Constraints */
-#define MAX_NUM_REGISTER_POLLS 1000
-#define MAX_NUM_WRITE_RETRIES 2
+static int eeprom_wait_ready(struct pci_dev *pdev, u32 *status)
+{
+ u32 reg;
+ int i;
+
+ /*
+ * 1. Check LBCIF Status Register for bits 6 & 3:2 all equal to 0 and
+ * bits 7,1:0 both equal to 1, at least once after reset.
+ * Subsequent operations need only to check that bits 1:0 are equal
+ * to 1 prior to starting a single byte read/write
+ */
+
+ for (i = 0; i < MAX_NUM_REGISTER_POLLS; i++) {
+ /* Read registers grouped in DWORD1 */
+ if (pci_read_config_dword(pdev, LBCIF_DWORD1_GROUP, &reg))
+ return -EIO;
+
+ /* I2C idle and Phy Queue Avail both true */
+ if ((reg & 0x3000) == 0x3000) {
+ if (status)
+ *status = reg;
+ return reg & 0xFF;
+ }
+ }
+ return -ETIMEDOUT;
+}
-/*
- * Define macros that allow individual register values to be extracted from a
- * DWORD1 register grouping
- */
-#define EXTRACT_DATA_REGISTER(x) (u8)(x & 0xFF)
-#define EXTRACT_STATUS_REGISTER(x) (u8)((x >> 16) & 0xFF)
-#define EXTRACT_CONTROL_REG(x) (u8)((x >> 8) & 0xFF)
/**
- * EepromWriteByte - Write a byte to the ET1310's EEPROM
+ * eeprom_write - Write a byte to the ET1310's EEPROM
* @etdev: pointer to our private adapter structure
* @addr: the address to write
* @data: the value to write
*
- * Returns SUCCESS or FAILURE
+ * Returns 1 for a successful write.
*/
-int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
+static int eeprom_write(struct et131x_adapter *etdev, u32 addr, u8 data)
{
struct pci_dev *pdev = etdev->pdev;
- int index;
+ int index = 0;
int retries;
int err = 0;
int i2c_wack = 0;
int writeok = 0;
- u8 control;
- u8 status = 0;
- u32 dword1 = 0;
+ u32 status;
u32 val = 0;
/*
- * The following excerpt is from "Serial EEPROM HW Design
- * Specification" Version 0.92 (9/20/2004):
- *
- * Single Byte Writes
- *
* For an EEPROM, an I2C single byte write is defined as a START
* condition followed by the device address, EEPROM address, one byte
* of data and a STOP condition. The STOP condition will trigger the
* EEPROM's internally timed write cycle to the nonvolatile memory.
* All inputs are disabled during this write cycle and the EEPROM will
* not respond to any access until the internal write is complete.
- * The steps to execute a single byte write are as follows:
- *
- * 1. Check LBCIF Status Register for bits 6 & 3:2 all equal to 0 and
- * bits 7,1:0 both equal to 1, at least once after reset.
- * Subsequent operations need only to check that bits 1:0 are
- * equal to 1 prior to starting a single byte write.
- *
+ */
+
+ err = eeprom_wait_ready(pdev, NULL);
+ if (err)
+ return err;
+
+ /*
* 2. Write to the LBCIF Control Register: bit 7=1, bit 6=1, bit 3=0,
* and bits 1:0 both =0. Bit 5 should be set according to the
* type of EEPROM being accessed (1=two byte addressing, 0=one
* byte addressing).
- *
- * 3. Write the address to the LBCIF Address Register.
- *
- * 4. Write the data to the LBCIF Data Register (the I2C write will
- * begin).
- *
- * 5. Monitor bit 1:0 of the LBCIF Status Register. When bits 1:0 are
- * both equal to 1, the I2C write has completed and the internal
- * write cycle of the EEPROM is about to start. (bits 1:0 = 01 is
- * a legal state while waiting from both equal to 1, but bits
- * 1:0 = 10 is invalid and implies that something is broken).
- *
- * 6. Check bit 3 of the LBCIF Status Register. If equal to 1, an
- * error has occurred.
- *
- * 7. Check bit 2 of the LBCIF Status Register. If equal to 1 an ACK
- * error has occurred on the address phase of the write. This
- * could be due to an actual hardware failure or the EEPROM may
- * still be in its internal write cycle from a previous write.
- * This write operation was ignored and must be repeated later.
- *
- * 8. Set bit 6 of the LBCIF Control Register = 0. If another write is
- * required, go to step 1.
*/
-
- /* Step 1: */
- for (index = 0; index < MAX_NUM_REGISTER_POLLS; index++) {
- /* Read registers grouped in DWORD1 */
- if (pci_read_config_dword(pdev, LBCIF_DWORD1_GROUP_OFFSET,
- &dword1)) {
- err = 1;
- break;
- }
-
- status = EXTRACT_STATUS_REGISTER(dword1);
-
- if (status & LBCIF_STATUS_PHY_QUEUE_AVAIL &&
- status & LBCIF_STATUS_I2C_IDLE)
- /* bits 1:0 are equal to 1 */
- break;
- }
-
- if (err || (index >= MAX_NUM_REGISTER_POLLS))
- return FAILURE;
-
- /* Step 2: */
- control = 0;
- control |= LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE;
-
- if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
- control)) {
- return FAILURE;
- }
+ if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER,
+ LBCIF_CONTROL_LBCIF_ENABLE | LBCIF_CONTROL_I2C_WRITE))
+ return -EIO;
i2c_wack = 1;
/* Prepare EEPROM address for Step 3 */
for (retries = 0; retries < MAX_NUM_WRITE_RETRIES; retries++) {
- /* Step 3:*/
- if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
- addr)) {
- break;
- }
-
- /* Step 4: */
- if (pci_write_config_byte(pdev, LBCIF_DATA_REGISTER_OFFSET,
- data)) {
+ /* Write the address to the LBCIF Address Register */
+ if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER, addr))
break;
- }
-
- /* Step 5: */
- for (index = 0; index < MAX_NUM_REGISTER_POLLS; index++) {
- /* Read registers grouped in DWORD1 */
- if (pci_read_config_dword(pdev,
- LBCIF_DWORD1_GROUP_OFFSET,
- &dword1)) {
- err = 1;
- break;
- }
-
- status = EXTRACT_STATUS_REGISTER(dword1);
-
- if (status & LBCIF_STATUS_PHY_QUEUE_AVAIL &&
- status & LBCIF_STATUS_I2C_IDLE) {
- /* I2C write complete */
- break;
- }
- }
-
- if (err || (index >= MAX_NUM_REGISTER_POLLS))
+ /*
+ * Write the data to the LBCIF Data Register (the I2C write
+ * will begin).
+ */
+ if (pci_write_config_byte(pdev, LBCIF_DATA_REGISTER, data))
break;
+ /*
+ * Monitor bit 1:0 of the LBCIF Status Register. When bits
+ * 1:0 are both equal to 1, the I2C write has completed and the
+ * internal write cycle of the EEPROM is about to start.
+ * (bits 1:0 = 01 is a legal state while waiting from both
+ * equal to 1, but bits 1:0 = 10 is invalid and implies that
+ * something is broken).
+ */
+ err = eeprom_wait_ready(pdev, &status);
+ if (err < 0)
+ return 0;
/*
- * Step 6: Don't break here if we are revision 1, this is
- * so we do a blind write for load bug.
+ * Check bit 3 of the LBCIF Status Register. If equal to 1,
+ * an error has occurred.Don't break here if we are revision
+ * 1, this is so we do a blind write for load bug.
*/
- if (status & LBCIF_STATUS_GENERAL_ERROR
- && etdev->pdev->revision == 0) {
+ if ((status & LBCIF_STATUS_GENERAL_ERROR)
+ && etdev->pdev->revision == 0)
break;
- }
- /* Step 7 */
+ /*
+ * Check bit 2 of the LBCIF Status Register. If equal to 1 an
+ * ACK error has occurred on the address phase of the write.
+ * This could be due to an actual hardware failure or the
+ * EEPROM may still be in its internal write cycle from a
+ * previous write. This write operation was ignored and must be
+ *repeated later.
+ */
if (status & LBCIF_STATUS_ACK_ERROR) {
/*
* This could be due to an actual hardware failure
@@ -302,154 +224,160 @@ int EepromWriteByte(struct et131x_adapter *etdev, u32 addr, u8 data)
break;
}
- /* Step 8: */
+ /*
+ * Set bit 6 of the LBCIF Control Register = 0.
+ */
udelay(10);
- index = 0;
- while (i2c_wack) {
- control &= ~LBCIF_CONTROL_I2C_WRITE;
- if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
- control)) {
+ while (i2c_wack) {
+ if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER,
+ LBCIF_CONTROL_LBCIF_ENABLE))
writeok = 0;
- }
/* Do read until internal ACK_ERROR goes away meaning write
* completed
*/
do {
pci_write_config_dword(pdev,
- LBCIF_ADDRESS_REGISTER_OFFSET,
+ LBCIF_ADDRESS_REGISTER,
addr);
do {
pci_read_config_dword(pdev,
- LBCIF_DATA_REGISTER_OFFSET, &val);
+ LBCIF_DATA_REGISTER, &val);
} while ((val & 0x00010000) == 0);
} while (val & 0x00040000);
- control = EXTRACT_CONTROL_REG(val);
-
- if (control != 0xC0 || index == 10000)
+ if ((val & 0xFF00) != 0xC000 || index == 10000)
break;
-
index++;
}
-
- return writeok ? SUCCESS : FAILURE;
+ return writeok ? 0 : -EIO;
}
/**
- * EepromReadByte - Read a byte from the ET1310's EEPROM
+ * eeprom_read - Read a byte from the ET1310's EEPROM
* @etdev: pointer to our private adapter structure
* @addr: the address from which to read
* @pdata: a pointer to a byte in which to store the value of the read
* @eeprom_id: the ID of the EEPROM
* @addrmode: how the EEPROM is to be accessed
*
- * Returns SUCCESS or FAILURE
+ * Returns 1 for a successful read
*/
-int EepromReadByte(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
+static int eeprom_read(struct et131x_adapter *etdev, u32 addr, u8 *pdata)
{
struct pci_dev *pdev = etdev->pdev;
- int index;
- int err = 0;
- u8 control;
- u8 status = 0;
- u32 dword1 = 0;
+ int err;
+ u32 status;
/*
- * The following excerpt is from "Serial EEPROM HW Design
- * Specification" Version 0.92 (9/20/2004):
- *
- * Single Byte Reads
- *
* A single byte read is similar to the single byte write, with the
* exception of the data flow:
- *
- * 1. Check LBCIF Status Register for bits 6 & 3:2 all equal to 0 and
- * bits 7,1:0 both equal to 1, at least once after reset.
- * Subsequent operations need only to check that bits 1:0 are equal
- * to 1 prior to starting a single byte read.
- *
- * 2. Write to the LBCIF Control Register: bit 7=1, bit 6=0, bit 3=0,
- * and bits 1:0 both =0. Bit 5 should be set according to the type
- * of EEPROM being accessed (1=two byte addressing, 0=one byte
- * addressing).
- *
- * 3. Write the address to the LBCIF Address Register (I2C read will
- * begin).
- *
- * 4. Monitor bit 0 of the LBCIF Status Register. When =1, I2C read
- * is complete. (if bit 1 =1 and bit 0 stays =0, a hardware failure
- * has occurred).
- *
- * 5. Check bit 2 of the LBCIF Status Register. If =1, then an error
- * has occurred. The data that has been returned from the PHY may
- * be invalid.
- *
- * 6. Regardless of error status, read data byte from LBCIF Data
- * Register. If another byte is required, go to step 1.
*/
- /* Step 1: */
- for (index = 0; index < MAX_NUM_REGISTER_POLLS; index++) {
- /* Read registers grouped in DWORD1 */
- if (pci_read_config_dword(pdev, LBCIF_DWORD1_GROUP_OFFSET,
- &dword1)) {
- err = 1;
- break;
- }
-
- status = EXTRACT_STATUS_REGISTER(dword1);
-
- if (status & LBCIF_STATUS_PHY_QUEUE_AVAIL &&
- status & LBCIF_STATUS_I2C_IDLE) {
- /* bits 1:0 are equal to 1 */
- break;
- }
- }
-
- if (err || (index >= MAX_NUM_REGISTER_POLLS))
- return FAILURE;
-
- /* Step 2: */
- control = 0;
- control |= LBCIF_CONTROL_LBCIF_ENABLE;
-
- if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER_OFFSET,
- control)) {
- return FAILURE;
- }
+ err = eeprom_wait_ready(pdev, NULL);
+ if (err)
+ return err;
+ /*
+ * Write to the LBCIF Control Register: bit 7=1, bit 6=0, bit 3=0,
+ * and bits 1:0 both =0. Bit 5 should be set according to the type
+ * of EEPROM being accessed (1=two byte addressing, 0=one byte
+ * addressing).
+ */
+ if (pci_write_config_byte(pdev, LBCIF_CONTROL_REGISTER,
+ LBCIF_CONTROL_LBCIF_ENABLE))
+ return -EIO;
+ /*
+ * Write the address to the LBCIF Address Register (I2C read will
+ * begin).
+ */
+ if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER, addr))
+ return -EIO;
+ /*
+ * Monitor bit 0 of the LBCIF Status Register. When = 1, I2C read
+ * is complete. (if bit 1 =1 and bit 0 stays = 0, a hardware failure
+ * has occurred).
+ */
+ err = eeprom_wait_ready(pdev, &status);
+ if (err < 0)
+ return err;
+ /*
+ * Regardless of error status, read data byte from LBCIF Data
+ * Register.
+ */
+ *pdata = err;
+ /*
+ * Check bit 2 of the LBCIF Status Register. If = 1,
+ * then an error has occurred.
+ */
+ return (status & LBCIF_STATUS_ACK_ERROR) ? -EIO : 0;
+}
- /* Step 3: */
+int et131x_init_eeprom(struct et131x_adapter *etdev)
+{
+ struct pci_dev *pdev = etdev->pdev;
+ u8 eestatus;
- if (pci_write_config_dword(pdev, LBCIF_ADDRESS_REGISTER_OFFSET,
- addr)) {
- return FAILURE;
+ /* We first need to check the EEPROM Status code located at offset
+ * 0xB2 of config space
+ */
+ pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS,
+ &eestatus);
+
+ /* THIS IS A WORKAROUND:
+ * I need to call this function twice to get my card in a
+ * LG M1 Express Dual running. I tried also a msleep before this
+ * function, because I thougth there could be some time condidions
+ * but it didn't work. Call the whole function twice also work.
+ */
+ if (pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS, &eestatus)) {
+ dev_err(&pdev->dev,
+ "Could not read PCI config space for EEPROM Status\n");
+ return -EIO;
}
- /* Step 4: */
- for (index = 0; index < MAX_NUM_REGISTER_POLLS; index++) {
- /* Read registers grouped in DWORD1 */
- if (pci_read_config_dword(pdev, LBCIF_DWORD1_GROUP_OFFSET,
- &dword1)) {
- err = 1;
- break;
+ /* Determine if the error(s) we care about are present. If they are
+ * present we need to fail.
+ */
+ if (eestatus & 0x4C) {
+ int write_failed = 0;
+ if (pdev->revision == 0x01) {
+ int i;
+ static const u8 eedata[4] = { 0xFE, 0x13, 0x10, 0xFF };
+
+ /* Re-write the first 4 bytes if we have an eeprom
+ * present and the revision id is 1, this fixes the
+ * corruption seen with 1310 B Silicon
+ */
+ for (i = 0; i < 3; i++)
+ if (eeprom_write(etdev, i, eedata[i]) < 0)
+ write_failed = 1;
}
-
- status = EXTRACT_STATUS_REGISTER(dword1);
-
- if (status & LBCIF_STATUS_PHY_QUEUE_AVAIL
- && status & LBCIF_STATUS_I2C_IDLE) {
- /* I2C read complete */
- break;
+ if (pdev->revision != 0x01 || write_failed) {
+ dev_err(&pdev->dev,
+ "Fatal EEPROM Status Error - 0x%04x\n", eestatus);
+
+ /* This error could mean that there was an error
+ * reading the eeprom or that the eeprom doesn't exist.
+ * We will treat each case the same and not try to gather
+ * additional information that normally would come from the
+ * eeprom, like MAC Address
+ */
+ etdev->has_eeprom = 0;
+ return -EIO;
}
}
+ etdev->has_eeprom = 1;
- if (err || (index >= MAX_NUM_REGISTER_POLLS))
- return FAILURE;
+ /* Read the EEPROM for information regarding LED behavior. Refer to
+ * ET1310_phy.c, et131x_xcvr_init(), for its use.
+ */
+ eeprom_read(etdev, 0x70, &etdev->eepromData[0]);
+ eeprom_read(etdev, 0x71, &etdev->eepromData[1]);
- /* Step 6: */
- *pdata = EXTRACT_DATA_REGISTER(dword1);
+ if (etdev->eepromData[0] != 0xcd)
+ /* Disable all optional features */
+ etdev->eepromData[1] = 0x00;
- return (status & LBCIF_STATUS_ACK_ERROR) ? FAILURE : SUCCESS;
+ return 0;
}
diff --git a/drivers/staging/et131x/et1310_eeprom.h b/drivers/staging/et131x/et1310_eeprom.h
index d8ac9a0439e2..6a6c6a632a8f 100644
--- a/drivers/staging/et131x/et1310_eeprom.h
+++ b/drivers/staging/et131x/et1310_eeprom.h
@@ -61,17 +61,43 @@
#include "et1310_address_map.h"
-#ifndef SUCCESS
-#define SUCCESS 0
-#define FAILURE 1
-#endif
+/*
+ * EEPROM Defines
+ */
+
+/* LBCIF Register Groups (addressed via 32-bit offsets) */
+#define LBCIF_DWORD0_GROUP 0xAC
+#define LBCIF_DWORD1_GROUP 0xB0
+
+/* LBCIF Registers (addressed via 8-bit offsets) */
+#define LBCIF_ADDRESS_REGISTER 0xAC
+#define LBCIF_DATA_REGISTER 0xB0
+#define LBCIF_CONTROL_REGISTER 0xB1
+#define LBCIF_STATUS_REGISTER 0xB2
+
+/* LBCIF Control Register Bits */
+#define LBCIF_CONTROL_SEQUENTIAL_READ 0x01
+#define LBCIF_CONTROL_PAGE_WRITE 0x02
+#define LBCIF_CONTROL_EEPROM_RELOAD 0x08
+#define LBCIF_CONTROL_TWO_BYTE_ADDR 0x20
+#define LBCIF_CONTROL_I2C_WRITE 0x40
+#define LBCIF_CONTROL_LBCIF_ENABLE 0x80
+
+/* LBCIF Status Register Bits */
+#define LBCIF_STATUS_PHY_QUEUE_AVAIL 0x01
+#define LBCIF_STATUS_I2C_IDLE 0x02
+#define LBCIF_STATUS_ACK_ERROR 0x04
+#define LBCIF_STATUS_GENERAL_ERROR 0x08
+#define LBCIF_STATUS_CHECKSUM_ERROR 0x40
+#define LBCIF_STATUS_EEPROM_PRESENT 0x80
+
+/* Miscellaneous Constraints */
+#define MAX_NUM_REGISTER_POLLS 1000
+#define MAX_NUM_WRITE_RETRIES 2
/* Forward declaration of the private adapter structure */
struct et131x_adapter;
-int32_t EepromWriteByte(struct et131x_adapter *adapter, u32 unAddress,
- u8 bData);
-int32_t EepromReadByte(struct et131x_adapter *adapter, u32 unAddress,
- u8 *pbData);
+int et131x_init_eeprom(struct et131x_adapter *etdev);
#endif /* _ET1310_EEPROM_H_ */
diff --git a/drivers/staging/et131x/et1310_mac.c b/drivers/staging/et131x/et1310_mac.c
index f81e1cba8547..ae7cee43a165 100644
--- a/drivers/staging/et131x/et1310_mac.c
+++ b/drivers/staging/et131x/et1310_mac.c
@@ -101,41 +101,27 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
struct _MAC_t __iomem *pMac = &etdev->regs->mac;
MAC_STATION_ADDR1_t station1;
MAC_STATION_ADDR2_t station2;
- MAC_IPG_t ipg;
- MAC_HFDP_t hfdp;
- MII_MGMT_CFG_t mii_mgmt_cfg;
+ u32 ipg;
/* First we need to reset everything. Write to MAC configuration
* register 1 to perform reset.
*/
- writel(0xC00F0000, &pMac->cfg1.value);
+ writel(0xC00F0000, &pMac->cfg1);
/* Next lets configure the MAC Inter-packet gap register */
- ipg.bits.non_B2B_ipg_1 = 0x38; /* 58d */
- ipg.bits.non_B2B_ipg_2 = 0x58; /* 88d */
- ipg.bits.min_ifg_enforce = 0x50; /* 80d */
- ipg.bits.B2B_ipg = 0x60; /* 96d */
- writel(ipg.value, &pMac->ipg.value);
+ ipg = 0x38005860; /* IPG1 0x38 IPG2 0x58 B2B 0x60 */
+ ipg |= 0x50 << 8; /* ifg enforce 0x50 */
+ writel(ipg, &pMac->ipg);
/* Next lets configure the MAC Half Duplex register */
- hfdp.bits.alt_beb_trunc = 0xA;
- hfdp.bits.alt_beb_enable = 0x0;
- hfdp.bits.bp_no_backoff = 0x0;
- hfdp.bits.no_backoff = 0x0;
- hfdp.bits.excess_defer = 0x1;
- hfdp.bits.rexmit_max = 0xF;
- hfdp.bits.coll_window = 0x37; /* 55d */
- writel(hfdp.value, &pMac->hfdp.value);
+ /* BEB trunc 0xA, Ex Defer, Rexmit 0xF Coll 0x37 */
+ writel(0x00A1F037, &pMac->hfdp);
/* Next lets configure the MAC Interface Control register */
writel(0, &pMac->if_ctrl.value);
/* Let's move on to setting up the mii management configuration */
- mii_mgmt_cfg.bits.reset_mii_mgmt = 0;
- mii_mgmt_cfg.bits.scan_auto_incremt = 0;
- mii_mgmt_cfg.bits.preamble_suppress = 0;
- mii_mgmt_cfg.bits.mgmt_clk_reset = 0x7;
- writel(mii_mgmt_cfg.value, &pMac->mii_mgmt_cfg.value);
+ writel(0x07, &pMac->mii_mgmt_cfg); /* Clock reset 0x7 */
/* Next lets configure the MAC Station Address register. These
* values are read from the EEPROM during initialization and stored
@@ -160,10 +146,10 @@ void ConfigMACRegs1(struct et131x_adapter *etdev)
* Packets larger than (RegistryJumboPacket) that do not contain a
* VLAN ID will be dropped by the Rx function.
*/
- writel(etdev->RegistryJumboPacket + 4, &pMac->max_fm_len.value);
+ writel(etdev->RegistryJumboPacket + 4, &pMac->max_fm_len);
/* clear out MAC config reset */
- writel(0, &pMac->cfg1.value);
+ writel(0, &pMac->cfg1);
}
/**
@@ -174,79 +160,59 @@ void ConfigMACRegs2(struct et131x_adapter *etdev)
{
int32_t delay = 0;
struct _MAC_t __iomem *pMac = &etdev->regs->mac;
- MAC_CFG1_t cfg1;
- MAC_CFG2_t cfg2;
+ u32 cfg1;
+ u32 cfg2;
MAC_IF_CTRL_t ifctrl;
TXMAC_CTL_t ctl;
ctl.value = readl(&etdev->regs->txmac.ctl.value);
- cfg1.value = readl(&pMac->cfg1.value);
- cfg2.value = readl(&pMac->cfg2.value);
+ cfg1 = readl(&pMac->cfg1);
+ cfg2 = readl(&pMac->cfg2);
ifctrl.value = readl(&pMac->if_ctrl.value);
+ /* Set up the if mode bits */
+ cfg2 &= ~0x300;
if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
- cfg2.bits.if_mode = 0x2;
+ cfg2 |= 0x200;
ifctrl.bits.phy_mode = 0x0;
} else {
- cfg2.bits.if_mode = 0x1;
+ cfg2 |= 0x100;
ifctrl.bits.phy_mode = 0x1;
}
/* We need to enable Rx/Tx */
- cfg1.bits.rx_enable = 0x1;
- cfg1.bits.tx_enable = 0x1;
-
- /* Set up flow control */
- cfg1.bits.tx_flow = 0x1;
-
- if ((etdev->FlowControl == RxOnly) ||
- (etdev->FlowControl == Both)) {
- cfg1.bits.rx_flow = 0x1;
- } else {
- cfg1.bits.rx_flow = 0x0;
- }
-
+ cfg1 |= CFG1_RX_ENABLE|CFG1_TX_ENABLE|CFG1_TX_FLOW;
/* Initialize loop back to off */
- cfg1.bits.loop_back = 0;
-
- writel(cfg1.value, &pMac->cfg1.value);
+ cfg1 &= ~(CFG1_LOOPBACK|CFG1_RX_FLOW);
+ if (etdev->FlowControl == RxOnly || etdev->FlowControl == Both)
+ cfg1 |= CFG1_RX_FLOW;
+ writel(cfg1, &pMac->cfg1);
/* Now we need to initialize the MAC Configuration 2 register */
- cfg2.bits.preamble_len = 0x7;
- cfg2.bits.huge_frame = 0x0;
- /* LENGTH FIELD CHECKING bit4: Set this bit to cause the MAC to check
- * the frame's length field to ensure it matches the actual data
- * field length. Clear this bit if no length field checking is
- * desired. Its default is 0.
- */
- cfg2.bits.len_check = 0x1;
+ /* preamble 7, check length, huge frame off, pad crc, crc enable
+ full duplex off */
+ cfg2 |= 0x7016;
+ cfg2 &= ~0x0021;
- if (etdev->RegistryPhyLoopbk == false) {
- cfg2.bits.pad_crc = 0x1;
- cfg2.bits.crc_enable = 0x1;
- } else {
- cfg2.bits.pad_crc = 0;
- cfg2.bits.crc_enable = 0;
- }
+ /* Turn on duplex if needed */
+ if (etdev->duplex_mode)
+ cfg2 |= 0x01;
- /* 1 - full duplex, 0 - half-duplex */
- cfg2.bits.full_duplex = etdev->duplex_mode;
ifctrl.bits.ghd_mode = !etdev->duplex_mode;
writel(ifctrl.value, &pMac->if_ctrl.value);
- writel(cfg2.value, &pMac->cfg2.value);
+ writel(cfg2, &pMac->cfg2);
do {
udelay(10);
delay++;
- cfg1.value = readl(&pMac->cfg1.value);
- } while ((!cfg1.bits.syncd_rx_en || !cfg1.bits.syncd_tx_en) &&
- delay < 100);
+ cfg1 = readl(&pMac->cfg1);
+ } while ((cfg1 & CFG1_WAIT) != CFG1_WAIT && delay < 100);
if (delay == 100) {
dev_warn(&etdev->pdev->dev,
"Syncd bits did not respond correctly cfg1 word 0x%08x\n",
- cfg1.value);
+ cfg1);
}
/* Enable TXMAC */
diff --git a/drivers/staging/et131x/et1310_phy.c b/drivers/staging/et131x/et1310_phy.c
index dd199bdb9eff..6ecad619f779 100644
--- a/drivers/staging/et131x/et1310_phy.c
+++ b/drivers/staging/et131x/et1310_phy.c
@@ -98,238 +98,498 @@
#include "et1310_mac.h"
/* Prototypes for functions with local scope */
-static int et131x_xcvr_init(struct et131x_adapter *adapter);
+static void et131x_xcvr_init(struct et131x_adapter *etdev);
/**
* PhyMiRead - Read from the PHY through the MII Interface on the MAC
- * @adapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
* @xcvrAddr: the address of the transciever
* @xcvrReg: the register to read
* @value: pointer to a 16-bit value in which the value will be stored
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int PhyMiRead(struct et131x_adapter *adapter, uint8_t xcvrAddr,
- uint8_t xcvrReg, uint16_t *value)
+int PhyMiRead(struct et131x_adapter *etdev, u8 xcvrAddr,
+ u8 xcvrReg, u16 *value)
{
- struct _MAC_t __iomem *mac = &adapter->regs->mac;
+ struct _MAC_t __iomem *mac = &etdev->regs->mac;
int status = 0;
- uint32_t delay;
- MII_MGMT_ADDR_t miiAddr;
- MII_MGMT_CMD_t miiCmd;
- MII_MGMT_INDICATOR_t miiIndicator;
+ u32 delay;
+ u32 miiAddr;
+ u32 miiCmd;
+ u32 miiIndicator;
/* Save a local copy of the registers we are dealing with so we can
* set them back
*/
- miiAddr.value = readl(&mac->mii_mgmt_addr.value);
- miiCmd.value = readl(&mac->mii_mgmt_cmd.value);
+ miiAddr = readl(&mac->mii_mgmt_addr);
+ miiCmd = readl(&mac->mii_mgmt_cmd);
/* Stop the current operation */
- writel(0, &mac->mii_mgmt_cmd.value);
+ writel(0, &mac->mii_mgmt_cmd);
/* Set up the register we need to read from on the correct PHY */
- {
- MII_MGMT_ADDR_t mii_mgmt_addr = { 0 };
-
- mii_mgmt_addr.bits.phy_addr = xcvrAddr;
- mii_mgmt_addr.bits.reg_addr = xcvrReg;
- writel(mii_mgmt_addr.value, &mac->mii_mgmt_addr.value);
- }
+ writel(MII_ADDR(xcvrAddr, xcvrReg), &mac->mii_mgmt_addr);
/* Kick the read cycle off */
delay = 0;
- writel(0x1, &mac->mii_mgmt_cmd.value);
+ writel(0x1, &mac->mii_mgmt_cmd);
do {
udelay(50);
delay++;
- miiIndicator.value = readl(&mac->mii_mgmt_indicator.value);
- } while ((miiIndicator.bits.not_valid || miiIndicator.bits.busy) &&
- delay < 50);
+ miiIndicator = readl(&mac->mii_mgmt_indicator);
+ } while ((miiIndicator & MGMT_WAIT) && delay < 50);
/* If we hit the max delay, we could not read the register */
- if (delay >= 50) {
- dev_warn(&adapter->pdev->dev,
+ if (delay == 50) {
+ dev_warn(&etdev->pdev->dev,
"xcvrReg 0x%08x could not be read\n", xcvrReg);
- dev_warn(&adapter->pdev->dev, "status is 0x%08x\n",
- miiIndicator.value);
+ dev_warn(&etdev->pdev->dev, "status is 0x%08x\n",
+ miiIndicator);
status = -EIO;
}
/* If we hit here we were able to read the register and we need to
- * return the value to the caller
- */
- /* TODO: make this stuff a simple readw()?! */
- {
- MII_MGMT_STAT_t mii_mgmt_stat;
-
- mii_mgmt_stat.value = readl(&mac->mii_mgmt_stat.value);
- *value = (uint16_t) mii_mgmt_stat.bits.phy_stat;
- }
+ * return the value to the caller */
+ *value = readl(&mac->mii_mgmt_stat) & 0xFFFF;
/* Stop the read operation */
- writel(0, &mac->mii_mgmt_cmd.value);
+ writel(0, &mac->mii_mgmt_cmd);
/* set the registers we touched back to the state at which we entered
* this function
*/
- writel(miiAddr.value, &mac->mii_mgmt_addr.value);
- writel(miiCmd.value, &mac->mii_mgmt_cmd.value);
+ writel(miiAddr, &mac->mii_mgmt_addr);
+ writel(miiCmd, &mac->mii_mgmt_cmd);
return status;
}
/**
* MiWrite - Write to a PHY register through the MII interface of the MAC
- * @adapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
* @xcvrReg: the register to read
* @value: 16-bit value to write
*
+ * FIXME: one caller in netdev still
+ *
* Return 0 on success, errno on failure (as defined in errno.h)
*/
-int MiWrite(struct et131x_adapter *adapter, uint8_t xcvrReg, uint16_t value)
+int MiWrite(struct et131x_adapter *etdev, u8 xcvrReg, u16 value)
{
- struct _MAC_t __iomem *mac = &adapter->regs->mac;
+ struct _MAC_t __iomem *mac = &etdev->regs->mac;
int status = 0;
- uint8_t xcvrAddr = adapter->Stats.xcvr_addr;
- uint32_t delay;
- MII_MGMT_ADDR_t miiAddr;
- MII_MGMT_CMD_t miiCmd;
- MII_MGMT_INDICATOR_t miiIndicator;
+ u8 xcvrAddr = etdev->Stats.xcvr_addr;
+ u32 delay;
+ u32 miiAddr;
+ u32 miiCmd;
+ u32 miiIndicator;
/* Save a local copy of the registers we are dealing with so we can
* set them back
*/
- miiAddr.value = readl(&mac->mii_mgmt_addr.value);
- miiCmd.value = readl(&mac->mii_mgmt_cmd.value);
+ miiAddr = readl(&mac->mii_mgmt_addr);
+ miiCmd = readl(&mac->mii_mgmt_cmd);
/* Stop the current operation */
- writel(0, &mac->mii_mgmt_cmd.value);
+ writel(0, &mac->mii_mgmt_cmd);
/* Set up the register we need to write to on the correct PHY */
- {
- MII_MGMT_ADDR_t mii_mgmt_addr;
-
- mii_mgmt_addr.bits.phy_addr = xcvrAddr;
- mii_mgmt_addr.bits.reg_addr = xcvrReg;
- writel(mii_mgmt_addr.value, &mac->mii_mgmt_addr.value);
- }
+ writel(MII_ADDR(xcvrAddr, xcvrReg), &mac->mii_mgmt_addr);
/* Add the value to write to the registers to the mac */
- writel(value, &mac->mii_mgmt_ctrl.value);
+ writel(value, &mac->mii_mgmt_ctrl);
delay = 0;
do {
udelay(50);
delay++;
- miiIndicator.value = readl(&mac->mii_mgmt_indicator.value);
- } while (miiIndicator.bits.busy && delay < 100);
+ miiIndicator = readl(&mac->mii_mgmt_indicator);
+ } while ((miiIndicator & MGMT_BUSY) && delay < 100);
/* If we hit the max delay, we could not write the register */
if (delay == 100) {
- uint16_t TempValue;
+ u16 TempValue;
- dev_warn(&adapter->pdev->dev,
+ dev_warn(&etdev->pdev->dev,
"xcvrReg 0x%08x could not be written", xcvrReg);
- dev_warn(&adapter->pdev->dev, "status is 0x%08x\n",
- miiIndicator.value);
- dev_warn(&adapter->pdev->dev, "command is 0x%08x\n",
- readl(&mac->mii_mgmt_cmd.value));
+ dev_warn(&etdev->pdev->dev, "status is 0x%08x\n",
+ miiIndicator);
+ dev_warn(&etdev->pdev->dev, "command is 0x%08x\n",
+ readl(&mac->mii_mgmt_cmd));
- MiRead(adapter, xcvrReg, &TempValue);
+ MiRead(etdev, xcvrReg, &TempValue);
status = -EIO;
}
-
/* Stop the write operation */
- writel(0, &mac->mii_mgmt_cmd.value);
+ writel(0, &mac->mii_mgmt_cmd);
/* set the registers we touched back to the state at which we entered
* this function
*/
- writel(miiAddr.value, &mac->mii_mgmt_addr.value);
- writel(miiCmd.value, &mac->mii_mgmt_cmd.value);
+ writel(miiAddr, &mac->mii_mgmt_addr);
+ writel(miiCmd, &mac->mii_mgmt_cmd);
return status;
}
/**
* et131x_xcvr_find - Find the PHY ID
- * @adapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_xcvr_find(struct et131x_adapter *adapter)
+int et131x_xcvr_find(struct et131x_adapter *etdev)
{
- int status = -ENODEV;
- uint8_t xcvr_addr;
+ u8 xcvr_addr;
MI_IDR1_t idr1;
MI_IDR2_t idr2;
- uint32_t xcvr_id;
+ u32 xcvr_id;
/* We need to get xcvr id and address we just get the first one */
for (xcvr_addr = 0; xcvr_addr < 32; xcvr_addr++) {
/* Read the ID from the PHY */
- PhyMiRead(adapter, xcvr_addr,
- (uint8_t) offsetof(MI_REGS_t, idr1),
+ PhyMiRead(etdev, xcvr_addr,
+ (u8) offsetof(MI_REGS_t, idr1),
&idr1.value);
- PhyMiRead(adapter, xcvr_addr,
- (uint8_t) offsetof(MI_REGS_t, idr2),
+ PhyMiRead(etdev, xcvr_addr,
+ (u8) offsetof(MI_REGS_t, idr2),
&idr2.value);
- xcvr_id = (uint32_t) ((idr1.value << 16) | idr2.value);
+ xcvr_id = (u32) ((idr1.value << 16) | idr2.value);
- if ((idr1.value != 0) && (idr1.value != 0xffff)) {
- adapter->Stats.xcvr_id = xcvr_id;
- adapter->Stats.xcvr_addr = xcvr_addr;
-
- status = 0;
- break;
+ if (idr1.value != 0 && idr1.value != 0xffff) {
+ etdev->Stats.xcvr_id = xcvr_id;
+ etdev->Stats.xcvr_addr = xcvr_addr;
+ return 0;
}
}
- return status;
+ return -ENODEV;
+}
+
+void ET1310_PhyReset(struct et131x_adapter *etdev)
+{
+ MiWrite(etdev, PHY_CONTROL, 0x8000);
+}
+
+/**
+ * ET1310_PhyPowerDown - PHY power control
+ * @etdev: device to control
+ * @down: true for off/false for back on
+ *
+ * one hundred, ten, one thousand megs
+ * How would you like to have your LAN accessed
+ * Can't you see that this code processed
+ * Phy power, phy power..
+ */
+
+void ET1310_PhyPowerDown(struct et131x_adapter *etdev, bool down)
+{
+ u16 data;
+
+ MiRead(etdev, PHY_CONTROL, &data);
+ data &= ~0x0800; /* Power UP */
+ if (down) /* Power DOWN */
+ data |= 0x0800;
+ MiWrite(etdev, PHY_CONTROL, data);
+}
+
+/**
+ * ET130_PhyAutoNEg - autonegotiate control
+ * @etdev: device to control
+ * @enabe: autoneg on/off
+ *
+ * Set up the autonegotiation state according to whether we will be
+ * negotiating the state or forcing a speed.
+ */
+
+static void ET1310_PhyAutoNeg(struct et131x_adapter *etdev, bool enable)
+{
+ u16 data;
+
+ MiRead(etdev, PHY_CONTROL, &data);
+ data &= ~0x1000; /* Autonegotiation OFF */
+ if (enable)
+ data |= 0x1000; /* Autonegotiation ON */
+ MiWrite(etdev, PHY_CONTROL, data);
+}
+
+/**
+ * ET130_PhyDuplexMode - duplex control
+ * @etdev: device to control
+ * @duplex: duplex on/off
+ *
+ * Set up the duplex state on the PHY
+ */
+
+static void ET1310_PhyDuplexMode(struct et131x_adapter *etdev, u16 duplex)
+{
+ u16 data;
+
+ MiRead(etdev, PHY_CONTROL, &data);
+ data &= ~0x100; /* Set Half Duplex */
+ if (duplex == TRUEPHY_DUPLEX_FULL)
+ data |= 0x100; /* Set Full Duplex */
+ MiWrite(etdev, PHY_CONTROL, data);
+}
+
+/**
+ * ET130_PhySpeedSelect - speed control
+ * @etdev: device to control
+ * @duplex: duplex on/off
+ *
+ * Set the speed of our PHY.
+ */
+
+static void ET1310_PhySpeedSelect(struct et131x_adapter *etdev, u16 speed)
+{
+ u16 data;
+ static const u16 bits[3]={0x0000, 0x2000, 0x0040};
+
+ /* Read the PHY control register */
+ MiRead(etdev, PHY_CONTROL, &data);
+ /* Clear all Speed settings (Bits 6, 13) */
+ data &= ~0x2040;
+ /* Write back the new speed */
+ MiWrite(etdev, PHY_CONTROL, data | bits[speed]);
+}
+
+/**
+ * ET1310_PhyLinkStatus - read link state
+ * @etdev: device to read
+ * @link_status: reported link state
+ * @autoneg: reported autonegotiation state (complete/incomplete/disabled)
+ * @linkspeed: returnedlink speed in use
+ * @duplex_mode: reported half/full duplex state
+ * @mdi_mdix: not yet working
+ * @masterslave: report whether we are master or slave
+ * @polarity: link polarity
+ *
+ * I can read your lan like a magazine
+ * I see if your up
+ * I know your link speed
+ * I see all the setting that you'd rather keep
+ */
+
+static void ET1310_PhyLinkStatus(struct et131x_adapter *etdev,
+ u8 *link_status,
+ u32 *autoneg,
+ u32 *linkspeed,
+ u32 *duplex_mode,
+ u32 *mdi_mdix,
+ u32 *masterslave, u32 *polarity)
+{
+ u16 mistatus = 0;
+ u16 is1000BaseT = 0;
+ u16 vmi_phystatus = 0;
+ u16 control = 0;
+
+ MiRead(etdev, PHY_STATUS, &mistatus);
+ MiRead(etdev, PHY_1000_STATUS, &is1000BaseT);
+ MiRead(etdev, PHY_PHY_STATUS, &vmi_phystatus);
+ MiRead(etdev, PHY_CONTROL, &control);
+
+ *link_status = (vmi_phystatus & 0x0040) ? 1 : 0;
+ *autoneg = (control & 0x1000) ? ((vmi_phystatus & 0x0020) ?
+ TRUEPHY_ANEG_COMPLETE :
+ TRUEPHY_ANEG_NOT_COMPLETE) :
+ TRUEPHY_ANEG_DISABLED;
+ *linkspeed = (vmi_phystatus & 0x0300) >> 8;
+ *duplex_mode = (vmi_phystatus & 0x0080) >> 7;
+ /* NOTE: Need to complete this */
+ *mdi_mdix = 0;
+
+ *masterslave = (is1000BaseT & 0x4000) ?
+ TRUEPHY_CFG_MASTER : TRUEPHY_CFG_SLAVE;
+ *polarity = (vmi_phystatus & 0x0400) ?
+ TRUEPHY_POLARITY_INVERTED : TRUEPHY_POLARITY_NORMAL;
+}
+
+static void ET1310_PhyAndOrReg(struct et131x_adapter *etdev,
+ u16 regnum, u16 andMask, u16 orMask)
+{
+ u16 reg;
+
+ MiRead(etdev, regnum, &reg);
+ reg &= andMask;
+ reg |= orMask;
+ MiWrite(etdev, regnum, reg);
+}
+
+/* Still used from _mac for BIT_READ */
+void ET1310_PhyAccessMiBit(struct et131x_adapter *etdev, u16 action,
+ u16 regnum, u16 bitnum, u8 *value)
+{
+ u16 reg;
+ u16 mask = 0x0001 << bitnum;
+
+ /* Read the requested register */
+ MiRead(etdev, regnum, &reg);
+
+ switch (action) {
+ case TRUEPHY_BIT_READ:
+ *value = (reg & mask) >> bitnum;
+ break;
+
+ case TRUEPHY_BIT_SET:
+ MiWrite(etdev, regnum, reg | mask);
+ break;
+
+ case TRUEPHY_BIT_CLEAR:
+ MiWrite(etdev, regnum, reg & ~mask);
+ break;
+
+ default:
+ break;
+ }
+}
+
+void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *etdev,
+ u16 duplex)
+{
+ u16 data;
+
+ /* Read the PHY 1000 Base-T Control Register */
+ MiRead(etdev, PHY_1000_CONTROL, &data);
+
+ /* Clear Bits 8,9 */
+ data &= ~0x0300;
+
+ switch (duplex) {
+ case TRUEPHY_ADV_DUPLEX_NONE:
+ /* Duplex already cleared, do nothing */
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_FULL:
+ /* Set Bit 9 */
+ data |= 0x0200;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_HALF:
+ /* Set Bit 8 */
+ data |= 0x0100;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_BOTH:
+ default:
+ data |= 0x0300;
+ break;
+ }
+
+ /* Write back advertisement */
+ MiWrite(etdev, PHY_1000_CONTROL, data);
+}
+
+static void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *etdev,
+ u16 duplex)
+{
+ u16 data;
+
+ /* Read the Autonegotiation Register (10/100) */
+ MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &data);
+
+ /* Clear bits 7,8 */
+ data &= ~0x0180;
+
+ switch (duplex) {
+ case TRUEPHY_ADV_DUPLEX_NONE:
+ /* Duplex already cleared, do nothing */
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_FULL:
+ /* Set Bit 8 */
+ data |= 0x0100;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_HALF:
+ /* Set Bit 7 */
+ data |= 0x0080;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_BOTH:
+ default:
+ /* Set Bits 7,8 */
+ data |= 0x0180;
+ break;
+ }
+
+ /* Write back advertisement */
+ MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, data);
+}
+
+static void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *etdev,
+ u16 duplex)
+{
+ u16 data;
+
+ /* Read the Autonegotiation Register (10/100) */
+ MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &data);
+
+ /* Clear bits 5,6 */
+ data &= ~0x0060;
+
+ switch (duplex) {
+ case TRUEPHY_ADV_DUPLEX_NONE:
+ /* Duplex already cleared, do nothing */
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_FULL:
+ /* Set Bit 6 */
+ data |= 0x0040;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_HALF:
+ /* Set Bit 5 */
+ data |= 0x0020;
+ break;
+
+ case TRUEPHY_ADV_DUPLEX_BOTH:
+ default:
+ /* Set Bits 5,6 */
+ data |= 0x0060;
+ break;
+ }
+
+ /* Write back advertisement */
+ MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, data);
}
/**
* et131x_setphy_normal - Set PHY for normal operation.
- * @adapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
*
* Used by Power Management to force the PHY into 10 Base T half-duplex mode,
* when going to D3 in WOL mode. Also used during initialization to set the
* PHY for normal operation.
*/
-int et131x_setphy_normal(struct et131x_adapter *adapter)
+void et131x_setphy_normal(struct et131x_adapter *etdev)
{
- int status;
-
/* Make sure the PHY is powered up */
- ET1310_PhyPowerDown(adapter, 0);
- status = et131x_xcvr_init(adapter);
- return status;
+ ET1310_PhyPowerDown(etdev, 0);
+ et131x_xcvr_init(etdev);
}
+
/**
* et131x_xcvr_init - Init the phy if we are setting it into force mode
- * @adapter: pointer to our private adapter structure
+ * @etdev: pointer to our private adapter structure
*
- * Returns 0 on success, errno on failure (as defined in errno.h)
*/
-static int et131x_xcvr_init(struct et131x_adapter *adapter)
+static void et131x_xcvr_init(struct et131x_adapter *etdev)
{
- int status = 0;
MI_IMR_t imr;
MI_ISR_t isr;
MI_LCR2_t lcr2;
/* Zero out the adapter structure variable representing BMSR */
- adapter->Bmsr.value = 0;
+ etdev->Bmsr.value = 0;
- MiRead(adapter, (uint8_t) offsetof(MI_REGS_t, isr), &isr.value);
-
- MiRead(adapter, (uint8_t) offsetof(MI_REGS_t, imr), &imr.value);
+ MiRead(etdev, (u8) offsetof(MI_REGS_t, isr), &isr.value);
+ MiRead(etdev, (u8) offsetof(MI_REGS_t, imr), &imr.value);
/* Set the link status interrupt only. Bad behavior when link status
* and auto neg are set, we run into a nested interrupt problem
@@ -338,7 +598,7 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
imr.bits.link_status = 0x1;
imr.bits.autoneg_status = 0x1;
- MiWrite(adapter, (uint8_t) offsetof(MI_REGS_t, imr), imr.value);
+ MiWrite(etdev, (u8) offsetof(MI_REGS_t, imr), imr.value);
/* Set the LED behavior such that LED 1 indicates speed (off =
* 10Mbits, blink = 100Mbits, on = 1000Mbits) and LED 2 indicates
@@ -348,111 +608,138 @@ static int et131x_xcvr_init(struct et131x_adapter *adapter)
* vendors; The LED behavior is now determined by vendor data in the
* EEPROM. However, the above description is the default.
*/
- if ((adapter->eepromData[1] & 0x4) == 0) {
- MiRead(adapter, (uint8_t) offsetof(MI_REGS_t, lcr2),
+ if ((etdev->eepromData[1] & 0x4) == 0) {
+ MiRead(etdev, (u8) offsetof(MI_REGS_t, lcr2),
&lcr2.value);
- if ((adapter->eepromData[1] & 0x8) == 0)
+ if ((etdev->eepromData[1] & 0x8) == 0)
lcr2.bits.led_tx_rx = 0x3;
else
lcr2.bits.led_tx_rx = 0x4;
lcr2.bits.led_link = 0xa;
- MiWrite(adapter, (uint8_t) offsetof(MI_REGS_t, lcr2),
+ MiWrite(etdev, (u8) offsetof(MI_REGS_t, lcr2),
lcr2.value);
}
/* Determine if we need to go into a force mode and set it */
- if (adapter->AiForceSpeed == 0 && adapter->AiForceDpx == 0) {
- if ((adapter->RegistryFlowControl == TxOnly) ||
- (adapter->RegistryFlowControl == Both)) {
- ET1310_PhyAccessMiBit(adapter,
+ if (etdev->AiForceSpeed == 0 && etdev->AiForceDpx == 0) {
+ if (etdev->RegistryFlowControl == TxOnly ||
+ etdev->RegistryFlowControl == Both)
+ ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 11, NULL);
- } else {
- ET1310_PhyAccessMiBit(adapter,
+ else
+ ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_CLEAR, 4, 11, NULL);
- }
- if (adapter->RegistryFlowControl == Both) {
- ET1310_PhyAccessMiBit(adapter,
+ if (etdev->RegistryFlowControl == Both)
+ ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_SET, 4, 10, NULL);
- } else {
- ET1310_PhyAccessMiBit(adapter,
+ else
+ ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_CLEAR, 4, 10, NULL);
- }
/* Set the phy to autonegotiation */
- ET1310_PhyAutoNeg(adapter, true);
+ ET1310_PhyAutoNeg(etdev, true);
/* NOTE - Do we need this? */
- ET1310_PhyAccessMiBit(adapter, TRUEPHY_BIT_SET, 0, 9, NULL);
- return status;
- } else {
- ET1310_PhyAutoNeg(adapter, false);
-
- /* Set to the correct force mode. */
- if (adapter->AiForceDpx != 1) {
- if ((adapter->RegistryFlowControl == TxOnly) ||
- (adapter->RegistryFlowControl == Both)) {
- ET1310_PhyAccessMiBit(adapter,
- TRUEPHY_BIT_SET, 4, 11,
- NULL);
- } else {
- ET1310_PhyAccessMiBit(adapter,
- TRUEPHY_BIT_CLEAR, 4, 11,
- NULL);
- }
+ ET1310_PhyAccessMiBit(etdev, TRUEPHY_BIT_SET, 0, 9, NULL);
+ return;
+ }
- if (adapter->RegistryFlowControl == Both) {
- ET1310_PhyAccessMiBit(adapter,
- TRUEPHY_BIT_SET, 4, 10,
- NULL);
- } else {
- ET1310_PhyAccessMiBit(adapter,
- TRUEPHY_BIT_CLEAR, 4, 10,
- NULL);
- }
- } else {
- ET1310_PhyAccessMiBit(adapter,
- TRUEPHY_BIT_CLEAR, 4, 10, NULL);
- ET1310_PhyAccessMiBit(adapter,
+ ET1310_PhyAutoNeg(etdev, false);
+
+ /* Set to the correct force mode. */
+ if (etdev->AiForceDpx != 1) {
+ if (etdev->RegistryFlowControl == TxOnly ||
+ etdev->RegistryFlowControl == Both)
+ ET1310_PhyAccessMiBit(etdev,
+ TRUEPHY_BIT_SET, 4, 11, NULL);
+ else
+ ET1310_PhyAccessMiBit(etdev,
TRUEPHY_BIT_CLEAR, 4, 11, NULL);
- }
- switch (adapter->AiForceSpeed) {
- case 10:
- if (adapter->AiForceDpx == 1)
- TPAL_SetPhy10HalfDuplex(adapter);
- else if (adapter->AiForceDpx == 2)
- TPAL_SetPhy10FullDuplex(adapter);
- else
- TPAL_SetPhy10Force(adapter);
- break;
- case 100:
- if (adapter->AiForceDpx == 1)
- TPAL_SetPhy100HalfDuplex(adapter);
- else if (adapter->AiForceDpx == 2)
- TPAL_SetPhy100FullDuplex(adapter);
- else
- TPAL_SetPhy100Force(adapter);
- break;
- case 1000:
- TPAL_SetPhy1000FullDuplex(adapter);
- break;
+ if (etdev->RegistryFlowControl == Both)
+ ET1310_PhyAccessMiBit(etdev,
+ TRUEPHY_BIT_SET, 4, 10, NULL);
+ else
+ ET1310_PhyAccessMiBit(etdev,
+ TRUEPHY_BIT_CLEAR, 4, 10, NULL);
+ } else {
+ ET1310_PhyAccessMiBit(etdev, TRUEPHY_BIT_CLEAR, 4, 10, NULL);
+ ET1310_PhyAccessMiBit(etdev, TRUEPHY_BIT_CLEAR, 4, 11, NULL);
+ }
+ ET1310_PhyPowerDown(etdev, 1);
+ switch (etdev->AiForceSpeed) {
+ case 10:
+ /* First we need to turn off all other advertisement */
+ ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ if (etdev->AiForceDpx == 1) {
+ /* Set our advertise values accordingly */
+ ET1310_PhyAdvertise10BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_HALF);
+ } else if (etdev->AiForceDpx == 2) {
+ /* Set our advertise values accordingly */
+ ET1310_PhyAdvertise10BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_FULL);
+ } else {
+ /* Disable autoneg */
+ ET1310_PhyAutoNeg(etdev, false);
+ /* Disable rest of the advertisements */
+ ET1310_PhyAdvertise10BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_NONE);
+ /* Force 10 Mbps */
+ ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_10MBPS);
+ /* Force Full duplex */
+ ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
}
-
- return status;
+ break;
+ case 100:
+ /* first we need to turn off all other advertisement */
+ ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ if (etdev->AiForceDpx == 1) {
+ /* Set our advertise values accordingly */
+ ET1310_PhyAdvertise100BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_HALF);
+ /* Set speed */
+ ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
+ } else if (etdev->AiForceDpx == 2) {
+ /* Set our advertise values accordingly */
+ ET1310_PhyAdvertise100BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_FULL);
+ } else {
+ /* Disable autoneg */
+ ET1310_PhyAutoNeg(etdev, false);
+ /* Disable other advertisement */
+ ET1310_PhyAdvertise100BaseT(etdev,
+ TRUEPHY_ADV_DUPLEX_NONE);
+ /* Force 100 Mbps */
+ ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
+ /* Force Full duplex */
+ ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
+ }
+ break;
+ case 1000:
+ /* first we need to turn off all other advertisement */
+ ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
+ /* set our advertise values accordingly */
+ ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
+ break;
}
+ ET1310_PhyPowerDown(etdev, 0);
}
void et131x_Mii_check(struct et131x_adapter *etdev,
MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints)
{
- uint8_t link_status;
- uint32_t autoneg_status;
- uint32_t speed;
- uint32_t duplex;
- uint32_t mdi_mdix;
- uint32_t masterslave;
- uint32_t polarity;
+ u8 link_status;
+ u32 autoneg_status;
+ u32 speed;
+ u32 duplex;
+ u32 mdi_mdix;
+ u32 masterslave;
+ u32 polarity;
unsigned long flags;
if (bmsr_ints.bits.link_status) {
@@ -469,9 +756,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
spin_unlock_irqrestore(&etdev->Lock, flags);
- /* Don't indicate state if we're in loopback mode */
- if (etdev->RegistryPhyLoopbk == false)
- netif_carrier_on(etdev->netdev);
+ netif_carrier_on(etdev->netdev);
} else {
dev_warn(&etdev->pdev->dev,
"Link down - cable problem ?\n");
@@ -481,7 +766,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
* TruePHY?
* && TRU_QueryCoreType(etdev->hTruePhy, 0) == EMI_TRUEPHY_A13O) {
*/
- uint16_t Register18;
+ u16 Register18;
MiRead(etdev, 0x12, &Register18);
MiWrite(etdev, 0x12, Register18 | 0x4);
@@ -504,11 +789,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
spin_unlock_irqrestore(&etdev->Lock,
flags);
- /* Only indicate state if we're in loopback
- * mode
- */
- if (etdev->RegistryPhyLoopbk == false)
- netif_carrier_off(etdev->netdev);
+ netif_carrier_off(etdev->netdev);
}
etdev->linkspeed = 0;
@@ -561,7 +842,7 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
* TruePHY?
* && TRU_QueryCoreType(etdev->hTruePhy, 0)== EMI_TRUEPHY_A13O) {
*/
- uint16_t Register18;
+ u16 Register18;
MiRead(etdev, 0x12, &Register18);
MiWrite(etdev, 0x12, Register18 | 0x4);
@@ -583,212 +864,13 @@ void et131x_Mii_check(struct et131x_adapter *etdev,
}
}
-/**
- * TPAL_SetPhy10HalfDuplex - Force the phy into 10 Base T Half Duplex mode.
- * @etdev: pointer to the adapter structure
- *
- * Also sets the MAC so it is syncd up properly
- */
-void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* First we need to turn off all other advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Set our advertise values accordingly */
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy10FullDuplex - Force the phy into 10 Base T Full Duplex mode.
- * @etdev: pointer to the adapter structure
- *
- * Also sets the MAC so it is syncd up properly
- */
-void TPAL_SetPhy10FullDuplex(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* First we need to turn off all other advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Set our advertise values accordingly */
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy10Force - Force Base-T FD mode WITHOUT using autonegotiation
- * @etdev: pointer to the adapter structure
- */
-void TPAL_SetPhy10Force(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* Disable autoneg */
- ET1310_PhyAutoNeg(etdev, false);
-
- /* Disable all advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Force 10 Mbps */
- ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_10MBPS);
-
- /* Force Full duplex */
- ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy100HalfDuplex - Force 100 Base T Half Duplex mode.
- * @etdev: pointer to the adapter structure
- *
- * Also sets the MAC so it is syncd up properly.
- */
-void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* first we need to turn off all other advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Set our advertise values accordingly */
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_HALF);
-
- /* Set speed */
- ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy100FullDuplex - Force 100 Base T Full Duplex mode.
- * @etdev: pointer to the adapter structure
- *
- * Also sets the MAC so it is syncd up properly
- */
-void TPAL_SetPhy100FullDuplex(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* First we need to turn off all other advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Set our advertise values accordingly */
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy100Force - Force 100 BaseT FD mode WITHOUT using autonegotiation
- * @etdev: pointer to the adapter structure
- */
-void TPAL_SetPhy100Force(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* Disable autoneg */
- ET1310_PhyAutoNeg(etdev, false);
-
- /* Disable all advertisement */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Force 100 Mbps */
- ET1310_PhySpeedSelect(etdev, TRUEPHY_SPEED_100MBPS);
-
- /* Force Full duplex */
- ET1310_PhyDuplexMode(etdev, TRUEPHY_DUPLEX_FULL);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhy1000FullDuplex - Force 1000 Base T Full Duplex mode
- * @etdev: pointer to the adapter structure
- *
- * Also sets the MAC so it is syncd up properly.
- */
-void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* first we need to turn off all other advertisement */
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* set our advertise values accordingly */
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
-
- /* power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-/**
- * TPAL_SetPhyAutoNeg - Set phy to autonegotiation mode.
- * @etdev: pointer to the adapter structure
- */
-void TPAL_SetPhyAutoNeg(struct et131x_adapter *etdev)
-{
- /* Power down PHY */
- ET1310_PhyPowerDown(etdev, 1);
-
- /* Turn on advertisement of all capabilities */
- ET1310_PhyAdvertise10BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);
-
- ET1310_PhyAdvertise100BaseT(etdev, TRUEPHY_ADV_DUPLEX_BOTH);
-
- if (etdev->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_FULL);
- else
- ET1310_PhyAdvertise1000BaseT(etdev, TRUEPHY_ADV_DUPLEX_NONE);
-
- /* Make sure auto-neg is ON (it is disabled in FORCE modes) */
- ET1310_PhyAutoNeg(etdev, true);
-
- /* Power up PHY */
- ET1310_PhyPowerDown(etdev, 0);
-}
-
-
/*
* The routines which follow provide low-level access to the PHY, and are used
* primarily by the routines above (although there are a few places elsewhere
* in the driver where this level of access is required).
*/
-static const uint16_t ConfigPhy[25][2] = {
+static const u16 ConfigPhy[25][2] = {
/* Reg Value Register */
/* Addr */
{0x880B, 0x0926}, /* AfeIfCreg4B1000Msbs */
@@ -831,7 +913,7 @@ static const uint16_t ConfigPhy[25][2] = {
/* condensed version of the phy initialization routine */
void ET1310_PhyInit(struct et131x_adapter *etdev)
{
- uint16_t data, index;
+ u16 data, index;
if (etdev == NULL)
return;
@@ -896,304 +978,3 @@ void ET1310_PhyInit(struct et131x_adapter *etdev)
MiWrite(etdev, PHY_MPHY_CONTROL_REG, 0x0002);
}
-void ET1310_PhyReset(struct et131x_adapter *etdev)
-{
- MiWrite(etdev, PHY_CONTROL, 0x8000);
-}
-
-void ET1310_PhyPowerDown(struct et131x_adapter *etdev, bool down)
-{
- uint16_t data;
-
- MiRead(etdev, PHY_CONTROL, &data);
-
- if (down == false) {
- /* Power UP */
- data &= ~0x0800;
- MiWrite(etdev, PHY_CONTROL, data);
- } else {
- /* Power DOWN */
- data |= 0x0800;
- MiWrite(etdev, PHY_CONTROL, data);
- }
-}
-
-void ET1310_PhyAutoNeg(struct et131x_adapter *etdev, bool enable)
-{
- uint16_t data;
-
- MiRead(etdev, PHY_CONTROL, &data);
-
- if (enable == true) {
- /* Autonegotiation ON */
- data |= 0x1000;
- MiWrite(etdev, PHY_CONTROL, data);
- } else {
- /* Autonegotiation OFF */
- data &= ~0x1000;
- MiWrite(etdev, PHY_CONTROL, data);
- }
-}
-
-void ET1310_PhyDuplexMode(struct et131x_adapter *etdev, uint16_t duplex)
-{
- uint16_t data;
-
- MiRead(etdev, PHY_CONTROL, &data);
-
- if (duplex == TRUEPHY_DUPLEX_FULL) {
- /* Set Full Duplex */
- data |= 0x100;
- MiWrite(etdev, PHY_CONTROL, data);
- } else {
- /* Set Half Duplex */
- data &= ~0x100;
- MiWrite(etdev, PHY_CONTROL, data);
- }
-}
-
-void ET1310_PhySpeedSelect(struct et131x_adapter *etdev, uint16_t speed)
-{
- uint16_t data;
-
- /* Read the PHY control register */
- MiRead(etdev, PHY_CONTROL, &data);
-
- /* Clear all Speed settings (Bits 6, 13) */
- data &= ~0x2040;
-
- /* Reset the speed bits based on user selection */
- switch (speed) {
- case TRUEPHY_SPEED_10MBPS:
- /* Bits already cleared above, do nothing */
- break;
-
- case TRUEPHY_SPEED_100MBPS:
- /* 100M == Set bit 13 */
- data |= 0x2000;
- break;
-
- case TRUEPHY_SPEED_1000MBPS:
- default:
- data |= 0x0040;
- break;
- }
-
- /* Write back the new speed */
- MiWrite(etdev, PHY_CONTROL, data);
-}
-
-void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *etdev,
- uint16_t duplex)
-{
- uint16_t data;
-
- /* Read the PHY 1000 Base-T Control Register */
- MiRead(etdev, PHY_1000_CONTROL, &data);
-
- /* Clear Bits 8,9 */
- data &= ~0x0300;
-
- switch (duplex) {
- case TRUEPHY_ADV_DUPLEX_NONE:
- /* Duplex already cleared, do nothing */
- break;
-
- case TRUEPHY_ADV_DUPLEX_FULL:
- /* Set Bit 9 */
- data |= 0x0200;
- break;
-
- case TRUEPHY_ADV_DUPLEX_HALF:
- /* Set Bit 8 */
- data |= 0x0100;
- break;
-
- case TRUEPHY_ADV_DUPLEX_BOTH:
- default:
- data |= 0x0300;
- break;
- }
-
- /* Write back advertisement */
- MiWrite(etdev, PHY_1000_CONTROL, data);
-}
-
-void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *etdev,
- uint16_t duplex)
-{
- uint16_t data;
-
- /* Read the Autonegotiation Register (10/100) */
- MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &data);
-
- /* Clear bits 7,8 */
- data &= ~0x0180;
-
- switch (duplex) {
- case TRUEPHY_ADV_DUPLEX_NONE:
- /* Duplex already cleared, do nothing */
- break;
-
- case TRUEPHY_ADV_DUPLEX_FULL:
- /* Set Bit 8 */
- data |= 0x0100;
- break;
-
- case TRUEPHY_ADV_DUPLEX_HALF:
- /* Set Bit 7 */
- data |= 0x0080;
- break;
-
- case TRUEPHY_ADV_DUPLEX_BOTH:
- default:
- /* Set Bits 7,8 */
- data |= 0x0180;
- break;
- }
-
- /* Write back advertisement */
- MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, data);
-}
-
-void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *etdev,
- uint16_t duplex)
-{
- uint16_t data;
-
- /* Read the Autonegotiation Register (10/100) */
- MiRead(etdev, PHY_AUTO_ADVERTISEMENT, &data);
-
- /* Clear bits 5,6 */
- data &= ~0x0060;
-
- switch (duplex) {
- case TRUEPHY_ADV_DUPLEX_NONE:
- /* Duplex already cleared, do nothing */
- break;
-
- case TRUEPHY_ADV_DUPLEX_FULL:
- /* Set Bit 6 */
- data |= 0x0040;
- break;
-
- case TRUEPHY_ADV_DUPLEX_HALF:
- /* Set Bit 5 */
- data |= 0x0020;
- break;
-
- case TRUEPHY_ADV_DUPLEX_BOTH:
- default:
- /* Set Bits 5,6 */
- data |= 0x0060;
- break;
- }
-
- /* Write back advertisement */
- MiWrite(etdev, PHY_AUTO_ADVERTISEMENT, data);
-}
-
-void ET1310_PhyLinkStatus(struct et131x_adapter *etdev,
- uint8_t *link_status,
- uint32_t *autoneg,
- uint32_t *linkspeed,
- uint32_t *duplex_mode,
- uint32_t *mdi_mdix,
- uint32_t *masterslave, uint32_t *polarity)
-{
- uint16_t mistatus = 0;
- uint16_t is1000BaseT = 0;
- uint16_t vmi_phystatus = 0;
- uint16_t control = 0;
-
- MiRead(etdev, PHY_STATUS, &mistatus);
- MiRead(etdev, PHY_1000_STATUS, &is1000BaseT);
- MiRead(etdev, PHY_PHY_STATUS, &vmi_phystatus);
- MiRead(etdev, PHY_CONTROL, &control);
-
- if (link_status) {
- *link_status =
- (unsigned char)((vmi_phystatus & 0x0040) ? 1 : 0);
- }
-
- if (autoneg) {
- *autoneg =
- (control & 0x1000) ? ((vmi_phystatus & 0x0020) ?
- TRUEPHY_ANEG_COMPLETE :
- TRUEPHY_ANEG_NOT_COMPLETE) :
- TRUEPHY_ANEG_DISABLED;
- }
-
- if (linkspeed)
- *linkspeed = (vmi_phystatus & 0x0300) >> 8;
-
- if (duplex_mode)
- *duplex_mode = (vmi_phystatus & 0x0080) >> 7;
-
- if (mdi_mdix)
- /* NOTE: Need to complete this */
- *mdi_mdix = 0;
-
- if (masterslave) {
- *masterslave =
- (is1000BaseT & 0x4000) ? TRUEPHY_CFG_MASTER :
- TRUEPHY_CFG_SLAVE;
- }
-
- if (polarity) {
- *polarity =
- (vmi_phystatus & 0x0400) ? TRUEPHY_POLARITY_INVERTED :
- TRUEPHY_POLARITY_NORMAL;
- }
-}
-
-void ET1310_PhyAndOrReg(struct et131x_adapter *etdev,
- uint16_t regnum, uint16_t andMask, uint16_t orMask)
-{
- uint16_t reg;
-
- /* Read the requested register */
- MiRead(etdev, regnum, &reg);
-
- /* Apply the AND mask */
- reg &= andMask;
-
- /* Apply the OR mask */
- reg |= orMask;
-
- /* Write the value back to the register */
- MiWrite(etdev, regnum, reg);
-}
-
-void ET1310_PhyAccessMiBit(struct et131x_adapter *etdev, uint16_t action,
- uint16_t regnum, uint16_t bitnum, uint8_t *value)
-{
- uint16_t reg;
- uint16_t mask = 0;
-
- /* Create a mask to isolate the requested bit */
- mask = 0x0001 << bitnum;
-
- /* Read the requested register */
- MiRead(etdev, regnum, &reg);
-
- switch (action) {
- case TRUEPHY_BIT_READ:
- if (value != NULL)
- *value = (reg & mask) >> bitnum;
- break;
-
- case TRUEPHY_BIT_SET:
- reg |= mask;
- MiWrite(etdev, regnum, reg);
- break;
-
- case TRUEPHY_BIT_CLEAR:
- reg &= ~mask;
- MiWrite(etdev, regnum, reg);
- break;
-
- default:
- break;
- }
-}
diff --git a/drivers/staging/et131x/et1310_phy.h b/drivers/staging/et131x/et1310_phy.h
index 080656c6142c..758b9b251715 100644
--- a/drivers/staging/et131x/et1310_phy.h
+++ b/drivers/staging/et131x/et1310_phy.h
@@ -61,9 +61,6 @@
#include "et1310_address_map.h"
-#define TRUEPHY_SUCCESS 0
-#define TRUEPHY_FAILURE 1
-
/* MI Register Addresses */
#define MI_CONTROL_REG 0
#define MI_STATUS_REG 1
@@ -742,25 +739,15 @@ typedef union _MI_LCR2_t {
/* Forward declaration of the private adapter structure */
struct et131x_adapter;
-/* OS Specific Functions*/
-void TPAL_SetPhy10HalfDuplex(struct et131x_adapter *adapter);
-void TPAL_SetPhy10FullDuplex(struct et131x_adapter *adapter);
-void TPAL_SetPhy10Force(struct et131x_adapter *pAdapter);
-void TPAL_SetPhy100HalfDuplex(struct et131x_adapter *adapter);
-void TPAL_SetPhy100FullDuplex(struct et131x_adapter *adapter);
-void TPAL_SetPhy100Force(struct et131x_adapter *pAdapter);
-void TPAL_SetPhy1000FullDuplex(struct et131x_adapter *adapter);
-void TPAL_SetPhyAutoNeg(struct et131x_adapter *adapter);
-
/* Prototypes for ET1310_phy.c */
int et131x_xcvr_find(struct et131x_adapter *adapter);
-int et131x_setphy_normal(struct et131x_adapter *adapter);
-int32_t PhyMiRead(struct et131x_adapter *adapter,
- u8 xcvrAddr, u8 xcvrReg, u16 *value);
+void et131x_setphy_normal(struct et131x_adapter *adapter);
/* static inline function does not work because et131x_adapter is not always
* defined
*/
+int PhyMiRead(struct et131x_adapter *adapter, u8 xcvrAddr,
+ u8 xcvrReg, u16 *value);
#define MiRead(adapter, xcvrReg, value) \
PhyMiRead((adapter), (adapter)->Stats.xcvr_addr, (xcvrReg), (value))
@@ -860,24 +847,8 @@ void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter);
void ET1310_PhyInit(struct et131x_adapter *adapter);
void ET1310_PhyReset(struct et131x_adapter *adapter);
void ET1310_PhyPowerDown(struct et131x_adapter *adapter, bool down);
-void ET1310_PhyAutoNeg(struct et131x_adapter *adapter, bool enable);
-void ET1310_PhyDuplexMode(struct et131x_adapter *adapter, u16 duplex);
-void ET1310_PhySpeedSelect(struct et131x_adapter *adapter, u16 speed);
void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *adapter,
u16 duplex);
-void ET1310_PhyAdvertise100BaseT(struct et131x_adapter *adapter,
- u16 duplex);
-void ET1310_PhyAdvertise10BaseT(struct et131x_adapter *adapter,
- u16 duplex);
-void ET1310_PhyLinkStatus(struct et131x_adapter *adapter,
- u8 *Link_status,
- u32 *autoneg,
- u32 *linkspeed,
- u32 *duplex_mode,
- u32 *mdi_mdix,
- u32 *masterslave, u32 *polarity);
-void ET1310_PhyAndOrReg(struct et131x_adapter *adapter,
- u16 regnum, u16 andMask, u16 orMask);
void ET1310_PhyAccessMiBit(struct et131x_adapter *adapter,
u16 action,
u16 regnum, u16 bitnum, u8 *value);
diff --git a/drivers/staging/et131x/et1310_rx.c b/drivers/staging/et131x/et1310_rx.c
index 10e21db57ac3..4c4555dffd1f 100644
--- a/drivers/staging/et131x/et1310_rx.c
+++ b/drivers/staging/et131x/et1310_rx.c
@@ -106,9 +106,9 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd);
*/
int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
{
- uint32_t OuterLoop, InnerLoop;
- uint32_t bufsize;
- uint32_t pktStatRingSize, FBRChunkSize;
+ u32 i, j;
+ u32 bufsize;
+ u32 pktStatRingSize, FBRChunkSize;
RX_RING_t *rx_ring;
/* Setup some convenience pointers */
@@ -227,11 +227,11 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
rx_ring->Fbr0offset);
#endif
- for (OuterLoop = 0; OuterLoop < (rx_ring->Fbr1NumEntries / FBR_CHUNKS);
- OuterLoop++) {
- uint64_t Fbr1Offset;
- uint64_t Fbr1TempPa;
- uint32_t Fbr1Align;
+ for (i = 0; i < (rx_ring->Fbr1NumEntries / FBR_CHUNKS);
+ i++) {
+ u64 Fbr1Offset;
+ u64 Fbr1TempPa;
+ u32 Fbr1Align;
/* This code allocates an area of memory big enough for N
* free buffers + (buffer_size - 1) so that the buffers can
@@ -247,39 +247,39 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
FBRChunkSize =
(FBR_CHUNKS * rx_ring->Fbr1BufferSize) + Fbr1Align - 1;
- rx_ring->Fbr1MemVa[OuterLoop] =
+ rx_ring->Fbr1MemVa[i] =
pci_alloc_consistent(adapter->pdev, FBRChunkSize,
- &rx_ring->Fbr1MemPa[OuterLoop]);
+ &rx_ring->Fbr1MemPa[i]);
- if (!rx_ring->Fbr1MemVa[OuterLoop]) {
+ if (!rx_ring->Fbr1MemVa[i]) {
dev_err(&adapter->pdev->dev,
"Could not alloc memory\n");
return -ENOMEM;
}
/* See NOTE in "Save Physical Address" comment above */
- Fbr1TempPa = rx_ring->Fbr1MemPa[OuterLoop];
+ Fbr1TempPa = rx_ring->Fbr1MemPa[i];
et131x_align_allocated_memory(adapter,
&Fbr1TempPa,
&Fbr1Offset, (Fbr1Align - 1));
- for (InnerLoop = 0; InnerLoop < FBR_CHUNKS; InnerLoop++) {
- uint32_t index = (OuterLoop * FBR_CHUNKS) + InnerLoop;
+ for (j = 0; j < FBR_CHUNKS; j++) {
+ u32 index = (i * FBR_CHUNKS) + j;
/* Save the Virtual address of this index for quick
* access later
*/
rx_ring->Fbr[1]->Va[index] =
- (uint8_t *) rx_ring->Fbr1MemVa[OuterLoop] +
- (InnerLoop * rx_ring->Fbr1BufferSize) + Fbr1Offset;
+ (uint8_t *) rx_ring->Fbr1MemVa[i] +
+ (j * rx_ring->Fbr1BufferSize) + Fbr1Offset;
/* now store the physical address in the descriptor
* so the device can access it
*/
rx_ring->Fbr[1]->PAHigh[index] =
- (uint32_t) (Fbr1TempPa >> 32);
- rx_ring->Fbr[1]->PALow[index] = (uint32_t) Fbr1TempPa;
+ (u32) (Fbr1TempPa >> 32);
+ rx_ring->Fbr[1]->PALow[index] = (u32) Fbr1TempPa;
Fbr1TempPa += rx_ring->Fbr1BufferSize;
@@ -292,40 +292,40 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
#ifdef USE_FBR0
/* Same for FBR0 (if in use) */
- for (OuterLoop = 0; OuterLoop < (rx_ring->Fbr0NumEntries / FBR_CHUNKS);
- OuterLoop++) {
- uint64_t Fbr0Offset;
- uint64_t Fbr0TempPa;
+ for (i = 0; i < (rx_ring->Fbr0NumEntries / FBR_CHUNKS);
+ i++) {
+ u64 Fbr0Offset;
+ u64 Fbr0TempPa;
FBRChunkSize = ((FBR_CHUNKS + 1) * rx_ring->Fbr0BufferSize) - 1;
- rx_ring->Fbr0MemVa[OuterLoop] =
+ rx_ring->Fbr0MemVa[i] =
pci_alloc_consistent(adapter->pdev, FBRChunkSize,
- &rx_ring->Fbr0MemPa[OuterLoop]);
+ &rx_ring->Fbr0MemPa[i]);
- if (!rx_ring->Fbr0MemVa[OuterLoop]) {
+ if (!rx_ring->Fbr0MemVa[i]) {
dev_err(&adapter->pdev->dev,
"Could not alloc memory\n");
return -ENOMEM;
}
/* See NOTE in "Save Physical Address" comment above */
- Fbr0TempPa = rx_ring->Fbr0MemPa[OuterLoop];
+ Fbr0TempPa = rx_ring->Fbr0MemPa[i];
et131x_align_allocated_memory(adapter,
&Fbr0TempPa,
&Fbr0Offset,
rx_ring->Fbr0BufferSize - 1);
- for (InnerLoop = 0; InnerLoop < FBR_CHUNKS; InnerLoop++) {
- uint32_t index = (OuterLoop * FBR_CHUNKS) + InnerLoop;
+ for (j = 0; j < FBR_CHUNKS; j++) {
+ u32 index = (i * FBR_CHUNKS) + j;
rx_ring->Fbr[0]->Va[index] =
- (uint8_t *) rx_ring->Fbr0MemVa[OuterLoop] +
- (InnerLoop * rx_ring->Fbr0BufferSize) + Fbr0Offset;
+ (uint8_t *) rx_ring->Fbr0MemVa[i] +
+ (j * rx_ring->Fbr0BufferSize) + Fbr0Offset;
rx_ring->Fbr[0]->PAHigh[index] =
- (uint32_t) (Fbr0TempPa >> 32);
- rx_ring->Fbr[0]->PALow[index] = (uint32_t) Fbr0TempPa;
+ (u32) (Fbr0TempPa >> 32);
+ rx_ring->Fbr[0]->PALow[index] = (u32) Fbr0TempPa;
Fbr0TempPa += rx_ring->Fbr0BufferSize;
@@ -342,7 +342,7 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
sizeof(PKT_STAT_DESC_t) * adapter->RxRing.PsrNumEntries;
rx_ring->pPSRingVa = pci_alloc_consistent(adapter->pdev,
- pktStatRingSize + 0x0fff,
+ pktStatRingSize,
&rx_ring->pPSRingPa);
if (!rx_ring->pPSRingVa) {
@@ -350,45 +350,26 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
"Cannot alloc memory for Packet Status Ring\n");
return -ENOMEM;
}
+ printk("PSR %lx\n", (unsigned long) rx_ring->pPSRingPa);
- /* Save physical address
- *
+ /*
* NOTE : pci_alloc_consistent(), used above to alloc DMA regions,
* ALWAYS returns SAC (32-bit) addresses. If DAC (64-bit) addresses
* are ever returned, make sure the high part is retrieved here before
* storing the adjusted address.
*/
- rx_ring->pPSRingRealPa = rx_ring->pPSRingPa;
-
- /* Align Packet Status Ring on a 4K boundary */
- et131x_align_allocated_memory(adapter,
- &rx_ring->pPSRingRealPa,
- &rx_ring->pPSRingOffset, 0x0FFF);
-
- rx_ring->pPSRingVa = (void *)((uint8_t *) rx_ring->pPSRingVa +
- rx_ring->pPSRingOffset);
/* Allocate an area of memory for writeback of status information */
rx_ring->pRxStatusVa = pci_alloc_consistent(adapter->pdev,
- sizeof(RX_STATUS_BLOCK_t) +
- 0x7, &rx_ring->pRxStatusPa);
+ sizeof(RX_STATUS_BLOCK_t),
+ &rx_ring->pRxStatusPa);
if (!rx_ring->pRxStatusVa) {
dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Status Block\n");
return -ENOMEM;
}
-
- /* Save physical address */
- rx_ring->RxStatusRealPA = rx_ring->pRxStatusPa;
-
- /* Align write back on an 8 byte boundary */
- et131x_align_allocated_memory(adapter,
- &rx_ring->RxStatusRealPA,
- &rx_ring->RxStatusOffset, 0x07);
-
- rx_ring->pRxStatusVa = (void *)((uint8_t *) rx_ring->pRxStatusVa +
- rx_ring->RxStatusOffset);
rx_ring->NumRfd = NIC_DEFAULT_NUM_RFD;
+ printk("PRS %lx\n", (unsigned long)rx_ring->pRxStatusPa);
/* Recv
* pci_pool_create initializes a lookaside list. After successful
@@ -409,7 +390,6 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
* lists now.
*/
INIT_LIST_HEAD(&rx_ring->RecvList);
- INIT_LIST_HEAD(&rx_ring->RecvPendingList);
return 0;
}
@@ -419,10 +399,10 @@ int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter)
*/
void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
{
- uint32_t index;
- uint32_t bufsize;
- uint32_t pktStatRingSize;
- PMP_RFD pMpRfd;
+ u32 index;
+ u32 bufsize;
+ u32 pktStatRingSize;
+ PMP_RFD rfd;
RX_RING_t *rx_ring;
/* Setup some convenience pointers */
@@ -432,18 +412,12 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
WARN_ON(rx_ring->nReadyRecv != rx_ring->NumRfd);
while (!list_empty(&rx_ring->RecvList)) {
- pMpRfd = (MP_RFD *) list_entry(rx_ring->RecvList.next,
+ rfd = (MP_RFD *) list_entry(rx_ring->RecvList.next,
MP_RFD, list_node);
- list_del(&pMpRfd->list_node);
- et131x_rfd_resources_free(adapter, pMpRfd);
- }
-
- while (!list_empty(&rx_ring->RecvPendingList)) {
- pMpRfd = (MP_RFD *) list_entry(rx_ring->RecvPendingList.next,
- MP_RFD, list_node);
- list_del(&pMpRfd->list_node);
- et131x_rfd_resources_free(adapter, pMpRfd);
+ list_del(&rfd->list_node);
+ rfd->Packet = NULL;
+ kmem_cache_free(adapter->RxRing.RecvLookaside, rfd);
}
/* Free Free Buffer Ring 1 */
@@ -452,7 +426,7 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
for (index = 0; index <
(rx_ring->Fbr1NumEntries / FBR_CHUNKS); index++) {
if (rx_ring->Fbr1MemVa[index]) {
- uint32_t Fbr1Align;
+ u32 Fbr1Align;
if (rx_ring->Fbr1BufferSize > 4096)
Fbr1Align = 4096;
@@ -523,14 +497,10 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
/* Free Packet Status Ring */
if (rx_ring->pPSRingVa) {
- rx_ring->pPSRingVa = (void *)((uint8_t *) rx_ring->pPSRingVa -
- rx_ring->pPSRingOffset);
-
pktStatRingSize =
sizeof(PKT_STAT_DESC_t) * adapter->RxRing.PsrNumEntries;
- pci_free_consistent(adapter->pdev,
- pktStatRingSize + 0x0fff,
+ pci_free_consistent(adapter->pdev, pktStatRingSize,
rx_ring->pPSRingVa, rx_ring->pPSRingPa);
rx_ring->pPSRingVa = NULL;
@@ -538,11 +508,8 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
/* Free area of memory for the writeback of status information */
if (rx_ring->pRxStatusVa) {
- rx_ring->pRxStatusVa = (void *)((uint8_t *)
- rx_ring->pRxStatusVa - rx_ring->RxStatusOffset);
-
pci_free_consistent(adapter->pdev,
- sizeof(RX_STATUS_BLOCK_t) + 0x7,
+ sizeof(RX_STATUS_BLOCK_t),
rx_ring->pRxStatusVa, rx_ring->pRxStatusPa);
rx_ring->pRxStatusVa = NULL;
@@ -578,49 +545,43 @@ void et131x_rx_dma_memory_free(struct et131x_adapter *adapter)
int et131x_init_recv(struct et131x_adapter *adapter)
{
int status = -ENOMEM;
- PMP_RFD pMpRfd = NULL;
- uint32_t RfdCount;
- uint32_t TotalNumRfd = 0;
+ PMP_RFD rfd = NULL;
+ u32 rfdct;
+ u32 numrfd = 0;
RX_RING_t *rx_ring = NULL;
/* Setup some convenience pointers */
rx_ring = (RX_RING_t *) &adapter->RxRing;
/* Setup each RFD */
- for (RfdCount = 0; RfdCount < rx_ring->NumRfd; RfdCount++) {
- pMpRfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
+ for (rfdct = 0; rfdct < rx_ring->NumRfd; rfdct++) {
+ rfd = (MP_RFD *) kmem_cache_alloc(rx_ring->RecvLookaside,
GFP_ATOMIC | GFP_DMA);
- if (!pMpRfd) {
+ if (!rfd) {
dev_err(&adapter->pdev->dev,
"Couldn't alloc RFD out of kmem_cache\n");
status = -ENOMEM;
continue;
}
- status = et131x_rfd_resources_alloc(adapter, pMpRfd);
- if (status != 0) {
- dev_err(&adapter->pdev->dev,
- "Couldn't alloc packet for RFD\n");
- kmem_cache_free(rx_ring->RecvLookaside, pMpRfd);
- continue;
- }
+ rfd->Packet = NULL;
/* Add this RFD to the RecvList */
- list_add_tail(&pMpRfd->list_node, &rx_ring->RecvList);
+ list_add_tail(&rfd->list_node, &rx_ring->RecvList);
/* Increment both the available RFD's, and the total RFD's. */
rx_ring->nReadyRecv++;
- TotalNumRfd++;
+ numrfd++;
}
- if (TotalNumRfd > NIC_MIN_NUM_RFD)
+ if (numrfd > NIC_MIN_NUM_RFD)
status = 0;
- rx_ring->NumRfd = TotalNumRfd;
+ rx_ring->NumRfd = numrfd;
if (status != 0) {
- kmem_cache_free(rx_ring->RecvLookaside, pMpRfd);
+ kmem_cache_free(rx_ring->RecvLookaside, rfd);
dev_err(&adapter->pdev->dev,
"Allocation problems in et131x_init_recv\n");
}
@@ -628,40 +589,15 @@ int et131x_init_recv(struct et131x_adapter *adapter)
}
/**
- * et131x_rfd_resources_alloc
- * @adapter: pointer to our private adapter structure
- * @pMpRfd: pointer to a RFD
- *
- * Returns 0 on success and errno on failure (as defined in errno.h)
- */
-int et131x_rfd_resources_alloc(struct et131x_adapter *adapter, MP_RFD *pMpRfd)
-{
- pMpRfd->Packet = NULL;
-
- return 0;
-}
-
-/**
- * et131x_rfd_resources_free - Free the packet allocated for the given RFD
- * @adapter: pointer to our private adapter structure
- * @pMpRfd: pointer to a RFD
- */
-void et131x_rfd_resources_free(struct et131x_adapter *adapter, MP_RFD *pMpRfd)
-{
- pMpRfd->Packet = NULL;
- kmem_cache_free(adapter->RxRing.RecvLookaside, pMpRfd);
-}
-
-/**
* ConfigRxDmaRegs - Start of Rx_DMA init sequence
* @etdev: pointer to our adapter structure
*/
void ConfigRxDmaRegs(struct et131x_adapter *etdev)
{
struct _RXDMA_t __iomem *rx_dma = &etdev->regs->rxdma;
- struct _rx_ring_t *pRxLocal = &etdev->RxRing;
+ struct _rx_ring_t *rx_local = &etdev->RxRing;
PFBR_DESC_t fbr_entry;
- uint32_t entry;
+ u32 entry;
RXDMA_PSR_NUM_DES_t psr_num_des;
unsigned long flags;
@@ -675,19 +611,19 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
* are ever returned, make sure the high part is retrieved here
* before storing the adjusted address.
*/
- writel((uint32_t) (pRxLocal->RxStatusRealPA >> 32),
+ writel((u32) ((u64)rx_local->pRxStatusPa >> 32),
&rx_dma->dma_wb_base_hi);
- writel((uint32_t) pRxLocal->RxStatusRealPA, &rx_dma->dma_wb_base_lo);
+ writel((u32) rx_local->pRxStatusPa, &rx_dma->dma_wb_base_lo);
- memset(pRxLocal->pRxStatusVa, 0, sizeof(RX_STATUS_BLOCK_t));
+ memset(rx_local->pRxStatusVa, 0, sizeof(RX_STATUS_BLOCK_t));
/* Set the address and parameters of the packet status ring into the
* 1310's registers
*/
- writel((uint32_t) (pRxLocal->pPSRingRealPa >> 32),
+ writel((u32) ((u64)rx_local->pPSRingPa >> 32),
&rx_dma->psr_base_hi);
- writel((uint32_t) pRxLocal->pPSRingRealPa, &rx_dma->psr_base_lo);
- writel(pRxLocal->PsrNumEntries - 1, &rx_dma->psr_num_des.value);
+ writel((u32) rx_local->pPSRingPa, &rx_dma->psr_base_lo);
+ writel(rx_local->PsrNumEntries - 1, &rx_dma->psr_num_des.value);
writel(0, &rx_dma->psr_full_offset.value);
psr_num_des.value = readl(&rx_dma->psr_num_des.value);
@@ -697,14 +633,14 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
spin_lock_irqsave(&etdev->RcvLock, flags);
/* These local variables track the PSR in the adapter structure */
- pRxLocal->local_psr_full.bits.psr_full = 0;
- pRxLocal->local_psr_full.bits.psr_full_wrap = 0;
+ rx_local->local_psr_full.bits.psr_full = 0;
+ rx_local->local_psr_full.bits.psr_full_wrap = 0;
/* Now's the best time to initialize FBR1 contents */
- fbr_entry = (PFBR_DESC_t) pRxLocal->pFbr1RingVa;
- for (entry = 0; entry < pRxLocal->Fbr1NumEntries; entry++) {
- fbr_entry->addr_hi = pRxLocal->Fbr[1]->PAHigh[entry];
- fbr_entry->addr_lo = pRxLocal->Fbr[1]->PALow[entry];
+ fbr_entry = (PFBR_DESC_t) rx_local->pFbr1RingVa;
+ for (entry = 0; entry < rx_local->Fbr1NumEntries; entry++) {
+ fbr_entry->addr_hi = rx_local->Fbr[1]->PAHigh[entry];
+ fbr_entry->addr_lo = rx_local->Fbr[1]->PALow[entry];
fbr_entry->word2.bits.bi = entry;
fbr_entry++;
}
@@ -712,38 +648,38 @@ void ConfigRxDmaRegs(struct et131x_adapter *etdev)
/* Set the address and parameters of Free buffer ring 1 (and 0 if
* required) into the 1310's registers
*/
- writel((uint32_t) (pRxLocal->Fbr1Realpa >> 32), &rx_dma->fbr1_base_hi);
- writel((uint32_t) pRxLocal->Fbr1Realpa, &rx_dma->fbr1_base_lo);
- writel(pRxLocal->Fbr1NumEntries - 1, &rx_dma->fbr1_num_des.value);
+ writel((u32) (rx_local->Fbr1Realpa >> 32), &rx_dma->fbr1_base_hi);
+ writel((u32) rx_local->Fbr1Realpa, &rx_dma->fbr1_base_lo);
+ writel(rx_local->Fbr1NumEntries - 1, &rx_dma->fbr1_num_des.value);
writel(ET_DMA10_WRAP, &rx_dma->fbr1_full_offset);
/* This variable tracks the free buffer ring 1 full position, so it
* has to match the above.
*/
- pRxLocal->local_Fbr1_full = ET_DMA10_WRAP;
- writel(((pRxLocal->Fbr1NumEntries * LO_MARK_PERCENT_FOR_RX) / 100) - 1,
+ rx_local->local_Fbr1_full = ET_DMA10_WRAP;
+ writel(((rx_local->Fbr1NumEntries * LO_MARK_PERCENT_FOR_RX) / 100) - 1,
&rx_dma->fbr1_min_des.value);
#ifdef USE_FBR0
/* Now's the best time to initialize FBR0 contents */
- fbr_entry = (PFBR_DESC_t) pRxLocal->pFbr0RingVa;
- for (entry = 0; entry < pRxLocal->Fbr0NumEntries; entry++) {
- fbr_entry->addr_hi = pRxLocal->Fbr[0]->PAHigh[entry];
- fbr_entry->addr_lo = pRxLocal->Fbr[0]->PALow[entry];
+ fbr_entry = (PFBR_DESC_t) rx_local->pFbr0RingVa;
+ for (entry = 0; entry < rx_local->Fbr0NumEntries; entry++) {
+ fbr_entry->addr_hi = rx_local->Fbr[0]->PAHigh[entry];
+ fbr_entry->addr_lo = rx_local->Fbr[0]->PALow[entry];
fbr_entry->word2.bits.bi = entry;
fbr_entry++;
}
- writel((uint32_t) (pRxLocal->Fbr0Realpa >> 32), &rx_dma->fbr0_base_hi);
- writel((uint32_t) pRxLocal->Fbr0Realpa, &rx_dma->fbr0_base_lo);
- writel(pRxLocal->Fbr0NumEntries - 1, &rx_dma->fbr0_num_des.value);
+ writel((u32) (rx_local->Fbr0Realpa >> 32), &rx_dma->fbr0_base_hi);
+ writel((u32) rx_local->Fbr0Realpa, &rx_dma->fbr0_base_lo);
+ writel(rx_local->Fbr0NumEntries - 1, &rx_dma->fbr0_num_des.value);
writel(ET_DMA10_WRAP, &rx_dma->fbr0_full_offset);
/* This variable tracks the free buffer ring 0 full position, so it
* has to match the above.
*/
- pRxLocal->local_Fbr0_full = ET_DMA10_WRAP;
- writel(((pRxLocal->Fbr0NumEntries * LO_MARK_PERCENT_FOR_RX) / 100) - 1,
+ rx_local->local_Fbr0_full = ET_DMA10_WRAP;
+ writel(((rx_local->Fbr0NumEntries * LO_MARK_PERCENT_FOR_RX) / 100) - 1,
&rx_dma->fbr0_min_des.value);
#endif
@@ -807,40 +743,35 @@ void et131x_rx_dma_disable(struct et131x_adapter *etdev)
*/
void et131x_rx_dma_enable(struct et131x_adapter *etdev)
{
- if (etdev->RegistryPhyLoopbk)
- /* RxDMA is disabled for loopback operation. */
- writel(0x1, &etdev->regs->rxdma.csr.value);
- else {
/* Setup the receive dma configuration register for normal operation */
- RXDMA_CSR_t csr = { 0 };
-
- csr.bits.fbr1_enable = 1;
- if (etdev->RxRing.Fbr1BufferSize == 4096)
- csr.bits.fbr1_size = 1;
- else if (etdev->RxRing.Fbr1BufferSize == 8192)
- csr.bits.fbr1_size = 2;
- else if (etdev->RxRing.Fbr1BufferSize == 16384)
- csr.bits.fbr1_size = 3;
+ RXDMA_CSR_t csr = { 0 };
+
+ csr.bits.fbr1_enable = 1;
+ if (etdev->RxRing.Fbr1BufferSize == 4096)
+ csr.bits.fbr1_size = 1;
+ else if (etdev->RxRing.Fbr1BufferSize == 8192)
+ csr.bits.fbr1_size = 2;
+ else if (etdev->RxRing.Fbr1BufferSize == 16384)
+ csr.bits.fbr1_size = 3;
#ifdef USE_FBR0
- csr.bits.fbr0_enable = 1;
- if (etdev->RxRing.Fbr0BufferSize == 256)
- csr.bits.fbr0_size = 1;
- else if (etdev->RxRing.Fbr0BufferSize == 512)
- csr.bits.fbr0_size = 2;
- else if (etdev->RxRing.Fbr0BufferSize == 1024)
- csr.bits.fbr0_size = 3;
+ csr.bits.fbr0_enable = 1;
+ if (etdev->RxRing.Fbr0BufferSize == 256)
+ csr.bits.fbr0_size = 1;
+ else if (etdev->RxRing.Fbr0BufferSize == 512)
+ csr.bits.fbr0_size = 2;
+ else if (etdev->RxRing.Fbr0BufferSize == 1024)
+ csr.bits.fbr0_size = 3;
#endif
- writel(csr.value, &etdev->regs->rxdma.csr.value);
+ writel(csr.value, &etdev->regs->rxdma.csr.value);
+ csr.value = readl(&etdev->regs->rxdma.csr.value);
+ if (csr.bits.halt_status != 0) {
+ udelay(5);
csr.value = readl(&etdev->regs->rxdma.csr.value);
if (csr.bits.halt_status != 0) {
- udelay(5);
- csr.value = readl(&etdev->regs->rxdma.csr.value);
- if (csr.bits.halt_status != 0) {
- dev_err(&etdev->pdev->dev,
- "RX Dma failed to exit halt state. CSR 0x%08x\n",
- csr.value);
- }
+ dev_err(&etdev->pdev->dev,
+ "RX Dma failed to exit halt state. CSR 0x%08x\n",
+ csr.value);
}
}
}
@@ -849,7 +780,7 @@ void et131x_rx_dma_enable(struct et131x_adapter *etdev)
* nic_rx_pkts - Checks the hardware for available packets
* @etdev: pointer to our adapter
*
- * Returns pMpRfd, a pointer to our MPRFD.
+ * Returns rfd, a pointer to our MPRFD.
*
* Checks the hardware for available packets, using completion ring
* If packets are available, it gets an RFD from the RecvList, attaches
@@ -858,119 +789,119 @@ void et131x_rx_dma_enable(struct et131x_adapter *etdev)
*/
PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
{
- struct _rx_ring_t *pRxLocal = &etdev->RxRing;
- PRX_STATUS_BLOCK_t pRxStatusBlock;
- PPKT_STAT_DESC_t pPSREntry;
- PMP_RFD pMpRfd;
- uint32_t nIndex;
- uint8_t *pBufVa;
+ struct _rx_ring_t *rx_local = &etdev->RxRing;
+ PRX_STATUS_BLOCK_t status;
+ PPKT_STAT_DESC_t psr;
+ PMP_RFD rfd;
+ u32 i;
+ uint8_t *buf;
unsigned long flags;
struct list_head *element;
- uint8_t ringIndex;
- uint16_t bufferIndex;
- uint32_t localLen;
+ uint8_t rindex;
+ uint16_t bindex;
+ u32 len;
PKT_STAT_DESC_WORD0_t Word0;
/* RX Status block is written by the DMA engine prior to every
* interrupt. It contains the next to be used entry in the Packet
* Status Ring, and also the two Free Buffer rings.
*/
- pRxStatusBlock = (PRX_STATUS_BLOCK_t) pRxLocal->pRxStatusVa;
+ status = (PRX_STATUS_BLOCK_t) rx_local->pRxStatusVa;
- if (pRxStatusBlock->Word1.bits.PSRoffset ==
- pRxLocal->local_psr_full.bits.psr_full &&
- pRxStatusBlock->Word1.bits.PSRwrap ==
- pRxLocal->local_psr_full.bits.psr_full_wrap) {
+ if (status->Word1.bits.PSRoffset ==
+ rx_local->local_psr_full.bits.psr_full &&
+ status->Word1.bits.PSRwrap ==
+ rx_local->local_psr_full.bits.psr_full_wrap) {
/* Looks like this ring is not updated yet */
return NULL;
}
/* The packet status ring indicates that data is available. */
- pPSREntry = (PPKT_STAT_DESC_t) (pRxLocal->pPSRingVa) +
- pRxLocal->local_psr_full.bits.psr_full;
+ psr = (PPKT_STAT_DESC_t) (rx_local->pPSRingVa) +
+ rx_local->local_psr_full.bits.psr_full;
/* Grab any information that is required once the PSR is
* advanced, since we can no longer rely on the memory being
* accurate
*/
- localLen = pPSREntry->word1.bits.length;
- ringIndex = (uint8_t) pPSREntry->word1.bits.ri;
- bufferIndex = (uint16_t) pPSREntry->word1.bits.bi;
- Word0 = pPSREntry->word0;
+ len = psr->word1.bits.length;
+ rindex = (uint8_t) psr->word1.bits.ri;
+ bindex = (uint16_t) psr->word1.bits.bi;
+ Word0 = psr->word0;
/* Indicate that we have used this PSR entry. */
- if (++pRxLocal->local_psr_full.bits.psr_full >
- pRxLocal->PsrNumEntries - 1) {
- pRxLocal->local_psr_full.bits.psr_full = 0;
- pRxLocal->local_psr_full.bits.psr_full_wrap ^= 1;
+ if (++rx_local->local_psr_full.bits.psr_full >
+ rx_local->PsrNumEntries - 1) {
+ rx_local->local_psr_full.bits.psr_full = 0;
+ rx_local->local_psr_full.bits.psr_full_wrap ^= 1;
}
- writel(pRxLocal->local_psr_full.value,
+ writel(rx_local->local_psr_full.value,
&etdev->regs->rxdma.psr_full_offset.value);
#ifndef USE_FBR0
- if (ringIndex != 1) {
+ if (rindex != 1) {
return NULL;
}
#endif
#ifdef USE_FBR0
- if (ringIndex > 1 ||
- (ringIndex == 0 &&
- bufferIndex > pRxLocal->Fbr0NumEntries - 1) ||
- (ringIndex == 1 &&
- bufferIndex > pRxLocal->Fbr1NumEntries - 1))
+ if (rindex > 1 ||
+ (rindex == 0 &&
+ bindex > rx_local->Fbr0NumEntries - 1) ||
+ (rindex == 1 &&
+ bindex > rx_local->Fbr1NumEntries - 1))
#else
- if (ringIndex != 1 ||
- bufferIndex > pRxLocal->Fbr1NumEntries - 1)
+ if (rindex != 1 ||
+ bindex > rx_local->Fbr1NumEntries - 1)
#endif
{
/* Illegal buffer or ring index cannot be used by S/W*/
dev_err(&etdev->pdev->dev,
"NICRxPkts PSR Entry %d indicates "
"length of %d and/or bad bi(%d)\n",
- pRxLocal->local_psr_full.bits.psr_full,
- localLen, bufferIndex);
+ rx_local->local_psr_full.bits.psr_full,
+ len, bindex);
return NULL;
}
/* Get and fill the RFD. */
spin_lock_irqsave(&etdev->RcvLock, flags);
- pMpRfd = NULL;
- element = pRxLocal->RecvList.next;
- pMpRfd = (PMP_RFD) list_entry(element, MP_RFD, list_node);
+ rfd = NULL;
+ element = rx_local->RecvList.next;
+ rfd = (PMP_RFD) list_entry(element, MP_RFD, list_node);
- if (pMpRfd == NULL) {
+ if (rfd == NULL) {
spin_unlock_irqrestore(&etdev->RcvLock, flags);
return NULL;
}
- list_del(&pMpRfd->list_node);
- pRxLocal->nReadyRecv--;
+ list_del(&rfd->list_node);
+ rx_local->nReadyRecv--;
spin_unlock_irqrestore(&etdev->RcvLock, flags);
- pMpRfd->bufferindex = bufferIndex;
- pMpRfd->ringindex = ringIndex;
+ rfd->bufferindex = bindex;
+ rfd->ringindex = rindex;
/* In V1 silicon, there is a bug which screws up filtering of
* runt packets. Therefore runt packet filtering is disabled
* in the MAC and the packets are dropped here. They are
* also counted here.
*/
- if (localLen < (NIC_MIN_PACKET_SIZE + 4)) {
+ if (len < (NIC_MIN_PACKET_SIZE + 4)) {
etdev->Stats.other_errors++;
- localLen = 0;
+ len = 0;
}
- if (localLen) {
+ if (len) {
if (etdev->ReplicaPhyLoopbk == 1) {
- pBufVa = pRxLocal->Fbr[ringIndex]->Va[bufferIndex];
+ buf = rx_local->Fbr[rindex]->Va[bindex];
- if (memcmp(&pBufVa[6], &etdev->CurrentAddress[0],
+ if (memcmp(&buf[6], &etdev->CurrentAddress[0],
ETH_ALEN) == 0) {
- if (memcmp(&pBufVa[42], "Replica packet",
+ if (memcmp(&buf[42], "Replica packet",
ETH_HLEN)) {
etdev->ReplicaPhyLoopbkPF = 1;
}
@@ -990,28 +921,28 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
if ((etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST)
&& !(etdev->PacketFilter & ET131X_PACKET_TYPE_PROMISCUOUS)
&& !(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) {
- pBufVa = pRxLocal->Fbr[ringIndex]->
- Va[bufferIndex];
+ buf = rx_local->Fbr[rindex]->
+ Va[bindex];
/* Loop through our list to see if the
* destination address of this packet
* matches one in our list.
*/
- for (nIndex = 0;
- nIndex < etdev->MCAddressCount;
- nIndex++) {
- if (pBufVa[0] ==
- etdev->MCList[nIndex][0]
- && pBufVa[1] ==
- etdev->MCList[nIndex][1]
- && pBufVa[2] ==
- etdev->MCList[nIndex][2]
- && pBufVa[3] ==
- etdev->MCList[nIndex][3]
- && pBufVa[4] ==
- etdev->MCList[nIndex][4]
- && pBufVa[5] ==
- etdev->MCList[nIndex][5]) {
+ for (i = 0;
+ i < etdev->MCAddressCount;
+ i++) {
+ if (buf[0] ==
+ etdev->MCList[i][0]
+ && buf[1] ==
+ etdev->MCList[i][1]
+ && buf[2] ==
+ etdev->MCList[i][2]
+ && buf[3] ==
+ etdev->MCList[i][3]
+ && buf[4] ==
+ etdev->MCList[i][4]
+ && buf[5] ==
+ etdev->MCList[i][5]) {
break;
}
}
@@ -1024,11 +955,11 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
* so we free our RFD when we return
* from this function.
*/
- if (nIndex == etdev->MCAddressCount)
- localLen = 0;
+ if (i == etdev->MCAddressCount)
+ len = 0;
}
- if (localLen > 0)
+ if (len > 0)
etdev->Stats.multircv++;
} else if (Word0.value & ALCATEL_BROADCAST_PKT)
etdev->Stats.brdcstrcv++;
@@ -1041,24 +972,24 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
etdev->Stats.unircv++;
}
- if (localLen > 0) {
+ if (len > 0) {
struct sk_buff *skb = NULL;
- /* pMpRfd->PacketSize = localLen - 4; */
- pMpRfd->PacketSize = localLen;
+ /* rfd->PacketSize = len - 4; */
+ rfd->PacketSize = len;
- skb = dev_alloc_skb(pMpRfd->PacketSize + 2);
+ skb = dev_alloc_skb(rfd->PacketSize + 2);
if (!skb) {
dev_err(&etdev->pdev->dev,
"Couldn't alloc an SKB for Rx\n");
return NULL;
}
- etdev->net_stats.rx_bytes += pMpRfd->PacketSize;
+ etdev->net_stats.rx_bytes += rfd->PacketSize;
- memcpy(skb_put(skb, pMpRfd->PacketSize),
- pRxLocal->Fbr[ringIndex]->Va[bufferIndex],
- pMpRfd->PacketSize);
+ memcpy(skb_put(skb, rfd->PacketSize),
+ rx_local->Fbr[rindex]->Va[bindex],
+ rfd->PacketSize);
skb->dev = etdev->netdev;
skb->protocol = eth_type_trans(skb, etdev->netdev);
@@ -1066,11 +997,11 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
netif_rx(skb);
} else {
- pMpRfd->PacketSize = 0;
+ rfd->PacketSize = 0;
}
- nic_return_rfd(etdev, pMpRfd);
- return pMpRfd;
+ nic_return_rfd(etdev, rfd);
+ return rfd;
}
/**
@@ -1081,21 +1012,8 @@ PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev)
*/
void et131x_reset_recv(struct et131x_adapter *etdev)
{
- PMP_RFD pMpRfd;
- struct list_head *element;
-
WARN_ON(list_empty(&etdev->RxRing.RecvList));
- /* Take all the RFD's from the pending list, and stick them on the
- * RecvList.
- */
- while (!list_empty(&etdev->RxRing.RecvPendingList)) {
- element = etdev->RxRing.RecvPendingList.next;
-
- pMpRfd = (PMP_RFD) list_entry(element, MP_RFD, list_node);
-
- list_move_tail(&pMpRfd->list_node, &etdev->RxRing.RecvList);
- }
}
/**
@@ -1106,27 +1024,21 @@ void et131x_reset_recv(struct et131x_adapter *etdev)
*/
void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
{
- PMP_RFD pMpRfd = NULL;
- struct sk_buff *PacketArray[NUM_PACKETS_HANDLED];
- PMP_RFD RFDFreeArray[NUM_PACKETS_HANDLED];
- uint32_t PacketArrayCount = 0;
- uint32_t PacketsToHandle;
- uint32_t PacketFreeCount = 0;
- bool TempUnfinishedRec = false;
-
- PacketsToHandle = NUM_PACKETS_HANDLED;
+ PMP_RFD rfd = NULL;
+ u32 count = 0;
+ bool done = true;
/* Process up to available RFD's */
- while (PacketArrayCount < PacketsToHandle) {
+ while (count < NUM_PACKETS_HANDLED) {
if (list_empty(&etdev->RxRing.RecvList)) {
WARN_ON(etdev->RxRing.nReadyRecv != 0);
- TempUnfinishedRec = true;
+ done = false;
break;
}
- pMpRfd = nic_rx_pkts(etdev);
+ rfd = nic_rx_pkts(etdev);
- if (pMpRfd == NULL)
+ if (rfd == NULL)
break;
/* Do not receive any packets until a filter has been set.
@@ -1136,7 +1048,7 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
*/
if (!etdev->PacketFilter ||
!(etdev->Flags & fMP_ADAPTER_LINK_DETECTION) ||
- pMpRfd->PacketSize == 0) {
+ rfd->PacketSize == 0) {
continue;
}
@@ -1144,35 +1056,20 @@ void et131x_handle_recv_interrupt(struct et131x_adapter *etdev)
etdev->Stats.ipackets++;
/* Set the status on the packet, either resources or success */
- if (etdev->RxRing.nReadyRecv >= RFD_LOW_WATER_MARK) {
- /* Put this RFD on the pending list
- *
- * NOTE: nic_rx_pkts() above is already returning the
- * RFD to the RecvList, so don't additionally do that
- * here.
- * Besides, we don't really need (at this point) the
- * pending list anyway.
- */
- } else {
- RFDFreeArray[PacketFreeCount] = pMpRfd;
- PacketFreeCount++;
-
+ if (etdev->RxRing.nReadyRecv < RFD_LOW_WATER_MARK) {
dev_warn(&etdev->pdev->dev,
"RFD's are running out\n");
}
-
- PacketArray[PacketArrayCount] = pMpRfd->Packet;
- PacketArrayCount++;
+ count++;
}
- if ((PacketArrayCount == NUM_PACKETS_HANDLED) || TempUnfinishedRec) {
+ if (count == NUM_PACKETS_HANDLED || !done) {
etdev->RxRing.UnfinishedReceives = true;
writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO,
&etdev->regs->global.watchdog_timer);
- } else {
+ } else
/* Watchdog timer will disable itself if appropriate. */
etdev->RxRing.UnfinishedReceives = false;
- }
}
static inline u32 bump_fbr(u32 *fbr, u32 limit)
@@ -1196,14 +1093,14 @@ static inline u32 bump_fbr(u32 *fbr, u32 limit)
/**
* NICReturnRFD - Recycle a RFD and put it back onto the receive list
* @etdev: pointer to our adapter
- * @pMpRfd: pointer to the RFD
+ * @rfd: pointer to the RFD
*/
-void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
+void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD rfd)
{
struct _rx_ring_t *rx_local = &etdev->RxRing;
struct _RXDMA_t __iomem *rx_dma = &etdev->regs->rxdma;
- uint16_t bi = pMpRfd->bufferindex;
- uint8_t ri = pMpRfd->ringindex;
+ uint16_t bi = rfd->bufferindex;
+ uint8_t ri = rfd->ringindex;
unsigned long flags;
/* We don't use any of the OOB data besides status. Otherwise, we
@@ -1217,7 +1114,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
spin_lock_irqsave(&etdev->FbrLock, flags);
if (ri == 1) {
- PFBR_DESC_t pNextDesc =
+ PFBR_DESC_t next =
(PFBR_DESC_t) (rx_local->pFbr1RingVa) +
INDEX10(rx_local->local_Fbr1_full);
@@ -1225,9 +1122,9 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
* the PA / Buffer Index for the returned buffer into
* the oldest (next to be freed)FBR entry
*/
- pNextDesc->addr_hi = rx_local->Fbr[1]->PAHigh[bi];
- pNextDesc->addr_lo = rx_local->Fbr[1]->PALow[bi];
- pNextDesc->word2.value = bi;
+ next->addr_hi = rx_local->Fbr[1]->PAHigh[bi];
+ next->addr_lo = rx_local->Fbr[1]->PALow[bi];
+ next->word2.value = bi;
writel(bump_fbr(&rx_local->local_Fbr1_full,
rx_local->Fbr1NumEntries - 1),
@@ -1235,7 +1132,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
}
#ifdef USE_FBR0
else {
- PFBR_DESC_t pNextDesc =
+ PFBR_DESC_t next =
(PFBR_DESC_t) rx_local->pFbr0RingVa +
INDEX10(rx_local->local_Fbr0_full);
@@ -1243,9 +1140,9 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
* the PA / Buffer Index for the returned buffer into
* the oldest (next to be freed) FBR entry
*/
- pNextDesc->addr_hi = rx_local->Fbr[0]->PAHigh[bi];
- pNextDesc->addr_lo = rx_local->Fbr[0]->PALow[bi];
- pNextDesc->word2.value = bi;
+ next->addr_hi = rx_local->Fbr[0]->PAHigh[bi];
+ next->addr_lo = rx_local->Fbr[0]->PALow[bi];
+ next->word2.value = bi;
writel(bump_fbr(&rx_local->local_Fbr0_full,
rx_local->Fbr0NumEntries - 1),
@@ -1262,7 +1159,7 @@ void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd)
* our list
*/
spin_lock_irqsave(&etdev->RcvLock, flags);
- list_add_tail(&pMpRfd->list_node, &rx_local->RecvList);
+ list_add_tail(&rfd->list_node, &rx_local->RecvList);
rx_local->nReadyRecv++;
spin_unlock_irqrestore(&etdev->RcvLock, flags);
diff --git a/drivers/staging/et131x/et1310_rx.h b/drivers/staging/et131x/et1310_rx.h
index 72a522985270..a11bd8b0872e 100644
--- a/drivers/staging/et131x/et1310_rx.h
+++ b/drivers/staging/et131x/et1310_rx.h
@@ -209,36 +209,26 @@ typedef struct _PKT_STAT_DESC_t {
/* Typedefs for the RX DMA status word */
/*
- * RXSTAT_WORD0_t structure holds part of the status bits of the Rx DMA engine
+ * rx status word 0 holds part of the status bits of the Rx DMA engine
* that get copied out to memory by the ET-1310. Word 0 is a 32 bit word
- * whichcontains Free Buffer ring 0 and 1 available offset.
+ * which contains the Free Buffer ring 0 and 1 available offset.
+ *
+ * bit 0-9 FBR1 offset
+ * bit 10 Wrap flag for FBR1
+ * bit 16-25 FBR0 offset
+ * bit 26 Wrap flag for FBR0
*/
-typedef union _rxstat_word0_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 FBR1unused:5; /* bits 27-31 */
- u32 FBR1wrap:1; /* bit 26 */
- u32 FBR1offset:10; /* bits 16-25 */
- u32 FBR0unused:5; /* bits 11-15 */
- u32 FBR0wrap:1; /* bit 10 */
- u32 FBR0offset:10; /* bits 0-9 */
-#else
- u32 FBR0offset:10; /* bits 0-9 */
- u32 FBR0wrap:1; /* bit 10 */
- u32 FBR0unused:5; /* bits 11-15 */
- u32 FBR1offset:10; /* bits 16-25 */
- u32 FBR1wrap:1; /* bit 26 */
- u32 FBR1unused:5; /* bits 27-31 */
-#endif
- } bits;
-} RXSTAT_WORD0_t, *PRXSTAT_WORD0_t;
/*
* RXSTAT_WORD1_t structure holds part of the status bits of the Rx DMA engine
* that get copied out to memory by the ET-1310. Word 3 is a 32 bit word
* which contains the Packet Status Ring available offset.
*/
+
+#define RXSTAT1_OFFSET 16
+#define RXSTAT1_MASK 0xFFF
+#define RXSTAT1_WRAP 0x10000000
+
typedef union _rxstat_word1_t {
u32 value;
struct {
@@ -261,7 +251,7 @@ typedef union _rxstat_word1_t {
* it sits in free memory, and is pointed to by 0x101c / 0x1020
*/
typedef struct _rx_status_block_t {
- RXSTAT_WORD0_t Word0;
+ u32 Word0;
RXSTAT_WORD1_t Word1;
} RX_STATUS_BLOCK_t, *PRX_STATUS_BLOCK_t;
@@ -282,15 +272,6 @@ typedef enum {
} eRX_INTERRUPT_STATE_t, *PeRX_INTERRUPT_STATE_t;
/*
- * Structure to hold the skb's in a list
- */
-typedef struct rx_skb_list_elem {
- struct list_head skb_list_elem;
- dma_addr_t dma_addr;
- struct sk_buff *skb;
-} RX_SKB_LIST_ELEM, *PRX_SKB_LIST_ELEM;
-
-/*
* RX_RING_t is sructure representing the adaptor's local reference(s) to the
* rings
*/
@@ -319,21 +300,16 @@ typedef struct _rx_ring_t {
void *pPSRingVa;
dma_addr_t pPSRingPa;
- uint64_t pPSRingRealPa;
- uint64_t pPSRingOffset;
RXDMA_PSR_FULL_OFFSET_t local_psr_full;
u32 PsrNumEntries;
void *pRxStatusVa;
dma_addr_t pRxStatusPa;
- uint64_t RxStatusRealPA;
- uint64_t RxStatusOffset;
struct list_head RecvBufferPool;
/* RECV */
struct list_head RecvList;
- struct list_head RecvPendingList;
u32 nReadyRecv;
u32 NumRfd;
diff --git a/drivers/staging/et131x/et1310_tx.c b/drivers/staging/et131x/et1310_tx.c
index 94f7752e2ccc..d0c71db6c57c 100644
--- a/drivers/staging/et131x/et1310_tx.c
+++ b/drivers/staging/et131x/et1310_tx.c
@@ -94,13 +94,11 @@
#include "et1310_tx.h"
-static void et131x_update_tcb_list(struct et131x_adapter *etdev);
-static void et131x_check_send_wait_list(struct et131x_adapter *etdev);
static inline void et131x_free_send_packet(struct et131x_adapter *etdev,
- PMP_TCB pMpTcb);
+ struct tcb *tcb);
static int et131x_send_packet(struct sk_buff *skb,
struct et131x_adapter *etdev);
-static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb);
+static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb);
/**
* et131x_tx_dma_memory_alloc
@@ -117,12 +115,12 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb);
int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
{
int desc_size = 0;
- TX_RING_t *tx_ring = &adapter->TxRing;
+ struct tx_ring *tx_ring = &adapter->tx_ring;
/* Allocate memory for the TCB's (Transmit Control Block) */
- adapter->TxRing.MpTcbMem = (MP_TCB *)kcalloc(NUM_TCB, sizeof(MP_TCB),
- GFP_ATOMIC | GFP_DMA);
- if (!adapter->TxRing.MpTcbMem) {
+ adapter->tx_ring.tcb_ring = (struct tcb *)
+ kcalloc(NUM_TCB, sizeof(struct tcb), GFP_ATOMIC | GFP_DMA);
+ if (!adapter->tx_ring.tcb_ring) {
dev_err(&adapter->pdev->dev, "Cannot alloc memory for TCBs\n");
return -ENOMEM;
}
@@ -130,12 +128,13 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
/* Allocate enough memory for the Tx descriptor ring, and allocate
* some extra so that the ring can be aligned on a 4k boundary.
*/
- desc_size = (sizeof(TX_DESC_ENTRY_t) * NUM_DESC_PER_RING_TX) + 4096 - 1;
- tx_ring->pTxDescRingVa =
- (PTX_DESC_ENTRY_t) pci_alloc_consistent(adapter->pdev, desc_size,
- &tx_ring->pTxDescRingPa);
- if (!adapter->TxRing.pTxDescRingVa) {
- dev_err(&adapter->pdev->dev, "Cannot alloc memory for Tx Ring\n");
+ desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX) + 4096 - 1;
+ tx_ring->tx_desc_ring =
+ (struct tx_desc *) pci_alloc_consistent(adapter->pdev, desc_size,
+ &tx_ring->tx_desc_ring_pa);
+ if (!adapter->tx_ring.tx_desc_ring) {
+ dev_err(&adapter->pdev->dev,
+ "Cannot alloc memory for Tx Ring\n");
return -ENOMEM;
}
@@ -146,35 +145,15 @@ int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter)
* are ever returned, make sure the high part is retrieved here before
* storing the adjusted address.
*/
- tx_ring->pTxDescRingAdjustedPa = tx_ring->pTxDescRingPa;
-
- /* Align Tx Descriptor Ring on a 4k (0x1000) byte boundary */
- et131x_align_allocated_memory(adapter,
- &tx_ring->pTxDescRingAdjustedPa,
- &tx_ring->TxDescOffset, 0x0FFF);
-
- tx_ring->pTxDescRingVa += tx_ring->TxDescOffset;
-
/* Allocate memory for the Tx status block */
- tx_ring->pTxStatusVa = pci_alloc_consistent(adapter->pdev,
- sizeof(TX_STATUS_BLOCK_t),
- &tx_ring->pTxStatusPa);
- if (!adapter->TxRing.pTxStatusPa) {
+ tx_ring->tx_status = pci_alloc_consistent(adapter->pdev,
+ sizeof(u32),
+ &tx_ring->tx_status_pa);
+ if (!adapter->tx_ring.tx_status_pa) {
dev_err(&adapter->pdev->dev,
"Cannot alloc memory for Tx status block\n");
return -ENOMEM;
}
-
- /* Allocate memory for a dummy buffer */
- tx_ring->pTxDummyBlkVa = pci_alloc_consistent(adapter->pdev,
- NIC_MIN_PACKET_SIZE,
- &tx_ring->pTxDummyBlkPa);
- if (!adapter->TxRing.pTxDummyBlkPa) {
- dev_err(&adapter->pdev->dev,
- "Cannot alloc memory for Tx dummy buffer\n");
- return -ENOMEM;
- }
-
return 0;
}
@@ -188,76 +167,59 @@ void et131x_tx_dma_memory_free(struct et131x_adapter *adapter)
{
int desc_size = 0;
- if (adapter->TxRing.pTxDescRingVa) {
+ if (adapter->tx_ring.tx_desc_ring) {
/* Free memory relating to Tx rings here */
- adapter->TxRing.pTxDescRingVa -= adapter->TxRing.TxDescOffset;
-
- desc_size =
- (sizeof(TX_DESC_ENTRY_t) * NUM_DESC_PER_RING_TX) + 4096 - 1;
-
+ desc_size = (sizeof(struct tx_desc) * NUM_DESC_PER_RING_TX)
+ + 4096 - 1;
pci_free_consistent(adapter->pdev,
desc_size,
- adapter->TxRing.pTxDescRingVa,
- adapter->TxRing.pTxDescRingPa);
-
- adapter->TxRing.pTxDescRingVa = NULL;
+ adapter->tx_ring.tx_desc_ring,
+ adapter->tx_ring.tx_desc_ring_pa);
+ adapter->tx_ring.tx_desc_ring = NULL;
}
/* Free memory for the Tx status block */
- if (adapter->TxRing.pTxStatusVa) {
- pci_free_consistent(adapter->pdev,
- sizeof(TX_STATUS_BLOCK_t),
- adapter->TxRing.pTxStatusVa,
- adapter->TxRing.pTxStatusPa);
-
- adapter->TxRing.pTxStatusVa = NULL;
- }
-
- /* Free memory for the dummy buffer */
- if (adapter->TxRing.pTxDummyBlkVa) {
+ if (adapter->tx_ring.tx_status) {
pci_free_consistent(adapter->pdev,
- NIC_MIN_PACKET_SIZE,
- adapter->TxRing.pTxDummyBlkVa,
- adapter->TxRing.pTxDummyBlkPa);
+ sizeof(u32),
+ adapter->tx_ring.tx_status,
+ adapter->tx_ring.tx_status_pa);
- adapter->TxRing.pTxDummyBlkVa = NULL;
+ adapter->tx_ring.tx_status = NULL;
}
-
- /* Free the memory for MP_TCB structures */
- kfree(adapter->TxRing.MpTcbMem);
+ /* Free the memory for the tcb structures */
+ kfree(adapter->tx_ring.tcb_ring);
}
/**
* ConfigTxDmaRegs - Set up the tx dma section of the JAGCore.
* @etdev: pointer to our private adapter structure
+ *
+ * Configure the transmit engine with the ring buffers we have created
+ * and prepare it for use.
*/
void ConfigTxDmaRegs(struct et131x_adapter *etdev)
{
struct _TXDMA_t __iomem *txdma = &etdev->regs->txdma;
/* Load the hardware with the start of the transmit descriptor ring. */
- writel((uint32_t) (etdev->TxRing.pTxDescRingAdjustedPa >> 32),
+ writel((u32) ((u64)etdev->tx_ring.tx_desc_ring_pa >> 32),
&txdma->pr_base_hi);
- writel((uint32_t) etdev->TxRing.pTxDescRingAdjustedPa,
+ writel((u32) etdev->tx_ring.tx_desc_ring_pa,
&txdma->pr_base_lo);
/* Initialise the transmit DMA engine */
writel(NUM_DESC_PER_RING_TX - 1, &txdma->pr_num_des.value);
- /* Load the completion writeback physical address
- *
- * NOTE: pci_alloc_consistent(), used above to alloc DMA regions,
- * ALWAYS returns SAC (32-bit) addresses. If DAC (64-bit) addresses
- * are ever returned, make sure the high part is retrieved here before
- * storing the adjusted address.
- */
- writel(0, &txdma->dma_wb_base_hi);
- writel(etdev->TxRing.pTxStatusPa, &txdma->dma_wb_base_lo);
+ /* Load the completion writeback physical address */
+ writel((u32)((u64)etdev->tx_ring.tx_status_pa >> 32),
+ &txdma->dma_wb_base_hi);
+ writel((u32)etdev->tx_ring.tx_status_pa, &txdma->dma_wb_base_lo);
- memset(etdev->TxRing.pTxStatusVa, 0, sizeof(TX_STATUS_BLOCK_t));
+ *etdev->tx_ring.tx_status = 0;
writel(0, &txdma->service_request);
- etdev->TxRing.txDmaReadyToSend = 0;
+ etdev->tx_ring.send_idx = 0;
}
/**
@@ -279,16 +241,11 @@ void et131x_tx_dma_disable(struct et131x_adapter *etdev)
*/
void et131x_tx_dma_enable(struct et131x_adapter *etdev)
{
- u32 csr = ET_TXDMA_SNGL_EPKT;
- if (etdev->RegistryPhyLoopbk)
- /* TxDMA is disabled for loopback operation. */
- csr |= ET_TXDMA_CSR_HALT;
- else
- /* Setup the transmit dma configuration register for normal
- * operation
- */
- csr |= PARM_DMA_CACHE_DEF << ET_TXDMA_CACHE_SHIFT;
- writel(csr, &etdev->regs->txdma.csr);
+ /* Setup the transmit dma configuration register for normal
+ * operation
+ */
+ writel(ET_TXDMA_SNGL_EPKT|(PARM_DMA_CACHE_DEF << ET_TXDMA_CACHE_SHIFT),
+ &etdev->regs->txdma.csr);
}
/**
@@ -297,39 +254,32 @@ void et131x_tx_dma_enable(struct et131x_adapter *etdev)
*/
void et131x_init_send(struct et131x_adapter *adapter)
{
- PMP_TCB pMpTcb;
- uint32_t TcbCount;
- TX_RING_t *tx_ring;
+ struct tcb *tcb;
+ u32 ct;
+ struct tx_ring *tx_ring;
/* Setup some convenience pointers */
- tx_ring = &adapter->TxRing;
- pMpTcb = adapter->TxRing.MpTcbMem;
+ tx_ring = &adapter->tx_ring;
+ tcb = adapter->tx_ring.tcb_ring;
- tx_ring->TCBReadyQueueHead = pMpTcb;
+ tx_ring->tcb_qhead = tcb;
- /* Go through and set up each TCB */
- for (TcbCount = 0; TcbCount < NUM_TCB; TcbCount++) {
- memset(pMpTcb, 0, sizeof(MP_TCB));
+ memset(tcb, 0, sizeof(struct tcb) * NUM_TCB);
+ /* Go through and set up each TCB */
+ for (ct = 0; ct++ < NUM_TCB; tcb++)
/* Set the link pointer in HW TCB to the next TCB in the
- * chain. If this is the last TCB in the chain, also set the
- * tail pointer.
+ * chain
*/
- if (TcbCount < NUM_TCB - 1) {
- pMpTcb->Next = pMpTcb + 1;
- } else {
- tx_ring->TCBReadyQueueTail = pMpTcb;
- pMpTcb->Next = (PMP_TCB) NULL;
- }
-
- pMpTcb++;
- }
+ tcb->next = tcb + 1;
+ /* Set the tail pointer */
+ tcb--;
+ tx_ring->tcb_qtail = tcb;
+ tcb->next = NULL;
/* Curr send queue should now be empty */
- tx_ring->CurrSendHead = (PMP_TCB) NULL;
- tx_ring->CurrSendTail = (PMP_TCB) NULL;
-
- INIT_LIST_HEAD(&adapter->TxRing.SendWaitQueue);
+ tx_ring->send_head = NULL;
+ tx_ring->send_tail = NULL;
}
/**
@@ -352,9 +302,8 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
* to Tx, so the PacketCount and it's array used makes no sense here
*/
- /* Queue is not empty or TCB is not available */
- if (!list_empty(&etdev->TxRing.SendWaitQueue) ||
- MP_TCB_RESOURCES_NOT_AVAILABLE(etdev)) {
+ /* TCB is not available */
+ if (etdev->tx_ring.used >= NUM_TCB) {
/* NOTE: If there's an error on send, no need to queue the
* packet under Linux; if we just send an error up to the
* netif layer, it will resend the skb to us.
@@ -364,27 +313,15 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
/* We need to see if the link is up; if it's not, make the
* netif layer think we're good and drop the packet
*/
- /*
- * if( MP_SHOULD_FAIL_SEND( etdev ) ||
- * etdev->DriverNoPhyAccess )
- */
- if (MP_SHOULD_FAIL_SEND(etdev) || etdev->DriverNoPhyAccess
- || !netif_carrier_ok(netdev)) {
+ if ((etdev->Flags & fMP_ADAPTER_FAIL_SEND_MASK) ||
+ !netif_carrier_ok(netdev)) {
dev_kfree_skb_any(skb);
skb = NULL;
etdev->net_stats.tx_dropped++;
} else {
status = et131x_send_packet(skb, etdev);
-
- if (status == -ENOMEM) {
-
- /* NOTE: If there's an error on send, no need
- * to queue the packet under Linux; if we just
- * send an error up to the netif layer, it
- * will resend the skb to us.
- */
- } else if (status != 0) {
+ if (status != 0 && status != -ENOMEM) {
/* On any other error, make netif think we're
* OK and drop the packet
*/
@@ -409,87 +346,83 @@ int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev)
static int et131x_send_packet(struct sk_buff *skb,
struct et131x_adapter *etdev)
{
- int status = 0;
- PMP_TCB pMpTcb = NULL;
- uint16_t *shbufva;
+ int status;
+ struct tcb *tcb = NULL;
+ u16 *shbufva;
unsigned long flags;
/* All packets must have at least a MAC address and a protocol type */
- if (skb->len < ETH_HLEN) {
+ if (skb->len < ETH_HLEN)
return -EIO;
- }
/* Get a TCB for this packet */
spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
- pMpTcb = etdev->TxRing.TCBReadyQueueHead;
+ tcb = etdev->tx_ring.tcb_qhead;
- if (pMpTcb == NULL) {
+ if (tcb == NULL) {
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
return -ENOMEM;
}
- etdev->TxRing.TCBReadyQueueHead = pMpTcb->Next;
+ etdev->tx_ring.tcb_qhead = tcb->next;
- if (etdev->TxRing.TCBReadyQueueHead == NULL)
- etdev->TxRing.TCBReadyQueueTail = NULL;
+ if (etdev->tx_ring.tcb_qhead == NULL)
+ etdev->tx_ring.tcb_qtail = NULL;
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
- pMpTcb->PacketLength = skb->len;
- pMpTcb->Packet = skb;
+ tcb->skb = skb;
- if ((skb->data != NULL) && ((skb->len - skb->data_len) >= 6)) {
- shbufva = (uint16_t *) skb->data;
+ if (skb->data != NULL && skb->len - skb->data_len >= 6) {
+ shbufva = (u16 *) skb->data;
if ((shbufva[0] == 0xffff) &&
(shbufva[1] == 0xffff) && (shbufva[2] == 0xffff)) {
- pMpTcb->Flags |= fMP_DEST_BROAD;
+ tcb->flags |= fMP_DEST_BROAD;
} else if ((shbufva[0] & 0x3) == 0x0001) {
- pMpTcb->Flags |= fMP_DEST_MULTI;
+ tcb->flags |= fMP_DEST_MULTI;
}
}
- pMpTcb->Next = NULL;
+ tcb->next = NULL;
/* Call the NIC specific send handler. */
- if (status == 0)
- status = nic_send_packet(etdev, pMpTcb);
+ status = nic_send_packet(etdev, tcb);
if (status != 0) {
spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
- if (etdev->TxRing.TCBReadyQueueTail) {
- etdev->TxRing.TCBReadyQueueTail->Next = pMpTcb;
- } else {
+ if (etdev->tx_ring.tcb_qtail)
+ etdev->tx_ring.tcb_qtail->next = tcb;
+ else
/* Apparently ready Q is empty. */
- etdev->TxRing.TCBReadyQueueHead = pMpTcb;
- }
+ etdev->tx_ring.tcb_qhead = tcb;
- etdev->TxRing.TCBReadyQueueTail = pMpTcb;
+ etdev->tx_ring.tcb_qtail = tcb;
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
return status;
}
- WARN_ON(etdev->TxRing.nBusySend > NUM_TCB);
+ WARN_ON(etdev->tx_ring.used > NUM_TCB);
return 0;
}
/**
* nic_send_packet - NIC specific send handler for version B silicon.
* @etdev: pointer to our adapter
- * @pMpTcb: pointer to MP_TCB
+ * @tcb: pointer to struct tcb
*
* Returns 0 or errno.
*/
-static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
+static int nic_send_packet(struct et131x_adapter *etdev, struct tcb *tcb)
{
- uint32_t loopIndex;
- TX_DESC_ENTRY_t CurDesc[24];
- uint32_t FragmentNumber = 0;
- uint32_t thiscopy, remainder;
- struct sk_buff *pPacket = pMpTcb->Packet;
- uint32_t FragListCount = skb_shinfo(pPacket)->nr_frags + 1;
- struct skb_frag_struct *pFragList = &skb_shinfo(pPacket)->frags[0];
+ u32 i;
+ struct tx_desc desc[24]; /* 24 x 16 byte */
+ u32 frag = 0;
+ u32 thiscopy, remainder;
+ struct sk_buff *skb = tcb->skb;
+ u32 nr_frags = skb_shinfo(skb)->nr_frags + 1;
+ struct skb_frag_struct *frags = &skb_shinfo(skb)->frags[0];
unsigned long flags;
/* Part of the optimizations of this send routine restrict us to
@@ -500,17 +433,16 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
* number of fragments. If needed, we can call this function,
* although it is less efficient.
*/
- if (FragListCount > 23) {
+ if (nr_frags > 23)
return -EIO;
- }
- memset(CurDesc, 0, sizeof(TX_DESC_ENTRY_t) * (FragListCount + 1));
+ memset(desc, 0, sizeof(struct tx_desc) * (nr_frags + 1));
- for (loopIndex = 0; loopIndex < FragListCount; loopIndex++) {
+ for (i = 0; i < nr_frags; i++) {
/* If there is something in this element, lets get a
* descriptor from the ring and get the necessary data
*/
- if (loopIndex == 0) {
+ if (i == 0) {
/* If the fragments are smaller than a standard MTU,
* then map them to a single descriptor in the Tx
* Desc ring. However, if they're larger, as is
@@ -520,166 +452,164 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
* This will work until we determine why the hardware
* doesn't seem to like large fragments.
*/
- if ((pPacket->len - pPacket->data_len) <= 1514) {
- CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
- CurDesc[FragmentNumber].word2.bits.
- length_in_bytes =
- pPacket->len - pPacket->data_len;
+ if ((skb->len - skb->data_len) <= 1514) {
+ desc[frag].addr_hi = 0;
+ /* Low 16bits are length, high is vlan and
+ unused currently so zero */
+ desc[frag].len_vlan =
+ skb->len - skb->data_len;
/* NOTE: Here, the dma_addr_t returned from
* pci_map_single() is implicitly cast as a
- * uint32_t. Although dma_addr_t can be
+ * u32. Although dma_addr_t can be
* 64-bit, the address returned by
* pci_map_single() is always 32-bit
* addressable (as defined by the pci/dma
* subsystem)
*/
- CurDesc[FragmentNumber++].DataBufferPtrLow =
+ desc[frag++].addr_lo =
pci_map_single(etdev->pdev,
- pPacket->data,
- pPacket->len -
- pPacket->data_len,
+ skb->data,
+ skb->len -
+ skb->data_len,
PCI_DMA_TODEVICE);
} else {
- CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
- CurDesc[FragmentNumber].word2.bits.
- length_in_bytes =
- ((pPacket->len - pPacket->data_len) / 2);
+ desc[frag].addr_hi = 0;
+ desc[frag].len_vlan =
+ (skb->len - skb->data_len) / 2;
/* NOTE: Here, the dma_addr_t returned from
* pci_map_single() is implicitly cast as a
- * uint32_t. Although dma_addr_t can be
+ * u32. Although dma_addr_t can be
* 64-bit, the address returned by
* pci_map_single() is always 32-bit
* addressable (as defined by the pci/dma
* subsystem)
*/
- CurDesc[FragmentNumber++].DataBufferPtrLow =
+ desc[frag++].addr_lo =
pci_map_single(etdev->pdev,
- pPacket->data,
- ((pPacket->len -
- pPacket->data_len) / 2),
+ skb->data,
+ ((skb->len -
+ skb->data_len) / 2),
PCI_DMA_TODEVICE);
- CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
+ desc[frag].addr_hi = 0;
- CurDesc[FragmentNumber].word2.bits.
- length_in_bytes =
- ((pPacket->len - pPacket->data_len) / 2);
+ desc[frag].len_vlan =
+ (skb->len - skb->data_len) / 2;
/* NOTE: Here, the dma_addr_t returned from
* pci_map_single() is implicitly cast as a
- * uint32_t. Although dma_addr_t can be
+ * u32. Although dma_addr_t can be
* 64-bit, the address returned by
* pci_map_single() is always 32-bit
* addressable (as defined by the pci/dma
* subsystem)
*/
- CurDesc[FragmentNumber++].DataBufferPtrLow =
+ desc[frag++].addr_lo =
pci_map_single(etdev->pdev,
- pPacket->data +
- ((pPacket->len -
- pPacket->data_len) / 2),
- ((pPacket->len -
- pPacket->data_len) / 2),
+ skb->data +
+ ((skb->len -
+ skb->data_len) / 2),
+ ((skb->len -
+ skb->data_len) / 2),
PCI_DMA_TODEVICE);
}
} else {
- CurDesc[FragmentNumber].DataBufferPtrHigh = 0;
- CurDesc[FragmentNumber].word2.bits.length_in_bytes =
- pFragList[loopIndex - 1].size;
+ desc[frag].addr_hi = 0;
+ desc[frag].len_vlan =
+ frags[i - 1].size;
/* NOTE: Here, the dma_addr_t returned from
- * pci_map_page() is implicitly cast as a uint32_t.
+ * pci_map_page() is implicitly cast as a u32.
* Although dma_addr_t can be 64-bit, the address
* returned by pci_map_page() is always 32-bit
* addressable (as defined by the pci/dma subsystem)
*/
- CurDesc[FragmentNumber++].DataBufferPtrLow =
+ desc[frag++].addr_lo =
pci_map_page(etdev->pdev,
- pFragList[loopIndex - 1].page,
- pFragList[loopIndex - 1].page_offset,
- pFragList[loopIndex - 1].size,
+ frags[i - 1].page,
+ frags[i - 1].page_offset,
+ frags[i - 1].size,
PCI_DMA_TODEVICE);
}
}
- if (FragmentNumber == 0)
+ if (frag == 0)
return -EIO;
if (etdev->linkspeed == TRUEPHY_SPEED_1000MBPS) {
- if (++etdev->TxRing.TxPacketsSinceLastinterrupt ==
- PARM_TX_NUM_BUFS_DEF) {
- CurDesc[FragmentNumber - 1].word3.value = 0x5;
- etdev->TxRing.TxPacketsSinceLastinterrupt = 0;
- } else {
- CurDesc[FragmentNumber - 1].word3.value = 0x1;
+ if (++etdev->tx_ring.since_irq == PARM_TX_NUM_BUFS_DEF) {
+ /* Last element & Interrupt flag */
+ desc[frag - 1].flags = 0x5;
+ etdev->tx_ring.since_irq = 0;
+ } else { /* Last element */
+ desc[frag - 1].flags = 0x1;
}
- } else {
- CurDesc[FragmentNumber - 1].word3.value = 0x5;
- }
+ } else
+ desc[frag - 1].flags = 0x5;
- CurDesc[0].word3.bits.f = 1;
+ desc[0].flags |= 2; /* First element flag */
- pMpTcb->WrIndexStart = etdev->TxRing.txDmaReadyToSend;
- pMpTcb->PacketStaleCount = 0;
+ tcb->index_start = etdev->tx_ring.send_idx;
+ tcb->stale = 0;
spin_lock_irqsave(&etdev->SendHWLock, flags);
thiscopy = NUM_DESC_PER_RING_TX -
- INDEX10(etdev->TxRing.txDmaReadyToSend);
+ INDEX10(etdev->tx_ring.send_idx);
- if (thiscopy >= FragmentNumber) {
+ if (thiscopy >= frag) {
remainder = 0;
- thiscopy = FragmentNumber;
+ thiscopy = frag;
} else {
- remainder = FragmentNumber - thiscopy;
+ remainder = frag - thiscopy;
}
- memcpy(etdev->TxRing.pTxDescRingVa +
- INDEX10(etdev->TxRing.txDmaReadyToSend), CurDesc,
- sizeof(TX_DESC_ENTRY_t) * thiscopy);
+ memcpy(etdev->tx_ring.tx_desc_ring +
+ INDEX10(etdev->tx_ring.send_idx), desc,
+ sizeof(struct tx_desc) * thiscopy);
- add_10bit(&etdev->TxRing.txDmaReadyToSend, thiscopy);
+ add_10bit(&etdev->tx_ring.send_idx, thiscopy);
- if (INDEX10(etdev->TxRing.txDmaReadyToSend)== 0 ||
- INDEX10(etdev->TxRing.txDmaReadyToSend) == NUM_DESC_PER_RING_TX) {
- etdev->TxRing.txDmaReadyToSend &= ~ET_DMA10_MASK;
- etdev->TxRing.txDmaReadyToSend ^= ET_DMA10_WRAP;
+ if (INDEX10(etdev->tx_ring.send_idx) == 0 ||
+ INDEX10(etdev->tx_ring.send_idx) == NUM_DESC_PER_RING_TX) {
+ etdev->tx_ring.send_idx &= ~ET_DMA10_MASK;
+ etdev->tx_ring.send_idx ^= ET_DMA10_WRAP;
}
if (remainder) {
- memcpy(etdev->TxRing.pTxDescRingVa,
- CurDesc + thiscopy,
- sizeof(TX_DESC_ENTRY_t) * remainder);
+ memcpy(etdev->tx_ring.tx_desc_ring,
+ desc + thiscopy,
+ sizeof(struct tx_desc) * remainder);
- add_10bit(&etdev->TxRing.txDmaReadyToSend, remainder);
+ add_10bit(&etdev->tx_ring.send_idx, remainder);
}
- if (INDEX10(etdev->TxRing.txDmaReadyToSend) == 0) {
- if (etdev->TxRing.txDmaReadyToSend)
- pMpTcb->WrIndex = NUM_DESC_PER_RING_TX - 1;
+ if (INDEX10(etdev->tx_ring.send_idx) == 0) {
+ if (etdev->tx_ring.send_idx)
+ tcb->index = NUM_DESC_PER_RING_TX - 1;
else
- pMpTcb->WrIndex= ET_DMA10_WRAP | (NUM_DESC_PER_RING_TX - 1);
+ tcb->index = ET_DMA10_WRAP|(NUM_DESC_PER_RING_TX - 1);
} else
- pMpTcb->WrIndex = etdev->TxRing.txDmaReadyToSend - 1;
+ tcb->index = etdev->tx_ring.send_idx - 1;
spin_lock(&etdev->TCBSendQLock);
- if (etdev->TxRing.CurrSendTail)
- etdev->TxRing.CurrSendTail->Next = pMpTcb;
+ if (etdev->tx_ring.send_tail)
+ etdev->tx_ring.send_tail->next = tcb;
else
- etdev->TxRing.CurrSendHead = pMpTcb;
+ etdev->tx_ring.send_head = tcb;
- etdev->TxRing.CurrSendTail = pMpTcb;
+ etdev->tx_ring.send_tail = tcb;
- WARN_ON(pMpTcb->Next != NULL);
+ WARN_ON(tcb->next != NULL);
- etdev->TxRing.nBusySend++;
+ etdev->tx_ring.used++;
spin_unlock(&etdev->TCBSendQLock);
/* Write the new write pointer back to the device. */
- writel(etdev->TxRing.txDmaReadyToSend,
+ writel(etdev->tx_ring.send_idx,
&etdev->regs->txdma.service_request);
/* For Gig only, we use Tx Interrupt coalescing. Enable the software
@@ -696,72 +626,71 @@ static int nic_send_packet(struct et131x_adapter *etdev, PMP_TCB pMpTcb)
/**
- * et131x_free_send_packet - Recycle a MP_TCB, complete the packet if necessary
+ * et131x_free_send_packet - Recycle a struct tcb
* @etdev: pointer to our adapter
- * @pMpTcb: pointer to MP_TCB
+ * @tcb: pointer to struct tcb
*
+ * Complete the packet if necessary
* Assumption - Send spinlock has been acquired
*/
inline void et131x_free_send_packet(struct et131x_adapter *etdev,
- PMP_TCB pMpTcb)
+ struct tcb *tcb)
{
unsigned long flags;
- TX_DESC_ENTRY_t *desc = NULL;
+ struct tx_desc *desc = NULL;
struct net_device_stats *stats = &etdev->net_stats;
- if (pMpTcb->Flags & fMP_DEST_BROAD)
+ if (tcb->flags & fMP_DEST_BROAD)
atomic_inc(&etdev->Stats.brdcstxmt);
- else if (pMpTcb->Flags & fMP_DEST_MULTI)
+ else if (tcb->flags & fMP_DEST_MULTI)
atomic_inc(&etdev->Stats.multixmt);
else
atomic_inc(&etdev->Stats.unixmt);
- if (pMpTcb->Packet) {
- stats->tx_bytes += pMpTcb->Packet->len;
+ if (tcb->skb) {
+ stats->tx_bytes += tcb->skb->len;
/* Iterate through the TX descriptors on the ring
* corresponding to this packet and umap the fragments
* they point to
*/
do {
- desc =
- (TX_DESC_ENTRY_t *) (etdev->TxRing.pTxDescRingVa +
- INDEX10(pMpTcb->WrIndexStart));
+ desc = (struct tx_desc *)(etdev->tx_ring.tx_desc_ring +
+ INDEX10(tcb->index_start));
pci_unmap_single(etdev->pdev,
- desc->DataBufferPtrLow,
- desc->word2.value, PCI_DMA_TODEVICE);
-
- add_10bit(&pMpTcb->WrIndexStart, 1);
- if (INDEX10(pMpTcb->WrIndexStart) >=
- NUM_DESC_PER_RING_TX) {
- pMpTcb->WrIndexStart &= ~ET_DMA10_MASK;
- pMpTcb->WrIndexStart ^= ET_DMA10_WRAP;
+ desc->addr_lo,
+ desc->len_vlan, PCI_DMA_TODEVICE);
+
+ add_10bit(&tcb->index_start, 1);
+ if (INDEX10(tcb->index_start) >=
+ NUM_DESC_PER_RING_TX) {
+ tcb->index_start &= ~ET_DMA10_MASK;
+ tcb->index_start ^= ET_DMA10_WRAP;
}
- } while (desc != (etdev->TxRing.pTxDescRingVa +
- INDEX10(pMpTcb->WrIndex)));
+ } while (desc != (etdev->tx_ring.tx_desc_ring +
+ INDEX10(tcb->index)));
- dev_kfree_skb_any(pMpTcb->Packet);
+ dev_kfree_skb_any(tcb->skb);
}
- memset(pMpTcb, 0, sizeof(MP_TCB));
+ memset(tcb, 0, sizeof(struct tcb));
/* Add the TCB to the Ready Q */
spin_lock_irqsave(&etdev->TCBReadyQLock, flags);
etdev->Stats.opackets++;
- if (etdev->TxRing.TCBReadyQueueTail) {
- etdev->TxRing.TCBReadyQueueTail->Next = pMpTcb;
- } else {
+ if (etdev->tx_ring.tcb_qtail)
+ etdev->tx_ring.tcb_qtail->next = tcb;
+ else
/* Apparently ready Q is empty. */
- etdev->TxRing.TCBReadyQueueHead = pMpTcb;
- }
+ etdev->tx_ring.tcb_qhead = tcb;
- etdev->TxRing.TCBReadyQueueTail = pMpTcb;
+ etdev->tx_ring.tcb_qtail = tcb;
spin_unlock_irqrestore(&etdev->TCBReadyQLock, flags);
- WARN_ON(etdev->TxRing.nBusySend < 0);
+ WARN_ON(etdev->tx_ring.used < 0);
}
/**
@@ -772,52 +701,40 @@ inline void et131x_free_send_packet(struct et131x_adapter *etdev,
*/
void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
{
- PMP_TCB pMpTcb;
- struct list_head *entry;
+ struct tcb *tcb;
unsigned long flags;
- uint32_t FreeCounter = 0;
-
- while (!list_empty(&etdev->TxRing.SendWaitQueue)) {
- spin_lock_irqsave(&etdev->SendWaitLock, flags);
-
- etdev->TxRing.nWaitSend--;
- spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
-
- entry = etdev->TxRing.SendWaitQueue.next;
- }
-
- etdev->TxRing.nWaitSend = 0;
+ u32 freed = 0;
/* Any packets being sent? Check the first TCB on the send list */
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
- while ((pMpTcb != NULL) && (FreeCounter < NUM_TCB)) {
- PMP_TCB pNext = pMpTcb->Next;
+ while (tcb != NULL && freed < NUM_TCB) {
+ struct tcb *next = tcb->next;
- etdev->TxRing.CurrSendHead = pNext;
+ etdev->tx_ring.send_head = next;
- if (pNext == NULL)
- etdev->TxRing.CurrSendTail = NULL;
+ if (next == NULL)
+ etdev->tx_ring.send_tail = NULL;
- etdev->TxRing.nBusySend--;
+ etdev->tx_ring.used--;
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
- FreeCounter++;
- et131x_free_send_packet(etdev, pMpTcb);
+ freed++;
+ et131x_free_send_packet(etdev, tcb);
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
}
- WARN_ON(FreeCounter == NUM_TCB);
+ WARN_ON(freed == NUM_TCB);
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
- etdev->TxRing.nBusySend = 0;
+ etdev->tx_ring.used = 0;
}
/**
@@ -831,99 +748,56 @@ void et131x_free_busy_send_packets(struct et131x_adapter *etdev)
*/
void et131x_handle_send_interrupt(struct et131x_adapter *etdev)
{
- /* Mark as completed any packets which have been sent by the device. */
- et131x_update_tcb_list(etdev);
-
- /* If we queued any transmits because we didn't have any TCBs earlier,
- * dequeue and send those packets now, as long as we have free TCBs.
- */
- et131x_check_send_wait_list(etdev);
-}
-
-/**
- * et131x_update_tcb_list - Helper routine for Send Interrupt handler
- * @etdev: pointer to our adapter
- *
- * Re-claims the send resources and completes sends. Can also be called as
- * part of the NIC send routine when the "ServiceComplete" indication has
- * wrapped.
- */
-static void et131x_update_tcb_list(struct et131x_adapter *etdev)
-{
unsigned long flags;
- u32 ServiceComplete;
- PMP_TCB pMpTcb;
+ u32 serviced;
+ struct tcb *tcb;
u32 index;
- ServiceComplete = readl(&etdev->regs->txdma.NewServiceComplete);
- index = INDEX10(ServiceComplete);
+ serviced = readl(&etdev->regs->txdma.NewServiceComplete);
+ index = INDEX10(serviced);
/* Has the ring wrapped? Process any descriptors that do not have
* the same "wrap" indicator as the current completion indicator
*/
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
- while (pMpTcb &&
- ((ServiceComplete ^ pMpTcb->WrIndex) & ET_DMA10_WRAP) &&
- index < INDEX10(pMpTcb->WrIndex)) {
- etdev->TxRing.nBusySend--;
- etdev->TxRing.CurrSendHead = pMpTcb->Next;
- if (pMpTcb->Next == NULL)
- etdev->TxRing.CurrSendTail = NULL;
+ while (tcb &&
+ ((serviced ^ tcb->index) & ET_DMA10_WRAP) &&
+ index < INDEX10(tcb->index)) {
+ etdev->tx_ring.used--;
+ etdev->tx_ring.send_head = tcb->next;
+ if (tcb->next == NULL)
+ etdev->tx_ring.send_tail = NULL;
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
- et131x_free_send_packet(etdev, pMpTcb);
+ et131x_free_send_packet(etdev, tcb);
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
/* Goto the next packet */
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
}
- while (pMpTcb &&
- !((ServiceComplete ^ pMpTcb->WrIndex) & ET_DMA10_WRAP)
- && index > (pMpTcb->WrIndex & ET_DMA10_MASK)) {
- etdev->TxRing.nBusySend--;
- etdev->TxRing.CurrSendHead = pMpTcb->Next;
- if (pMpTcb->Next == NULL)
- etdev->TxRing.CurrSendTail = NULL;
+ while (tcb &&
+ !((serviced ^ tcb->index) & ET_DMA10_WRAP)
+ && index > (tcb->index & ET_DMA10_MASK)) {
+ etdev->tx_ring.used--;
+ etdev->tx_ring.send_head = tcb->next;
+ if (tcb->next == NULL)
+ etdev->tx_ring.send_tail = NULL;
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
- et131x_free_send_packet(etdev, pMpTcb);
+ et131x_free_send_packet(etdev, tcb);
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
/* Goto the next packet */
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
}
/* Wake up the queue when we hit a low-water mark */
- if (etdev->TxRing.nBusySend <= (NUM_TCB / 3))
+ if (etdev->tx_ring.used <= NUM_TCB / 3)
netif_wake_queue(etdev->netdev);
spin_unlock_irqrestore(&etdev->TCBSendQLock, flags);
}
-/**
- * et131x_check_send_wait_list - Helper routine for the interrupt handler
- * @etdev: pointer to our adapter
- *
- * Takes packets from the send wait queue and posts them to the device (if
- * room available).
- */
-static void et131x_check_send_wait_list(struct et131x_adapter *etdev)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&etdev->SendWaitLock, flags);
-
- while (!list_empty(&etdev->TxRing.SendWaitQueue) &&
- MP_TCB_RESOURCES_AVAILABLE(etdev)) {
- struct list_head *entry;
-
- entry = etdev->TxRing.SendWaitQueue.next;
-
- etdev->TxRing.nWaitSend--;
- }
-
- spin_unlock_irqrestore(&etdev->SendWaitLock, flags);
-}
diff --git a/drivers/staging/et131x/et1310_tx.h b/drivers/staging/et131x/et1310_tx.h
index ad0372121de0..4f0ea81978f5 100644
--- a/drivers/staging/et131x/et1310_tx.h
+++ b/drivers/staging/et131x/et1310_tx.h
@@ -63,167 +63,89 @@
/* Typedefs for Tx Descriptor Ring */
/*
- * TXDESC_WORD2_t structure holds part of the control bits in the Tx Descriptor
- * ring for the ET-1310
+ * word 2 of the control bits in the Tx Descriptor ring for the ET-1310
+ *
+ * 0-15: length of packet
+ * 16-27: VLAN tag
+ * 28: VLAN CFI
+ * 29-31: VLAN priority
+ *
+ * word 3 of the control bits in the Tx Descriptor ring for the ET-1310
+ *
+ * 0: last packet in the sequence
+ * 1: first packet in the sequence
+ * 2: interrupt the processor when this pkt sent
+ * 3: Control word - no packet data
+ * 4: Issue half-duplex backpressure : XON/XOFF
+ * 5: send pause frame
+ * 6: Tx frame has error
+ * 7: append CRC
+ * 8: MAC override
+ * 9: pad packet
+ * 10: Packet is a Huge packet
+ * 11: append VLAN tag
+ * 12: IP checksum assist
+ * 13: TCP checksum assist
+ * 14: UDP checksum assist
*/
-typedef union _txdesc_word2_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 vlan_prio:3; /* bits 29-31(VLAN priority) */
- u32 vlan_cfi:1; /* bit 28(cfi) */
- u32 vlan_tag:12; /* bits 16-27(VLAN tag) */
- u32 length_in_bytes:16; /* bits 0-15(packet length) */
-#else
- u32 length_in_bytes:16; /* bits 0-15(packet length) */
- u32 vlan_tag:12; /* bits 16-27(VLAN tag) */
- u32 vlan_cfi:1; /* bit 28(cfi) */
- u32 vlan_prio:3; /* bits 29-31(VLAN priority) */
-#endif /* _BIT_FIELDS_HTOL */
- } bits;
-} TXDESC_WORD2_t, *PTXDESC_WORD2_t;
-/*
- * TXDESC_WORD3_t structure holds part of the control bits in the Tx Descriptor
- * ring for the ET-1310
- */
-typedef union _txdesc_word3_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 unused:17; /* bits 15-31 */
- u32 udpa:1; /* bit 14(UDP checksum assist) */
- u32 tcpa:1; /* bit 13(TCP checksum assist) */
- u32 ipa:1; /* bit 12(IP checksum assist) */
- u32 vlan:1; /* bit 11(append VLAN tag) */
- u32 hp:1; /* bit 10(Packet is a Huge packet) */
- u32 pp:1; /* bit 9(pad packet) */
- u32 mac:1; /* bit 8(MAC override) */
- u32 crc:1; /* bit 7(append CRC) */
- u32 e:1; /* bit 6(Tx frame has error) */
- u32 pf:1; /* bit 5(send pause frame) */
- u32 bp:1; /* bit 4(Issue half-duplex backpressure (XON/XOFF) */
- u32 cw:1; /* bit 3(Control word - no packet data) */
- u32 ir:1; /* bit 2(interrupt the processor when this pkt sent) */
- u32 f:1; /* bit 1(first packet in the sequence) */
- u32 l:1; /* bit 0(last packet in the sequence) */
-#else
- u32 l:1; /* bit 0(last packet in the sequence) */
- u32 f:1; /* bit 1(first packet in the sequence) */
- u32 ir:1; /* bit 2(interrupt the processor when this pkt sent) */
- u32 cw:1; /* bit 3(Control word - no packet data) */
- u32 bp:1; /* bit 4(Issue half-duplex backpressure (XON/XOFF) */
- u32 pf:1; /* bit 5(send pause frame) */
- u32 e:1; /* bit 6(Tx frame has error) */
- u32 crc:1; /* bit 7(append CRC) */
- u32 mac:1; /* bit 8(MAC override) */
- u32 pp:1; /* bit 9(pad packet) */
- u32 hp:1; /* bit 10(Packet is a Huge packet) */
- u32 vlan:1; /* bit 11(append VLAN tag) */
- u32 ipa:1; /* bit 12(IP checksum assist) */
- u32 tcpa:1; /* bit 13(TCP checksum assist) */
- u32 udpa:1; /* bit 14(UDP checksum assist) */
- u32 unused:17; /* bits 15-31 */
-#endif /* _BIT_FIELDS_HTOL */
- } bits;
-} TXDESC_WORD3_t, *PTXDESC_WORD3_t;
-
-/* TX_DESC_ENTRY_t is sructure representing each descriptor on the ring */
-typedef struct _tx_desc_entry_t {
- u32 DataBufferPtrHigh;
- u32 DataBufferPtrLow;
- TXDESC_WORD2_t word2; /* control words how to xmit the */
- TXDESC_WORD3_t word3; /* data (detailed above) */
-} TX_DESC_ENTRY_t, *PTX_DESC_ENTRY_t;
-
-
-/* Typedefs for Tx DMA engine status writeback */
+/* struct tx_desc represents each descriptor on the ring */
+struct tx_desc {
+ u32 addr_hi;
+ u32 addr_lo;
+ u32 len_vlan; /* control words how to xmit the */
+ u32 flags; /* data (detailed above) */
+};
/*
- * TX_STATUS_BLOCK_t is sructure representing the status of the Tx DMA engine
- * it sits in free memory, and is pointed to by 0x101c / 0x1020
+ * The status of the Tx DMA engine it sits in free memory, and is pointed to
+ * by 0x101c / 0x1020. This is a DMA10 type
*/
-typedef union _tx_status_block_t {
- u32 value;
- struct {
-#ifdef _BIT_FIELDS_HTOL
- u32 unused:21; /* bits 11-31 */
- u32 serv_cpl_wrap:1; /* bit 10 */
- u32 serv_cpl:10; /* bits 0-9 */
-#else
- u32 serv_cpl:10; /* bits 0-9 */
- u32 serv_cpl_wrap:1; /* bit 10 */
- u32 unused:21; /* bits 11-31 */
-#endif
- } bits;
-} TX_STATUS_BLOCK_t, *PTX_STATUS_BLOCK_t;
-
-/* TCB (Transmit Control Block) */
-typedef struct _MP_TCB {
- struct _MP_TCB *Next;
- u32 Flags;
- u32 Count;
- u32 PacketStaleCount;
- struct sk_buff *Packet;
- u32 PacketLength;
- u32 WrIndex;
- u32 WrIndexStart;
-} MP_TCB, *PMP_TCB;
-
-/* Structure to hold the skb's in a list */
-typedef struct tx_skb_list_elem {
- struct list_head skb_list_elem;
- struct sk_buff *skb;
-} TX_SKB_LIST_ELEM, *PTX_SKB_LIST_ELEM;
-
-/* TX_RING_t is sructure representing our local reference(s) to the ring */
-typedef struct _tx_ring_t {
+
+/* TCB (Transmit Control Block: Host Side) */
+struct tcb {
+ struct tcb *next; /* Next entry in ring */
+ u32 flags; /* Our flags for the packet */
+ u32 count; /* Used to spot stuck/lost packets */
+ u32 stale; /* Used to spot stuck/lost packets */
+ struct sk_buff *skb; /* Network skb we are tied to */
+ u32 index; /* Ring indexes */
+ u32 index_start;
+};
+
+/* Structure representing our local reference(s) to the ring */
+struct tx_ring {
/* TCB (Transmit Control Block) memory and lists */
- PMP_TCB MpTcbMem;
+ struct tcb *tcb_ring;
/* List of TCBs that are ready to be used */
- PMP_TCB TCBReadyQueueHead;
- PMP_TCB TCBReadyQueueTail;
+ struct tcb *tcb_qhead;
+ struct tcb *tcb_qtail;
/* list of TCBs that are currently being sent. NOTE that access to all
- * three of these (including nBusySend) are controlled via the
+ * three of these (including used) are controlled via the
* TCBSendQLock. This lock should be secured prior to incementing /
- * decrementing nBusySend, or any queue manipulation on CurrSendHead /
- * Tail
+ * decrementing used, or any queue manipulation on send_head /
+ * tail
*/
- PMP_TCB CurrSendHead;
- PMP_TCB CurrSendTail;
- int32_t nBusySend;
-
- /* List of packets (not TCBs) that were queued for lack of resources */
- struct list_head SendWaitQueue;
- int32_t nWaitSend;
+ struct tcb *send_head;
+ struct tcb *send_tail;
+ int used;
/* The actual descriptor ring */
- PTX_DESC_ENTRY_t pTxDescRingVa;
- dma_addr_t pTxDescRingPa;
- uint64_t pTxDescRingAdjustedPa;
- uint64_t TxDescOffset;
+ struct tx_desc *tx_desc_ring;
+ dma_addr_t tx_desc_ring_pa;
- /* ReadyToSend indicates where we last wrote to in the descriptor ring. */
- u32 txDmaReadyToSend;
+ /* send_idx indicates where we last wrote to in the descriptor ring. */
+ u32 send_idx;
/* The location of the write-back status block */
- PTX_STATUS_BLOCK_t pTxStatusVa;
- dma_addr_t pTxStatusPa;
-
- /* A Block of zeroes used to pad packets that are less than 60 bytes */
- void *pTxDummyBlkVa;
- dma_addr_t pTxDummyBlkPa;
-
- TXMAC_ERR_t TxMacErr;
-
- /* Variables to track the Tx interrupt coalescing features */
- int32_t TxPacketsSinceLastinterrupt;
-} TX_RING_t, *PTX_RING_t;
+ u32 *tx_status;
+ dma_addr_t tx_status_pa;
-/* Forward declaration of the frag-list for the following prototypes */
-typedef struct _MP_FRAG_LIST MP_FRAG_LIST, *PMP_FRAG_LIST;
+ /* Packets since the last IRQ: used for interrupt coalescing */
+ int since_irq;
+};
/* Forward declaration of the private adapter structure */
struct et131x_adapter;
@@ -231,12 +153,12 @@ struct et131x_adapter;
/* PROTOTYPES for et1310_tx.c */
int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter);
void et131x_tx_dma_memory_free(struct et131x_adapter *adapter);
-void ConfigTxDmaRegs(struct et131x_adapter *pAdapter);
+void ConfigTxDmaRegs(struct et131x_adapter *adapter);
void et131x_init_send(struct et131x_adapter *adapter);
-void et131x_tx_dma_disable(struct et131x_adapter *pAdapter);
-void et131x_tx_dma_enable(struct et131x_adapter *pAdapter);
-void et131x_handle_send_interrupt(struct et131x_adapter *pAdapter);
-void et131x_free_busy_send_packets(struct et131x_adapter *pAdapter);
+void et131x_tx_dma_disable(struct et131x_adapter *adapter);
+void et131x_tx_dma_enable(struct et131x_adapter *adapter);
+void et131x_handle_send_interrupt(struct et131x_adapter *adapter);
+void et131x_free_busy_send_packets(struct et131x_adapter *adapter);
int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev);
#endif /* __ET1310_TX_H__ */
diff --git a/drivers/staging/et131x/et131x_adapter.h b/drivers/staging/et131x/et131x_adapter.h
index 1dfe06f1b1a7..cc5a6ba55dcf 100644
--- a/drivers/staging/et131x/et131x_adapter.h
+++ b/drivers/staging/et131x/et131x_adapter.h
@@ -100,12 +100,6 @@
#define LO_MARK_PERCENT_FOR_PSR 15
#define LO_MARK_PERCENT_FOR_RX 15
-/* Macros specific to the private adapter structure */
-#define MP_TCB_RESOURCES_AVAILABLE(_M) ((_M)->TxRing.nBusySend < NUM_TCB)
-#define MP_TCB_RESOURCES_NOT_AVAILABLE(_M) ((_M)->TxRing.nBusySend >= NUM_TCB)
-
-#define MP_SHOULD_FAIL_SEND(_M) ((_M)->Flags & fMP_ADAPTER_FAIL_SEND_MASK)
-
/* Counters for error rate monitoring */
typedef struct _MP_ERR_COUNTERS {
u32 PktCountTxPackets;
@@ -203,7 +197,6 @@ struct et131x_adapter {
spinlock_t TCBSendQLock;
spinlock_t TCBReadyQLock;
spinlock_t SendHWLock;
- spinlock_t SendWaitLock;
spinlock_t RcvLock;
spinlock_t RcvPendLock;
@@ -234,9 +227,6 @@ struct et131x_adapter {
u32 RegistryRxMemEnd; /* Size of internal rx memory */
u32 RegistryJumboPacket; /* Max supported ethernet packet size */
- /* Validation helpers */
- u8 RegistryNMIDisable;
- u8 RegistryPhyLoopbk; /* Enable Phy loopback */
/* Derived from the registry: */
u8 AiForceDpx; /* duplex setting */
@@ -248,7 +238,6 @@ struct et131x_adapter {
NETIF_STATUS_MEDIA_DISCONNECT,
NETIF_STATUS_MAX
} MediaState;
- u8 DriverNoPhyAccess;
/* Minimize init-time */
struct timer_list ErrorTimer;
@@ -259,7 +248,7 @@ struct et131x_adapter {
MI_BMSR_t Bmsr;
/* Tx Memory Variables */
- TX_RING_t TxRing;
+ struct tx_ring tx_ring;
/* Rx Memory Variables */
RX_RING_t RxRing;
diff --git a/drivers/staging/et131x/et131x_defs.h b/drivers/staging/et131x/et131x_defs.h
index f98dca5fd26b..d81fc77a501f 100644
--- a/drivers/staging/et131x/et131x_defs.h
+++ b/drivers/staging/et131x/et131x_defs.h
@@ -102,7 +102,6 @@
/* Some offsets in PCI config space that are actually used. */
#define ET1310_PCI_MAX_PYLD 0x4C
-#define ET1310_NMI_DISABLE 0x61
#define ET1310_PCI_MAC_ADDRESS 0xA4
#define ET1310_PCI_EEPROM_STATUS 0xB2
#define ET1310_PCI_ACK_NACK 0xC0
diff --git a/drivers/staging/et131x/et131x_initpci.c b/drivers/staging/et131x/et131x_initpci.c
index 9db205667262..0892b6a538db 100644
--- a/drivers/staging/et131x/et131x_initpci.c
+++ b/drivers/staging/et131x/et131x_initpci.c
@@ -106,17 +106,6 @@
#define PARM_SPEED_DUPLEX_MIN 0
#define PARM_SPEED_DUPLEX_MAX 5
-/* Module parameter for disabling NMI
- * et131x_nmi_disable :
- * Disable NMI (0-2) [0]
- * 0 :
- * 1 :
- * 2 :
- */
-static u32 et131x_nmi_disable; /* 0-2 */
-module_param(et131x_nmi_disable, uint, 0);
-MODULE_PARM_DESC(et131x_nmi_disable, "Disable NMI (0-2) [0]");
-
/* Module parameter for manual speed setting
* Set Link speed and dublex manually (0-5) [0]
* 1 : 10Mb Half-Duplex
@@ -132,128 +121,88 @@ MODULE_PARM_DESC(et131x_speed_set,
"Set Link speed and dublex manually (0-5) [0] \n 1 : 10Mb Half-Duplex \n 2 : 10Mb Full-Duplex \n 3 : 100Mb Half-Duplex \n 4 : 100Mb Full-Duplex \n 5 : 1000Mb Full-Duplex \n 0 : Auto Speed Auto Dublex");
/**
- * et131x_find_adapter - Find the adapter and get all the assigned resources
+ * et131x_hwaddr_init - set up the MAC Address on the ET1310
* @adapter: pointer to our private adapter structure
- *
- * Returns 0 on success, errno on failure (as defined in errno.h)
*/
-int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
+void et131x_hwaddr_init(struct et131x_adapter *adapter)
{
- int result;
- uint8_t eepromStat;
- uint8_t maxPayload = 0;
- uint8_t read_size_reg;
- u8 rev;
-
- /* Allow disabling of Non-Maskable Interrupts in I/O space, to
- * support validation.
+ /* If have our default mac from init and no mac address from
+ * EEPROM then we need to generate the last octet and set it on the
+ * device
*/
- if (adapter->RegistryNMIDisable) {
- uint8_t RegisterVal;
-
- RegisterVal = inb(ET1310_NMI_DISABLE);
- RegisterVal &= 0xf3;
-
- if (adapter->RegistryNMIDisable == 2)
- RegisterVal |= 0xc;
-
- outb(ET1310_NMI_DISABLE, RegisterVal);
+ if (adapter->PermanentAddress[0] == 0x00 &&
+ adapter->PermanentAddress[1] == 0x00 &&
+ adapter->PermanentAddress[2] == 0x00 &&
+ adapter->PermanentAddress[3] == 0x00 &&
+ adapter->PermanentAddress[4] == 0x00 &&
+ adapter->PermanentAddress[5] == 0x00) {
+ /*
+ * We need to randomly generate the last octet so we
+ * decrease our chances of setting the mac address to
+ * same as another one of our cards in the system
+ */
+ get_random_bytes(&adapter->CurrentAddress[5], 1);
+ /*
+ * We have the default value in the register we are
+ * working with so we need to copy the current
+ * address into the permanent address
+ */
+ memcpy(adapter->PermanentAddress,
+ adapter->CurrentAddress, ETH_ALEN);
+ } else {
+ /* We do not have an override address, so set the
+ * current address to the permanent address and add
+ * it to the device
+ */
+ memcpy(adapter->CurrentAddress,
+ adapter->PermanentAddress, ETH_ALEN);
}
+}
- /* We first need to check the EEPROM Status code located at offset
- * 0xB2 of config space
- */
- result = pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS,
- &eepromStat);
-
- /* THIS IS A WORKAROUND:
- * I need to call this function twice to get my card in a
- * LG M1 Express Dual running. I tried also a msleep before this
- * function, because I thougth there could be some time condidions
- * but it didn't work. Call the whole function twice also work.
- */
- result = pci_read_config_byte(pdev, ET1310_PCI_EEPROM_STATUS,
- &eepromStat);
- if (result != PCIBIOS_SUCCESSFUL) {
- dev_err(&pdev->dev, "Could not read PCI config space for "
- "EEPROM Status\n");
- return -EIO;
- }
- /* Determine if the error(s) we care about are present. If they are
- * present, we need to fail.
- */
- if (eepromStat & 0x4C) {
- result = pci_read_config_byte(pdev, PCI_REVISION_ID, &rev);
- if (result != PCIBIOS_SUCCESSFUL) {
- dev_err(&pdev->dev,
- "Could not read PCI config space for "
- "Revision ID\n");
- return -EIO;
- } else if (rev == 0x01) {
- int32_t nLoop;
- uint8_t temp[4] = { 0xFE, 0x13, 0x10, 0xFF };
-
- /* Re-write the first 4 bytes if we have an eeprom
- * present and the revision id is 1, this fixes the
- * corruption seen with 1310 B Silicon
- */
- for (nLoop = 0; nLoop < 3; nLoop++) {
- EepromWriteByte(adapter, nLoop, temp[nLoop]);
- }
- }
+/**
+ * et131x_pci_init - initial PCI setup
+ * @adapter: pointer to our private adapter structure
+ * @pdev: our PCI device
+ *
+ * Perform the initial setup of PCI registers and if possible initialise
+ * the MAC address. At this point the I/O registers have yet to be mapped
+ */
- dev_err(&pdev->dev, "Fatal EEPROM Status Error - 0x%04x\n", eepromStat);
+static int et131x_pci_init(struct et131x_adapter *adapter,
+ struct pci_dev *pdev)
+{
+ int i;
+ u8 max_payload;
+ u8 read_size_reg;
- /* This error could mean that there was an error reading the
- * eeprom or that the eeprom doesn't exist. We will treat
- * each case the same and not try to gather additional
- * information that normally would come from the eeprom, like
- * MAC Address
- */
- adapter->has_eeprom = 0;
+ if (et131x_init_eeprom(adapter) < 0)
return -EIO;
- } else
- adapter->has_eeprom = 1;
-
- /* Read the EEPROM for information regarding LED behavior. Refer to
- * ET1310_phy.c, et131x_xcvr_init(), for its use.
- */
- EepromReadByte(adapter, 0x70, &adapter->eepromData[0]);
- EepromReadByte(adapter, 0x71, &adapter->eepromData[1]);
-
- if (adapter->eepromData[0] != 0xcd)
- /* Disable all optional features */
- adapter->eepromData[1] = 0x00;
/* Let's set up the PORT LOGIC Register. First we need to know what
* the max_payload_size is
*/
- result = pci_read_config_byte(pdev, ET1310_PCI_MAX_PYLD, &maxPayload);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_read_config_byte(pdev, ET1310_PCI_MAX_PYLD, &max_payload)) {
dev_err(&pdev->dev,
"Could not read PCI config space for Max Payload Size\n");
return -EIO;
}
/* Program the Ack/Nak latency and replay timers */
- maxPayload &= 0x07; /* Only the lower 3 bits are valid */
+ max_payload &= 0x07; /* Only the lower 3 bits are valid */
- if (maxPayload < 2) {
- const uint16_t AckNak[2] = { 0x76, 0xD0 };
- const uint16_t Replay[2] = { 0x1E0, 0x2ED };
+ if (max_payload < 2) {
+ static const u16 AckNak[2] = { 0x76, 0xD0 };
+ static const u16 Replay[2] = { 0x1E0, 0x2ED };
- result = pci_write_config_word(pdev, ET1310_PCI_ACK_NACK,
- AckNak[maxPayload]);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_write_config_word(pdev, ET1310_PCI_ACK_NACK,
+ AckNak[max_payload])) {
dev_err(&pdev->dev,
"Could not write PCI config space for ACK/NAK\n");
return -EIO;
}
-
- result = pci_write_config_word(pdev, ET1310_PCI_REPLAY,
- Replay[maxPayload]);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_write_config_word(pdev, ET1310_PCI_REPLAY,
+ Replay[max_payload])) {
dev_err(&pdev->dev,
"Could not write PCI config space for Replay Timer\n");
return -EIO;
@@ -263,16 +212,14 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
/* l0s and l1 latency timers. We are using default values.
* Representing 001 for L0s and 010 for L1
*/
- result = pci_write_config_byte(pdev, ET1310_PCI_L0L1LATENCY, 0x11);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_write_config_byte(pdev, ET1310_PCI_L0L1LATENCY, 0x11)) {
dev_err(&pdev->dev,
"Could not write PCI config space for Latency Timers\n");
return -EIO;
}
/* Change the max read size to 2k */
- result = pci_read_config_byte(pdev, 0x51, &read_size_reg);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_read_config_byte(pdev, 0x51, &read_size_reg)) {
dev_err(&pdev->dev,
"Could not read PCI config space for Max read size\n");
return -EIO;
@@ -281,8 +228,7 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
read_size_reg &= 0x8f;
read_size_reg |= 0x40;
- result = pci_write_config_byte(pdev, 0x51, read_size_reg);
- if (result != PCIBIOS_SUCCESSFUL) {
+ if (pci_write_config_byte(pdev, 0x51, read_size_reg)) {
dev_err(&pdev->dev,
"Could not write PCI config space for Max read size\n");
return -EIO;
@@ -291,19 +237,19 @@ int et131x_find_adapter(struct et131x_adapter *adapter, struct pci_dev *pdev)
/* Get MAC address from config space if an eeprom exists, otherwise
* the MAC address there will not be valid
*/
- if (adapter->has_eeprom) {
- int i;
-
- for (i = 0; i < ETH_ALEN; i++) {
- result = pci_read_config_byte(
- pdev, ET1310_PCI_MAC_ADDRESS + i,
- adapter->PermanentAddress + i);
- if (result != PCIBIOS_SUCCESSFUL) {
- dev_err(&pdev->dev, ";Could not read PCI config space for MAC address\n");
- return -EIO;
- }
+ if (!adapter->has_eeprom) {
+ et131x_hwaddr_init(adapter);
+ return 0;
+ }
+
+ for (i = 0; i < ETH_ALEN; i++) {
+ if (pci_read_config_byte(pdev, ET1310_PCI_MAC_ADDRESS + i,
+ adapter->PermanentAddress + i)) {
+ dev_err(&pdev->dev, "Could not read PCI config space for MAC address\n");
+ return -EIO;
}
}
+ memcpy(adapter->CurrentAddress, adapter->PermanentAddress, ETH_ALEN);
return 0;
}
@@ -383,52 +329,34 @@ void ConfigGlobalRegs(struct et131x_adapter *etdev)
{
struct _GLOBAL_t __iomem *regs = &etdev->regs->global;
- if (etdev->RegistryPhyLoopbk == false) {
- if (etdev->RegistryJumboPacket < 2048) {
- /* Tx / RxDMA and Tx/Rx MAC interfaces have a 1k word
- * block of RAM that the driver can split between Tx
- * and Rx as it desires. Our default is to split it
- * 50/50:
- */
- writel(0, &regs->rxq_start_addr);
- writel(PARM_RX_MEM_END_DEF, &regs->rxq_end_addr);
- writel(PARM_RX_MEM_END_DEF + 1, &regs->txq_start_addr);
- writel(INTERNAL_MEM_SIZE - 1, &regs->txq_end_addr);
- } else if (etdev->RegistryJumboPacket < 8192) {
- /* For jumbo packets > 2k but < 8k, split 50-50. */
- writel(0, &regs->rxq_start_addr);
- writel(INTERNAL_MEM_RX_OFFSET, &regs->rxq_end_addr);
- writel(INTERNAL_MEM_RX_OFFSET + 1, &regs->txq_start_addr);
- writel(INTERNAL_MEM_SIZE - 1, &regs->txq_end_addr);
- } else {
- /* 9216 is the only packet size greater than 8k that
- * is available. The Tx buffer has to be big enough
- * for one whole packet on the Tx side. We'll make
- * the Tx 9408, and give the rest to Rx
- */
- writel(0x0000, &regs->rxq_start_addr);
- writel(0x01b3, &regs->rxq_end_addr);
- writel(0x01b4, &regs->txq_start_addr);
- writel(INTERNAL_MEM_SIZE - 1,&regs->txq_end_addr);
- }
+ writel(0, &regs->rxq_start_addr);
+ writel(INTERNAL_MEM_SIZE - 1, &regs->txq_end_addr);
- /* Initialize the loopback register. Disable all loopbacks. */
- writel(0, &regs->loopback);
+ if (etdev->RegistryJumboPacket < 2048) {
+ /* Tx / RxDMA and Tx/Rx MAC interfaces have a 1k word
+ * block of RAM that the driver can split between Tx
+ * and Rx as it desires. Our default is to split it
+ * 50/50:
+ */
+ writel(PARM_RX_MEM_END_DEF, &regs->rxq_end_addr);
+ writel(PARM_RX_MEM_END_DEF + 1, &regs->txq_start_addr);
+ } else if (etdev->RegistryJumboPacket < 8192) {
+ /* For jumbo packets > 2k but < 8k, split 50-50. */
+ writel(INTERNAL_MEM_RX_OFFSET, &regs->rxq_end_addr);
+ writel(INTERNAL_MEM_RX_OFFSET + 1, &regs->txq_start_addr);
} else {
- /* For PHY Line loopback, the memory is configured as if Tx
- * and Rx both have all the memory. This is because the
- * RxMAC will write data into the space, and the TxMAC will
- * read it out.
+ /* 9216 is the only packet size greater than 8k that
+ * is available. The Tx buffer has to be big enough
+ * for one whole packet on the Tx side. We'll make
+ * the Tx 9408, and give the rest to Rx
*/
- writel(0, &regs->rxq_start_addr);
- writel(INTERNAL_MEM_SIZE - 1, &regs->rxq_end_addr);
- writel(0, &regs->txq_start_addr);
- writel(INTERNAL_MEM_SIZE - 1, &regs->txq_end_addr);
-
- /* Initialize the loopback register (MAC loopback). */
- writel(ET_LOOP_MAC, &regs->loopback);
+ writel(0x01b3, &regs->rxq_end_addr);
+ writel(0x01b4, &regs->txq_start_addr);
}
+ /* Initialize the loopback register. Disable all loopbacks. */
+ writel(0, &regs->loopback);
+
/* MSI Register */
writel(0, &regs->msi_config);
@@ -498,57 +426,18 @@ int et131x_adapter_setup(struct et131x_adapter *etdev)
}
/**
- * et131x_setup_hardware_properties - set up the MAC Address on the ET1310
- * @adapter: pointer to our private adapter structure
- */
-void et131x_setup_hardware_properties(struct et131x_adapter *adapter)
-{
- /* If have our default mac from registry and no mac address from
- * EEPROM then we need to generate the last octet and set it on the
- * device
- */
- if (adapter->PermanentAddress[0] == 0x00 &&
- adapter->PermanentAddress[1] == 0x00 &&
- adapter->PermanentAddress[2] == 0x00 &&
- adapter->PermanentAddress[3] == 0x00 &&
- adapter->PermanentAddress[4] == 0x00 &&
- adapter->PermanentAddress[5] == 0x00) {
- /*
- * We need to randomly generate the last octet so we
- * decrease our chances of setting the mac address to
- * same as another one of our cards in the system
- */
- get_random_bytes(&adapter->CurrentAddress[5], 1);
- /*
- * We have the default value in the register we are
- * working with so we need to copy the current
- * address into the permanent address
- */
- memcpy(adapter->PermanentAddress,
- adapter->CurrentAddress, ETH_ALEN);
- } else {
- /* We do not have an override address, so set the
- * current address to the permanent address and add
- * it to the device
- */
- memcpy(adapter->CurrentAddress,
- adapter->PermanentAddress, ETH_ALEN);
- }
-}
-
-/**
* et131x_soft_reset - Issue a soft reset to the hardware, complete for ET1310
* @adapter: pointer to our private adapter structure
*/
void et131x_soft_reset(struct et131x_adapter *adapter)
{
/* Disable MAC Core */
- writel(0xc00f0000, &adapter->regs->mac.cfg1.value);
+ writel(0xc00f0000, &adapter->regs->mac.cfg1);
/* Set everything to a reset value */
writel(0x7F, &adapter->regs->global.sw_reset);
- writel(0x000f0000, &adapter->regs->mac.cfg1.value);
- writel(0x00000000, &adapter->regs->mac.cfg1.value);
+ writel(0x000f0000, &adapter->regs->mac.cfg1);
+ writel(0x00000000, &adapter->regs->mac.cfg1);
}
/**
@@ -588,36 +477,32 @@ void et131x_align_allocated_memory(struct et131x_adapter *adapter,
*/
int et131x_adapter_memory_alloc(struct et131x_adapter *adapter)
{
- int status = 0;
-
- do {
- /* Allocate memory for the Tx Ring */
- status = et131x_tx_dma_memory_alloc(adapter);
- if (status != 0) {
- dev_err(&adapter->pdev->dev,
- "et131x_tx_dma_memory_alloc FAILED\n");
- break;
- }
+ int status;
- /* Receive buffer memory allocation */
- status = et131x_rx_dma_memory_alloc(adapter);
- if (status != 0) {
- dev_err(&adapter->pdev->dev,
- "et131x_rx_dma_memory_alloc FAILED\n");
- et131x_tx_dma_memory_free(adapter);
- break;
- }
+ /* Allocate memory for the Tx Ring */
+ status = et131x_tx_dma_memory_alloc(adapter);
+ if (status != 0) {
+ dev_err(&adapter->pdev->dev,
+ "et131x_tx_dma_memory_alloc FAILED\n");
+ return status;
+ }
+ /* Receive buffer memory allocation */
+ status = et131x_rx_dma_memory_alloc(adapter);
+ if (status != 0) {
+ dev_err(&adapter->pdev->dev,
+ "et131x_rx_dma_memory_alloc FAILED\n");
+ et131x_tx_dma_memory_free(adapter);
+ return status;
+ }
- /* Init receive data structures */
- status = et131x_init_recv(adapter);
- if (status != 0) {
- dev_err(&adapter->pdev->dev,
- "et131x_init_recv FAILED\n");
- et131x_tx_dma_memory_free(adapter);
- et131x_rx_dma_memory_free(adapter);
- break;
- }
- } while (0);
+ /* Init receive data structures */
+ status = et131x_init_recv(adapter);
+ if (status != 0) {
+ dev_err(&adapter->pdev->dev,
+ "et131x_init_recv FAILED\n");
+ et131x_tx_dma_memory_free(adapter);
+ et131x_rx_dma_memory_free(adapter);
+ }
return status;
}
@@ -632,22 +517,50 @@ void et131x_adapter_memory_free(struct et131x_adapter *adapter)
et131x_rx_dma_memory_free(adapter);
}
+
+
/**
- * et131x_config_parse
+ * et131x_adapter_init
* @etdev: pointer to the private adapter struct
+ * @pdev: pointer to the PCI device
*
- * Parses a configuration from some location (module parameters, for example)
- * into the private adapter struct. This really has no sensible analogy in
- * Linux as sysfs parameters are dynamic. Several things that were hee could
- * go into sysfs, but other stuff like speed handling is part of the mii
- * interfaces/ethtool.
+ * Initialize the data structures for the et131x_adapter object and link
+ * them together with the platform provided device structures.
*/
-void et131x_config_parse(struct et131x_adapter *etdev)
+
+
+static struct et131x_adapter *et131x_adapter_init(struct net_device *netdev,
+ struct pci_dev *pdev)
{
static const u8 default_mac[] = { 0x00, 0x05, 0x3d, 0x00, 0x02, 0x00 };
static const u8 duplex[] = { 0, 1, 2, 1, 2, 2 };
static const u16 speed[] = { 0, 10, 10, 100, 100, 1000 };
+ struct et131x_adapter *etdev;
+
+ /* Setup the fundamental net_device and private adapter structure elements */
+ SET_NETDEV_DEV(netdev, &pdev->dev);
+
+ /* Allocate private adapter struct and copy in relevant information */
+ etdev = netdev_priv(netdev);
+ etdev->pdev = pci_dev_get(pdev);
+ etdev->netdev = netdev;
+
+ /* Do the same for the netdev struct */
+ netdev->irq = pdev->irq;
+ netdev->base_addr = pci_resource_start(pdev, 0);
+
+ /* Initialize spinlocks here */
+ spin_lock_init(&etdev->Lock);
+ spin_lock_init(&etdev->TCBSendQLock);
+ spin_lock_init(&etdev->TCBReadyQLock);
+ spin_lock_init(&etdev->SendHWLock);
+ spin_lock_init(&etdev->RcvLock);
+ spin_lock_init(&etdev->RcvPendLock);
+ spin_lock_init(&etdev->FbrLock);
+ spin_lock_init(&etdev->PHYLock);
+
+ /* Parse configuration parameters into the private adapter struct */
if (et131x_speed_set)
dev_info(&etdev->pdev->dev,
"Speed set manually to : %d \n", et131x_speed_set);
@@ -655,8 +568,6 @@ void et131x_config_parse(struct et131x_adapter *etdev)
etdev->SpeedDuplex = et131x_speed_set;
etdev->RegistryJumboPacket = 1514; /* 1514-9216 */
- etdev->RegistryNMIDisable = et131x_nmi_disable;
-
/* Set the MAC address to a default */
memcpy(etdev->CurrentAddress, default_mac, ETH_ALEN);
@@ -674,40 +585,10 @@ void et131x_config_parse(struct et131x_adapter *etdev)
etdev->AiForceSpeed = speed[etdev->SpeedDuplex];
etdev->AiForceDpx = duplex[etdev->SpeedDuplex]; /* Auto FDX */
-}
-
-
-/**
- * et131x_pci_remove
- * @pdev: a pointer to the device's pci_dev structure
- *
- * Registered in the pci_driver structure, this function is called when the
- * PCI subsystem detects that a PCI device which matches the information
- * contained in the pci_device_id table has been removed.
- */
-
-void __devexit et131x_pci_remove(struct pci_dev *pdev)
-{
- struct net_device *netdev;
- struct et131x_adapter *adapter;
- /* Retrieve the net_device pointer from the pci_dev struct, as well
- * as the private adapter struct
- */
- netdev = (struct net_device *) pci_get_drvdata(pdev);
- adapter = netdev_priv(netdev);
-
- /* Perform device cleanup */
- unregister_netdev(netdev);
- et131x_adapter_memory_free(adapter);
- iounmap(adapter->regs);
- pci_dev_put(adapter->pdev);
- free_netdev(netdev);
- pci_release_regions(pdev);
- pci_disable_device(pdev);
+ return etdev;
}
-
/**
* et131x_pci_setup - Perform device initialization
* @pdev: a pointer to the device's pci_dev structure
@@ -721,34 +602,31 @@ void __devexit et131x_pci_remove(struct pci_dev *pdev)
* a device insertion routine.
*/
-int __devinit et131x_pci_setup(struct pci_dev *pdev,
+static int __devinit et131x_pci_setup(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
- int result = 0;
+ int result = -EBUSY;
int pm_cap;
bool pci_using_dac;
- struct net_device *netdev = NULL;
- struct et131x_adapter *adapter = NULL;
+ struct net_device *netdev;
+ struct et131x_adapter *adapter;
/* Enable the device via the PCI subsystem */
- result = pci_enable_device(pdev);
- if (result != 0) {
- dev_err(&adapter->pdev->dev,
+ if (pci_enable_device(pdev) != 0) {
+ dev_err(&pdev->dev,
"pci_enable_device() failed\n");
- goto out;
+ return -EIO;
}
/* Perform some basic PCI checks */
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
- dev_err(&adapter->pdev->dev,
+ dev_err(&pdev->dev,
"Can't find PCI device's base address\n");
- result = -ENODEV;
- goto out;
+ goto err_disable;
}
- result = pci_request_regions(pdev, DRIVER_NAME);
- if (result != 0) {
- dev_err(&adapter->pdev->dev,
+ if (pci_request_regions(pdev, DRIVER_NAME)) {
+ dev_err(&pdev->dev,
"Can't get PCI resources\n");
goto err_disable;
}
@@ -763,27 +641,26 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev,
*/
pm_cap = pci_find_capability(pdev, PCI_CAP_ID_PM);
if (pm_cap == 0) {
- dev_err(&adapter->pdev->dev,
+ dev_err(&pdev->dev,
"Cannot find Power Management capabilities\n");
result = -EIO;
goto err_release_res;
}
/* Check the DMA addressing support of this device */
- if (!pci_set_dma_mask(pdev, 0xffffffffffffffffULL)) {
+ if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(64))) {
pci_using_dac = true;
- result =
- pci_set_consistent_dma_mask(pdev, 0xffffffffffffffffULL);
+ result = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
if (result != 0) {
dev_err(&pdev->dev,
"Unable to obtain 64 bit DMA for consistent allocations\n");
goto err_release_res;
}
- } else if (!pci_set_dma_mask(pdev, 0xffffffffULL)) {
+ } else if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
pci_using_dac = false;
} else {
- dev_err(&adapter->pdev->dev,
+ dev_err(&pdev->dev,
"No usable DMA addressing method\n");
result = -EIO;
goto err_release_res;
@@ -792,87 +669,22 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev,
/* Allocate netdev and private adapter structs */
netdev = et131x_device_alloc();
if (netdev == NULL) {
- dev_err(&adapter->pdev->dev,
- "Couldn't alloc netdev struct\n");
+ dev_err(&pdev->dev, "Couldn't alloc netdev struct\n");
result = -ENOMEM;
goto err_release_res;
}
-
- /* Setup the fundamental net_device and private adapter structure elements */
- SET_NETDEV_DEV(netdev, &pdev->dev);
- /*
- if (pci_using_dac) {
- netdev->features |= NETIF_F_HIGHDMA;
- }
- */
-
- /*
- * NOTE - Turn this on when we're ready to deal with SG-DMA
- *
- * NOTE: According to "Linux Device Drivers", 3rd ed, Rubini et al,
- * if checksumming is not performed in HW, then the kernel will not
- * use SG.
- * From pp 510-511:
- *
- * "Note that the kernel does not perform scatter/gather I/O to your
- * device if it does not also provide some form of checksumming as
- * well. The reason is that, if the kernel has to make a pass over a
- * fragmented ("nonlinear") packet to calculate the checksum, it
- * might as well copy the data and coalesce the packet at the same
- * time."
- *
- * This has been verified by setting the flags below and still not
- * receiving a scattered buffer from the network stack, so leave it
- * off until checksums are calculated in HW.
- */
- /* netdev->features |= NETIF_F_SG; */
- /* netdev->features |= NETIF_F_NO_CSUM; */
- /* netdev->features |= NETIF_F_LLTX; */
-
- /* Allocate private adapter struct and copy in relevant information */
- adapter = netdev_priv(netdev);
- adapter->pdev = pci_dev_get(pdev);
- adapter->netdev = netdev;
-
- /* Do the same for the netdev struct */
- netdev->irq = pdev->irq;
- netdev->base_addr = pdev->resource[0].start;
-
- /* Initialize spinlocks here */
- spin_lock_init(&adapter->Lock);
- spin_lock_init(&adapter->TCBSendQLock);
- spin_lock_init(&adapter->TCBReadyQLock);
- spin_lock_init(&adapter->SendHWLock);
- spin_lock_init(&adapter->SendWaitLock);
- spin_lock_init(&adapter->RcvLock);
- spin_lock_init(&adapter->RcvPendLock);
- spin_lock_init(&adapter->FbrLock);
- spin_lock_init(&adapter->PHYLock);
-
- /* Parse configuration parameters into the private adapter struct */
- et131x_config_parse(adapter);
-
- /* Find the physical adapter
- *
- * NOTE: This is the equivalent of the MpFindAdapter() routine; can we
- * lump it's init with the device specific init below into a
- * single init function?
- */
- /* while (et131x_find_adapter(adapter, pdev) != 0); */
- et131x_find_adapter(adapter, pdev);
+ adapter = et131x_adapter_init(netdev, pdev);
+ /* Initialise the PCI setup for the device */
+ et131x_pci_init(adapter, pdev);
/* Map the bus-relative registers to system virtual memory */
-
- adapter->regs = ioremap_nocache(pci_resource_start(pdev, 0),
- pci_resource_len(pdev, 0));
+ adapter->regs = pci_ioremap_bar(pdev, 0);
if (adapter->regs == NULL) {
dev_err(&pdev->dev, "Cannot map device registers\n");
result = -ENOMEM;
goto err_free_dev;
}
- /* Perform device-specific initialization here (See code below) */
-
/* If Phy COMA mode was enabled when we went down, disable it here. */
writel(ET_PMCSR_INIT, &adapter->regs->global.pm_csr);
@@ -892,20 +704,12 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev,
/* Init send data structures */
et131x_init_send(adapter);
- /* Register the interrupt
- *
- * NOTE - This is being done in the open routine, where most other
- * Linux drivers setup IRQ handlers. Make sure device
- * interrupts are not turned on before the IRQ is registered!!
- *
- * What we will do here is setup the task structure for the
- * ISR's deferred handler
+ /*
+ * Set up the task structure for the ISR's deferred handler
*/
INIT_WORK(&adapter->task, et131x_isr_handler);
- /* Determine MAC Address, and copy into the net_device struct */
- et131x_setup_hardware_properties(adapter);
-
+ /* Copy address into the net_device struct */
memcpy(netdev->dev_addr, adapter->CurrentAddress, ETH_ALEN);
/* Setup et1310 as per the documentation */
@@ -944,10 +748,7 @@ int __devinit et131x_pci_setup(struct pci_dev *pdev,
* been initialized, just in case it needs to be quickly restored.
*/
pci_set_drvdata(pdev, netdev);
-
pci_save_state(adapter->pdev);
-
-out:
return result;
err_mem_free:
@@ -961,7 +762,37 @@ err_release_res:
pci_release_regions(pdev);
err_disable:
pci_disable_device(pdev);
- goto out;
+ return result;
+}
+
+/**
+ * et131x_pci_remove
+ * @pdev: a pointer to the device's pci_dev structure
+ *
+ * Registered in the pci_driver structure, this function is called when the
+ * PCI subsystem detects that a PCI device which matches the information
+ * contained in the pci_device_id table has been removed.
+ */
+
+static void __devexit et131x_pci_remove(struct pci_dev *pdev)
+{
+ struct net_device *netdev;
+ struct et131x_adapter *adapter;
+
+ /* Retrieve the net_device pointer from the pci_dev struct, as well
+ * as the private adapter struct
+ */
+ netdev = (struct net_device *) pci_get_drvdata(pdev);
+ adapter = netdev_priv(netdev);
+
+ /* Perform device cleanup */
+ unregister_netdev(netdev);
+ et131x_adapter_memory_free(adapter);
+ iounmap(adapter->regs);
+ pci_dev_put(adapter->pdev);
+ free_netdev(netdev);
+ pci_release_regions(pdev);
+ pci_disable_device(pdev);
}
static struct pci_device_id et131x_pci_table[] __devinitdata = {
@@ -989,7 +820,7 @@ static struct pci_driver et131x_driver = {
*
* Returns 0 on success, errno on failure (as defined in errno.h)
*/
-static int et131x_init_module(void)
+static int __init et131x_init_module(void)
{
if (et131x_speed_set < PARM_SPEED_DUPLEX_MIN ||
et131x_speed_set > PARM_SPEED_DUPLEX_MAX) {
@@ -1002,7 +833,7 @@ static int et131x_init_module(void)
/**
* et131x_cleanup_module - The entry point called on driver cleanup
*/
-static void et131x_cleanup_module(void)
+static void __exit et131x_cleanup_module(void)
{
pci_unregister_driver(&et131x_driver);
}
@@ -1010,7 +841,6 @@ static void et131x_cleanup_module(void)
module_init(et131x_init_module);
module_exit(et131x_cleanup_module);
-
/* Modinfo parameters (filled out using defines from et131x_version.h) */
MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_INFO);
diff --git a/drivers/staging/et131x/et131x_initpci.h b/drivers/staging/et131x/et131x_initpci.h
index 8131d6a65c2a..7269569a874b 100644
--- a/drivers/staging/et131x/et131x_initpci.h
+++ b/drivers/staging/et131x/et131x_initpci.h
@@ -67,7 +67,7 @@ void et131x_align_allocated_memory(struct et131x_adapter *adapter,
int et131x_adapter_setup(struct et131x_adapter *adapter);
int et131x_adapter_memory_alloc(struct et131x_adapter *adapter);
void et131x_adapter_memory_free(struct et131x_adapter *adapter);
-void et131x_setup_hardware_properties(struct et131x_adapter *adapter);
+void et131x_hwaddr_init(struct et131x_adapter *adapter);
void et131x_soft_reset(struct et131x_adapter *adapter);
#endif /* __ET131X_INITPCI_H__ */
diff --git a/drivers/staging/et131x/et131x_isr.c b/drivers/staging/et131x/et131x_isr.c
index f80189d7cb6d..ccd9bc22e185 100644
--- a/drivers/staging/et131x/et131x_isr.c
+++ b/drivers/staging/et131x/et131x_isr.c
@@ -109,9 +109,6 @@ void et131x_enable_interrupts(struct et131x_adapter *adapter)
else
mask = INT_MASK_ENABLE_NO_FLOW;
- if (adapter->DriverNoPhyAccess)
- mask |= ET_INTR_PHY;
-
adapter->CachedMaskValue = mask;
writel(mask, &adapter->regs->global.int_mask);
}
@@ -182,15 +179,15 @@ irqreturn_t et131x_isr(int irq, void *dev_id)
/* This is our interrupt, so process accordingly */
if (status & ET_INTR_WATCHDOG) {
- PMP_TCB pMpTcb = adapter->TxRing.CurrSendHead;
+ struct tcb *tcb = adapter->tx_ring.send_head;
- if (pMpTcb)
- if (++pMpTcb->PacketStaleCount > 1)
+ if (tcb)
+ if (++tcb->stale > 1)
status |= ET_INTR_TXDMA_ISR;
if (adapter->RxRing.UnfinishedReceives)
status |= ET_INTR_RXDMA_XFR_DONE;
- else if (pMpTcb == NULL)
+ else if (tcb == NULL)
writel(0, &adapter->regs->global.watchdog_timer);
status &= ~ET_INTR_WATCHDOG;
@@ -400,8 +397,7 @@ void et131x_isr_handler(struct work_struct *work)
/* Let's move on to the TxMac */
if (status & ET_INTR_TXMAC) {
- etdev->TxRing.TxMacErr.value =
- readl(&iomem->txmac.err.value);
+ u32 err = readl(&iomem->txmac.err.value);
/*
* When any of the errors occur and TXMAC generates
@@ -415,7 +411,7 @@ void et131x_isr_handler(struct work_struct *work)
*/
dev_warn(&etdev->pdev->dev,
"TXMAC interrupt, error 0x%08x\n",
- etdev->TxRing.TxMacErr.value);
+ err);
/* If we are debugging, we want to see this error,
* otherwise we just want the device to be reset and
diff --git a/drivers/staging/et131x/et131x_netdev.c b/drivers/staging/et131x/et131x_netdev.c
index 8c7612f63f91..24d97b4fa6fb 100644
--- a/drivers/staging/et131x/et131x_netdev.c
+++ b/drivers/staging/et131x/et131x_netdev.c
@@ -519,7 +519,7 @@ int et131x_tx(struct sk_buff *skb, struct net_device *netdev)
void et131x_tx_timeout(struct net_device *netdev)
{
struct et131x_adapter *etdev = netdev_priv(netdev);
- PMP_TCB pMpTcb;
+ struct tcb *tcb;
unsigned long flags;
/* Just skip this part if the adapter is doing link detection */
@@ -541,28 +541,19 @@ void et131x_tx_timeout(struct net_device *netdev)
/* Is send stuck? */
spin_lock_irqsave(&etdev->TCBSendQLock, flags);
- pMpTcb = etdev->TxRing.CurrSendHead;
+ tcb = etdev->tx_ring.send_head;
- if (pMpTcb != NULL) {
- pMpTcb->Count++;
-
- if (pMpTcb->Count > NIC_SEND_HANG_THRESHOLD) {
- TX_DESC_ENTRY_t StuckDescriptors[10];
-
- if (INDEX10(pMpTcb->WrIndex) > 7) {
- memcpy(StuckDescriptors,
- etdev->TxRing.pTxDescRingVa +
- INDEX10(pMpTcb->WrIndex) - 6,
- sizeof(TX_DESC_ENTRY_t) * 10);
- }
+ if (tcb != NULL) {
+ tcb->count++;
+ if (tcb->count > NIC_SEND_HANG_THRESHOLD) {
spin_unlock_irqrestore(&etdev->TCBSendQLock,
flags);
dev_warn(&etdev->pdev->dev,
- "Send stuck - reset. pMpTcb->WrIndex %x, Flags 0x%08x\n",
- pMpTcb->WrIndex,
- pMpTcb->Flags);
+ "Send stuck - reset. tcb->WrIndex %x, Flags 0x%08x\n",
+ tcb->index,
+ tcb->flags);
et131x_close(netdev);
et131x_open(netdev);
@@ -622,7 +613,7 @@ int et131x_change_mtu(struct net_device *netdev, int new_mtu)
et131x_init_send(adapter);
- et131x_setup_hardware_properties(adapter);
+ et131x_hwaddr_init(adapter);
memcpy(netdev->dev_addr, adapter->CurrentAddress, ETH_ALEN);
/* Init the device with the new settings */
@@ -709,9 +700,7 @@ int et131x_set_mac_addr(struct net_device *netdev, void *new_mac)
et131x_init_send(adapter);
- et131x_setup_hardware_properties(adapter);
- /* memcpy( netdev->dev_addr, adapter->CurrentAddress, ETH_ALEN ); */
- /* blux: no, do not override our nice address */
+ et131x_hwaddr_init(adapter);
/* Init the device with the new settings */
et131x_adapter_setup(adapter);
diff --git a/drivers/staging/iio/Kconfig b/drivers/staging/iio/Kconfig
index 4586650d65c3..ace99f6d1166 100644
--- a/drivers/staging/iio/Kconfig
+++ b/drivers/staging/iio/Kconfig
@@ -8,7 +8,7 @@ menuconfig IIO
---help---
The industrial I/O subsystem provides a unified framework for
drivers for many different types of embedded sensors using a
- number of different physical interfaces (i2c, spi etc). See
+ number of different physical interfaces (i2c, spi, etc). See
Documentation/industrialio for more information.
if IIO
@@ -23,10 +23,10 @@ if IIO_RING_BUFFER
config IIO_SW_RING
tristate "Industrial I/O lock free software ring"
help
- example software ring buffer implementation. The design aim
- of this particular realization was to minize write locking
- with the intention that some devices would be able to write
- in interrupt context.
+ Example software ring buffer implementation. The design aim
+ of this particular realization was to minimize write locking
+ with the intention that some devices would be able to write
+ in interrupt context.
endif # IIO_RINGBUFFER
diff --git a/drivers/staging/iio/chrdev.h b/drivers/staging/iio/chrdev.h
index 8bc64bf08459..f42bafb3a894 100644
--- a/drivers/staging/iio/chrdev.h
+++ b/drivers/staging/iio/chrdev.h
@@ -75,10 +75,12 @@ struct iio_shared_ev_pointer {
* @current_events: number of events in detected list
* @id: indentifier to allow the event interface to know which
* physical line it corresponds to
+ * @attr: this chrdev's minor number sysfs attribute
* @owner: ensure the driver module owns the file, not iio
* @private: driver specific data
* @_name: used internally to store the sysfs name for minor id
* attribute
+ * @_attrname: the event interface's attribute name
*/
struct iio_event_interface {
struct device dev;
@@ -105,7 +107,7 @@ struct iio_event_interface {
* @handler: event handler function - called on event if this
* event_handler is enabled.
*
- * Each device has one list of these per interrupt line
+ * Each device has one list of these per interrupt line.
**/
struct iio_event_handler_list {
struct list_head list;
diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
index 25ccb809221e..71dbfe12b579 100644
--- a/drivers/staging/iio/iio.h
+++ b/drivers/staging/iio/iio.h
@@ -166,7 +166,7 @@ static inline int iio_scan_mask_clear(struct iio_dev *dev_info, int bit)
* @bit: which number scan element is this
**/
static inline int iio_scan_mask_count_to_right(struct iio_dev *dev_info,
-int bit)
+ int bit)
{
int count = 0;
int mask = (1 << bit);
@@ -239,7 +239,7 @@ void iio_unregister_interrupt_line(struct iio_dev *dev_info,
* @dev_info: IIO device structure
* @ev_line: Which event line (hardware interrupt)
* @ev_code: What event
- * @timestamp: When the event occured
+ * @timestamp: When the event occurred
**/
int iio_push_event(struct iio_dev *dev_info,
int ev_line,
@@ -248,11 +248,11 @@ int iio_push_event(struct iio_dev *dev_info,
/**
* struct iio_work_cont - container for when singleton handler case matters
- * @ws: [DEVICE]work_struct when not only possible event
- * @ws_nocheck: [DEVICE]work_struct when only possible event
- * @address: [DEVICE]associated register address
- * @mask: [DEVICE]associated mask for identifying event source
- * @st: [DEVICE]device specific state information
+ * @ws: [DEVICE] work_struct when not only possible event
+ * @ws_nocheck: [DEVICE] work_struct when only possible event
+ * @address: [DEVICE] associated register address
+ * @mask: [DEVICE] associated mask for identifying event source
+ * @st: [DEVICE] device specific state information
**/
struct iio_work_cont {
struct work_struct ws;
@@ -273,9 +273,9 @@ struct iio_work_cont {
* @cont: the work container
* @_checkfunc: function called when there are multiple possible int sources
* @_nocheckfunc: function for when there is only one int source
- * @_add: driver dependant, typically a register address
- * @_mask: driver dependant, typically a bit mask for a register
- * @_st: driver dependant, typically pointer to a device state structure
+ * @_add: driver dependent, typically a register address
+ * @_mask: driver dependent, typically a bit mask for a register
+ * @_st: driver dependent, typically pointer to a device state structure
**/
static inline void
iio_init_work_cont(struct iio_work_cont *cont,
@@ -290,7 +290,7 @@ iio_init_work_cont(struct iio_work_cont *cont,
cont->st = _st;
}
/**
- * __iio_push_event() tries to add an event to the list associated with a chrdev
+ * __iio_push_event() - tries to add an event to the list associated with a chrdev
* @ev_int: the event interface to which we are pushing the event
* @ev_code: the outgoing event code
* @timestamp: timestamp of the event
@@ -302,8 +302,8 @@ int __iio_push_event(struct iio_event_interface *ev_int,
struct iio_shared_ev_pointer*
shared_pointer_p);
/**
- * __iio_change_event() change an event code in case of event escallation
- * @ev: the evnet to be changed
+ * __iio_change_event() - change an event code in case of event escalation
+ * @ev: the event to be changed
* @ev_code: new event code
* @timestamp: new timestamp
**/
@@ -312,7 +312,7 @@ void __iio_change_event(struct iio_detected_event_list *ev,
s64 timestamp);
/**
- * iio_setup_ev_int() Configure an event interface (chrdev)
+ * iio_setup_ev_int() - configure an event interface (chrdev)
* @name: name used for resulting sysfs directory etc.
* @ev_int: interface we are configuring
* @owner: module that is responsible for registering this ev_int
@@ -343,7 +343,7 @@ extern dev_t iio_devt;
extern struct class iio_class;
/**
- * iio_put_device() - reference counted deallocated of struct device
+ * iio_put_device() - reference counted deallocation of struct device
* @dev: the iio_device containing the device
**/
static inline void iio_put_device(struct iio_dev *dev)
@@ -353,7 +353,7 @@ static inline void iio_put_device(struct iio_dev *dev)
};
/**
- * to_iio_dev() - get iio_dev for which we have have the struct device
+ * to_iio_dev() - get iio_dev for which we have the struct device
* @d: the struct device
**/
static inline struct iio_dev *to_iio_dev(struct device *d)
@@ -377,6 +377,7 @@ struct iio_dev *iio_allocate_device(void);
/**
* iio_free_device() - free an iio_dev from a driver
+ * @dev: the iio_dev associated with the device
**/
void iio_free_device(struct iio_dev *dev);
@@ -395,7 +396,8 @@ int iio_device_get_chrdev_minor(void);
void iio_device_free_chrdev_minor(int val);
/**
- * iio_ring_enabled() helper function to test if any form of ring enabled
+ * iio_ring_enabled() - helper function to test if any form of ring is enabled
+ * @dev_info: IIO device info structure for device
**/
static inline bool iio_ring_enabled(struct iio_dev *dev_info)
{
diff --git a/drivers/staging/iio/ring_generic.h b/drivers/staging/iio/ring_generic.h
index d9261897f332..93b91b28a02f 100644
--- a/drivers/staging/iio/ring_generic.h
+++ b/drivers/staging/iio/ring_generic.h
@@ -25,9 +25,12 @@ int iio_push_ring_event(struct iio_ring_buffer *ring_buf,
int event_code,
s64 timestamp);
/**
- * iio_push_or_escallate_ring_event() - escallate or add as appropriate
+ * iio_push_or_escallate_ring_event() - escalate or add as appropriate
+ * @ring_buf: ring buffer that is the event source
+ * @event_code: event indentification code
+ * @timestamp: time of event
*
- * Typical usecase is to escallate a 50% ring full to 75% full if noone has yet
+ * Typical usecase is to escalate a 50% ring full to 75% full if noone has yet
* read the first event. Clearly the 50% full is no longer of interest in
* typical use case.
**/
@@ -37,10 +40,6 @@ int iio_push_or_escallate_ring_event(struct iio_ring_buffer *ring_buf,
/**
* struct iio_ring_access_funcs - access functions for ring buffers.
- * @create: perform allocation
- * @init: get ring buffer ready for use
- * @_exit: reverse steps in init
- * @_free: deallocate ring buffer
* @mark_in_use: reference counting, typically to prevent module removal
* @unmark_in_use: reduce reference count when no longer using ring buffer
* @store_to: actually store stuff to the ring buffer
@@ -60,7 +59,7 @@ int iio_push_or_escallate_ring_event(struct iio_ring_buffer *ring_buf,
*
* The purpose of this structure is to make the ring buffer element
* modular as event for a given driver, different usecases may require
- * different ring designs (space efficiency vs speed for example.
+ * different ring designs (space efficiency vs speed for example).
*
* It is worth noting that a given ring implementation may only support a small
* proportion of these functions. The core code 'should' cope fine with any of
@@ -91,23 +90,25 @@ struct iio_ring_access_funcs {
/**
* struct iio_ring_buffer - general ring buffer structure
- * @length: [DEVICE]number of datums in ring
- * @bpd: [DEVICE]size of individual datum including timestamp
- * @loopcount: [INTERN]number of times the ring has looped
- * @access_minor_name: [INTERN]store of name of the access chrdev minor number
- * sysfs attribute
- * @access_handler: [INTERN]chrdev access handling
- * @event_minor_name: [INTERN]store of name of the event chrdev minor number
- * sysfs attribute
- * @ev_int: [INTERN]chrdev interface for the event chrdev
- * @shared_ev_pointer: [INTERN]the shared event pointer to allow escalation of
+ * @dev: ring buffer device struct
+ * @access_dev: system device struct for the chrdev
+ * @indio_dev: industrial I/O device structure
+ * @owner: module that owns the ring buffer (for ref counting)
+ * @id: unique id number
+ * @access_id: device id number
+ * @length: [DEVICE] number of datums in ring
+ * @bpd: [DEVICE] size of individual datum including timestamp
+ * @loopcount: [INTERN] number of times the ring has looped
+ * @access_handler: [INTERN] chrdev access handling
+ * @ev_int: [INTERN] chrdev interface for the event chrdev
+ * @shared_ev_pointer: [INTERN] the shared event pointer to allow escalation of
* events
- * @ring_access: [DRIVER]ring access functions associated with the
+ * @access: [DRIVER] ring access functions associated with the
* implementation.
- * @ring_prenable: [DRIVER] function to run prior to marking ring enabled
- * @ring_postenable: [DRIVER] function to run after marking ring enabled
- * @ring_predisable: [DRIVER] function to run prior to marking ring disabled
- * @ring_postdisable: [DRIVER] function to run after marking ring disabled
+ * @preenable: [DRIVER] function to run prior to marking ring enabled
+ * @postenable: [DRIVER] function to run after marking ring enabled
+ * @predisable: [DRIVER] function to run prior to marking ring disabled
+ * @postdisable: [DRIVER] function to run after marking ring disabled
**/
struct iio_ring_buffer {
struct device dev;
@@ -133,7 +134,10 @@ void iio_ring_buffer_init(struct iio_ring_buffer *ring,
struct iio_dev *dev_info);
/**
- * __iio_init_ring_buffer() - initialize common elements of ring buffers.
+ * __iio_init_ring_buffer() - initialize common elements of ring buffers
+ * @ring: ring buffer that is the event source
+ * @bytes_per_datum: size of individual datum including timestamp
+ * @length: number of datums in ring
**/
static inline void __iio_init_ring_buffer(struct iio_ring_buffer *ring,
int bytes_per_datum, int length)
@@ -171,7 +175,11 @@ struct iio_scan_el {
container_of(_dev_attr, struct iio_scan_el, dev_attr);
/**
- * iio_scan_el_store() - sysfs scan element selection interface.
+ * iio_scan_el_store() - sysfs scan element selection interface
+ * @dev: the target device
+ * @attr: the device attribute that is being processed
+ * @buf: input from userspace
+ * @len: length of input
*
* A generic function used to enable various scan elements. In some
* devices explicit read commands for each channel mean this is merely
@@ -184,12 +192,15 @@ ssize_t iio_scan_el_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len);
/**
* iio_scal_el_show() - sysfs interface to query whether a scan element is
- * is enabled or not.
+ * is enabled or not
+ * @dev: the target device
+ * @attr: the device attribute that is being processed
+ * @buf: output buffer
**/
ssize_t iio_scan_el_show(struct device *dev, struct device_attribute *attr,
char *buf);
/**
- * IIO_SCAN_EL: - declare and initialize a scan element without control func
+ * IIO_SCAN_EL - declare and initialize a scan element without control func
* @_name: identifying name. Resulting struct is iio_scan_el_##_name,
* sysfs element, scan_en_##_name.
* @_number: unique id number for the scan element.
@@ -214,8 +225,14 @@ ssize_t iio_scan_el_ts_store(struct device *dev, struct device_attribute *attr,
ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
char *buf);
/**
- * IIO_SCAN_EL_C: - declare and initialize a scan element with a control func
+ * IIO_SCAN_EL_C - declare and initialize a scan element with a control func
*
+ * @_name: identifying name. Resulting struct is iio_scan_el_##_name,
+ * sysfs element, scan_en_##_name.
+ * @_number: unique id number for the scan element.
+ * @_bits: number of bits in the scan element result (used in mixed bit
+ * length devices).
+ * @_label: indentification variable used by drivers. Often a reg address.
* @_controlfunc: function used to notify hardware of whether state changes
**/
#define IIO_SCAN_EL_C(_name, _number, _bits, _label, _controlfunc) \
@@ -230,7 +247,7 @@ ssize_t iio_scan_el_ts_show(struct device *dev, struct device_attribute *attr,
.set_state = _controlfunc, \
}
/**
- * IIO_SCAN_EL_TIMESTAMP: - declare a special scan element for timestamps
+ * IIO_SCAN_EL_TIMESTAMP - declare a special scan element for timestamps
*
* Odd one out. Handled slightly differently from other scan elements.
**/
diff --git a/drivers/staging/iio/ring_sw.h b/drivers/staging/iio/ring_sw.h
index 4b0de7cfb0cb..fd677f008365 100644
--- a/drivers/staging/iio/ring_sw.h
+++ b/drivers/staging/iio/ring_sw.h
@@ -35,52 +35,65 @@
#if defined CONFIG_IIO_SW_RING || defined CONFIG_IIO_SW_RING_MODULE
/**
- * iio_create_sw_rb() software ring buffer allocation
+ * iio_create_sw_rb() - software ring buffer allocation
* @r: pointer to ring buffer pointer
**/
int iio_create_sw_rb(struct iio_ring_buffer **r);
/**
- * iio_init_sw_rb() initialize the software ring buffer
+ * iio_init_sw_rb() - initialize the software ring buffer
* @r: pointer to a software ring buffer created by an
- * iio_create_sw_rb call.
+ * iio_create_sw_rb call
+ * @indio_dev: industrial I/O device structure
**/
int iio_init_sw_rb(struct iio_ring_buffer *r, struct iio_dev *indio_dev);
+
/**
- * iio_exit_sw_rb() reverse what was done in iio_init_sw_rb
+ * iio_exit_sw_rb() - reverse what was done in iio_init_sw_rb
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
void iio_exit_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_free_sw_rb() free memory occupied by the core ring buffer struct
+ * iio_free_sw_rb() - free memory occupied by the core ring buffer struct
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
void iio_free_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_mark_sw_rb_in_use() reference counting to prevent incorrect chances
+ * iio_mark_sw_rb_in_use() - reference counting to prevent incorrect chances
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
void iio_mark_sw_rb_in_use(struct iio_ring_buffer *r);
/**
- * iio_unmark_sw_rb_in_use() notify the ring buffer that we don't care anymore
+ * iio_unmark_sw_rb_in_use() - notify the ring buffer that we don't care anymore
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
void iio_unmark_sw_rb_in_use(struct iio_ring_buffer *r);
/**
- * iio_read_last_from_sw_rb() attempt to read the last stored datum from the rb
+ * iio_read_last_from_sw_rb() - attempt to read the last stored datum from the rb
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
+ * @data: where to store the last datum
**/
int iio_read_last_from_sw_rb(struct iio_ring_buffer *r, u8 *data);
/**
- * iio_store_to_sw_rb() store a new datum to the ring buffer
- * @rb: pointer to ring buffer instance
- * @data: the datum to be stored including timestamp if relevant.
- * @timestamp: timestamp which will be attached to buffer events if relevant.
+ * iio_store_to_sw_rb() - store a new datum to the ring buffer
+ * @r: pointer to ring buffer instance
+ * @data: the datum to be stored including timestamp if relevant
+ * @timestamp: timestamp which will be attached to buffer events if relevant
**/
int iio_store_to_sw_rb(struct iio_ring_buffer *r, u8 *data, s64 timestamp);
/**
- * iio_rip_sw_rb() attempt to read data from the ring buffer
+ * iio_rip_sw_rb() - attempt to read data from the ring buffer
* @r: ring buffer instance
* @count: number of datum's to try and read
* @data: where the data will be stored.
@@ -93,38 +106,53 @@ int iio_rip_sw_rb(struct iio_ring_buffer *r,
int *dead_offset);
/**
- * iio_request_update_sw_rb() update params if update needed
+ * iio_request_update_sw_rb() - update params if update needed
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
int iio_request_update_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_mark_update_needed_sw_rb() tell the ring buffer it needs a param update
+ * iio_mark_update_needed_sw_rb() - tell the ring buffer it needs a param update
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
int iio_mark_update_needed_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_get_bpd_sw_rb() get the datum size in bytes
+ * iio_get_bpd_sw_rb() - get the datum size in bytes
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
int iio_get_bpd_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_set_bpd_sw_rb() set the datum size in bytes
+ * iio_set_bpd_sw_rb() - set the datum size in bytes
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
+ * @bpd: bytes per datum value
**/
int iio_set_bpd_sw_rb(struct iio_ring_buffer *r, size_t bpd);
/**
- * iio_get_length_sw_rb() get how many datums the rb may contain
+ * iio_get_length_sw_rb() - get how many datums the rb may contain
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
**/
int iio_get_length_sw_rb(struct iio_ring_buffer *r);
/**
- * iio_set_length_sw_rb() set how many datums the rb may contain
+ * iio_set_length_sw_rb() - set how many datums the rb may contain
+ * @r: pointer to a software ring buffer created by an
+ * iio_create_sw_rb call
+ * @length: max number of data items for the ring buffer
**/
int iio_set_length_sw_rb(struct iio_ring_buffer *r, int length);
/**
- * iio_ring_sw_register_funcs() helper function to set up rb access
+ * iio_ring_sw_register_funcs() - helper function to set up rb access
+ * @ra: pointer to @iio_ring_access_funcs
**/
static inline void iio_ring_sw_register_funcs(struct iio_ring_access_funcs *ra)
{
diff --git a/drivers/staging/iio/sysfs.h b/drivers/staging/iio/sysfs.h
index bfe4055c0ed2..e501e1338e11 100644
--- a/drivers/staging/iio/sysfs.h
+++ b/drivers/staging/iio/sysfs.h
@@ -15,7 +15,7 @@
#include "iio.h"
/**
- * struct iio_event_attribute - event control attribute
+ * struct iio_event_attr - event control attribute
* @dev_attr: underlying device attribute
* @mask: mask for the event when detecting
* @listel: list header to allow addition to list of event handlers
@@ -54,6 +54,7 @@ __init_iio_chrdev_minor_attr(struct iio_chrdev_minor_attr *minor_attr,
* struct iio_dev_attr - iio specific device attribute
* @dev_attr: underlying device attribute
* @address: associated register address
+ * @val2: secondary attribute value
*/
struct iio_dev_attr {
struct device_attribute dev_attr;
@@ -71,6 +72,8 @@ ssize_t iio_read_const_attr(struct device *dev,
/**
* struct iio_const_attr - constant device specific attribute
* often used for things like available modes
+ * @string: attribute string
+ * @dev_attr: underlying device attribute
*/
struct iio_const_attr {
const char *string;
@@ -80,7 +83,7 @@ struct iio_const_attr {
#define to_iio_const_attr(_dev_attr) \
container_of(_dev_attr, struct iio_const_attr, dev_attr)
-/* Some attributes will be hard coded (device dependant) and not require an
+/* Some attributes will be hard coded (device dependent) and not require an
address, in these cases pass a negative */
#define IIO_ATTR(_name, _mode, _show, _store, _addr) \
{ .dev_attr = __ATTR(_name, _mode, _show, _store), \
@@ -108,102 +111,130 @@ struct iio_const_attr {
/* Generic attributes of onetype or another */
/**
- * IIO_DEV_ATTR_REG: revision number for the device
+ * IIO_DEV_ATTR_REV - revision number for the device
+ * @_show: output method for the attribute
*
* Very much device dependent.
**/
#define IIO_DEV_ATTR_REV(_show) \
IIO_DEVICE_ATTR(revision, S_IRUGO, _show, NULL, 0)
+
/**
- * IIO_DEV_ATTR_NAME: chip type dependant identifier
+ * IIO_DEV_ATTR_NAME - chip type dependent identifier
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_NAME(_show) \
IIO_DEVICE_ATTR(name, S_IRUGO, _show, NULL, 0)
/**
- * IIO_DEV_ATTR_SAMP_FREQ: sets any internal clock frequency
+ * IIO_DEV_ATTR_SAMP_FREQ - sets any internal clock frequency
+ * @_mode: sysfs file mode/permissions
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
**/
#define IIO_DEV_ATTR_SAMP_FREQ(_mode, _show, _store) \
IIO_DEVICE_ATTR(sampling_frequency, _mode, _show, _store, 0)
/**
- * IIO_DEV_ATTR_AVAIL_SAMP_FREQ: list available sampling frequencies.
+ * IIO_DEV_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies
+ * @_show: output method for the attribute
*
- * May be mode dependant on some devices
+ * May be mode dependent on some devices
**/
#define IIO_DEV_ATTR_AVAIL_SAMP_FREQ(_show) \
IIO_DEVICE_ATTR(available_sampling_frequency, S_IRUGO, _show, NULL, 0)
/**
- * IIO_DEV_ATTR_CONST_AVAIL_SAMP_FREQ: list available sampling frequencies.
+ * IIO_CONST_ATTR_AVAIL_SAMP_FREQ - list available sampling frequencies
+ * @_string: frequency string for the attribute
*
* Constant version
**/
#define IIO_CONST_ATTR_AVAIL_SAMP_FREQ(_string) \
IIO_CONST_ATTR(available_sampling_frequency, _string)
+
/**
- * IIO_DEV_ATTR_SCAN_MODE: select a scan mode
+ * IIO_DEV_ATTR_SCAN_MODE - select a scan mode
+ * @_mode: sysfs file mode/permissions
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
*
* This is used when only certain combinations of inputs may be read in one
* scan.
**/
#define IIO_DEV_ATTR_SCAN_MODE(_mode, _show, _store) \
IIO_DEVICE_ATTR(scan_mode, _mode, _show, _store, 0)
+
/**
- * IIO_DEV_ATTR_AVAIL_SCAN_MODES: list available scan modes
+ * IIO_DEV_ATTR_AVAIL_SCAN_MODES - list available scan modes
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_AVAIL_SCAN_MODES(_show) \
IIO_DEVICE_ATTR(available_scan_modes, S_IRUGO, _show, NULL, 0)
/**
- * IIO_DEV_ATTR_SCAN: result of scan of multiple channels
+ * IIO_DEV_ATTR_SCAN - result of scan of multiple channels
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_SCAN(_show) \
IIO_DEVICE_ATTR(scan, S_IRUGO, _show, NULL, 0);
/**
- * IIO_DEV_ATTR_INPUT: direct read of a single input channel
+ * IIO_DEV_ATTR_INPUT - direct read of a single input channel
+ * @_number: input channel number
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_INPUT(_number, _show) \
IIO_DEVICE_ATTR(in##_number, S_IRUGO, _show, NULL, _number)
-
/**
- * IIO_DEV_ATTR_SW_RING_ENABLE: enable software ring buffer
+ * IIO_DEV_ATTR_SW_RING_ENABLE - enable software ring buffer
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
*
- * Success may be dependant on attachment of trigger previously
+ * Success may be dependent on attachment of trigger previously.
**/
#define IIO_DEV_ATTR_SW_RING_ENABLE(_show, _store) \
IIO_DEVICE_ATTR(sw_ring_enable, S_IRUGO | S_IWUSR, _show, _store, 0)
/**
- * IIO_DEV_ATTR_HW_RING_ENABLE: enable hardware ring buffer
+ * IIO_DEV_ATTR_HW_RING_ENABLE - enable hardware ring buffer
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
*
- * This is a different attribute from the software one as one can invision
+ * This is a different attribute from the software one as one can envision
* schemes where a combination of the two may be used.
**/
#define IIO_DEV_ATTR_HW_RING_ENABLE(_show, _store) \
IIO_DEVICE_ATTR(hw_ring_enable, S_IRUGO | S_IWUSR, _show, _store, 0)
/**
- * IIO_DEV_ATTR_BPSE: set number of bits per scan element
+ * IIO_DEV_ATTR_BPSE - set number of bits per scan element
+ * @_mode: sysfs file mode/permissions
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
**/
#define IIO_DEV_ATTR_BPSE(_mode, _show, _store) \
IIO_DEVICE_ATTR(bpse, _mode, _show, _store, 0)
/**
- * IIO_DEV_ATTR_BPSE_AVAILABLE: no of bits per scan element supported
+ * IIO_DEV_ATTR_BPSE_AVAILABLE - number of bits per scan element supported
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_BPSE_AVAILABLE(_show) \
IIO_DEVICE_ATTR(bpse_available, S_IRUGO, _show, NULL, 0)
/**
- * IIO_DEV_ATTR_TEMP: many sensors have auxiliary temperature sensors
+ * IIO_DEV_ATTR_TEMP - many sensors have auxiliary temperature sensors
+ * @_show: output method for the attribute
**/
#define IIO_DEV_ATTR_TEMP(_show) \
IIO_DEVICE_ATTR(temp, S_IRUGO, _show, NULL, 0)
+
/**
- * IIO_EVENT_SH: generic shared event handler
+ * IIO_EVENT_SH - generic shared event handler
+ * @_name: event name
+ * @_handler: handler function to be called
*
* This is used in cases where more than one event may result from a single
* handler. Often the case that some alarm register must be read and multiple
@@ -221,8 +252,14 @@ struct iio_const_attr {
.prev = &iio_event_##_name.list, \
}, \
};
+
/**
- * IIO_EVENT_ATTR_SH: generic shared event attribute
+ * IIO_EVENT_ATTR_SH - generic shared event attribute
+ * @_name: event name
+ * @_ev_list: event handler list
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
*
* An attribute with an associated IIO_EVENT_SH
**/
@@ -235,7 +272,12 @@ struct iio_const_attr {
.listel = &_ev_list };
/**
- * IIO_EVENT_ATTR: non shared event attribute
+ * IIO_EVENT_ATTR - non-shared event attribute
+ * @_name: event name
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
+ * @_handler: handler function to be called
**/
#define IIO_EVENT_ATTR(_name, _show, _store, _mask, _handler) \
static struct iio_event_handler_list \
@@ -251,10 +293,14 @@ struct iio_const_attr {
.listel = &iio_event_##_name }; \
/**
- * IIO_EVENT_ATTR_DATA_RDY: event driven by data ready signal
+ * IIO_EVENT_ATTR_DATA_RDY - event driven by data ready signal
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
+ * @_handler: handler function to be called
*
* Not typically implemented in devices where full triggering support
- * has been implemented
+ * has been implemented.
**/
#define IIO_EVENT_ATTR_DATA_RDY(_show, _store, _mask, _handler) \
IIO_EVENT_ATTR(data_rdy, _show, _store, _mask, _handler)
@@ -269,19 +315,31 @@ struct iio_const_attr {
#define IIO_EVENT_CODE_DEVICE_SPECIFIC 1000
/**
- * IIO_EVENT_ATTR_RING_50_FULL: ring buffer event to indicate 50% full
+ * IIO_EVENT_ATTR_RING_50_FULL - ring buffer event to indicate 50% full
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
+ * @_handler: handler function to be called
**/
#define IIO_EVENT_ATTR_RING_50_FULL(_show, _store, _mask, _handler) \
IIO_EVENT_ATTR(ring_50_full, _show, _store, _mask, _handler)
/**
- * IIO_EVENT_ATTR_RING_50_FULL_SH: shared ring event to indicate 50% full
+ * IIO_EVENT_ATTR_RING_50_FULL_SH - shared ring event to indicate 50% full
+ * @_evlist: event handler list
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
**/
#define IIO_EVENT_ATTR_RING_50_FULL_SH(_evlist, _show, _store, _mask) \
IIO_EVENT_ATTR_SH(ring_50_full, _evlist, _show, _store, _mask)
/**
- * IIO_EVENT_ATTR_RING_75_FULL_SH: shared ring event to indicate 75% full
+ * IIO_EVENT_ATTR_RING_75_FULL_SH - shared ring event to indicate 75% full
+ * @_evlist: event handler list
+ * @_show: output method for the attribute
+ * @_store: input method for the attribute
+ * @_mask: mask used when detecting the event
**/
#define IIO_EVENT_ATTR_RING_75_FULL_SH(_evlist, _show, _store, _mask) \
IIO_EVENT_ATTR_SH(ring_75_full, _evlist, _show, _store, _mask)
diff --git a/drivers/staging/iio/trigger.h b/drivers/staging/iio/trigger.h
index 8284098c9589..784e7b6fac1c 100644
--- a/drivers/staging/iio/trigger.h
+++ b/drivers/staging/iio/trigger.h
@@ -19,16 +19,18 @@
* @id: [INTERN] unique id number
* @name: [DRIVER] unique name
* @dev: [DRIVER] associated device (if relevant)
- * @sysfs_dev: [INTERN] sysfs relevant device
* @private_data: [DRIVER] device specific data
* @list: [INTERN] used in maintenance of global trigger list
* @alloc_list: [DRIVER] used for driver specific trigger list
- * @poll_func_list_lock:[INTERN] protection of the polling function list
+ * @pollfunc_list_lock: [INTERN] protection of the polling function list
* @pollfunc_list: [INTERN] list of functions to run on trigger.
* @control_attrs: [DRIVER] sysfs attributes relevant to trigger type
- * @set_trigger_state: [DRIVER] switch on/off the trigger on demand
* @timestamp: [INTERN] timestamp usesd by some trigs (e.g. datardy)
* @owner: [DRIVER] used to monitor usage count of the trigger.
+ * @use_count: use count for the trigger
+ * @set_trigger_state: [DRIVER] switch on/off the trigger on demand
+ * @try_reenable: function to reenable the trigger when the
+ * use count is zero (may be NULL)
**/
struct iio_trigger {
int id;
@@ -68,6 +70,9 @@ static inline void iio_get_trigger(struct iio_trigger *trig)
/**
* iio_trigger_read_name() - sysfs access function to get the trigger name
+ * @dev: the system device
+ * @attr: device attributes for the device
+ * @buf: output buffer to store the trigger name
**/
ssize_t iio_trigger_read_name(struct device *dev,
struct device_attribute *attr,
@@ -79,6 +84,8 @@ ssize_t iio_trigger_read_name(struct device *dev,
/**
* iio_trigger_find_by_name() - search global trigger list
+ * @name: trigger name to search for
+ * @len: trigger name string length to compare
**/
struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len);
@@ -90,32 +97,35 @@ int iio_trigger_register(struct iio_trigger *trig_info);
/**
* iio_trigger_unregister() - unregister a trigger from the core
+ * @trig_info: trigger to be unregistered
**/
void iio_trigger_unregister(struct iio_trigger *trig_info);
/**
* iio_trigger_attach_poll_func() - add a function pair to be run on trigger
* @trig: trigger to which the function pair are being added
- * @pf: poll function pair
+ * @pf: poll function pair
**/
int iio_trigger_attach_poll_func(struct iio_trigger *trig,
struct iio_poll_func *pf);
/**
* iio_trigger_dettach_poll_func() - remove function pair from those to be
- * run on trigger.
- * @trig: trigger from which the function is being removed.
+ * run on trigger
+ * @trig: trigger from which the function is being removed
* @pf: poll function pair
**/
int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
struct iio_poll_func *pf);
/**
- * iio_trigger_poll() - called on a trigger occuring
+ * iio_trigger_poll() - called on a trigger occurring
+ * @trig: trigger which occurred
+ *
* Typically called in relevant hardware interrupt handler.
**/
-void iio_trigger_poll(struct iio_trigger *);
-void iio_trigger_notify_done(struct iio_trigger *);
+void iio_trigger_poll(struct iio_trigger *trig);
+void iio_trigger_notify_done(struct iio_trigger *trig);
/**
* struct iio_poll_func - poll function pair
@@ -127,11 +137,10 @@ void iio_trigger_notify_done(struct iio_trigger *);
* control on sensor supporting it.
* @poll_func_main: function in here is run after all immediates.
* Reading from sensor etc typically involves
- * scheduling
- * from here.
+ * scheduling from here.
*
- * The two stage approach used here only important when multiple sensors are
- * being triggered by a single trigger. This really comes into it's own with
+ * The two stage approach used here is only important when multiple sensors are
+ * being triggered by a single trigger. This really comes into its own with
* simultaneous sampling devices where a simple latch command can be used to
* make the device store the values on all inputs.
**/
diff --git a/drivers/staging/iio/trigger/Kconfig b/drivers/staging/iio/trigger/Kconfig
index fdd9301271a4..d842a584a3af 100644
--- a/drivers/staging/iio/trigger/Kconfig
+++ b/drivers/staging/iio/trigger/Kconfig
@@ -9,13 +9,13 @@ config IIO_PERIODIC_RTC_TRIGGER
tristate "Periodic RTC triggers"
depends on RTC_CLASS
help
- Provides support for using periodic capable real time
- clocks as IIO triggers.
+ Provides support for using periodic capable real time
+ clocks as IIO triggers.
config IIO_GPIO_TRIGGER
tristate "GPIO trigger"
depends on GENERIC_GPIO
help
- Provides support for using GPIO pins as IIO triggers.
+ Provides support for using GPIO pins as IIO triggers.
endif # IIO_TRIGGER
diff --git a/drivers/staging/iio/trigger_consumer.h b/drivers/staging/iio/trigger_consumer.h
index 4c7f527dc79f..a02d70b0d24a 100644
--- a/drivers/staging/iio/trigger_consumer.h
+++ b/drivers/staging/iio/trigger_consumer.h
@@ -10,12 +10,13 @@
#ifdef CONFIG_IIO_TRIGGER
/**
- * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers.
+ * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
* @dev_info: iio_dev associated with the device that will consume the trigger
**/
int iio_device_register_trigger_consumer(struct iio_dev *dev_info);
+
/**
- * iio_device_unregister_trigger_consumer() - reverse the registration process.
+ * iio_device_unregister_trigger_consumer() - reverse the registration process
* @dev_info: iio_dev associated with the device that consumed the trigger
**/
int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info);
@@ -23,13 +24,14 @@ int iio_device_unregister_trigger_consumer(struct iio_dev *dev_info);
#else
/**
- * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers.
+ * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers
* @dev_info: iio_dev associated with the device that will consume the trigger
**/
int iio_device_register_trigger_consumer(struct iio_dev *dev_info)
{
return 0;
};
+
/**
* iio_device_unregister_trigger_consumer() - reverse the registration process
* @dev_info: iio_dev associated with the device that consumed the trigger
diff --git a/drivers/staging/line6/driver.c b/drivers/staging/line6/driver.c
index f188ecee502f..e4078a92d399 100644
--- a/drivers/staging/line6/driver.c
+++ b/drivers/staging/line6/driver.c
@@ -168,19 +168,19 @@ static void line6_dump_urb(struct urb *urb)
#endif
/*
- Send raw message in pieces of wMaxPacketSize bytes.
+ Send raw message in pieces of max_packet_size bytes.
*/
int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
int size)
{
int i, done = 0;
+ int actual_size;
#if DO_DUMP_URB_SEND
line6_write_hexdump(line6, 'S', buffer, size);
#endif
- for (i = 0; i < size; i += line6->max_packet_size) {
- int partial;
+ for (i = 0; i < size; i += actual_size) {
const char *frag_buf = buffer + i;
int frag_size = min(line6->max_packet_size, size - i);
int retval;
@@ -189,7 +189,7 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
usb_sndintpipe(line6->usbdev,
line6->ep_control_write),
(char *)frag_buf, frag_size,
- &partial, LINE6_TIMEOUT * HZ);
+ &actual_size, LINE6_TIMEOUT * HZ);
if (retval) {
dev_err(line6->ifcdev,
@@ -197,7 +197,7 @@ int line6_send_raw_message(struct usb_line6 *line6, const char *buffer,
break;
}
- done += frag_size;
+ done += actual_size;
}
return done;
@@ -395,17 +395,44 @@ static void line6_data_received(struct urb *urb)
line6_start_listen(line6);
}
+static int line6_send(struct usb_line6 *line6, unsigned char *buf, size_t len)
+{
+ int retval;
+ unsigned int partial;
+
+#if DO_DUMP_URB_SEND
+ line6_write_hexdump(line6, 'S', buf, len);
+#endif
+
+ retval = usb_interrupt_msg(line6->usbdev,
+ usb_sndintpipe(line6->usbdev,
+ line6->ep_control_write),
+ buf, len, &partial,
+ LINE6_TIMEOUT * HZ);
+
+ if (retval) {
+ dev_err(line6->ifcdev,
+ "usb_interrupt_msg failed (%d)\n", retval);
+ }
+
+ if (partial != len) {
+ dev_err(line6->ifcdev,
+ "usb_interrupt_msg sent partial message (%d)\n",
+ retval);
+ }
+
+ return retval;
+}
+
/*
Send channel number (i.e., switch to a different sound).
*/
int line6_send_program(struct usb_line6 *line6, int value)
{
- int retval;
unsigned char *buffer;
- unsigned int partial;
-
- buffer = kmalloc(2, GFP_KERNEL);
+ size_t len = 2;
+ buffer = kmalloc(len, GFP_KERNEL);
if (!buffer) {
dev_err(line6->ifcdev, "out of memory\n");
return -ENOMEM;
@@ -414,20 +441,7 @@ int line6_send_program(struct usb_line6 *line6, int value)
buffer[0] = LINE6_PROGRAM_CHANGE | LINE6_CHANNEL_HOST;
buffer[1] = value;
-#if DO_DUMP_URB_SEND
- line6_write_hexdump(line6, 'S', buffer, 2);
-#endif
-
- retval = usb_interrupt_msg(line6->usbdev,
- usb_sndintpipe(line6->usbdev,
- line6->ep_control_write),
- buffer, 2, &partial, LINE6_TIMEOUT * HZ);
-
- if (retval)
- dev_err(line6->ifcdev, "usb_interrupt_msg failed (%d)\n", retval);
-
- kfree(buffer);
- return retval;
+ return line6_send(line6, buffer, len);
}
/*
@@ -435,12 +449,10 @@ int line6_send_program(struct usb_line6 *line6, int value)
*/
int line6_transmit_parameter(struct usb_line6 *line6, int param, int value)
{
- int retval;
unsigned char *buffer;
- unsigned int partial;
-
- buffer = kmalloc(3, GFP_KERNEL);
+ size_t len = 3;
+ buffer = kmalloc(len, GFP_KERNEL);
if (!buffer) {
dev_err(line6->ifcdev, "out of memory\n");
return -ENOMEM;
@@ -450,19 +462,7 @@ int line6_transmit_parameter(struct usb_line6 *line6, int param, int value)
buffer[1] = param;
buffer[2] = value;
-#if DO_DUMP_URB_SEND
- line6_write_hexdump(line6, 'S', buffer, 3);
-#endif
-
- retval = usb_interrupt_msg(line6->usbdev,
- usb_sndintpipe(line6->usbdev, line6->ep_control_write),
- buffer, 3, &partial, LINE6_TIMEOUT * HZ);
-
- if (retval)
- dev_err(line6->ifcdev, "usb_interrupt_msg failed (%d)\n", retval);
-
- kfree(buffer);
- return retval;
+ return line6_send(line6, buffer, len);
}
/*
@@ -476,8 +476,10 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t dat
/* query the serial number: */
ret = usb_control_msg(usbdev, usb_sndctrlpipe(usbdev, 0), 0x67,
- USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT,
- (datalen << 8) | 0x21, address, NULL, 0, LINE6_TIMEOUT * HZ);
+ USB_TYPE_VENDOR | USB_RECIP_DEVICE
+ | USB_DIR_OUT,
+ (datalen << 8) | 0x21, address,
+ NULL, 0, LINE6_TIMEOUT * HZ);
if (ret < 0) {
dev_err(line6->ifcdev, "read request failed (error %d)\n", ret);
@@ -496,9 +498,7 @@ int line6_read_data(struct usb_line6 *line6, int address, void *data, size_t dat
"receive length failed (error %d)\n", ret);
return ret;
}
- }
- while (len == 0xff)
- ;
+ } while (len == 0xff);
if (len != datalen) {
/* should be equal or something went wrong */
@@ -682,10 +682,14 @@ static int line6_probe(struct usb_interface *interface, const struct usb_device_
return -ENODEV;
/* check vendor and product id */
- for (devtype = ARRAY_SIZE(line6_id_table) - 1; devtype--;)
- if ((le16_to_cpu(usbdev->descriptor.idVendor) == line6_id_table[devtype].idVendor) &&
- (le16_to_cpu(usbdev->descriptor.idProduct) == line6_id_table[devtype].idProduct))
+ for (devtype = ARRAY_SIZE(line6_id_table) - 1; devtype--;) {
+ u16 vendor = le16_to_cpu(usbdev->descriptor.idVendor);
+ u16 product = le16_to_cpu(usbdev->descriptor.idProduct);
+
+ if (vendor == line6_id_table[devtype].idVendor
+ && product == line6_id_table[devtype].idProduct)
break;
+ }
if (devtype < 0)
return -ENODEV;
@@ -1036,9 +1040,10 @@ static void line6_disconnect(struct usb_interface *interface)
dev_info(&interface->dev, "Line6 %s now disconnected\n", line6->properties->name);
- for (i = LINE6_MAX_DEVICES; i--;)
+ for (i = LINE6_MAX_DEVICES; i--;) {
if (line6_devices[i] == line6)
line6_devices[i] = NULL;
+ }
}
line6_destruct(interface);
diff --git a/drivers/staging/netwave/Kconfig b/drivers/staging/netwave/Kconfig
new file mode 100644
index 000000000000..c0c996c0550a
--- /dev/null
+++ b/drivers/staging/netwave/Kconfig
@@ -0,0 +1,11 @@
+config PCMCIA_NETWAVE
+ tristate "Xircom Netwave AirSurfer Pcmcia wireless support"
+ depends on PCMCIA
+ select WIRELESS_EXT
+ select WEXT_PRIV
+ help
+ Say Y here if you intend to attach this type of PCMCIA (PC-card)
+ wireless Ethernet networking card to your computer.
+
+ To compile this driver as a module, choose M here: the module will be
+ called netwave_cs. If unsure, say N.
diff --git a/drivers/staging/netwave/Makefile b/drivers/staging/netwave/Makefile
new file mode 100644
index 000000000000..2ab89de59b9b
--- /dev/null
+++ b/drivers/staging/netwave/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_PCMCIA_NETWAVE) += netwave_cs.o
diff --git a/drivers/staging/netwave/TODO b/drivers/staging/netwave/TODO
new file mode 100644
index 000000000000..9bd15a2f6d9e
--- /dev/null
+++ b/drivers/staging/netwave/TODO
@@ -0,0 +1,7 @@
+TODO:
+ - step up and maintain this driver to ensure that it continues
+ to work. Having the hardware for this is pretty much a
+ requirement. If this does not happen, the will be removed in
+ the 2.6.35 kernel release.
+
+Please send patches to Greg Kroah-Hartman <greg@kroah.com>.
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/staging/netwave/netwave_cs.c
index 9498b46c99a4..acba179d19fc 100644
--- a/drivers/net/wireless/netwave_cs.c
+++ b/drivers/staging/netwave/netwave_cs.c
@@ -1,5 +1,5 @@
/*********************************************************************
- *
+ *
* Filename: netwave_cs.c
* Version: 0.4.1
* Description: Netwave AirSurfer Wireless LAN PC Card driver
@@ -10,27 +10,27 @@
* Created at: A long time ago!
* Modified at: Mon Nov 10 11:54:37 1997
* Modified by: Dag Brattli <dagb@cs.uit.no>
- *
+ *
* Copyright (c) 1997 University of Tromsø, Norway
*
* Revision History:
*
* 08-Nov-97 15:14:47 John Markus Bjørndalen <johnm@cs.uit.no>
- * - Fixed some bugs in netwave_rx and cleaned it up a bit.
+ * - Fixed some bugs in netwave_rx and cleaned it up a bit.
* (One of the bugs would have destroyed packets when receiving
- * multiple packets per interrupt).
- * - Cleaned up parts of newave_hw_xmit.
- * - A few general cleanups.
+ * multiple packets per interrupt).
+ * - Cleaned up parts of newave_hw_xmit.
+ * - A few general cleanups.
* 24-Oct-97 13:17:36 Dag Brattli <dagb@cs.uit.no>
* - Fixed netwave_rx receive function (got updated docs)
* Others:
- * - Changed name from xircnw to netwave, take a look at
+ * - Changed name from xircnw to netwave, take a look at
* http://www.netwave-wireless.com
* - Some reorganizing of the code
* - Removed possible race condition between interrupt handler and transmit
* function
* - Started to add wireless extensions, but still needs some coding
- * - Added watchdog for better handling of transmission timeouts
+ * - Added watchdog for better handling of transmission timeouts
* (hopefully this works better)
********************************************************************/
@@ -102,7 +102,7 @@
/*
* Commands used in the extended command buffer
- * NETWAVE_EREG_CB (0x100-0x10F)
+ * NETWAVE_EREG_CB (0x100-0x10F)
*/
#define NETWAVE_CMD_NOP 0x00
#define NETWAVE_CMD_SRC 0x01
@@ -134,7 +134,7 @@ static const unsigned int corConfIENA = 0x01; /* Interrupt enable */
static const unsigned int corConfLVLREQ = 0x40; /* Keep high */
static const unsigned int rxConfRxEna = 0x80; /* Receive Enable */
-static const unsigned int rxConfMAC = 0x20; /* MAC host receive mode*/
+static const unsigned int rxConfMAC = 0x20; /* MAC host receive mode*/
static const unsigned int rxConfPro = 0x10; /* Promiscuous */
static const unsigned int rxConfAMP = 0x08; /* Accept Multicast Packets */
static const unsigned int rxConfBcast = 0x04; /* Accept Broadcast Packets */
@@ -170,15 +170,15 @@ static char *version =
/* Choose the domain, default is 0x100 */
static u_int domain = 0x100;
-/* Scramble key, range from 0x0 to 0xffff.
- * 0x0 is no scrambling.
+/* Scramble key, range from 0x0 to 0xffff.
+ * 0x0 is no scrambling.
*/
static u_int scramble_key = 0x0;
-/* Shared memory speed, in ns. The documentation states that
- * the card should not be read faster than every 400ns.
- * This timing should be provided by the HBA. If it becomes a
- * problem, try setting mem_speed to 400.
+/* Shared memory speed, in ns. The documentation states that
+ * the card should not be read faster than every 400ns.
+ * This timing should be provided by the HBA. If it becomes a
+ * problem, try setting mem_speed to 400.
*/
static int mem_speed;
@@ -247,7 +247,7 @@ struct site_survey {
u_short length;
u_char struct_revision;
u_char roaming_state;
-
+
u_char sp_existsFlag;
u_char sp_link_quality;
u_char sp_max_link_quality;
@@ -257,12 +257,12 @@ struct site_survey {
u_char sp_goodness;
u_char sp_hotheadcount;
u_char roaming_condition;
-
+
net_addr sp;
u_char numAPs;
net_addr nearByAccessPoints[MAX_ESA];
-};
-
+};
+
typedef struct netwave_private {
struct pcmcia_device *p_dev;
spinlock_t spinlock; /* Serialize access to the hardware (SMP) */
@@ -279,7 +279,7 @@ typedef struct netwave_private {
* The Netwave card is little-endian, so won't work for big endian
* systems.
*/
-static inline unsigned short get_uint16(u_char __iomem *staddr)
+static inline unsigned short get_uint16(u_char __iomem *staddr)
{
return readw(staddr); /* Return only 16 bits */
}
@@ -289,38 +289,38 @@ static inline short get_int16(u_char __iomem * staddr)
return readw(staddr);
}
-/*
- * Wait until the WOC (Write Operation Complete) bit in the
- * ASR (Adapter Status Register) is asserted.
- * This should have aborted if it takes too long time.
+/*
+ * Wait until the WOC (Write Operation Complete) bit in the
+ * ASR (Adapter Status Register) is asserted.
+ * This should have aborted if it takes too long time.
*/
static inline void wait_WOC(unsigned int iobase)
{
/* Spin lock */
- while ((inb(iobase + NETWAVE_REG_ASR) & 0x8) != 0x8) ;
+ while ((inb(iobase + NETWAVE_REG_ASR) & 0x8) != 0x8) ;
}
-static void netwave_snapshot(netwave_private *priv, u_char __iomem *ramBase,
+static void netwave_snapshot(netwave_private *priv, u_char __iomem *ramBase,
unsigned int iobase) {
u_short resultBuffer;
- /* if time since last snapshot is > 1 sec. (100 jiffies?) then take
- * new snapshot, else return cached data. This is the recommended rate.
+ /* if time since last snapshot is > 1 sec. (100 jiffies?) then take
+ * new snapshot, else return cached data. This is the recommended rate.
*/
- if ( jiffies - priv->lastExec > 100) {
- /* Take site survey snapshot */
+ if ( jiffies - priv->lastExec > 100) {
+ /* Take site survey snapshot */
/*printk( KERN_DEBUG "Taking new snapshot. %ld\n", jiffies -
priv->lastExec); */
- wait_WOC(iobase);
- writeb(NETWAVE_CMD_SSS, ramBase + NETWAVE_EREG_CB + 0);
- writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
- wait_WOC(iobase);
-
- /* Get result and copy to cach */
- resultBuffer = readw(ramBase + NETWAVE_EREG_CRBP);
- copy_from_pc( &priv->nss, ramBase+resultBuffer,
- sizeof(struct site_survey));
- }
+ wait_WOC(iobase);
+ writeb(NETWAVE_CMD_SSS, ramBase + NETWAVE_EREG_CB + 0);
+ writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
+ wait_WOC(iobase);
+
+ /* Get result and copy to cach */
+ resultBuffer = readw(ramBase + NETWAVE_EREG_CRBP);
+ copy_from_pc( &priv->nss, ramBase+resultBuffer,
+ sizeof(struct site_survey));
+ }
}
/*
@@ -330,21 +330,21 @@ static void netwave_snapshot(netwave_private *priv, u_char __iomem *ramBase,
*
*/
static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev)
-{
+{
unsigned long flags;
unsigned int iobase = dev->base_addr;
netwave_private *priv = netdev_priv(dev);
u_char __iomem *ramBase = priv->ramBase;
struct iw_statistics* wstats;
-
+
wstats = &priv->iw_stats;
spin_lock_irqsave(&priv->spinlock, flags);
-
+
netwave_snapshot( priv, ramBase, iobase);
wstats->status = priv->nss.roaming_state;
- wstats->qual.qual = readb( ramBase + NETWAVE_EREG_SPCQ);
+ wstats->qual.qual = readb( ramBase + NETWAVE_EREG_SPCQ);
wstats->qual.level = readb( ramBase + NETWAVE_EREG_ISPLQ);
wstats->qual.noise = readb( ramBase + NETWAVE_EREG_SPU) & 0x3f;
wstats->discard.nwid = 0L;
@@ -352,7 +352,7 @@ static struct iw_statistics *netwave_get_wireless_stats(struct net_device *dev)
wstats->discard.misc = 0L;
spin_unlock_irqrestore(&priv->spinlock, flags);
-
+
return &priv->iw_stats;
}
@@ -370,8 +370,8 @@ static const struct net_device_ops netwave_netdev_ops = {
/*
* Function netwave_attach (void)
*
- * Creates an "instance" of the driver, allocating local data
- * structures for one device. The device is registered with Card
+ * Creates an "instance" of the driver, allocating local data
+ * structures for one device. The device is registered with Card
* Services.
*
* The dev_link structure is initialized, but we don't actually
@@ -396,15 +396,15 @@ static int netwave_probe(struct pcmcia_device *link)
/* The io structure describes IO port mapping */
link->io.NumPorts1 = 16;
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
- /* link->io.NumPorts2 = 16;
+ /* link->io.NumPorts2 = 16;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_16; */
link->io.IOAddrLines = 5;
-
+
/* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.Handler = &netwave_interrupt;
-
+
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
@@ -478,7 +478,7 @@ static int netwave_set_nwid(struct net_device *dev,
if(!wrqu->nwid.disabled) {
domain = wrqu->nwid.value;
- printk( KERN_DEBUG "Setting domain to 0x%x%02x\n",
+ printk( KERN_DEBUG "Setting domain to 0x%x%02x\n",
(domain >> 8) & 0x01, domain & 0xff);
wait_WOC(iobase);
writeb(NETWAVE_CMD_SMD, ramBase + NETWAVE_EREG_CB + 0);
@@ -489,7 +489,7 @@ static int netwave_set_nwid(struct net_device *dev,
/* ReEnable interrupts & restore flags */
spin_unlock_irqrestore(&priv->spinlock, flags);
-
+
return 0;
}
@@ -532,7 +532,7 @@ static int netwave_set_scramble(struct net_device *dev,
/* ReEnable interrupts & restore flags */
spin_unlock_irqrestore(&priv->spinlock, flags);
-
+
return 0;
}
@@ -587,19 +587,19 @@ static int netwave_get_range(struct net_device *dev,
/* Set the Wireless Extension versions */
range->we_version_compiled = WIRELESS_EXT;
range->we_version_source = 9; /* Nothing for us in v10 and v11 */
-
+
/* Set information in the range struct */
range->throughput = 450 * 1000; /* don't argue on this ! */
range->min_nwid = 0x0000;
range->max_nwid = 0x01FF;
range->num_channels = range->num_frequency = 0;
-
+
range->sensitivity = 0x3F;
range->max_qual.qual = 255;
range->max_qual.level = 255;
range->max_qual.noise = 0;
-
+
range->num_bitrates = 1;
range->bitrate[0] = 1000000; /* 1 Mb/s */
@@ -635,7 +635,7 @@ static int netwave_get_snap(struct net_device *dev,
/* ReEnable interrupts & restore flags */
spin_unlock_irqrestore(&priv->spinlock, flags);
-
+
return(0);
}
@@ -646,8 +646,8 @@ static int netwave_get_snap(struct net_device *dev,
static const struct iw_priv_args netwave_private_args[] = {
/*{ cmd, set_args, get_args, name } */
- { SIOCGIPSNAP, 0,
- IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | sizeof(struct site_survey),
+ { SIOCGIPSNAP, 0,
+ IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | sizeof(struct site_survey),
"getsitesurvey" },
};
@@ -719,9 +719,9 @@ static const struct iw_handler_def netwave_handler_def =
/*
* Function netwave_pcmcia_config (link)
*
- * netwave_pcmcia_config() is scheduled to run after a CARD_INSERTION
+ * netwave_pcmcia_config() is scheduled to run after a CARD_INSERTION
* event is received, to configure the PCMCIA socket, and to make the
- * device available to the system.
+ * device available to the system.
*
*/
@@ -778,7 +778,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
req.Base = 0; req.Size = 0x8000;
req.AccessSpeed = mem_speed;
CS_CHECK(RequestWindow, pcmcia_request_window(&link, &req, &link->win));
- mem.CardOffset = 0x20000; mem.Page = 0;
+ mem.CardOffset = 0x20000; mem.Page = 0;
CS_CHECK(MapMemPage, pcmcia_map_mem_page(link->win, &mem));
/* Store base address of the common window frame */
@@ -801,7 +801,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
netwave_doreset(dev->base_addr, ramBase);
/* Read the ethernet address and fill in the Netwave registers. */
- for (i = 0; i < 6; i++)
+ for (i = 0; i < 6; i++)
dev->dev_addr[i] = readb(ramBase + NETWAVE_EREG_PA + i);
printk(KERN_INFO "%s: Netwave: port %#3lx, irq %d, mem %lx, "
@@ -813,7 +813,7 @@ static int netwave_pcmcia_config(struct pcmcia_device *link) {
dev->dev_addr);
/* get revision words */
- printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n",
+ printk(KERN_DEBUG "Netwave_reset: revision %04x %04x\n",
get_uint16(ramBase + NETWAVE_EREG_ARW),
get_uint16(ramBase + NETWAVE_EREG_ARW+2));
return 0;
@@ -884,7 +884,7 @@ static void netwave_doreset(unsigned int ioBase, u_char __iomem *ramBase)
/*
* Function netwave_reset (dev)
*
- * Reset and restore all of the netwave registers
+ * Reset and restore all of the netwave registers
*/
static void netwave_reset(struct net_device *dev) {
/* u_char state; */
@@ -899,24 +899,24 @@ static void netwave_reset(struct net_device *dev) {
/* Reset card */
netwave_doreset(iobase, ramBase);
printk(KERN_DEBUG "netwave_reset: Done with hardware reset\n");
-
+
/* Write a NOP to check the card */
wait_WOC(iobase);
writeb(NETWAVE_CMD_NOP, ramBase + NETWAVE_EREG_CB + 0);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
-
+
/* Set receive conf */
wait_WOC(iobase);
writeb(NETWAVE_CMD_SRC, ramBase + NETWAVE_EREG_CB + 0);
writeb(rxConfRxEna + rxConfBcast, ramBase + NETWAVE_EREG_CB + 1);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 2);
-
+
/* Set transmit conf */
wait_WOC(iobase);
writeb(NETWAVE_CMD_STC, ramBase + NETWAVE_EREG_CB + 0);
writeb(txConfTxEna, ramBase + NETWAVE_EREG_CB + 1);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 2);
-
+
/* Now set the MU Domain */
printk(KERN_DEBUG "Setting domain to 0x%x%02x\n", (domain >> 8) & 0x01, domain & 0xff);
wait_WOC(iobase);
@@ -924,7 +924,7 @@ static void netwave_reset(struct net_device *dev) {
writeb(domain & 0xff, ramBase + NETWAVE_EREG_CB + 1);
writeb((domain>>8) & 0x01, ramBase + NETWAVE_EREG_CB + 2);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 3);
-
+
/* Set scramble key */
printk(KERN_DEBUG "Setting scramble key to 0x%x\n", scramble_key);
wait_WOC(iobase);
@@ -934,8 +934,8 @@ static void netwave_reset(struct net_device *dev) {
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 3);
/* Enable interrupts, bit 4 high to keep unused
- * source from interrupting us, bit 2 high to
- * set interrupt enable, 567 to enable TxDN,
+ * source from interrupting us, bit 2 high to
+ * set interrupt enable, 567 to enable TxDN,
* RxErr and RxRdy
*/
wait_WOC(iobase);
@@ -946,29 +946,29 @@ static void netwave_reset(struct net_device *dev) {
* skriv 80 til d000:3688
* sjekk om det ble 80
*/
-
+
/* Enable Receiver */
wait_WOC(iobase);
writeb(NETWAVE_CMD_ER, ramBase + NETWAVE_EREG_CB + 0);
writeb(NETWAVE_CMD_EOC, ramBase + NETWAVE_EREG_CB + 1);
-
+
/* Set the IENA bit in COR */
wait_WOC(iobase);
outb(corConfIENA + corConfLVLREQ, iobase + NETWAVE_REG_COR);
}
/*
- * Function netwave_hw_xmit (data, len, dev)
+ * Function netwave_hw_xmit (data, len, dev)
*/
static int netwave_hw_xmit(unsigned char* data, int len,
struct net_device* dev) {
unsigned long flags;
unsigned int TxFreeList,
curBuff,
- MaxData,
+ MaxData,
DataOffset;
- int tmpcount;
-
+ int tmpcount;
+
netwave_private *priv = netdev_priv(dev);
u_char __iomem * ramBase = priv->ramBase;
unsigned int iobase = dev->base_addr;
@@ -999,23 +999,23 @@ static int netwave_hw_xmit(unsigned char* data, int len,
TxFreeList = get_uint16(ramBase + NETWAVE_EREG_TDP);
MaxData = get_uint16(ramBase + NETWAVE_EREG_TDP+2);
DataOffset = get_uint16(ramBase + NETWAVE_EREG_TDP+4);
-
+
DEBUG(3, "TxFreeList %x, MaxData %x, DataOffset %x\n",
TxFreeList, MaxData, DataOffset);
/* Copy packet to the adapter fragment buffers */
- curBuff = TxFreeList;
- tmpcount = 0;
+ curBuff = TxFreeList;
+ tmpcount = 0;
while (tmpcount < len) {
- int tmplen = len - tmpcount;
- copy_to_pc(ramBase + curBuff + DataOffset, data + tmpcount,
+ int tmplen = len - tmpcount;
+ copy_to_pc(ramBase + curBuff + DataOffset, data + tmpcount,
(tmplen < MaxData) ? tmplen : MaxData);
tmpcount += MaxData;
-
+
/* Advance to next buffer */
curBuff = get_uint16(ramBase + curBuff);
}
-
+
/* Now issue transmit list */
wait_WOC(iobase);
writeb(NETWAVE_CMD_TL, ramBase + NETWAVE_EREG_CB + 0);
@@ -1040,7 +1040,7 @@ static netdev_tx_t netwave_start_xmit(struct sk_buff *skb,
{
short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
unsigned char* buf = skb->data;
-
+
if (netwave_hw_xmit( buf, length, dev) == 1) {
/* Some error, let's make them call us another time? */
netif_start_queue(dev);
@@ -1048,7 +1048,7 @@ static netdev_tx_t netwave_start_xmit(struct sk_buff *skb,
dev->trans_start = jiffies;
}
dev_kfree_skb(skb);
-
+
return NETDEV_TX_OK;
} /* netwave_start_xmit */
@@ -1056,7 +1056,7 @@ static netdev_tx_t netwave_start_xmit(struct sk_buff *skb,
* Function netwave_interrupt (irq, dev_id)
*
* This function is the interrupt handler for the Netwave card. This
- * routine will be called whenever:
+ * routine will be called whenever:
* 1. A packet is received.
* 2. A packet has successfully been transferred and the unit is
* ready to transmit another packet.
@@ -1070,29 +1070,29 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
struct netwave_private *priv = netdev_priv(dev);
struct pcmcia_device *link = priv->p_dev;
int i;
-
+
if (!netif_device_present(dev))
return IRQ_NONE;
-
+
iobase = dev->base_addr;
ramBase = priv->ramBase;
-
+
/* Now find what caused the interrupt, check while interrupts ready */
for (i = 0; i < 10; i++) {
u_char status;
-
- wait_WOC(iobase);
+
+ wait_WOC(iobase);
if (!(inb(iobase+NETWAVE_REG_CCSR) & 0x02))
break; /* None of the interrupt sources asserted (normal exit) */
-
+
status = inb(iobase + NETWAVE_REG_ASR);
-
+
if (!pcmcia_dev_present(link)) {
DEBUG(1, "netwave_interrupt: Interrupt with status 0x%x "
"from removed or suspended card!\n", status);
break;
}
-
+
/* RxRdy */
if (status & 0x80) {
netwave_rx(dev);
@@ -1102,24 +1102,24 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
/* RxErr */
if (status & 0x40) {
u_char rser;
-
- rser = readb(ramBase + NETWAVE_EREG_RSER);
-
+
+ rser = readb(ramBase + NETWAVE_EREG_RSER);
+
if (rser & 0x04) {
++dev->stats.rx_dropped;
++dev->stats.rx_crc_errors;
}
if (rser & 0x02)
++dev->stats.rx_frame_errors;
-
+
/* Clear the RxErr bit in RSER. RSER+4 is the
- * write part. Also clear the RxCRC (0x04) and
+ * write part. Also clear the RxCRC (0x04) and
* RxBig (0x02) bits if present */
wait_WOC(iobase);
writeb(0x40 | (rser & 0x06), ramBase + NETWAVE_EREG_RSER + 4);
/* Write bit 6 high to ASCC to clear RxErr in ASR,
- * WOC must be set first!
+ * WOC must be set first!
*/
wait_WOC(iobase);
writeb(0x40, ramBase + NETWAVE_EREG_ASCC);
@@ -1132,33 +1132,33 @@ static irqreturn_t netwave_interrupt(int irq, void* dev_id)
int txStatus;
txStatus = readb(ramBase + NETWAVE_EREG_TSER);
- DEBUG(3, "Transmit done. TSER = %x id %x\n",
+ DEBUG(3, "Transmit done. TSER = %x id %x\n",
txStatus, readb(ramBase + NETWAVE_EREG_TSER + 1));
-
+
if (txStatus & 0x20) {
/* Transmitting was okay, clear bits */
wait_WOC(iobase);
writeb(0x2f, ramBase + NETWAVE_EREG_TSER + 4);
++dev->stats.tx_packets;
}
-
+
if (txStatus & 0xd0) {
if (txStatus & 0x80) {
++dev->stats.collisions; /* Because of /proc/net/dev*/
/* ++dev->stats.tx_aborted_errors; */
/* printk("Collision. %ld\n", jiffies - dev->trans_start); */
}
- if (txStatus & 0x40)
+ if (txStatus & 0x40)
++dev->stats.tx_carrier_errors;
/* 0x80 TxGU Transmit giveup - nine times and no luck
* 0x40 TxNOAP No access point. Discarded packet.
- * 0x10 TxErr Transmit error. Always set when
+ * 0x10 TxErr Transmit error. Always set when
* TxGU and TxNOAP is set. (Those are the only ones
* to set TxErr).
*/
- DEBUG(3, "netwave_interrupt: TxDN with error status %x\n",
+ DEBUG(3, "netwave_interrupt: TxDN with error status %x\n",
txStatus);
-
+
/* Clear out TxGU, TxNOAP, TxErr and TxTrys */
wait_WOC(iobase);
writeb(0xdf & txStatus, ramBase+NETWAVE_EREG_TSER+4);
@@ -1210,31 +1210,31 @@ static int netwave_rx(struct net_device *dev)
int dataCount, dataOffset;
int i;
u_char *ptr;
-
+
DEBUG(3, "xinw_rx: Receiving ... \n");
/* Receive max 10 packets for now. */
for (i = 0; i < 10; i++) {
/* Any packets? */
wait_WOC(iobase);
- rxStatus = readb(ramBase + NETWAVE_EREG_RSER);
+ rxStatus = readb(ramBase + NETWAVE_EREG_RSER);
if ( !( rxStatus & 0x80)) /* No more packets */
break;
-
+
/* Check if multicast/broadcast or other */
/* multicast = (rxStatus & 0x20); */
-
+
/* The receive list pointer and length of the packet */
wait_WOC(iobase);
rcvLen = get_int16( ramBase + NETWAVE_EREG_RDP);
rcvList = get_uint16( ramBase + NETWAVE_EREG_RDP + 2);
-
+
if (rcvLen < 0) {
- printk(KERN_DEBUG "netwave_rx: Receive packet with len %d\n",
+ printk(KERN_DEBUG "netwave_rx: Receive packet with len %d\n",
rcvLen);
return 0;
}
-
+
skb = dev_alloc_skb(rcvLen+5);
if (skb == NULL) {
DEBUG(1, "netwave_rx: Could not allocate an sk_buff of "
@@ -1253,21 +1253,21 @@ static int netwave_rx(struct net_device *dev)
/* Copy packet fragments to the skb data area */
ptr = (u_char*) skb->data;
curBuffer = rcvList;
- tmpcount = 0;
+ tmpcount = 0;
while ( tmpcount < rcvLen) {
/* Get length and offset of current buffer */
dataCount = get_uint16( ramBase+curBuffer+2);
dataOffset = get_uint16( ramBase+curBuffer+4);
-
+
copy_from_pc( ptr + tmpcount,
ramBase+curBuffer+dataOffset, dataCount);
tmpcount += dataCount;
-
+
/* Point to next buffer */
curBuffer = get_uint16(ramBase + curBuffer);
}
-
+
skb->protocol = eth_type_trans(skb,dev);
/* Queue packet for network layer */
netif_rx(skb);
@@ -1289,7 +1289,7 @@ static int netwave_open(struct net_device *dev) {
struct pcmcia_device *link = priv->p_dev;
DEBUG(1, "netwave_open: starting.\n");
-
+
if (!pcmcia_dev_present(link))
return -ENODEV;
@@ -1297,7 +1297,7 @@ static int netwave_open(struct net_device *dev) {
netif_start_queue(dev);
netwave_reset(dev);
-
+
return 0;
}
@@ -1356,7 +1356,7 @@ static void set_multicast_list(struct net_device *dev)
netwave_private *priv = netdev_priv(dev);
u_char __iomem * ramBase = priv->ramBase;
u_char rcvMode = 0;
-
+
#ifdef PCMCIA_DEBUG
if (pc_debug > 2) {
static int old;
@@ -1367,7 +1367,7 @@ static void set_multicast_list(struct net_device *dev)
}
}
#endif
-
+
if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) {
/* Multicast Mode */
rcvMode = rxConfRxEna + rxConfAMP + rxConfBcast;
@@ -1378,7 +1378,7 @@ static void set_multicast_list(struct net_device *dev)
/* Normal mode */
rcvMode = rxConfRxEna + rxConfBcast;
}
-
+
/* printk("netwave set_multicast_list: rcvMode to %x\n", rcvMode);*/
/* Now set receive mode */
wait_WOC(iobase);
diff --git a/drivers/staging/octeon/ethernet-rgmii.c b/drivers/staging/octeon/ethernet-rgmii.c
index 8704133fe127..fbaa465d2fac 100644
--- a/drivers/staging/octeon/ethernet-rgmii.c
+++ b/drivers/staging/octeon/ethernet-rgmii.c
@@ -308,7 +308,7 @@ int cvm_oct_rgmii_init(struct net_device *dev)
/*
* Due to GMX errata in CN3XXX series chips, it is necessary
- * to take the link down immediately whne the PHY changes
+ * to take the link down immediately when the PHY changes
* state. In order to do this we call the poll function every
* time the RGMII inband status changes. This may cause
* problems if the PHY doesn't implement inband status
@@ -317,6 +317,8 @@ int cvm_oct_rgmii_init(struct net_device *dev)
if (number_rgmii_ports == 0) {
r = request_irq(OCTEON_IRQ_RML, cvm_oct_rgmii_rml_interrupt,
IRQF_SHARED, "RGMII", &number_rgmii_ports);
+ if (r != 0)
+ return r;
}
number_rgmii_ports++;
diff --git a/drivers/staging/p9auth/p9auth.c b/drivers/staging/p9auth/p9auth.c
index 8ccfff723eec..db7962621210 100644
--- a/drivers/staging/p9auth/p9auth.c
+++ b/drivers/staging/p9auth/p9auth.c
@@ -334,6 +334,7 @@ static const struct file_operations cap_fops = {
.release = cap_release,
};
+/* no __exit here because it can be called by the init function */
static void cap_cleanup_module(void)
{
int i;
@@ -360,7 +361,7 @@ static void cap_setup_cdev(struct cap_dev *dev, int index)
printk(KERN_NOTICE "Error %d adding cap%d", err, index);
}
-static int cap_init_module(void)
+static int __init cap_init_module(void)
{
int result, i;
dev_t dev = 0;
diff --git a/drivers/staging/phison/phison.c b/drivers/staging/phison/phison.c
index 270ebcb681a2..3817d7497049 100644
--- a/drivers/staging/phison/phison.c
+++ b/drivers/staging/phison/phison.c
@@ -87,12 +87,12 @@ static struct pci_driver phison_pci_driver = {
#endif
};
-static int phison_ide_init(void)
+static int __init phison_ide_init(void)
{
return pci_register_driver(&phison_pci_driver);
}
-static void phison_ide_exit(void)
+static void __exit phison_ide_exit(void)
{
pci_unregister_driver(&phison_pci_driver);
}
diff --git a/drivers/staging/poch/README b/drivers/staging/poch/README
index 842afd464993..ac76ff969a2f 100644
--- a/drivers/staging/poch/README
+++ b/drivers/staging/poch/README
@@ -1,7 +1,6 @@
TODO:
- Rx block size is limited to < 2048, hardware bug?
- Group size is limited to < page size, kernel alloc/mmap API issues
- - fix/workaround cache issues in circular buffer header
- test whether Tx is transmitting data from provided buffers
- handle device unplug case
- handle temperature above threshold
@@ -10,5 +9,128 @@ TODO:
- audit userspace interfaces
- get reserved major/minor if needed
+Sample Code:
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+#include <sys/ioctl.h>
+#include <poll.h>
+#include <stdio.h>
+#include <error.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdint.h>
+
+#include <sysfs/libsysfs.h>
+
+#include <poch.h>
+
+struct pconsume {
+ uint32_t * offsets;
+ uint32_t nfetch;
+ uint32_t nflush;
+};
+
+uint32_t offsets[10];
+
+void process_group(unsigned char *buf, uint32_t size)
+{
+ uint16_t *buf16 = (uint16_t *)buf;
+
+ printf("RX: %p %u %04x %04x %04x %04x %04x %04x\n", buf, size,
+ buf16[0], buf16[1], buf16[2], buf16[3], buf16[4], buf16[5]);
+}
+
+int main()
+{
+ struct sysfs_attribute *attr;
+ char *path;
+ int ret;
+ unsigned long mmap_size;
+ int fd;
+ unsigned char *cbuf;
+
+ uint32_t nflush;
+ struct pollfd poll_fds;
+ int count = 0;
+ int i;
+
+ path = "/sys/class/pocketchange/poch0/ch0/block_size";
+ attr = sysfs_open_attribute(path);
+ ret = sysfs_write_attribute(attr, "256", strlen("256"));
+ if (ret == -1)
+ error(1, errno, "error writing attribute %s", path);
+ sysfs_close_attribute(attr);
+
+ path = "/sys/class/pocketchange/poch0/ch0/group_size";
+ attr = sysfs_open_attribute(path);
+ ret = sysfs_write_attribute(attr, "4096", strlen("4096"));
+ if (ret == -1)
+ error(1, errno, "error writing attribute %s", path);
+ sysfs_close_attribute(attr);
+
+ path = "/sys/class/pocketchange/poch0/ch0/group_count";
+ attr = sysfs_open_attribute(path);
+ ret = sysfs_write_attribute(attr, "64", strlen("64"));
+ if (ret == -1)
+ error(1, errno, "error writing attribute %s", path);
+ sysfs_close_attribute(attr);
+
+ fd = open("/dev/ch0", O_RDWR);
+ if (fd == -1)
+ error(1, errno, "error opening device node");
+
+ path = "/sys/class/pocketchange/poch0/ch0/mmap_size";
+ attr = sysfs_open_attribute(path);
+ ret = sysfs_read_attribute(attr);
+ if (ret == -1)
+ error(1, errno, "error reading attribute %s", path);
+ printf("%s", attr->value);
+ sscanf(attr->value, "%lu", &mmap_size);
+ sysfs_close_attribute(attr);
+
+ cbuf = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE,
+ MAP_PRIVATE, fd, 0);
+ if (cbuf == MAP_FAILED)
+ error(1, errno, "error mapping DMA buffers");
+
+ ret = ioctl(fd, POCH_IOC_TRANSFER_START, 0);
+ if (ret == -1)
+ error(1, errno, "error starting transfer");
+
+ nflush = 0;
+ while (1) {
+ struct pconsume consume;
+
+ consume.offsets = offsets;
+ consume.nfetch = 10;
+ consume.nflush = nflush;
+
+ ret = ioctl(fd, POCH_IOC_CONSUME, &consume);
+ if (ret == -1)
+ error(1, errno, "error consuming groups");
+
+ nflush = consume.nfetch;
+
+ for (i = 0; i < nflush; i++) {
+ process_group(cbuf + consume.offsets[i], 4096);
+
+ count++;
+ if (count == 1000)
+ break;
+ }
+
+ if (count == 1000)
+ break;
+ }
+
+ ret = ioctl(fd, POCH_IOC_TRANSFER_STOP, 0);
+ if (ret == -1)
+ error(1, errno, "error starting transfer");
+
+ return 0;
+}
+
Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
Vijay Kumar <vijaykumar@bravegnu.org> and Jaya Kumar <jayakumar.lkml@gmail.com>
diff --git a/drivers/staging/poch/poch.c b/drivers/staging/poch/poch.c
index 2eb8e3d43c4d..9095158fb1b3 100644
--- a/drivers/staging/poch/poch.c
+++ b/drivers/staging/poch/poch.c
@@ -197,10 +197,9 @@ struct channel_info {
/* Contains the header and circular buffer exported to userspace. */
spinlock_t group_offsets_lock;
- struct poch_cbuf_header *header;
- struct page *header_pg;
- unsigned long header_size;
+ /* Last group consumed by user space. */
+ unsigned int consumed;
/* Last group indicated as 'complete' to user space. */
unsigned int transfer;
@@ -245,6 +244,16 @@ struct poch_dev {
struct device *dev;
};
+static int synth_rx;
+module_param(synth_rx, bool, 0600);
+MODULE_PARM_DESC(synth_rx,
+ "Synthesize received values using a counter. Default: No");
+
+static int loopback;
+module_param(loopback, bool, 0600);
+MODULE_PARM_DESC(loopback,
+ "Enable hardware loopback of trasnmitted data. Default: No");
+
static dev_t poch_first_dev;
static struct class *poch_cls;
static DEFINE_IDR(poch_ids);
@@ -317,14 +326,12 @@ static ssize_t show_mmap_size(struct device *dev,
int len;
unsigned long mmap_size;
unsigned long group_pages;
- unsigned long header_pages;
unsigned long total_group_pages;
group_pages = npages(channel->group_size);
- header_pages = npages(channel->header_size);
total_group_pages = group_pages * channel->group_count;
- mmap_size = (header_pages + total_group_pages) * PAGE_SIZE;
+ mmap_size = total_group_pages * PAGE_SIZE;
len = sprintf(buf, "%lu\n", mmap_size);
return len;
}
@@ -357,10 +364,8 @@ static int poch_channel_alloc_groups(struct channel_info *channel)
{
unsigned long i;
unsigned long group_pages;
- unsigned long header_pages;
group_pages = npages(channel->group_size);
- header_pages = npages(channel->header_size);
for (i = 0; i < channel->group_count; i++) {
struct poch_group_info *group;
@@ -390,8 +395,7 @@ static int poch_channel_alloc_groups(struct channel_info *channel)
* this?
*/
group->dma_addr = page_to_pfn(group->pg) * PAGE_SIZE;
- group->user_offset =
- (header_pages + (i * group_pages)) * PAGE_SIZE;
+ group->user_offset = (i * group_pages) * PAGE_SIZE;
printk(KERN_INFO PFX "%ld: user_offset: 0x%lx\n", i,
group->user_offset);
@@ -476,7 +480,7 @@ static void channel_dma_init(struct channel_info *channel)
fpga + block_count_reg);
iowrite32(channel->group_count, fpga + group_count_reg);
/* FIXME: Hardcoded groups per int. Get it from sysfs? */
- iowrite32(1, fpga + groups_per_int_reg);
+ iowrite32(16, fpga + groups_per_int_reg);
/* Unlock PCI address? Not defined in the data sheet, but used
* in the reference code by Redrapids.
@@ -513,56 +517,6 @@ static void channel_dma_init(struct channel_info *channel)
}
-static int poch_channel_alloc_header(struct channel_info *channel)
-{
- struct poch_cbuf_header *header = channel->header;
- unsigned long group_offset_size;
- unsigned long tot_group_offsets_size;
-
- /* Allocate memory to hold header exported userspace */
- group_offset_size = sizeof(header->group_offsets[0]);
- tot_group_offsets_size = group_offset_size * channel->group_count;
- channel->header_size = sizeof(*header) + tot_group_offsets_size;
- channel->header_pg = alloc_pages(GFP_KERNEL | __GFP_ZERO,
- get_order(channel->header_size));
- if (!channel->header_pg)
- return -ENOMEM;
-
- channel->header = page_address(channel->header_pg);
-
- return 0;
-}
-
-static void poch_channel_free_header(struct channel_info *channel)
-{
- unsigned int order;
-
- order = get_order(channel->header_size);
- __free_pages(channel->header_pg, order);
-}
-
-static void poch_channel_init_header(struct channel_info *channel)
-{
- int i;
- struct poch_group_info *groups;
- s32 *group_offsets;
-
- channel->header->group_size_bytes = channel->group_size;
- channel->header->group_count = channel->group_count;
-
- spin_lock_init(&channel->group_offsets_lock);
-
- group_offsets = channel->header->group_offsets;
- groups = channel->groups;
-
- for (i = 0; i < channel->group_count; i++) {
- if (channel->dir == CHANNEL_DIR_RX)
- group_offsets[i] = -1;
- else
- group_offsets[i] = groups[i].user_offset;
- }
-}
-
static void __poch_channel_clear_counters(struct channel_info *channel)
{
channel->counters.pll_unlock = 0;
@@ -584,6 +538,7 @@ static int poch_channel_init(struct channel_info *channel,
if (ret != 0)
goto out;
+ channel->consumed = 0;
channel->transfer = 0;
/* Allocate memory to hold group information. */
@@ -604,12 +559,6 @@ static int poch_channel_init(struct channel_info *channel,
goto out_free_group_info;
}
- ret = poch_channel_alloc_header(channel);
- if (ret) {
- dev_err(dev, "error allocating user space header\n");
- goto out_free_groups;
- }
-
channel->fpga_iomem = poch_dev->fpga_iomem;
channel->bridge_iomem = poch_dev->bridge_iomem;
channel->iomem_lock = &poch_dev->iomem_lock;
@@ -617,14 +566,8 @@ static int poch_channel_init(struct channel_info *channel,
__poch_channel_clear_counters(channel);
- printk(KERN_WARNING "poch_channel_init_header\n");
-
- poch_channel_init_header(channel);
-
return 0;
- out_free_groups:
- poch_channel_free_groups(channel);
out_free_group_info:
kfree(channel->groups);
out:
@@ -822,14 +765,21 @@ static int poch_open(struct inode *inode, struct file *filp)
if (channel->dir == CHANNEL_DIR_TX) {
/* Flush TX FIFO and output data from cardbus. */
- iowrite32(FPGA_TX_CTL_FIFO_FLUSH
- | FPGA_TX_CTL_OUTPUT_CARDBUS,
- fpga + FPGA_TX_CTL_REG);
+ u32 ctl_val = 0;
+
+ ctl_val |= FPGA_TX_CTL_FIFO_FLUSH;
+ ctl_val |= FPGA_TX_CTL_OUTPUT_CARDBUS;
+ if (loopback)
+ ctl_val |= FPGA_TX_CTL_LOOPBACK;
+
+ iowrite32(ctl_val, fpga + FPGA_TX_CTL_REG);
} else {
/* Flush RX FIFO and output data to cardbus. */
- iowrite32(FPGA_RX_CTL_CONT_CAP
- | FPGA_RX_CTL_FIFO_FLUSH,
- fpga + FPGA_RX_CTL_REG);
+ u32 ctl_val = FPGA_RX_CTL_CONT_CAP | FPGA_RX_CTL_FIFO_FLUSH;
+ if (synth_rx)
+ ctl_val |= FPGA_RX_CTL_SYNTH_DATA;
+
+ iowrite32(ctl_val, fpga + FPGA_RX_CTL_REG);
}
atomic_inc(&channel->inited);
@@ -861,7 +811,6 @@ static int poch_release(struct inode *inode, struct file *filp)
}
atomic_dec(&channel->inited);
- poch_channel_free_header(channel);
poch_channel_free_groups(channel);
kfree(channel->groups);
atomic_inc(&channel->free);
@@ -870,7 +819,7 @@ static int poch_release(struct inode *inode, struct file *filp)
}
/*
- * Map the header and the group buffers, to user space.
+ * Map the the group buffers, to user space.
*/
static int poch_mmap(struct file *filp, struct vm_area_struct *vma)
{
@@ -880,7 +829,6 @@ static int poch_mmap(struct file *filp, struct vm_area_struct *vma)
unsigned long size;
unsigned long group_pages;
- unsigned long header_pages;
unsigned long total_group_pages;
int pg_num;
@@ -897,30 +845,16 @@ static int poch_mmap(struct file *filp, struct vm_area_struct *vma)
}
group_pages = npages(channel->group_size);
- header_pages = npages(channel->header_size);
total_group_pages = group_pages * channel->group_count;
size = vma->vm_end - vma->vm_start;
- if (size != (header_pages + total_group_pages) * PAGE_SIZE) {
+ if (size != total_group_pages * PAGE_SIZE) {
printk(KERN_WARNING PFX "required %lu bytes\n", size);
return -EINVAL;
}
start = vma->vm_start;
- /* FIXME: Cleanup required on failure? */
- pg = channel->header_pg;
- for (pg_num = 0; pg_num < header_pages; pg_num++, pg++) {
- printk(KERN_DEBUG PFX "page_count: %d\n", page_count(pg));
- printk(KERN_DEBUG PFX "%d: header: 0x%lx\n", pg_num, start);
- ret = vm_insert_page(vma, start, pg);
- if (ret) {
- printk(KERN_DEBUG "vm_insert 1 failed at %lx\n", start);
- return ret;
- }
- start += PAGE_SIZE;
- }
-
for (i = 0; i < channel->group_count; i++) {
pg = channel->groups[i].pg;
for (pg_num = 0; pg_num < group_pages; pg_num++, pg++) {
@@ -947,20 +881,16 @@ static int poch_mmap(struct file *filp, struct vm_area_struct *vma)
*/
static int poch_channel_available(struct channel_info *channel)
{
- int i;
+ int available = 0;
spin_lock_irq(&channel->group_offsets_lock);
- for (i = 0; i < channel->group_count; i++) {
- if (channel->header->group_offsets[i] != -1) {
- spin_unlock_irq(&channel->group_offsets_lock);
- return 1;
- }
- }
+ if (channel->consumed != channel->transfer)
+ available = 1;
spin_unlock_irq(&channel->group_offsets_lock);
- return 0;
+ return available;
}
static unsigned int poch_poll(struct file *filp, poll_table *pt)
@@ -1026,6 +956,51 @@ static int poch_ioctl(struct inode *inode, struct file *filp,
break;
}
break;
+ case POCH_IOC_CONSUME:
+ {
+ int available;
+ int nfetch;
+ unsigned int from;
+ unsigned int count;
+ unsigned int i, j;
+ struct poch_consume consume;
+ struct poch_consume *uconsume;
+
+ uconsume = argp;
+ ret = copy_from_user(&consume, uconsume, sizeof(consume));
+ if (ret)
+ return ret;
+
+ spin_lock_irq(&channel->group_offsets_lock);
+
+ channel->consumed += consume.nflush;
+ channel->consumed %= channel->group_count;
+
+ available = channel->transfer - channel->consumed;
+ if (available < 0)
+ available += channel->group_count;
+
+ from = channel->consumed;
+
+ spin_unlock_irq(&channel->group_offsets_lock);
+
+ nfetch = consume.nfetch;
+ count = min(available, nfetch);
+
+ for (i = 0; i < count; i++) {
+ j = (from + i) % channel->group_count;
+ ret = put_user(channel->groups[j].user_offset,
+ &consume.offsets[i]);
+ if (ret)
+ return -EFAULT;
+ }
+
+ ret = put_user(count, &uconsume->nfetch);
+ if (ret)
+ return -EFAULT;
+
+ break;
+ }
case POCH_IOC_GET_COUNTERS:
if (!access_ok(VERIFY_WRITE, argp, sizeof(struct poch_counters)))
return -EFAULT;
@@ -1073,7 +1048,6 @@ static void poch_irq_dma(struct channel_info *channel)
long groups_done;
unsigned long i, j;
struct poch_group_info *groups;
- s32 *group_offsets;
u32 curr_group_reg;
if (!atomic_read(&channel->inited))
@@ -1093,20 +1067,24 @@ static void poch_irq_dma(struct channel_info *channel)
if (groups_done <= 0)
groups_done += channel->group_count;
- group_offsets = channel->header->group_offsets;
groups = channel->groups;
spin_lock(&channel->group_offsets_lock);
for (i = 0; i < groups_done; i++) {
j = (prev_transfer + i) % channel->group_count;
- group_offsets[j] = groups[j].user_offset;
+
+ channel->transfer += 1;
+ channel->transfer %= channel->group_count;
+
+ if (channel->transfer == channel->consumed) {
+ channel->consumed += 1;
+ channel->consumed %= channel->group_count;
+ }
}
spin_unlock(&channel->group_offsets_lock);
- channel->transfer = curr_transfer;
-
wake_up_interruptible(&channel->wq);
}
diff --git a/drivers/staging/poch/poch.h b/drivers/staging/poch/poch.h
index 51a2d145798e..8b08385861fd 100644
--- a/drivers/staging/poch/poch.h
+++ b/drivers/staging/poch/poch.h
@@ -7,11 +7,8 @@
* include/linux for final version.
*
*/
-struct poch_cbuf_header {
- __s32 group_size_bytes;
- __s32 group_count;
- __s32 group_offsets[0];
-};
+
+#include <linux/types.h>
struct poch_counters {
__u32 fifo_empty;
@@ -19,6 +16,12 @@ struct poch_counters {
__u32 pll_unlock;
};
+struct poch_consume {
+ __u32 __user *offsets;
+ __u32 nfetch;
+ __u32 nflush;
+};
+
#define POCH_IOC_NUM '9'
#define POCH_IOC_TRANSFER_START _IO(POCH_IOC_NUM, 0)
@@ -27,3 +30,6 @@ struct poch_counters {
struct poch_counters)
#define POCH_IOC_SYNC_GROUP_FOR_USER _IO(POCH_IOC_NUM, 3)
#define POCH_IOC_SYNC_GROUP_FOR_DEVICE _IO(POCH_IOC_NUM, 4)
+
+#define POCH_IOC_CONSUME _IOWR(POCH_IOC_NUM, 5, \
+ struct poch_consume)
diff --git a/drivers/staging/ramzswap/Kconfig b/drivers/staging/ramzswap/Kconfig
new file mode 100644
index 000000000000..24e25691fae2
--- /dev/null
+++ b/drivers/staging/ramzswap/Kconfig
@@ -0,0 +1,21 @@
+config RAMZSWAP
+ tristate "Compressed in-memory swap device (ramzswap)"
+ depends on SWAP
+ select LZO_COMPRESS
+ select LZO_DECOMPRESS
+ default n
+ help
+ Creates virtual block devices which can be used (only) as a swap
+ disks. Pages swapped to these disks are compressed and stored in
+ memory itself.
+
+ See ramzswap.txt for more information.
+ Project home: http://compcache.googlecode.com/
+
+config RAMZSWAP_STATS
+ bool "Enable ramzswap stats"
+ depends on RAMZSWAP
+ default y
+ help
+ Enable statistics collection for ramzswap. This adds only a minimal
+ overhead. In unsure, say Y.
diff --git a/drivers/staging/ramzswap/Makefile b/drivers/staging/ramzswap/Makefile
new file mode 100644
index 000000000000..507d7dc3b864
--- /dev/null
+++ b/drivers/staging/ramzswap/Makefile
@@ -0,0 +1,3 @@
+ramzswap-objs := ramzswap_drv.o xvmalloc.o
+
+obj-$(CONFIG_RAMZSWAP) += ramzswap.o
diff --git a/drivers/staging/ramzswap/TODO b/drivers/staging/ramzswap/TODO
new file mode 100644
index 000000000000..bac40d6cb9f1
--- /dev/null
+++ b/drivers/staging/ramzswap/TODO
@@ -0,0 +1,6 @@
+TODO:
+ - Add support for swap notifiers
+ - Remove CONFIG_ARM hack
+
+Please send patches to Greg Kroah-Hartman <greg@kroah.com> and
+Nitin Gupta <ngupta@vflare.org>
diff --git a/drivers/staging/ramzswap/ramzswap.txt b/drivers/staging/ramzswap/ramzswap.txt
new file mode 100644
index 000000000000..e9f1619505a0
--- /dev/null
+++ b/drivers/staging/ramzswap/ramzswap.txt
@@ -0,0 +1,51 @@
+ramzswap: Compressed RAM based swap device
+-------------------------------------------
+
+Project home: http://compcache.googlecode.com/
+
+* Introduction
+
+It creates RAM based block devices which can be used (only) as swap disks.
+Pages swapped to these devices are compressed and stored in memory itself.
+See project home for use cases, performance numbers and a lot more.
+
+Individual ramzswap devices are configured and initialized using rzscontrol
+userspace utility as shown in examples below. See rzscontrol man page for more
+details.
+
+* Usage
+
+Following shows a typical sequence of steps for using ramzswap.
+
+1) Load Modules:
+ modprobe ramzswap num_devices=4
+ This creates 4 (uninitialized) devices: /dev/ramzswap{0,1,2,3}
+ (num_devices parameter is optional. Default: 1)
+
+2) Initialize:
+ Use rzscontrol utility to configure and initialize individual
+ ramzswap devices. Example:
+ rzscontrol /dev/ramzswap2 --init # uses default value of disksize_kb
+
+ *See rzscontrol man page for more details and examples*
+
+3) Activate:
+ swapon /dev/ramzswap2 # or any other initialized ramzswap device
+
+4) Stats:
+ rzscontrol /dev/ramzswap2 --stats
+
+5) Deactivate:
+ swapoff /dev/ramzswap2
+
+6) Reset:
+ rzscontrol /dev/ramzswap2 --reset
+ (This frees all the memory allocated for this device).
+
+
+Please report any problems at:
+ - Mailing list: linux-mm-cc at laptop dot org
+ - Issue tracker: http://code.google.com/p/compcache/issues/list
+
+Nitin Gupta
+ngupta@vflare.org
diff --git a/drivers/staging/ramzswap/ramzswap_drv.c b/drivers/staging/ramzswap/ramzswap_drv.c
new file mode 100644
index 000000000000..b839f05efbce
--- /dev/null
+++ b/drivers/staging/ramzswap/ramzswap_drv.c
@@ -0,0 +1,1435 @@
+/*
+ * Compressed RAM based swap device
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ * Project home: http://compcache.googlecode.com
+ */
+
+#define KMSG_COMPONENT "ramzswap"
+#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/bitops.h>
+#include <linux/blkdev.h>
+#include <linux/buffer_head.h>
+#include <linux/device.h>
+#include <linux/genhd.h>
+#include <linux/highmem.h>
+#include <linux/lzo.h>
+#include <linux/mutex.h>
+#include <linux/string.h>
+#include <linux/swap.h>
+#include <linux/swapops.h>
+#include <linux/vmalloc.h>
+#include <linux/version.h>
+
+#include "ramzswap_drv.h"
+
+/* Globals */
+static int ramzswap_major;
+static struct ramzswap *devices;
+
+/*
+ * Pages that compress to larger than this size are
+ * forwarded to backing swap, if present or stored
+ * uncompressed in memory otherwise.
+ */
+static unsigned int max_zpage_size;
+
+/* Module params (documentation at end) */
+static unsigned int num_devices;
+
+static int rzs_test_flag(struct ramzswap *rzs, u32 index,
+ enum rzs_pageflags flag)
+{
+ return rzs->table[index].flags & BIT(flag);
+}
+
+static void rzs_set_flag(struct ramzswap *rzs, u32 index,
+ enum rzs_pageflags flag)
+{
+ rzs->table[index].flags |= BIT(flag);
+}
+
+static void rzs_clear_flag(struct ramzswap *rzs, u32 index,
+ enum rzs_pageflags flag)
+{
+ rzs->table[index].flags &= ~BIT(flag);
+}
+
+static int page_zero_filled(void *ptr)
+{
+ unsigned int pos;
+ unsigned long *page;
+
+ page = (unsigned long *)ptr;
+
+ for (pos = 0; pos != PAGE_SIZE / sizeof(*page); pos++) {
+ if (page[pos])
+ return 0;
+ }
+
+ return 1;
+}
+
+/*
+ * memlimit cannot be greater than backing disk size.
+ */
+static void ramzswap_set_memlimit(struct ramzswap *rzs, size_t totalram_bytes)
+{
+ int memlimit_valid = 1;
+
+ if (!rzs->memlimit) {
+ pr_info("Memory limit not set.\n");
+ memlimit_valid = 0;
+ }
+
+ if (rzs->memlimit > rzs->disksize) {
+ pr_info("Memory limit cannot be greater than "
+ "disksize: limit=%zu, disksize=%zu\n",
+ rzs->memlimit, rzs->disksize);
+ memlimit_valid = 0;
+ }
+
+ if (!memlimit_valid) {
+ size_t mempart, disksize;
+ pr_info("Using default: smaller of (%u%% of RAM) and "
+ "(backing disk size).\n",
+ default_memlimit_perc_ram);
+ mempart = default_memlimit_perc_ram * (totalram_bytes / 100);
+ disksize = rzs->disksize;
+ rzs->memlimit = mempart > disksize ? disksize : mempart;
+ }
+
+ if (rzs->memlimit > totalram_bytes / 2) {
+ pr_info(
+ "Its not advisable setting limit more than half of "
+ "size of memory since we expect a 2:1 compression ratio. "
+ "Limit represents amount of *compressed* data we can keep "
+ "in memory!\n"
+ "\tMemory Size: %zu kB\n"
+ "\tLimit you selected: %zu kB\n"
+ "Continuing anyway ...\n",
+ totalram_bytes >> 10, rzs->memlimit >> 10
+ );
+ }
+
+ rzs->memlimit &= PAGE_MASK;
+ BUG_ON(!rzs->memlimit);
+}
+
+static void ramzswap_set_disksize(struct ramzswap *rzs, size_t totalram_bytes)
+{
+ if (!rzs->disksize) {
+ pr_info(
+ "disk size not provided. You can use disksize_kb module "
+ "param to specify size.\nUsing default: (%u%% of RAM).\n",
+ default_disksize_perc_ram
+ );
+ rzs->disksize = default_disksize_perc_ram *
+ (totalram_bytes / 100);
+ }
+
+ if (rzs->disksize > 2 * (totalram_bytes)) {
+ pr_info(
+ "There is little point creating a ramzswap of greater than "
+ "twice the size of memory since we expect a 2:1 compression "
+ "ratio. Note that ramzswap uses about 0.1%% of the size of "
+ "the swap device when not in use so a huge ramzswap is "
+ "wasteful.\n"
+ "\tMemory Size: %zu kB\n"
+ "\tSize you selected: %zu kB\n"
+ "Continuing anyway ...\n",
+ totalram_bytes >> 10, rzs->disksize
+ );
+ }
+
+ rzs->disksize &= PAGE_MASK;
+}
+
+/*
+ * Swap header (1st page of swap device) contains information
+ * to indentify it as a swap partition. Prepare such a header
+ * for ramzswap device (ramzswap0) so that swapon can identify
+ * it as swap partition. In case backing swap device is provided,
+ * copy its swap header.
+ */
+static int setup_swap_header(struct ramzswap *rzs, union swap_header *s)
+{
+ int ret = 0;
+ struct page *page;
+ struct address_space *mapping;
+ union swap_header *backing_swap_header;
+
+ /*
+ * There is no backing swap device. Create a swap header
+ * that is acceptable by swapon.
+ */
+ if (!rzs->backing_swap) {
+ s->info.version = 1;
+ s->info.last_page = (rzs->disksize >> PAGE_SHIFT) - 1;
+ s->info.nr_badpages = 0;
+ memcpy(s->magic.magic, "SWAPSPACE2", 10);
+ return 0;
+ }
+
+ /*
+ * We have a backing swap device. Copy its swap header
+ * to ramzswap device header. If this header contains
+ * invalid information (backing device not a swap
+ * partition, etc.), swapon will fail for ramzswap
+ * which is correct behavior - we don't want to swap
+ * over filesystem partition!
+ */
+
+ /* Read the backing swap header (code from sys_swapon) */
+ mapping = rzs->swap_file->f_mapping;
+ if (!mapping->a_ops->readpage) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ page = read_mapping_page(mapping, 0, rzs->swap_file);
+ if (IS_ERR(page)) {
+ ret = PTR_ERR(page);
+ goto out;
+ }
+
+ backing_swap_header = kmap(page);
+ memcpy(s, backing_swap_header, sizeof(*s));
+ if (s->info.nr_badpages) {
+ pr_info("Cannot use backing swap with bad pages (%u)\n",
+ s->info.nr_badpages);
+ ret = -EINVAL;
+ }
+ /*
+ * ramzswap disksize equals number of usable pages in backing
+ * swap. Set last_page in swap header to match this disksize
+ * ('last_page' means 0-based index of last usable swap page).
+ */
+ s->info.last_page = (rzs->disksize >> PAGE_SHIFT) - 1;
+ kunmap(page);
+
+out:
+ return ret;
+}
+
+static void ramzswap_flush_dcache_page(struct page *page)
+{
+#ifdef CONFIG_ARM
+ int flag = 0;
+ /*
+ * Ugly hack to get flush_dcache_page() work on ARM.
+ * page_mapping(page) == NULL after clearing this swap cache flag.
+ * Without clearing this flag, flush_dcache_page() will simply set
+ * "PG_dcache_dirty" bit and return.
+ */
+ if (PageSwapCache(page)) {
+ flag = 1;
+ ClearPageSwapCache(page);
+ }
+#endif
+ flush_dcache_page(page);
+#ifdef CONFIG_ARM
+ if (flag)
+ SetPageSwapCache(page);
+#endif
+}
+
+void ramzswap_ioctl_get_stats(struct ramzswap *rzs,
+ struct ramzswap_ioctl_stats *s)
+{
+ strncpy(s->backing_swap_name, rzs->backing_swap_name,
+ MAX_SWAP_NAME_LEN - 1);
+ s->backing_swap_name[MAX_SWAP_NAME_LEN - 1] = '\0';
+
+ s->disksize = rzs->disksize;
+ s->memlimit = rzs->memlimit;
+
+#if defined(CONFIG_RAMZSWAP_STATS)
+ {
+ struct ramzswap_stats *rs = &rzs->stats;
+ size_t succ_writes, mem_used;
+ unsigned int good_compress_perc = 0, no_compress_perc = 0;
+
+ mem_used = xv_get_total_size_bytes(rzs->mem_pool)
+ + (rs->pages_expand << PAGE_SHIFT);
+ succ_writes = rs->num_writes - rs->failed_writes;
+
+ if (succ_writes && rs->pages_stored) {
+ good_compress_perc = rs->good_compress * 100
+ / rs->pages_stored;
+ no_compress_perc = rs->pages_expand * 100
+ / rs->pages_stored;
+ }
+
+ s->num_reads = rs->num_reads;
+ s->num_writes = rs->num_writes;
+ s->failed_reads = rs->failed_reads;
+ s->failed_writes = rs->failed_writes;
+ s->invalid_io = rs->invalid_io;
+ s->pages_zero = rs->pages_zero;
+
+ s->good_compress_pct = good_compress_perc;
+ s->pages_expand_pct = no_compress_perc;
+
+ s->pages_stored = rs->pages_stored;
+ s->pages_used = mem_used >> PAGE_SHIFT;
+ s->orig_data_size = rs->pages_stored << PAGE_SHIFT;
+ s->compr_data_size = rs->compr_size;
+ s->mem_used_total = mem_used;
+
+ s->bdev_num_reads = rs->bdev_num_reads;
+ s->bdev_num_writes = rs->bdev_num_writes;
+ }
+#endif /* CONFIG_RAMZSWAP_STATS */
+}
+
+static int add_backing_swap_extent(struct ramzswap *rzs,
+ pgoff_t phy_pagenum,
+ pgoff_t num_pages)
+{
+ unsigned int idx;
+ struct list_head *head;
+ struct page *curr_page, *new_page;
+ unsigned int extents_per_page = PAGE_SIZE /
+ sizeof(struct ramzswap_backing_extent);
+
+ idx = rzs->num_extents % extents_per_page;
+ if (!idx) {
+ new_page = alloc_page(__GFP_ZERO);
+ if (!new_page)
+ return -ENOMEM;
+
+ if (rzs->num_extents) {
+ curr_page = virt_to_page(rzs->curr_extent);
+ head = &curr_page->lru;
+ } else {
+ head = &rzs->backing_swap_extent_list;
+ }
+
+ list_add(&new_page->lru, head);
+ rzs->curr_extent = page_address(new_page);
+ }
+
+ rzs->curr_extent->phy_pagenum = phy_pagenum;
+ rzs->curr_extent->num_pages = num_pages;
+
+ pr_debug("add_extent: idx=%u, phy_pgnum=%lu, num_pgs=%lu, "
+ "pg_last=%lu, curr_ext=%p\n", idx, phy_pagenum, num_pages,
+ phy_pagenum + num_pages - 1, rzs->curr_extent);
+
+ if (idx != extents_per_page - 1)
+ rzs->curr_extent++;
+
+ return 0;
+}
+
+static int setup_backing_swap_extents(struct ramzswap *rzs,
+ struct inode *inode, unsigned long *num_pages)
+{
+ int ret = 0;
+ unsigned blkbits;
+ unsigned blocks_per_page;
+ pgoff_t contig_pages = 0, total_pages = 0;
+ pgoff_t pagenum = 0, prev_pagenum = 0;
+ sector_t probe_block = 0;
+ sector_t last_block;
+
+ blkbits = inode->i_blkbits;
+ blocks_per_page = PAGE_SIZE >> blkbits;
+
+ last_block = i_size_read(inode) >> blkbits;
+ while (probe_block + blocks_per_page <= last_block) {
+ unsigned block_in_page;
+ sector_t first_block;
+
+ first_block = bmap(inode, probe_block);
+ if (first_block == 0)
+ goto bad_bmap;
+
+ /* It must be PAGE_SIZE aligned on-disk */
+ if (first_block & (blocks_per_page - 1)) {
+ probe_block++;
+ goto probe_next;
+ }
+
+ /* All blocks within this page must be contiguous on disk */
+ for (block_in_page = 1; block_in_page < blocks_per_page;
+ block_in_page++) {
+ sector_t block;
+
+ block = bmap(inode, probe_block + block_in_page);
+ if (block == 0)
+ goto bad_bmap;
+ if (block != first_block + block_in_page) {
+ /* Discontiguity */
+ probe_block++;
+ goto probe_next;
+ }
+ }
+
+ /*
+ * We found a PAGE_SIZE length, PAGE_SIZE aligned
+ * run of blocks.
+ */
+ pagenum = first_block >> (PAGE_SHIFT - blkbits);
+
+ if (total_pages && (pagenum != prev_pagenum + 1)) {
+ ret = add_backing_swap_extent(rzs, prev_pagenum -
+ (contig_pages - 1), contig_pages);
+ if (ret < 0)
+ goto out;
+ rzs->num_extents++;
+ contig_pages = 0;
+ }
+ total_pages++;
+ contig_pages++;
+ prev_pagenum = pagenum;
+ probe_block += blocks_per_page;
+
+probe_next:
+ continue;
+ }
+
+ if (contig_pages) {
+ pr_debug("adding last extent: pagenum=%lu, "
+ "contig_pages=%lu\n", pagenum, contig_pages);
+ ret = add_backing_swap_extent(rzs,
+ prev_pagenum - (contig_pages - 1), contig_pages);
+ if (ret < 0)
+ goto out;
+ rzs->num_extents++;
+ }
+ if (!rzs->num_extents) {
+ pr_err("No swap extents found!\n");
+ ret = -EINVAL;
+ }
+
+ if (!ret) {
+ *num_pages = total_pages;
+ pr_info("Found %lu extents containing %luk\n",
+ rzs->num_extents, *num_pages << (PAGE_SHIFT - 10));
+ }
+ goto out;
+
+bad_bmap:
+ pr_err("Backing swapfile has holes\n");
+ ret = -EINVAL;
+out:
+ while (ret && !list_empty(&rzs->backing_swap_extent_list)) {
+ struct page *page;
+ struct list_head *entry = rzs->backing_swap_extent_list.next;
+ page = list_entry(entry, struct page, lru);
+ list_del(entry);
+ __free_page(page);
+ }
+ return ret;
+}
+
+static void map_backing_swap_extents(struct ramzswap *rzs)
+{
+ struct ramzswap_backing_extent *se;
+ struct page *table_page, *se_page;
+ unsigned long num_pages, num_table_pages, entry;
+ unsigned long se_idx, span;
+ unsigned entries_per_page = PAGE_SIZE / sizeof(*rzs->table);
+ unsigned extents_per_page = PAGE_SIZE / sizeof(*se);
+
+ /* True for block device */
+ if (!rzs->num_extents)
+ return;
+
+ se_page = list_entry(rzs->backing_swap_extent_list.next,
+ struct page, lru);
+ se = page_address(se_page);
+ span = se->num_pages;
+ num_pages = rzs->disksize >> PAGE_SHIFT;
+ num_table_pages = DIV_ROUND_UP(num_pages * sizeof(*rzs->table),
+ PAGE_SIZE);
+
+ entry = 0;
+ se_idx = 0;
+ while (num_table_pages--) {
+ table_page = vmalloc_to_page(&rzs->table[entry]);
+ while (span <= entry) {
+ se_idx++;
+ if (se_idx == rzs->num_extents)
+ BUG();
+
+ if (!(se_idx % extents_per_page)) {
+ se_page = list_entry(se_page->lru.next,
+ struct page, lru);
+ se = page_address(se_page);
+ } else
+ se++;
+
+ span += se->num_pages;
+ }
+ table_page->mapping = (struct address_space *)se;
+ table_page->private = se->num_pages - (span - entry);
+ pr_debug("map_table: entry=%lu, span=%lu, map=%p, priv=%lu\n",
+ entry, span, table_page->mapping, table_page->private);
+ entry += entries_per_page;
+ }
+}
+
+/*
+ * Check if value of backing_swap module param is sane.
+ * Claim this device and set ramzswap size equal to
+ * size of this block device.
+ */
+static int setup_backing_swap(struct ramzswap *rzs)
+{
+ int ret = 0;
+ size_t disksize;
+ unsigned long num_pages = 0;
+ struct inode *inode;
+ struct file *swap_file;
+ struct address_space *mapping;
+ struct block_device *bdev = NULL;
+
+ if (!rzs->backing_swap_name[0]) {
+ pr_debug("backing_swap param not given\n");
+ goto out;
+ }
+
+ pr_info("Using backing swap device: %s\n", rzs->backing_swap_name);
+
+ swap_file = filp_open(rzs->backing_swap_name,
+ O_RDWR | O_LARGEFILE, 0);
+ if (IS_ERR(swap_file)) {
+ pr_err("Error opening backing device: %s\n",
+ rzs->backing_swap_name);
+ ret = -EINVAL;
+ goto out;
+ }
+
+ mapping = swap_file->f_mapping;
+ inode = mapping->host;
+
+ if (S_ISBLK(inode->i_mode)) {
+ bdev = I_BDEV(inode);
+ ret = bd_claim(bdev, setup_backing_swap);
+ if (ret < 0) {
+ bdev = NULL;
+ goto bad_param;
+ }
+ disksize = i_size_read(inode);
+ } else if (S_ISREG(inode->i_mode)) {
+ bdev = inode->i_sb->s_bdev;
+ if (IS_SWAPFILE(inode)) {
+ ret = -EBUSY;
+ goto bad_param;
+ }
+ ret = setup_backing_swap_extents(rzs, inode, &num_pages);
+ if (ret < 0)
+ goto bad_param;
+ disksize = num_pages << PAGE_SHIFT;
+ } else {
+ goto bad_param;
+ }
+
+ rzs->swap_file = swap_file;
+ rzs->backing_swap = bdev;
+ rzs->disksize = disksize;
+ BUG_ON(!rzs->disksize);
+
+ return 0;
+
+bad_param:
+ if (bdev)
+ bd_release(bdev);
+ filp_close(swap_file, NULL);
+
+out:
+ rzs->backing_swap = NULL;
+ return ret;
+}
+
+/*
+ * Map logical page number 'pagenum' to physical page number
+ * on backing swap device. For block device, this is a nop.
+ */
+u32 map_backing_swap_page(struct ramzswap *rzs, u32 pagenum)
+{
+ u32 skip_pages, entries_per_page;
+ size_t delta, se_offset, skipped;
+ struct page *table_page, *se_page;
+ struct ramzswap_backing_extent *se;
+
+ if (!rzs->num_extents)
+ return pagenum;
+
+ entries_per_page = PAGE_SIZE / sizeof(*rzs->table);
+
+ table_page = vmalloc_to_page(&rzs->table[pagenum]);
+ se = (struct ramzswap_backing_extent *)table_page->mapping;
+ se_page = virt_to_page(se);
+
+ skip_pages = pagenum - (pagenum / entries_per_page * entries_per_page);
+ se_offset = table_page->private + skip_pages;
+
+ if (se_offset < se->num_pages)
+ return se->phy_pagenum + se_offset;
+
+ skipped = se->num_pages - table_page->private;
+ do {
+ struct ramzswap_backing_extent *se_base;
+ u32 se_entries_per_page = PAGE_SIZE / sizeof(*se);
+
+ /* Get next swap extent */
+ se_base = (struct ramzswap_backing_extent *)
+ page_address(se_page);
+ if (se - se_base == se_entries_per_page - 1) {
+ se_page = list_entry(se_page->lru.next,
+ struct page, lru);
+ se = page_address(se_page);
+ } else {
+ se++;
+ }
+
+ skipped += se->num_pages;
+ } while (skipped < skip_pages);
+
+ delta = skipped - skip_pages;
+ se_offset = se->num_pages - delta;
+
+ return se->phy_pagenum + se_offset;
+}
+
+static void ramzswap_free_page(struct ramzswap *rzs, size_t index)
+{
+ u32 clen;
+ void *obj;
+
+ struct page *page = rzs->table[index].page;
+ u32 offset = rzs->table[index].offset;
+
+ if (unlikely(!page)) {
+ if (rzs_test_flag(rzs, index, RZS_ZERO)) {
+ rzs_clear_flag(rzs, index, RZS_ZERO);
+ stat_dec(rzs->stats.pages_zero);
+ }
+ return;
+ }
+
+ if (unlikely(rzs_test_flag(rzs, index, RZS_UNCOMPRESSED))) {
+ clen = PAGE_SIZE;
+ __free_page(page);
+ rzs_clear_flag(rzs, index, RZS_UNCOMPRESSED);
+ stat_dec(rzs->stats.pages_expand);
+ goto out;
+ }
+
+ obj = kmap_atomic(page, KM_USER0) + offset;
+ clen = xv_get_object_size(obj) - sizeof(struct zobj_header);
+ kunmap_atomic(obj, KM_USER0);
+
+ xv_free(rzs->mem_pool, page, offset);
+ if (clen <= PAGE_SIZE / 2)
+ stat_dec(rzs->stats.good_compress);
+
+out:
+ rzs->stats.compr_size -= clen;
+ stat_dec(rzs->stats.pages_stored);
+
+ rzs->table[index].page = NULL;
+ rzs->table[index].offset = 0;
+}
+
+static int handle_zero_page(struct bio *bio)
+{
+ void *user_mem;
+ struct page *page = bio->bi_io_vec[0].bv_page;
+
+ user_mem = kmap_atomic(page, KM_USER0);
+ memset(user_mem, 0, PAGE_SIZE);
+ kunmap_atomic(user_mem, KM_USER0);
+
+ ramzswap_flush_dcache_page(page);
+
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+}
+
+static int handle_uncompressed_page(struct ramzswap *rzs, struct bio *bio)
+{
+ u32 index;
+ struct page *page;
+ unsigned char *user_mem, *cmem;
+
+ page = bio->bi_io_vec[0].bv_page;
+ index = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;
+
+ user_mem = kmap_atomic(page, KM_USER0);
+ cmem = kmap_atomic(rzs->table[index].page, KM_USER1) +
+ rzs->table[index].offset;
+
+ memcpy(user_mem, cmem, PAGE_SIZE);
+ kunmap_atomic(user_mem, KM_USER0);
+ kunmap_atomic(cmem, KM_USER1);
+
+ ramzswap_flush_dcache_page(page);
+
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+}
+
+
+/*
+ * Called when request page is not present in ramzswap.
+ * Its either in backing swap device (if present) or
+ * this is an attempt to read before any previous write
+ * to this location - this happens due to readahead when
+ * swap device is read from user-space (e.g. during swapon)
+ */
+static int handle_ramzswap_fault(struct ramzswap *rzs, struct bio *bio)
+{
+ /*
+ * Always forward such requests to backing swap
+ * device (if present)
+ */
+ if (rzs->backing_swap) {
+ u32 pagenum;
+ stat_dec(rzs->stats.num_reads);
+ stat_inc(rzs->stats.bdev_num_reads);
+ bio->bi_bdev = rzs->backing_swap;
+
+ /*
+ * In case backing swap is a file, find the right offset within
+ * the file corresponding to logical position 'index'. For block
+ * device, this is a nop.
+ */
+ pagenum = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;
+ bio->bi_sector = map_backing_swap_page(rzs, pagenum)
+ << SECTORS_PER_PAGE_SHIFT;
+ return 1;
+ }
+
+ /*
+ * Its unlikely event in case backing dev is
+ * not present
+ */
+ pr_debug("Read before write on swap device: "
+ "sector=%lu, size=%u, offset=%u\n",
+ (ulong)(bio->bi_sector), bio->bi_size,
+ bio->bi_io_vec[0].bv_offset);
+
+ /* Do nothing. Just return success */
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+}
+
+static int ramzswap_read(struct ramzswap *rzs, struct bio *bio)
+{
+ int ret;
+ u32 index;
+ size_t clen;
+ struct page *page;
+ struct zobj_header *zheader;
+ unsigned char *user_mem, *cmem;
+
+ stat_inc(rzs->stats.num_reads);
+
+ page = bio->bi_io_vec[0].bv_page;
+ index = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;
+
+ if (rzs_test_flag(rzs, index, RZS_ZERO))
+ return handle_zero_page(bio);
+
+ /* Requested page is not present in compressed area */
+ if (!rzs->table[index].page)
+ return handle_ramzswap_fault(rzs, bio);
+
+ /* Page is stored uncompressed since its incompressible */
+ if (unlikely(rzs_test_flag(rzs, index, RZS_UNCOMPRESSED)))
+ return handle_uncompressed_page(rzs, bio);
+
+ user_mem = kmap_atomic(page, KM_USER0);
+ clen = PAGE_SIZE;
+
+ cmem = kmap_atomic(rzs->table[index].page, KM_USER1) +
+ rzs->table[index].offset;
+
+ ret = lzo1x_decompress_safe(
+ cmem + sizeof(*zheader),
+ xv_get_object_size(cmem) - sizeof(*zheader),
+ user_mem, &clen);
+
+ kunmap_atomic(user_mem, KM_USER0);
+ kunmap_atomic(cmem, KM_USER1);
+
+ /* should NEVER happen */
+ if (unlikely(ret != LZO_E_OK)) {
+ pr_err("Decompression failed! err=%d, page=%u\n",
+ ret, index);
+ stat_inc(rzs->stats.failed_reads);
+ goto out;
+ }
+
+ ramzswap_flush_dcache_page(page);
+
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+
+out:
+ bio_io_error(bio);
+ return 0;
+}
+
+static int ramzswap_write(struct ramzswap *rzs, struct bio *bio)
+{
+ int ret, fwd_write_request = 0;
+ u32 offset, index;
+ size_t clen;
+ struct zobj_header *zheader;
+ struct page *page, *page_store;
+ unsigned char *user_mem, *cmem, *src;
+
+ stat_inc(rzs->stats.num_writes);
+
+ page = bio->bi_io_vec[0].bv_page;
+ index = bio->bi_sector >> SECTORS_PER_PAGE_SHIFT;
+
+ src = rzs->compress_buffer;
+
+ /*
+ * System swaps to same sector again when the stored page
+ * is no longer referenced by any process. So, its now safe
+ * to free the memory that was allocated for this page.
+ */
+ if (rzs->table[index].page)
+ ramzswap_free_page(rzs, index);
+
+ /*
+ * No memory ia allocated for zero filled pages.
+ * Simply clear zero page flag.
+ */
+ if (rzs_test_flag(rzs, index, RZS_ZERO)) {
+ stat_dec(rzs->stats.pages_zero);
+ rzs_clear_flag(rzs, index, RZS_ZERO);
+ }
+
+ mutex_lock(&rzs->lock);
+
+ user_mem = kmap_atomic(page, KM_USER0);
+ if (page_zero_filled(user_mem)) {
+ kunmap_atomic(user_mem, KM_USER0);
+ mutex_unlock(&rzs->lock);
+ stat_inc(rzs->stats.pages_zero);
+ rzs_set_flag(rzs, index, RZS_ZERO);
+
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+ }
+
+ if (rzs->backing_swap &&
+ (rzs->stats.compr_size > rzs->memlimit - PAGE_SIZE)) {
+ kunmap_atomic(user_mem, KM_USER0);
+ mutex_unlock(&rzs->lock);
+ fwd_write_request = 1;
+ goto out;
+ }
+
+ ret = lzo1x_1_compress(user_mem, PAGE_SIZE, src, &clen,
+ rzs->compress_workmem);
+
+ kunmap_atomic(user_mem, KM_USER0);
+
+ if (unlikely(ret != LZO_E_OK)) {
+ mutex_unlock(&rzs->lock);
+ pr_err("Compression failed! err=%d\n", ret);
+ stat_inc(rzs->stats.failed_writes);
+ goto out;
+ }
+
+ /*
+ * Page is incompressible. Forward it to backing swap
+ * if present. Otherwise, store it as-is (uncompressed)
+ * since we do not want to return too many swap write
+ * errors which has side effect of hanging the system.
+ */
+ if (unlikely(clen > max_zpage_size)) {
+ if (rzs->backing_swap) {
+ mutex_unlock(&rzs->lock);
+ fwd_write_request = 1;
+ goto out;
+ }
+
+ clen = PAGE_SIZE;
+ page_store = alloc_page(GFP_NOIO | __GFP_HIGHMEM);
+ if (unlikely(!page_store)) {
+ mutex_unlock(&rzs->lock);
+ pr_info("Error allocating memory for incompressible "
+ "page: %u\n", index);
+ stat_inc(rzs->stats.failed_writes);
+ goto out;
+ }
+
+ offset = 0;
+ rzs_set_flag(rzs, index, RZS_UNCOMPRESSED);
+ stat_inc(rzs->stats.pages_expand);
+ rzs->table[index].page = page_store;
+ src = kmap_atomic(page, KM_USER0);
+ goto memstore;
+ }
+
+ if (xv_malloc(rzs->mem_pool, clen + sizeof(*zheader),
+ &rzs->table[index].page, &offset,
+ GFP_NOIO | __GFP_HIGHMEM)) {
+ mutex_unlock(&rzs->lock);
+ pr_info("Error allocating memory for compressed "
+ "page: %u, size=%zu\n", index, clen);
+ stat_inc(rzs->stats.failed_writes);
+ if (rzs->backing_swap)
+ fwd_write_request = 1;
+ goto out;
+ }
+
+memstore:
+ rzs->table[index].offset = offset;
+
+ cmem = kmap_atomic(rzs->table[index].page, KM_USER1) +
+ rzs->table[index].offset;
+
+#if 0
+ /* Back-reference needed for memory defragmentation */
+ if (!rzs_test_flag(rzs, index, RZS_UNCOMPRESSED)) {
+ zheader = (struct zobj_header *)cmem;
+ zheader->table_idx = index;
+ cmem += sizeof(*zheader);
+ }
+#endif
+
+ memcpy(cmem, src, clen);
+
+ kunmap_atomic(cmem, KM_USER1);
+ if (unlikely(rzs_test_flag(rzs, index, RZS_UNCOMPRESSED)))
+ kunmap_atomic(src, KM_USER0);
+
+ /* Update stats */
+ rzs->stats.compr_size += clen;
+ stat_inc(rzs->stats.pages_stored);
+ if (clen <= PAGE_SIZE / 2)
+ stat_inc(rzs->stats.good_compress);
+
+ mutex_unlock(&rzs->lock);
+
+ set_bit(BIO_UPTODATE, &bio->bi_flags);
+ bio_endio(bio, 0);
+ return 0;
+
+out:
+ if (fwd_write_request) {
+ stat_inc(rzs->stats.bdev_num_writes);
+ bio->bi_bdev = rzs->backing_swap;
+#if 0
+ /*
+ * TODO: We currently have linear mapping of ramzswap and
+ * backing swap sectors. This is not desired since we want
+ * to optimize writes to backing swap to minimize disk seeks
+ * or have effective wear leveling (for SSDs). Also, a
+ * non-linear mapping is required to implement compressed
+ * on-disk swapping.
+ */
+ bio->bi_sector = get_backing_swap_page()
+ << SECTORS_PER_PAGE_SHIFT;
+#endif
+ /*
+ * In case backing swap is a file, find the right offset within
+ * the file corresponding to logical position 'index'. For block
+ * device, this is a nop.
+ */
+ bio->bi_sector = map_backing_swap_page(rzs, index)
+ << SECTORS_PER_PAGE_SHIFT;
+ return 1;
+ }
+
+ bio_io_error(bio);
+ return 0;
+}
+
+
+/*
+ * Check if request is within bounds and page aligned.
+ */
+static inline int valid_swap_request(struct ramzswap *rzs, struct bio *bio)
+{
+ if (unlikely(
+ (bio->bi_sector >= (rzs->disksize >> SECTOR_SHIFT)) ||
+ (bio->bi_sector & (SECTORS_PER_PAGE - 1)) ||
+ (bio->bi_vcnt != 1) ||
+ (bio->bi_size != PAGE_SIZE) ||
+ (bio->bi_io_vec[0].bv_offset != 0))) {
+
+ return 0;
+ }
+
+ /* swap request is valid */
+ return 1;
+}
+
+/*
+ * Handler function for all ramzswap I/O requests.
+ */
+static int ramzswap_make_request(struct request_queue *queue, struct bio *bio)
+{
+ int ret = 0;
+ struct ramzswap *rzs = queue->queuedata;
+
+ if (unlikely(!rzs->init_done)) {
+ bio_io_error(bio);
+ return 0;
+ }
+
+ if (!valid_swap_request(rzs, bio)) {
+ stat_inc(rzs->stats.invalid_io);
+ bio_io_error(bio);
+ return 0;
+ }
+
+ switch (bio_data_dir(bio)) {
+ case READ:
+ ret = ramzswap_read(rzs, bio);
+ break;
+
+ case WRITE:
+ ret = ramzswap_write(rzs, bio);
+ break;
+ }
+
+ return ret;
+}
+
+static void reset_device(struct ramzswap *rzs)
+{
+ int is_backing_blkdev = 0;
+ size_t index, num_pages;
+ unsigned entries_per_page;
+ unsigned long num_table_pages, entry = 0;
+
+ if (rzs->backing_swap && !rzs->num_extents)
+ is_backing_blkdev = 1;
+
+ num_pages = rzs->disksize >> PAGE_SHIFT;
+
+ /* Free various per-device buffers */
+ kfree(rzs->compress_workmem);
+ free_pages((unsigned long)rzs->compress_buffer, 1);
+
+ rzs->compress_workmem = NULL;
+ rzs->compress_buffer = NULL;
+
+ /* Free all pages that are still in this ramzswap device */
+ for (index = 0; index < num_pages; index++) {
+ struct page *page;
+ u16 offset;
+
+ page = rzs->table[index].page;
+ offset = rzs->table[index].offset;
+
+ if (!page)
+ continue;
+
+ if (unlikely(rzs_test_flag(rzs, index, RZS_UNCOMPRESSED)))
+ __free_page(page);
+ else
+ xv_free(rzs->mem_pool, page, offset);
+ }
+
+ entries_per_page = PAGE_SIZE / sizeof(*rzs->table);
+ num_table_pages = DIV_ROUND_UP(num_pages * sizeof(*rzs->table),
+ PAGE_SIZE);
+ /*
+ * Set page->mapping to NULL for every table page.
+ * Otherwise, we will hit bad_page() during free.
+ */
+ while (rzs->num_extents && num_table_pages--) {
+ struct page *page;
+ page = vmalloc_to_page(&rzs->table[entry]);
+ page->mapping = NULL;
+ entry += entries_per_page;
+ }
+ vfree(rzs->table);
+ rzs->table = NULL;
+
+ xv_destroy_pool(rzs->mem_pool);
+ rzs->mem_pool = NULL;
+
+ /* Free all swap extent pages */
+ while (!list_empty(&rzs->backing_swap_extent_list)) {
+ struct page *page;
+ struct list_head *entry;
+ entry = rzs->backing_swap_extent_list.next;
+ page = list_entry(entry, struct page, lru);
+ list_del(entry);
+ __free_page(page);
+ }
+ INIT_LIST_HEAD(&rzs->backing_swap_extent_list);
+ rzs->num_extents = 0;
+
+ /* Close backing swap device, if present */
+ if (rzs->backing_swap) {
+ if (is_backing_blkdev)
+ bd_release(rzs->backing_swap);
+ filp_close(rzs->swap_file, NULL);
+ rzs->backing_swap = NULL;
+ }
+
+ /* Reset stats */
+ memset(&rzs->stats, 0, sizeof(rzs->stats));
+
+ rzs->disksize = 0;
+ rzs->memlimit = 0;
+
+ /* Back to uninitialized state */
+ rzs->init_done = 0;
+}
+
+static int ramzswap_ioctl_init_device(struct ramzswap *rzs)
+{
+ int ret;
+ size_t num_pages;
+ struct page *page;
+ union swap_header *swap_header;
+
+ if (rzs->init_done) {
+ pr_info("Device already initialized!\n");
+ return -EBUSY;
+ }
+
+ ret = setup_backing_swap(rzs);
+ if (ret)
+ goto fail;
+
+ if (rzs->backing_swap)
+ ramzswap_set_memlimit(rzs, totalram_pages << PAGE_SHIFT);
+ else
+ ramzswap_set_disksize(rzs, totalram_pages << PAGE_SHIFT);
+
+ rzs->compress_workmem = kzalloc(LZO1X_MEM_COMPRESS, GFP_KERNEL);
+ if (!rzs->compress_workmem) {
+ pr_err("Error allocating compressor working memory!\n");
+ ret = -ENOMEM;
+ goto fail;
+ }
+
+ rzs->compress_buffer = (void *)__get_free_pages(__GFP_ZERO, 1);
+ if (!rzs->compress_buffer) {
+ pr_err("Error allocating compressor buffer space\n");
+ ret = -ENOMEM;
+ goto fail;
+ }
+
+ num_pages = rzs->disksize >> PAGE_SHIFT;
+ rzs->table = vmalloc(num_pages * sizeof(*rzs->table));
+ if (!rzs->table) {
+ pr_err("Error allocating ramzswap address table\n");
+ /* To prevent accessing table entries during cleanup */
+ rzs->disksize = 0;
+ ret = -ENOMEM;
+ goto fail;
+ }
+ memset(rzs->table, 0, num_pages * sizeof(*rzs->table));
+
+ map_backing_swap_extents(rzs);
+
+ page = alloc_page(__GFP_ZERO);
+ if (!page) {
+ pr_err("Error allocating swap header page\n");
+ ret = -ENOMEM;
+ goto fail;
+ }
+ rzs->table[0].page = page;
+ rzs_set_flag(rzs, 0, RZS_UNCOMPRESSED);
+
+ swap_header = kmap(page);
+ ret = setup_swap_header(rzs, swap_header);
+ kunmap(page);
+ if (ret) {
+ pr_err("Error setting swap header\n");
+ goto fail;
+ }
+
+ set_capacity(rzs->disk, rzs->disksize >> SECTOR_SHIFT);
+
+ /*
+ * We have ident mapping of sectors for ramzswap and
+ * and the backing swap device. So, this queue flag
+ * should be according to backing dev.
+ */
+ if (!rzs->backing_swap ||
+ blk_queue_nonrot(rzs->backing_swap->bd_disk->queue))
+ queue_flag_set_unlocked(QUEUE_FLAG_NONROT, rzs->disk->queue);
+
+ rzs->mem_pool = xv_create_pool();
+ if (!rzs->mem_pool) {
+ pr_err("Error creating memory pool\n");
+ ret = -ENOMEM;
+ goto fail;
+ }
+
+ /*
+ * Pages that compress to size greater than this are forwarded
+ * to physical swap disk (if backing dev is provided)
+ * TODO: make this configurable
+ */
+ if (rzs->backing_swap)
+ max_zpage_size = max_zpage_size_bdev;
+ else
+ max_zpage_size = max_zpage_size_nobdev;
+ pr_debug("Max compressed page size: %u bytes\n", max_zpage_size);
+
+ rzs->init_done = 1;
+
+ pr_debug("Initialization done!\n");
+ return 0;
+
+fail:
+ reset_device(rzs);
+
+ pr_err("Initialization failed: err=%d\n", ret);
+ return ret;
+}
+
+static int ramzswap_ioctl_reset_device(struct ramzswap *rzs)
+{
+ if (rzs->init_done)
+ reset_device(rzs);
+
+ return 0;
+}
+
+static int ramzswap_ioctl(struct block_device *bdev, fmode_t mode,
+ unsigned int cmd, unsigned long arg)
+{
+ int ret = 0;
+ size_t disksize_kb, memlimit_kb;
+
+ struct ramzswap *rzs = bdev->bd_disk->private_data;
+
+ switch (cmd) {
+ case RZSIO_SET_DISKSIZE_KB:
+ if (rzs->init_done) {
+ ret = -EBUSY;
+ goto out;
+ }
+ if (copy_from_user(&disksize_kb, (void *)arg,
+ _IOC_SIZE(cmd))) {
+ ret = -EFAULT;
+ goto out;
+ }
+ rzs->disksize = disksize_kb << 10;
+ pr_info("Disk size set to %zu kB\n", disksize_kb);
+ break;
+
+ case RZSIO_SET_MEMLIMIT_KB:
+ if (rzs->init_done) {
+ /* TODO: allow changing memlimit */
+ ret = -EBUSY;
+ goto out;
+ }
+ if (copy_from_user(&memlimit_kb, (void *)arg,
+ _IOC_SIZE(cmd))) {
+ ret = -EFAULT;
+ goto out;
+ }
+ rzs->memlimit = memlimit_kb << 10;
+ pr_info("Memory limit set to %zu kB\n", memlimit_kb);
+ break;
+
+ case RZSIO_SET_BACKING_SWAP:
+ if (rzs->init_done) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if (copy_from_user(&rzs->backing_swap_name, (void *)arg,
+ _IOC_SIZE(cmd))) {
+ ret = -EFAULT;
+ goto out;
+ }
+ rzs->backing_swap_name[MAX_SWAP_NAME_LEN - 1] = '\0';
+ pr_info("Backing swap set to %s\n", rzs->backing_swap_name);
+ break;
+
+ case RZSIO_GET_STATS:
+ {
+ struct ramzswap_ioctl_stats *stats;
+ if (!rzs->init_done) {
+ ret = -ENOTTY;
+ goto out;
+ }
+ stats = kzalloc(sizeof(*stats), GFP_KERNEL);
+ if (!stats) {
+ ret = -ENOMEM;
+ goto out;
+ }
+ ramzswap_ioctl_get_stats(rzs, stats);
+ if (copy_to_user((void *)arg, stats, sizeof(*stats))) {
+ kfree(stats);
+ ret = -EFAULT;
+ goto out;
+ }
+ kfree(stats);
+ break;
+ }
+ case RZSIO_INIT:
+ ret = ramzswap_ioctl_init_device(rzs);
+ break;
+
+ case RZSIO_RESET:
+ /* Do not reset an active device! */
+ if (bdev->bd_holders) {
+ ret = -EBUSY;
+ goto out;
+ }
+ ret = ramzswap_ioctl_reset_device(rzs);
+ break;
+
+ default:
+ pr_info("Invalid ioctl %u\n", cmd);
+ ret = -ENOTTY;
+ }
+
+out:
+ return ret;
+}
+
+static struct block_device_operations ramzswap_devops = {
+ .ioctl = ramzswap_ioctl,
+ .owner = THIS_MODULE,
+};
+
+static void create_device(struct ramzswap *rzs, int device_id)
+{
+ mutex_init(&rzs->lock);
+ INIT_LIST_HEAD(&rzs->backing_swap_extent_list);
+
+ rzs->queue = blk_alloc_queue(GFP_KERNEL);
+ if (!rzs->queue) {
+ pr_err("Error allocating disk queue for device %d\n",
+ device_id);
+ return;
+ }
+
+ blk_queue_make_request(rzs->queue, ramzswap_make_request);
+ rzs->queue->queuedata = rzs;
+
+ /* gendisk structure */
+ rzs->disk = alloc_disk(1);
+ if (!rzs->disk) {
+ blk_cleanup_queue(rzs->queue);
+ pr_warning("Error allocating disk structure for device %d\n",
+ device_id);
+ return;
+ }
+
+ rzs->disk->major = ramzswap_major;
+ rzs->disk->first_minor = device_id;
+ rzs->disk->fops = &ramzswap_devops;
+ rzs->disk->queue = rzs->queue;
+ rzs->disk->private_data = rzs;
+ snprintf(rzs->disk->disk_name, 16, "ramzswap%d", device_id);
+
+ /*
+ * Actual capacity set using RZSIO_SET_DISKSIZE_KB ioctl
+ * or set equal to backing swap device (if provided)
+ */
+ set_capacity(rzs->disk, 0);
+ add_disk(rzs->disk);
+
+ rzs->init_done = 0;
+}
+
+static void destroy_device(struct ramzswap *rzs)
+{
+ if (rzs->disk) {
+ del_gendisk(rzs->disk);
+ put_disk(rzs->disk);
+ }
+
+ if (rzs->queue)
+ blk_cleanup_queue(rzs->queue);
+}
+
+static int __init ramzswap_init(void)
+{
+ int i, ret;
+
+ if (num_devices > max_num_devices) {
+ pr_warning("Invalid value for num_devices: %u\n",
+ num_devices);
+ return -EINVAL;
+ }
+
+ ramzswap_major = register_blkdev(0, "ramzswap");
+ if (ramzswap_major <= 0) {
+ pr_warning("Unable to get major number\n");
+ return -EBUSY;
+ }
+
+ if (!num_devices) {
+ pr_info("num_devices not specified. Using default: 1\n");
+ num_devices = 1;
+ }
+
+ /* Allocate the device array and initialize each one */
+ pr_info("Creating %u devices ...\n", num_devices);
+ devices = kzalloc(num_devices * sizeof(struct ramzswap), GFP_KERNEL);
+ if (!devices) {
+ ret = -ENOMEM;
+ goto out;
+ }
+
+ for (i = 0; i < num_devices; i++)
+ create_device(&devices[i], i);
+
+ return 0;
+out:
+ unregister_blkdev(ramzswap_major, "ramzswap");
+ return ret;
+}
+
+static void __exit ramzswap_exit(void)
+{
+ int i;
+ struct ramzswap *rzs;
+
+ for (i = 0; i < num_devices; i++) {
+ rzs = &devices[i];
+
+ destroy_device(rzs);
+ if (rzs->init_done)
+ reset_device(rzs);
+ }
+
+ unregister_blkdev(ramzswap_major, "ramzswap");
+
+ kfree(devices);
+ pr_debug("Cleanup done!\n");
+}
+
+module_param(num_devices, uint, 0);
+MODULE_PARM_DESC(num_devices, "Number of ramzswap devices");
+
+module_init(ramzswap_init);
+module_exit(ramzswap_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Nitin Gupta <ngupta@vflare.org>");
+MODULE_DESCRIPTION("Compressed RAM Based Swap Device");
diff --git a/drivers/staging/ramzswap/ramzswap_drv.h b/drivers/staging/ramzswap/ramzswap_drv.h
new file mode 100644
index 000000000000..a6ea240935b6
--- /dev/null
+++ b/drivers/staging/ramzswap/ramzswap_drv.h
@@ -0,0 +1,171 @@
+/*
+ * Compressed RAM based swap device
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ * Project home: http://compcache.googlecode.com
+ */
+
+#ifndef _RAMZSWAP_DRV_H_
+#define _RAMZSWAP_DRV_H_
+
+#include "ramzswap_ioctl.h"
+#include "xvmalloc.h"
+
+/*
+ * Some arbitrary value. This is just to catch
+ * invalid value for num_devices module parameter.
+ */
+static const unsigned max_num_devices = 32;
+
+/*
+ * Stored at beginning of each compressed object.
+ *
+ * It stores back-reference to table entry which points to this
+ * object. This is required to support memory defragmentation or
+ * migrating compressed pages to backing swap disk.
+ */
+struct zobj_header {
+#if 0
+ u32 table_idx;
+#endif
+};
+
+/*-- Configurable parameters */
+
+/* Default ramzswap disk size: 25% of total RAM */
+static const unsigned default_disksize_perc_ram = 25;
+static const unsigned default_memlimit_perc_ram = 15;
+
+/*
+ * Max compressed page size when backing device is provided.
+ * Pages that compress to size greater than this are sent to
+ * physical swap disk.
+ */
+static const unsigned max_zpage_size_bdev = PAGE_SIZE / 2;
+
+/*
+ * Max compressed page size when there is no backing dev.
+ * Pages that compress to size greater than this are stored
+ * uncompressed in memory.
+ */
+static const unsigned max_zpage_size_nobdev = PAGE_SIZE / 4 * 3;
+
+/*
+ * NOTE: max_zpage_size_{bdev,nobdev} sizes must be
+ * less than or equal to:
+ * XV_MAX_ALLOC_SIZE - sizeof(struct zobj_header)
+ * since otherwise xv_malloc would always return failure.
+ */
+
+/*-- End of configurable params */
+
+#define SECTOR_SHIFT 9
+#define SECTOR_SIZE (1 << SECTOR_SHIFT)
+#define SECTORS_PER_PAGE_SHIFT (PAGE_SHIFT - SECTOR_SHIFT)
+#define SECTORS_PER_PAGE (1 << SECTORS_PER_PAGE_SHIFT)
+
+/* Debugging and Stats */
+#if defined(CONFIG_RAMZSWAP_STATS)
+#define stat_inc(stat) ((stat)++)
+#define stat_dec(stat) ((stat)--)
+#else
+#define stat_inc(x)
+#define stat_dec(x)
+#endif
+
+/* Flags for ramzswap pages (table[page_no].flags) */
+enum rzs_pageflags {
+ /* Page is stored uncompressed */
+ RZS_UNCOMPRESSED,
+
+ /* Page consists entirely of zeros */
+ RZS_ZERO,
+
+ __NR_RZS_PAGEFLAGS,
+};
+
+/*-- Data structures */
+
+/*
+ * Allocated for each swap slot, indexed by page no.
+ * These table entries must fit exactly in a page.
+ */
+struct table {
+ struct page *page;
+ u16 offset;
+ u8 count; /* object ref count (not yet used) */
+ u8 flags;
+} __attribute__((aligned(4)));;
+
+/*
+ * Swap extent information in case backing swap is a regular
+ * file. These extent entries must fit exactly in a page.
+ */
+struct ramzswap_backing_extent {
+ pgoff_t phy_pagenum;
+ pgoff_t num_pages;
+} __attribute__((aligned(4)));
+
+struct ramzswap_stats {
+ /* basic stats */
+ size_t compr_size; /* compressed size of pages stored -
+ * needed to enforce memlimit */
+ /* more stats */
+#if defined(CONFIG_RAMZSWAP_STATS)
+ u64 num_reads; /* failed + successful */
+ u64 num_writes; /* --do-- */
+ u64 failed_reads; /* can happen when memory is too low */
+ u64 failed_writes; /* should NEVER! happen */
+ u64 invalid_io; /* non-swap I/O requests */
+ u32 pages_zero; /* no. of zero filled pages */
+ u32 pages_stored; /* no. of pages currently stored */
+ u32 good_compress; /* % of pages with compression ratio<=50% */
+ u32 pages_expand; /* % of incompressible pages */
+ u64 bdev_num_reads; /* no. of reads on backing dev */
+ u64 bdev_num_writes; /* no. of writes on backing dev */
+#endif
+};
+
+struct ramzswap {
+ struct xv_pool *mem_pool;
+ void *compress_workmem;
+ void *compress_buffer;
+ struct table *table;
+ struct mutex lock;
+ struct request_queue *queue;
+ struct gendisk *disk;
+ int init_done;
+ /*
+ * This is limit on compressed data size (stats.compr_size)
+ * Its applicable only when backing swap device is present.
+ */
+ size_t memlimit; /* bytes */
+ /*
+ * This is limit on amount of *uncompressed* worth of data
+ * we can hold. When backing swap device is provided, it is
+ * set equal to device size.
+ */
+ size_t disksize; /* bytes */
+
+ struct ramzswap_stats stats;
+
+ /* backing swap device info */
+ struct ramzswap_backing_extent *curr_extent;
+ struct list_head backing_swap_extent_list;
+ unsigned long num_extents;
+ char backing_swap_name[MAX_SWAP_NAME_LEN];
+ struct block_device *backing_swap;
+ struct file *swap_file;
+};
+
+/*-- */
+
+#endif
+
diff --git a/drivers/staging/ramzswap/ramzswap_ioctl.h b/drivers/staging/ramzswap/ramzswap_ioctl.h
new file mode 100644
index 000000000000..c713a09af580
--- /dev/null
+++ b/drivers/staging/ramzswap/ramzswap_ioctl.h
@@ -0,0 +1,49 @@
+/*
+ * Compressed RAM based swap device
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ *
+ * Project home: http://compcache.googlecode.com
+ */
+
+#ifndef _RAMZSWAP_IOCTL_H_
+#define _RAMZSWAP_IOCTL_H_
+
+#define MAX_SWAP_NAME_LEN 128
+
+struct ramzswap_ioctl_stats {
+ char backing_swap_name[MAX_SWAP_NAME_LEN];
+ u64 memlimit; /* only applicable if backing swap present */
+ u64 disksize; /* user specified or equal to backing swap
+ * size (if present) */
+ u64 num_reads; /* failed + successful */
+ u64 num_writes; /* --do-- */
+ u64 failed_reads; /* can happen when memory is too low */
+ u64 failed_writes; /* should NEVER! happen */
+ u64 invalid_io; /* non-swap I/O requests */
+ u32 pages_zero; /* no. of zero filled pages */
+ u32 good_compress_pct; /* no. of pages with compression ratio<=50% */
+ u32 pages_expand_pct; /* no. of incompressible pages */
+ u32 pages_stored;
+ u32 pages_used;
+ u64 orig_data_size;
+ u64 compr_data_size;
+ u64 mem_used_total;
+ u64 bdev_num_reads; /* no. of reads on backing dev */
+ u64 bdev_num_writes; /* no. of writes on backing dev */
+} __attribute__ ((packed, aligned(4)));
+
+#define RZSIO_SET_DISKSIZE_KB _IOW('z', 0, size_t)
+#define RZSIO_SET_MEMLIMIT_KB _IOW('z', 1, size_t)
+#define RZSIO_SET_BACKING_SWAP _IOW('z', 2, unsigned char[MAX_SWAP_NAME_LEN])
+#define RZSIO_GET_STATS _IOR('z', 3, struct ramzswap_ioctl_stats)
+#define RZSIO_INIT _IO('z', 4)
+#define RZSIO_RESET _IO('z', 5)
+
+#endif
diff --git a/drivers/staging/ramzswap/xvmalloc.c b/drivers/staging/ramzswap/xvmalloc.c
new file mode 100644
index 000000000000..b3e986c33141
--- /dev/null
+++ b/drivers/staging/ramzswap/xvmalloc.c
@@ -0,0 +1,507 @@
+/*
+ * xvmalloc memory allocator
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ */
+
+#include <linux/bitops.h>
+#include <linux/errno.h>
+#include <linux/highmem.h>
+#include <linux/init.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+
+#include "xvmalloc.h"
+#include "xvmalloc_int.h"
+
+static void stat_inc(u64 *value)
+{
+ *value = *value + 1;
+}
+
+static void stat_dec(u64 *value)
+{
+ *value = *value - 1;
+}
+
+static int test_flag(struct block_header *block, enum blockflags flag)
+{
+ return block->prev & BIT(flag);
+}
+
+static void set_flag(struct block_header *block, enum blockflags flag)
+{
+ block->prev |= BIT(flag);
+}
+
+static void clear_flag(struct block_header *block, enum blockflags flag)
+{
+ block->prev &= ~BIT(flag);
+}
+
+/*
+ * Given <page, offset> pair, provide a derefrencable pointer.
+ * This is called from xv_malloc/xv_free path, so it
+ * needs to be fast.
+ */
+static void *get_ptr_atomic(struct page *page, u16 offset, enum km_type type)
+{
+ unsigned char *base;
+
+ base = kmap_atomic(page, type);
+ return base + offset;
+}
+
+static void put_ptr_atomic(void *ptr, enum km_type type)
+{
+ kunmap_atomic(ptr, type);
+}
+
+static u32 get_blockprev(struct block_header *block)
+{
+ return block->prev & PREV_MASK;
+}
+
+static void set_blockprev(struct block_header *block, u16 new_offset)
+{
+ block->prev = new_offset | (block->prev & FLAGS_MASK);
+}
+
+static struct block_header *BLOCK_NEXT(struct block_header *block)
+{
+ return (struct block_header *)
+ ((char *)block + block->size + XV_ALIGN);
+}
+
+/*
+ * Get index of free list containing blocks of maximum size
+ * which is less than or equal to given size.
+ */
+static u32 get_index_for_insert(u32 size)
+{
+ if (unlikely(size > XV_MAX_ALLOC_SIZE))
+ size = XV_MAX_ALLOC_SIZE;
+ size &= ~FL_DELTA_MASK;
+ return (size - XV_MIN_ALLOC_SIZE) >> FL_DELTA_SHIFT;
+}
+
+/*
+ * Get index of free list having blocks of size greater than
+ * or equal to requested size.
+ */
+static u32 get_index(u32 size)
+{
+ if (unlikely(size < XV_MIN_ALLOC_SIZE))
+ size = XV_MIN_ALLOC_SIZE;
+ size = ALIGN(size, FL_DELTA);
+ return (size - XV_MIN_ALLOC_SIZE) >> FL_DELTA_SHIFT;
+}
+
+/**
+ * find_block - find block of at least given size
+ * @pool: memory pool to search from
+ * @size: size of block required
+ * @page: page containing required block
+ * @offset: offset within the page where block is located.
+ *
+ * Searches two level bitmap to locate block of at least
+ * the given size. If such a block is found, it provides
+ * <page, offset> to identify this block and returns index
+ * in freelist where we found this block.
+ * Otherwise, returns 0 and <page, offset> params are not touched.
+ */
+static u32 find_block(struct xv_pool *pool, u32 size,
+ struct page **page, u32 *offset)
+{
+ ulong flbitmap, slbitmap;
+ u32 flindex, slindex, slbitstart;
+
+ /* There are no free blocks in this pool */
+ if (!pool->flbitmap)
+ return 0;
+
+ /* Get freelist index correspoding to this size */
+ slindex = get_index(size);
+ slbitmap = pool->slbitmap[slindex / BITS_PER_LONG];
+ slbitstart = slindex % BITS_PER_LONG;
+
+ /*
+ * If freelist is not empty at this index, we found the
+ * block - head of this list. This is approximate best-fit match.
+ */
+ if (test_bit(slbitstart, &slbitmap)) {
+ *page = pool->freelist[slindex].page;
+ *offset = pool->freelist[slindex].offset;
+ return slindex;
+ }
+
+ /*
+ * No best-fit found. Search a bit further in bitmap for a free block.
+ * Second level bitmap consists of series of 32-bit chunks. Search
+ * further in the chunk where we expected a best-fit, starting from
+ * index location found above.
+ */
+ slbitstart++;
+ slbitmap >>= slbitstart;
+
+ /* Skip this search if we were already at end of this bitmap chunk */
+ if ((slbitstart != BITS_PER_LONG) && slbitmap) {
+ slindex += __ffs(slbitmap) + 1;
+ *page = pool->freelist[slindex].page;
+ *offset = pool->freelist[slindex].offset;
+ return slindex;
+ }
+
+ /* Now do a full two-level bitmap search to find next nearest fit */
+ flindex = slindex / BITS_PER_LONG;
+
+ flbitmap = (pool->flbitmap) >> (flindex + 1);
+ if (!flbitmap)
+ return 0;
+
+ flindex += __ffs(flbitmap) + 1;
+ slbitmap = pool->slbitmap[flindex];
+ slindex = (flindex * BITS_PER_LONG) + __ffs(slbitmap);
+ *page = pool->freelist[slindex].page;
+ *offset = pool->freelist[slindex].offset;
+
+ return slindex;
+}
+
+/*
+ * Insert block at <page, offset> in freelist of given pool.
+ * freelist used depends on block size.
+ */
+static void insert_block(struct xv_pool *pool, struct page *page, u32 offset,
+ struct block_header *block)
+{
+ u32 flindex, slindex;
+ struct block_header *nextblock;
+
+ slindex = get_index_for_insert(block->size);
+ flindex = slindex / BITS_PER_LONG;
+
+ block->link.prev_page = 0;
+ block->link.prev_offset = 0;
+ block->link.next_page = pool->freelist[slindex].page;
+ block->link.next_offset = pool->freelist[slindex].offset;
+ pool->freelist[slindex].page = page;
+ pool->freelist[slindex].offset = offset;
+
+ if (block->link.next_page) {
+ nextblock = get_ptr_atomic(block->link.next_page,
+ block->link.next_offset, KM_USER1);
+ nextblock->link.prev_page = page;
+ nextblock->link.prev_offset = offset;
+ put_ptr_atomic(nextblock, KM_USER1);
+ }
+
+ __set_bit(slindex % BITS_PER_LONG, &pool->slbitmap[flindex]);
+ __set_bit(flindex, &pool->flbitmap);
+}
+
+/*
+ * Remove block from head of freelist. Index 'slindex' identifies the freelist.
+ */
+static void remove_block_head(struct xv_pool *pool,
+ struct block_header *block, u32 slindex)
+{
+ struct block_header *tmpblock;
+ u32 flindex = slindex / BITS_PER_LONG;
+
+ pool->freelist[slindex].page = block->link.next_page;
+ pool->freelist[slindex].offset = block->link.next_offset;
+ block->link.prev_page = 0;
+ block->link.prev_offset = 0;
+
+ if (!pool->freelist[slindex].page) {
+ __clear_bit(slindex % BITS_PER_LONG, &pool->slbitmap[flindex]);
+ if (!pool->slbitmap[flindex])
+ __clear_bit(flindex, &pool->flbitmap);
+ } else {
+ /*
+ * DEBUG ONLY: We need not reinitialize freelist head previous
+ * pointer to 0 - we never depend on its value. But just for
+ * sanity, lets do it.
+ */
+ tmpblock = get_ptr_atomic(pool->freelist[slindex].page,
+ pool->freelist[slindex].offset, KM_USER1);
+ tmpblock->link.prev_page = 0;
+ tmpblock->link.prev_offset = 0;
+ put_ptr_atomic(tmpblock, KM_USER1);
+ }
+}
+
+/*
+ * Remove block from freelist. Index 'slindex' identifies the freelist.
+ */
+static void remove_block(struct xv_pool *pool, struct page *page, u32 offset,
+ struct block_header *block, u32 slindex)
+{
+ u32 flindex;
+ struct block_header *tmpblock;
+
+ if (pool->freelist[slindex].page == page
+ && pool->freelist[slindex].offset == offset) {
+ remove_block_head(pool, block, slindex);
+ return;
+ }
+
+ flindex = slindex / BITS_PER_LONG;
+
+ if (block->link.prev_page) {
+ tmpblock = get_ptr_atomic(block->link.prev_page,
+ block->link.prev_offset, KM_USER1);
+ tmpblock->link.next_page = block->link.next_page;
+ tmpblock->link.next_offset = block->link.next_offset;
+ put_ptr_atomic(tmpblock, KM_USER1);
+ }
+
+ if (block->link.next_page) {
+ tmpblock = get_ptr_atomic(block->link.next_page,
+ block->link.next_offset, KM_USER1);
+ tmpblock->link.prev_page = block->link.prev_page;
+ tmpblock->link.prev_offset = block->link.prev_offset;
+ put_ptr_atomic(tmpblock, KM_USER1);
+ }
+}
+
+/*
+ * Allocate a page and add it freelist of given pool.
+ */
+static int grow_pool(struct xv_pool *pool, gfp_t flags)
+{
+ struct page *page;
+ struct block_header *block;
+
+ page = alloc_page(flags);
+ if (unlikely(!page))
+ return -ENOMEM;
+
+ stat_inc(&pool->total_pages);
+
+ spin_lock(&pool->lock);
+ block = get_ptr_atomic(page, 0, KM_USER0);
+
+ block->size = PAGE_SIZE - XV_ALIGN;
+ set_flag(block, BLOCK_FREE);
+ clear_flag(block, PREV_FREE);
+ set_blockprev(block, 0);
+
+ insert_block(pool, page, 0, block);
+
+ put_ptr_atomic(block, KM_USER0);
+ spin_unlock(&pool->lock);
+
+ return 0;
+}
+
+/*
+ * Create a memory pool. Allocates freelist, bitmaps and other
+ * per-pool metadata.
+ */
+struct xv_pool *xv_create_pool(void)
+{
+ u32 ovhd_size;
+ struct xv_pool *pool;
+
+ ovhd_size = roundup(sizeof(*pool), PAGE_SIZE);
+ pool = kzalloc(ovhd_size, GFP_KERNEL);
+ if (!pool)
+ return NULL;
+
+ spin_lock_init(&pool->lock);
+
+ return pool;
+}
+
+void xv_destroy_pool(struct xv_pool *pool)
+{
+ kfree(pool);
+}
+
+/**
+ * xv_malloc - Allocate block of given size from pool.
+ * @pool: pool to allocate from
+ * @size: size of block to allocate
+ * @page: page no. that holds the object
+ * @offset: location of object within page
+ *
+ * On success, <page, offset> identifies block allocated
+ * and 0 is returned. On failure, <page, offset> is set to
+ * 0 and -ENOMEM is returned.
+ *
+ * Allocation requests with size > XV_MAX_ALLOC_SIZE will fail.
+ */
+int xv_malloc(struct xv_pool *pool, u32 size, struct page **page,
+ u32 *offset, gfp_t flags)
+{
+ int error;
+ u32 index, tmpsize, origsize, tmpoffset;
+ struct block_header *block, *tmpblock;
+
+ *page = NULL;
+ *offset = 0;
+ origsize = size;
+
+ if (unlikely(!size || size > XV_MAX_ALLOC_SIZE))
+ return -ENOMEM;
+
+ size = ALIGN(size, XV_ALIGN);
+
+ spin_lock(&pool->lock);
+
+ index = find_block(pool, size, page, offset);
+
+ if (!*page) {
+ spin_unlock(&pool->lock);
+ if (flags & GFP_NOWAIT)
+ return -ENOMEM;
+ error = grow_pool(pool, flags);
+ if (unlikely(error))
+ return error;
+
+ spin_lock(&pool->lock);
+ index = find_block(pool, size, page, offset);
+ }
+
+ if (!*page) {
+ spin_unlock(&pool->lock);
+ return -ENOMEM;
+ }
+
+ block = get_ptr_atomic(*page, *offset, KM_USER0);
+
+ remove_block_head(pool, block, index);
+
+ /* Split the block if required */
+ tmpoffset = *offset + size + XV_ALIGN;
+ tmpsize = block->size - size;
+ tmpblock = (struct block_header *)((char *)block + size + XV_ALIGN);
+ if (tmpsize) {
+ tmpblock->size = tmpsize - XV_ALIGN;
+ set_flag(tmpblock, BLOCK_FREE);
+ clear_flag(tmpblock, PREV_FREE);
+
+ set_blockprev(tmpblock, *offset);
+ if (tmpblock->size >= XV_MIN_ALLOC_SIZE)
+ insert_block(pool, *page, tmpoffset, tmpblock);
+
+ if (tmpoffset + XV_ALIGN + tmpblock->size != PAGE_SIZE) {
+ tmpblock = BLOCK_NEXT(tmpblock);
+ set_blockprev(tmpblock, tmpoffset);
+ }
+ } else {
+ /* This block is exact fit */
+ if (tmpoffset != PAGE_SIZE)
+ clear_flag(tmpblock, PREV_FREE);
+ }
+
+ block->size = origsize;
+ clear_flag(block, BLOCK_FREE);
+
+ put_ptr_atomic(block, KM_USER0);
+ spin_unlock(&pool->lock);
+
+ *offset += XV_ALIGN;
+
+ return 0;
+}
+
+/*
+ * Free block identified with <page, offset>
+ */
+void xv_free(struct xv_pool *pool, struct page *page, u32 offset)
+{
+ void *page_start;
+ struct block_header *block, *tmpblock;
+
+ offset -= XV_ALIGN;
+
+ spin_lock(&pool->lock);
+
+ page_start = get_ptr_atomic(page, 0, KM_USER0);
+ block = (struct block_header *)((char *)page_start + offset);
+
+ /* Catch double free bugs */
+ BUG_ON(test_flag(block, BLOCK_FREE));
+
+ block->size = ALIGN(block->size, XV_ALIGN);
+
+ tmpblock = BLOCK_NEXT(block);
+ if (offset + block->size + XV_ALIGN == PAGE_SIZE)
+ tmpblock = NULL;
+
+ /* Merge next block if its free */
+ if (tmpblock && test_flag(tmpblock, BLOCK_FREE)) {
+ /*
+ * Blocks smaller than XV_MIN_ALLOC_SIZE
+ * are not inserted in any free list.
+ */
+ if (tmpblock->size >= XV_MIN_ALLOC_SIZE) {
+ remove_block(pool, page,
+ offset + block->size + XV_ALIGN, tmpblock,
+ get_index_for_insert(tmpblock->size));
+ }
+ block->size += tmpblock->size + XV_ALIGN;
+ }
+
+ /* Merge previous block if its free */
+ if (test_flag(block, PREV_FREE)) {
+ tmpblock = (struct block_header *)((char *)(page_start) +
+ get_blockprev(block));
+ offset = offset - tmpblock->size - XV_ALIGN;
+
+ if (tmpblock->size >= XV_MIN_ALLOC_SIZE)
+ remove_block(pool, page, offset, tmpblock,
+ get_index_for_insert(tmpblock->size));
+
+ tmpblock->size += block->size + XV_ALIGN;
+ block = tmpblock;
+ }
+
+ /* No used objects in this page. Free it. */
+ if (block->size == PAGE_SIZE - XV_ALIGN) {
+ put_ptr_atomic(page_start, KM_USER0);
+ spin_unlock(&pool->lock);
+
+ __free_page(page);
+ stat_dec(&pool->total_pages);
+ return;
+ }
+
+ set_flag(block, BLOCK_FREE);
+ if (block->size >= XV_MIN_ALLOC_SIZE)
+ insert_block(pool, page, offset, block);
+
+ if (offset + block->size + XV_ALIGN != PAGE_SIZE) {
+ tmpblock = BLOCK_NEXT(block);
+ set_flag(tmpblock, PREV_FREE);
+ set_blockprev(tmpblock, offset);
+ }
+
+ put_ptr_atomic(page_start, KM_USER0);
+ spin_unlock(&pool->lock);
+}
+
+u32 xv_get_object_size(void *obj)
+{
+ struct block_header *blk;
+
+ blk = (struct block_header *)((char *)(obj) - XV_ALIGN);
+ return blk->size;
+}
+
+/*
+ * Returns total memory used by allocator (userdata + metadata)
+ */
+u64 xv_get_total_size_bytes(struct xv_pool *pool)
+{
+ return pool->total_pages << PAGE_SHIFT;
+}
diff --git a/drivers/staging/ramzswap/xvmalloc.h b/drivers/staging/ramzswap/xvmalloc.h
new file mode 100644
index 000000000000..010c6fe5e173
--- /dev/null
+++ b/drivers/staging/ramzswap/xvmalloc.h
@@ -0,0 +1,30 @@
+/*
+ * xvmalloc memory allocator
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ */
+
+#ifndef _XV_MALLOC_H_
+#define _XV_MALLOC_H_
+
+#include <linux/types.h>
+
+struct xv_pool;
+
+struct xv_pool *xv_create_pool(void);
+void xv_destroy_pool(struct xv_pool *pool);
+
+int xv_malloc(struct xv_pool *pool, u32 size, struct page **page,
+ u32 *offset, gfp_t flags);
+void xv_free(struct xv_pool *pool, struct page *page, u32 offset);
+
+u32 xv_get_object_size(void *obj);
+u64 xv_get_total_size_bytes(struct xv_pool *pool);
+
+#endif
diff --git a/drivers/staging/ramzswap/xvmalloc_int.h b/drivers/staging/ramzswap/xvmalloc_int.h
new file mode 100644
index 000000000000..03c1a652a3aa
--- /dev/null
+++ b/drivers/staging/ramzswap/xvmalloc_int.h
@@ -0,0 +1,86 @@
+/*
+ * xvmalloc memory allocator
+ *
+ * Copyright (C) 2008, 2009 Nitin Gupta
+ *
+ * This code is released using a dual license strategy: BSD/GPL
+ * You can choose the licence that better fits your requirements.
+ *
+ * Released under the terms of 3-clause BSD License
+ * Released under the terms of GNU General Public License Version 2.0
+ */
+
+#ifndef _XV_MALLOC_INT_H_
+#define _XV_MALLOC_INT_H_
+
+#include <linux/kernel.h>
+#include <linux/types.h>
+
+/* User configurable params */
+
+/* Must be power of two */
+#define XV_ALIGN_SHIFT 2
+#define XV_ALIGN (1 << XV_ALIGN_SHIFT)
+#define XV_ALIGN_MASK (XV_ALIGN - 1)
+
+/* This must be greater than sizeof(link_free) */
+#define XV_MIN_ALLOC_SIZE 32
+#define XV_MAX_ALLOC_SIZE (PAGE_SIZE - XV_ALIGN)
+
+/* Free lists are separated by FL_DELTA bytes */
+#define FL_DELTA_SHIFT 3
+#define FL_DELTA (1 << FL_DELTA_SHIFT)
+#define FL_DELTA_MASK (FL_DELTA - 1)
+#define NUM_FREE_LISTS ((XV_MAX_ALLOC_SIZE - XV_MIN_ALLOC_SIZE) \
+ / FL_DELTA + 1)
+
+#define MAX_FLI DIV_ROUND_UP(NUM_FREE_LISTS, BITS_PER_LONG)
+
+/* End of user params */
+
+enum blockflags {
+ BLOCK_FREE,
+ PREV_FREE,
+ __NR_BLOCKFLAGS,
+};
+
+#define FLAGS_MASK XV_ALIGN_MASK
+#define PREV_MASK (~FLAGS_MASK)
+
+struct freelist_entry {
+ struct page *page;
+ u16 offset;
+ u16 pad;
+};
+
+struct link_free {
+ struct page *prev_page;
+ struct page *next_page;
+ u16 prev_offset;
+ u16 next_offset;
+};
+
+struct block_header {
+ union {
+ /* This common header must be ALIGN bytes */
+ u8 common[XV_ALIGN];
+ struct {
+ u16 size;
+ u16 prev;
+ };
+ };
+ struct link_free link;
+};
+
+struct xv_pool {
+ ulong flbitmap;
+ ulong slbitmap[MAX_FLI];
+ spinlock_t lock;
+
+ struct freelist_entry freelist[NUM_FREE_LISTS];
+
+ /* stats */
+ u64 total_pages;
+};
+
+#endif
diff --git a/drivers/staging/rt2860/2860_main_dev.c b/drivers/staging/rt2860/2860_main_dev.c
deleted file mode 100644
index c2f02963f91c..000000000000
--- a/drivers/staging/rt2860/2860_main_dev.c
+++ /dev/null
@@ -1,1319 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- 2870_main_dev.c
-
- Abstract:
- Create and register network interface.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "rt_config.h"
-
-extern INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p,
- IN UINT argc, OUT PRTMP_ADAPTER *ppAd);
-
-static void rx_done_tasklet(unsigned long data);
-static void mgmt_dma_done_tasklet(unsigned long data);
-static void ac0_dma_done_tasklet(unsigned long data);
-static void ac1_dma_done_tasklet(unsigned long data);
-static void ac2_dma_done_tasklet(unsigned long data);
-static void ac3_dma_done_tasklet(unsigned long data);
-static void hcca_dma_done_tasklet(unsigned long data);
-static void fifo_statistic_full_tasklet(unsigned long data);
-
-
-/*---------------------------------------------------------------------*/
-/* Symbol & Macro Definitions */
-/*---------------------------------------------------------------------*/
-#define RT2860_INT_RX_DLY (1<<0) // bit 0
-#define RT2860_INT_TX_DLY (1<<1) // bit 1
-#define RT2860_INT_RX_DONE (1<<2) // bit 2
-#define RT2860_INT_AC0_DMA_DONE (1<<3) // bit 3
-#define RT2860_INT_AC1_DMA_DONE (1<<4) // bit 4
-#define RT2860_INT_AC2_DMA_DONE (1<<5) // bit 5
-#define RT2860_INT_AC3_DMA_DONE (1<<6) // bit 6
-#define RT2860_INT_HCCA_DMA_DONE (1<<7) // bit 7
-#define RT2860_INT_MGMT_DONE (1<<8) // bit 8
-
-#define INT_RX RT2860_INT_RX_DONE
-
-#define INT_AC0_DLY (RT2860_INT_AC0_DMA_DONE) //| RT2860_INT_TX_DLY)
-#define INT_AC1_DLY (RT2860_INT_AC1_DMA_DONE) //| RT2860_INT_TX_DLY)
-#define INT_AC2_DLY (RT2860_INT_AC2_DMA_DONE) //| RT2860_INT_TX_DLY)
-#define INT_AC3_DLY (RT2860_INT_AC3_DMA_DONE) //| RT2860_INT_TX_DLY)
-#define INT_HCCA_DLY (RT2860_INT_HCCA_DMA_DONE) //| RT2860_INT_TX_DLY)
-#define INT_MGMT_DLY RT2860_INT_MGMT_DONE
-
-/*---------------------------------------------------------------------*/
-/* Prototypes of Functions Used */
-/*---------------------------------------------------------------------*/
-/* function declarations */
-static INT __devinit rt2860_init_one (struct pci_dev *pci_dev, const struct pci_device_id *ent);
-static VOID __devexit rt2860_remove_one(struct pci_dev *pci_dev);
-static INT __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_device_id *ent);
-void init_thread_task(PRTMP_ADAPTER pAd);
-static void __exit rt2860_cleanup_module(void);
-static int __init rt2860_init_module(void);
-
-#ifdef CONFIG_PM
-static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state);
-static int rt2860_resume(struct pci_dev *pci_dev);
-#endif // CONFIG_PM //
-
-
-//
-// Ralink PCI device table, include all supported chipsets
-//
-static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
-{
- {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2860_PCI_DEVICE_ID)}, //RT28602.4G
- {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2860_PCIe_DEVICE_ID)},
- {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2760_PCI_DEVICE_ID)},
- {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2790_PCIe_DEVICE_ID)},
- {PCI_DEVICE(VEN_AWT_PCI_VENDOR_ID, VEN_AWT_PCIe_DEVICE_ID)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7708)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7728)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7758)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7727)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7738)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7748)},
- {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7768)},
- {0,} // terminate list
-};
-
-MODULE_DEVICE_TABLE(pci, rt2860_pci_tbl);
-MODULE_LICENSE("GPL");
-#ifdef MODULE_VERSION
-MODULE_VERSION(STA_DRIVER_VERSION);
-#endif
-
-//
-// Our PCI driver structure
-//
-static struct pci_driver rt2860_driver =
-{
- name: "rt2860",
- id_table: rt2860_pci_tbl,
- probe: rt2860_init_one,
- remove: __devexit_p(rt2860_remove_one),
-
-#ifdef CONFIG_PM
- suspend: rt2860_suspend,
- resume: rt2860_resume,
-#endif
-};
-
-
-#ifdef CONFIG_PM
-
-VOID RT2860RejectPendingPackets(
- IN PRTMP_ADAPTER pAd)
-{
- // clear PS packets
- // clear TxSw packets
-}
-
-static int rt2860_suspend(
- struct pci_dev *pci_dev,
- pm_message_t state)
-{
- struct net_device *net_dev = pci_get_drvdata(pci_dev);
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
- INT32 retval;
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_suspend()\n"));
-
- if (net_dev == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
- }
- else
- {
- pAd = net_dev->ml_priv;
-
- /* we can not use IFF_UP because ra0 down but ra1 up */
- /* and 1 suspend/resume function for 1 module, not for each interface */
- /* so Linux will call suspend/resume function once */
- if (VIRTUAL_IF_NUM(pAd) > 0)
- {
- // avoid users do suspend after interface is down
-
- // stop interface
- netif_carrier_off(net_dev);
- netif_stop_queue(net_dev);
-
- // mark device as removed from system and therefore no longer available
- netif_device_detach(net_dev);
-
- // mark halt flag
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-
- // take down the device
- rt28xx_close((PNET_DEV)net_dev);
-
- RT_MOD_DEC_USE_COUNT();
- }
- }
-
- // reference to http://vovo2000.com/type-lab/linux/kernel-api/linux-kernel-api.html
- // enable device to generate PME# when suspended
- // pci_choose_state(): Choose the power state of a PCI device to be suspended
- retval = pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state), 1);
- // save the PCI configuration space of a device before suspending
- pci_save_state(pci_dev);
- // disable PCI device after use
- pci_disable_device(pci_dev);
-
- retval = pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_suspend()\n"));
- return retval;
-}
-
-static int rt2860_resume(
- struct pci_dev *pci_dev)
-{
- struct net_device *net_dev = pci_get_drvdata(pci_dev);
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
- INT32 retval;
-
-
- // set the power state of a PCI device
- // PCI has 4 power states, DO (normal) ~ D3(less power)
- // in include/linux/pci.h, you can find that
- // #define PCI_D0 ((pci_power_t __force) 0)
- // #define PCI_D1 ((pci_power_t __force) 1)
- // #define PCI_D2 ((pci_power_t __force) 2)
- // #define PCI_D3hot ((pci_power_t __force) 3)
- // #define PCI_D3cold ((pci_power_t __force) 4)
- // #define PCI_UNKNOWN ((pci_power_t __force) 5)
- // #define PCI_POWER_ERROR ((pci_power_t __force) -1)
- retval = pci_set_power_state(pci_dev, PCI_D0);
-
- // restore the saved state of a PCI device
- pci_restore_state(pci_dev);
-
- // initialize device before it's used by a driver
- if (pci_enable_device(pci_dev))
- {
- printk("pci enable fail!\n");
- return 0;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_resume()\n"));
-
- if (net_dev == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
- }
- else
- pAd = net_dev->ml_priv;
-
- if (pAd != NULL)
- {
- /* we can not use IFF_UP because ra0 down but ra1 up */
- /* and 1 suspend/resume function for 1 module, not for each interface */
- /* so Linux will call suspend/resume function once */
- if (VIRTUAL_IF_NUM(pAd) > 0)
- {
- // mark device as attached from system and restart if needed
- netif_device_attach(net_dev);
-
- if (rt28xx_open((PNET_DEV)net_dev) != 0)
- {
- // open fail
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_resume()\n"));
- return 0;
- }
-
- // increase MODULE use count
- RT_MOD_INC_USE_COUNT();
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-
- netif_start_queue(net_dev);
- netif_carrier_on(net_dev);
- netif_wake_queue(net_dev);
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_resume()\n"));
- return 0;
-}
-#endif // CONFIG_PM //
-
-
-static INT __init rt2860_init_module(VOID)
-{
- return pci_register_driver(&rt2860_driver);
-}
-
-
-//
-// Driver module unload function
-//
-static VOID __exit rt2860_cleanup_module(VOID)
-{
- pci_unregister_driver(&rt2860_driver);
-}
-
-module_init(rt2860_init_module);
-module_exit(rt2860_cleanup_module);
-
-
-static INT __devinit rt2860_init_one (
- IN struct pci_dev *pci_dev,
- IN const struct pci_device_id *ent)
-{
- INT rc;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_init_one\n"));
-
- // wake up and enable device
- if (pci_enable_device (pci_dev))
- {
- rc = -EIO;
- }
- else
- {
- rc = rt2860_probe(pci_dev, ent);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_init_one\n"));
- return rc;
-}
-
-
-static VOID __devexit rt2860_remove_one(
- IN struct pci_dev *pci_dev)
-{
- struct net_device *net_dev = pci_get_drvdata(pci_dev);
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_remove_one\n"));
-
- if (pAd != NULL)
- {
- // Unregister network device
- unregister_netdev(net_dev);
-
- // Unmap CSR base address
- iounmap((char *)(net_dev->base_addr));
-
- RTMPFreeAdapter(pAd);
-
- // release memory region
- release_mem_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0));
- }
- else
- {
- // Unregister network device
- unregister_netdev(net_dev);
-
- // Unmap CSR base address
- iounmap((char *)(net_dev->base_addr));
-
- // release memory region
- release_mem_region(pci_resource_start(pci_dev, 0), pci_resource_len(pci_dev, 0));
- }
-
- // Free pre-allocated net_device memory
- free_netdev(net_dev);
-}
-
-//
-// PCI device probe & initialization function
-//
-static INT __devinit rt2860_probe(
- IN struct pci_dev *pci_dev,
- IN const struct pci_device_id *ent)
-{
- PRTMP_ADAPTER pAd;
- INT rv = 0;
-
- rv = (INT)rt28xx_probe((void *)pci_dev, (void *)ent, 0, &pAd);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE);
- return rv;
-}
-
-
-void init_thread_task(IN PRTMP_ADAPTER pAd)
-{
- POS_COOKIE pObj;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->mgmt_dma_done_task, mgmt_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac0_dma_done_task, ac0_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac1_dma_done_task, ac1_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac2_dma_done_task, ac2_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac3_dma_done_task, ac3_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->hcca_dma_done_task, hcca_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->tbtt_task, tbtt_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->fifo_statistic_full_task, fifo_statistic_full_tasklet, (unsigned long)pAd);
-}
-
-void kill_thread_task(IN PRTMP_ADAPTER pAd)
-{
- POS_COOKIE pObj;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- tasklet_kill(&pObj->rx_done_task);
- tasklet_kill(&pObj->mgmt_dma_done_task);
- tasklet_kill(&pObj->ac0_dma_done_task);
- tasklet_kill(&pObj->ac1_dma_done_task);
- tasklet_kill(&pObj->ac2_dma_done_task);
- tasklet_kill(&pObj->ac3_dma_done_task);
- tasklet_kill(&pObj->hcca_dma_done_task);
- tasklet_kill(&pObj->tbtt_task);
- tasklet_kill(&pObj->fifo_statistic_full_task);
-}
-
-
-static void rt2860_int_enable(PRTMP_ADAPTER pAd, unsigned int mode)
-{
- u32 regValue;
-
- pAd->int_disable_mask &= ~(mode);
- regValue = pAd->int_enable_reg & ~(pAd->int_disable_mask);
- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, regValue); // 1:enable
-
- if (regValue != 0)
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE);
-}
-
-
-static void rt2860_int_disable(PRTMP_ADAPTER pAd, unsigned int mode)
-{
- u32 regValue;
-
- pAd->int_disable_mask |= mode;
- regValue = pAd->int_enable_reg & ~(pAd->int_disable_mask);
- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, regValue); // 0: disable
-
- if (regValue == 0)
- {
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE);
- }
-}
-
-static void mgmt_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- IntSource.word = 0;
- IntSource.field.MgmtDmaDone = 1;
- pAd->int_pending &= ~INT_MGMT_DLY;
-
- RTMPHandleMgmtRingDmaDoneInterrupt(pAd);
-
- // if you use RTMP_SEM_LOCK, sometimes kernel will hang up, no any
- // bug report output
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid lose of interrupts
- */
- if (pAd->int_pending & INT_MGMT_DLY)
- {
- tasklet_hi_schedule(&pObj->mgmt_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_MGMT_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-static void rx_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- BOOLEAN bReschedule = 0;
- POS_COOKIE pObj;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- pAd->int_pending &= ~(INT_RX);
-
- bReschedule = STARxDoneInterruptHandle(pAd, 0);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid rotting packet
- */
- if (pAd->int_pending & INT_RX || bReschedule)
- {
- tasklet_hi_schedule(&pObj->rx_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable RxINT again */
- rt2860_int_enable(pAd, INT_RX);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-
-}
-
-void fifo_statistic_full_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- POS_COOKIE pObj;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- pAd->int_pending &= ~(FifoStaFullInt);
- NICUpdateFifoStaCounters(pAd);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid rotting packet
- */
- if (pAd->int_pending & FifoStaFullInt)
- {
- tasklet_hi_schedule(&pObj->fifo_statistic_full_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable RxINT again */
-
- rt2860_int_enable(pAd, FifoStaFullInt);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-
-}
-
-static void hcca_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
-
- IntSource.word = 0;
- IntSource.field.HccaDmaDone = 1;
- pAd->int_pending &= ~INT_HCCA_DLY;
-
- RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid lose of interrupts
- */
- if (pAd->int_pending & INT_HCCA_DLY)
- {
- tasklet_hi_schedule(&pObj->hcca_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_HCCA_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-static void ac3_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
- BOOLEAN bReschedule = 0;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- IntSource.word = 0;
- IntSource.field.Ac3DmaDone = 1;
- pAd->int_pending &= ~INT_AC3_DLY;
-
- bReschedule = RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid lose of interrupts
- */
- if ((pAd->int_pending & INT_AC3_DLY) || bReschedule)
- {
- tasklet_hi_schedule(&pObj->ac3_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_AC3_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-static void ac2_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
- BOOLEAN bReschedule = 0;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- IntSource.word = 0;
- IntSource.field.Ac2DmaDone = 1;
- pAd->int_pending &= ~INT_AC2_DLY;
-
- bReschedule = RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
-
- /*
- * double check to avoid lose of interrupts
- */
- if ((pAd->int_pending & INT_AC2_DLY) || bReschedule)
- {
- tasklet_hi_schedule(&pObj->ac2_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_AC2_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-static void ac1_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
- BOOLEAN bReschedule = 0;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- IntSource.word = 0;
- IntSource.field.Ac1DmaDone = 1;
- pAd->int_pending &= ~INT_AC1_DLY;
-
- bReschedule = RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid lose of interrupts
- */
- if ((pAd->int_pending & INT_AC1_DLY) || bReschedule)
- {
- tasklet_hi_schedule(&pObj->ac1_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_AC1_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-static void ac0_dma_done_tasklet(unsigned long data)
-{
- unsigned long flags;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
- BOOLEAN bReschedule = 0;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- IntSource.word = 0;
- IntSource.field.Ac0DmaDone = 1;
- pAd->int_pending &= ~INT_AC0_DLY;
-
- bReschedule = RTMPHandleTxRingDmaDoneInterrupt(pAd, IntSource);
-
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- /*
- * double check to avoid lose of interrupts
- */
- if ((pAd->int_pending & INT_AC0_DLY) || bReschedule)
- {
- tasklet_hi_schedule(&pObj->ac0_dma_done_task);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- return;
- }
-
- /* enable TxDataInt again */
- rt2860_int_enable(pAd, INT_AC0_DLY);
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
-}
-
-
-int print_int_count;
-
-IRQ_HANDLE_TYPE
-rt2860_interrupt(int irq, void *dev_instance)
-{
- struct net_device *net_dev = (struct net_device *) dev_instance;
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
- INT_SOURCE_CSR_STRUC IntSource;
- POS_COOKIE pObj;
- BOOLEAN bOldValue;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
-
- /* Note 03312008: we can not return here before
- RTMP_IO_READ32(pAd, INT_SOURCE_CSR, &IntSource.word);
- RTMP_IO_WRITE32(pAd, INT_SOURCE_CSR, IntSource.word);
- Or kernel will panic after ifconfig ra0 down sometimes */
-
-
- //
- // Inital the Interrupt source.
- //
- IntSource.word = 0x00000000L;
-// McuIntSource.word = 0x00000000L;
-
- //
- // Get the interrupt sources & saved to local variable
- //
- //RTMP_IO_READ32(pAd, where, &McuIntSource.word);
- //RTMP_IO_WRITE32(pAd, , McuIntSource.word);
-
- //
- // Flag fOP_STATUS_DOZE On, means ASIC put to sleep, elase means ASICK WakeUp
- // And at the same time, clock maybe turned off that say there is no DMA service.
- // when ASIC get to sleep.
- // To prevent system hang on power saving.
- // We need to check it before handle the INT_SOURCE_CSR, ASIC must be wake up.
- //
- // RT2661 => when ASIC is sleeping, MAC register cannot be read and written.
- // RT2860 => when ASIC is sleeping, MAC register can be read and written.
-
- bOldValue = pAd->bPCIclkOff;
- pAd->bPCIclkOff = FALSE;
- {
- RTMP_IO_READ32(pAd, INT_SOURCE_CSR, &IntSource.word);
- RTMP_IO_WRITE32(pAd, INT_SOURCE_CSR, IntSource.word); // write 1 to clear
- }
- pAd->bPCIclkOff = bOldValue;
-
- // Do nothing if Reset in progress
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- {
- return IRQ_HANDLED;
- }
-
- //
- // Handle interrupt, walk through all bits
- // Should start from highest priority interrupt
- // The priority can be adjust by altering processing if statement
- //
-
- // If required spinlock, each interrupt service routine has to acquire
- // and release itself.
- //
-
- // Do nothing if NIC doesn't exist
- if (IntSource.word == 0xffffffff)
- {
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS);
- printk("snowpin - IntSource.word == 0xffffffff\n");
- return IRQ_HANDLED;
- }
-
- if (IntSource.word & TxCoherent)
- {
- DBGPRINT(RT_DEBUG_ERROR, (">>>TxCoherent<<<\n"));
- RTMPHandleRxCoherentInterrupt(pAd);
- }
-
- if (IntSource.word & RxCoherent)
- {
- DBGPRINT(RT_DEBUG_ERROR, (">>>RxCoherent<<<\n"));
- RTMPHandleRxCoherentInterrupt(pAd);
- }
-
- if (IntSource.word & FifoStaFullInt)
- {
-#if 1
- if ((pAd->int_disable_mask & FifoStaFullInt) == 0)
- {
- /* mask FifoStaFullInt */
- rt2860_int_disable(pAd, FifoStaFullInt);
- tasklet_hi_schedule(&pObj->fifo_statistic_full_task);
- }
- pAd->int_pending |= FifoStaFullInt;
-#else
- NICUpdateFifoStaCounters(pAd);
-#endif
- }
-
- if (IntSource.word & INT_MGMT_DLY)
- {
- if ((pAd->int_disable_mask & INT_MGMT_DLY) ==0 )
- {
- rt2860_int_disable(pAd, INT_MGMT_DLY);
- tasklet_hi_schedule(&pObj->mgmt_dma_done_task);
- }
- pAd->int_pending |= INT_MGMT_DLY ;
- }
-
- if (IntSource.word & INT_RX)
- {
- if ((pAd->int_disable_mask & INT_RX) == 0)
- {
- /* mask RxINT */
- rt2860_int_disable(pAd, INT_RX);
- tasklet_hi_schedule(&pObj->rx_done_task);
- }
- pAd->int_pending |= INT_RX;
- }
-
- if (IntSource.word & INT_HCCA_DLY)
- {
-
- if ((pAd->int_disable_mask & INT_HCCA_DLY) == 0)
- {
- /* mask TxDataInt */
- rt2860_int_disable(pAd, INT_HCCA_DLY);
- tasklet_hi_schedule(&pObj->hcca_dma_done_task);
- }
- pAd->int_pending |= INT_HCCA_DLY;
- }
-
- if (IntSource.word & INT_AC3_DLY)
- {
-
- if ((pAd->int_disable_mask & INT_AC3_DLY) == 0)
- {
- /* mask TxDataInt */
- rt2860_int_disable(pAd, INT_AC3_DLY);
- tasklet_hi_schedule(&pObj->ac3_dma_done_task);
- }
- pAd->int_pending |= INT_AC3_DLY;
- }
-
- if (IntSource.word & INT_AC2_DLY)
- {
-
- if ((pAd->int_disable_mask & INT_AC2_DLY) == 0)
- {
- /* mask TxDataInt */
- rt2860_int_disable(pAd, INT_AC2_DLY);
- tasklet_hi_schedule(&pObj->ac2_dma_done_task);
- }
- pAd->int_pending |= INT_AC2_DLY;
- }
-
- if (IntSource.word & INT_AC1_DLY)
- {
-
- pAd->int_pending |= INT_AC1_DLY;
-
- if ((pAd->int_disable_mask & INT_AC1_DLY) == 0)
- {
- /* mask TxDataInt */
- rt2860_int_disable(pAd, INT_AC1_DLY);
- tasklet_hi_schedule(&pObj->ac1_dma_done_task);
- }
-
- }
-
- if (IntSource.word & INT_AC0_DLY)
- {
- pAd->int_pending |= INT_AC0_DLY;
-
- if ((pAd->int_disable_mask & INT_AC0_DLY) == 0)
- {
- /* mask TxDataInt */
- rt2860_int_disable(pAd, INT_AC0_DLY);
- tasklet_hi_schedule(&pObj->ac0_dma_done_task);
- }
-
- }
-
- if (IntSource.word & PreTBTTInt)
- {
- RTMPHandlePreTBTTInterrupt(pAd);
- }
-
- if (IntSource.word & TBTTInt)
- {
- RTMPHandleTBTTInterrupt(pAd);
- }
-
- if (IntSource.word & AutoWakeupInt)
- RTMPHandleTwakeupInterrupt(pAd);
-
- return IRQ_HANDLED;
-}
-
-/*
-========================================================================
-Routine Description:
- Check the chipset vendor/product ID.
-
-Arguments:
- _dev_p Point to the PCI or USB device
-
-Return Value:
- TRUE Check ok
- FALSE Check fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXChipsetCheck(
- IN void *_dev_p)
-{
- /* always TRUE */
- return TRUE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Init net device structure.
-
-Arguments:
- _dev_p Point to the PCI or USB device
- *net_dev Point to the net device
- *pAd the raxx interface data pointer
-
-Return Value:
- TRUE Init ok
- FALSE Init fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXNetDevInit(
- IN void *_dev_p,
- IN struct net_device *net_dev,
- IN RTMP_ADAPTER *pAd)
-{
- struct pci_dev *pci_dev = (struct pci_dev *)_dev_p;
- const CHAR *print_name;
- ULONG csr_addr;
-
-
- print_name = pci_dev ? pci_name(pci_dev) : "rt2860";
-
- net_dev->base_addr = 0;
- net_dev->irq = 0;
-
- if (pci_request_regions(pci_dev, print_name))
- goto err_out_free_netdev;
-
- // interrupt IRQ number
- net_dev->irq = pci_dev->irq;
-
- // map physical address to virtual address for accessing register
- csr_addr = (unsigned long) ioremap(pci_resource_start(pci_dev, 0),
- pci_resource_len(pci_dev, 0));
-
- if (!csr_addr)
- {
- DBGPRINT(RT_DEBUG_ERROR,
- ("ioremap failed for device %s, region 0x%lX @ 0x%lX\n",
- print_name, (ULONG)pci_resource_len(pci_dev, 0),
- (ULONG)pci_resource_start(pci_dev, 0)));
- goto err_out_free_res;
- }
-
- // Save CSR virtual address and irq to device structure
- net_dev->base_addr = csr_addr;
- pAd->CSRBaseAddress = (PUCHAR)net_dev->base_addr;
-
- // Set DMA master
- pci_set_master(pci_dev);
-
- net_dev->priv_flags = INT_MAIN;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s: at 0x%lx, VA 0x%lx, IRQ %d. \n",
- net_dev->name, (ULONG)pci_resource_start(pci_dev, 0),
- (ULONG)csr_addr, pci_dev->irq));
- return TRUE;
-
-
- /* --------------------------- ERROR HANDLE --------------------------- */
-err_out_free_res:
- pci_release_regions(pci_dev);
-err_out_free_netdev:
- /* free netdev in caller, not here */
- return FALSE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Init net device structure.
-
-Arguments:
- _dev_p Point to the PCI or USB device
- *pAd the raxx interface data pointer
-
-Return Value:
- TRUE Config ok
- FALSE Config fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXProbePostConfig(
- IN void *_dev_p,
- IN RTMP_ADAPTER *pAd,
- IN INT32 argc)
-{
- /* no use */
- return TRUE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Disable DMA.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28XXDMADisable(
- IN RTMP_ADAPTER *pAd)
-{
- WPDMA_GLO_CFG_STRUC GloCfg;
-
-
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- GloCfg.word &= 0xff0;
- GloCfg.field.EnTXWriteBackDDONE =1;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-}
-
-
-/*
-========================================================================
-Routine Description:
- Enable DMA.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28XXDMAEnable(
- IN RTMP_ADAPTER *pAd)
-{
- WPDMA_GLO_CFG_STRUC GloCfg;
- int i = 0;
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x4);
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> DMABusy\n"));
- RTMPusecDelay(1000);
- i++;
- }while ( i <200);
-
- RTMPusecDelay(50);
-
- GloCfg.field.EnTXWriteBackDDONE = 1;
- GloCfg.field.WPDMABurstSIZE = 2;
- GloCfg.field.EnableRxDMA = 1;
- GloCfg.field.EnableTxDMA = 1;
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== WRITE DMA offset 0x208 = 0x%x\n", GloCfg.word));
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-
-}
-
-/*
-========================================================================
-Routine Description:
- Write Beacon buffer to Asic.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28xx_UpdateBeaconToAsic(
- IN RTMP_ADAPTER *pAd,
- IN INT apidx,
- IN ULONG FrameLen,
- IN ULONG UpdatePos)
-{
- ULONG CapInfoPos = 0;
- UCHAR *ptr, *ptr_update, *ptr_capinfo;
- UINT i;
- BOOLEAN bBcnReq = FALSE;
- UCHAR bcn_idx = 0;
-
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s() : No valid Interface be found.\n", __func__));
- return;
- }
-
- if (bBcnReq == FALSE)
- {
- /* when the ra interface is down, do not send its beacon frame */
- /* clear all zero */
- for(i=0; i<TXWI_SIZE; i+=4)
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, 0x00);
- }
- else
- {
- ptr = (PUCHAR)&pAd->BeaconTxWI;
-
- for (i=0; i<TXWI_SIZE; i+=4) // 16-byte TXWI field
- {
- UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, longptr);
- ptr += 4;
- }
-
- // Update CapabilityInfo in Beacon
- for (i = CapInfoPos; i < (CapInfoPos+2); i++)
- {
- RTMP_IO_WRITE8(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, *ptr_capinfo);
- ptr_capinfo ++;
- }
-
- if (FrameLen > UpdatePos)
- {
- for (i= UpdatePos; i< (FrameLen); i++)
- {
- RTMP_IO_WRITE8(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, *ptr_update);
- ptr_update ++;
- }
- }
-
- }
-
-}
-
-VOID RTMPInitPCIeLinkCtrlValue(
- IN PRTMP_ADAPTER pAd)
-{
-}
-
-VOID RTMPFindHostPCIDev(
- IN PRTMP_ADAPTER pAd)
-{
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
- Level = RESTORE_HALT : Restore PCI host and Ralink PCIe Link Control field to its default value.
- Level = Other Value : Restore from dot11 power save or radio off status. And force PCI host Link Control fields to 0x1
-
- ========================================================================
-*/
-VOID RTMPPCIeLinkCtrlValueRestore(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level)
-{
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
- Max : limit Host PCI and Ralink PCIe device's LINK CONTROL field's value.
- Because now frequently set our device to mode 1 or mode 3 will cause problem.
-
- ========================================================================
-*/
-VOID RTMPPCIeLinkCtrlSetting(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Max)
-{
-}
-
-VOID rt2860_stop(struct net_device *net_dev)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
- if (net_dev == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
- }
- else
- pAd = net_dev->ml_priv;
-
- if (pAd != NULL)
- {
- // stop interface
- netif_carrier_off(net_dev);
- netif_stop_queue(net_dev);
-
- // mark device as removed from system and therefore no longer available
- netif_device_detach(net_dev);
-
- // mark halt flag
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-
- // take down the device
- rt28xx_close((PNET_DEV)net_dev);
- RT_MOD_DEC_USE_COUNT();
- }
- return;
-}
-
-/*
- * invaild or writeback cache
- * and convert virtual address to physical address
- */
-dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, int sd_idx, int direction)
-{
- PRTMP_ADAPTER pAd;
- POS_COOKIE pObj;
-
- /*
- ------ Porting Information ------
- > For Tx Alloc:
- mgmt packets => sd_idx = 0
- SwIdx: pAd->MgmtRing.TxCpuIdx
- pTxD : pAd->MgmtRing.Cell[SwIdx].AllocVa;
-
- data packets => sd_idx = 1
- TxIdx : pAd->TxRing[pTxBlk->QueIdx].TxCpuIdx
- QueIdx: pTxBlk->QueIdx
- pTxD : pAd->TxRing[pTxBlk->QueIdx].Cell[TxIdx].AllocVa;
-
- > For Rx Alloc:
- sd_idx = -1
- */
-
- pAd = (PRTMP_ADAPTER)handle;
- pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- if (sd_idx == 1)
- {
- PTX_BLK pTxBlk;
- pTxBlk = (PTX_BLK)ptr;
- return pci_map_single(pObj->pci_dev, pTxBlk->pSrcBufData, pTxBlk->SrcBufLen, direction);
- }
- else
- {
- return pci_map_single(pObj->pci_dev, ptr, size, direction);
- }
-
-}
-
-void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, int direction)
-{
- PRTMP_ADAPTER pAd;
- POS_COOKIE pObj;
-
- pAd=(PRTMP_ADAPTER)handle;
- pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- pci_unmap_single(pObj->pci_dev, dma_addr, size, direction);
-
-}
-
diff --git a/drivers/staging/rt2860/Kconfig b/drivers/staging/rt2860/Kconfig
index 7f44e5e72463..602e81830e70 100644
--- a/drivers/staging/rt2860/Kconfig
+++ b/drivers/staging/rt2860/Kconfig
@@ -1,5 +1,6 @@
config RT2860
- tristate "Ralink 2860 wireless support"
+ tristate "Ralink 2860/3090 wireless support"
depends on PCI && X86 && WLAN_80211
---help---
- This is an experimental driver for the Ralink 2860 wireless chip.
+ This is an experimental driver for the Ralink 2860 and 3090
+ wireless chips.
diff --git a/drivers/staging/rt2860/Makefile b/drivers/staging/rt2860/Makefile
index c9fe92583d7e..ba171427ac9d 100644
--- a/drivers/staging/rt2860/Makefile
+++ b/drivers/staging/rt2860/Makefile
@@ -2,26 +2,34 @@ obj-$(CONFIG_RT2860) += rt2860sta.o
# TODO: all of these should be removed
EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
-EXTRA_CFLAGS += -DRT2860
+EXTRA_CFLAGS += -DRTMP_MAC_PCI -DRTMP_PCI_SUPPORT -DRT2860
+EXTRA_CFLAGS += -DRTMP_RF_RW_SUPPORT -DRTMP_EFUSE_SUPPORT -DRT30xx -DRT3090
EXTRA_CFLAGS += -DDBG
rt2860sta-objs := \
- common/md5.o \
+ common/crypt_md5.o \
+ common/crypt_sha2.o \
+ common/crypt_hmac.o \
common/mlme.o \
- common/rtmp_wep.o \
+ common/cmm_wep.o \
common/action.o \
common/cmm_data.o \
common/rtmp_init.o \
- common/rtmp_tkip.o \
+ common/cmm_tkip.o \
+ common/cmm_aes.o \
common/cmm_sync.o \
common/eeprom.o \
common/cmm_sanity.o \
common/cmm_info.o \
+ common/cmm_cfg.o \
common/cmm_wpa.o \
common/dfs.o \
common/spectrum.o \
+ common/rtmp_timer.o \
+ common/rt_channel.o \
+ common/cmm_profile.o \
+ common/cmm_asic.o \
sta/assoc.o \
- sta/aironet.o \
sta/auth.o \
sta/auth_rsp.o \
sta/sync.o \
@@ -34,6 +42,13 @@ rt2860sta-objs := \
rt_main_dev.o \
sta_ioctl.o \
common/ba_action.o \
- common/2860_rtmp_init.o \
- 2860_main_dev.o \
- common/cmm_data_2860.o
+ pci_main_dev.o \
+ rt_pci_rbus.o \
+ common/cmm_mac_pci.o \
+ common/cmm_data_pci.o \
+ common/ee_prom.o \
+ common/rtmp_mcu.o \
+ common/ee_efuse.o \
+ chips/rt30xx.o \
+ common/rt_rf.o \
+ chips/rt3090.o
diff --git a/drivers/staging/rt2860/aironet.h b/drivers/staging/rt2860/aironet.h
deleted file mode 100644
index 1e07b19b8cdc..000000000000
--- a/drivers/staging/rt2860/aironet.h
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- aironet.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- Paul Lin 04-06-15 Initial
-*/
-
-#ifndef __AIRONET_H__
-#define __AIRONET_H__
-
-// Measurement Type definition
-#define MSRN_TYPE_UNUSED 0
-#define MSRN_TYPE_CHANNEL_LOAD_REQ 1
-#define MSRN_TYPE_NOISE_HIST_REQ 2
-#define MSRN_TYPE_BEACON_REQ 3
-#define MSRN_TYPE_FRAME_REQ 4
-
-// Scan Mode in Beacon Request
-#define MSRN_SCAN_MODE_PASSIVE 0
-#define MSRN_SCAN_MODE_ACTIVE 1
-#define MSRN_SCAN_MODE_BEACON_TABLE 2
-
-// PHY type definition for Aironet beacon report, CCX 2 table 36-9
-#define PHY_FH 1
-#define PHY_DSS 2
-#define PHY_UNUSED 3
-#define PHY_OFDM 4
-#define PHY_HR_DSS 5
-#define PHY_ERP 6
-
-// RPI table in dBm
-#define RPI_0 0 // Power <= -87
-#define RPI_1 1 // -87 < Power <= -82
-#define RPI_2 2 // -82 < Power <= -77
-#define RPI_3 3 // -77 < Power <= -72
-#define RPI_4 4 // -72 < Power <= -67
-#define RPI_5 5 // -67 < Power <= -62
-#define RPI_6 6 // -62 < Power <= -57
-#define RPI_7 7 // -57 < Power
-
-// Cisco Aironet IAPP definetions
-#define AIRONET_IAPP_TYPE 0x32
-#define AIRONET_IAPP_SUBTYPE_REQUEST 0x01
-#define AIRONET_IAPP_SUBTYPE_REPORT 0x81
-
-// Measurement Request detail format
-typedef struct _MEASUREMENT_REQUEST {
- UCHAR Channel;
- UCHAR ScanMode; // Use only in beacon request, other requests did not use this field
- USHORT Duration;
-} MEASUREMENT_REQUEST, *PMEASUREMENT_REQUEST;
-
-// Beacon Measurement Report
-// All these field might change to UCHAR, because we didn't do anything to these report.
-// We copy all these beacons and report to CCX 2 AP.
-typedef struct _BEACON_REPORT {
- UCHAR Channel;
- UCHAR Spare;
- USHORT Duration;
- UCHAR PhyType; // Definiation is listed above table 36-9
- UCHAR RxPower;
- UCHAR BSSID[6];
- UCHAR ParentTSF[4];
- UCHAR TargetTSF[8];
- USHORT BeaconInterval;
- USHORT CapabilityInfo;
-} BEACON_REPORT, *PBEACON_REPORT;
-
-// Frame Measurement Report (Optional)
-typedef struct _FRAME_REPORT {
- UCHAR Channel;
- UCHAR Spare;
- USHORT Duration;
- UCHAR TA;
- UCHAR BSSID[6];
- UCHAR RSSI;
- UCHAR Count;
-} FRAME_REPORT, *PFRAME_REPORT;
-
-#pragma pack(1)
-// Channel Load Report
-typedef struct _CHANNEL_LOAD_REPORT {
- UCHAR Channel;
- UCHAR Spare;
- USHORT Duration;
- UCHAR CCABusy;
-} CHANNEL_LOAD_REPORT, *PCHANNEL_LOAD_REPORT;
-#pragma pack()
-
-// Nosie Histogram Report
-typedef struct _NOISE_HIST_REPORT {
- UCHAR Channel;
- UCHAR Spare;
- USHORT Duration;
- UCHAR Density[8];
-} NOISE_HIST_REPORT, *PNOISE_HIST_REPORT;
-
-// Radio Management Capability element
-typedef struct _RADIO_MANAGEMENT_CAPABILITY {
- UCHAR Eid; // TODO: Why the Eid is 1 byte, not normal 2 bytes???
- UCHAR Length;
- UCHAR AironetOui[3]; // AIronet OUI (00 40 96)
- UCHAR Type; // Type / Version
- USHORT Status; // swap16 required
-} RADIO_MANAGEMENT_CAPABILITY, *PRADIO_MANAGEMENT_CAPABILITY;
-
-// Measurement Mode Bit definition
-typedef struct _MEASUREMENT_MODE {
- UCHAR Rsvd:4;
- UCHAR Report:1;
- UCHAR NotUsed:1;
- UCHAR Enable:1;
- UCHAR Parallel:1;
-} MEASUREMENT_MODE, *PMEASUREMENT_MODE;
-
-// Measurement Request element, This is little endian mode
-typedef struct _MEASUREMENT_REQUEST_ELEMENT {
- USHORT Eid;
- USHORT Length; // swap16 required
- USHORT Token; // non-zero unique token
- UCHAR Mode; // Measurement Mode
- UCHAR Type; // Measurement type
-} MEASUREMENT_REQUEST_ELEMENT, *PMEASUREMENT_REQUEST_ELEMENT;
-
-// Measurement Report element, This is little endian mode
-typedef struct _MEASUREMENT_REPORT_ELEMENT {
- USHORT Eid;
- USHORT Length; // swap16 required
- USHORT Token; // non-zero unique token
- UCHAR Mode; // Measurement Mode
- UCHAR Type; // Measurement type
-} MEASUREMENT_REPORT_ELEMENT, *PMEASUREMENT_REPORT_ELEMENT;
-
-// Cisco Aironet IAPP Frame Header, Network byte order used
-typedef struct _AIRONET_IAPP_HEADER {
- UCHAR CiscoSnapHeader[8]; // 8 bytes Cisco snap header
- USHORT Length; // IAPP ID & length, remember to swap16 in LE system
- UCHAR Type; // IAPP type
- UCHAR SubType; // IAPP subtype
- UCHAR DA[6]; // Destination MAC address
- UCHAR SA[6]; // Source MAC address
- USHORT Token; // Dialog token, no need to swap16 since it is for yoken usage only
-} AIRONET_IAPP_HEADER, *PAIRONET_IAPP_HEADER;
-
-// Radio Measurement Request frame
-typedef struct _AIRONET_RM_REQUEST_FRAME {
- AIRONET_IAPP_HEADER IAPP; // Common header
- UCHAR Delay; // Activation Delay
- UCHAR Offset; // Measurement offset
-} AIRONET_RM_REQUEST_FRAME, *PAIRONET_RM_REQUEST_FRAME;
-
-// Radio Measurement Report frame
-typedef struct _AIRONET_RM_REPORT_FRAME {
- AIRONET_IAPP_HEADER IAPP; // Common header
-} AIRONET_RM_REPORT_FRAME, *PAIRONET_RM_REPORT_FRAME;
-
-// Saved element request actions which will saved in StaCfg.
-typedef struct _RM_REQUEST_ACTION {
- MEASUREMENT_REQUEST_ELEMENT ReqElem; // Saved request element
- MEASUREMENT_REQUEST Measurement; // Saved measurement within the request element
-} RM_REQUEST_ACTION, *PRM_REQUEST_ACTION;
-
-// CCX administration control
-typedef union _CCX_CONTROL {
- struct {
- UINT32 Enable:1; // Enable CCX2
- UINT32 LeapEnable:1; // Enable LEAP at CCX2
- UINT32 RMEnable:1; // Radio Measurement Enable
- UINT32 DCRMEnable:1; // Non serving channel Radio Measurement enable
- UINT32 QOSEnable:1; // Enable QOS for CCX 2.0 support
- UINT32 FastRoamEnable:1; // Enable fast roaming
- UINT32 Rsvd:2; // Not used
- UINT32 dBmToRoam:8; // the condition to roam when receiving Rssi less than this value. It's negative value.
- UINT32 TuLimit:16; // Limit for different channel scan
- } field;
- UINT32 word;
-} CCX_CONTROL, *PCCX_CONTROL;
-
-#endif // __AIRONET_H__
diff --git a/drivers/staging/rt2860/ap.h b/drivers/staging/rt2860/ap.h
index fcdb35847b10..6c58ce8ef951 100644
--- a/drivers/staging/rt2860/ap.h
+++ b/drivers/staging/rt2860/ap.h
@@ -40,22 +40,24 @@
#ifndef __AP_H__
#define __AP_H__
-// ap_mlme.c
+// ap_wpa.c
+VOID WpaStateMachineInit(
+ IN PRTMP_ADAPTER pAd,
+ IN STATE_MACHINE *Sm,
+ OUT STATE_MACHINE_FUNC Trans[]);
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
VOID BeaconUpdateExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
VOID RTMPSetPiggyBack(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bPiggyBack);
-// ap.c
-
VOID MacTableReset(
IN PRTMP_ADAPTER pAd);
diff --git a/drivers/staging/rt3090/mac_pci.h b/drivers/staging/rt2860/chip/mac_pci.h
index bad04d43ebae..61b3f82315a1 100644
--- a/drivers/staging/rt3090/mac_pci.h
+++ b/drivers/staging/rt2860/chip/mac_pci.h
@@ -25,7 +25,7 @@
*************************************************************************
Module Name:
- mac_pci.h
+ mac_pci.h
Abstract:
@@ -37,11 +37,11 @@
#ifndef __MAC_PCI_H__
#define __MAC_PCI_H__
-#include "rtmp_type.h"
+#include "../rtmp_type.h"
#include "rtmp_mac.h"
#include "rtmp_phy.h"
-#include "rtmp_iface.h"
-#include "rtmp_dot11.h"
+#include "../rtmp_iface.h"
+#include "../rtmp_dot11.h"
//
@@ -74,29 +74,6 @@
//
// TX descriptor format, Tx ring, Mgmt Ring
//
-#ifdef RT_BIG_ENDIAN
-typedef struct PACKED _TXD_STRUC {
- // Word 0
- UINT32 SDPtr0;
- // Word 1
- UINT32 DMADONE:1;
- UINT32 LastSec0:1;
- UINT32 SDLen0:14;
- UINT32 Burst:1;
- UINT32 LastSec1:1;
- UINT32 SDLen1:14;
- // Word 2
- UINT32 SDPtr1;
- // Word 3
- UINT32 ICO:1;
- UINT32 UCO:1;
- UINT32 TCO:1;
- UINT32 rsv:2;
- UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
- UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
- UINT32 rsv2:24;
-} TXD_STRUC, *PTXD_STRUC;
-#else
typedef struct PACKED _TXD_STRUC {
// Word 0
UINT32 SDPtr0;
@@ -118,47 +95,11 @@ typedef struct PACKED _TXD_STRUC {
UINT32 UCO:1; //
UINT32 ICO:1; //
} TXD_STRUC, *PTXD_STRUC;
-#endif
//
// Rx descriptor format, Rx Ring
//
-#ifdef RT_BIG_ENDIAN
-typedef struct PACKED _RXD_STRUC{
- // Word 0
- UINT32 SDP0;
- // Word 1
- UINT32 DDONE:1;
- UINT32 LS0:1;
- UINT32 SDL0:14;
- UINT32 Rsv:2;
- UINT32 SDL1:14;
- // Word 2
- UINT32 SDP1;
- // Word 3
- UINT32 Rsv1:13;
- UINT32 PlcpRssil:1;// To be moved
- UINT32 PlcpSignal:1; // To be moved
- UINT32 Decrypted:1; // this frame is being decrypted.
- UINT32 AMPDU:1;
- UINT32 L2PAD:1;
- UINT32 RSSI:1;
- UINT32 HTC:1;
- UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header. obsolete.
- UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
- UINT32 Crc:1; // 1: CRC error
- UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
- UINT32 Bcast:1; // 1: this is a broadcast frame
- UINT32 Mcast:1; // 1: this is a multicast frame
- UINT32 U2M:1; // 1: this RX frame is unicast to me
- UINT32 FRAG:1;
- UINT32 NULLDATA:1;
- UINT32 DATA:1;
- UINT32 BA:1;
-
-} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
-#else
typedef struct PACKED _RXD_STRUC{
// Word 0
UINT32 SDP0;
@@ -191,23 +132,7 @@ typedef struct PACKED _RXD_STRUC{
UINT32 PlcpRssil:1;// To be moved
UINT32 Rsv1:13;
} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
-#endif
-
-#ifdef BIG_ENDIAN
-typedef union _TX_ATTENUATION_CTRL_STRUC
-{
- struct
- {
- ULONG Reserve1:20;
- ULONG PCIE_PHY_TX_ATTEN_EN:1;
- ULONG PCIE_PHY_TX_ATTEN_VALUE:3;
- ULONG Reserve2:7;
- ULONG RF_ISOLATION_ENABLE:1;
- } field;
- ULONG word;
-} TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC;
-#else
typedef union _TX_ATTENUATION_CTRL_STRUC {
struct
{
@@ -220,7 +145,7 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
ULONG word;
} TX_ATTENUATION_CTRL_STRUC, *PTX_ATTENUATION_CTRL_STRUC;
-#endif
+
/* ----------------- EEPROM Related MACRO ----------------- */
// 8051 firmware image for RT2860 - base address = 0x4000
@@ -434,7 +359,6 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
#define CID3MASK 0xff000000
-#ifdef CONFIG_STA_SUPPORT
#define RTMP_STA_FORCE_WAKEUP(pAd, bFromTx) \
RT28xxPciStaAsicForceWakeup(pAd, bFromTx);
@@ -443,7 +367,6 @@ typedef union _TX_ATTENUATION_CTRL_STRUC {
#define RTMP_SET_PSM_BIT(_pAd, _val) \
MlmeSetPsmBit(_pAd, _val);
-#endif // CONFIG_STA_SUPPORT //
#define RTMP_MLME_RADIO_ON(pAd) \
RT28xxPciMlmeRadioOn(pAd);
diff --git a/drivers/staging/rt2860/chip/mac_usb.h b/drivers/staging/rt2860/chip/mac_usb.h
new file mode 100644
index 000000000000..5a8588377425
--- /dev/null
+++ b/drivers/staging/rt2860/chip/mac_usb.h
@@ -0,0 +1,365 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+
+ Module Name:
+ mac_usb.h
+
+ Abstract:
+
+ Revision History:
+ Who When What
+ --------- ---------- ----------------------------------------------
+ */
+
+#ifndef __MAC_USB_H__
+#define __MAC_USB_H__
+
+#include "../rtmp_type.h"
+#include "rtmp_mac.h"
+#include "rtmp_phy.h"
+#include "../rtmp_iface.h"
+#include "../rtmp_dot11.h"
+
+
+#define USB_CYC_CFG 0x02a4
+
+#define BEACON_RING_SIZE 2
+#define MGMTPIPEIDX 0 // EP6 is highest priority
+
+#define RTMP_PKT_TAIL_PADDING 11 // 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding)
+
+#define fRTMP_ADAPTER_NEED_STOP_TX \
+ (fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS | \
+ fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_BULKOUT_RESET | \
+ fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_REMOVE_IN_PROGRESS)
+
+//
+// RXINFO appends at the end of each rx packet.
+//
+#define RXINFO_SIZE 4
+#define RT2870_RXDMALEN_FIELD_SIZE 4
+
+typedef struct PACKED _RXINFO_STRUC {
+ UINT32 BA:1;
+ UINT32 DATA:1;
+ UINT32 NULLDATA:1;
+ UINT32 FRAG:1;
+ UINT32 U2M:1; // 1: this RX frame is unicast to me
+ UINT32 Mcast:1; // 1: this is a multicast frame
+ UINT32 Bcast:1; // 1: this is a broadcast frame
+ UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
+ UINT32 Crc:1; // 1: CRC error
+ UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
+ UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
+ UINT32 HTC:1;
+ UINT32 RSSI:1;
+ UINT32 L2PAD:1;
+ UINT32 AMPDU:1; // To be moved
+ UINT32 Decrypted:1;
+ UINT32 PlcpRssil:1;
+ UINT32 CipherAlg:1;
+ UINT32 LastAMSDU:1;
+ UINT32 PlcpSignal:12;
+} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
+
+
+//
+// TXINFO
+//
+#define TXINFO_SIZE 4
+
+typedef struct _TXINFO_STRUC {
+ // Word 0
+ UINT32 USBDMATxPktLen:16; //used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame.
+ UINT32 rsv:8;
+ UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
+ UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
+ UINT32 SwUseLastRound:1; // Software use.
+ UINT32 rsv2:2; // Software use.
+ UINT32 USBDMANextVLD:1; //used ONLY in USB bulk Aggregation, NextValid
+ UINT32 USBDMATxburst:1;//used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint
+} TXINFO_STRUC, *PTXINFO_STRUC;
+
+
+//
+// Management ring buffer format
+//
+typedef struct _MGMT_STRUC {
+ BOOLEAN Valid;
+ PUCHAR pBuffer;
+ ULONG Length;
+} MGMT_STRUC, *PMGMT_STRUC;
+
+
+////////////////////////////////////////////////////////////////////////////
+// The TX_BUFFER structure forms the transmitted USB packet to the device
+////////////////////////////////////////////////////////////////////////////
+typedef struct __TX_BUFFER{
+ union{
+ UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
+ HEADER_802_11 NullFrame;
+ PSPOLL_FRAME PsPollPacket;
+ RTS_FRAME RTSFrame;
+ }field;
+ UCHAR Aggregation[4]; //Buffer for save Aggregation size.
+} TX_BUFFER, *PTX_BUFFER;
+
+typedef struct __HTTX_BUFFER{
+ union{
+ UCHAR WirelessPacket[MAX_TXBULK_SIZE];
+ HEADER_802_11 NullFrame;
+ PSPOLL_FRAME PsPollPacket;
+ RTS_FRAME RTSFrame;
+ }field;
+ UCHAR Aggregation[4]; //Buffer for save Aggregation size.
+} HTTX_BUFFER, *PHTTX_BUFFER;
+
+
+// used to track driver-generated write irps
+typedef struct _TX_CONTEXT
+{
+ PVOID pAd; //Initialized in MiniportInitialize
+ PURB pUrb; //Initialized in MiniportInitialize
+ PIRP pIrp; //used to cancel pending bulk out.
+ //Initialized in MiniportInitialize
+ PTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
+ ULONG BulkOutSize;
+ UCHAR BulkOutPipeId;
+ UCHAR SelfIdx;
+ BOOLEAN InUse;
+ BOOLEAN bWaitingBulkOut; // at least one packet is in this TxContext, ready for making IRP anytime.
+ BOOLEAN bFullForBulkOut; // all tx buffer are full , so waiting for tx bulkout.
+ BOOLEAN IRPPending;
+ BOOLEAN LastOne;
+ BOOLEAN bAggregatible;
+ UCHAR Header_802_3[LENGTH_802_3];
+ UCHAR Rsv[2];
+ ULONG DataOffset;
+ UINT TxRate;
+ dma_addr_t data_dma; // urb dma on linux
+
+} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
+
+
+// used to track driver-generated write irps
+typedef struct _HT_TX_CONTEXT
+{
+ PVOID pAd; //Initialized in MiniportInitialize
+ PURB pUrb; //Initialized in MiniportInitialize
+ PIRP pIrp; //used to cancel pending bulk out.
+ //Initialized in MiniportInitialize
+ PHTTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
+ ULONG BulkOutSize; // Indicate the total bulk-out size in bytes in one bulk-transmission
+ UCHAR BulkOutPipeId;
+ BOOLEAN IRPPending;
+ BOOLEAN LastOne;
+ BOOLEAN bCurWriting;
+ BOOLEAN bRingEmpty;
+ BOOLEAN bCopySavePad;
+ UCHAR SavedPad[8];
+ UCHAR Header_802_3[LENGTH_802_3];
+ ULONG CurWritePosition; // Indicate the buffer offset which packet will be inserted start from.
+ ULONG CurWriteRealPos; // Indicate the buffer offset which packet now are writing to.
+ ULONG NextBulkOutPosition; // Indicate the buffer start offset of a bulk-transmission
+ ULONG ENextBulkOutPosition; // Indicate the buffer end offset of a bulk-transmission
+ UINT TxRate;
+ dma_addr_t data_dma; // urb dma on linux
+} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
+
+
+//
+// Structure to keep track of receive packets and buffers to indicate
+// receive data to the protocol.
+//
+typedef struct _RX_CONTEXT
+{
+ PUCHAR TransferBuffer;
+ PVOID pAd;
+ PIRP pIrp;//used to cancel pending bulk in.
+ PURB pUrb;
+ //These 2 Boolean shouldn't both be 1 at the same time.
+ ULONG BulkInOffset; // number of packets waiting for reordering .
+// BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication
+ BOOLEAN bRxHandling; // Notify this packet is being process now.
+ BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet.
+ BOOLEAN Readable; // Receive Complete back. OK for driver to indicate receiving packet.
+ BOOLEAN IRPPending; // TODO: To be removed
+ atomic_t IrpLock;
+ NDIS_SPIN_LOCK RxContextLock;
+ dma_addr_t data_dma; // urb dma on linux
+} RX_CONTEXT, *PRX_CONTEXT;
+
+
+
+/******************************************************************************
+
+ USB Frimware Related MACRO
+
+******************************************************************************/
+// 8051 firmware image for usb - use last-half base address = 0x3000
+#define FIRMWARE_IMAGE_BASE 0x3000
+#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
+
+#define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
+ RTUSBFirmwareWrite(_pAd, _pFwImage, _FwLen)
+
+
+
+/******************************************************************************
+
+ USB TX Related MACRO
+
+******************************************************************************/
+#define RTMP_START_DEQUEUE(pAd, QueIdx, irqFlags) \
+ do{ \
+ RTMP_IRQ_LOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
+ if (pAd->DeQueueRunning[QueIdx]) \
+ { \
+ RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags);\
+ DBGPRINT(RT_DEBUG_OFF, ("DeQueueRunning[%d]= TRUE!\n", QueIdx)); \
+ continue; \
+ } \
+ else \
+ { \
+ pAd->DeQueueRunning[QueIdx] = TRUE; \
+ RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags);\
+ } \
+ }while(0)
+
+#define RTMP_STOP_DEQUEUE(pAd, QueIdx, irqFlags) \
+ do{ \
+ RTMP_IRQ_LOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
+ pAd->DeQueueRunning[QueIdx] = FALSE; \
+ RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
+ }while(0)
+
+#define RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \
+ (RTUSBFreeDescriptorRequest(pAd, pTxBlk->QueIdx, (pTxBlk->TotalFrameLen + GET_OS_PKT_LEN(pPacket))) == NDIS_STATUS_SUCCESS)
+
+#define RTMP_RELEASE_DESC_RESOURCE(pAd, QueIdx) \
+ do{}while(0)
+
+#define NEED_QUEUE_BACK_FOR_AGG(_pAd, _QueIdx, _freeNum, _TxFrameType) \
+ ((_TxFrameType == TX_RALINK_FRAME) && (RTUSBNeedQueueBackForAgg(_pAd, _QueIdx)))
+
+#define HAL_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber) \
+ RtmpUSB_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber)
+
+#define HAL_WriteTxResource(pAd, pTxBlk,bIsLast, pFreeNumber) \
+ RtmpUSB_WriteSingleTxResource(pAd, pTxBlk,bIsLast, pFreeNumber)
+
+#define HAL_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber) \
+ RtmpUSB_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber)
+
+#define HAL_WriteMultiTxResource(pAd, pTxBlk,frameNum, pFreeNumber) \
+ RtmpUSB_WriteMultiTxResource(pAd, pTxBlk,frameNum, pFreeNumber)
+
+#define HAL_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, TxIdx) \
+ RtmpUSB_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, TxIdx)
+
+#define HAL_LastTxIdx(pAd, QueIdx,TxIdx) \
+ /*RtmpUSBDataLastTxIdx(pAd, QueIdx,TxIdx)*/
+
+#define HAL_KickOutTx(pAd, pTxBlk, QueIdx) \
+ RtmpUSBDataKickOut(pAd, pTxBlk, QueIdx)
+
+#define HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen) \
+ RtmpUSBMgmtKickOut(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen)
+
+#define HAL_KickOutNullFrameTx(_pAd, _QueIdx, _pNullFrame, _frameLen) \
+ RtmpUSBNullFrameKickOut(_pAd, _QueIdx, _pNullFrame, _frameLen)
+
+#define GET_TXRING_FREENO(_pAd, _QueIdx) (_QueIdx) //(_pAd->TxRing[_QueIdx].TxSwFreeIdx)
+#define GET_MGMTRING_FREENO(_pAd) (_pAd->MgmtRing.TxSwFreeIdx)
+
+
+/* ----------------- RX Related MACRO ----------------- */
+
+
+/*
+ * Device Hardware Interface Related MACRO
+ */
+#define RTMP_IRQ_INIT(pAd) do{}while(0)
+#define RTMP_IRQ_ENABLE(pAd) do{}while(0)
+
+
+/*
+ * MLME Related MACRO
+ */
+#define RTMP_MLME_HANDLER(pAd) RTUSBMlmeUp(pAd)
+
+#define RTMP_MLME_PRE_SANITY_CHECK(pAd) \
+ { if ((pAd->CommonCfg.bHardwareRadio == TRUE) && \
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) && \
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) { \
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_CHECK_GPIO, NULL, 0); } }
+
+#define RTMP_MLME_STA_QUICK_RSP_WAKE_UP(pAd) \
+ { RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_QKERIODIC_EXECUT, NULL, 0); \
+ RTUSBMlmeUp(pAd); }
+
+#define RTMP_MLME_RESET_STATE_MACHINE(pAd) \
+ MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_RESET_CONF, 0, NULL); \
+ RTUSBMlmeUp(pAd);
+
+#define RTMP_HANDLE_COUNTER_MEASURE(_pAd, _pEntry) \
+ { RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_802_11_COUNTER_MEASURE, _pEntry, sizeof(MAC_TABLE_ENTRY)); \
+ RTUSBMlmeUp(_pAd); \
+ }
+
+
+/*
+ * Power Save Related MACRO
+ */
+#define RTMP_PS_POLL_ENQUEUE(pAd) \
+ { RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); \
+ RTUSBKickBulkOut(pAd); }
+
+#define RTMP_STA_FORCE_WAKEUP(_pAd, bFromTx) \
+ RT28xxUsbStaAsicForceWakeup(_pAd, bFromTx);
+
+#define RTMP_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp) \
+ RT28xxUsbStaAsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
+
+#define RTMP_SET_PSM_BIT(_pAd, _val) \
+ {\
+ if ((_pAd)->StaCfg.WindowsPowerMode == Ndis802_11PowerModeFast_PSP) \
+ MlmeSetPsmBit(_pAd, _val);\
+ else \
+ { \
+ USHORT _psm_val; \
+ _psm_val = _val; \
+ RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_SET_PSM_BIT, &(_psm_val), sizeof(USHORT)); \
+ }\
+ }
+
+#define RTMP_MLME_RADIO_ON(pAd) \
+ RT28xxUsbMlmeRadioOn(pAd);
+
+#define RTMP_MLME_RADIO_OFF(pAd) \
+ RT28xxUsbMlmeRadioOFF(pAd);
+
+#endif //__MAC_USB_H__ //
diff --git a/drivers/staging/rt3090/netif_block.h b/drivers/staging/rt2860/chip/rt2860.h
index 9e753894f294..2989d09556bc 100644
--- a/drivers/staging/rt3090/netif_block.h
+++ b/drivers/staging/rt2860/chip/rt2860.h
@@ -25,32 +25,32 @@
*************************************************************************
*/
-#ifndef __NET_IF_BLOCK_H__
-#define __NET_IF_BLOCK_H__
+#ifndef __RT2860_H__
+#define __RT2860_H__
-#include "link_list.h"
-#include "rtmp.h"
+#include "mac_pci.h"
-#define FREE_NETIF_POOL_SIZE 32
+#ifndef RTMP_PCI_SUPPORT
+#error "For RT2860, you should define the compile flag -DRTMP_PCI_SUPPORT"
+#endif
-typedef struct _NETIF_ENTRY
-{
- struct _NETIF_ENTRY *pNext;
- PNET_DEV pNetDev;
-} NETIF_ENTRY, *PNETIF_ENTRY;
+#ifndef RTMP_MAC_PCI
+#error "For RT2880, you should define the compile flag -DRTMP_MAC_PCI"
+#endif
-void initblockQueueTab(
- IN PRTMP_ADAPTER pAd);
+//
+// Device ID & Vendor ID, these values should match EEPROM value
+//
+#define NIC2860_PCI_DEVICE_ID 0x0601
+#define NIC2860_PCIe_DEVICE_ID 0x0681
+#define NIC2760_PCI_DEVICE_ID 0x0701 // 1T/2R Cardbus ???
+#define NIC2790_PCIe_DEVICE_ID 0x0781 // 1T/2R miniCard
-BOOLEAN blockNetIf(
- IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry,
- IN PNET_DEV pNetDev);
-VOID releaseNetIf(
- IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry);
+#define VEN_AWT_PCIe_DEVICE_ID 0x1059
+#define VEN_AWT_PCI_VENDOR_ID 0x1A3B
-VOID StopNetIfQueue(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket);
-#endif // __NET_IF_BLOCK_H__
+#define EDIMAX_PCI_VENDOR_ID 0x1432
+
+
+#endif //__RT2860_H__ //
diff --git a/drivers/staging/rt3090/rt33xx.h b/drivers/staging/rt2860/chip/rt2870.h
index 6eb938860b77..a9309253b20f 100644
--- a/drivers/staging/rt3090/rt33xx.h
+++ b/drivers/staging/rt2860/chip/rt2870.h
@@ -23,26 +23,25 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
-
- Module Name:
- rt33xx.h
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
*/
+#ifndef __RT2870_H__
+#define __RT2870_H__
+
+#ifdef RT2870
-#ifndef __RT33XX_H__
-#define __RT33XX_H__
+#ifndef RTMP_USB_SUPPORT
+#error "For RT2870, you should define the compile flag -DRTMP_USB_SUPPORT"
+#endif
-#ifdef RT33xx
+#ifndef RTMP_MAC_USB
+#error "For RT2870, you should define the compile flag -DRTMP_MAC_USB"
+#endif
+#include "../rtmp_type.h"
+#include "mac_usb.h"
-extern REG_PAIR RFRegTableOverRT3390[];
-extern UCHAR NUM_RF_REG_PARMS_OVER_RT3390;
-#endif // RT33xx //
+//#define RTMP_CHIP_NAME "RT2870"
-#endif //__RT33XX_H__ //
+#endif // RT2870 //
+#endif //__RT2870_H__ //
diff --git a/drivers/staging/rt3090/rt3370.h b/drivers/staging/rt2860/chip/rt3070.h
index bfa9006d059a..87df99ad929a 100644
--- a/drivers/staging/rt3090/rt3370.h
+++ b/drivers/staging/rt2860/chip/rt3070.h
@@ -25,7 +25,7 @@
*************************************************************************
Module Name:
- rt3370.h
+ rt3070.h
Abstract:
@@ -34,31 +34,35 @@
--------- ---------- ----------------------------------------------
*/
-#ifndef __RT3370_H__
-#define __RT3370_H__
+#ifndef __RT3070_H__
+#define __RT3070_H__
-#ifdef RT3370
+#ifdef RT3070
+#ifndef RTMP_USB_SUPPORT
#error "For RT3070, you should define the compile flag -DRTMP_USB_SUPPORT"
+#endif
+#ifndef RTMP_MAC_USB
#error "For RT3070, you should define the compile flag -DRTMP_MAC_USB"
+#endif
#ifndef RTMP_RF_RW_SUPPORT
#error "For RT3070, you should define the compile flag -DRTMP_RF_RW_SUPPORT"
#endif
-#ifndef RT33xx
+#ifndef RT30xx
#error "For RT3070, you should define the compile flag -DRT30xx"
#endif
#include "mac_usb.h"
-#include "rt33xx.h"
+#include "rt30xx.h"
//
// Device ID & Vendor ID, these values should match EEPROM value
//
-#endif // RT3370 //
+#endif // RT3070 //
-#endif //__RT3370_H__ //
+#endif //__RT3070_H__ //
diff --git a/drivers/staging/rt3090/rt3090.h b/drivers/staging/rt2860/chip/rt3090.h
index d325cb028c05..c2249a471231 100644
--- a/drivers/staging/rt3090/rt3090.h
+++ b/drivers/staging/rt2860/chip/rt3090.h
@@ -55,11 +55,6 @@
#error "For RT3090, you should define the compile flag -DRT30xx"
#endif
-#ifdef CARRIER_DETECTION_SUPPORT
-#define TONE_RADAR_DETECT_SUPPORT
-#define CARRIER_SENSE_NEW_ALGO
-#endif // CARRIER_DETECTION_SUPPORT //
-
#define PCIE_PS_SUPPORT
#include "mac_pci.h"
diff --git a/drivers/staging/rt3090/rt30xx.h b/drivers/staging/rt2860/chip/rt30xx.h
index 70971a062607..70971a062607 100644
--- a/drivers/staging/rt3090/rt30xx.h
+++ b/drivers/staging/rt2860/chip/rt30xx.h
diff --git a/drivers/staging/rt2860/rt28xx.h b/drivers/staging/rt2860/chip/rtmp_mac.h
index c08525002cc2..3ddb0bf03c6f 100644
--- a/drivers/staging/rt2860/rt28xx.h
+++ b/drivers/staging/rt2860/chip/rtmp_mac.h
@@ -25,60 +25,142 @@
*************************************************************************
Module Name:
- rt28xx.h
+ rtmp_mac.h
Abstract:
- RT28xx ASIC related definition & structures
+ Ralink Wireless Chip MAC related definition & structures
Revision History:
Who When What
-------- ---------- ----------------------------------------------
- Jan Lee Jan-3-2006 created for RT2860c
*/
-#ifndef __RT28XX_H__
-#define __RT28XX_H__
+#ifndef __RTMP_MAC_H__
+#define __RTMP_MAC_H__
+
+
+
+// =================================================================================
+// TX / RX ring descriptor format
+// =================================================================================
+
+// the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
+// MAC block use this TXINFO to control the transmission behavior of this frame.
+#define FIFO_MGMT 0
+#define FIFO_HCCA 1
+#define FIFO_EDCA 2
//
-// PCI registers - base address 0x0000
+// TXD Wireless Information format for Tx ring and Mgmt Ring
//
-#define PCI_CFG 0x0000
-#define PCI_EECTRL 0x0004
-#define PCI_MCUCTRL 0x0008
+//txop : for txop mode
+// 0:txop for the MPDU frame will be handles by ASIC by register
+// 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
+typedef struct PACKED _TXWI_STRUC {
+ // Word 0
+ // ex: 00 03 00 40 means txop = 3, PHYMODE = 1
+ UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
+ UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
+ UINT32 CFACK:1;
+ UINT32 TS:1;
+
+ UINT32 AMPDU:1;
+ UINT32 MpduDensity:3;
+ UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
+ UINT32 rsv:6;
-typedef int NTSTATUS;
+ UINT32 MCS:7;
+ UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
+ UINT32 ShortGI:1;
+ UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
+ UINT32 Ifs:1; //
+// UINT32 rsv2:2; //channel bandwidth 20MHz or 40 MHz
+ UINT32 rsv2:1;
+ UINT32 TxBF:1; // 3*3
+ UINT32 PHYMODE:2;
+ // Word1
+ // ex: 1c ff 38 00 means ACK=0, BAWinSize=7, MPDUtotalByteCount = 0x38
+ UINT32 ACK:1;
+ UINT32 NSEQ:1;
+ UINT32 BAWinSize:6;
+ UINT32 WirelessCliID:8;
+ UINT32 MPDUtotalByteCount:12;
+ UINT32 PacketId:4;
+ //Word2
+ UINT32 IV;
+ //Word3
+ UINT32 EIV;
+} TXWI_STRUC, *PTXWI_STRUC;
+
+
+//
+// RXWI wireless information format, in PBF. invisible in driver.
+//
+typedef struct PACKED _RXWI_STRUC {
+ // Word 0
+ UINT32 WirelessCliID:8;
+ UINT32 KeyIndex:2;
+ UINT32 BSSID:3;
+ UINT32 UDF:3;
+ UINT32 MPDUtotalByteCount:12;
+ UINT32 TID:4;
+ // Word 1
+ UINT32 FRAG:4;
+ UINT32 SEQUENCE:12;
+ UINT32 MCS:7;
+ UINT32 BW:1;
+ UINT32 ShortGI:1;
+ UINT32 STBC:2;
+ UINT32 rsv:3;
+ UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
+ //Word2
+ UINT32 RSSI0:8;
+ UINT32 RSSI1:8;
+ UINT32 RSSI2:8;
+ UINT32 rsv1:8;
+ //Word3
+ UINT32 SNR0:8;
+ UINT32 SNR1:8;
+ UINT32 FOFFSET:8; // RT35xx
+ UINT32 rsv2:8;
+ /*UINT32 rsv2:16;*/
+} RXWI_STRUC, *PRXWI_STRUC;
+
+
+// =================================================================================
+// Register format
+// =================================================================================
-#define OPT_14 0x114
//
// SCH/DMA registers - base address 0x0200
//
// INT_SOURCE_CSR: Interrupt source register. Write one to clear corresponding bit
//
-#define DMA_CSR0 0x200
-#define INT_SOURCE_CSR 0x200
+#define DMA_CSR0 0x200
+#define INT_SOURCE_CSR 0x200
typedef union _INT_SOURCE_CSR_STRUC {
struct {
UINT32 RxDelayINT:1;
UINT32 TxDelayINT:1;
UINT32 RxDone:1;
UINT32 Ac0DmaDone:1;//4
- UINT32 Ac1DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 HccaDmaDone:1; // bit7
- UINT32 MgmtDmaDone:1;
- UINT32 MCUCommandINT:1;//bit 9
- UINT32 RxTxCoherent:1;
- UINT32 TBTTInt:1;
- UINT32 PreTBTT:1;
- UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
- UINT32 AutoWakeup:1;//bit14
- UINT32 GPTimer:1;
- UINT32 RxCoherent:1;//bit16
- UINT32 TxCoherent:1;
- UINT32 :14;
+ UINT32 Ac1DmaDone:1;
+ UINT32 Ac2DmaDone:1;
+ UINT32 Ac3DmaDone:1;
+ UINT32 HccaDmaDone:1; // bit7
+ UINT32 MgmtDmaDone:1;
+ UINT32 MCUCommandINT:1;//bit 9
+ UINT32 RxTxCoherent:1;
+ UINT32 TBTTInt:1;
+ UINT32 PreTBTT:1;
+ UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
+ UINT32 AutoWakeup:1;//bit14
+ UINT32 GPTimer:1;
+ UINT32 RxCoherent:1;//bit16
+ UINT32 TxCoherent:1;
+ UINT32 :14;
} field;
UINT32 word;
} INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
@@ -93,64 +175,62 @@ typedef union _INT_MASK_CSR_STRUC {
UINT32 TxDelay:1;
UINT32 RxDone:1;
UINT32 Ac0DmaDone:1;
- UINT32 Ac1DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 HccaDmaDone:1;
- UINT32 MgmtDmaDone:1;
- UINT32 MCUCommandINT:1;
- UINT32 :20;
- UINT32 RxCoherent:1;
- UINT32 TxCoherent:1;
+ UINT32 Ac1DmaDone:1;
+ UINT32 Ac2DmaDone:1;
+ UINT32 Ac3DmaDone:1;
+ UINT32 HccaDmaDone:1;
+ UINT32 MgmtDmaDone:1;
+ UINT32 MCUCommandINT:1;
+ UINT32 :20;
+ UINT32 RxCoherent:1;
+ UINT32 TxCoherent:1;
} field;
UINT32 word;
} INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
-#define WPDMA_GLO_CFG 0x208
+#define WPDMA_GLO_CFG 0x208
typedef union _WPDMA_GLO_CFG_STRUC {
struct {
UINT32 EnableTxDMA:1;
UINT32 TxDMABusy:1;
UINT32 EnableRxDMA:1;
UINT32 RxDMABusy:1;
- UINT32 WPDMABurstSIZE:2;
- UINT32 EnTXWriteBackDDONE:1;
- UINT32 BigEndian:1;
- UINT32 RXHdrScater:8;
- UINT32 HDR_SEG_LEN:16;
+ UINT32 WPDMABurstSIZE:2;
+ UINT32 EnTXWriteBackDDONE:1;
+ UINT32 BigEndian:1;
+ UINT32 RXHdrScater:8;
+ UINT32 HDR_SEG_LEN:16;
} field;
UINT32 word;
} WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
-#define WPDMA_RST_IDX 0x20c
+#define WPDMA_RST_IDX 0x20c
typedef union _WPDMA_RST_IDX_STRUC {
struct {
UINT32 RST_DTX_IDX0:1;
UINT32 RST_DTX_IDX1:1;
UINT32 RST_DTX_IDX2:1;
UINT32 RST_DTX_IDX3:1;
- UINT32 RST_DTX_IDX4:1;
- UINT32 RST_DTX_IDX5:1;
- UINT32 rsv:10;
- UINT32 RST_DRX_IDX0:1;
- UINT32 :15;
+ UINT32 RST_DTX_IDX4:1;
+ UINT32 RST_DTX_IDX5:1;
+ UINT32 rsv:10;
+ UINT32 RST_DRX_IDX0:1;
+ UINT32 :15;
} field;
UINT32 word;
} WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
-
#define DELAY_INT_CFG 0x0210
typedef union _DELAY_INT_CFG_STRUC {
struct {
UINT32 RXMAX_PTIME:8;
- UINT32 RXMAX_PINT:7;
- UINT32 RXDLY_INT_EN:1;
- UINT32 TXMAX_PTIME:8;
- UINT32 TXMAX_PINT:7;
- UINT32 TXDLY_INT_EN:1;
+ UINT32 RXMAX_PINT:7;
+ UINT32 RXDLY_INT_EN:1;
+ UINT32 TXMAX_PTIME:8;
+ UINT32 TXMAX_PINT:7;
+ UINT32 TXDLY_INT_EN:1;
} field;
UINT32 word;
} DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
-
#define WMM_AIFSN_CFG 0x0214
typedef union _AIFSN_CSR_STRUC {
struct {
@@ -162,7 +242,6 @@ typedef union _AIFSN_CSR_STRUC {
} field;
UINT32 word;
} AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
-
//
// CWMIN_CSR: CWmin for each EDCA AC
//
@@ -193,6 +272,7 @@ typedef union _CWMAX_CSR_STRUC {
UINT32 word;
} CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
+
//
// AC_TXOP_CSR0: AC_BK/AC_BE TXOP register
//
@@ -217,6 +297,7 @@ typedef union _AC_TXOP_CSR1_STRUC {
UINT32 word;
} AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
+
#define RINGREG_DIFF 0x10
#define GPIO_CTRL_CFG 0x0228 //MAC_CSR13
#define MCU_CMD_CFG 0x022c
@@ -224,40 +305,41 @@ typedef union _AC_TXOP_CSR1_STRUC {
#define TX_MAX_CNT0 0x0234
#define TX_CTX_IDX0 0x0238
#define TX_DTX_IDX0 0x023c
-#define TX_BASE_PTR1 0x0240 //AC_BE base address
+#define TX_BASE_PTR1 0x0240 //AC_BE base address
#define TX_MAX_CNT1 0x0244
#define TX_CTX_IDX1 0x0248
#define TX_DTX_IDX1 0x024c
-#define TX_BASE_PTR2 0x0250 //AC_VI base address
+#define TX_BASE_PTR2 0x0250 //AC_VI base address
#define TX_MAX_CNT2 0x0254
#define TX_CTX_IDX2 0x0258
#define TX_DTX_IDX2 0x025c
-#define TX_BASE_PTR3 0x0260 //AC_VO base address
+#define TX_BASE_PTR3 0x0260 //AC_VO base address
#define TX_MAX_CNT3 0x0264
#define TX_CTX_IDX3 0x0268
#define TX_DTX_IDX3 0x026c
-#define TX_BASE_PTR4 0x0270 //HCCA base address
+#define TX_BASE_PTR4 0x0270 //HCCA base address
#define TX_MAX_CNT4 0x0274
#define TX_CTX_IDX4 0x0278
#define TX_DTX_IDX4 0x027c
-#define TX_BASE_PTR5 0x0280 //MGMT base address
+#define TX_BASE_PTR5 0x0280 //MGMT base address
#define TX_MAX_CNT5 0x0284
#define TX_CTX_IDX5 0x0288
#define TX_DTX_IDX5 0x028c
#define TX_MGMTMAX_CNT TX_MAX_CNT5
#define TX_MGMTCTX_IDX TX_CTX_IDX5
#define TX_MGMTDTX_IDX TX_DTX_IDX5
-#define RX_BASE_PTR 0x0290 //RX base address
+#define RX_BASE_PTR 0x0290 //RX base address
#define RX_MAX_CNT 0x0294
#define RX_CRX_IDX 0x0298
#define RX_DRX_IDX 0x029c
-#define USB_DMA_CFG 0x02a0
+
+#define USB_DMA_CFG 0x02a0
typedef union _USB_DMA_CFG_STRUC {
struct {
UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 256 bytes
- UINT32 phyclear:1; //phy watch dog enable. write 1
+ UINT32 phyclear:1; //phy watch dog enable. write 1
UINT32 rsv:2;
UINT32 TxClear:1; //Clear USB DMA TX path
UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
@@ -266,54 +348,44 @@ typedef union _USB_DMA_CFG_STRUC {
UINT32 TxBulkEn:1; //Enable USB DMA Tx
UINT32 EpoutValid:6; //OUT endpoint data valid
UINT32 RxBusy:1; //USB DMA RX FSM busy
- UINT32 TxBusy:1; //USB DMA TX FSM busy
+ UINT32 TxBusy:1; //USB DMA TX FSM busy
} field;
UINT32 word;
} USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
+
//
// 3 PBF registers
//
//
// Most are for debug. Driver doesn't touch PBF register.
-#define PBF_SYS_CTRL 0x0400
-#define PBF_CFG 0x0408
-#define PBF_MAX_PCNT 0x040C
-#define PBF_CTRL 0x0410
-#define PBF_INT_STA 0x0414
-#define PBF_INT_ENA 0x0418
-#define TXRXQ_PCNT 0x0438
-#define PBF_DBG 0x043c
-#define PBF_CAP_CTRL 0x0440
-
+#define PBF_SYS_CTRL 0x0400
+#define PBF_CFG 0x0408
+#define PBF_MAX_PCNT 0x040C
+#define PBF_CTRL 0x0410
+#define PBF_INT_STA 0x0414
+#define PBF_INT_ENA 0x0418
+#define TXRXQ_PCNT 0x0438
+#define PBF_DBG 0x043c
+#define PBF_CAP_CTRL 0x0440
+
+#ifdef RT30xx
+#ifdef RTMP_EFUSE_SUPPORT
// eFuse registers
-#define EFUSE_CTRL 0x0580
-#define EFUSE_DATA0 0x0590
-#define EFUSE_DATA1 0x0594
-#define EFUSE_DATA2 0x0598
-#define EFUSE_DATA3 0x059c
-#define EFUSE_USAGE_MAP_START 0x2d0
-#define EFUSE_USAGE_MAP_END 0x2fc
-#define EFUSE_TAG 0x2fe
-#define EFUSE_USAGE_MAP_SIZE 45
-
-typedef union _EFUSE_CTRL_STRUC {
- struct {
- UINT32 EFSROM_AOUT:6;
- UINT32 EFSROM_MODE:2;
- UINT32 EFSROM_LDO_OFF_TIME:6;
- UINT32 EFSROM_LDO_ON_TIME:2;
- UINT32 EFSROM_AIN:10;
- UINT32 RESERVED:4;
- UINT32 EFSROM_KICK:1;
- UINT32 SEL_EFUSE:1;
- } field;
- UINT32 word;
-} EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
-
-#define LDO_CFG0 0x05d4
+#define EFUSE_CTRL 0x0580
+#define EFUSE_DATA0 0x0590
+#define EFUSE_DATA1 0x0594
+#define EFUSE_DATA2 0x0598
+#define EFUSE_DATA3 0x059c
+#endif // RTMP_EFUSE_SUPPORT //
+#endif // RT30xx //
+
+#define OSC_CTRL 0x5a4
+#define PCIE_PHY_TX_ATTENUATION_CTRL 0x05C8
+#define LDO_CFG0 0x05d4
#define GPIO_SWITCH 0x05dc
+
//
// 4 MAC registers
//
@@ -328,10 +400,9 @@ typedef union _ASIC_VER_ID_STRUC {
} field;
UINT32 word;
} ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
-
#define MAC_SYS_CTRL 0x1004 //MAC_CSR1
-#define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
-#define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
+#define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
+#define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
//
// MAC_CSR2: STA MAC register 0
//
@@ -358,8 +429,8 @@ typedef union _MAC_DW1_STRUC {
UINT32 word;
} MAC_DW1_STRUC, *PMAC_DW1_STRUC;
-#define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
-#define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
+#define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
+#define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
//
// MAC_CSR5: BSSID register 1
@@ -368,7 +439,7 @@ typedef union _MAC_CSR5_STRUC {
struct {
UCHAR Byte4; // BSSID byte 4
UCHAR Byte5; // BSSID byte 5
- USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
+ USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
USHORT MBssBcnNum:3;
USHORT Rsvd:11;
} field;
@@ -376,7 +447,7 @@ typedef union _MAC_CSR5_STRUC {
} MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
#define MAX_LEN_CFG 0x1018 // rt2860b max 16k bytes. bit12:13 Maximum PSDU length (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16
-#define BBP_CSR_CFG 0x101c //
+#define BBP_CSR_CFG 0x101c //
//
// BBP_CSR_CFG: BBP serial control register
//
@@ -392,8 +463,7 @@ typedef union _BBP_CSR_CFG_STRUC {
} field;
UINT32 word;
} BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
-
-#define RF_CSR_CFG0 0x1020
+#define RF_CSR_CFG0 0x1020
//
// RF_CSR_CFG: RF control register
//
@@ -407,8 +477,7 @@ typedef union _RF_CSR_CFG0_STRUC {
} field;
UINT32 word;
} RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
-
-#define RF_CSR_CFG1 0x1024
+#define RF_CSR_CFG1 0x1024
typedef union _RF_CSR_CFG1_STRUC {
struct {
UINT32 RegIdAndContent:24; // Register value to program into BBP
@@ -417,8 +486,7 @@ typedef union _RF_CSR_CFG1_STRUC {
} field;
UINT32 word;
} RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
-
-#define RF_CSR_CFG2 0x1028 //
+#define RF_CSR_CFG2 0x1028 //
typedef union _RF_CSR_CFG2_STRUC {
struct {
UINT32 RegIdAndContent:24; // Register value to program into BBP
@@ -426,8 +494,7 @@ typedef union _RF_CSR_CFG2_STRUC {
} field;
UINT32 word;
} RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
-
-#define LED_CFG 0x102c // MAC_CSR14
+#define LED_CFG 0x102c // MAC_CSR14
typedef union _LED_CFG_STRUC {
struct {
UINT32 OnPeriod:8; // blinking on period unit 1ms
@@ -442,7 +509,6 @@ typedef union _LED_CFG_STRUC {
} field;
UINT32 word;
} LED_CFG_STRUC, *PLED_CFG_STRUC;
-
//
// 4.2 MAC TIMING configuration registers (offset:0x1100)
//
@@ -461,7 +527,7 @@ typedef union _IFS_SLOT_CFG_STRUC {
#define BKOFF_SLOT_CFG 0x1104 // mac_csr9 last 8 bits
#define NAV_TIME_CFG 0x1108 // NAV (MAC_CSR15)
-#define CH_TIME_CFG 0x110C // Count as channel busy
+#define CH_TIME_CFG 0x110C // Count as channel busy
#define PBF_LIFE_TIMER 0x1110 //TX/RX MPDU timestamp timer (free run)Unit: 1us
#define BCN_TIME_CFG 0x1114 // TXRX_CSR9
@@ -483,15 +549,14 @@ typedef union _BCN_TIME_CFG_STRUC {
} field;
UINT32 word;
} BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
-
-#define TBTT_SYNC_CFG 0x1118 // txrx_csr10
-#define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
-#define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
-#define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
-#define INT_TIMER_CFG 0x1128 //
-#define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
-#define CH_IDLE_STA 0x1130 // channel idle time
-#define CH_BUSY_STA 0x1134 // channle busy time
+#define TBTT_SYNC_CFG 0x1118 // txrx_csr10
+#define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
+#define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
+#define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
+#define INT_TIMER_CFG 0x1128 //
+#define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
+#define CH_IDLE_STA 0x1130 // channel idle time
+#define CH_BUSY_STA 0x1134 // channle busy time
//
// 4.2 MAC POWER configuration registers (offset:0x1200)
//
@@ -510,7 +575,6 @@ typedef union _AUTO_WAKEUP_STRUC {
} field;
UINT32 word;
} AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
-
//
// 4.3 MAC TX configuration registers (offset:0x1300)
//
@@ -554,7 +618,6 @@ typedef union _TX_RTS_CFG_STRUC {
} field;
UINT32 word;
} TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
-
#define TX_TIMEOUT_CFG 0x1348
typedef union _TX_TIMEOUT_CFG_STRUC {
struct {
@@ -566,7 +629,6 @@ typedef union _TX_TIMEOUT_CFG_STRUC {
} field;
UINT32 word;
} TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
-
#define TX_RTY_CFG 0x134c
typedef union PACKED _TX_RTY_CFG_STRUC {
struct {
@@ -580,7 +642,6 @@ typedef union PACKED _TX_RTY_CFG_STRUC {
} field;
UINT32 word;
} TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
-
#define TX_LINK_CFG 0x1350
typedef union PACKED _TX_LINK_CFG_STRUC {
struct PACKED {
@@ -596,7 +657,6 @@ typedef union PACKED _TX_LINK_CFG_STRUC {
} field;
UINT32 word;
} TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
-
#define HT_FBK_CFG0 0x1354
typedef union PACKED _HT_FBK_CFG0_STRUC {
struct {
@@ -611,7 +671,6 @@ typedef union PACKED _HT_FBK_CFG0_STRUC {
} field;
UINT32 word;
} HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
-
#define HT_FBK_CFG1 0x1358
typedef union _HT_FBK_CFG1_STRUC {
struct {
@@ -626,7 +685,6 @@ typedef union _HT_FBK_CFG1_STRUC {
} field;
UINT32 word;
} HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
-
#define LG_FBK_CFG0 0x135c
typedef union _LG_FBK_CFG0_STRUC {
struct {
@@ -641,7 +699,6 @@ typedef union _LG_FBK_CFG0_STRUC {
} field;
UINT32 word;
} LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
-
#define LG_FBK_CFG1 0x1360
typedef union _LG_FBK_CFG1_STRUC {
struct {
@@ -654,6 +711,7 @@ typedef union _LG_FBK_CFG1_STRUC {
UINT32 word;
} LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
+
//=======================================================
//================ Protection Paramater================================
//=======================================================
@@ -770,7 +828,6 @@ typedef union _RX_STA_CNT2_STRUC {
} field;
UINT32 word;
} RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
-
#define TX_STA_CNT0 0x170C //
//
// STA_CSR3: TX Beacon count
@@ -782,7 +839,6 @@ typedef union _TX_STA_CNT0_STRUC {
} field;
UINT32 word;
} TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
-
#define TX_STA_CNT1 0x1710 //
//
// TX_STA_CNT1: TX tx count
@@ -794,7 +850,6 @@ typedef union _TX_STA_CNT1_STRUC {
} field;
UINT32 word;
} TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
-
#define TX_STA_CNT2 0x1714 //
//
// TX_STA_CNT2: TX tx count
@@ -806,18 +861,17 @@ typedef union _TX_STA_CNT2_STRUC {
} field;
UINT32 word;
} TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
-
#define TX_STA_FIFO 0x1718 //
//
// TX_STA_FIFO_STRUC: TX Result for specific PID status fifo register
//
typedef union PACKED _TX_STA_FIFO_STRUC {
struct {
- UINT32 bValid:1; // 1:This register contains a valid TX result
- UINT32 PidType:4;
- UINT32 TxSuccess:1; // Tx No retry success
- UINT32 TxAggre:1; // Tx Retry Success
- UINT32 TxAckRequired:1; // Tx fail
+ UINT32 bValid:1; // 1:This register contains a valid TX result
+ UINT32 PidType:4;
+ UINT32 TxSuccess:1; // Tx No retry success
+ UINT32 TxAggre:1; // Tx Retry Success
+ UINT32 TxAckRequired:1; // Tx fail
UINT32 wcid:8; //wireless client index
// UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
@@ -826,7 +880,6 @@ typedef union PACKED _TX_STA_FIFO_STRUC {
} field;
UINT32 word;
} TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
-
// Debug counter
#define TX_AGG_CNT 0x171c
typedef union _TX_AGG_CNT_STRUC {
@@ -836,7 +889,6 @@ typedef union _TX_AGG_CNT_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
-
// Debug counter
#define TX_AGG_CNT0 0x1720
typedef union _TX_AGG_CNT0_STRUC {
@@ -846,7 +898,6 @@ typedef union _TX_AGG_CNT0_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
-
// Debug counter
#define TX_AGG_CNT1 0x1724
typedef union _TX_AGG_CNT1_STRUC {
@@ -856,7 +907,6 @@ typedef union _TX_AGG_CNT1_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
-
#define TX_AGG_CNT2 0x1728
typedef union _TX_AGG_CNT2_STRUC {
struct {
@@ -865,7 +915,6 @@ typedef union _TX_AGG_CNT2_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
-
// Debug counter
#define TX_AGG_CNT3 0x172c
typedef union _TX_AGG_CNT3_STRUC {
@@ -875,7 +924,6 @@ typedef union _TX_AGG_CNT3_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
-
// Debug counter
#define TX_AGG_CNT4 0x1730
typedef union _TX_AGG_CNT4_STRUC {
@@ -885,7 +933,6 @@ typedef union _TX_AGG_CNT4_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
-
#define TX_AGG_CNT5 0x1734
typedef union _TX_AGG_CNT5_STRUC {
struct {
@@ -894,7 +941,6 @@ typedef union _TX_AGG_CNT5_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
-
#define TX_AGG_CNT6 0x1738
typedef union _TX_AGG_CNT6_STRUC {
struct {
@@ -903,7 +949,6 @@ typedef union _TX_AGG_CNT6_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
-
#define TX_AGG_CNT7 0x173c
typedef union _TX_AGG_CNT7_STRUC {
struct {
@@ -912,7 +957,6 @@ typedef union _TX_AGG_CNT7_STRUC {
} field;
UINT32 word;
} TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
-
#define MPDU_DENSITY_CNT 0x1740
typedef union _MPDU_DEN_CNT_STRUC {
struct {
@@ -921,7 +965,6 @@ typedef union _MPDU_DEN_CNT_STRUC {
} field;
UINT32 word;
} MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
-
//
// TXRX control registers - base address 0x3000
//
@@ -940,13 +983,14 @@ typedef union _MPDU_DEN_CNT_STRUC {
#define HW_IVEIV_ENTRY_SIZE 8
#define MAC_WCID_ATTRIBUTE_BASE 0x6800 // 4-byte * 256-entry = -byte
#define HW_WCID_ATTRI_SIZE 4
-#define WCID_RESERVED 0x6bfc
+#define WCID_RESERVED 0x6bfc
#define SHARED_KEY_TABLE_BASE 0x6c00 // 32-byte * 16-entry = 512-byte
#define SHARED_KEY_MODE_BASE 0x7000 // 32-byte * 16-entry = 512-byte
#define HW_SHARED_KEY_MODE_SIZE 4
#define SHAREDKEYTABLE 0
#define PAIRWISEKEYTABLE 1
+
typedef union _SHAREDKEY_MODE_STRUC {
struct {
UINT32 Bss0Key0CipherAlg:3;
@@ -968,7 +1012,6 @@ typedef union _SHAREDKEY_MODE_STRUC {
} field;
UINT32 word;
} SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
-
// 64-entry for pairwise key table
typedef struct _HW_WCID_ENTRY { // 8-byte per entry
UCHAR Address[6];
@@ -976,260 +1019,6 @@ typedef struct _HW_WCID_ENTRY { // 8-byte per entry
} HW_WCID_ENTRY, PHW_WCID_ENTRY;
-
-//
-// Other on-chip shared memory space, base = 0x2000
-//
-
-// CIS space - base address = 0x2000
-#define HW_CIS_BASE 0x2000
-
-// Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
-#define HW_CS_CTS_BASE 0x7700
-// DFS CTS frame base address. It's where mac stores CTS frame for DFS.
-#define HW_DFS_CTS_BASE 0x7780
-#define HW_CTS_FRAME_SIZE 0x80
-
-// 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
-// to save debugging settings
-#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
-#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
-
-// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
-// Three section discontinue memory segments will be used.
-// 1. The original region for BCN 0~3
-// 2. Extract memory from FCE table for BCN 4~5
-// 3. Extract memory from Pair-wise key table for BCN 6~7
-// It occupied those memory of wcid 238~253 for BCN 6
-// and wcid 222~237 for BCN 7
-#define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
-#define HW_BEACON_BASE0 0x7800
-#define HW_BEACON_BASE1 0x7A00
-#define HW_BEACON_BASE2 0x7C00
-#define HW_BEACON_BASE3 0x7E00
-#define HW_BEACON_BASE4 0x7200
-#define HW_BEACON_BASE5 0x7400
-#define HW_BEACON_BASE6 0x5DC0
-#define HW_BEACON_BASE7 0x5BC0
-
-#define HW_BEACON_MAX_COUNT 8
-#define HW_BEACON_OFFSET 0x0200
-#define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
-
-// HOST-MCU shared memory - base address = 0x2100
-#define HOST_CMD_CSR 0x404
-#define H2M_MAILBOX_CSR 0x7010
-#define H2M_MAILBOX_CID 0x7014
-#define H2M_MAILBOX_STATUS 0x701c
-#define H2M_INT_SRC 0x7024
-#define H2M_BBP_AGENT 0x7028
-#define M2H_CMD_DONE_CSR 0x000c
-#define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
-#define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
-#define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
-#define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
-#define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
-
-//
-// Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
-//
-//
-// DMA RING DESCRIPTOR
-//
-#define E2PROM_CSR 0x0004
-#define IO_CNTL_CSR 0x77d0
-
-#ifdef RT2860
-// 8051 firmware image for RT2860 - base address = 0x4000
-#define FIRMWARE_IMAGE_BASE 0x2000
-#define MAX_FIRMWARE_IMAGE_SIZE 0x2000 // 8kbyte
-#endif
-#ifdef RT2870
-// 8051 firmware image for usb - use last-half base address = 0x3000
-#define FIRMWARE_IMAGE_BASE 0x3000
-#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
-#endif // RT2870 //
-
-// ================================================================
-// Tx / Rx / Mgmt ring descriptor definition
-// ================================================================
-
-// the following PID values are used to mark outgoing frame type in TXD->PID so that
-// proper TX statistics can be collected based on these categories
-// b3-2 of PID field -
-#define PID_MGMT 0x05
-#define PID_BEACON 0x0c
-#define PID_DATA_NORMALUCAST 0x02
-#define PID_DATA_AMPDU 0x04
-#define PID_DATA_NO_ACK 0x08
-#define PID_DATA_NOT_NORM_ACK 0x03
-// value domain of pTxD->HostQId (4-bit: 0~15)
-#define QID_AC_BK 1 // meet ACI definition in 802.11e
-#define QID_AC_BE 0 // meet ACI definition in 802.11e
-#define QID_AC_VI 2
-#define QID_AC_VO 3
-#define QID_HCCA 4
-#define NUM_OF_TX_RING 5
-#define QID_MGMT 13
-#define QID_RX 14
-#define QID_OTHER 15
-
-
-// ------------------------------------------------------
-// BBP & RF definition
-// ------------------------------------------------------
-#define BUSY 1
-#define IDLE 0
-
-#define RF_R00 0
-#define RF_R01 1
-#define RF_R02 2
-#define RF_R03 3
-#define RF_R04 4
-#define RF_R05 5
-#define RF_R06 6
-#define RF_R07 7
-#define RF_R08 8
-#define RF_R09 9
-#define RF_R10 10
-#define RF_R11 11
-#define RF_R12 12
-#define RF_R13 13
-#define RF_R14 14
-#define RF_R15 15
-#define RF_R16 16
-#define RF_R17 17
-#define RF_R18 18
-#define RF_R19 19
-#define RF_R20 20
-#define RF_R21 21
-#define RF_R22 22
-#define RF_R23 23
-#define RF_R24 24
-#define RF_R25 25
-#define RF_R26 26
-#define RF_R27 27
-#define RF_R28 28
-#define RF_R29 29
-#define RF_R30 30
-#define RF_R31 31
-
-#define BBP_R0 0 // version
-#define BBP_R1 1 // TSSI
-#define BBP_R2 2 // TX configure
-#define BBP_R3 3
-#define BBP_R4 4
-#define BBP_R5 5
-#define BBP_R6 6
-#define BBP_R14 14 // RX configure
-#define BBP_R16 16
-#define BBP_R17 17 // RX sensibility
-#define BBP_R18 18
-#define BBP_R21 21
-#define BBP_R22 22
-#define BBP_R24 24
-#define BBP_R25 25
-#define BBP_R31 31
-#define BBP_R49 49 //TSSI
-#define BBP_R50 50
-#define BBP_R51 51
-#define BBP_R52 52
-#define BBP_R55 55
-#define BBP_R62 62 // Rx SQ0 Threshold HIGH
-#define BBP_R63 63
-#define BBP_R64 64
-#define BBP_R65 65
-#define BBP_R66 66
-#define BBP_R67 67
-#define BBP_R68 68
-#define BBP_R69 69
-#define BBP_R70 70 // Rx AGC SQ CCK Xcorr threshold
-#define BBP_R73 73
-#define BBP_R75 75
-#define BBP_R77 77
-#define BBP_R79 79
-#define BBP_R80 80
-#define BBP_R81 81
-#define BBP_R82 82
-#define BBP_R83 83
-#define BBP_R84 84
-#define BBP_R86 86
-#define BBP_R91 91
-#define BBP_R92 92
-#define BBP_R94 94 // Tx Gain Control
-#define BBP_R103 103
-#define BBP_R105 105
-#define BBP_R113 113
-#define BBP_R114 114
-#define BBP_R115 115
-#define BBP_R116 116
-#define BBP_R117 117
-#define BBP_R118 118
-#define BBP_R119 119
-#define BBP_R120 120
-#define BBP_R121 121
-#define BBP_R122 122
-#define BBP_R123 123
-#define BBP_R138 138 // add by johnli, RF power sequence setup, ADC dynamic on/off control
-
-
-#define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db
-
-#define RSSI_FOR_VERY_LOW_SENSIBILITY -35
-#define RSSI_FOR_LOW_SENSIBILITY -58
-#define RSSI_FOR_MID_LOW_SENSIBILITY -80
-#define RSSI_FOR_MID_SENSIBILITY -90
-
-//-------------------------------------------------------------------------
-// EEPROM definition
-//-------------------------------------------------------------------------
-#define EEDO 0x08
-#define EEDI 0x04
-#define EECS 0x02
-#define EESK 0x01
-#define EERL 0x80
-
-#define EEPROM_WRITE_OPCODE 0x05
-#define EEPROM_READ_OPCODE 0x06
-#define EEPROM_EWDS_OPCODE 0x10
-#define EEPROM_EWEN_OPCODE 0x13
-
-#define NUM_EEPROM_BBP_PARMS 19 // Include NIC Config 0, 1, CR, TX ALC step, BBPs
-#define NUM_EEPROM_TX_G_PARMS 7
-#define EEPROM_NIC1_OFFSET 0x34 // The address is from NIC config 0, not BBP register ID
-#define EEPROM_NIC2_OFFSET 0x36 // The address is from NIC config 0, not BBP register ID
-#define EEPROM_BBP_BASE_OFFSET 0xf0 // The address is from NIC config 0, not BBP register ID
-#define EEPROM_G_TX_PWR_OFFSET 0x52
-#define EEPROM_G_TX2_PWR_OFFSET 0x60
-#define EEPROM_LED1_OFFSET 0x3c
-#define EEPROM_LED2_OFFSET 0x3e
-#define EEPROM_LED3_OFFSET 0x40
-#define EEPROM_LNA_OFFSET 0x44
-#define EEPROM_RSSI_BG_OFFSET 0x46
-#define EEPROM_RSSI_A_OFFSET 0x4a
-#define EEPROM_DEFINE_MAX_TXPWR 0x4e
-#define EEPROM_TXPOWER_BYRATE_20MHZ_2_4G 0xde // 20MHZ 2.4G tx power.
-#define EEPROM_TXPOWER_BYRATE_40MHZ_2_4G 0xee // 40MHZ 2.4G tx power.
-#define EEPROM_TXPOWER_BYRATE_20MHZ_5G 0xfa // 20MHZ 5G tx power.
-#define EEPROM_TXPOWER_BYRATE_40MHZ_5G 0x10a // 40MHZ 5G tx power.
-#define EEPROM_A_TX_PWR_OFFSET 0x78
-#define EEPROM_A_TX2_PWR_OFFSET 0xa6
-#define EEPROM_VERSION_OFFSET 0x02
-#define EEPROM_FREQ_OFFSET 0x3a
-#define EEPROM_TXPOWER_BYRATE 0xde // 20MHZ power.
-#define EEPROM_TXPOWER_DELTA 0x50 // 20MHZ AND 40 MHZ use different power. This is delta in 40MHZ.
-#define VALID_EEPROM_VERSION 1
-
-// PairKeyMode definition
-#define PKMODE_NONE 0
-#define PKMODE_WEP64 1
-#define PKMODE_WEP128 2
-#define PKMODE_TKIP 3
-#define PKMODE_AES 4
-#define PKMODE_CKIP64 5
-#define PKMODE_CKIP128 6
-#define PKMODE_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
-
// =================================================================================
// WCID format
// =================================================================================
@@ -1259,148 +1048,6 @@ typedef struct _MAC_ATTRIBUTE_STRUC {
UINT32 rsv:22;
} MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
-// =================================================================================
-// TX / RX ring descriptor format
-// =================================================================================
-
-// the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
-// MAC block use this TXINFO to control the transmission behavior of this frame.
-#define FIFO_MGMT 0
-#define FIFO_HCCA 1
-#define FIFO_EDCA 2
-
-//
-// TX descriptor format, Tx ring, Mgmt Ring
-//
-typedef struct PACKED _TXD_STRUC {
- // Word 0
- UINT32 SDPtr0;
- // Word 1
- UINT32 SDLen1:14;
- UINT32 LastSec1:1;
- UINT32 Burst:1;
- UINT32 SDLen0:14;
- UINT32 LastSec0:1;
- UINT32 DMADONE:1;
- //Word2
- UINT32 SDPtr1;
- //Word3
- UINT32 rsv2:24;
- UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
- UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
- UINT32 rsv:2;
- UINT32 TCO:1; //
- UINT32 UCO:1; //
- UINT32 ICO:1; //
-} TXD_STRUC, *PTXD_STRUC;
-
-//
-// TXD Wireless Information format for Tx ring and Mgmt Ring
-//
-//txop : for txop mode
-// 0:txop for the MPDU frame will be handles by ASIC by register
-// 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
-typedef struct PACKED _TXWI_STRUC {
- // Word 0
- UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
- UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
- UINT32 CFACK:1;
- UINT32 TS:1;
-
- UINT32 AMPDU:1;
- UINT32 MpduDensity:3;
- UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
- UINT32 rsv:6;
-
- UINT32 MCS:7;
- UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
- UINT32 ShortGI:1;
- UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
- UINT32 Ifs:1; //
- UINT32 rsv2:1;
- UINT32 TxBF:1; // 3*3
- UINT32 PHYMODE:2;
- // Word 1
- UINT32 ACK:1;
- UINT32 NSEQ:1;
- UINT32 BAWinSize:6;
- UINT32 WirelessCliID:8;
- UINT32 MPDUtotalByteCount:12;
- UINT32 PacketId:4;
- //Word2
- UINT32 IV;
- //Word3
- UINT32 EIV;
-} TXWI_STRUC, *PTXWI_STRUC;
-
-//
-// Rx descriptor format, Rx Ring
-//
-#ifdef RT2860
-typedef struct PACKED _RXD_STRUC {
- // Word 0
- UINT32 SDP0;
- // Word 1
- UINT32 SDL1:14;
- UINT32 Rsv:2;
- UINT32 SDL0:14;
- UINT32 LS0:1;
- UINT32 DDONE:1;
- // Word 2
- UINT32 SDP1;
- // Word 3
- UINT32 BA:1;
- UINT32 DATA:1;
- UINT32 NULLDATA:1;
- UINT32 FRAG:1;
- UINT32 U2M:1; // 1: this RX frame is unicast to me
- UINT32 Mcast:1; // 1: this is a multicast frame
- UINT32 Bcast:1; // 1: this is a broadcast frame
- UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
- UINT32 Crc:1; // 1: CRC error
- UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
- UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
- UINT32 HTC:1;
- UINT32 RSSI:1;
- UINT32 L2PAD:1;
- UINT32 AMPDU:1;
- UINT32 Decrypted:1; // this frame is being decrypted.
- UINT32 PlcpSignal:1; // To be moved
- UINT32 PlcpRssil:1;// To be moved
- UINT32 Rsv1:13;
-} RXD_STRUC, *PRXD_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
-#endif /* RT2860 */
-
-//
-// RXWI wireless information format, in PBF. invisible in driver.
-//
-typedef struct PACKED _RXWI_STRUC {
- // Word 0
- UINT32 WirelessCliID:8;
- UINT32 KeyIndex:2;
- UINT32 BSSID:3;
- UINT32 UDF:3;
- UINT32 MPDUtotalByteCount:12;
- UINT32 TID:4;
- // Word 1
- UINT32 FRAG:4;
- UINT32 SEQUENCE:12;
- UINT32 MCS:7;
- UINT32 BW:1;
- UINT32 ShortGI:1;
- UINT32 STBC:2;
- UINT32 rsv:3;
- UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
- //Word2
- UINT32 RSSI0:8;
- UINT32 RSSI1:8;
- UINT32 RSSI2:8;
- UINT32 rsv1:8;
- //Word3
- UINT32 SNR0:8;
- UINT32 SNR1:8;
- UINT32 rsv2:16;
-} RXWI_STRUC, *PRXWI_STRUC;
// =================================================================================
// HOST-MCU communication data structure
@@ -1432,22 +1079,6 @@ typedef union _M2H_CMD_DONE_STRUC {
UINT32 word;
} M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
-//
-// MCU_LEDCS: MCU LED Control Setting.
-//
-typedef union _MCU_LEDCS_STRUC {
- struct {
- UCHAR LedMode:7;
- UCHAR Polarity:1;
- } field;
- UCHAR word;
-} MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
-
-// =================================================================================
-// Register format
-// =================================================================================
-
-
//NAV_TIME_CFG :NAV
typedef union _NAV_TIME_CFG_STRUC {
@@ -1461,6 +1092,7 @@ typedef union _NAV_TIME_CFG_STRUC {
UINT32 word;
} NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
+
//
// RX_FILTR_CFG: /RX configuration register
//
@@ -1484,14 +1116,17 @@ typedef union _RX_FILTR_CFG_STRUC {
UINT32 DropRts:1; // Drop Ps-Poll
UINT32 DropPsPoll:1; // Drop Ps-Poll
UINT32 DropBA:1; //
- UINT32 DropBAR:1; //
+ UINT32 DropBAR:1; //
- UINT32 DropRsvCntlType:1;
+ UINT32 DropRsvCntlType:1;
UINT32 :15;
} field;
UINT32 word;
} RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
+
+
+
//
// PHY_CSR4: RF serial control register
//
@@ -1506,6 +1141,7 @@ typedef union _PHY_CSR4_STRUC {
UINT32 word;
} PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
+
//
// SEC_CSR5: shared key table security mode register
//
@@ -1531,6 +1167,7 @@ typedef union _SEC_CSR5_STRUC {
UINT32 word;
} SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
+
//
// HOST_CMD_CSR: For HOST to interrupt embedded processor
//
@@ -1542,6 +1179,7 @@ typedef union _HOST_CMD_CSR_STRUC {
UINT32 word;
} HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
+
//
// AIFSN_CSR: AIFSN for each EDCA AC
//
@@ -1565,87 +1203,6 @@ typedef union _E2PROM_CSR_STRUC {
UINT32 word;
} E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
-// -------------------------------------------------------------------
-// E2PROM data layout
-// -------------------------------------------------------------------
-
-//
-// EEPROM antenna select format
-//
-typedef union _EEPROM_ANTENNA_STRUC {
- struct {
- USHORT RxPath:4; // 1: 1R, 2: 2R, 3: 3R
- USHORT TxPath:4; // 1: 1T, 2: 2T
- USHORT RfIcType:4; // see E2PROM document
- USHORT Rsv:4;
- } field;
- USHORT word;
-} EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
-
-typedef union _EEPROM_NIC_CINFIG2_STRUC {
- struct {
- USHORT HardwareRadioControl:1; // 1:enable, 0:disable
- USHORT DynamicTxAgcControl:1; //
- USHORT ExternalLNAForG:1; //
- USHORT ExternalLNAForA:1; // external LNA enable for 2.4G
- USHORT CardbusAcceleration:1; // !!! NOTE: 0 - enable, 1 - disable
- USHORT BW40MSidebandForG:1;
- USHORT BW40MSidebandForA:1;
- USHORT EnableWPSPBC:1; // WPS PBC Control bit
- USHORT BW40MAvailForG:1; // 0:enable, 1:disable
- USHORT BW40MAvailForA:1; // 0:enable, 1:disable
- USHORT Rsv1:1; // must be 0
- USHORT AntDiversity:1; // Antenna diversity
- USHORT Rsv2:3; // must be 0
- USHORT DACTestBit:1; // control if driver should patch the DAC issue
- } field;
- USHORT word;
-} EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
-
-//
-// TX_PWR Value valid range 0xFA(-6) ~ 0x24(36)
-//
-typedef union _EEPROM_TX_PWR_STRUC {
- struct {
- CHAR Byte0; // Low Byte
- CHAR Byte1; // High Byte
- } field;
- USHORT word;
-} EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
-
-typedef union _EEPROM_VERSION_STRUC {
- struct {
- UCHAR FaeReleaseNumber; // Low Byte
- UCHAR Version; // High Byte
- } field;
- USHORT word;
-} EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
-
-typedef union _EEPROM_LED_STRUC {
- struct {
- USHORT PolarityRDY_G:1; // Polarity RDY_G setting.
- USHORT PolarityRDY_A:1; // Polarity RDY_A setting.
- USHORT PolarityACT:1; // Polarity ACT setting.
- USHORT PolarityGPIO_0:1; // Polarity GPIO#0 setting.
- USHORT PolarityGPIO_1:1; // Polarity GPIO#1 setting.
- USHORT PolarityGPIO_2:1; // Polarity GPIO#2 setting.
- USHORT PolarityGPIO_3:1; // Polarity GPIO#3 setting.
- USHORT PolarityGPIO_4:1; // Polarity GPIO#4 setting.
- USHORT LedMode:5; // Led mode.
- USHORT Rsvd:3; // Reserved
- } field;
- USHORT word;
-} EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
-
-typedef union _EEPROM_TXPOWER_DELTA_STRUC {
- struct {
- UCHAR DeltaValue:6; // Tx Power dalta value (MAX=4)
- UCHAR Type:1; // 1: plus the delta value, 0: minus the delta value
- UCHAR TxPowerEnable:1;// Enable
- } field;
- UCHAR value;
-} EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
-
//
// QOS_CSR0: TXOP holder address0 register
//
@@ -1685,4 +1242,93 @@ typedef union _RF_CSR_CFG_STRUC {
UINT word;
} RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
-#endif // __RT28XX_H__
+
+//
+// Other on-chip shared memory space, base = 0x2000
+//
+
+// CIS space - base address = 0x2000
+#define HW_CIS_BASE 0x2000
+
+// Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
+#define HW_CS_CTS_BASE 0x7700
+// DFS CTS frame base address. It's where mac stores CTS frame for DFS.
+#define HW_DFS_CTS_BASE 0x7780
+#define HW_CTS_FRAME_SIZE 0x80
+
+// 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
+// to save debugging settings
+#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
+#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
+
+// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
+// Three section discontinue memory segments will be used.
+// 1. The original region for BCN 0~3
+// 2. Extract memory from FCE table for BCN 4~5
+// 3. Extract memory from Pair-wise key table for BCN 6~7
+// It occupied those memory of wcid 238~253 for BCN 6
+// and wcid 222~237 for BCN 7
+#define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
+#define HW_BEACON_BASE0 0x7800
+#define HW_BEACON_BASE1 0x7A00
+#define HW_BEACON_BASE2 0x7C00
+#define HW_BEACON_BASE3 0x7E00
+#define HW_BEACON_BASE4 0x7200
+#define HW_BEACON_BASE5 0x7400
+#define HW_BEACON_BASE6 0x5DC0
+#define HW_BEACON_BASE7 0x5BC0
+
+#define HW_BEACON_MAX_COUNT 8
+#define HW_BEACON_OFFSET 0x0200
+#define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
+
+// HOST-MCU shared memory - base address = 0x2100
+#define HOST_CMD_CSR 0x404
+#define H2M_MAILBOX_CSR 0x7010
+#define H2M_MAILBOX_CID 0x7014
+#define H2M_MAILBOX_STATUS 0x701c
+#define H2M_INT_SRC 0x7024
+#define H2M_BBP_AGENT 0x7028
+#define M2H_CMD_DONE_CSR 0x000c
+#define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
+#define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
+#define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
+#define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
+#define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
+
+//
+// Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
+//
+//
+// DMA RING DESCRIPTOR
+//
+#define E2PROM_CSR 0x0004
+#define IO_CNTL_CSR 0x77d0
+
+
+
+// ================================================================
+// Tx / Rx / Mgmt ring descriptor definition
+// ================================================================
+
+// the following PID values are used to mark outgoing frame type in TXD->PID so that
+// proper TX statistics can be collected based on these categories
+// b3-2 of PID field -
+#define PID_MGMT 0x05
+#define PID_BEACON 0x0c
+#define PID_DATA_NORMALUCAST 0x02
+#define PID_DATA_AMPDU 0x04
+#define PID_DATA_NO_ACK 0x08
+#define PID_DATA_NOT_NORM_ACK 0x03
+// value domain of pTxD->HostQId (4-bit: 0~15)
+#define QID_AC_BK 1 // meet ACI definition in 802.11e
+#define QID_AC_BE 0 // meet ACI definition in 802.11e
+#define QID_AC_VI 2
+#define QID_AC_VO 3
+#define QID_HCCA 4
+#define NUM_OF_TX_RING 4
+#define QID_MGMT 13
+#define QID_RX 14
+#define QID_OTHER 15
+
+#endif // __RTMP_MAC_H__ //
diff --git a/drivers/staging/rt3090/rtmp_phy.h b/drivers/staging/rt2860/chip/rtmp_phy.h
index b9848cac282e..87516f3a111a 100644
--- a/drivers/staging/rt3090/rtmp_phy.h
+++ b/drivers/staging/rt2860/chip/rtmp_phy.h
@@ -154,25 +154,8 @@
#define BBP_R138 138 // add by johnli, RF power sequence setup, ADC dynamic on/off control
#endif // RT30xx //
-
#define BBPR94_DEFAULT 0x06 // Add 1 value will gain 1db
-
-#ifdef MERGE_ARCH_TEAM
- #define MAX_BBP_ID 200
- #define MAX_BBP_MSG_SIZE 4096
-#else
-#ifdef RT30xx
- // edit by johnli, RF power sequence setup, add BBP R138 for ADC dynamic on/off control
- #define MAX_BBP_ID 138
-#endif // RT30xx //
-#ifndef RT30xx
- #define MAX_BBP_ID 136
-#endif // RT30xx //
- #define MAX_BBP_MSG_SIZE 2048
-#endif // MERGE_ARCH_TEAM //
-
-
//
// BBP & RF are using indirect access. Before write any value into it.
// We have to make sure there is no outstanding command pending via checking busy bit.
@@ -214,15 +197,15 @@
} \
}
#endif // RTMP_MAC_PCI //
-
-
+#ifdef RTMP_MAC_USB
+#define RTMP_RF_IO_WRITE32(_A, _V) RTUSBWriteRFRegister(_A, _V)
+#endif // RTMP_MAC_USB //
#ifdef RT30xx
#define RTMP_RF_IO_READ8_BY_REG_ID(_A, _I, _pV) RT30xxReadRFRegister(_A, _I, _pV)
#define RTMP_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V) RT30xxWriteRFRegister(_A, _I, _V)
#endif // RT30xx //
-
/*****************************************************************************
BBP register Read/Write marco definitions.
we read/write the bbp value by register's ID.
@@ -295,7 +278,7 @@
But for some chipset which didn't have mcu (e.g., RBUS based chipset), we
will use this function too and didn't access the bbp register via the MCU.
*/
-#ifndef CONFIG_STA_SUPPORT
+#if 0
#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
do{ \
if ((_A)->bPCIclkOff == FALSE) \
@@ -306,8 +289,7 @@
RTMP_BBP_IO_READ8((_A), (_I), (_pV), TRUE); \
} \
}while(0)
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
+#else
// Read BBP register by register's ID. Generate PER to test BA
#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
{ \
@@ -399,7 +381,7 @@
*(_pV) = (_A)->BbpWriteLatch[_I]; \
} \
}
-#endif // CONFIG_STA_SUPPORT //
+#endif // 0 //
/*
basic marco for BBP write operation.
@@ -459,7 +441,7 @@
But for some chipset which didn't have mcu (e.g., RBUS based chipset), we
will use this function too and didn't access the bbp register via the MCU.
*/
-#ifndef CONFIG_STA_SUPPORT
+#if 0
#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _pV) \
do{ \
if ((_A)->bPCIclkOff == FALSE) \
@@ -470,8 +452,7 @@
RTMP_BBP_IO_WRITE8((_A), (_I), (_pV), TRUE); \
} \
}while(0)
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
+#else
// Write BBP register by register's ID & value
#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
{ \
@@ -557,44 +538,18 @@
DBGPRINT_ERR(("****** BBP_Write_Latch Buffer exceeds max boundry ****** \n")); \
} \
}
-#endif // CONFIG_STA_SUPPORT //
-#endif // RTMP_MAC_PCI //
+#endif // 0 //
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTUSBReadBBPRegister(_A, _I, _pV)
+#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTUSBWriteBBPRegister(_A, _I, _V)
+#define BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTUSBWriteBBPRegister(_A, _I, _V)
+#define BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTUSBReadBBPRegister(_A, _I, _pV)
+#endif // RTMP_MAC_USB //
#ifdef RT30xx
-//Need to collect each ant's rssi concurrently
-//rssi1 is report to pair2 Ant and rss2 is reprot to pair1 Ant when 4 Ant
-#define COLLECT_RX_ANTENNA_AVERAGE_RSSI(_pAd, _rssi1, _rssi2) \
-{ \
- SHORT AvgRssi; \
- UCHAR UsedAnt; \
- if (_pAd->RxAnt.EvaluatePeriod == 0) \
- { \
- UsedAnt = _pAd->RxAnt.Pair1PrimaryRxAnt; \
- AvgRssi = _pAd->RxAnt.Pair1AvgRssi[UsedAnt]; \
- if (AvgRssi < 0) \
- AvgRssi = AvgRssi - (AvgRssi >> 3) + _rssi1; \
- else \
- AvgRssi = _rssi1 << 3; \
- _pAd->RxAnt.Pair1AvgRssi[UsedAnt] = AvgRssi; \
- } \
- else \
- { \
- UsedAnt = _pAd->RxAnt.Pair1SecondaryRxAnt; \
- AvgRssi = _pAd->RxAnt.Pair1AvgRssi[UsedAnt]; \
- if ((AvgRssi < 0) && (_pAd->RxAnt.FirstPktArrivedWhenEvaluate)) \
- AvgRssi = AvgRssi - (AvgRssi >> 3) + _rssi1; \
- else \
- { \
- _pAd->RxAnt.FirstPktArrivedWhenEvaluate = TRUE; \
- AvgRssi = _rssi1 << 3; \
- } \
- _pAd->RxAnt.Pair1AvgRssi[UsedAnt] = AvgRssi; \
- _pAd->RxAnt.RcvPktNumWhenEvaluate++; \
- } \
-}
-
#define RTMP_ASIC_MMPS_DISABLE(_pAd) \
do{ \
UCHAR _bbpData; \
diff --git a/drivers/staging/rt2860/chips/rt3070.c b/drivers/staging/rt2860/chips/rt3070.c
new file mode 100644
index 000000000000..5a3e668601ab
--- /dev/null
+++ b/drivers/staging/rt2860/chips/rt3070.c
@@ -0,0 +1,185 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+
+ Module Name:
+ rt3070.c
+
+ Abstract:
+ Specific funcitons and variables for RT3070
+
+ Revision History:
+ Who When What
+ -------- ---------- ----------------------------------------------
+*/
+
+#ifdef RT3070
+
+#include "../rt_config.h"
+
+
+#ifndef RTMP_RF_RW_SUPPORT
+#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
+#endif // RTMP_RF_RW_SUPPORT //
+
+
+VOID NICInitRT3070RFRegisters(IN PRTMP_ADAPTER pAd)
+{
+ INT i;
+ UCHAR RFValue;
+
+ // Driver must read EEPROM to get RfIcType before initial RF registers
+ // Initialize RF register to default value
+ if (IS_RT3070(pAd) || IS_RT3071(pAd))
+ {
+ // Init RF calibration
+ // Driver should toggle RF R30 bit7 before init RF registers
+ UINT32 RfReg = 0;
+ UINT32 data;
+
+ RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
+ RfReg |= 0x80;
+ RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
+ RTMPusecDelay(1000);
+ RfReg &= 0x7F;
+ RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
+
+ // Initialize RF register to default value
+ for (i = 0; i < NUM_RF_REG_PARMS; i++)
+ {
+ RT30xxWriteRFRegister(pAd, RT30xx_RFRegTable[i].Register, RT30xx_RFRegTable[i].Value);
+ }
+
+ // add by johnli
+ if (IS_RT3070(pAd))
+ {
+ //
+ // The DAC issue(LDO_CFG0) has been fixed in RT3070(F).
+ // The voltage raising patch is no longer needed for RT3070(F)
+ //
+ if ((pAd->MACVersion & 0xffff) < 0x0201)
+ {
+ // Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate
+ RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
+ data = ((data & 0xF0FFFFFF) | 0x0D000000);
+ RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
+ }
+ }
+ else if (IS_RT3071(pAd))
+ {
+ // Driver should set RF R6 bit6 on before init RF registers
+ RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
+ RfReg |= 0x40;
+ RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
+
+ // init R31
+ RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
+
+ // RT3071 version E has fixed this issue
+ if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
+ {
+ // patch tx EVM issue temporarily
+ RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
+ data = ((data & 0xE0FFFFFF) | 0x0D000000);
+ RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
+ }
+ else
+ {
+ RTMP_IO_READ32(pAd, LDO_CFG0, &data);
+ data = ((data & 0xE0FFFFFF) | 0x01000000);
+ RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
+ }
+
+ // patch LNA_PE_G1 failed issue
+ RTUSBReadMACRegister(pAd, GPIO_SWITCH, &data);
+ data &= ~(0x20);
+ RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data);
+ }
+
+ //For RF filter Calibration
+ RTMPFilterCalibration(pAd);
+
+ // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
+ //
+ // TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
+ // Raising RF voltage is no longer needed for RT3070(F)
+ //
+ if ((IS_RT3070(pAd)) && ((pAd->MACVersion & 0xffff) < 0x0201))
+ {
+ RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
+ }
+ else if ((IS_RT3071(pAd)) && ((pAd->MACVersion & 0xffff) < 0x0211))
+ {
+ RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
+ }
+
+ // set led open drain enable
+ RTUSBReadMACRegister(pAd, OPT_14, &data);
+ data |= 0x01;
+ RTUSBWriteMACRegister(pAd, OPT_14, data);
+
+ // move from RT30xxLoadRFNormalModeSetup because it's needed for both RT3070 and RT3071
+ // TX_LO1_en, RF R17 register Bit 3 to 0
+ RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
+ RFValue &= (~0x08);
+ // to fix rx long range issue
+ if (pAd->NicConfig2.field.ExternalLNAForG == 0)
+ {
+ if ((IS_RT3071(pAd) && ((pAd->MACVersion & 0xffff) >= 0x0211)) || IS_RT3070(pAd))
+ {
+ RFValue |= 0x20;
+ }
+ }
+ // set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h
+ if (pAd->TxMixerGain24G >= 1)
+ {
+ RFValue &= (~0x7); // clean bit [2:0]
+ RFValue |= pAd->TxMixerGain24G;
+ }
+ RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
+
+ if (IS_RT3071(pAd))
+ {
+ // add by johnli, RF power sequence setup, load RF normal operation-mode setup
+ RT30xxLoadRFNormalModeSetup(pAd);
+ }
+ else if (IS_RT3070(pAd))
+ {
+ /* add by johnli, reset RF_R27 when interface down & up to fix throughput problem*/
+ // LDORF_VC, RF R27 register Bit 2 to 0
+ RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
+ // TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
+ // Raising RF voltage is no longer needed for RT3070(F)
+ if ((pAd->MACVersion & 0xffff) < 0x0201)
+ RFValue = (RFValue & (~0x77)) | 0x3;
+ else
+ RFValue = (RFValue & (~0x77));
+ RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
+ /* end johnli */
+ }
+ }
+
+}
+#endif // RT3070 //
diff --git a/drivers/staging/rt3090/chips/rt3090.c b/drivers/staging/rt2860/chips/rt3090.c
index 35c549dc4ce1..35c549dc4ce1 100644
--- a/drivers/staging/rt3090/chips/rt3090.c
+++ b/drivers/staging/rt2860/chips/rt3090.c
diff --git a/drivers/staging/rt3090/chips/rt30xx.c b/drivers/staging/rt2860/chips/rt30xx.c
index 9c8ae009dff9..f29d11d6de47 100644
--- a/drivers/staging/rt3090/chips/rt30xx.c
+++ b/drivers/staging/rt2860/chips/rt30xx.c
@@ -386,6 +386,9 @@ VOID RT30xxLoadRFSleepModeSetup(
UINT32 MACValue;
+#ifdef RTMP_MAC_USB
+ if(!IS_RT3572(pAd))
+#endif // RTMP_MAC_USB //
{
// RF_BLOCK_en. RF R1 register Bit 0 to 0
RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
@@ -412,6 +415,9 @@ VOID RT30xxLoadRFSleepModeSetup(
IS_RT3572(pAd) ||
(IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
{
+#ifdef RTMP_MAC_USB
+ if (!IS_RT3572(pAd))
+#endif // RTMP_MAC_USB //
{
RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
RFValue |= 0x77;
@@ -438,6 +444,9 @@ VOID RT30xxReverseRFSleepModeSetup(
UCHAR RFValue;
UINT32 MACValue;
+#ifdef RTMP_MAC_USB
+ if(!IS_RT3572(pAd))
+#endif // RTMP_MAC_USB //
{
// RF_BLOCK_en, RF R1 register Bit 0 to 1
RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
@@ -465,6 +474,9 @@ VOID RT30xxReverseRFSleepModeSetup(
IS_RT3390(pAd) ||
(IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
{
+#ifdef RTMP_MAC_USB
+ if (!IS_RT3572(pAd))
+#endif // RTMP_MAC_USB //
{
RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
if ((pAd->MACVersion & 0xffff) < 0x0211)
diff --git a/drivers/staging/rt2860/chlist.h b/drivers/staging/rt2860/chlist.h
index f49a35c95de6..9ce915415462 100644
--- a/drivers/staging/rt2860/chlist.h
+++ b/drivers/staging/rt2860/chlist.h
@@ -64,1182 +64,65 @@ typedef struct _CH_REGION {
CH_DESP ChDesp[10];
} CH_REGION, *PCH_REGION;
-static CH_REGION ChRegion[] =
-{
- { // Antigua and Berbuda
- "AG",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Argentina
- "AR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Aruba
- "AW",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Australia
- "AU",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Austria
- "AT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, TRUE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Bahamas
- "BS",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Barbados
- "BB",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Bermuda
- "BM",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Brazil
- "BR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 24, BOTH, FALSE}, // 5G, ch 100~140
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Belgium
- "BE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 18, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 18, IDOR, FALSE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Bulgaria
- "BG",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, ODOR, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Canada
- "CA",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Cayman IsLands
- "KY",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Chile
- "CL",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 20, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 20, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 20, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // China
- "CN",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 27, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Colombia
- "CO",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 17, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Costa Rica
- "CR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 17, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Cyprus
- "CY",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Czech_Republic
- "CZ",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Denmark
- "DK",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Dominican Republic
- "DO",
- CE,
- {
- { 1, 0, 20, BOTH, FALSE}, // 2.4 G, ch 0
- { 149, 4, 20, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Equador
- "EC",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 100, 11, 27, BOTH, FALSE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // El Salvador
- "SV",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 30, BOTH, TRUE}, // 5G, ch 52~64
- { 149, 4, 36, BOTH, TRUE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Finland
- "FI",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // France
- "FR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Germany
- "DE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Greece
- "GR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, ODOR, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Guam
- "GU",
- CE,
- {
- { 1, 11, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 36, 4, 17, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, FALSE}, // 5G, ch 100~140
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Guatemala
- "GT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 17, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Haiti
- "HT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 17, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Honduras
- "HN",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 27, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Hong Kong
- "HK",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Hungary
- "HU",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Iceland
- "IS",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // India
- "IN",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 24, IDOR, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Indonesia
- "ID",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 27, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Ireland
- "IE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, ODOR, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Israel
- "IL",
- CE,
- {
- { 1, 3, 20, IDOR, FALSE}, // 2.4 G, ch 1~3
- { 4, 6, 20, BOTH, FALSE}, // 2.4 G, ch 4~9
- { 10, 4, 20, IDOR, FALSE}, // 2.4 G, ch 10~13
- { 0}, // end
- }
- },
-
- { // Italy
- "IT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, ODOR, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Japan
- "JP",
- JAP,
- {
- { 1, 14, 20, BOTH, FALSE}, // 2.4 G, ch 1~14
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 0}, // end
- }
- },
-
- { // Jordan
- "JO",
- CE,
- {
- { 1, 13, 20, IDOR, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 149, 4, 23, IDOR, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Latvia
- "LV",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Liechtenstein
- "LI",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Lithuania
- "LT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Luxemburg
- "LU",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Malaysia
- "MY",
- CE,
- {
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 20, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Malta
- "MT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Marocco
- "MA",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 24, IDOR, FALSE}, // 5G, ch 36~48
- { 0}, // end
- }
- },
-
- { // Mexico
- "MX",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 5, 30, IDOR, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Netherlands
- "NL",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // New Zealand
- "NZ",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 24, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Norway
- "NO",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 24, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 24, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Peru
- "PE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 27, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Portugal
- "PT",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Poland
- "PL",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Romania
- "RO",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Russia
- "RU",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 149, 4, 20, IDOR, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Saudi Arabia
- "SA",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 23, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Serbia_and_Montenegro
- "CS",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 0}, // end
- }
- },
-
- { // Singapore
- "SG",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 149, 4, 20, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Slovakia
- "SK",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Slovenia
- "SI",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // South Africa
- "ZA",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, FALSE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 149, 4, 30, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // South Korea
- "KR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 20, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 20, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 8, 20, BOTH, FALSE}, // 5G, ch 100~128
- { 149, 4, 20, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Spain
- "ES",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 17, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Sweden
- "SE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Switzerland
- "CH",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~13
- { 36, 4, 23, IDOR, TRUE}, // 5G, ch 36~48
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Taiwan
- "TW",
- CE,
- {
- { 1, 11, 30, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 52, 4, 23, IDOR, FALSE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // Turkey
- "TR",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 36, 4, 23, BOTH, FALSE}, // 5G, ch 36~48
- { 52, 4, 23, BOTH, FALSE}, // 5G, ch 52~64
- { 0}, // end
- }
- },
-
- { // UK
- "GB",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 36, 4, 23, IDOR, FALSE}, // 5G, ch 52~64
- { 52, 4, 23, IDOR, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 0}, // end
- }
- },
-
- { // Ukraine
- "UA",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 0}, // end
- }
- },
-
- { // United_Arab_Emirates
- "AE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 0}, // end
- }
- },
-
- { // United_States
- "US",
- CE,
- {
- { 1, 11, 30, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 36, 4, 17, IDOR, FALSE}, // 5G, ch 52~64
- { 52, 4, 24, BOTH, TRUE}, // 5G, ch 52~64
- { 100, 11, 30, BOTH, TRUE}, // 5G, ch 100~140
- { 149, 5, 30, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-
- { // Venezuela
- "VE",
- CE,
- {
- { 1, 13, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 149, 4, 27, BOTH, FALSE}, // 5G, ch 149~161
- { 0}, // end
- }
- },
-
- { // Default
- "",
- CE,
- {
- { 1, 11, 20, BOTH, FALSE}, // 2.4 G, ch 1~11
- { 36, 4, 20, BOTH, FALSE}, // 5G, ch 52~64
- { 52, 4, 20, BOTH, FALSE}, // 5G, ch 52~64
- { 100, 11, 20, BOTH, FALSE}, // 5G, ch 100~140
- { 149, 5, 20, BOTH, FALSE}, // 5G, ch 149~165
- { 0}, // end
- }
- },
-};
-
-static inline PCH_REGION GetChRegion(
- IN PUCHAR CntryCode)
-{
- INT loop = 0;
- PCH_REGION pChRegion = NULL;
-
- while (strcmp(ChRegion[loop].CountReg, "") != 0)
- {
- if (strncmp(ChRegion[loop].CountReg, CntryCode, 2) == 0)
- {
- pChRegion = &ChRegion[loop];
- break;
- }
- loop++;
- }
-
- if (pChRegion == NULL)
- pChRegion = &ChRegion[loop];
- return pChRegion;
-}
-
-static inline VOID ChBandCheck(
- IN UCHAR PhyMode,
- OUT PUCHAR pChType)
-{
- switch(PhyMode)
- {
- case PHY_11A:
- case PHY_11AN_MIXED:
- *pChType = BAND_5G;
- break;
- case PHY_11ABG_MIXED:
- case PHY_11AGN_MIXED:
- case PHY_11ABGN_MIXED:
- *pChType = BAND_BOTH;
- break;
-
- default:
- *pChType = BAND_24G;
- break;
- }
-}
-
-static inline UCHAR FillChList(
- IN PRTMP_ADAPTER pAd,
- IN PCH_DESP pChDesp,
- IN UCHAR Offset,
- IN UCHAR increment)
-{
- INT i, j, l;
- UCHAR channel;
-
- j = Offset;
- for (i = 0; i < pChDesp->NumOfCh; i++)
- {
- channel = pChDesp->FirstChannel + i * increment;
- for (l=0; l<MAX_NUM_OF_CHANNELS; l++)
- {
- if (channel == pAd->TxPower[l].Channel)
- {
- pAd->ChannelList[j].Power = pAd->TxPower[l].Power;
- pAd->ChannelList[j].Power2 = pAd->TxPower[l].Power2;
- break;
- }
- }
- if (l == MAX_NUM_OF_CHANNELS)
- continue;
-
- pAd->ChannelList[j].Channel = pChDesp->FirstChannel + i * increment;
- pAd->ChannelList[j].MaxTxPwr = pChDesp->MaxTxPwr;
- pAd->ChannelList[j].DfsReq = pChDesp->DfsReq;
- j++;
- }
- pAd->ChannelListNum = j;
-
- return j;
-}
-
-static inline VOID CreateChList(
- IN PRTMP_ADAPTER pAd,
- IN PCH_REGION pChRegion,
- IN UCHAR Geography)
-{
- INT i;
- UCHAR offset = 0;
- PCH_DESP pChDesp;
- UCHAR ChType;
- UCHAR increment;
-
- if (pChRegion == NULL)
- return;
-
- ChBandCheck(pAd->CommonCfg.PhyMode, &ChType);
-
- for (i=0; i<10; i++)
- {
- pChDesp = &pChRegion->ChDesp[i];
- if (pChDesp->FirstChannel == 0)
- break;
-
- if (ChType == BAND_5G)
- {
- if (pChDesp->FirstChannel <= 14)
- continue;
- }
- else if (ChType == BAND_24G)
- {
- if (pChDesp->FirstChannel > 14)
- continue;
- }
-
- if ((pChDesp->Geography == BOTH)
- || (pChDesp->Geography == Geography))
- {
- if (pChDesp->FirstChannel > 14)
- increment = 4;
- else
- increment = 1;
- offset = FillChList(pAd, pChDesp, offset, increment);
- }
- }
-}
-
-static inline VOID BuildChannelListEx(
- IN PRTMP_ADAPTER pAd)
-{
- PCH_REGION pChReg;
-
- pChReg = GetChRegion(pAd->CommonCfg.CountryCode);
- CreateChList(pAd, pChReg, pAd->CommonCfg.Geography);
-}
-
-static inline VOID BuildBeaconChList(
+extern CH_REGION ChRegion[];
+
+typedef struct _CH_FREQ_MAP_{
+ UINT16 channel;
+ UINT16 freqKHz;
+}CH_FREQ_MAP;
+
+extern CH_FREQ_MAP CH_HZ_ID_MAP[];
+extern int CH_HZ_ID_MAP_NUM;
+
+
+#define MAP_CHANNEL_ID_TO_KHZ(_ch, _khz) \
+ do{ \
+ int _chIdx; \
+ for (_chIdx = 0; _chIdx < CH_HZ_ID_MAP_NUM; _chIdx++)\
+ { \
+ if ((_ch) == CH_HZ_ID_MAP[_chIdx].channel) \
+ { \
+ (_khz) = CH_HZ_ID_MAP[_chIdx].freqKHz * 1000; \
+ break; \
+ } \
+ } \
+ if (_chIdx == CH_HZ_ID_MAP_NUM) \
+ (_khz) = 2412000; \
+ }while(0)
+
+#define MAP_KHZ_TO_CHANNEL_ID(_khz, _ch) \
+ do{ \
+ int _chIdx; \
+ for (_chIdx = 0; _chIdx < CH_HZ_ID_MAP_NUM; _chIdx++)\
+ { \
+ if ((_khz) == CH_HZ_ID_MAP[_chIdx].freqKHz) \
+ { \
+ (_ch) = CH_HZ_ID_MAP[_chIdx].channel; \
+ break; \
+ } \
+ } \
+ if (_chIdx == CH_HZ_ID_MAP_NUM) \
+ (_ch) = 1; \
+ }while(0)
+
+
+VOID BuildChannelListEx(
+ IN PRTMP_ADAPTER pAd);
+
+VOID BuildBeaconChList(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pBuf,
- OUT PULONG pBufLen)
-{
- INT i;
- ULONG TmpLen;
- PCH_REGION pChRegion;
- PCH_DESP pChDesp;
- UCHAR ChType;
-
- pChRegion = GetChRegion(pAd->CommonCfg.CountryCode);
-
- if (pChRegion == NULL)
- return;
-
- ChBandCheck(pAd->CommonCfg.PhyMode, &ChType);
- *pBufLen = 0;
-
- for (i=0; i<10; i++)
- {
- pChDesp = &pChRegion->ChDesp[i];
- if (pChDesp->FirstChannel == 0)
- break;
-
- if (ChType == BAND_5G)
- {
- if (pChDesp->FirstChannel <= 14)
- continue;
- }
- else if (ChType == BAND_24G)
- {
- if (pChDesp->FirstChannel > 14)
- continue;
- }
-
- if ((pChDesp->Geography == BOTH)
- || (pChDesp->Geography == pAd->CommonCfg.Geography))
- {
- MakeOutgoingFrame(pBuf + *pBufLen, &TmpLen,
- 1, &pChDesp->FirstChannel,
- 1, &pChDesp->NumOfCh,
- 1, &pChDesp->MaxTxPwr,
- END_OF_ARGS);
- *pBufLen += TmpLen;
- }
- }
-}
-
-static inline BOOLEAN IsValidChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR channel)
-
-{
- INT i;
-
- for (i = 0; i < pAd->ChannelListNum; i++)
- {
- if (pAd->ChannelList[i].Channel == channel)
- break;
- }
-
- if (i == pAd->ChannelListNum)
- return FALSE;
- else
- return TRUE;
-}
-
-
-static inline UCHAR GetExtCh(
- IN UCHAR Channel,
- IN UCHAR Direction)
-{
- CHAR ExtCh;
-
- if (Direction == EXTCHA_ABOVE)
- ExtCh = Channel + 4;
- else
- ExtCh = (Channel - 4) > 0 ? (Channel - 4) : 0;
-
- return ExtCh;
-}
-
-
-static inline VOID N_ChannelCheck(
- IN PRTMP_ADAPTER pAd)
-{
- //UCHAR ChannelNum = pAd->ChannelListNum;
- UCHAR Channel = pAd->CommonCfg.Channel;
-
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40))
- {
- if (Channel > 14)
- {
- if ((Channel == 36) || (Channel == 44) || (Channel == 52) || (Channel == 60) || (Channel == 100) || (Channel == 108) ||
- (Channel == 116) || (Channel == 124) || (Channel == 132) || (Channel == 149) || (Channel == 157))
- {
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
- }
- else if ((Channel == 40) || (Channel == 48) || (Channel == 56) || (Channel == 64) || (Channel == 104) || (Channel == 112) ||
- (Channel == 120) || (Channel == 128) || (Channel == 136) || (Channel == 153) || (Channel == 161))
- {
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- }
- }
- else
- {
- do
- {
- UCHAR ExtCh;
- UCHAR Dir = pAd->CommonCfg.RegTransmitSetting.field.EXTCHA;
- ExtCh = GetExtCh(Channel, Dir);
- if (IsValidChannel(pAd, ExtCh))
- break;
-
- Dir = (Dir == EXTCHA_ABOVE) ? EXTCHA_BELOW : EXTCHA_ABOVE;
- ExtCh = GetExtCh(Channel, Dir);
- if (IsValidChannel(pAd, ExtCh))
- {
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = Dir;
- break;
- }
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- } while(FALSE);
-
- if (Channel == 14)
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- //pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_NONE; // We didn't set the ExtCh as NONE due to it'll set in RTMPSetHT()
- }
- }
- }
-
-
-}
+ OUT PULONG pBufLen);
+VOID N_ChannelCheck(
+ IN PRTMP_ADAPTER pAd);
-static inline VOID N_SetCenCh(
- IN PRTMP_ADAPTER pAd)
-{
- if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)
- {
- if (pAd->CommonCfg.RegTransmitSetting.field.EXTCHA == EXTCHA_ABOVE)
- {
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2;
- }
- else
- {
- if (pAd->CommonCfg.Channel == 14)
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 1;
- else
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2;
- }
- }
- else
- {
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
- }
-}
+VOID N_SetCenCh(
+ IN PRTMP_ADAPTER pAd);
-static inline UINT8 GetCuntryMaxTxPwr(
+UINT8 GetCuntryMaxTxPwr(
IN PRTMP_ADAPTER pAd,
- IN UINT8 channel)
-{
- int i;
- for (i = 0; i < pAd->ChannelListNum; i++)
- {
- if (pAd->ChannelList[i].Channel == channel)
- break;
- }
+ IN UINT8 channel);
- if (i == pAd->ChannelListNum)
- return 0xff;
- else
- return pAd->ChannelList[i].MaxTxPwr;
-}
#endif // __CHLIST_H__
diff --git a/drivers/staging/rt2860/common/2860_rtmp_init.c b/drivers/staging/rt2860/common/2860_rtmp_init.c
deleted file mode 100644
index 0bc0fb99d2e4..000000000000
--- a/drivers/staging/rt2860/common/2860_rtmp_init.c
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- 2860_rtmp_init.c
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 2002-08-01 created
- John Chang 2004-08-20 RT2561/2661 use scatter-gather scheme
- Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT.
-*/
-#include "../rt_config.h"
-
-
-
-
-/*
- ========================================================================
-
- Routine Description:
- Allocate DMA memory blocks for send, receive
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
- NDIS_STATUS_RESOURCES
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS RTMPAllocTxRxRingMemory(
- IN PRTMP_ADAPTER pAd)
-{
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- ULONG RingBasePaHigh;
- ULONG RingBasePaLow;
- PVOID RingBaseVa;
- INT index, num;
- PTXD_STRUC pTxD;
- PRXD_STRUC pRxD;
- ULONG ErrorValue = 0;
- PRTMP_TX_RING pTxRing;
- PRTMP_DMABUF pDmaBuf;
- PNDIS_PACKET pPacket;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n"));
- do
- {
- //
- // Allocate all ring descriptors, include TxD, RxD, MgmtD.
- // Although each size is different, to prevent cacheline and alignment
- // issue, I intentional set them all to 64 bytes.
- //
- for (num=0; num<NUM_OF_TX_RING; num++)
- {
- ULONG BufBasePaHigh;
- ULONG BufBasePaLow;
- PVOID BufBaseVa;
-
- //
- // Allocate Tx ring descriptor's memory (5 TX rings = 4 ACs + 1 HCCA)
- //
- pAd->TxDescRing[num].AllocSize = TX_RING_SIZE * TXD_SIZE;
- RTMP_AllocateTxDescMemory(
- pAd,
- num,
- pAd->TxDescRing[num].AllocSize,
- FALSE,
- &pAd->TxDescRing[num].AllocVa,
- &pAd->TxDescRing[num].AllocPa);
-
- if (pAd->TxDescRing[num].AllocVa == NULL)
- {
- ErrorValue = ERRLOG_OUT_OF_SHARED_MEMORY;
- DBGPRINT_ERR(("Failed to allocate a big buffer\n"));
- Status = NDIS_STATUS_RESOURCES;
- break;
- }
-
- // Zero init this memory block
- NdisZeroMemory(pAd->TxDescRing[num].AllocVa, pAd->TxDescRing[num].AllocSize);
-
- // Save PA & VA for further operation
- RingBasePaHigh = RTMP_GetPhysicalAddressHigh(pAd->TxDescRing[num].AllocPa);
- RingBasePaLow = RTMP_GetPhysicalAddressLow (pAd->TxDescRing[num].AllocPa);
- RingBaseVa = pAd->TxDescRing[num].AllocVa;
-
- //
- // Allocate all 1st TXBuf's memory for this TxRing
- //
- pAd->TxBufSpace[num].AllocSize = TX_RING_SIZE * TX_DMA_1ST_BUFFER_SIZE;
- RTMP_AllocateFirstTxBuffer(
- pAd,
- num,
- pAd->TxBufSpace[num].AllocSize,
- FALSE,
- &pAd->TxBufSpace[num].AllocVa,
- &pAd->TxBufSpace[num].AllocPa);
-
- if (pAd->TxBufSpace[num].AllocVa == NULL)
- {
- ErrorValue = ERRLOG_OUT_OF_SHARED_MEMORY;
- DBGPRINT_ERR(("Failed to allocate a big buffer\n"));
- Status = NDIS_STATUS_RESOURCES;
- break;
- }
-
- // Zero init this memory block
- NdisZeroMemory(pAd->TxBufSpace[num].AllocVa, pAd->TxBufSpace[num].AllocSize);
-
- // Save PA & VA for further operation
- BufBasePaHigh = RTMP_GetPhysicalAddressHigh(pAd->TxBufSpace[num].AllocPa);
- BufBasePaLow = RTMP_GetPhysicalAddressLow (pAd->TxBufSpace[num].AllocPa);
- BufBaseVa = pAd->TxBufSpace[num].AllocVa;
-
- //
- // Initialize Tx Ring Descriptor and associated buffer memory
- //
- pTxRing = &pAd->TxRing[num];
- for (index = 0; index < TX_RING_SIZE; index++)
- {
- pTxRing->Cell[index].pNdisPacket = NULL;
- pTxRing->Cell[index].pNextNdisPacket = NULL;
- // Init Tx Ring Size, Va, Pa variables
- pTxRing->Cell[index].AllocSize = TXD_SIZE;
- pTxRing->Cell[index].AllocVa = RingBaseVa;
- RTMP_SetPhysicalAddressHigh(pTxRing->Cell[index].AllocPa, RingBasePaHigh);
- RTMP_SetPhysicalAddressLow (pTxRing->Cell[index].AllocPa, RingBasePaLow);
-
- // Setup Tx Buffer size & address. only 802.11 header will store in this space
- pDmaBuf = &pTxRing->Cell[index].DmaBuf;
- pDmaBuf->AllocSize = TX_DMA_1ST_BUFFER_SIZE;
- pDmaBuf->AllocVa = BufBaseVa;
- RTMP_SetPhysicalAddressHigh(pDmaBuf->AllocPa, BufBasePaHigh);
- RTMP_SetPhysicalAddressLow(pDmaBuf->AllocPa, BufBasePaLow);
-
- // link the pre-allocated TxBuf to TXD
- pTxD = (PTXD_STRUC) pTxRing->Cell[index].AllocVa;
- pTxD->SDPtr0 = BufBasePaLow;
- // advance to next ring descriptor address
- pTxD->DMADONE = 1;
- RingBasePaLow += TXD_SIZE;
- RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE;
-
- // advance to next TxBuf address
- BufBasePaLow += TX_DMA_1ST_BUFFER_SIZE;
- BufBaseVa = (PUCHAR) BufBaseVa + TX_DMA_1ST_BUFFER_SIZE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("TxRing[%d]: total %d entry allocated\n", num, index));
- }
- if (Status == NDIS_STATUS_RESOURCES)
- break;
-
- //
- // Allocate MGMT ring descriptor's memory except Tx ring which allocated eariler
- //
- pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * TXD_SIZE;
- RTMP_AllocateMgmtDescMemory(
- pAd,
- pAd->MgmtDescRing.AllocSize,
- FALSE,
- &pAd->MgmtDescRing.AllocVa,
- &pAd->MgmtDescRing.AllocPa);
-
- if (pAd->MgmtDescRing.AllocVa == NULL)
- {
- ErrorValue = ERRLOG_OUT_OF_SHARED_MEMORY;
- DBGPRINT_ERR(("Failed to allocate a big buffer\n"));
- Status = NDIS_STATUS_RESOURCES;
- break;
- }
-
- // Zero init this memory block
- NdisZeroMemory(pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize);
-
- // Save PA & VA for further operation
- RingBasePaHigh = RTMP_GetPhysicalAddressHigh(pAd->MgmtDescRing.AllocPa);
- RingBasePaLow = RTMP_GetPhysicalAddressLow (pAd->MgmtDescRing.AllocPa);
- RingBaseVa = pAd->MgmtDescRing.AllocVa;
-
- //
- // Initialize MGMT Ring and associated buffer memory
- //
- for (index = 0; index < MGMT_RING_SIZE; index++)
- {
- pAd->MgmtRing.Cell[index].pNdisPacket = NULL;
- pAd->MgmtRing.Cell[index].pNextNdisPacket = NULL;
- // Init MGMT Ring Size, Va, Pa variables
- pAd->MgmtRing.Cell[index].AllocSize = TXD_SIZE;
- pAd->MgmtRing.Cell[index].AllocVa = RingBaseVa;
- RTMP_SetPhysicalAddressHigh(pAd->MgmtRing.Cell[index].AllocPa, RingBasePaHigh);
- RTMP_SetPhysicalAddressLow (pAd->MgmtRing.Cell[index].AllocPa, RingBasePaLow);
-
- // Offset to next ring descriptor address
- RingBasePaLow += TXD_SIZE;
- RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE;
-
- // link the pre-allocated TxBuf to TXD
- pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[index].AllocVa;
- pTxD->DMADONE = 1;
-
- // no pre-allocated buffer required in MgmtRing for scatter-gather case
- }
- DBGPRINT(RT_DEBUG_TRACE, ("MGMT Ring: total %d entry allocated\n", index));
-
- //
- // Allocate RX ring descriptor's memory except Tx ring which allocated eariler
- //
- pAd->RxDescRing.AllocSize = RX_RING_SIZE * RXD_SIZE;
- RTMP_AllocateRxDescMemory(
- pAd,
- pAd->RxDescRing.AllocSize,
- FALSE,
- &pAd->RxDescRing.AllocVa,
- &pAd->RxDescRing.AllocPa);
-
- if (pAd->RxDescRing.AllocVa == NULL)
- {
- ErrorValue = ERRLOG_OUT_OF_SHARED_MEMORY;
- DBGPRINT_ERR(("Failed to allocate a big buffer\n"));
- Status = NDIS_STATUS_RESOURCES;
- break;
- }
-
- // Zero init this memory block
- NdisZeroMemory(pAd->RxDescRing.AllocVa, pAd->RxDescRing.AllocSize);
-
-
- printk("RX DESC %p size = %ld\n", pAd->RxDescRing.AllocVa,
- pAd->RxDescRing.AllocSize);
-
- // Save PA & VA for further operation
- RingBasePaHigh = RTMP_GetPhysicalAddressHigh(pAd->RxDescRing.AllocPa);
- RingBasePaLow = RTMP_GetPhysicalAddressLow (pAd->RxDescRing.AllocPa);
- RingBaseVa = pAd->RxDescRing.AllocVa;
-
- //
- // Initialize Rx Ring and associated buffer memory
- //
- for (index = 0; index < RX_RING_SIZE; index++)
- {
- // Init RX Ring Size, Va, Pa variables
- pAd->RxRing.Cell[index].AllocSize = RXD_SIZE;
- pAd->RxRing.Cell[index].AllocVa = RingBaseVa;
- RTMP_SetPhysicalAddressHigh(pAd->RxRing.Cell[index].AllocPa, RingBasePaHigh);
- RTMP_SetPhysicalAddressLow (pAd->RxRing.Cell[index].AllocPa, RingBasePaLow);
-
- // Offset to next ring descriptor address
- RingBasePaLow += RXD_SIZE;
- RingBaseVa = (PUCHAR) RingBaseVa + RXD_SIZE;
-
- // Setup Rx associated Buffer size & allocate share memory
- pDmaBuf = &pAd->RxRing.Cell[index].DmaBuf;
- pDmaBuf->AllocSize = RX_BUFFER_AGGRESIZE;
- pPacket = RTMP_AllocateRxPacketBuffer(
- pAd,
- pDmaBuf->AllocSize,
- FALSE,
- &pDmaBuf->AllocVa,
- &pDmaBuf->AllocPa);
-
- /* keep allocated rx packet */
- pAd->RxRing.Cell[index].pNdisPacket = pPacket;
-
- // Error handling
- if (pDmaBuf->AllocVa == NULL)
- {
- ErrorValue = ERRLOG_OUT_OF_SHARED_MEMORY;
- DBGPRINT_ERR(("Failed to allocate RxRing's 1st buffer\n"));
- Status = NDIS_STATUS_RESOURCES;
- break;
- }
-
- // Zero init this memory block
- NdisZeroMemory(pDmaBuf->AllocVa, pDmaBuf->AllocSize);
-
- // Write RxD buffer address & allocated buffer length
- pRxD = (PRXD_STRUC) pAd->RxRing.Cell[index].AllocVa;
- pRxD->SDP0 = RTMP_GetPhysicalAddressLow(pDmaBuf->AllocPa);
- pRxD->DDONE = 0;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Rx Ring: total %d entry allocated\n", index));
-
- } while (FALSE);
-
-
- NdisZeroMemory(&pAd->FragFrame, sizeof(FRAGMENT_FRAME));
- pAd->FragFrame.pFragPacket = RTMP_AllocateFragPacketBuffer(pAd, RX_BUFFER_NORMSIZE);
-
- if (pAd->FragFrame.pFragPacket == NULL)
- {
- Status = NDIS_STATUS_RESOURCES;
- }
-
- if (Status != NDIS_STATUS_SUCCESS)
- {
- // Log error inforamtion
- NdisWriteErrorLogEntry(
- pAd->AdapterHandle,
- NDIS_ERROR_CODE_OUT_OF_RESOURCES,
- 1,
- ErrorValue);
- }
-
- DBGPRINT_S(Status, ("<-- RTMPAllocTxRxRingMemory, Status=%x\n", Status));
- return Status;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Initialize transmit data structures
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
- Initialize all transmit releated private buffer, include those define
- in RTMP_ADAPTER structure and all private data structures.
-
- ========================================================================
-*/
-VOID NICInitTxRxRingAndBacklogQueue(
- IN PRTMP_ADAPTER pAd)
-{
- //WPDMA_GLO_CFG_STRUC GloCfg;
- int i;
-
- DBGPRINT(RT_DEBUG_TRACE, ("<--> NICInitTxRxRingAndBacklogQueue\n"));
-
- // Initialize all transmit related software queues
- InitializeQueueHeader(&pAd->TxSwQueue[QID_AC_BE]);
- InitializeQueueHeader(&pAd->TxSwQueue[QID_AC_BK]);
- InitializeQueueHeader(&pAd->TxSwQueue[QID_AC_VI]);
- InitializeQueueHeader(&pAd->TxSwQueue[QID_AC_VO]);
- InitializeQueueHeader(&pAd->TxSwQueue[QID_HCCA]);
-
- // Init RX Ring index pointer
- pAd->RxRing.RxSwReadIdx = 0;
- pAd->RxRing.RxCpuIdx = RX_RING_SIZE - 1;
-
- // Init TX rings index pointer
- for (i=0; i<NUM_OF_TX_RING; i++)
- {
- pAd->TxRing[i].TxSwFreeIdx = 0;
- pAd->TxRing[i].TxCpuIdx = 0;
- }
-
- // init MGMT ring index pointer
- pAd->MgmtRing.TxSwFreeIdx = 0;
- pAd->MgmtRing.TxCpuIdx = 0;
-
- pAd->PrivateInfo.TxRingFullCnt = 0;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Reset NIC Asics. Call after rest DMA. So reset TX_CTX_IDX to zero.
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
- Reset NIC to initial state AS IS system boot up time.
-
- ========================================================================
-*/
-VOID RTMPRingCleanUp(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RingType)
-{
- PTXD_STRUC pTxD;
- PRXD_STRUC pRxD;
- PQUEUE_ENTRY pEntry;
- PNDIS_PACKET pPacket;
- int i;
- PRTMP_TX_RING pTxRing;
- unsigned long IrqFlags;
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPRingCleanUp(RingIdx=%d, Pending-NDIS=%ld)\n", RingType, pAd->RalinkCounters.PendingNdisPacketCount));
- switch (RingType)
- {
- case QID_AC_BK:
- case QID_AC_BE:
- case QID_AC_VI:
- case QID_AC_VO:
- case QID_HCCA:
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
- pTxRing = &pAd->TxRing[RingType];
-
- // We have to clean all descriptors in case some error happened with reset
- for (i=0; i<TX_RING_SIZE; i++) // We have to scan all TX ring
- {
- pTxD = (PTXD_STRUC) pTxRing->Cell[i].AllocVa;
-
- pPacket = (PNDIS_PACKET) pTxRing->Cell[i].pNdisPacket;
- // release scatter-and-gather NDIS_PACKET
- if (pPacket)
- {
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- pTxRing->Cell[i].pNdisPacket = NULL;
- }
-
- pPacket = (PNDIS_PACKET) pTxRing->Cell[i].pNextNdisPacket;
- // release scatter-and-gather NDIS_PACKET
- if (pPacket)
- {
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- pTxRing->Cell[i].pNextNdisPacket = NULL;
- }
- }
-
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + RingType * 0x10, &pTxRing->TxDmaIdx);
- pTxRing->TxSwFreeIdx = pTxRing->TxDmaIdx;
- pTxRing->TxCpuIdx = pTxRing->TxDmaIdx;
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + RingType * 0x10, pTxRing->TxCpuIdx);
-
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
- while (pAd->TxSwQueue[RingType].Head != NULL)
- {
- pEntry = RemoveHeadQueue(&pAd->TxSwQueue[RingType]);
- pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- DBGPRINT(RT_DEBUG_TRACE,("Release 1 NDIS packet from s/w backlog queue\n"));
- }
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
- break;
-
- case QID_MGMT:
- // We have to clean all descriptors in case some error happened with reset
- NdisAcquireSpinLock(&pAd->MgmtRingLock);
-
- for (i=0; i<MGMT_RING_SIZE; i++)
- {
- pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[i].AllocVa;
-
- pPacket = (PNDIS_PACKET) pAd->MgmtRing.Cell[i].pNdisPacket;
- // rlease scatter-and-gather NDIS_PACKET
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
- pAd->MgmtRing.Cell[i].pNdisPacket = NULL;
-
- pPacket = (PNDIS_PACKET) pAd->MgmtRing.Cell[i].pNextNdisPacket;
- // release scatter-and-gather NDIS_PACKET
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
- pAd->MgmtRing.Cell[i].pNextNdisPacket = NULL;
-
- }
-
- RTMP_IO_READ32(pAd, TX_MGMTDTX_IDX, &pAd->MgmtRing.TxDmaIdx);
- pAd->MgmtRing.TxSwFreeIdx = pAd->MgmtRing.TxDmaIdx;
- pAd->MgmtRing.TxCpuIdx = pAd->MgmtRing.TxDmaIdx;
- RTMP_IO_WRITE32(pAd, TX_MGMTCTX_IDX, pAd->MgmtRing.TxCpuIdx);
-
- NdisReleaseSpinLock(&pAd->MgmtRingLock);
- pAd->RalinkCounters.MgmtRingFullCount = 0;
- break;
-
- case QID_RX:
- // We have to clean all descriptors in case some error happened with reset
- NdisAcquireSpinLock(&pAd->RxRingLock);
-
- for (i=0; i<RX_RING_SIZE; i++)
- {
- pRxD = (PRXD_STRUC) pAd->RxRing.Cell[i].AllocVa;
- pRxD->DDONE = 0 ;
- }
-
- RTMP_IO_READ32(pAd, RX_DRX_IDX, &pAd->RxRing.RxDmaIdx);
- pAd->RxRing.RxSwReadIdx = pAd->RxRing.RxDmaIdx;
- pAd->RxRing.RxCpuIdx = ((pAd->RxRing.RxDmaIdx == 0) ? (RX_RING_SIZE-1) : (pAd->RxRing.RxDmaIdx-1));
- RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx);
-
- NdisReleaseSpinLock(&pAd->RxRingLock);
- break;
-
- default:
- break;
- }
-}
-
-
-NDIS_STATUS AdapterBlockAllocateMemory(
- IN PVOID handle,
- OUT PVOID *ppAd)
-{
- PPCI_DEV pci_dev;
- dma_addr_t *phy_addr;
- POS_COOKIE pObj = (POS_COOKIE) handle;
-
- pci_dev = pObj->pci_dev;
- phy_addr = &pObj->pAd_pa;
-
- *ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER)); //pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr);
-
- if (*ppAd)
- {
- NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
- ((PRTMP_ADAPTER)*ppAd)->OS_Cookie = handle;
- return (NDIS_STATUS_SUCCESS);
- } else {
- return (NDIS_STATUS_FAILURE);
- }
-}
-
-
-void RTMP_AllocateTxDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN UINT Index,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- *VirtualAddress = (PVOID)PCI_ALLOC_CONSISTENT(pObj->pci_dev,sizeof(char)*Length, PhysicalAddress);
-
-}
-
-void RTMP_AllocateMgmtDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- *VirtualAddress = (PVOID)PCI_ALLOC_CONSISTENT(pObj->pci_dev,sizeof(char)*Length, PhysicalAddress);
-
-}
-
-void RTMP_AllocateRxDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- *VirtualAddress = (PVOID)PCI_ALLOC_CONSISTENT(pObj->pci_dev,sizeof(char)*Length, PhysicalAddress);
-
-}
-
-void RTMP_FreeRxDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN PVOID VirtualAddress,
- IN NDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- PCI_FREE_CONSISTENT(pObj->pci_dev, Length, VirtualAddress, PhysicalAddress);
-}
-
-
-void RTMP_AllocateFirstTxBuffer(
- IN PRTMP_ADAPTER pAd,
- IN UINT Index,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- *VirtualAddress = (PVOID)PCI_ALLOC_CONSISTENT(pObj->pci_dev,sizeof(char)*Length, PhysicalAddress);
-}
-
-/*
- * FUNCTION: Allocate a common buffer for DMA
- * ARGUMENTS:
- * AdapterHandle: AdapterHandle
- * Length: Number of bytes to allocate
- * Cached: Whether or not the memory can be cached
- * VirtualAddress: Pointer to memory is returned here
- * PhysicalAddress: Physical address corresponding to virtual address
- */
-
-void RTMP_AllocateSharedMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- *VirtualAddress = (PVOID)PCI_ALLOC_CONSISTENT(pObj->pci_dev,sizeof(char)*Length, PhysicalAddress);
-}
-
-VOID RTMPFreeTxRxRingMemory(
- IN PRTMP_ADAPTER pAd)
-{
- int index, num , j;
- PRTMP_TX_RING pTxRing;
- PTXD_STRUC pTxD;
- PNDIS_PACKET pPacket;
- unsigned int IrqFlags;
-
- POS_COOKIE pObj =(POS_COOKIE) pAd->OS_Cookie;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPFreeTxRxRingMemory\n"));
-
- // Free TxSwQueue Packet
- for (index=0; index <NUM_OF_TX_RING; index++)
- {
- PQUEUE_ENTRY pEntry;
- PNDIS_PACKET pPacket;
- PQUEUE_HEADER pQueue;
-
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
- pQueue = &pAd->TxSwQueue[index];
- while (pQueue->Head)
- {
- pEntry = RemoveHeadQueue(pQueue);
- pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
- }
-
- // Free Tx Ring Packet
- for (index=0;index< NUM_OF_TX_RING;index++)
- {
- pTxRing = &pAd->TxRing[index];
-
- for (j=0; j< TX_RING_SIZE; j++)
- {
- pTxD = (PTXD_STRUC) (pTxRing->Cell[j].AllocVa);
- pPacket = pTxRing->Cell[j].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- //Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[j].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[j].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- //Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[pTxRing->TxSwFreeIdx].pNextNdisPacket = NULL;
-
- }
- }
-
- for (index = RX_RING_SIZE - 1 ; index >= 0; index--)
- {
- if ((pAd->RxRing.Cell[index].DmaBuf.AllocVa) && (pAd->RxRing.Cell[index].pNdisPacket))
- {
- PCI_UNMAP_SINGLE(pObj->pci_dev, pAd->RxRing.Cell[index].DmaBuf.AllocPa, pAd->RxRing.Cell[index].DmaBuf.AllocSize, PCI_DMA_FROMDEVICE);
- RELEASE_NDIS_PACKET(pAd, pAd->RxRing.Cell[index].pNdisPacket, NDIS_STATUS_SUCCESS);
- }
- }
- NdisZeroMemory(pAd->RxRing.Cell, RX_RING_SIZE * sizeof(RTMP_DMACB));
-
- if (pAd->RxDescRing.AllocVa)
- {
- PCI_FREE_CONSISTENT(pObj->pci_dev, pAd->RxDescRing.AllocSize, pAd->RxDescRing.AllocVa, pAd->RxDescRing.AllocPa);
- }
- NdisZeroMemory(&pAd->RxDescRing, sizeof(RTMP_DMABUF));
-
- if (pAd->MgmtDescRing.AllocVa)
- {
- PCI_FREE_CONSISTENT(pObj->pci_dev, pAd->MgmtDescRing.AllocSize, pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocPa);
- }
- NdisZeroMemory(&pAd->MgmtDescRing, sizeof(RTMP_DMABUF));
-
- for (num = 0; num < NUM_OF_TX_RING; num++)
- {
- if (pAd->TxBufSpace[num].AllocVa)
- {
- PCI_FREE_CONSISTENT(pObj->pci_dev, pAd->TxBufSpace[num].AllocSize, pAd->TxBufSpace[num].AllocVa, pAd->TxBufSpace[num].AllocPa);
- }
- NdisZeroMemory(&pAd->TxBufSpace[num], sizeof(RTMP_DMABUF));
-
- if (pAd->TxDescRing[num].AllocVa)
- {
- PCI_FREE_CONSISTENT(pObj->pci_dev, pAd->TxDescRing[num].AllocSize, pAd->TxDescRing[num].AllocVa, pAd->TxDescRing[num].AllocPa);
- }
- NdisZeroMemory(&pAd->TxDescRing[num], sizeof(RTMP_DMABUF));
- }
-
- if (pAd->FragFrame.pFragPacket)
- RELEASE_NDIS_PACKET(pAd, pAd->FragFrame.pFragPacket, NDIS_STATUS_SUCCESS);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- RTMPFreeTxRxRingMemory\n"));
-}
-
-
-/*
- * FUNCTION: Allocate a packet buffer for DMA
- * ARGUMENTS:
- * AdapterHandle: AdapterHandle
- * Length: Number of bytes to allocate
- * Cached: Whether or not the memory can be cached
- * VirtualAddress: Pointer to memory is returned here
- * PhysicalAddress: Physical address corresponding to virtual address
- * Notes:
- * Cached is ignored: always cached memory
- */
-PNDIS_PACKET RTMP_AllocateRxPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress)
-{
- PNDIS_PACKET pkt;
-
- pkt = RTPKT_TO_OSPKT(DEV_ALLOC_SKB(Length));
-
- if (pkt == NULL) {
- DBGPRINT(RT_DEBUG_ERROR, ("can't allocate rx %ld size packet\n",Length));
- }
-
- if (pkt) {
- RTMP_SET_PACKET_SOURCE(pkt, PKTSRC_NDIS);
- *VirtualAddress = (PVOID) RTPKT_TO_OSPKT(pkt)->data;
- *PhysicalAddress = PCI_MAP_SINGLE(pAd, *VirtualAddress, Length, -1, PCI_DMA_FROMDEVICE);
- } else {
- *VirtualAddress = (PVOID) NULL;
- *PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL;
- }
-
- return (PNDIS_PACKET) pkt;
-}
-
-
-VOID Invalid_Remaining_Packet(
- IN PRTMP_ADAPTER pAd,
- IN ULONG VirtualAddress)
-{
- NDIS_PHYSICAL_ADDRESS PhysicalAddress;
-
- PhysicalAddress = PCI_MAP_SINGLE(pAd, (void *)(VirtualAddress+1600), RX_BUFFER_NORMSIZE-1600, -1, PCI_DMA_FROMDEVICE);
-}
-
-PNDIS_PACKET GetPacketFromRxRing(
- IN PRTMP_ADAPTER pAd,
- OUT PRT28XX_RXD_STRUC pSaveRxD,
- OUT BOOLEAN *pbReschedule,
- IN OUT UINT32 *pRxPending)
-{
- PRXD_STRUC pRxD;
- PNDIS_PACKET pRxPacket = NULL;
- PNDIS_PACKET pNewPacket;
- PVOID AllocVa;
- NDIS_PHYSICAL_ADDRESS AllocPa;
- BOOLEAN bReschedule = FALSE;
-
- RTMP_SEM_LOCK(&pAd->RxRingLock);
-
- if (*pRxPending == 0)
- {
- // Get how may packets had been received
- RTMP_IO_READ32(pAd, RX_DRX_IDX , &pAd->RxRing.RxDmaIdx);
-
- if (pAd->RxRing.RxSwReadIdx == pAd->RxRing.RxDmaIdx)
- {
- // no more rx packets
- bReschedule = FALSE;
- goto done;
- }
-
- // get rx pending count
- if (pAd->RxRing.RxDmaIdx > pAd->RxRing.RxSwReadIdx)
- *pRxPending = pAd->RxRing.RxDmaIdx - pAd->RxRing.RxSwReadIdx;
- else
- *pRxPending = pAd->RxRing.RxDmaIdx + RX_RING_SIZE - pAd->RxRing.RxSwReadIdx;
-
- }
-
- // Point to Rx indexed rx ring descriptor
- pRxD = (PRXD_STRUC) pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].AllocVa;
-
- if (pRxD->DDONE == 0)
- {
- *pRxPending = 0;
- // DMAIndx had done but DDONE bit not ready
- bReschedule = TRUE;
- goto done;
- }
-
-
- // return rx descriptor
- NdisMoveMemory(pSaveRxD, pRxD, RXD_SIZE);
-
- pNewPacket = RTMP_AllocateRxPacketBuffer(pAd, RX_BUFFER_AGGRESIZE, FALSE, &AllocVa, &AllocPa);
-
- if (pNewPacket)
- {
- // unmap the rx buffer
- PCI_UNMAP_SINGLE(pAd, pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocPa,
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocSize, PCI_DMA_FROMDEVICE);
- pRxPacket = pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].pNdisPacket;
-
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocSize = RX_BUFFER_AGGRESIZE;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].pNdisPacket = (PNDIS_PACKET) pNewPacket;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocVa = AllocVa;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocPa = AllocPa;
- /* update SDP0 to new buffer of rx packet */
- pRxD->SDP0 = AllocPa;
- }
- else
- {
- //printk("No Rx Buffer\n");
- pRxPacket = NULL;
- bReschedule = TRUE;
- }
-
- pRxD->DDONE = 0;
-
- // had handled one rx packet
- *pRxPending = *pRxPending - 1;
-
- // update rx descriptor and kick rx
- INC_RING_INDEX(pAd->RxRing.RxSwReadIdx, RX_RING_SIZE);
-
- pAd->RxRing.RxCpuIdx = (pAd->RxRing.RxSwReadIdx == 0) ? (RX_RING_SIZE-1) : (pAd->RxRing.RxSwReadIdx-1);
- RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx);
-
-done:
- RTMP_SEM_UNLOCK(&pAd->RxRingLock);
- *pbReschedule = bReschedule;
- return pRxPacket;
-}
-/* End of 2860_rtmp_init.c */
-
diff --git a/drivers/staging/rt2860/common/action.c b/drivers/staging/rt2860/common/action.c
index 256cb67e0594..5593966f0a94 100644
--- a/drivers/staging/rt2860/common/action.c
+++ b/drivers/staging/rt2860/common/action.c
@@ -150,7 +150,9 @@ VOID MlmeADDBAAction(
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(FRAME_ADDBA_REQ), &Frame,
END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
+
+ MiniportMMRequest(pAd, (MGMT_USE_QUEUE_FLAG | MapUserPriorityToAccessCategory[pInfo->TID]), pOutBuffer, FrameLen);
+
MlmeFreeMemory(pAd, pOutBuffer);
DBGPRINT(RT_DEBUG_TRACE, ("BA - Send ADDBA request. StartSeq = %x, FrameLen = %ld. BufSize = %d\n", Frame.BaStartSeq.field.StartSeq, FrameLen, Frame.BaParm.BufSize));
@@ -527,9 +529,13 @@ VOID SendRefreshBAR(
MakeOutgoingFrame(pOutBuffer, &FrameLen,
sizeof(FRAME_BAR), &FrameBar,
END_OF_ARGS);
+ //if (!(CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_RALINK_CHIPSET)))
+ if (1) // Now we always send BAR.
+ {
+ //MiniportMMRequestUnlock(pAd, 0, pOutBuffer, FrameLen);
+ MiniportMMRequest(pAd, (MGMT_USE_QUEUE_FLAG | MapUserPriorityToAccessCategory[TID]), pOutBuffer, FrameLen);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
-
+ }
MlmeFreeMemory(pAd, pOutBuffer);
}
}
diff --git a/drivers/staging/rt2860/common/ba_action.c b/drivers/staging/rt2860/common/ba_action.c
index b7bbe99d4d57..ff4dce6786fd 100644
--- a/drivers/staging/rt2860/common/ba_action.c
+++ b/drivers/staging/rt2860/common/ba_action.c
@@ -35,8 +35,8 @@
#define ORI_BA_SESSION_TIMEOUT (2000) // ms
#define REC_BA_SESSION_IDLE_TIMEOUT (1000) // ms
-#define REORDERING_PACKET_TIMEOUT ((100 * HZ)/1000) // system ticks -- 100 ms
-#define MAX_REORDERING_PACKET_TIMEOUT ((3000 * HZ)/1000) // system ticks -- 100 ms
+#define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) // system ticks -- 100 ms
+#define MAX_REORDERING_PACKET_TIMEOUT ((3000 * OS_HZ)/1000) // system ticks -- 100 ms
#define RESET_RCV_SEQ (0xFFFF)
@@ -460,6 +460,8 @@ void ba_flush_reordering_timeout_mpdus(
pBAEntry->LastIndSeq = Sequence;
}
+ DBGPRINT(RT_DEBUG_OFF, ("%x, flush one!\n", pBAEntry->LastIndSeq));
+
}
}
@@ -493,7 +495,7 @@ VOID BAOriSessionSetUp(
{
// try again after 3 secs
DelayTime = 3000;
-// printk("DeCline BA from Peer\n");
+// DBGPRINT(RT_DEBUG_TRACE, ("DeCline BA from Peer\n"));
// return;
}
@@ -531,11 +533,6 @@ VOID BAOriSessionSetUp(
pBAEntry->TimeOutValue = TimeOut;
pBAEntry->pAdapter = pAd;
- DBGPRINT(RT_DEBUG_TRACE,("Send AddBA to %02x:%02x:%02x:%02x:%02x:%02x Tid:%d isForced:%d Wcid:%d\n"
- ,pEntry->Addr[0],pEntry->Addr[1],pEntry->Addr[2]
- ,pEntry->Addr[3],pEntry->Addr[4],pEntry->Addr[5]
- ,TID,isForced,pEntry->Aid));
-
if (!(pEntry->TXBAbitmap & (1<<TID)))
{
RTMPInitTimer(pAd, &pBAEntry->ORIBATimer, GET_TIMER_FUNCTION(BAOriSessionSetupTimeout), pBAEntry, FALSE);
@@ -573,6 +570,8 @@ VOID BAOriSessionAdd(
pBAEntry->TimeOutValue = pFrame->TimeOutValue;
pBAEntry->ORI_BA_Status = Originator_Done;
+ pAd->BATable.numDoneOriginator ++;
+
// reset sequence number
pBAEntry->Sequence = BA_ORI_INIT_SEQ;
// Set Bitmap flag.
@@ -668,7 +667,7 @@ BOOLEAN BARecSessionAdd(
// initial sequence number
pBAEntry->LastIndSeq = RESET_RCV_SEQ; //pFrame->BaStartSeq.field.StartSeq;
- printk("Start Seq = %08x\n", pFrame->BaStartSeq.field.StartSeq);
+ DBGPRINT(RT_DEBUG_OFF, ("Start Seq = %08x\n", pFrame->BaStartSeq.field.StartSeq));
if (pEntry->RXBAbitmap & (1<<TID))
{
@@ -686,7 +685,7 @@ BOOLEAN BARecSessionAdd(
pEntry->BADeclineBitmap &= ~(1<<TID);
// Set BA session mask in WCID table.
- RT28XX_ADD_BA_SESSION_TO_ASIC(pAd, pEntry->Aid, TID);
+ RTMP_ADD_BA_SESSION_TO_ASIC(pAd, pEntry->Aid, TID);
DBGPRINT(RT_DEBUG_TRACE,("MACEntry[%d]RXBAbitmap = 0x%x. BARecWcidArray=%d\n",
pEntry->Aid, pEntry->RXBAbitmap, pEntry->BARecWcidArray[TID]));
@@ -713,8 +712,8 @@ BA_REC_ENTRY *BATableAllocRecEntry(
if (pAd->BATable.numAsRecipient >= MAX_BARECI_SESSION)
{
- printk("BA Recipeint Session (%ld) > %d\n", pAd->BATable.numAsRecipient,
- MAX_BARECI_SESSION);
+ DBGPRINT(RT_DEBUG_OFF, ("BA Recipeint Session (%ld) > %d\n",
+ pAd->BATable.numAsRecipient, MAX_BARECI_SESSION));
goto done;
}
@@ -794,6 +793,7 @@ VOID BATableFreeOriEntry(
NdisAcquireSpinLock(&pAd->BATabLock);
if (pBAEntry->ORI_BA_Status == Originator_Done)
{
+ pAd->BATable.numDoneOriginator -= 1;
pEntry->TXBAbitmap &= (~(1<<(pBAEntry->TID) ));
DBGPRINT(RT_DEBUG_TRACE, ("BATableFreeOriEntry numAsOriginator= %ld\n", pAd->BATable.numAsRecipient));
// Erase Bitmap flag.
@@ -867,9 +867,8 @@ VOID BAOriSessionTearDown(
// force send specified TID DelBA
MLME_DELBA_REQ_STRUCT DelbaReq;
MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem == NULL)
- return;
-
+ if (Elem != NULL)
+ {
NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
@@ -877,15 +876,15 @@ VOID BAOriSessionTearDown(
DelbaReq.Wcid = Wcid;
DelbaReq.TID = TID;
DelbaReq.Initiator = ORIGINATOR;
-#if 1
Elem->MsgLen = sizeof(DelbaReq);
NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
MlmeDELBAAction(pAd, Elem);
kfree(Elem);
-#else
- MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ORI_DELBA_CATE, sizeof(MLME_DELBA_REQ_STRUCT), (PVOID)&DelbaReq);
- RT28XX_MLME_HANDLER(pAd);
-#endif
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s(bForceSend):alloc memory failed!\n", __func__));
+ }
}
return;
@@ -902,9 +901,8 @@ VOID BAOriSessionTearDown(
{
MLME_DELBA_REQ_STRUCT DelbaReq;
MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem == NULL)
- return;
-
+ if (Elem != NULL)
+ {
NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
@@ -912,15 +910,16 @@ VOID BAOriSessionTearDown(
DelbaReq.Wcid = Wcid;
DelbaReq.TID = pBAEntry->TID;
DelbaReq.Initiator = ORIGINATOR;
-#if 1
Elem->MsgLen = sizeof(DelbaReq);
NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
MlmeDELBAAction(pAd, Elem);
kfree(Elem);
-#else
- MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ORI_DELBA_CATE, sizeof(MLME_DELBA_REQ_STRUCT), (PVOID)&DelbaReq);
- RT28XX_MLME_HANDLER(pAd);
-#endif
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s():alloc memory failed!\n", __func__));
+ return;
+ }
}
RTMPCancelTimer(&pBAEntry->ORIBATimer, &Cancelled);
BATableFreeOriEntry(pAd, Idx);
@@ -964,7 +963,6 @@ VOID BARecSessionTearDown(
{
MLME_DELBA_REQ_STRUCT DelbaReq;
BOOLEAN Cancelled;
- MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
//ULONG offset;
//UINT32 VALUE;
@@ -975,6 +973,9 @@ VOID BARecSessionTearDown(
//
if (bPassive == FALSE)
{
+ MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
+ if (Elem != NULL)
+ {
NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
@@ -982,15 +983,16 @@ VOID BARecSessionTearDown(
DelbaReq.Wcid = Wcid;
DelbaReq.TID = TID;
DelbaReq.Initiator = RECIPIENT;
-#if 1
Elem->MsgLen = sizeof(DelbaReq);
NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
MlmeDELBAAction(pAd, Elem);
kfree(Elem);
-#else
- MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ORI_DELBA_CATE, sizeof(MLME_DELBA_REQ_STRUCT), (PVOID)&DelbaReq);
- RT28XX_MLME_HANDLER(pAd);
-#endif
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s():alloc memory failed!\n", __func__));
+ return;
+ }
}
@@ -1009,7 +1011,7 @@ VOID BARecSessionTearDown(
pAd->MacTab.Content[Wcid].RXBAbitmap &= (~(1<<(pBAEntry->TID)));
pAd->MacTab.Content[Wcid].BARecWcidArray[TID] = 0;
- RT28XX_DEL_BA_SESSION_FROM_ASIC(pAd, Wcid, TID);
+ RTMP_DEL_BA_SESSION_FROM_ASIC(pAd, Wcid, TID);
NdisReleaseSpinLock(&pAd->BATabLock);
@@ -1061,9 +1063,12 @@ VOID BAOriSessionSetupTimeout(
pAd = pBAEntry->pAdapter;
+ {
// Do nothing if monitor mode is on
if (MONITOR_ON(pAd))
return;
+ }
+
pEntry = &pAd->MacTab.Content[pBAEntry->Wcid];
@@ -1079,12 +1084,9 @@ VOID BAOriSessionSetupTimeout(
AddbaReq.TimeOutValue = 0;
AddbaReq.Token = pBAEntry->Token;
MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE, sizeof(MLME_ADDBA_REQ_STRUCT), (PVOID)&AddbaReq);
- RT28XX_MLME_HANDLER(pAd);
- DBGPRINT(RT_DEBUG_TRACE,("BA Ori Session Timeout(%d) to %02x:%02x:%02x:%02x:%02x:%02x Tid:%d Wcid:%d\n"
- ,pBAEntry->Token
- ,pEntry->Addr[0],pEntry->Addr[1],pEntry->Addr[2]
- ,pEntry->Addr[3],pEntry->Addr[4],pEntry->Addr[5]
- ,pBAEntry->TID,pEntry->Aid));
+ RTMP_MLME_HANDLER(pAd);
+ DBGPRINT(RT_DEBUG_TRACE,("BA Ori Session Timeout(%d) : Send ADD BA again\n", pBAEntry->Token));
+
pBAEntry->Token++;
RTMPSetTimer(&pBAEntry->ORIBATimer, ORI_BA_SESSION_TIMEOUT);
}
@@ -1131,7 +1133,7 @@ VOID BARecSessionIdleTimeout(
pAd = pBAEntry->pAdapter;
// flush all pending reordering mpdus
ba_refresh_reordering_mpdus(pAd, pBAEntry);
- printk("%ld: REC BA session Timeout\n", Now32);
+ DBGPRINT(RT_DEBUG_OFF, ("%ld: REC BA session Timeout\n", Now32));
}
}
}
@@ -1174,7 +1176,7 @@ VOID PeerAddBAReqAction(
if ((pAd->CommonCfg.bBADecline == FALSE) && IS_HT_STA(pMacEntry))
{
pAddreqFrame = (PFRAME_ADDBA_REQ)(&Elem->Msg[0]);
- printk("Rcv Wcid(%d) AddBAReq\n", Elem->Wcid);
+ DBGPRINT(RT_DEBUG_OFF, ("Rcv Wcid(%d) AddBAReq\n", Elem->Wcid));
if (BARecSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid], pAddreqFrame))
Status = 0;
else
@@ -1367,7 +1369,7 @@ BOOLEAN CntlEnqueueForRecv(
if (SEQ_SMALLER(pBAEntry->LastIndSeq, pFrame->BAStartingSeq.field.StartSeq, MAXSEQ))
{
- //printk("BAR Seq = %x, LastIndSeq = %x\n", pFrame->BAStartingSeq.field.StartSeq, pBAEntry->LastIndSeq);
+ //DBGPRINT(RT_DEBUG_TRACE, ("BAR Seq = %x, LastIndSeq = %x\n", pFrame->BAStartingSeq.field.StartSeq, pBAEntry->LastIndSeq));
ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, pFrame->BAStartingSeq.field.StartSeq);
pBAEntry->LastIndSeq = (pFrame->BAStartingSeq.field.StartSeq == 0) ? MAXSEQ :(pFrame->BAStartingSeq.field.StartSeq -1);
}
@@ -1388,8 +1390,6 @@ VOID SendPSMPAction(
//ULONG Idx;
FRAME_PSMP_ACTION Frame;
ULONG FrameLen;
- UCHAR bbpdata=0;
- UINT32 macdata;
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
if (NStatus != NDIS_STATUS_SUCCESS)
@@ -1405,48 +1405,26 @@ VOID SendPSMPAction(
switch (Psmp)
{
case MMPS_ENABLE:
- if (IS_RT3090(pAd))
+#ifdef RT30xx
+ if (IS_RT30xx(pAd)
+ &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
{
- // disable MMPS BBP control register
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
- bbpdata &= ~(0x04); //bit 2
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
-
- // disable MMPS MAC control register
- RTMP_IO_READ32(pAd, 0x1210, &macdata);
- macdata &= ~(0x09); //bit 0, 3
- RTMP_IO_WRITE32(pAd, 0x1210, macdata);
+ RTMP_ASIC_MMPS_DISABLE(pAd);
}
+#endif // RT30xx //
Frame.Psmp = 0;
break;
case MMPS_DYNAMIC:
- if (IS_RT3090(pAd))
- {
- // enable MMPS BBP control register
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
- bbpdata |= 0x04; //bit 2
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
-
- // enable MMPS MAC control register
- RTMP_IO_READ32(pAd, 0x1210, &macdata);
- macdata |= 0x09; //bit 0, 3
- RTMP_IO_WRITE32(pAd, 0x1210, macdata);
- }
Frame.Psmp = 3;
break;
case MMPS_STATIC:
- if (IS_RT3090(pAd))
+#ifdef RT30xx
+ if (IS_RT30xx(pAd)
+ &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
{
- // enable MMPS BBP control register
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &bbpdata);
- bbpdata |= 0x04; //bit 2
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, bbpdata);
-
- // enable MMPS MAC control register
- RTMP_IO_READ32(pAd, 0x1210, &macdata);
- macdata |= 0x09; //bit 0, 3
- RTMP_IO_WRITE32(pAd, 0x1210, macdata);
+ RTMP_ASIC_MMPS_ENABLE(pAd);
}
+#endif // RT30xx //
Frame.Psmp = 1;
break;
}
@@ -1504,20 +1482,22 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet(
ASSERT(pRxBlk->pRxPacket);
pRxPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
- RTPKT_TO_OSPKT(pRxPkt)->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
- RTPKT_TO_OSPKT(pRxPkt)->data = pRxBlk->pData;
- RTPKT_TO_OSPKT(pRxPkt)->len = pRxBlk->DataSize;
- RTPKT_TO_OSPKT(pRxPkt)->tail = RTPKT_TO_OSPKT(pRxPkt)->data + RTPKT_TO_OSPKT(pRxPkt)->len;
+ SET_OS_PKT_NETDEV(pRxPkt, get_netdev_from_bssid(pAd, FromWhichBSSID));
+ SET_OS_PKT_DATAPTR(pRxPkt, pRxBlk->pData);
+ SET_OS_PKT_LEN(pRxPkt, pRxBlk->DataSize);
+ SET_OS_PKT_DATATAIL(pRxPkt, pRxBlk->pData, pRxBlk->DataSize);
//
// copy 802.3 header, if necessary
//
if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU))
{
+ {
#ifdef LINUX
NdisMoveMemory(skb_push(pRxPkt, LENGTH_802_3), Header802_3, LENGTH_802_3);
#endif
}
+ }
}
@@ -1550,7 +1530,8 @@ static VOID ba_enqueue_reordering_packet(
UINT16 Sequence = (UINT16) pRxBlk->pHeader->Sequence;
mpdu_blk = ba_mpdu_blk_alloc(pAd);
- if (mpdu_blk != NULL)
+ if ((mpdu_blk != NULL) &&
+ (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP)))
{
// Write RxD buffer address & allocated buffer length
NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
diff --git a/drivers/staging/rt3090/common/cmm_aes.c b/drivers/staging/rt2860/common/cmm_aes.c
index 4ccbbbfe4cca..2c311b166784 100644
--- a/drivers/staging/rt3090/common/cmm_aes.c
+++ b/drivers/staging/rt2860/common/cmm_aes.c
@@ -35,7 +35,7 @@
Paul Wu 02-25-02 Initial
*/
-#include "../rt_config.h"
+#include "../rt_config.h"
typedef struct
@@ -480,9 +480,6 @@ BOOLEAN RTMPSoftDecryptAES(
UCHAR MIC[8];
UCHAR TrailMIC[8];
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pData, DIR_READ, FALSE);
-#endif
fc0 = *pData;
fc1 = *(pData + 1);
@@ -653,9 +650,6 @@ BOOLEAN RTMPSoftDecryptAES(
return FALSE;
}
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pData, DIR_READ, FALSE);
-#endif
return TRUE;
}
@@ -1408,153 +1402,3 @@ VOID AES_GTK_KEY_UNWRAP(
os_free_mem(NULL, R);
}
-
-
-/* ======= The related function of AES-128-CMAC ======= */
-VOID leftshift_onebit(
- IN PUCHAR input,
- OUT PUCHAR output)
-{
- INT i;
- UCHAR overflow = 0;
-
- for (i=15; i>=0; i--)
- {
- output[i] = input[i] << 1;
- output[i] |= overflow;
- overflow = (input[i] & 0x80) ? 1 : 0;
- }
-}
-
-VOID do_padding(
- IN PUCHAR lastb,
- OUT PUCHAR pad,
- IN INT len)
-{
- INT j;
-
- for (j=0; j<16; j++)
- {
- if (j < len)
- pad[j] = lastb[j];
- else if (j == len)
- pad[j] = 0x80;
- else
- pad[j] = 0x00;
- }
-
-
-}
-
-/*
- * The Subkey Generation Algorithm
- */
-VOID generate_subkey(
- IN PUCHAR key,
- OUT PUCHAR K1,
- OUT PUCHAR K2)
-{
- aes_context aesctx;
- UCHAR aes_128_key[16];
- UCHAR const_Zero[16];
- UCHAR tmp[16];
- UCHAR const_Rb[16] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87};
-
- // initial the key material
- memset(const_Zero, 0, 16);
- memset(aes_128_key, 0, 16);
-
- // AES-128 with key is applied to an all-zero input block
- rt_aes_set_key(&aesctx, key, 128);
- rt_aes_encrypt(&aesctx, const_Zero, aes_128_key);
-
- // derive K1(128-bit first subkey) and K2(128-bit second subkey), refer to rfc-4493 ch 2.3
- if ((aes_128_key[0] & 0x80) == 0)
- {
- leftshift_onebit(aes_128_key, K1);
- }
- else
- {
- leftshift_onebit(aes_128_key, tmp);
- xor_128(tmp, const_Rb, K1);
- }
-
- if ((K1[0] & 0x80) == 0)
- {
- leftshift_onebit(K1, K2);
- }
- else
- {
- leftshift_onebit(K1, tmp);
- xor_128(tmp, const_Rb, K2);
- }
-
-}
-
-/*
- * AES-CMAC Algorithm. (refer to rfc-4493 and SP800-38B)
- *
- * Input : key (128-bit key)
- * input (message to be authenticated)
- * len (length of the message in octets)
- *
- * output: mac (message authentication code)
- */
-VOID AES_128_CMAC(
- IN PUCHAR key,
- IN PUCHAR input,
- IN INT len,
- OUT PUCHAR mac)
-{
- UCHAR X[16], Y[16], M_last[16], padded[16];
- UCHAR K1[16], K2[16];
- aes_context aesctx;
- INT n, i, flag;
-
- generate_subkey(key, K1, K2);
-
- n = (len+15) / 16; // n is number of rounds
-
- if (n == 0)
- {
- n = 1;
- flag = 0;
- }
- else
- {
- if ((len%16) == 0)
- flag = 1; // indicate that last block is a complete block
- else
- flag = 0; // indicate that last block is not a complete block
- }
-
- if (flag)
- {
- xor_128(&input[16*(n-1)], K1, M_last);
- }
- else
- {
- do_padding(&input[16*(n-1)], padded, len%16);
- xor_128(padded, K2, M_last);
- }
-
- memset(X, 0, 16);
- for (i=0; i<n-1; i++)
- {
- xor_128(X, &input[16*i], Y);
- rt_aes_set_key(&aesctx, key, 128);
- rt_aes_encrypt(&aesctx, Y, X);
- }
-
- xor_128(X, M_last, Y);
- rt_aes_set_key(&aesctx, key, 128);
- rt_aes_encrypt(&aesctx, Y, X);
-
- for (i=0; i<16; i++)
- {
- mac[i] = X[i];
- }
-
-}
-/* ======= The related function of AES-128-CMAC ======= */
diff --git a/drivers/staging/rt3090/common/cmm_asic.c b/drivers/staging/rt2860/common/cmm_asic.c
index 3d1c808496f3..5d3a387f76a2 100644
--- a/drivers/staging/rt3090/common/cmm_asic.c
+++ b/drivers/staging/rt2860/common/cmm_asic.c
@@ -201,7 +201,6 @@ VOID AsicUpdateAutoFallBackTable(
}
}
break;
-#ifdef DOT11_N_SUPPORT
case 2: //HT-MIX
case 3: //HT-GF
{
@@ -263,7 +262,6 @@ VOID AsicUpdateAutoFallBackTable(
}
}
break;
-#endif // DOT11_N_SUPPORT //
}
pNextTxRate = pCurrTxRate;
@@ -305,12 +303,7 @@ VOID AsicUpdateProtect(
UCHAR i;
UINT32 MacReg = 0;
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-#ifdef DOT11_N_SUPPORT
if (!(pAd->CommonCfg.bHTProtect) && (OperationMode != 8))
{
return;
@@ -324,16 +317,13 @@ VOID AsicUpdateProtect(
SetMask = ALLN_SETPROTECT;
OperationMode = 8;
}
-#endif // DOT11_N_SUPPORT //
// Config ASIC RTS threshold register
RTMP_IO_READ32(pAd, TX_RTS_CFG, &MacReg);
MacReg &= 0xFF0000FF;
- // If the user want disable RtsThreshold and enbale Amsdu/Ralink-Aggregation, set the RtsThreshold as 4096
+ // If the user want disable RtsThreshold and enable Amsdu/Ralink-Aggregation, set the RtsThreshold as 4096
if ((
-#ifdef DOT11_N_SUPPORT
(pAd->CommonCfg.BACapability.field.AmsduEnable) ||
-#endif // DOT11_N_SUPPORT //
(pAd->CommonCfg.bAggregationCapable == TRUE))
&& pAd->CommonCfg.RtsThreshold == MAX_RTS_THRESHOLD)
{
@@ -383,7 +373,6 @@ VOID AsicUpdateProtect(
pAd->FlgCtsEnabled = 1; /* CTS-self is used */
}
-#ifdef DOT11_N_SUPPORT
// Decide HT frame protection.
if ((SetMask & ALLN_SETPROTECT) != 0)
{
@@ -514,7 +503,6 @@ VOID AsicUpdateProtect(
break;
}
}
-#endif // DOT11_N_SUPPORT //
offset = CCK_PROT_CFG;
for (i = 0;i < 6;i++)
@@ -618,12 +606,12 @@ VOID AsicSwitchChannel(
// Set BW
if (!bScan && (pAd->CommonCfg.BBPCurrentBW == BW_40))
- {
+ {
RFValue = pAd->Mlme.CaliBW40RfR24;
//DISABLE_11N_CHECK(pAd);
}
else
- {
+ {
RFValue = pAd->Mlme.CaliBW20RfR24;
}
RT30xxWriteRFRegister(pAd, RF_R24, RFValue);
@@ -735,18 +723,6 @@ VOID AsicSwitchChannel(
pAd->LatchRfRegs.R3 = R3;
pAd->LatchRfRegs.R4 = R4;
-#ifdef DFS_DEBUG
-#ifdef DFS_FCC_BW40_FIX
- if (pAd->infType == RTMP_DEV_INF_PCI) // RT2880 PCI
- {
- /* only for RT2880 */
- // FCC DFS test
- pAd->LatchRfRegs.R1 |= 0x100;
- pAd->LatchRfRegs.R4 |= 0x00400000;
- }
-#endif // DFS_FCC_BW40_FIX //
-#endif // DFS_DEBUG //
-
// Set RF value 1's set R3[bit2] = [0]
RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
@@ -911,6 +887,17 @@ VOID AsicSwitchChannel(
RTMPusecDelay(1000);
}
+VOID AsicResetBBPAgent(
+IN PRTMP_ADAPTER pAd)
+{
+ BBP_CSR_CFG_STRUC BbpCsr;
+ DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n"));
+ // Still need to find why BBP agent keeps busy, but in fact, hardware still function ok. Now clear busy first.
+ RTMP_IO_READ32(pAd, H2M_BBP_AGENT, &BbpCsr.word);
+ BbpCsr.field.Busy = 0;
+ RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
+}
+
/*
==========================================================================
Description:
@@ -930,102 +917,6 @@ VOID AsicLockChannel(
{
}
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-#ifdef ANT_DIVERSITY_SUPPORT
-VOID AsicAntennaSelect(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel)
-{
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- if (pAd->Mlme.OneSecPeriodicRound % 2 == 1)
-#endif // CONFIG_STA_SUPPORT //
- {
- // patch for AsicSetRxAnt failed
- pAd->RxAnt.EvaluatePeriod = 0;
-
- // check every 2 second. If rcv-beacon less than 5 in the past 2 second, then AvgRSSI is no longer a
- // valid indication of the distance between this AP and its clients.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- SHORT realavgrssi1;
-
- // if no traffic then reset average rssi to trigger evaluation
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->StaCfg.NumOfAvgRssiSample < 5)
- {
- pAd->RxAnt.Pair1LastAvgRssi = (-99);
- pAd->RxAnt.Pair2LastAvgRssi = (-99);
- DBGPRINT(RT_DEBUG_TRACE, ("MlmePeriodicExec: no traffic/beacon, reset RSSI\n"));
- }
-
- pAd->StaCfg.NumOfAvgRssiSample = 0;
- realavgrssi1 = (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1PrimaryRxAnt] >> 3);
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE,("Ant-realrssi0(%d), Lastrssi0(%d), EvaluateStableCnt=%d\n", realavgrssi1, pAd->RxAnt.Pair1LastAvgRssi, pAd->RxAnt.EvaluateStableCnt));
-
- // if the difference between two rssi is larger or less than 5, then evaluate the other antenna
- if ((pAd->RxAnt.EvaluateStableCnt < 2) || (realavgrssi1 > (pAd->RxAnt.Pair1LastAvgRssi + 5)) || (realavgrssi1 < (pAd->RxAnt.Pair1LastAvgRssi - 5)))
- AsicEvaluateRxAnt(pAd);
-
- pAd->RxAnt.Pair1LastAvgRssi = realavgrssi1;
- }
- else
- {
- // if not connected, always switch antenna to try to connect
- UCHAR temp;
-
- temp = pAd->RxAnt.Pair1PrimaryRxAnt;
- pAd->RxAnt.Pair1PrimaryRxAnt = pAd->RxAnt.Pair1SecondaryRxAnt;
- pAd->RxAnt.Pair1SecondaryRxAnt = temp;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MlmePeriodicExec: no connect, switch to another one to try connection\n"));
-
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- }
- }
-}
-#endif // ANT_DIVERSITY_SUPPORT //
-
-/*
- ========================================================================
-
- Routine Description:
- Antenna miscellaneous setting.
-
- Arguments:
- pAd Pointer to our adapter
- BandState Indicate current Band State.
-
- Return Value:
- None
-
- IRQL <= DISPATCH_LEVEL
-
- Note:
- 1.) Frame End type control
- only valid for G only (RF_2527 & RF_2529)
- 0: means DPDT, set BBP R4 bit 5 to 1
- 1: means SPDT, set BBP R4 bit 5 to 0
-
-
- ========================================================================
-*/
-VOID AsicAntennaSetting(
- IN PRTMP_ADAPTER pAd,
- IN ABGBAND_STATE BandState)
-{
-}
-
VOID AsicRfTuningExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
@@ -1062,42 +953,22 @@ VOID AsicAdjustTxPower(
PCHAR pTxAgcCompensate;
ULONG TxPwr[5];
CHAR Value;
-#ifdef CONFIG_STA_SUPPORT
CHAR Rssi = -127;
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CARRIER_SENSE_NEW_ALGO
- unsigned long flags; //KH Add to Fix PCIe Power-Saving bug
-#endif // CARRIER_SENSE_NEW_ALGO //
-#ifdef CARRIER_SENSE_NEW_ALGO
- //KH Add to Fix PCIe Power-Saving bug<--
- RTMP_INT_LOCK(&pAd->irq_lock, flags);
- //KH Add to Fix PCIe Power-Saving bug-->
-#endif // CARRIER_SENSE_NEW_ALGO //
-#ifdef CONFIG_STA_SUPPORT
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ||
#ifdef RTMP_MAC_PCI
(pAd->bPCIclkOff == TRUE) ||
#endif // RTMP_MAC_PCI //
RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF) ||
RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
-{
-
-#ifdef CARRIER_SENSE_NEW_ALGO
- //KH Add to Fix PCIe Power-Saving bug<--
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- //KH add to fix PCIe-Power Saving -->
-#endif // CARRIER_SENSE_NEW_ALGO //
return;
-}
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
+
Rssi = RTMPMaxRssi(pAd,
pAd->StaCfg.RssiSample.AvgRssi0,
pAd->StaCfg.RssiSample.AvgRssi1,
pAd->StaCfg.RssiSample.AvgRssi2);
-#endif // CONFIG_STA_SUPPORT //
if (pAd->CommonCfg.BBPCurrentBW == BW_40)
{
@@ -1242,102 +1113,12 @@ VOID AsicAdjustTxPower(
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BbpR1);
BbpR1 &= 0xFC;
-#ifdef SINGLE_SKU
- // Handle regulatory max tx power constrain
- do
- {
- UCHAR TxPwrInEEPROM = 0xFF, CountryTxPwr = 0xFF, criterion;
- UCHAR AdjustMaxTxPwr[40];
-
- if (pAd->CommonCfg.Channel > 14) // 5G band
- TxPwrInEEPROM = ((pAd->CommonCfg.DefineMaxTxPwr & 0xFF00) >> 8);
- else // 2.4G band
- TxPwrInEEPROM = (pAd->CommonCfg.DefineMaxTxPwr & 0x00FF);
- CountryTxPwr = GetCuntryMaxTxPwr(pAd, pAd->CommonCfg.Channel);
-
- // error handling, range check
- if ((TxPwrInEEPROM > 0x50) || (CountryTxPwr > 0x50))
- {
- DBGPRINT(RT_DEBUG_ERROR,("AsicAdjustTxPower - Invalid max tx power (=0x%02x), CountryTxPwr=%d\n", TxPwrInEEPROM, CountryTxPwr));
- break;
- }
-
- criterion = *((PUCHAR)TxPwr + 2) & 0xF; // FAE use OFDM 6M as criterion
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,("AsicAdjustTxPower (criterion=%d, TxPwrInEEPROM=%d, CountryTxPwr=%d)\n", criterion, TxPwrInEEPROM, CountryTxPwr));
-
- // Adjust max tx power according to the relationship of tx power in E2PROM
- for (i=0; i<5; i++)
- {
- // CCK will have 4dBm larger than OFDM
- // Therefore, we should separate to parse the tx power field
- if (i == 0)
- {
- for (j=0; j<8; j++)
- {
- Value = (CHAR)((TxPwr[i] >> j*4) & 0x0F);
-
- if (j < 4)
- {
- // CCK will have 4dBm larger than OFDM
- AdjustMaxTxPwr[i*8+j] = TxPwrInEEPROM + (Value - criterion) + 4;
- }
- else
- {
- AdjustMaxTxPwr[i*8+j] = TxPwrInEEPROM + (Value - criterion);
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE,("AsicAdjustTxPower (i/j=%d/%d, Value=%d, %d)\n", i, j, Value, AdjustMaxTxPwr[i*8+j]));
- }
- }
- else
- {
- for (j=0; j<8; j++)
- {
- Value = (CHAR)((TxPwr[i] >> j*4) & 0x0F);
-
- AdjustMaxTxPwr[i*8+j] = TxPwrInEEPROM + (Value - criterion);
- DBGPRINT_RAW(RT_DEBUG_TRACE,("AsicAdjustTxPower (i/j=%d/%d, Value=%d, %d)\n", i, j, Value, AdjustMaxTxPwr[i*8+j]));
- }
- }
- }
-
- // Adjust tx power according to the relationship
- for (i=0; i<5; i++)
- {
- if (TxPwr[i] != 0xffffffff)
- {
- for (j=0; j<8; j++)
- {
- Value = (CHAR)((TxPwr[i] >> j*4) & 0x0F);
-
- // The system tx power is larger than the regulatory, the power should be restrain
- if (AdjustMaxTxPwr[i*8+j] > CountryTxPwr)
- {
- // decrease to zero and don't need to take care BBPR1
- if ((Value - (AdjustMaxTxPwr[i*8+j] - CountryTxPwr)) > 0)
- Value -= (AdjustMaxTxPwr[i*8+j] - CountryTxPwr);
- else
- Value = 0;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,("AsicAdjustTxPower (i/j=%d/%d, Value=%d, %d)\n", i, j, Value, AdjustMaxTxPwr[i*8+j]));
- }
- else
- DBGPRINT_RAW(RT_DEBUG_TRACE,("AsicAdjustTxPower (i/j=%d/%d, Value=%d, %d, no change)\n", i, j, Value, AdjustMaxTxPwr[i*8+j]));
-
- TxPwr[i] = (TxPwr[i] & ~(0x0000000F << j*4)) | (Value << j*4);
- }
- }
- }
- } while (FALSE);
-#endif // SINGLE_SKU //
/* calculate delta power based on the percentage specified from UI */
// E2PROM setting is calibrated for maximum TX power (i.e. 100%)
// We lower TX power here according to the percentage specified from UI
if (pAd->CommonCfg.TxPowerPercentage == 0xffffffff) // AUTO TX POWER control
{
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// to patch high power issue with some APs, like Belkin N1.
if (Rssi > -35)
@@ -1351,7 +1132,6 @@ VOID AsicAdjustTxPower(
else
;
}
-#endif // CONFIG_STA_SUPPORT //
}
else if (pAd->CommonCfg.TxPowerPercentage > 90) // 91 ~ 100% & AUTO, treat as 100% in terms of mW
;
@@ -1415,26 +1195,10 @@ VOID AsicAdjustTxPower(
}
}
-#ifdef CARRIER_SENSE_NEW_ALGO
- //KH Add to Fix PCIe Power-Saving bug<--
- RTMP_INT_UNLOCK(&pAd->irq_lock, flags);
- //KH add to fix PCIe-Power Saving -->
-#endif // CARRIER_SENSE_NEW_ALGO //
}
-#ifdef CONFIG_STA_SUPPORT
-VOID AsicResetBBPAgent(
-IN PRTMP_ADAPTER pAd)
-{
- BBP_CSR_CFG_STRUC BbpCsr;
- DBGPRINT(RT_DEBUG_ERROR, ("Reset BBP Agent busy bit.!! \n"));
- // Still need to find why BBP agent keeps busy, but in fact, hardware still function ok. Now clear busy first.
- RTMP_IO_READ32(pAd, H2M_BBP_AGENT, &BbpCsr.word);
- BbpCsr.field.Busy = 0;
- RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
-}
/*
==========================================================================
Description:
@@ -1485,7 +1249,6 @@ VOID AsicForceWakeup(
DBGPRINT(RT_DEBUG_INFO, ("--> AsicForceWakeup \n"));
RTMP_STA_FORCE_WAKEUP(pAd, bFromTx);
}
-#endif // CONFIG_STA_SUPPORT //
/*
@@ -1607,9 +1370,7 @@ VOID AsicDisableRDG(
// Data |= 0x60; // for performance issue not set the TXOP to 0
#endif
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE)
-#ifdef DOT11_N_SUPPORT
&& (pAd->MacTab.fAnyStationMIMOPSDynamic == FALSE)
-#endif // DOT11_N_SUPPORT //
)
{
// For CWC test, change txop from 0x30 to 0x20 in TxBurst mode
@@ -1665,8 +1426,6 @@ VOID AsicEnableBssSync(
RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
// RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, 0x00000000);
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
csr.field.bTsfTicking = 1;
@@ -1674,7 +1433,6 @@ VOID AsicEnableBssSync(
csr.field.bBeaconGen = 0; // do NOT generate BEACON
csr.field.bTBTTEnable = 1;
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
}
@@ -1724,7 +1482,27 @@ VOID AsicEnableIbssSync(
ptr +=4;
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ // move BEACON TXD and frame content to on-chip memory
+ ptr = (PUCHAR)&pAd->BeaconTxWI;
+ for (i=0; i<TXWI_SIZE; i+=2) // 16-byte TXWI field
+ {
+ //UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
+ //RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr);
+ RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2);
+ ptr += 2;
+ }
+ // start right after the 16-byte TXWI field
+ ptr = pAd->BeaconBuf;
+ for (i=0; i< pAd->BeaconTxWI.MPDUtotalByteCount; i+=2)
+ {
+ //UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
+ //RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr);
+ RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2);
+ ptr +=2;
+ }
+#endif // RTMP_MAC_USB //
//
// For Wi-Fi faily generated beacons between participating stations.
@@ -1890,14 +1668,10 @@ VOID AsicSetEdcaParm(
Ac2Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VI];
}
Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI] + 1;
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef INF_AMAZON_SE
-#endif // INF_AMAZON_SE //
+#ifdef RTMP_MAC_USB
+ Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI] + 3;
+#endif // RTMP_MAC_USB //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Tuning for Wi-Fi WMM S06
if (pAd->CommonCfg.bWiFiTest &&
@@ -1912,7 +1686,6 @@ VOID AsicSetEdcaParm(
Ac0Cfg.field.Aifsn = 3;
Ac2Cfg.field.AcTxop = 5;
}
-
#ifdef RT30xx
if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
{
@@ -1921,7 +1694,6 @@ VOID AsicSetEdcaParm(
}
#endif // RT30xx //
}
-#endif // CONFIG_STA_SUPPORT //
Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO];
Ac3Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VO];
@@ -1963,10 +1735,7 @@ VOID AsicSetEdcaParm(
CwminCsr.field.Cwmin0 = pEdcaParm->Cwmin[QID_AC_BE];
CwminCsr.field.Cwmin1 = pEdcaParm->Cwmin[QID_AC_BK];
CwminCsr.field.Cwmin2 = pEdcaParm->Cwmin[QID_AC_VI];
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word);
CwmaxCsr.word = 0;
@@ -1980,11 +1749,7 @@ VOID AsicSetEdcaParm(
AifsnCsr.field.Aifsn0 = Ac0Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BE];
AifsnCsr.field.Aifsn1 = Ac1Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BK];
AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_VI];
-#ifdef INF_AMAZON_SE
-#endif // INF_AMAZON_SE //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// Tuning for Wi-Fi WMM S06
if (pAd->CommonCfg.bWiFiTest &&
@@ -2003,22 +1768,17 @@ VOID AsicSetEdcaParm(
if (INFRA_ON(pAd))
CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_WMM_CAPABLE);
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test
#ifdef RT30xx
// TODO: Shiang, this modification also suitable for RT3052/RT3050 ???
if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
{
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
AifsnCsr.field.Aifsn2 = 0x2; //pEdcaParm->Aifsn[QID_AC_VI]; //for WiFi WMM S4-T04.
}
#endif // RT30xx //
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word);
NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
@@ -2070,10 +1830,8 @@ VOID AsicSetSlotTime(
ULONG SlotTime;
UINT32 RegValue = 0;
-#ifdef CONFIG_STA_SUPPORT
if (pAd->CommonCfg.Channel > 14)
bUseShortSlotTime = TRUE;
-#endif // CONFIG_STA_SUPPORT //
if (bUseShortSlotTime && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED))
return;
@@ -2087,14 +1845,10 @@ VOID AsicSetSlotTime(
SlotTime = (bUseShortSlotTime)? 9 : 20;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// force using short SLOT time for FAE to demo performance when TxBurst is ON
if (((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED)))
-#ifdef DOT11_N_SUPPORT
|| ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE))
-#endif // DOT11_N_SUPPORT //
)
{
// In this case, we will think it is doing Wi-Fi test
@@ -2106,15 +1860,12 @@ VOID AsicSetSlotTime(
SlotTime = 9;
}
}
-#endif // CONFIG_STA_SUPPORT //
//
// For some reasons, always set it to short slot time.
//
// ToDo: Should consider capability with 11B
//
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (pAd->StaCfg.BssType == BSS_ADHOC)
{
@@ -2122,7 +1873,6 @@ VOID AsicSetSlotTime(
SlotTime = 20;
}
}
-#endif // CONFIG_STA_SUPPORT //
RTMP_IO_READ32(pAd, BKOFF_SLOT_CFG, &RegValue);
RegValue = RegValue & 0xFFFFFF00;
@@ -2202,7 +1952,24 @@ VOID AsicAddSharedKeyEntry(
}
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+{
+ offset = SHARED_KEY_TABLE_BASE + (4*BssIndex + KeyIdx)*HW_KEY_ENTRY_SIZE;
+ RTUSBMultiWrite(pAd, offset, pKey, MAX_LEN_OF_SHARE_KEY);
+ offset += MAX_LEN_OF_SHARE_KEY;
+ if (pTxMic)
+ {
+ RTUSBMultiWrite(pAd, offset, pTxMic, 8);
+ }
+
+ offset += 8;
+ if (pRxMic)
+ {
+ RTUSBMultiWrite(pAd, offset, pRxMic, 8);
+ }
+}
+#endif // RTMP_MAC_USB //
//
// Update cipher algorithm. WSTA always use BSS0
@@ -2424,7 +2191,24 @@ VOID AsicAddKeyEntry(
}
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTUSBMultiWrite(pAd, offset, pKey, MAX_LEN_OF_PEER_KEY);
+ offset += MAX_LEN_OF_PEER_KEY;
+
+ //
+ // 3.) Set MIC key if available
+ //
+ if (pTxMic)
+ {
+ RTUSBMultiWrite(pAd, offset, pTxMic, 8);
+ }
+ offset += LEN_TKIP_TXMICK;
+ if (pRxMic)
+ {
+ RTUSBMultiWrite(pAd, offset, pRxMic, 8);
+ }
+#endif // RTMP_MAC_USB //
//
// 4.) Modify IV/EIV if needs
@@ -2456,6 +2240,25 @@ VOID AsicAddKeyEntry(
RTMP_IO_WRITE8(pAd, offset + i, pTxtsc[i + 2]);
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ UINT32 tmpVal;
+
+ //
+ // Write IV
+ //
+ IV4 = (KeyIdx << 6);
+ if ((CipherAlg == CIPHER_TKIP) || (CipherAlg == CIPHER_TKIP_NO_MIC) ||(CipherAlg == CIPHER_AES))
+ IV4 |= 0x20; // turn on extension bit means EIV existence
+
+ tmpVal = pTxtsc[1] + (((pTxtsc[1] | 0x20) & 0x7f) << 8) + (pTxtsc[0] << 16) + (IV4 << 24);
+ RTMP_IO_WRITE32(pAd, offset, tmpVal);
+
+ //
+ // Write EIV
+ //
+ offset += 4;
+ RTMP_IO_WRITE32(pAd, offset, *(PUINT32)&pCipherKey->TxTsc[2]);
+#endif // RTMP_MAC_USB //
AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg, bUsePairewiseKeyTable);
}
@@ -2527,6 +2330,9 @@ VOID AsicAddPairwiseKeyEntry(
RTMP_IO_WRITE8(pAd, offset + i, pKey[i]);
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTUSBMultiWrite(pAd, offset, &pCipherKey->Key[0], MAX_LEN_OF_PEER_KEY);
+#endif // RTMP_MAC_USB //
for (i=0; i<MAX_LEN_OF_PEER_KEY; i+=4)
{
UINT32 Value;
@@ -2544,6 +2350,9 @@ VOID AsicAddPairwiseKeyEntry(
RTMP_IO_WRITE8(pAd, offset+i, pTxMic[i]);
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTUSBMultiWrite(pAd, offset, &pCipherKey->TxMic[0], 8);
+#endif // RTMP_MAC_USB //
}
offset += 8;
if (pRxMic)
@@ -2554,6 +2363,9 @@ VOID AsicAddPairwiseKeyEntry(
RTMP_IO_WRITE8(pAd, offset+i, pRxMic[i]);
}
#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTUSBMultiWrite(pAd, offset, &pCipherKey->RxMic[0], 8);
+#endif // RTMP_MAC_USB //
}
DBGPRINT(RT_DEBUG_TRACE,("AsicAddPairwiseKeyEntry: WCID #%d Alg=%s\n",WCID, CipherName[CipherAlg]));
@@ -2600,7 +2412,6 @@ BOOLEAN AsicSendCommandToMcu(
IN UCHAR Arg1)
{
-
if (pAd->chipOps.sendCommandToMcu)
pAd->chipOps.sendCommandToMcu(pAd, Command, Token, Arg0, Arg1);
@@ -2612,14 +2423,10 @@ VOID AsicSetRxAnt(
IN PRTMP_ADAPTER pAd,
IN UCHAR Ant)
{
-#ifdef RT33xx
- RT33xxSetRxAnt(pAd, Ant);
-#else
#ifdef RT30xx
/* RT3572 ATE need not to do this. */
RT30xxSetRxAnt(pAd, Ant);
#endif // RT30xx //
-#endif // RT33xx //
}
diff --git a/drivers/staging/rt3090/common/cmm_cfg.c b/drivers/staging/rt2860/common/cmm_cfg.c
index d8be9793c61b..c1cf2bf4680d 100644
--- a/drivers/staging/rt3090/common/cmm_cfg.c
+++ b/drivers/staging/rt2860/common/cmm_cfg.c
@@ -35,6 +35,8 @@
--------- ---------- ----------------------------------------------
*/
+
+
#include "../rt_config.h"
@@ -48,13 +50,11 @@ char* GetPhyMode(
case MODE_OFDM:
return "OFDM";
-#ifdef DOT11_N_SUPPORT
case MODE_HTMIX:
return "HTMIX";
case MODE_HTGREENFIELD:
return "GREEN";
-#endif // DOT11_N_SUPPORT //
default:
return "N/A";
}
@@ -71,10 +71,8 @@ char* GetBW(
case BW_20:
return "20M";
-#ifdef DOT11_N_SUPPORT
case BW_40:
return "40M";
-#endif // DOT11_N_SUPPORT //
default:
return "N/A";
}
@@ -154,15 +152,12 @@ INT RT_CfgSetWirelessMode(
INT MaxPhyMode = PHY_11G;
LONG WirelessMode;
-#ifdef DOT11_N_SUPPORT
MaxPhyMode = PHY_11N_5G;
-#endif // DOT11_N_SUPPORT //
WirelessMode = simple_strtol(arg, 0, 10);
if (WirelessMode <= MaxPhyMode)
{
pAd->CommonCfg.PhyMode = WirelessMode;
- pAd->CommonCfg.DesiredPhyMode = WirelessMode;
return TRUE;
}
diff --git a/drivers/staging/rt2860/common/cmm_data.c b/drivers/staging/rt2860/common/cmm_data.c
index 774fabb0be40..36969134696b 100644
--- a/drivers/staging/rt2860/common/cmm_data.c
+++ b/drivers/staging/rt2860/common/cmm_data.c
@@ -25,9 +25,8 @@
*************************************************************************
*/
-#include "../rt_config.h"
-#define MAX_TX_IN_TBTT (16)
+#include "../rt_config.h"
UCHAR SNAP_802_1H[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
@@ -67,6 +66,7 @@ UCHAR RxwiMCSToOfdmRate[12] = {
char* MCSToMbps[] = {"1Mbps","2Mbps","5.5Mbps","11Mbps","06Mbps","09Mbps","12Mbps","18Mbps","24Mbps","36Mbps","48Mbps","54Mbps","MM-0","MM-1","MM-2","MM-3","MM-4","MM-5","MM-6","MM-7","MM-8","MM-9","MM-10","MM-11","MM-12","MM-13","MM-14","MM-15","MM-32","ee1","ee2","ee3"};
UCHAR default_cwmin[]={CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1, CW_MIN_IN_BITS-2};
+//UCHAR default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1};
UCHAR default_sta_aifsn[]={3,7,2,2};
UCHAR MapUserPriorityToAccessCategory[8] = {QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI, QID_AC_VO, QID_AC_VO};
@@ -105,28 +105,38 @@ NDIS_STATUS MiniportMMRequest(
PNDIS_PACKET pPacket;
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
ULONG FreeNum;
-#ifdef RT2860
+ UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN];
+#ifdef RTMP_MAC_PCI
unsigned long IrqFlags = 0;
-#endif
UCHAR IrqState;
- UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN];
+#endif // RTMP_MAC_PCI //
+ BOOLEAN bUseDataQ = FALSE;
+ int retryCnt = 0;
ASSERT(Length <= MGMT_DMA_BUFFER_SIZE);
- QueIdx=3;
+ if ((QueIdx & MGMT_USE_QUEUE_FLAG) == MGMT_USE_QUEUE_FLAG)
+ {
+ bUseDataQ = TRUE;
+ QueIdx &= (~MGMT_USE_QUEUE_FLAG);
+ }
+#ifdef RTMP_MAC_PCI
// 2860C use Tx Ring
-
IrqState = pAd->irq_disabled;
-
-#ifdef RT2860
- if ((pAd->MACVersion == 0x28600100) && (!IrqState))
+ if (pAd->MACVersion == 0x28600100)
+ {
+ QueIdx = (bUseDataQ ==TRUE ? QueIdx : 3);
+ bUseDataQ = TRUE;
+ }
+ if (bUseDataQ && (!IrqState))
RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
-#endif
+#endif // RTMP_MAC_PCI //
+
do
{
// Reset is in progress, stop immediately
- if ( RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)||
!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
{
@@ -136,13 +146,16 @@ NDIS_STATUS MiniportMMRequest(
// Check Free priority queue
// Since we use PBF Queue2 for management frame. Its corresponding DMA ring should be using TxRing.
-
- // 2860C use Tx Ring
- if (pAd->MACVersion == 0x28600100)
+#ifdef RTMP_MAC_PCI
+ if (bUseDataQ)
{
+ retryCnt = MAX_DATAMM_RETRY;
+ // free Tx(QueIdx) resources
+ RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
FreeNum = GET_TXRING_FREENO(pAd, QueIdx);
}
else
+#endif // RTMP_MAC_PCI //
{
FreeNum = GET_MGMTRING_FREENO(pAd);
}
@@ -162,96 +175,51 @@ NDIS_STATUS MiniportMMRequest(
//pAd->CommonCfg.MlmeRate = RATE_2;
+#ifdef RTMP_MAC_PCI
+ if (bUseDataQ)
+ {
+ Status = MlmeDataHardTransmit(pAd, QueIdx, pPacket);
+ retryCnt--;
+ }
+ else
+#endif // RTMP_MAC_PCI //
Status = MlmeHardTransmit(pAd, QueIdx, pPacket);
- if (Status != NDIS_STATUS_SUCCESS)
+ if (Status == NDIS_STATUS_SUCCESS)
+ retryCnt = 0;
+ else
RTMPFreeNdisPacket(pAd, pPacket);
}
else
{
pAd->RalinkCounters.MgmtRingFullCount++;
+#ifdef RTMP_MAC_PCI
+ if (bUseDataQ)
+ {
+ retryCnt--;
+ DBGPRINT(RT_DEBUG_TRACE, ("retryCnt %d\n", retryCnt));
+ if (retryCnt == 0)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in DataRing, MgmtRingFullCount=%ld!\n",
+ QueIdx, pAd->RalinkCounters.MgmtRingFullCount));
+ }
+ }
+#endif // RTMP_MAC_PCI //
DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in MgmtRing, MgmtRingFullCount=%ld!\n",
QueIdx, pAd->RalinkCounters.MgmtRingFullCount));
}
+ } while (retryCnt > 0);
- } while (FALSE);
-#ifdef RT2860
- // 2860C use Tx Ring
- if ((pAd->MACVersion == 0x28600100) && (!IrqState))
+#ifdef RTMP_MAC_PCI
+ if (bUseDataQ && (!IrqState))
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
-#endif
+#endif // RTMP_MAC_PCI //
+
return Status;
}
-#ifdef RT2860
-NDIS_STATUS MiniportMMRequestUnlock(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PUCHAR pData,
- IN UINT Length)
-{
- PNDIS_PACKET pPacket;
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- ULONG FreeNum;
- TXWI_STRUC TXWI;
- ULONG SW_TX_IDX;
- PTXD_STRUC pTxD;
-
- QueIdx = 3;
- ASSERT(Length <= MGMT_DMA_BUFFER_SIZE);
-
- do
- {
- // Reset is in progress, stop immediately
- if ( RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)||
- !RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
- {
- Status = NDIS_STATUS_FAILURE;
- break;
- }
-
- // Check Free priority queue
- // Since we use PBF Queue2 for management frame. Its corresponding DMA ring should be using TxRing.
- // 2860C use Tx Ring
- if (pAd->MACVersion == 0x28600100)
- {
- FreeNum = GET_TXRING_FREENO(pAd, QueIdx);
- SW_TX_IDX = pAd->TxRing[QueIdx].TxCpuIdx;
- pTxD = (PTXD_STRUC) pAd->TxRing[QueIdx].Cell[SW_TX_IDX].AllocVa;
- }
- else
- {
- FreeNum = GET_MGMTRING_FREENO(pAd);
- SW_TX_IDX = pAd->MgmtRing.TxCpuIdx;
- pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SW_TX_IDX].AllocVa;
- }
- if ((FreeNum > 0))
- {
- NdisZeroMemory(&TXWI, TXWI_SIZE);
- Status = RTMPAllocateNdisPacket(pAd, &pPacket, (PUCHAR)&TXWI, TXWI_SIZE, pData, Length);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_WARN, ("MiniportMMRequest (error:: can't allocate NDIS PACKET)\n"));
- break;
- }
-
- Status = MlmeHardTransmit(pAd, QueIdx, pPacket);
- if (Status != NDIS_STATUS_SUCCESS)
- RTMPFreeNdisPacket(pAd, pPacket);
- }
- else
- {
- pAd->RalinkCounters.MgmtRingFullCount++;
- DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in MgmtRing\n", QueIdx));
- }
-
- } while (FALSE);
- return Status;
-}
-#endif
/*
========================================================================
@@ -282,203 +250,33 @@ NDIS_STATUS MlmeHardTransmit(
IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket)
{
- if (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
- {
- return NDIS_STATUS_FAILURE;
- }
-
-#ifdef RT2860
- if ( pAd->MACVersion == 0x28600100 )
- return MlmeHardTransmitTxRing(pAd,QueIdx,pPacket);
- else
-#endif
- return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket);
-
-}
-
-#ifdef RT2860
-NDIS_STATUS MlmeHardTransmitTxRing(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket)
-{
PACKET_INFO PacketInfo;
PUCHAR pSrcBufVA;
UINT SrcBufLen;
- PTXD_STRUC pTxD;
PHEADER_802_11 pHeader_802_11;
- BOOLEAN bAckRequired, bInsertTimestamp;
- ULONG SrcBufPA;
- UCHAR MlmeRate;
- ULONG SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
- PTXWI_STRUC pFirstTxWI;
- ULONG FreeNum;
- MAC_TABLE_ENTRY *pMacEntry = NULL;
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
-
- if (pSrcBufVA == NULL)
- {
- // The buffer shouldn't be NULL
- return NDIS_STATUS_FAILURE;
- }
-
- // Make sure MGMT ring resource won't be used by other threads
- //NdisAcquireSpinLock(&pAd->TxRingLock);
-
- FreeNum = GET_TXRING_FREENO(pAd, QueIdx);
-
- if (FreeNum == 0)
+ if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
+ )
{
- //NdisReleaseSpinLock(&pAd->TxRingLock);
return NDIS_STATUS_FAILURE;
}
- SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
-
- pTxD = (PTXD_STRUC) pAd->TxRing[QueIdx].Cell[SwIdx].AllocVa;
-
- if (pAd->TxRing[QueIdx].Cell[SwIdx].pNdisPacket)
- {
- printk("MlmeHardTransmit Error\n");
+ RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
+ if (pSrcBufVA == NULL)
return NDIS_STATUS_FAILURE;
- }
- // outgoing frame always wakeup PHY to prevent frame lost
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- AsicForceWakeup(pAd, FROM_TX);
+ pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE);
- pFirstTxWI =(PTXWI_STRUC)pSrcBufVA;
- pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXWI_SIZE);
- if (pHeader_802_11->Addr1[0] & 0x01)
- {
- MlmeRate = pAd->CommonCfg.BasicMlmeRate;
- }
- else
- {
- MlmeRate = pAd->CommonCfg.MlmeRate;
- }
-
- if ((pHeader_802_11->FC.Type == BTYPE_DATA) &&
- (pHeader_802_11->FC.SubType == SUBTYPE_QOS_NULL))
- {
- pMacEntry = MacTableLookup(pAd, pHeader_802_11->Addr1);
- }
-
- // Verify Mlme rate for a / g bands.
- if ((pAd->LatchRfRegs.Channel > 14) && (MlmeRate < RATE_6)) // 11A band
- MlmeRate = RATE_6;
-
- //
- // Should not be hard code to set PwrMgmt to 0 (PWR_ACTIVE)
- // Snice it's been set to 0 while on MgtMacHeaderInit
- // By the way this will cause frame to be send on PWR_SAVE failed.
- //
- //
- // In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame
-
- // Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD
- if (pHeader_802_11->FC.Type != BTYPE_DATA)
- {
- if ((pHeader_802_11->FC.SubType == SUBTYPE_PROBE_REQ) || !(pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable))
- {
- pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE;
- }
- else
- {
- pHeader_802_11->FC.PwrMgmt = pAd->CommonCfg.bAPSDForcePowerSave;
- }
- }
-
- bInsertTimestamp = FALSE;
- if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL
- {
- bAckRequired = FALSE;
- }
- else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
- {
- if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST
- {
- bAckRequired = FALSE;
- pHeader_802_11->Duration = 0;
- }
- else
- {
- bAckRequired = TRUE;
- pHeader_802_11->Duration = RTMPCalcDuration(pAd, MlmeRate, 14);
- if (pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP)
- {
- bInsertTimestamp = TRUE;
- }
- }
- }
- pHeader_802_11->Sequence = pAd->Sequence++;
- if (pAd->Sequence > 0xfff)
- pAd->Sequence = 0;
- // Before radar detection done, mgmt frame can not be sent but probe req
- // Because we need to use probe req to trigger driver to send probe req in passive scan
- if ((pHeader_802_11->FC.SubType != SUBTYPE_PROBE_REQ)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE))
- {
- DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
- return (NDIS_STATUS_FAILURE);
- }
-
- //
- // fill scatter-and-gather buffer list into TXD. Internally created NDIS PACKET
- // should always has only one ohysical buffer, and the whole frame size equals
- // to the first scatter buffer size
- //
-
- // Initialize TX Descriptor
- // For inter-frame gap, the number is for this frame and next frame
- // For MLME rate, we will fix as 2Mb to match other vendor's implement
-
-// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not.
- // Only beacon use Nseq=TRUE. So here we use Nseq=FALSE.
- if (pMacEntry == NULL)
- {
- RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE,
- 0, RESERVED_WCID, (SrcBufLen - TXWI_SIZE), PID_MGMT, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
- }
+#ifdef RTMP_MAC_PCI
+ if ( pAd->MACVersion == 0x28600100 )
+ return MlmeHardTransmitTxRing(pAd,QueIdx,pPacket);
else
- {
- RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
- bInsertTimestamp, FALSE, bAckRequired, FALSE,
- 0, pMacEntry->Aid, (SrcBufLen - TXWI_SIZE),
- pMacEntry->MaxHTPhyMode.field.MCS, 0,
- (UCHAR)pMacEntry->MaxHTPhyMode.field.MCS,
- IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
- }
-
- pAd->TxRing[QueIdx].Cell[SwIdx].pNdisPacket = pPacket;
- pAd->TxRing[QueIdx].Cell[SwIdx].pNextNdisPacket = NULL;
-
- SrcBufPA = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);
-
-
- RTMPWriteTxDescriptor(pAd, pTxD, TRUE, FIFO_EDCA);
- pTxD->LastSec0 = 1;
- pTxD->LastSec1 = 1;
- pTxD->SDLen0 = SrcBufLen;
- pTxD->SDLen1 = 0;
- pTxD->SDPtr0 = SrcBufPA;
- pTxD->DMADONE = 0;
-
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
-
- // Increase TX_CTX_IDX, but write to register later.
- INC_RING_INDEX(pAd->TxRing[QueIdx].TxCpuIdx, TX_RING_SIZE);
-
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QueIdx*0x10, pAd->TxRing[QueIdx].TxCpuIdx);
+#endif // RTMP_MAC_PCI //
+ return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket);
- return NDIS_STATUS_SUCCESS;
}
-#endif /* RT2860 */
+
NDIS_STATUS MlmeHardTransmitMgmtRing(
IN PRTMP_ADAPTER pAd,
@@ -493,25 +291,24 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
UCHAR MlmeRate;
PTXWI_STRUC pFirstTxWI;
MAC_TABLE_ENTRY *pMacEntry = NULL;
+ UCHAR PID;
RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
- RTMP_SEM_LOCK(&pAd->MgmtRingLock);
-
+ // Make sure MGMT ring resource won't be used by other threads
+ RTMP_SEM_LOCK(&pAd->MgmtRingLock);
if (pSrcBufVA == NULL)
{
+ // The buffer shouldn't be NULL
RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
return NDIS_STATUS_FAILURE;
}
+ {
// outgoing frame always wakeup PHY to prevent frame lost
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
-#ifdef RT2860
- AsicForceWakeup(pAd, FROM_TX);
-#endif
-#ifdef RT2870
AsicForceWakeup(pAd, TRUE);
-#endif
+ }
pFirstTxWI = (PTXWI_STRUC)(pSrcBufVA + TXINFO_SIZE);
pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE); //TXWI_SIZE);
@@ -553,19 +350,28 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
// Snice it's been set to 0 while on MgtMacHeaderInit
// By the way this will cause frame to be send on PWR_SAVE failed.
//
- // pHeader_802_11->FC.PwrMgmt = 0; // (pAd->StaCfg.Psm == PWR_SAVE);
+ pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE; // (pAd->StaCfg.Psm == PWR_SAVE);
+
//
// In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame
-
// Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD
- if ((pHeader_802_11->FC.Type != BTYPE_DATA) && (pHeader_802_11->FC.Type != BTYPE_CNTL))
+// if ((pHeader_802_11->FC.Type != BTYPE_DATA) && (pHeader_802_11->FC.Type != BTYPE_CNTL))
{
- if ((pAd->StaCfg.Psm == PWR_SAVE) &&
- (pHeader_802_11->FC.SubType == SUBTYPE_ACTION))
+ if ((pHeader_802_11->FC.SubType == SUBTYPE_ACTION) ||
+ ((pHeader_802_11->FC.Type == BTYPE_DATA) &&
+ ((pHeader_802_11->FC.SubType == SUBTYPE_QOS_NULL) ||
+ (pHeader_802_11->FC.SubType == SUBTYPE_NULL_FUNC))))
+ {
+ if (pAd->StaCfg.Psm == PWR_SAVE)
pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
else
- pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE;
+ pHeader_802_11->FC.PwrMgmt = pAd->CommonCfg.bAPSDForcePowerSave;
}
+ }
+
+
+
+
bInsertTimestamp = FALSE;
if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL
@@ -579,6 +385,9 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
}
else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
{
+ //pAd->Sequence++;
+ //pHeader_802_11->Sequence = pAd->Sequence;
+
if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST
{
bAckRequired = FALSE;
@@ -588,9 +397,14 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
{
bAckRequired = TRUE;
pHeader_802_11->Duration = RTMPCalcDuration(pAd, MlmeRate, 14);
- if (pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP)
+ if ((pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP) && (pHeader_802_11->FC.Type == BTYPE_MGMT))
{
bInsertTimestamp = TRUE;
+ bAckRequired = FALSE; // Disable ACK to prevent retry 0x1f for Probe Response
+ }
+ else if ((pHeader_802_11->FC.SubType == SUBTYPE_PROBE_REQ) && (pHeader_802_11->FC.Type == BTYPE_MGMT))
+ {
+ bAckRequired = FALSE; // Disable ACK to prevent retry 0x1f for Probe Request
}
}
}
@@ -606,28 +420,35 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
&& (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE))
{
DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
+// if (!IrqState)
RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
return (NDIS_STATUS_FAILURE);
}
+
//
// fill scatter-and-gather buffer list into TXD. Internally created NDIS PACKET
- // should always has only one ohysical buffer, and the whole frame size equals
+ // should always has only one physical buffer, and the whole frame size equals
// to the first scatter buffer size
//
// Initialize TX Descriptor
// For inter-frame gap, the number is for this frame and next frame
// For MLME rate, we will fix as 2Mb to match other vendor's implement
+// pAd->CommonCfg.MlmeTransmit.field.MODE = 1;
// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not.
+ PID = PID_MGMT;
+
+
if (pMacEntry == NULL)
{
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE,
- 0, RESERVED_WCID, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID_MGMT, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
+ 0, RESERVED_WCID, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
}
else
{
+ /* dont use low rate to send QoS Null data frame */
RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
bInsertTimestamp, FALSE, bAckRequired, FALSE,
0, pMacEntry->Aid, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE),
@@ -640,6 +461,7 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen);
// Make sure to release MGMT ring resource
+// if (!IrqState)
RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
return NDIS_STATUS_SUCCESS;
}
@@ -737,10 +559,6 @@ static UCHAR TxPktClassification(
bHTRate = TRUE;
if (RTMP_GET_PACKET_MOREDATA(pPacket) || (pMacEntry->PsMode == PWR_SAVE))
TxFrameType = TX_LEGACY_FRAME;
-#ifdef UAPSD_AP_SUPPORT
- else if (RTMP_GET_PACKET_EOSP(pPacket))
- TxFrameType = TX_LEGACY_FRAME;
-#endif // UAPSD_AP_SUPPORT //
else if((pMacEntry->TXBAbitmap & (1<<(RTMP_GET_PACKET_UP(pPacket)))) != 0)
return TX_AMPDU_FRAME;
else if(CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_AMSDU_INUSED))
@@ -799,12 +617,6 @@ BOOLEAN RTMP_FillTxBlkInfo(
{
pTxBlk->pMacEntry = NULL;
{
-#ifdef MCAST_RATE_SPECIFIC
- PUCHAR pDA = GET_OS_PKT_DATAPTR(pPacket);
- if (((*pDA & 0x01) == 0x01) && (*pDA != 0xff))
- pTxBlk->pTransmit = &pAd->CommonCfg.MCastPhyMode;
- else
-#endif // MCAST_RATE_SPECIFIC //
pTxBlk->pTransmit = &pAd->MacTab.Content[MCAST_WCID].HTPhyMode;
}
@@ -832,16 +644,25 @@ BOOLEAN RTMP_FillTxBlkInfo(
else
TX_BLK_SET_FLAG(pTxBlk, fTX_bAckRequired);
+ if ((pAd->OpMode == OPMODE_STA) &&
+ (ADHOC_ON(pAd)) &&
+ (RX_FILTER_TEST_FLAG(pAd, fRX_FILTER_ACCEPT_PROMISCUOUS)))
{
+ if(pAd->CommonCfg.PSPXlink)
+ TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bAckRequired);
+ }
+
+ {
+ {
+
// If support WMM, enable it.
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
-#endif
-#ifdef RT2870
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))
-#endif
TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM);
+
+// if (pAd->StaCfg.bAutoTxRateSwitch)
+// TX_BLK_SET_FLAG(pTxBlk, fTX_AutoRateSwitch);
+ }
}
if (pTxBlk->TxFrameType == TX_LEGACY_FRAME)
@@ -871,12 +692,6 @@ BOOLEAN RTMP_FillTxBlkInfo(
{
TX_BLK_SET_FLAG(pTxBlk, fTX_bMoreData);
}
-#ifdef UAPSD_AP_SUPPORT
- if (RTMP_GET_PACKET_EOSP(pPacket))
- {
- TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM_UAPSD_EOSP);
- }
-#endif // UAPSD_AP_SUPPORT //
}
else if (pTxBlk->TxFrameType == TX_FRAG_FRAME)
{
@@ -896,7 +711,7 @@ BOOLEAN CanDoAggregateTransmit(
IN TX_BLK *pTxBlk)
{
- //printk("Check if can do aggregation! TxFrameType=%d!\n", pTxBlk->TxFrameType);
+ //DBGPRINT(RT_DEBUG_TRACE, ("Check if can do aggregation! TxFrameType=%d!\n", pTxBlk->TxFrameType));
if (RTMP_GET_PACKET_WCID(pPacket) == MCAST_WCID)
return FALSE;
@@ -922,6 +737,7 @@ BOOLEAN CanDoAggregateTransmit(
return TRUE;
else
return FALSE;
+
}
@@ -970,7 +786,6 @@ VOID RTMPDeQueuePacket(
if (QIdx == NUM_OF_TX_RING)
{
sQIdx = 0;
-//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
eQIdx = 3; // 4 ACs, start from 0.
}
else
@@ -982,7 +797,7 @@ VOID RTMPDeQueuePacket(
{
Count=0;
- RT28XX_START_DEQUEUE(pAd, QueIdx, IrqFlags);
+ RTMP_START_DEQUEUE(pAd, QueIdx, IrqFlags);
while (1)
@@ -993,7 +808,7 @@ VOID RTMPDeQueuePacket(
fRTMP_ADAPTER_HALT_IN_PROGRESS |
fRTMP_ADAPTER_NIC_NOT_EXIST))))
{
- RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
+ RTMP_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
return;
}
@@ -1006,7 +821,8 @@ VOID RTMPDeQueuePacket(
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
break;
}
-#ifdef RT2860
+
+#ifdef RTMP_MAC_PCI
FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
@@ -1016,7 +832,8 @@ VOID RTMPDeQueuePacket(
RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
}
-#endif /* RT2860 */
+#endif // RTMP_MAC_PCI //
+
// probe the Queue Head
pQueue = &pAd->TxSwQueue[QueIdx];
if ((pEntry = pQueue->Head) == NULL)
@@ -1027,12 +844,14 @@ VOID RTMPDeQueuePacket(
pTxBlk = &TxBlk;
NdisZeroMemory((PUCHAR)pTxBlk, sizeof(TX_BLK));
+ //InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it.
pTxBlk->QueIdx = QueIdx;
- pPacket = QUEUE_ENTRY_TO_PKT(pEntry);
+ pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
+
// Early check to make sure we have enoguh Tx Resource.
- hasTxDesc = RT28XX_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
+ hasTxDesc = RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
if (!hasTxDesc)
{
pAd->PrivateInfo.TxRingFullCnt++;
@@ -1065,16 +884,16 @@ VOID RTMPDeQueuePacket(
break;
// For TX_AMSDU_FRAME/TX_RALINK_FRAME, Need to check if next pakcet can do aggregation.
- pPacket = QUEUE_ENTRY_TO_PKT(pEntry);
+ pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
- hasTxDesc = RT28XX_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
+ hasTxDesc = RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
if ((hasTxDesc == FALSE) || (CanDoAggregateTransmit(pAd, pPacket, pTxBlk) == FALSE))
break;
//Remove the packet from the TxSwQueue and insert into pTxBlk
pEntry = RemoveHeadQueue(pQueue);
ASSERT(pEntry);
- pPacket = QUEUE_ENTRY_TO_PKT(pEntry);
+ pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
pTxBlk->TotalFrameNum++;
pTxBlk->TotalFragNum += RTMP_GET_PACKET_FRAGMENTS(pPacket); // The real fragment number maybe vary
pTxBlk->TotalFrameLen += GET_OS_PKT_LEN(pPacket);
@@ -1085,29 +904,29 @@ VOID RTMPDeQueuePacket(
pTxBlk->TxFrameType = TX_LEGACY_FRAME;
}
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
-#endif // RT2870 //
-
+#endif // RTMP_MAC_USB //
Count += pTxBlk->TxPacketList.Number;
// Do HardTransmit now.
Status = STAHardTransmit(pAd, pTxBlk, QueIdx);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
// static rate also need NICUpdateFifoStaCounters() function.
//if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
NICUpdateFifoStaCounters(pAd);
-#endif
+#endif // RTMP_MAC_PCI //
+
}
- RT28XX_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
+ RTMP_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
if (!hasTxDesc)
RTUSBKickBulkOut(pAd);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
}
}
@@ -1243,9 +1062,16 @@ VOID RTMPWriteTxWI(
pTxWI->NSEQ = NSeq;
// John tune the performace with Intel Client in 20 MHz performance
BASize = pAd->CommonCfg.TxBASize;
-
+ if (pAd->MACVersion == 0x28720200)
+ {
+ if( BASize >13 )
+ BASize =13;
+ }
+ else
+ {
if( BASize >7 )
BASize =7;
+ }
pTxWI->BAWinSize = BASize;
pTxWI->ShortGI = pTransmit->field.ShortGI;
pTxWI->STBC = pTransmit->field.STBC;
@@ -1387,7 +1213,7 @@ VOID RTMPWriteTxWI_Cache(
IN OUT PTXWI_STRUC pTxWI,
IN TX_BLK *pTxBlk)
{
- PHTTRANSMIT_SETTING pTransmit;
+ PHTTRANSMIT_SETTING /*pTxHTPhyMode,*/ pTransmit;
PMAC_TABLE_ENTRY pMacEntry;
//
@@ -1396,6 +1222,9 @@ VOID RTMPWriteTxWI_Cache(
pMacEntry = pTxBlk->pMacEntry;
pTransmit = pTxBlk->pTransmit;
+ //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
+ //if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pMacEntry))
+ //if (TX_BLK_TEST_FLAG(pTxBlk, fTX_AutoRateSwitch))
if (pMacEntry->bAutoTxRateSwitch)
{
pTxWI->txop = IFS_HTTXOP;
@@ -1440,53 +1269,6 @@ VOID RTMPWriteTxWI_Cache(
}
-/*
- ========================================================================
-
- Routine Description:
- Calculates the duration which is required to transmit out frames
- with given size and specified rate.
-
- Arguments:
- pTxD Pointer to transmit descriptor
- Ack Setting for Ack requirement bit
- Fragment Setting for Fragment bit
- RetryMode Setting for retry mode
- Ifs Setting for IFS gap
- Rate Setting for transmit rate
- Service Setting for service
- Length Frame length
- TxPreamble Short or Long preamble when using CCK rates
- QueIdx - 0-3, according to 802.11e/d4.4 June/2003
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID RTMPWriteTxDescriptor(
- IN PRTMP_ADAPTER pAd,
- IN PTXD_STRUC pTxD,
- IN BOOLEAN bWIV,
- IN UCHAR QueueSEL)
-{
- //
- // Always use Long preamble before verifiation short preamble functionality works well.
- // Todo: remove the following line if short preamble functionality works
- //
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
-
- pTxD->WIV = (bWIV) ? 1: 0;
- pTxD->QSEL= (QueueSEL);
- if (pAd->bGenOneHCCA == TRUE)
- pTxD->QSEL= FIFO_HCCA;
- pTxD->DMADONE = 0;
-}
-
-
// should be called only when -
// 1. MEADIA_CONNECTED
// 2. AGGREGATION_IN_USED
@@ -1582,12 +1364,14 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(
{
ULONG Number;
+ // 2004-11-15 to be removed. test aggregation only
+// if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2))
+// return NULL;
Number = pAd->TxSwQueue[QID_AC_BK].Number
+ pAd->TxSwQueue[QID_AC_BE].Number
+ pAd->TxSwQueue[QID_AC_VI].Number
- + pAd->TxSwQueue[QID_AC_VO].Number
- + pAd->TxSwQueue[QID_HCCA].Number;
+ + pAd->TxSwQueue[QID_AC_VO].Number;
if (pAd->TxSwQueue[QID_AC_VO].Head != NULL)
{
@@ -1609,11 +1393,6 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(
*pQueIdx = QID_AC_BK;
return (&pAd->TxSwQueue[QID_AC_BK]);
}
- else if (pAd->TxSwQueue[QID_HCCA].Head != NULL)
- {
- *pQueIdx = QID_HCCA;
- return (&pAd->TxSwQueue[QID_HCCA]);
- }
// No packet pending in Tx Sw queue
*pQueIdx = QID_AC_BK;
@@ -1621,277 +1400,6 @@ PQUEUE_HEADER RTMPCheckTxSwQueue(
return (NULL);
}
-#ifdef RT2860
-BOOLEAN RTMPFreeTXDUponTxDmaDone(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx)
-{
- PRTMP_TX_RING pTxRing;
- PTXD_STRUC pTxD;
- PNDIS_PACKET pPacket;
- UCHAR FREE = 0;
- TXD_STRUC TxD, *pOriTxD;
- //ULONG IrqFlags;
- BOOLEAN bReschedule = FALSE;
-
-
- ASSERT(QueIdx < NUM_OF_TX_RING);
- pTxRing = &pAd->TxRing[QueIdx];
-
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QueIdx * RINGREG_DIFF, &pTxRing->TxDmaIdx);
- while (pTxRing->TxSwFreeIdx != pTxRing->TxDmaIdx)
- {
- // static rate also need NICUpdateFifoStaCounters() function.
- //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
- NICUpdateFifoStaCounters(pAd);
-
- /* Note : If (pAd->ate.bQATxStart == TRUE), we will never reach here. */
- FREE++;
- pTxD = (PTXD_STRUC) (pTxRing->Cell[pTxRing->TxSwFreeIdx].AllocVa);
- pOriTxD = pTxD;
- NdisMoveMemory(&TxD, pTxD, sizeof(TXD_STRUC));
- pTxD = &TxD;
-
- pTxD->DMADONE = 0;
-
-/*====================================================================*/
- {
- pPacket = pTxRing->Cell[pTxRing->TxSwFreeIdx].pNdisPacket;
- if (pPacket)
- {
-#ifdef CONFIG_5VT_ENHANCE
- if (RTMP_GET_PACKET_5VT(pPacket))
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, 16, PCI_DMA_TODEVICE);
- else
-#endif // CONFIG_5VT_ENHANCE //
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- //Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[pTxRing->TxSwFreeIdx].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[pTxRing->TxSwFreeIdx].pNextNdisPacket;
-
- ASSERT(pPacket == NULL);
- if (pPacket)
- {
-#ifdef CONFIG_5VT_ENHANCE
- if (RTMP_GET_PACKET_5VT(pPacket))
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, 16, PCI_DMA_TODEVICE);
- else
-#endif // CONFIG_5VT_ENHANCE //
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- //Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[pTxRing->TxSwFreeIdx].pNextNdisPacket = NULL;
- }
-/*====================================================================*/
-
- pAd->RalinkCounters.TransmittedByteCount += (pTxD->SDLen1 + pTxD->SDLen0);
- pAd->RalinkCounters.OneSecDmaDoneCount[QueIdx] ++;
- INC_RING_INDEX(pTxRing->TxSwFreeIdx, TX_RING_SIZE);
- /* get tx_tdx_idx again */
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QueIdx * RINGREG_DIFF , &pTxRing->TxDmaIdx);
-
- NdisMoveMemory(pOriTxD, pTxD, sizeof(TXD_STRUC));
- }
-
-
- return bReschedule;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Process TX Rings DMA Done interrupt, running in DPC level
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(
- IN PRTMP_ADAPTER pAd,
- IN INT_SOURCE_CSR_STRUC TxRingBitmap)
-{
- unsigned long IrqFlags;
- BOOLEAN bReschedule = FALSE;
-
- // Make sure Tx ring resource won't be used by other threads
-
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
-
- if (TxRingBitmap.field.Ac0DmaDone)
- bReschedule = RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_BE);
-
- if (TxRingBitmap.field.HccaDmaDone)
- bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_HCCA);
-
- if (TxRingBitmap.field.Ac3DmaDone)
- bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_VO);
-
- if (TxRingBitmap.field.Ac2DmaDone)
- bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_VI);
-
- if (TxRingBitmap.field.Ac1DmaDone)
- bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_BK);
-
- // Make sure to release Tx ring resource
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
-
- // Dequeue outgoing frames from TxSwQueue[] and process it
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
-
- return bReschedule;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Process MGMT ring DMA done interrupt, running in DPC level
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPHandleMgmtRingDmaDoneInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- PTXD_STRUC pTxD;
- PNDIS_PACKET pPacket;
- UCHAR FREE = 0;
- PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing;
-
- NdisAcquireSpinLock(&pAd->MgmtRingLock);
-
- RTMP_IO_READ32(pAd, TX_MGMTDTX_IDX, &pMgmtRing->TxDmaIdx);
- while (pMgmtRing->TxSwFreeIdx!= pMgmtRing->TxDmaIdx)
- {
- FREE++;
- pTxD = (PTXD_STRUC) (pMgmtRing->Cell[pAd->MgmtRing.TxSwFreeIdx].AllocVa);
- pTxD->DMADONE = 0;
- pPacket = pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNdisPacket;
-
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNdisPacket = NULL;
-
- pPacket = pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNextNdisPacket;
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
- pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNextNdisPacket = NULL;
- INC_RING_INDEX(pMgmtRing->TxSwFreeIdx, MGMT_RING_SIZE);
- }
- NdisReleaseSpinLock(&pAd->MgmtRingLock);
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Arguments:
- Adapter Pointer to our adapter. Dequeue all power safe delayed braodcast frames after beacon.
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID RTMPHandleTBTTInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- {
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- }
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Arguments:
- Adapter Pointer to our adapter. Rewrite beacon content before next send-out.
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID RTMPHandlePreTBTTInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- {
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPHandlePreTBTTInterrupt...\n"));
- }
- }
-
-
-}
-
-VOID RTMPHandleRxCoherentInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- WPDMA_GLO_CFG_STRUC GloCfg;
-
- if (pAd == NULL)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("====> pAd is NULL, return.\n"));
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPHandleRxCoherentInterrupt \n"));
-
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG , &GloCfg.word);
-
- GloCfg.field.EnTXWriteBackDDONE = 0;
- GloCfg.field.EnableRxDMA = 0;
- GloCfg.field.EnableTxDMA = 0;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-
- RTMPRingCleanUp(pAd, QID_AC_BE);
- RTMPRingCleanUp(pAd, QID_AC_BK);
- RTMPRingCleanUp(pAd, QID_AC_VI);
- RTMPRingCleanUp(pAd, QID_AC_VO);
- RTMPRingCleanUp(pAd, QID_HCCA);
- RTMPRingCleanUp(pAd, QID_MGMT);
- RTMPRingCleanUp(pAd, QID_RX);
-
- RTMPEnableRxTx(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== RTMPHandleRxCoherentInterrupt \n"));
-}
-#endif /* RT2860 */
/*
========================================================================
@@ -1922,9 +1430,11 @@ VOID RTMPSuspendMsduTransmission(
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue);
// set BBP_R66 to 0x30/0x40 when scanning (AsicSwitchChannel will set R66 according to channel when scanning)
+ //RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, (0x26 + GET_LNA_GAIN(pAd)));
RTMPSetAGCInitValue(pAd, BW_20);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
+ //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x000f0000); // abort all TX rings
}
@@ -1949,8 +1459,11 @@ VOID RTMPSuspendMsduTransmission(
VOID RTMPResumeMsduTransmission(
IN PRTMP_ADAPTER pAd)
{
+// UCHAR IrqState;
+
DBGPRINT(RT_DEBUG_TRACE,("SCAN done, resume MSDU transmission ...\n"));
+
// After finish BSS_SCAN_IN_PROGRESS, we need to restore Current R66 value
// R66 should not be 0
if (pAd->BbpTuning.R66CurrentValue == 0)
@@ -1962,6 +1475,11 @@ VOID RTMPResumeMsduTransmission(
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, pAd->BbpTuning.R66CurrentValue);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
+// sample, for IRQ LOCK to SEM LOCK
+// IrqState = pAd->irq_disabled;
+// if (IrqState)
+// RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
+// else
RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
}
@@ -1990,7 +1508,9 @@ UINT deaggregate_AMSDU_announce(
nMSDU++;
+ //hex_dump("subheader", pData, 64);
pAMSDUsubheader = (PHEADER_802_3)pData;
+ //pData += LENGTH_802_3;
PayloadSize = pAMSDUsubheader->Octet[1] + (pAMSDUsubheader->Octet[0]<<8);
SubFrameSize = PayloadSize + LENGTH_802_3;
@@ -2000,6 +1520,8 @@ UINT deaggregate_AMSDU_announce(
break;
}
+ //DBGPRINT(RT_DEBUG_TRACE,("%d subframe: Size = %d\n", nMSDU, PayloadSize));
+
pPayload = pData + LENGTH_802_3;
pDA = pData;
pSA = pData + MAC_ADDR_LEN;
@@ -2009,15 +1531,17 @@ UINT deaggregate_AMSDU_announce(
if ((Header802_3[12] == 0x88) && (Header802_3[13] == 0x8E) )
{
- // avoid local heap overflow, use dyanamic allocation
+ /* avoid local heap overflow, use dyanamic allocation */
MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem == NULL)
- return;
+ if (Elem != NULL)
+ {
memmove(Elem->Msg+(LENGTH_802_11 + LENGTH_802_1_H), pPayload, PayloadSize);
Elem->MsgLen = LENGTH_802_11 + LENGTH_802_1_H + PayloadSize;
- WpaEAPOLKeyAction(pAd, Elem);
+ //WpaEAPOLKeyAction(pAd, Elem);
+ REPORT_MGMT_FRAME_TO_MLME(pAd, BSSID_WCID, Elem->Msg, Elem->MsgLen, 0, 0, 0, 0);
kfree(Elem);
}
+ }
{
if (pRemovedLLCSNAP)
@@ -2121,6 +1645,8 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(
UCHAR HashIdx;
int i, FirstWcid;
MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
+// USHORT offset;
+// ULONG addr;
// if FULL, return
if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
@@ -2183,22 +1709,15 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(
pEntry->AuthMode = pAd->StaCfg.AuthMode;
pEntry->WepStatus = pAd->StaCfg.WepStatus;
pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)i);
-#endif
+#endif // RTMP_MAC_PCI //
}
}
pEntry->GTKState = REKEY_NEGOTIATING;
pEntry->PairwiseKey.KeyLen = 0;
pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
-
-#ifdef RT2860
- if ((pAd->OpMode == OPMODE_STA) &&
- (pAd->StaCfg.BssType == BSS_ADHOC))
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- else
-#endif
pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
pEntry->PMKID_CacheIdx = ENTRY_NOT_FOUND;
@@ -2210,13 +1729,14 @@ MAC_TABLE_ENTRY *MacTableInsertEntry(
pEntry->PsMode = PWR_ACTIVE;
pEntry->PsQIdleCount = 0;
pEntry->NoDataIdleCount = 0;
+ pEntry->AssocDeadLine = MAC_TABLE_ASSOC_TIMEOUT;
pEntry->ContinueTxFailCnt = 0;
InitializeQueueHeader(&pEntry->PsQueue);
pAd->MacTab.Size ++;
// Add this entry into ASIC RX WCID search table
- RT28XX_STA_ENTRY_ADD(pAd, pEntry);
+ RTMP_STA_ENTRY_ADD(pAd, pEntry);
@@ -2260,6 +1780,8 @@ BOOLEAN MacTableDeleteEntry(
USHORT HashIdx;
MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry;
BOOLEAN Cancelled;
+ //USHORT offset; // unused variable
+ //UCHAR j; // unused variable
if (wcid >= MAX_LEN_OF_MAC_TABLE)
return FALSE;
@@ -2267,6 +1789,7 @@ BOOLEAN MacTableDeleteEntry(
NdisAcquireSpinLock(&pAd->MacTabLock);
HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
+ //pEntry = pAd->MacTab.Hash[HashIdx];
pEntry = &pAd->MacTab.Content[wcid];
if (pEntry && (pEntry->ValidAsCLI || pEntry->ValidAsApCli || pEntry->ValidAsWDS || pEntry->ValidAsMesh
@@ -2276,7 +1799,7 @@ BOOLEAN MacTableDeleteEntry(
{
// Delete this entry from ASIC on-chip WCID Table
- RT28XX_STA_ENTRY_MAC_RESET(pAd, wcid);
+ RTMP_STA_ENTRY_MAC_RESET(pAd, wcid);
// free resources of BA
BASessionTearDownALL(pAd, pEntry->Aid);
@@ -2308,7 +1831,7 @@ BOOLEAN MacTableDeleteEntry(
// not found !!!
ASSERT(pProbeEntry != NULL);
- RT28XX_STA_ENTRY_KEY_DEL(pAd, BSS0, wcid);
+ RTMP_STA_ENTRY_KEY_DEL(pAd, BSS0, wcid);
if (pEntry->EnqueueEapolStartTimerRunning != EAPOL_START_DISABLE)
@@ -2324,7 +1847,7 @@ BOOLEAN MacTableDeleteEntry(
}
else
{
- printk("\n%s: Impossible Wcid = %d !!!!!\n", __func__, wcid);
+ DBGPRINT(RT_DEBUG_OFF, ("\n%s: Impossible Wcid = %d !!!!!\n", __func__, wcid));
}
}
@@ -2334,13 +1857,8 @@ BOOLEAN MacTableDeleteEntry(
if (pAd->MacTab.Size == 0)
{
pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode = 0;
-#ifdef RT2860
- AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/);
-#else
- // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
- // Set MAC register value according operation mode
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_UPDATE_PROTECT, NULL, 0);
-#endif
+ //AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/);
+ RTMP_UPDATE_PROTECT(pAd); // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
}
return TRUE;
@@ -2362,24 +1880,25 @@ VOID MacTableReset(
DBGPRINT(RT_DEBUG_TRACE, ("MacTableReset\n"));
//NdisAcquireSpinLock(&pAd->MacTabLock);
+
for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
{
-#ifdef RT2860
- RT28XX_STA_ENTRY_MAC_RESET(pAd, i);
-#endif
+#ifdef RTMP_MAC_PCI
+ RTMP_STA_ENTRY_MAC_RESET(pAd, i);
+#endif // RTMP_MAC_PCI //
if (pAd->MacTab.Content[i].ValidAsCLI == TRUE)
{
+
+
// free resources of BA
BASessionTearDownALL(pAd, i);
pAd->MacTab.Content[i].ValidAsCLI = FALSE;
-
-
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
NdisZeroMemory(pAd->MacTab.Content[i].Addr, 6);
- RT28XX_STA_ENTRY_MAC_RESET(pAd, i);
-#endif // RT2870 //
+ RTMP_STA_ENTRY_MAC_RESET(pAd, i);
+#endif // RTMP_MAC_USB //
//AsicDelWcidTab(pAd, i);
}
@@ -2544,7 +2063,7 @@ BOOLEAN RTMPCheckEtherType(
RTMP_SET_PACKET_SPECIFIC(pPacket, 0);
// get Ethernet protocol field
- TypeLen = (pSrcBuf[12] << 8) + pSrcBuf[13];
+ TypeLen = (pSrcBuf[12] << 8) | pSrcBuf[13];
pSrcBuf += LENGTH_802_3; // Skip the Ethernet Header.
@@ -2558,7 +2077,7 @@ BOOLEAN RTMPCheckEtherType(
*/
if (pSrcBuf[0] == 0xAA && pSrcBuf[1] == 0xAA && pSrcBuf[2] == 0x03)
{
- Sniff2BytesFromNdisBuffer(pSrcBuf, 6, &Byte0, &Byte1);
+ Sniff2BytesFromNdisBuffer((PNDIS_BUFFER)pSrcBuf, 6, &Byte0, &Byte1);
RTMP_SET_PACKET_LLCSNAP(pPacket, 1);
TypeLen = (USHORT)((Byte0 << 8) + Byte1);
pSrcBuf += 8; // Skip this LLC/SNAP header
@@ -2584,7 +2103,7 @@ BOOLEAN RTMPCheckEtherType(
Frame Check Sequence (4-bytes) */
RTMP_SET_PACKET_VLAN(pPacket, 1);
- Sniff2BytesFromNdisBuffer(pSrcBuf, 2, &Byte0, &Byte1);
+ Sniff2BytesFromNdisBuffer((PNDIS_BUFFER)pSrcBuf, 2, &Byte0, &Byte1);
TypeLen = (USHORT)((Byte0 << 8) + Byte1);
pSrcBuf += 4; // Skip the VLAN Header.
@@ -2600,8 +2119,8 @@ BOOLEAN RTMPCheckEtherType(
ASSERT((pktLen > 34)); // 14 for ethernet header, 20 for IP header
pSrcBuf += 20; // Skip the IP header
- srcPort = OS_NTOHS(*((UINT16 *)pSrcBuf));
- dstPort = OS_NTOHS(*((UINT16 *)(pSrcBuf +2)));
+ srcPort = OS_NTOHS(get_unaligned((PUINT16)(pSrcBuf)));
+ dstPort = OS_NTOHS(get_unaligned((PUINT16)(pSrcBuf+2)));
if ((srcPort==0x44 && dstPort==0x43) || (srcPort==0x43 && dstPort==0x44))
{ //It's a BOOTP/DHCP packet
@@ -2692,7 +2211,7 @@ VOID Indicate_Legacy_Packet(
STATS_INC_RX_PACKETS(pAd, FromWhichBSSID);
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
if (pAd->CommonCfg.bDisableReordering == 0)
{
PBA_REC_ENTRY pBAEntry;
@@ -2701,7 +2220,7 @@ VOID Indicate_Legacy_Packet(
UCHAR TID = pRxBlk->pRxWI->TID;
USHORT Idx;
-#define REORDERING_PACKET_TIMEOUT ((100 * HZ)/1000) // system ticks -- 100 ms
+#define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) // system ticks -- 100 ms
if (Wcid < MAX_LEN_OF_MAC_TABLE)
{
@@ -2715,14 +2234,15 @@ VOID Indicate_Legacy_Packet(
RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(REORDERING_PACKET_TIMEOUT)))
)
{
- printk("Indicate_Legacy_Packet():flush reordering_timeout_mpdus! RxWI->Flags=%d, pRxWI.TID=%d, RxD->AMPDU=%d!\n", pRxBlk->Flags, pRxBlk->pRxWI->TID, pRxBlk->RxD.AMPDU);
+ DBGPRINT(RT_DEBUG_OFF, ("Indicate_Legacy_Packet():flush reordering_timeout_mpdus! RxWI->Flags=%d, pRxWI.TID=%d, RxD->AMPDU=%d!\n",
+ pRxBlk->Flags, pRxBlk->pRxWI->TID, pRxBlk->RxD.AMPDU));
hex_dump("Dump the legacy Packet:", GET_OS_PKT_DATAPTR(pRxBlk->pRxPacket), 64);
ba_flush_reordering_timeout_mpdus(pAd, pBAEntry, Now32);
}
}
}
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID);
diff --git a/drivers/staging/rt3090/common/cmm_data_pci.c b/drivers/staging/rt2860/common/cmm_data_pci.c
index 084f81927158..e9739b45ba37 100644
--- a/drivers/staging/rt3090/common/cmm_data_pci.c
+++ b/drivers/staging/rt2860/common/cmm_data_pci.c
@@ -23,14 +23,14 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
-*/
+ */
/*
All functions in this file must be PCI-depended, or you should out your function
in other files.
*/
-#include "../rt_config.h"
+#include "../rt_config.h"
USHORT RtmpPCI_WriteTxResource(
@@ -110,10 +110,6 @@ USHORT RtmpPCI_WriteSingleTxResource(
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
UINT32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHeaderLen;
@@ -138,13 +134,7 @@ USHORT RtmpPCI_WriteSingleTxResource(
//
// build Tx Descriptor
//
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
-#endif
NdisZeroMemory(pTxD, TXD_SIZE);
pTxD->SDPtr0 = BufBasePaLow;
@@ -155,12 +145,6 @@ USHORT RtmpPCI_WriteSingleTxResource(
pTxD->LastSec1 = (bIsLast) ? 1 : 0;
RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)(pDMAHeaderBufVA + TXINFO_SIZE), TYPE_TXWI);
- RTMPFrameEndianChange(pAd, (PUCHAR)(pDMAHeaderBufVA + TXINFO_SIZE + TXWI_SIZE), DIR_WRITE, FALSE);
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif // RT_BIG_ENDIAN //
RetTxIdx = TxIdx;
//
@@ -185,10 +169,6 @@ USHORT RtmpPCI_WriteMultiTxResource(
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
UINT32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHdrLen;
@@ -232,13 +212,7 @@ USHORT RtmpPCI_WriteMultiTxResource(
//
// build Tx Descriptor
//
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
-#endif
NdisZeroMemory(pTxD, TXD_SIZE);
pTxD->SDPtr0 = BufBasePaLow;
@@ -250,16 +224,6 @@ USHORT RtmpPCI_WriteMultiTxResource(
RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
-#ifdef RT_BIG_ENDIAN
- if (frameNum == 0)
- RTMPFrameEndianChange(pAd, (PUCHAR)(pDMAHeaderBufVA+ TXINFO_SIZE + TXWI_SIZE), DIR_WRITE, FALSE);
-
- if (frameNum != 0)
- RTMPWIEndianChange((PUCHAR)(pDMAHeaderBufVA + TXINFO_SIZE), TYPE_TXWI);
-
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif // RT_BIG_ENDIAN //
RetTxIdx = TxIdx;
//
@@ -291,9 +255,6 @@ VOID RtmpPCI_FinalWriteTxResource(
pTxRing = &pAd->TxRing[pTxBlk->QueIdx];
pTxWI = (PTXWI_STRUC) pTxRing->Cell[FirstTxIdx].DmaBuf.AllocVa;
pTxWI->MPDUtotalByteCount = totalMPDUSize;
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)pTxWI, TYPE_TXWI);
-#endif // RT_BIG_ENDIAN //
}
@@ -304,10 +265,6 @@ VOID RtmpPCIDataLastTxIdx(
IN USHORT LastTxIdx)
{
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
PRTMP_TX_RING pTxRing;
//
@@ -318,20 +275,10 @@ VOID RtmpPCIDataLastTxIdx(
//
// build Tx Descriptor
//
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) pTxRing->Cell[LastTxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC) pTxRing->Cell[LastTxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
-#endif
pTxD->LastSec1 = 1;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif // RT_BIG_ENDIAN //
}
@@ -345,10 +292,6 @@ USHORT RtmpPCI_WriteFragTxResource(
UCHAR *pDMAHeaderBufVA;
USHORT TxIdx, RetTxIdx;
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
UINT32 BufBasePaLow;
PRTMP_TX_RING pTxRing;
USHORT hwHeaderLen;
@@ -375,13 +318,7 @@ USHORT RtmpPCI_WriteFragTxResource(
//
// Build Tx Descriptor
//
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
-#endif
NdisZeroMemory(pTxD, TXD_SIZE);
if (fragNum == pTxBlk->TotalFragNum)
@@ -399,12 +336,6 @@ USHORT RtmpPCI_WriteFragTxResource(
RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)(pDMAHeaderBufVA + TXINFO_SIZE), TYPE_TXWI);
- RTMPFrameEndianChange(pAd, (PUCHAR)(pDMAHeaderBufVA + TXINFO_SIZE + TXWI_SIZE), DIR_WRITE, FALSE);
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif // RT_BIG_ENDIAN //
RetTxIdx = TxIdx;
pTxBlk->Priv += pTxBlk->SrcBufLen;
@@ -434,20 +365,9 @@ int RtmpPCIMgmtKickOut(
IN UINT SrcBufLen)
{
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
ULONG SwIdx = pAd->MgmtRing.TxCpuIdx;
-#ifdef RT_BIG_ENDIAN
- pDestTxD = (PTXD_STRUC)pAd->MgmtRing.Cell[SwIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#else
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[SwIdx].AllocVa;
-#endif
pAd->MgmtRing.Cell[SwIdx].pNdisPacket = pPacket;
pAd->MgmtRing.Cell[SwIdx].pNextNdisPacket = NULL;
@@ -460,10 +380,6 @@ int RtmpPCIMgmtKickOut(
pTxD->SDPtr0 = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);
pTxD->SDLen0 = SrcBufLen;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
//==================================================================
/* DBGPRINT_RAW(RT_DEBUG_TRACE, ("MLMEHardTransmit\n"));
@@ -491,7 +407,6 @@ int RtmpPCIMgmtKickOut(
}
-#ifdef CONFIG_STA_SUPPORT
/*
========================================================================
@@ -588,12 +503,10 @@ NDIS_STATUS RTMPCheckRxError(
if (pRxD->CipherErr == 2)
{
pWpaKey = &pAd->SharedKey[BSS0][pRxWI->KeyIndex];
-#ifdef WPA_SUPPLICANT_SUPPORT
if (pAd->StaCfg.WpaSupplicantUP)
WpaSendMicFailureToWpaSupplicant(pAd,
(pWpaKey->Type == PAIRWISEKEY) ? TRUE:FALSE);
else
-#endif // WPA_SUPPLICANT_SUPPORT //
RTMPReportMicError(pAd, pWpaKey);
if (((pRxD->CipherErr & 2) == 2) && pAd->CommonCfg.bWirelessEvent && INFRA_ON(pAd))
@@ -618,7 +531,6 @@ NDIS_STATUS RTMPCheckRxError(
return(NDIS_STATUS_SUCCESS);
}
-#endif // CONFIG_STA_SUPPORT //
BOOLEAN RTMPFreeTXDUponTxDmaDone(
@@ -627,9 +539,6 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(
{
PRTMP_TX_RING pTxRing;
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
-#endif
PNDIS_PACKET pPacket;
UCHAR FREE = 0;
TXD_STRUC TxD, *pOriTxD;
@@ -644,87 +553,6 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(
while (pTxRing->TxSwFreeIdx != pTxRing->TxDmaIdx)
{
// RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
-#ifdef RALINK_ATE
-#ifdef RALINK_28xx_QA
- PHEADER_802_11 pHeader80211;
-
- if ((ATE_ON(pAd)) && (pAd->ate.bQATxStart == TRUE))
- {
- if (pAd->ate.QID == QueIdx)
- {
- pAd->ate.TxDoneCount++;
- pAd->RalinkCounters.KickTxCount++;
-
- /* always use QID_AC_BE and FIFO_EDCA */
- ASSERT(pAd->ate.QID == 0);
- pAd->ate.TxAc0++;
-
- FREE++;
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC) (pTxRing->Cell[pTxRing->TxSwFreeIdx].AllocVa);
- pOriTxD = pTxD;
- NdisMoveMemory(&TxD, pTxD, sizeof(TXD_STRUC));
- pTxD = &TxD;
-#else
- pDestTxD = (PTXD_STRUC) (pTxRing->Cell[pTxRing->TxSwFreeIdx].AllocVa);
- pOriTxD = pDestTxD ;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- pTxD->DMADONE = 0;
-
- pHeader80211 = pTxRing->Cell[pTxRing->TxSwFreeIdx].DmaBuf.AllocVa + sizeof(TXWI_STRUC);
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pHeader80211, DIR_READ, FALSE);
-#endif
- pHeader80211->Sequence = ++pAd->ate.seq;
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pHeader80211, DIR_WRITE, FALSE);
-#endif
-
- if ((pAd->ate.bQATxStart == TRUE) && (pAd->ate.Mode & ATE_TXFRAME) && (pAd->ate.TxDoneCount < pAd->ate.TxCount))
- {
- pAd->RalinkCounters.TransmittedByteCount += (pTxD->SDLen1 + pTxD->SDLen0);
- pAd->RalinkCounters.OneSecTransmittedByteCount += (pTxD->SDLen1 + pTxD->SDLen0);
- pAd->RalinkCounters.OneSecDmaDoneCount[QueIdx] ++;
- INC_RING_INDEX(pTxRing->TxSwFreeIdx, TX_RING_SIZE);
-
- /* get TX_DTX_IDX again */
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QueIdx * RINGREG_DIFF , &pTxRing->TxDmaIdx);
- goto kick_out;
- }
- else if ((pAd->ate.TxStatus == 1)/* or (pAd->ate.bQATxStart == TRUE) ??? */ && (pAd->ate.TxDoneCount == pAd->ate.TxCount))
- {
- DBGPRINT(RT_DEBUG_TRACE,("all Tx is done\n"));
-
- // Tx status enters idle mode.
- pAd->ate.TxStatus = 0;
- }
- else if (!(pAd->ate.Mode & ATE_TXFRAME))
- {
- /* not complete sending yet, but someone press the Stop TX botton */
- DBGPRINT(RT_DEBUG_ERROR,("not complete sending yet, but someone pressed the Stop TX bottom\n"));
- DBGPRINT(RT_DEBUG_ERROR,("pAd->ate.Mode = 0x%02x\n", pAd->ate.Mode));
- }
- else
- {
- DBGPRINT(RT_DEBUG_OFF,("pTxRing->TxSwFreeIdx = %d\n", pTxRing->TxSwFreeIdx));
- }
-
-#ifndef RT_BIG_ENDIAN
- NdisMoveMemory(pOriTxD, pTxD, sizeof(TXD_STRUC));
-#else
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- *pDestTxD = TxD;
-#endif // RT_BIG_ENDIAN //
-
- INC_RING_INDEX(pTxRing->TxSwFreeIdx, TX_RING_SIZE);
- continue;
- }
- }
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
// static rate also need NICUpdateFifoStaCounters() function.
//if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
@@ -732,35 +560,18 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(
/* Note : If (pAd->ate.bQATxStart == TRUE), we will never reach here. */
FREE++;
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) (pTxRing->Cell[pTxRing->TxSwFreeIdx].AllocVa);
pOriTxD = pTxD;
NdisMoveMemory(&TxD, pTxD, sizeof(TXD_STRUC));
pTxD = &TxD;
-#else
- pDestTxD = (PTXD_STRUC) (pTxRing->Cell[pTxRing->TxSwFreeIdx].AllocVa);
- pOriTxD = pDestTxD ;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
pTxD->DMADONE = 0;
-#ifdef RALINK_ATE
- /* Execution of this block is not allowed when ATE is running. */
- if (!(ATE_ON(pAd)))
-#endif // RALINK_ATE //
{
pPacket = pTxRing->Cell[pTxRing->TxSwFreeIdx].pNdisPacket;
if (pPacket)
{
-#ifdef CONFIG_5VT_ENHANCE
- if (RTMP_GET_PACKET_5VT(pPacket))
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, 16, PCI_DMA_TODEVICE);
- else
-#endif // CONFIG_5VT_ENHANCE //
PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
}
@@ -772,11 +583,6 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(
ASSERT(pPacket == NULL);
if (pPacket)
{
-#ifdef CONFIG_5VT_ENHANCE
- if (RTMP_GET_PACKET_5VT(pPacket))
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, 16, PCI_DMA_TODEVICE);
- else
-#endif // CONFIG_5VT_ENHANCE //
PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
}
@@ -789,59 +595,8 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(
INC_RING_INDEX(pTxRing->TxSwFreeIdx, TX_RING_SIZE);
/* get tx_tdx_idx again */
RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QueIdx * RINGREG_DIFF , &pTxRing->TxDmaIdx);
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- *pDestTxD = TxD;
-#else
NdisMoveMemory(pOriTxD, pTxD, sizeof(TXD_STRUC));
-#endif
-
-#ifdef RALINK_ATE
-#ifdef RALINK_28xx_QA
-kick_out:
-#endif // RALINK_28xx_QA //
-
- /*
- ATE_TXCONT mode also need to send some normal frames, so let it in.
- ATE_STOP must be changed not to be 0xff
- to prevent it from running into this block.
- */
- if ((pAd->ate.Mode & ATE_TXFRAME) && (pAd->ate.QID == QueIdx))
- {
- // TxDoneCount++ has been done if QA is used.
- if (pAd->ate.bQATxStart == FALSE)
- {
- pAd->ate.TxDoneCount++;
- }
- if (((pAd->ate.TxCount - pAd->ate.TxDoneCount + 1) >= TX_RING_SIZE))
- {
- /* Note : We increase TxCpuIdx here, not TxSwFreeIdx ! */
- INC_RING_INDEX(pAd->TxRing[QueIdx].TxCpuIdx, TX_RING_SIZE);
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC) (pTxRing->Cell[pAd->TxRing[QueIdx].TxCpuIdx].AllocVa);
- pOriTxD = pTxD;
- NdisMoveMemory(&TxD, pTxD, sizeof(TXD_STRUC));
- pTxD = &TxD;
-#else
- pDestTxD = (PTXD_STRUC) (pTxRing->Cell[pAd->TxRing[QueIdx].TxCpuIdx].AllocVa);
- pOriTxD = pDestTxD ;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- pTxD->DMADONE = 0;
-#ifndef RT_BIG_ENDIAN
- NdisMoveMemory(pOriTxD, pTxD, sizeof(TXD_STRUC));
-#else
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- *pDestTxD = TxD;
-#endif
- // kick Tx-Ring
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QueIdx * RINGREG_DIFF, pAd->TxRing[QueIdx].TxCpuIdx);
- pAd->RalinkCounters.KickTxCount++;
- }
- }
-#endif // RALINK_ATE //
+
// RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
}
@@ -882,10 +637,6 @@ BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(
if (TxRingBitmap.field.Ac0DmaDone)
bReschedule = RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_BE);
-/*
- if (TxRingBitmap.field.HccaDmaDone)
- bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_HCCA);
-*/
if (TxRingBitmap.field.Ac3DmaDone)
bReschedule |= RTMPFreeTXDUponTxDmaDone(pAd, QID_AC_VO);
@@ -929,10 +680,6 @@ VOID RTMPHandleMgmtRingDmaDoneInterrupt(
IN PRTMP_ADAPTER pAd)
{
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
PNDIS_PACKET pPacket;
// int i;
UCHAR FREE = 0;
@@ -944,14 +691,7 @@ VOID RTMPHandleMgmtRingDmaDoneInterrupt(
while (pMgmtRing->TxSwFreeIdx!= pMgmtRing->TxDmaIdx)
{
FREE++;
-#ifdef RT_BIG_ENDIAN
- pDestTxD = (PTXD_STRUC) (pMgmtRing->Cell[pAd->MgmtRing.TxSwFreeIdx].AllocVa);
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#else
pTxD = (PTXD_STRUC) (pMgmtRing->Cell[pAd->MgmtRing.TxSwFreeIdx].AllocVa);
-#endif
pTxD->DMADONE = 0;
pPacket = pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNdisPacket;
@@ -972,15 +712,9 @@ VOID RTMPHandleMgmtRingDmaDoneInterrupt(
pMgmtRing->Cell[pMgmtRing->TxSwFreeIdx].pNextNdisPacket = NULL;
INC_RING_INDEX(pMgmtRing->TxSwFreeIdx, MGMT_RING_SIZE);
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, TRUE, TYPE_TXD);
-#endif
}
NdisReleaseSpinLock(&pAd->MgmtRingLock);
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
}
@@ -1054,7 +788,6 @@ VOID RTMPHandleRxCoherentInterrupt(
RTMPRingCleanUp(pAd, QID_AC_BK);
RTMPRingCleanUp(pAd, QID_AC_VI);
RTMPRingCleanUp(pAd, QID_AC_VO);
- /*RTMPRingCleanUp(pAd, QID_HCCA);*/
RTMPRingCleanUp(pAd, QID_MGMT);
RTMPRingCleanUp(pAd, QID_RX);
@@ -1063,125 +796,6 @@ VOID RTMPHandleRxCoherentInterrupt(
DBGPRINT(RT_DEBUG_TRACE, ("<== RTMPHandleRxCoherentInterrupt \n"));
}
-
-
-
-VOID DBGPRINT_TX_RING(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx)
-{
- UINT32 Ac0Base;
- UINT32 Ac0HwIdx = 0, Ac0SwIdx = 0, AC0freeIdx;
- int i;
-// PULONG pTxD;
- PULONG ptemp;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("=====================================================\n " ));
- switch (QueIdx)
- {
- case QID_AC_BE:
- RTMP_IO_READ32(pAd, TX_BASE_PTR0, &Ac0Base);
- RTMP_IO_READ32(pAd, TX_CTX_IDX0, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, TX_DTX_IDX0, &Ac0HwIdx);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_BE DESCRIPTOR \n " ));
- for (i=0;i<TX_RING_SIZE;i++)
- {
- ptemp= (PULONG)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
- break;
- case QID_AC_BK:
- RTMP_IO_READ32(pAd, TX_BASE_PTR1, &Ac0Base);
- RTMP_IO_READ32(pAd, TX_CTX_IDX1, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, TX_DTX_IDX1, &Ac0HwIdx);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_BK DESCRIPTOR \n " ));
- for (i=0;i<TX_RING_SIZE;i++)
- {
- ptemp= (PULONG)pAd->TxRing[QID_AC_BK].Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
- break;
- case QID_AC_VI:
- RTMP_IO_READ32(pAd, TX_BASE_PTR2, &Ac0Base);
- RTMP_IO_READ32(pAd, TX_CTX_IDX2, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, TX_DTX_IDX2, &Ac0HwIdx);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_VI DESCRIPTOR \n " ));
- for (i=0;i<TX_RING_SIZE;i++)
- {
- ptemp= (PULONG)pAd->TxRing[QID_AC_VI].Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
- break;
- case QID_AC_VO:
- RTMP_IO_READ32(pAd, TX_BASE_PTR3, &Ac0Base);
- RTMP_IO_READ32(pAd, TX_CTX_IDX3, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, TX_DTX_IDX3, &Ac0HwIdx);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("All QID_AC_VO DESCRIPTOR \n " ));
- for (i=0;i<TX_RING_SIZE;i++)
- {
- ptemp= (PULONG)pAd->TxRing[QID_AC_VO].Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
- break;
- case QID_MGMT:
- RTMP_IO_READ32(pAd, TX_BASE_PTR5, &Ac0Base);
- RTMP_IO_READ32(pAd, TX_CTX_IDX5, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, TX_DTX_IDX5, &Ac0HwIdx);
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" All QID_MGMT DESCRIPTOR \n " ));
- for (i=0;i<MGMT_RING_SIZE;i++)
- {
- ptemp= (PULONG)pAd->MgmtRing.Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08lx: %08lx: %08lx: %08lx\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" \n " ));
- break;
-
- default:
- DBGPRINT_ERR(("DBGPRINT_TX_RING(Ring %d) not supported\n", QueIdx));
- break;
- }
- AC0freeIdx = pAd->TxRing[QueIdx].TxSwFreeIdx;
-
- DBGPRINT(RT_DEBUG_TRACE,("TxRing%d, TX_DTX_IDX=%d, TX_CTX_IDX=%d\n", QueIdx, Ac0HwIdx, Ac0SwIdx));
- DBGPRINT_RAW(RT_DEBUG_TRACE,(" TxSwFreeIdx[%d]", AC0freeIdx));
- DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount));
-
-
-}
-
-
-VOID DBGPRINT_RX_RING(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 Ac0Base;
- UINT32 Ac0HwIdx = 0, Ac0SwIdx = 0, AC0freeIdx;
-// PULONG pTxD;
- int i;
- UINT32 *ptemp;
-// PRXD_STRUC pRxD;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("=====================================================\n " ));
- RTMP_IO_READ32(pAd, RX_BASE_PTR, &Ac0Base);
- RTMP_IO_READ32(pAd, RX_CRX_IDX, &Ac0SwIdx);
- RTMP_IO_READ32(pAd, RX_DRX_IDX, &Ac0HwIdx);
- AC0freeIdx = pAd->RxRing.RxSwReadIdx;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("All RX DSP \n " ));
- for (i=0;i<RX_RING_SIZE;i++)
- {
- ptemp = (UINT32 *)pAd->RxRing.Cell[i].AllocVa;
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("[%02d] %08x: %08x: %08x: %08x\n " , i, *ptemp,*(ptemp+1),*(ptemp+2),*(ptemp+3)));
- }
- DBGPRINT(RT_DEBUG_TRACE,("RxRing, RX_DRX_IDX=%d, RX_CRX_IDX=%d \n", Ac0HwIdx, Ac0SwIdx));
- DBGPRINT_RAW(RT_DEBUG_TRACE,(" RxSwReadIdx [%d]=", AC0freeIdx));
- DBGPRINT_RAW(RT_DEBUG_TRACE,(" pending-NDIS=%ld\n", pAd->RalinkCounters.PendingNdisPacketCount));
-}
-
-
PNDIS_PACKET GetPacketFromRxRing(
IN PRTMP_ADAPTER pAd,
OUT PRT28XX_RXD_STRUC pSaveRxD,
@@ -1189,15 +803,12 @@ PNDIS_PACKET GetPacketFromRxRing(
IN OUT UINT32 *pRxPending)
{
PRXD_STRUC pRxD;
-#ifdef RT_BIG_ENDIAN
- PRXD_STRUC pDestRxD;
- RXD_STRUC RxD;
-#endif
PNDIS_PACKET pRxPacket = NULL;
PNDIS_PACKET pNewPacket;
PVOID AllocVa;
NDIS_PHYSICAL_ADDRESS AllocPa;
BOOLEAN bReschedule = FALSE;
+ RTMP_DMACB *pRxCell;
RTMP_SEM_LOCK(&pAd->RxRingLock);
@@ -1221,15 +832,10 @@ PNDIS_PACKET GetPacketFromRxRing(
}
-#ifdef RT_BIG_ENDIAN
- pDestRxD = (PRXD_STRUC) pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].AllocVa;
- RxD = *pDestRxD;
- pRxD = &RxD;
- RTMPDescriptorEndianChange((PUCHAR)pRxD, TYPE_RXD);
-#else
+ pRxCell = &pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx];
+
// Point to Rx indexed rx ring descriptor
- pRxD = (PRXD_STRUC) pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].AllocVa;
-#endif
+ pRxD = (PRXD_STRUC) pRxCell->AllocVa;
if (pRxD->DDONE == 0)
{
@@ -1248,14 +854,14 @@ PNDIS_PACKET GetPacketFromRxRing(
if (pNewPacket)
{
// unmap the rx buffer
- PCI_UNMAP_SINGLE(pAd, pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocPa,
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocSize, PCI_DMA_FROMDEVICE);
- pRxPacket = pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].pNdisPacket;
-
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocSize = RX_BUFFER_AGGRESIZE;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].pNdisPacket = (PNDIS_PACKET) pNewPacket;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocVa = AllocVa;
- pAd->RxRing.Cell[pAd->RxRing.RxSwReadIdx].DmaBuf.AllocPa = AllocPa;
+ PCI_UNMAP_SINGLE(pAd, pRxCell->DmaBuf.AllocPa,
+ pRxCell->DmaBuf.AllocSize, PCI_DMA_FROMDEVICE);
+ pRxPacket = pRxCell->pNdisPacket;
+
+ pRxCell->DmaBuf.AllocSize = RX_BUFFER_AGGRESIZE;
+ pRxCell->pNdisPacket = (PNDIS_PACKET) pNewPacket;
+ pRxCell->DmaBuf.AllocVa = AllocVa;
+ pRxCell->DmaBuf.AllocPa = AllocPa;
/* update SDP0 to new buffer of rx packet */
pRxD->SDP0 = AllocPa;
}
@@ -1272,10 +878,6 @@ PNDIS_PACKET GetPacketFromRxRing(
*pRxPending = *pRxPending - 1;
// update rx descriptor and kick rx
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pRxD, TYPE_RXD);
- WriteBackToDescriptor((PUCHAR)pDestRxD, (PUCHAR)pRxD, FALSE, TYPE_RXD);
-#endif
INC_RING_INDEX(pAd->RxRing.RxSwReadIdx, RX_RING_SIZE);
pAd->RxRing.RxCpuIdx = (pAd->RxRing.RxSwReadIdx == 0) ? (RX_RING_SIZE-1) : (pAd->RxRing.RxSwReadIdx-1);
@@ -1297,10 +899,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
PUCHAR pSrcBufVA;
UINT SrcBufLen;
PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
PHEADER_802_11 pHeader_802_11;
BOOLEAN bAckRequired, bInsertTimestamp;
ULONG SrcBufPA;
@@ -1336,14 +934,7 @@ NDIS_STATUS MlmeHardTransmitTxRing(
SwIdx = pAd->TxRing[QueIdx].TxCpuIdx;
-#ifndef RT_BIG_ENDIAN
pTxD = (PTXD_STRUC) pAd->TxRing[QueIdx].Cell[SwIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pAd->TxRing[QueIdx].Cell[SwIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
if (pAd->TxRing[QueIdx].Cell[SwIdx].pNdisPacket)
{
@@ -1352,16 +943,12 @@ NDIS_STATUS MlmeHardTransmitTxRing(
return NDIS_STATUS_FAILURE;
}
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
// outgoing frame always wakeup PHY to prevent frame lost
// if (pAd->StaCfg.Psm == PWR_SAVE)
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
AsicForceWakeup(pAd, TRUE);
}
-#endif // CONFIG_STA_SUPPORT //
pFirstTxWI =(PTXWI_STRUC)pSrcBufVA;
pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXWI_SIZE);
@@ -1391,7 +978,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
//
//
// In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame
-#ifdef CONFIG_STA_SUPPORT
// Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD
if (pHeader_802_11->FC.Type != BTYPE_DATA)
{
@@ -1404,7 +990,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
pHeader_802_11->FC.PwrMgmt = pAd->CommonCfg.bAPSDForcePowerSave;
}
}
-#endif // CONFIG_STA_SUPPORT //
bInsertTimestamp = FALSE;
if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL
@@ -1442,9 +1027,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
return (NDIS_STATUS_FAILURE);
}
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pHeader_802_11, DIR_WRITE, FALSE);
-#endif
//
// fill scatter-and-gather buffer list into TXD. Internally created NDIS PACKET
// should always has only one ohysical buffer, and the whole frame size equals
@@ -1476,9 +1058,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
pAd->TxRing[QueIdx].Cell[SwIdx].pNdisPacket = pPacket;
pAd->TxRing[QueIdx].Cell[SwIdx].pNextNdisPacket = NULL;
// pFirstTxWI->MPDUtotalByteCount = SrcBufLen - TXWI_SIZE;
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)pFirstTxWI, TYPE_TXWI);
-#endif
SrcBufPA = PCI_MAP_SINGLE(pAd, pSrcBufVA, SrcBufLen, 0, PCI_DMA_TODEVICE);
@@ -1490,10 +1069,6 @@ NDIS_STATUS MlmeHardTransmitTxRing(
pTxD->SDPtr0 = SrcBufPA;
pTxD->DMADONE = 0;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
pAd->RalinkCounters.KickTxCount++;
pAd->RalinkCounters.OneSecTxDoneCount++;
@@ -1568,9 +1143,5 @@ VOID RTMPWriteTxDescriptor(
pTxD->QSEL= (QueueSEL);
//RT2860c?? fixed using EDCA queue for test... We doubt Queue1 has problem. 2006-09-26 Jan
//pTxD->QSEL= FIFO_EDCA;
- /*
- if (pAd->bGenOneHCCA == TRUE)
- pTxD->QSEL= FIFO_HCCA;
- */
pTxD->DMADONE = 0;
}
diff --git a/drivers/staging/rt2870/common/cmm_data_2870.c b/drivers/staging/rt2860/common/cmm_data_usb.c
index 3b63a48310f0..bd6f9d8de9b8 100644
--- a/drivers/staging/rt2870/common/cmm_data_2870.c
+++ b/drivers/staging/rt2860/common/cmm_data_usb.c
@@ -24,12 +24,17 @@
* *
*************************************************************************
*/
+
/*
All functions in this file must be USB-depended, or you should out your function
in other files.
*/
-#include "../rt_config.h"
+
+#ifdef RTMP_MAC_USB
+
+
+#include "../rt_config.h"
/*
@@ -41,7 +46,7 @@
static inline NDIS_STATUS RtmpUSBCanDoWrite(
IN RTMP_ADAPTER *pAd,
IN UCHAR QueIdx,
- IN HT_TX_CONTEXT *pHTTXContext)
+ IN HT_TX_CONTEXT *pHTTXContext)
{
NDIS_STATUS canWrite = NDIS_STATUS_RESOURCES;
@@ -292,7 +297,6 @@ USHORT RtmpUSB_WriteSingleTxResource(
pTxBlk->Priv = (TXINFO_SIZE + USBDMApktLen);
// For TxInfo, the length of USBDMApktLen = TXWI_SIZE + 802.11 header + payload
- //PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT)(USBDMApktLen), FALSE, FIFO_EDCA, FALSE /*NextValid*/, FALSE);
if ((pHTTXContext->CurWritePosition + 3906 + pTxBlk->Priv) > MAX_TXBULK_LIMIT)
@@ -583,11 +587,11 @@ VOID RtmpUSBDataKickOut(
This function handle RT2870 specific TxDesc and cpu index update and kick the packet out.
*/
int RtmpUSBMgmtKickOut(
- IN RTMP_ADAPTER *pAd,
- IN UCHAR QueIdx,
+ IN RTMP_ADAPTER *pAd,
+ IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket,
IN PUCHAR pSrcBufVA,
- IN UINT SrcBufLen)
+ IN UINT SrcBufLen)
{
PTXINFO_STRUC pTxInfo;
ULONG BulkOutSize;
@@ -679,6 +683,7 @@ VOID RtmpUSBNullFrameKickOut(
pTxWI = (PTXWI_STRUC)&pWirelessPkt[TXINFO_SIZE];
RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, 0, BSSID_WCID, (sizeof(HEADER_802_11)),
0, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_HTTXOP, FALSE, &pAd->CommonCfg.MlmeTransmit);
+
RTMPMoveMemory(&pWirelessPkt[TXWI_SIZE+TXINFO_SIZE], &pAd->NullFrame, sizeof(HEADER_802_11));
pAd->NullContext.BulkOutSize = TXINFO_SIZE + TXWI_SIZE + sizeof(pAd->NullFrame) + 4;
@@ -693,6 +698,109 @@ VOID RtmpUSBNullFrameKickOut(
}
+
+/*
+========================================================================
+Routine Description:
+ Get a received packet.
+
+Arguments:
+ pAd device control block
+ pSaveRxD receive descriptor information
+ *pbReschedule need reschedule flag
+ *pRxPending pending received packet flag
+
+Return Value:
+ the recieved packet
+
+Note:
+========================================================================
+*/
+PNDIS_PACKET GetPacketFromRxRing(
+ IN PRTMP_ADAPTER pAd,
+ OUT PRT28XX_RXD_STRUC pSaveRxD,
+ OUT BOOLEAN *pbReschedule,
+ IN OUT UINT32 *pRxPending)
+{
+ PRX_CONTEXT pRxContext;
+ PNDIS_PACKET pSkb;
+ PUCHAR pData;
+ ULONG ThisFrameLen;
+ ULONG RxBufferLength;
+ PRXWI_STRUC pRxWI;
+
+ pRxContext = &pAd->RxContext[pAd->NextRxBulkInReadIndex];
+ if ((pRxContext->Readable == FALSE) || (pRxContext->InUse == TRUE))
+ return NULL;
+
+ RxBufferLength = pRxContext->BulkInOffset - pAd->ReadPosition;
+ if (RxBufferLength < (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXWI_STRUC) + sizeof(RXINFO_STRUC)))
+ {
+ goto label_null;
+ }
+
+ pData = &pRxContext->TransferBuffer[pAd->ReadPosition]; /* 4KB */
+ // The RXDMA field is 4 bytes, now just use the first 2 bytes. The Length including the (RXWI + MSDU + Padding)
+ ThisFrameLen = *pData + (*(pData+1)<<8);
+ if (ThisFrameLen == 0)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("BIRIdx(%d): RXDMALen is zero.[%ld], BulkInBufLen = %ld)\n",
+ pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset));
+ goto label_null;
+ }
+ if ((ThisFrameLen&0x3) != 0)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("BIRIdx(%d): RXDMALen not multiple of 4.[%ld], BulkInBufLen = %ld)\n",
+ pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset));
+ goto label_null;
+ }
+
+ if ((ThisFrameLen + 8)> RxBufferLength) // 8 for (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXINFO_STRUC))
+ {
+ DBGPRINT(RT_DEBUG_TRACE,("BIRIdx(%d):FrameLen(0x%lx) outranges. BulkInLen=0x%lx, remaining RxBufLen=0x%lx, ReadPos=0x%lx\n",
+ pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset, RxBufferLength, pAd->ReadPosition));
+
+ // error frame. finish this loop
+ goto label_null;
+ }
+
+ // skip USB frame length field
+ pData += RT2870_RXDMALEN_FIELD_SIZE;
+ pRxWI = (PRXWI_STRUC)pData;
+ if (pRxWI->MPDUtotalByteCount > ThisFrameLen)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s():pRxWIMPDUtotalByteCount(%d) large than RxDMALen(%ld)\n",
+ __FUNCTION__, pRxWI->MPDUtotalByteCount, ThisFrameLen));
+ goto label_null;
+ }
+
+ // allocate a rx packet
+ pSkb = dev_alloc_skb(ThisFrameLen);
+ if (pSkb == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR,("%s():Cannot Allocate sk buffer for this Bulk-In buffer!\n", __FUNCTION__));
+ goto label_null;
+ }
+
+ // copy the rx packet
+ memcpy(skb_put(pSkb, ThisFrameLen), pData, ThisFrameLen);
+ RTPKT_TO_OSPKT(pSkb)->dev = get_netdev_from_bssid(pAd, BSS0);
+ RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pSkb), PKTSRC_NDIS);
+
+ // copy RxD
+ *pSaveRxD = *(PRXINFO_STRUC)(pData + ThisFrameLen);
+
+ // update next packet read position.
+ pAd->ReadPosition += (ThisFrameLen + RT2870_RXDMALEN_FIELD_SIZE + RXINFO_SIZE); // 8 for (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXINFO_STRUC))
+
+ return pSkb;
+
+label_null:
+
+ return NULL;
+}
+
+
/*
========================================================================
@@ -775,6 +883,11 @@ NDIS_STATUS RTMPCheckRxError(
if (pRxINFO->Decrypted && pRxINFO->CipherErr)
{
+ if (((pRxINFO->CipherErr & 1) == 1) && pAd->CommonCfg.bWirelessEvent && INFRA_ON(pAd))
+ RTMPSendWirelessEvent(pAd, IW_ICV_ERROR_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
+
+ if (((pRxINFO->CipherErr & 2) == 2) && pAd->CommonCfg.bWirelessEvent && INFRA_ON(pAd))
+ RTMPSendWirelessEvent(pAd, IW_MIC_ERROR_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
//
// MIC Error
//
@@ -801,14 +914,32 @@ NDIS_STATUS RTMPCheckRxError(
return(NDIS_STATUS_SUCCESS);
}
+VOID RtmpUsbStaAsicForceWakeupTimeout(
+ IN PVOID SystemSpecific1,
+ IN PVOID FunctionContext,
+ IN PVOID SystemSpecific2,
+ IN PVOID SystemSpecific3)
+{
+ RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
+
+
+ if (pAd && pAd->Mlme.AutoWakeupTimerRunning)
+ {
+ AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
+
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+ pAd->Mlme.AutoWakeupTimerRunning = FALSE;
+ }
+}
+
VOID RT28xxUsbStaAsicForceWakeup(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bFromTx)
{
- AUTO_WAKEUP_STRUC AutoWakeupCfg;
+ BOOLEAN Canceled;
- AutoWakeupCfg.word = 0;
- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+ if (pAd->Mlme.AutoWakeupTimerRunning)
+ RTMPCancelTimer(&pAd->Mlme.AutoWakeupTimer, &Canceled);
AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
@@ -819,19 +950,14 @@ VOID RT28xxUsbStaAsicSleepThenAutoWakeup(
IN PRTMP_ADAPTER pAd,
IN USHORT TbttNumToNextWakeUp)
{
- AUTO_WAKEUP_STRUC AutoWakeupCfg;
+
// we have decided to SLEEP, so at least do it for a BEACON period.
if (TbttNumToNextWakeUp == 0)
TbttNumToNextWakeUp = 1;
- AutoWakeupCfg.word = 0;
- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
-
- AutoWakeupCfg.field.NumofSleepingTbtt = TbttNumToNextWakeUp - 1;
- AutoWakeupCfg.field.EnableAutoWakeup = 1;
- AutoWakeupCfg.field.AutoLeadTime = 5;
- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+ RTMPSetTimer(&pAd->Mlme.AutoWakeupTimer, AUTO_WAKEUP_TIMEOUT);
+ pAd->Mlme.AutoWakeupTimerRunning = TRUE;
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02); // send POWER-SAVE command to MCU. Timeout 40us.
@@ -839,98 +965,4 @@ VOID RT28xxUsbStaAsicSleepThenAutoWakeup(
}
-VOID RT28xxUsbMlmeRadioOn(
- IN PRTMP_ADAPTER pAd)
-{
- DBGPRINT(RT_DEBUG_TRACE,("RT28xxUsbMlmeRadioOn()\n"));
-
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
- return;
-
- AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
- RTMPusecDelay(10000);
-
- NICResetFromError(pAd);
-
- // Enable Tx/Rx
- RTMPEnableRxTx(pAd);
-
-#ifdef RT3070
- if (IS_RT3071(pAd))
- {
- RT30xxReverseRFSleepModeSetup(pAd);
- }
-#endif // RT3070 //
-
- // Clear Radio off flag
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-
- RTUSBBulkReceive(pAd);
-
- // Set LED
- RTMPSetLED(pAd, LED_RADIO_ON);
-}
-
-VOID RT28xxUsbMlmeRadioOFF(
- IN PRTMP_ADAPTER pAd)
-{
- WPDMA_GLO_CFG_STRUC GloCfg;
- UINT32 Value, i;
-
- DBGPRINT(RT_DEBUG_TRACE,("RT28xxUsbMlmeRadioOFF()\n"));
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
- return;
-
- // Set LED
- RTMPSetLED(pAd, LED_RADIO_OFF);
- // Set Radio off flag
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-
- {
- // Link down first if any association exists
- if (INFRA_ON(pAd) || ADHOC_ON(pAd))
- LinkDown(pAd, FALSE);
- RTMPusecDelay(10000);
-
- //==========================================
- // Clean up old bss table
- BssTableInit(&pAd->ScanTab);
- }
-
- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
- {
- // Must using 40MHz.
- AsicTurnOffRFClk(pAd, pAd->CommonCfg.CentralChannel);
- }
- else
- {
- // Must using 20MHz.
- AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
- }
-
- // Disable Tx/Rx DMA
- RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
- GloCfg.field.EnableTxDMA = 0;
- GloCfg.field.EnableRxDMA = 0;
- RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
-
- // Waiting for DMA idle
- i = 0;
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- RTMPusecDelay(1000);
- }while (i++ < 100);
-
- // Disable MAC Tx/Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= (0xfffffff3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
-}
-
+#endif // RTMP_MAC_USB //
diff --git a/drivers/staging/rt2860/common/cmm_info.c b/drivers/staging/rt2860/common/cmm_info.c
index 019cc4474ce8..49e9bdfad3da 100644
--- a/drivers/staging/rt2860/common/cmm_info.c
+++ b/drivers/staging/rt2860/common/cmm_info.c
@@ -23,154 +23,154 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
-*/
+ */
#include <linux/sched.h>
#include "../rt_config.h"
INT Show_SSID_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_WirelessMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_TxBurst_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_TxPreamble_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_TxPower_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_Channel_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_BGProtection_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_RTSThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_FragThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtBw_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtMcs_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtGi_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtOpMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtExtcha_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtMpduDensity_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtBaWinSize_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtRdg_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtAmsdu_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_HtAutoBa_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_CountryRegion_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_CountryRegionABand_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_CountryCode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
#ifdef AGGREGATION_SUPPORT
INT Show_PktAggregate_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
#endif // AGGREGATION_SUPPORT //
#ifdef WMM_SUPPORT
INT Show_WmmCapable_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
#endif // WMM_SUPPORT //
INT Show_IEEE80211H_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_NetworkType_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_AuthMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_EncrypType_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_DefaultKeyID_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_Key1_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_Key2_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_Key3_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_Key4_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
INT Show_WPAPSK_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf);
+ OUT PSTRING pBuf);
static struct {
- CHAR *name;
- INT (*show_proc)(PRTMP_ADAPTER pAdapter, PUCHAR arg);
+ PSTRING name;
+ INT (*show_proc)(PRTMP_ADAPTER pAdapter, PSTRING arg);
} *PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC, RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC[] = {
{"SSID", Show_SSID_Proc},
{"WirelessMode", Show_WirelessMode_Proc},
@@ -224,8 +224,9 @@ static struct {
*/
INT Set_DriverVersion_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
+
DBGPRINT(RT_DEBUG_TRACE, ("Driver version-%s\n", STA_DRIVER_VERSION));
return TRUE;
@@ -242,32 +243,14 @@ INT Set_DriverVersion_Proc(
*/
INT Set_CountryRegion_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG region;
+ int retval;
- region = simple_strtol(arg, 0, 10);
- // Country can be set only when EEPROM not programmed
- if (pAd->CommonCfg.CountryRegion & 0x80)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Set_CountryRegion_Proc::parameter of CountryRegion in eeprom is programmed \n"));
+ retval = RT_CfgSetCountryRegion(pAd, arg, BAND_24G);
+ if (retval == FALSE)
return FALSE;
- }
-
- if((region >= 0) && (region <= REGION_MAXIMUM_BG_BAND))
- {
- pAd->CommonCfg.CountryRegion = (UCHAR) region;
- }
- else if (region == REGION_31_BG_BAND)
- {
- pAd->CommonCfg.CountryRegion = (UCHAR) region;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Set_CountryRegion_Proc::parameters out of range\n"));
- return FALSE;
- }
// if set country region, driver needs to be reset
BuildChannelList(pAd);
@@ -288,28 +271,14 @@ INT Set_CountryRegion_Proc(
*/
INT Set_CountryRegionABand_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG region;
-
- region = simple_strtol(arg, 0, 10);
+ int retval;
- // Country can be set only when EEPROM not programmed
- if (pAd->CommonCfg.CountryRegionForABand & 0x80)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Set_CountryRegionABand_Proc::parameter of CountryRegion in eeprom is programmed \n"));
- return FALSE;
- }
- if((region >= 0) && (region <= REGION_MAXIMUM_A_BAND))
- {
- pAd->CommonCfg.CountryRegionForABand = (UCHAR) region;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Set_CountryRegionABand_Proc::parameters out of range\n"));
+ retval = RT_CfgSetCountryRegion(pAd, arg, BAND_5G);
+ if (retval == FALSE)
return FALSE;
- }
// if set country region, driver needs to be reset
BuildChannelList(pAd);
@@ -329,22 +298,17 @@ INT Set_CountryRegionABand_Proc(
*/
INT Set_WirelessMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG WirelessMode;
INT success = TRUE;
- WirelessMode = simple_strtol(arg, 0, 10);
-
+ success = RT_CfgSetWirelessMode(pAd, arg);
+ if (success)
{
- INT MaxPhyMode = PHY_11G;
-
- MaxPhyMode = PHY_11N_5G;
-
- if (WirelessMode <= MaxPhyMode)
{
- RTMPSetPhyMode(pAd, WirelessMode);
+ LONG WirelessMode = pAd->CommonCfg.PhyMode;
+ RTMPSetPhyMode(pAd, WirelessMode);
if (WirelessMode >= PHY_11ABGN_MIXED)
{
pAd->CommonCfg.BACapability.field.AutoBA = TRUE;
@@ -364,17 +328,10 @@ INT Set_WirelessMode_Proc(
AsicEnableIbssSync(pAd); // copy to on-chip memory
}
}
- else
- {
- success = FALSE;
- }
- }
// it is needed to set SSID to take effect
- if (success == TRUE)
- {
SetCommonHT(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("Set_WirelessMode_Proc::(=%ld)\n", WirelessMode));
+ DBGPRINT(RT_DEBUG_TRACE, ("Set_WirelessMode_Proc::(=%d)\n", pAd->CommonCfg.PhyMode));
}
else
{
@@ -394,7 +351,7 @@ INT Set_WirelessMode_Proc(
*/
INT Set_Channel_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
INT success = TRUE;
UCHAR Channel;
@@ -451,24 +408,18 @@ INT Set_Channel_Proc(
*/
INT Set_ShortSlot_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG ShortSlot;
-
- ShortSlot = simple_strtol(arg, 0, 10);
-
- if (ShortSlot == 1)
- pAd->CommonCfg.bUseShortSlotTime = TRUE;
- else if (ShortSlot == 0)
- pAd->CommonCfg.bUseShortSlotTime = FALSE;
- else
- return FALSE; //Invalid argument
+ int retval;
+ retval = RT_CfgSetShortSlot(pAd, arg);
+ if (retval == TRUE)
DBGPRINT(RT_DEBUG_TRACE, ("Set_ShortSlot_Proc::(ShortSlot=%d)\n", pAd->CommonCfg.bUseShortSlotTime));
- return TRUE;
+ return retval;
}
+
/*
==========================================================================
Description:
@@ -479,12 +430,12 @@ INT Set_ShortSlot_Proc(
*/
INT Set_TxPower_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG TxPower;
+ LONG TxPower;
INT success = FALSE;
- TxPower = (ULONG) simple_strtol(arg, 0, 10);
+ TxPower = simple_strtol(arg, 0, 10);
if (TxPower <= 100)
{
{
@@ -511,7 +462,7 @@ INT Set_TxPower_Proc(
*/
INT Set_BGProtection_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
switch (simple_strtol(arg, 0, 10))
{
@@ -544,7 +495,7 @@ INT Set_BGProtection_Proc(
*/
INT Set_TxPreamble_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
RT_802_11_PREAMBLE Preamble;
@@ -585,7 +536,7 @@ INT Set_TxPreamble_Proc(
*/
INT Set_RTSThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
NDIS_802_11_RTS_THRESHOLD RtsThresh;
@@ -613,7 +564,7 @@ INT Set_RTSThreshold_Proc(
*/
INT Set_FragThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
NDIS_802_11_FRAGMENTATION_THRESHOLD FragThresh;
@@ -657,9 +608,9 @@ INT Set_FragThreshold_Proc(
*/
INT Set_TxBurst_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG TxBurst;
+ LONG TxBurst;
TxBurst = simple_strtol(arg, 0, 10);
if (TxBurst == 1)
@@ -685,9 +636,9 @@ INT Set_TxBurst_Proc(
*/
INT Set_PktAggregate_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG aggre;
+ LONG aggre;
aggre = simple_strtol(arg, 0, 10);
@@ -716,9 +667,9 @@ INT Set_PktAggregate_Proc(
*/
INT Set_IEEE80211H_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
- ULONG ieee80211h;
+ LONG ieee80211h;
ieee80211h = simple_strtol(arg, 0, 10);
@@ -746,7 +697,7 @@ INT Set_IEEE80211H_Proc(
*/
INT Set_Debug_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
DBGPRINT(RT_DEBUG_TRACE, ("==> Set_Debug_Proc *******************\n"));
@@ -761,10 +712,11 @@ INT Set_Debug_Proc(
INT Show_DescInfo_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
INT i, QueIdx=0;
+// ULONG RegValue;
PRT28XX_RXD_STRUC pRxD;
PTXD_STRUC pTxD;
PRTMP_TX_RING pTxRing = &pAd->TxRing[QueIdx];
@@ -774,27 +726,28 @@ INT Show_DescInfo_Proc(
for(i=0;i<TX_RING_SIZE;i++)
{
pTxD = (PTXD_STRUC) pTxRing->Cell[i].AllocVa;
- printk("Desc #%d\n",i);
- hex_dump("Tx Descriptor", (char *)pTxD, 16);
- printk("pTxD->DMADONE = %x\n", pTxD->DMADONE);
+ DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
+ hex_dump("Tx Descriptor", (PUCHAR)pTxD, 16);
+ DBGPRINT(RT_DEBUG_OFF, ("pTxD->DMADONE = %x\n", pTxD->DMADONE));
}
- printk("---------------------------------------------------\n");
+ DBGPRINT(RT_DEBUG_OFF, ("---------------------------------------------------\n"));
for(i=0;i<MGMT_RING_SIZE;i++)
{
pTxD = (PTXD_STRUC) pMgmtRing->Cell[i].AllocVa;
- printk("Desc #%d\n",i);
- hex_dump("Mgmt Descriptor", (char *)pTxD, 16);
- printk("pMgmt->DMADONE = %x\n", pTxD->DMADONE);
+ DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
+ hex_dump("Mgmt Descriptor", (PUCHAR)pTxD, 16);
+ DBGPRINT(RT_DEBUG_OFF, ("pMgmt->DMADONE = %x\n", pTxD->DMADONE));
}
- printk("---------------------------------------------------\n");
+ DBGPRINT(RT_DEBUG_OFF, ("---------------------------------------------------\n"));
for(i=0;i<RX_RING_SIZE;i++)
{
pRxD = (PRT28XX_RXD_STRUC) pRxRing->Cell[i].AllocVa;
- printk("Desc #%d\n",i);
- hex_dump("Rx Descriptor", (char *)pRxD, 16);
- printk("pRxD->DDONE = %x\n", pRxD->DDONE);
+ DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
+ hex_dump("Rx Descriptor", (PUCHAR)pRxD, 16);
+ DBGPRINT(RT_DEBUG_OFF, ("pRxD->DDONE = %x\n", pRxD->DDONE));
}
-#endif /* RT2860 */
+#endif // RTMP_MAC_PCI //
+
return TRUE;
}
@@ -813,8 +766,11 @@ INT Show_DescInfo_Proc(
*/
INT Set_ResetStatCounter_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
+ //UCHAR i;
+ //MAC_TABLE_ENTRY *pEntry;
+
DBGPRINT(RT_DEBUG_TRACE, ("==>Set_ResetStatCounter_Proc\n"));
// add the most up-to-date h/w raw counters into software counters
@@ -824,9 +780,33 @@ INT Set_ResetStatCounter_Proc(
NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3));
NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK));
+ // Reset HotSpot counter
+
+
return TRUE;
}
+/*
+ ========================================================================
+
+ Routine Description:
+ Add WPA key process.
+ In Adhoc WPANONE, bPairwise = 0; KeyIdx = 0;
+
+ Arguments:
+ pAd Pointer to our adapter
+ pBuf Pointer to the where the key stored
+
+ Return Value:
+ NDIS_SUCCESS Add key successfully
+
+ IRQL = DISPATCH_LEVEL
+
+ Note:
+
+ ========================================================================
+*/
+
BOOLEAN RTMPCheckStrPrintAble(
IN CHAR *pInPutStr,
IN UCHAR strLen)
@@ -1100,7 +1080,7 @@ VOID RTMPWPARemoveAllKeys(
UCHAR i;
DBGPRINT(RT_DEBUG_TRACE,("RTMPWPARemoveAllKeys(AuthMode=%d, WepStatus=%d)\n", pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus));
-
+ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
// For WEP/CKIP, there is no need to remove it, since WinXP won't set it again after
// Link up. And it will be replaced if user changed it.
if (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)
@@ -1122,9 +1102,33 @@ VOID RTMPWPARemoveAllKeys(
AsicRemoveSharedKeyEntry(pAd, BSS0, i);
}
-
+ RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ As STA's BSSID is a WC too, it uses shared key table.
+ This function write correct unicast TX key to ASIC WCID.
+ And we still make a copy in our MacTab.Content[BSSID_WCID].PairwiseKey.
+ Caller guarantee TKIP/AES always has keyidx = 0. (pairwise key)
+ Caller guarantee WEP calls this function when set Txkey, default key index=0~3.
+
+ Arguments:
+ pAd Pointer to our adapter
+ pKey Pointer to the where the key stored
+
+ Return Value:
+ NDIS_SUCCESS Add key successfully
+
+ IRQL = DISPATCH_LEVEL
+
+ Note:
+
+ ========================================================================
+*/
/*
========================================================================
Routine Description:
@@ -1147,6 +1151,11 @@ VOID RTMPSetPhyMode(
INT i;
// the selected phymode must be supported by the RF IC encoded in E2PROM
+ // if no change, do nothing
+ /* bug fix
+ if (pAd->CommonCfg.PhyMode == phymode)
+ return;
+ */
pAd->CommonCfg.PhyMode = (UCHAR)phymode;
DBGPRINT(RT_DEBUG_TRACE,("RTMPSetPhyMode : PhyMode=%d, channel=%d \n", pAd->CommonCfg.PhyMode, pAd->CommonCfg.Channel));
@@ -1466,7 +1475,10 @@ VOID RTMPSetHT(
}
AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
+ {
RTMPSetIndividualHT(pAd, 0);
+ }
+
}
/*
@@ -1657,12 +1669,8 @@ VOID RTMPAddWcidAttributeEntry(
// 1. In ADHOC mode, the AID is wcid number. And NO mesh link exists.
// 2. In Infra mode, the AID:1 MUST be wcid of infra STA.
// the AID:2~ assign to mesh link entry.
- if (pEntry && ADHOC_ON(pAd))
+ if (pEntry)
Wcid = pEntry->Aid;
- else if (pEntry && INFRA_ON(pAd))
- {
- Wcid = BSSID_WCID;
- }
else
Wcid = MCAST_WCID;
}
@@ -1697,12 +1705,12 @@ VOID RTMPAddWcidAttributeEntry(
}
// For key index and ext IV bit, so only need to update the position(offset+3).
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
RTMP_IO_WRITE8(pAd, offset+3, IVEIV);
-#endif
-#ifdef RT2870
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
RTUSBMultiWrite_OneByte(pAd, offset+3, &IVEIV);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
DBGPRINT(RT_DEBUG_TRACE,("RTMPAddWcidAttributeEntry: WCID #%d, KeyIndex #%d, Alg=%s\n",Wcid, KeyIdx, CipherName[CipherAlg]));
DBGPRINT(RT_DEBUG_TRACE,(" WCIDAttri = 0x%x \n", WCIDAttri));
@@ -1723,7 +1731,7 @@ Arguments:
Note:
==========================================================================
*/
-CHAR *GetEncryptType(CHAR enc)
+PSTRING GetEncryptType(CHAR enc)
{
if(enc == Ndis802_11WEPDisabled)
return "NONE";
@@ -1739,7 +1747,7 @@ CHAR *GetEncryptType(CHAR enc)
return "UNKNOW";
}
-CHAR *GetAuthMode(CHAR auth)
+PSTRING GetAuthMode(CHAR auth)
{
if(auth == Ndis802_11AuthModeOpen)
return "OPEN";
@@ -1783,71 +1791,133 @@ CHAR *GetAuthMode(CHAR auth)
3.) UI needs to prepare at least 4096bytes to get the results
==========================================================================
*/
-#define LINE_LEN (4+33+20+8+10+9+7+3) // Channel+SSID+Bssid+WepStatus+AuthMode+Signal+WiressMode+NetworkType
-VOID RTMPIoctlGetSiteSurvey(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
+#define LINE_LEN (4+33+20+23+9+7+7+3) // Channel+SSID+Bssid+Security+Signal+WiressMode+ExtCh+NetworkType
+VOID RTMPCommSiteSurveyData(
+ IN PSTRING msg,
+ IN PBSS_ENTRY pBss)
{
- CHAR *msg;
- INT i=0;
- INT WaitCnt;
- INT Status=0;
- CHAR Ssid[MAX_LEN_OF_SSID +1];
- INT Rssi = 0, max_len = LINE_LEN;
+ INT Rssi = 0;
UINT Rssi_Quality = 0;
NDIS_802_11_NETWORK_TYPE wireless_mode;
+ CHAR Ssid[MAX_LEN_OF_SSID +1];
+ STRING SecurityStr[32] = {0};
+ NDIS_802_11_ENCRYPTION_STATUS ap_cipher = Ndis802_11EncryptionDisabled;
+ NDIS_802_11_AUTHENTICATION_MODE ap_auth_mode = Ndis802_11AuthModeOpen;
- os_alloc_mem(NULL, (PUCHAR *)&msg, sizeof(CHAR)*((MAX_LEN_OF_BSS_TABLE)*max_len));
-
- if (msg == NULL)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPIoctlGetSiteSurvey - msg memory alloc fail.\n"));
- return;
- }
-
- memset(msg, 0 ,(MAX_LEN_OF_BSS_TABLE)*max_len );
memset(Ssid, 0 ,(MAX_LEN_OF_SSID +1));
- sprintf(msg,"%s","\n");
- sprintf(msg+strlen(msg),"%-4s%-33s%-20s%-8s%-10s%-9s%-7s%-3s\n",
- "Ch", "SSID", "BSSID", "Enc", "Auth", "Siganl(%)", "W-Mode", " NT");
-
- WaitCnt = 0;
- pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
-
- while ((ScanRunning(pAdapter) == TRUE) && (WaitCnt++ < 200))
- OS_WAIT(500);
-
- for(i=0; i<pAdapter->ScanTab.BssNr ;i++)
- {
- if( pAdapter->ScanTab.BssEntry[i].Channel==0)
- break;
-
- if((strlen(msg)+max_len ) >= IW_SCAN_MAX_DATA)
- break;
//Channel
- sprintf(msg+strlen(msg),"%-4d", pAdapter->ScanTab.BssEntry[i].Channel);
+ sprintf(msg+strlen(msg),"%-4d", pBss->Channel);
//SSID
- memcpy(Ssid, pAdapter->ScanTab.BssEntry[i].Ssid, pAdapter->ScanTab.BssEntry[i].SsidLen);
- Ssid[pAdapter->ScanTab.BssEntry[i].SsidLen] = '\0';
+ memcpy(Ssid, pBss->Ssid, pBss->SsidLen);
+ Ssid[pBss->SsidLen] = '\0';
sprintf(msg+strlen(msg),"%-33s", Ssid);
//BSSID
sprintf(msg+strlen(msg),"%02x:%02x:%02x:%02x:%02x:%02x ",
- pAdapter->ScanTab.BssEntry[i].Bssid[0],
- pAdapter->ScanTab.BssEntry[i].Bssid[1],
- pAdapter->ScanTab.BssEntry[i].Bssid[2],
- pAdapter->ScanTab.BssEntry[i].Bssid[3],
- pAdapter->ScanTab.BssEntry[i].Bssid[4],
- pAdapter->ScanTab.BssEntry[i].Bssid[5]);
- //Encryption Type
- sprintf(msg+strlen(msg),"%-8s",GetEncryptType(pAdapter->ScanTab.BssEntry[i].WepStatus));
- //Authentication Mode
- if (pAdapter->ScanTab.BssEntry[i].WepStatus == Ndis802_11WEPEnabled)
- sprintf(msg+strlen(msg),"%-10s", "UNKNOW");
+ pBss->Bssid[0],
+ pBss->Bssid[1],
+ pBss->Bssid[2],
+ pBss->Bssid[3],
+ pBss->Bssid[4],
+ pBss->Bssid[5]);
+
+ //Security
+ if ((Ndis802_11AuthModeWPA <= pBss->AuthMode) &&
+ (pBss->AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK))
+ {
+ if (pBss->AuthModeAux == Ndis802_11AuthModeWPANone)
+ {
+ ap_auth_mode = pBss->AuthMode;
+ if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
+ ap_cipher = pBss->WPA.PairCipher;
+ else
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ }
+ else if (pBss->AuthModeAux == Ndis802_11AuthModeOpen)
+ {
+ ap_auth_mode = pBss->AuthMode;
+ if ((ap_auth_mode == Ndis802_11AuthModeWPA) ||
+ (ap_auth_mode == Ndis802_11AuthModeWPAPSK))
+ {
+ if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
+ ap_cipher = pBss->WPA.PairCipher;
+ else
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ }
+ else if ((ap_auth_mode == Ndis802_11AuthModeWPA2) ||
+ (ap_auth_mode == Ndis802_11AuthModeWPA2PSK))
+ {
+ if (pBss->WPA2.PairCipherAux == Ndis802_11WEPDisabled)
+ ap_cipher = pBss->WPA2.PairCipher;
+ else
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ }
+ }
+ else if ((pBss->AuthMode == Ndis802_11AuthModeWPAPSK) ||
+ (pBss->AuthMode == Ndis802_11AuthModeWPA2PSK))
+ {
+ if ((pBss->AuthModeAux == Ndis802_11AuthModeWPAPSK) ||
+ (pBss->AuthModeAux == Ndis802_11AuthModeWPA2PSK))
+ ap_auth_mode = Ndis802_11AuthModeWPA1PSKWPA2PSK;
+ else
+ ap_auth_mode = pBss->AuthMode;
+
+ if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher)
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux))
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
+ (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled))
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
+ (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled))
+ ap_cipher = pBss->WPA.PairCipher;
+ }
+ else if ((pBss->AuthMode == Ndis802_11AuthModeWPA) ||
+ (pBss->AuthMode == Ndis802_11AuthModeWPA2))
+ {
+ if ((pBss->AuthModeAux == Ndis802_11AuthModeWPA) ||
+ (pBss->AuthMode == Ndis802_11AuthModeWPA2))
+ ap_auth_mode = Ndis802_11AuthModeWPA1WPA2;
+ else
+ ap_auth_mode = pBss->AuthMode;
+
+ if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher)
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux))
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
+ (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled))
+ ap_cipher = Ndis802_11Encryption4Enabled;
+ else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
+ (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
+ (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled))
+ ap_cipher = pBss->WPA.PairCipher;
+ }
+
+ sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));
+ }
+ else
+ {
+ ap_auth_mode = pBss->AuthMode;
+ ap_cipher = pBss->WepStatus;
+ if (ap_cipher == Ndis802_11WEPDisabled)
+ sprintf(SecurityStr, "NONE");
+ else if (ap_cipher == Ndis802_11WEPEnabled)
+ sprintf(SecurityStr, "WEP");
else
- sprintf(msg+strlen(msg),"%-10s",GetAuthMode(pAdapter->ScanTab.BssEntry[i].AuthMode));
+ sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));
+ }
+
+ sprintf(msg+strlen(msg), "%-23s", SecurityStr);
+
// Rssi
- Rssi = (INT)pAdapter->ScanTab.BssEntry[i].Rssi;
+ Rssi = (INT)pBss->Rssi;
if (Rssi >= -50)
Rssi_Quality = 100;
else if (Rssi >= -80) // between -50 ~ -80dbm
@@ -1858,7 +1928,7 @@ VOID RTMPIoctlGetSiteSurvey(
Rssi_Quality = 0;
sprintf(msg+strlen(msg),"%-9d", Rssi_Quality);
// Wireless Mode
- wireless_mode = NetworkTypeInUseSanity(&pAdapter->ScanTab.BssEntry[i]);
+ wireless_mode = NetworkTypeInUseSanity(pBss);
if (wireless_mode == Ndis802_11FH ||
wireless_mode == Ndis802_11DS)
sprintf(msg+strlen(msg),"%-7s", "11b");
@@ -1872,13 +1942,79 @@ VOID RTMPIoctlGetSiteSurvey(
sprintf(msg+strlen(msg),"%-7s", "11b/g/n");
else
sprintf(msg+strlen(msg),"%-7s", "unknow");
+
+ // Ext Channel
+ if (pBss->AddHtInfoLen > 0)
+ {
+ if (pBss->AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE)
+ sprintf(msg+strlen(msg),"%-7s", " ABOVE");
+ else if (pBss->AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW)
+ sprintf(msg+strlen(msg),"%-7s", " BELOW");
+ else
+ sprintf(msg+strlen(msg),"%-7s", " NONE");
+ }
+ else
+ {
+ sprintf(msg+strlen(msg),"%-7s", " NONE");
+ }
+
//Network Type
- if (pAdapter->ScanTab.BssEntry[i].BssType == BSS_ADHOC)
+ if (pBss->BssType == BSS_ADHOC)
sprintf(msg+strlen(msg),"%-3s", " Ad");
else
sprintf(msg+strlen(msg),"%-3s", " In");
sprintf(msg+strlen(msg),"\n");
+
+ return;
+}
+
+VOID RTMPIoctlGetSiteSurvey(
+ IN PRTMP_ADAPTER pAdapter,
+ IN struct iwreq *wrq)
+{
+ PSTRING msg;
+ INT i=0;
+ INT WaitCnt;
+ INT Status=0;
+ INT max_len = LINE_LEN;
+ PBSS_ENTRY pBss;
+
+
+ os_alloc_mem(NULL, (PUCHAR *)&msg, sizeof(CHAR)*((MAX_LEN_OF_BSS_TABLE)*max_len));
+
+ if (msg == NULL)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("RTMPIoctlGetSiteSurvey - msg memory alloc fail.\n"));
+ return;
+ }
+
+ memset(msg, 0 ,(MAX_LEN_OF_BSS_TABLE)*max_len );
+ sprintf(msg,"%s","\n");
+ sprintf(msg+strlen(msg),"%-4s%-33s%-20s%-23s%-9s%-7s%-7s%-3s\n",
+ "Ch", "SSID", "BSSID", "Security", "Siganl(%)", "W-Mode", " ExtCH"," NT");
+
+
+
+ WaitCnt = 0;
+ pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
+ while ((ScanRunning(pAdapter) == TRUE) && (WaitCnt++ < 200))
+ OS_WAIT(500);
+
+ for(i=0; i<pAdapter->ScanTab.BssNr ;i++)
+ {
+ pBss = &pAdapter->ScanTab.BssEntry[i];
+
+ if( pBss->Channel==0)
+ break;
+
+ if((strlen(msg)+max_len ) >= IW_SCAN_MAX_DATA)
+ break;
+
+
+ RTMPCommSiteSurveyData(msg, pBss);
+
+
}
pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
@@ -1933,7 +2069,12 @@ VOID RTMPIoctlGetMacTable(
DBGPRINT(RT_DEBUG_TRACE, ("%s: copy_to_user() fail\n", __func__));
}
- msg = (CHAR *) kmalloc(sizeof(CHAR)*(MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN), MEM_ALLOC_FLAG);
+ msg = kmalloc(sizeof(CHAR)*(MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN), MEM_ALLOC_FLAG);
+ if (msg == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s():Alloc memory failed\n", __func__));
+ return;
+ }
memset(msg, 0 ,MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN );
sprintf(msg,"%s","\n");
sprintf(msg+strlen(msg),"%-14s%-4s%-4s%-10s%-10s%-10s%-6s%-6s\n",
@@ -1968,12 +2109,14 @@ VOID RTMPIoctlGetMacTable(
kfree(msg);
}
+
INT Set_BASetup_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR mac[6], tid;
- char *token, sepValue[] = ":", DASH = '-';
+ PSTRING token;
+ STRING sepValue[] = ":", DASH = '-';
INT i;
MAC_TABLE_ENTRY *pEntry;
@@ -1982,6 +2125,7 @@ INT Set_BASetup_Proc(
=>The six 2 digit hex-decimal number previous are the Mac address,
=>The seventh decimal number is the tid value.
*/
+ //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format.
return FALSE;
@@ -1989,7 +2133,7 @@ INT Set_BASetup_Proc(
token = strchr(arg, DASH);
if ((token != NULL) && (strlen(token)>1))
{
- tid = simple_strtol((token+1), 0, 10);
+ tid = (UCHAR) simple_strtol((token+1), 0, 10);
if (tid > 15)
return FALSE;
@@ -1998,18 +2142,18 @@ INT Set_BASetup_Proc(
{
if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
return FALSE;
- AtoH(token, (PUCHAR)(&mac[i]), 1);
+ AtoH(token, (&mac[i]), 1);
}
if(i != 6)
return FALSE;
- printk("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x\n", mac[0], mac[1],
- mac[2], mac[3], mac[4], mac[5], tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x\n",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
- pEntry = MacTableLookup(pAd, mac);
+ pEntry = MacTableLookup(pAd, (PUCHAR) mac);
if (pEntry) {
- printk("\nSetup BA Session: Tid = %d\n", tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\nSetup BA Session: Tid = %d\n", tid));
BAOriSessionSetUp(pAd, pEntry, tid, 0, 100, TRUE);
}
@@ -2022,7 +2166,7 @@ INT Set_BASetup_Proc(
INT Set_BADecline_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG bBADecline;
@@ -2048,13 +2192,15 @@ INT Set_BADecline_Proc(
INT Set_BAOriTearDown_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR mac[6], tid;
- char *token, sepValue[] = ":", DASH = '-';
+ PSTRING token;
+ STRING sepValue[] = ":", DASH = '-';
INT i;
MAC_TABLE_ENTRY *pEntry;
+ //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
/*
The BAOriTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
=>The six 2 digit hex-decimal number previous are the Mac address,
@@ -2075,18 +2221,18 @@ INT Set_BAOriTearDown_Proc(
{
if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
return FALSE;
- AtoH(token, (PUCHAR)(&mac[i]), 1);
+ AtoH(token, (&mac[i]), 1);
}
if(i != 6)
return FALSE;
- printk("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x", mac[0], mac[1],
- mac[2], mac[3], mac[4], mac[5], tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
- pEntry = MacTableLookup(pAd, mac);
+ pEntry = MacTableLookup(pAd, (PUCHAR) mac);
if (pEntry) {
- printk("\nTear down Ori BA Session: Tid = %d\n", tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\nTear down Ori BA Session: Tid = %d\n", tid));
BAOriSessionTearDown(pAd, pEntry->Aid, tid, FALSE, TRUE);
}
@@ -2099,14 +2245,15 @@ INT Set_BAOriTearDown_Proc(
INT Set_BARecTearDown_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR mac[6], tid;
- char *token, sepValue[] = ":", DASH = '-';
+ PSTRING token;
+ STRING sepValue[] = ":", DASH = '-';
INT i;
MAC_TABLE_ENTRY *pEntry;
- //printk("\n%s\n", arg);
+ //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
/*
The BARecTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
=>The six 2 digit hex-decimal number previous are the Mac address,
@@ -2127,18 +2274,18 @@ INT Set_BARecTearDown_Proc(
{
if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
return FALSE;
- AtoH(token, (PUCHAR)(&mac[i]), 1);
+ AtoH(token, (&mac[i]), 1);
}
if(i != 6)
return FALSE;
- printk("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x", mac[0], mac[1],
- mac[2], mac[3], mac[4], mac[5], tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
- pEntry = MacTableLookup(pAd, mac);
+ pEntry = MacTableLookup(pAd, (PUCHAR) mac);
if (pEntry) {
- printk("\nTear down Rec BA Session: Tid = %d\n", tid);
+ DBGPRINT(RT_DEBUG_OFF, ("\nTear down Rec BA Session: Tid = %d\n", tid));
BARecSessionTearDown(pAd, pEntry->Aid, tid, FALSE);
}
@@ -2151,7 +2298,7 @@ INT Set_BARecTearDown_Proc(
INT Set_HtBw_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG HtBw;
@@ -2172,7 +2319,7 @@ INT Set_HtBw_Proc(
INT Set_HtMcs_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG HtMcs, Mcs_tmp;
BOOLEAN bAutoRate = FALSE;
@@ -2226,7 +2373,7 @@ INT Set_HtMcs_Proc(
INT Set_HtGi_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG HtGi;
@@ -2249,7 +2396,7 @@ INT Set_HtGi_Proc(
INT Set_HtTxBASize_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR Size;
@@ -2265,10 +2412,32 @@ INT Set_HtTxBASize_Proc(
return TRUE;
}
+INT Set_HtDisallowTKIP_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
+{
+ ULONG Value;
+
+ Value = simple_strtol(arg, 0, 10);
+
+ if (Value == 1)
+ {
+ pAd->CommonCfg.HT_DisallowTKIP = TRUE;
+ }
+ else
+ {
+ pAd->CommonCfg.HT_DisallowTKIP = FALSE;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("Set_HtDisallowTKIP_Proc ::%s\n",
+ (pAd->CommonCfg.HT_DisallowTKIP == TRUE) ? "enabled" : "disabled"));
+
+ return TRUE;
+}
INT Set_HtOpMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2292,7 +2461,7 @@ INT Set_HtOpMode_Proc(
INT Set_HtStbc_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2315,7 +2484,7 @@ INT Set_HtStbc_Proc(
INT Set_HtHtc_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2335,7 +2504,7 @@ INT Set_HtHtc_Proc(
INT Set_HtExtcha_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2358,7 +2527,7 @@ INT Set_HtExtcha_Proc(
INT Set_HtMpduDensity_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2378,7 +2547,7 @@ INT Set_HtMpduDensity_Proc(
INT Set_HtBaWinSize_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2405,7 +2574,7 @@ INT Set_HtBaWinSize_Proc(
INT Set_HtRdg_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2430,7 +2599,7 @@ INT Set_HtRdg_Proc(
INT Set_HtLinkAdapt_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2452,7 +2621,7 @@ INT Set_HtLinkAdapt_Proc(
INT Set_HtAmsdu_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2473,7 +2642,7 @@ INT Set_HtAmsdu_Proc(
INT Set_HtAutoBa_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2504,7 +2673,7 @@ INT Set_HtAutoBa_Proc(
INT Set_HtProtect_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2523,14 +2692,15 @@ INT Set_HtProtect_Proc(
INT Set_SendPSMPAction_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR mac[6], mode;
- char *token, sepValue[] = ":", DASH = '-';
+ PSTRING token;
+ STRING sepValue[] = ":", DASH = '-';
INT i;
MAC_TABLE_ENTRY *pEntry;
- //printk("\n%s\n", arg);
+ //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
/*
The BARecTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
=>The six 2 digit hex-decimal number previous are the Mac address,
@@ -2551,18 +2721,18 @@ INT Set_SendPSMPAction_Proc(
{
if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
return FALSE;
- AtoH(token, (PUCHAR)(&mac[i]), 1);
+ AtoH(token, (&mac[i]), 1);
}
if(i != 6)
return FALSE;
- printk("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x", mac[0], mac[1],
- mac[2], mac[3], mac[4], mac[5], mode);
+ DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
+ mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], mode));
pEntry = MacTableLookup(pAd, mac);
if (pEntry) {
- printk("\nSendPSMPAction MIPS mode = %d\n", mode);
+ DBGPRINT(RT_DEBUG_OFF, ("\nSendPSMPAction MIPS mode = %d\n", mode));
SendPSMPAction(pAd, pEntry->Aid, mode);
}
@@ -2576,7 +2746,7 @@ INT Set_SendPSMPAction_Proc(
INT Set_HtMIMOPSmode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2597,7 +2767,7 @@ INT Set_HtMIMOPSmode_Proc(
INT Set_ForceShortGI_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2620,7 +2790,7 @@ INT Set_ForceShortGI_Proc(
INT Set_ForceGF_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2641,7 +2811,7 @@ INT Set_ForceGF_Proc(
INT Set_HtMimoPs_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG Value;
@@ -2682,7 +2852,7 @@ INT SetCommonHT(
INT Set_FixedTxMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UCHAR fix_tx_mode = FIXED_TXMODE_HT;
@@ -2702,8 +2872,57 @@ INT Set_FixedTxMode_Proc(
return TRUE;
}
+#if defined(RT305x)||defined(RT3070)
+INT Set_HiPower_Proc(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PSTRING arg)
+{
+ pAdapter->CommonCfg.HighPowerPatchDisabled = !(simple_strtol(arg, 0, 10));
+
+ if (pAdapter->CommonCfg.HighPowerPatchDisabled != 0)
+ {
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R82, 0x62);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R67, 0x20);
+#ifdef RT3070
+ if ((IS_RT3070(pAdapter) && ((pAdapter->MACVersion & 0xffff) < 0x0201)))
+#endif // RT3070 //
+ RT30xxWriteRFRegister(pAdapter, RF_R27, 0x23);
+ }
+ return TRUE;
+}
+#endif
+
+INT Set_LongRetryLimit_Proc(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PSTRING arg)
+{
+ TX_RTY_CFG_STRUC tx_rty_cfg;
+ UCHAR LongRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
+
+ RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
+ tx_rty_cfg.field.LongRtyLimit = LongRetryLimit;
+ RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
+ DBGPRINT(RT_DEBUG_TRACE, ("IF Set_LongRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
+ return TRUE;
+}
+
+INT Set_ShortRetryLimit_Proc(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PSTRING arg)
+{
+ TX_RTY_CFG_STRUC tx_rty_cfg;
+ UCHAR ShortRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
+
+ RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
+ tx_rty_cfg.field.ShortRtyLimit = ShortRetryLimit;
+ RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
+ DBGPRINT(RT_DEBUG_TRACE, ("IF Set_ShortRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
+ return TRUE;
+}
+
+
/////////////////////////////////////////////////////////////////////////
-PCHAR RTMPGetRalinkAuthModeStr(
+PSTRING RTMPGetRalinkAuthModeStr(
IN NDIS_802_11_AUTHENTICATION_MODE authMode)
{
switch(authMode)
@@ -2731,14 +2950,11 @@ PCHAR RTMPGetRalinkAuthModeStr(
}
}
-PCHAR RTMPGetRalinkEncryModeStr(
+PSTRING RTMPGetRalinkEncryModeStr(
IN USHORT encryMode)
{
switch(encryMode)
{
-#if defined(RT2860) || defined(RT30xx)
- default:
-#endif
case Ndis802_11WEPDisabled:
return "NONE";
case Ndis802_11WEPEnabled:
@@ -2749,17 +2965,15 @@ PCHAR RTMPGetRalinkEncryModeStr(
return "AES";
case Ndis802_11Encryption4Enabled:
return "TKIPAES";
-#if !defined(RT2860) && !defined(RT30xx)
default:
return "UNKNOW";
-#endif
}
}
INT RTMPShowCfgValue(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pName,
- IN PUCHAR pBuf)
+ IN PSTRING pName,
+ IN PSTRING pBuf)
{
INT Status = 0;
@@ -2785,7 +2999,7 @@ INT RTMPShowCfgValue(
INT Show_SSID_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.Ssid);
return 0;
@@ -2793,7 +3007,7 @@ INT Show_SSID_Proc(
INT Show_WirelessMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.PhyMode)
{
@@ -2843,7 +3057,7 @@ INT Show_WirelessMode_Proc(
INT Show_TxBurst_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.bEnableTxBurst ? "TRUE":"FALSE");
return 0;
@@ -2851,7 +3065,7 @@ INT Show_TxBurst_Proc(
INT Show_TxPreamble_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.TxPreamble)
{
@@ -2874,7 +3088,7 @@ INT Show_TxPreamble_Proc(
INT Show_TxPower_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%lu", pAd->CommonCfg.TxPowerPercentage);
return 0;
@@ -2882,7 +3096,7 @@ INT Show_TxPower_Proc(
INT Show_Channel_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%d", pAd->CommonCfg.Channel);
return 0;
@@ -2890,7 +3104,7 @@ INT Show_Channel_Proc(
INT Show_BGProtection_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.UseBGProtection)
{
@@ -2912,7 +3126,7 @@ INT Show_BGProtection_Proc(
INT Show_RTSThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%u", pAd->CommonCfg.RtsThreshold);
return 0;
@@ -2920,7 +3134,7 @@ INT Show_RTSThreshold_Proc(
INT Show_FragThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%u", pAd->CommonCfg.FragmentThreshold);
return 0;
@@ -2928,7 +3142,7 @@ INT Show_FragThreshold_Proc(
INT Show_HtBw_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)
{
@@ -2943,7 +3157,7 @@ INT Show_HtBw_Proc(
INT Show_HtMcs_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%u", pAd->StaCfg.DesiredTransmitSetting.field.MCS);
return 0;
@@ -2951,7 +3165,7 @@ INT Show_HtMcs_Proc(
INT Show_HtGi_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.RegTransmitSetting.field.ShortGI)
{
@@ -2970,7 +3184,7 @@ INT Show_HtGi_Proc(
INT Show_HtOpMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.RegTransmitSetting.field.HTMODE)
{
@@ -2989,7 +3203,7 @@ INT Show_HtOpMode_Proc(
INT Show_HtExtcha_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->CommonCfg.RegTransmitSetting.field.EXTCHA)
{
@@ -3009,7 +3223,7 @@ INT Show_HtExtcha_Proc(
INT Show_HtMpduDensity_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%u", pAd->CommonCfg.BACapability.field.MpduDensity);
return 0;
@@ -3017,7 +3231,7 @@ INT Show_HtMpduDensity_Proc(
INT Show_HtBaWinSize_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%u", pAd->CommonCfg.BACapability.field.RxBAWinLimit);
return 0;
@@ -3025,7 +3239,7 @@ INT Show_HtBaWinSize_Proc(
INT Show_HtRdg_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.bRdg ? "TRUE":"FALSE");
return 0;
@@ -3033,7 +3247,7 @@ INT Show_HtRdg_Proc(
INT Show_HtAmsdu_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.BACapability.field.AmsduEnable ? "TRUE":"FALSE");
return 0;
@@ -3041,7 +3255,7 @@ INT Show_HtAmsdu_Proc(
INT Show_HtAutoBa_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.BACapability.field.AutoBA ? "TRUE":"FALSE");
return 0;
@@ -3049,7 +3263,7 @@ INT Show_HtAutoBa_Proc(
INT Show_CountryRegion_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%d", pAd->CommonCfg.CountryRegion);
return 0;
@@ -3057,7 +3271,7 @@ INT Show_CountryRegion_Proc(
INT Show_CountryRegionABand_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%d", pAd->CommonCfg.CountryRegionForABand);
return 0;
@@ -3065,7 +3279,7 @@ INT Show_CountryRegionABand_Proc(
INT Show_CountryCode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.CountryCode);
return 0;
@@ -3074,7 +3288,7 @@ INT Show_CountryCode_Proc(
#ifdef AGGREGATION_SUPPORT
INT Show_PktAggregate_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.bAggregationCapable ? "TRUE":"FALSE");
return 0;
@@ -3084,7 +3298,7 @@ INT Show_PktAggregate_Proc(
#ifdef WMM_SUPPORT
INT Show_WmmCapable_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.bWmmCapable ? "TRUE":"FALSE");
@@ -3094,7 +3308,7 @@ INT Show_WmmCapable_Proc(
INT Show_IEEE80211H_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
sprintf(pBuf, "\t%s", pAd->CommonCfg.bIEEE80211H ? "TRUE":"FALSE");
return 0;
@@ -3102,7 +3316,7 @@ INT Show_IEEE80211H_Proc(
INT Show_NetworkType_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
switch(pAd->StaCfg.BssType)
{
@@ -3125,9 +3339,11 @@ INT Show_NetworkType_Proc(
return 0;
}
+
+
INT Show_AuthMode_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
NDIS_802_11_AUTHENTICATION_MODE AuthMode = Ndis802_11AuthModeOpen;
@@ -3144,7 +3360,7 @@ INT Show_AuthMode_Proc(
INT Show_EncrypType_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
NDIS_802_11_WEP_STATUS WepStatus = Ndis802_11WEPDisabled;
@@ -3161,7 +3377,7 @@ INT Show_EncrypType_Proc(
INT Show_DefaultKeyID_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
UCHAR DefaultKeyId = 0;
@@ -3175,7 +3391,7 @@ INT Show_DefaultKeyID_Proc(
INT Show_WepKey_Proc(
IN PRTMP_ADAPTER pAd,
IN INT KeyIdx,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
UCHAR Key[16] = {0}, KeyLength = 0;
INT index = BSS0;
@@ -3184,7 +3400,7 @@ INT Show_WepKey_Proc(
NdisMoveMemory(Key, pAd->SharedKey[index][KeyIdx].Key, KeyLength);
//check key string is ASCII or not
- if (RTMPCheckStrPrintAble(Key, KeyLength))
+ if (RTMPCheckStrPrintAble((PCHAR)Key, KeyLength))
sprintf(pBuf, "\t%s", Key);
else
{
@@ -3198,7 +3414,7 @@ INT Show_WepKey_Proc(
INT Show_Key1_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
Show_WepKey_Proc(pAd, 0, pBuf);
return 0;
@@ -3206,7 +3422,7 @@ INT Show_Key1_Proc(
INT Show_Key2_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
Show_WepKey_Proc(pAd, 1, pBuf);
return 0;
@@ -3214,7 +3430,7 @@ INT Show_Key2_Proc(
INT Show_Key3_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
Show_WepKey_Proc(pAd, 2, pBuf);
return 0;
@@ -3222,7 +3438,7 @@ INT Show_Key3_Proc(
INT Show_Key4_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
Show_WepKey_Proc(pAd, 3, pBuf);
return 0;
@@ -3230,7 +3446,7 @@ INT Show_Key4_Proc(
INT Show_WPAPSK_Proc(
IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf)
+ OUT PSTRING pBuf)
{
INT idx;
UCHAR PMK[32] = {0};
diff --git a/drivers/staging/rt3090/common/cmm_mac_pci.c b/drivers/staging/rt2860/common/cmm_mac_pci.c
index 8e1636315a8b..73992cb4ee67 100644
--- a/drivers/staging/rt3090/common/cmm_mac_pci.c
+++ b/drivers/staging/rt2860/common/cmm_mac_pci.c
@@ -25,9 +25,9 @@
*************************************************************************
*/
-#ifdef RTMP_MAC_PCI
-#include "../rt_config.h"
+#ifdef RTMP_MAC_PCI
+#include "../rt_config.h"
/*
@@ -162,9 +162,6 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(
pTxD->SDPtr0 = BufBasePaLow;
// advance to next ring descriptor address
pTxD->DMADONE = 1;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
RingBasePaLow += TXD_SIZE;
RingBaseVa = (PUCHAR) RingBaseVa + TXD_SIZE;
@@ -225,9 +222,6 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(
pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[index].AllocVa;
pTxD->DMADONE = 1;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
// no pre-allocated buffer required in MgmtRing for scatter-gather case
}
DBGPRINT(RT_DEBUG_TRACE, ("MGMT Ring: total %d entry allocated\n", index));
@@ -310,9 +304,6 @@ NDIS_STATUS RTMPAllocTxRxRingMemory(
pRxD->SDP0 = RTMP_GetPhysicalAddressLow(pDmaBuf->AllocPa);
pRxD->DDONE = 0;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pRxD, TYPE_RXD);
-#endif
}
DBGPRINT(RT_DEBUG_TRACE, ("Rx Ring: total %d entry allocated\n", index));
@@ -423,7 +414,6 @@ VOID RTMPRingCleanUp(
case QID_AC_BE:
case QID_AC_VI:
case QID_AC_VO:
- /*case QID_HCCA:*/
pTxRing = &pAd->TxRing[RingType];
@@ -806,7 +796,7 @@ VOID RT28xx_UpdateBeaconToAsic(
{
- DBGPRINT(RT_DEBUG_ERROR, ("%s() : No valid Interface be found.\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_ERROR, ("%s() : No valid Interface be found.\n", __func__));
return;
}
@@ -824,9 +814,6 @@ VOID RT28xx_UpdateBeaconToAsic(
else
{
ptr = (PUCHAR)&pAd->BeaconTxWI;
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange(ptr, TYPE_TXWI);
-#endif
for (i=0; i<TXWI_SIZE; i+=4) // 16-byte TXWI field
{
UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
@@ -855,7 +842,6 @@ VOID RT28xx_UpdateBeaconToAsic(
}
-#ifdef CONFIG_STA_SUPPORT
VOID RT28xxPciStaAsicForceWakeup(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bFromTx)
@@ -1008,12 +994,11 @@ VOID RT28xxPciStaAsicSleepThenAutoWakeup(
RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x00); // send POWER-SAVE command to MCU. Timeout 40us.
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_DOZE);
- DBGPRINT(RT_DEBUG_TRACE, ("<-- %s, TbttNumToNextWakeUp=%d \n", __FUNCTION__, TbttNumToNextWakeUp));
+ DBGPRINT(RT_DEBUG_TRACE, ("<-- %s, TbttNumToNextWakeUp=%d \n", __func__, TbttNumToNextWakeUp));
}
}
-
VOID PsPollWakeExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
@@ -1024,7 +1009,6 @@ VOID PsPollWakeExec(
unsigned long flags;
DBGPRINT(RT_DEBUG_TRACE,("-->PsPollWakeExec \n"));
-
RTMP_INT_LOCK(&pAd->irq_lock, flags);
if (pAd->Mlme.bPsPollTimerRunning)
{
@@ -1042,7 +1026,6 @@ VOID PsPollWakeExec(
DBGPRINT(RT_DEBUG_TRACE,("<--PsPollWakeExec::3090 calls AsicForceWakeup(pAd, DOT11POWERSAVE) in advance \n"));
AsicForceWakeup(pAd, DOT11POWERSAVE);
}
-
#endif // PCIE_PS_SUPPORT //
}
@@ -1072,8 +1055,6 @@ VOID RadioOnExec(
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
{
DBGPRINT(RT_DEBUG_TRACE,("-->RadioOnExec() return on SCAN_IN_PROGRESS; \n"));
-
-
#ifdef RTMP_PCI_SUPPORT
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
&&pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
@@ -1097,7 +1078,6 @@ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
RTMPRingCleanUp(pAd, QID_AC_BE);
RTMPRingCleanUp(pAd, QID_AC_VI);
RTMPRingCleanUp(pAd, QID_AC_VO);
- /*RTMPRingCleanUp(pAd, QID_HCCA);*/
RTMPRingCleanUp(pAd, QID_MGMT);
RTMPRingCleanUp(pAd, QID_RX);
@@ -1129,11 +1109,12 @@ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
AsicLockChannel(pAd, pAd->CommonCfg.Channel);
}
+
//KH Debug:The following codes should be enclosed by RT3090 compile flag
if (pChipOps->AsicReverseRfFromSleepMode)
pChipOps->AsicReverseRfFromSleepMode(pAd);
+
#ifdef PCIE_PS_SUPPORT
-#ifdef CONFIG_STA_SUPPORT
// 3090 MCU Wakeup command needs more time to be stable.
// Before stable, don't issue other MCU command to prevent from firmware error.
if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
@@ -1144,8 +1125,8 @@ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(p
pAd->brt30xxBanMcuCmd = FALSE;
RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
}
-#endif // CONFIG_STA_SUPPORT //
#endif // PCIE_PS_SUPPORT //
+
// Clear Radio off flag
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
@@ -1162,8 +1143,6 @@ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(p
RT28xxPciAsicRadioOff(pAd, GUIRADIO_OFF, 0);
}
}
-#endif // CONFIG_STA_SUPPORT //
-
/*
==========================================================================
@@ -1181,19 +1160,16 @@ BOOLEAN RT28xxPciAsicRadioOn(
IN UCHAR Level)
{
//WPDMA_GLO_CFG_STRUC DmaCfg;
-#ifdef CONFIG_STA_SUPPORT
BOOLEAN Cancelled;
-#endif // CONFIG_STA_SUPPORT //
//UINT32 MACValue;
if (pAd->OpMode == OPMODE_AP && Level==DOT11POWERSAVE)
return FALSE;
-#ifdef CONFIG_STA_SUPPORT
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
- {
+ {
pAd->Mlme.bPsPollTimerRunning = FALSE;
RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
}
@@ -1225,17 +1201,14 @@ if (!(((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_
{
pAd->bPCIclkOff = FALSE;
DBGPRINT(RT_DEBUG_TRACE, ("PSM :309xbPCIclkOff == %d\n", pAd->bPCIclkOff));
-
}
-#endif // CONFIG_STA_SUPPORT //
// 2. Send wake up command.
AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02);
- pAd->bPCIclkOff = FALSE;
+ pAd->bPCIclkOff = FALSE;
// 2-1. wait command ok.
AsicCheckCommanOk(pAd, PowerWakeCID);
RTMP_ASIC_INTERRUPT_ENABLE(pAd);
-
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
if (Level == GUI_IDLE_POWER_SAVE)
{
@@ -1248,7 +1221,6 @@ if (!(((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_
if (pChipOps->AsicReverseRfFromSleepMode)
pChipOps->AsicReverseRfFromSleepMode(pAd);
-#ifdef CONFIG_STA_SUPPORT
// 3090 MCU Wakeup command needs more time to be stable.
// Before stable, don't issue other MCU command to prevent from firmware error.
if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
@@ -1259,15 +1231,12 @@ if (!(((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_
pAd->brt30xxBanMcuCmd = FALSE;
RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
}
-#endif // CONFIG_STA_SUPPORT //
}
else
// end johnli
#endif // PCIE_PS_SUPPORT //
{
// In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (INFRA_ON(pAd) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
&& (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
@@ -1283,7 +1252,7 @@ if (!(((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_
AsicLockChannel(pAd, pAd->CommonCfg.Channel);
}
}
-#endif // CONFIG_STA_SUPPORT //
+
}
}
return TRUE;
@@ -1308,10 +1277,8 @@ BOOLEAN RT28xxPciAsicRadioOff(
IN UCHAR Level,
IN USHORT TbttNumToNextWakeUp)
{
-#ifdef CONFIG_STA_SUPPORT
WPDMA_GLO_CFG_STRUC DmaCfg;
UCHAR i, tempBBP_R3 = 0;
-#endif // CONFIG_STA_SUPPORT //
BOOLEAN brc = FALSE, Cancelled;
UINT32 TbTTTime = 0;
UINT32 PsPollTime = 0/*, MACValue*/;
@@ -1341,12 +1308,9 @@ BOOLEAN RT28xxPciAsicRadioOff(
RTMP_SET_PSFLAG(pAd, fRTMP_PS_DISABLE_TX);
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
&& pAd->OpMode == OPMODE_STA
-#ifdef CONFIG_STA_SUPPORT
&&pAd->StaCfg.PSControl.field.EnableNewPS == TRUE
-#endif // CONFIG_STA_SUPPORT //
)
{
-
RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
@@ -1368,7 +1332,6 @@ BOOLEAN RT28xxPciAsicRadioOff(
{
PsPollTime = (64*TbTTTime- LEAD_TIME*1024)/1000;
#ifdef PCIE_PS_SUPPORT
-#ifdef CONFIG_STA_SUPPORT
if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
&& (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
&& (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
@@ -1376,7 +1339,6 @@ BOOLEAN RT28xxPciAsicRadioOff(
PsPollTime -= 5;
}
else
-#endif // CONFIG_STA_SUPPORT //
#endif // PCIE_PS_SUPPORT //
PsPollTime -= 3;
@@ -1395,16 +1357,15 @@ BOOLEAN RT28xxPciAsicRadioOff(
}
pAd->bPCIclkOffDisableTx = FALSE;
+
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
-#ifdef CONFIG_STA_SUPPORT
// Set to 1R.
if (pAd->Antenna.field.RxPath > 1 && pAd->OpMode == OPMODE_STA)
{
- tempBBP_R3 = (pAd->StaCfg.BBPR3 & 0xE7);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, tempBBP_R3);
+ tempBBP_R3 = (pAd->StaCfg.BBPR3 & 0xE7);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, tempBBP_R3);
}
-#endif // CONFIG_STA_SUPPORT //
// In Radio Off, we turn off RF clk, So now need to call ASICSwitchChannel again.
if ((INFRA_ON(pAd) || pAd->OpMode == OPMODE_AP) && (pAd->CommonCfg.CentralChannel != pAd->CommonCfg.Channel)
@@ -1456,7 +1417,6 @@ BOOLEAN RT28xxPciAsicRadioOff(
AsicCheckCommanOk(pAd, PowerRadioOffCID);
}
-#ifdef CONFIG_STA_SUPPORT
// 1. Wait DMA not busy
i = 0;
do
@@ -1479,14 +1439,12 @@ BOOLEAN RT28xxPciAsicRadioOff(
pAd->CheckDmaBusyCount = 0;
}
*/
-#endif // CONFIG_STA_SUPPORT //
//KH Debug:My original codes have the follwoing codes, but currecnt codes do not have it.
// Disable for stability. If PCIE Link Control is modified for advance power save, re-covery this code segment.
RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x1280);
//OPSTATUS_SET_FLAG(pAd, fOP_STATUS_CLKSELECT_40MHZ);
#ifdef PCIE_PS_SUPPORT
-#ifdef CONFIG_STA_SUPPORT
if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
&& (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
&& (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
@@ -1497,8 +1455,8 @@ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(p
// For this case, doesn't need to below actions, so return here.
return brc;
}
-#endif // CONFIG_STA_SUPPORT //
#endif // PCIE_PS_SUPPORT //
+
if (Level == DOT11POWERSAVE)
{
AUTO_WAKEUP_STRUC AutoWakeupCfg;
@@ -1518,7 +1476,6 @@ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(p
RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
}
-#ifdef CONFIG_STA_SUPPORT
// 4-1. If it's to disable our device. Need to restore PCI Configuration Space to its original value.
if (Level == RTMP_HALT && pAd->OpMode == OPMODE_STA)
{
@@ -1531,7 +1488,6 @@ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(p
if ((brc == TRUE) && (i < 50))
RTMPPCIeLinkCtrlSetting(pAd, 3);
}
-#endif // CONFIG_STA_SUPPORT //
//pAd->bPCIclkOffDisableTx = FALSE;
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_DISABLE_TX);
@@ -1547,24 +1503,21 @@ VOID RT28xxPciMlmeRadioOn(
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__));
- if ((pAd->OpMode == OPMODE_AP) ||
+ if ((pAd->OpMode == OPMODE_AP) ||
((pAd->OpMode == OPMODE_STA)
&& (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
-#ifdef CONFIG_STA_SUPPORT
||pAd->StaCfg.PSControl.field.EnableNewPS == FALSE
-#endif // CONFIG_STA_SUPPORT //
)))
{
- RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
- //NICResetFromError(pAd);
+ RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
+ //NICResetFromError(pAd);
RTMPRingCleanUp(pAd, QID_AC_BK);
RTMPRingCleanUp(pAd, QID_AC_BE);
RTMPRingCleanUp(pAd, QID_AC_VI);
RTMPRingCleanUp(pAd, QID_AC_VO);
- /*RTMPRingCleanUp(pAd, QID_HCCA);*/
RTMPRingCleanUp(pAd, QID_MGMT);
RTMPRingCleanUp(pAd, QID_RX);
@@ -1573,12 +1526,13 @@ VOID RT28xxPciMlmeRadioOn(
// Clear Radio off flag
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+
// Set LED
RTMPSetLED(pAd, LED_RADIO_ON);
}
-#ifdef CONFIG_STA_SUPPORT
if ((pAd->OpMode == OPMODE_STA) &&
(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
&&(pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
@@ -1592,7 +1546,6 @@ VOID RT28xxPciMlmeRadioOn(
RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 40);
}
-#endif // CONFIG_STA_SUPPORT //
}
@@ -1604,7 +1557,6 @@ VOID RT28xxPciMlmeRadioOFF(
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
return;
-#ifdef CONFIG_STA_SUPPORT
// Link down first if any association exists
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
{
@@ -1630,17 +1582,12 @@ VOID RT28xxPciMlmeRadioOFF(
}
}
}
-#endif // CONFIG_STA_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__));
- // Set LED
- //RTMPSetLED(pAd, LED_RADIO_OFF);
// Set Radio off flag
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
BOOLEAN Cancelled;
if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
@@ -1679,19 +1626,18 @@ VOID RT28xxPciMlmeRadioOFF(
// Clean up old bss table
BssTableInit(&pAd->ScanTab);
- /*
+ /*
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10);
return;
}
- */
+ */
}
-#endif // CONFIG_STA_SUPPORT //
+
// Set LED.Move to here for fixing LED bug. This flag must be called after LinkDown
RTMPSetLED(pAd, LED_RADIO_OFF);
-#ifdef CONFIG_STA_SUPPORT
//KH Debug:All PCIe devices need to use timer to execute radio off function, or the PCIe&&EnableNewPS needs.
//KH Ans:It is right, because only when the PCIe and EnableNewPs is true, we need to delay the RadioOffTimer
//to avoid the deadlock with PCIe Power saving function.
@@ -1702,55 +1648,15 @@ if (pAd->OpMode == OPMODE_STA&&
RTMPSetTimer(&pAd->Mlme.RadioOnOffTimer, 10);
}
else
-#endif // CONFIG_STA_SUPPORT //
{
-
-
- brc=RT28xxPciAsicRadioOff(pAd, GUIRADIO_OFF, 0);
+ brc=RT28xxPciAsicRadioOff(pAd, GUIRADIO_OFF, 0);
if (brc==FALSE)
{
- DBGPRINT(RT_DEBUG_ERROR,("%s call RT28xxPciAsicRadioOff fail !!\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_ERROR,("%s call RT28xxPciAsicRadioOff fail !!\n", __func__));
}
}
/*
- // Disable Tx/Rx DMA
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
- GloCfg.field.EnableTxDMA = 0;
- GloCfg.field.EnableRxDMA = 0;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
-
-
- // MAC_SYS_CTRL => value = 0x0 => 40mA
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0);
-
- // PWR_PIN_CFG => value = 0x0 => 40mA
- RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0);
-
- // TX_PIN_CFG => value = 0x0 => 20mA
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, 0);
-
- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
- {
- // Must using 40MHz.
- AsicTurnOffRFClk(pAd, pAd->CommonCfg.CentralChannel);
- }
- else
- {
- // Must using 20MHz.
- AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
- }
-
- // Waiting for DMA idle
- i = 0;
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- RTMPusecDelay(1000);
- }while (i++ < 100);
*/
}
diff --git a/drivers/staging/rt2860/common/cmm_mac_usb.c b/drivers/staging/rt2860/common/cmm_mac_usb.c
new file mode 100644
index 000000000000..ad8c60176472
--- /dev/null
+++ b/drivers/staging/rt2860/common/cmm_mac_usb.c
@@ -0,0 +1,1216 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+*/
+
+#ifdef RTMP_MAC_USB
+
+
+#include "../rt_config.h"
+
+
+/*
+========================================================================
+Routine Description:
+ Initialize receive data structures.
+
+Arguments:
+ pAd Pointer to our adapter
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+ NDIS_STATUS_RESOURCES
+
+Note:
+ Initialize all receive releated private buffer, include those define
+ in RTMP_ADAPTER structure and all private data structures. The mahor
+ work is to allocate buffer for each packet and chain buffer to
+ NDIS packet descriptor.
+========================================================================
+*/
+NDIS_STATUS NICInitRecv(
+ IN PRTMP_ADAPTER pAd)
+{
+ UCHAR i;
+ NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
+ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+
+
+ DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n"));
+ pObj = pObj;
+
+ //InterlockedExchange(&pAd->PendingRx, 0);
+ pAd->PendingRx = 0;
+ pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index
+ pAd->NextRxBulkInIndex = 0 ; //RX_RING_SIZE -1; // Rx Bulk pointer
+ pAd->NextRxBulkInPosition = 0;
+
+ for (i = 0; i < (RX_RING_SIZE); i++)
+ {
+ PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
+
+ //Allocate URB
+ pRxContext->pUrb = RTUSB_ALLOC_URB(0);
+ if (pRxContext->pUrb == NULL)
+ {
+ Status = NDIS_STATUS_RESOURCES;
+ goto out1;
+ }
+
+ // Allocate transfer buffer
+ pRxContext->TransferBuffer = RTUSB_URB_ALLOC_BUFFER(pObj->pUsb_Dev, MAX_RXBULK_SIZE, &pRxContext->data_dma);
+ if (pRxContext->TransferBuffer == NULL)
+ {
+ Status = NDIS_STATUS_RESOURCES;
+ goto out1;
+ }
+
+ NdisZeroMemory(pRxContext->TransferBuffer, MAX_RXBULK_SIZE);
+
+ pRxContext->pAd = pAd;
+ pRxContext->pIrp = NULL;
+ pRxContext->InUse = FALSE;
+ pRxContext->IRPPending = FALSE;
+ pRxContext->Readable = FALSE;
+ //pRxContext->ReorderInUse = FALSE;
+ pRxContext->bRxHandling = FALSE;
+ pRxContext->BulkInOffset = 0;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitRecv(Status=%d)\n", Status));
+ return Status;
+
+out1:
+ for (i = 0; i < (RX_RING_SIZE); i++)
+ {
+ PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
+
+ if (NULL != pRxContext->TransferBuffer)
+ {
+ RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, MAX_RXBULK_SIZE,
+ pRxContext->TransferBuffer, pRxContext->data_dma);
+ pRxContext->TransferBuffer = NULL;
+ }
+
+ if (NULL != pRxContext->pUrb)
+ {
+ RTUSB_UNLINK_URB(pRxContext->pUrb);
+ RTUSB_FREE_URB(pRxContext->pUrb);
+ pRxContext->pUrb = NULL;
+ }
+ }
+
+ return Status;
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Initialize transmit data structures.
+
+Arguments:
+ pAd Pointer to our adapter
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+ NDIS_STATUS_RESOURCES
+
+Note:
+========================================================================
+*/
+NDIS_STATUS NICInitTransmit(
+ IN PRTMP_ADAPTER pAd)
+{
+#define LM_USB_ALLOC(pObj, Context, TB_Type, BufferSize, Status, msg1, err1, msg2, err2) \
+ Context->pUrb = RTUSB_ALLOC_URB(0); \
+ if (Context->pUrb == NULL) { \
+ DBGPRINT(RT_DEBUG_ERROR, msg1); \
+ Status = NDIS_STATUS_RESOURCES; \
+ goto err1; } \
+ \
+ Context->TransferBuffer = \
+ (TB_Type)RTUSB_URB_ALLOC_BUFFER(pObj->pUsb_Dev, BufferSize, &Context->data_dma); \
+ if (Context->TransferBuffer == NULL) { \
+ DBGPRINT(RT_DEBUG_ERROR, msg2); \
+ Status = NDIS_STATUS_RESOURCES; \
+ goto err2; }
+
+#define LM_URB_FREE(pObj, Context, BufferSize) \
+ if (NULL != Context->pUrb) { \
+ RTUSB_UNLINK_URB(Context->pUrb); \
+ RTUSB_FREE_URB(Context->pUrb); \
+ Context->pUrb = NULL; } \
+ if (NULL != Context->TransferBuffer) { \
+ RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, BufferSize, \
+ Context->TransferBuffer, \
+ Context->data_dma); \
+ Context->TransferBuffer = NULL; }
+
+ UCHAR i, acidx;
+ NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
+ PTX_CONTEXT pNullContext = &(pAd->NullContext);
+ PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
+ PTX_CONTEXT pRTSContext = &(pAd->RTSContext);
+ PTX_CONTEXT pMLMEContext = NULL;
+// PHT_TX_CONTEXT pHTTXContext = NULL;
+ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+ PVOID RingBaseVa;
+// RTMP_TX_RING *pTxRing;
+ RTMP_MGMT_RING *pMgmtRing;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitTransmit\n"));
+ pObj = pObj;
+
+ // Init 4 set of Tx parameters
+ for(acidx = 0; acidx < NUM_OF_TX_RING; acidx++)
+ {
+ // Initialize all Transmit releated queues
+ InitializeQueueHeader(&pAd->TxSwQueue[acidx]);
+
+ // Next Local tx ring pointer waiting for buck out
+ pAd->NextBulkOutIndex[acidx] = acidx;
+ pAd->BulkOutPending[acidx] = FALSE; // Buck Out control flag
+ //pAd->DataBulkDoneIdx[acidx] = 0;
+ }
+
+ //pAd->NextMLMEIndex = 0;
+ //pAd->PushMgmtIndex = 0;
+ //pAd->PopMgmtIndex = 0;
+ //InterlockedExchange(&pAd->MgmtQueueSize, 0);
+ //InterlockedExchange(&pAd->TxCount, 0);
+
+ //pAd->PrioRingFirstIndex = 0;
+ //pAd->PrioRingTxCnt = 0;
+
+ do
+ {
+ //
+ // TX_RING_SIZE, 4 ACs
+ //
+ for(acidx=0; acidx<4; acidx++)
+ {
+ PHT_TX_CONTEXT pHTTXContext = &(pAd->TxContext[acidx]);
+
+ NdisZeroMemory(pHTTXContext, sizeof(HT_TX_CONTEXT));
+ //Allocate URB
+ LM_USB_ALLOC(pObj, pHTTXContext, PHTTX_BUFFER, sizeof(HTTX_BUFFER), Status,
+ ("<-- ERROR in Alloc TX TxContext[%d] urb!! \n", acidx),
+ done,
+ ("<-- ERROR in Alloc TX TxContext[%d] HTTX_BUFFER !! \n", acidx),
+ out1);
+
+ NdisZeroMemory(pHTTXContext->TransferBuffer->Aggregation, 4);
+ pHTTXContext->pAd = pAd;
+ pHTTXContext->pIrp = NULL;
+ pHTTXContext->IRPPending = FALSE;
+ pHTTXContext->NextBulkOutPosition = 0;
+ pHTTXContext->ENextBulkOutPosition = 0;
+ pHTTXContext->CurWritePosition = 0;
+ pHTTXContext->CurWriteRealPos = 0;
+ pHTTXContext->BulkOutSize = 0;
+ pHTTXContext->BulkOutPipeId = acidx;
+ pHTTXContext->bRingEmpty = TRUE;
+ pHTTXContext->bCopySavePad = FALSE;
+ pAd->BulkOutPending[acidx] = FALSE;
+ }
+
+
+ //
+ // MGMT_RING_SIZE
+ //
+
+ // Allocate MGMT ring descriptor's memory
+ pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * sizeof(TX_CONTEXT);
+ os_alloc_mem(pAd, (PUCHAR *)(&pAd->MgmtDescRing.AllocVa), pAd->MgmtDescRing.AllocSize);
+ if (pAd->MgmtDescRing.AllocVa == NULL)
+ {
+ DBGPRINT_ERR(("Failed to allocate a big buffer for MgmtDescRing!\n"));
+ Status = NDIS_STATUS_RESOURCES;
+ goto out1;
+ }
+ NdisZeroMemory(pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize);
+ RingBaseVa = pAd->MgmtDescRing.AllocVa;
+
+ // Initialize MGMT Ring and associated buffer memory
+ pMgmtRing = &pAd->MgmtRing;
+ for (i = 0; i < MGMT_RING_SIZE; i++)
+ {
+ // link the pre-allocated Mgmt buffer to MgmtRing.Cell
+ pMgmtRing->Cell[i].AllocSize = sizeof(TX_CONTEXT);
+ pMgmtRing->Cell[i].AllocVa = RingBaseVa;
+ pMgmtRing->Cell[i].pNdisPacket = NULL;
+ pMgmtRing->Cell[i].pNextNdisPacket = NULL;
+
+ //Allocate URB for MLMEContext
+ pMLMEContext = (PTX_CONTEXT) pAd->MgmtRing.Cell[i].AllocVa;
+ pMLMEContext->pUrb = RTUSB_ALLOC_URB(0);
+ if (pMLMEContext->pUrb == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("<-- ERROR in Alloc TX MLMEContext[%d] urb!! \n", i));
+ Status = NDIS_STATUS_RESOURCES;
+ goto out2;
+ }
+ pMLMEContext->pAd = pAd;
+ pMLMEContext->pIrp = NULL;
+ pMLMEContext->TransferBuffer = NULL;
+ pMLMEContext->InUse = FALSE;
+ pMLMEContext->IRPPending = FALSE;
+ pMLMEContext->bWaitingBulkOut = FALSE;
+ pMLMEContext->BulkOutSize = 0;
+ pMLMEContext->SelfIdx = i;
+
+ // Offset to next ring descriptor address
+ RingBaseVa = (PUCHAR) RingBaseVa + sizeof(TX_CONTEXT);
+ }
+ DBGPRINT(RT_DEBUG_TRACE, ("MGMT Ring: total %d entry allocated\n", i));
+
+ //pAd->MgmtRing.TxSwFreeIdx = (MGMT_RING_SIZE - 1);
+ pAd->MgmtRing.TxSwFreeIdx = MGMT_RING_SIZE;
+ pAd->MgmtRing.TxCpuIdx = 0;
+ pAd->MgmtRing.TxDmaIdx = 0;
+
+ //
+ // BEACON_RING_SIZE
+ //
+ for(i=0; i<BEACON_RING_SIZE; i++) // 2
+ {
+ PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
+
+
+ NdisZeroMemory(pBeaconContext, sizeof(TX_CONTEXT));
+
+ //Allocate URB
+ LM_USB_ALLOC(pObj, pBeaconContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
+ ("<-- ERROR in Alloc TX BeaconContext[%d] urb!! \n", i),
+ out2,
+ ("<-- ERROR in Alloc TX BeaconContext[%d] TX_BUFFER !! \n", i),
+ out3);
+
+ pBeaconContext->pAd = pAd;
+ pBeaconContext->pIrp = NULL;
+ pBeaconContext->InUse = FALSE;
+ pBeaconContext->IRPPending = FALSE;
+ }
+
+ //
+ // NullContext
+ //
+ NdisZeroMemory(pNullContext, sizeof(TX_CONTEXT));
+
+ //Allocate URB
+ LM_USB_ALLOC(pObj, pNullContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
+ ("<-- ERROR in Alloc TX NullContext urb!! \n"),
+ out3,
+ ("<-- ERROR in Alloc TX NullContext TX_BUFFER !! \n"),
+ out4);
+
+ pNullContext->pAd = pAd;
+ pNullContext->pIrp = NULL;
+ pNullContext->InUse = FALSE;
+ pNullContext->IRPPending = FALSE;
+
+ //
+ // RTSContext
+ //
+ NdisZeroMemory(pRTSContext, sizeof(TX_CONTEXT));
+
+ //Allocate URB
+ LM_USB_ALLOC(pObj, pRTSContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
+ ("<-- ERROR in Alloc TX RTSContext urb!! \n"),
+ out4,
+ ("<-- ERROR in Alloc TX RTSContext TX_BUFFER !! \n"),
+ out5);
+
+ pRTSContext->pAd = pAd;
+ pRTSContext->pIrp = NULL;
+ pRTSContext->InUse = FALSE;
+ pRTSContext->IRPPending = FALSE;
+
+ //
+ // PsPollContext
+ //
+ //NdisZeroMemory(pPsPollContext, sizeof(TX_CONTEXT));
+ //Allocate URB
+ LM_USB_ALLOC(pObj, pPsPollContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
+ ("<-- ERROR in Alloc TX PsPollContext urb!! \n"),
+ out5,
+ ("<-- ERROR in Alloc TX PsPollContext TX_BUFFER !! \n"),
+ out6);
+
+ pPsPollContext->pAd = pAd;
+ pPsPollContext->pIrp = NULL;
+ pPsPollContext->InUse = FALSE;
+ pPsPollContext->IRPPending = FALSE;
+ pPsPollContext->bAggregatible = FALSE;
+ pPsPollContext->LastOne = TRUE;
+
+ } while (FALSE);
+
+
+done:
+ DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitTransmit(Status=%d)\n", Status));
+
+ return Status;
+
+ /* --------------------------- ERROR HANDLE --------------------------- */
+out6:
+ LM_URB_FREE(pObj, pPsPollContext, sizeof(TX_BUFFER));
+
+out5:
+ LM_URB_FREE(pObj, pRTSContext, sizeof(TX_BUFFER));
+
+out4:
+ LM_URB_FREE(pObj, pNullContext, sizeof(TX_BUFFER));
+
+out3:
+ for(i=0; i<BEACON_RING_SIZE; i++)
+ {
+ PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
+ if (pBeaconContext)
+ LM_URB_FREE(pObj, pBeaconContext, sizeof(TX_BUFFER));
+ }
+
+out2:
+ if (pAd->MgmtDescRing.AllocVa)
+ {
+ pMgmtRing = &pAd->MgmtRing;
+ for(i=0; i<MGMT_RING_SIZE; i++)
+ {
+ pMLMEContext = (PTX_CONTEXT) pAd->MgmtRing.Cell[i].AllocVa;
+ if (pMLMEContext)
+ LM_URB_FREE(pObj, pMLMEContext, sizeof(TX_BUFFER));
+ }
+ os_free_mem(pAd, pAd->MgmtDescRing.AllocVa);
+ pAd->MgmtDescRing.AllocVa = NULL;
+ }
+
+out1:
+ for (acidx = 0; acidx < 4; acidx++)
+ {
+ PHT_TX_CONTEXT pTxContext = &(pAd->TxContext[acidx]);
+ if (pTxContext)
+ LM_URB_FREE(pObj, pTxContext, sizeof(HTTX_BUFFER));
+ }
+
+ // Here we didn't have any pre-allocated memory need to free.
+
+ return Status;
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Allocate DMA memory blocks for send, receive.
+
+Arguments:
+ pAd Pointer to our adapter
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+ NDIS_STATUS_FAILURE
+ NDIS_STATUS_RESOURCES
+
+Note:
+========================================================================
+*/
+NDIS_STATUS RTMPAllocTxRxRingMemory(
+ IN PRTMP_ADAPTER pAd)
+{
+// COUNTER_802_11 pCounter = &pAd->WlanCounters;
+ NDIS_STATUS Status;
+ INT num;
+
+
+ DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n"));
+
+
+ do
+ {
+ // Init the CmdQ and CmdQLock
+ NdisAllocateSpinLock(&pAd->CmdQLock);
+ NdisAcquireSpinLock(&pAd->CmdQLock);
+ RTUSBInitializeCmdQ(&pAd->CmdQ);
+ NdisReleaseSpinLock(&pAd->CmdQLock);
+
+
+ NdisAllocateSpinLock(&pAd->MLMEBulkOutLock);
+ //NdisAllocateSpinLock(&pAd->MLMEWaitQueueLock);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[0]);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[1]);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[2]);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[3]);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[4]);
+ NdisAllocateSpinLock(&pAd->BulkOutLock[5]);
+ NdisAllocateSpinLock(&pAd->BulkInLock);
+
+ for (num = 0; num < NUM_OF_TX_RING; num++)
+ {
+ NdisAllocateSpinLock(&pAd->TxContextQueueLock[num]);
+ }
+
+
+// NdisAllocateSpinLock(&pAd->MemLock); // Not used in RT28XX
+
+// NdisAllocateSpinLock(&pAd->MacTabLock); // init it in UserCfgInit()
+// NdisAllocateSpinLock(&pAd->BATabLock); // init it in BATableInit()
+
+// for(num=0; num<MAX_LEN_OF_BA_REC_TABLE; num++)
+// {
+// NdisAllocateSpinLock(&pAd->BATable.BARecEntry[num].RxReRingLock);
+// }
+
+ //
+ // Init Mac Table
+ //
+// MacTableInitialize(pAd);
+
+ //
+ // Init send data structures and related parameters
+ //
+ Status = NICInitTransmit(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ break;
+
+ //
+ // Init receive data structures and related parameters
+ //
+ Status = NICInitRecv(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ break;
+
+ pAd->PendingIoCount = 1;
+
+ } while (FALSE);
+
+ NdisZeroMemory(&pAd->FragFrame, sizeof(FRAGMENT_FRAME));
+ pAd->FragFrame.pFragPacket = RTMP_AllocateFragPacketBuffer(pAd, RX_BUFFER_NORMSIZE);
+
+ if (pAd->FragFrame.pFragPacket == NULL)
+ {
+ Status = NDIS_STATUS_RESOURCES;
+ }
+
+ DBGPRINT_S(Status, ("<-- RTMPAllocTxRxRingMemory, Status=%x\n", Status));
+ return Status;
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Calls USB_InterfaceStop and frees memory allocated for the URBs
+ calls NdisMDeregisterDevice and frees the memory
+ allocated in VNetInitialize for the Adapter Object
+
+Arguments:
+ *pAd the raxx interface data pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+VOID RTMPFreeTxRxRingMemory(
+ IN PRTMP_ADAPTER pAd)
+{
+#define LM_URB_FREE(pObj, Context, BufferSize) \
+ if (NULL != Context->pUrb) { \
+ RTUSB_UNLINK_URB(Context->pUrb); \
+ RTUSB_FREE_URB(Context->pUrb); \
+ Context->pUrb = NULL; } \
+ if (NULL != Context->TransferBuffer) { \
+ RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, BufferSize, \
+ Context->TransferBuffer, \
+ Context->data_dma); \
+ Context->TransferBuffer = NULL; }
+
+
+ UINT i, acidx;
+ PTX_CONTEXT pNullContext = &pAd->NullContext;
+ PTX_CONTEXT pPsPollContext = &pAd->PsPollContext;
+ PTX_CONTEXT pRTSContext = &pAd->RTSContext;
+// PHT_TX_CONTEXT pHTTXContext;
+ //PRTMP_REORDERBUF pReorderBuf;
+ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+// RTMP_TX_RING *pTxRing;
+
+ DBGPRINT(RT_DEBUG_ERROR, ("---> RTMPFreeTxRxRingMemory\n"));
+ pObj = pObj;
+
+ // Free all resources for the RECEIVE buffer queue.
+ for(i=0; i<(RX_RING_SIZE); i++)
+ {
+ PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
+ if (pRxContext)
+ LM_URB_FREE(pObj, pRxContext, MAX_RXBULK_SIZE);
+ }
+
+ // Free PsPoll frame resource
+ LM_URB_FREE(pObj, pPsPollContext, sizeof(TX_BUFFER));
+
+ // Free NULL frame resource
+ LM_URB_FREE(pObj, pNullContext, sizeof(TX_BUFFER));
+
+ // Free RTS frame resource
+ LM_URB_FREE(pObj, pRTSContext, sizeof(TX_BUFFER));
+
+
+ // Free beacon frame resource
+ for(i=0; i<BEACON_RING_SIZE; i++)
+ {
+ PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
+ if (pBeaconContext)
+ LM_URB_FREE(pObj, pBeaconContext, sizeof(TX_BUFFER));
+ }
+
+
+ // Free mgmt frame resource
+ for(i = 0; i < MGMT_RING_SIZE; i++)
+ {
+ PTX_CONTEXT pMLMEContext = (PTX_CONTEXT)pAd->MgmtRing.Cell[i].AllocVa;
+ //LM_URB_FREE(pObj, pMLMEContext, sizeof(TX_BUFFER));
+ if (NULL != pAd->MgmtRing.Cell[i].pNdisPacket)
+ {
+ RTMPFreeNdisPacket(pAd, pAd->MgmtRing.Cell[i].pNdisPacket);
+ pAd->MgmtRing.Cell[i].pNdisPacket = NULL;
+ pMLMEContext->TransferBuffer = NULL;
+ }
+
+ if (pMLMEContext)
+ {
+ if (NULL != pMLMEContext->pUrb)
+ {
+ RTUSB_UNLINK_URB(pMLMEContext->pUrb);
+ RTUSB_FREE_URB(pMLMEContext->pUrb);
+ pMLMEContext->pUrb = NULL;
+ }
+ }
+ }
+ if (pAd->MgmtDescRing.AllocVa)
+ os_free_mem(pAd, pAd->MgmtDescRing.AllocVa);
+
+
+ // Free Tx frame resource
+ for (acidx = 0; acidx < 4; acidx++)
+ {
+ PHT_TX_CONTEXT pHTTXContext = &(pAd->TxContext[acidx]);
+ if (pHTTXContext)
+ LM_URB_FREE(pObj, pHTTXContext, sizeof(HTTX_BUFFER));
+ }
+
+ if (pAd->FragFrame.pFragPacket)
+ RELEASE_NDIS_PACKET(pAd, pAd->FragFrame.pFragPacket, NDIS_STATUS_SUCCESS);
+
+ for(i=0; i<6; i++)
+ {
+ NdisFreeSpinLock(&pAd->BulkOutLock[i]);
+ }
+
+ NdisFreeSpinLock(&pAd->BulkInLock);
+ NdisFreeSpinLock(&pAd->MLMEBulkOutLock);
+
+ NdisFreeSpinLock(&pAd->CmdQLock);
+ // Clear all pending bulk-out request flags.
+ RTUSB_CLEAR_BULK_FLAG(pAd, 0xffffffff);
+
+// NdisFreeSpinLock(&pAd->MacTabLock);
+
+// for(i=0; i<MAX_LEN_OF_BA_REC_TABLE; i++)
+// {
+// NdisFreeSpinLock(&pAd->BATable.BARecEntry[i].RxReRingLock);
+// }
+
+ DBGPRINT(RT_DEBUG_ERROR, ("<--- RTMPFreeTxRxRingMemory\n"));
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Write WLAN MAC address to USB 2870.
+
+Arguments:
+ pAd Pointer to our adapter
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+
+Note:
+========================================================================
+*/
+NDIS_STATUS RTUSBWriteHWMACAddress(
+ IN PRTMP_ADAPTER pAd)
+{
+ MAC_DW0_STRUC StaMacReg0;
+ MAC_DW1_STRUC StaMacReg1;
+ NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
+ LARGE_INTEGER NOW;
+
+
+ // initialize the random number generator
+ RTMP_GetCurrentSystemTime(&NOW);
+
+ if (pAd->bLocalAdminMAC != TRUE)
+ {
+ pAd->CurrentAddress[0] = pAd->PermanentAddress[0];
+ pAd->CurrentAddress[1] = pAd->PermanentAddress[1];
+ pAd->CurrentAddress[2] = pAd->PermanentAddress[2];
+ pAd->CurrentAddress[3] = pAd->PermanentAddress[3];
+ pAd->CurrentAddress[4] = pAd->PermanentAddress[4];
+ pAd->CurrentAddress[5] = pAd->PermanentAddress[5];
+ }
+ // Write New MAC address to MAC_CSR2 & MAC_CSR3 & let ASIC know our new MAC
+ StaMacReg0.field.Byte0 = pAd->CurrentAddress[0];
+ StaMacReg0.field.Byte1 = pAd->CurrentAddress[1];
+ StaMacReg0.field.Byte2 = pAd->CurrentAddress[2];
+ StaMacReg0.field.Byte3 = pAd->CurrentAddress[3];
+ StaMacReg1.field.Byte4 = pAd->CurrentAddress[4];
+ StaMacReg1.field.Byte5 = pAd->CurrentAddress[5];
+ StaMacReg1.field.U2MeMask = 0xff;
+ DBGPRINT_RAW(RT_DEBUG_TRACE, ("Local MAC = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ pAd->CurrentAddress[0], pAd->CurrentAddress[1], pAd->CurrentAddress[2],
+ pAd->CurrentAddress[3], pAd->CurrentAddress[4], pAd->CurrentAddress[5]));
+
+ RTUSBWriteMACRegister(pAd, MAC_ADDR_DW0, StaMacReg0.word);
+ RTUSBWriteMACRegister(pAd, MAC_ADDR_DW1, StaMacReg1.word);
+ return Status;
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Disable DMA.
+
+Arguments:
+ *pAd the raxx interface data pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+VOID RT28XXDMADisable(
+ IN RTMP_ADAPTER *pAd)
+{
+ // no use
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Enable DMA.
+
+Arguments:
+ *pAd the raxx interface data pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+VOID RT28XXDMAEnable(
+ IN RTMP_ADAPTER *pAd)
+{
+ WPDMA_GLO_CFG_STRUC GloCfg;
+ USB_DMA_CFG_STRUC UsbCfg;
+ int i = 0;
+
+
+ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x4);
+ do
+ {
+ RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
+ if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
+ break;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("==> DMABusy\n"));
+ RTMPusecDelay(1000);
+ i++;
+ }while ( i <200);
+
+
+ RTMPusecDelay(50);
+ GloCfg.field.EnTXWriteBackDDONE = 1;
+ GloCfg.field.EnableRxDMA = 1;
+ GloCfg.field.EnableTxDMA = 1;
+ DBGPRINT(RT_DEBUG_TRACE, ("<== WRITE DMA offset 0x208 = 0x%x\n", GloCfg.word));
+ RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
+
+ UsbCfg.word = 0;
+ UsbCfg.field.phyclear = 0;
+ /* usb version is 1.1,do not use bulk in aggregation */
+ if (pAd->BulkInMaxPacketSize == 512)
+ UsbCfg.field.RxBulkAggEn = 1;
+ /* for last packet, PBF might use more than limited, so minus 2 to prevent from error */
+ UsbCfg.field.RxBulkAggLmt = (MAX_RXBULK_SIZE /1024)-3;
+ UsbCfg.field.RxBulkAggTOut = 0x80; /* 2006-10-18 */
+ UsbCfg.field.RxBulkEn = 1;
+ UsbCfg.field.TxBulkEn = 1;
+
+ RTUSBWriteMACRegister(pAd, USB_DMA_CFG, UsbCfg.word);
+
+}
+
+/********************************************************************
+ *
+ * 2870 Beacon Update Related functions.
+ *
+ ********************************************************************/
+
+/*
+========================================================================
+Routine Description:
+ Write Beacon buffer to Asic.
+
+Arguments:
+ *pAd the raxx interface data pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+VOID RT28xx_UpdateBeaconToAsic(
+ IN RTMP_ADAPTER *pAd,
+ IN INT apidx,
+ IN ULONG FrameLen,
+ IN ULONG UpdatePos)
+{
+ PUCHAR pBeaconFrame = NULL;
+ UCHAR *ptr;
+ UINT i, padding;
+ BEACON_SYNC_STRUCT *pBeaconSync = pAd->CommonCfg.pBeaconSync;
+ UINT32 longValue;
+// USHORT shortValue;
+ BOOLEAN bBcnReq = FALSE;
+ UCHAR bcn_idx = 0;
+
+
+ if (pBeaconFrame == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR,("pBeaconFrame is NULL!\n"));
+ return;
+ }
+
+ if (pBeaconSync == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR,("pBeaconSync is NULL!\n"));
+ return;
+ }
+
+ //if ((pAd->WdsTab.Mode == WDS_BRIDGE_MODE) ||
+ // ((pAd->ApCfg.MBSSID[apidx].MSSIDDev == NULL) || !(pAd->ApCfg.MBSSID[apidx].MSSIDDev->flags & IFF_UP))
+ // )
+ if (bBcnReq == FALSE)
+ {
+ /* when the ra interface is down, do not send its beacon frame */
+ /* clear all zero */
+ for(i=0; i<TXWI_SIZE; i+=4) {
+ RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, 0x00);
+ }
+ pBeaconSync->BeaconBitMap &= (~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
+ NdisZeroMemory(pBeaconSync->BeaconTxWI[bcn_idx], TXWI_SIZE);
+ }
+ else
+ {
+ ptr = (PUCHAR)&pAd->BeaconTxWI;
+ if (NdisEqualMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE) == FALSE)
+ { // If BeaconTxWI changed, we need to rewrite the TxWI for the Beacon frames.
+ pBeaconSync->BeaconBitMap &= (~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
+ NdisMoveMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE);
+ }
+
+ if ((pBeaconSync->BeaconBitMap & (1 << bcn_idx)) != (1 << bcn_idx))
+ {
+ for (i=0; i<TXWI_SIZE; i+=4) // 16-byte TXWI field
+ {
+ longValue = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
+ RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, longValue);
+ ptr += 4;
+ }
+ }
+
+ ptr = pBeaconSync->BeaconBuf[bcn_idx];
+ padding = (FrameLen & 0x01);
+ NdisZeroMemory((PUCHAR)(pBeaconFrame + FrameLen), padding);
+ FrameLen += padding;
+ for (i = 0 ; i < FrameLen /*HW_BEACON_OFFSET*/; i += 2)
+ {
+ if (NdisEqualMemory(ptr, pBeaconFrame, 2) == FALSE)
+ {
+ NdisMoveMemory(ptr, pBeaconFrame, 2);
+ //shortValue = *ptr + (*(ptr+1)<<8);
+ //RTMP_IO_WRITE8(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, shortValue);
+ RTUSBMultiWrite(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, ptr, 2);
+ }
+ ptr +=2;
+ pBeaconFrame += 2;
+ }
+
+ pBeaconSync->BeaconBitMap |= (1 << bcn_idx);
+
+ // For AP interface, set the DtimBitOn so that we can send Bcast/Mcast frame out after this beacon frame.
+}
+
+}
+
+
+VOID RTUSBBssBeaconStop(
+ IN RTMP_ADAPTER *pAd)
+{
+ BEACON_SYNC_STRUCT *pBeaconSync;
+ int i, offset;
+ BOOLEAN Cancelled = TRUE;
+
+ pBeaconSync = pAd->CommonCfg.pBeaconSync;
+ if (pBeaconSync && pBeaconSync->EnableBeacon)
+ {
+ INT NumOfBcn;
+
+ {
+ NumOfBcn = MAX_MESH_NUM;
+ }
+
+ RTMPCancelTimer(&pAd->CommonCfg.BeaconUpdateTimer, &Cancelled);
+
+ for(i=0; i<NumOfBcn; i++)
+ {
+ NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
+ NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
+
+ for (offset=0; offset<HW_BEACON_OFFSET; offset+=4)
+ RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[i] + offset, 0x00);
+
+ pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
+ pBeaconSync->TimIELocationInBeacon[i] = 0;
+ }
+ pBeaconSync->BeaconBitMap = 0;
+ pBeaconSync->DtimBitOn = 0;
+ }
+}
+
+
+VOID RTUSBBssBeaconStart(
+ IN RTMP_ADAPTER *pAd)
+{
+ int apidx;
+ BEACON_SYNC_STRUCT *pBeaconSync;
+// LARGE_INTEGER tsfTime, deltaTime;
+
+ pBeaconSync = pAd->CommonCfg.pBeaconSync;
+ if (pBeaconSync && pBeaconSync->EnableBeacon)
+ {
+ INT NumOfBcn;
+
+ {
+ NumOfBcn = MAX_MESH_NUM;
+ }
+
+ for(apidx=0; apidx<NumOfBcn; apidx++)
+ {
+ UCHAR CapabilityInfoLocationInBeacon = 0;
+ UCHAR TimIELocationInBeacon = 0;
+
+
+ NdisZeroMemory(pBeaconSync->BeaconBuf[apidx], HW_BEACON_OFFSET);
+ pBeaconSync->CapabilityInfoLocationInBeacon[apidx] = CapabilityInfoLocationInBeacon;
+ pBeaconSync->TimIELocationInBeacon[apidx] = TimIELocationInBeacon;
+ NdisZeroMemory(pBeaconSync->BeaconTxWI[apidx], TXWI_SIZE);
+ }
+ pBeaconSync->BeaconBitMap = 0;
+ pBeaconSync->DtimBitOn = 0;
+ pAd->CommonCfg.BeaconUpdateTimer.Repeat = TRUE;
+
+ pAd->CommonCfg.BeaconAdjust = 0;
+ pAd->CommonCfg.BeaconFactor = 0xffffffff / (pAd->CommonCfg.BeaconPeriod << 10);
+ pAd->CommonCfg.BeaconRemain = (0xffffffff % (pAd->CommonCfg.BeaconPeriod << 10)) + 1;
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBBssBeaconStart:BeaconFactor=%d, BeaconRemain=%d!\n",
+ pAd->CommonCfg.BeaconFactor, pAd->CommonCfg.BeaconRemain));
+ RTMPSetTimer(&pAd->CommonCfg.BeaconUpdateTimer, 10 /*pAd->CommonCfg.BeaconPeriod*/);
+
+ }
+}
+
+
+VOID RTUSBBssBeaconInit(
+ IN RTMP_ADAPTER *pAd)
+{
+ BEACON_SYNC_STRUCT *pBeaconSync;
+ int i;
+
+ os_alloc_mem(pAd, (PUCHAR *)(&pAd->CommonCfg.pBeaconSync), sizeof(BEACON_SYNC_STRUCT));
+ //NdisAllocMemory(pAd->CommonCfg.pBeaconSync, sizeof(BEACON_SYNC_STRUCT), MEM_ALLOC_FLAG);
+ if (pAd->CommonCfg.pBeaconSync)
+ {
+ pBeaconSync = pAd->CommonCfg.pBeaconSync;
+ NdisZeroMemory(pBeaconSync, sizeof(BEACON_SYNC_STRUCT));
+ for(i=0; i < HW_BEACON_MAX_COUNT; i++)
+ {
+ NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
+ pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
+ pBeaconSync->TimIELocationInBeacon[i] = 0;
+ NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
+ }
+ pBeaconSync->BeaconBitMap = 0;
+
+ //RTMPInitTimer(pAd, &pAd->CommonCfg.BeaconUpdateTimer, GET_TIMER_FUNCTION(BeaconUpdateExec), pAd, TRUE);
+ pBeaconSync->EnableBeacon = TRUE;
+ }
+}
+
+
+VOID RTUSBBssBeaconExit(
+ IN RTMP_ADAPTER *pAd)
+{
+ BEACON_SYNC_STRUCT *pBeaconSync;
+ BOOLEAN Cancelled = TRUE;
+ int i;
+
+ if (pAd->CommonCfg.pBeaconSync)
+ {
+ pBeaconSync = pAd->CommonCfg.pBeaconSync;
+ pBeaconSync->EnableBeacon = FALSE;
+ RTMPCancelTimer(&pAd->CommonCfg.BeaconUpdateTimer, &Cancelled);
+ pBeaconSync->BeaconBitMap = 0;
+
+ for(i=0; i<HW_BEACON_MAX_COUNT; i++)
+ {
+ NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
+ pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
+ pBeaconSync->TimIELocationInBeacon[i] = 0;
+ NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
+ }
+
+ os_free_mem(pAd, pAd->CommonCfg.pBeaconSync);
+ pAd->CommonCfg.pBeaconSync = NULL;
+ }
+}
+
+
+/*
+ ========================================================================
+ Routine Description:
+ For device work as AP mode but didn't have TBTT interrupt event, we need a mechanism
+ to update the beacon context in each Beacon interval. Here we use a periodical timer
+ to simulate the TBTT interrupt to handle the beacon context update.
+
+ Arguments:
+ SystemSpecific1 - Not used.
+ FunctionContext - Pointer to our Adapter context.
+ SystemSpecific2 - Not used.
+ SystemSpecific3 - Not used.
+
+ Return Value:
+ None
+
+ ========================================================================
+*/
+VOID BeaconUpdateExec(
+ IN PVOID SystemSpecific1,
+ IN PVOID FunctionContext,
+ IN PVOID SystemSpecific2,
+ IN PVOID SystemSpecific3)
+{
+ PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)FunctionContext;
+ LARGE_INTEGER tsfTime_a;//, tsfTime_b, deltaTime_exp, deltaTime_ab;
+ UINT32 delta, delta2MS, period2US, remain, remain_low, remain_high;
+// BOOLEAN positive;
+
+ if (pAd->CommonCfg.IsUpdateBeacon==TRUE)
+ {
+ ReSyncBeaconTime(pAd);
+
+
+ }
+
+ RTMP_IO_READ32(pAd, TSF_TIMER_DW0, &tsfTime_a.u.LowPart);
+ RTMP_IO_READ32(pAd, TSF_TIMER_DW1, &tsfTime_a.u.HighPart);
+
+
+ //positive=getDeltaTime(tsfTime_a, expectedTime, &deltaTime_exp);
+ period2US = (pAd->CommonCfg.BeaconPeriod << 10);
+ remain_high = pAd->CommonCfg.BeaconRemain * tsfTime_a.u.HighPart;
+ remain_low = tsfTime_a.u.LowPart % (pAd->CommonCfg.BeaconPeriod << 10);
+ remain = (remain_high + remain_low)%(pAd->CommonCfg.BeaconPeriod << 10);
+ delta = (pAd->CommonCfg.BeaconPeriod << 10) - remain;
+
+ delta2MS = (delta>>10);
+ if (delta2MS > 150)
+ {
+ pAd->CommonCfg.BeaconUpdateTimer.TimerValue = 100;
+ pAd->CommonCfg.IsUpdateBeacon=FALSE;
+ }
+ else
+ {
+ pAd->CommonCfg.BeaconUpdateTimer.TimerValue = delta2MS + 10;
+ pAd->CommonCfg.IsUpdateBeacon=TRUE;
+ }
+
+}
+
+
+/********************************************************************
+ *
+ * 2870 Radio on/off Related functions.
+ *
+ ********************************************************************/
+VOID RT28xxUsbMlmeRadioOn(
+ IN PRTMP_ADAPTER pAd)
+{
+ RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
+
+ DBGPRINT(RT_DEBUG_TRACE,("RT28xxUsbMlmeRadioOn()\n"));
+
+ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
+ return;
+
+ {
+ AsicSendCommandToMcu(pAd, 0x31, 0xff, 0x00, 0x02);
+ RTMPusecDelay(10000);
+ }
+ //NICResetFromError(pAd);
+
+ // Enable Tx/Rx
+ RTMPEnableRxTx(pAd);
+
+ if (pChipOps->AsicReverseRfFromSleepMode)
+ pChipOps->AsicReverseRfFromSleepMode(pAd);
+
+ // Clear Radio off flag
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+
+ RTUSBBulkReceive(pAd);
+
+ // Set LED
+ RTMPSetLED(pAd, LED_RADIO_ON);
+}
+
+
+VOID RT28xxUsbMlmeRadioOFF(
+ IN PRTMP_ADAPTER pAd)
+{
+ WPDMA_GLO_CFG_STRUC GloCfg;
+ UINT32 Value, i;
+
+ DBGPRINT(RT_DEBUG_TRACE,("RT28xxUsbMlmeRadioOFF()\n"));
+
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
+ return;
+
+ // Clear PMKID cache.
+ pAd->StaCfg.SavedPMKNum = 0;
+ RTMPZeroMemory(pAd->StaCfg.SavedPMK, (PMKID_NO * sizeof(BSSID_INFO)));
+
+ // Link down first if any association exists
+ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
+ {
+ if (INFRA_ON(pAd) || ADHOC_ON(pAd))
+ {
+ MLME_DISASSOC_REQ_STRUCT DisReq;
+ MLME_QUEUE_ELEM *pMsgElem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
+
+ if (pMsgElem)
+ {
+ COPY_MAC_ADDR(&DisReq.Addr, pAd->CommonCfg.Bssid);
+ DisReq.Reason = REASON_DISASSOC_STA_LEAVING;
+
+ pMsgElem->Machine = ASSOC_STATE_MACHINE;
+ pMsgElem->MsgType = MT2_MLME_DISASSOC_REQ;
+ pMsgElem->MsgLen = sizeof(MLME_DISASSOC_REQ_STRUCT);
+ NdisMoveMemory(pMsgElem->Msg, &DisReq, sizeof(MLME_DISASSOC_REQ_STRUCT));
+
+ MlmeDisassocReqAction(pAd, pMsgElem);
+ kfree(pMsgElem);
+
+ RTMPusecDelay(1000);
+ }
+ }
+ }
+
+ // Set Radio off flag
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
+
+ {
+ // Link down first if any association exists
+ if (INFRA_ON(pAd) || ADHOC_ON(pAd))
+ LinkDown(pAd, FALSE);
+ RTMPusecDelay(10000);
+
+ //==========================================
+ // Clean up old bss table
+ BssTableInit(&pAd->ScanTab);
+ }
+
+ // Set LED
+ RTMPSetLED(pAd, LED_RADIO_OFF);
+
+
+ if (pAd->CommonCfg.BBPCurrentBW == BW_40)
+ {
+ // Must using 40MHz.
+ AsicTurnOffRFClk(pAd, pAd->CommonCfg.CentralChannel);
+ }
+ else
+ {
+ // Must using 20MHz.
+ AsicTurnOffRFClk(pAd, pAd->CommonCfg.Channel);
+ }
+
+ // Disable Tx/Rx DMA
+ RTUSBReadMACRegister(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
+ GloCfg.field.EnableTxDMA = 0;
+ GloCfg.field.EnableRxDMA = 0;
+ RTUSBWriteMACRegister(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
+
+ // Waiting for DMA idle
+ i = 0;
+ do
+ {
+ RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
+ if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
+ break;
+
+ RTMPusecDelay(1000);
+ }while (i++ < 100);
+
+ // Disable MAC Tx/Rx
+ RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
+ Value &= (0xfffffff3);
+ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
+
+ {
+ AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
+ }
+}
+
+#endif // RTMP_MAC_USB //
diff --git a/drivers/staging/rt3090/common/cmm_profile.c b/drivers/staging/rt2860/common/cmm_profile.c
index 5803f422ae09..056cffda42b1 100644
--- a/drivers/staging/rt3090/common/cmm_profile.c
+++ b/drivers/staging/rt2860/common/cmm_profile.c
@@ -23,16 +23,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
-
- Module Name:
- cmm_profile.c
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
+*/
#include "../rt_config.h"
@@ -611,9 +602,6 @@ static void rtmp_read_key_parms_from_file(IN PRTMP_ADAPTER pAd, PSTRING tmpbuf,
//DefaultKeyID
if(RTMPGetKeyParameter("DefaultKeyID", tmpbuf, 25, buffer, TRUE))
{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
KeyIdx = simple_strtol(tmpbuf, 0, 10);
if((KeyIdx >= 1 ) && (KeyIdx <= 4))
@@ -623,7 +611,6 @@ static void rtmp_read_key_parms_from_file(IN PRTMP_ADAPTER pAd, PSTRING tmpbuf,
DBGPRINT(RT_DEBUG_TRACE, ("DefaultKeyID(0~3)=%d\n", pAd->StaCfg.DefaultKeyId));
}
-#endif // CONFIG_STA_SUPPORT //
}
@@ -645,8 +632,6 @@ static void rtmp_read_key_parms_from_file(IN PRTMP_ADAPTER pAd, PSTRING tmpbuf,
KeyType[i] = simple_strtol(macptr, 0, 10);
}
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
sprintf(tok_str, "Key%dStr", idx + 1);
if (RTMPGetKeyParameter(tok_str, tmpbuf, 128, buffer, FALSE))
@@ -654,14 +639,12 @@ static void rtmp_read_key_parms_from_file(IN PRTMP_ADAPTER pAd, PSTRING tmpbuf,
rtmp_parse_key_buffer_from_file(pAd, tmpbuf, KeyType[BSS0], BSS0, idx);
}
}
-#endif // CONFIG_STA_SUPPORT //
}
}
}
-#ifdef CONFIG_STA_SUPPORT
static void rtmp_read_sta_wmm_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbuf, char *buffer)
{
PSTRING macptr;
@@ -684,22 +667,6 @@ static void rtmp_read_sta_wmm_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbu
DBGPRINT(RT_DEBUG_TRACE, ("WmmCapable=%d\n", pAd->CommonCfg.bWmmCapable));
}
-#ifdef QOS_DLS_SUPPORT
- //DLSCapable
- if(RTMPGetKeyParameter("DLSCapable", tmpbuf, 32, buffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- {
- pAd->CommonCfg.bDLSCapable = TRUE;
- }
- else //Disable
- {
- pAd->CommonCfg.bDLSCapable = FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("bDLSCapable=%d\n", pAd->CommonCfg.bDLSCapable));
- }
-#endif // QOS_DLS_SUPPORT //
//AckPolicy for AC_BK, AC_BE, AC_VI, AC_VO
if(RTMPGetKeyParameter("AckPolicy", tmpbuf, 32, buffer, TRUE))
@@ -758,10 +725,8 @@ static void rtmp_read_sta_wmm_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbu
}
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef DOT11_N_SUPPORT
static void HTParametersHook(
IN PRTMP_ADAPTER pAd,
IN PSTRING pValueStr,
@@ -1002,8 +967,6 @@ static void HTParametersHook(
{
UCHAR fix_tx_mode;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
fix_tx_mode = FIXED_TXMODE_HT;
@@ -1035,7 +998,6 @@ static void HTParametersHook(
DBGPRINT(RT_DEBUG_TRACE, ("Fixed Tx Mode = %d\n", fix_tx_mode));
}
-#endif // CONFIG_STA_SUPPORT //
}
@@ -1053,10 +1015,6 @@ static void HTParametersHook(
pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
}
-#ifdef MCAST_RATE_SPECIFIC
- pAd->CommonCfg.MCastPhyMode.field.BW = pAd->CommonCfg.RegTransmitSetting.field.BW;
-#endif // MCAST_RATE_SPECIFIC //
-
DBGPRINT(RT_DEBUG_TRACE, ("HT: Channel Width = %s\n", (Value==BW_40) ? "40 MHz" : "20 MHz" ));
}
@@ -1080,9 +1038,6 @@ static void HTParametersHook(
// MSC
if (RTMPGetKeyParameter("HT_MCS", pValueStr, 50, pInput, TRUE))
{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
Value = simple_strtol(pValueStr, 0, 10);
@@ -1100,7 +1055,6 @@ static void HTParametersHook(
DBGPRINT(RT_DEBUG_TRACE, ("HT: MCS = AUTO\n"));
}
}
-#endif // CONFIG_STA_SUPPORT //
}
// STBC
@@ -1210,7 +1164,6 @@ static void HTParametersHook(
//2008/11/05:KH add to support Antenna power-saving of AP-->
}
-#endif // DOT11_N_SUPPORT //
NDIS_STATUS RTMPSetProfileParameters(
@@ -1255,12 +1208,6 @@ NDIS_STATUS RTMPSetProfileParameters(
if(RTMPGetKeyParameter("CountryCode", tmpbuf, 25, pBuffer, TRUE))
{
NdisMoveMemory(pAd->CommonCfg.CountryCode, tmpbuf , 2);
-#ifdef CONFIG_STA_SUPPORT
-#ifdef EXT_BUILD_CHANNEL_LIST
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- NdisMoveMemory(pAd->StaCfg.StaOriCountryCode, tmpbuf , 2);
-#endif // EXT_BUILD_CHANNEL_LIST //
-#endif // CONFIG_STA_SUPPORT //
if (strlen((PSTRING) pAd->CommonCfg.CountryCode) != 0)
{
pAd->CommonCfg.bCountryFlag = TRUE;
@@ -1276,12 +1223,6 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->CommonCfg.Geography = Geography;
pAd->CommonCfg.CountryCode[2] =
(pAd->CommonCfg.Geography == BOTH) ? ' ' : ((pAd->CommonCfg.Geography == IDOR) ? 'I' : 'O');
-#ifdef CONFIG_STA_SUPPORT
-#ifdef EXT_BUILD_CHANNEL_LIST
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pAd->StaCfg.StaOriGeography = pAd->CommonCfg.Geography;
-#endif // EXT_BUILD_CHANNEL_LIST //
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("ChannelGeography=%d\n", pAd->CommonCfg.Geography));
}
}
@@ -1291,9 +1232,6 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->CommonCfg.CountryCode[2] = ' ';
}
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//SSID
if (RTMPGetKeyParameter("SSID", tmpbuf, 256, pBuffer, FALSE))
@@ -1309,14 +1247,11 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->MlmeAux.SsidLen = pAd->CommonCfg.SsidLen;
NdisZeroMemory(pAd->MlmeAux.Ssid, NDIS_802_11_LENGTH_SSID);
NdisMoveMemory(pAd->MlmeAux.Ssid, tmpbuf, pAd->MlmeAux.SsidLen);
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(SSID=%s)\n", __FUNCTION__, tmpbuf));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::(SSID=%s)\n", __func__, tmpbuf));
}
}
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//NetworkType
if (RTMPGetKeyParameter("NetworkType", tmpbuf, 25, pBuffer, TRUE))
@@ -1328,7 +1263,7 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->StaCfg.BssType = BSS_INFRA;
// Reset Ralink supplicant to not use, it will be set to start when UI set PMK key
pAd->StaCfg.WpaState = SS_NOTUSE;
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __FUNCTION__, pAd->StaCfg.BssType));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __func__, pAd->StaCfg.BssType));
}
}
#ifdef RTMP_MAC_PCI
@@ -1374,7 +1309,6 @@ NDIS_STATUS RTMPSetProfileParameters(
DBGPRINT(RT_DEBUG_TRACE, ("rt30xxForceASPM=%d\n", pAd->StaCfg.PSControl.field.rt30xxForceASPMTest));
}
#endif // RT3090 //
-#endif // CONFIG_STA_SUPPORT //
//Channel
if(RTMPGetKeyParameter("Channel", tmpbuf, 10, pBuffer, TRUE))
{
@@ -1403,10 +1337,7 @@ NDIS_STATUS RTMPSetProfileParameters(
if(RTMPGetKeyParameter("TxPower", tmpbuf, 10, pBuffer, TRUE))
{
pAd->CommonCfg.TxPowerPercentage = (ULONG) simple_strtol(tmpbuf, 0, 10);
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
pAd->CommonCfg.TxPowerDefault = pAd->CommonCfg.TxPowerPercentage;
-#endif // CONFIG_STA_SUPPORT //
DBGPRINT(RT_DEBUG_TRACE, ("TxPower=%ld\n", pAd->CommonCfg.TxPowerPercentage));
}
//BGProtection
@@ -1532,10 +1463,7 @@ NDIS_STATUS RTMPSetProfileParameters(
// WmmCapable
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
rtmp_read_sta_wmm_parms_from_file(pAd, tmpbuf, pBuffer);
-#endif // CONFIG_STA_SUPPORT //
//ShortSlot
if(RTMPGetKeyParameter("ShortSlot", tmpbuf, 10, pBuffer, TRUE))
@@ -1567,56 +1495,6 @@ NDIS_STATUS RTMPSetProfileParameters(
DBGPRINT(RT_DEBUG_TRACE, ("CSPeriod=%d\n", pAd->CommonCfg.RadarDetect.CSPeriod));
}
-#ifdef MERGE_ARCH_TEAM
- // DfsLowerLimit
- if(RTMPGetKeyParameter("DfsLowerLimit", tmpbuf, 10, pBuffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.DfsLowerLimit = simple_strtol(tmpbuf, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("DfsLowerLimit=%ld\n", pAd->CommonCfg.RadarDetect.DfsLowerLimit));
- }
-
- // DfsUpperLimit
- if(RTMPGetKeyParameter("DfsUpperLimit", tmpbuf, 10, pBuffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.DfsUpperLimit = simple_strtol(tmpbuf, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("DfsUpperLimit=%ld\n", pAd->CommonCfg.RadarDetect.DfsUpperLimit));
- }
-
- // FixDfsLimit
- if(RTMPGetKeyParameter("FixDfsLimit", tmpbuf, 10, pBuffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.FixDfsLimit = TRUE;
- else
- pAd->CommonCfg.RadarDetect.FixDfsLimit = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("FixDfsLimit=%d\n", pAd->CommonCfg.RadarDetect.FixDfsLimit));
- }
-
- // LongPulseRadarTh
- if(RTMPGetKeyParameter("LongPulseRadarTh", tmpbuf, 10, pBuffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh = simple_strtol(tmpbuf, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("LongPulseRadarTh=%d\n", pAd->CommonCfg.RadarDetect.LongPulseRadarTh));
- }
-
- // AvgRssiReq
- if(RTMPGetKeyParameter("AvgRssiReq", tmpbuf, 10, pBuffer, TRUE))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.AvgRssiReq = simple_strtol(tmpbuf, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("AvgRssiReq=%d\n", pAd->CommonCfg.RadarDetect.AvgRssiReq));
- }
-
-#endif // MERGE_ARCH_TEAM //
-
//RDRegion
if(RTMPGetKeyParameter("RDRegion", tmpbuf, 128, pBuffer, TRUE))
{
@@ -1640,9 +1518,6 @@ NDIS_STATUS RTMPSetProfileParameters(
{
pRadarDetect->RDDurRegion = FCC;
pRadarDetect->DfsSessionTime = 5;
-#ifdef DFS_FCC_BW40_FIX
- pRadarDetect->DfsSessionFccOff = 0;
-#endif // DFS_FCC_BW40_FIX //
}
else if ((strncmp(tmpbuf, "CE", 2) == 0) || (strncmp(tmpbuf, "ce", 2) == 0))
{
@@ -1666,14 +1541,10 @@ NDIS_STATUS RTMPSetProfileParameters(
//WirelessEvent
if(RTMPGetKeyParameter("WirelessEvent", tmpbuf, 10, pBuffer, TRUE))
{
-#if WIRELESS_EXT >= 15
if(simple_strtol(tmpbuf, 0, 10) != 0)
pAd->CommonCfg.bWirelessEvent = simple_strtol(tmpbuf, 0, 10);
else
pAd->CommonCfg.bWirelessEvent = 0; // disable
-#else
- pAd->CommonCfg.bWirelessEvent = 0; // disable
-#endif
DBGPRINT(RT_DEBUG_TRACE, ("WirelessEvent=%d\n", pAd->CommonCfg.bWirelessEvent));
}
if(RTMPGetKeyParameter("WiFiTest", tmpbuf, 10, pBuffer, TRUE))
@@ -1688,8 +1559,6 @@ NDIS_STATUS RTMPSetProfileParameters(
//AuthMode
if(RTMPGetKeyParameter("AuthMode", tmpbuf, 128, pBuffer, TRUE))
{
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if ((strcmp(tmpbuf, "WEPAUTO") == 0) || (strcmp(tmpbuf, "wepauto") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeAutoSwitch;
@@ -1701,27 +1570,21 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
else if ((strcmp(tmpbuf, "WPA2PSK") == 0) || (strcmp(tmpbuf, "wpa2psk") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
-#ifdef WPA_SUPPLICANT_SUPPORT
else if ((strcmp(tmpbuf, "WPA") == 0) || (strcmp(tmpbuf, "wpa") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
else if ((strcmp(tmpbuf, "WPA2") == 0) || (strcmp(tmpbuf, "wpa2") == 0))
pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
-#endif // WPA_SUPPLICANT_SUPPORT //
else
pAd->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __FUNCTION__, pAd->StaCfg.WepStatus));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::(AuthMode=%d)\n", __func__, pAd->StaCfg.AuthMode));
}
-#endif // CONFIG_STA_SUPPORT //
}
//EncrypType
if(RTMPGetKeyParameter("EncrypType", tmpbuf, 128, pBuffer, TRUE))
{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if ((strcmp(tmpbuf, "WEP") == 0) || (strcmp(tmpbuf, "wep") == 0))
pAd->StaCfg.WepStatus = Ndis802_11WEPEnabled;
@@ -1739,14 +1602,10 @@ NDIS_STATUS RTMPSetProfileParameters(
pAd->StaCfg.bMixCipher = FALSE;
//RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __FUNCTION__, pAd->StaCfg.WepStatus));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
}
-#endif // CONFIG_STA_SUPPORT //
}
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if(RTMPGetKeyParameter("WPAPSK", tmpbuf, 512, pBuffer, FALSE))
{
@@ -1782,11 +1641,10 @@ NDIS_STATUS RTMPSetProfileParameters(
{
pAd->StaCfg.WpaState = SS_NOTUSE;
}
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(WPAPSK=%s)\n", __FUNCTION__, tmpbuf));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::(WPAPSK=%s)\n", __func__, tmpbuf));
}
}
}
-#endif // CONFIG_STA_SUPPORT //
//DefaultKeyID, KeyType, KeyStr
rtmp_read_key_parms_from_file(pAd, tmpbuf, pBuffer);
@@ -1808,30 +1666,8 @@ NDIS_STATUS RTMPSetProfileParameters(
DBGPRINT(RT_DEBUG_TRACE, "HSCounter=%d\n", pAd->CommonCfg.bEnableHSCounter);
}*/
-#ifdef DOT11_N_SUPPORT
HTParametersHook(pAd, tmpbuf, pBuffer);
-#endif // DOT11_N_SUPPORT //
-
-#ifdef CARRIER_DETECTION_SUPPORT
- //CarrierDetect
- if(RTMPGetKeyParameter("CarrierDetect", tmpbuf, 128, pBuffer, TRUE))
- {
- if ((strncmp(tmpbuf, "0", 1) == 0))
- pAd->CommonCfg.CarrierDetect.Enable = FALSE;
- else if ((strncmp(tmpbuf, "1", 1) == 0))
- pAd->CommonCfg.CarrierDetect.Enable = TRUE;
- else
- pAd->CommonCfg.CarrierDetect.Enable = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("CarrierDetect.Enable=%d\n", pAd->CommonCfg.CarrierDetect.Enable));
- }
- else
- pAd->CommonCfg.CarrierDetect.Enable = FALSE;
-#endif // CARRIER_DETECTION_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
//PSMode
if (RTMPGetKeyParameter("PSMode", tmpbuf, 10, pBuffer, TRUE))
@@ -1854,7 +1690,7 @@ NDIS_STATUS RTMPSetProfileParameters(
{
// do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
// to exclude certain situations.
- // MlmeSetPsmBit(pAd, PWR_SAVE);
+ // RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeFast_PSP;
@@ -1866,7 +1702,7 @@ NDIS_STATUS RTMPSetProfileParameters(
{
// do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
// to exclude certain situations.
- // MlmeSetPsmBit(pAd, PWR_SAVE);
+ // RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeLegacy_PSP;
@@ -1929,30 +1765,9 @@ NDIS_STATUS RTMPSetProfileParameters(
}
-#endif // CONFIG_STA_SUPPORT //
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if(RTMPGetKeyParameter("AntDiversity", tmpbuf, 10, pBuffer, TRUE))
- {
- for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
- {
- UCHAR Ant = simple_strtol(tmpbuf, 0, 10);
- if(Ant < 3)
- pAd->CommonCfg.bRxAntDiversity = Ant;
- else
- pAd->CommonCfg.bRxAntDiversity = ANT_DIVERSITY_DISABLE;
-
- DBGPRINT(RT_DEBUG_ERROR, ("AntDiversity=%d\n", pAd->CommonCfg.bRxAntDiversity));
- }
- }
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
}while(0);
@@ -1962,360 +1777,3 @@ NDIS_STATUS RTMPSetProfileParameters(
return NDIS_STATUS_SUCCESS;
}
-
-
-#ifdef MULTIPLE_CARD_SUPPORT
-// record whether the card in the card list is used in the card file
-UINT8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD];
-// record used card mac address in the card list
-static UINT8 MC_CardMac[MAX_NUM_OF_MULTIPLE_CARD][6];
-
-/*
-========================================================================
-Routine Description:
- Get card profile path.
-
-Arguments:
- pAd
-
-Return Value:
- TRUE - Find a card profile
- FALSE - use default profile
-
-Note:
-========================================================================
-*/
-BOOLEAN RTMP_CardInfoRead(
- IN PRTMP_ADAPTER pAd)
-{
-#define MC_SELECT_CARDID 0 /* use CARD ID (0 ~ 31) to identify different cards */
-#define MC_SELECT_MAC 1 /* use CARD MAC to identify different cards */
-#define MC_SELECT_CARDTYPE 2 /* use CARD type (abgn or bgn) to identify different cards */
-
-#define LETTER_CASE_TRANSLATE(txt_p, card_id) \
- { UINT32 _len; char _char; \
- for(_len=0; _len<strlen(card_id); _len++) { \
- _char = *(txt_p + _len); \
- if (('A' <= _char) && (_char <= 'Z')) \
- *(txt_p+_len) = 'a'+(_char-'A'); \
- } }
-
- RTMP_OS_FD srcf;
- INT retval;
- PSTRING buffer, tmpbuf;
- STRING card_id_buf[30], RFIC_word[30];
- BOOLEAN flg_match_ok = FALSE;
- INT32 card_select_method;
- INT32 card_free_id, card_nouse_id, card_same_mac_id, card_match_id;
- EEPROM_ANTENNA_STRUC antenna;
- USHORT addr01, addr23, addr45;
- UINT8 mac[6];
- UINT32 data, card_index;
- UCHAR *start_ptr;
- RTMP_OS_FS_INFO osFSInfo;
-
- // init
- buffer = kmalloc(MAX_INI_BUFFER_SIZE, MEM_ALLOC_FLAG);
- if (buffer == NULL)
- return FALSE;
-
- tmpbuf = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- if(tmpbuf == NULL)
- {
- kfree(buffer);
- return NDIS_STATUS_FAILURE;
- }
-
- // get RF IC type
- RTMP_IO_READ32(pAd, E2PROM_CSR, &data);
-
- if ((data & 0x30) == 0)
- pAd->EEPROMAddressNum = 6; // 93C46
- else if ((data & 0x30) == 0x10)
- pAd->EEPROMAddressNum = 8; // 93C66
- else
- pAd->EEPROMAddressNum = 8; // 93C86
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_NIC1_OFFSET, antenna.word);
-
- if ((antenna.field.RfIcType == RFIC_2850) ||
- (antenna.field.RfIcType == RFIC_2750))
- {
- /* ABGN card */
- strcpy(RFIC_word, "abgn");
- }
- else
- {
- /* BGN card */
- strcpy(RFIC_word, "bgn");
- }
-
- // get MAC address
- RT28xx_EEPROM_READ16(pAd, 0x04, addr01);
- RT28xx_EEPROM_READ16(pAd, 0x06, addr23);
- RT28xx_EEPROM_READ16(pAd, 0x08, addr45);
-
- mac[0] = (UCHAR)(addr01 & 0xff);
- mac[1] = (UCHAR)(addr01 >> 8);
- mac[2] = (UCHAR)(addr23 & 0xff);
- mac[3] = (UCHAR)(addr23 >> 8);
- mac[4] = (UCHAR)(addr45 & 0xff);
- mac[5] = (UCHAR)(addr45 >> 8);
-
- DBGPRINT(RT_DEBUG_TRACE, ("mac addr=%02x:%02x:%02x:%02x:%02x:%02x!\n", PRINT_MAC(mac)));
-
- RtmpOSFSInfoChange(&osFSInfo, TRUE);
- // open card information file
- srcf = RtmpOSFileOpen(CARD_INFO_PATH, O_RDONLY, 0);
- if (IS_FILE_OPEN_ERR(srcf))
- {
- /* card information file does not exist */
- DBGPRINT(RT_DEBUG_TRACE,
- ("--> Error opening %s\n", CARD_INFO_PATH));
- goto free_resource;
- }
-
- /* card information file exists so reading the card information */
- memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);
- retval = RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE);
- if (retval < 0)
- {
- /* read fail */
- DBGPRINT(RT_DEBUG_TRACE,
- ("--> Read %s error %d\n", CARD_INFO_PATH, -retval));
- }
- else
- {
- /* get card selection method */
- memset(tmpbuf, 0x00, MAX_PARAM_BUFFER_SIZE);
- card_select_method = MC_SELECT_CARDTYPE; // default
-
- if (RTMPGetKeyParameter("SELECT", tmpbuf, 256, buffer, TRUE))
- {
- if (strcmp(tmpbuf, "CARDID") == 0)
- card_select_method = MC_SELECT_CARDID;
- else if (strcmp(tmpbuf, "MAC") == 0)
- card_select_method = MC_SELECT_MAC;
- else if (strcmp(tmpbuf, "CARDTYPE") == 0)
- card_select_method = MC_SELECT_CARDTYPE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,
- ("MC> Card Selection = %d\n", card_select_method));
-
- // init
- card_free_id = -1;
- card_nouse_id = -1;
- card_same_mac_id = -1;
- card_match_id = -1;
-
- // search current card information records
- for(card_index=0;
- card_index<MAX_NUM_OF_MULTIPLE_CARD;
- card_index++)
- {
- if ((*(UINT32 *)&MC_CardMac[card_index][0] == 0) &&
- (*(UINT16 *)&MC_CardMac[card_index][4] == 0))
- {
- // MAC is all-0 so the entry is available
- MC_CardUsed[card_index] = 0;
-
- if (card_free_id < 0)
- card_free_id = card_index; // 1st free entry
- }
- else
- {
- if (memcmp(MC_CardMac[card_index], mac, 6) == 0)
- {
- // we find the entry with same MAC
- if (card_same_mac_id < 0)
- card_same_mac_id = card_index; // 1st same entry
- }
- else
- {
- // MAC is not all-0 but used flag == 0
- if ((MC_CardUsed[card_index] == 0) &&
- (card_nouse_id < 0))
- {
- card_nouse_id = card_index; // 1st available entry
- }
- }
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE,
- ("MC> Free = %d, Same = %d, NOUSE = %d\n",
- card_free_id, card_same_mac_id, card_nouse_id));
-
- if ((card_same_mac_id >= 0) &&
- ((card_select_method == MC_SELECT_CARDID) ||
- (card_select_method == MC_SELECT_CARDTYPE)))
- {
- // same MAC entry is found
- card_match_id = card_same_mac_id;
-
- if (card_select_method == MC_SELECT_CARDTYPE)
- {
- // for CARDTYPE
- sprintf(card_id_buf, "%02dCARDTYPE%s",
- card_match_id, RFIC_word);
-
- if ((start_ptr = (PUCHAR)rtstrstruncasecmp(buffer, card_id_buf)) != NULL)
- {
- // we found the card ID
- LETTER_CASE_TRANSLATE(start_ptr, card_id_buf);
- }
- }
- }
- else
- {
- // the card is 1st plug-in, try to find the match card profile
- switch(card_select_method)
- {
- case MC_SELECT_CARDID: // CARDID
- default:
- if (card_free_id >= 0)
- card_match_id = card_free_id;
- else
- card_match_id = card_nouse_id;
- break;
-
- case MC_SELECT_MAC: // MAC
- sprintf(card_id_buf, "MAC%02x:%02x:%02x:%02x:%02x:%02x",
- mac[0], mac[1], mac[2],
- mac[3], mac[4], mac[5]);
-
- /* try to find the key word in the card file */
- if ((start_ptr = (PUCHAR)rtstrstruncasecmp(buffer, card_id_buf)) != NULL)
- {
- LETTER_CASE_TRANSLATE(start_ptr, card_id_buf);
-
- /* get the row ID (2 ASCII characters) */
- start_ptr -= 2;
- card_id_buf[0] = *(start_ptr);
- card_id_buf[1] = *(start_ptr+1);
- card_id_buf[2] = 0x00;
-
- card_match_id = simple_strtol(card_id_buf, 0, 10);
- }
- break;
-
- case MC_SELECT_CARDTYPE: // CARDTYPE
- card_nouse_id = -1;
-
- for(card_index=0;
- card_index<MAX_NUM_OF_MULTIPLE_CARD;
- card_index++)
- {
- sprintf(card_id_buf, "%02dCARDTYPE%s",
- card_index, RFIC_word);
-
- if ((start_ptr = (PUCHAR)rtstrstruncasecmp(buffer,
- card_id_buf)) != NULL)
- {
- LETTER_CASE_TRANSLATE(start_ptr, card_id_buf);
-
- if (MC_CardUsed[card_index] == 0)
- {
- /* current the card profile is not used */
- if ((*(UINT32 *)&MC_CardMac[card_index][0] == 0) &&
- (*(UINT16 *)&MC_CardMac[card_index][4] == 0))
- {
- // find it and no previous card use it
- card_match_id = card_index;
- break;
- }
- else
- {
- // ever a card use it
- if (card_nouse_id < 0)
- card_nouse_id = card_index;
- }
- }
- }
- }
-
- // if not find a free one, use the available one
- if (card_match_id < 0)
- card_match_id = card_nouse_id;
- break;
- }
- }
-
- if (card_match_id >= 0)
- {
- // make up search keyword
- switch(card_select_method)
- {
- case MC_SELECT_CARDID: // CARDID
- sprintf(card_id_buf, "%02dCARDID", card_match_id);
- break;
-
- case MC_SELECT_MAC: // MAC
- sprintf(card_id_buf,
- "%02dmac%02x:%02x:%02x:%02x:%02x:%02x",
- card_match_id,
- mac[0], mac[1], mac[2],
- mac[3], mac[4], mac[5]);
- break;
-
- case MC_SELECT_CARDTYPE: // CARDTYPE
- default:
- sprintf(card_id_buf, "%02dcardtype%s",
- card_match_id, RFIC_word);
- break;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Search Keyword = %s\n", card_id_buf));
-
- // read card file path
- if (RTMPGetKeyParameter(card_id_buf, tmpbuf, 256, buffer, TRUE))
- {
- if (strlen(tmpbuf) < sizeof(pAd->MC_FileName))
- {
- // backup card information
- pAd->MC_RowID = card_match_id; /* base 0 */
- MC_CardUsed[card_match_id] = 1;
- memcpy(MC_CardMac[card_match_id], mac, sizeof(mac));
-
- // backup card file path
- NdisMoveMemory(pAd->MC_FileName, tmpbuf , strlen(tmpbuf));
- pAd->MC_FileName[strlen(tmpbuf)] = '\0';
- flg_match_ok = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE,
- ("Card Profile Name = %s\n", pAd->MC_FileName));
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR,
- ("Card Profile Name length too large!\n"));
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR,
- ("Can not find search key word in card.dat!\n"));
- }
-
- if ((flg_match_ok != TRUE) &&
- (card_match_id < MAX_NUM_OF_MULTIPLE_CARD))
- {
- MC_CardUsed[card_match_id] = 0;
- memset(MC_CardMac[card_match_id], 0, sizeof(mac));
- }
- } // if (card_match_id >= 0)
- }
-
-
- // close file
- retval = RtmpOSFileClose(srcf);
-
-free_resource:
- RtmpOSFSInfoChange(&osFSInfo, FALSE);
- kfree(buffer);
- kfree(tmpbuf);
-
- return flg_match_ok;
-}
-#endif // MULTIPLE_CARD_SUPPORT //
diff --git a/drivers/staging/rt2860/common/cmm_sanity.c b/drivers/staging/rt2860/common/cmm_sanity.c
index 85855f7f38cb..457b6d8a3ce2 100644
--- a/drivers/staging/rt2860/common/cmm_sanity.c
+++ b/drivers/staging/rt2860/common/cmm_sanity.c
@@ -283,8 +283,8 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
OUT USHORT *LengthVIE,
OUT PNDIS_802_11_VARIABLE_IEs pVIE)
{
- CHAR *Ptr;
- CHAR TimLen;
+ UCHAR *Ptr;
+ UCHAR TimLen;
PFRAME_802_11 pFrame;
PEID_STRUCT pEid;
UCHAR SubType;
@@ -529,10 +529,9 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
case IE_TIM:
if(INFRA_ON(pAd) && SubType == SUBTYPE_BEACON)
{
- GetTimBit((PUCHAR)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe);
+ GetTimBit((PCHAR)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe);
}
break;
-
case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
if(pEid->Len == 3)
{
@@ -545,6 +544,26 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
// Wifi WMM use the same IE vale, need to parse that too
// case IE_WPA:
case IE_VENDOR_SPECIFIC:
+ // Check Broadcom/Atheros 802.11n OUI version, for HT Capability IE.
+ // This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan.
+ /*if (NdisEqualMemory(pEid->Octet, BROADCOM_OUI, 3) && (pEid->Len >= 4))
+ {
+ if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 30))
+ {
+ {
+ NdisMoveMemory(pHtCapability, &pEid->Octet[4], sizeof(HT_CAPABILITY_IE));
+ *pHtCapabilityLen = SIZE_HT_CAP_IE; // Nnow we only support 26 bytes.
+ }
+ }
+ if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 26))
+ {
+ {
+ NdisMoveMemory(AddHtInfo, &pEid->Octet[4], sizeof(ADD_HT_INFO_IE));
+ *AddHtInfoLen = SIZE_ADD_HT_INFO_IE; // Nnow we only support 26 bytes.
+ }
+ }
+ }
+ */
// Check the OUI version, filter out non-standard usage
if (NdisEqualMemory(pEid->Octet, RALINK_OUI, 3) && (pEid->Len == 7))
{
@@ -638,6 +657,8 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
pEdcaParm->Cwmax[QID_AC_VO] = CW_MAX_IN_BITS-1;
pEdcaParm->Txop[QID_AC_VO] = 48; // AC_VO: 48*32us ~= 1.5ms
}
+
+
break;
case IE_EXT_SUPP_RATES:
@@ -718,7 +739,7 @@ BOOLEAN PeerBeaconAndProbeRspSanity(
if (Sanity != 0x7)
{
- DBGPRINT(RT_DEBUG_WARN, ("PeerBeaconAndProbeRspSanity - missing field, Sanity=0x%02x\n", Sanity));
+ DBGPRINT(RT_DEBUG_LOUD, ("PeerBeaconAndProbeRspSanity - missing field, Sanity=0x%02x\n", Sanity));
return FALSE;
}
else
@@ -755,8 +776,6 @@ BOOLEAN MlmeScanReqSanity(
if ((*pBssType == BSS_INFRA || *pBssType == BSS_ADHOC || *pBssType == BSS_ANY)
&& (*pScanType == SCAN_ACTIVE || *pScanType == SCAN_PASSIVE
- || *pScanType == SCAN_CISCO_PASSIVE || *pScanType == SCAN_CISCO_ACTIVE
- || *pScanType == SCAN_CISCO_CHANNEL_LOAD || *pScanType == SCAN_CISCO_NOISE
))
{
return TRUE;
@@ -837,8 +856,7 @@ BOOLEAN PeerAuthSanity(
NdisMoveMemory(pSeq, &pFrame->Octet[2], 2);
NdisMoveMemory(pStatus, &pFrame->Octet[4], 2);
- if ((*pAlg == Ndis802_11AuthModeOpen)
- )
+ if (*pAlg == AUTH_MODE_OPEN)
{
if (*pSeq == 1 || *pSeq == 2)
{
@@ -850,7 +868,7 @@ BOOLEAN PeerAuthSanity(
return FALSE;
}
}
- else if (*pAlg == Ndis802_11AuthModeShared)
+ else if (*pAlg == AUTH_MODE_KEY)
{
if (*pSeq == 1 || *pSeq == 4)
{
@@ -897,7 +915,7 @@ BOOLEAN MlmeAuthReqSanity(
*pTimeout = pInfo->Timeout;
*pAlg = pInfo->Alg;
- if (((*pAlg == Ndis802_11AuthModeShared) ||(*pAlg == Ndis802_11AuthModeOpen)
+ if (((*pAlg == AUTH_MODE_KEY) ||(*pAlg == AUTH_MODE_OPEN)
) &&
((*pAddr & 0x01) == 0))
{
@@ -1052,3 +1070,196 @@ NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(
return NetWorkType;
}
+
+/*
+ ==========================================================================
+ Description:
+ Check the validity of the received EAPoL frame
+ Return:
+ TRUE if all parameters are OK,
+ FALSE otherwise
+ ==========================================================================
+ */
+BOOLEAN PeerWpaMessageSanity(
+ IN PRTMP_ADAPTER pAd,
+ IN PEAPOL_PACKET pMsg,
+ IN ULONG MsgLen,
+ IN UCHAR MsgType,
+ IN MAC_TABLE_ENTRY *pEntry)
+{
+ UCHAR mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE];
+ BOOLEAN bReplayDiff = FALSE;
+ BOOLEAN bWPA2 = FALSE;
+ KEY_INFO EapolKeyInfo;
+ UCHAR GroupKeyIndex = 0;
+
+
+ NdisZeroMemory(mic, sizeof(mic));
+ NdisZeroMemory(digest, sizeof(digest));
+ NdisZeroMemory(KEYDATA, sizeof(KEYDATA));
+ NdisZeroMemory((PUCHAR)&EapolKeyInfo, sizeof(EapolKeyInfo));
+
+ NdisMoveMemory((PUCHAR)&EapolKeyInfo, (PUCHAR)&pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO));
+
+ *((USHORT *)&EapolKeyInfo) = cpu2le16(*((USHORT *)&EapolKeyInfo));
+
+ // Choose WPA2 or not
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
+ bWPA2 = TRUE;
+
+ // 0. Check MsgType
+ if ((MsgType > EAPOL_GROUP_MSG_2) || (MsgType < EAPOL_PAIR_MSG_1))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("The message type is invalid(%d)! \n", MsgType));
+ return FALSE;
+ }
+
+ // 1. Replay counter check
+ if (MsgType == EAPOL_PAIR_MSG_1 || MsgType == EAPOL_PAIR_MSG_3 || MsgType == EAPOL_GROUP_MSG_1) // For supplicant
+ {
+ // First validate replay counter, only accept message with larger replay counter.
+ // Let equal pass, some AP start with all zero replay counter
+ UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
+
+ NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
+ if ((RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY) != 1) &&
+ (RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, ZeroReplay, LEN_KEY_DESC_REPLAY) != 0))
+ {
+ bReplayDiff = TRUE;
+ }
+ }
+ else if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_4 || MsgType == EAPOL_GROUP_MSG_2) // For authenticator
+ {
+ // check Replay Counter coresponds to MSG from authenticator, otherwise discard
+ if (!NdisEqualMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY))
+ {
+ bReplayDiff = TRUE;
+ }
+ }
+
+ // Replay Counter different condition
+ if (bReplayDiff)
+ {
+ // send wireless event - for replay counter different
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_REPLAY_COUNTER_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ if (MsgType < EAPOL_GROUP_MSG_1)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in pairwise msg %d of 4-way handshake!\n", MsgType));
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
+ }
+
+ hex_dump("Receive replay counter ", pMsg->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
+ hex_dump("Current replay counter ", pEntry->R_Counter, LEN_KEY_DESC_REPLAY);
+ return FALSE;
+ }
+
+ // 2. Verify MIC except Pairwise Msg1
+ if (MsgType != EAPOL_PAIR_MSG_1)
+ {
+ UCHAR rcvd_mic[LEN_KEY_DESC_MIC];
+
+ // Record the received MIC for check later
+ NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
+ NdisZeroMemory(pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
+
+ if (EapolKeyInfo.KeyDescVer == DESC_TYPE_TKIP) // TKIP
+ {
+ HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (PUCHAR)pMsg, MsgLen, mic, MD5_DIGEST_SIZE);
+ }
+ else if (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES) // AES
+ {
+ HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (PUCHAR)pMsg, MsgLen, digest, SHA1_DIGEST_SIZE);
+ NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
+ }
+
+ if (!NdisEqualMemory(rcvd_mic, mic, LEN_KEY_DESC_MIC))
+ {
+ // send wireless event - for MIC different
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_MIC_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ if (MsgType < EAPOL_GROUP_MSG_1)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in pairwise msg %d of 4-way handshake!\n", MsgType));
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
+ }
+
+ hex_dump("Received MIC", rcvd_mic, LEN_KEY_DESC_MIC);
+ hex_dump("Desired MIC", mic, LEN_KEY_DESC_MIC);
+
+ return FALSE;
+ }
+ }
+
+ // 1. Decrypt the Key Data field if GTK is included.
+ // 2. Extract the context of the Key Data field if it exist.
+ // The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is clear.
+ // The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted.
+ if (CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen) > 0)
+ {
+ // Decrypt this field
+ if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1))
+ {
+ if(
+ (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES))
+ {
+ // AES
+ AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA,
+ CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen),
+ pMsg->KeyDesc.KeyData);
+ }
+ else
+ {
+ INT i;
+ UCHAR Key[32];
+ // Decrypt TKIP GTK
+ // Construct 32 bytes RC4 Key
+ NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16);
+ NdisMoveMemory(&Key[16], &pEntry->PTK[16], 16);
+ ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, Key, 32);
+ //discard first 256 bytes
+ for(i = 0; i < 256; i++)
+ ARCFOUR_BYTE(&pAd->PrivateInfo.WEPCONTEXT);
+ // Decrypt GTK. Becareful, there is no ICV to check the result is correct or not
+ ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA,
+ pMsg->KeyDesc.KeyData,
+ CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen));
+ }
+
+ if (!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))
+ GroupKeyIndex = EapolKeyInfo.KeyIndex;
+
+ }
+ else if ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2))
+ {
+ NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData, CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen));
+ }
+ else
+ {
+
+ return TRUE;
+ }
+
+ // Parse Key Data field to
+ // 1. verify RSN IE for pairwise_msg_2_WPA1(WPA2) ,pairwise_msg_3_WPA1(WPA2)
+ // 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2
+ // 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2)
+ if (!RTMPParseEapolKeyData(pAd, KEYDATA,
+ CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen),
+ GroupKeyIndex, MsgType, bWPA2, pEntry))
+ {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
+
+}
diff --git a/drivers/staging/rt2860/common/cmm_sync.c b/drivers/staging/rt2860/common/cmm_sync.c
index a6e1b6ddfe57..9be4d50ab5d5 100644
--- a/drivers/staging/rt2860/common/cmm_sync.c
+++ b/drivers/staging/rt2860/common/cmm_sync.c
@@ -25,7 +25,7 @@
*************************************************************************
Module Name:
- sync.c
+ cmm_sync.c
Abstract:
@@ -64,11 +64,16 @@ UCHAR A_BAND_REGION_3_CHANNEL_LIST[]={52, 56, 60, 64, 149, 153, 157, 161};
UCHAR A_BAND_REGION_4_CHANNEL_LIST[]={149, 153, 157, 161, 165};
UCHAR A_BAND_REGION_5_CHANNEL_LIST[]={149, 153, 157, 161};
UCHAR A_BAND_REGION_6_CHANNEL_LIST[]={36, 40, 44, 48};
-UCHAR A_BAND_REGION_7_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165};
+UCHAR A_BAND_REGION_7_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173};
UCHAR A_BAND_REGION_8_CHANNEL_LIST[]={52, 56, 60, 64};
UCHAR A_BAND_REGION_9_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165};
UCHAR A_BAND_REGION_10_CHANNEL_LIST[]={36, 40, 44, 48, 149, 153, 157, 161, 165};
UCHAR A_BAND_REGION_11_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161};
+UCHAR A_BAND_REGION_12_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
+UCHAR A_BAND_REGION_13_CHANNEL_LIST[]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161};
+UCHAR A_BAND_REGION_14_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165};
+UCHAR A_BAND_REGION_15_CHANNEL_LIST[]={149, 153, 157, 161, 165, 169, 173};
+
//BaSizeArray follows the 802.11n definition as MaxRxFactor. 2^(13+factor) bytes. When factor =0, it's about Ba buffer size =8.
UCHAR BaSizeArray[4] = {8,16,32,64};
@@ -200,7 +205,22 @@ VOID BuildChannelList(
num = sizeof(A_BAND_REGION_11_CHANNEL_LIST)/sizeof(UCHAR);
pChannelList = A_BAND_REGION_11_CHANNEL_LIST;
break;
-
+ case REGION_12_A_BAND:
+ num = sizeof(A_BAND_REGION_12_CHANNEL_LIST)/sizeof(UCHAR);
+ pChannelList = A_BAND_REGION_12_CHANNEL_LIST;
+ break;
+ case REGION_13_A_BAND:
+ num = sizeof(A_BAND_REGION_13_CHANNEL_LIST)/sizeof(UCHAR);
+ pChannelList = A_BAND_REGION_13_CHANNEL_LIST;
+ break;
+ case REGION_14_A_BAND:
+ num = sizeof(A_BAND_REGION_14_CHANNEL_LIST)/sizeof(UCHAR);
+ pChannelList = A_BAND_REGION_14_CHANNEL_LIST;
+ break;
+ case REGION_15_A_BAND:
+ num = sizeof(A_BAND_REGION_15_CHANNEL_LIST)/sizeof(UCHAR);
+ pChannelList = A_BAND_REGION_15_CHANNEL_LIST;
+ break;
default: // Error. should never happen
DBGPRINT(RT_DEBUG_WARN,("countryregion=%d not support", pAd->CommonCfg.CountryRegionForABand));
break;
@@ -383,8 +403,11 @@ VOID ScanNextChannel(
PHEADER_802_11 pHdr80211;
UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME;
+ {
if (MONITOR_ON(pAd))
return;
+ }
+
if (pAd->MlmeAux.Channel == 0)
{
@@ -438,29 +461,26 @@ VOID ScanNextChannel(
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
}
+
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
}
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
else if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->OpMode == OPMODE_STA))
{
pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
MlmeCntlConfirm(pAd, MT2_SCAN_CONF, MLME_FAIL_NO_RESOURCE);
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
else
{
{
// BBP and RF are not accessible in PS mode, we has to wake them up first
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
-#ifdef RT2860
- AsicForceWakeup(pAd, FROM_TX);
-#endif
-#ifdef RT2870
AsicForceWakeup(pAd, TRUE);
-#endif
+
// leave PSM during scanning. otherwise we may lost ProbeRsp & BEACON
if (pAd->StaCfg.Psm == PWR_SAVE)
- MlmeSetPsmBit(pAd, PWR_ACTIVE);
+ RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE);
}
AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, TRUE);
@@ -487,16 +507,6 @@ VOID ScanNextChannel(
// Chnage the channel scan time for CISCO stuff based on its IAPP announcement
if (ScanType == FAST_SCAN_ACTIVE)
RTMPSetTimer(&pAd->MlmeAux.ScanTimer, FAST_ACTIVE_SCAN_TIME);
- else if (((ScanType == SCAN_CISCO_ACTIVE) ||
- (ScanType == SCAN_CISCO_PASSIVE) ||
- (ScanType == SCAN_CISCO_CHANNEL_LOAD) ||
- (ScanType == SCAN_CISCO_NOISE)) && (pAd->OpMode == OPMODE_STA))
- {
- if (pAd->StaCfg.CCXScanTime < 25)
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, pAd->StaCfg.CCXScanTime * 2);
- else
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, pAd->StaCfg.CCXScanTime);
- }
else // must be SCAN_PASSIVE or SCAN_ACTIVE
{
if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
@@ -512,8 +522,9 @@ VOID ScanNextChannel(
RTMPSetTimer(&pAd->MlmeAux.ScanTimer, MAX_CHANNEL_TIME);
}
- if ((ScanType == SCAN_ACTIVE) || (ScanType == FAST_SCAN_ACTIVE) ||
- (ScanType == SCAN_CISCO_ACTIVE))
+ if ((ScanType == SCAN_ACTIVE)
+ || (ScanType == FAST_SCAN_ACTIVE)
+ )
{
NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
if (NStatus != NDIS_STATUS_SUCCESS)
diff --git a/drivers/staging/rt3090/common/cmm_tkip.c b/drivers/staging/rt2860/common/cmm_tkip.c
index 0b474f20859b..20423e16e0c0 100644
--- a/drivers/staging/rt3090/common/cmm_tkip.c
+++ b/drivers/staging/rt2860/common/cmm_tkip.c
@@ -35,8 +35,7 @@
Paul Wu 02-25-02 Initial
*/
-#include "../rt_config.h"
-
+#include "../rt_config.h"
// Rotation functions on 32 bit values
#define ROL32( A, n ) \
@@ -132,15 +131,9 @@ typedef struct PACKED _IV_CONTROL_
{
struct PACKED
{
-#ifdef RT_BIG_ENDIAN
- UCHAR KeyID:2;
- UCHAR ExtIV:1;
- UCHAR Rsvd:5;
-#else
UCHAR Rsvd:5;
UCHAR ExtIV:1;
UCHAR KeyID:2;
-#endif
} field;
UCHAR Byte;
} CONTROL;
@@ -521,75 +514,6 @@ BOOLEAN RTMPTkipCompareMICValue(
========================================================================
Routine Description:
- Compare MIC value of received MSDU
-
- Arguments:
- pAd Pointer to our adapter
- pLLC LLC header
- pSrc Pointer to the received Plain text data
- pDA Pointer to DA address
- pSA Pointer to SA address
- pMICKey pointer to MIC Key
- Len the length of the received plain text data exclude MIC value
-
- Return Value:
- TRUE MIC value matched
- FALSE MIC value mismatched
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-BOOLEAN RTMPTkipCompareMICValueWithLLC(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pLLC,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UINT Len)
-{
- UCHAR OldMic[8];
- ULONG Priority = 0;
-
- // Init MIC value calculation
- RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey);
- // DA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pDA, MAC_ADDR_LEN);
- // SA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN);
- // Priority + 3 bytes of 0
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, (PUCHAR)&Priority, 4);
-
- // Start with LLC header
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pLLC, 8);
-
- // Calculate MIC value from plain text data
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len);
-
- // Get MIC valude from received frame
- NdisMoveMemory(OldMic, pSrc + Len, 8);
-
- // Get MIC value from decrypted plain data
- RTMPTkipGetMIC(&pAd->PrivateInfo.Rx);
-
- // Move MIC value from MSDU, this steps should move to data path.
- // Since the MIC value might cross MPDUs.
- if(!NdisEqualMemory(pAd->PrivateInfo.Rx.MIC, OldMic, 8))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("RTMPTkipCompareMICValueWithLLC(): TKIP MIC Error !\n")); //MIC error.
-
-
- return (FALSE);
- }
- return (TRUE);
-}
-/*
- ========================================================================
-
- Routine Description:
Copy frame from waiting queue into relative ring buffer and set
appropriate ASIC register to kick hardware transmit function
@@ -631,8 +555,6 @@ VOID RTMPCalculateMICValue(
if (((*(pSrc + 12) << 8) + *(pSrc + 13)) == 0x8100)
vlan_offset = 4;
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
{
RTMPInitMICEngine(
pAd,
@@ -847,9 +769,6 @@ BOOLEAN RTMPSoftDecryptTKIP(
UCHAR MIC[8];
UCHAR TrailMIC[8];
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pData, DIR_READ, FALSE);
-#endif
fc0 = *pData;
fc1 = *(pData + 1);
@@ -958,9 +877,6 @@ BOOLEAN RTMPSoftDecryptTKIP(
return (FALSE);
}
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pData, DIR_READ, FALSE);
-#endif
//DBGPRINT(RT_DEBUG_TRACE, "RTMPSoftDecryptTKIP Decript done!!\n");
return TRUE;
}
diff --git a/drivers/staging/rt3090/common/cmm_wep.c b/drivers/staging/rt2860/common/cmm_wep.c
index d8ddfb245578..b13858d0a74a 100644
--- a/drivers/staging/rt3090/common/cmm_wep.c
+++ b/drivers/staging/rt2860/common/cmm_wep.c
@@ -35,8 +35,7 @@
Paul Wu 10-28-02 Initial
*/
-#include "../rt_config.h"
-
+#include "../rt_config.h"
UINT FCSTAB_32[256] =
{
diff --git a/drivers/staging/rt2860/common/cmm_wpa.c b/drivers/staging/rt2860/common/cmm_wpa.c
index 2de29fde2c40..5af78b841183 100644
--- a/drivers/staging/rt2860/common/cmm_wpa.c
+++ b/drivers/staging/rt2860/common/cmm_wpa.c
@@ -52,9 +52,1209 @@ UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04};
UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01};
UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02};
UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05};
-// MSA OUI
-UCHAR OUI_MSA_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x05}; // Not yet final - IEEE 802.11s-D1.06
-UCHAR OUI_MSA_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x06}; // Not yet final - IEEE 802.11s-D1.06
+
+
+
+static VOID ConstructEapolKeyData(
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN UCHAR GroupKeyWepStatus,
+ IN UCHAR keyDescVer,
+ IN UCHAR MsgType,
+ IN UCHAR DefaultKeyIdx,
+ IN UCHAR *GTK,
+ IN UCHAR *RSNIE,
+ IN UCHAR RSNIE_LEN,
+ OUT PEAPOL_PACKET pMsg);
+
+static VOID CalculateMIC(
+ IN UCHAR KeyDescVer,
+ IN UCHAR *PTK,
+ OUT PEAPOL_PACKET pMsg);
+
+static VOID WpaEAPPacketAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem);
+
+static VOID WpaEAPOLASFAlertAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem);
+
+static VOID WpaEAPOLLogoffAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem);
+
+static VOID WpaEAPOLStartAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem);
+
+static VOID WpaEAPOLKeyAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem);
+
+/*
+ ==========================================================================
+ Description:
+ association state machine init, including state transition and timer init
+ Parameters:
+ S - pointer to the association state machine
+ ==========================================================================
+ */
+VOID WpaStateMachineInit(
+ IN PRTMP_ADAPTER pAd,
+ IN STATE_MACHINE *S,
+ OUT STATE_MACHINE_FUNC Trans[])
+{
+ StateMachineInit(S, (STATE_MACHINE_FUNC *)Trans, MAX_WPA_PTK_STATE, MAX_WPA_MSG, (STATE_MACHINE_FUNC)Drop, WPA_PTK, WPA_MACHINE_BASE);
+
+ StateMachineSetAction(S, WPA_PTK, MT2_EAPPacket, (STATE_MACHINE_FUNC)WpaEAPPacketAction);
+ StateMachineSetAction(S, WPA_PTK, MT2_EAPOLStart, (STATE_MACHINE_FUNC)WpaEAPOLStartAction);
+ StateMachineSetAction(S, WPA_PTK, MT2_EAPOLLogoff, (STATE_MACHINE_FUNC)WpaEAPOLLogoffAction);
+ StateMachineSetAction(S, WPA_PTK, MT2_EAPOLKey, (STATE_MACHINE_FUNC)WpaEAPOLKeyAction);
+ StateMachineSetAction(S, WPA_PTK, MT2_EAPOLASFAlert, (STATE_MACHINE_FUNC)WpaEAPOLASFAlertAction);
+}
+
+/*
+ ==========================================================================
+ Description:
+ this is state machine function.
+ When receiving EAP packets which is for 802.1x authentication use.
+ Not use in PSK case
+ Return:
+ ==========================================================================
+*/
+VOID WpaEAPPacketAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+}
+
+VOID WpaEAPOLASFAlertAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+}
+
+VOID WpaEAPOLLogoffAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+}
+
+/*
+ ==========================================================================
+ Description:
+ Start 4-way HS when rcv EAPOL_START which may create by our driver in assoc.c
+ Return:
+ ==========================================================================
+*/
+VOID WpaEAPOLStartAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ MAC_TABLE_ENTRY *pEntry;
+ PHEADER_802_11 pHeader;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("WpaEAPOLStartAction ===> \n"));
+
+ pHeader = (PHEADER_802_11)Elem->Msg;
+
+ //For normaol PSK, we enqueue an EAPOL-Start command to trigger the process.
+ if (Elem->MsgLen == 6)
+ pEntry = MacTableLookup(pAd, Elem->Msg);
+ else
+ {
+ pEntry = MacTableLookup(pAd, pHeader->Addr2);
+ }
+
+ if (pEntry)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, (" PortSecured(%d), WpaState(%d), AuthMode(%d), PMKID_CacheIdx(%d) \n", pEntry->PortSecured, pEntry->WpaState, pEntry->AuthMode, pEntry->PMKID_CacheIdx));
+
+ if ((pEntry->PortSecured == WPA_802_1X_PORT_NOT_SECURED)
+ && (pEntry->WpaState < AS_PTKSTART)
+ && ((pEntry->AuthMode == Ndis802_11AuthModeWPAPSK) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK) || ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) && (pEntry->PMKID_CacheIdx != ENTRY_NOT_FOUND))))
+ {
+ pEntry->PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
+ pEntry->WpaState = AS_INITPSK;
+ pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
+ NdisZeroMemory(pEntry->R_Counter, sizeof(pEntry->R_Counter));
+ pEntry->ReTryCounter = PEER_MSG1_RETRY_TIMER_CTR;
+
+ WPAStart4WayHS(pAd, pEntry, PEER_MSG1_RETRY_EXEC_INTV);
+ }
+ }
+}
+
+/*
+ ==========================================================================
+ Description:
+ This is state machine function.
+ When receiving EAPOL packets which is for 802.1x key management.
+ Use both in WPA, and WPAPSK case.
+ In this function, further dispatch to different functions according to the received packet. 3 categories are :
+ 1. normal 4-way pairwisekey and 2-way groupkey handshake
+ 2. MIC error (Countermeasures attack) report packet from STA.
+ 3. Request for pairwise/group key update from STA
+ Return:
+ ==========================================================================
+*/
+VOID WpaEAPOLKeyAction(
+ IN PRTMP_ADAPTER pAd,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ MAC_TABLE_ENTRY *pEntry;
+ PHEADER_802_11 pHeader;
+ PEAPOL_PACKET pEapol_packet;
+ KEY_INFO peerKeyInfo;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("WpaEAPOLKeyAction ===>\n"));
+
+ pHeader = (PHEADER_802_11)Elem->Msg;
+ pEapol_packet = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+
+ NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
+ NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pEapol_packet->KeyDesc.KeyInfo, sizeof(KEY_INFO));
+
+ hex_dump("Received Eapol frame", (unsigned char *)pEapol_packet, (Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H));
+
+ *((USHORT *)&peerKeyInfo) = cpu2le16(*((USHORT *)&peerKeyInfo));
+
+ do
+ {
+ pEntry = MacTableLookup(pAd, pHeader->Addr2);
+
+ if (!pEntry || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
+ break;
+
+ if (pEntry->AuthMode < Ndis802_11AuthModeWPA)
+ break;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPoL-Key frame from STA %02X-%02X-%02X-%02X-%02X-%02X\n", PRINT_MAC(pEntry->Addr)));
+
+ if (((pEapol_packet->ProVer != EAPOL_VER) && (pEapol_packet->ProVer != EAPOL_VER2)) ||
+ ((pEapol_packet->KeyDesc.Type != WPA1_KEY_DESC) && (pEapol_packet->KeyDesc.Type != WPA2_KEY_DESC)))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Key descripter does not match with WPA rule\n"));
+ break;
+ }
+
+ // The value 1 shall be used for all EAPOL-Key frames to and from a STA when
+ // neither the group nor pairwise ciphers are CCMP for Key Descriptor 1.
+ if ((pEntry->WepStatus == Ndis802_11Encryption2Enabled) && (peerKeyInfo.KeyDescVer != DESC_TYPE_TKIP))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Key descripter version not match(TKIP) \n"));
+ break;
+ }
+ // The value 2 shall be used for all EAPOL-Key frames to and from a STA when
+ // either the pairwise or the group cipher is AES-CCMP for Key Descriptor 2.
+ else if ((pEntry->WepStatus == Ndis802_11Encryption3Enabled) && (peerKeyInfo.KeyDescVer != DESC_TYPE_AES))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Key descripter version not match(AES) \n"));
+ break;
+ }
+
+ // Check if this STA is in class 3 state and the WPA state is started
+ if ((pEntry->Sst == SST_ASSOC) && (pEntry->WpaState >= AS_INITPSK))
+ {
+ // Check the Key Ack (bit 7) of the Key Information to determine the Authenticator
+ // or not.
+ // An EAPOL-Key frame that is sent by the Supplicant in response to an EAPOL-
+ // Key frame from the Authenticator must not have the Ack bit set.
+ if (peerKeyInfo.KeyAck == 1)
+ {
+ // The frame is snet by Authenticator.
+ // So the Supplicant side shall handle this.
+
+ if ((peerKeyInfo.Secure == 0) && (peerKeyInfo.Request == 0) &&
+ (peerKeyInfo.Error == 0) && (peerKeyInfo.KeyType == PAIRWISEKEY))
+ {
+ // Process 1. the message 1 of 4-way HS in WPA or WPA2
+ // EAPOL-Key(0,0,1,0,P,0,0,ANonce,0,DataKD_M1)
+ // 2. the message 3 of 4-way HS in WPA
+ // EAPOL-Key(0,1,1,1,P,0,KeyRSC,ANonce,MIC,DataKD_M3)
+ if (peerKeyInfo.KeyMic == 0)
+ PeerPairMsg1Action(pAd, pEntry, Elem);
+ else
+ PeerPairMsg3Action(pAd, pEntry, Elem);
+ }
+ else if ((peerKeyInfo.Secure == 1) &&
+ (peerKeyInfo.KeyMic == 1) &&
+ (peerKeyInfo.Request == 0) &&
+ (peerKeyInfo.Error == 0))
+ {
+ // Process 1. the message 3 of 4-way HS in WPA2
+ // EAPOL-Key(1,1,1,1,P,0,KeyRSC,ANonce,MIC,DataKD_M3)
+ // 2. the message 1 of group KS in WPA or WPA2
+ // EAPOL-Key(1,1,1,0,G,0,Key RSC,0, MIC,GTK[N])
+ if (peerKeyInfo.KeyType == PAIRWISEKEY)
+ PeerPairMsg3Action(pAd, pEntry, Elem);
+ else
+ PeerGroupMsg1Action(pAd, pEntry, Elem);
+ }
+ }
+ else
+ {
+ // The frame is snet by Supplicant.
+ // So the Authenticator side shall handle this.
+ if ((peerKeyInfo.Request == 0) &&
+ (peerKeyInfo.Error == 0) &&
+ (peerKeyInfo.KeyMic == 1))
+ {
+ if (peerKeyInfo.Secure == 0 && peerKeyInfo.KeyType == PAIRWISEKEY)
+ {
+ // EAPOL-Key(0,1,0,0,P,0,0,SNonce,MIC,Data)
+ // Process 1. message 2 of 4-way HS in WPA or WPA2
+ // 2. message 4 of 4-way HS in WPA
+ if (CONV_ARRARY_TO_UINT16(pEapol_packet->KeyDesc.KeyDataLen) == 0)
+ {
+ PeerPairMsg4Action(pAd, pEntry, Elem);
+ }
+ else
+ {
+ PeerPairMsg2Action(pAd, pEntry, Elem);
+ }
+ }
+ else if (peerKeyInfo.Secure == 1 && peerKeyInfo.KeyType == PAIRWISEKEY)
+ {
+ // EAPOL-Key(1,1,0,0,P,0,0,0,MIC,0)
+ // Process message 4 of 4-way HS in WPA2
+ PeerPairMsg4Action(pAd, pEntry, Elem);
+ }
+ else if (peerKeyInfo.Secure == 1 && peerKeyInfo.KeyType == GROUPKEY)
+ {
+ // EAPOL-Key(1,1,0,0,G,0,0,0,MIC,0)
+ // Process message 2 of Group key HS in WPA or WPA2
+ PeerGroupMsg2Action(pAd, pEntry, &Elem->Msg[LENGTH_802_11], (Elem->MsgLen - LENGTH_802_11));
+ }
+ }
+ }
+ }
+ }while(FALSE);
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Copy frame from waiting queue into relative ring buffer and set
+ appropriate ASIC register to kick hardware encryption before really
+ sent out to air.
+
+ Arguments:
+ pAd Pointer to our adapter
+ PNDIS_PACKET Pointer to outgoing Ndis frame
+ NumberOfFrag Number of fragment required
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID RTMPToWirelessSta(
+ IN PRTMP_ADAPTER pAd,
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN PUCHAR pHeader802_3,
+ IN UINT HdrLen,
+ IN PUCHAR pData,
+ IN UINT DataLen,
+ IN BOOLEAN bClearFrame)
+{
+ PNDIS_PACKET pPacket;
+ NDIS_STATUS Status;
+
+ if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
+ return;
+
+ do {
+ // build a NDIS packet
+ Status = RTMPAllocateNdisPacket(pAd, &pPacket, pHeader802_3, HdrLen, pData, DataLen);
+ if (Status != NDIS_STATUS_SUCCESS)
+ break;
+
+
+ if (bClearFrame)
+ RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 1);
+ else
+ RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 0);
+ {
+ RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS);
+
+ RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPacket, MAIN_MBSSID); // set a default value
+ if(pEntry->apidx != 0)
+ RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPacket, pEntry->apidx);
+
+ RTMP_SET_PACKET_WCID(pPacket, (UCHAR)pEntry->Aid);
+ RTMP_SET_PACKET_MOREDATA(pPacket, FALSE);
+ }
+
+ {
+ // send out the packet
+ Status = STASendPacket(pAd, pPacket);
+ if (Status == NDIS_STATUS_SUCCESS)
+ {
+ UCHAR Index;
+
+ // Dequeue one frame from TxSwQueue0..3 queue and process it
+ // There are three place calling dequeue for TX ring.
+ // 1. Here, right after queueing the frame.
+ // 2. At the end of TxRingTxDone service routine.
+ // 3. Upon NDIS call RTMPSendPackets
+ if((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)))
+ {
+ for(Index = 0; Index < 5; Index ++)
+ if(pAd->TxSwQueue[Index].Number > 0)
+ RTMPDeQueuePacket(pAd, FALSE, Index, MAX_TX_PROCESS);
+ }
+ }
+ }
+
+ } while (FALSE);
+}
+
+/*
+ ==========================================================================
+ Description:
+ This is a function to initilize 4-way handshake
+
+ Return:
+
+ ==========================================================================
+*/
+VOID WPAStart4WayHS(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN ULONG TimeInterval)
+{
+ UCHAR Header802_3[14];
+ EAPOL_PACKET EAPOLPKT;
+ PUINT8 pBssid = NULL;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart4WayHS\n"));
+
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : The interface is closed...\n"));
+ return;
+ }
+
+
+ if (pBssid == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : No corresponding Authenticator.\n"));
+ return;
+ }
+
+ // Check the status
+ if ((pEntry->WpaState > AS_PTKSTART) || (pEntry->WpaState < AS_INITPMK))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : Not expect calling\n"));
+ return;
+ }
+
+
+ // Increment replay counter by 1
+ ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
+
+ // Randomly generate ANonce
+ GenRandom(pAd, (UCHAR *)pBssid, pEntry->ANonce);
+
+ // Construct EAPoL message - Pairwise Msg 1
+ // EAPOL-Key(0,0,1,0,P,0,0,ANonce,0,DataKD_M1)
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_PAIR_MSG_1,
+ 0, // Default key index
+ pEntry->ANonce,
+ NULL, // TxRSC
+ NULL, // GTK
+ NULL, // RSNIE
+ 0, // RSNIE length
+ &EAPOLPKT);
+
+
+ // Make outgoing frame
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
+ RTMPToWirelessSta(pAd, pEntry, Header802_3,
+ LENGTH_802_3, (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4,
+ (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE);
+
+ // Trigger Retry Timer
+ RTMPModTimer(&pEntry->RetryTimer, TimeInterval);
+
+ // Update State
+ pEntry->WpaState = AS_PTKSTART;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== WPAStart4WayHS: send Msg1 of 4-way \n"));
+
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Process Pairwise key Msg-1 of 4-way handshaking and send Msg-2
+
+ Arguments:
+ pAd Pointer to our adapter
+ Elem Message body
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID PeerPairMsg1Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ UCHAR PTK[80];
+ UCHAR Header802_3[14];
+ PEAPOL_PACKET pMsg1;
+ UINT MsgLen;
+ EAPOL_PACKET EAPOLPKT;
+ PUINT8 pCurrentAddr = NULL;
+ PUINT8 pmk_ptr = NULL;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+ PUINT8 rsnie_ptr = NULL;
+ UCHAR rsnie_len = 0;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg1Action \n"));
+
+ if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
+ return;
+
+ if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
+ return;
+
+ {
+ pCurrentAddr = pAd->CurrentAddress;
+ pmk_ptr = pAd->StaCfg.PMK;
+ group_cipher = pAd->StaCfg.GroupCipher;
+ rsnie_ptr = pAd->StaCfg.RSN_IE;
+ rsnie_len = pAd->StaCfg.RSNIE_Len;
+ }
+
+ // Store the received frame
+ pMsg1 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+ MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
+
+ // Sanity Check peer Pairwise message 1 - Replay Counter
+ if (PeerWpaMessageSanity(pAd, pMsg1, MsgLen, EAPOL_PAIR_MSG_1, pEntry) == FALSE)
+ return;
+
+ // Store Replay counter, it will use to verify message 3 and construct message 2
+ NdisMoveMemory(pEntry->R_Counter, pMsg1->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
+
+ // Store ANonce
+ NdisMoveMemory(pEntry->ANonce, pMsg1->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
+
+ // Generate random SNonce
+ GenRandom(pAd, (UCHAR *)pCurrentAddr, pEntry->SNonce);
+
+ {
+ // Calculate PTK(ANonce, SNonce)
+ WpaDerivePTK(pAd,
+ pmk_ptr,
+ pEntry->ANonce,
+ pEntry->Addr,
+ pEntry->SNonce,
+ pCurrentAddr,
+ PTK,
+ LEN_PTK);
+
+ // Save key to PTK entry
+ NdisMoveMemory(pEntry->PTK, PTK, LEN_PTK);
+ }
+
+ // Update WpaState
+ pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
+
+ // Construct EAPoL message - Pairwise Msg 2
+ // EAPOL-Key(0,1,0,0,P,0,0,SNonce,MIC,DataKD_M2)
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_PAIR_MSG_2,
+ 0, // DefaultKeyIdx
+ pEntry->SNonce,
+ NULL, // TxRsc
+ NULL, // GTK
+ (UCHAR *)rsnie_ptr,
+ rsnie_len,
+ &EAPOLPKT);
+
+ // Make outgoing frame
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
+
+ RTMPToWirelessSta(pAd, pEntry,
+ Header802_3, sizeof(Header802_3), (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg1Action: send Msg2 of 4-way \n"));
+}
+
+
+/*
+ ==========================================================================
+ Description:
+ When receiving the second packet of 4-way pairwisekey handshake.
+ Return:
+ ==========================================================================
+*/
+VOID PeerPairMsg2Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ UCHAR PTK[80];
+ BOOLEAN Cancelled;
+ PHEADER_802_11 pHeader;
+ EAPOL_PACKET EAPOLPKT;
+ PEAPOL_PACKET pMsg2;
+ UINT MsgLen;
+ UCHAR Header802_3[LENGTH_802_3];
+ UCHAR TxTsc[6];
+ PUINT8 pBssid = NULL;
+ PUINT8 pmk_ptr = NULL;
+ PUINT8 gtk_ptr = NULL;
+ UCHAR default_key = 0;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+ PUINT8 rsnie_ptr = NULL;
+ UCHAR rsnie_len = 0;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg2Action \n"));
+
+ if ((!pEntry) || (!pEntry->ValidAsCLI))
+ return;
+
+ if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
+ return;
+
+ // check Entry in valid State
+ if (pEntry->WpaState < AS_PTKSTART)
+ return;
+
+
+
+ // pointer to 802.11 header
+ pHeader = (PHEADER_802_11)Elem->Msg;
+
+ // skip 802.11_header(24-byte) and LLC_header(8)
+ pMsg2 = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+ MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
+
+ // Store SNonce
+ NdisMoveMemory(pEntry->SNonce, pMsg2->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
+
+ {
+ // Derive PTK
+ WpaDerivePTK(pAd,
+ (UCHAR *)pmk_ptr,
+ pEntry->ANonce, // ANONCE
+ (UCHAR *)pBssid,
+ pEntry->SNonce, // SNONCE
+ pEntry->Addr,
+ PTK,
+ LEN_PTK);
+
+ NdisMoveMemory(pEntry->PTK, PTK, LEN_PTK);
+ }
+
+ // Sanity Check peer Pairwise message 2 - Replay Counter, MIC, RSNIE
+ if (PeerWpaMessageSanity(pAd, pMsg2, MsgLen, EAPOL_PAIR_MSG_2, pEntry) == FALSE)
+ return;
+
+ do
+ {
+ // delete retry timer
+ RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
+
+ // Change state
+ pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
+
+ // Increment replay counter by 1
+ ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
+
+ // Construct EAPoL message - Pairwise Msg 3
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_PAIR_MSG_3,
+ default_key,
+ pEntry->ANonce,
+ TxTsc,
+ (UCHAR *)gtk_ptr,
+ (UCHAR *)rsnie_ptr,
+ rsnie_len,
+ &EAPOLPKT);
+
+ // Make outgoing frame
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
+ RTMPToWirelessSta(pAd, pEntry, Header802_3, LENGTH_802_3,
+ (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4,
+ (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE);
+
+ pEntry->ReTryCounter = PEER_MSG3_RETRY_TIMER_CTR;
+ RTMPSetTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
+
+ // Update State
+ pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
+ }while(FALSE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg2Action: send Msg3 of 4-way \n"));
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Process Pairwise key Msg 3 of 4-way handshaking and send Msg 4
+
+ Arguments:
+ pAd Pointer to our adapter
+ Elem Message body
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID PeerPairMsg3Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ PHEADER_802_11 pHeader;
+ UCHAR Header802_3[14];
+ EAPOL_PACKET EAPOLPKT;
+ PEAPOL_PACKET pMsg3;
+ UINT MsgLen;
+ PUINT8 pCurrentAddr = NULL;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg3Action \n"));
+
+ if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
+ return;
+
+ if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
+ return;
+
+ {
+ pCurrentAddr = pAd->CurrentAddress;
+ group_cipher = pAd->StaCfg.GroupCipher;
+
+ }
+
+ // Record 802.11 header & the received EAPOL packet Msg3
+ pHeader = (PHEADER_802_11) Elem->Msg;
+ pMsg3 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+ MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
+
+ // Sanity Check peer Pairwise message 3 - Replay Counter, MIC, RSNIE
+ if (PeerWpaMessageSanity(pAd, pMsg3, MsgLen, EAPOL_PAIR_MSG_3, pEntry) == FALSE)
+ return;
+
+ // Save Replay counter, it will use construct message 4
+ NdisMoveMemory(pEntry->R_Counter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
+
+ // Double check ANonce
+ if (!NdisEqualMemory(pEntry->ANonce, pMsg3->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE))
+ {
+ return;
+ }
+
+ // Construct EAPoL message - Pairwise Msg 4
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_PAIR_MSG_4,
+ 0, // group key index not used in message 4
+ NULL, // Nonce not used in message 4
+ NULL, // TxRSC not used in message 4
+ NULL, // GTK not used in message 4
+ NULL, // RSN IE not used in message 4
+ 0,
+ &EAPOLPKT);
+
+ // Update WpaState
+ pEntry->WpaState = AS_PTKINITDONE;
+
+ // Update pairwise key
+ {
+ PCIPHER_KEY pSharedKey;
+
+ pSharedKey = &pAd->SharedKey[BSS0][0];
+
+ NdisMoveMemory(pAd->StaCfg.PTK, pEntry->PTK, LEN_PTK);
+
+ // Prepare pair-wise key information into shared key table
+ NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
+ pSharedKey->KeyLen = LEN_TKIP_EK;
+ NdisMoveMemory(pSharedKey->Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
+ NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
+
+ // Decide its ChiperAlg
+ if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
+ pSharedKey->CipherAlg = CIPHER_TKIP;
+ else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
+ pSharedKey->CipherAlg = CIPHER_AES;
+ else
+ pSharedKey->CipherAlg = CIPHER_NONE;
+
+ // Update these related information to MAC_TABLE_ENTRY
+ pEntry = &pAd->MacTab.Content[BSSID_WCID];
+ NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
+ NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
+ pEntry->PairwiseKey.CipherAlg = pSharedKey->CipherAlg;
+
+ // Update pairwise key information to ASIC Shared Key Table
+ AsicAddSharedKeyEntry(pAd,
+ BSS0,
+ 0,
+ pSharedKey->CipherAlg,
+ pSharedKey->Key,
+ pSharedKey->TxMic,
+ pSharedKey->RxMic);
+
+ // Update ASIC WCID attribute table and IVEIV table
+ RTMPAddWcidAttributeEntry(pAd,
+ BSS0,
+ 0,
+ pSharedKey->CipherAlg,
+ pEntry);
+
+ }
+
+ // open 802.1x port control and privacy filter
+ if (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK ||
+ pEntry->AuthMode == Ndis802_11AuthModeWPA2)
+ {
+ pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
+ pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
+
+ STA_PORT_SECURED(pAd);
+ // Indicate Connected for GUI
+ pAd->IndicateMediaState = NdisMediaStateConnected;
+ DBGPRINT(RT_DEBUG_TRACE, ("PeerPairMsg3Action: AuthMode(%s) PairwiseCipher(%s) GroupCipher(%s) \n",
+ GetAuthMode(pEntry->AuthMode),
+ GetEncryptType(pEntry->WepStatus),
+ GetEncryptType(group_cipher)));
+ }
+ else
+ {
+ }
+
+ // Init 802.3 header and send out
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
+ RTMPToWirelessSta(pAd, pEntry,
+ Header802_3, sizeof(Header802_3),
+ (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg3Action: send Msg4 of 4-way \n"));
+}
+
+/*
+ ==========================================================================
+ Description:
+ When receiving the last packet of 4-way pairwisekey handshake.
+ Initilize 2-way groupkey handshake following.
+ Return:
+ ==========================================================================
+*/
+VOID PeerPairMsg4Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ PEAPOL_PACKET pMsg4;
+ PHEADER_802_11 pHeader;
+ UINT MsgLen;
+ BOOLEAN Cancelled;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg4Action\n"));
+
+ do
+ {
+ if ((!pEntry) || (!pEntry->ValidAsCLI))
+ break;
+
+ if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2 ) )
+ break;
+
+ if (pEntry->WpaState < AS_PTKINIT_NEGOTIATING)
+ break;
+
+
+ // pointer to 802.11 header
+ pHeader = (PHEADER_802_11)Elem->Msg;
+
+ // skip 802.11_header(24-byte) and LLC_header(8)
+ pMsg4 = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+ MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
+
+ // Sanity Check peer Pairwise message 4 - Replay Counter, MIC
+ if (PeerWpaMessageSanity(pAd, pMsg4, MsgLen, EAPOL_PAIR_MSG_4, pEntry) == FALSE)
+ break;
+
+ // 3. uses the MLME.SETKEYS.request to configure PTK into MAC
+ NdisZeroMemory(&pEntry->PairwiseKey, sizeof(CIPHER_KEY));
+
+ // reset IVEIV in Asic
+ AsicUpdateWCIDIVEIV(pAd, pEntry->Aid, 1, 0);
+
+ pEntry->PairwiseKey.KeyLen = LEN_TKIP_EK;
+ NdisMoveMemory(pEntry->PairwiseKey.Key, &pEntry->PTK[32], LEN_TKIP_EK);
+ NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pEntry->PTK[TKIP_AP_RXMICK_OFFSET], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pEntry->PTK[TKIP_AP_TXMICK_OFFSET], LEN_TKIP_TXMICK);
+
+ // Set pairwise key to Asic
+ {
+ pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
+ if (pEntry->WepStatus == Ndis802_11Encryption2Enabled)
+ pEntry->PairwiseKey.CipherAlg = CIPHER_TKIP;
+ else if (pEntry->WepStatus == Ndis802_11Encryption3Enabled)
+ pEntry->PairwiseKey.CipherAlg = CIPHER_AES;
+
+ // Add Pair-wise key to Asic
+ AsicAddPairwiseKeyEntry(
+ pAd,
+ pEntry->Addr,
+ (UCHAR)pEntry->Aid,
+ &pEntry->PairwiseKey);
+
+ // update WCID attribute table and IVEIV table for this entry
+ RTMPAddWcidAttributeEntry(
+ pAd,
+ pEntry->apidx,
+ 0,
+ pEntry->PairwiseKey.CipherAlg,
+ pEntry);
+ }
+
+ // 4. upgrade state
+ pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
+ pEntry->WpaState = AS_PTKINITDONE;
+ pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
+
+
+ if (pEntry->AuthMode == Ndis802_11AuthModeWPA2 ||
+ pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK)
+ {
+ pEntry->GTKState = REKEY_ESTABLISHED;
+ RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
+
+
+ // send wireless event - for set key done WPA2
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA2, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
+ pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
+ pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
+ group_cipher,
+ GetEncryptType(group_cipher)));
+ }
+ else
+ {
+ // 5. init Group 2-way handshake if necessary.
+ WPAStart2WayGroupHS(pAd, pEntry);
+
+ pEntry->ReTryCounter = GROUP_MSG1_RETRY_TIMER_CTR;
+ RTMPModTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
+ }
+ }while(FALSE);
+
+}
+
+/*
+ ==========================================================================
+ Description:
+ This is a function to send the first packet of 2-way groupkey handshake
+ Return:
+
+ ==========================================================================
+*/
+VOID WPAStart2WayGroupHS(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry)
+{
+ UCHAR Header802_3[14];
+ UCHAR TxTsc[6];
+ EAPOL_PACKET EAPOLPKT;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+ UCHAR default_key = 0;
+ PUINT8 gnonce_ptr = NULL;
+ PUINT8 gtk_ptr = NULL;
+ PUINT8 pBssid = NULL;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart2WayGroupHS\n"));
+
+ if ((!pEntry) || (!pEntry->ValidAsCLI))
+ return;
+
+
+ do
+ {
+ // Increment replay counter by 1
+ ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
+
+ // Construct EAPoL message - Group Msg 1
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_GROUP_MSG_1,
+ default_key,
+ (UCHAR *)gnonce_ptr,
+ TxTsc,
+ (UCHAR *)gtk_ptr,
+ NULL,
+ 0,
+ &EAPOLPKT);
+
+ // Make outgoing frame
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
+ RTMPToWirelessSta(pAd, pEntry,
+ Header802_3, LENGTH_802_3,
+ (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, FALSE);
+
+
+
+ }while (FALSE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== WPAStart2WayGroupHS : send out Group Message 1 \n"));
+
+ return;
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Process Group key 2-way handshaking
+
+ Arguments:
+ pAd Pointer to our adapter
+ Elem Message body
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID PeerGroupMsg1Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem)
+{
+ UCHAR Header802_3[14];
+ EAPOL_PACKET EAPOLPKT;
+ PEAPOL_PACKET pGroup;
+ UINT MsgLen;
+ BOOLEAN Cancelled;
+ UCHAR default_key = 0;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+ PUINT8 pCurrentAddr = NULL;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg1Action \n"));
+
+ if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
+ return;
+
+ {
+ pCurrentAddr = pAd->CurrentAddress;
+ group_cipher = pAd->StaCfg.GroupCipher;
+ default_key = pAd->StaCfg.DefaultKeyId;
+ }
+
+ // Process Group Message 1 frame. skip 802.11 header(24) & LLC_SNAP header(8)
+ pGroup = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
+ MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
+
+ // Sanity Check peer group message 1 - Replay Counter, MIC, RSNIE
+ if (PeerWpaMessageSanity(pAd, pGroup, MsgLen, EAPOL_GROUP_MSG_1, pEntry) == FALSE)
+ return;
+
+ // delete retry timer
+ RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
+
+ // Save Replay counter, it will use to construct message 2
+ NdisMoveMemory(pEntry->R_Counter, pGroup->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
+
+ // Construct EAPoL message - Group Msg 2
+ NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
+ ConstructEapolMsg(pEntry,
+ group_cipher,
+ EAPOL_GROUP_MSG_2,
+ default_key,
+ NULL, // Nonce not used
+ NULL, // TxRSC not used
+ NULL, // GTK not used
+ NULL, // RSN IE not used
+ 0,
+ &EAPOLPKT);
+
+ // open 802.1x port control and privacy filter
+ pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
+ pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
+
+ STA_PORT_SECURED(pAd);
+ // Indicate Connected for GUI
+ pAd->IndicateMediaState = NdisMediaStateConnected;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("PeerGroupMsg1Action: AuthMode(%s) PairwiseCipher(%s) GroupCipher(%s) \n",
+ GetAuthMode(pEntry->AuthMode),
+ GetEncryptType(pEntry->WepStatus),
+ GetEncryptType(group_cipher)));
+
+ // init header and Fill Packet and send Msg 2 to authenticator
+ MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
+ RTMPToWirelessSta(pAd, pEntry,
+ Header802_3, sizeof(Header802_3),
+ (PUCHAR)&EAPOLPKT,
+ CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, FALSE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerGroupMsg1Action: sned group message 2\n"));
+}
+
+/*
+ ==========================================================================
+ Description:
+ When receiving the last packet of 2-way groupkey handshake.
+ Return:
+ ==========================================================================
+*/
+VOID PeerGroupMsg2Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN VOID *Msg,
+ IN UINT MsgLen)
+{
+ UINT Len;
+ PUCHAR pData;
+ BOOLEAN Cancelled;
+ PEAPOL_PACKET pMsg2;
+ UCHAR group_cipher = Ndis802_11WEPDisabled;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg2Action \n"));
+
+ do
+ {
+ if ((!pEntry) || (!pEntry->ValidAsCLI))
+ break;
+
+ if (MsgLen < (LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
+ break;
+
+ if (pEntry->WpaState != AS_PTKINITDONE)
+ break;
+
+
+ pData = (PUCHAR)Msg;
+ pMsg2 = (PEAPOL_PACKET) (pData + LENGTH_802_1_H);
+ Len = MsgLen - LENGTH_802_1_H;
+
+ // Sanity Check peer group message 2 - Replay Counter, MIC
+ if (PeerWpaMessageSanity(pAd, pMsg2, Len, EAPOL_GROUP_MSG_2, pEntry) == FALSE)
+ break;
+
+ // 3. upgrade state
+
+ RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
+ pEntry->GTKState = REKEY_ESTABLISHED;
+
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
+ {
+ // send wireless event - for set key done WPA2
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA2, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
+ pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
+ pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
+ group_cipher, GetEncryptType(group_cipher)));
+ }
+ else
+ {
+ // send wireless event - for set key done WPA
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA1_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA1, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
+ pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
+ pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
+ group_cipher, GetEncryptType(group_cipher)));
+ }
+ }while(FALSE);
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Classify WPA EAP message type
+
+ Arguments:
+ EAPType Value of EAP message type
+ MsgType Internal Message definition for MLME state machine
+
+ Return Value:
+ TRUE Found appropriate message type
+ FALSE No appropriate message type
+
+ IRQL = DISPATCH_LEVEL
+
+ Note:
+ All these constants are defined in wpa.h
+ For supplicant, there is only EAPOL Key message avaliable
+
+ ========================================================================
+*/
+BOOLEAN WpaMsgTypeSubst(
+ IN UCHAR EAPType,
+ OUT INT *MsgType)
+{
+ switch (EAPType)
+ {
+ case EAPPacket:
+ *MsgType = MT2_EAPPacket;
+ break;
+ case EAPOLStart:
+ *MsgType = MT2_EAPOLStart;
+ break;
+ case EAPOLLogoff:
+ *MsgType = MT2_EAPOLLogoff;
+ break;
+ case EAPOLKey:
+ *MsgType = MT2_EAPOLKey;
+ break;
+ case EAPOLASFAlert:
+ *MsgType = MT2_EAPOLASFAlert;
+ break;
+ default:
+ return FALSE;
+ }
+ return TRUE;
+}
/*
========================================================================
@@ -126,7 +1326,7 @@ VOID PRF(
// Then concatenate to last result
for (i = 0; i < (len + 19) / 20; i++)
{
- HMAC_SHA1(input, total_len, key, key_len, &output[currentindex]);
+ HMAC_SHA1(key, key_len, input, total_len, &output[currentindex], SHA1_DIGEST_SIZE);
currentindex += 20;
// update the last octet
@@ -136,6 +1336,61 @@ VOID PRF(
}
/*
+* F(P, S, c, i) = U1 xor U2 xor ... Uc
+* U1 = PRF(P, S || Int(i))
+* U2 = PRF(P, U1)
+* Uc = PRF(P, Uc-1)
+*/
+
+static void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output)
+{
+ unsigned char digest[36], digest1[SHA1_DIGEST_SIZE];
+ int i, j;
+
+ /* U1 = PRF(P, S || int(i)) */
+ memcpy(digest, ssid, ssidlength);
+ digest[ssidlength] = (unsigned char)((count>>24) & 0xff);
+ digest[ssidlength+1] = (unsigned char)((count>>16) & 0xff);
+ digest[ssidlength+2] = (unsigned char)((count>>8) & 0xff);
+ digest[ssidlength+3] = (unsigned char)(count & 0xff);
+ HMAC_SHA1((unsigned char*) password, (int) strlen(password), digest, ssidlength+4, digest1, SHA1_DIGEST_SIZE); // for WPA update
+
+ /* output = U1 */
+ memcpy(output, digest1, SHA1_DIGEST_SIZE);
+
+ for (i = 1; i < iterations; i++)
+ {
+ /* Un = PRF(P, Un-1) */
+ HMAC_SHA1((unsigned char*) password, (int) strlen(password), digest1, SHA1_DIGEST_SIZE, digest, SHA1_DIGEST_SIZE); // for WPA update
+ memcpy(digest1, digest, SHA1_DIGEST_SIZE);
+
+ /* output = output xor Un */
+ for (j = 0; j < SHA1_DIGEST_SIZE; j++)
+ {
+ output[j] ^= digest[j];
+ }
+ }
+}
+
+/*
+* password - ascii string up to 63 characters in length
+* ssid - octet string up to 32 octets
+* ssidlength - length of ssid in octets
+* output must be 40 octets in length and outputs 256 bits of key
+*/
+int PasswordHash(PSTRING password, PUCHAR ssid, INT ssidlength, PUCHAR output)
+{
+ if ((strlen(password) > 63) || (ssidlength > 32))
+ return 0;
+
+ F(password, ssid, ssidlength, 4096, 1, output);
+ F(password, ssid, ssidlength, 4096, 2, &output[SHA1_DIGEST_SIZE]);
+ return 1;
+}
+
+
+
+/*
========================================================================
Routine Description:
@@ -143,7 +1398,7 @@ VOID PRF(
It shall be called by 4-way handshake processing.
Arguments:
- pAd - pointer to our pAdapter context
+ pAd - pointer to our pAdapter context
PMK - pointer to PMK
ANonce - pointer to ANonce
AA - pointer to Authenticator Address
@@ -159,7 +1414,7 @@ VOID PRF(
========================================================================
*/
-VOID WpaCountPTK(
+VOID WpaDerivePTK(
IN PRTMP_ADAPTER pAd,
IN UCHAR *PMK,
IN UCHAR *ANonce,
@@ -290,8 +1545,8 @@ VOID GenRandom(
Arguments:
pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
- WepStatus - indicate the encryption type
+ ElementID - indicate the WPA1 or WPA2
+ WepStatus - indicate the encryption type
bMixCipher - a boolean to indicate the pairwise cipher and group
cipher are the same or not
@@ -301,7 +1556,7 @@ VOID GenRandom(
========================================================================
*/
-static VOID RTMPInsertRsnIeCipher(
+static VOID RTMPMakeRsnIeCipher(
IN PRTMP_ADAPTER pAd,
IN UCHAR ElementID,
IN UINT WepStatus,
@@ -324,7 +1579,7 @@ static VOID RTMPInsertRsnIeCipher(
switch (WepStatus)
{
- // TKIP mode
+ // TKIP mode
case Ndis802_11Encryption2Enabled:
NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_TKIP, 4);
pRsnie_cipher->ucount = 1;
@@ -351,11 +1606,11 @@ static VOID RTMPInsertRsnIeCipher(
// Insert WPA2 TKIP as the first pairwise cipher
if (MIX_CIPHER_WPA2_TKIP_ON(FlexibleCipher))
{
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_TKIP, 4);
+ NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_TKIP, 4);
// Insert WPA2 AES as the secondary pairwise cipher
if (MIX_CIPHER_WPA2_AES_ON(FlexibleCipher))
{
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA2_CCMP, 4);
+ NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA2_CCMP, 4);
PairwiseCnt = 2;
}
}
@@ -374,7 +1629,7 @@ static VOID RTMPInsertRsnIeCipher(
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
{
- UINT GroupCipher = pAd->StaCfg.GroupCipher;
+ UINT GroupCipher = pAd->StaCfg.GroupCipher;
switch(GroupCipher)
{
case Ndis802_11GroupWEP40Enabled:
@@ -427,11 +1682,11 @@ static VOID RTMPInsertRsnIeCipher(
// Insert WPA TKIP as the first pairwise cipher
if (MIX_CIPHER_WPA_TKIP_ON(FlexibleCipher))
{
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_TKIP, 4);
+ NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_TKIP, 4);
// Insert WPA AES as the secondary pairwise cipher
if (MIX_CIPHER_WPA_AES_ON(FlexibleCipher))
{
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA_CCMP, 4);
+ NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA_CCMP, 4);
PairwiseCnt = 2;
}
}
@@ -450,7 +1705,7 @@ static VOID RTMPInsertRsnIeCipher(
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
(pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
{
- UINT GroupCipher = pAd->StaCfg.GroupCipher;
+ UINT GroupCipher = pAd->StaCfg.GroupCipher;
switch(GroupCipher)
{
case Ndis802_11GroupWEP40Enabled:
@@ -477,8 +1732,8 @@ static VOID RTMPInsertRsnIeCipher(
Arguments:
pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
- AuthMode - indicate the authentication mode
+ ElementID - indicate the WPA1 or WPA2
+ AuthMode - indicate the authentication mode
apidx - indicate the interface index
Return Value:
@@ -487,7 +1742,7 @@ static VOID RTMPInsertRsnIeCipher(
========================================================================
*/
-static VOID RTMPInsertRsnIeAKM(
+static VOID RTMPMakeRsnIeAKM(
IN PRTMP_ADAPTER pAd,
IN UCHAR ElementID,
IN UINT AuthMode,
@@ -496,25 +1751,29 @@ static VOID RTMPInsertRsnIeAKM(
OUT UCHAR *rsn_len)
{
RSNIE_AUTH *pRsnie_auth;
+ UCHAR AkmCnt = 1; // default as 1
pRsnie_auth = (RSNIE_AUTH*)(pRsnIe + (*rsn_len));
// decide WPA2 or WPA1
if (ElementID == Wpa2Ie)
{
+
switch (AuthMode)
{
case Ndis802_11AuthModeWPA2:
case Ndis802_11AuthModeWPA1WPA2:
- pRsnie_auth->acount = 1;
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_8021X_AKM, 4);
+ NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_8021X_AKM, 4);
break;
case Ndis802_11AuthModeWPA2PSK:
case Ndis802_11AuthModeWPA1PSKWPA2PSK:
- pRsnie_auth->acount = 1;
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_PSK_AKM, 4);
+ NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_PSK_AKM, 4);
break;
+ default:
+ AkmCnt = 0;
+ break;
+
}
}
else
@@ -523,26 +1782,28 @@ static VOID RTMPInsertRsnIeAKM(
{
case Ndis802_11AuthModeWPA:
case Ndis802_11AuthModeWPA1WPA2:
- pRsnie_auth->acount = 1;
NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_8021X_AKM, 4);
break;
case Ndis802_11AuthModeWPAPSK:
case Ndis802_11AuthModeWPA1PSKWPA2PSK:
- pRsnie_auth->acount = 1;
NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_PSK_AKM, 4);
break;
case Ndis802_11AuthModeWPANone:
- pRsnie_auth->acount = 1;
NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_NONE_AKM, 4);
break;
+ default:
+ AkmCnt = 0;
+ break;
}
}
+ pRsnie_auth->acount = AkmCnt;
pRsnie_auth->acount = cpu2le16(pRsnie_auth->acount);
- (*rsn_len) += sizeof(RSNIE_AUTH); // update current RSNIE length
+ // update current RSNIE length
+ (*rsn_len) += (sizeof(RSNIE_AUTH) + (4 * (AkmCnt - 1)));
}
@@ -555,7 +1816,7 @@ static VOID RTMPInsertRsnIeAKM(
Arguments:
pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
+ ElementID - indicate the WPA1 or WPA2
apidx - indicate the interface index
Return Value:
@@ -564,7 +1825,7 @@ static VOID RTMPInsertRsnIeAKM(
========================================================================
*/
-static VOID RTMPInsertRsnIeCap(
+static VOID RTMPMakeRsnIeCap(
IN PRTMP_ADAPTER pAd,
IN UCHAR ElementID,
IN UCHAR apidx,
@@ -595,8 +1856,8 @@ static VOID RTMPInsertRsnIeCap(
Arguments:
pAd - pointer to our pAdapter context
- AuthMode - indicate the authentication mode
- WepStatus - indicate the encryption type
+ AuthMode - indicate the authentication mode
+ WepStatus - indicate the encryption type
apidx - indicate the interface index
Return Value:
@@ -612,7 +1873,7 @@ VOID RTMPMakeRSNIE(
IN UCHAR apidx)
{
PUCHAR pRsnIe = NULL; // primary RSNIE
- UCHAR *rsnielen_cur_p = 0; // the length of the primary RSNIE
+ UCHAR *rsnielen_cur_p = 0; // the length of the primary RSNIE
UCHAR *rsnielen_ex_cur_p = 0; // the length of the secondary RSNIE
UCHAR PrimaryRsnie;
BOOLEAN bMixCipher = FALSE; // indicate the pairwise and group cipher are different
@@ -667,13 +1928,13 @@ VOID RTMPMakeRSNIE(
{
// Build the primary RSNIE
// 1. insert cipher suite
- RTMPInsertRsnIeCipher(pAd, PrimaryRsnie, WepStatus, bMixCipher, FlexibleCipher, pRsnIe, &p_offset);
+ RTMPMakeRsnIeCipher(pAd, PrimaryRsnie, WepStatus, bMixCipher, FlexibleCipher, pRsnIe, &p_offset);
// 2. insert AKM
- RTMPInsertRsnIeAKM(pAd, PrimaryRsnie, AuthMode, apidx, pRsnIe, &p_offset);
+ RTMPMakeRsnIeAKM(pAd, PrimaryRsnie, AuthMode, apidx, pRsnIe, &p_offset);
// 3. insert capability
- RTMPInsertRsnIeCap(pAd, PrimaryRsnie, apidx, pRsnIe, &p_offset);
+ RTMPMakeRsnIeCap(pAd, PrimaryRsnie, apidx, pRsnIe, &p_offset);
}
// 4. update the RSNIE length
@@ -693,12 +1954,12 @@ VOID RTMPMakeRSNIE(
pAd - pointer to our pAdapter context
pEntry - pointer to active entry
pData - the received frame
- DataByteCount - the received frame's length
+ DataByteCount - the received frame's length
FromWhichBSSID - indicate the interface index
Return:
- TRUE - This frame is EAP frame
- FALSE - otherwise
+ TRUE - This frame is EAP frame
+ FALSE - otherwise
==========================================================================
*/
BOOLEAN RTMPCheckWPAframe(
@@ -741,7 +2002,7 @@ BOOLEAN RTMPCheckWPAframe(
DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL-Start frame, TYPE = 1 \n"));
if (pEntry->EnqueueEapolStartTimerRunning != EAPOL_START_DISABLE)
{
- DBGPRINT(RT_DEBUG_TRACE, ("Cancel the EnqueueEapolStartTimerRunning \n"));
+ DBGPRINT(RT_DEBUG_TRACE, ("Cancel the EnqueueEapolStartTimerRunning \n"));
RTMPCancelTimer(&pEntry->EnqueueStartForPSKTimer, &Cancelled);
pEntry->EnqueueEapolStartTimerRunning = EAPOL_START_DISABLE;
}
@@ -764,73 +2025,1088 @@ BOOLEAN RTMPCheckWPAframe(
}
/*
+ ==========================================================================
+ Description:
+ Report the EAP message type
+
+ Arguments:
+ msg - EAPOL_PAIR_MSG_1
+ EAPOL_PAIR_MSG_2
+ EAPOL_PAIR_MSG_3
+ EAPOL_PAIR_MSG_4
+ EAPOL_GROUP_MSG_1
+ EAPOL_GROUP_MSG_2
+
+ Return:
+ message type string
+
+ ==========================================================================
+*/
+PSTRING GetEapolMsgType(CHAR msg)
+{
+ if(msg == EAPOL_PAIR_MSG_1)
+ return "Pairwise Message 1";
+ else if(msg == EAPOL_PAIR_MSG_2)
+ return "Pairwise Message 2";
+ else if(msg == EAPOL_PAIR_MSG_3)
+ return "Pairwise Message 3";
+ else if(msg == EAPOL_PAIR_MSG_4)
+ return "Pairwise Message 4";
+ else if(msg == EAPOL_GROUP_MSG_1)
+ return "Group Message 1";
+ else if(msg == EAPOL_GROUP_MSG_2)
+ return "Group Message 2";
+ else
+ return "Invalid Message";
+}
+
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Check Sanity RSN IE of EAPoL message
+
+ Arguments:
+
+ Return Value:
+
+
+ ========================================================================
+*/
+BOOLEAN RTMPCheckRSNIE(
+ IN PRTMP_ADAPTER pAd,
+ IN PUCHAR pData,
+ IN UCHAR DataLen,
+ IN MAC_TABLE_ENTRY *pEntry,
+ OUT UCHAR *Offset)
+{
+ PUCHAR pVIE;
+ UCHAR len;
+ PEID_STRUCT pEid;
+ BOOLEAN result = FALSE;
+
+ pVIE = pData;
+ len = DataLen;
+ *Offset = 0;
+
+ while (len > sizeof(RSNIE2))
+ {
+ pEid = (PEID_STRUCT) pVIE;
+ // WPA RSN IE
+ if ((pEid->Eid == IE_WPA) && (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)))
+ {
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA || pEntry->AuthMode == Ndis802_11AuthModeWPAPSK) &&
+ (NdisEqualMemory(pVIE, pEntry->RSN_IE, pEntry->RSNIE_Len)) &&
+ (pEntry->RSNIE_Len == (pEid->Len + 2)))
+ {
+ result = TRUE;
+ }
+
+ *Offset += (pEid->Len + 2);
+ }
+ // WPA2 RSN IE
+ else if ((pEid->Eid == IE_RSN) && (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3)))
+ {
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2 || pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK) &&
+ (pEid->Eid == pEntry->RSN_IE[0]) &&
+ ((pEid->Len + 2) >= pEntry->RSNIE_Len) &&
+ (NdisEqualMemory(pEid->Octet, &pEntry->RSN_IE[2], pEntry->RSNIE_Len - 2)))
+ {
+
+ result = TRUE;
+ }
+
+ *Offset += (pEid->Len + 2);
+ }
+ else
+ {
+ break;
+ }
+
+ pVIE += (pEid->Len + 2);
+ len -= (pEid->Len + 2);
+ }
+
+
+ return result;
+
+}
+
+/*
========================================================================
Routine Description:
- Misc function to decrypt AES body
+ Parse KEYDATA field. KEYDATA[] May contain 2 RSN IE and optionally GTK.
+ GTK is encaptulated in KDE format at p.83 802.11i D10
Arguments:
Return Value:
Note:
- This function references to RFC 3394 for aes key unwrap algorithm.
+ 802.11i D10
========================================================================
*/
-VOID AES_GTK_KEY_UNWRAP(
- IN UCHAR *key,
- OUT UCHAR *plaintext,
- IN UCHAR c_len,
- IN UCHAR *ciphertext)
+BOOLEAN RTMPParseEapolKeyData(
+ IN PRTMP_ADAPTER pAd,
+ IN PUCHAR pKeyData,
+ IN UCHAR KeyDataLen,
+ IN UCHAR GroupKeyIndex,
+ IN UCHAR MsgType,
+ IN BOOLEAN bWPA2,
+ IN MAC_TABLE_ENTRY *pEntry)
+{
+ PKDE_ENCAP pKDE = NULL;
+ PUCHAR pMyKeyData = pKeyData;
+ UCHAR KeyDataLength = KeyDataLen;
+ UCHAR GTKLEN = 0;
+ UCHAR DefaultIdx = 0;
+ UCHAR skip_offset;
+
+ // Verify The RSN IE contained in pairewise_msg_2 && pairewise_msg_3 and skip it
+ if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_3)
+ {
+ // Check RSN IE whether it is WPA2/WPA2PSK
+ if (!RTMPCheckRSNIE(pAd, pKeyData, KeyDataLen, pEntry, &skip_offset))
+ {
+ // send wireless event - for RSN IE different
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_RSNIE_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
+
+ DBGPRINT(RT_DEBUG_ERROR, ("RSN_IE Different in msg %d of 4-way handshake!\n", MsgType));
+ hex_dump("Receive RSN_IE ", pKeyData, KeyDataLen);
+ hex_dump("Desired RSN_IE ", pEntry->RSN_IE, pEntry->RSNIE_Len);
+ return FALSE;
+ }
+ else
+ {
+ if (bWPA2 && MsgType == EAPOL_PAIR_MSG_3)
+ {
+ WpaShowAllsuite(pMyKeyData, skip_offset);
+
+ // skip RSN IE
+ pMyKeyData += skip_offset;
+ KeyDataLength -= skip_offset;
+ DBGPRINT(RT_DEBUG_TRACE, ("RTMPParseEapolKeyData ==> WPA2/WPA2PSK RSN IE matched in Msg 3, Length(%d) \n", skip_offset));
+ }
+ else
+ return TRUE;
+ }
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE,("RTMPParseEapolKeyData ==> KeyDataLength %d without RSN_IE \n", KeyDataLength));
+ //hex_dump("remain data", pMyKeyData, KeyDataLength);
+
+
+ // Parse EKD format in pairwise_msg_3_WPA2 && group_msg_1_WPA2
+ if (bWPA2 && (MsgType == EAPOL_PAIR_MSG_3 || MsgType == EAPOL_GROUP_MSG_1))
+ {
+ if (KeyDataLength >= 8) // KDE format exclude GTK length
+ {
+ pKDE = (PKDE_ENCAP) pMyKeyData;
+
+
+ DefaultIdx = pKDE->GTKEncap.Kid;
+
+ // Sanity check - KED length
+ if (KeyDataLength < (pKDE->Len + 2))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR: The len from KDE is too short \n"));
+ return FALSE;
+ }
+
+ // Get GTK length - refer to IEEE 802.11i-2004 p.82
+ GTKLEN = pKDE->Len -6;
+ if (GTKLEN < LEN_AES_KEY)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN));
+ return FALSE;
+ }
+
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR: KDE format length is too short \n"));
+ return FALSE;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("GTK in KDE format ,DefaultKeyID=%d, KeyLen=%d \n", DefaultIdx, GTKLEN));
+ // skip it
+ pMyKeyData += 8;
+ KeyDataLength -= 8;
+
+ }
+ else if (!bWPA2 && MsgType == EAPOL_GROUP_MSG_1)
+ {
+ DefaultIdx = GroupKeyIndex;
+ DBGPRINT(RT_DEBUG_TRACE, ("GTK DefaultKeyID=%d \n", DefaultIdx));
+ }
+
+ // Sanity check - shared key index must be 1 ~ 3
+ if (DefaultIdx < 1 || DefaultIdx > 3)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key index(%d) is invalid in %s %s \n", DefaultIdx, ((bWPA2) ? "WPA2" : "WPA"), GetEapolMsgType(MsgType)));
+ return FALSE;
+ }
+
+ {
+ PCIPHER_KEY pSharedKey;
+
+ // set key material, TxMic and RxMic
+ NdisMoveMemory(pAd->StaCfg.GTK, pMyKeyData, 32);
+ pAd->StaCfg.DefaultKeyId = DefaultIdx;
+
+ pSharedKey = &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId];
+
+ // Prepare pair-wise key information into shared key table
+ NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
+ pSharedKey->KeyLen = LEN_TKIP_EK;
+ NdisMoveMemory(pSharedKey->Key, pAd->StaCfg.GTK, LEN_TKIP_EK);
+ NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.GTK[16], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.GTK[24], LEN_TKIP_TXMICK);
+
+ // Update Shared Key CipherAlg
+ pSharedKey->CipherAlg = CIPHER_NONE;
+ if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
+ pSharedKey->CipherAlg = CIPHER_TKIP;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
+ pSharedKey->CipherAlg = CIPHER_AES;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
+ pSharedKey->CipherAlg = CIPHER_WEP64;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
+ pSharedKey->CipherAlg = CIPHER_WEP128;
+
+
+ // Update group key information to ASIC Shared Key Table
+ AsicAddSharedKeyEntry(pAd,
+ BSS0,
+ pAd->StaCfg.DefaultKeyId,
+ pSharedKey->CipherAlg,
+ pSharedKey->Key,
+ pSharedKey->TxMic,
+ pSharedKey->RxMic);
+
+ // Update ASIC WCID attribute table and IVEIV table
+ RTMPAddWcidAttributeEntry(pAd,
+ BSS0,
+ pAd->StaCfg.DefaultKeyId,
+ pSharedKey->CipherAlg,
+ NULL);
+ }
+
+ return TRUE;
+
+}
+
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Construct EAPoL message for WPA handshaking
+ Its format is below,
+
+ +--------------------+
+ | Protocol Version | 1 octet
+ +--------------------+
+ | Protocol Type | 1 octet
+ +--------------------+
+ | Body Length | 2 octets
+ +--------------------+
+ | Descriptor Type | 1 octet
+ +--------------------+
+ | Key Information | 2 octets
+ +--------------------+
+ | Key Length | 1 octet
+ +--------------------+
+ | Key Repaly Counter | 8 octets
+ +--------------------+
+ | Key Nonce | 32 octets
+ +--------------------+
+ | Key IV | 16 octets
+ +--------------------+
+ | Key RSC | 8 octets
+ +--------------------+
+ | Key ID or Reserved | 8 octets
+ +--------------------+
+ | Key MIC | 16 octets
+ +--------------------+
+ | Key Data Length | 2 octets
+ +--------------------+
+ | Key Data | n octets
+ +--------------------+
+
+
+ Arguments:
+ pAd Pointer to our adapter
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID ConstructEapolMsg(
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN UCHAR GroupKeyWepStatus,
+ IN UCHAR MsgType,
+ IN UCHAR DefaultKeyIdx,
+ IN UCHAR *KeyNonce,
+ IN UCHAR *TxRSC,
+ IN UCHAR *GTK,
+ IN UCHAR *RSNIE,
+ IN UCHAR RSNIE_Len,
+ OUT PEAPOL_PACKET pMsg)
{
- UCHAR A[8], BIN[16], BOUT[16];
- UCHAR xor;
- INT i, j;
- aes_context aesctx;
- UCHAR *R;
- INT num_blocks = c_len/8; // unit:64bits
+ BOOLEAN bWPA2 = FALSE;
+ UCHAR KeyDescVer;
+
+ // Choose WPA2 or not
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) ||
+ (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
+ bWPA2 = TRUE;
+
+ // Init Packet and Fill header
+ pMsg->ProVer = EAPOL_VER;
+ pMsg->ProType = EAPOLKey;
+
+ // Default 95 bytes, the EAPoL-Key descriptor exclude Key-data field
+ SET_UINT16_TO_ARRARY(pMsg->Body_Len, LEN_EAPOL_KEY_MSG);
+
+ // Fill in EAPoL descriptor
+ if (bWPA2)
+ pMsg->KeyDesc.Type = WPA2_KEY_DESC;
+ else
+ pMsg->KeyDesc.Type = WPA1_KEY_DESC;
+
+ // Key Descriptor Version (bits 0-2) specifies the key descriptor version type
+ {
+ // Fill in Key information, refer to IEEE Std 802.11i-2004 page 78
+ // When either the pairwise or the group cipher is AES, the DESC_TYPE_AES(2) shall be used.
+ KeyDescVer = (((pEntry->WepStatus == Ndis802_11Encryption3Enabled) ||
+ (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)) ? (DESC_TYPE_AES) : (DESC_TYPE_TKIP));
+ }
+
+ pMsg->KeyDesc.KeyInfo.KeyDescVer = KeyDescVer;
+
+ // Specify Key Type as Group(0) or Pairwise(1)
+ if (MsgType >= EAPOL_GROUP_MSG_1)
+ pMsg->KeyDesc.KeyInfo.KeyType = GROUPKEY;
+ else
+ pMsg->KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
+
+ // Specify Key Index, only group_msg1_WPA1
+ if (!bWPA2 && (MsgType >= EAPOL_GROUP_MSG_1))
+ pMsg->KeyDesc.KeyInfo.KeyIndex = DefaultKeyIdx;
+
+ if (MsgType == EAPOL_PAIR_MSG_3)
+ pMsg->KeyDesc.KeyInfo.Install = 1;
+
+ if ((MsgType == EAPOL_PAIR_MSG_1) || (MsgType == EAPOL_PAIR_MSG_3) || (MsgType == EAPOL_GROUP_MSG_1))
+ pMsg->KeyDesc.KeyInfo.KeyAck = 1;
+
+ if (MsgType != EAPOL_PAIR_MSG_1)
+ pMsg->KeyDesc.KeyInfo.KeyMic = 1;
+
+ if ((bWPA2 && (MsgType >= EAPOL_PAIR_MSG_3)) ||
+ (!bWPA2 && (MsgType >= EAPOL_GROUP_MSG_1)))
+ {
+ pMsg->KeyDesc.KeyInfo.Secure = 1;
+ }
+
+ if (bWPA2 && ((MsgType == EAPOL_PAIR_MSG_3) ||
+ (MsgType == EAPOL_GROUP_MSG_1)))
+ {
+ pMsg->KeyDesc.KeyInfo.EKD_DL = 1;
+ }
+
+ // key Information element has done.
+ *(USHORT *)(&pMsg->KeyDesc.KeyInfo) = cpu2le16(*(USHORT *)(&pMsg->KeyDesc.KeyInfo));
+
+ // Fill in Key Length
+ {
+ if (MsgType >= EAPOL_GROUP_MSG_1)
+ {
+ // the length of group key cipher
+ pMsg->KeyDesc.KeyLength[1] = ((GroupKeyWepStatus == Ndis802_11Encryption2Enabled) ? TKIP_GTK_LENGTH : LEN_AES_KEY);
+ }
+ else
+ {
+ // the length of pairwise key cipher
+ pMsg->KeyDesc.KeyLength[1] = ((pEntry->WepStatus == Ndis802_11Encryption2Enabled) ? LEN_TKIP_KEY : LEN_AES_KEY);
+ }
+ }
+
+ // Fill in replay counter
+ NdisMoveMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY);
+
+ // Fill Key Nonce field
+ // ANonce : pairwise_msg1 & pairwise_msg3
+ // SNonce : pairwise_msg2
+ // GNonce : group_msg1_wpa1
+ if ((MsgType <= EAPOL_PAIR_MSG_3) || ((!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))))
+ NdisMoveMemory(pMsg->KeyDesc.KeyNonce, KeyNonce, LEN_KEY_DESC_NONCE);
+
+ // Fill key IV - WPA2 as 0, WPA1 as random
+ if (!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))
+ {
+ // Suggest IV be random number plus some number,
+ NdisMoveMemory(pMsg->KeyDesc.KeyIv, &KeyNonce[16], LEN_KEY_DESC_IV);
+ pMsg->KeyDesc.KeyIv[15] += 2;
+ }
+
+ // Fill Key RSC field
+ // It contains the RSC for the GTK being installed.
+ if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1))
+ {
+ NdisMoveMemory(pMsg->KeyDesc.KeyRsc, TxRSC, 6);
+ }
+
+ // Clear Key MIC field for MIC calculation later
+ NdisZeroMemory(pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
+
+ ConstructEapolKeyData(pEntry,
+ GroupKeyWepStatus,
+ KeyDescVer,
+ MsgType,
+ DefaultKeyIdx,
+ GTK,
+ RSNIE,
+ RSNIE_Len,
+ pMsg);
+
+ // Calculate MIC and fill in KeyMic Field except Pairwise Msg 1.
+ if (MsgType != EAPOL_PAIR_MSG_1)
+ {
+ CalculateMIC(KeyDescVer, pEntry->PTK, pMsg);
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> ConstructEapolMsg for %s %s\n", ((bWPA2) ? "WPA2" : "WPA"), GetEapolMsgType(MsgType)));
+ DBGPRINT(RT_DEBUG_TRACE, (" Body length = %d \n", CONV_ARRARY_TO_UINT16(pMsg->Body_Len)));
+ DBGPRINT(RT_DEBUG_TRACE, (" Key length = %d \n", CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyLength)));
+
+
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Construct the Key Data field of EAPoL message
+
+ Arguments:
+ pAd Pointer to our adapter
+ Elem Message body
+
+ Return Value:
+ None
+
+ Note:
+
+ ========================================================================
+*/
+VOID ConstructEapolKeyData(
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN UCHAR GroupKeyWepStatus,
+ IN UCHAR keyDescVer,
+ IN UCHAR MsgType,
+ IN UCHAR DefaultKeyIdx,
+ IN UCHAR *GTK,
+ IN UCHAR *RSNIE,
+ IN UCHAR RSNIE_LEN,
+ OUT PEAPOL_PACKET pMsg)
+{
+ UCHAR *mpool, *Key_Data, *Rc4GTK;
+ UCHAR ekey[(LEN_KEY_DESC_IV+LEN_EAP_EK)];
+ ULONG data_offset;
+ BOOLEAN bWPA2Capable = FALSE;
+ PRTMP_ADAPTER pAd = pEntry->pAd;
+ BOOLEAN GTK_Included = FALSE;
+
+ // Choose WPA2 or not
+ if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) ||
+ (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
+ bWPA2Capable = TRUE;
+
+ if (MsgType == EAPOL_PAIR_MSG_1 ||
+ MsgType == EAPOL_PAIR_MSG_4 ||
+ MsgType == EAPOL_GROUP_MSG_2)
+ return;
+
+ // allocate memory pool
+ os_alloc_mem(NULL, (PUCHAR *)&mpool, 1500);
+
+ if (mpool == NULL)
+ return;
+
+ /* Rc4GTK Len = 512 */
+ Rc4GTK = (UCHAR *) ROUND_UP(mpool, 4);
+ /* Key_Data Len = 512 */
+ Key_Data = (UCHAR *) ROUND_UP(Rc4GTK + 512, 4);
+
+ NdisZeroMemory(Key_Data, 512);
+ SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, 0);
+ data_offset = 0;
+
+ // Encapsulate RSNIE in pairwise_msg2 & pairwise_msg3
+ if (RSNIE_LEN && ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3)))
+ {
+ PUINT8 pmkid_ptr = NULL;
+ UINT8 pmkid_len = 0;
+
+
+ RTMPInsertRSNIE(&Key_Data[data_offset],
+ &data_offset,
+ RSNIE,
+ RSNIE_LEN,
+ pmkid_ptr,
+ pmkid_len);
+ }
+
+
+ // Encapsulate KDE format in pairwise_msg3_WPA2 & group_msg1_WPA2
+ if (bWPA2Capable && ((MsgType == EAPOL_PAIR_MSG_3) || (MsgType == EAPOL_GROUP_MSG_1)))
+ {
+ // Key Data Encapsulation (KDE) format - 802.11i-2004 Figure-43w and Table-20h
+ Key_Data[data_offset + 0] = 0xDD;
+ if (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)
+ {
+ Key_Data[data_offset + 1] = 0x16;// 4+2+16(OUI+DataType+DataField)
+ }
+ else
+ {
+ Key_Data[data_offset + 1] = 0x26;// 4+2+32(OUI+DataType+DataField)
+ }
+
+ Key_Data[data_offset + 2] = 0x00;
+ Key_Data[data_offset + 3] = 0x0F;
+ Key_Data[data_offset + 4] = 0xAC;
+ Key_Data[data_offset + 5] = 0x01;
+
+ // GTK KDE format - 802.11i-2004 Figure-43x
+ Key_Data[data_offset + 6] = (DefaultKeyIdx & 0x03);
+ Key_Data[data_offset + 7] = 0x00; // Reserved Byte
+
+ data_offset += 8;
+ }
+
+
+ // Encapsulate GTK
+ // Only for pairwise_msg3_WPA2 and group_msg1
+ if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2Capable) || (MsgType == EAPOL_GROUP_MSG_1))
+ {
+ // Fill in GTK
+ if (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)
+ {
+ NdisMoveMemory(&Key_Data[data_offset], GTK, LEN_AES_KEY);
+ data_offset += LEN_AES_KEY;
+ }
+ else
+ {
+ NdisMoveMemory(&Key_Data[data_offset], GTK, TKIP_GTK_LENGTH);
+ data_offset += TKIP_GTK_LENGTH;
+ }
+
+ GTK_Included = TRUE;
+ }
+
+
+ // This whole key-data field shall be encrypted if a GTK is included.
+ // Encrypt the data material in key data field with KEK
+ if (GTK_Included)
+ {
+ //hex_dump("GTK_Included", Key_Data, data_offset);
+
+ if (
+ (keyDescVer == DESC_TYPE_AES))
+ {
+ UCHAR remainder = 0;
+ UCHAR pad_len = 0;
+
+ // Key Descriptor Version 2 or 3: AES key wrap, defined in IETF RFC 3394,
+ // shall be used to encrypt the Key Data field using the KEK field from
+ // the derived PTK.
+
+ // If the Key Data field uses the NIST AES key wrap, then the Key Data field
+ // shall be padded before encrypting if the key data length is less than 16
+ // octets or if it is not a multiple of 8. The padding consists of appending
+ // a single octet 0xdd followed by zero or more 0x00 octets.
+ if ((remainder = data_offset & 0x07) != 0)
+ {
+ INT i;
+
+ pad_len = (8 - remainder);
+ Key_Data[data_offset] = 0xDD;
+ for (i = 1; i < pad_len; i++)
+ Key_Data[data_offset + i] = 0;
+
+ data_offset += pad_len;
+ }
+
+ AES_GTK_KEY_WRAP(&pEntry->PTK[16], Key_Data, data_offset, Rc4GTK);
+ // AES wrap function will grow 8 bytes in length
+ data_offset += 8;
+ }
+ else
+ {
+ /* Key Descriptor Version 1: ARC4 is used to encrypt the Key Data field
+ using the KEK field from the derived PTK. */
+
+ // PREPARE Encrypted "Key DATA" field. (Encrypt GTK with RC4, usinf PTK[16]->[31] as Key, IV-field as IV)
+ // put TxTsc in Key RSC field
+ pAd->PrivateInfo.FCSCRC32 = PPPINITFCS32; //Init crc32.
+
+ // ekey is the contanetion of IV-field, and PTK[16]->PTK[31]
+ NdisMoveMemory(ekey, pMsg->KeyDesc.KeyIv, LEN_KEY_DESC_IV);
+ NdisMoveMemory(&ekey[LEN_KEY_DESC_IV], &pEntry->PTK[16], LEN_EAP_EK);
+ ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, ekey, sizeof(ekey)); //INIT SBOX, KEYLEN+3(IV)
+ pAd->PrivateInfo.FCSCRC32 = RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, Key_Data, data_offset);
+ WPAARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, Rc4GTK, Key_Data, data_offset);
+ }
+
+ NdisMoveMemory(pMsg->KeyDesc.KeyData, Rc4GTK, data_offset);
+ }
+ else
+ {
+ NdisMoveMemory(pMsg->KeyDesc.KeyData, Key_Data, data_offset);
+ }
+
+ // Update key data length field and total body length
+ SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, data_offset);
+ INC_UINT16_TO_ARRARY(pMsg->Body_Len, data_offset);
+
+ os_free_mem(NULL, mpool);
+
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Calcaulate MIC. It is used during 4-ways handsharking.
+
+ Arguments:
+ pAd - pointer to our pAdapter context
+ PeerWepStatus - indicate the encryption type
+
+ Return Value:
+
+ Note:
+
+ ========================================================================
+*/
+static VOID CalculateMIC(
+ IN UCHAR KeyDescVer,
+ IN UCHAR *PTK,
+ OUT PEAPOL_PACKET pMsg)
+{
+ UCHAR *OutBuffer;
+ ULONG FrameLen = 0;
+ UCHAR mic[LEN_KEY_DESC_MIC];
+ UCHAR digest[80];
- os_alloc_mem(NULL, (PUCHAR *)&R, 512);
+ // allocate memory for MIC calculation
+ os_alloc_mem(NULL, (PUCHAR *)&OutBuffer, 512);
- if (R == NULL)
+ if (OutBuffer == NULL)
{
- DBGPRINT(RT_DEBUG_ERROR, ("!!!AES_GTK_KEY_UNWRAP: no memory!!!\n"));
- return;
- } /* End of if */
+ DBGPRINT(RT_DEBUG_ERROR, ("!!!CalculateMIC: no memory!!!\n"));
+ return;
+ }
+
+ // make a frame for calculating MIC.
+ MakeOutgoingFrame(OutBuffer, &FrameLen,
+ CONV_ARRARY_TO_UINT16(pMsg->Body_Len) + 4, pMsg,
+ END_OF_ARGS);
- // Initialize
- NdisMoveMemory(A, ciphertext, 8);
- //Input plaintext
- for(i = 0; i < (c_len-8); i++)
+ NdisZeroMemory(mic, sizeof(mic));
+
+ // Calculate MIC
+ if (KeyDescVer == DESC_TYPE_AES)
+ {
+ HMAC_SHA1(PTK, LEN_EAP_MICK, OutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
+ NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
+ }
+ else
{
- R[ i] = ciphertext[i + 8];
+ HMAC_MD5(PTK, LEN_EAP_MICK, OutBuffer, FrameLen, mic, MD5_DIGEST_SIZE);
}
- rtmp_aes_set_key(&aesctx, key, 128);
+ // store the calculated MIC
+ NdisMoveMemory(pMsg->KeyDesc.KeyMic, mic, LEN_KEY_DESC_MIC);
- for(j = 5; j >= 0; j--)
+ os_free_mem(NULL, OutBuffer);
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Some received frames can't decrypt by Asic, so decrypt them by software.
+
+ Arguments:
+ pAd - pointer to our pAdapter context
+ PeerWepStatus - indicate the encryption type
+
+ Return Value:
+ NDIS_STATUS_SUCCESS - decryption successful
+ NDIS_STATUS_FAILURE - decryption failure
+
+ ========================================================================
+*/
+NDIS_STATUS RTMPSoftDecryptBroadCastData(
+ IN PRTMP_ADAPTER pAd,
+ IN RX_BLK *pRxBlk,
+ IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher,
+ IN PCIPHER_KEY pShard_key)
+{
+ PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
+
+
+
+ // handle WEP decryption
+ if (GroupCipher == Ndis802_11Encryption1Enabled)
{
- for(i = (num_blocks-1); i > 0; i--)
+ if (RTMPSoftDecryptWEP(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount, pShard_key))
{
- xor = (num_blocks -1 )* j + i;
- NdisMoveMemory(BIN, A, 8);
- BIN[7] = A[7] ^ xor;
- NdisMoveMemory(&BIN[8], &R[(i-1)*8], 8);
- rtmp_aes_decrypt(&aesctx, BIN, BOUT);
- NdisMoveMemory(A, &BOUT[0], 8);
- NdisMoveMemory(&R[(i-1)*8], &BOUT[8], 8);
+
+ //Minus IV[4] & ICV[4]
+ pRxWI->MPDUtotalByteCount -= 8;
}
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR : Software decrypt WEP data fails.\n"));
+ // give up this frame
+ return NDIS_STATUS_FAILURE;
+ }
+ }
+ // handle TKIP decryption
+ else if (GroupCipher == Ndis802_11Encryption2Enabled)
+ {
+ if (RTMPSoftDecryptTKIP(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount, 0, pShard_key))
+ {
+
+ //Minus 8 bytes MIC, 8 bytes IV/EIV, 4 bytes ICV
+ pRxWI->MPDUtotalByteCount -= 20;
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR : RTMPSoftDecryptTKIP Failed\n"));
+ // give up this frame
+ return NDIS_STATUS_FAILURE;
+ }
}
+ // handle AES decryption
+ else if (GroupCipher == Ndis802_11Encryption3Enabled)
+ {
+ if (RTMPSoftDecryptAES(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount , pShard_key))
+ {
- // OUTPUT
- for(i = 0; i < c_len; i++)
+ //8 bytes MIC, 8 bytes IV/EIV (CCMP Header)
+ pRxWI->MPDUtotalByteCount -= 16;
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("ERROR : RTMPSoftDecryptAES Failed\n"));
+ // give up this frame
+ return NDIS_STATUS_FAILURE;
+ }
+ }
+ else
{
- plaintext[i] = R[i];
+ // give up this frame
+ return NDIS_STATUS_FAILURE;
}
+ return NDIS_STATUS_SUCCESS;
+
+}
+
+
+PUINT8 GetSuiteFromRSNIE(
+ IN PUINT8 rsnie,
+ IN UINT rsnie_len,
+ IN UINT8 type,
+ OUT UINT8 *count)
+{
+ PEID_STRUCT pEid;
+ INT len;
+ PUINT8 pBuf;
+ INT offset = 0;
+ PRSNIE_AUTH pAkm;
+ UINT16 acount;
+ BOOLEAN isWPA2 = FALSE;
+
+ pEid = (PEID_STRUCT)rsnie;
+ len = rsnie_len - 2; // exclude IE and length
+ pBuf = (PUINT8)&pEid->Octet[0];
+
+
+
+ // set default value
+ *count = 0;
+
+ // Check length
+ if ((len <= 0) || (pEid->Len != len))
+ {
+ DBGPRINT_ERR(("%s : The length is invalid\n", __func__));
+ return NULL;
+ }
+
+ // Check WPA or WPA2
+ if (pEid->Eid == IE_WPA)
+ {
+ PRSNIE pRsnie = (PRSNIE)pBuf;
+ UINT16 ucount;
+
+ if (len < sizeof(RSNIE))
+ {
+ DBGPRINT_ERR(("%s : The length is too short for WPA\n", __func__));
+ return NULL;
+ }
+
+ // Get the count of pairwise cipher
+ ucount = cpu2le16(pRsnie->ucount);
+ if (ucount > 2)
+ {
+ DBGPRINT_ERR(("%s : The count(%d) of pairwise cipher is invlaid\n",
+ __func__, ucount));
+ return NULL;
+ }
+
+ // Get the group cipher
+ if (type == GROUP_SUITE)
+ {
+ *count = 1;
+ return pRsnie->mcast;
+ }
+ // Get the pairwise cipher suite
+ else if (type == PAIRWISE_SUITE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of pairwise cipher is %d\n",
+ __func__, ucount));
+ *count = ucount;
+ return pRsnie->ucast[0].oui;
+ }
+
+ offset = sizeof(RSNIE) + (4 * (ucount - 1));
+
+ }
+ else if (pEid->Eid == IE_RSN)
+ {
+ PRSNIE2 pRsnie = (PRSNIE2)pBuf;
+ UINT16 ucount;
+
+ isWPA2 = TRUE;
+
+ if (len < sizeof(RSNIE2))
+ {
+ DBGPRINT_ERR(("%s : The length is too short for WPA2\n", __func__));
+ return NULL;
+ }
+
+ // Get the count of pairwise cipher
+ ucount = cpu2le16(pRsnie->ucount);
+ if (ucount > 2)
+ {
+ DBGPRINT_ERR(("%s : The count(%d) of pairwise cipher is invlaid\n",
+ __func__, ucount));
+ return NULL;
+ }
+
+ // Get the group cipher
+ if (type == GROUP_SUITE)
+ {
+ *count = 1;
+ return pRsnie->mcast;
+ }
+ // Get the pairwise cipher suite
+ else if (type == PAIRWISE_SUITE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of pairwise cipher is %d\n",
+ __func__, ucount));
+ *count = ucount;
+ return pRsnie->ucast[0].oui;
+ }
+
+ offset = sizeof(RSNIE2) + (4 * (ucount - 1));
+
+ }
+ else
+ {
+ DBGPRINT_ERR(("%s : Unknown IE (%d)\n", __func__, pEid->Eid));
+ return NULL;
+ }
+
+ // skip group cipher and pairwise cipher suite
+ pBuf += offset;
+ len -= offset;
+
+ if (len < sizeof(RSNIE_AUTH))
+ {
+ DBGPRINT_ERR(("%s : The length of RSNIE is too short\n", __func__));
+ return NULL;
+ }
+
+ // pointer to AKM count
+ pAkm = (PRSNIE_AUTH)pBuf;
+
+ // Get the count of pairwise cipher
+ acount = cpu2le16(pAkm->acount);
+ if (acount > 2)
+ {
+ DBGPRINT_ERR(("%s : The count(%d) of AKM is invlaid\n",
+ __func__, acount));
+ return NULL;
+ }
+
+ // Get the AKM suite
+ if (type == AKM_SUITE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of AKM is %d\n",
+ __func__, acount));
+ *count = acount;
+ return pAkm->auth[0].oui;
+ }
+ offset = sizeof(RSNIE_AUTH) + (4 * (acount - 1));
+
+ pBuf += offset;
+ len -= offset;
+
+ // The remaining length must larger than (RSN-Capability(2) + PMKID-Count(2) + PMKID(16~))
+ if (len >= (sizeof(RSN_CAPABILITIES) + 2 + LEN_PMKID))
+ {
+ // Skip RSN capability and PMKID-Count
+ pBuf += (sizeof(RSN_CAPABILITIES) + 2);
+ len -= (sizeof(RSN_CAPABILITIES) + 2);
+
+ // Get PMKID
+ if (type == PMKID_LIST)
+ {
+ *count = 1;
+ return pBuf;
+ }
+ }
+ else
+ {
+ DBGPRINT_ERR(("%s : it can't get any more information beyond AKM \n", __func__));
+ return NULL;
+ }
+
+ *count = 0;
+ //DBGPRINT_ERR(("%s : The type(%d) doesn't support \n", __func__, type));
+ return NULL;
+
+}
+
+VOID WpaShowAllsuite(
+ IN PUINT8 rsnie,
+ IN UINT rsnie_len)
+{
+ PUINT8 pSuite = NULL;
+ UINT8 count;
+
+ hex_dump("RSNIE", rsnie, rsnie_len);
+
+ // group cipher
+ if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, GROUP_SUITE, &count)) != NULL)
+ {
+ hex_dump("group cipher", pSuite, 4*count);
+ }
+
+ // pairwise cipher
+ if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, PAIRWISE_SUITE, &count)) != NULL)
+ {
+ hex_dump("pairwise cipher", pSuite, 4*count);
+ }
+
+ // AKM
+ if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, AKM_SUITE, &count)) != NULL)
+ {
+ hex_dump("AKM suite", pSuite, 4*count);
+ }
+
+ // PMKID
+ if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, PMKID_LIST, &count)) != NULL)
+ {
+ hex_dump("PMKID", pSuite, LEN_PMKID);
+ }
+
+}
+
+VOID RTMPInsertRSNIE(
+ IN PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN PUINT8 rsnie_ptr,
+ IN UINT8 rsnie_len,
+ IN PUINT8 pmkid_ptr,
+ IN UINT8 pmkid_len)
+{
+ PUCHAR pTmpBuf;
+ ULONG TempLen = 0;
+ UINT8 extra_len = 0;
+ UINT16 pmk_count = 0;
+ UCHAR ie_num;
+ UINT8 total_len = 0;
+ UCHAR WPA2_OUI[3]={0x00,0x0F,0xAC};
+
+ pTmpBuf = pFrameBuf;
+
+ /* PMKID-List Must larger than 0 and the multiple of 16. */
+ if (pmkid_len > 0 && ((pmkid_len & 0x0f) == 0))
+ {
+ extra_len = sizeof(UINT16) + pmkid_len;
+
+ pmk_count = (pmkid_len >> 4);
+ pmk_count = cpu2le16(pmk_count);
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_WARN, ("%s : The length is PMKID-List is invalid (%d), so don't insert it.\n",
+ __func__, pmkid_len));
+ }
+
+ if (rsnie_len != 0)
+ {
+ ie_num = IE_WPA;
+ total_len = rsnie_len;
+
+ if (NdisEqualMemory(rsnie_ptr + 2, WPA2_OUI, sizeof(WPA2_OUI)))
+ {
+ ie_num = IE_RSN;
+ total_len += extra_len;
+ }
+
+ /* construct RSNIE body */
+ MakeOutgoingFrame(pTmpBuf, &TempLen,
+ 1, &ie_num,
+ 1, &total_len,
+ rsnie_len, rsnie_ptr,
+ END_OF_ARGS);
+
+ pTmpBuf += TempLen;
+ *pFrameLen = *pFrameLen + TempLen;
+
+ if (ie_num == IE_RSN)
+ {
+ /* Insert PMKID-List field */
+ if (extra_len > 0)
+ {
+ MakeOutgoingFrame(pTmpBuf, &TempLen,
+ 2, &pmk_count,
+ pmkid_len, pmkid_ptr,
+ END_OF_ARGS);
+
+ pTmpBuf += TempLen;
+ *pFrameLen = *pFrameLen + TempLen;
+ }
+ }
+ }
- os_free_mem(NULL, R);
+ return;
}
diff --git a/drivers/staging/rt3090/common/crypt_hmac.c b/drivers/staging/rt2860/common/crypt_hmac.c
index e2854082f1d9..adf3cad0691a 100644
--- a/drivers/staging/rt3090/common/crypt_hmac.c
+++ b/drivers/staging/rt2860/common/crypt_hmac.c
@@ -77,12 +77,12 @@ VOID HMAC_SHA1 (
/* End of if */
/* Exclusive-Or K0 with ipad */
- /* ipad: Inner pad; the byte x��36�� repeated B times. */
+ /* ipad: Inner pad; the byte x¡¦36¡¦ repeated B times. */
for (index = 0; index < SHA1_BLOCK_SIZE; index++)
K0[index] ^= 0x36;
/* End of for */
- SHA1_Init(&sha_ctx1);
+ RT_SHA1_Init(&sha_ctx1);
/* H(K0^ipad) */
SHA1_Append(&sha_ctx1, K0, sizeof(K0));
/* H((K0^ipad)||text) */
@@ -90,12 +90,12 @@ VOID HMAC_SHA1 (
SHA1_End(&sha_ctx1, Digest);
/* Exclusive-Or K0 with opad and remove ipad */
- /* opad: Outer pad; the byte x��5c�� repeated B times. */
+ /* opad: Outer pad; the byte x¡¦5c¡¦ repeated B times. */
for (index = 0; index < SHA1_BLOCK_SIZE; index++)
K0[index] ^= 0x36^0x5c;
/* End of for */
- SHA1_Init(&sha_ctx2);
+ RT_SHA1_Init(&sha_ctx2);
/* H(K0^opad) */
SHA1_Append(&sha_ctx2, K0, sizeof(K0));
/* H( (K0^opad) || H((K0^ipad)||text) ) */
@@ -160,7 +160,7 @@ VOID HMAC_SHA256 (
}
/* Exclusive-Or K0 with ipad */
- /* ipad: Inner pad; the byte x��36�� repeated B times. */
+ /* ipad: Inner pad; the byte x¡¦36¡¦ repeated B times. */
for (index = 0; index < SHA256_BLOCK_SIZE; index++)
K0[index] ^= 0x36;
/* End of for */
@@ -173,7 +173,7 @@ VOID HMAC_SHA256 (
SHA256_End(&sha_ctx1, Digest);
/* Exclusive-Or K0 with opad and remove ipad */
- /* opad: Outer pad; the byte x��5c�� repeated B times. */
+ /* opad: Outer pad; the byte x¡¦5c¡¦ repeated B times. */
for (index = 0; index < SHA256_BLOCK_SIZE; index++)
K0[index] ^= 0x36^0x5c;
/* End of for */
@@ -244,7 +244,7 @@ VOID HMAC_MD5(
}
/* Exclusive-Or K0 with ipad */
- /* ipad: Inner pad; the byte x��36�� repeated B times. */
+ /* ipad: Inner pad; the byte x¡¦36¡¦ repeated B times. */
for (index = 0; index < MD5_BLOCK_SIZE; index++)
K0[index] ^= 0x36;
/* End of for */
@@ -257,7 +257,7 @@ VOID HMAC_MD5(
MD5_End(&md5_ctx1, Digest);
/* Exclusive-Or K0 with opad and remove ipad */
- /* opad: Outer pad; the byte x��5c�� repeated B times. */
+ /* opad: Outer pad; the byte x¡¦5c¡¦ repeated B times. */
for (index = 0; index < MD5_BLOCK_SIZE; index++)
K0[index] ^= 0x36^0x5c;
/* End of for */
diff --git a/drivers/staging/rt3090/common/crypt_md5.c b/drivers/staging/rt2860/common/crypt_md5.c
index b09326540f5e..7c9ecfa8e5a2 100644
--- a/drivers/staging/rt3090/common/crypt_md5.c
+++ b/drivers/staging/rt2860/common/crypt_md5.c
@@ -26,7 +26,6 @@
#include "../crypt_md5.h"
-
#ifdef MD5_SUPPORT
/*
* F, G, H and I are basic MD5 functions.
diff --git a/drivers/staging/rt3090/common/crypt_sha2.c b/drivers/staging/rt2860/common/crypt_sha2.c
index c7490d0d3c44..cb3f7c27b622 100644
--- a/drivers/staging/rt3090/common/crypt_sha2.c
+++ b/drivers/staging/rt2860/common/crypt_sha2.c
@@ -26,7 +26,6 @@
#include "../crypt_sha2.h"
-
/* Basic operations */
#define SHR(x,n) (x >> n) /* SHR(x)^n, right shift n bits , x is w-bit word, 0 <= n <= w */
#define ROTR(x,n,w) ((x >> n) | (x << (w - n))) /* ROTR(x)^n, circular right shift n bits , x is w-bit word, 0 <= n <= w */
@@ -99,7 +98,7 @@ Note:
None
========================================================================
*/
-VOID SHA1_Init (
+VOID RT_SHA1_Init (
IN SHA1_CTX_STRUC *pSHA_CTX)
{
NdisMoveMemory(pSHA_CTX->HashValue, SHA1_DefaultHashValue,
@@ -107,7 +106,7 @@ VOID SHA1_Init (
NdisZeroMemory(pSHA_CTX->Block, SHA1_BLOCK_SIZE);
pSHA_CTX->MessageLen = 0;
pSHA_CTX->BlockLen = 0;
-} /* End of SHA1_Init */
+} /* End of RT_SHA1_Init */
/*
@@ -305,7 +304,7 @@ VOID RT_SHA1 (
SHA1_CTX_STRUC sha_ctx;
NdisZeroMemory(&sha_ctx, sizeof(SHA1_CTX_STRUC));
- SHA1_Init(&sha_ctx);
+ RT_SHA1_Init(&sha_ctx);
SHA1_Append(&sha_ctx, Message, MessageLen);
SHA1_End(&sha_ctx, DigestMessage);
} /* End of RT_SHA1 */
diff --git a/drivers/staging/rt2860/common/dfs.c b/drivers/staging/rt2860/common/dfs.c
index 23330f2661d9..11b7c1932a2e 100644
--- a/drivers/staging/rt2860/common/dfs.c
+++ b/drivers/staging/rt2860/common/dfs.c
@@ -33,164 +33,10 @@
Revision History:
Who When What
-------- ---------- ----------------------------------------------
- Fonchi 03-12-2007 created
*/
#include "../rt_config.h"
-typedef struct _RADAR_DURATION_TABLE
-{
- ULONG RDDurRegion;
- ULONG RadarSignalDuration;
- ULONG Tolerance;
-} RADAR_DURATION_TABLE, *PRADAR_DURATION_TABLE;
-
-
-static UCHAR RdIdleTimeTable[MAX_RD_REGION][4] =
-{
- {9, 250, 250, 250}, // CE
- {4, 250, 250, 250}, // FCC
- {4, 250, 250, 250}, // JAP
- {15, 250, 250, 250}, // JAP_W53
- {4, 250, 250, 250} // JAP_W56
-};
-
-/*
- ========================================================================
-
- Routine Description:
- Bbp Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID BbpRadarDetectionStart(
- IN PRTMP_ADAPTER pAd)
-{
- UINT8 RadarPeriod;
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 114, 0x02);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 121, 0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 122, 0x00);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 123, 0x08/*0x80*/);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff);
-
- RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ?
- (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250;
-
- RTMP_IO_WRITE8(pAd, 0x7020, 0x1d);
- RTMP_IO_WRITE8(pAd, 0x7021, 0x40);
-
- RadarDetectionStart(pAd, 0, RadarPeriod);
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Bbp Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID BbpRadarDetectionStop(
- IN PRTMP_ADAPTER pAd)
-{
- RTMP_IO_WRITE8(pAd, 0x7020, 0x1d);
- RTMP_IO_WRITE8(pAd, 0x7021, 0x60);
-
- RadarDetectionStop(pAd);
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID RadarDetectionStart(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN CTSProtect,
- IN UINT8 CTSPeriod)
-{
- UINT8 DfsActiveTime = (pAd->CommonCfg.RadarDetect.DfsSessionTime & 0x1f);
- UINT8 CtsProtect = (CTSProtect == 1) ? 0x02 : 0x01; // CTS protect.
-
- if (CTSProtect != 0)
- {
- switch(pAd->CommonCfg.RadarDetect.RDDurRegion)
- {
- case FCC:
- case JAP_W56:
- CtsProtect = 0x03;
- break;
-
- case CE:
- case JAP_W53:
- default:
- CtsProtect = 0x02;
- break;
- }
- }
- else
- CtsProtect = 0x01;
-
-
- // send start-RD with CTS protection command to MCU
- // highbyte [7] reserve
- // highbyte [6:5] 0x: stop Carrier/Radar detection
- // highbyte [10]: Start Carrier/Radar detection without CTS protection, 11: Start Carrier/Radar detection with CTS protection
- // highbyte [4:0] Radar/carrier detection duration. In 1ms.
-
- // lowbyte [7:0] Radar/carrier detection period, in 1ms.
- AsicSendCommandToMcu(pAd, 0x60, 0xff, CTSPeriod, DfsActiveTime | (CtsProtect << 5));
- //AsicSendCommandToMcu(pAd, 0x63, 0xff, 10, 0);
-
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- TRUE Found radar signal
- FALSE Not found radar signal
-
- ========================================================================
-*/
-VOID RadarDetectionStop(
- IN PRTMP_ADAPTER pAd)
-{
- DBGPRINT(RT_DEBUG_TRACE,("RadarDetectionStop.\n"));
- AsicSendCommandToMcu(pAd, 0x60, 0xff, 0x00, 0x00); // send start-RD with CTS protection command to MCU
-
- return;
-}
-
/*
========================================================================
@@ -210,7 +56,6 @@ BOOLEAN RadarChannelCheck(
IN PRTMP_ADAPTER pAd,
IN UCHAR Ch)
{
-#if 1
INT i;
BOOLEAN result = FALSE;
@@ -224,209 +69,4 @@ BOOLEAN RadarChannelCheck(
}
return result;
-#else
- INT i;
- UCHAR Channel[15]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
-
- for (i=0; i<15; i++)
- {
- if (Ch == Channel[i])
- {
- break;
- }
- }
-
- if (i != 15)
- return TRUE;
- else
- return FALSE;
-#endif
-}
-
-ULONG JapRadarType(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG i;
- const UCHAR Channel[15]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
-
- if (pAd->CommonCfg.RadarDetect.RDDurRegion != JAP)
- {
- return pAd->CommonCfg.RadarDetect.RDDurRegion;
- }
-
- for (i=0; i<15; i++)
- {
- if (pAd->CommonCfg.Channel == Channel[i])
- {
- break;
- }
- }
-
- if (i < 4)
- return JAP_W53;
- else if (i < 15)
- return JAP_W56;
- else
- return JAP; // W52
-
-}
-
-ULONG RTMPBbpReadRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- UINT8 byteValue = 0;
- ULONG result;
-
- BBP_IO_READ8_BY_REG_ID(pAd, BBP_R115, &byteValue);
-
- result = 0;
- switch (byteValue)
- {
- case 1: // radar signal detected by pulse mode.
- case 2: // radar signal detected by width mode.
- result = RTMPReadRadarDuration(pAd);
- break;
-
- case 0: // No radar signal.
- default:
-
- result = 0;
- break;
- }
-
- return result;
-}
-
-ULONG RTMPReadRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG result = 0;
-
- return result;
-
-}
-
-VOID RTMPCleanRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- return;
-}
-
-/*
- ========================================================================
- Routine Description:
- Radar wave detection. The API should be invoke each second.
-
- Arguments:
- pAd - Adapter pointer
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID ApRadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd)
-{
- INT i;
-
- pAd->CommonCfg.RadarDetect.InServiceMonitorCount++;
-
- for (i=0; i<pAd->ChannelListNum; i++)
- {
- if (pAd->ChannelList[i].RemainingTimeForUse > 0)
- {
- pAd->ChannelList[i].RemainingTimeForUse --;
- if ((pAd->Mlme.PeriodicRound%5) == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RadarDetectPeriodic - ch=%d, RemainingTimeForUse=%d\n", pAd->ChannelList[i].Channel, pAd->ChannelList[i].RemainingTimeForUse));
- }
- }
- }
-
- //radar detect
- if ((pAd->CommonCfg.Channel > 14)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && RadarChannelCheck(pAd, pAd->CommonCfg.Channel))
- {
- RadarDetectPeriodic(pAd);
- }
-
- return;
-}
-
-// Periodic Radar detection, switch channel will occur in RTMPHandleTBTTInterrupt()
-// Before switch channel, driver needs doing channel switch announcement.
-VOID RadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd)
-{
- // need to check channel availability, after switch channel
- if (pAd->CommonCfg.RadarDetect.RDMode != RD_SILENCE_MODE)
- return;
-
- // channel availability check time is 60sec, use 65 for assurance
- if (pAd->CommonCfg.RadarDetect.RDCount++ > pAd->CommonCfg.RadarDetect.ChMovingTime)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Not found radar signal, start send beacon and radar detection in service monitor\n\n"));
- BbpRadarDetectionStop(pAd);
- AsicEnableBssSync(pAd);
- pAd->CommonCfg.RadarDetect.RDMode = RD_NORMAL_MODE;
-
-
- return;
- }
-
- return;
-}
-
-
-/*
- ==========================================================================
- Description:
- change channel moving time for DFS testing.
-
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 set ChMovTime=[value]
- ==========================================================================
-*/
-INT Set_ChMovingTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- UINT8 Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- pAd->CommonCfg.RadarDetect.ChMovingTime = Value;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __func__,
- pAd->CommonCfg.RadarDetect.ChMovingTime));
-
- return TRUE;
}
-
-INT Set_LongPulseRadarTh_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- UINT8 Value;
-
- Value = simple_strtol(arg, 0, 10) > 10 ? 10 : simple_strtol(arg, 0, 10);
-
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh = Value;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __func__,
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh));
-
- return TRUE;
-}
-
-
diff --git a/drivers/staging/rt3090/common/ee_efuse.c b/drivers/staging/rt2860/common/ee_efuse.c
index c51e3059bf4c..f52224441d23 100644
--- a/drivers/staging/rt3090/common/ee_efuse.c
+++ b/drivers/staging/rt2860/common/ee_efuse.c
@@ -35,7 +35,9 @@
-------- ---------- ----------------------------------------------
*/
-#include "../rt_config.h"
+
+#include "../rt_config.h"
+
#define EFUSE_USAGE_MAP_START 0x2d0
@@ -51,22 +53,6 @@
#define EFUSE_TAG 0x2fe
-
-#ifdef RT_BIG_ENDIAN
-typedef union _EFUSE_CTRL_STRUC {
- struct {
- UINT32 SEL_EFUSE:1;
- UINT32 EFSROM_KICK:1;
- UINT32 RESERVED:4;
- UINT32 EFSROM_AIN:10;
- UINT32 EFSROM_LDO_ON_TIME:2;
- UINT32 EFSROM_LDO_OFF_TIME:6;
- UINT32 EFSROM_MODE:2;
- UINT32 EFSROM_AOUT:6;
- } field;
- UINT32 word;
-} EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
-#else
typedef union _EFUSE_CTRL_STRUC {
struct {
UINT32 EFSROM_AOUT:6;
@@ -80,7 +66,6 @@ typedef union _EFUSE_CTRL_STRUC {
} field;
UINT32 word;
} EFUSE_CTRL_STRUC, *PEFUSE_CTRL_STRUC;
-#endif // RT_BIG_ENDIAN //
static UCHAR eFuseReadRegisters(
IN PRTMP_ADAPTER pAd,
@@ -197,11 +182,7 @@ UCHAR eFuseReadRegisters(
//Return 2-bytes
//The return byte statrs from S. Therefore, the little-endian will return BA, the Big-endian will return DC.
//For returning the bottom 2 bytes, the Big-endian should shift right 2-bytes.
-#ifdef RT_BIG_ENDIAN
- data = data << (8*((Offset & 0x3)^0x2));
-#else
data = data >> (8*(Offset & 0x3));
-#endif // RT_BIG_ENDIAN //
NdisMoveMemory(pData, &data, Length);
}
@@ -272,11 +253,7 @@ VOID eFusePhysicalReadRegisters(
RTMP_IO_READ32(pAd, efuseDataOffset, &data);
-#ifdef RT_BIG_ENDIAN
- data = data << (8*((Offset & 0x3)^0x2));
-#else
data = data >> (8*(Offset & 0x3));
-#endif // RT_BIG_ENDIAN //
NdisMoveMemory(pData, &data, Length);
@@ -445,7 +422,7 @@ static VOID eFusePhysicalWriteRegisters(
NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
- //Step4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It��s done.
+ //Step4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It¡¦s done.
i = 0;
while(i < 500)
@@ -1067,7 +1044,7 @@ static NTSTATUS eFuseWriteRegistersFromBin(
RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
- //Step1.1.4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It��s done.
+ //Step1.1.4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It¡¦s done.
i = 0;
while(i < 100)
{
diff --git a/drivers/staging/rt3090/common/ee_prom.c b/drivers/staging/rt2860/common/ee_prom.c
index 051cfdee2a15..9ebff8b9e568 100644
--- a/drivers/staging/rt3090/common/ee_prom.c
+++ b/drivers/staging/rt2860/common/ee_prom.c
@@ -35,7 +35,9 @@
-------- ---------- ----------------------------------------------
*/
-#include "../rt_config.h"
+
+#include "../rt_config.h"
+
// IRQL = PASSIVE_LEVEL
@@ -188,14 +190,6 @@ int rtmp_ee_prom_read16(
UINT32 x;
USHORT data;
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- if (pAd->NicConfig2.field.AntDiversity)
- {
- pAd->EepromAccess = TRUE;
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
Offset /= 2;
// reset bits and set EECS
@@ -221,18 +215,6 @@ int rtmp_ee_prom_read16(
EEpromCleanup(pAd);
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- // Antenna and EEPROM access are both using EESK pin,
- // Therefor we should avoid accessing EESK at the same time
- // Then restore antenna after EEPROM access
- if ((pAd->NicConfig2.field.AntDiversity)/* || (pAd->RfIcType == RFIC_3020)*/)
- {
- pAd->EepromAccess = FALSE;
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
*pValue = data;
@@ -247,14 +229,6 @@ int rtmp_ee_prom_write16(
{
UINT32 x;
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- if (pAd->NicConfig2.field.AntDiversity)
- {
- pAd->EepromAccess = TRUE;
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
Offset /= 2;
@@ -290,18 +264,6 @@ int rtmp_ee_prom_write16(
EEpromCleanup(pAd);
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- // Antenna and EEPROM access are both using EESK pin,
- // Therefor we should avoid accessing EESK at the same time
- // Then restore antenna after EEPROM access
- if ((pAd->NicConfig2.field.AntDiversity) /*|| (pAd->RfIcType == RFIC_3020)*/)
- {
- pAd->EepromAccess = FALSE;
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
return NDIS_STATUS_SUCCESS;
diff --git a/drivers/staging/rt2860/common/eeprom.c b/drivers/staging/rt2860/common/eeprom.c
index ffcb4ce1a034..03b8454bf74f 100644
--- a/drivers/staging/rt2860/common/eeprom.c
+++ b/drivers/staging/rt2860/common/eeprom.c
@@ -36,1444 +36,68 @@
*/
#include "../rt_config.h"
-// IRQL = PASSIVE_LEVEL
-VOID RaiseClock(
- IN PRTMP_ADAPTER pAd,
- IN UINT32 *x)
-{
- *x = *x | EESK;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
- RTMPusecDelay(1); // Max frequency = 1MHz in Spec. definition
-}
-
-// IRQL = PASSIVE_LEVEL
-VOID LowerClock(
- IN PRTMP_ADAPTER pAd,
- IN UINT32 *x)
-{
- *x = *x & ~EESK;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, *x);
- RTMPusecDelay(1);
-}
-
-// IRQL = PASSIVE_LEVEL
-USHORT ShiftInBits(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 x,i;
- USHORT data=0;
-
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
-
- x &= ~( EEDO | EEDI);
-
- for(i=0; i<16; i++)
- {
- data = data << 1;
- RaiseClock(pAd, &x);
-
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
-
- LowerClock(pAd, &x); /* prevent read failed */
-
- x &= ~(EEDI);
- if(x & EEDO)
- data |= 1;
- }
-
- return data;
-}
-
-// IRQL = PASSIVE_LEVEL
-VOID ShiftOutBits(
- IN PRTMP_ADAPTER pAd,
- IN USHORT data,
- IN USHORT count)
-{
- UINT32 x,mask;
-
- mask = 0x01 << (count - 1);
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
-
- x &= ~(EEDO | EEDI);
-
- do
- {
- x &= ~EEDI;
- if(data & mask) x |= EEDI;
-
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
-
- mask = mask >> 1;
- } while(mask);
-
- x &= ~EEDI;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-}
-
-// IRQL = PASSIVE_LEVEL
-VOID EEpromCleanup(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 x;
-
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
-
- x &= ~(EECS | EEDI);
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
-}
-
-VOID EWEN(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 x;
-
- // reset bits and set EECS
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EEDI | EEDO | EESK);
- x |= EECS;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- // kick a pulse
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
-
- // output the read_opcode and six pulse in that order
- ShiftOutBits(pAd, EEPROM_EWEN_OPCODE, 5);
- ShiftOutBits(pAd, 0, 6);
-
- EEpromCleanup(pAd);
-}
-
-VOID EWDS(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 x;
-
- // reset bits and set EECS
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EEDI | EEDO | EESK);
- x |= EECS;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- // kick a pulse
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
-
- // output the read_opcode and six pulse in that order
- ShiftOutBits(pAd, EEPROM_EWDS_OPCODE, 5);
- ShiftOutBits(pAd, 0, 6);
-
- EEpromCleanup(pAd);
-}
-
-// IRQL = PASSIVE_LEVEL
-USHORT RTMP_EEPROM_READ16(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset)
-{
- UINT32 x;
- USHORT data;
-
-#ifdef RT2870
- if (pAd->NicConfig2.field.AntDiversity)
- {
- pAd->EepromAccess = TRUE;
- }
-#endif
- Offset /= 2;
- // reset bits and set EECS
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EEDI | EEDO | EESK);
- x |= EECS;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- // patch can not access e-Fuse issue
- if (!IS_RT3090(pAd))
- {
- // kick a pulse
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
- }
-
- // output the read_opcode and register number in that order
- ShiftOutBits(pAd, EEPROM_READ_OPCODE, 3);
- ShiftOutBits(pAd, Offset, pAd->EEPROMAddressNum);
-
- // Now read the data (16 bits) in from the selected EEPROM word
- data = ShiftInBits(pAd);
-
- EEpromCleanup(pAd);
-
-#ifdef RT2870
- // Antenna and EEPROM access are both using EESK pin,
- // Therefor we should avoid accessing EESK at the same time
- // Then restore antenna after EEPROM access
- if ((pAd->NicConfig2.field.AntDiversity) || (pAd->RfIcType == RFIC_3020))
- {
- pAd->EepromAccess = FALSE;
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- }
-#endif
- return data;
-} //ReadEEprom
-
-VOID RTMP_EEPROM_WRITE16(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Data)
-{
- UINT32 x;
-
-#ifdef RT2870
- if (pAd->NicConfig2.field.AntDiversity)
- {
- pAd->EepromAccess = TRUE;
- }
-#endif
- Offset /= 2;
-
- EWEN(pAd);
-
- // reset bits and set EECS
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EEDI | EEDO | EESK);
- x |= EECS;
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- // patch can not access e-Fuse issue
- if (!IS_RT3090(pAd))
- {
- // kick a pulse
- RaiseClock(pAd, &x);
- LowerClock(pAd, &x);
- }
-
- // output the read_opcode ,register number and data in that order
- ShiftOutBits(pAd, EEPROM_WRITE_OPCODE, 3);
- ShiftOutBits(pAd, Offset, pAd->EEPROMAddressNum);
- ShiftOutBits(pAd, Data, 16); // 16-bit access
-
- // read DO status
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
-
- EEpromCleanup(pAd);
-
- RTMPusecDelay(10000); //delay for twp(MAX)=10ms
-
- EWDS(pAd);
-
- EEpromCleanup(pAd);
-
-#ifdef RT2870
- // Antenna and EEPROM access are both using EESK pin,
- // Therefor we should avoid accessing EESK at the same time
- // Then restore antenna after EEPROM access
- if ((pAd->NicConfig2.field.AntDiversity) || (pAd->RfIcType == RFIC_3020))
- {
- pAd->EepromAccess = FALSE;
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- }
-#endif
-}
-
-#ifdef RT2870
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-UCHAR eFuseReadRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData)
-{
- EFUSE_CTRL_STRUC eFuseCtrlStruc;
- int i;
- USHORT efuseDataOffset;
- UINT32 data;
-
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- //Step0. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- //Use the eeprom logical address and covert to address to block number
- eFuseCtrlStruc.field.EFSROM_AIN = Offset & 0xfff0;
-
- //Step1. Write EFSROM_MODE (0x580, bit7:bit6) to 0.
- eFuseCtrlStruc.field.EFSROM_MODE = 0;
-
- //Step2. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical read procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step3. Polling EFSROM_KICK(0x580, bit30) until it become 0 again.
- i = 0;
- while(i < 100)
- {
- //rtmp.HwMemoryReadDword(EFUSE_CTRL, (DWORD *) &eFuseCtrlStruc, 4);
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
- {
- break;
- }
- RTMPusecDelay(2);
- i++;
- }
-
- //if EFSROM_AOUT is not found in physical address, write 0xffff
- if (eFuseCtrlStruc.field.EFSROM_AOUT == 0x3f)
- {
- for(i=0; i<Length/2; i++)
- *(pData+2*i) = 0xffff;
- }
- else
- {
- //Step4. Read 16-byte of data from EFUSE_DATA0-3 (0x590-0x59C)
- efuseDataOffset = EFUSE_DATA3 - (Offset & 0xC) ;
- //data hold 4 bytes data.
- //In RTMP_IO_READ32 will automatically execute 32-bytes swapping
- RTMP_IO_READ32(pAd, efuseDataOffset, &data);
- //Decide the upper 2 bytes or the bottom 2 bytes.
- // Little-endian S | S Big-endian
- // addr 3 2 1 0 | 0 1 2 3
- // Ori-V D C B A | A B C D
- //After swapping
- // D C B A | D C B A
- //Return 2-bytes
- //The return byte statrs from S. Therefore, the little-endian will return BA, the Big-endian will return DC.
- //For returning the bottom 2 bytes, the Big-endian should shift right 2-bytes.
- data = data >> (8*(Offset & 0x3));
-
- NdisMoveMemory(pData, &data, Length);
- }
-
- return (UCHAR) eFuseCtrlStruc.field.EFSROM_AOUT;
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-VOID eFusePhysicalReadRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData)
+INT RtmpChipOpsEepromHook(
+ IN RTMP_ADAPTER *pAd,
+ IN INT infType)
{
- EFUSE_CTRL_STRUC eFuseCtrlStruc;
- int i;
- USHORT efuseDataOffset;
- UINT32 data;
-
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- //Step0. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- eFuseCtrlStruc.field.EFSROM_AIN = Offset & 0xfff0;
-
- //Step1. Write EFSROM_MODE (0x580, bit7:bit6) to 1.
- //Read in physical view
- eFuseCtrlStruc.field.EFSROM_MODE = 1;
-
- //Step2. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical read procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
-
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step3. Polling EFSROM_KICK(0x580, bit30) until it become 0 again.
- i = 0;
- while(i < 100)
- {
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
- break;
- RTMPusecDelay(2);
- i++;
- }
-
- //Step4. Read 16-byte of data from EFUSE_DATA0-3 (0x59C-0x590)
- //Because the size of each EFUSE_DATA is 4 Bytes, the size of address of each is 2 bits.
- //The previous 2 bits is the EFUSE_DATA number, the last 2 bits is used to decide which bytes
- //Decide which EFUSE_DATA to read
- //590:F E D C
- //594:B A 9 8
- //598:7 6 5 4
- //59C:3 2 1 0
- efuseDataOffset = EFUSE_DATA3 - (Offset & 0xC) ;
-
- RTMP_IO_READ32(pAd, efuseDataOffset, &data);
-
- data = data >> (8*(Offset & 0x3));
-
- NdisMoveMemory(pData, &data, Length);
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-VOID eFuseReadPhysical(
- IN PRTMP_ADAPTER pAd,
- IN PUSHORT lpInBuffer,
- IN ULONG nInBufferSize,
- OUT PUSHORT lpOutBuffer,
- IN ULONG nOutBufferSize
-)
-{
- USHORT* pInBuf = (USHORT*)lpInBuffer;
- USHORT* pOutBuf = (USHORT*)lpOutBuffer;
-
- USHORT Offset = pInBuf[0]; //addr
- USHORT Length = pInBuf[1]; //length
- int i;
-
- for(i=0; i<Length; i+=2)
- {
- eFusePhysicalReadRegisters(pAd,Offset+i, 2, &pOutBuf[i/2]);
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS eFuseRead(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- OUT PUCHAR pData,
- IN USHORT Length)
-{
- USHORT* pOutBuf = (USHORT*)pData;
- NTSTATUS Status = STATUS_SUCCESS;
- UCHAR EFSROM_AOUT;
- int i;
-
- for(i=0; i<Length; i+=2)
- {
- EFSROM_AOUT = eFuseReadRegisters(pAd, Offset+i, 2, &pOutBuf[i/2]);
- }
- return Status;
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-VOID eFusePhysicalWriteRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData)
-{
- EFUSE_CTRL_STRUC eFuseCtrlStruc;
- int i;
- USHORT efuseDataOffset;
- UINT32 data, eFuseDataBuffer[4];
-
- //Step0. Write 16-byte of data to EFUSE_DATA0-3 (0x590-0x59C), where EFUSE_DATA0 is the LSB DW, EFUSE_DATA3 is the MSB DW.
-
- /////////////////////////////////////////////////////////////////
- //read current values of 16-byte block
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- //Step0. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- eFuseCtrlStruc.field.EFSROM_AIN = Offset & 0xfff0;
-
- //Step1. Write EFSROM_MODE (0x580, bit7:bit6) to 1.
- eFuseCtrlStruc.field.EFSROM_MODE = 1;
-
- //Step2. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical read procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
-
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step3. Polling EFSROM_KICK(0x580, bit30) until it become 0 again.
- i = 0;
- while(i < 100)
- {
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
- break;
- RTMPusecDelay(2);
- i++;
- }
-
- //Step4. Read 16-byte of data from EFUSE_DATA0-3 (0x59C-0x590)
- efuseDataOffset = EFUSE_DATA3;
- for(i=0; i< 4; i++)
- {
- RTMP_IO_READ32(pAd, efuseDataOffset, (PUINT32) &eFuseDataBuffer[i]);
- efuseDataOffset -= 4;
- }
-
- //Update the value, the offset is multiple of 2, length is 2
- efuseDataOffset = (Offset & 0xc) >> 2;
- data = pData[0] & 0xffff;
- //The offset should be 0x***10 or 0x***00
- if((Offset % 4) != 0)
- {
- eFuseDataBuffer[efuseDataOffset] = (eFuseDataBuffer[efuseDataOffset] & 0xffff) | (data << 16);
- }
- else
- {
- eFuseDataBuffer[efuseDataOffset] = (eFuseDataBuffer[efuseDataOffset] & 0xffff0000) | data;
- }
-
- efuseDataOffset = EFUSE_DATA3;
- for(i=0; i< 4; i++)
- {
- RTMP_IO_WRITE32(pAd, efuseDataOffset, eFuseDataBuffer[i]);
- efuseDataOffset -= 4;
- }
- /////////////////////////////////////////////////////////////////
-
- //Step1. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- eFuseCtrlStruc.field.EFSROM_AIN = Offset & 0xfff0;
-
- //Step2. Write EFSROM_MODE (0x580, bit7:bit6) to 3.
- eFuseCtrlStruc.field.EFSROM_MODE = 3;
-
- //Step3. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical write procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
-
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It��s done.
- i = 0;
- while(i < 100)
- {
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
- break;
-
- RTMPusecDelay(2);
- i++;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS eFuseWriteRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- IN USHORT* pData)
-{
- USHORT i;
- USHORT eFuseData;
- USHORT LogicalAddress, BlkNum = 0xffff;
- UCHAR EFSROM_AOUT;
-
- USHORT addr,tmpaddr, InBuf[3], tmpOffset;
- USHORT buffer[8];
- BOOLEAN bWriteSuccess = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters Offset=%x, pData=%x\n", Offset, *pData));
-
- //Step 0. find the entry in the mapping table
- //The address of EEPROM is 2-bytes alignment.
- //The last bit is used for alignment, so it must be 0.
- tmpOffset = Offset & 0xfffe;
- EFSROM_AOUT = eFuseReadRegisters(pAd, tmpOffset, 2, &eFuseData);
-
- if( EFSROM_AOUT == 0x3f)
- { //find available logical address pointer
- //the logical address does not exist, find an empty one
- //from the first address of block 45=16*45=0x2d0 to the last address of block 47
- //==>48*16-3(reserved)=2FC
- for (i=EFUSE_USAGE_MAP_START; i<=EFUSE_USAGE_MAP_END; i+=2)
- {
- //Retrive the logical block nubmer form each logical address pointer
- //It will access two logical address pointer each time.
- eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
- if( (LogicalAddress & 0xff) == 0)
- {//Not used logical address pointer
- BlkNum = i-EFUSE_USAGE_MAP_START;
- break;
- }
- else if(( (LogicalAddress >> 8) & 0xff) == 0)
- {//Not used logical address pointer
- if (i != EFUSE_USAGE_MAP_END)
- {
- BlkNum = i-EFUSE_USAGE_MAP_START+1;
- }
- break;
- }
- }
- }
- else
- {
- BlkNum = EFSROM_AOUT;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters BlkNum = %d \n", BlkNum));
-
- if(BlkNum == 0xffff)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters: out of free E-fuse space!!!\n"));
- return FALSE;
- }
-
- //Step 1. Save data of this block which is pointed by the avaible logical address pointer
- // read and save the original block data
- for(i =0; i<8; i++)
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+2*i;
- InBuf[1] = 2;
- InBuf[2] = 0x0;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
-
- buffer[i] = InBuf[2];
- }
-
- //Step 2. Update the data in buffer, and write the data to Efuse
- buffer[ (Offset >> 1) % 8] = pData[0];
+ RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
+#ifdef RT30xx
+#ifdef RTMP_EFUSE_SUPPORT
+ UINT32 eFuseCtrl, MacCsr0;
+ int index;
+ index = 0;
do
{
- //Step 3. Write the data to Efuse
- if(!bWriteSuccess)
- {
- for(i =0; i<8; i++)
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+2*i;
- InBuf[1] = 2;
- InBuf[2] = buffer[i];
-
- eFuseWritePhysical(pAd, &InBuf[0], 6, NULL, 2);
- }
- }
- else
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+(Offset % 16);
- InBuf[1] = 2;
- InBuf[2] = pData[0];
-
- eFuseWritePhysical(pAd, &InBuf[0], 6, NULL, 2);
- }
-
- //Step 4. Write mapping table
- addr = EFUSE_USAGE_MAP_START+BlkNum;
-
- tmpaddr = addr;
+ RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
+ pAd->MACVersion = MacCsr0;
- if(addr % 2 != 0)
- addr = addr -1;
- InBuf[0] = addr;
- InBuf[1] = 2;
-
- //convert the address from 10 to 8 bit ( bit7, 6 = parity and bit5 ~ 0 = bit9~4), and write to logical map entry
- tmpOffset = Offset;
- tmpOffset >>= 4;
- tmpOffset |= ((~((tmpOffset & 0x01) ^ ( tmpOffset >> 1 & 0x01) ^ (tmpOffset >> 2 & 0x01) ^ (tmpOffset >> 3 & 0x01))) << 6) & 0x40;
- tmpOffset |= ((~( (tmpOffset >> 2 & 0x01) ^ (tmpOffset >> 3 & 0x01) ^ (tmpOffset >> 4 & 0x01) ^ ( tmpOffset >> 5 & 0x01))) << 7) & 0x80;
-
- // write the logical address
- if(tmpaddr%2 != 0)
- InBuf[2] = tmpOffset<<8;
- else
- InBuf[2] = tmpOffset;
-
- eFuseWritePhysical(pAd,&InBuf[0], 6, NULL, 0);
-
- //Step 5. Compare data if not the same, invalidate the mapping entry, then re-write the data until E-fuse is exhausted
- bWriteSuccess = TRUE;
- for(i =0; i<8; i++)
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+2*i;
- InBuf[1] = 2;
- InBuf[2] = 0x0;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
-
- if(buffer[i] != InBuf[2])
- {
- bWriteSuccess = FALSE;
- break;
- }
- }
-
- //Step 6. invlidate mapping entry and find a free mapping entry if not succeed
- if (!bWriteSuccess)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Not bWriteSuccess BlkNum = %d\n", BlkNum));
-
- // the offset of current mapping entry
- addr = EFUSE_USAGE_MAP_START+BlkNum;
-
- //find a new mapping entry
- BlkNum = 0xffff;
- for (i=EFUSE_USAGE_MAP_START; i<=EFUSE_USAGE_MAP_END; i+=2)
- {
- eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
- if( (LogicalAddress & 0xff) == 0)
- {
- BlkNum = i-EFUSE_USAGE_MAP_START;
- break;
- }
- else if(( (LogicalAddress >> 8) & 0xff) == 0)
- {
- if (i != EFUSE_USAGE_MAP_END)
- {
- BlkNum = i+1-EFUSE_USAGE_MAP_START;
- }
- break;
- }
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Not bWriteSuccess new BlkNum = %d\n", BlkNum));
- if(BlkNum == 0xffff)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters: out of free E-fuse space!!!\n"));
- return FALSE;
- }
-
- //invalidate the original mapping entry if new entry is not found
- tmpaddr = addr;
-
- if(addr % 2 != 0)
- addr = addr -1;
- InBuf[0] = addr;
- InBuf[1] = 2;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
-
- // write the logical address
- if(tmpaddr%2 != 0)
- {
- // Invalidate the high byte
- for (i=8; i<15; i++)
- {
- if( ( (InBuf[2] >> i) & 0x01) == 0)
- {
- InBuf[2] |= (0x1 <<i);
- break;
- }
- }
- }
- else
- {
- // invalidate the low byte
- for (i=0; i<8; i++)
- {
- if( ( (InBuf[2] >> i) & 0x01) == 0)
- {
- InBuf[2] |= (0x1 <<i);
- break;
- }
- }
- }
- eFuseWritePhysical(pAd, &InBuf[0], 6, NULL, 0);
- }
- }
- while(!bWriteSuccess);
-
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-VOID eFuseWritePhysical(
- IN PRTMP_ADAPTER pAd,
- PUSHORT lpInBuffer,
- ULONG nInBufferSize,
- PUCHAR lpOutBuffer,
- ULONG nOutBufferSize
-)
-{
- USHORT* pInBuf = (USHORT*)lpInBuffer;
- int i;
- //USHORT* pOutBuf = (USHORT*)ioBuffer;
-
- USHORT Offset = pInBuf[0]; //addr
- USHORT Length = pInBuf[1]; //length
- USHORT* pValueX = &pInBuf[2]; //value ...
- // Little-endian S | S Big-endian
- // addr 3 2 1 0 | 0 1 2 3
- // Ori-V D C B A | A B C D
- //After swapping
- // D C B A | D C B A
- //Both the little and big-endian use the same sequence to write data.
- //Therefore, we only need swap data when read the data.
- for(i=0; i<Length; i+=2)
- {
- eFusePhysicalWriteRegisters(pAd, Offset+i, 2, &pValueX[i/2]);
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS eFuseWrite(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN PUCHAR pData,
- IN USHORT length)
-{
- int i;
-
- USHORT* pValueX = (PUSHORT) pData; //value ...
- //The input value=3070 will be stored as following
- // Little-endian S | S Big-endian
- // addr 1 0 | 0 1
- // Ori-V 30 70 | 30 70
- //After swapping
- // 30 70 | 70 30
- //Casting
- // 3070 | 7030 (x)
- //The swapping should be removed for big-endian
- for(i=0; i<length; i+=2)
- {
- eFuseWriteRegisters(pAd, Offset+i, 2, &pValueX[i/2]);
- }
-
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-INT set_eFuseGetFreeBlockCount_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- USHORT i;
- USHORT LogicalAddress;
- USHORT efusefreenum=0;
- if(!pAd->bUseEfuse)
- return FALSE;
- for (i = EFUSE_USAGE_MAP_START; i <= EFUSE_USAGE_MAP_END; i+=2)
- {
- eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
- if( (LogicalAddress & 0xff) == 0)
- {
- efusefreenum= (UCHAR) (EFUSE_USAGE_MAP_END-i+1);
- break;
- }
- else if(( (LogicalAddress >> 8) & 0xff) == 0)
- {
- efusefreenum = (UCHAR) (EFUSE_USAGE_MAP_END-i);
- break;
- }
-
- if(i == EFUSE_USAGE_MAP_END)
- efusefreenum = 0;
- }
- printk("efuseFreeNumber is %d\n",efusefreenum);
- return TRUE;
-}
-INT set_eFusedump_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
-USHORT InBuf[3];
- INT i=0;
- if(!pAd->bUseEfuse)
- return FALSE;
- for(i =0; i<EFUSE_USAGE_MAP_END/2; i++)
- {
- InBuf[0] = 2*i;
- InBuf[1] = 2;
- InBuf[2] = 0x0;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
- if(i%4==0)
- printk("\nBlock %x:",i/8);
- printk("%04x ",InBuf[2]);
- }
- return TRUE;
-}
-INT set_eFuseLoadFromBin_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- CHAR *src;
- struct file *srcf;
- INT retval;
- mm_segment_t orgfs;
- UCHAR *buffer;
- UCHAR BinFileSize=0;
- INT i = 0,j=0,k=1;
- USHORT *PDATA;
- USHORT DATA;
- BinFileSize=strlen("RT30xxEEPROM.bin");
- src = kmalloc(128, MEM_ALLOC_FLAG);
- NdisZeroMemory(src, 128);
-
- if(strlen(arg)>0)
- {
-
- NdisMoveMemory(src, arg, strlen(arg));
- }
-
- else
- {
-
- NdisMoveMemory(src, "RT30xxEEPROM.bin", BinFileSize);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("FileName=%s\n",src));
- buffer = kmalloc(MAX_EEPROM_BIN_FILE_SIZE, MEM_ALLOC_FLAG);
-
- if(buffer == NULL)
- {
- kfree(src);
- return FALSE;
-}
- PDATA=kmalloc(sizeof(USHORT)*8,MEM_ALLOC_FLAG);
-
- if(PDATA==NULL)
- {
- kfree(src);
-
- kfree(buffer);
- return FALSE;
- }
-
- orgfs = get_fs();
- set_fs(KERNEL_DS);
-
- if (src && *src)
- {
- srcf = filp_open(src, O_RDONLY, 0);
- if (IS_ERR(srcf))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error %ld opening %s\n", -PTR_ERR(srcf),src));
- return FALSE;
- }
- else
- {
- // The object must have a read method
- if (srcf->f_op && srcf->f_op->read)
- {
- memset(buffer, 0x00, MAX_EEPROM_BIN_FILE_SIZE);
- while(srcf->f_op->read(srcf, &buffer[i], 1, &srcf->f_pos)==1)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%02X ",buffer[i]));
- if((i+1)%8==0)
- DBGPRINT(RT_DEBUG_TRACE, ("\n"));
- i++;
- if(i>=MAX_EEPROM_BIN_FILE_SIZE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error %ld reading %s, The file is too large[1024]\n", -PTR_ERR(srcf),src));
- kfree(PDATA);
- kfree(buffer);
- kfree(src);
- return FALSE;
- }
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error!! System doest not support read function\n"));
- kfree(PDATA);
- kfree(buffer);
- kfree(src);
- return FALSE;
- }
- }
-
-
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error src or srcf is null\n"));
- kfree(PDATA);
- kfree(buffer);
- return FALSE;
-
- }
-
-
- retval=filp_close(srcf,NULL);
-
- if (retval)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> Error %d closing %s\n", -retval, src));
- }
- set_fs(orgfs);
-
- for(j=0;j<i;j++)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%02X ",buffer[j]));
- if((j+1)%2==0)
- PDATA[j/2%8]=((buffer[j]<<8)&0xff00)|(buffer[j-1]&0xff);
- if(j%16==0)
- {
- k=buffer[j];
- }
- else
- {
- k&=buffer[j];
- if((j+1)%16==0)
- {
-
- DBGPRINT(RT_DEBUG_TRACE, (" result=%02X,blk=%02x\n",k,j/16));
-
- if(k!=0xff)
- eFuseWriteRegistersFromBin(pAd,(USHORT)j-15, 16, PDATA);
- else
- {
- if(eFuseReadRegisters(pAd,j, 2,(PUSHORT)&DATA)!=0x3f)
- eFuseWriteRegistersFromBin(pAd,(USHORT)j-15, 16, PDATA);
- }
- /*
- for(l=0;l<8;l++)
- printk("%04x ",PDATA[l]);
- printk("\n");
- */
- NdisZeroMemory(PDATA,16);
-
-
- }
- }
-
-
- }
-
-
- kfree(PDATA);
- kfree(buffer);
- kfree(src);
- return TRUE;
-}
-NTSTATUS eFuseWriteRegistersFromBin(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- IN USHORT* pData)
-{
- USHORT i;
- USHORT eFuseData;
- USHORT LogicalAddress, BlkNum = 0xffff;
- UCHAR EFSROM_AOUT,Loop=0;
- EFUSE_CTRL_STRUC eFuseCtrlStruc;
- USHORT efuseDataOffset;
- UINT32 data,tempbuffer;
- USHORT addr,tmpaddr, InBuf[3], tmpOffset;
- UINT32 buffer[4];
- BOOLEAN bWriteSuccess = TRUE;
- BOOLEAN bNotWrite=TRUE;
- BOOLEAN bAllocateNewBlk=TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegistersFromBin Offset=%x, pData=%04x:%04x:%04x:%04x\n", Offset, *pData,*(pData+1),*(pData+2),*(pData+3)));
-
- do
- {
- //Step 0. find the entry in the mapping table
- //The address of EEPROM is 2-bytes alignment.
- //The last bit is used for alignment, so it must be 0.
- Loop++;
- tmpOffset = Offset & 0xfffe;
- EFSROM_AOUT = eFuseReadRegisters(pAd, tmpOffset, 2, &eFuseData);
-
- if( EFSROM_AOUT == 0x3f)
- { //find available logical address pointer
- //the logical address does not exist, find an empty one
- //from the first address of block 45=16*45=0x2d0 to the last address of block 47
- //==>48*16-3(reserved)=2FC
- bAllocateNewBlk=TRUE;
- for (i=EFUSE_USAGE_MAP_START; i<=EFUSE_USAGE_MAP_END; i+=2)
- {
- //Retrive the logical block nubmer form each logical address pointer
- //It will access two logical address pointer each time.
- eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
- if( (LogicalAddress & 0xff) == 0)
- {//Not used logical address pointer
- BlkNum = i-EFUSE_USAGE_MAP_START;
- break;
- }
- else if(( (LogicalAddress >> 8) & 0xff) == 0)
- {//Not used logical address pointer
- if (i != EFUSE_USAGE_MAP_END)
- {
- BlkNum = i-EFUSE_USAGE_MAP_START+1;
- }
- break;
- }
- }
- }
- else
- {
- bAllocateNewBlk=FALSE;
- BlkNum = EFSROM_AOUT;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters BlkNum = %d \n", BlkNum));
-
- if(BlkNum == 0xffff)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegisters: out of free E-fuse space!!!\n"));
- return FALSE;
- }
- //Step 1.1.0
- //If the block is not existing in mapping table, create one
- //and write down the 16-bytes data to the new block
- if(bAllocateNewBlk)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Allocate New Blk\n"));
- efuseDataOffset = EFUSE_DATA3;
- for(i=0; i< 4; i++)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Allocate New Blk, Data%d=%04x%04x\n",3-i,pData[2*i+1],pData[2*i]));
- tempbuffer=((pData[2*i+1]<<16)&0xffff0000)|pData[2*i];
-
-
- RTMP_IO_WRITE32(pAd, efuseDataOffset,tempbuffer);
- efuseDataOffset -= 4;
-
- }
- /////////////////////////////////////////////////////////////////
-
- //Step1.1.1. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- eFuseCtrlStruc.field.EFSROM_AIN = BlkNum* 0x10 ;
-
- //Step1.1.2. Write EFSROM_MODE (0x580, bit7:bit6) to 3.
- eFuseCtrlStruc.field.EFSROM_MODE = 3;
-
- //Step1.1.3. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical write procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
-
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
-
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step1.1.4. Polling EFSROM_KICK(0x580, bit30) until it become 0 again. It��s done.
- i = 0;
- while(i < 100)
- {
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
+ if ((pAd->MACVersion != 0x00) && (pAd->MACVersion != 0xFFFFFFFF))
break;
- RTMPusecDelay(2);
- i++;
- }
+ RTMPusecDelay(10);
+ } while (index++ < 100);
- }
- else
- { //Step1.2.
- //If the same logical number is existing, check if the writting data and the data
- //saving in this block are the same.
- /////////////////////////////////////////////////////////////////
- //read current values of 16-byte block
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- //Step1.2.0. Write 10-bit of address to EFSROM_AIN (0x580, bit25:bit16). The address must be 16-byte alignment.
- eFuseCtrlStruc.field.EFSROM_AIN = Offset & 0xfff0;
-
- //Step1.2.1. Write EFSROM_MODE (0x580, bit7:bit6) to 1.
- eFuseCtrlStruc.field.EFSROM_MODE = 0;
-
- //Step1.2.2. Write EFSROM_KICK (0x580, bit30) to 1 to kick-off physical read procedure.
- eFuseCtrlStruc.field.EFSROM_KICK = 1;
-
- NdisMoveMemory(&data, &eFuseCtrlStruc, 4);
- RTMP_IO_WRITE32(pAd, EFUSE_CTRL, data);
-
- //Step1.2.3. Polling EFSROM_KICK(0x580, bit30) until it become 0 again.
- i = 0;
- while(i < 100)
- {
- RTMP_IO_READ32(pAd, EFUSE_CTRL, (PUINT32) &eFuseCtrlStruc);
-
- if(eFuseCtrlStruc.field.EFSROM_KICK == 0)
- break;
- RTMPusecDelay(2);
- i++;
- }
-
- //Step1.2.4. Read 16-byte of data from EFUSE_DATA0-3 (0x59C-0x590)
- efuseDataOffset = EFUSE_DATA3;
- for(i=0; i< 4; i++)
- {
- RTMP_IO_READ32(pAd, efuseDataOffset, (PUINT32) &buffer[i]);
- efuseDataOffset -= 4;
- }
- //Step1.2.5. Check if the data of efuse and the writing data are the same.
- for(i =0; i<4; i++)
- {
- tempbuffer=((pData[2*i+1]<<16)&0xffff0000)|pData[2*i];
- DBGPRINT(RT_DEBUG_TRACE, ("buffer[%d]=%x,pData[%d]=%x,pData[%d]=%x,tempbuffer=%x\n",i,buffer[i],2*i,pData[2*i],2*i+1,pData[2*i+1],tempbuffer));
-
- if(((buffer[i]&0xffff0000)==(pData[2*i+1]<<16))&&((buffer[i]&0xffff)==pData[2*i]))
- bNotWrite&=TRUE;
- else
+ pAd->bUseEfuse=FALSE;
+ RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrl);
+ pAd->bUseEfuse = ( (eFuseCtrl & 0x80000000) == 0x80000000) ? 1 : 0;
+ if(pAd->bUseEfuse)
{
- bNotWrite&=FALSE;
- break;
- }
- }
- if(!bNotWrite)
- {
- printk("The data is not the same\n");
-
- for(i =0; i<8; i++)
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+2*i;
- InBuf[1] = 2;
- InBuf[2] = pData[i];
-
- eFuseWritePhysical(pAd, &InBuf[0], 6, NULL, 2);
- }
-
- }
- else
- return TRUE;
+ pChipOps->eeinit = eFuse_init;
+ pChipOps->eeread = rtmp_ee_efuse_read16;
+ pChipOps->eewrite = rtmp_ee_efuse_write16;
+ return 0 ;
}
-
-
-
- //Step 2. Write mapping table
- addr = EFUSE_USAGE_MAP_START+BlkNum;
-
- tmpaddr = addr;
-
- if(addr % 2 != 0)
- addr = addr -1;
- InBuf[0] = addr;
- InBuf[1] = 2;
-
- //convert the address from 10 to 8 bit ( bit7, 6 = parity and bit5 ~ 0 = bit9~4), and write to logical map entry
- tmpOffset = Offset;
- tmpOffset >>= 4;
- tmpOffset |= ((~((tmpOffset & 0x01) ^ ( tmpOffset >> 1 & 0x01) ^ (tmpOffset >> 2 & 0x01) ^ (tmpOffset >> 3 & 0x01))) << 6) & 0x40;
- tmpOffset |= ((~( (tmpOffset >> 2 & 0x01) ^ (tmpOffset >> 3 & 0x01) ^ (tmpOffset >> 4 & 0x01) ^ ( tmpOffset >> 5 & 0x01))) << 7) & 0x80;
-
- // write the logical address
- if(tmpaddr%2 != 0)
- InBuf[2] = tmpOffset<<8;
else
- InBuf[2] = tmpOffset;
-
- eFuseWritePhysical(pAd,&InBuf[0], 6, NULL, 0);
-
- //Step 3. Compare data if not the same, invalidate the mapping entry, then re-write the data until E-fuse is exhausted
- bWriteSuccess = TRUE;
- for(i =0; i<8; i++)
- {
- addr = BlkNum * 0x10 ;
-
- InBuf[0] = addr+2*i;
- InBuf[1] = 2;
- InBuf[2] = 0x0;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
- DBGPRINT(RT_DEBUG_TRACE, ("addr=%x, buffer[i]=%x,InBuf[2]=%x\n",InBuf[0],pData[i],InBuf[2]));
- if(pData[i] != InBuf[2])
{
- bWriteSuccess = FALSE;
- break;
+ pAd->bFroceEEPROMBuffer = FALSE;
+ DBGPRINT(RT_DEBUG_TRACE, ("NVM is EEPROM\n"));
}
- }
-
- //Step 4. invlidate mapping entry and find a free mapping entry if not succeed
+#endif // RTMP_EFUSE_SUPPORT //
+#endif // RT30xx //
- if (!bWriteSuccess&&Loop<2)
+ switch(infType)
{
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegistersFromBin::Not bWriteSuccess BlkNum = %d\n", BlkNum));
-
- // the offset of current mapping entry
- addr = EFUSE_USAGE_MAP_START+BlkNum;
-
- //find a new mapping entry
- BlkNum = 0xffff;
- for (i=EFUSE_USAGE_MAP_START; i<=EFUSE_USAGE_MAP_END; i+=2)
- {
- eFusePhysicalReadRegisters(pAd, i, 2, &LogicalAddress);
- if( (LogicalAddress & 0xff) == 0)
- {
- BlkNum = i-EFUSE_USAGE_MAP_START;
+#ifdef RTMP_PCI_SUPPORT
+ case RTMP_DEV_INF_PCI:
+ pChipOps->eeinit = NULL;
+ pChipOps->eeread = rtmp_ee_prom_read16;
+ pChipOps->eewrite = rtmp_ee_prom_write16;
break;
- }
- else if(( (LogicalAddress >> 8) & 0xff) == 0)
- {
- if (i != EFUSE_USAGE_MAP_END)
- {
- BlkNum = i+1-EFUSE_USAGE_MAP_START;
- }
+#endif // RTMP_PCI_SUPPORT //
+#ifdef RTMP_USB_SUPPORT
+ case RTMP_DEV_INF_USB:
+ pChipOps->eeinit = NULL;
+ pChipOps->eeread = RTUSBReadEEPROM16;
+ pChipOps->eewrite = RTUSBWriteEEPROM16;
break;
- }
- }
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegistersFromBin::Not bWriteSuccess new BlkNum = %d\n", BlkNum));
- if(BlkNum == 0xffff)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("eFuseWriteRegistersFromBin: out of free E-fuse space!!!\n"));
- return FALSE;
- }
-
- //invalidate the original mapping entry if new entry is not found
- tmpaddr = addr;
+#endif // RTMP_USB_SUPPORT //
- if(addr % 2 != 0)
- addr = addr -1;
- InBuf[0] = addr;
- InBuf[1] = 2;
-
- eFuseReadPhysical(pAd, &InBuf[0], 4, &InBuf[2], 2);
-
- // write the logical address
- if(tmpaddr%2 != 0)
- {
- // Invalidate the high byte
- for (i=8; i<15; i++)
- {
- if( ( (InBuf[2] >> i) & 0x01) == 0)
- {
- InBuf[2] |= (0x1 <<i);
+ default:
+ DBGPRINT(RT_DEBUG_ERROR, ("RtmpChipOpsEepromHook() failed!\n"));
break;
}
- }
- }
- else
- {
- // invalidate the low byte
- for (i=0; i<8; i++)
- {
- if( ( (InBuf[2] >> i) & 0x01) == 0)
- {
- InBuf[2] |= (0x1 <<i);
- break;
- }
- }
- }
- eFuseWritePhysical(pAd, &InBuf[0], 6, NULL, 0);
- }
-
- }
- while(!bWriteSuccess&&Loop<2);
- return TRUE;
+ return 0;
}
-#endif
diff --git a/drivers/staging/rt2860/common/firmware.h b/drivers/staging/rt2860/common/firmware.h
index e72996f42c07..e984725358da 100644
--- a/drivers/staging/rt2860/common/firmware.h
+++ b/drivers/staging/rt2860/common/firmware.h
@@ -43,7 +43,7 @@
/* AUTO GEN PLEASE DO NOT MODIFY IT */
-UCHAR FirmwareImage [] = {
+UCHAR FirmwareImage_2860 [] = {
0x02, 0x03, 0x5e, 0x02, 0x02, 0xb1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x82, 0xff, 0xff,
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x01, 0x33, 0xc0, 0xe0,
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
diff --git a/drivers/staging/rt2860/common/firmware_3070.h b/drivers/staging/rt2860/common/firmware_3070.h
new file mode 100644
index 000000000000..19569407f722
--- /dev/null
+++ b/drivers/staging/rt2860/common/firmware_3070.h
@@ -0,0 +1,517 @@
+/* AUTO GEN PLEASE DO NOT MODIFY IT */
+/* AUTO GEN PLEASE DO NOT MODIFY IT */
+
+
+UCHAR FirmwareImage_3070 [] = {
+0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x13, 0x1f, 0x02,
+0x13, 0x20, 0x02, 0x13, 0x3f, 0x02, 0x13, 0x44, 0x12, 0x13, 0x40, 0x22, 0x02, 0x17, 0xae, 0x02,
+0x18, 0xd2, 0x02, 0x14, 0x3d, 0x02, 0x13, 0x78, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x19,
+0x95, 0x22, 0x90, 0x01, 0x8c, 0xe0, 0x30, 0xe3, 0x1b, 0xe5, 0x4c, 0x30, 0xe0, 0x04, 0x7f, 0x40,
+0x80, 0x02, 0x7f, 0x00, 0x90, 0x10, 0x2f, 0xef, 0xf0, 0x90, 0x01, 0x8c, 0x74, 0x08, 0xf0, 0xe4,
+0x90, 0x01, 0xa7, 0xf0, 0x90, 0x01, 0x8c, 0xe0, 0x30, 0xe0, 0x1c, 0x90, 0x01, 0x80, 0xe0, 0xb4,
+0x02, 0x15, 0xa3, 0xe0, 0xb4, 0x01, 0x10, 0x90, 0x01, 0x84, 0xe0, 0xb4, 0x81, 0x09, 0x90, 0x01,
+0x8c, 0x74, 0x01, 0xf0, 0x12, 0x0d, 0xc8, 0x22, 0x90, 0x04, 0x14, 0xe0, 0x20, 0xe7, 0x03, 0x02,
+0x13, 0x1e, 0x90, 0x70, 0x12, 0xe0, 0xf5, 0x56, 0x90, 0x04, 0x04, 0xe0, 0x12, 0x0a, 0x9d, 0x10,
+0xd9, 0x31, 0x10, 0xbd, 0x36, 0x11, 0x02, 0x50, 0x11, 0x39, 0x51, 0x11, 0x42, 0x52, 0x11, 0x42,
+0x53, 0x11, 0x42, 0x54, 0x11, 0x83, 0x55, 0x11, 0xd2, 0x56, 0x12, 0x25, 0x70, 0x12, 0x50, 0x71,
+0x12, 0x7e, 0x72, 0x12, 0xd5, 0x73, 0x12, 0xf6, 0x80, 0x00, 0x00, 0x13, 0x1e, 0x90, 0x70, 0x11,
+0xe0, 0xf5, 0x3c, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe5, 0x56,
+0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x20, 0x02, 0x03, 0x30, 0x03, 0x1d, 0x7d,
+0x02, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13,
+0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x85, 0x56, 0x41, 0xd2,
+0x02, 0x22, 0x90, 0x70, 0x10, 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x0a, 0x0d, 0x90, 0x70, 0x11, 0xe0,
+0xb4, 0x08, 0x06, 0x75, 0x4e, 0x01, 0x75, 0x4f, 0x84, 0x90, 0x70, 0x10, 0xe0, 0x54, 0x7f, 0xff,
+0xbf, 0x02, 0x12, 0x90, 0x70, 0x11, 0xe0, 0x64, 0x08, 0x60, 0x04, 0xe0, 0xb4, 0x20, 0x06, 0x75,
+0x4e, 0x03, 0x75, 0x4f, 0x20, 0xe4, 0xf5, 0x27, 0x22, 0x90, 0x70, 0x11, 0xe0, 0x24, 0xff, 0x92,
+0x47, 0x22, 0x90, 0x04, 0x04, 0xe0, 0x25, 0xe0, 0x24, 0x5d, 0xf5, 0x57, 0x90, 0x70, 0x10, 0xe0,
+0xff, 0x74, 0x47, 0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, 0x90, 0x70, 0x11, 0xe0, 0xff, 0x74, 0x48,
+0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14,
+0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e,
+0x02, 0x13, 0x17, 0xe5, 0x47, 0x64, 0x07, 0x60, 0x1d, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x17, 0xe5,
+0x47, 0x64, 0x09, 0x60, 0x11, 0xe5, 0x47, 0x64, 0x0a, 0x60, 0x0b, 0xe5, 0x47, 0x64, 0x0b, 0x60,
+0x05, 0xe5, 0x47, 0xb4, 0x0c, 0x08, 0x90, 0x70, 0x11, 0xe0, 0x54, 0x0f, 0xf5, 0x3a, 0xe5, 0x47,
+0xb4, 0x09, 0x08, 0xe5, 0x3a, 0xb4, 0x03, 0x03, 0xe4, 0xf5, 0x46, 0xe5, 0x47, 0xb4, 0x0a, 0x08,
+0xe5, 0x3a, 0xb4, 0x01, 0x03, 0xe4, 0xf5, 0x46, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0xd2,
+0x04, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xf4, 0xff, 0x90, 0x70, 0x10, 0xe0, 0x5f, 0xff, 0x90, 0x70,
+0x11, 0xe0, 0x55, 0x27, 0x4f, 0x90, 0x70, 0x18, 0xf0, 0x90, 0x70, 0x11, 0xe0, 0x90, 0x70, 0x19,
+0xf0, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x30, 0x15, 0x03, 0xd2, 0x14, 0x22, 0x90, 0x70,
+0x18, 0xe0, 0xf5, 0x27, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, 0xef, 0x5e,
+0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x90,
+0x02, 0x28, 0xef, 0xf0, 0x22, 0x90, 0x70, 0x10, 0xe0, 0xfe, 0x90, 0x70, 0x11, 0xe0, 0xfd, 0xed,
+0xf8, 0xe6, 0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0,
+0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17,
+0x90, 0x70, 0x10, 0xe0, 0xfe, 0x90, 0x70, 0x11, 0xe0, 0xfd, 0xed, 0xf5, 0x82, 0x8e, 0x83, 0xe0,
+0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90,
+0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x90, 0x10,
+0x00, 0xe0, 0xf5, 0x57, 0x90, 0x10, 0x02, 0xe0, 0xf5, 0x58, 0xa3, 0xe0, 0xf5, 0x59, 0xe5, 0x58,
+0xb4, 0x70, 0x1e, 0xe5, 0x59, 0xb4, 0x30, 0x19, 0x90, 0x05, 0x08, 0xe0, 0x44, 0x01, 0xf0, 0xfd,
+0x90, 0x05, 0x05, 0xe0, 0x54, 0xfb, 0xf0, 0x44, 0x04, 0xf0, 0xed, 0x54, 0xfe, 0x90, 0x05, 0x08,
+0xf0, 0xe4, 0xf5, 0x4e, 0xf5, 0x4f, 0x75, 0x3a, 0xff, 0x75, 0x3c, 0xff, 0xad, 0x57, 0xaf, 0x56,
+0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56,
+0xf4, 0x60, 0x4b, 0x80, 0x42, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x93, 0xe4, 0xfd, 0xaf,
+0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5,
+0x56, 0xf4, 0x60, 0x2a, 0x80, 0x21, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x4a, 0xd2, 0x05,
+0xad, 0x57, 0xaf, 0x56, 0x12, 0x0b, 0x91, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70,
+0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x60, 0x07, 0x90, 0x70, 0x25, 0xe0, 0x44, 0x01, 0xf0, 0x22, 0x22,
+0xe5, 0x53, 0x70, 0x1a, 0x30, 0x60, 0x09, 0xb2, 0x4d, 0x30, 0x4d, 0x04, 0x05, 0x46, 0xc2, 0x04,
+0xe5, 0x4f, 0x45, 0x4e, 0x60, 0x08, 0xe5, 0x4f, 0x15, 0x4f, 0x70, 0x02, 0x15, 0x4e, 0x22, 0x22,
+0xc2, 0x42, 0xd3, 0x22, 0x30, 0x14, 0x30, 0x90, 0x70, 0x19, 0xe0, 0x55, 0x27, 0xff, 0x90, 0x70,
+0x18, 0xe0, 0x4f, 0xf5, 0x27, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, 0xef,
+0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff,
+0x90, 0x02, 0x28, 0xef, 0xf0, 0xc2, 0x14, 0x22, 0xc2, 0x4b, 0xc2, 0x4c, 0xe5, 0x44, 0x12, 0x0a,
+0x9d, 0x13, 0x9a, 0x00, 0x14, 0x28, 0x04, 0x14, 0x24, 0x08, 0x14, 0x04, 0x10, 0x13, 0xae, 0x20,
+0x13, 0xce, 0x60, 0x13, 0xdf, 0xa0, 0x00, 0x00, 0x14, 0x2a, 0x85, 0x48, 0x43, 0x85, 0x4a, 0x42,
+0x85, 0x4c, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x60, 0x03, 0x02, 0x14, 0x2a, 0x80, 0x1b, 0xe5, 0x48,
+0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4a, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4c, 0xc4, 0x54,
+0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x61, 0x53, 0x43, 0x0f, 0x80, 0x5c, 0x85, 0x49,
+0x43, 0x85, 0x4b, 0x42, 0x85, 0x4d, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x4d, 0x80, 0x1b, 0xe5,
+0x49, 0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4b, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4d, 0xc4,
+0x54, 0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x30, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x10,
+0xf5, 0x43, 0x80, 0x26, 0xe5, 0x47, 0x64, 0x04, 0x60, 0x05, 0xe5, 0x47, 0xb4, 0x05, 0x06, 0x43,
+0x5e, 0x04, 0x75, 0x42, 0x09, 0xe5, 0x47, 0xb4, 0x06, 0x10, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x30,
+0xf5, 0x43, 0x80, 0x06, 0xd2, 0x4b, 0x80, 0x02, 0xd2, 0x4c, 0xe4, 0xf5, 0x25, 0xe5, 0x42, 0xc4,
+0x54, 0xf0, 0xff, 0xe5, 0x43, 0x54, 0x0f, 0x4f, 0xf5, 0x5f, 0xd2, 0x60, 0x22, 0xd2, 0x15, 0xe5,
+0x47, 0x24, 0xf5, 0x60, 0x0b, 0x24, 0xcb, 0x60, 0x07, 0x24, 0x40, 0x70, 0x06, 0xc2, 0x15, 0x22,
+0x12, 0x17, 0x79, 0x12, 0x14, 0x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, 0x08, 0xe5,
+0x3a, 0x70, 0x04, 0xd2, 0x6c, 0xc2, 0x6d, 0x20, 0x69, 0x07, 0xe5, 0x5e, 0x20, 0xe0, 0x02, 0xb2,
+0x68, 0x20, 0x6b, 0x07, 0xe5, 0x5e, 0x20, 0xe1, 0x02, 0xb2, 0x6a, 0x20, 0x6d, 0x07, 0xe5, 0x5e,
+0x20, 0xe2, 0x02, 0xb2, 0x6c, 0x75, 0x2e, 0x40, 0x20, 0x69, 0x04, 0xa2, 0x68, 0x80, 0x26, 0x30,
+0x68, 0x06, 0xe5, 0x46, 0xa2, 0xe2, 0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe2, 0x04, 0x7f, 0x01, 0x80,
+0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e,
+0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, 0x73, 0x92, 0x72, 0x20, 0x6b, 0x04, 0xa2, 0x6a, 0x80, 0x26,
+0x30, 0x6a, 0x06, 0xe5, 0x46, 0xa2, 0xe2, 0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe0, 0x04, 0x7f, 0x01,
+0x80, 0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54, 0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02,
+0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92, 0x75, 0x92, 0x74, 0x20, 0x6d, 0x04, 0xa2, 0x6c, 0x80,
+0x26, 0xe5, 0x47, 0x64, 0x0a, 0x70, 0x22, 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x17,
+0xe5, 0x3a, 0xb4, 0x01, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x34, 0xe5, 0x46, 0x20, 0xe4, 0x03,
+0x30, 0xe5, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x80, 0x26, 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe2,
+0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe1, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54,
+0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92,
+0x71, 0x92, 0x70, 0x90, 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, 0x90, 0x10, 0x03, 0xe0, 0xc3,
+0x94, 0x30, 0x40, 0x14, 0xa2, 0x71, 0x92, 0x77, 0xa2, 0x70, 0x92, 0x76, 0xe5, 0x2e, 0x13, 0x13,
+0x54, 0x3f, 0xf5, 0x2e, 0xc2, 0x77, 0xd2, 0x76, 0x90, 0x10, 0x2f, 0xe5, 0x2e, 0xf0, 0xe5, 0x47,
+0x64, 0x06, 0x70, 0x39, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x43, 0xc4, 0x54, 0x0f,
+0x14, 0x60, 0x0c, 0x24, 0xfe, 0x60, 0x0c, 0x24, 0x03, 0x70, 0x13, 0xc2, 0x38, 0x80, 0x0f, 0xd2,
+0x38, 0x80, 0x0b, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x38, 0x30, 0x47,
+0x05, 0xaf, 0x27, 0x02, 0x17, 0x73, 0xe5, 0x27, 0xf4, 0xff, 0x02, 0x17, 0x73, 0xe5, 0x47, 0x64,
+0x07, 0x60, 0x0f, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x09, 0xe5, 0x47, 0x64, 0x09, 0x60, 0x03, 0x02,
+0x16, 0xf2, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xfc, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x22, 0x14, 0x60,
+0x25, 0x14, 0x60, 0x2d, 0x24, 0xfc, 0x60, 0x49, 0x24, 0xf9, 0x60, 0x14, 0x24, 0x0e, 0x70, 0x50,
+0xe5, 0x46, 0x13, 0x13, 0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x24, 0xff, 0x80, 0x3a,
+0xd2, 0x39, 0xc2, 0x38, 0x80, 0x3e, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x1d, 0xc3, 0x80,
+0x1a, 0xe5, 0x46, 0x30, 0xe2, 0x0d, 0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f,
+0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, 0x38, 0xc2, 0x39, 0x80,
+0x13, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0xc2, 0x38, 0x80, 0x04,
+0xc2, 0x38, 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x02,
+0x17, 0x73, 0xe5, 0x47, 0x64, 0x0c, 0x60, 0x06, 0xe5, 0x47, 0x64, 0x0b, 0x70, 0x7a, 0x90, 0x02,
+0x29, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x20, 0x14, 0x60, 0x21, 0x14, 0x60, 0x2b,
+0x24, 0xfc, 0x60, 0x45, 0x24, 0xf9, 0x60, 0x12, 0x24, 0x0e, 0x70, 0x4a, 0xe5, 0x46, 0x13, 0x13,
+0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x80, 0x29, 0xd2, 0x39, 0x80, 0x3a, 0xe5, 0x46,
+0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0x80, 0x2d, 0xe5, 0x46, 0x30, 0xe2, 0x0d,
+0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f,
+0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, 0x39, 0x80, 0x0f, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80,
+0x01, 0xc3, 0x92, 0x39, 0x80, 0x02, 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5,
+0x27, 0xf4, 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, 0x22, 0xe5, 0x47, 0xb4, 0x0b, 0x10, 0x90, 0x02,
+0x29, 0xe0, 0x54, 0xeb, 0xf0, 0xe5, 0x27, 0x54, 0xeb, 0x45, 0x45, 0xf5, 0x27, 0x22, 0xe4, 0x90,
+0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x45, 0x80, 0x04, 0xe5, 0x45, 0xf4, 0xff, 0x90, 0x02,
+0x28, 0xef, 0xf0, 0x22, 0x8f, 0x50, 0xd2, 0x59, 0x22, 0x8f, 0x54, 0xd2, 0x58, 0x22, 0xe4, 0xf5,
+0x62, 0xc2, 0xaf, 0xe5, 0x51, 0x14, 0x60, 0x48, 0x14, 0x60, 0x66, 0x24, 0x02, 0x60, 0x03, 0x02,
+0x18, 0xb6, 0xd2, 0x59, 0x75, 0x55, 0x01, 0x90, 0x02, 0xa2, 0xe0, 0x54, 0x7f, 0xf0, 0xa3, 0xe0,
+0x20, 0xe7, 0x23, 0x90, 0x04, 0x34, 0xe0, 0xb4, 0x02, 0x1c, 0xa3, 0xe0, 0xb4, 0x02, 0x17, 0xa3,
+0xe0, 0xb4, 0x02, 0x12, 0x7f, 0x20, 0x12, 0x17, 0xa4, 0x90, 0x10, 0x04, 0xe0, 0x54, 0xf3, 0xf0,
+0x75, 0x51, 0x01, 0x02, 0x18, 0xb6, 0xe5, 0x50, 0x70, 0x06, 0x75, 0x62, 0x03, 0x02, 0x18, 0xb6,
+0x90, 0x12, 0x00, 0xe0, 0x54, 0x03, 0x70, 0x12, 0x7f, 0x20, 0x12, 0x17, 0xa4, 0x90, 0x02, 0xa2,
+0xe0, 0x54, 0xbf, 0xf0, 0x75, 0x51, 0x02, 0x02, 0x18, 0xb6, 0xe5, 0x50, 0x70, 0x03, 0x02, 0x18,
+0xb1, 0x90, 0x02, 0xa3, 0xe0, 0x30, 0xe6, 0x03, 0x02, 0x18, 0xad, 0x90, 0x04, 0x37, 0xe0, 0x64,
+0x22, 0x70, 0x7a, 0x90, 0x01, 0x8a, 0x74, 0x7e, 0xf0, 0x90, 0x01, 0x96, 0xf0, 0x90, 0x12, 0x04,
+0x74, 0x0a, 0xf0, 0xe5, 0x58, 0xb4, 0x72, 0x15, 0xe5, 0x59, 0xb4, 0x35, 0x10, 0xe4, 0x90, 0x05,
+0x00, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0, 0x7f, 0x01, 0x12,
+0x0d, 0x2a, 0x90, 0x13, 0x28, 0xe0, 0x54, 0xf0, 0xf0, 0xa3, 0xe0, 0x54, 0xf0, 0xf0, 0xe5, 0x59,
+0xb4, 0x35, 0x14, 0xe5, 0x3c, 0xf4, 0x60, 0x06, 0xa3, 0xe0, 0x54, 0xf3, 0x80, 0x14, 0x90, 0x13,
+0x2a, 0xe0, 0x54, 0xfb, 0xf0, 0x80, 0x14, 0xe5, 0x3c, 0xf4, 0x90, 0x13, 0x2a, 0x60, 0x08, 0xe0,
+0x54, 0xf2, 0x45, 0x3c, 0xf0, 0x80, 0x04, 0xe0, 0x54, 0xfa, 0xf0, 0x90, 0x04, 0x01, 0xe0, 0x54,
+0xfd, 0xf0, 0x75, 0x62, 0x01, 0x75, 0x55, 0x02, 0xe4, 0xf5, 0x51, 0x80, 0x09, 0xe5, 0x50, 0x70,
+0x05, 0x75, 0x62, 0x03, 0xf5, 0x51, 0xe5, 0x62, 0x60, 0x15, 0xc2, 0x01, 0xe4, 0xf5, 0x51, 0xc2,
+0x59, 0xad, 0x62, 0xaf, 0x40, 0x12, 0x19, 0x61, 0xe5, 0x62, 0xb4, 0x03, 0x02, 0xd2, 0x03, 0xd2,
+0xaf, 0x22, 0xc2, 0xaf, 0x30, 0x01, 0x12, 0xe4, 0x90, 0x01, 0x96, 0xf0, 0xf5, 0x51, 0xc2, 0x59,
+0xc2, 0x01, 0x7d, 0x02, 0xaf, 0x40, 0x12, 0x19, 0x61, 0xe5, 0x52, 0x14, 0x60, 0x09, 0x04, 0x70,
+0x6d, 0x75, 0x52, 0x01, 0x75, 0x55, 0x03, 0x90, 0x04, 0x01, 0xe0, 0x44, 0x0e, 0xf0, 0x90, 0x13,
+0x28, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x05, 0xf0, 0x90,
+0x12, 0x04, 0x74, 0x03, 0xf0, 0xe5, 0x58, 0xb4, 0x72, 0x16, 0xe5, 0x59, 0xb4, 0x35, 0x11, 0x90,
+0x05, 0x00, 0x74, 0xe2, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0,
+0x7f, 0x01, 0x12, 0x0d, 0x2a, 0x90, 0x02, 0xa2, 0xe0, 0x44, 0xc0, 0xf0, 0x90, 0x10, 0x04, 0xe0,
+0x44, 0x0c, 0xf0, 0xe4, 0xf5, 0x52, 0xf5, 0x55, 0x30, 0x02, 0x09, 0xc2, 0x02, 0x7d, 0x01, 0xaf,
+0x41, 0x12, 0x19, 0x61, 0x30, 0x03, 0x02, 0xc2, 0x03, 0xe4, 0x90, 0x01, 0x96, 0xf0, 0xd2, 0xaf,
+0x22, 0xef, 0xf4, 0x60, 0x2d, 0xe4, 0xfe, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5,
+0x83, 0xe0, 0xb4, 0xff, 0x19, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xef,
+0xf0, 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xed, 0xf0, 0x22, 0x0e, 0xbe,
+0x04, 0xd5, 0x22, 0x22, 0x22, 0x90, 0x70, 0x2a, 0xe0, 0x30, 0xe1, 0x4d, 0xc2, 0xaf, 0x90, 0x70,
+0x28, 0xe0, 0x90, 0x10, 0x1c, 0xf0, 0x90, 0x70, 0x29, 0xe0, 0x90, 0x10, 0x1d, 0xf0, 0x90, 0x70,
+0x2a, 0xe0, 0x90, 0x10, 0x1e, 0xf0, 0x90, 0x10, 0x1c, 0xe0, 0xf5, 0x62, 0x90, 0x10, 0x1e, 0xe0,
+0x20, 0xe1, 0xf3, 0x90, 0x10, 0x1c, 0xe0, 0x90, 0x70, 0x28, 0xf0, 0x90, 0x10, 0x1d, 0xe0, 0x90,
+0x70, 0x29, 0xf0, 0x90, 0x10, 0x1e, 0xe0, 0x90, 0x70, 0x2a, 0xf0, 0x30, 0x4a, 0x07, 0x90, 0x70,
+0x24, 0xe0, 0x44, 0x01, 0xf0, 0xc2, 0x05, 0xd2, 0xaf, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x7b, 0xc4,
+0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x13, 0x1f, 0x02,
+0x13, 0x20, 0x02, 0x13, 0x3f, 0x02, 0x13, 0x44, 0x12, 0x13, 0x40, 0x22, 0x02, 0x17, 0xae, 0x02,
+0x18, 0xd2, 0x02, 0x14, 0x3d, 0x02, 0x13, 0x78, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x19,
+0x95, 0x22, 0x90, 0x01, 0x8c, 0xe0, 0x30, 0xe3, 0x1b, 0xe5, 0x4c, 0x30, 0xe0, 0x04, 0x7f, 0x40,
+0x80, 0x02, 0x7f, 0x00, 0x90, 0x10, 0x2f, 0xef, 0xf0, 0x90, 0x01, 0x8c, 0x74, 0x08, 0xf0, 0xe4,
+0x90, 0x01, 0xa7, 0xf0, 0x90, 0x01, 0x8c, 0xe0, 0x30, 0xe0, 0x1c, 0x90, 0x01, 0x80, 0xe0, 0xb4,
+0x02, 0x15, 0xa3, 0xe0, 0xb4, 0x01, 0x10, 0x90, 0x01, 0x84, 0xe0, 0xb4, 0x81, 0x09, 0x90, 0x01,
+0x8c, 0x74, 0x01, 0xf0, 0x12, 0x0d, 0xdd, 0x22, 0x90, 0x04, 0x14, 0xe0, 0x20, 0xe7, 0x03, 0x02,
+0x13, 0x1e, 0x90, 0x70, 0x12, 0xe0, 0xf5, 0x56, 0x90, 0x04, 0x04, 0xe0, 0x12, 0x0a, 0xb6, 0x10,
+0xd9, 0x31, 0x10, 0xbd, 0x36, 0x11, 0x02, 0x50, 0x11, 0x39, 0x51, 0x11, 0x42, 0x52, 0x11, 0x42,
+0x53, 0x11, 0x42, 0x54, 0x11, 0x83, 0x55, 0x11, 0xd2, 0x56, 0x12, 0x25, 0x70, 0x12, 0x50, 0x71,
+0x12, 0x7e, 0x72, 0x12, 0xd5, 0x73, 0x12, 0xf6, 0x80, 0x00, 0x00, 0x13, 0x1e, 0x90, 0x70, 0x11,
+0xe0, 0xf5, 0x3c, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe5, 0x56,
+0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x20, 0x02, 0x03, 0x30, 0x03, 0x1d, 0x7d,
+0x02, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13,
+0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x85, 0x56, 0x41, 0xd2,
+0x02, 0x22, 0x90, 0x70, 0x10, 0xe0, 0x54, 0x7f, 0xff, 0xbf, 0x0a, 0x0d, 0x90, 0x70, 0x11, 0xe0,
+0xb4, 0x08, 0x06, 0x75, 0x4e, 0x01, 0x75, 0x4f, 0x84, 0x90, 0x70, 0x10, 0xe0, 0x54, 0x7f, 0xff,
+0xbf, 0x02, 0x12, 0x90, 0x70, 0x11, 0xe0, 0x64, 0x08, 0x60, 0x04, 0xe0, 0xb4, 0x20, 0x06, 0x75,
+0x4e, 0x03, 0x75, 0x4f, 0x20, 0xe4, 0xf5, 0x27, 0x22, 0x90, 0x70, 0x11, 0xe0, 0x24, 0xff, 0x92,
+0x47, 0x22, 0x90, 0x04, 0x04, 0xe0, 0x25, 0xe0, 0x24, 0x5d, 0xf5, 0x57, 0x90, 0x70, 0x10, 0xe0,
+0xff, 0x74, 0x47, 0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, 0x90, 0x70, 0x11, 0xe0, 0xff, 0x74, 0x48,
+0x25, 0x57, 0xf8, 0xc6, 0xef, 0xc6, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14,
+0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e,
+0x02, 0x13, 0x17, 0xe5, 0x47, 0x64, 0x07, 0x60, 0x1d, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x17, 0xe5,
+0x47, 0x64, 0x09, 0x60, 0x11, 0xe5, 0x47, 0x64, 0x0a, 0x60, 0x0b, 0xe5, 0x47, 0x64, 0x0b, 0x60,
+0x05, 0xe5, 0x47, 0xb4, 0x0c, 0x08, 0x90, 0x70, 0x11, 0xe0, 0x54, 0x0f, 0xf5, 0x3a, 0xe5, 0x47,
+0xb4, 0x09, 0x08, 0xe5, 0x3a, 0xb4, 0x03, 0x03, 0xe4, 0xf5, 0x46, 0xe5, 0x47, 0xb4, 0x0a, 0x08,
+0xe5, 0x3a, 0xb4, 0x01, 0x03, 0xe4, 0xf5, 0x46, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0xd2,
+0x04, 0x22, 0x90, 0x70, 0x11, 0xe0, 0xf4, 0xff, 0x90, 0x70, 0x10, 0xe0, 0x5f, 0xff, 0x90, 0x70,
+0x11, 0xe0, 0x55, 0x27, 0x4f, 0x90, 0x70, 0x18, 0xf0, 0x90, 0x70, 0x11, 0xe0, 0x90, 0x70, 0x19,
+0xf0, 0xe4, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x30, 0x15, 0x03, 0xd2, 0x14, 0x22, 0x90, 0x70,
+0x18, 0xe0, 0xf5, 0x27, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, 0xef, 0x5e,
+0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x90,
+0x02, 0x28, 0xef, 0xf0, 0x22, 0x90, 0x70, 0x10, 0xe0, 0xfe, 0x90, 0x70, 0x11, 0xe0, 0xfd, 0xed,
+0xf8, 0xe6, 0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0,
+0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17,
+0x90, 0x70, 0x10, 0xe0, 0xfe, 0x90, 0x70, 0x11, 0xe0, 0xfd, 0xed, 0xf5, 0x82, 0x8e, 0x83, 0xe0,
+0xf5, 0x57, 0xfd, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90,
+0x70, 0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x70, 0x03, 0x02, 0x13, 0x1e, 0x02, 0x13, 0x17, 0x90, 0x10,
+0x00, 0xe0, 0xf5, 0x57, 0x90, 0x10, 0x02, 0xe0, 0xf5, 0x58, 0xa3, 0xe0, 0xf5, 0x59, 0xe5, 0x58,
+0xb4, 0x70, 0x1e, 0xe5, 0x59, 0xb4, 0x30, 0x19, 0x90, 0x05, 0x08, 0xe0, 0x44, 0x01, 0xf0, 0xfd,
+0x90, 0x05, 0x05, 0xe0, 0x54, 0xfb, 0xf0, 0x44, 0x04, 0xf0, 0xed, 0x54, 0xfe, 0x90, 0x05, 0x08,
+0xf0, 0xe4, 0xf5, 0x4e, 0xf5, 0x4f, 0x75, 0x3a, 0xff, 0x75, 0x3c, 0xff, 0xad, 0x57, 0xaf, 0x56,
+0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5, 0x56,
+0xf4, 0x60, 0x4b, 0x80, 0x42, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x93, 0xe4, 0xfd, 0xaf,
+0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70, 0x13, 0xf0, 0xe5,
+0x56, 0xf4, 0x60, 0x2a, 0x80, 0x21, 0x90, 0x70, 0x10, 0xe0, 0x24, 0xff, 0x92, 0x4a, 0xd2, 0x05,
+0xad, 0x57, 0xaf, 0x56, 0x12, 0x0b, 0xaa, 0x90, 0x04, 0x14, 0x74, 0x80, 0xf0, 0xe4, 0x90, 0x70,
+0x13, 0xf0, 0xe5, 0x56, 0xf4, 0x60, 0x07, 0x90, 0x70, 0x25, 0xe0, 0x44, 0x01, 0xf0, 0x22, 0x22,
+0xe5, 0x53, 0x70, 0x1a, 0x30, 0x60, 0x09, 0xb2, 0x4d, 0x30, 0x4d, 0x04, 0x05, 0x46, 0xc2, 0x04,
+0xe5, 0x4f, 0x45, 0x4e, 0x60, 0x08, 0xe5, 0x4f, 0x15, 0x4f, 0x70, 0x02, 0x15, 0x4e, 0x22, 0x22,
+0xc2, 0x42, 0xd3, 0x22, 0x30, 0x14, 0x30, 0x90, 0x70, 0x19, 0xe0, 0x55, 0x27, 0xff, 0x90, 0x70,
+0x18, 0xe0, 0x4f, 0xf5, 0x27, 0x90, 0x02, 0x29, 0xe0, 0xff, 0x90, 0x70, 0x19, 0xe0, 0xfe, 0xef,
+0x5e, 0x90, 0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff,
+0x90, 0x02, 0x28, 0xef, 0xf0, 0xc2, 0x14, 0x22, 0xc2, 0x4b, 0xc2, 0x4c, 0xe5, 0x44, 0x12, 0x0a,
+0xb6, 0x13, 0x9a, 0x00, 0x14, 0x28, 0x04, 0x14, 0x24, 0x08, 0x14, 0x04, 0x10, 0x13, 0xae, 0x20,
+0x13, 0xce, 0x60, 0x13, 0xdf, 0xa0, 0x00, 0x00, 0x14, 0x2a, 0x85, 0x48, 0x43, 0x85, 0x4a, 0x42,
+0x85, 0x4c, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x60, 0x03, 0x02, 0x14, 0x2a, 0x80, 0x1b, 0xe5, 0x48,
+0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4a, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4c, 0xc4, 0x54,
+0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x61, 0x53, 0x43, 0x0f, 0x80, 0x5c, 0x85, 0x49,
+0x43, 0x85, 0x4b, 0x42, 0x85, 0x4d, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x4d, 0x80, 0x1b, 0xe5,
+0x49, 0xc4, 0x54, 0x0f, 0xf5, 0x43, 0xe5, 0x4b, 0xc4, 0x54, 0x0f, 0xf5, 0x42, 0xe5, 0x4d, 0xc4,
+0x54, 0x0f, 0xf5, 0x5e, 0xe5, 0x47, 0x64, 0x06, 0x70, 0x30, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x10,
+0xf5, 0x43, 0x80, 0x26, 0xe5, 0x47, 0x64, 0x04, 0x60, 0x05, 0xe5, 0x47, 0xb4, 0x05, 0x06, 0x43,
+0x5e, 0x04, 0x75, 0x42, 0x09, 0xe5, 0x47, 0xb4, 0x06, 0x10, 0xe5, 0x43, 0x54, 0x0f, 0x44, 0x30,
+0xf5, 0x43, 0x80, 0x06, 0xd2, 0x4b, 0x80, 0x02, 0xd2, 0x4c, 0xe4, 0xf5, 0x25, 0xe5, 0x42, 0x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 0x47, 0x64, 0x0a, 0x70, 0x22, 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x17,
+0xe5, 0x3a, 0xb4, 0x01, 0x06, 0xe5, 0x46, 0xa2, 0xe3, 0x80, 0x34, 0xe5, 0x46, 0x20, 0xe4, 0x03,
+0x30, 0xe5, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x80, 0x26, 0x30, 0x6c, 0x06, 0xe5, 0x46, 0xa2, 0xe2,
+0x80, 0x1d, 0xe5, 0x5e, 0x20, 0xe1, 0x04, 0x7f, 0x01, 0x80, 0x02, 0x7f, 0x00, 0xe5, 0x46, 0x54,
+0xf0, 0xfe, 0xbe, 0xf0, 0x04, 0x7e, 0x01, 0x80, 0x02, 0x7e, 0x00, 0xee, 0x6f, 0x24, 0xff, 0x92,
+0x71, 0x92, 0x70, 0x90, 0x10, 0x00, 0xe0, 0x90, 0x10, 0x2c, 0xf0, 0x90, 0x10, 0x03, 0xe0, 0xc3,
+0x94, 0x30, 0x40, 0x14, 0xa2, 0x71, 0x92, 0x77, 0xa2, 0x70, 0x92, 0x76, 0xe5, 0x2e, 0x13, 0x13,
+0x54, 0x3f, 0xf5, 0x2e, 0xc2, 0x77, 0xd2, 0x76, 0x90, 0x10, 0x2f, 0xe5, 0x2e, 0xf0, 0xe5, 0x47,
+0x64, 0x06, 0x70, 0x39, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xfe, 0xf0, 0xe5, 0x43, 0xc4, 0x54, 0x0f,
+0x14, 0x60, 0x0c, 0x24, 0xfe, 0x60, 0x0c, 0x24, 0x03, 0x70, 0x13, 0xc2, 0x38, 0x80, 0x0f, 0xd2,
+0x38, 0x80, 0x0b, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x38, 0x30, 0x47,
+0x05, 0xaf, 0x27, 0x02, 0x17, 0x73, 0xe5, 0x27, 0xf4, 0xff, 0x02, 0x17, 0x73, 0xe5, 0x47, 0x64,
+0x07, 0x60, 0x0f, 0xe5, 0x47, 0x64, 0x08, 0x60, 0x09, 0xe5, 0x47, 0x64, 0x09, 0x60, 0x03, 0x02,
+0x16, 0xf2, 0x90, 0x02, 0x29, 0xe0, 0x54, 0xfc, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x22, 0x14, 0x60,
+0x25, 0x14, 0x60, 0x2d, 0x24, 0xfc, 0x60, 0x49, 0x24, 0xf9, 0x60, 0x14, 0x24, 0x0e, 0x70, 0x50,
+0xe5, 0x46, 0x13, 0x13, 0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x24, 0xff, 0x80, 0x3a,
+0xd2, 0x39, 0xc2, 0x38, 0x80, 0x3e, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x1d, 0xc3, 0x80,
+0x1a, 0xe5, 0x46, 0x30, 0xe2, 0x0d, 0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f,
+0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f, 0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, 0x38, 0xc2, 0x39, 0x80,
+0x13, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0xc2, 0x38, 0x80, 0x04,
+0xc2, 0x38, 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5, 0x27, 0xf4, 0xff, 0x02,
+0x17, 0x73, 0xe5, 0x47, 0x64, 0x0c, 0x60, 0x06, 0xe5, 0x47, 0x64, 0x0b, 0x70, 0x7a, 0x90, 0x02,
+0x29, 0xe0, 0x54, 0xfd, 0xf0, 0xe5, 0x3a, 0x14, 0x60, 0x20, 0x14, 0x60, 0x21, 0x14, 0x60, 0x2b,
+0x24, 0xfc, 0x60, 0x45, 0x24, 0xf9, 0x60, 0x12, 0x24, 0x0e, 0x70, 0x4a, 0xe5, 0x46, 0x13, 0x13,
+0x54, 0x3f, 0x75, 0xf0, 0x03, 0x84, 0xe5, 0xf0, 0x80, 0x29, 0xd2, 0x39, 0x80, 0x3a, 0xe5, 0x46,
+0x30, 0xe2, 0x03, 0xd3, 0x80, 0x01, 0xc3, 0x92, 0x39, 0x80, 0x2d, 0xe5, 0x46, 0x30, 0xe2, 0x0d,
+0x54, 0x38, 0xc3, 0x94, 0x30, 0x50, 0x06, 0x7e, 0x00, 0x7f, 0x01, 0x80, 0x04, 0x7e, 0x00, 0x7f,
+0x00, 0xee, 0x4f, 0x24, 0xff, 0x92, 0x39, 0x80, 0x0f, 0xe5, 0x46, 0x30, 0xe2, 0x03, 0xd3, 0x80,
+0x01, 0xc3, 0x92, 0x39, 0x80, 0x02, 0xc2, 0x39, 0x30, 0x47, 0x04, 0xaf, 0x27, 0x80, 0x04, 0xe5,
+0x27, 0xf4, 0xff, 0x90, 0x02, 0x28, 0xef, 0xf0, 0x22, 0xe5, 0x47, 0xb4, 0x0b, 0x10, 0x90, 0x02,
+0x29, 0xe0, 0x54, 0xeb, 0xf0, 0xe5, 0x27, 0x54, 0xeb, 0x45, 0x45, 0xf5, 0x27, 0x22, 0xe4, 0x90,
+0x02, 0x29, 0xf0, 0x30, 0x47, 0x04, 0xaf, 0x45, 0x80, 0x04, 0xe5, 0x45, 0xf4, 0xff, 0x90, 0x02,
+0x28, 0xef, 0xf0, 0x22, 0x8f, 0x50, 0xd2, 0x59, 0x22, 0x8f, 0x54, 0xd2, 0x58, 0x22, 0xe4, 0xf5,
+0x62, 0xc2, 0xaf, 0xe5, 0x51, 0x14, 0x60, 0x48, 0x14, 0x60, 0x66, 0x24, 0x02, 0x60, 0x03, 0x02,
+0x18, 0xb6, 0xd2, 0x59, 0x75, 0x55, 0x01, 0x90, 0x02, 0xa2, 0xe0, 0x54, 0x7f, 0xf0, 0xa3, 0xe0,
+0x20, 0xe7, 0x23, 0x90, 0x04, 0x34, 0xe0, 0xb4, 0x02, 0x1c, 0xa3, 0xe0, 0xb4, 0x02, 0x17, 0xa3,
+0xe0, 0xb4, 0x02, 0x12, 0x7f, 0x20, 0x12, 0x17, 0xa4, 0x90, 0x10, 0x04, 0xe0, 0x54, 0xf3, 0xf0,
+0x75, 0x51, 0x01, 0x02, 0x18, 0xb6, 0xe5, 0x50, 0x70, 0x06, 0x75, 0x62, 0x03, 0x02, 0x18, 0xb6,
+0x90, 0x12, 0x00, 0xe0, 0x54, 0x03, 0x70, 0x12, 0x7f, 0x20, 0x12, 0x17, 0xa4, 0x90, 0x02, 0xa2,
+0xe0, 0x54, 0xbf, 0xf0, 0x75, 0x51, 0x02, 0x02, 0x18, 0xb6, 0xe5, 0x50, 0x70, 0x03, 0x02, 0x18,
+0xb1, 0x90, 0x02, 0xa3, 0xe0, 0x30, 0xe6, 0x03, 0x02, 0x18, 0xad, 0x90, 0x04, 0x37, 0xe0, 0x64,
+0x22, 0x70, 0x7a, 0x90, 0x01, 0x8a, 0x74, 0x7e, 0xf0, 0x90, 0x01, 0x96, 0xf0, 0x90, 0x12, 0x04,
+0x74, 0x0a, 0xf0, 0xe5, 0x58, 0xb4, 0x72, 0x15, 0xe5, 0x59, 0xb4, 0x35, 0x10, 0xe4, 0x90, 0x05,
+0x00, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0, 0x7f, 0x01, 0x12,
+0x0d, 0x48, 0x90, 0x13, 0x28, 0xe0, 0x54, 0xf0, 0xf0, 0xa3, 0xe0, 0x54, 0xf0, 0xf0, 0xe5, 0x59,
+0xb4, 0x35, 0x14, 0xe5, 0x3c, 0xf4, 0x60, 0x06, 0xa3, 0xe0, 0x54, 0xf3, 0x80, 0x14, 0x90, 0x13,
+0x2a, 0xe0, 0x54, 0xfb, 0xf0, 0x80, 0x14, 0xe5, 0x3c, 0xf4, 0x90, 0x13, 0x2a, 0x60, 0x08, 0xe0,
+0x54, 0xf2, 0x45, 0x3c, 0xf0, 0x80, 0x04, 0xe0, 0x54, 0xfa, 0xf0, 0x90, 0x04, 0x01, 0xe0, 0x54,
+0xfd, 0xf0, 0x75, 0x62, 0x01, 0x75, 0x55, 0x02, 0xe4, 0xf5, 0x51, 0x80, 0x09, 0xe5, 0x50, 0x70,
+0x05, 0x75, 0x62, 0x03, 0xf5, 0x51, 0xe5, 0x62, 0x60, 0x15, 0xc2, 0x01, 0xe4, 0xf5, 0x51, 0xc2,
+0x59, 0xad, 0x62, 0xaf, 0x40, 0x12, 0x19, 0x61, 0xe5, 0x62, 0xb4, 0x03, 0x02, 0xd2, 0x03, 0xd2,
+0xaf, 0x22, 0xc2, 0xaf, 0x30, 0x01, 0x12, 0xe4, 0x90, 0x01, 0x96, 0xf0, 0xf5, 0x51, 0xc2, 0x59,
+0xc2, 0x01, 0x7d, 0x02, 0xaf, 0x40, 0x12, 0x19, 0x61, 0xe5, 0x52, 0x14, 0x60, 0x09, 0x04, 0x70,
+0x6d, 0x75, 0x52, 0x01, 0x75, 0x55, 0x03, 0x90, 0x04, 0x01, 0xe0, 0x44, 0x0e, 0xf0, 0x90, 0x13,
+0x28, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x0f, 0xf0, 0xa3, 0xe0, 0x44, 0x05, 0xf0, 0x90,
+0x12, 0x04, 0x74, 0x03, 0xf0, 0xe5, 0x58, 0xb4, 0x72, 0x16, 0xe5, 0x59, 0xb4, 0x35, 0x11, 0x90,
+0x05, 0x00, 0x74, 0xe2, 0xf0, 0xa3, 0x74, 0x08, 0xf0, 0xa3, 0x74, 0x01, 0xf0, 0x74, 0x03, 0xf0,
+0x7f, 0x01, 0x12, 0x0d, 0x48, 0x90, 0x02, 0xa2, 0xe0, 0x44, 0xc0, 0xf0, 0x90, 0x10, 0x04, 0xe0,
+0x44, 0x0c, 0xf0, 0xe4, 0xf5, 0x52, 0xf5, 0x55, 0x30, 0x02, 0x09, 0xc2, 0x02, 0x7d, 0x01, 0xaf,
+0x41, 0x12, 0x19, 0x61, 0x30, 0x03, 0x02, 0xc2, 0x03, 0xe4, 0x90, 0x01, 0x96, 0xf0, 0xd2, 0xaf,
+0x22, 0xef, 0xf4, 0x60, 0x2d, 0xe4, 0xfe, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5,
+0x83, 0xe0, 0xb4, 0xff, 0x19, 0x74, 0x14, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xef,
+0xf0, 0x74, 0x1c, 0x2e, 0xf5, 0x82, 0xe4, 0x34, 0x70, 0xf5, 0x83, 0xed, 0xf0, 0x22, 0x0e, 0xbe,
+0x04, 0xd5, 0x22, 0x22, 0x22, 0x90, 0x70, 0x2a, 0xe0, 0x30, 0xe1, 0x4d, 0xc2, 0xaf, 0x90, 0x70,
+0x28, 0xe0, 0x90, 0x10, 0x1c, 0xf0, 0x90, 0x70, 0x29, 0xe0, 0x90, 0x10, 0x1d, 0xf0, 0x90, 0x70,
+0x2a, 0xe0, 0x90, 0x10, 0x1e, 0xf0, 0x90, 0x10, 0x1c, 0xe0, 0xf5, 0x62, 0x90, 0x10, 0x1e, 0xe0,
+0x20, 0xe1, 0xf3, 0x90, 0x10, 0x1c, 0xe0, 0x90, 0x70, 0x28, 0xf0, 0x90, 0x10, 0x1d, 0xe0, 0x90,
+0x70, 0x29, 0xf0, 0x90, 0x10, 0x1e, 0xe0, 0x90, 0x70, 0x2a, 0xf0, 0x30, 0x4a, 0x07, 0x90, 0x70,
+0x24, 0xe0, 0x44, 0x01, 0xf0, 0xc2, 0x05, 0xd2, 0xaf, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x65, 0xd3, } ;
diff --git a/drivers/staging/rt2860/common/md5.c b/drivers/staging/rt2860/common/md5.c
deleted file mode 100644
index ad883ca2ffc8..000000000000
--- a/drivers/staging/rt2860/common/md5.c
+++ /dev/null
@@ -1,1415 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- md5.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- jan 10-28-03 Initial
- Rita 11-23-04 Modify MD5 and SHA-1
- Rita 10-14-05 Modify SHA-1 in big-endian platform
- */
-#include "../rt_config.h"
-
-/**
- * md5_mac:
- * @key: pointer to the key used for MAC generation
- * @key_len: length of the key in bytes
- * @data: pointer to the data area for which the MAC is generated
- * @data_len: length of the data in bytes
- * @mac: pointer to the buffer holding space for the MAC; the buffer should
- * have space for 128-bit (16 bytes) MD5 hash value
- *
- * md5_mac() determines the message authentication code by using secure hash
- * MD5(key | data | key).
- */
-void md5_mac(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac)
-{
- MD5_CTX context;
-
- MD5Init(&context);
- MD5Update(&context, key, key_len);
- MD5Update(&context, data, data_len);
- MD5Update(&context, key, key_len);
- MD5Final(mac, &context);
-}
-
-/**
- * hmac_md5:
- * @key: pointer to the key used for MAC generation
- * @key_len: length of the key in bytes
- * @data: pointer to the data area for which the MAC is generated
- * @data_len: length of the data in bytes
- * @mac: pointer to the buffer holding space for the MAC; the buffer should
- * have space for 128-bit (16 bytes) MD5 hash value
- *
- * hmac_md5() determines the message authentication code using HMAC-MD5.
- * This implementation is based on the sample code presented in RFC 2104.
- */
-void hmac_md5(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac)
-{
- MD5_CTX context;
- u8 k_ipad[65]; /* inner padding - key XORd with ipad */
- u8 k_opad[65]; /* outer padding - key XORd with opad */
- u8 tk[16];
- int i;
-
- //assert(key != NULL && data != NULL && mac != NULL);
-
- /* if key is longer than 64 bytes reset it to key = MD5(key) */
- if (key_len > 64) {
- MD5_CTX ttcontext;
-
- MD5Init(&ttcontext);
- MD5Update(&ttcontext, key, key_len);
- MD5Final(tk, &ttcontext);
- //key=(PUCHAR)ttcontext.buf;
- key = tk;
- key_len = 16;
- }
-
- /* the HMAC_MD5 transform looks like:
- *
- * MD5(K XOR opad, MD5(K XOR ipad, text))
- *
- * where K is an n byte key
- * ipad is the byte 0x36 repeated 64 times
- * opad is the byte 0x5c repeated 64 times
- * and text is the data being protected */
-
- /* start out by storing key in pads */
- NdisZeroMemory(k_ipad, sizeof(k_ipad));
- NdisZeroMemory(k_opad, sizeof(k_opad));
- //assert(key_len < sizeof(k_ipad));
- NdisMoveMemory(k_ipad, key, key_len);
- NdisMoveMemory(k_opad, key, key_len);
-
- /* XOR key with ipad and opad values */
- for (i = 0; i < 64; i++) {
- k_ipad[i] ^= 0x36;
- k_opad[i] ^= 0x5c;
- }
-
- /* perform inner MD5 */
- MD5Init(&context); /* init context for 1st pass */
- MD5Update(&context, k_ipad, 64); /* start with inner pad */
- MD5Update(&context, data, data_len); /* then text of datagram */
- MD5Final(mac, &context); /* finish up 1st pass */
-
- /* perform outer MD5 */
- MD5Init(&context); /* init context for 2nd pass */
- MD5Update(&context, k_opad, 64); /* start with outer pad */
- MD5Update(&context, mac, 16); /* then results of 1st hash */
- MD5Final(mac, &context); /* finish up 2nd pass */
-}
-
-#define byteReverse(buf, len) /* Nothing */
-
-/* ========================== MD5 implementation =========================== */
-// four base functions for MD5
-#define MD5_F1(x, y, z) (((x) & (y)) | ((~x) & (z)))
-#define MD5_F2(x, y, z) (((x) & (z)) | ((y) & (~z)))
-#define MD5_F3(x, y, z) ((x) ^ (y) ^ (z))
-#define MD5_F4(x, y, z) ((y) ^ ((x) | (~z)))
-#define CYCLIC_LEFT_SHIFT(w, s) (((w) << (s)) | ((w) >> (32-(s))))
-
-#define MD5Step(f, w, x, y, z, data, t, s) \
- ( w += f(x, y, z) + data + t, w = (CYCLIC_LEFT_SHIFT(w, s)) & 0xffffffff, w += x )
-
-
-/*
- * Function Description:
- * Initiate MD5 Context satisfied in RFC 1321
- *
- * Arguments:
- * pCtx Pointer to MD5 context
- *
- * Return Value:
- * None
- */
-VOID MD5Init(MD5_CTX *pCtx)
-{
- pCtx->Buf[0]=0x67452301;
- pCtx->Buf[1]=0xefcdab89;
- pCtx->Buf[2]=0x98badcfe;
- pCtx->Buf[3]=0x10325476;
-
- pCtx->LenInBitCount[0]=0;
- pCtx->LenInBitCount[1]=0;
-}
-
-
-/*
- * Function Description:
- * Update MD5 Context, allow of an arrary of octets as the next portion
- * of the message
- *
- * Arguments:
- * pCtx Pointer to MD5 context
- * pData Pointer to input data
- * LenInBytes The length of input data (unit: byte)
- *
- * Return Value:
- * None
- *
- * Note:
- * Called after MD5Init or MD5Update(itself)
- */
-VOID MD5Update(MD5_CTX *pCtx, UCHAR *pData, UINT32 LenInBytes)
-{
-
- UINT32 TfTimes;
- UINT32 temp;
- unsigned int i;
-
- temp = pCtx->LenInBitCount[0];
-
- pCtx->LenInBitCount[0] = (UINT32) (pCtx->LenInBitCount[0] + (LenInBytes << 3));
-
- if (pCtx->LenInBitCount[0] < temp)
- pCtx->LenInBitCount[1]++; //carry in
-
- pCtx->LenInBitCount[1] += LenInBytes >> 29;
-
- // mod 64 bytes
- temp = (temp >> 3) & 0x3f;
-
- // process lacks of 64-byte data
- if (temp)
- {
- UCHAR *pAds = (UCHAR *) pCtx->Input + temp;
-
- if ((temp+LenInBytes) < 64)
- {
- NdisMoveMemory(pAds, (UCHAR *)pData, LenInBytes);
- return;
- }
-
- NdisMoveMemory(pAds, (UCHAR *)pData, 64-temp);
- byteReverse(pCtx->Input, 16);
- MD5Transform(pCtx->Buf, (UINT32 *)pCtx->Input);
-
- pData += 64-temp;
- LenInBytes -= 64-temp;
- } // end of if (temp)
-
-
- TfTimes = (LenInBytes >> 6);
-
- for (i=TfTimes; i>0; i--)
- {
- NdisMoveMemory(pCtx->Input, (UCHAR *)pData, 64);
- byteReverse(pCtx->Input, 16);
- MD5Transform(pCtx->Buf, (UINT32 *)pCtx->Input);
- pData += 64;
- LenInBytes -= 64;
- } // end of for
-
- // buffering lacks of 64-byte data
- if(LenInBytes)
- NdisMoveMemory(pCtx->Input, (UCHAR *)pData, LenInBytes);
-
-}
-
-
-/*
- * Function Description:
- * Append padding bits and length of original message in the tail
- * The message digest has to be completed in the end
- *
- * Arguments:
- * Digest Output of Digest-Message for MD5
- * pCtx Pointer to MD5 context
- *
- * Return Value:
- * None
- *
- * Note:
- * Called after MD5Update
- */
-VOID MD5Final(UCHAR Digest[16], MD5_CTX *pCtx)
-{
- UCHAR Remainder;
- UCHAR PadLenInBytes;
- UCHAR *pAppend=0;
- unsigned int i;
-
- Remainder = (UCHAR)((pCtx->LenInBitCount[0] >> 3) & 0x3f);
-
- PadLenInBytes = (Remainder < 56) ? (56-Remainder) : (120-Remainder);
-
- pAppend = (UCHAR *)pCtx->Input + Remainder;
-
- // padding bits without crossing block(64-byte based) boundary
- if (Remainder < 56)
- {
- *pAppend = 0x80;
- PadLenInBytes --;
-
- NdisZeroMemory((UCHAR *)pCtx->Input + Remainder+1, PadLenInBytes);
-
- // add data-length field, from low to high
- for (i=0; i<4; i++)
- {
- pCtx->Input[56+i] = (UCHAR)((pCtx->LenInBitCount[0] >> (i << 3)) & 0xff);
- pCtx->Input[60+i] = (UCHAR)((pCtx->LenInBitCount[1] >> (i << 3)) & 0xff);
- }
-
- byteReverse(pCtx->Input, 16);
- MD5Transform(pCtx->Buf, (UINT32 *)pCtx->Input);
- } // end of if
-
- // padding bits with crossing block(64-byte based) boundary
- else
- {
- // the first block ===
- *pAppend = 0x80;
- PadLenInBytes --;
-
- NdisZeroMemory((UCHAR *)pCtx->Input + Remainder+1, (64-Remainder-1));
- PadLenInBytes -= (64 - Remainder - 1);
-
- byteReverse(pCtx->Input, 16);
- MD5Transform(pCtx->Buf, (UINT32 *)pCtx->Input);
-
-
- // the second block ===
- NdisZeroMemory((UCHAR *)pCtx->Input, PadLenInBytes);
-
- // add data-length field
- for (i=0; i<4; i++)
- {
- pCtx->Input[56+i] = (UCHAR)((pCtx->LenInBitCount[0] >> (i << 3)) & 0xff);
- pCtx->Input[60+i] = (UCHAR)((pCtx->LenInBitCount[1] >> (i << 3)) & 0xff);
- }
-
- byteReverse(pCtx->Input, 16);
- MD5Transform(pCtx->Buf, (UINT32 *)pCtx->Input);
- } // end of else
-
-
- NdisMoveMemory((UCHAR *)Digest, (UINT32 *)pCtx->Buf, 16); // output
- byteReverse((UCHAR *)Digest, 4);
- NdisZeroMemory(pCtx, sizeof(pCtx)); // memory free
-}
-
-
-/*
- * Function Description:
- * The central algorithm of MD5, consists of four rounds and sixteen
- * steps per round
- *
- * Arguments:
- * Buf Buffers of four states (output: 16 bytes)
- * Mes Input data (input: 64 bytes)
- *
- * Return Value:
- * None
- *
- * Note:
- * Called by MD5Update or MD5Final
- */
-VOID MD5Transform(UINT32 Buf[4], UINT32 Mes[16])
-{
- UINT32 Reg[4], Temp;
- unsigned int i;
-
- static UCHAR LShiftVal[16] =
- {
- 7, 12, 17, 22,
- 5, 9 , 14, 20,
- 4, 11, 16, 23,
- 6, 10, 15, 21,
- };
-
-
- // [equal to 4294967296*abs(sin(index))]
- static UINT32 MD5Table[64] =
- {
- 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
- 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
- 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
- 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
-
- 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
- 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
- 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
- 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
-
- 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
- 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
- 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,
- 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
-
- 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
- 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
- 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
- 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
- };
-
-
- for (i=0; i<4; i++)
- Reg[i]=Buf[i];
-
-
- // 64 steps in MD5 algorithm
- for (i=0; i<16; i++)
- {
- MD5Step(MD5_F1, Reg[0], Reg[1], Reg[2], Reg[3], Mes[i],
- MD5Table[i], LShiftVal[i & 0x3]);
-
- // one-word right shift
- Temp = Reg[3];
- Reg[3] = Reg[2];
- Reg[2] = Reg[1];
- Reg[1] = Reg[0];
- Reg[0] = Temp;
- }
- for (i=16; i<32; i++)
- {
- MD5Step(MD5_F2, Reg[0], Reg[1], Reg[2], Reg[3], Mes[(5*(i & 0xf)+1) & 0xf],
- MD5Table[i], LShiftVal[(0x1 << 2)+(i & 0x3)]);
-
- // one-word right shift
- Temp = Reg[3];
- Reg[3] = Reg[2];
- Reg[2] = Reg[1];
- Reg[1] = Reg[0];
- Reg[0] = Temp;
- }
- for (i=32; i<48; i++)
- {
- MD5Step(MD5_F3, Reg[0], Reg[1], Reg[2], Reg[3], Mes[(3*(i & 0xf)+5) & 0xf],
- MD5Table[i], LShiftVal[(0x1 << 3)+(i & 0x3)]);
-
- // one-word right shift
- Temp = Reg[3];
- Reg[3] = Reg[2];
- Reg[2] = Reg[1];
- Reg[1] = Reg[0];
- Reg[0] = Temp;
- }
- for (i=48; i<64; i++)
- {
- MD5Step(MD5_F4, Reg[0], Reg[1], Reg[2], Reg[3], Mes[(7*(i & 0xf)) & 0xf],
- MD5Table[i], LShiftVal[(0x3 << 2)+(i & 0x3)]);
-
- // one-word right shift
- Temp = Reg[3];
- Reg[3] = Reg[2];
- Reg[2] = Reg[1];
- Reg[1] = Reg[0];
- Reg[0] = Temp;
- }
-
-
- // (temporary)output
- for (i=0; i<4; i++)
- Buf[i] += Reg[i];
-
-}
-
-
-
-/* ========================= SHA-1 implementation ========================== */
-// four base functions for SHA-1
-#define SHA1_F1(b, c, d) (((b) & (c)) | ((~b) & (d)))
-#define SHA1_F2(b, c, d) ((b) ^ (c) ^ (d))
-#define SHA1_F3(b, c, d) (((b) & (c)) | ((b) & (d)) | ((c) & (d)))
-
-
-#define SHA1Step(f, a, b, c, d, e, w, k) \
- ( e += ( f(b, c, d) + w + k + CYCLIC_LEFT_SHIFT(a, 5)) & 0xffffffff, \
- b = CYCLIC_LEFT_SHIFT(b, 30) )
-
-//Initiate SHA-1 Context satisfied in RFC 3174
-VOID SHAInit(SHA_CTX *pCtx)
-{
- pCtx->Buf[0]=0x67452301;
- pCtx->Buf[1]=0xefcdab89;
- pCtx->Buf[2]=0x98badcfe;
- pCtx->Buf[3]=0x10325476;
- pCtx->Buf[4]=0xc3d2e1f0;
-
- pCtx->LenInBitCount[0]=0;
- pCtx->LenInBitCount[1]=0;
-}
-
-/*
- * Function Description:
- * Update SHA-1 Context, allow of an arrary of octets as the next
- * portion of the message
- *
- * Arguments:
- * pCtx Pointer to SHA-1 context
- * pData Pointer to input data
- * LenInBytes The length of input data (unit: byte)
- *
- * Return Value:
- * error indicate more than pow(2,64) bits of data
- *
- * Note:
- * Called after SHAInit or SHAUpdate(itself)
- */
-UCHAR SHAUpdate(SHA_CTX *pCtx, UCHAR *pData, UINT32 LenInBytes)
-{
- UINT32 TfTimes;
- UINT32 temp1,temp2;
- unsigned int i;
- UCHAR err=1;
-
- temp1 = pCtx->LenInBitCount[0];
- temp2 = pCtx->LenInBitCount[1];
-
- pCtx->LenInBitCount[0] = (UINT32) (pCtx->LenInBitCount[0] + (LenInBytes << 3));
- if (pCtx->LenInBitCount[0] < temp1)
- pCtx->LenInBitCount[1]++; //carry in
-
-
- pCtx->LenInBitCount[1] = (UINT32) (pCtx->LenInBitCount[1] +(LenInBytes >> 29));
- if (pCtx->LenInBitCount[1] < temp2)
- return (err); //check total length of original data
-
-
- // mod 64 bytes
- temp1 = (temp1 >> 3) & 0x3f;
-
- // process lacks of 64-byte data
- if (temp1)
- {
- UCHAR *pAds = (UCHAR *) pCtx->Input + temp1;
-
- if ((temp1+LenInBytes) < 64)
- {
- NdisMoveMemory(pAds, (UCHAR *)pData, LenInBytes);
- return (0);
- }
-
- NdisMoveMemory(pAds, (UCHAR *)pData, 64-temp1);
- byteReverse((UCHAR *)pCtx->Input, 16);
-
- NdisZeroMemory((UCHAR *)pCtx->Input + 64, 16);
- SHATransform(pCtx->Buf, (UINT32 *)pCtx->Input);
-
- pData += 64-temp1;
- LenInBytes -= 64-temp1;
- } // end of if (temp1)
-
-
- TfTimes = (LenInBytes >> 6);
-
- for (i=TfTimes; i>0; i--)
- {
- NdisMoveMemory(pCtx->Input, (UCHAR *)pData, 64);
- byteReverse((UCHAR *)pCtx->Input, 16);
-
- NdisZeroMemory((UCHAR *)pCtx->Input + 64, 16);
- SHATransform(pCtx->Buf, (UINT32 *)pCtx->Input);
- pData += 64;
- LenInBytes -= 64;
- } // end of for
-
- // buffering lacks of 64-byte data
- if(LenInBytes)
- NdisMoveMemory(pCtx->Input, (UCHAR *)pData, LenInBytes);
-
- return (0);
-
-}
-
-// Append padding bits and length of original message in the tail
-// The message digest has to be completed in the end
-VOID SHAFinal(SHA_CTX *pCtx, UCHAR Digest[20])
-{
- UCHAR Remainder;
- UCHAR PadLenInBytes;
- UCHAR *pAppend=0;
- unsigned int i;
-
- Remainder = (UCHAR)((pCtx->LenInBitCount[0] >> 3) & 0x3f);
-
- pAppend = (UCHAR *)pCtx->Input + Remainder;
-
- PadLenInBytes = (Remainder < 56) ? (56-Remainder) : (120-Remainder);
-
- // padding bits without crossing block(64-byte based) boundary
- if (Remainder < 56)
- {
- *pAppend = 0x80;
- PadLenInBytes --;
-
- NdisZeroMemory((UCHAR *)pCtx->Input + Remainder+1, PadLenInBytes);
-
- // add data-length field, from high to low
- for (i=0; i<4; i++)
- {
- pCtx->Input[56+i] = (UCHAR)((pCtx->LenInBitCount[1] >> ((3-i) << 3)) & 0xff);
- pCtx->Input[60+i] = (UCHAR)((pCtx->LenInBitCount[0] >> ((3-i) << 3)) & 0xff);
- }
-
- byteReverse((UCHAR *)pCtx->Input, 16);
- NdisZeroMemory((UCHAR *)pCtx->Input + 64, 14);
- SHATransform(pCtx->Buf, (UINT32 *)pCtx->Input);
- } // end of if
-
- // padding bits with crossing block(64-byte based) boundary
- else
- {
- // the first block ===
- *pAppend = 0x80;
- PadLenInBytes --;
-
- NdisZeroMemory((UCHAR *)pCtx->Input + Remainder+1, (64-Remainder-1));
- PadLenInBytes -= (64 - Remainder - 1);
-
- byteReverse((UCHAR *)pCtx->Input, 16);
- NdisZeroMemory((UCHAR *)pCtx->Input + 64, 16);
- SHATransform(pCtx->Buf, (UINT32 *)pCtx->Input);
-
-
- // the second block ===
- NdisZeroMemory((UCHAR *)pCtx->Input, PadLenInBytes);
-
- // add data-length field
- for (i=0; i<4; i++)
- {
- pCtx->Input[56+i] = (UCHAR)((pCtx->LenInBitCount[1] >> ((3-i) << 3)) & 0xff);
- pCtx->Input[60+i] = (UCHAR)((pCtx->LenInBitCount[0] >> ((3-i) << 3)) & 0xff);
- }
-
- byteReverse((UCHAR *)pCtx->Input, 16);
- NdisZeroMemory((UCHAR *)pCtx->Input + 64, 16);
- SHATransform(pCtx->Buf, (UINT32 *)pCtx->Input);
- } // end of else
-
-
- //Output, bytereverse
- for (i=0; i<20; i++)
- {
- Digest [i] = (UCHAR)(pCtx->Buf[i>>2] >> 8*(3-(i & 0x3)));
- }
-
- NdisZeroMemory(pCtx, sizeof(pCtx)); // memory free
-}
-
-
-// The central algorithm of SHA-1, consists of four rounds and
-// twenty steps per round
-VOID SHATransform(UINT32 Buf[5], UINT32 Mes[20])
-{
- UINT32 Reg[5],Temp;
- unsigned int i;
- UINT32 W[80];
-
- static UINT32 SHA1Table[4] = { 0x5a827999, 0x6ed9eba1,
- 0x8f1bbcdc, 0xca62c1d6 };
-
- Reg[0]=Buf[0];
- Reg[1]=Buf[1];
- Reg[2]=Buf[2];
- Reg[3]=Buf[3];
- Reg[4]=Buf[4];
-
- //the first octet of a word is stored in the 0th element, bytereverse
- for(i = 0; i < 16; i++)
- {
- W[i] = (Mes[i] >> 24) & 0xff;
- W[i] |= (Mes[i] >> 8 ) & 0xff00;
- W[i] |= (Mes[i] << 8 ) & 0xff0000;
- W[i] |= (Mes[i] << 24) & 0xff000000;
- }
-
-
- for (i = 0; i < 64; i++)
- W[16+i] = CYCLIC_LEFT_SHIFT(W[i] ^ W[2+i] ^ W[8+i] ^ W[13+i], 1);
-
-
- // 80 steps in SHA-1 algorithm
- for (i=0; i<80; i++)
- {
- if (i<20)
- SHA1Step(SHA1_F1, Reg[0], Reg[1], Reg[2], Reg[3], Reg[4],
- W[i], SHA1Table[0]);
-
- else if (i>=20 && i<40)
- SHA1Step(SHA1_F2, Reg[0], Reg[1], Reg[2], Reg[3], Reg[4],
- W[i], SHA1Table[1]);
-
- else if (i>=40 && i<60)
- SHA1Step(SHA1_F3, Reg[0], Reg[1], Reg[2], Reg[3], Reg[4],
- W[i], SHA1Table[2]);
-
- else
- SHA1Step(SHA1_F2, Reg[0], Reg[1], Reg[2], Reg[3], Reg[4],
- W[i], SHA1Table[3]);
-
-
- // one-word right shift
- Temp = Reg[4];
- Reg[4] = Reg[3];
- Reg[3] = Reg[2];
- Reg[2] = Reg[1];
- Reg[1] = Reg[0];
- Reg[0] = Temp;
-
- } // end of for-loop
-
-
- // (temporary)output
- for (i=0; i<5; i++)
- Buf[i] += Reg[i];
-
-}
-
-
-/* ========================= AES En/Decryption ========================== */
-
-/* forward S-box */
-static uint32 FSb[256] =
-{
- 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5,
- 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76,
- 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0,
- 0xAD, 0xD4, 0xA2, 0xA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74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A,
- 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E,
- 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E,
- 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94,
- 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF,
- 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68,
- 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16
-};
-
-/* forward table */
-#define FT \
-\
- V(C6,63,63,A5), V(F8,7C,7C,84), V(EE,77,77,99), V(F6,7B,7B,8D), \
- V(FF,F2,F2,0D), V(D6,6B,6B,BD), V(DE,6F,6F,B1), V(91,C5,C5,54), \
- V(60,30,30,50), V(02,01,01,03), V(CE,67,67,A9), V(56,2B,2B,7D), \
- V(E7,FE,FE,19), V(B5,D7,D7,62), V(4D,AB,AB,E6), V(EC,76,76,9A), \
- V(8F,CA,CA,45), V(1F,82,82,9D), V(89,C9,C9,40), V(FA,7D,7D,87), \
- V(EF,FA,FA,15), V(B2,59,59,EB), V(8E,47,47,C9), V(FB,F0,F0,0B), \
- V(41,AD,AD,EC), V(B3,D4,D4,67), V(5F,A2,A2,FD), V(45,AF,AF,EA), \
- V(23,9C,9C,BF), V(53,A4,A4,F7), V(E4,72,72,96), V(9B,C0,C0,5B), \
- V(75,B7,B7,C2), V(E1,FD,FD,1C), V(3D,93,93,AE), V(4C,26,26,6A), \
- V(6C,36,36,5A), V(7E,3F,3F,41), V(F5,F7,F7,02), V(83,CC,CC,4F), \
- V(68,34,34,5C), V(51,A5,A5,F4), V(D1,E5,E5,34), V(F9,F1,F1,08), \
- V(E2,71,71,93), V(AB,D8,D8,73), V(62,31,31,53), V(2A,15,15,3F), \
- V(08,04,04,0C), V(95,C7,C7,52), V(46,23,23,65), V(9D,C3,C3,5E), \
- V(30,18,18,28), V(37,96,96,A1), V(0A,05,05,0F), V(2F,9A,9A,B5), \
- V(0E,07,07,09), V(24,12,12,36), V(1B,80,80,9B), V(DF,E2,E2,3D), \
- V(CD,EB,EB,26), V(4E,27,27,69), V(7F,B2,B2,CD), V(EA,75,75,9F), \
- V(12,09,09,1B), V(1D,83,83,9E), V(58,2C,2C,74), V(34,1A,1A,2E), \
- V(36,1B,1B,2D), V(DC,6E,6E,B2), V(B4,5A,5A,EE), V(5B,A0,A0,FB), \
- V(A4,52,52,F6), V(76,3B,3B,4D), V(B7,D6,D6,61), V(7D,B3,B3,CE), \
- V(52,29,29,7B), V(DD,E3,E3,3E), V(5E,2F,2F,71), V(13,84,84,97), \
- V(A6,53,53,F5), V(B9,D1,D1,68), V(00,00,00,00), V(C1,ED,ED,2C), \
- V(40,20,20,60), V(E3,FC,FC,1F), V(79,B1,B1,C8), V(B6,5B,5B,ED), \
- V(D4,6A,6A,BE), V(8D,CB,CB,46), V(67,BE,BE,D9), V(72,39,39,4B), \
- V(94,4A,4A,DE), V(98,4C,4C,D4), V(B0,58,58,E8), V(85,CF,CF,4A), \
- V(BB,D0,D0,6B), V(C5,EF,EF,2A), V(4F,AA,AA,E5), V(ED,FB,FB,16), \
- V(86,43,43,C5), V(9A,4D,4D,D7), V(66,33,33,55), V(11,85,85,94), \
- V(8A,45,45,CF), V(E9,F9,F9,10), V(04,02,02,06), V(FE,7F,7F,81), \
- V(A0,50,50,F0), V(78,3C,3C,44), V(25,9F,9F,BA), V(4B,A8,A8,E3), \
- V(A2,51,51,F3), V(5D,A3,A3,FE), V(80,40,40,C0), V(05,8F,8F,8A), \
- V(3F,92,92,AD), V(21,9D,9D,BC), V(70,38,38,48), V(F1,F5,F5,04), \
- V(63,BC,BC,DF), V(77,B6,B6,C1), V(AF,DA,DA,75), V(42,21,21,63), \
- V(20,10,10,30), V(E5,FF,FF,1A), V(FD,F3,F3,0E), V(BF,D2,D2,6D), \
- V(81,CD,CD,4C), V(18,0C,0C,14), V(26,13,13,35), V(C3,EC,EC,2F), \
- V(BE,5F,5F,E1), V(35,97,97,A2), V(88,44,44,CC), V(2E,17,17,39), \
- V(93,C4,C4,57), V(55,A7,A7,F2), V(FC,7E,7E,82), V(7A,3D,3D,47), \
- V(C8,64,64,AC), V(BA,5D,5D,E7), V(32,19,19,2B), V(E6,73,73,95), \
- V(C0,60,60,A0), V(19,81,81,98), V(9E,4F,4F,D1), V(A3,DC,DC,7F), \
- V(44,22,22,66), V(54,2A,2A,7E), V(3B,90,90,AB), V(0B,88,88,83), \
- V(8C,46,46,CA), V(C7,EE,EE,29), V(6B,B8,B8,D3), V(28,14,14,3C), \
- V(A7,DE,DE,79), V(BC,5E,5E,E2), V(16,0B,0B,1D), V(AD,DB,DB,76), \
- V(DB,E0,E0,3B), V(64,32,32,56), V(74,3A,3A,4E), V(14,0A,0A,1E), \
- V(92,49,49,DB), V(0C,06,06,0A), V(48,24,24,6C), V(B8,5C,5C,E4), \
- V(9F,C2,C2,5D), V(BD,D3,D3,6E), V(43,AC,AC,EF), V(C4,62,62,A6), \
- V(39,91,91,A8), V(31,95,95,A4), V(D3,E4,E4,37), V(F2,79,79,8B), \
- V(D5,E7,E7,32), V(8B,C8,C8,43), V(6E,37,37,59), V(DA,6D,6D,B7), \
- V(01,8D,8D,8C), V(B1,D5,D5,64), V(9C,4E,4E,D2), V(49,A9,A9,E0), \
- V(D8,6C,6C,B4), V(AC,56,56,FA), V(F3,F4,F4,07), V(CF,EA,EA,25), \
- V(CA,65,65,AF), V(F4,7A,7A,8E), V(47,AE,AE,E9), V(10,08,08,18), \
- V(6F,BA,BA,D5), V(F0,78,78,88), V(4A,25,25,6F), V(5C,2E,2E,72), \
- V(38,1C,1C,24), V(57,A6,A6,F1), V(73,B4,B4,C7), V(97,C6,C6,51), \
- V(CB,E8,E8,23), V(A1,DD,DD,7C), V(E8,74,74,9C), V(3E,1F,1F,21), \
- V(96,4B,4B,DD), V(61,BD,BD,DC), V(0D,8B,8B,86), V(0F,8A,8A,85), \
- V(E0,70,70,90), V(7C,3E,3E,42), V(71,B5,B5,C4), V(CC,66,66,AA), \
- V(90,48,48,D8), V(06,03,03,05), V(F7,F6,F6,01), V(1C,0E,0E,12), \
- V(C2,61,61,A3), V(6A,35,35,5F), V(AE,57,57,F9), V(69,B9,B9,D0), \
- V(17,86,86,91), V(99,C1,C1,58), V(3A,1D,1D,27), V(27,9E,9E,B9), \
- V(D9,E1,E1,38), V(EB,F8,F8,13), V(2B,98,98,B3), V(22,11,11,33), \
- V(D2,69,69,BB), V(A9,D9,D9,70), V(07,8E,8E,89), V(33,94,94,A7), \
- V(2D,9B,9B,B6), V(3C,1E,1E,22), V(15,87,87,92), V(C9,E9,E9,20), \
- V(87,CE,CE,49), V(AA,55,55,FF), V(50,28,28,78), V(A5,DF,DF,7A), \
- V(03,8C,8C,8F), V(59,A1,A1,F8), V(09,89,89,80), V(1A,0D,0D,17), \
- V(65,BF,BF,DA), V(D7,E6,E6,31), V(84,42,42,C6), V(D0,68,68,B8), \
- V(82,41,41,C3), V(29,99,99,B0), V(5A,2D,2D,77), V(1E,0F,0F,11), \
- V(7B,B0,B0,CB), V(A8,54,54,FC), V(6D,BB,BB,D6), V(2C,16,16,3A)
-
-#define V(a,b,c,d) 0x##a##b##c##d
-static uint32 FT0[256] = { FT };
-#undef V
-
-#define V(a,b,c,d) 0x##d##a##b##c
-static uint32 FT1[256] = { FT };
-#undef V
-
-#define V(a,b,c,d) 0x##c##d##a##b
-static uint32 FT2[256] = { FT };
-#undef V
-
-#define V(a,b,c,d) 0x##b##c##d##a
-static uint32 FT3[256] = { FT };
-#undef V
-
-#undef FT
-
-/* reverse S-box */
-
-static uint32 RSb[256] =
-{
- 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38,
- 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB,
- 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87,
- 0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x31,
- 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F,
- 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D,
- 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF,
- 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0,
- 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61,
- 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26,
- 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D
-};
-
-/* reverse table */
-
-#define RT \
-\
- V(51,F4,A7,50), V(7E,41,65,53), V(1A,17,A4,C3), V(3A,27,5E,96), \
- V(3B,AB,6B,CB), V(1F,9D,45,F1), V(AC,FA,58,AB), V(4B,E3,03,93), \
- V(20,30,FA,55), V(AD,76,6D,F6), V(88,CC,76,91), V(F5,02,4C,25), \
- V(4F,E5,D7,FC), V(C5,2A,CB,D7), V(26,35,44,80), V(B5,62,A3,8F), \
- V(DE,B1,5A,49), V(25,BA,1B,67), V(45,EA,0E,98), V(5D,FE,C0,E1), \
- V(C3,2F,75,02), V(81,4C,F0,12), V(8D,46,97,A3), V(6B,D3,F9,C6), \
- V(03,8F,5F,E7), V(15,92,9C,95), V(BF,6D,7A,EB), V(95,52,59,DA), \
- V(D4,BE,83,2D), V(58,74,21,D3), V(49,E0,69,29), V(8E,C9,C8,44), \
- V(75,C2,89,6A), V(F4,8E,79,78), V(99,58,3E,6B), V(27,B9,71,DD), \
- V(BE,E1,4F,B6), V(F0,88,AD,17), V(C9,20,AC,66), V(7D,CE,3A,B4), \
- V(63,DF,4A,18), V(E5,1A,31,82), V(97,51,33,60), V(62,53,7F,45), \
- V(B1,64,77,E0), V(BB,6B,AE,84), V(FE,81,A0,1C), V(F9,08,2B,94), \
- V(70,48,68,58), V(8F,45,FD,19), V(94,DE,6C,87), V(52,7B,F8,B7), \
- V(AB,73,D3,23), V(72,4B,02,E2), V(E3,1F,8F,57), V(66,55,AB,2A), \
- V(B2,EB,28,07), V(2F,B5,C2,03), V(86,C5,7B,9A), V(D3,37,08,A5), \
- V(30,28,87,F2), V(23,BF,A5,B2), V(02,03,6A,BA), V(ED,16,82,5C), \
- V(8A,CF,1C,2B), V(A7,79,B4,92), V(F3,07,F2,F0), V(4E,69,E2,A1), \
- V(65,DA,F4,CD), V(06,05,BE,D5), V(D1,34,62,1F), V(C4,A6,FE,8A), \
- V(34,2E,53,9D), V(A2,F3,55,A0), V(05,8A,E1,32), V(A4,F6,EB,75), \
- V(0B,83,EC,39), V(40,60,EF,AA), V(5E,71,9F,06), V(BD,6E,10,51), \
- V(3E,21,8A,F9), V(96,DD,06,3D), V(DD,3E,05,AE), V(4D,E6,BD,46), \
- V(91,54,8D,B5), V(71,C4,5D,05), V(04,06,D4,6F), V(60,50,15,FF), \
- V(19,98,FB,24), V(D6,BD,E9,97), V(89,40,43,CC), V(67,D9,9E,77), \
- V(B0,E8,42,BD), V(07,89,8B,88), V(E7,19,5B,38), V(79,C8,EE,DB), \
- V(A1,7C,0A,47), V(7C,42,0F,E9), V(F8,84,1E,C9), V(00,00,00,00), \
- V(09,80,86,83), V(32,2B,ED,48), V(1E,11,70,AC), V(6C,5A,72,4E), \
- V(FD,0E,FF,FB), V(0F,85,38,56), V(3D,AE,D5,1E), V(36,2D,39,27), \
- V(0A,0F,D9,64), V(68,5C,A6,21), V(9B,5B,54,D1), V(24,36,2E,3A), \
- V(0C,0A,67,B1), V(93,57,E7,0F), V(B4,EE,96,D2), V(1B,9B,91,9E), \
- V(80,C0,C5,4F), V(61,DC,20,A2), V(5A,77,4B,69), V(1C,12,1A,16), \
- V(E2,93,BA,0A), V(C0,A0,2A,E5), V(3C,22,E0,43), V(12,1B,17,1D), \
- V(0E,09,0D,0B), V(F2,8B,C7,AD), V(2D,B6,A8,B9), V(14,1E,A9,C8), \
- V(57,F1,19,85), V(AF,75,07,4C), V(EE,99,DD,BB), V(A3,7F,60,FD), \
- V(F7,01,26,9F), V(5C,72,F5,BC), V(44,66,3B,C5), V(5B,FB,7E,34), \
- V(8B,43,29,76), V(CB,23,C6,DC), V(B6,ED,FC,68), V(B8,E4,F1,63), \
- V(D7,31,DC,CA), V(42,63,85,10), V(13,97,22,40), V(84,C6,11,20), \
- V(85,4A,24,7D), V(D2,BB,3D,F8), V(AE,F9,32,11), V(C7,29,A1,6D), \
- V(1D,9E,2F,4B), V(DC,B2,30,F3), V(0D,86,52,EC), V(77,C1,E3,D0), \
- V(2B,B3,16,6C), V(A9,70,B9,99), V(11,94,48,FA), V(47,E9,64,22), \
- V(A8,FC,8C,C4), V(A0,F0,3F,1A), V(56,7D,2C,D8), V(22,33,90,EF), \
- V(87,49,4E,C7), V(D9,38,D1,C1), V(8C,CA,A2,FE), V(98,D4,0B,36), \
- V(A6,F5,81,CF), V(A5,7A,DE,28), V(DA,B7,8E,26), V(3F,AD,BF,A4), \
- V(2C,3A,9D,E4), V(50,78,92,0D), V(6A,5F,CC,9B), V(54,7E,46,62), \
- V(F6,8D,13,C2), V(90,D8,B8,E8), V(2E,39,F7,5E), V(82,C3,AF,F5), \
- V(9F,5D,80,BE), V(69,D0,93,7C), V(6F,D5,2D,A9), V(CF,25,12,B3), \
- V(C8,AC,99,3B), V(10,18,7D,A7), V(E8,9C,63,6E), V(DB,3B,BB,7B), \
- V(CD,26,78,09), V(6E,59,18,F4), V(EC,9A,B7,01), V(83,4F,9A,A8), \
- V(E6,95,6E,65), V(AA,FF,E6,7E), V(21,BC,CF,08), V(EF,15,E8,E6), \
- V(BA,E7,9B,D9), V(4A,6F,36,CE), V(EA,9F,09,D4), V(29,B0,7C,D6), \
- V(31,A4,B2,AF), V(2A,3F,23,31), V(C6,A5,94,30), V(35,A2,66,C0), \
- V(74,4E,BC,37), V(FC,82,CA,A6), V(E0,90,D0,B0), V(33,A7,D8,15), \
- V(F1,04,98,4A), V(41,EC,DA,F7), V(7F,CD,50,0E), V(17,91,F6,2F), \
- V(76,4D,D6,8D), V(43,EF,B0,4D), V(CC,AA,4D,54), V(E4,96,04,DF), \
- V(9E,D1,B5,E3), V(4C,6A,88,1B), V(C1,2C,1F,B8), V(46,65,51,7F), \
- V(9D,5E,EA,04), V(01,8C,35,5D), V(FA,87,74,73), V(FB,0B,41,2E), \
- V(B3,67,1D,5A), V(92,DB,D2,52), V(E9,10,56,33), V(6D,D6,47,13), \
- V(9A,D7,61,8C), V(37,A1,0C,7A), V(59,F8,14,8E), V(EB,13,3C,89), \
- V(CE,A9,27,EE), V(B7,61,C9,35), V(E1,1C,E5,ED), V(7A,47,B1,3C), \
- V(9C,D2,DF,59), V(55,F2,73,3F), V(18,14,CE,79), V(73,C7,37,BF), \
- V(53,F7,CD,EA), V(5F,FD,AA,5B), V(DF,3D,6F,14), V(78,44,DB,86), \
- V(CA,AF,F3,81), V(B9,68,C4,3E), V(38,24,34,2C), V(C2,A3,40,5F), \
- V(16,1D,C3,72), V(BC,E2,25,0C), V(28,3C,49,8B), V(FF,0D,95,41), \
- V(39,A8,01,71), V(08,0C,B3,DE), V(D8,B4,E4,9C), V(64,56,C1,90), \
- V(7B,CB,84,61), V(D5,32,B6,70), V(48,6C,5C,74), V(D0,B8,57,42)
-
-#define V(a,b,c,d) 0x##a##b##c##d
-static uint32 RT0[256] = { RT };
-#undef V
-
-#define V(a,b,c,d) 0x##d##a##b##c
-static uint32 RT1[256] = { RT };
-#undef V
-
-#define V(a,b,c,d) 0x##c##d##a##b
-static uint32 RT2[256] = { RT };
-#undef V
-
-#define V(a,b,c,d) 0x##b##c##d##a
-static uint32 RT3[256] = { RT };
-#undef V
-
-#undef RT
-
-/* round constants */
-
-static uint32 RCON[10] =
-{
- 0x01000000, 0x02000000, 0x04000000, 0x08000000,
- 0x10000000, 0x20000000, 0x40000000, 0x80000000,
- 0x1B000000, 0x36000000
-};
-
-/* key schedule tables */
-
-static int KT_init = 1;
-
-static uint32 KT0[256];
-static uint32 KT1[256];
-static uint32 KT2[256];
-static uint32 KT3[256];
-
-/* platform-independant 32-bit integer manipulation macros */
-
-#define GET_UINT32(n,b,i) \
-{ \
- (n) = ( (uint32) (b)[(i) ] << 24 ) \
- | ( (uint32) (b)[(i) + 1] << 16 ) \
- | ( (uint32) (b)[(i) + 2] << 8 ) \
- | ( (uint32) (b)[(i) + 3] ); \
-}
-
-#define PUT_UINT32(n,b,i) \
-{ \
- (b)[(i) ] = (uint8) ( (n) >> 24 ); \
- (b)[(i) + 1] = (uint8) ( (n) >> 16 ); \
- (b)[(i) + 2] = (uint8) ( (n) >> 8 ); \
- (b)[(i) + 3] = (uint8) ( (n) ); \
-}
-
-/* AES key scheduling routine */
-
-int rtmp_aes_set_key( aes_context *ctx, uint8 *key, int nbits )
-{
- int i;
- uint32 *RK, *SK;
-
- switch( nbits )
- {
- case 128: ctx->nr = 10; break;
- case 192: ctx->nr = 12; break;
- case 256: ctx->nr = 14; break;
- default : return( 1 );
- }
-
- RK = ctx->erk;
-
- for( i = 0; i < (nbits >> 5); i++ )
- {
- GET_UINT32( RK[i], key, i * 4 );
- }
-
- /* setup encryption round keys */
-
- switch( nbits )
- {
- case 128:
-
- for( i = 0; i < 10; i++, RK += 4 )
- {
- RK[4] = RK[0] ^ RCON[i] ^
- ( FSb[ (uint8) ( RK[3] >> 16 ) ] << 24 ) ^
- ( FSb[ (uint8) ( RK[3] >> 8 ) ] << 16 ) ^
- ( FSb[ (uint8) ( RK[3] ) ] << 8 ) ^
- ( FSb[ (uint8) ( RK[3] >> 24 ) ] );
-
- RK[5] = RK[1] ^ RK[4];
- RK[6] = RK[2] ^ RK[5];
- RK[7] = RK[3] ^ RK[6];
- }
- break;
-
- case 192:
-
- for( i = 0; i < 8; i++, RK += 6 )
- {
- RK[6] = RK[0] ^ RCON[i] ^
- ( FSb[ (uint8) ( RK[5] >> 16 ) ] << 24 ) ^
- ( FSb[ (uint8) ( RK[5] >> 8 ) ] << 16 ) ^
- ( FSb[ (uint8) ( RK[5] ) ] << 8 ) ^
- ( FSb[ (uint8) ( RK[5] >> 24 ) ] );
-
- RK[7] = RK[1] ^ RK[6];
- RK[8] = RK[2] ^ RK[7];
- RK[9] = RK[3] ^ RK[8];
- RK[10] = RK[4] ^ RK[9];
- RK[11] = RK[5] ^ RK[10];
- }
- break;
-
- case 256:
-
- for( i = 0; i < 7; i++, RK += 8 )
- {
- RK[8] = RK[0] ^ RCON[i] ^
- ( FSb[ (uint8) ( RK[7] >> 16 ) ] << 24 ) ^
- ( FSb[ (uint8) ( RK[7] >> 8 ) ] << 16 ) ^
- ( FSb[ (uint8) ( RK[7] ) ] << 8 ) ^
- ( FSb[ (uint8) ( RK[7] >> 24 ) ] );
-
- RK[9] = RK[1] ^ RK[8];
- RK[10] = RK[2] ^ RK[9];
- RK[11] = RK[3] ^ RK[10];
-
- RK[12] = RK[4] ^
- ( FSb[ (uint8) ( RK[11] >> 24 ) ] << 24 ) ^
- ( FSb[ (uint8) ( RK[11] >> 16 ) ] << 16 ) ^
- ( FSb[ (uint8) ( RK[11] >> 8 ) ] << 8 ) ^
- ( FSb[ (uint8) ( RK[11] ) ] );
-
- RK[13] = RK[5] ^ RK[12];
- RK[14] = RK[6] ^ RK[13];
- RK[15] = RK[7] ^ RK[14];
- }
- break;
- }
-
- /* setup decryption round keys */
-
- if( KT_init )
- {
- for( i = 0; i < 256; i++ )
- {
- KT0[i] = RT0[ FSb[i] ];
- KT1[i] = RT1[ FSb[i] ];
- KT2[i] = RT2[ FSb[i] ];
- KT3[i] = RT3[ FSb[i] ];
- }
-
- KT_init = 0;
- }
-
- SK = ctx->drk;
-
- *SK++ = *RK++;
- *SK++ = *RK++;
- *SK++ = *RK++;
- *SK++ = *RK++;
-
- for( i = 1; i < ctx->nr; i++ )
- {
- RK -= 8;
-
- *SK++ = KT0[ (uint8) ( *RK >> 24 ) ] ^
- KT1[ (uint8) ( *RK >> 16 ) ] ^
- KT2[ (uint8) ( *RK >> 8 ) ] ^
- KT3[ (uint8) ( *RK ) ]; RK++;
-
- *SK++ = KT0[ (uint8) ( *RK >> 24 ) ] ^
- KT1[ (uint8) ( *RK >> 16 ) ] ^
- KT2[ (uint8) ( *RK >> 8 ) ] ^
- KT3[ (uint8) ( *RK ) ]; RK++;
-
- *SK++ = KT0[ (uint8) ( *RK >> 24 ) ] ^
- KT1[ (uint8) ( *RK >> 16 ) ] ^
- KT2[ (uint8) ( *RK >> 8 ) ] ^
- KT3[ (uint8) ( *RK ) ]; RK++;
-
- *SK++ = KT0[ (uint8) ( *RK >> 24 ) ] ^
- KT1[ (uint8) ( *RK >> 16 ) ] ^
- KT2[ (uint8) ( *RK >> 8 ) ] ^
- KT3[ (uint8) ( *RK ) ]; RK++;
- }
-
- RK -= 8;
-
- *SK++ = *RK++;
- *SK++ = *RK++;
- *SK++ = *RK++;
- *SK++ = *RK++;
-
- return( 0 );
-}
-
-/* AES 128-bit block encryption routine */
-
-void rtmp_aes_encrypt(aes_context *ctx, uint8 input[16], uint8 output[16] )
-{
- uint32 *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
-
- RK = ctx->erk;
- GET_UINT32( X0, input, 0 ); X0 ^= RK[0];
- GET_UINT32( X1, input, 4 ); X1 ^= RK[1];
- GET_UINT32( X2, input, 8 ); X2 ^= RK[2];
- GET_UINT32( X3, input, 12 ); X3 ^= RK[3];
-
-#define AES_FROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \
-{ \
- RK += 4; \
- \
- X0 = RK[0] ^ FT0[ (uint8) ( Y0 >> 24 ) ] ^ \
- FT1[ (uint8) ( Y1 >> 16 ) ] ^ \
- FT2[ (uint8) ( Y2 >> 8 ) ] ^ \
- FT3[ (uint8) ( Y3 ) ]; \
- \
- X1 = RK[1] ^ FT0[ (uint8) ( Y1 >> 24 ) ] ^ \
- FT1[ (uint8) ( Y2 >> 16 ) ] ^ \
- FT2[ (uint8) ( Y3 >> 8 ) ] ^ \
- FT3[ (uint8) ( Y0 ) ]; \
- \
- X2 = RK[2] ^ FT0[ (uint8) ( Y2 >> 24 ) ] ^ \
- FT1[ (uint8) ( Y3 >> 16 ) ] ^ \
- FT2[ (uint8) ( Y0 >> 8 ) ] ^ \
- FT3[ (uint8) ( Y1 ) ]; \
- \
- X3 = RK[3] ^ FT0[ (uint8) ( Y3 >> 24 ) ] ^ \
- FT1[ (uint8) ( Y0 >> 16 ) ] ^ \
- FT2[ (uint8) ( Y1 >> 8 ) ] ^ \
- FT3[ (uint8) ( Y2 ) ]; \
-}
-
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 1 */
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 2 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 3 */
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 4 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 5 */
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 6 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 7 */
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 8 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 9 */
-
- if( ctx->nr > 10 )
- {
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 10 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 11 */
- }
-
- if( ctx->nr > 12 )
- {
- AES_FROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 12 */
- AES_FROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 13 */
- }
-
- /* last round */
-
- RK += 4;
-
- X0 = RK[0] ^ ( FSb[ (uint8) ( Y0 >> 24 ) ] << 24 ) ^
- ( FSb[ (uint8) ( Y1 >> 16 ) ] << 16 ) ^
- ( FSb[ (uint8) ( Y2 >> 8 ) ] << 8 ) ^
- ( FSb[ (uint8) ( Y3 ) ] );
-
- X1 = RK[1] ^ ( FSb[ (uint8) ( Y1 >> 24 ) ] << 24 ) ^
- ( FSb[ (uint8) ( Y2 >> 16 ) ] << 16 ) ^
- ( FSb[ (uint8) ( Y3 >> 8 ) ] << 8 ) ^
- ( FSb[ (uint8) ( Y0 ) ] );
-
- X2 = RK[2] ^ ( FSb[ (uint8) ( Y2 >> 24 ) ] << 24 ) ^
- ( FSb[ (uint8) ( Y3 >> 16 ) ] << 16 ) ^
- ( FSb[ (uint8) ( Y0 >> 8 ) ] << 8 ) ^
- ( FSb[ (uint8) ( Y1 ) ] );
-
- X3 = RK[3] ^ ( FSb[ (uint8) ( Y3 >> 24 ) ] << 24 ) ^
- ( FSb[ (uint8) ( Y0 >> 16 ) ] << 16 ) ^
- ( FSb[ (uint8) ( Y1 >> 8 ) ] << 8 ) ^
- ( FSb[ (uint8) ( Y2 ) ] );
-
- PUT_UINT32( X0, output, 0 );
- PUT_UINT32( X1, output, 4 );
- PUT_UINT32( X2, output, 8 );
- PUT_UINT32( X3, output, 12 );
-}
-
-/* AES 128-bit block decryption routine */
-
-void rtmp_aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] )
-{
- uint32 *RK, X0, X1, X2, X3, Y0, Y1, Y2, Y3;
-
- RK = ctx->drk;
-
- GET_UINT32( X0, input, 0 ); X0 ^= RK[0];
- GET_UINT32( X1, input, 4 ); X1 ^= RK[1];
- GET_UINT32( X2, input, 8 ); X2 ^= RK[2];
- GET_UINT32( X3, input, 12 ); X3 ^= RK[3];
-
-#define AES_RROUND(X0,X1,X2,X3,Y0,Y1,Y2,Y3) \
-{ \
- RK += 4; \
- \
- X0 = RK[0] ^ RT0[ (uint8) ( Y0 >> 24 ) ] ^ \
- RT1[ (uint8) ( Y3 >> 16 ) ] ^ \
- RT2[ (uint8) ( Y2 >> 8 ) ] ^ \
- RT3[ (uint8) ( Y1 ) ]; \
- \
- X1 = RK[1] ^ RT0[ (uint8) ( Y1 >> 24 ) ] ^ \
- RT1[ (uint8) ( Y0 >> 16 ) ] ^ \
- RT2[ (uint8) ( Y3 >> 8 ) ] ^ \
- RT3[ (uint8) ( Y2 ) ]; \
- \
- X2 = RK[2] ^ RT0[ (uint8) ( Y2 >> 24 ) ] ^ \
- RT1[ (uint8) ( Y1 >> 16 ) ] ^ \
- RT2[ (uint8) ( Y0 >> 8 ) ] ^ \
- RT3[ (uint8) ( Y3 ) ]; \
- \
- X3 = RK[3] ^ RT0[ (uint8) ( Y3 >> 24 ) ] ^ \
- RT1[ (uint8) ( Y2 >> 16 ) ] ^ \
- RT2[ (uint8) ( Y1 >> 8 ) ] ^ \
- RT3[ (uint8) ( Y0 ) ]; \
-}
-
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 1 */
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 2 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 3 */
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 4 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 5 */
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 6 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 7 */
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 8 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 9 */
-
- if( ctx->nr > 10 )
- {
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 10 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 11 */
- }
-
- if( ctx->nr > 12 )
- {
- AES_RROUND( X0, X1, X2, X3, Y0, Y1, Y2, Y3 ); /* round 12 */
- AES_RROUND( Y0, Y1, Y2, Y3, X0, X1, X2, X3 ); /* round 13 */
- }
-
- /* last round */
-
- RK += 4;
-
- X0 = RK[0] ^ ( RSb[ (uint8) ( Y0 >> 24 ) ] << 24 ) ^
- ( RSb[ (uint8) ( Y3 >> 16 ) ] << 16 ) ^
- ( RSb[ (uint8) ( Y2 >> 8 ) ] << 8 ) ^
- ( RSb[ (uint8) ( Y1 ) ] );
-
- X1 = RK[1] ^ ( RSb[ (uint8) ( Y1 >> 24 ) ] << 24 ) ^
- ( RSb[ (uint8) ( Y0 >> 16 ) ] << 16 ) ^
- ( RSb[ (uint8) ( Y3 >> 8 ) ] << 8 ) ^
- ( RSb[ (uint8) ( Y2 ) ] );
-
- X2 = RK[2] ^ ( RSb[ (uint8) ( Y2 >> 24 ) ] << 24 ) ^
- ( RSb[ (uint8) ( Y1 >> 16 ) ] << 16 ) ^
- ( RSb[ (uint8) ( Y0 >> 8 ) ] << 8 ) ^
- ( RSb[ (uint8) ( Y3 ) ] );
-
- X3 = RK[3] ^ ( RSb[ (uint8) ( Y3 >> 24 ) ] << 24 ) ^
- ( RSb[ (uint8) ( Y2 >> 16 ) ] << 16 ) ^
- ( RSb[ (uint8) ( Y1 >> 8 ) ] << 8 ) ^
- ( RSb[ (uint8) ( Y0 ) ] );
-
- PUT_UINT32( X0, output, 0 );
- PUT_UINT32( X1, output, 4 );
- PUT_UINT32( X2, output, 8 );
- PUT_UINT32( X3, output, 12 );
-}
-
-/*
- ========================================================================
-
- Routine Description:
- SHA1 function
-
- Arguments:
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-VOID HMAC_SHA1(
- IN UCHAR *text,
- IN UINT text_len,
- IN UCHAR *key,
- IN UINT key_len,
- IN UCHAR *digest)
-{
- SHA_CTX context;
- UCHAR k_ipad[65]; /* inner padding - key XORd with ipad */
- UCHAR k_opad[65]; /* outer padding - key XORd with opad */
- INT i;
-
- // if key is longer than 64 bytes reset it to key=SHA1(key)
- if (key_len > 64)
- {
- SHA_CTX tctx;
- SHAInit(&tctx);
- SHAUpdate(&tctx, key, key_len);
- SHAFinal(&tctx, key);
- key_len = 20;
- }
- NdisZeroMemory(k_ipad, sizeof(k_ipad));
- NdisZeroMemory(k_opad, sizeof(k_opad));
- NdisMoveMemory(k_ipad, key, key_len);
- NdisMoveMemory(k_opad, key, key_len);
-
- // XOR key with ipad and opad values
- for (i = 0; i < 64; i++)
- {
- k_ipad[i] ^= 0x36;
- k_opad[i] ^= 0x5c;
- }
-
- // perform inner SHA1
- SHAInit(&context); /* init context for 1st pass */
- SHAUpdate(&context, k_ipad, 64); /* start with inner pad */
- SHAUpdate(&context, text, text_len); /* then text of datagram */
- SHAFinal(&context, digest); /* finish up 1st pass */
-
- //perform outer SHA1
- SHAInit(&context); /* init context for 2nd pass */
- SHAUpdate(&context, k_opad, 64); /* start with outer pad */
- SHAUpdate(&context, digest, 20); /* then results of 1st hash */
- SHAFinal(&context, digest); /* finish up 2nd pass */
-
-}
-
-/*
-* F(P, S, c, i) = U1 xor U2 xor ... Uc
-* U1 = PRF(P, S || Int(i))
-* U2 = PRF(P, U1)
-* Uc = PRF(P, Uc-1)
-*/
-
-void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output)
-{
- unsigned char digest[36], digest1[SHA_DIGEST_LEN];
- int i, j;
-
- /* U1 = PRF(P, S || int(i)) */
- memcpy(digest, ssid, ssidlength);
- digest[ssidlength] = (unsigned char)((count>>24) & 0xff);
- digest[ssidlength+1] = (unsigned char)((count>>16) & 0xff);
- digest[ssidlength+2] = (unsigned char)((count>>8) & 0xff);
- digest[ssidlength+3] = (unsigned char)(count & 0xff);
- HMAC_SHA1(digest, ssidlength+4, (unsigned char*) password, (int) strlen(password), digest1); // for WPA update
-
- /* output = U1 */
- memcpy(output, digest1, SHA_DIGEST_LEN);
-
- for (i = 1; i < iterations; i++)
- {
- /* Un = PRF(P, Un-1) */
- HMAC_SHA1(digest1, SHA_DIGEST_LEN, (unsigned char*) password, (int) strlen(password), digest); // for WPA update
- memcpy(digest1, digest, SHA_DIGEST_LEN);
-
- /* output = output xor Un */
- for (j = 0; j < SHA_DIGEST_LEN; j++)
- {
- output[j] ^= digest[j];
- }
- }
-}
-/*
-* password - ascii string up to 63 characters in length
-* ssid - octet string up to 32 octets
-* ssidlength - length of ssid in octets
-* output must be 40 octets in length and outputs 256 bits of key
-*/
-int PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output)
-{
- if ((strlen(password) > 63) || (ssidlength > 32))
- return 0;
-
- F(password, ssid, ssidlength, 4096, 1, output);
- F(password, ssid, ssidlength, 4096, 2, &output[SHA_DIGEST_LEN]);
- return 1;
-}
-
-
diff --git a/drivers/staging/rt2860/common/mlme.c b/drivers/staging/rt2860/common/mlme.c
index 61a2a4eb7140..7647c090c349 100644
--- a/drivers/staging/rt2860/common/mlme.c
+++ b/drivers/staging/rt2860/common/mlme.c
@@ -127,46 +127,54 @@ UCHAR RateSwitchTable11G[] = {
UCHAR RateSwitchTable11N1S[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x09, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30, 101,
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x21, 5, 10, 25,
- 0x06, 0x21, 6, 8, 14,
- 0x07, 0x21, 7, 8, 14,
- 0x08, 0x23, 7, 8, 14,
+ 0x0c, 0x0a, 0, 0, 0, // Initial used item after association
+ 0x00, 0x00, 0, 40, 101,
+ 0x01, 0x00, 1, 40, 50,
+ 0x02, 0x00, 2, 25, 45,
+ 0x03, 0x21, 0, 20, 35,
+ 0x04, 0x21, 1, 20, 35,
+ 0x05, 0x21, 2, 20, 35,
+ 0x06, 0x21, 3, 15, 35,
+ 0x07, 0x21, 4, 15, 30,
+ 0x08, 0x21, 5, 10, 25,
+ 0x09, 0x21, 6, 8, 14,
+ 0x0a, 0x21, 7, 8, 14,
+ 0x0b, 0x23, 7, 8, 14,
};
UCHAR RateSwitchTable11N2S[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0a, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30, 101,
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x20, 12, 15, 30,
- 0x06, 0x20, 13, 8, 20,
- 0x07, 0x20, 14, 8, 20,
- 0x08, 0x20, 15, 8, 25,
- 0x09, 0x22, 15, 8, 25,
+ 0x0e, 0x0c, 0, 0, 0, // Initial used item after association
+ 0x00, 0x00, 0, 40, 101,
+ 0x01, 0x00, 1, 40, 50,
+ 0x02, 0x00, 2, 25, 45,
+ 0x03, 0x21, 0, 20, 35,
+ 0x04, 0x21, 1, 20, 35,
+ 0x05, 0x21, 2, 20, 35,
+ 0x06, 0x21, 3, 15, 35,
+ 0x07, 0x21, 4, 15, 30,
+ 0x08, 0x20, 11, 15, 30,
+ 0x09, 0x20, 12, 15, 30,
+ 0x0a, 0x20, 13, 8, 20,
+ 0x0b, 0x20, 14, 8, 20,
+ 0x0c, 0x20, 15, 8, 25,
+ 0x0d, 0x22, 15, 8, 15,
};
UCHAR RateSwitchTable11N3S[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0a, 0x00, 0, 0, 0, // Initial used item after association
+ 0x0b, 0x00, 0, 0, 0, // 0x0a, 0x00, 0, 0, 0, // Initial used item after association
0x00, 0x21, 0, 30, 101,
0x01, 0x21, 1, 20, 50,
0x02, 0x21, 2, 20, 50,
0x03, 0x21, 3, 15, 50,
0x04, 0x21, 4, 15, 30,
- 0x05, 0x20, 12, 15, 30,
- 0x06, 0x20, 13, 8, 20,
- 0x07, 0x20, 14, 8, 20,
- 0x08, 0x20, 15, 8, 25,
- 0x09, 0x22, 15, 8, 25,
+ 0x05, 0x20, 11, 15, 30, // Required by System-Alan @ 20080812
+ 0x06, 0x20, 12, 15, 30, // 0x05, 0x20, 12, 15, 30,
+ 0x07, 0x20, 13, 8, 20, // 0x06, 0x20, 13, 8, 20,
+ 0x08, 0x20, 14, 8, 20, // 0x07, 0x20, 14, 8, 20,
+ 0x09, 0x20, 15, 8, 25, // 0x08, 0x20, 15, 8, 25,
+ 0x0a, 0x22, 15, 8, 25, // 0x09, 0x22, 15, 8, 25,
};
UCHAR RateSwitchTable11N2SForABand[] = {
@@ -203,35 +211,38 @@ UCHAR RateSwitchTable11N3SForABand[] = { // 3*3
UCHAR RateSwitchTable11BGN1S[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0d, 0x00, 0, 0, 0, // Initial used item after association
+ 0x0c, 0x0a, 0, 0, 0, // Initial used item after association
0x00, 0x00, 0, 40, 101,
0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 35, 45,
- 0x03, 0x00, 3, 20, 45,
- 0x04, 0x21, 0, 30,101, //50
- 0x05, 0x21, 1, 20, 50,
- 0x06, 0x21, 2, 20, 50,
- 0x07, 0x21, 3, 15, 50,
- 0x08, 0x21, 4, 15, 30,
- 0x09, 0x21, 5, 10, 25,
- 0x0a, 0x21, 6, 8, 14,
- 0x0b, 0x21, 7, 8, 14,
- 0x0c, 0x23, 7, 8, 14,
+ 0x02, 0x00, 2, 25, 45,
+ 0x03, 0x21, 0, 20, 35,
+ 0x04, 0x21, 1, 20, 35,
+ 0x05, 0x21, 2, 20, 35,
+ 0x06, 0x21, 3, 15, 35,
+ 0x07, 0x21, 4, 15, 30,
+ 0x08, 0x21, 5, 10, 25,
+ 0x09, 0x21, 6, 8, 14,
+ 0x0a, 0x21, 7, 8, 14,
+ 0x0b, 0x23, 7, 8, 14,
};
UCHAR RateSwitchTable11BGN2S[] = {
// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0a, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30,101, //50
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x20, 12, 15, 30,
- 0x06, 0x20, 13, 8, 20,
- 0x07, 0x20, 14, 8, 20,
- 0x08, 0x20, 15, 8, 25,
- 0x09, 0x22, 15, 8, 25,
+ 0x0e, 0x0c, 0, 0, 0, // Initial used item after association
+ 0x00, 0x00, 0, 40, 101,
+ 0x01, 0x00, 1, 40, 50,
+ 0x02, 0x00, 2, 25, 45,
+ 0x03, 0x21, 0, 20, 35,
+ 0x04, 0x21, 1, 20, 35,
+ 0x05, 0x21, 2, 20, 35,
+ 0x06, 0x21, 3, 15, 35,
+ 0x07, 0x21, 4, 15, 30,
+ 0x08, 0x20, 11, 15, 30,
+ 0x09, 0x20, 12, 15, 30,
+ 0x0a, 0x20, 13, 8, 20,
+ 0x0b, 0x20, 14, 8, 20,
+ 0x0c, 0x20, 15, 8, 25,
+ 0x0d, 0x22, 15, 8, 15,
};
UCHAR RateSwitchTable11BGN3S[] = { // 3*3
@@ -282,27 +293,6 @@ UCHAR RateSwitchTable11BGN3SForABand[] = { // 3*3
0x0b, 0x22, 23, 8, 25,
};
-PUCHAR ReasonString[] = {
- /* 0 */ "Reserved",
- /* 1 */ "Unspecified Reason",
- /* 2 */ "Previous Auth no longer valid",
- /* 3 */ "STA is leaving / has left",
- /* 4 */ "DIS-ASSOC due to inactivity",
- /* 5 */ "AP unable to hanle all associations",
- /* 6 */ "class 2 error",
- /* 7 */ "class 3 error",
- /* 8 */ "STA is leaving / has left",
- /* 9 */ "require auth before assoc/re-assoc",
- /* 10 */ "Reserved",
- /* 11 */ "Reserved",
- /* 12 */ "Reserved",
- /* 13 */ "invalid IE",
- /* 14 */ "MIC error",
- /* 15 */ "4-way handshake timeout",
- /* 16 */ "2-way (group key) handshake timeout",
- /* 17 */ "4-way handshake IE diff among AssosReq/Rsp/Beacon",
- /* 18 */
-};
extern UCHAR OfdmRateToRxwiMCS[];
// since RT61 has better RX sensibility, we have to limit TX ACK rate not to exceed our normal data TX rate.
@@ -311,7 +301,6 @@ ULONG BasicRateMask[12] = {0xfffff001 /* 1-Mbps */, 0xfffff003 /* 2 Mbps */,
0xfffff01f /* 6 */ , 0xfffff03f /* 9 */ , 0xfffff07f /* 12 */ , 0xfffff0ff /* 18 */,
0xfffff1ff /* 24 */ , 0xfffff3ff /* 36 */ , 0xfffff7ff /* 48 */ , 0xffffffff /* 54 */};
-UCHAR MULTICAST_ADDR[MAC_ADDR_LEN] = {0x1, 0x00, 0x00, 0x00, 0x00, 0x00};
UCHAR BROADCAST_ADDR[MAC_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
@@ -336,7 +325,6 @@ UCHAR TimIe = IE_TIM;
UCHAR WpaIe = IE_WPA;
UCHAR Wpa2Ie = IE_WPA2;
UCHAR IbssIe = IE_IBSS_PARM;
-UCHAR Ccx2Ie = IE_CCX_V2;
extern UCHAR WPA_OUI[];
@@ -345,107 +333,6 @@ UCHAR SES_OUI[] = {0x00, 0x90, 0x4c};
UCHAR ZeroSsid[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
-// Reset the RFIC setting to new series
-RTMP_RF_REGS RF2850RegTable[] = {
-// ch R1 R2 R3(TX0~4=0) R4
- {1, 0x98402ecc, 0x984c0786, 0x9816b455, 0x9800510b},
- {2, 0x98402ecc, 0x984c0786, 0x98168a55, 0x9800519f},
- {3, 0x98402ecc, 0x984c078a, 0x98168a55, 0x9800518b},
- {4, 0x98402ecc, 0x984c078a, 0x98168a55, 0x9800519f},
- {5, 0x98402ecc, 0x984c078e, 0x98168a55, 0x9800518b},
- {6, 0x98402ecc, 0x984c078e, 0x98168a55, 0x9800519f},
- {7, 0x98402ecc, 0x984c0792, 0x98168a55, 0x9800518b},
- {8, 0x98402ecc, 0x984c0792, 0x98168a55, 0x9800519f},
- {9, 0x98402ecc, 0x984c0796, 0x98168a55, 0x9800518b},
- {10, 0x98402ecc, 0x984c0796, 0x98168a55, 0x9800519f},
- {11, 0x98402ecc, 0x984c079a, 0x98168a55, 0x9800518b},
- {12, 0x98402ecc, 0x984c079a, 0x98168a55, 0x9800519f},
- {13, 0x98402ecc, 0x984c079e, 0x98168a55, 0x9800518b},
- {14, 0x98402ecc, 0x984c07a2, 0x98168a55, 0x98005193},
-
- // 802.11 UNI / HyperLan 2
- {36, 0x98402ecc, 0x984c099a, 0x98158a55, 0x980ed1a3},
- {38, 0x98402ecc, 0x984c099e, 0x98158a55, 0x980ed193},
- {40, 0x98402ec8, 0x984c0682, 0x98158a55, 0x980ed183},
- {44, 0x98402ec8, 0x984c0682, 0x98158a55, 0x980ed1a3},
- {46, 0x98402ec8, 0x984c0686, 0x98158a55, 0x980ed18b},
- {48, 0x98402ec8, 0x984c0686, 0x98158a55, 0x980ed19b},
- {52, 0x98402ec8, 0x984c068a, 0x98158a55, 0x980ed193},
- {54, 0x98402ec8, 0x984c068a, 0x98158a55, 0x980ed1a3},
- {56, 0x98402ec8, 0x984c068e, 0x98158a55, 0x980ed18b},
- {60, 0x98402ec8, 0x984c0692, 0x98158a55, 0x980ed183},
- {62, 0x98402ec8, 0x984c0692, 0x98158a55, 0x980ed193},
- {64, 0x98402ec8, 0x984c0692, 0x98158a55, 0x980ed1a3}, // Plugfest#4, Day4, change RFR3 left4th 9->5.
-
- // 802.11 HyperLan 2
- {100, 0x98402ec8, 0x984c06b2, 0x98178a55, 0x980ed783},
-
- // 2008.04.30 modified
- // The system team has AN to improve the EVM value
- // for channel 102 to 108 for the RT2850/RT2750 dual band solution.
- {102, 0x98402ec8, 0x985c06b2, 0x98578a55, 0x980ed793},
- {104, 0x98402ec8, 0x985c06b2, 0x98578a55, 0x980ed1a3},
- {108, 0x98402ecc, 0x985c0a32, 0x98578a55, 0x980ed193},
-
- {110, 0x98402ecc, 0x984c0a36, 0x98178a55, 0x980ed183},
- {112, 0x98402ecc, 0x984c0a36, 0x98178a55, 0x980ed19b},
- {116, 0x98402ecc, 0x984c0a3a, 0x98178a55, 0x980ed1a3},
- {118, 0x98402ecc, 0x984c0a3e, 0x98178a55, 0x980ed193},
- {120, 0x98402ec4, 0x984c0382, 0x98178a55, 0x980ed183},
- {124, 0x98402ec4, 0x984c0382, 0x98178a55, 0x980ed193},
- {126, 0x98402ec4, 0x984c0382, 0x98178a55, 0x980ed15b}, // 0x980ed1bb->0x980ed15b required by Rory 20070927
- {128, 0x98402ec4, 0x984c0382, 0x98178a55, 0x980ed1a3},
- {132, 0x98402ec4, 0x984c0386, 0x98178a55, 0x980ed18b},
- {134, 0x98402ec4, 0x984c0386, 0x98178a55, 0x980ed193},
- {136, 0x98402ec4, 0x984c0386, 0x98178a55, 0x980ed19b},
- {140, 0x98402ec4, 0x984c038a, 0x98178a55, 0x980ed183},
-
- // 802.11 UNII
- {149, 0x98402ec4, 0x984c038a, 0x98178a55, 0x980ed1a7},
- {151, 0x98402ec4, 0x984c038e, 0x98178a55, 0x980ed187},
- {153, 0x98402ec4, 0x984c038e, 0x98178a55, 0x980ed18f},
- {157, 0x98402ec4, 0x984c038e, 0x98178a55, 0x980ed19f},
- {159, 0x98402ec4, 0x984c038e, 0x98178a55, 0x980ed1a7},
- {161, 0x98402ec4, 0x984c0392, 0x98178a55, 0x980ed187},
- {165, 0x98402ec4, 0x984c0392, 0x98178a55, 0x980ed197},
-
- // Japan
- {184, 0x95002ccc, 0x9500491e, 0x9509be55, 0x950c0a0b},
- {188, 0x95002ccc, 0x95004922, 0x9509be55, 0x950c0a13},
- {192, 0x95002ccc, 0x95004926, 0x9509be55, 0x950c0a1b},
- {196, 0x95002ccc, 0x9500492a, 0x9509be55, 0x950c0a23},
- {208, 0x95002ccc, 0x9500493a, 0x9509be55, 0x950c0a13},
- {212, 0x95002ccc, 0x9500493e, 0x9509be55, 0x950c0a1b},
- {216, 0x95002ccc, 0x95004982, 0x9509be55, 0x950c0a23},
-
- // still lack of MMAC(Japan) ch 34,38,42,46
-};
-UCHAR NUM_OF_2850_CHNL = (sizeof(RF2850RegTable) / sizeof(RTMP_RF_REGS));
-
-FREQUENCY_ITEM FreqItems3020[] =
-{
- /**************************************************/
- // ISM : 2.4 to 2.483 GHz //
- /**************************************************/
- // 11g
- /**************************************************/
- //-CH---N-------R---K-----------
- {1, 241, 2, 2},
- {2, 241, 2, 7},
- {3, 242, 2, 2},
- {4, 242, 2, 7},
- {5, 243, 2, 2},
- {6, 243, 2, 7},
- {7, 244, 2, 2},
- {8, 244, 2, 7},
- {9, 245, 2, 2},
- {10, 245, 2, 7},
- {11, 246, 2, 2},
- {12, 246, 2, 7},
- {13, 247, 2, 2},
- {14, 248, 2, 4},
-};
-UCHAR NUM_OF_3020_CHNL=(sizeof(FreqItems3020) / sizeof(FREQUENCY_ITEM));
/*
==========================================================================
@@ -484,14 +371,19 @@ NDIS_STATUS MlmeInit(
AuthStateMachineInit(pAd, &pAd->Mlme.AuthMachine, pAd->Mlme.AuthFunc);
AuthRspStateMachineInit(pAd, &pAd->Mlme.AuthRspMachine, pAd->Mlme.AuthRspFunc);
SyncStateMachineInit(pAd, &pAd->Mlme.SyncMachine, pAd->Mlme.SyncFunc);
- WpaPskStateMachineInit(pAd, &pAd->Mlme.WpaPskMachine, pAd->Mlme.WpaPskFunc);
- AironetStateMachineInit(pAd, &pAd->Mlme.AironetMachine, pAd->Mlme.AironetFunc);
+
+
+
// Since we are using switch/case to implement it, the init is different from the above
// state machine init
MlmeCntlInit(pAd, &pAd->Mlme.CntlMachine, NULL);
}
+
+ WpaStateMachineInit(pAd, &pAd->Mlme.WpaMachine, pAd->Mlme.WpaFunc);
+
+
ActionStateMachineInit(pAd, &pAd->Mlme.ActMachine, pAd->Mlme.ActFunc);
// Init mlme periodic timer
@@ -503,16 +395,24 @@ NDIS_STATUS MlmeInit(
// software-based RX Antenna diversity
RTMPInitTimer(pAd, &pAd->Mlme.RxAntEvalTimer, GET_TIMER_FUNCTION(AsicRxAntEvalTimeout), pAd, FALSE);
-#ifdef RT2860
{
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+#ifdef RTMP_PCI_SUPPORT
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
// only PCIe cards need these two timers
RTMPInitTimer(pAd, &pAd->Mlme.PsPollTimer, GET_TIMER_FUNCTION(PsPollWakeExec), pAd, FALSE);
RTMPInitTimer(pAd, &pAd->Mlme.RadioOnOffTimer, GET_TIMER_FUNCTION(RadioOnExec), pAd, FALSE);
}
+#endif // RTMP_PCI_SUPPORT //
+
+ RTMPInitTimer(pAd, &pAd->Mlme.LinkDownTimer, GET_TIMER_FUNCTION(LinkDownExec), pAd, FALSE);
+
+#ifdef RTMP_MAC_USB
+ RTMPInitTimer(pAd, &pAd->Mlme.AutoWakeupTimer, GET_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout), pAd, FALSE);
+ pAd->Mlme.AutoWakeupTimerRunning = FALSE;
+#endif // RTMP_MAC_USB //
}
-#endif
+
} while (FALSE);
DBGPRINT(RT_DEBUG_TRACE, ("<-- MLME Initialize\n"));
@@ -567,7 +467,7 @@ VOID MlmeHandler(
//From message type, determine which state machine I should drive
if (MlmeDequeue(&pAd->Mlme.Queue, &Elem))
{
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
if (Elem->MsgType == MT2_RESET_CONF)
{
DBGPRINT_RAW(RT_DEBUG_TRACE, ("!!! reset MLME state machine !!!\n"));
@@ -576,7 +476,7 @@ VOID MlmeHandler(
Elem->MsgLen = 0;
continue;
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// if dequeue success
switch (Elem->Machine)
@@ -600,14 +500,16 @@ VOID MlmeHandler(
case WPA_PSK_STATE_MACHINE:
StateMachinePerformAction(pAd, &pAd->Mlme.WpaPskMachine, Elem);
break;
- case AIRONET_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.AironetMachine, Elem);
- break;
+
+
+
case ACTION_STATE_MACHINE:
StateMachinePerformAction(pAd, &pAd->Mlme.ActMachine, Elem);
break;
-
+ case WPA_STATE_MACHINE:
+ StateMachinePerformAction(pAd, &pAd->Mlme.WpaMachine, Elem);
+ break;
default:
@@ -647,9 +549,6 @@ VOID MlmeHalt(
IN PRTMP_ADAPTER pAd)
{
BOOLEAN Cancelled;
-#ifdef RT3070
- UINT32 TxPinCfg = 0x00050F0F;
-#endif // RT3070 //
DBGPRINT(RT_DEBUG_TRACE, ("==> MlmeHalt\n"));
@@ -667,13 +566,22 @@ VOID MlmeHalt(
RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+
+
+#ifdef RTMP_MAC_PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
+ &&(pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
{
RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
}
-#endif
+#endif // RTMP_MAC_PCI //
+
+ RTMPCancelTimer(&pAd->Mlme.LinkDownTimer, &Cancelled);
+
+#ifdef RTMP_MAC_USB
+ RTMPCancelTimer(&pAd->Mlme.AutoWakeupTimer, &Cancelled);
+#endif // RTMP_MAC_USB //
}
RTMPCancelTimer(&pAd->Mlme.PeriodicTimer, &Cancelled);
@@ -683,10 +591,12 @@ VOID MlmeHalt(
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
{
+ RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
+
// Set LED
RTMPSetLED(pAd, LED_HALT);
RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, firmware is not done it.
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
{
LED_CFG_STRUC LedCfg;
RTMP_IO_READ32(pAd, LED_CFG, &LedCfg.word);
@@ -696,17 +606,10 @@ VOID MlmeHalt(
LedCfg.field.YLedMode = 0;
RTMP_IO_WRITE32(pAd, LED_CFG, LedCfg.word);
}
-#endif // RT2870 //
-#ifdef RT3070
- //
- // Turn off LNA_PE
- //
- if (IS_RT3070(pAd) || IS_RT3071(pAd))
- {
- TxPinCfg &= 0xFFFFF0F0;
- RTUSBWriteMACRegister(pAd, TX_PIN_CFG, TxPinCfg);
- }
-#endif // RT3070 //
+#endif // RTMP_MAC_USB //
+
+ if (pChipOps->AsicHaltAction)
+ pChipOps->AsicHaltAction(pAd);
}
RTMPusecDelay(5000); // 5 msec to gurantee Ant Diversity timer canceled
@@ -730,6 +633,8 @@ VOID MlmeResetRalinkCounters(
pAd->RalinkCounters.OneSecTxNoRetryOkCount = 0;
pAd->RalinkCounters.OneSecTxRetryOkCount = 0;
pAd->RalinkCounters.OneSecRxOkDataCnt = 0;
+ pAd->RalinkCounters.OneSecReceivedByteCount = 0;
+ pAd->RalinkCounters.OneSecTransmittedByteCount = 0;
// TODO: for debug only. to be removed
pAd->RalinkCounters.OneSecOsTxCount[QID_AC_BE] = 0;
@@ -748,8 +653,6 @@ VOID MlmeResetRalinkCounters(
return;
}
-unsigned long rx_AMSDU;
-unsigned long rx_Total;
/*
==========================================================================
@@ -776,34 +679,41 @@ VOID MlmePeriodicExec(
{
ULONG TxTotalCnt;
PRTMP_ADAPTER pAd = (RTMP_ADAPTER *)FunctionContext;
+ SHORT realavgrssi;
-#ifdef RT2860
- //Baron 2008/07/10
- //printk("Baron_Test:\t%s", RTMPGetRalinkEncryModeStr(pAd->StaCfg.WepStatus));
- //If the STA security setting is OPEN or WEP, pAd->StaCfg.WpaSupplicantUP = 0.
- //If the STA security setting is WPAPSK or WPA2PSK, pAd->StaCfg.WpaSupplicantUP = 1.
- if(pAd->StaCfg.WepStatus<2)
- {
- pAd->StaCfg.WpaSupplicantUP = 0;
- }
- else
- {
- pAd->StaCfg.WpaSupplicantUP = 1;
- }
-
+#ifdef RTMP_MAC_PCI
{
// If Hardware controlled Radio enabled, we have to check GPIO pin2 every 2 second.
// Move code to here, because following code will return when radio is off
- if ((pAd->Mlme.PeriodicRound % (MLME_TASK_EXEC_MULTIPLE * 2) == 0) &&
- (pAd->StaCfg.bHardwareRadio == TRUE) &&
- (RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP)) &&
+ if ((pAd->Mlme.PeriodicRound % (MLME_TASK_EXEC_MULTIPLE * 2) == 0) && (pAd->StaCfg.bHardwareRadio == TRUE) &&
(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)))
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
+ /*&&(pAd->bPCIclkOff == FALSE)*/)
{
UINT32 data = 0;
// Read GPIO pin2 as Hardware controlled radio state
- RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data);
+#ifndef RT3090
+ RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &data);
+#endif // RT3090 //
+//KH(PCIE PS):Added based on Jane<--
+#ifdef RT3090
+// Read GPIO pin2 as Hardware controlled radio state
+// We need to Read GPIO if HW said so no mater what advance power saving
+if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd))
+ && (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
+ && (pAd->StaCfg.PSControl.field.EnablePSinIdle == TRUE))
+ {
+ // Want to make sure device goes to L0 state before reading register.
+ RTMPPCIeLinkCtrlValueRestore(pAd, 0);
+ RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data);
+ RTMPPCIeLinkCtrlSetting(pAd, 3);
+ }
+else
+ RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data);
+#endif // RT3090 //
+//KH(PCIE PS):Added based on Jane-->
+
if (data & 0x04)
{
pAd->StaCfg.bHwRadio = TRUE;
@@ -830,7 +740,7 @@ VOID MlmePeriodicExec(
}
}
}
-#endif /* RT2860 */
+#endif // RTMP_MAC_PCI //
// Do nothing if the driver is starting halt state.
// This might happen when timer already been fired before cancel timer with mlmehalt
@@ -840,46 +750,7 @@ VOID MlmePeriodicExec(
fRTMP_ADAPTER_RESET_IN_PROGRESS))))
return;
-#ifdef RT2860
- {
- if ((pAd->RalinkCounters.LastReceivedByteCount == pAd->RalinkCounters.ReceivedByteCount) && (pAd->StaCfg.bRadio == TRUE))
- {
- // If ReceiveByteCount doesn't change, increase SameRxByteCount by 1.
- pAd->SameRxByteCount++;
- }
- else
- pAd->SameRxByteCount = 0;
-
- // If after BBP, still not work...need to check to reset PBF&MAC.
- if (pAd->SameRxByteCount == 702)
- {
- pAd->SameRxByteCount = 0;
- AsicResetPBF(pAd);
- AsicResetMAC(pAd);
- }
-
- // If SameRxByteCount keeps happens for 2 second in infra mode, or for 60 seconds in idle mode.
- if (((INFRA_ON(pAd)) && (pAd->SameRxByteCount > 20)) || ((IDLE_ON(pAd)) && (pAd->SameRxByteCount > 600)))
- {
- if ((pAd->StaCfg.bRadio == TRUE) && (pAd->SameRxByteCount < 700))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("---> SameRxByteCount = %lu !!!!!!!!!!!!!!! \n", pAd->SameRxByteCount));
- pAd->SameRxByteCount = 700;
- AsicResetBBP(pAd);
- }
- }
-
- // Update lastReceiveByteCount.
- pAd->RalinkCounters.LastReceivedByteCount = pAd->RalinkCounters.ReceivedByteCount;
-
- if ((pAd->CheckDmaBusyCount > 3) && (IDLE_ON(pAd)))
- {
- pAd->CheckDmaBusyCount = 0;
- AsicResetFromDMABusy(pAd);
- }
- }
-#endif /* RT2860 */
- RT28XX_MLME_PRE_SANITY_CHECK(pAd);
+ RTMP_MLME_PRE_SANITY_CHECK(pAd);
{
// Do nothing if monitor mode is on
@@ -911,10 +782,11 @@ VOID MlmePeriodicExec(
// RECBATimerTimeout(SystemSpecific1,FunctionContext,SystemSpecific2,SystemSpecific3);
pAd->Mlme.PeriodicRound ++;
-#ifdef RT3070
+#ifdef RTMP_MAC_USB
// execute every 100ms, update the Tx FIFO Cnt for update Tx Rate.
NICUpdateFifoStaCounters(pAd);
-#endif // RT3070 //
+#endif // RTMP_MAC_USB //
+
// execute every 500ms
if ((pAd->Mlme.PeriodicRound % 5 == 0) && RTMPAutoRateSwitchCheck(pAd)/*(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))*/)
{
@@ -932,13 +804,10 @@ VOID MlmePeriodicExec(
{
pAd->Mlme.OneSecPeriodicRound ++;
- if (rx_Total)
- {
- // reset counters
- rx_AMSDU = 0;
- rx_Total = 0;
- }
+
+
+ //ORIBATimerTimeout(pAd);
// Media status changed, report to NDIS
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE))
@@ -963,14 +832,23 @@ VOID MlmePeriodicExec(
// the dynamic tuning mechanism below are based on most up-to-date information
NICUpdateRawCounters(pAd);
-#ifdef RT2870
- RT2870_WatchDog(pAd);
-#endif // RT2870 //
+#ifdef RTMP_MAC_USB
+ RTUSBWatchDog(pAd);
+#endif // RTMP_MAC_USB //
// Need statistics after read counter. So put after NICUpdateRawCounters
ORIBATimerTimeout(pAd);
+ // if MGMT RING is full more than twice within 1 second, we consider there's
+ // a hardware problem stucking the TX path. In this case, try a hardware reset
+ // to recover the system
+ // if (pAd->RalinkCounters.MgmtRingFullCount >= 2)
+ // RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HARDWARE_ERROR);
+ // else
+ // pAd->RalinkCounters.MgmtRingFullCount = 0;
+
// The time period for checking antenna is according to traffic
+ {
if (pAd->Mlme.bEnableAutoAntennaCheck)
{
TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
@@ -993,15 +871,16 @@ VOID MlmePeriodicExec(
}
}
}
+ }
STAMlmePeriodicExec(pAd);
MlmeResetRalinkCounters(pAd);
{
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->bPCIclkOff == FALSE))
-#endif
+#endif // RTMP_MAC_PCI //
{
// When Adhoc beacon is enabled and RTS/CTS is enabled, there is a chance that hardware MAC FSM will run into a deadlock
// and sending CTS-to-self over and over.
@@ -1024,356 +903,13 @@ VOID MlmePeriodicExec(
}
}
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
- pAd->bUpdateBcnCntDone = FALSE;
-}
-
-VOID STAMlmePeriodicExec(
- PRTMP_ADAPTER pAd)
-{
-#ifdef RT2860
- ULONG TxTotalCnt;
-#endif
-#ifdef RT2870
- ULONG TxTotalCnt;
- int i;
-#endif
-
- if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
- {
- // WPA MIC error should block association attempt for 60 seconds
- if (pAd->StaCfg.bBlockAssoc && (pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ) < pAd->Mlme.Now32))
- pAd->StaCfg.bBlockAssoc = FALSE;
- }
-
-#ifdef RT2860
- //Baron 2008/07/10
- //printk("Baron_Test:\t%s", RTMPGetRalinkEncryModeStr(pAd->StaCfg.WepStatus));
- //If the STA security setting is OPEN or WEP, pAd->StaCfg.WpaSupplicantUP = 0.
- //If the STA security setting is WPAPSK or WPA2PSK, pAd->StaCfg.WpaSupplicantUP = 1.
- if(pAd->StaCfg.WepStatus<2)
- {
- pAd->StaCfg.WpaSupplicantUP = 0;
- }
- else
- {
- pAd->StaCfg.WpaSupplicantUP = 1;
- }
-#endif
-
- if ((pAd->PreMediaState != pAd->IndicateMediaState) && (pAd->CommonCfg.bWirelessEvent))
- {
- if (pAd->IndicateMediaState == NdisMediaStateConnected)
- {
- RTMPSendWirelessEvent(pAd, IW_STA_LINKUP_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
- pAd->PreMediaState = pAd->IndicateMediaState;
- }
-
-#ifdef RT2860
- if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd)) &&
- (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) &&
- (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE) &&
- (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) &&
- (RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
- {
- RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0);
- }
-#endif
-
-
-
- AsicStaBbpTuning(pAd);
-
- TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
- pAd->RalinkCounters.OneSecTxRetryOkCount +
- pAd->RalinkCounters.OneSecTxFailCount;
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- // update channel quality for Roaming and UI LinkQuality display
- MlmeCalculateChannelQuality(pAd, pAd->Mlme.Now32);
- }
-
- // must be AFTER MlmeDynamicTxRateSwitching() because it needs to know if
- // Radio is currently in noisy environment
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- AsicAdjustTxPower(pAd);
-
- if (INFRA_ON(pAd))
- {
- // Is PSM bit consistent with user power management policy?
- // This is the only place that will set PSM bit ON.
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- MlmeCheckPsmChange(pAd, pAd->Mlme.Now32);
-
- pAd->RalinkCounters.LastOneSecTotalTxCount = TxTotalCnt;
-
- if ((pAd->StaCfg.LastBeaconRxTime + 1*OS_HZ < pAd->Mlme.Now32) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
- ((TxTotalCnt + pAd->RalinkCounters.OneSecRxOkCnt < 600)))
- {
- RTMPSetAGCInitValue(pAd, BW_20);
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. restore R66 to the low bound(%d) \n", (0x2E + GET_LNA_GAIN(pAd))));
- }
-
- {
- if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable)
- {
- // When APSD is enabled, the period changes as 20 sec
- if ((pAd->Mlme.OneSecPeriodicRound % 20) == 8)
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- }
- else
- {
- // Send out a NULL frame every 10 sec to inform AP that STA is still alive (Avoid being age out)
- if ((pAd->Mlme.OneSecPeriodicRound % 10) == 8)
- {
- if (pAd->CommonCfg.bWmmCapable)
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- else
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, FALSE);
- }
- }
- }
-
- if (CQI_IS_DEAD(pAd->Mlme.ChannelQuality))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. Dead CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
- pAd->StaCfg.CCXAdjacentAPReportFlag = TRUE;
- pAd->StaCfg.CCXAdjacentAPLinkDownTime = pAd->StaCfg.LastBeaconRxTime;
-
- // Lost AP, send disconnect & link down event
- LinkDown(pAd, FALSE);
-
- {
- union iwreq_data wrqu;
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
-
- MlmeAutoReconnectLastSSID(pAd);
- }
- else if (CQI_IS_BAD(pAd->Mlme.ChannelQuality))
- {
- pAd->RalinkCounters.BadCQIAutoRecoveryCount ++;
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Bad CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
- MlmeAutoReconnectLastSSID(pAd);
- }
-
- // Add auto seamless roaming
- if (pAd->StaCfg.bFastRoaming)
- {
- SHORT dBmToRoam = (SHORT)pAd->StaCfg.dBmToRoam;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Rssi=%d, dBmToRoam=%d\n", RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2), (CHAR)dBmToRoam));
-
- if (RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2) <= (CHAR)dBmToRoam)
- {
- MlmeCheckForFastRoaming(pAd, pAd->Mlme.Now32);
- }
- }
- }
- else if (ADHOC_ON(pAd))
- {
-#ifdef RT2860
- // 2003-04-17 john. this is a patch that driver forces a BEACON out if ASIC fails
- // the "TX BEACON competition" for the entire past 1 sec.
- // So that even when ASIC's BEACONgen engine been blocked
- // by peer's BEACON due to slower system clock, this STA still can send out
- // minimum BEACON to tell the peer I'm alive.
- // drawback is that this BEACON won't be well aligned at TBTT boundary.
- // EnqueueBeaconFrame(pAd); // software send BEACON
-
- // if all 11b peers leave this BSS more than 5 seconds, update Tx rate,
- // restore outgoing BEACON to support B/G-mixed mode
- if ((pAd->CommonCfg.Channel <= 14) &&
- (pAd->CommonCfg.MaxTxRate <= RATE_11) &&
- (pAd->CommonCfg.MaxDesiredRate > RATE_11) &&
- ((pAd->StaCfg.Last11bBeaconRxTime + 5*OS_HZ) < pAd->Mlme.Now32))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - last 11B peer left, update Tx rates\n"));
- NdisMoveMemory(pAd->StaActive.SupRate, pAd->CommonCfg.SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- pAd->StaActive.SupRateLen = pAd->CommonCfg.SupRateLen;
- MlmeUpdateTxRates(pAd, FALSE, 0);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy to on-chip memory
- pAd->StaCfg.AdhocBOnlyJoined = FALSE;
- }
-
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- {
- if ((pAd->StaCfg.AdhocBGJoined) &&
- ((pAd->StaCfg.Last11gBeaconRxTime + 5 * OS_HZ) < pAd->Mlme.Now32))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - last 11G peer left\n"));
- pAd->StaCfg.AdhocBGJoined = FALSE;
- }
-
- if ((pAd->StaCfg.Adhoc20NJoined) &&
- ((pAd->StaCfg.Last20NBeaconRxTime + 5 * OS_HZ) < pAd->Mlme.Now32))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - last 20MHz N peer left\n"));
- pAd->StaCfg.Adhoc20NJoined = FALSE;
- }
- }
-#endif /* RT2860 */
-
- //radar detect
- if ((pAd->CommonCfg.Channel > 14)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && RadarChannelCheck(pAd, pAd->CommonCfg.Channel))
- {
- RadarDetectPeriodic(pAd);
- }
-
- // If all peers leave, and this STA becomes the last one in this IBSS, then change MediaState
- // to DISCONNECTED. But still holding this IBSS (i.e. sending BEACON) so that other STAs can
- // join later.
- if ((pAd->StaCfg.LastBeaconRxTime + ADHOC_BEACON_LOST_TIME < pAd->Mlme.Now32) &&
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- MLME_START_REQ_STRUCT StartReq;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - excessive BEACON lost, last STA in this IBSS, MediaState=Disconnected\n"));
- LinkDown(pAd, FALSE);
-
- StartParmFill(pAd, &StartReq, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
- }
-
-#ifdef RT2870
- for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
- {
- MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[i];
-
- if (pEntry->ValidAsCLI == FALSE)
- continue;
-
- if (pEntry->LastBeaconRxTime + ADHOC_BEACON_LOST_TIME < pAd->Mlme.Now32)
- MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
- }
-#endif
- }
- else // no INFRA nor ADHOC connection
- {
-
- if (pAd->StaCfg.bScanReqIsFromWebUI &&
- ((pAd->StaCfg.LastScanTime + 30 * OS_HZ) > pAd->Mlme.Now32))
- goto SKIP_AUTO_SCAN_CONN;
- else
- pAd->StaCfg.bScanReqIsFromWebUI = FALSE;
-
- if ((pAd->StaCfg.bAutoReconnect == TRUE)
- && RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP)
- && (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
- {
- if ((pAd->ScanTab.BssNr==0) && (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE))
- {
- MLME_SCAN_REQ_STRUCT ScanReq;
-
- if ((pAd->StaCfg.LastScanTime + 10 * OS_HZ) < pAd->Mlme.Now32)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("STAMlmePeriodicExec():CNTL - ScanTab.BssNr==0, start a new ACTIVE scan SSID[%s]\n", pAd->MlmeAux.AutoReconnectSsid));
- ScanParmFill(pAd, &ScanReq, pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen, BSS_ANY, SCAN_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
- // Reset Missed scan number
- pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
- }
- else if (pAd->StaCfg.BssType == BSS_ADHOC) // Quit the forever scan when in a very clean room
- MlmeAutoReconnectLastSSID(pAd);
- }
- else if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- if ((pAd->Mlme.OneSecPeriodicRound % 7) == 0)
- {
- MlmeAutoScan(pAd);
- pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
- }
- else
- {
- MlmeAutoReconnectLastSSID(pAd);
- }
- }
- }
- }
-
-SKIP_AUTO_SCAN_CONN:
-
- if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap !=0) && (pAd->MacTab.fAnyBASession == FALSE))
- {
- pAd->MacTab.fAnyBASession = TRUE;
- AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, FALSE, FALSE);
- }
- else if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap ==0) && (pAd->MacTab.fAnyBASession == TRUE))
- {
- pAd->MacTab.fAnyBASession = FALSE;
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE);
- }
-
- return;
-}
-
-// Link down report
-VOID LinkDownExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
-
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
-}
-// IRQL = DISPATCH_LEVEL
-VOID MlmeAutoScan(
- IN PRTMP_ADAPTER pAd)
-{
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Driver auto scan\n"));
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID_LIST_SCAN,
- 0,
- NULL);
- RT28XX_MLME_HANDLER(pAd);
- }
+ pAd->bUpdateBcnCntDone = FALSE;
}
-// IRQL = DISPATCH_LEVEL
-VOID MlmeAutoReconnectLastSSID(
- IN PRTMP_ADAPTER pAd)
-{
-
-
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- if ((pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) &&
- (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
- {
- NDIS_802_11_SSID OidSsid;
- OidSsid.SsidLength = pAd->MlmeAux.AutoReconnectSsidLen;
- NdisMoveMemory(OidSsid.Ssid, pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Driver auto reconnect to last OID_802_11_SSID setting - %s, len - %d\n", pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen));
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_SSID,
- sizeof(NDIS_802_11_SSID),
- &OidSsid);
- RT28XX_MLME_HANDLER(pAd);
- }
-}
/*
==========================================================================
@@ -1394,10 +930,10 @@ BOOLEAN MlmeValidateSSID(
// Check each character value
for (index = 0; index < SsidLen; index++)
- {
+ {
if (pSsid[index] < 0x20)
return (FALSE);
- }
+ }
// All checked
return (TRUE);
@@ -1414,27 +950,19 @@ VOID MlmeSelectTxRateTable(
{
// decide the rate table for tuning
if (pAd->CommonCfg.TxRateTableSize > 0)
- {
+ {
*ppTable = RateSwitchTable;
*pTableSize = RateSwitchTable[0];
*pInitTxRateIdx = RateSwitchTable[1];
break;
- }
+ }
if ((pAd->OpMode == OPMODE_STA) && ADHOC_ON(pAd))
- {
+ {
if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) &&
-#ifdef RT2860
- !pAd->StaCfg.AdhocBOnlyJoined &&
- !pAd->StaCfg.AdhocBGJoined &&
- (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
- ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
-#endif
-#ifdef RT2870
(pEntry->HTCapability.MCSSet[0] == 0xff) &&
((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
-#endif
{// 11N 1S Adhoc
*ppTable = RateSwitchTable11N1S;
*pTableSize = RateSwitchTable11N1S[0];
@@ -1442,50 +970,29 @@ VOID MlmeSelectTxRateTable(
}
else if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) &&
-#ifdef RT2860
- !pAd->StaCfg.AdhocBOnlyJoined &&
- !pAd->StaCfg.AdhocBGJoined &&
- (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
- (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) &&
-#endif
-#ifdef RT2870
(pEntry->HTCapability.MCSSet[0] == 0xff) &&
(pEntry->HTCapability.MCSSet[1] == 0xff) &&
-#endif
(pAd->Antenna.field.TxPath == 2))
{// 11N 2S Adhoc
if (pAd->LatchRfRegs.Channel <= 14)
- {
+ {
*ppTable = RateSwitchTable11N2S;
*pTableSize = RateSwitchTable11N2S[0];
*pInitTxRateIdx = RateSwitchTable11N2S[1];
- }
+ }
else
{
*ppTable = RateSwitchTable11N2SForABand;
*pTableSize = RateSwitchTable11N2SForABand[0];
*pInitTxRateIdx = RateSwitchTable11N2SForABand[1];
- }
+ }
- }
+ }
else
-#ifdef RT2860
- if (pAd->CommonCfg.PhyMode == PHY_11B)
- {
- *ppTable = RateSwitchTable11B;
- *pTableSize = RateSwitchTable11B[0];
- *pInitTxRateIdx = RateSwitchTable11B[1];
-
- }
- else if((pAd->LatchRfRegs.Channel <= 14) && (pAd->StaCfg.AdhocBOnlyJoined == TRUE))
-#endif
-#ifdef RT2870
if ((pEntry->RateLen == 4)
&& (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)
)
-#endif
{
- // USe B Table when Only b-only Station in my IBSS .
*ppTable = RateSwitchTable11B;
*pTableSize = RateSwitchTable11B[0];
*pInitTxRateIdx = RateSwitchTable11B[1];
@@ -1508,7 +1015,9 @@ VOID MlmeSelectTxRateTable(
break;
}
- if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
+ //if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
+ // ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
+ if (((pEntry->RateLen == 12) || (pAd->OpMode == OPMODE_STA)) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
{// 11BGN 1S AP
*ppTable = RateSwitchTable11BGN1S;
@@ -1516,13 +1025,15 @@ VOID MlmeSelectTxRateTable(
*pInitTxRateIdx = RateSwitchTable11BGN1S[1];
break;
- }
+ }
- if ((pEntry->RateLen == 12) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
+ //else if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
+ // (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
+ if (((pEntry->RateLen == 12) || (pAd->OpMode == OPMODE_STA)) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
(pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
{// 11BGN 2S AP
if (pAd->LatchRfRegs.Channel <= 14)
- {
+ {
*ppTable = RateSwitchTable11BGN2S;
*pTableSize = RateSwitchTable11BGN2S[0];
*pInitTxRateIdx = RateSwitchTable11BGN2S[1];
@@ -1538,6 +1049,7 @@ VOID MlmeSelectTxRateTable(
break;
}
+ //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
if ((pEntry->HTCapability.MCSSet[0] == 0xff) && ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
{// 11N 1S AP
*ppTable = RateSwitchTable11N1S;
@@ -1547,6 +1059,7 @@ VOID MlmeSelectTxRateTable(
break;
}
+ //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
if ((pEntry->HTCapability.MCSSet[0] == 0xff) && (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
{// 11N 2S AP
if (pAd->LatchRfRegs.Channel <= 14)
@@ -1554,7 +1067,7 @@ VOID MlmeSelectTxRateTable(
*ppTable = RateSwitchTable11N2S;
*pTableSize = RateSwitchTable11N2S[0];
*pInitTxRateIdx = RateSwitchTable11N2S[1];
- }
+ }
else
{
*ppTable = RateSwitchTable11N2SForABand;
@@ -1564,9 +1077,11 @@ VOID MlmeSelectTxRateTable(
break;
}
-
//else if ((pAd->StaActive.SupRateLen == 4) && (pAd->StaActive.ExtRateLen == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0))
- if (pEntry->RateLen == 4)
+ if ((pEntry->RateLen == 4 || pAd->CommonCfg.PhyMode==PHY_11B)
+ //Iverson mark for Adhoc b mode,sta will use rate 54 Mbps when connect with sta b/g/n mode
+ /* && (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)*/
+ )
{// B only AP
*ppTable = RateSwitchTable11B;
*pTableSize = RateSwitchTable11B[0];
@@ -1624,7 +1139,6 @@ VOID MlmeSelectTxRateTable(
}
break;
}
-
if (pAd->LatchRfRegs.Channel <= 14)
{
if (pAd->CommonCfg.TxStream == 1)
@@ -1659,13 +1173,413 @@ VOID MlmeSelectTxRateTable(
DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode,default use 11N 2S AP \n"));
}
}
-
DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode (SupRateLen=%d, ExtRateLen=%d, MCSSet[0]=0x%x, MCSSet[1]=0x%x)\n",
pAd->StaActive.SupRateLen, pAd->StaActive.ExtRateLen, pAd->StaActive.SupportedPhyInfo.MCSSet[0], pAd->StaActive.SupportedPhyInfo.MCSSet[1]));
}
} while(FALSE);
}
+
+VOID STAMlmePeriodicExec(
+ PRTMP_ADAPTER pAd)
+{
+ ULONG TxTotalCnt;
+ int i;
+
+ /*
+ We return here in ATE mode, because the statistics
+ that ATE need are not collected via this routine.
+ */
+#if defined(RT305x)||defined(RT3070)
+ // request by Gary, if Rssi0 > -42, BBP 82 need to be changed from 0x62 to 0x42, , bbp 67 need to be changed from 0x20 to 0x18
+ if (!pAd->CommonCfg.HighPowerPatchDisabled)
+ {
+#ifdef RT3070
+ if ( (IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
+#endif // RT3070 //
+ {
+ if ((pAd->StaCfg.RssiSample.AvgRssi0 != 0) && (pAd->StaCfg.RssiSample.AvgRssi0 > (pAd->BbpRssiToDbmDelta - 35)))
+ {
+ RT30xxWriteRFRegister(pAd, RF_R27, 0x20);
+ }
+ else
+ {
+ RT30xxWriteRFRegister(pAd, RF_R27, 0x23);
+ }
+ }
+ }
+#endif
+#ifdef PCIE_PS_SUPPORT
+// don't perform idle-power-save mechanism within 3 min after driver initialization.
+// This can make rebooter test more robust
+if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
+ {
+ if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd))
+ && (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE)
+ && (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
+ && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
+ {
+ if (IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd))
+ {
+ if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
+
+ RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0);
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
+ AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x2);
+ // Wait command success
+ AsicCheckCommanOk(pAd, PowerSafeCID);
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+ DBGPRINT(RT_DEBUG_TRACE, ("PSM - rt30xx Issue Sleep command)\n"));
+ }
+ }
+ else if (pAd->Mlme.OneSecPeriodicRound > 180)
+ {
+ if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
+ RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0);
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
+ AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x02);
+ // Wait command success
+ AsicCheckCommanOk(pAd, PowerSafeCID);
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+ DBGPRINT(RT_DEBUG_TRACE, ("PSM - rt28xx Issue Sleep command)\n"));
+ }
+ }
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_TRACE,("STAMlmePeriodicExec MMCHK - CommonCfg.Ssid[%d]=%c%c%c%c... MlmeAux.Ssid[%d]=%c%c%c%c...\n",
+ pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid[0], pAd->CommonCfg.Ssid[1], pAd->CommonCfg.Ssid[2], pAd->CommonCfg.Ssid[3],
+ pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid[0], pAd->MlmeAux.Ssid[1], pAd->MlmeAux.Ssid[2], pAd->MlmeAux.Ssid[3]));
+ }
+ }
+#endif // PCIE_PS_SUPPORT //
+
+ if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
+ {
+ // WPA MIC error should block association attempt for 60 seconds
+ if (pAd->StaCfg.bBlockAssoc &&
+ RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastMicErrorTime + (60*OS_HZ)))
+ pAd->StaCfg.bBlockAssoc = FALSE;
+ }
+
+ if ((pAd->PreMediaState != pAd->IndicateMediaState) && (pAd->CommonCfg.bWirelessEvent))
+ {
+ if (pAd->IndicateMediaState == NdisMediaStateConnected)
+ {
+ RTMPSendWirelessEvent(pAd, IW_STA_LINKUP_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
+ }
+ pAd->PreMediaState = pAd->IndicateMediaState;
+ }
+
+
+
+
+ if (pAd->CommonCfg.PSPXlink && ADHOC_ON(pAd))
+ {
+ }
+ else
+ {
+ AsicStaBbpTuning(pAd);
+ }
+
+ TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
+ pAd->RalinkCounters.OneSecTxRetryOkCount +
+ pAd->RalinkCounters.OneSecTxFailCount;
+
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
+ {
+ // update channel quality for Roaming and UI LinkQuality display
+ MlmeCalculateChannelQuality(pAd, NULL, pAd->Mlme.Now32);
+ }
+
+ // must be AFTER MlmeDynamicTxRateSwitching() because it needs to know if
+ // Radio is currently in noisy environment
+ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
+ AsicAdjustTxPower(pAd);
+
+ if (INFRA_ON(pAd))
+ {
+
+ // Is PSM bit consistent with user power management policy?
+ // This is the only place that will set PSM bit ON.
+ if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
+ MlmeCheckPsmChange(pAd, pAd->Mlme.Now32);
+
+ pAd->RalinkCounters.LastOneSecTotalTxCount = TxTotalCnt;
+
+ if ((RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastBeaconRxTime + (1*OS_HZ))) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
+ (((TxTotalCnt + pAd->RalinkCounters.OneSecRxOkCnt) < 600)))
+ {
+ RTMPSetAGCInitValue(pAd, BW_20);
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. restore R66 to the low bound(%d) \n", (0x2E + GET_LNA_GAIN(pAd))));
+ }
+
+ //if ((pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
+ // (pAd->RalinkCounters.OneSecTxRetryOkCount == 0))
+ {
+ if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable)
+ {
+ // When APSD is enabled, the period changes as 20 sec
+ if ((pAd->Mlme.OneSecPeriodicRound % 20) == 8)
+ RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
+ }
+ else
+ {
+ // Send out a NULL frame every 10 sec to inform AP that STA is still alive (Avoid being age out)
+ if ((pAd->Mlme.OneSecPeriodicRound % 10) == 8)
+ {
+ if (pAd->CommonCfg.bWmmCapable)
+ RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
+ else
+ RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, FALSE);
+ }
+ }
+ }
+
+ if (CQI_IS_DEAD(pAd->Mlme.ChannelQuality))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. Dead CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
+
+ // Lost AP, send disconnect & link down event
+ LinkDown(pAd, FALSE);
+
+
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
+
+ // RTMPPatchMacBbpBug(pAd);
+ MlmeAutoReconnectLastSSID(pAd);
+ }
+ else if (CQI_IS_BAD(pAd->Mlme.ChannelQuality))
+ {
+ pAd->RalinkCounters.BadCQIAutoRecoveryCount ++;
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Bad CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
+ MlmeAutoReconnectLastSSID(pAd);
+ }
+
+ if (pAd->StaCfg.bAutoRoaming)
+ {
+ BOOLEAN rv = FALSE;
+ CHAR dBmToRoam = pAd->StaCfg.dBmToRoam;
+ CHAR MaxRssi = RTMPMaxRssi(pAd,
+ pAd->StaCfg.RssiSample.LastRssi0,
+ pAd->StaCfg.RssiSample.LastRssi1,
+ pAd->StaCfg.RssiSample.LastRssi2);
+
+ // Scanning, ignore Roaming
+ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) &&
+ (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE) &&
+ (MaxRssi <= dBmToRoam))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("Rssi=%d, dBmToRoam=%d\n", MaxRssi, (CHAR)dBmToRoam));
+
+
+ // Add auto seamless roaming
+ if (rv == FALSE)
+ rv = MlmeCheckForFastRoaming(pAd);
+
+ if (rv == FALSE)
+ {
+ if ((pAd->StaCfg.LastScanTime + 10 * OS_HZ) < pAd->Mlme.Now32)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming, No eligable entry, try new scan!\n"));
+ pAd->StaCfg.ScanCnt = 2;
+ pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
+ MlmeAutoScan(pAd);
+ }
+ }
+ }
+ }
+ }
+ else if (ADHOC_ON(pAd))
+ {
+ // If all peers leave, and this STA becomes the last one in this IBSS, then change MediaState
+ // to DISCONNECTED. But still holding this IBSS (i.e. sending BEACON) so that other STAs can
+ // join later.
+ if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastBeaconRxTime + ADHOC_BEACON_LOST_TIME) &&
+ OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
+ {
+ MLME_START_REQ_STRUCT StartReq;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - excessive BEACON lost, last STA in this IBSS, MediaState=Disconnected\n"));
+ LinkDown(pAd, FALSE);
+
+ StartParmFill(pAd, &StartReq, (CHAR *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
+ MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
+ pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
+ }
+
+ for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
+ {
+ MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[i];
+
+ if (pEntry->ValidAsCLI == FALSE)
+ continue;
+
+ if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pEntry->LastBeaconRxTime + ADHOC_BEACON_LOST_TIME))
+ MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
+ }
+ }
+ else // no INFRA nor ADHOC connection
+ {
+
+ if (pAd->StaCfg.bScanReqIsFromWebUI &&
+ RTMP_TIME_BEFORE(pAd->Mlme.Now32, pAd->StaCfg.LastScanTime + (30 * OS_HZ)))
+ goto SKIP_AUTO_SCAN_CONN;
+ else
+ pAd->StaCfg.bScanReqIsFromWebUI = FALSE;
+
+ if ((pAd->StaCfg.bAutoReconnect == TRUE)
+ && RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP)
+ && (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
+ {
+ if ((pAd->ScanTab.BssNr==0) && (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE))
+ {
+ MLME_SCAN_REQ_STRUCT ScanReq;
+
+ if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastScanTime + (10 * OS_HZ)))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("STAMlmePeriodicExec():CNTL - ScanTab.BssNr==0, start a new ACTIVE scan SSID[%s]\n", pAd->MlmeAux.AutoReconnectSsid));
+ ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen, BSS_ANY, SCAN_ACTIVE);
+ MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
+ pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
+ // Reset Missed scan number
+ pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
+ }
+ else if (pAd->StaCfg.BssType == BSS_ADHOC) // Quit the forever scan when in a very clean room
+ MlmeAutoReconnectLastSSID(pAd);
+ }
+ else if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
+ {
+ if ((pAd->Mlme.OneSecPeriodicRound % 7) == 0)
+ {
+ MlmeAutoScan(pAd);
+ pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
+ }
+ else
+ {
+ MlmeAutoReconnectLastSSID(pAd);
+ }
+ }
+ }
+ }
+
+SKIP_AUTO_SCAN_CONN:
+
+ if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap !=0) && (pAd->MacTab.fAnyBASession == FALSE))
+ {
+ pAd->MacTab.fAnyBASession = TRUE;
+ AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, FALSE, FALSE);
+ }
+ else if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap ==0) && (pAd->MacTab.fAnyBASession == TRUE))
+ {
+ pAd->MacTab.fAnyBASession = FALSE;
+ AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE);
+ }
+
+ return;
+}
+
+// Link down report
+VOID LinkDownExec(
+ IN PVOID SystemSpecific1,
+ IN PVOID FunctionContext,
+ IN PVOID SystemSpecific2,
+ IN PVOID SystemSpecific3)
+{
+ RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
+
+ if (pAd != NULL)
+ {
+ MLME_DISASSOC_REQ_STRUCT DisassocReq;
+
+ if ((pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED) &&
+ (INFRA_ON(pAd)))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("LinkDownExec(): disassociate with current AP...\n"));
+ DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
+ MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
+ sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
+ pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
+
+ pAd->IndicateMediaState = NdisMediaStateDisconnected;
+ RTMP_IndicateMediaState(pAd);
+ pAd->ExtraInfo = GENERAL_LINK_DOWN;
+ }
+ }
+}
+
+// IRQL = DISPATCH_LEVEL
+VOID MlmeAutoScan(
+ IN PRTMP_ADAPTER pAd)
+{
+ // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
+ if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Driver auto scan\n"));
+ MlmeEnqueue(pAd,
+ MLME_CNTL_STATE_MACHINE,
+ OID_802_11_BSSID_LIST_SCAN,
+ pAd->MlmeAux.AutoReconnectSsidLen,
+ pAd->MlmeAux.AutoReconnectSsid);
+ RTMP_MLME_HANDLER(pAd);
+ }
+}
+
+// IRQL = DISPATCH_LEVEL
+VOID MlmeAutoReconnectLastSSID(
+ IN PRTMP_ADAPTER pAd)
+{
+ if (pAd->StaCfg.bAutoConnectByBssid)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("Driver auto reconnect to last OID_802_11_BSSID setting - %02X:%02X:%02X:%02X:%02X:%02X\n",
+ pAd->MlmeAux.Bssid[0],
+ pAd->MlmeAux.Bssid[1],
+ pAd->MlmeAux.Bssid[2],
+ pAd->MlmeAux.Bssid[3],
+ pAd->MlmeAux.Bssid[4],
+ pAd->MlmeAux.Bssid[5]));
+
+ pAd->MlmeAux.Channel = pAd->CommonCfg.Channel;
+ MlmeEnqueue(pAd,
+ MLME_CNTL_STATE_MACHINE,
+ OID_802_11_BSSID,
+ MAC_ADDR_LEN,
+ pAd->MlmeAux.Bssid);
+
+ pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
+
+ RTMP_MLME_HANDLER(pAd);
+ }
+ // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
+ else if ((pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) &&
+ (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
+ {
+ NDIS_802_11_SSID OidSsid;
+ OidSsid.SsidLength = pAd->MlmeAux.AutoReconnectSsidLen;
+ NdisMoveMemory(OidSsid.Ssid, pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("Driver auto reconnect to last OID_802_11_SSID setting - %s, len - %d\n", pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen));
+ MlmeEnqueue(pAd,
+ MLME_CNTL_STATE_MACHINE,
+ OID_802_11_SSID,
+ sizeof(NDIS_802_11_SSID),
+ &OidSsid);
+ RTMP_MLME_HANDLER(pAd);
+ }
+}
+
+
/*
==========================================================================
Description:
@@ -1693,7 +1607,7 @@ VOID MlmeCheckForRoaming(
{
pBss = &pAd->ScanTab.BssEntry[i];
- if ((pBss->LastBeaconRxTime + BEACON_LOST_TIME) < Now32)
+ if ((pBss->LastBeaconRxTime + pAd->StaCfg.BeaconLostTime) < Now32)
continue; // AP disappear
if (pBss->Rssi <= RSSI_THRESHOLD_FOR_ROAMING)
continue; // RSSI too weak. forget it.
@@ -1715,7 +1629,7 @@ VOID MlmeCheckForRoaming(
pAd->RalinkCounters.PoorCQIRoamingCount ++;
DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming attempt #%ld\n", pAd->RalinkCounters.PoorCQIRoamingCount));
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_MLME_ROAMING_REQ, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
}
DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeCheckForRoaming(# of candidate= %d)\n",pRoamTab->BssNr));
@@ -1733,9 +1647,8 @@ VOID MlmeCheckForRoaming(
Output:
==========================================================================
*/
-VOID MlmeCheckForFastRoaming(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now)
+BOOLEAN MlmeCheckForFastRoaming(
+ IN PRTMP_ADAPTER pAd)
{
USHORT i;
BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab;
@@ -1745,7 +1658,7 @@ VOID MlmeCheckForFastRoaming(
// put all roaming candidates into RoamTab, and sort in RSSI order
BssTableInit(pRoamTab);
for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
+ {
pBss = &pAd->ScanTab.BssEntry[i];
if ((pBss->Rssi <= -50) && (pBss->Channel == pAd->CommonCfg.Channel))
@@ -1761,119 +1674,23 @@ VOID MlmeCheckForFastRoaming(
// AP passing all above rules is put into roaming candidate table
NdisMoveMemory(&pRoamTab->BssEntry[pRoamTab->BssNr], pBss, sizeof(BSS_ENTRY));
pRoamTab->BssNr += 1;
- }
+ }
+ DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeCheckForFastRoaming (BssNr=%d)\n", pRoamTab->BssNr));
if (pRoamTab->BssNr > 0)
- {
+ {
// check CntlMachine.CurrState to avoid collision with NDIS SetOID request
if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
+ {
pAd->RalinkCounters.PoorCQIRoamingCount ++;
DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming attempt #%ld\n", pAd->RalinkCounters.PoorCQIRoamingCount));
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_MLME_ROAMING_REQ, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
- }
- }
- // Maybe site survey required
- else
- {
- if ((pAd->StaCfg.LastScanTime + 10 * 1000) < Now)
- {
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming, No eligable entry, try new scan!\n"));
- pAd->StaCfg.ScanCnt = 2;
- pAd->StaCfg.LastScanTime = Now;
- MlmeAutoScan(pAd);
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeCheckForFastRoaming (BssNr=%d)\n", pRoamTab->BssNr));
-}
-
-/*
- ==========================================================================
- Description:
- This routine calculates TxPER, RxPER of the past N-sec period. And
- according to the calculation result, ChannelQuality is calculated here
- to decide if current AP is still doing the job.
-
- If ChannelQuality is not good, a ROAMing attempt may be tried later.
- Output:
- StaCfg.ChannelQuality - 0..100
-
- IRQL = DISPATCH_LEVEL
-
- NOTE: This routine decide channle quality based on RX CRC error ratio.
- Caller should make sure a function call to NICUpdateRawCounters(pAd)
- is performed right before this routine, so that this routine can decide
- channel quality based on the most up-to-date information
- ==========================================================================
- */
-VOID MlmeCalculateChannelQuality(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now32)
-{
- ULONG TxOkCnt, TxCnt, TxPER, TxPRR;
- ULONG RxCnt, RxPER;
- UCHAR NorRssi;
- CHAR MaxRssi;
- ULONG BeaconLostTime = BEACON_LOST_TIME;
-
- MaxRssi = RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2);
-
- //
- // calculate TX packet error ratio and TX retry ratio - if too few TX samples, skip TX related statistics
- //
- TxOkCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount + pAd->RalinkCounters.OneSecTxRetryOkCount;
- TxCnt = TxOkCnt + pAd->RalinkCounters.OneSecTxFailCount;
- if (TxCnt < 5)
- {
- TxPER = 0;
- TxPRR = 0;
- }
- else
- {
- TxPER = (pAd->RalinkCounters.OneSecTxFailCount * 100) / TxCnt;
- TxPRR = ((TxCnt - pAd->RalinkCounters.OneSecTxNoRetryOkCount) * 100) / TxCnt;
- }
-
- //
- // calculate RX PER - don't take RxPER into consideration if too few sample
- //
- RxCnt = pAd->RalinkCounters.OneSecRxOkCnt + pAd->RalinkCounters.OneSecRxFcsErrCnt;
- if (RxCnt < 5)
- RxPER = 0;
- else
- RxPER = (pAd->RalinkCounters.OneSecRxFcsErrCnt * 100) / RxCnt;
-
- //
- // decide ChannelQuality based on: 1)last BEACON received time, 2)last RSSI, 3)TxPER, and 4)RxPER
- //
- if (INFRA_ON(pAd) &&
- (pAd->RalinkCounters.OneSecTxNoRetryOkCount < 2) && // no heavy traffic
- (pAd->StaCfg.LastBeaconRxTime + BeaconLostTime < Now32))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("BEACON lost > %ld msec with TxOkCnt=%ld -> CQI=0\n", BeaconLostTime, TxOkCnt));
- pAd->Mlme.ChannelQuality = 0;
- }
- else
- {
- // Normalize Rssi
- if (MaxRssi > -40)
- NorRssi = 100;
- else if (MaxRssi < -90)
- NorRssi = 0;
- else
- NorRssi = (MaxRssi + 90) * 2;
-
- // ChannelQuality = W1*RSSI + W2*TxPRR + W3*RxPER (RSSI 0..100), (TxPER 100..0), (RxPER 100..0)
- pAd->Mlme.ChannelQuality = (RSSI_WEIGHTING * NorRssi +
- TX_WEIGHTING * (100 - TxPRR) +
- RX_WEIGHTING* (100 - RxPER)) / 100;
- if (pAd->Mlme.ChannelQuality >= 100)
- pAd->Mlme.ChannelQuality = 100;
- }
+ RTMP_MLME_HANDLER(pAd);
+ return TRUE;
+ }
+ }
+ return FALSE;
}
VOID MlmeSetTxRate(
@@ -1887,7 +1704,7 @@ VOID MlmeSetTxRate(
if (pTxRate->STBC && (pAd->StaCfg.MaxHTPhyMode.field.STBC) && (pAd->Antenna.field.TxPath == 2))
pAd->StaCfg.HTPhyMode.field.STBC = STBC_USE;
- else
+ else
pAd->StaCfg.HTPhyMode.field.STBC = STBC_NONE;
if (pTxRate->CurrMCS < MCS_AUTO)
@@ -1896,8 +1713,8 @@ VOID MlmeSetTxRate(
if (pAd->StaCfg.HTPhyMode.field.MCS > 7)
pAd->StaCfg.HTPhyMode.field.STBC = STBC_NONE;
- if (ADHOC_ON(pAd))
- {
+ if (ADHOC_ON(pAd))
+ {
// If peer adhoc is b-only mode, we can't send 11g rate.
pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
pEntry->HTPhyMode.field.STBC = STBC_NONE;
@@ -1911,13 +1728,13 @@ VOID MlmeSetTxRate(
// Patch speed error in status page
pAd->StaCfg.HTPhyMode.field.MODE = pEntry->HTPhyMode.field.MODE;
- }
- else
- {
+ }
+ else
+ {
if (pTxRate->Mode <= MaxMode)
- pAd->StaCfg.HTPhyMode.field.MODE = pTxRate->Mode;
+ pAd->StaCfg.HTPhyMode.field.MODE = pTxRate->Mode;
- if (pTxRate->ShortGI && (pAd->StaCfg.MaxHTPhyMode.field.ShortGI))
+ if (pTxRate->ShortGI && (pAd->StaCfg.MaxHTPhyMode.field.ShortGI))
pAd->StaCfg.HTPhyMode.field.ShortGI = GI_400;
else
pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
@@ -1931,52 +1748,51 @@ VOID MlmeSetTxRate(
pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
}
- // Turn RTS/CTS rate to 6Mbps.
+ // Turn RTS/CTS rate to 6Mbps.
if ((pEntry->HTPhyMode.field.MCS == 0) && (pAd->StaCfg.HTPhyMode.field.MCS != 0))
- {
+ {
pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
if (pAd->MacTab.fAnyBASession)
{
AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
+ }
else
{
AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
+ }
}
- }
else if ((pEntry->HTPhyMode.field.MCS == 8) && (pAd->StaCfg.HTPhyMode.field.MCS != 8))
- {
+ {
pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
if (pAd->MacTab.fAnyBASession)
- {
+ {
AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
- else
- {
+ }
+ else
+ {
AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
+ }
}
- }
else if ((pEntry->HTPhyMode.field.MCS != 0) && (pAd->StaCfg.HTPhyMode.field.MCS == 0))
- {
+ {
AsicUpdateProtect(pAd, HT_RTSCTS_6M, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
+ }
else if ((pEntry->HTPhyMode.field.MCS != 8) && (pAd->StaCfg.HTPhyMode.field.MCS == 8))
- {
+ {
AsicUpdateProtect(pAd, HT_RTSCTS_6M, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
+ }
pEntry->HTPhyMode.field.STBC = pAd->StaCfg.HTPhyMode.field.STBC;
pEntry->HTPhyMode.field.ShortGI = pAd->StaCfg.HTPhyMode.field.ShortGI;
pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
+ if ((pAd->StaCfg.MaxHTPhyMode.field.MODE == MODE_HTGREENFIELD) &&
+ pAd->WIFItestbed.bGreenField)
+ pEntry->HTPhyMode.field.MODE = MODE_HTGREENFIELD;
+ }
- if ((pAd->StaCfg.MaxHTPhyMode.field.MODE == MODE_HTGREENFIELD) &&
- pAd->WIFItestbed.bGreenField)
- pEntry->HTPhyMode.field.MODE = MODE_HTGREENFIELD;
- }
-
- pAd->LastTxRate = (USHORT)(pEntry->HTPhyMode.word);
+ pAd->LastTxRate = (USHORT)(pEntry->HTPhyMode.word);
}
/*
@@ -2002,7 +1818,7 @@ VOID MlmeDynamicTxRateSwitching(
UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx;
ULONG i, AccuTxTotalCnt = 0, TxTotalCnt;
ULONG TxErrorRatio = 0;
- BOOLEAN bTxRateChanged, bUpgradeQuality = FALSE;
+ BOOLEAN bTxRateChanged = FALSE, bUpgradeQuality = FALSE;
PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL;
PUCHAR pTable;
UCHAR TableSize = 0;
@@ -2012,29 +1828,26 @@ VOID MlmeDynamicTxRateSwitching(
TX_STA_CNT0_STRUC TxStaCnt0;
ULONG TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0;
MAC_TABLE_ENTRY *pEntry;
+ RSSI_SAMPLE *pRssi = &pAd->StaCfg.RssiSample;
+
//
// walk through MAC table, see if need to change AP's TX rate toward each entry
//
- for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
+ for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
{
pEntry = &pAd->MacTab.Content[i];
- // check if this entry need to switch rate automatically
+ // check if this entry need to switch rate automatically
if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pEntry) == FALSE)
continue;
if ((pAd->MacTab.Size == 1) || (pEntry->ValidAsDls))
{
-#ifdef RT2860
- Rssi = RTMPMaxRssi(pAd, (CHAR)pAd->StaCfg.RssiSample.AvgRssi0, (CHAR)pAd->StaCfg.RssiSample.AvgRssi1, (CHAR)pAd->StaCfg.RssiSample.AvgRssi2);
-#endif
-#ifdef RT2870
Rssi = RTMPMaxRssi(pAd,
- pAd->StaCfg.RssiSample.AvgRssi0,
- pAd->StaCfg.RssiSample.AvgRssi1,
- pAd->StaCfg.RssiSample.AvgRssi2);
-#endif
+ pRssi->AvgRssi0,
+ pRssi->AvgRssi1,
+ pRssi->AvgRssi2);
// Update statistic counter
RTMP_IO_READ32(pAd, TX_STA_CNT0, &TxStaCnt0.word);
@@ -2063,22 +1876,17 @@ VOID MlmeDynamicTxRateSwitching(
TxErrorRatio = ((TxRetransmit + TxFailCount) * 100) / TxTotalCnt;
}
else
- {
-#ifdef RT2860
- Rssi = RTMPMaxRssi(pAd, (CHAR)pEntry->RssiSample.AvgRssi0, (CHAR)pEntry->RssiSample.AvgRssi1, (CHAR)pEntry->RssiSample.AvgRssi2);
-#endif
-#ifdef RT2870
+ {
if (INFRA_ON(pAd) && (i == 1))
Rssi = RTMPMaxRssi(pAd,
- pAd->StaCfg.RssiSample.AvgRssi0,
- pAd->StaCfg.RssiSample.AvgRssi1,
- pAd->StaCfg.RssiSample.AvgRssi2);
+ pRssi->AvgRssi0,
+ pRssi->AvgRssi1,
+ pRssi->AvgRssi2);
else
Rssi = RTMPMaxRssi(pAd,
pEntry->RssiSample.AvgRssi0,
pEntry->RssiSample.AvgRssi1,
pEntry->RssiSample.AvgRssi2);
-#endif
TxTotalCnt = pEntry->OneSecTxNoRetryOkCount +
pEntry->OneSecTxRetryOkCount +
@@ -2086,7 +1894,45 @@ VOID MlmeDynamicTxRateSwitching(
if (TxTotalCnt)
TxErrorRatio = ((pEntry->OneSecTxRetryOkCount + pEntry->OneSecTxFailCount) * 100) / TxTotalCnt;
+ }
+
+ if (TxTotalCnt)
+ {
+ /*
+ Three AdHoc connections can not work normally if one AdHoc connection is disappeared from a heavy traffic environment generated by ping tool
+ We force to set LongRtyLimit and ShortRtyLimit to 0 to stop retransmitting packet, after a while, resoring original settings
+ */
+ if (TxErrorRatio == 100)
+ {
+ TX_RTY_CFG_STRUC TxRtyCfg,TxRtyCfgtmp;
+ ULONG Index;
+ ULONG MACValue;
+
+ RTMP_IO_READ32(pAd, TX_RTY_CFG, &TxRtyCfg.word);
+ TxRtyCfgtmp.word = TxRtyCfg.word;
+ TxRtyCfg.field.LongRtyLimit = 0x0;
+ TxRtyCfg.field.ShortRtyLimit = 0x0;
+ RTMP_IO_WRITE32(pAd, TX_RTY_CFG, TxRtyCfg.word);
+
+ RTMPusecDelay(1);
+
+ Index = 0;
+ MACValue = 0;
+ do
+ {
+ RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
+ if ((MACValue & 0xffffff) == 0)
+ break;
+ Index++;
+ RTMPusecDelay(1000);
+ }while((Index < 330)&&(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)));
+
+ RTMP_IO_READ32(pAd, TX_RTY_CFG, &TxRtyCfg.word);
+ TxRtyCfg.field.LongRtyLimit = TxRtyCfgtmp.field.LongRtyLimit;
+ TxRtyCfg.field.ShortRtyLimit = TxRtyCfgtmp.field.ShortRtyLimit;
+ RTMP_IO_WRITE32(pAd, TX_RTY_CFG, TxRtyCfg.word);
}
+ }
CurrRateIdx = pEntry->CurrTxRateIndex;
@@ -2118,33 +1964,33 @@ VOID MlmeDynamicTxRateSwitching(
// decide the next upgrade rate and downgrade rate, if any
if ((CurrRateIdx > 0) && (CurrRateIdx < (TableSize - 1)))
- {
+ {
UpRateIdx = CurrRateIdx + 1;
DownRateIdx = CurrRateIdx -1;
- }
+ }
else if (CurrRateIdx == 0)
{
UpRateIdx = CurrRateIdx + 1;
DownRateIdx = CurrRateIdx;
}
else if (CurrRateIdx == (TableSize - 1))
- {
+ {
UpRateIdx = CurrRateIdx;
DownRateIdx = CurrRateIdx - 1;
- }
+ }
pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(CurrRateIdx+1)*5];
if ((Rssi > -65) && (pCurrTxRate->Mode >= MODE_HTMIX))
- {
+ {
TrainUp = (pCurrTxRate->TrainUp + (pCurrTxRate->TrainUp >> 1));
TrainDown = (pCurrTxRate->TrainDown + (pCurrTxRate->TrainDown >> 1));
- }
- else
- {
+ }
+ else
+ {
TrainUp = pCurrTxRate->TrainUp;
TrainDown = pCurrTxRate->TrainDown;
- }
+ }
//pAd->DrsCounters.LastTimeTxRateChangeAction = pAd->DrsCounters.LastSecTxRateChangeAction;
@@ -2160,10 +2006,9 @@ VOID MlmeDynamicTxRateSwitching(
// (criteria copied from RT2500 for Netopia case)
//
if (TxTotalCnt <= 15)
- {
+ {
CHAR idx = 0;
UCHAR TxRateIdx;
- //UCHAR MCS0 = 0, MCS1 = 0, MCS2 = 0, MCS3 = 0, MCS4 = 0, MCS7 = 0, MCS12 = 0, MCS13 = 0, MCS14 = 0, MCS15 = 0;
UCHAR MCS0 = 0, MCS1 = 0, MCS2 = 0, MCS3 = 0, MCS4 = 0, MCS5 =0, MCS6 = 0, MCS7 = 0;
UCHAR MCS12 = 0, MCS13 = 0, MCS14 = 0, MCS15 = 0;
UCHAR MCS20 = 0, MCS21 = 0, MCS22 = 0, MCS23 = 0; // 3*3
@@ -2174,54 +2019,55 @@ VOID MlmeDynamicTxRateSwitching(
pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(idx+1)*5];
if (pCurrTxRate->CurrMCS == MCS_0)
- {
+ {
MCS0 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_1)
- {
+ {
MCS1 = idx;
}
else if (pCurrTxRate->CurrMCS == MCS_2)
- {
+ {
MCS2 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_3)
- {
+ {
MCS3 = idx;
}
else if (pCurrTxRate->CurrMCS == MCS_4)
{
MCS4 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_5)
{
MCS5 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_6)
- {
+ {
MCS6 = idx;
}
//else if (pCurrTxRate->CurrMCS == MCS_7)
else if ((pCurrTxRate->CurrMCS == MCS_7) && (pCurrTxRate->ShortGI == GI_800)) // prevent the highest MCS using short GI when 1T and low throughput
- {
+ {
MCS7 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_12)
- {
+ {
MCS12 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_13)
{
MCS13 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_14)
- {
+ {
MCS14 = idx;
- }
+ }
+ //else if ((pCurrTxRate->CurrMCS == MCS_15)/* && (pCurrTxRate->ShortGI == GI_800)*/) //we hope to use ShortGI as initial rate
else if ((pCurrTxRate->CurrMCS == MCS_15) && (pCurrTxRate->ShortGI == GI_800)) //we hope to use ShortGI as initial rate, however Atheros's chip has bugs when short GI
- {
+ {
MCS15 = idx;
- }
+ }
else if (pCurrTxRate->CurrMCS == MCS_20) // 3*3
{
MCS20 = idx;
@@ -2270,13 +2116,13 @@ VOID MlmeDynamicTxRateSwitching(
(pTable == RateSwitchTable))
{// N mode with 3 stream // 3*3
if (MCS23 && (Rssi >= -70))
- TxRateIdx = MCS15;
+ TxRateIdx = MCS23;
else if (MCS22 && (Rssi >= -72))
- TxRateIdx = MCS14;
+ TxRateIdx = MCS22;
else if (MCS21 && (Rssi >= -76))
- TxRateIdx = MCS13;
+ TxRateIdx = MCS21;
else if (MCS20 && (Rssi >= -78))
- TxRateIdx = MCS12;
+ TxRateIdx = MCS20;
else if (MCS4 && (Rssi >= -82))
TxRateIdx = MCS4;
else if (MCS3 && (Rssi >= -84))
@@ -2288,6 +2134,7 @@ VOID MlmeDynamicTxRateSwitching(
else
TxRateIdx = MCS0;
}
+// else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand) || (pTable == RateSwitchTable))
else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand)) // 3*3
{// N mode with 2 stream
if (MCS15 && (Rssi >= (-70+RssiOffset)))
@@ -2350,6 +2197,7 @@ VOID MlmeDynamicTxRateSwitching(
TxRateIdx = MCS0;
}
+ // if (TxRateIdx != pAd->CommonCfg.TxRateIndex)
{
pEntry->CurrTxRateIndex = TxRateIdx;
pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pEntry->CurrTxRateIndex+1)*5];
@@ -2464,15 +2312,29 @@ VOID MlmeDynamicTxRateSwitching(
}
pEntry->LastTxOkCount = TxSuccess;
+ {
+ UCHAR tmpTxRate;
- // reset all OneSecTx counters
- RESET_ONE_SEC_TX_CNT(pEntry);
+ // to fix tcp ack issue
+ if (!bTxRateChanged && (pAd->RalinkCounters.OneSecReceivedByteCount > (pAd->RalinkCounters.OneSecTransmittedByteCount * 5)))
+ {
+ tmpTxRate = DownRateIdx;
+ DBGPRINT_RAW(RT_DEBUG_TRACE,("DRS: Rx(%d) is 5 times larger than Tx(%d), use low rate (curr=%d, tmp=%d)\n",
+ pAd->RalinkCounters.OneSecReceivedByteCount, pAd->RalinkCounters.OneSecTransmittedByteCount, pEntry->CurrTxRateIndex, tmpTxRate));
+ }
+ else
+ {
+ tmpTxRate = pEntry->CurrTxRateIndex;
+ }
- pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pEntry->CurrTxRateIndex+1)*5];
+ pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(tmpTxRate+1)*5];
+ }
if (bTxRateChanged && pNextTxRate)
{
MlmeSetTxRate(pAd, pEntry, pNextTxRate);
}
+ // reset all OneSecTx counters
+ RESET_ONE_SEC_TX_CNT(pEntry);
}
}
@@ -2502,12 +2364,7 @@ VOID StaQuickResponeForRateUpExec(
UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx = 0;
ULONG TxTotalCnt;
ULONG TxErrorRatio = 0;
-#ifdef RT2860
- BOOLEAN bTxRateChanged = TRUE; //, bUpgradeQuality = FALSE;
-#endif
-#ifdef RT2870
BOOLEAN bTxRateChanged; //, bUpgradeQuality = FALSE;
-#endif
PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL;
PUCHAR pTable;
UCHAR TableSize = 0;
@@ -2532,14 +2389,6 @@ VOID StaQuickResponeForRateUpExec(
if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pEntry) == FALSE)
continue;
-#ifdef RT2860
- //Rssi = RTMPMaxRssi(pAd, (CHAR)pAd->StaCfg.AvgRssi0, (CHAR)pAd->StaCfg.AvgRssi1, (CHAR)pAd->StaCfg.AvgRssi2);
- if (pAd->Antenna.field.TxPath > 1)
- Rssi = (pAd->StaCfg.RssiSample.AvgRssi0 + pAd->StaCfg.RssiSample.AvgRssi1) >> 1;
- else
- Rssi = pAd->StaCfg.RssiSample.AvgRssi0;
-#endif
-#ifdef RT2870
if (INFRA_ON(pAd) && (i == 1))
Rssi = RTMPMaxRssi(pAd,
pAd->StaCfg.RssiSample.AvgRssi0,
@@ -2550,7 +2399,6 @@ VOID StaQuickResponeForRateUpExec(
pEntry->RssiSample.AvgRssi0,
pEntry->RssiSample.AvgRssi1,
pEntry->RssiSample.AvgRssi2);
-#endif
CurrRateIdx = pAd->CommonCfg.TxRateIndex;
@@ -2690,9 +2538,7 @@ VOID StaQuickResponeForRateUpExec(
pAd->DrsCounters.TxRateUpPenalty = 0;
NdisZeroMemory(pAd->DrsCounters.TxQuality, sizeof(USHORT) * MAX_STEP_OF_TX_RATE_SWITCH);
NdisZeroMemory(pAd->DrsCounters.PER, sizeof(UCHAR) * MAX_STEP_OF_TX_RATE_SWITCH);
-#ifdef RT2870
bTxRateChanged = TRUE;
-#endif
}
// if rate-down happen, only clear DownRate's bad history
else if (pAd->CommonCfg.TxRateIndex < CurrRateIdx)
@@ -2702,9 +2548,7 @@ VOID StaQuickResponeForRateUpExec(
pAd->DrsCounters.TxRateUpPenalty = 0; // no penalty
pAd->DrsCounters.TxQuality[pAd->CommonCfg.TxRateIndex] = 0;
pAd->DrsCounters.PER[pAd->CommonCfg.TxRateIndex] = 0;
-#ifdef RT2870
bTxRateChanged = TRUE;
-#endif
}
else
{
@@ -2750,34 +2594,21 @@ VOID MlmeCheckPsmChange(
// 3. but current psm is not in PWR_SAVE
// 4. CNTL state machine is not doing SCANning
// 5. no TX SUCCESS event for the past 1-sec period
-#ifdef NDIS51_MINIPORT
- if (pAd->StaCfg.WindowsPowerProfile == NdisPowerProfileBattery)
- PowerMode = pAd->StaCfg.WindowsBatteryPowerMode;
- else
-#endif
PowerMode = pAd->StaCfg.WindowsPowerMode;
if (INFRA_ON(pAd) &&
(PowerMode != Ndis802_11PowerModeCAM) &&
(pAd->StaCfg.Psm == PWR_ACTIVE) &&
-#ifdef RT2860
- RTMP_TEST_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP))
-#else
- (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE))
-#endif
+// (! RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
+ (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)&&
+ RTMP_TEST_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP)
+ /*&&
+ (pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
+ (pAd->RalinkCounters.OneSecTxRetryOkCount == 0)*/)
{
- // add by johnli, use Rx OK data count per second to calculate throughput
- // If Ttraffic is too high ( > 400 Rx per second), don't go to sleep mode. If tx rate is low, use low criteria
- // Mode=CCK/MCS=3 => 11 Mbps, Mode=OFDM/MCS=3 => 18 Mbps
- if (((pAd->StaCfg.HTPhyMode.field.MCS <= 3) &&
- (pAd->RalinkCounters.OneSecRxOkDataCnt < (ULONG)100)) ||
- ((pAd->StaCfg.HTPhyMode.field.MCS > 3) &&
- (pAd->RalinkCounters.OneSecRxOkDataCnt < (ULONG)400)))
- {
- // Get this time
NdisGetSystemUpTime(&pAd->Mlme.LastSendNULLpsmTime);
pAd->RalinkCounters.RxCountSinceLastNULL = 0;
- MlmeSetPsmBit(pAd, PWR_SAVE);
+ RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
if (!(pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable))
{
RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, FALSE);
@@ -2787,7 +2618,6 @@ VOID MlmeCheckPsmChange(
RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
}
}
- }
}
// IRQL = PASSIVE_LEVEL
@@ -2806,6 +2636,118 @@ VOID MlmeSetPsmBit(
DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetPsmBit = %d\n", psm));
}
+/*
+ ==========================================================================
+ Description:
+ This routine calculates TxPER, RxPER of the past N-sec period. And
+ according to the calculation result, ChannelQuality is calculated here
+ to decide if current AP is still doing the job.
+
+ If ChannelQuality is not good, a ROAMing attempt may be tried later.
+ Output:
+ StaCfg.ChannelQuality - 0..100
+
+ IRQL = DISPATCH_LEVEL
+
+ NOTE: This routine decide channle quality based on RX CRC error ratio.
+ Caller should make sure a function call to NICUpdateRawCounters(pAd)
+ is performed right before this routine, so that this routine can decide
+ channel quality based on the most up-to-date information
+ ==========================================================================
+ */
+VOID MlmeCalculateChannelQuality(
+ IN PRTMP_ADAPTER pAd,
+ IN PMAC_TABLE_ENTRY pMacEntry,
+ IN ULONG Now32)
+{
+ ULONG TxOkCnt, TxCnt, TxPER, TxPRR;
+ ULONG RxCnt, RxPER;
+ UCHAR NorRssi;
+ CHAR MaxRssi;
+ RSSI_SAMPLE *pRssiSample = NULL;
+ UINT32 OneSecTxNoRetryOkCount = 0;
+ UINT32 OneSecTxRetryOkCount = 0;
+ UINT32 OneSecTxFailCount = 0;
+ UINT32 OneSecRxOkCnt = 0;
+ UINT32 OneSecRxFcsErrCnt = 0;
+ ULONG ChannelQuality = 0; // 0..100, Channel Quality Indication for Roaming
+ ULONG BeaconLostTime = pAd->StaCfg.BeaconLostTime;
+
+
+ if (pAd->OpMode == OPMODE_STA)
+ {
+ pRssiSample = &pAd->StaCfg.RssiSample;
+ OneSecTxNoRetryOkCount = pAd->RalinkCounters.OneSecTxNoRetryOkCount;
+ OneSecTxRetryOkCount = pAd->RalinkCounters.OneSecTxRetryOkCount;
+ OneSecTxFailCount = pAd->RalinkCounters.OneSecTxFailCount;
+ OneSecRxOkCnt = pAd->RalinkCounters.OneSecRxOkCnt;
+ OneSecRxFcsErrCnt = pAd->RalinkCounters.OneSecRxFcsErrCnt;
+ }
+
+ MaxRssi = RTMPMaxRssi(pAd, pRssiSample->LastRssi0,
+ pRssiSample->LastRssi1,
+ pRssiSample->LastRssi2);
+
+ //
+ // calculate TX packet error ratio and TX retry ratio - if too few TX samples, skip TX related statistics
+ //
+ TxOkCnt = OneSecTxNoRetryOkCount + OneSecTxRetryOkCount;
+ TxCnt = TxOkCnt + OneSecTxFailCount;
+ if (TxCnt < 5)
+ {
+ TxPER = 0;
+ TxPRR = 0;
+ }
+ else
+ {
+ TxPER = (OneSecTxFailCount * 100) / TxCnt;
+ TxPRR = ((TxCnt - OneSecTxNoRetryOkCount) * 100) / TxCnt;
+ }
+
+ //
+ // calculate RX PER - don't take RxPER into consideration if too few sample
+ //
+ RxCnt = OneSecRxOkCnt + OneSecRxFcsErrCnt;
+ if (RxCnt < 5)
+ RxPER = 0;
+ else
+ RxPER = (OneSecRxFcsErrCnt * 100) / RxCnt;
+
+ //
+ // decide ChannelQuality based on: 1)last BEACON received time, 2)last RSSI, 3)TxPER, and 4)RxPER
+ //
+ if ((pAd->OpMode == OPMODE_STA) &&
+ INFRA_ON(pAd) &&
+ (OneSecTxNoRetryOkCount < 2) && // no heavy traffic
+ ((pAd->StaCfg.LastBeaconRxTime + BeaconLostTime) < Now32))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("BEACON lost > %ld msec with TxOkCnt=%ld -> CQI=0\n", BeaconLostTime, TxOkCnt));
+ ChannelQuality = 0;
+ }
+ else
+ {
+ // Normalize Rssi
+ if (MaxRssi > -40)
+ NorRssi = 100;
+ else if (MaxRssi < -90)
+ NorRssi = 0;
+ else
+ NorRssi = (MaxRssi + 90) * 2;
+
+ // ChannelQuality = W1*RSSI + W2*TxPRR + W3*RxPER (RSSI 0..100), (TxPER 100..0), (RxPER 100..0)
+ ChannelQuality = (RSSI_WEIGHTING * NorRssi +
+ TX_WEIGHTING * (100 - TxPRR) +
+ RX_WEIGHTING* (100 - RxPER)) / 100;
+ }
+
+
+ if (pAd->OpMode == OPMODE_STA)
+ pAd->Mlme.ChannelQuality = (ChannelQuality > 100) ? 100 : ChannelQuality;
+
+
+}
+
+
// IRQL = DISPATCH_LEVEL
VOID MlmeSetTxPreamble(
IN PRTMP_ADAPTER pAd,
@@ -2968,23 +2910,29 @@ VOID MlmeUpdateTxRates(
// specified; otherwise disabled
if (num <= 1)
{
+ //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
+ //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
*auto_rate_cur_p = FALSE;
}
else
{
+ //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
+ //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
*auto_rate_cur_p = TRUE;
}
-#if 1
if (HtMcs != MCS_AUTO)
{
+ //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
+ //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
*auto_rate_cur_p = FALSE;
}
else
{
+ //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
+ //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
*auto_rate_cur_p = TRUE;
}
-#endif
if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA))
{
@@ -3050,6 +2998,9 @@ VOID MlmeUpdateTxRates(
RTMP_IO_WRITE32(pAd, LEGACY_BASIC_RATE, BasicRateBitmap);
+ // bug fix
+ // pAd->CommonCfg.BasicRateBitmap = BasicRateBitmap;
+
// calculate the exptected ACK rate for each TX rate. This info is used to caculate
// the DURATION field of outgoing uniicast DATA/MGMT frame
for (i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
@@ -3067,6 +3018,14 @@ VOID MlmeUpdateTxRates(
pAd->CommonCfg.MaxTxRate = MaxDesire;
pAd->CommonCfg.MinTxRate = MinSupport;
+ // 2003-07-31 john - 2500 doesn't have good sensitivity at high OFDM rates. to increase the success
+ // ratio of initial DHCP packet exchange, TX rate starts from a lower rate depending
+ // on average RSSI
+ // 1. RSSI >= -70db, start at 54 Mbps (short distance)
+ // 2. -70 > RSSI >= -75, start at 24 Mbps (mid distance)
+ // 3. -75 > RSSI, start at 11 Mbps (long distance)
+ //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED)/* &&
+ // OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)*/)
if (*auto_rate_cur_p)
{
short dbm = 0;
@@ -3134,7 +3093,12 @@ VOID MlmeUpdateTxRates(
pAd->CommonCfg.MlmeRate = RATE_1;
pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1;
+
+//#ifdef WIFI_TEST
pAd->CommonCfg.RtsRate = RATE_11;
+//#else
+// pAd->CommonCfg.RtsRate = RATE_1;
+//#endif
break;
case PHY_11G:
case PHY_11A:
@@ -3151,23 +3115,23 @@ VOID MlmeUpdateTxRates(
case PHY_11ABG_MIXED:
case PHY_11ABGN_MIXED:
if (pAd->CommonCfg.Channel <= 14)
- {
+ {
pAd->CommonCfg.MlmeRate = RATE_1;
pAd->CommonCfg.RtsRate = RATE_1;
pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1;
- }
+ }
else
- {
+ {
pAd->CommonCfg.MlmeRate = RATE_6;
pAd->CommonCfg.RtsRate = RATE_6;
pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- }
+ }
break;
default: // error
pAd->CommonCfg.MlmeRate = RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
+ pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
pAd->CommonCfg.RtsRate = RATE_1;
break;
@@ -3198,19 +3162,19 @@ VOID MlmeUpdateTxRates(
This function update HT Rate setting.
Input Wcid value is valid for 2 case :
1. it's used for Station in infra mode that copy AP rate to Mactable.
- 2. OR Station in adhoc mode to copy peer's HT rate to Mactable.
+ 2. OR Station in adhoc mode to copy peer's HT rate to Mactable.
- IRQL = DISPATCH_LEVEL
+ IRQL = DISPATCH_LEVEL
==========================================================================
*/
VOID MlmeUpdateHtTxRates(
- IN PRTMP_ADAPTER pAd,
+ IN PRTMP_ADAPTER pAd,
IN UCHAR apidx)
{
UCHAR StbcMcs; //j, StbcMcs, bitmask;
- CHAR i; // 3*3
- RT_HT_CAPABILITY *pRtHtCap = NULL;
+ CHAR i; // 3*3
+ RT_HT_CAPABILITY *pRtHtCap = NULL;
RT_HT_PHY_INFO *pActiveHtPhy = NULL;
ULONG BasicMCS;
UCHAR j, bitmask;
@@ -3218,7 +3182,7 @@ VOID MlmeUpdateHtTxRates(
PHTTRANSMIT_SETTING pHtPhy = NULL;
PHTTRANSMIT_SETTING pMaxHtPhy = NULL;
PHTTRANSMIT_SETTING pMinHtPhy = NULL;
- BOOLEAN *auto_rate_cur_p;
+ BOOLEAN *auto_rate_cur_p;
DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates===> \n"));
@@ -3227,7 +3191,7 @@ VOID MlmeUpdateHtTxRates(
{
pDesireHtPhy = &pAd->StaCfg.DesiredHtPhyInfo;
pActiveHtPhy = &pAd->StaCfg.DesiredHtPhyInfo;
- pHtPhy = &pAd->StaCfg.HTPhyMode;
+ pHtPhy = &pAd->StaCfg.HTPhyMode;
pMaxHtPhy = &pAd->StaCfg.MaxHTPhyMode;
pMinHtPhy = &pAd->StaCfg.MinHTPhyMode;
@@ -3278,16 +3242,21 @@ VOID MlmeUpdateHtTxRates(
else
pMaxHtPhy->field.ShortGI = (pAd->CommonCfg.DesiredHtPhy.ShortGIfor40 & pRtHtCap->ShortGIfor40);
+ if (pDesireHtPhy->MCSSet[4] != 0)
+ {
+ pMaxHtPhy->field.MCS = 32;
+ }
+
for (i=23; i>=0; i--) // 3*3
{
j = i/8;
bitmask = (1<<(i-(j*8)));
if ((pActiveHtPhy->MCSSet[j] & bitmask) && (pDesireHtPhy->MCSSet[j] & bitmask))
- {
+ {
pMaxHtPhy->field.MCS = i;
break;
- }
+ }
if (i==0)
break;
@@ -3302,26 +3271,27 @@ VOID MlmeUpdateHtTxRates(
if ( (pAd->OpMode == OPMODE_STA) && (pDesireHtPhy->MCSSet[0] != 0xff))
{
if (pDesireHtPhy->MCSSet[4] != 0)
- {
+ {
pMaxHtPhy->field.MCS = 32;
pMinHtPhy->field.MCS = 32;
DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates<=== Use Fixed MCS = %d\n",pMinHtPhy->field.MCS));
- }
+ }
for (i=23; (CHAR)i >= 0; i--) // 3*3
- {
+ {
j = i/8;
bitmask = (1<<(i-(j*8)));
if ( (pDesireHtPhy->MCSSet[j] & bitmask) && (pActiveHtPhy->MCSSet[j] & bitmask))
- {
+ {
pMaxHtPhy->field.MCS = i;
pMinHtPhy->field.MCS = i;
break;
- }
+ }
if (i==0)
break;
- }
}
+ }
+
// Decide ht rate
pHtPhy->field.STBC = pMaxHtPhy->field.STBC;
@@ -3342,18 +3312,40 @@ VOID MlmeUpdateHtTxRates(
DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates<=== \n"));
}
+
+VOID BATableInit(
+ IN PRTMP_ADAPTER pAd,
+ IN BA_TABLE *Tab)
+{
+ int i;
+
+ Tab->numAsOriginator = 0;
+ Tab->numAsRecipient = 0;
+ Tab->numDoneOriginator = 0;
+ NdisAllocateSpinLock(&pAd->BATabLock);
+ for (i = 0; i < MAX_LEN_OF_BA_REC_TABLE; i++)
+ {
+ Tab->BARecEntry[i].REC_BA_Status = Recipient_NONE;
+ NdisAllocateSpinLock(&(Tab->BARecEntry[i].RxReRingLock));
+ }
+ for (i = 0; i < MAX_LEN_OF_BA_ORI_TABLE; i++)
+ {
+ Tab->BAOriEntry[i].ORI_BA_Status = Originator_NONE;
+ }
+}
+
// IRQL = DISPATCH_LEVEL
VOID MlmeRadioOff(
IN PRTMP_ADAPTER pAd)
{
- RT28XX_MLME_RADIO_OFF(pAd);
+ RTMP_MLME_RADIO_OFF(pAd);
}
// IRQL = DISPATCH_LEVEL
VOID MlmeRadioOn(
IN PRTMP_ADAPTER pAd)
{
- RT28XX_MLME_RADIO_ON(pAd);
+ RTMP_MLME_RADIO_ON(pAd);
}
// ===========================================================================================
@@ -3379,31 +3371,12 @@ VOID BssTableInit(
Tab->BssNr = 0;
Tab->BssOverlapNr = 0;
for (i = 0; i < MAX_LEN_OF_BSS_TABLE; i++)
- {
+ {
NdisZeroMemory(&Tab->BssEntry[i], sizeof(BSS_ENTRY));
Tab->BssEntry[i].Rssi = -127; // initial the rssi as a minimum value
}
}
-VOID BATableInit(
- IN PRTMP_ADAPTER pAd,
- IN BA_TABLE *Tab)
-{
- int i;
-
- Tab->numAsOriginator = 0;
- Tab->numAsRecipient = 0;
- NdisAllocateSpinLock(&pAd->BATabLock);
- for (i = 0; i < MAX_LEN_OF_BA_REC_TABLE; i++)
- {
- Tab->BARecEntry[i].REC_BA_Status = Recipient_NONE;
- NdisAllocateSpinLock(&(Tab->BARecEntry[i].RxReRingLock));
- }
- for (i = 0; i < MAX_LEN_OF_BA_ORI_TABLE; i++)
- {
- Tab->BAOriEntry[i].ORI_BA_Status = Originator_NONE;
- }
-}
/*! \brief search the BSS table by SSID
* \param p_tab pointer to the bss table
@@ -3489,6 +3462,25 @@ ULONG BssTableSearchWithSSID(
return (ULONG)BSS_NOT_FOUND;
}
+
+ULONG BssSsidTableSearchBySSID(
+ IN BSS_TABLE *Tab,
+ IN PUCHAR pSsid,
+ IN UCHAR SsidLen)
+{
+ UCHAR i;
+
+ for (i = 0; i < Tab->BssNr; i++)
+ {
+ if (SSID_EQUAL(pSsid, SsidLen, Tab->BssEntry[i].Ssid, Tab->BssEntry[i].SsidLen))
+ {
+ return i;
+ }
+ }
+ return (ULONG)BSS_NOT_FOUND;
+}
+
+
// IRQL = DISPATCH_LEVEL
VOID BssTableDeleteEntry(
IN OUT BSS_TABLE *Tab,
@@ -3555,7 +3547,7 @@ VOID BATableDeleteORIEntry(
*/
VOID BssEntrySet(
- IN PRTMP_ADAPTER pAd,
+ IN PRTMP_ADAPTER pAd,
OUT BSS_ENTRY *pBss,
IN PUCHAR pBssid,
IN CHAR Ssid[],
@@ -3632,8 +3624,6 @@ VOID BssEntrySet(
pBss->SupRateLen = SupRateLen;
ASSERT(ExtRateLen <= MAX_LEN_OF_SUPPORTED_RATES);
NdisMoveMemory(pBss->ExtRate, ExtRate, ExtRateLen);
- NdisMoveMemory(&pBss->HtCapability, pHtCapability, HtCapabilityLen);
- NdisMoveMemory(&pBss->AddHtInfo, pAddHtInfo, AddHtInfoLen);
pBss->NewExtChanOffset = NewExtChanOffset;
pBss->ExtRateLen = ExtRateLen;
pBss->Channel = Channel;
@@ -3660,7 +3650,6 @@ VOID BssEntrySet(
pBss->AddHtInfoLen = 0;
pBss->HtCapabilityLen = 0;
-
if (HtCapabilityLen> 0)
{
pBss->HtCapabilityLen = HtCapabilityLen;
@@ -3670,13 +3659,13 @@ VOID BssEntrySet(
pBss->AddHtInfoLen = AddHtInfoLen;
NdisMoveMemory(&pBss->AddHtInfo, pAddHtInfo, AddHtInfoLen);
- if ((pAddHtInfo->ControlChan > 2)&& (pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_BELOW) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
- {
- pBss->CentralChannel = pAddHtInfo->ControlChan - 2;
- }
- else if ((pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_ABOVE) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
+ if ((pAddHtInfo->ControlChan > 2)&& (pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_BELOW) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
{
- pBss->CentralChannel = pAddHtInfo->ControlChan + 2;
+ pBss->CentralChannel = pAddHtInfo->ControlChan - 2;
+ }
+ else if ((pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_ABOVE) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
+ {
+ pBss->CentralChannel = pAddHtInfo->ControlChan + 2;
}
}
}
@@ -3704,38 +3693,36 @@ VOID BssEntrySet(
NdisZeroMemory(&pBss->WpaIE.IE[0], MAX_CUSTOM_LEN);
NdisZeroMemory(&pBss->RsnIE.IE[0], MAX_CUSTOM_LEN);
-
pEid = (PEID_STRUCT) pVIE;
-
while ((Length + 2 + (USHORT)pEid->Len) <= LengthVIE)
- {
+ {
switch(pEid->Eid)
- {
+ {
case IE_WPA:
if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
- {
+ {
if ((pEid->Len + 2) > MAX_CUSTOM_LEN)
- {
+ {
pBss->WpaIE.IELen = 0;
break;
- }
+ }
pBss->WpaIE.IELen = pEid->Len + 2;
NdisMoveMemory(pBss->WpaIE.IE, pEid, pBss->WpaIE.IELen);
- }
- break;
+ }
+ break;
case IE_RSN:
if (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3))
{
if ((pEid->Len + 2) > MAX_CUSTOM_LEN)
{
pBss->RsnIE.IELen = 0;
- break;
- }
+ break;
+ }
pBss->RsnIE.IELen = pEid->Len + 2;
NdisMoveMemory(pBss->RsnIE.IE, pEid, pBss->RsnIE.IELen);
- }
+ }
break;
- }
+ }
Length = Length + 2 + (USHORT)pEid->Len; // Eid[1] + Len[1]+ content[Len]
pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
}
@@ -3766,7 +3753,7 @@ VOID BssEntrySet(
*/
ULONG BssTableSetEntry(
- IN PRTMP_ADAPTER pAd,
+ IN PRTMP_ADAPTER pAd,
OUT BSS_TABLE *Tab,
IN PUCHAR pBssid,
IN CHAR Ssid[],
@@ -3797,7 +3784,7 @@ ULONG BssTableSetEntry(
{
ULONG Idx;
- Idx = BssTableSearchWithSSID(Tab, pBssid, Ssid, SsidLen, ChannelNo);
+ Idx = BssTableSearchWithSSID(Tab, pBssid, (UCHAR *)Ssid, SsidLen, ChannelNo);
if (Idx == BSS_NOT_FOUND)
{
if (Tab->BssNr >= MAX_LEN_OF_BSS_TABLE)
@@ -3808,10 +3795,10 @@ ULONG BssTableSetEntry(
// In this case, if we found the desired AP then overwrite BSS Table.
//
if(!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
+ {
if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, pBssid) ||
SSID_EQUAL(pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, Ssid, SsidLen))
- {
+ {
Idx = Tab->BssOverlapNr;
BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod, CfParm, AtimWin,
CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
@@ -3819,11 +3806,11 @@ ULONG BssTableSetEntry(
Tab->BssOverlapNr = (Tab->BssOverlapNr++) % MAX_LEN_OF_BSS_TABLE;
}
return Idx;
- }
+ }
else
- {
+ {
return BSS_NOT_FOUND;
- }
+ }
}
Idx = Tab->BssNr;
BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod, CfParm, AtimWin,
@@ -3837,15 +3824,16 @@ ULONG BssTableSetEntry(
if ((SSID_EQUAL(Ssid, SsidLen, Tab->BssEntry[Idx].Ssid, Tab->BssEntry[Idx].SsidLen)) ||
(NdisEqualMemory(Tab->BssEntry[Idx].Ssid, ZeroSsid, Tab->BssEntry[Idx].SsidLen)))
{
- BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod,CfParm, AtimWin,
- CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
- NewExtChanOffset, ChannelNo, Rssi, TimeStamp, CkipFlag, pEdcaParm, pQosCapability, pQbssLoad, LengthVIE, pVIE);
+ BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod,CfParm, AtimWin,
+ CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
+ NewExtChanOffset, ChannelNo, Rssi, TimeStamp, CkipFlag, pEdcaParm, pQosCapability, pQbssLoad, LengthVIE, pVIE);
}
}
return Idx;
}
+
// IRQL = DISPATCH_LEVEL
VOID BssTableSsidSort(
IN PRTMP_ADAPTER pAd,
@@ -3865,24 +3853,25 @@ VOID BssTableSsidSort(
(pAd->MlmeAux.Channel > 14) &&
RadarChannelCheck(pAd, pInBss->Channel))
)
- {
+{
if (pInBss->Hidden)
bIsHiddenApIncluded = TRUE;
- }
+}
if ((pInBss->BssType == pAd->StaCfg.BssType) &&
(SSID_EQUAL(Ssid, SsidLen, pInBss->Ssid, pInBss->SsidLen) || bIsHiddenApIncluded))
{
BSS_ENTRY *pOutBss = &OutTab->BssEntry[OutTab->BssNr];
+
+
// 2.4G/5G N only mode
if ((pInBss->HtCapabilityLen == 0) &&
((pAd->CommonCfg.PhyMode == PHY_11N_2_4G) || (pAd->CommonCfg.PhyMode == PHY_11N_5G)))
{
DBGPRINT(RT_DEBUG_TRACE,("STA is in N-only Mode, this AP don't have Ht capability in Beacon.\n"));
continue;
- }
-
+ }
// New for WPA2
// Check the Authmode first
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
@@ -3901,9 +3890,9 @@ VOID BssTableSsidSort(
continue;
// check group cipher
- if (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled &&
- pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled &&
- pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
+ if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
+ (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
+ (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled))
continue;
// check pairwise cipher, skip if none matched
@@ -3922,9 +3911,9 @@ VOID BssTableSsidSort(
continue;
// check group cipher
- if (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled &&
- pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled &&
- pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
+ if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
+ (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
+ (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled))
continue;
// check pairwise cipher, skip if none matched
@@ -3943,7 +3932,7 @@ VOID BssTableSsidSort(
DBGPRINT(RT_DEBUG_TRACE,("StaCfg.WepStatus=%d, while pInBss->WepStatus=%d\n", pAd->StaCfg.WepStatus, pInBss->WepStatus));
//
// For the SESv2 case, we will not qualify WepStatus.
- //
+ //
if (!pInBss->bSES)
continue;
}
@@ -3958,9 +3947,9 @@ VOID BssTableSsidSort(
// If this 40MHz wideband is not allowed in my country list, use bandwidth 20MHZ instead,
if ((pInBss->CentralChannel != pInBss->Channel) &&
(pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40))
- {
+ {
if (RTMPCheckChannel(pAd, pInBss->CentralChannel, pInBss->Channel) == FALSE)
- {
+ {
pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
SetCommonHT(pAd);
pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
@@ -3971,8 +3960,8 @@ VOID BssTableSsidSort(
{
SetCommonHT(pAd);
}
- }
- }
+ }
+ }
// copy matching BSS from InTab to OutTab
NdisMoveMemory(pOutBss, pInBss, sizeof(BSS_ENTRY));
@@ -3980,13 +3969,14 @@ VOID BssTableSsidSort(
OutTab->BssNr++;
}
else if ((pInBss->BssType == pAd->StaCfg.BssType) && (SsidLen == 0))
- {
+ {
BSS_ENTRY *pOutBss = &OutTab->BssEntry[OutTab->BssNr];
+
// 2.4G/5G N only mode
if ((pInBss->HtCapabilityLen == 0) &&
((pAd->CommonCfg.PhyMode == PHY_11N_2_4G) || (pAd->CommonCfg.PhyMode == PHY_11N_5G)))
- {
+ {
DBGPRINT(RT_DEBUG_TRACE,("STA is in N-only Mode, this AP don't have Ht capability in Beacon.\n"));
continue;
}
@@ -4049,14 +4039,14 @@ VOID BssTableSsidSort(
// If this 40MHz wideband is not allowed in my country list, use bandwidth 20MHZ instead,
if ((pInBss->CentralChannel != pInBss->Channel) &&
(pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40))
- {
+ {
if (RTMPCheckChannel(pAd, pInBss->CentralChannel, pInBss->Channel) == FALSE)
{
pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
SetCommonHT(pAd);
pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
}
- }
+ }
// copy matching BSS from InTab to OutTab
NdisMoveMemory(pOutBss, pInBss, sizeof(BSS_ENTRY));
@@ -4065,8 +4055,8 @@ VOID BssTableSsidSort(
}
if (OutTab->BssNr >= MAX_LEN_OF_BSS_TABLE)
- break;
- }
+ break;
+ }
BssTableSortByRssi(OutTab);
}
@@ -4076,27 +4066,28 @@ VOID BssTableSsidSort(
VOID BssTableSortByRssi(
IN OUT BSS_TABLE *OutTab)
{
- INT i, j;
+ INT i, j;
BSS_ENTRY TmpBss;
for (i = 0; i < OutTab->BssNr - 1; i++)
- {
+ {
for (j = i+1; j < OutTab->BssNr; j++)
- {
+ {
if (OutTab->BssEntry[j].Rssi > OutTab->BssEntry[i].Rssi)
- {
+ {
NdisMoveMemory(&TmpBss, &OutTab->BssEntry[j], sizeof(BSS_ENTRY));
NdisMoveMemory(&OutTab->BssEntry[j], &OutTab->BssEntry[i], sizeof(BSS_ENTRY));
NdisMoveMemory(&OutTab->BssEntry[i], &TmpBss, sizeof(BSS_ENTRY));
- }
- }
- }
+ }
+ }
+ }
}
+
VOID BssCipherParse(
IN OUT PBSS_ENTRY pBss)
{
- PEID_STRUCT pEid;
+ PEID_STRUCT pEid;
PUCHAR pTmp;
PRSN_IE_HEADER_STRUCT pRsnHeader;
PCIPHER_SUITE_STRUCT pCipher;
@@ -4109,13 +4100,13 @@ VOID BssCipherParse(
// WepStatus will be reset later, if AP announce TKIP or AES on the beacon frame.
//
if (pBss->Privacy)
- {
- pBss->WepStatus = Ndis802_11WEPEnabled;
- }
- else
- {
- pBss->WepStatus = Ndis802_11WEPDisabled;
- }
+ {
+ pBss->WepStatus = Ndis802_11WEPEnabled;
+ }
+ else
+ {
+ pBss->WepStatus = Ndis802_11WEPDisabled;
+ }
// Set default to disable & open authentication before parsing variable IE
pBss->AuthMode = Ndis802_11AuthModeOpen;
pBss->AuthModeAux = Ndis802_11AuthModeOpen;
@@ -4132,58 +4123,29 @@ VOID BssCipherParse(
pBss->WPA2.PairCipherAux = Ndis802_11WEPDisabled;
pBss->WPA2.GroupCipher = Ndis802_11WEPDisabled;
pBss->WPA2.RsnCapability = 0;
- pBss->WPA2.bMixMode = FALSE;
+ pBss->WPA2.bMixMode = FALSE;
Length = (INT) pBss->VarIELen;
while (Length > 0)
- {
+ {
// Parse cipher suite base on WPA1 & WPA2, they should be parsed differently
pTmp = ((PUCHAR) pBss->VarIEs) + pBss->VarIELen - Length;
pEid = (PEID_STRUCT) pTmp;
switch (pEid->Eid)
- {
+ {
case IE_WPA:
- //Parse Cisco IE_WPA (LEAP, CCKM, etc.)
- if ( NdisEqualMemory((pTmp+8), CISCO_OUI, 3))
- {
- pTmp += 11;
- switch (*pTmp)
- {
- case 1:
- case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
- pBss->WepStatus = Ndis802_11Encryption1Enabled;
- pBss->WPA.PairCipher = Ndis802_11Encryption1Enabled;
- pBss->WPA.GroupCipher = Ndis802_11Encryption1Enabled;
- break;
- case 2:
- pBss->WepStatus = Ndis802_11Encryption2Enabled;
- pBss->WPA.PairCipher = Ndis802_11Encryption1Enabled;
- pBss->WPA.GroupCipher = Ndis802_11Encryption1Enabled;
- break;
- case 4:
- pBss->WepStatus = Ndis802_11Encryption3Enabled;
- pBss->WPA.PairCipher = Ndis802_11Encryption1Enabled;
- pBss->WPA.GroupCipher = Ndis802_11Encryption1Enabled;
- break;
- default:
- break;
- }
-
- // if Cisco IE_WPA, break
- break;
- }
- else if (NdisEqualMemory(pEid->Octet, SES_OUI, 3) && (pEid->Len == 7))
- {
+ if (NdisEqualMemory(pEid->Octet, SES_OUI, 3) && (pEid->Len == 7))
+ {
pBss->bSES = TRUE;
break;
- }
+ }
else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4) != 1)
- {
+ {
// if unsupported vendor specific IE
break;
- }
+ }
// Skip OUI, version, and multicast suite
// This part should be improved in the future when AP supported multiple cipher suite.
// For now, it's OK since almost all APs have fixed cipher suite supported.
@@ -4200,7 +4162,7 @@ VOID BssCipherParse(
// 5 WEP-104
// Parse group cipher
switch (*pTmp)
- {
+ {
case 1:
pBss->WPA.GroupCipher = Ndis802_11GroupWEP40Enabled;
break;
@@ -4226,12 +4188,12 @@ VOID BssCipherParse(
// Parsing all unicast cipher suite
while (Count > 0)
- {
+ {
// Skip OUI
pTmp += 3;
TmpCipher = Ndis802_11WEPDisabled;
switch (*pTmp)
- {
+ {
case 1:
case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
TmpCipher = Ndis802_11Encryption1Enabled;
@@ -4244,20 +4206,20 @@ VOID BssCipherParse(
break;
default:
break;
- }
+ }
if (TmpCipher > pBss->WPA.PairCipher)
- {
+ {
// Move the lower cipher suite to PairCipherAux
pBss->WPA.PairCipherAux = pBss->WPA.PairCipher;
pBss->WPA.PairCipher = TmpCipher;
- }
+ }
else
- {
+ {
pBss->WPA.PairCipherAux = TmpCipher;
- }
+ }
pTmp++;
Count--;
- }
+ }
// 4. get AKM suite counts
//Count = *(PUSHORT) pTmp;
@@ -4266,36 +4228,37 @@ VOID BssCipherParse(
pTmp += 3;
switch (*pTmp)
- {
+ {
case 1:
- // Set AP support WPA mode
+ // Set AP support WPA-enterprise mode
if (pBss->AuthMode == Ndis802_11AuthModeOpen)
pBss->AuthMode = Ndis802_11AuthModeWPA;
- else
+ else
pBss->AuthModeAux = Ndis802_11AuthModeWPA;
break;
case 2:
- // Set AP support WPA mode
+ // Set AP support WPA-PSK mode
if (pBss->AuthMode == Ndis802_11AuthModeOpen)
pBss->AuthMode = Ndis802_11AuthModeWPAPSK;
- else
+ else
pBss->AuthModeAux = Ndis802_11AuthModeWPAPSK;
break;
default:
break;
- }
+ }
pTmp += 1;
// Fixed for WPA-None
if (pBss->BssType == BSS_ADHOC)
- {
+ {
pBss->AuthMode = Ndis802_11AuthModeWPANone;
pBss->AuthModeAux = Ndis802_11AuthModeWPANone;
pBss->WepStatus = pBss->WPA.GroupCipher;
+ // Patched bugs for old driver
if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
pBss->WPA.PairCipherAux = pBss->WPA.GroupCipher;
- }
- else
+ }
+ else
pBss->WepStatus = pBss->WPA.PairCipher;
// Check the Pair & Group, if different, turn on mixed mode flag
@@ -4315,7 +4278,7 @@ VOID BssCipherParse(
// 1. Check group cipher
pCipher = (PCIPHER_SUITE_STRUCT) pTmp;
if (!RTMPEqualMemory(pTmp, RSN_OUI, 3))
- break;
+ break;
// Parse group cipher
switch (pCipher->Type)
@@ -4346,12 +4309,12 @@ VOID BssCipherParse(
// 3. Get pairwise cipher
// Parsing all unicast cipher suite
while (Count > 0)
- {
+ {
// Skip OUI
pCipher = (PCIPHER_SUITE_STRUCT) pTmp;
TmpCipher = Ndis802_11WEPDisabled;
switch (pCipher->Type)
- {
+ {
case 1:
case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
TmpCipher = Ndis802_11Encryption1Enabled;
@@ -4364,20 +4327,20 @@ VOID BssCipherParse(
break;
default:
break;
- }
+ }
if (TmpCipher > pBss->WPA2.PairCipher)
- {
+ {
// Move the lower cipher suite to PairCipherAux
pBss->WPA2.PairCipherAux = pBss->WPA2.PairCipher;
pBss->WPA2.PairCipher = TmpCipher;
- }
+ }
else
- {
+ {
pBss->WPA2.PairCipherAux = TmpCipher;
- }
+ }
pTmp += sizeof(CIPHER_SUITE_STRUCT);
Count--;
- }
+ }
// 4. get AKM suite counts
//Count = *(PUSHORT) pTmp;
@@ -4385,30 +4348,39 @@ VOID BssCipherParse(
pTmp += sizeof(USHORT);
// 5. Get AKM ciphers
- pAKM = (PAKM_SUITE_STRUCT) pTmp;
- if (!RTMPEqualMemory(pTmp, RSN_OUI, 3))
- break;
+ // Parsing all AKM ciphers
+ while (Count > 0)
+ {
+ pAKM = (PAKM_SUITE_STRUCT) pTmp;
+ if (!RTMPEqualMemory(pTmp, RSN_OUI, 3))
+ break;
- switch (pAKM->Type)
+ switch (pAKM->Type)
{
- case 1:
- // Set AP support WPA mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPA2;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPA2;
- break;
- case 2:
- // Set AP support WPA mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPA2PSK;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPA2PSK;
- break;
- default:
- break;
+ case 1:
+ // Set AP support WPA-enterprise mode
+ if (pBss->AuthMode == Ndis802_11AuthModeOpen)
+ pBss->AuthMode = Ndis802_11AuthModeWPA2;
+ else
+ pBss->AuthModeAux = Ndis802_11AuthModeWPA2;
+ break;
+ case 2:
+ // Set AP support WPA-PSK mode
+ if (pBss->AuthMode == Ndis802_11AuthModeOpen)
+ pBss->AuthMode = Ndis802_11AuthModeWPA2PSK;
+ else
+ pBss->AuthModeAux = Ndis802_11AuthModeWPA2PSK;
+ break;
+ default:
+ if (pBss->AuthMode == Ndis802_11AuthModeOpen)
+ pBss->AuthMode = Ndis802_11AuthModeMax;
+ else
+ pBss->AuthModeAux = Ndis802_11AuthModeMax;
+ break;
}
- pTmp += (Count * sizeof(AKM_SUITE_STRUCT));
+ pTmp += (Count * sizeof(AKM_SUITE_STRUCT));
+ Count--;
+ }
// Fixed for WPA-None
if (pBss->BssType == BSS_ADHOC)
@@ -4417,10 +4389,11 @@ VOID BssCipherParse(
pBss->AuthModeAux = Ndis802_11AuthModeWPANone;
pBss->WPA.PairCipherAux = pBss->WPA2.PairCipherAux;
pBss->WPA.GroupCipher = pBss->WPA2.GroupCipher;
- pBss->WepStatus = pBss->WPA.GroupCipher;
+ pBss->WepStatus = pBss->WPA.GroupCipher;
+ // Patched bugs for old driver
if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
pBss->WPA.PairCipherAux = pBss->WPA.GroupCipher;
- }
+ }
pBss->WepStatus = pBss->WPA2.PairCipher;
// 6. Get RSN capability
@@ -4475,8 +4448,8 @@ VOID MacAddrRandomBssid(
* \post
* \note this function initializes the following field
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
+ IRQL = PASSIVE_LEVEL
+ IRQL = DISPATCH_LEVEL
*/
VOID MgtMacHeaderInit(
@@ -4491,11 +4464,11 @@ VOID MgtMacHeaderInit(
pHdr80211->FC.Type = BTYPE_MGMT;
pHdr80211->FC.SubType = SubType;
+// if (SubType == SUBTYPE_ACK) // sample, no use, it will conflict with ACTION frame sub type
+// pHdr80211->FC.Type = BTYPE_CNTL;
pHdr80211->FC.ToDs = ToDs;
COPY_MAC_ADDR(pHdr80211->Addr1, pDA);
-
- COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
-
+ COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
COPY_MAC_ADDR(pHdr80211->Addr3, pBssid);
}
@@ -4518,15 +4491,15 @@ VOID MgtMacHeaderInit(
* MakeOutgoingFrame(Buffer, output_length, 2, &fc, 2, &dur, 6, p_addr1, 6,p_addr2, END_OF_ARGS);
IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
+ IRQL = DISPATCH_LEVEL
****************************************************************************/
ULONG MakeOutgoingFrame(
- OUT CHAR *Buffer,
+ OUT UCHAR *Buffer,
OUT ULONG *FrameLen, ...)
{
- CHAR *p;
- int leng;
+ UCHAR *p;
+ int leng;
ULONG TotLeng;
va_list Args;
@@ -4539,7 +4512,7 @@ ULONG MakeOutgoingFrame(
if (leng == END_OF_ARGS)
{
break;
- }
+ }
p = va_arg(Args, PVOID);
NdisMoveMemory(&Buffer[TotLeng], p, leng);
TotLeng = TotLeng + leng;
@@ -4596,12 +4569,12 @@ NDIS_STATUS MlmeQueueInit(
* \post
* \note The message has to be initialized
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
+ IRQL = PASSIVE_LEVEL
+ IRQL = DISPATCH_LEVEL
*/
BOOLEAN MlmeEnqueue(
- IN PRTMP_ADAPTER pAd,
+ IN PRTMP_ADAPTER pAd,
IN ULONG Machine,
IN ULONG MsgType,
IN ULONG MsgLen,
@@ -4617,24 +4590,24 @@ BOOLEAN MlmeEnqueue(
// First check the size, it MUST not exceed the mlme queue size
if (MsgLen > MGMT_DMA_BUFFER_SIZE)
- {
+ {
DBGPRINT_ERR(("MlmeEnqueue: msg too large, size = %ld \n", MsgLen));
return FALSE;
}
if (MlmeQueueFull(Queue))
- {
+ {
return FALSE;
- }
+ }
NdisAcquireSpinLock(&(Queue->Lock));
Tail = Queue->Tail;
Queue->Tail++;
Queue->Num++;
if (Queue->Tail == MAX_LEN_OF_MLME_QUEUE)
- {
+ {
Queue->Tail = 0;
- }
+ }
Queue->Entry[Tail].Wcid = RESERVED_WCID;
Queue->Entry[Tail].Occupied = TRUE;
@@ -4643,9 +4616,9 @@ BOOLEAN MlmeEnqueue(
Queue->Entry[Tail].MsgLen = MsgLen;
if (Msg != NULL)
- {
+ {
NdisMoveMemory(Queue->Entry[Tail].Msg, Msg, MsgLen);
- }
+ }
NdisReleaseSpinLock(&(Queue->Lock));
return TRUE;
@@ -4656,7 +4629,7 @@ BOOLEAN MlmeEnqueue(
* \param TimeStampHigh The upper 32 bit of timestamp
* \param TimeStampLow The lower 32 bit of timestamp
* \param Rssi The receiving RSSI strength
- * \param MsgLen The length of the message
+ * \param MsgLen The length of the message
* \param *Msg The message pointer
* \return TRUE if everything ok, FALSE otherwise (like Queue Full)
* \pre
@@ -4677,11 +4650,12 @@ BOOLEAN MlmeEnqueueForRecv(
IN VOID *Msg,
IN UCHAR Signal)
{
- INT Tail, Machine;
+ INT Tail, Machine;
PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
INT MsgType;
MLME_QUEUE *Queue = (MLME_QUEUE *)&pAd->Mlme.Queue;
+
// Do nothing if the driver is starting halt state.
// This might happen when timer already been fired before cancel timer with mlmehalt
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
@@ -4698,17 +4672,17 @@ BOOLEAN MlmeEnqueueForRecv(
}
if (MlmeQueueFull(Queue))
- {
+ {
return FALSE;
}
- {
+ {
if (!MsgTypeSubst(pAd, pFrame, &Machine, &MsgType))
{
DBGPRINT_ERR(("MlmeEnqueueForRecv: un-recongnized mgmt->subtype=%d\n",pFrame->Hdr.FC.SubType));
return FALSE;
+ }
}
- }
// OK, we got all the informations, it is time to put things into queue
NdisAcquireSpinLock(&(Queue->Lock));
@@ -4716,9 +4690,9 @@ BOOLEAN MlmeEnqueueForRecv(
Queue->Tail++;
Queue->Num++;
if (Queue->Tail == MAX_LEN_OF_MLME_QUEUE)
- {
+ {
Queue->Tail = 0;
- }
+ }
Queue->Entry[Tail].Occupied = TRUE;
Queue->Entry[Tail].Machine = Machine;
Queue->Entry[Tail].MsgType = MsgType;
@@ -4740,7 +4714,7 @@ BOOLEAN MlmeEnqueueForRecv(
NdisReleaseSpinLock(&(Queue->Lock));
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
return TRUE;
}
@@ -4776,14 +4750,14 @@ BOOLEAN MlmeDequeue(
VOID MlmeRestartStateMachine(
IN PRTMP_ADAPTER pAd)
{
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
MLME_QUEUE_ELEM *Elem = NULL;
-#endif
+#endif // RTMP_MAC_PCI //
BOOLEAN Cancelled;
DBGPRINT(RT_DEBUG_TRACE, ("MlmeRestartStateMachine \n"));
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
if(pAd->Mlme.bRunning)
{
@@ -4809,9 +4783,9 @@ VOID MlmeRestartStateMachine(
}
else {
DBGPRINT_ERR(("MlmeRestartStateMachine: MlmeQueue empty\n"));
- }
}
-#endif /* RT2860 */
+ }
+#endif // RTMP_MAC_PCI //
{
// Cancel all timer events
@@ -4822,6 +4796,7 @@ VOID MlmeRestartStateMachine(
RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
+
}
// Change back to original channel in case of doing scan
@@ -4841,12 +4816,12 @@ VOID MlmeRestartStateMachine(
pAd->Mlme.ActMachine.CurrState = ACT_IDLE;
}
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
// Remove running state
NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
pAd->Mlme.bRunning = FALSE;
NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
-#endif
+#endif // RTMP_MAC_PCI //
}
/*! \brief test if the MLME Queue is empty
@@ -4871,7 +4846,7 @@ BOOLEAN MlmeQueueEmpty(
}
/*! \brief test if the MLME Queue is full
- * \param *Queue The MLME Queue
+ * \param *Queue The MLME Queue
* \return TRUE if the Queue is empty, FALSE otherwise
* \pre
* \post
@@ -4913,6 +4888,7 @@ VOID MlmeQueueDestroy(
NdisFreeSpinLock(&(pQueue->Lock));
}
+
/*! \brief To substitute the message type if the message is coming from external
* \param pFrame The frame received
* \param *Machine The state machine
@@ -4930,7 +4906,7 @@ BOOLEAN MsgTypeSubst(
OUT INT *Machine,
OUT INT *MsgType)
{
- USHORT Seq;
+ USHORT Seq, Alg;
UCHAR EAPType;
PUCHAR pData;
@@ -4940,17 +4916,10 @@ BOOLEAN MsgTypeSubst(
// The only data type will pass to this function is EAPOL frame
if (pFrame->Hdr.FC.Type == BTYPE_DATA)
{
- if (NdisEqualMemory(SNAP_AIRONET, pData, LENGTH_802_1_H))
{
- // Cisco Aironet SNAP header
- *Machine = AIRONET_STATE_MACHINE;
- *MsgType = MT2_AIRONET_MSG;
- return (TRUE);
- }
- {
- *Machine = WPA_PSK_STATE_MACHINE;
+ *Machine = WPA_STATE_MACHINE;
EAPType = *((UCHAR*)pFrame + LENGTH_802_11 + LENGTH_802_1_H + 1);
- return(WpaMsgTypeSubst(EAPType, MsgType));
+ return (WpaMsgTypeSubst(EAPType, (INT *) MsgType));
}
}
@@ -4995,18 +4964,22 @@ BOOLEAN MsgTypeSubst(
case SUBTYPE_AUTH:
// get the sequence number from payload 24 Mac Header + 2 bytes algorithm
NdisMoveMemory(&Seq, &pFrame->Octet[2], sizeof(USHORT));
+ NdisMoveMemory(&Alg, &pFrame->Octet[0], sizeof(USHORT));
if (Seq == 1 || Seq == 3)
- {
+ {
*Machine = AUTH_RSP_STATE_MACHINE;
*MsgType = MT2_PEER_AUTH_ODD;
- }
+ }
else if (Seq == 2 || Seq == 4)
- {
- *Machine = AUTH_STATE_MACHINE;
- *MsgType = MT2_PEER_AUTH_EVEN;
- }
+ {
+ if (Alg == AUTH_MODE_OPEN || Alg == AUTH_MODE_KEY)
+ {
+ *Machine = AUTH_STATE_MACHINE;
+ *MsgType = MT2_PEER_AUTH_EVEN;
+ }
+ }
else
- {
+ {
return FALSE;
}
break;
@@ -5018,13 +4991,13 @@ BOOLEAN MsgTypeSubst(
*Machine = ACTION_STATE_MACHINE;
// Sometimes Sta will return with category bytes with MSB = 1, if they receive catogory out of their support
if ((pFrame->Octet[0]&0x7F) > MAX_PEER_CATE_MSG)
- {
+ {
*MsgType = MT2_ACT_INVALID;
- }
- else
- {
+ }
+ else
+ {
*MsgType = (pFrame->Octet[0]&0x7F);
- }
+ }
break;
default:
return FALSE;
@@ -5043,7 +5016,7 @@ BOOLEAN MsgTypeSubst(
* \param Trans State machine transition function
* \param StNr number of states
* \param MsgNr number of messages
- * \param DefFunc default function, when there is invalid state/message combination
+ * \param DefFunc default function, when there is invalid state/message combination
* \param InitState initial state of the state machine
* \param Base StateMachine base, internal use only
* \pre p_sm should be a legal pointer
@@ -5113,7 +5086,7 @@ VOID StateMachineSetAction(
/*! \brief This function does the state transition
* \param *Adapter the NIC adapter pointer
- * \param *S the state machine
+ * \param *S the state machine
* \param *Elem the message to be executed
* \return None
@@ -5186,9 +5159,9 @@ UCHAR RandomByte(
{
pAd->Mlme.ShiftReg = ((pAd->Mlme.ShiftReg ^ LFSR_MASK) >> 1) | 0x80000000;
Result = 1;
- }
- else
- {
+ }
+ else
+ {
pAd->Mlme.ShiftReg = pAd->Mlme.ShiftReg >> 1;
Result = 0;
}
@@ -5198,2453 +5171,6 @@ UCHAR RandomByte(
return R;
}
-VOID AsicUpdateAutoFallBackTable(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pRateTable)
-{
- UCHAR i;
- HT_FBK_CFG0_STRUC HtCfg0;
- HT_FBK_CFG1_STRUC HtCfg1;
- LG_FBK_CFG0_STRUC LgCfg0;
- LG_FBK_CFG1_STRUC LgCfg1;
- PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate;
-
- // set to initial value
- HtCfg0.word = 0x65432100;
- HtCfg1.word = 0xedcba988;
- LgCfg0.word = 0xedcba988;
- LgCfg1.word = 0x00002100;
-
- pNextTxRate = (PRTMP_TX_RATE_SWITCH)pRateTable+1;
- for (i = 1; i < *((PUCHAR) pRateTable); i++)
- {
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH)pRateTable+1+i;
- switch (pCurrTxRate->Mode)
- {
- case 0: //CCK
- break;
- case 1: //OFDM
- {
- switch(pCurrTxRate->CurrMCS)
- {
- case 0:
- LgCfg0.field.OFDMMCS0FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 1:
- LgCfg0.field.OFDMMCS1FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 2:
- LgCfg0.field.OFDMMCS2FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 3:
- LgCfg0.field.OFDMMCS3FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 4:
- LgCfg0.field.OFDMMCS4FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 5:
- LgCfg0.field.OFDMMCS5FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 6:
- LgCfg0.field.OFDMMCS6FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- case 7:
- LgCfg0.field.OFDMMCS7FBK = (pNextTxRate->Mode == MODE_OFDM) ? (pNextTxRate->CurrMCS+8): pNextTxRate->CurrMCS;
- break;
- }
- }
- break;
- case 2: //HT-MIX
- case 3: //HT-GF
- {
- if ((pNextTxRate->Mode >= MODE_HTMIX) && (pCurrTxRate->CurrMCS != pNextTxRate->CurrMCS))
- {
- switch(pCurrTxRate->CurrMCS)
- {
- case 0:
- HtCfg0.field.HTMCS0FBK = pNextTxRate->CurrMCS;
- break;
- case 1:
- HtCfg0.field.HTMCS1FBK = pNextTxRate->CurrMCS;
- break;
- case 2:
- HtCfg0.field.HTMCS2FBK = pNextTxRate->CurrMCS;
- break;
- case 3:
- HtCfg0.field.HTMCS3FBK = pNextTxRate->CurrMCS;
- break;
- case 4:
- HtCfg0.field.HTMCS4FBK = pNextTxRate->CurrMCS;
- break;
- case 5:
- HtCfg0.field.HTMCS5FBK = pNextTxRate->CurrMCS;
- break;
- case 6:
- HtCfg0.field.HTMCS6FBK = pNextTxRate->CurrMCS;
- break;
- case 7:
- HtCfg0.field.HTMCS7FBK = pNextTxRate->CurrMCS;
- break;
- case 8:
- HtCfg1.field.HTMCS8FBK = pNextTxRate->CurrMCS;
- break;
- case 9:
- HtCfg1.field.HTMCS9FBK = pNextTxRate->CurrMCS;
- break;
- case 10:
- HtCfg1.field.HTMCS10FBK = pNextTxRate->CurrMCS;
- break;
- case 11:
- HtCfg1.field.HTMCS11FBK = pNextTxRate->CurrMCS;
- break;
- case 12:
- HtCfg1.field.HTMCS12FBK = pNextTxRate->CurrMCS;
- break;
- case 13:
- HtCfg1.field.HTMCS13FBK = pNextTxRate->CurrMCS;
- break;
- case 14:
- HtCfg1.field.HTMCS14FBK = pNextTxRate->CurrMCS;
- break;
- case 15:
- HtCfg1.field.HTMCS15FBK = pNextTxRate->CurrMCS;
- break;
- default:
- DBGPRINT(RT_DEBUG_ERROR, ("AsicUpdateAutoFallBackTable: not support CurrMCS=%d\n", pCurrTxRate->CurrMCS));
- }
- }
- }
- break;
- }
-
- pNextTxRate = pCurrTxRate;
- }
-
- RTMP_IO_WRITE32(pAd, HT_FBK_CFG0, HtCfg0.word);
- RTMP_IO_WRITE32(pAd, HT_FBK_CFG1, HtCfg1.word);
- RTMP_IO_WRITE32(pAd, LG_FBK_CFG0, LgCfg0.word);
- RTMP_IO_WRITE32(pAd, LG_FBK_CFG1, LgCfg1.word);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Set MAC register value according operation mode.
- OperationMode AND bNonGFExist are for MM and GF Proteciton.
- If MM or GF mask is not set, those passing argument doesn't not take effect.
-
- Operation mode meaning:
- = 0 : Pure HT, no preotection.
- = 0x01; there may be non-HT devices in both the control and extension channel, protection is optional in BSS.
- = 0x10: No Transmission in 40M is protected.
- = 0x11: Transmission in both 40M and 20M shall be protected
- if (bNonGFExist)
- we should choose not to use GF. But still set correct ASIC registers.
- ========================================================================
-*/
-VOID AsicUpdateProtect(
- IN PRTMP_ADAPTER pAd,
- IN USHORT OperationMode,
- IN UCHAR SetMask,
- IN BOOLEAN bDisableBGProtect,
- IN BOOLEAN bNonGFExist)
-{
- PROT_CFG_STRUC ProtCfg, ProtCfg4;
- UINT32 Protect[6];
- USHORT offset;
- UCHAR i;
- UINT32 MacReg = 0;
-
- if (!(pAd->CommonCfg.bHTProtect) && (OperationMode != 8))
- {
- return;
- }
-
- if (pAd->BATable.numAsOriginator)
- {
- //
- // enable the RTS/CTS to avoid channel collision
- //
- SetMask = ALLN_SETPROTECT;
- OperationMode = 8;
- }
-
- // Config ASIC RTS threshold register
- RTMP_IO_READ32(pAd, TX_RTS_CFG, &MacReg);
- MacReg &= 0xFF0000FF;
-
- // If the user want disable RtsThreshold and enable Amsdu/Ralink-Aggregation, set the RtsThreshold as 4096
- if ((
- (pAd->CommonCfg.BACapability.field.AmsduEnable) ||
- (pAd->CommonCfg.bAggregationCapable == TRUE))
- && pAd->CommonCfg.RtsThreshold == MAX_RTS_THRESHOLD)
- {
- MacReg |= (0x1000 << 8);
- }
- else
- {
- MacReg |= (pAd->CommonCfg.RtsThreshold << 8);
- }
-
- RTMP_IO_WRITE32(pAd, TX_RTS_CFG, MacReg);
-
- // Initial common protection settings
- RTMPZeroMemory(Protect, sizeof(Protect));
- ProtCfg4.word = 0;
- ProtCfg.word = 0;
- ProtCfg.field.TxopAllowGF40 = 1;
- ProtCfg.field.TxopAllowGF20 = 1;
- ProtCfg.field.TxopAllowMM40 = 1;
- ProtCfg.field.TxopAllowMM20 = 1;
- ProtCfg.field.TxopAllowOfdm = 1;
- ProtCfg.field.TxopAllowCck = 1;
- ProtCfg.field.RTSThEn = 1;
- ProtCfg.field.ProtectNav = ASIC_SHORTNAV;
-
- // update PHY mode and rate
- if (pAd->CommonCfg.Channel > 14)
- ProtCfg.field.ProtectRate = 0x4000;
- ProtCfg.field.ProtectRate |= pAd->CommonCfg.RtsRate;
-
- // Handle legacy(B/G) protection
- if (bDisableBGProtect)
- {
- //ProtCfg.field.ProtectRate = pAd->CommonCfg.RtsRate;
- ProtCfg.field.ProtectCtrl = 0;
- Protect[0] = ProtCfg.word;
- Protect[1] = ProtCfg.word;
- }
- else
- {
- //ProtCfg.field.ProtectRate = pAd->CommonCfg.RtsRate;
- ProtCfg.field.ProtectCtrl = 0; // CCK do not need to be protected
- Protect[0] = ProtCfg.word;
- ProtCfg.field.ProtectCtrl = ASIC_CTS; // OFDM needs using CCK to protect
- Protect[1] = ProtCfg.word;
- }
-
- // Decide HT frame protection.
- if ((SetMask & ALLN_SETPROTECT) != 0)
- {
- switch(OperationMode)
- {
- case 0x0:
- // NO PROTECT
- // 1.All STAs in the BSS are 20/40 MHz HT
- // 2. in ai 20/40MHz BSS
- // 3. all STAs are 20MHz in a 20MHz BSS
- // Pure HT. no protection.
-
- // MM20_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 010111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4004 (OFDM 24M)
- Protect[2] = 0x01744004;
-
- // MM40_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 111111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4084 (duplicate OFDM 24M)
- Protect[3] = 0x03f44084;
-
- // CF20_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 010111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4004 (OFDM 24M)
- Protect[4] = 0x01744004;
-
- // CF40_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 111111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4084 (duplicate OFDM 24M)
- Protect[5] = 0x03f44084;
-
- if (bNonGFExist)
- {
- // PROT_NAV(19:18) -- 01 (Short NAV protectiion)
- // PROT_CTRL(17:16) -- 01 (RTS/CTS)
- Protect[4] = 0x01754004;
- Protect[5] = 0x03f54084;
- }
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = FALSE;
- break;
-
- case 1:
- // This is "HT non-member protection mode."
- // If there may be non-HT STAs my BSS
- ProtCfg.word = 0x01744004; // PROT_CTRL(17:16) : 0 (None)
- ProtCfg4.word = 0x03f44084; // duplicaet legacy 24M. BW set 1.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED))
- {
- ProtCfg.word = 0x01740003; //ERP use Protection bit is set, use protection rate at Clause 18..
- ProtCfg4.word = 0x03f40003; // Don't duplicate RTS/CTS in CCK mode. 0x03f40083;
- }
- //Assign Protection method for 20&40 MHz packets
- ProtCfg.field.ProtectCtrl = ASIC_RTS;
- ProtCfg.field.ProtectNav = ASIC_SHORTNAV;
- ProtCfg4.field.ProtectCtrl = ASIC_RTS;
- ProtCfg4.field.ProtectNav = ASIC_SHORTNAV;
- Protect[2] = ProtCfg.word;
- Protect[3] = ProtCfg4.word;
- Protect[4] = ProtCfg.word;
- Protect[5] = ProtCfg4.word;
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = TRUE;
- break;
-
- case 2:
- // If only HT STAs are in BSS. at least one is 20MHz. Only protect 40MHz packets
- ProtCfg.word = 0x01744004; // PROT_CTRL(17:16) : 0 (None)
- ProtCfg4.word = 0x03f44084; // duplicaet legacy 24M. BW set 1.
-
- //Assign Protection method for 40MHz packets
- ProtCfg4.field.ProtectCtrl = ASIC_RTS;
- ProtCfg4.field.ProtectNav = ASIC_SHORTNAV;
- Protect[2] = ProtCfg.word;
- Protect[3] = ProtCfg4.word;
- if (bNonGFExist)
- {
- ProtCfg.field.ProtectCtrl = ASIC_RTS;
- ProtCfg.field.ProtectNav = ASIC_SHORTNAV;
- }
- Protect[4] = ProtCfg.word;
- Protect[5] = ProtCfg4.word;
-
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = FALSE;
- break;
-
- case 3:
- // HT mixed mode. PROTECT ALL!
- // Assign Rate
- ProtCfg.word = 0x01744004; //duplicaet legacy 24M. BW set 1.
- ProtCfg4.word = 0x03f44084;
- // both 20MHz and 40MHz are protected. Whether use RTS or CTS-to-self depends on the
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED))
- {
- ProtCfg.word = 0x01740003; //ERP use Protection bit is set, use protection rate at Clause 18..
- ProtCfg4.word = 0x03f40003; // Don't duplicate RTS/CTS in CCK mode. 0x03f40083
- }
- //Assign Protection method for 20&40 MHz packets
- ProtCfg.field.ProtectCtrl = ASIC_RTS;
- ProtCfg.field.ProtectNav = ASIC_SHORTNAV;
- ProtCfg4.field.ProtectCtrl = ASIC_RTS;
- ProtCfg4.field.ProtectNav = ASIC_SHORTNAV;
- Protect[2] = ProtCfg.word;
- Protect[3] = ProtCfg4.word;
- Protect[4] = ProtCfg.word;
- Protect[5] = ProtCfg4.word;
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = TRUE;
- break;
-
- case 8:
- // Special on for Atheros problem n chip.
- Protect[2] = 0x01754004;
- Protect[3] = 0x03f54084;
- Protect[4] = 0x01754004;
- Protect[5] = 0x03f54084;
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = TRUE;
- break;
- }
- }
-
- offset = CCK_PROT_CFG;
- for (i = 0;i < 6;i++)
- {
- if ((SetMask & (1<< i)))
- {
- RTMP_IO_WRITE32(pAd, offset + i*4, Protect[i]);
- }
- }
-}
-
-#ifdef RT2870
-/*
- ==========================================================================
- Description:
-
- Load RF normal operation-mode setup
-
- ==========================================================================
- */
-VOID RT30xxLoadRFNormalModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
-
- // RX0_PD & TX0_PD, RF R1 register Bit 2 & Bit 3 to 0 and RF_BLOCK_en,RX1_PD & TX1_PD, Bit0, Bit 4 & Bit5 to 1
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue = (RFValue & (~0x0C)) | 0x31;
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // TX_LO2_en, RF R15 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R15, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R15, RFValue);
-
- // TX_LO1_en, RF R17 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
- RFValue &= (~0x08);
- // to fix rx long range issue
- if (((pAd->MACVersion & 0xffff) >= 0x0211) && (pAd->NicConfig2.field.ExternalLNAForG == 0))
- {
- RFValue |= 0x20;
- }
- RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
-
- // RX_LO1_en, RF R20 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R20, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R20, RFValue);
-
- // RX_LO2_en, RF R21 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
-
- // LDORF_VC, RF R27 register Bit 2 to 0
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RFValue = (RFValue & (~0x77)) | 0x3;
- else
- RFValue = (RFValue & (~0x77));
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
- /* end johnli */
-}
-
-/*
- ==========================================================================
- Description:
-
- Load RF sleep-mode setup
-
- ==========================================================================
- */
-VOID RT30xxLoadRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
- UINT32 MACValue;
-
- // RF_BLOCK_en. RF R1 register Bit 0 to 0
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue &= (~0x01);
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // VCO_IC, RF R7 register Bit 4 & Bit 5 to 0
- RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
- RFValue &= (~0x30);
- RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
-
- // Idoh, RF R9 register Bit 1, Bit 2 & Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R09, &RFValue);
- RFValue &= (~0x0E);
- RT30xxWriteRFRegister(pAd, RF_R09, RFValue);
-
- // RX_CTB_en, RF R21 register Bit 7 to 0
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue &= (~0x80);
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
-
- // LDORF_VC, RF R27 register Bit 0, Bit 1 & Bit 2 to 1
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- RFValue |= 0x77;
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
-
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue |= 0x1D000000;
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
-}
-
-/*
- ==========================================================================
- Description:
-
- Reverse RF sleep-mode setup
-
- ==========================================================================
- */
-VOID RT30xxReverseRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
- UINT32 MACValue;
-
- // RF_BLOCK_en, RF R1 register Bit 0 to 1
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue |= 0x01;
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // VCO_IC, RF R7 register Bit 4 & Bit 5 to 1
- RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
- RFValue |= 0x30;
- RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
-
- // Idoh, RF R9 register Bit 1, Bit 2 & Bit 3 to 1
- RT30xxReadRFRegister(pAd, RF_R09, &RFValue);
- RFValue |= 0x0E;
- RT30xxWriteRFRegister(pAd, RF_R09, RFValue);
-
- // RX_CTB_en, RF R21 register Bit 7 to 1
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue |= 0x80;
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
-
- // LDORF_VC, RF R27 register Bit 2 to 0
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RFValue = (RFValue & (~0x77)) | 0x3;
- else
- RFValue = (RFValue & (~0x77));
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
-
- // RT3071 version E has fixed this issue
- if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
- {
- // patch tx EVM issue temporarily
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue = ((MACValue & 0xE0FFFFFF) | 0x0D000000);
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
- }
- else
- {
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue = ((MACValue & 0xE0FFFFFF) | 0x01000000);
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
- }
-}
-#endif
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicSwitchChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel,
- IN BOOLEAN bScan)
-{
- ULONG R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0;
- CHAR TxPwer = 0, TxPwer2 = DEFAULT_RF_TX_POWER; //Bbp94 = BBPR94_DEFAULT, TxPwer2 = DEFAULT_RF_TX_POWER;
- UCHAR index;
- UINT32 Value = 0; //BbpReg, Value;
- RTMP_RF_REGS *RFRegTable;
-
- // Search Tx power value
- // We can't use ChannelList to search channel, since some central channl's txpowr doesn't list
- // in ChannelList, so use TxPower array instead.
- //
- for (index = 0; index < MAX_NUM_OF_CHANNELS; index++)
- {
- if (Channel == pAd->TxPower[index].Channel)
- {
- TxPwer = pAd->TxPower[index].Power;
- TxPwer2 = pAd->TxPower[index].Power2;
- break;
- }
- }
-
- if (index == MAX_NUM_OF_CHANNELS)
- DBGPRINT(RT_DEBUG_ERROR, ("AsicSwitchChannel: Can't find the Channel#%d \n", Channel));
-
-#ifdef RT2870
- // The RF programming sequence is difference between 3xxx and 2xxx
- if ((IS_RT3070(pAd) || IS_RT3090(pAd)) && (
- (pAd->RfIcType == RFIC_3022) || (pAd->RfIcType == RFIC_3021) ||
- (pAd->RfIcType == RFIC_3020) || (pAd->RfIcType == RFIC_2020)))
- {
- /* modify by WY for Read RF Reg. error */
- UCHAR RFValue;
-
- for (index = 0; index < NUM_OF_3020_CHNL; index++)
- {
- if (Channel == FreqItems3020[index].Channel)
- {
- // Programming channel parameters
- RT30xxWriteRFRegister(pAd, RF_R02, FreqItems3020[index].N);
- RT30xxWriteRFRegister(pAd, RF_R03, FreqItems3020[index].K);
-
- RT30xxReadRFRegister(pAd, RF_R06, &RFValue);
- RFValue = (RFValue & 0xFC) | FreqItems3020[index].R;
- RT30xxWriteRFRegister(pAd, RF_R06, RFValue);
-
- // Set Tx0 Power
- RT30xxReadRFRegister(pAd, RF_R12, &RFValue);
- RFValue = (RFValue & 0xE0) | TxPwer;
- RT30xxWriteRFRegister(pAd, RF_R12, RFValue);
-
- // Set Tx1 Power
- RT30xxReadRFRegister(pAd, RF_R13, &RFValue);
- RFValue = (RFValue & 0xE0) | TxPwer2;
- RT30xxWriteRFRegister(pAd, RF_R13, RFValue);
-
- // Tx/Rx Stream setting
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- //if (IS_RT3090(pAd))
- // RFValue |= 0x01; // Enable RF block.
- RFValue &= 0x03; //clear bit[7~2]
- if (pAd->Antenna.field.TxPath == 1)
- RFValue |= 0xA0;
- else if (pAd->Antenna.field.TxPath == 2)
- RFValue |= 0x80;
- if (pAd->Antenna.field.RxPath == 1)
- RFValue |= 0x50;
- else if (pAd->Antenna.field.RxPath == 2)
- RFValue |= 0x40;
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // Set RF offset
- RT30xxReadRFRegister(pAd, RF_R23, &RFValue);
- RFValue = (RFValue & 0x80) | pAd->RfFreqOffset;
- RT30xxWriteRFRegister(pAd, RF_R23, RFValue);
-
- // Set BW
- if (!bScan && (pAd->CommonCfg.BBPCurrentBW == BW_40))
- {
- RFValue = pAd->Mlme.CaliBW40RfR24;
- //DISABLE_11N_CHECK(pAd);
- }
- else
- {
- RFValue = pAd->Mlme.CaliBW20RfR24;
- }
- RT30xxWriteRFRegister(pAd, RF_R24, RFValue);
- RT30xxWriteRFRegister(pAd, RF_R31, RFValue);
-
- // Enable RF tuning
- RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
- RFValue = RFValue | 0x1;
- RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
-
- // latch channel for future usage.
- pAd->LatchRfRegs.Channel = Channel;
-
- DBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n",
- Channel,
- pAd->RfIcType,
- TxPwer,
- TxPwer2,
- pAd->Antenna.field.TxPath,
- FreqItems3020[index].N,
- FreqItems3020[index].K,
- FreqItems3020[index].R));
- break;
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n",
- Channel,
- pAd->RfIcType,
- TxPwer,
- TxPwer2,
- pAd->Antenna.field.TxPath,
- FreqItems3020[index].N,
- FreqItems3020[index].K,
- FreqItems3020[index].R));
- }
- else
-#endif // RT2870 //
- {
- RFRegTable = RF2850RegTable;
-
- switch (pAd->RfIcType)
- {
- case RFIC_2820:
- case RFIC_2850:
- case RFIC_2720:
- case RFIC_2750:
-
- for (index = 0; index < NUM_OF_2850_CHNL; index++)
- {
- if (Channel == RFRegTable[index].Channel)
- {
- R2 = RFRegTable[index].R2;
- if (pAd->Antenna.field.TxPath == 1)
- {
- R2 |= 0x4000; // If TXpath is 1, bit 14 = 1;
- }
-
- if (pAd->Antenna.field.RxPath == 2)
- {
- R2 |= 0x40; // write 1 to off Rxpath.
- }
- else if (pAd->Antenna.field.RxPath == 1)
- {
- R2 |= 0x20040; // write 1 to off RxPath
- }
-
- if (Channel > 14)
- {
- // initialize R3, R4
- R3 = (RFRegTable[index].R3 & 0xffffc1ff);
- R4 = (RFRegTable[index].R4 & (~0x001f87c0)) | (pAd->RfFreqOffset << 15);
-
- // 5G band power range: 0xF9~0X0F, TX0 Reg3 bit9/TX1 Reg4 bit6="0" means the TX power reduce 7dB
- // R3
- if ((TxPwer >= -7) && (TxPwer < 0))
- {
- TxPwer = (7+TxPwer);
- TxPwer = (TxPwer > 0xF) ? (0xF) : (TxPwer);
- R3 |= (TxPwer << 10);
- DBGPRINT(RT_DEBUG_ERROR, ("AsicSwitchChannel: TxPwer=%d \n", TxPwer));
- }
- else
- {
- TxPwer = (TxPwer > 0xF) ? (0xF) : (TxPwer);
- R3 |= (TxPwer << 10) | (1 << 9);
- }
-
- // R4
- if ((TxPwer2 >= -7) && (TxPwer2 < 0))
- {
- TxPwer2 = (7+TxPwer2);
- TxPwer2 = (TxPwer2 > 0xF) ? (0xF) : (TxPwer2);
- R4 |= (TxPwer2 << 7);
- DBGPRINT(RT_DEBUG_ERROR, ("AsicSwitchChannel: TxPwer2=%d \n", TxPwer2));
- }
- else
- {
- TxPwer2 = (TxPwer2 > 0xF) ? (0xF) : (TxPwer2);
- R4 |= (TxPwer2 << 7) | (1 << 6);
- }
- }
- else
- {
- R3 = (RFRegTable[index].R3 & 0xffffc1ff) | (TxPwer << 9); // set TX power0
- R4 = (RFRegTable[index].R4 & (~0x001f87c0)) | (pAd->RfFreqOffset << 15) | (TxPwer2 <<6);// Set freq Offset & TxPwr1
- }
-
- // Based on BBP current mode before changing RF channel.
- if (!bScan && (pAd->CommonCfg.BBPCurrentBW == BW_40))
- {
- R4 |=0x200000;
- }
-
- // Update variables
- pAd->LatchRfRegs.Channel = Channel;
- pAd->LatchRfRegs.R1 = RFRegTable[index].R1;
- pAd->LatchRfRegs.R2 = R2;
- pAd->LatchRfRegs.R3 = R3;
- pAd->LatchRfRegs.R4 = R4;
-
- // Set RF value 1's set R3[bit2] = [0]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 & (~0x04)));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- RTMPusecDelay(200);
-
- // Set RF value 2's set R3[bit2] = [1]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 | 0x04));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- RTMPusecDelay(200);
-
- // Set RF value 3's set R3[bit2] = [0]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 & (~0x04)));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- break;
- }
- }
- break;
-
- default:
- break;
- }
- }
-
- // Change BBP setting during siwtch from a->g, g->a
- if (Channel <= 14)
- {
- ULONG TxPinCfg = 0x00050F0A;//Gary 2007/08/09 0x050A0A
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R63, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R64, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R86, 0);//(0x44 - GET_LNA_GAIN(pAd))); // According the Rory's suggestion to solve the middle range issue.
- //RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x62);
-
- // Rx High power VGA offset for LNA select
- if (pAd->NicConfig2.field.ExternalLNAForG)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x62);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x46);
- }
- else
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x84);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x50);
- }
-
- // 5G band selection PIN, bit1 and bit2 are complement
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Value);
- Value &= (~0x6);
- Value |= (0x04);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
-
- // Turn off unused PA or LNA when only 1T or 1R
- if (pAd->Antenna.field.TxPath == 1)
- {
- TxPinCfg &= 0xFFFFFFF3;
- }
- if (pAd->Antenna.field.RxPath == 1)
- {
- TxPinCfg &= 0xFFFFF3FF;
- }
-
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
- }
- else
- {
- ULONG TxPinCfg = 0x00050F05;//Gary 2007/8/9 0x050505
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R63, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R64, (0x37 - GET_LNA_GAIN(pAd)));
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R86, 0);//(0x44 - GET_LNA_GAIN(pAd))); // According the Rory's suggestion to solve the middle range issue.
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0xF2);
-
- // Rx High power VGA offset for LNA select
- if (pAd->NicConfig2.field.ExternalLNAForA)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x46);
- }
- else
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R75, 0x50);
- }
-
- // 5G band selection PIN, bit1 and bit2 are complement
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Value);
- Value &= (~0x6);
- Value |= (0x02);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
-
- // Turn off unused PA or LNA when only 1T or 1R
- if (pAd->Antenna.field.TxPath == 1)
- {
- TxPinCfg &= 0xFFFFFFF3;
- }
- if (pAd->Antenna.field.RxPath == 1)
- {
- TxPinCfg &= 0xFFFFF3FF;
- }
-
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
- }
-
- // R66 should be set according to Channel and use 20MHz when scanning
- //RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, (0x2E + GET_LNA_GAIN(pAd)));
- if (bScan)
- RTMPSetAGCInitValue(pAd, BW_20);
- else
- RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW);
-
- //
- // On 11A, We should delay and wait RF/BBP to be stable
- // and the appropriate time should be 1000 micro seconds
- // 2005/06/05 - On 11G, We also need this delay time. Otherwise it's difficult to pass the WHQL.
- //
- RTMPusecDelay(1000);
-
- DBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%lu, Pwr1=%lu, %dT) to , R1=0x%08lx, R2=0x%08lx, R3=0x%08lx, R4=0x%08lx\n",
- Channel,
- pAd->RfIcType,
- (R3 & 0x00003e00) >> 9,
- (R4 & 0x000007c0) >> 6,
- pAd->Antenna.field.TxPath,
- pAd->LatchRfRegs.R1,
- pAd->LatchRfRegs.R2,
- pAd->LatchRfRegs.R3,
- pAd->LatchRfRegs.R4));
-}
-
-/*
- ==========================================================================
- Description:
- This function is required for 2421 only, and should not be used during
- site survey. It's only required after NIC decided to stay at a channel
- for a longer period.
- When this function is called, it's always after AsicSwitchChannel().
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicLockChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel)
-{
-}
-
-VOID AsicRfTuningExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
-}
-
-/*
- ==========================================================================
- Description:
- Gives CCK TX rate 2 more dB TX power.
- This routine works only in LINK UP in INFRASTRUCTURE mode.
-
- calculate desired Tx power in RF R3.Tx0~5, should consider -
- 0. if current radio is a noisy environment (pAd->DrsCounters.fNoisyEnvironment)
- 1. TxPowerPercentage
- 2. auto calibration based on TSSI feedback
- 3. extra 2 db for CCK
- 4. -10 db upon very-short distance (AvgRSSI >= -40db) to AP
-
- NOTE: Since this routine requires the value of (pAd->DrsCounters.fNoisyEnvironment),
- it should be called AFTER MlmeDynamicTxRatSwitching()
- ==========================================================================
- */
-VOID AsicAdjustTxPower(
- IN PRTMP_ADAPTER pAd)
-{
- INT i, j;
- CHAR DeltaPwr = 0;
- BOOLEAN bAutoTxAgc = FALSE;
- UCHAR TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep;
- UCHAR BbpR1 = 0, BbpR49 = 0, idx;
- PCHAR pTxAgcCompensate;
- ULONG TxPwr[5];
- CHAR Value;
-
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
- || (pAd->bPCIclkOff == TRUE)
- || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)
- || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- return;
-#endif
-
- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
- {
- if (pAd->CommonCfg.CentralChannel > 14)
- {
- TxPwr[0] = pAd->Tx40MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx40MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgGBand[4];
- }
- }
- else
- {
- if (pAd->CommonCfg.Channel > 14)
- {
- TxPwr[0] = pAd->Tx20MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx20MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgGBand[4];
- }
- }
-
- // TX power compensation for temperature variation based on TSSI. try every 4 second
- if (pAd->Mlme.OneSecPeriodicRound % 4 == 0)
- {
- if (pAd->CommonCfg.Channel <= 14)
- {
- /* bg channel */
- bAutoTxAgc = pAd->bAutoTxAgcG;
- TssiRef = pAd->TssiRefG;
- pTssiMinusBoundary = &pAd->TssiMinusBoundaryG[0];
- pTssiPlusBoundary = &pAd->TssiPlusBoundaryG[0];
- TxAgcStep = pAd->TxAgcStepG;
- pTxAgcCompensate = &pAd->TxAgcCompensateG;
- }
- else
- {
- /* a channel */
- bAutoTxAgc = pAd->bAutoTxAgcA;
- TssiRef = pAd->TssiRefA;
- pTssiMinusBoundary = &pAd->TssiMinusBoundaryA[0];
- pTssiPlusBoundary = &pAd->TssiPlusBoundaryA[0];
- TxAgcStep = pAd->TxAgcStepA;
- pTxAgcCompensate = &pAd->TxAgcCompensateA;
- }
-
- if (bAutoTxAgc)
- {
- /* BbpR1 is unsigned char */
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R49, &BbpR49);
-
- /* (p) TssiPlusBoundaryG[0] = 0 = (m) TssiMinusBoundaryG[0] */
- /* compensate: +4 +3 +2 +1 0 -1 -2 -3 -4 * steps */
- /* step value is defined in pAd->TxAgcStepG for tx power value */
-
- /* [4]+1+[4] p4 p3 p2 p1 o1 m1 m2 m3 m4 */
- /* ex: 0x00 0x15 0x25 0x45 0x88 0xA0 0xB5 0xD0 0xF0
- above value are examined in mass factory production */
- /* [4] [3] [2] [1] [0] [1] [2] [3] [4] */
-
- /* plus (+) is 0x00 ~ 0x45, minus (-) is 0xa0 ~ 0xf0 */
- /* if value is between p1 ~ o1 or o1 ~ s1, no need to adjust tx power */
- /* if value is 0xa5, tx power will be -= TxAgcStep*(2-1) */
-
- if (BbpR49 > pTssiMinusBoundary[1])
- {
- // Reading is larger than the reference value
- // check for how large we need to decrease the Tx power
- for (idx = 1; idx < 5; idx++)
- {
- if (BbpR49 <= pTssiMinusBoundary[idx]) // Found the range
- break;
- }
- // The index is the step we should decrease, idx = 0 means there is nothing to compensate
- *pTxAgcCompensate = -(TxAgcStep * (idx-1));
-
- DeltaPwr += (*pTxAgcCompensate);
- DBGPRINT(RT_DEBUG_TRACE, ("-- Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = -%d\n",
- BbpR49, TssiRef, TxAgcStep, idx-1));
- }
- else if (BbpR49 < pTssiPlusBoundary[1])
- {
- // Reading is smaller than the reference value
- // check for how large we need to increase the Tx power
- for (idx = 1; idx < 5; idx++)
- {
- if (BbpR49 >= pTssiPlusBoundary[idx]) // Found the range
- break;
- }
- // The index is the step we should increase, idx = 0 means there is nothing to compensate
- *pTxAgcCompensate = TxAgcStep * (idx-1);
- DeltaPwr += (*pTxAgcCompensate);
- DBGPRINT(RT_DEBUG_TRACE, ("++ Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = +%d\n",
- BbpR49, TssiRef, TxAgcStep, idx-1));
- }
- else
- {
- *pTxAgcCompensate = 0;
- DBGPRINT(RT_DEBUG_TRACE, (" Tx Power, BBP R49=%x, TssiRef=%x, TxAgcStep=%x, step = +%d\n",
- BbpR49, TssiRef, TxAgcStep, 0));
- }
- }
- }
- else
- {
- if (pAd->CommonCfg.Channel <= 14)
- {
- bAutoTxAgc = pAd->bAutoTxAgcG;
- pTxAgcCompensate = &pAd->TxAgcCompensateG;
- }
- else
- {
- bAutoTxAgc = pAd->bAutoTxAgcA;
- pTxAgcCompensate = &pAd->TxAgcCompensateA;
- }
-
- if (bAutoTxAgc)
- DeltaPwr += (*pTxAgcCompensate);
- }
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BbpR1);
- BbpR1 &= 0xFC;
-
- /* calculate delta power based on the percentage specified from UI */
- // E2PROM setting is calibrated for maximum TX power (i.e. 100%)
- // We lower TX power here according to the percentage specified from UI
- if (pAd->CommonCfg.TxPowerPercentage == 0xffffffff) // AUTO TX POWER control
- ;
- else if (pAd->CommonCfg.TxPowerPercentage > 90) // 91 ~ 100% & AUTO, treat as 100% in terms of mW
- ;
- else if (pAd->CommonCfg.TxPowerPercentage > 60) // 61 ~ 90%, treat as 75% in terms of mW // DeltaPwr -= 1;
- {
- DeltaPwr -= 1;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 30) // 31 ~ 60%, treat as 50% in terms of mW // DeltaPwr -= 3;
- {
- DeltaPwr -= 3;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 15) // 16 ~ 30%, treat as 25% in terms of mW // DeltaPwr -= 6;
- {
- BbpR1 |= 0x01;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 9) // 10 ~ 15%, treat as 12.5% in terms of mW // DeltaPwr -= 9;
- {
- BbpR1 |= 0x01;
- DeltaPwr -= 3;
- }
- else // 0 ~ 9 %, treat as MIN(~3%) in terms of mW // DeltaPwr -= 12;
- {
- BbpR1 |= 0x02;
- }
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BbpR1);
-
- /* reset different new tx power for different TX rate */
- for(i=0; i<5; i++)
- {
- if (TxPwr[i] != 0xffffffff)
- {
- for (j=0; j<8; j++)
- {
- Value = (CHAR)((TxPwr[i] >> j*4) & 0x0F); /* 0 ~ 15 */
-
- if ((Value + DeltaPwr) < 0)
- {
- Value = 0; /* min */
- }
- else if ((Value + DeltaPwr) > 0xF)
- {
- Value = 0xF; /* max */
- }
- else
- {
- Value += DeltaPwr; /* temperature compensation */
- }
-
- /* fill new value to CSR offset */
- TxPwr[i] = (TxPwr[i] & ~(0x0000000F << j*4)) | (Value << j*4);
- }
-
- /* write tx power value to CSR */
- /* TX_PWR_CFG_0 (8 tx rate) for TX power for OFDM 12M/18M
- TX power for OFDM 6M/9M
- TX power for CCK5.5M/11M
- TX power for CCK1M/2M */
- /* TX_PWR_CFG_1 ~ TX_PWR_CFG_4 */
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, TxPwr[i]);
- }
- }
-
-}
-
-/*
- ==========================================================================
- Description:
- put PHY to sleep here, and set next wakeup timer. PHY doesn't not wakeup
- automatically. Instead, MCU will issue a TwakeUpInterrupt to host after
- the wakeup timer timeout. Driver has to issue a separate command to wake
- PHY up.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicSleepThenAutoWakeup(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TbttNumToNextWakeUp)
-{
- RT28XX_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp);
-}
-
-/*
- ==========================================================================
- Description:
- AsicForceWakeup() is used whenever manual wakeup is required
- AsicForceSleep() should only be used when not in INFRA BSS. When
- in INFRA BSS, we should use AsicSleepThenAutoWakeup() instead.
- ==========================================================================
- */
-VOID AsicForceSleep(
- IN PRTMP_ADAPTER pAd)
-{
-
-}
-
-/*
- ==========================================================================
- Description:
- AsicForceWakeup() is used whenever Twakeup timer (set via AsicSleepThenAutoWakeup)
- expired.
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
- ==========================================================================
- */
-VOID AsicForceWakeup(
- IN PRTMP_ADAPTER pAd,
-#ifdef RT2860
- IN UCHAR Level)
-#endif
-#ifdef RT2870
- IN BOOLEAN bFromTx)
-#endif
-{
- DBGPRINT(RT_DEBUG_TRACE, ("--> AsicForceWakeup \n"));
-#ifdef RT2860
- RT28XX_STA_FORCE_WAKEUP(pAd, Level);
-#endif
-#ifdef RT2870
- RT28XX_STA_FORCE_WAKEUP(pAd, bFromTx);
-#endif
-}
-
-/*
- ==========================================================================
- Description:
- Set My BSSID
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicSetBssid(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pBssid)
-{
- ULONG Addr4;
- DBGPRINT(RT_DEBUG_TRACE, ("==============> AsicSetBssid %x:%x:%x:%x:%x:%x\n",
- pBssid[0],pBssid[1],pBssid[2],pBssid[3], pBssid[4],pBssid[5]));
-
- Addr4 = (ULONG)(pBssid[0]) |
- (ULONG)(pBssid[1] << 8) |
- (ULONG)(pBssid[2] << 16) |
- (ULONG)(pBssid[3] << 24);
- RTMP_IO_WRITE32(pAd, MAC_BSSID_DW0, Addr4);
-
- Addr4 = 0;
- // always one BSSID in STA mode
- Addr4 = (ULONG)(pBssid[4]) | (ULONG)(pBssid[5] << 8);
-
- RTMP_IO_WRITE32(pAd, MAC_BSSID_DW1, Addr4);
-}
-
-VOID AsicSetMcastWC(
- IN PRTMP_ADAPTER pAd)
-{
- MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[MCAST_WCID];
- USHORT offset;
-
- pEntry->Sst = SST_ASSOC;
- pEntry->Aid = MCAST_WCID; // Softap supports 1 BSSID and use WCID=0 as multicast Wcid index
- pEntry->PsMode = PWR_ACTIVE;
- pEntry->CurrTxRate = pAd->CommonCfg.MlmeRate;
- offset = MAC_WCID_BASE + BSS0Mcast_WCID * HW_WCID_ENTRY_SIZE;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicDelWcidTab(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid)
-{
- ULONG Addr0 = 0x0, Addr1 = 0x0;
- ULONG offset;
-
- DBGPRINT(RT_DEBUG_TRACE, ("AsicDelWcidTab==>Wcid = 0x%x\n",Wcid));
- offset = MAC_WCID_BASE + Wcid * HW_WCID_ENTRY_SIZE;
- RTMP_IO_WRITE32(pAd, offset, Addr0);
- offset += 4;
- RTMP_IO_WRITE32(pAd, offset, Addr1);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicEnableRDG(
- IN PRTMP_ADAPTER pAd)
-{
- TX_LINK_CFG_STRUC TxLinkCfg;
- UINT32 Data = 0;
-
- RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
- TxLinkCfg.field.TxRDGEn = 1;
- RTMP_IO_WRITE32(pAd, TX_LINK_CFG, TxLinkCfg.word);
-
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
- Data &= 0xFFFFFF00;
- Data |= 0x80;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Data);
-
- //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicDisableRDG(
- IN PRTMP_ADAPTER pAd)
-{
- TX_LINK_CFG_STRUC TxLinkCfg;
- UINT32 Data = 0;
-
-
- RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
- TxLinkCfg.field.TxRDGEn = 0;
- RTMP_IO_WRITE32(pAd, TX_LINK_CFG, TxLinkCfg.word);
-
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
-
- Data &= 0xFFFFFF00;
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE)
- && (pAd->MacTab.fAnyStationMIMOPSDynamic == FALSE)
- )
- {
- // For CWC test, change txop from 0x30 to 0x20 in TxBurst mode
- if (pAd->CommonCfg.bEnableTxBurst)
- Data |= 0x20;
- }
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Data);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicDisableSync(
- IN PRTMP_ADAPTER pAd)
-{
- BCN_TIME_CFG_STRUC csr;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--->Disable TSF synchronization\n"));
-
- // 2003-12-20 disable TSF and TBTT while NIC in power-saving have side effect
- // that NIC will never wakes up because TSF stops and no more
- // TBTT interrupts
- pAd->TbttTickCount = 0;
- RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
- csr.field.bBeaconGen = 0;
- csr.field.bTBTTEnable = 0;
- csr.field.TsfSyncMode = 0;
- csr.field.bTsfTicking = 0;
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
-
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicEnableBssSync(
- IN PRTMP_ADAPTER pAd)
-{
- BCN_TIME_CFG_STRUC csr;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableBssSync(INFRA mode)\n"));
-
- RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
-
- {
- csr.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
- csr.field.bTsfTicking = 1;
- csr.field.TsfSyncMode = 1; // sync TSF in INFRASTRUCTURE mode
- csr.field.bBeaconGen = 0; // do NOT generate BEACON
- csr.field.bTBTTEnable = 1;
- }
-
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
-}
-
-/*
- ==========================================================================
- Description:
- Note:
- BEACON frame in shared memory should be built ok before this routine
- can be called. Otherwise, a garbage frame maybe transmitted out every
- Beacon period.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicEnableIbssSync(
- IN PRTMP_ADAPTER pAd)
-{
- BCN_TIME_CFG_STRUC csr9;
- PUCHAR ptr;
- UINT i;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--->AsicEnableIbssSync(ADHOC mode. MPDUtotalByteCount = %d)\n", pAd->BeaconTxWI.MPDUtotalByteCount));
-
- RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr9.word);
- csr9.field.bBeaconGen = 0;
- csr9.field.bTBTTEnable = 0;
- csr9.field.bTsfTicking = 0;
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr9.word);
-
-#ifdef RT2860
- // move BEACON TXD and frame content to on-chip memory
- ptr = (PUCHAR)&pAd->BeaconTxWI;
- for (i=0; i<TXWI_SIZE; i+=4) // 16-byte TXWI field
- {
- UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
- RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + i, longptr);
- ptr += 4;
- }
-
- // start right after the 16-byte TXWI field
- ptr = pAd->BeaconBuf;
- for (i=0; i< pAd->BeaconTxWI.MPDUtotalByteCount; i+=4)
- {
- UINT32 longptr = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
- RTMP_IO_WRITE32(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, longptr);
- ptr +=4;
- }
-#endif
-#ifdef RT2870
- // move BEACON TXD and frame content to on-chip memory
- ptr = (PUCHAR)&pAd->BeaconTxWI;
- for (i=0; i<TXWI_SIZE; i+=2) // 16-byte TXWI field
- {
- RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + i, ptr, 2);
- ptr += 2;
- }
-
- // start right after the 16-byte TXWI field
- ptr = pAd->BeaconBuf;
- for (i=0; i< pAd->BeaconTxWI.MPDUtotalByteCount; i+=2)
- {
- RTUSBMultiWrite(pAd, HW_BEACON_BASE0 + TXWI_SIZE + i, ptr, 2);
- ptr +=2;
- }
-#endif // RT2870 //
-
- // start sending BEACON
- csr9.field.BeaconInterval = pAd->CommonCfg.BeaconPeriod << 4; // ASIC register in units of 1/16 TU
- csr9.field.bTsfTicking = 1;
- csr9.field.TsfSyncMode = 2; // sync TSF in IBSS mode
- csr9.field.bTBTTEnable = 1;
- csr9.field.bBeaconGen = 1;
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr9.word);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicSetEdcaParm(
- IN PRTMP_ADAPTER pAd,
- IN PEDCA_PARM pEdcaParm)
-{
- EDCA_AC_CFG_STRUC Ac0Cfg, Ac1Cfg, Ac2Cfg, Ac3Cfg;
- AC_TXOP_CSR0_STRUC csr0;
- AC_TXOP_CSR1_STRUC csr1;
- AIFSN_CSR_STRUC AifsnCsr;
- CWMIN_CSR_STRUC CwminCsr;
- CWMAX_CSR_STRUC CwmaxCsr;
- int i;
-
- Ac0Cfg.word = 0;
- Ac1Cfg.word = 0;
- Ac2Cfg.word = 0;
- Ac3Cfg.word = 0;
- if ((pEdcaParm == NULL) || (pEdcaParm->bValid == FALSE))
- {
- DBGPRINT(RT_DEBUG_TRACE,("AsicSetEdcaParm\n"));
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_WMM_INUSED);
- for (i=0; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- if (pAd->MacTab.Content[i].ValidAsCLI || pAd->MacTab.Content[i].ValidAsApCli)
- CLIENT_STATUS_CLEAR_FLAG(&pAd->MacTab.Content[i], fCLIENT_STATUS_WMM_CAPABLE);
- }
-
- //========================================================
- // MAC Register has a copy .
- //========================================================
- if( pAd->CommonCfg.bEnableTxBurst )
- {
- // For CWC test, change txop from 0x30 to 0x20 in TxBurst mode
- Ac0Cfg.field.AcTxop = 0x20; // Suggest by John for TxBurst in HT Mode
- }
- else
- Ac0Cfg.field.AcTxop = 0; // QID_AC_BE
- Ac0Cfg.field.Cwmin = CW_MIN_IN_BITS;
- Ac0Cfg.field.Cwmax = CW_MAX_IN_BITS;
- Ac0Cfg.field.Aifsn = 2;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Ac0Cfg.word);
-
- Ac1Cfg.field.AcTxop = 0; // QID_AC_BK
- Ac1Cfg.field.Cwmin = CW_MIN_IN_BITS;
- Ac1Cfg.field.Cwmax = CW_MAX_IN_BITS;
- Ac1Cfg.field.Aifsn = 2;
- RTMP_IO_WRITE32(pAd, EDCA_AC1_CFG, Ac1Cfg.word);
-
- if (pAd->CommonCfg.PhyMode == PHY_11B)
- {
- Ac2Cfg.field.AcTxop = 192; // AC_VI: 192*32us ~= 6ms
- Ac3Cfg.field.AcTxop = 96; // AC_VO: 96*32us ~= 3ms
- }
- else
- {
- Ac2Cfg.field.AcTxop = 96; // AC_VI: 96*32us ~= 3ms
- Ac3Cfg.field.AcTxop = 48; // AC_VO: 48*32us ~= 1.5ms
- }
- Ac2Cfg.field.Cwmin = CW_MIN_IN_BITS;
- Ac2Cfg.field.Cwmax = CW_MAX_IN_BITS;
- Ac2Cfg.field.Aifsn = 2;
- RTMP_IO_WRITE32(pAd, EDCA_AC2_CFG, Ac2Cfg.word);
- Ac3Cfg.field.Cwmin = CW_MIN_IN_BITS;
- Ac3Cfg.field.Cwmax = CW_MAX_IN_BITS;
- Ac3Cfg.field.Aifsn = 2;
- RTMP_IO_WRITE32(pAd, EDCA_AC3_CFG, Ac3Cfg.word);
-
- //========================================================
- // DMA Register has a copy too.
- //========================================================
- csr0.field.Ac0Txop = 0; // QID_AC_BE
- csr0.field.Ac1Txop = 0; // QID_AC_BK
- RTMP_IO_WRITE32(pAd, WMM_TXOP0_CFG, csr0.word);
- if (pAd->CommonCfg.PhyMode == PHY_11B)
- {
- csr1.field.Ac2Txop = 192; // AC_VI: 192*32us ~= 6ms
- csr1.field.Ac3Txop = 96; // AC_VO: 96*32us ~= 3ms
- }
- else
- {
- csr1.field.Ac2Txop = 96; // AC_VI: 96*32us ~= 3ms
- csr1.field.Ac3Txop = 48; // AC_VO: 48*32us ~= 1.5ms
- }
- RTMP_IO_WRITE32(pAd, WMM_TXOP1_CFG, csr1.word);
-
- CwminCsr.word = 0;
- CwminCsr.field.Cwmin0 = CW_MIN_IN_BITS;
- CwminCsr.field.Cwmin1 = CW_MIN_IN_BITS;
- CwminCsr.field.Cwmin2 = CW_MIN_IN_BITS;
- CwminCsr.field.Cwmin3 = CW_MIN_IN_BITS;
- RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word);
-
- CwmaxCsr.word = 0;
- CwmaxCsr.field.Cwmax0 = CW_MAX_IN_BITS;
- CwmaxCsr.field.Cwmax1 = CW_MAX_IN_BITS;
- CwmaxCsr.field.Cwmax2 = CW_MAX_IN_BITS;
- CwmaxCsr.field.Cwmax3 = CW_MAX_IN_BITS;
- RTMP_IO_WRITE32(pAd, WMM_CWMAX_CFG, CwmaxCsr.word);
-
- RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, 0x00002222);
-
- NdisZeroMemory(&pAd->CommonCfg.APEdcaParm, sizeof(EDCA_PARM));
- }
- else
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_WMM_INUSED);
- //========================================================
- // MAC Register has a copy.
- //========================================================
- //
- // Modify Cwmin/Cwmax/Txop on queue[QID_AC_VI], Recommend by Jerry 2005/07/27
- // To degrade our VIDO Queue's throughput for WiFi WMM S3T07 Issue.
- //
- //pEdcaParm->Txop[QID_AC_VI] = pEdcaParm->Txop[QID_AC_VI] * 7 / 10; // rt2860c need this
-
- Ac0Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_BE];
- Ac0Cfg.field.Cwmin= pEdcaParm->Cwmin[QID_AC_BE];
- Ac0Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_BE];
- Ac0Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_BE]; //+1;
-
- Ac1Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_BK];
- Ac1Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_BK]; //+2;
- Ac1Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_BK];
- Ac1Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_BK]; //+1;
-
- Ac2Cfg.field.AcTxop = (pEdcaParm->Txop[QID_AC_VI] * 6) / 10;
- Ac2Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VI];
- Ac2Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VI];
- Ac2Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VI];
-
- {
- // Tuning for Wi-Fi WMM S06
- if (pAd->CommonCfg.bWiFiTest &&
- pEdcaParm->Aifsn[QID_AC_VI] == 10)
- Ac2Cfg.field.Aifsn -= 1;
-
- // Tuning for TGn Wi-Fi 5.2.32
- // STA TestBed changes in this item: connexant legacy sta ==> broadcom 11n sta
- if (STA_TGN_WIFI_ON(pAd) &&
- pEdcaParm->Aifsn[QID_AC_VI] == 10)
- {
- Ac0Cfg.field.Aifsn = 3;
- Ac2Cfg.field.AcTxop = 5;
- }
-
-#ifdef RT2870
- if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
- {
- // Tuning for WiFi WMM S3-T07: connexant legacy sta ==> broadcom 11n sta.
- Ac2Cfg.field.Aifsn = 5;
- }
-#endif
- }
-
- Ac3Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VO];
- Ac3Cfg.field.Cwmin = pEdcaParm->Cwmin[QID_AC_VO];
- Ac3Cfg.field.Cwmax = pEdcaParm->Cwmax[QID_AC_VO];
- Ac3Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_VO];
-
-//#ifdef WIFI_TEST
- if (pAd->CommonCfg.bWiFiTest)
- {
- if (Ac3Cfg.field.AcTxop == 102)
- {
- Ac0Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_BE] ? pEdcaParm->Txop[QID_AC_BE] : 10;
- Ac0Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_BE]-1; /* AIFSN must >= 1 */
- Ac1Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_BK];
- Ac1Cfg.field.Aifsn = pEdcaParm->Aifsn[QID_AC_BK];
- Ac2Cfg.field.AcTxop = pEdcaParm->Txop[QID_AC_VI];
- } /* End of if */
- }
-//#endif // WIFI_TEST //
-
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Ac0Cfg.word);
- RTMP_IO_WRITE32(pAd, EDCA_AC1_CFG, Ac1Cfg.word);
- RTMP_IO_WRITE32(pAd, EDCA_AC2_CFG, Ac2Cfg.word);
- RTMP_IO_WRITE32(pAd, EDCA_AC3_CFG, Ac3Cfg.word);
-
-
- //========================================================
- // DMA Register has a copy too.
- //========================================================
- csr0.field.Ac0Txop = Ac0Cfg.field.AcTxop;
- csr0.field.Ac1Txop = Ac1Cfg.field.AcTxop;
- RTMP_IO_WRITE32(pAd, WMM_TXOP0_CFG, csr0.word);
-
- csr1.field.Ac2Txop = Ac2Cfg.field.AcTxop;
- csr1.field.Ac3Txop = Ac3Cfg.field.AcTxop;
- RTMP_IO_WRITE32(pAd, WMM_TXOP1_CFG, csr1.word);
-
- CwminCsr.word = 0;
- CwminCsr.field.Cwmin0 = pEdcaParm->Cwmin[QID_AC_BE];
- CwminCsr.field.Cwmin1 = pEdcaParm->Cwmin[QID_AC_BK];
- CwminCsr.field.Cwmin2 = pEdcaParm->Cwmin[QID_AC_VI];
-
- CwminCsr.field.Cwmin3 = pEdcaParm->Cwmin[QID_AC_VO] - 1; //for TGn wifi test
-
- RTMP_IO_WRITE32(pAd, WMM_CWMIN_CFG, CwminCsr.word);
-
- CwmaxCsr.word = 0;
- CwmaxCsr.field.Cwmax0 = pEdcaParm->Cwmax[QID_AC_BE];
- CwmaxCsr.field.Cwmax1 = pEdcaParm->Cwmax[QID_AC_BK];
- CwmaxCsr.field.Cwmax2 = pEdcaParm->Cwmax[QID_AC_VI];
- CwmaxCsr.field.Cwmax3 = pEdcaParm->Cwmax[QID_AC_VO];
- RTMP_IO_WRITE32(pAd, WMM_CWMAX_CFG, CwmaxCsr.word);
-
- AifsnCsr.word = 0;
- AifsnCsr.field.Aifsn0 = Ac0Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BE];
- AifsnCsr.field.Aifsn1 = Ac1Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_BK];
- AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn; //pEdcaParm->Aifsn[QID_AC_VI];
-
- {
- // Tuning for Wi-Fi WMM S06
- if (pAd->CommonCfg.bWiFiTest &&
- pEdcaParm->Aifsn[QID_AC_VI] == 10)
- AifsnCsr.field.Aifsn2 = Ac2Cfg.field.Aifsn - 4;
-
- // Tuning for TGn Wi-Fi 5.2.32
- // STA TestBed changes in this item: connexant legacy sta ==> broadcom 11n sta
- if (STA_TGN_WIFI_ON(pAd) &&
- pEdcaParm->Aifsn[QID_AC_VI] == 10)
- {
- AifsnCsr.field.Aifsn0 = 3;
- AifsnCsr.field.Aifsn2 = 7;
- }
-#ifdef RT2870
- if (INFRA_ON(pAd))
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_WMM_CAPABLE);
-#endif
- }
-
- AifsnCsr.field.Aifsn3 = Ac3Cfg.field.Aifsn - 1; //pEdcaParm->Aifsn[QID_AC_VO]; //for TGn wifi test
-#ifdef RT2870
- if (pAd->RfIcType == RFIC_3020 || pAd->RfIcType == RFIC_2020)
- AifsnCsr.field.Aifsn2 = 0x2; //pEdcaParm->Aifsn[QID_AC_VI]; //for WiFi WMM S4-T04.
-#endif
- RTMP_IO_WRITE32(pAd, WMM_AIFSN_CFG, AifsnCsr.word);
-
- NdisMoveMemory(&pAd->CommonCfg.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
- if (!ADHOC_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE,("EDCA [#%d]: AIFSN CWmin CWmax TXOP(us) ACM\n", pEdcaParm->EdcaUpdateCount));
- DBGPRINT(RT_DEBUG_TRACE,(" AC_BE %2d %2d %2d %4d %d\n",
- pEdcaParm->Aifsn[0],
- pEdcaParm->Cwmin[0],
- pEdcaParm->Cwmax[0],
- pEdcaParm->Txop[0]<<5,
- pEdcaParm->bACM[0]));
- DBGPRINT(RT_DEBUG_TRACE,(" AC_BK %2d %2d %2d %4d %d\n",
- pEdcaParm->Aifsn[1],
- pEdcaParm->Cwmin[1],
- pEdcaParm->Cwmax[1],
- pEdcaParm->Txop[1]<<5,
- pEdcaParm->bACM[1]));
- DBGPRINT(RT_DEBUG_TRACE,(" AC_VI %2d %2d %2d %4d %d\n",
- pEdcaParm->Aifsn[2],
- pEdcaParm->Cwmin[2],
- pEdcaParm->Cwmax[2],
- pEdcaParm->Txop[2]<<5,
- pEdcaParm->bACM[2]));
- DBGPRINT(RT_DEBUG_TRACE,(" AC_VO %2d %2d %2d %4d %d\n",
- pEdcaParm->Aifsn[3],
- pEdcaParm->Cwmin[3],
- pEdcaParm->Cwmax[3],
- pEdcaParm->Txop[3]<<5,
- pEdcaParm->bACM[3]));
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicSetSlotTime(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bUseShortSlotTime)
-{
- ULONG SlotTime;
- UINT32 RegValue = 0;
-
- if (pAd->CommonCfg.Channel > 14)
- bUseShortSlotTime = TRUE;
-
- if (bUseShortSlotTime)
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED);
- else
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED);
-
- SlotTime = (bUseShortSlotTime)? 9 : 20;
-
- {
- // force using short SLOT time for FAE to demo performance when TxBurst is ON
- if (((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED)))
- || ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE))
- )
- {
- // In this case, we will think it is doing Wi-Fi test
- // And we will not set to short slot when bEnableTxBurst is TRUE.
- }
- else if (pAd->CommonCfg.bEnableTxBurst)
- SlotTime = 9;
- }
-
- //
- // For some reasons, always set it to short slot time.
- //
- // ToDo: Should consider capability with 11B
- //
- if (pAd->StaCfg.BssType == BSS_ADHOC)
- SlotTime = 20;
-
- RTMP_IO_READ32(pAd, BKOFF_SLOT_CFG, &RegValue);
- RegValue = RegValue & 0xFFFFFF00;
-
- RegValue |= SlotTime;
-
- RTMP_IO_WRITE32(pAd, BKOFF_SLOT_CFG, RegValue);
-}
-
-/*
- ========================================================================
- Description:
- Add Shared key information into ASIC.
- Update shared key, TxMic and RxMic to Asic Shared key table
- Update its cipherAlg to Asic Shared key Mode.
-
- Return:
- ========================================================================
-*/
-VOID AsicAddSharedKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx,
- IN UCHAR CipherAlg,
- IN PUCHAR pKey,
- IN PUCHAR pTxMic,
- IN PUCHAR pRxMic)
-{
- ULONG offset; //, csr0;
- SHAREDKEY_MODE_STRUC csr1;
-#ifdef RT2860
- INT i;
-#endif
-
- DBGPRINT(RT_DEBUG_TRACE, ("AsicAddSharedKeyEntry BssIndex=%d, KeyIdx=%d\n", BssIndex,KeyIdx));
-//============================================================================================
-
- DBGPRINT(RT_DEBUG_TRACE,("AsicAddSharedKeyEntry: %s key #%d\n", CipherName[CipherAlg], BssIndex*4 + KeyIdx));
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pKey[0],pKey[1],pKey[2],pKey[3],pKey[4],pKey[5],pKey[6],pKey[7],pKey[8],pKey[9],pKey[10],pKey[11],pKey[12],pKey[13],pKey[14],pKey[15]));
- if (pRxMic)
- {
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" Rx MIC Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pRxMic[0],pRxMic[1],pRxMic[2],pRxMic[3],pRxMic[4],pRxMic[5],pRxMic[6],pRxMic[7]));
- }
- if (pTxMic)
- {
- DBGPRINT_RAW(RT_DEBUG_TRACE, (" Tx MIC Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pTxMic[0],pTxMic[1],pTxMic[2],pTxMic[3],pTxMic[4],pTxMic[5],pTxMic[6],pTxMic[7]));
- }
-//============================================================================================
- //
- // fill key material - key + TX MIC + RX MIC
- //
-
- offset = SHARED_KEY_TABLE_BASE + (4*BssIndex + KeyIdx)*HW_KEY_ENTRY_SIZE;
-#ifdef RT2860
- for (i=0; i<MAX_LEN_OF_SHARE_KEY; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pKey[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pKey, MAX_LEN_OF_SHARE_KEY);
-#endif
- offset += MAX_LEN_OF_SHARE_KEY;
- if (pTxMic)
- {
-#ifdef RT2860
- for (i=0; i<8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pTxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pTxMic, 8);
-#endif
- }
-
- offset += 8;
- if (pRxMic)
- {
-#ifdef RT2860
- for (i=0; i<8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pRxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pRxMic, 8);
-#endif
- }
-
-
- //
- // Update cipher algorithm. WSTA always use BSS0
- //
- RTMP_IO_READ32(pAd, SHARED_KEY_MODE_BASE+4*(BssIndex/2), &csr1.word);
- DBGPRINT(RT_DEBUG_TRACE,("Read: SHARED_KEY_MODE_BASE at this Bss[%d] KeyIdx[%d]= 0x%x \n", BssIndex,KeyIdx, csr1.word));
- if ((BssIndex%2) == 0)
- {
- if (KeyIdx == 0)
- csr1.field.Bss0Key0CipherAlg = CipherAlg;
- else if (KeyIdx == 1)
- csr1.field.Bss0Key1CipherAlg = CipherAlg;
- else if (KeyIdx == 2)
- csr1.field.Bss0Key2CipherAlg = CipherAlg;
- else
- csr1.field.Bss0Key3CipherAlg = CipherAlg;
- }
- else
- {
- if (KeyIdx == 0)
- csr1.field.Bss1Key0CipherAlg = CipherAlg;
- else if (KeyIdx == 1)
- csr1.field.Bss1Key1CipherAlg = CipherAlg;
- else if (KeyIdx == 2)
- csr1.field.Bss1Key2CipherAlg = CipherAlg;
- else
- csr1.field.Bss1Key3CipherAlg = CipherAlg;
- }
- DBGPRINT(RT_DEBUG_TRACE,("Write: SHARED_KEY_MODE_BASE at this Bss[%d] = 0x%x \n", BssIndex, csr1.word));
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE+4*(BssIndex/2), csr1.word);
-
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID AsicRemoveSharedKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx)
-{
- //ULONG SecCsr0;
- SHAREDKEY_MODE_STRUC csr1;
-
- DBGPRINT(RT_DEBUG_TRACE,("AsicRemoveSharedKeyEntry: #%d \n", BssIndex*4 + KeyIdx));
-
- RTMP_IO_READ32(pAd, SHARED_KEY_MODE_BASE+4*(BssIndex/2), &csr1.word);
- if ((BssIndex%2) == 0)
- {
- if (KeyIdx == 0)
- csr1.field.Bss0Key0CipherAlg = 0;
- else if (KeyIdx == 1)
- csr1.field.Bss0Key1CipherAlg = 0;
- else if (KeyIdx == 2)
- csr1.field.Bss0Key2CipherAlg = 0;
- else
- csr1.field.Bss0Key3CipherAlg = 0;
- }
- else
- {
- if (KeyIdx == 0)
- csr1.field.Bss1Key0CipherAlg = 0;
- else if (KeyIdx == 1)
- csr1.field.Bss1Key1CipherAlg = 0;
- else if (KeyIdx == 2)
- csr1.field.Bss1Key2CipherAlg = 0;
- else
- csr1.field.Bss1Key3CipherAlg = 0;
- }
- DBGPRINT(RT_DEBUG_TRACE,("Write: SHARED_KEY_MODE_BASE at this Bss[%d] = 0x%x \n", BssIndex, csr1.word));
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE+4*(BssIndex/2), csr1.word);
- ASSERT(BssIndex < 4);
- ASSERT(KeyIdx < 4);
-
-}
-
-
-VOID AsicUpdateWCIDAttribute(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN UCHAR BssIndex,
- IN UCHAR CipherAlg,
- IN BOOLEAN bUsePairewiseKeyTable)
-{
- ULONG WCIDAttri = 0, offset;
-
- //
- // Update WCID attribute.
- // Only TxKey could update WCID attribute.
- //
- offset = MAC_WCID_ATTRIBUTE_BASE + (WCID * HW_WCID_ATTRI_SIZE);
- WCIDAttri = (BssIndex << 4) | (CipherAlg << 1) | (bUsePairewiseKeyTable);
- RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
-}
-
-VOID AsicUpdateWCIDIVEIV(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN ULONG uIV,
- IN ULONG uEIV)
-{
- ULONG offset;
-
- offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE);
-
- RTMP_IO_WRITE32(pAd, offset, uIV);
- RTMP_IO_WRITE32(pAd, offset + 4, uEIV);
-}
-
-VOID AsicUpdateRxWCIDTable(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN PUCHAR pAddr)
-{
- ULONG offset;
- ULONG Addr;
-
- offset = MAC_WCID_BASE + (WCID * HW_WCID_ENTRY_SIZE);
- Addr = pAddr[0] + (pAddr[1] << 8) +(pAddr[2] << 16) +(pAddr[3] << 24);
- RTMP_IO_WRITE32(pAd, offset, Addr);
- Addr = pAddr[4] + (pAddr[5] << 8);
- RTMP_IO_WRITE32(pAd, offset + 4, Addr);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Set Cipher Key, Cipher algorithm, IV/EIV to Asic
-
- Arguments:
- pAd Pointer to our adapter
- WCID WCID Entry number.
- BssIndex BSSID index, station or none multiple BSSID support
- this value should be 0.
- KeyIdx This KeyIdx will set to IV's KeyID if bTxKey enabled
- pCipherKey Pointer to Cipher Key.
- bUsePairewiseKeyTable TRUE means saved the key in SharedKey table,
- otherwise PairewiseKey table
- bTxKey This is the transmit key if enabled.
-
- Return Value:
- None
-
- Note:
- This routine will set the relative key stuff to Asic including WCID attribute,
- Cipher Key, Cipher algorithm and IV/EIV.
-
- IV/EIV will be update if this CipherKey is the transmission key because
- ASIC will base on IV's KeyID value to select Cipher Key.
-
- If bTxKey sets to FALSE, this is not the TX key, but it could be
- RX key
-
- For AP mode bTxKey must be always set to TRUE.
- ========================================================================
-*/
-VOID AsicAddKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx,
- IN PCIPHER_KEY pCipherKey,
- IN BOOLEAN bUsePairewiseKeyTable,
- IN BOOLEAN bTxKey)
-{
- ULONG offset;
- UCHAR IV4 = 0;
- PUCHAR pKey = pCipherKey->Key;
- PUCHAR pTxMic = pCipherKey->TxMic;
- PUCHAR pRxMic = pCipherKey->RxMic;
- PUCHAR pTxtsc = pCipherKey->TxTsc;
- UCHAR CipherAlg = pCipherKey->CipherAlg;
- SHAREDKEY_MODE_STRUC csr1;
-#ifdef RT2860
- UCHAR i;
-#endif
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> AsicAddKeyEntry\n"));
- //
- // 1.) decide key table offset
- //
- if (bUsePairewiseKeyTable)
- offset = PAIRWISE_KEY_TABLE_BASE + (WCID * HW_KEY_ENTRY_SIZE);
- else
- offset = SHARED_KEY_TABLE_BASE + (4 * BssIndex + KeyIdx) * HW_KEY_ENTRY_SIZE;
-
- //
- // 2.) Set Key to Asic
- //
- //for (i = 0; i < KeyLen; i++)
-#ifdef RT2860
- for (i = 0; i < MAX_LEN_OF_PEER_KEY; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pKey[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pKey, MAX_LEN_OF_PEER_KEY);
-#endif
- offset += MAX_LEN_OF_PEER_KEY;
-
- //
- // 3.) Set MIC key if available
- //
- if (pTxMic)
- {
-#ifdef RT2860
- for (i = 0; i < 8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pTxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pTxMic, 8);
-#endif
- }
- offset += LEN_TKIP_TXMICK;
-
- if (pRxMic)
- {
-#ifdef RT2860
- for (i = 0; i < 8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pRxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, pRxMic, 8);
-#endif
- }
-
-
- //
- // 4.) Modify IV/EIV if needs
- // This will force Asic to use this key ID by setting IV.
- //
- if (bTxKey)
- {
-#ifdef RT2860
- offset = MAC_IVEIV_TABLE_BASE + (WCID * HW_IVEIV_ENTRY_SIZE);
- //
- // Write IV
- //
- RTMP_IO_WRITE8(pAd, offset, pTxtsc[1]);
- RTMP_IO_WRITE8(pAd, offset + 1, ((pTxtsc[1] | 0x20) & 0x7f));
- RTMP_IO_WRITE8(pAd, offset + 2, pTxtsc[0]);
-
- IV4 = (KeyIdx << 6);
- if ((CipherAlg == CIPHER_TKIP) || (CipherAlg == CIPHER_TKIP_NO_MIC) ||(CipherAlg == CIPHER_AES))
- IV4 |= 0x20; // turn on extension bit means EIV existence
-
- RTMP_IO_WRITE8(pAd, offset + 3, IV4);
-
- //
- // Write EIV
- //
- offset += 4;
- for (i = 0; i < 4; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pTxtsc[i + 2]);
- }
-
-#endif
-#ifdef RT2870
- UINT32 tmpVal;
-
- //
- // Write IV
- //
- IV4 = (KeyIdx << 6);
- if ((CipherAlg == CIPHER_TKIP) || (CipherAlg == CIPHER_TKIP_NO_MIC) ||(CipherAlg == CIPHER_AES))
- IV4 |= 0x20; // turn on extension bit means EIV existence
-
- tmpVal = pTxtsc[1] + (((pTxtsc[1] | 0x20) & 0x7f) << 8) + (pTxtsc[0] << 16) + (IV4 << 24);
- RTMP_IO_WRITE32(pAd, offset, tmpVal);
-
- //
- // Write EIV
- //
- offset += 4;
- RTMP_IO_WRITE32(pAd, offset, *(PUINT32)&pCipherKey->TxTsc[2]);
-#endif // RT2870 //
- AsicUpdateWCIDAttribute(pAd, WCID, BssIndex, CipherAlg, bUsePairewiseKeyTable);
- }
-
- if (!bUsePairewiseKeyTable)
- {
- //
- // Only update the shared key security mode
- //
- RTMP_IO_READ32(pAd, SHARED_KEY_MODE_BASE + 4 * (BssIndex / 2), &csr1.word);
- if ((BssIndex % 2) == 0)
- {
- if (KeyIdx == 0)
- csr1.field.Bss0Key0CipherAlg = CipherAlg;
- else if (KeyIdx == 1)
- csr1.field.Bss0Key1CipherAlg = CipherAlg;
- else if (KeyIdx == 2)
- csr1.field.Bss0Key2CipherAlg = CipherAlg;
- else
- csr1.field.Bss0Key3CipherAlg = CipherAlg;
- }
- else
- {
- if (KeyIdx == 0)
- csr1.field.Bss1Key0CipherAlg = CipherAlg;
- else if (KeyIdx == 1)
- csr1.field.Bss1Key1CipherAlg = CipherAlg;
- else if (KeyIdx == 2)
- csr1.field.Bss1Key2CipherAlg = CipherAlg;
- else
- csr1.field.Bss1Key3CipherAlg = CipherAlg;
- }
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE + 4 * (BssIndex / 2), csr1.word);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== AsicAddKeyEntry\n"));
-}
-
-
-/*
- ========================================================================
- Description:
- Add Pair-wise key material into ASIC.
- Update pairwise key, TxMic and RxMic to Asic Pair-wise key table
-
- Return:
- ========================================================================
-*/
-VOID AsicAddPairwiseKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR WCID,
- IN CIPHER_KEY *pCipherKey)
-{
- INT i;
- ULONG offset;
- PUCHAR pKey = pCipherKey->Key;
- PUCHAR pTxMic = pCipherKey->TxMic;
- PUCHAR pRxMic = pCipherKey->RxMic;
-#ifdef DBG
- UCHAR CipherAlg = pCipherKey->CipherAlg;
-#endif // DBG //
-
- // EKEY
- offset = PAIRWISE_KEY_TABLE_BASE + (WCID * HW_KEY_ENTRY_SIZE);
-#ifdef RT2860
- for (i=0; i<MAX_LEN_OF_PEER_KEY; i++)
- {
- RTMP_IO_WRITE8(pAd, offset + i, pKey[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, &pCipherKey->Key[0], MAX_LEN_OF_PEER_KEY);
-#endif // RT2870 //
- for (i=0; i<MAX_LEN_OF_PEER_KEY; i+=4)
- {
- UINT32 Value;
- RTMP_IO_READ32(pAd, offset + i, &Value);
- }
-
- offset += MAX_LEN_OF_PEER_KEY;
-
- // MIC KEY
- if (pTxMic)
- {
-#ifdef RT2860
- for (i=0; i<8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset+i, pTxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, &pCipherKey->TxMic[0], 8);
-#endif // RT2870 //
- }
- offset += 8;
- if (pRxMic)
- {
-#ifdef RT2860
- for (i=0; i<8; i++)
- {
- RTMP_IO_WRITE8(pAd, offset+i, pRxMic[i]);
- }
-#endif
-#ifdef RT2870
- RTUSBMultiWrite(pAd, offset, &pCipherKey->RxMic[0], 8);
-#endif // RT2870 //
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("AsicAddPairwiseKeyEntry: WCID #%d Alg=%s\n",WCID, CipherName[CipherAlg]));
- DBGPRINT(RT_DEBUG_TRACE,(" Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pKey[0],pKey[1],pKey[2],pKey[3],pKey[4],pKey[5],pKey[6],pKey[7],pKey[8],pKey[9],pKey[10],pKey[11],pKey[12],pKey[13],pKey[14],pKey[15]));
- if (pRxMic)
- {
- DBGPRINT(RT_DEBUG_TRACE, (" Rx MIC Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pRxMic[0],pRxMic[1],pRxMic[2],pRxMic[3],pRxMic[4],pRxMic[5],pRxMic[6],pRxMic[7]));
- }
- if (pTxMic)
- {
- DBGPRINT(RT_DEBUG_TRACE, (" Tx MIC Key = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n",
- pTxMic[0],pTxMic[1],pTxMic[2],pTxMic[3],pTxMic[4],pTxMic[5],pTxMic[6],pTxMic[7]));
- }
-}
-/*
- ========================================================================
- Description:
- Remove Pair-wise key material from ASIC.
-
- Return:
- ========================================================================
-*/
-VOID AsicRemovePairwiseKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIdx,
- IN UCHAR Wcid)
-{
- ULONG WCIDAttri;
- USHORT offset;
-
- // re-set the entry's WCID attribute as OPEN-NONE.
- offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE);
- WCIDAttri = (BssIdx<<4) | PAIRWISEKEYTABLE;
- RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
-}
-
-BOOLEAN AsicSendCommandToMcu(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Command,
- IN UCHAR Token,
- IN UCHAR Arg0,
- IN UCHAR Arg1)
-{
- HOST_CMD_CSR_STRUC H2MCmd;
- H2M_MAILBOX_STRUC H2MMailbox;
- ULONG i = 0;
-
- do
- {
- RTMP_IO_READ32(pAd, H2M_MAILBOX_CSR, &H2MMailbox.word);
- if (H2MMailbox.field.Owner == 0)
- break;
-
- RTMPusecDelay(2);
- } while(i++ < 100);
-
- if (i > 100)
- {
- {
-#ifdef RT2860
- UINT32 Data;
-
- // Reset DMA
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data |= 0x2;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-
- // After Reset DMA, DMA index will become Zero. So Driver need to reset all ring indexs too.
- // Reset DMA/CPU ring index
- RTMPRingCleanUp(pAd, QID_AC_BK);
- RTMPRingCleanUp(pAd, QID_AC_BE);
- RTMPRingCleanUp(pAd, QID_AC_VI);
- RTMPRingCleanUp(pAd, QID_AC_VO);
- RTMPRingCleanUp(pAd, QID_HCCA);
- RTMPRingCleanUp(pAd, QID_MGMT);
- RTMPRingCleanUp(pAd, QID_RX);
-
- // Clear Reset
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data &= 0xfffffffd;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-#endif /* RT2860 */
- DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
- }
- //return FALSE;
-#ifdef RT2870
- return FALSE;
-#endif
- }
-
- H2MMailbox.field.Owner = 1; // pass ownership to MCU
- H2MMailbox.field.CmdToken = Token;
- H2MMailbox.field.HighByte = Arg1;
- H2MMailbox.field.LowByte = Arg0;
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, H2MMailbox.word);
-
- H2MCmd.word = 0;
- H2MCmd.field.HostCommand = Command;
- RTMP_IO_WRITE32(pAd, HOST_CMD_CSR, H2MCmd.word);
-
- if (Command != 0x80)
- {
- }
-
- return TRUE;
-}
-
-#ifdef RT2860
-BOOLEAN AsicCheckCommanOk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Command)
-{
- UINT32 CmdStatus = 0, CID = 0, i;
- UINT32 ThisCIDMask = 0;
-
- i = 0;
- do
- {
- RTMP_IO_READ32(pAd, H2M_MAILBOX_CID, &CID);
- // Find where the command is. Because this is randomly specified by firmware.
- if ((CID & CID0MASK) == Command)
- {
- ThisCIDMask = CID0MASK;
- break;
- }
- else if ((((CID & CID1MASK)>>8) & 0xff) == Command)
- {
- ThisCIDMask = CID1MASK;
- break;
- }
- else if ((((CID & CID2MASK)>>16) & 0xff) == Command)
- {
- ThisCIDMask = CID2MASK;
- break;
- }
- else if ((((CID & CID3MASK)>>24) & 0xff) == Command)
- {
- ThisCIDMask = CID3MASK;
- break;
- }
-
- RTMPusecDelay(100);
- i++;
- }while (i < 200);
-
- // Get CommandStatus Value
- RTMP_IO_READ32(pAd, H2M_MAILBOX_STATUS, &CmdStatus);
-
- // This command's status is at the same position as command. So AND command position's bitmask to read status.
- if (i < 200)
- {
- // If Status is 1, the comamnd is success.
- if (((CmdStatus & ThisCIDMask) == 0x1) || ((CmdStatus & ThisCIDMask) == 0x100)
- || ((CmdStatus & ThisCIDMask) == 0x10000) || ((CmdStatus & ThisCIDMask) == 0x1000000))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> AsicCheckCommanOk CID = 0x%x, CmdStatus= 0x%x \n", CID, CmdStatus));
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_STATUS, 0xffffffff);
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CID, 0xffffffff);
- return TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("--> AsicCheckCommanFail1 CID = 0x%x, CmdStatus= 0x%x \n", CID, CmdStatus));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> AsicCheckCommanFail2 Timeout Command = %d, CmdStatus= 0x%x \n", Command, CmdStatus));
- }
- // Clear Command and Status.
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_STATUS, 0xffffffff);
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CID, 0xffffffff);
-
- return FALSE;
-}
-#endif /* RT8260 */
/*
========================================================================
@@ -7993,55 +5519,6 @@ CHAR RTMPMaxRssi(
return larger;
}
-#ifdef RT2870
-// Antenna divesity use GPIO3 and EESK pin for control
-// Antenna and EEPROM access are both using EESK pin,
-// Therefor we should avoid accessing EESK at the same time
-// Then restore antenna after EEPROM access
-VOID AsicSetRxAnt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ant)
-{
- UINT32 Value;
- UINT32 x;
-
- if ((pAd->EepromAccess) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
- {
- return;
- }
-
- // the antenna selection is through firmware and MAC register(GPIO3)
- if (Ant == 0)
- {
- // Main antenna
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x |= (EESK);
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &Value);
- Value &= ~(0x0808);
- RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to main antenna\n"));
- }
- else
- {
- // Aux antenna
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EESK);
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &Value);
- Value &= ~(0x0808);
- Value |= 0x08;
- RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to aux antenna\n"));
- }
-}
-#endif
/*
========================================================================
@@ -8065,39 +5542,24 @@ VOID AsicEvaluateRxAnt(
fRTMP_ADAPTER_HALT_IN_PROGRESS |
fRTMP_ADAPTER_RADIO_OFF |
fRTMP_ADAPTER_NIC_NOT_EXIST |
- fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)
- || OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT2870
+ fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) ||
+ OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
+#ifdef RT30xx
|| (pAd->EepromAccess)
-#endif
+#endif // RT30xx //
+#ifdef RT3090
+ || (pAd->bPCIclkOff == TRUE)
+#endif // RT3090 //
)
return;
-#ifdef RT30xx
- // two antenna selection mechanism- one is antenna diversity, the other is failed antenna remove
- // one is antenna diversity:there is only one antenna can rx and tx
- // the other is failed antenna remove:two physical antenna can rx and tx
- if (pAd->NicConfig2.field.AntDiversity)
- {
- DBGPRINT(RT_DEBUG_TRACE,("AntDiv - before evaluate Pair1-Ant (%d,%d)\n",
- pAd->RxAnt.Pair1PrimaryRxAnt, pAd->RxAnt.Pair1SecondaryRxAnt));
-
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1SecondaryRxAnt);
- pAd->RxAnt.EvaluatePeriod = 1; // 1:Means switch to SecondaryRxAnt, 0:Means switch to Pair1PrimaryRxAnt
- pAd->RxAnt.FirstPktArrivedWhenEvaluate = FALSE;
- pAd->RxAnt.RcvPktNumWhenEvaluate = 0;
+ {
+ //if (pAd->StaCfg.Psm == PWR_SAVE)
+ // return;
- // a one-shot timer to end the evalution
- // dynamic adjust antenna evaluation period according to the traffic
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 100);
- else
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 300);
- }
- else
-#endif
{
+
if (pAd->StaCfg.Psm == PWR_SAVE)
return;
@@ -8116,12 +5578,9 @@ VOID AsicEvaluateRxAnt(
BBPR3 |= (0x0);
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
pAd->StaCfg.BBPR3 = BBPR3;
-#endif
- }
-
+#endif // RTMP_MAC_PCI //
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
)
{
@@ -8141,6 +5600,11 @@ VOID AsicEvaluateRxAnt(
pAd->Mlme.bLowThroughput = TRUE;
}
}
+ }
+
+ }
+
+
}
/*
@@ -8169,48 +5633,20 @@ VOID AsicRxAntEvalTimeout(
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS |
fRTMP_ADAPTER_HALT_IN_PROGRESS |
fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_NIC_NOT_EXIST)
- || OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT2870
+ fRTMP_ADAPTER_NIC_NOT_EXIST) ||
+ OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
+#ifdef RT30xx
|| (pAd->EepromAccess)
-#endif
+#endif // RT30xx //
+#ifdef RT3090
+ || (pAd->bPCIclkOff == TRUE)
+#endif // RT3090 //
)
return;
{
-#ifdef RT30xx
- if (pAd->NicConfig2.field.AntDiversity)
- {
- if ((pAd->RxAnt.RcvPktNumWhenEvaluate != 0) && (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1SecondaryRxAnt] >= pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1PrimaryRxAnt]))
- {
- UCHAR temp;
-
- //
- // select PrimaryRxAntPair
- // Role change, Used Pair1SecondaryRxAnt as PrimaryRxAntPair.
- // Since Pair1SecondaryRxAnt Quality good than Pair1PrimaryRxAnt
- //
- temp = pAd->RxAnt.Pair1PrimaryRxAnt;
- pAd->RxAnt.Pair1PrimaryRxAnt = pAd->RxAnt.Pair1SecondaryRxAnt;
- pAd->RxAnt.Pair1SecondaryRxAnt = temp;
-
- pAd->RxAnt.Pair1LastAvgRssi = (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1SecondaryRxAnt] >> 3);
- pAd->RxAnt.EvaluateStableCnt = 0;
- }
- else
- {
- // if the evaluated antenna is not better than original, switch back to original antenna
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- pAd->RxAnt.EvaluateStableCnt ++;
- }
-
- pAd->RxAnt.EvaluatePeriod = 0; // 1:Means switch to SecondaryRxAnt, 0:Means switch to Pair1PrimaryRxAnt
-
- DBGPRINT(RT_DEBUG_TRACE,("AsicRxAntEvalAction::After Eval(fix in #%d), <%d, %d>, RcvPktNumWhenEvaluate=%ld\n",
- pAd->RxAnt.Pair1PrimaryRxAnt, (pAd->RxAnt.Pair1AvgRssi[0] >> 3), (pAd->RxAnt.Pair1AvgRssi[1] >> 3), pAd->RxAnt.RcvPktNumWhenEvaluate));
- }
- else
-#endif
+ //if (pAd->StaCfg.Psm == PWR_SAVE)
+ // return;
{
if (pAd->StaCfg.Psm == PWR_SAVE)
return;
@@ -8261,13 +5697,16 @@ VOID AsicRxAntEvalTimeout(
BBPR3 |= (0x0);
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
pAd->StaCfg.BBPR3 = BBPR3;
-#endif
+#endif // RTMP_MAC_PCI //
}
}
+
+
}
+
VOID APSDPeriodicExec(
IN PVOID SystemSpecific1,
IN PVOID FunctionContext,
@@ -8281,6 +5720,18 @@ VOID APSDPeriodicExec(
pAd->CommonCfg.TriggerTimerCount++;
+// Driver should not send trigger frame, it should be send by application layer
+/*
+ if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable
+ && (pAd->CommonCfg.bNeedSendTriggerFrame ||
+ (((pAd->CommonCfg.TriggerTimerCount%20) == 19) && (!pAd->CommonCfg.bAPSDAC_BE || !pAd->CommonCfg.bAPSDAC_BK || !pAd->CommonCfg.bAPSDAC_VI || !pAd->CommonCfg.bAPSDAC_VO))))
+ {
+ DBGPRINT(RT_DEBUG_TRACE,("Sending trigger frame and enter service period when support APSD\n"));
+ RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
+ pAd->CommonCfg.bNeedSendTriggerFrame = FALSE;
+ pAd->CommonCfg.TriggerTimerCount = 0;
+ pAd->CommonCfg.bInServicePeriod = TRUE;
+ }*/
}
/*
@@ -8347,9 +5798,10 @@ BOOLEAN RTMPCheckEntryEnableAutoRateSwitch(
BOOLEAN RTMPAutoRateSwitchCheck(
IN PRTMP_ADAPTER pAd)
{
+ {
if (pAd->StaCfg.bAutoTxRateSwitch)
return TRUE;
-
+ }
return FALSE;
}
@@ -8375,7 +5827,9 @@ UCHAR RTMPStaFixedTxMode(
{
UCHAR tx_mode = FIXED_TXMODE_HT;
+ {
tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode;
+ }
return tx_mode;
}
@@ -8462,12 +5916,10 @@ VOID AsicStaBbpTuning(
&& (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
)
&& !(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
-#ifdef RT2860
- && (pAd->bPCIclkOff == FALSE))
-#endif
-#ifdef RT2870
+#ifdef RTMP_MAC_PCI
+ && (pAd->bPCIclkOff == FALSE)
+#endif // RTMP_MAC_PCI //
)
-#endif
{
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &OrigR66Value);
R66 = OrigR66Value;
@@ -8479,26 +5931,31 @@ VOID AsicStaBbpTuning(
if (pAd->LatchRfRegs.Channel <= 14)
{ //BG band
-#ifdef RT2870
+#ifdef RT30xx
// RT3070 is a no LNA solution, it should have different control regarding to AGC gain control
// Otherwise, it will have some throughput side effect when low RSSI
- if (IS_RT30xx(pAd))
+
+ if (IS_RT3070(pAd)||IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
{
if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
{
R66 = 0x1C + 2*GET_LNA_GAIN(pAd) + 0x20;
if (OrigR66Value != R66)
+ {
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
}
+ }
else
{
R66 = 0x1C + 2*GET_LNA_GAIN(pAd);
if (OrigR66Value != R66)
+ {
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
}
}
+ }
else
-#endif // RT2870 //
+#endif // RT30xx //
{
if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
{
@@ -8564,108 +6021,6 @@ VOID AsicStaBbpTuning(
}
}
-#ifdef RT2860
-VOID AsicResetFromDMABusy(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 Data;
- BOOLEAN bCtrl = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("---> AsicResetFromDMABusy !!!!!!!!!!!!!!!!!!!!!!! \n"));
-
- // Be sure restore link control value so we can write register.
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
- {
- DBGPRINT(RT_DEBUG_TRACE,("AsicResetFromDMABusy==>\n"));
- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT);
- RTMPusecDelay(6000);
- pAd->bPCIclkOff = FALSE;
- bCtrl = TRUE;
- }
- // Reset DMA
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data |= 0x2;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-
- // After Reset DMA, DMA index will become Zero. So Driver need to reset all ring indexs too.
- // Reset DMA/CPU ring index
- RTMPRingCleanUp(pAd, QID_AC_BK);
- RTMPRingCleanUp(pAd, QID_AC_BE);
- RTMPRingCleanUp(pAd, QID_AC_VI);
- RTMPRingCleanUp(pAd, QID_AC_VO);
- RTMPRingCleanUp(pAd, QID_HCCA);
- RTMPRingCleanUp(pAd, QID_MGMT);
- RTMPRingCleanUp(pAd, QID_RX);
-
- // Clear Reset
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data &= 0xfffffffd;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-
- // If in Radio off, should call RTMPPCIePowerLinkCtrl again.
- if ((bCtrl == TRUE) && (pAd->StaCfg.bRadio == FALSE))
- RTMPPCIeLinkCtrlSetting(pAd, 3);
-
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS);
- DBGPRINT(RT_DEBUG_TRACE, ("<--- AsicResetFromDMABusy !!!!!!!!!!!!!!!!!!!!!!! \n"));
-}
-
-VOID AsicResetBBP(
- IN PRTMP_ADAPTER pAd)
-{
- DBGPRINT(RT_DEBUG_TRACE, ("---> Asic HardReset BBP !!!!!!!!!!!!!!!!!!!!!!! \n"));
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0xc);
-
- // After hard-reset BBP, initialize all BBP values.
- NICRestoreBBPValue(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("<--- Asic HardReset BBP !!!!!!!!!!!!!!!!!!!!!!! \n"));
-}
-
-VOID AsicResetMAC(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG Data;
-
- DBGPRINT(RT_DEBUG_TRACE, ("---> AsicResetMAC !!!! \n"));
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data |= 0x4;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
- Data &= 0xfffffffb;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<--- AsicResetMAC !!!! \n"));
-}
-
-VOID AsicResetPBF(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG Value1, Value2;
- ULONG Data;
-
- RTMP_IO_READ32(pAd, TXRXQ_PCNT, &Value1);
- RTMP_IO_READ32(pAd, PBF_DBG, &Value2);
-
- Value2 &= 0xff;
- // sum should be equals to 0xff, which is the total buffer size.
- if ((Value1 + Value2) < 0xff)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("---> Asic HardReset PBF !!!! \n"));
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &Data);
- Data |= 0x8;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
- Data &= 0xfffffff7;
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, Data);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<--- Asic HardReset PBF !!!! \n"));
- }
-}
-#endif /* RT2860 */
-
VOID RTMPSetAGCInitValue(
IN PRTMP_ADAPTER pAd,
IN UCHAR BandWidth)
@@ -8674,11 +6029,24 @@ VOID RTMPSetAGCInitValue(
if (pAd->LatchRfRegs.Channel <= 14)
{ // BG band
+#ifdef RT30xx
+ /* Gary was verified Amazon AP and find that RT307x has BBP_R66 invalid default value */
+
+ if (IS_RT3070(pAd)||IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
+ {
+ R66 = 0x1C + 2*GET_LNA_GAIN(pAd);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
+ }
+ else
+#endif // RT30xx //
+ {
R66 = 0x2E + GET_LNA_GAIN(pAd);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
}
+ }
else
{ //A band
+ {
if (BandWidth == BW_20)
{
R66 = (UCHAR)(0x32 + (GET_LNA_GAIN(pAd)*5)/3);
@@ -8690,133 +6058,7 @@ VOID RTMPSetAGCInitValue(
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
}
}
-
-}
-
-VOID AsicTurnOffRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel)
-{
-
- // RF R2 bit 18 = 0
- UINT32 R1 = 0, R2 = 0, R3 = 0;
- UCHAR index;
- RTMP_RF_REGS *RFRegTable;
-
- // The RF programming sequence is difference between 3xxx and 2xxx
- if (IS_RT3090(pAd))
- {
- RT30xxLoadRFSleepModeSetup(pAd); // add by johnli, RF power sequence setup, load RF sleep-mode setup
- return;
- }
-
- RFRegTable = RF2850RegTable;
-
- switch (pAd->RfIcType)
- {
- case RFIC_2820:
- case RFIC_2850:
- case RFIC_2720:
- case RFIC_2750:
-
- for (index = 0; index < NUM_OF_2850_CHNL; index++)
- {
- if (Channel == RFRegTable[index].Channel)
- {
- R1 = RFRegTable[index].R1 & 0xffffdfff;
- R2 = RFRegTable[index].R2 & 0xfffbffff;
- R3 = RFRegTable[index].R3 & 0xfff3ffff;
-
- RTMP_RF_IO_WRITE32(pAd, R1);
- RTMP_RF_IO_WRITE32(pAd, R2);
-
- // Program R1b13 to 1, R3/b18,19 to 0, R2b18 to 0.
- // Set RF R2 bit18=0, R3 bit[18:19]=0
- //if (pAd->StaCfg.bRadio == FALSE)
- if (1)
- {
- RTMP_RF_IO_WRITE32(pAd, R3);
-
- DBGPRINT(RT_DEBUG_TRACE, ("AsicTurnOffRFClk#%d(RF=%d, ) , R2=0x%08x, R3 = 0x%08x \n",
- Channel, pAd->RfIcType, R2, R3));
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("AsicTurnOffRFClk#%d(RF=%d, ) , R2=0x%08x \n",
- Channel, pAd->RfIcType, R2));
- break;
- }
- }
- break;
-
- default:
- break;
- }
-}
-
-
-VOID AsicTurnOnRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel)
-{
-
- // RF R2 bit 18 = 0
- UINT32 R1 = 0, R2 = 0, R3 = 0;
- UCHAR index;
- RTMP_RF_REGS *RFRegTable;
-
- // The RF programming sequence is difference between 3xxx and 2xxx
- if (IS_RT3090(pAd))
- return;
-
- RFRegTable = RF2850RegTable;
-
- switch (pAd->RfIcType)
- {
- case RFIC_2820:
- case RFIC_2850:
- case RFIC_2720:
- case RFIC_2750:
-
- for (index = 0; index < NUM_OF_2850_CHNL; index++)
- {
- if (Channel == RFRegTable[index].Channel)
- {
- R3 = pAd->LatchRfRegs.R3;
- R3 &= 0xfff3ffff;
- R3 |= 0x00080000;
- RTMP_RF_IO_WRITE32(pAd, R3);
-
- R1 = RFRegTable[index].R1;
- RTMP_RF_IO_WRITE32(pAd, R1);
-
- R2 = RFRegTable[index].R2;
- if (pAd->Antenna.field.TxPath == 1)
- {
- R2 |= 0x4000; // If TXpath is 1, bit 14 = 1;
- }
-
- if (pAd->Antenna.field.RxPath == 2)
- {
- R2 |= 0x40; // write 1 to off Rxpath.
- }
- else if (pAd->Antenna.field.RxPath == 1)
- {
- R2 |= 0x20040; // write 1 to off RxPath
- }
- RTMP_RF_IO_WRITE32(pAd, R2);
-
- break;
- }
- }
- break;
-
- default:
- break;
}
- DBGPRINT(RT_DEBUG_TRACE, ("AsicTurnOnRFClk#%d(RF=%d, ) , R2=0x%08x\n",
- Channel,
- pAd->RfIcType,
- R2));
}
diff --git a/drivers/staging/rt3090/common/rt_channel.c b/drivers/staging/rt2860/common/rt_channel.c
index da2391e8b74b..06b51a01289d 100644
--- a/drivers/staging/rt3090/common/rt_channel.c
+++ b/drivers/staging/rt2860/common/rt_channel.c
@@ -24,7 +24,6 @@
* *
*************************************************************************
*/
-
#include "../rt_config.h"
@@ -990,16 +989,12 @@ static VOID ChBandCheck(
switch(PhyMode)
{
case PHY_11A:
-#ifdef DOT11_N_SUPPORT
case PHY_11AN_MIXED:
-#endif // DOT11_N_SUPPORT //
*pChType = BAND_5G;
break;
case PHY_11ABG_MIXED:
-#ifdef DOT11_N_SUPPORT
case PHY_11AGN_MIXED:
case PHY_11ABGN_MIXED:
-#endif // DOT11_N_SUPPORT //
*pChType = BAND_BOTH;
break;
@@ -1151,7 +1146,6 @@ VOID BuildBeaconChList(
}
-#ifdef DOT11_N_SUPPORT
static BOOLEAN IsValidChannel(
IN PRTMP_ADAPTER pAd,
IN UCHAR channel)
@@ -1266,7 +1260,6 @@ VOID N_SetCenCh(
pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
}
}
-#endif // DOT11_N_SUPPORT //
UINT8 GetCuntryMaxTxPwr(
diff --git a/drivers/staging/rt3090/common/rt_rf.c b/drivers/staging/rt2860/common/rt_rf.c
index 9d638f71dbe5..e9f9384b024a 100644
--- a/drivers/staging/rt3090/common/rt_rf.c
+++ b/drivers/staging/rt2860/common/rt_rf.c
@@ -35,6 +35,7 @@
-------- ---------- ----------------------------------------------
*/
+
#include "../rt_config.h"
@@ -168,16 +169,6 @@ VOID RtmpChipOpsRFHook(
pChipOps->AsicRfTurnOff = NULL;
pChipOps->AsicReverseRfFromSleepMode = NULL;
pChipOps->AsicHaltAction = NULL;
-#ifdef RT33xx
-if (IS_RT3390(pAd) && (pAd->infType == RTMP_DEV_INF_PCI))
- {
- pChipOps->pRFRegTable = RFRegTableOverRT3390;
- pChipOps->AsicHaltAction = RT33xxHaltAction;
- pChipOps->AsicRfTurnOff = RT33xxLoadRFSleepModeSetup;
- pChipOps->AsicRfInit = NICInitRT3390RFRegisters;
- pChipOps->AsicReverseRfFromSleepMode = RT33xxReverseRFSleepModeSetup;
- }
-#else // RT33xx //
/* We depends on RfICType and MACVersion to assign the corresponding operation callbacks. */
#ifdef RT30xx
@@ -185,6 +176,17 @@ if (IS_RT3390(pAd) && (pAd->infType == RTMP_DEV_INF_PCI))
{
pChipOps->pRFRegTable = RT30xx_RFRegTable;
pChipOps->AsicHaltAction = RT30xxHaltAction;
+#ifdef RT3070
+ if((IS_RT3070(pAd) || IS_RT3071(pAd)) && (pAd->infType == RTMP_DEV_INF_USB))
+ {
+ pChipOps->AsicRfInit = NICInitRT3070RFRegisters;
+ if (IS_RT3071(pAd))
+ {
+ pChipOps->AsicRfTurnOff = RT30xxLoadRFSleepModeSetup;
+ pChipOps->AsicReverseRfFromSleepMode = RT30xxReverseRFSleepModeSetup;
+ }
+ }
+#endif // RT3070 //
#ifdef RT3090
if (IS_RT3090(pAd) && (pAd->infType == RTMP_DEV_INF_PCI))
{
@@ -195,7 +197,6 @@ if (IS_RT3390(pAd) && (pAd->infType == RTMP_DEV_INF_PCI))
#endif // RT3090 //
}
#endif // RT30xx //
-#endif // RT33xx //
}
#endif // RTMP_RF_RW_SUPPORT //
diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c
index 20c2ce26bc9d..3b43101102f3 100644
--- a/drivers/staging/rt2860/common/rtmp_init.c
+++ b/drivers/staging/rt2860/common/rtmp_init.c
@@ -33,30 +33,10 @@
Revision History:
Who When What
-------- ---------- ----------------------------------------------
- Paul Lin 2002-08-01 created
- John Chang 2004-08-20 RT2561/2661 use scatter-gather scheme
- Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT.
*/
#include "../rt_config.h"
-#ifdef RT2860
-#include "firmware.h"
-#include <linux/bitrev.h>
-#endif
-#ifdef RT2870
-/* New firmware handles both RT2870 and RT3070. */
-#include "../../rt3070/firmware.h"
-#endif
UCHAR BIT8[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
-ULONG BIT32[] = {0x00000001, 0x00000002, 0x00000004, 0x00000008,
- 0x00000010, 0x00000020, 0x00000040, 0x00000080,
- 0x00000100, 0x00000200, 0x00000400, 0x00000800,
- 0x00001000, 0x00002000, 0x00004000, 0x00008000,
- 0x00010000, 0x00020000, 0x00040000, 0x00080000,
- 0x00100000, 0x00200000, 0x00400000, 0x00800000,
- 0x01000000, 0x02000000, 0x04000000, 0x08000000,
- 0x10000000, 0x20000000, 0x40000000, 0x80000000};
-
char* CipherName[] = {"none","wep64","wep128","TKIP","AES","CKIP64","CKIP128"};
//
@@ -77,36 +57,10 @@ REG_PAIR BBPRegTable[] = {
{BBP_R92, 0x00}, // middle range issue, Rory @2008-01-28
{BBP_R103, 0x00}, // near range high-power issue, requested from Gary @2008-0528
{BBP_R105, 0x05}, // 0x05 is for rt2860E to turn on FEQ control. It is safe for rt2860D and before, because Bit 7:2 are reserved in rt2860D and before.
+ {BBP_R106, 0x35}, // for ShortGI throughput
};
#define NUM_BBP_REG_PARMS (sizeof(BBPRegTable) / sizeof(REG_PAIR))
-//
-// RF register initialization set
-//
-#ifdef RT2870
-REG_PAIR RT30xx_RFRegTable[] = {
- {RF_R04, 0x40},
- {RF_R05, 0x03},
- {RF_R06, 0x02},
- {RF_R07, 0x70},
- {RF_R09, 0x0F},
- {RF_R10, 0x41},
- {RF_R11, 0x21},
- {RF_R12, 0x7B},
- {RF_R14, 0x90},
- {RF_R15, 0x58},
- {RF_R16, 0xB3},
- {RF_R17, 0x92},
- {RF_R18, 0x2C},
- {RF_R19, 0x02},
- {RF_R20, 0xBA},
- {RF_R21, 0xDB},
- {RF_R24, 0x16},
- {RF_R25, 0x01},
- {RF_R29, 0x1F},
-};
-#define NUM_RF_REG_PARMS (sizeof(RT30xx_RFRegTable) / sizeof(REG_PAIR))
-#endif // RT2870 //
//
// ASIC register initialization sets
@@ -128,32 +82,37 @@ RTMP_REG_PAIR MACRegTable[] = {
{MAC_SYS_CTRL, 0x00}, // 0x1004, , default Disable RX
{RX_FILTR_CFG, 0x17f97}, //0x1400 , RX filter control,
{BKOFF_SLOT_CFG, 0x209}, // default set short slot time, CC_DELAY_TIME should be 2
+ //{TX_SW_CFG0, 0x40a06}, // Gary,2006-08-23
{TX_SW_CFG0, 0x0}, // Gary,2008-05-21 for CWC test
{TX_SW_CFG1, 0x80606}, // Gary,2006-08-23
{TX_LINK_CFG, 0x1020}, // Gary,2006-08-23
+ //{TX_TIMEOUT_CFG, 0x00182090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT
{TX_TIMEOUT_CFG, 0x000a2090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT , Modify for 2860E ,2007-08-01
{MAX_LEN_CFG, MAX_AGGREGATION_SIZE | 0x00001000}, // 0x3018, MAX frame length. Max PSDU = 16kbytes.
{LED_CFG, 0x7f031e46}, // Gary, 2006-08-23
+
{PBF_MAX_PCNT, 0x1F3FBF9F}, //0x1F3f7f9f}, //Jan, 2006/04/20
+
{TX_RTY_CFG, 0x47d01f0f}, // Jan, 2006/11/16, Set TxWI->ACK =0 in Probe Rsp Modify for 2860E ,2007-08-03
+
{AUTO_RSP_CFG, 0x00000013}, // Initial Auto_Responder, because QA will turn off Auto-Responder
{CCK_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled.
{OFDM_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled.
-//PS packets use Tx1Q (for HCCA) when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
{PBF_CFG, 0xf40006}, // Only enable Queue 2
{MM40_PROT_CFG, 0x3F44084}, // Initial Auto_Responder, because QA will turn off Auto-Responder
{WPDMA_GLO_CFG, 0x00000030},
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
{GF20_PROT_CFG, 0x01744004}, // set 19:18 --> Short NAV for MIMO PS
{GF40_PROT_CFG, 0x03F44084},
{MM20_PROT_CFG, 0x01744004},
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
{MM40_PROT_CFG, 0x03F54084},
-#endif
+#endif // RTMP_MAC_PCI //
{TXOP_CTRL_CFG, 0x0000583f, /*0x0000243f*/ /*0x000024bf*/}, //Extension channel backoff.
{TX_RTS_CFG, 0x00092b20},
{EXP_ACK_TIME, 0x002400ca}, // default value
+
{TXOP_HLDR_ET, 0x00000002},
/* Jerry comments 2008/01/16: we use SIFS = 10us in CCK defaultly, but it seems that 10us
@@ -173,26 +132,6 @@ RTMP_REG_PAIR STAMACRegTable[] = {
#define NUM_MAC_REG_PARMS (sizeof(MACRegTable) / sizeof(RTMP_REG_PAIR))
#define NUM_STA_MAC_REG_PARMS (sizeof(STAMACRegTable) / sizeof(RTMP_REG_PAIR))
-#ifdef RT2870
-//
-// RT2870 Firmware Spec only used 1 oct for version expression
-//
-#define FIRMWARE_MINOR_VERSION 7
-
-#endif // RT2870 //
-
-// New 8k byte firmware size for RT3071/RT3072
-#define FIRMWAREIMAGE_MAX_LENGTH 0x2000
-#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(UCHAR))
-#define FIRMWARE_MAJOR_VERSION 0
-
-#define FIRMWAREIMAGEV1_LENGTH 0x1000
-#define FIRMWAREIMAGEV2_LENGTH 0x1000
-
-#ifdef RT2860
-#define FIRMWARE_MINOR_VERSION 2
-#endif
-
/*
========================================================================
@@ -236,6 +175,7 @@ NDIS_STATUS RTMPAllocAdapterBlock(
DBGPRINT_ERR(("Failed to allocate memory - BeaconBuf!\n"));
break;
}
+ NdisZeroMemory(pBeaconBuf, MAX_BEACON_SIZE);
Status = AdapterBlockAllocateMemory(handle, (PVOID *)&pAd);
if (Status != NDIS_STATUS_SUCCESS)
@@ -244,14 +184,17 @@ NDIS_STATUS RTMPAllocAdapterBlock(
break;
}
pAd->BeaconBuf = pBeaconBuf;
- printk("\n\n=== pAd = %p, size = %d ===\n\n", pAd, (UINT32)sizeof(RTMP_ADAPTER));
+ DBGPRINT(RT_DEBUG_OFF, ("\n\n=== pAd = %p, size = %d ===\n\n", pAd, (UINT32)sizeof(RTMP_ADAPTER)));
// Init spin locks
NdisAllocateSpinLock(&pAd->MgmtRingLock);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
NdisAllocateSpinLock(&pAd->RxRingLock);
-#endif
+#ifdef RT3090
+ NdisAllocateSpinLock(&pAd->McuCmdLock);
+#endif // RT3090 //
+#endif // RTMP_MAC_PCI //
for (index =0 ; index < NUM_OF_TX_RING; index++)
{
@@ -298,7 +241,7 @@ VOID RTMPReadTxPwrPerRate(
USHORT i, value, value2;
INT Apwrdelta, Gpwrdelta;
UCHAR t1,t2,t3,t4;
- BOOLEAN bValid, bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE;
+ BOOLEAN bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE;
//
// Get power delta for 20MHz and 40MHz.
@@ -481,325 +424,16 @@ VOID RTMPReadTxPwrPerRate(
Gdata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
data |= (value<<16);
- pAd->Tx20MPwrCfgABand[i] = pAd->Tx40MPwrCfgABand[i] = Adata;
- pAd->Tx20MPwrCfgGBand[i] = pAd->Tx40MPwrCfgGBand[i] = Gdata;
+ /* For 20M/40M Power Delta issue */
+ pAd->Tx20MPwrCfgABand[i] = data;
+ pAd->Tx20MPwrCfgGBand[i] = data;
+ pAd->Tx40MPwrCfgABand[i] = Adata;
+ pAd->Tx40MPwrCfgGBand[i] = Gdata;
if (data != 0xffffffff)
RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, data);
DBGPRINT_RAW(RT_DEBUG_TRACE, ("20MHz BW, 2.4G band-%lx, Adata = %lx, Gdata = %lx \n", data, Adata, Gdata));
}
-
- //
- // Check this block is valid for 40MHz in 2.4G. If invalid, use parameter for 20MHz in 2.4G
- //
- bValid = TRUE;
- for (i=0; i<6; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_2_4G + 2 + i*2, value);
- if (((value & 0x00FF) == 0x00FF) || ((value & 0xFF00) == 0xFF00))
- {
- bValid = FALSE;
- break;
- }
- }
-
- //
- // Get Txpower per MCS for 40MHz in 2.4G.
- //
- if (bValid)
- {
- for (i=0; i<4; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_2_4G + i*4, value);
- if (bGpwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Gpwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Gpwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Gpwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Gpwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Gpwrdelta)
- t1 = (value&0xf)-(Gpwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Gpwrdelta)
- t2 = ((value&0xf0)>>4)-(Gpwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Gpwrdelta)
- t3 = ((value&0xf00)>>8)-(Gpwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Gpwrdelta)
- t4 = ((value&0xf000)>>12)-(Gpwrdelta);
- else
- t4 = 0;
- }
- Gdata = t1 + (t2<<4) + (t3<<8) + (t4<<12);
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_2_4G + i*4 + 2, value);
- if (bGpwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Gpwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Gpwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Gpwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Gpwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Gpwrdelta)
- t1 = (value&0xf)-(Gpwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Gpwrdelta)
- t2 = ((value&0xf0)>>4)-(Gpwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Gpwrdelta)
- t3 = ((value&0xf00)>>8)-(Gpwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Gpwrdelta)
- t4 = ((value&0xf000)>>12)-(Gpwrdelta);
- else
- t4 = 0;
- }
- Gdata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
-
- if (i == 0)
- pAd->Tx40MPwrCfgGBand[i+1] = (pAd->Tx40MPwrCfgGBand[i+1] & 0x0000FFFF) | (Gdata & 0xFFFF0000);
- else
- pAd->Tx40MPwrCfgGBand[i+1] = Gdata;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("40MHz BW, 2.4G band, Gdata = %lx \n", Gdata));
- }
- }
-
- //
- // Check this block is valid for 20MHz in 5G. If invalid, use parameter for 20MHz in 2.4G
- //
- bValid = TRUE;
- for (i=0; i<8; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_20MHZ_5G + 2 + i*2, value);
- if (((value & 0x00FF) == 0x00FF) || ((value & 0xFF00) == 0xFF00))
- {
- bValid = FALSE;
- break;
- }
- }
-
- //
- // Get Txpower per MCS for 20MHz in 5G.
- //
- if (bValid)
- {
- for (i=0; i<5; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_20MHZ_5G + i*4, value);
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata = t1 + (t2<<4) + (t3<<8) + (t4<<12);
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_20MHZ_5G + i*4 + 2, value);
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
-
- if (i == 0)
- pAd->Tx20MPwrCfgABand[i] = (pAd->Tx20MPwrCfgABand[i] & 0x0000FFFF) | (Adata & 0xFFFF0000);
- else
- pAd->Tx20MPwrCfgABand[i] = Adata;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("20MHz BW, 5GHz band, Adata = %lx \n", Adata));
- }
- }
-
- //
- // Check this block is valid for 40MHz in 5G. If invalid, use parameter for 20MHz in 2.4G
- //
- bValid = TRUE;
- for (i=0; i<6; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_5G + 2 + i*2, value);
- if (((value & 0x00FF) == 0x00FF) || ((value & 0xFF00) == 0xFF00))
- {
- bValid = FALSE;
- break;
- }
- }
-
- //
- // Get Txpower per MCS for 40MHz in 5G.
- //
- if (bValid)
- {
- for (i=0; i<4; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_5G + i*4, value);
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata = t1 + (t2<<4) + (t3<<8) + (t4<<12);
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_40MHZ_5G + i*4 + 2, value);
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
-
- if (i == 0)
- pAd->Tx40MPwrCfgABand[i+1] = (pAd->Tx40MPwrCfgABand[i+1] & 0x0000FFFF) | (Adata & 0xFFFF0000);
- else
- pAd->Tx40MPwrCfgABand[i+1] = Adata;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("40MHz BW, 5GHz band, Adata = %lx \n", Adata));
- }
- }
}
@@ -939,10 +573,11 @@ VOID RTMPReadChannelPwr(
pAd->TxPower[i * 2 + choffset + 1].Power2 = Power2.field.Byte1;
}
- // 3. U-NII upper band: 149, 151, 153; 157, 159, 161; 165 (including central frequency in BW 40MHz)
+ // 3. U-NII upper band: 149, 151, 153; 157, 159, 161; 165, 167, 169; 171, 173 (including central frequency in BW 40MHz)
// 3.1 Fill up channel
choffset = 14 + 12 + 16;
- for (i = 0; i < 2; i++)
+ /*for (i = 0; i < 2; i++)*/
+ for (i = 0; i < 3; i++)
{
pAd->TxPower[3 * i + choffset + 0].Channel = 149 + i * 8 + 0;
pAd->TxPower[3 * i + choffset + 0].Power = DEFAULT_RF_TX_POWER;
@@ -956,12 +591,17 @@ VOID RTMPReadChannelPwr(
pAd->TxPower[3 * i + choffset + 2].Power = DEFAULT_RF_TX_POWER;
pAd->TxPower[3 * i + choffset + 2].Power2 = DEFAULT_RF_TX_POWER;
}
- pAd->TxPower[3 * 2 + choffset + 0].Channel = 165;
- pAd->TxPower[3 * 2 + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * 2 + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
+ pAd->TxPower[3 * 3 + choffset + 0].Channel = 171;
+ pAd->TxPower[3 * 3 + choffset + 0].Power = DEFAULT_RF_TX_POWER;
+ pAd->TxPower[3 * 3 + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
+
+ pAd->TxPower[3 * 3 + choffset + 1].Channel = 173;
+ pAd->TxPower[3 * 3 + choffset + 1].Power = DEFAULT_RF_TX_POWER;
+ pAd->TxPower[3 * 3 + choffset + 1].Power2 = DEFAULT_RF_TX_POWER;
// 3.2 Fill up power
- for (i = 0; i < 4; i++)
+ /*for (i = 0; i < 4; i++)*/
+ for (i = 0; i < 6; i++)
{
RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word);
RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word);
@@ -980,7 +620,10 @@ VOID RTMPReadChannelPwr(
}
// 4. Print and Debug
- choffset = 14 + 12 + 16 + 7;
+ /*choffset = 14 + 12 + 16 + 7;*/
+ choffset = 14 + 12 + 16 + 11;
+
+
}
/*
@@ -1017,267 +660,6 @@ NDIS_STATUS NICReadRegParameters(
}
-#ifdef RT2870
-/*
- ========================================================================
-
- Routine Description:
- For RF filter calibration purpose
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID RTMPFilterCalibration(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR R55x = 0, value, FilterTarget = 0x1E, BBPValue=0;
- UINT loop = 0, count = 0, loopcnt = 0, ReTry = 0;
- UCHAR RF_R24_Value = 0;
-
- // Give bbp filter initial value
-#ifndef RT2870
- pAd->Mlme.CaliBW20RfR24 = 0x16;
- pAd->Mlme.CaliBW40RfR24 = 0x36; //Bit[5] must be 1 for BW 40
-#else
- pAd->Mlme.CaliBW20RfR24 = 0x1F;
- pAd->Mlme.CaliBW40RfR24 = 0x2F; //Bit[5] must be 1 for BW 40
-#endif
- do
- {
- if (loop == 1) //BandWidth = 40 MHz
- {
- // Write 0x27 to RF_R24 to program filter
- RF_R24_Value = 0x27;
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- if (IS_RT3090(pAd))
- FilterTarget = 0x15;
- else
- FilterTarget = 0x19;
-
- // when calibrate BW40, BBP mask must set to BW40.
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- BBPValue|= (0x10);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-#ifdef RT2870
- // set to BW40
- RT30xxReadRFRegister(pAd, RF_R31, &value);
- value |= 0x20;
- RT30xxWriteRFRegister(pAd, RF_R31, value);
-#endif
- }
- else //BandWidth = 20 MHz
- {
- // Write 0x07 to RF_R24 to program filter
- RF_R24_Value = 0x07;
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- if (IS_RT3090(pAd))
- FilterTarget = 0x13;
- else
- FilterTarget = 0x16;
-#ifdef RT2870
- // set to BW20
- RT30xxReadRFRegister(pAd, RF_R31, &value);
- value &= (~0x20);
- RT30xxWriteRFRegister(pAd, RF_R31, value);
-#endif
- }
-
- // Write 0x01 to RF_R22 to enable baseband loopback mode
- RT30xxReadRFRegister(pAd, RF_R22, &value);
- value |= 0x01;
- RT30xxWriteRFRegister(pAd, RF_R22, value);
-
- // Write 0x00 to BBP_R24 to set power & frequency of passband test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0);
-
- do
- {
- // Write 0x90 to BBP_R25 to transmit test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R25, 0x90);
-
- RTMPusecDelay(1000);
- // Read BBP_R55[6:0] for received power, set R55x = BBP_R55[6:0]
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R55, &value);
- R55x = value & 0xFF;
-
- } while ((ReTry++ < 100) && (R55x == 0));
-
- // Write 0x06 to BBP_R24 to set power & frequency of stopband test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0x06);
-
- while(TRUE)
- {
- // Write 0x90 to BBP_R25 to transmit test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R25, 0x90);
-
- //We need to wait for calibration
- RTMPusecDelay(1000);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R55, &value);
- value &= 0xFF;
- if ((R55x - value) < FilterTarget)
- {
- RF_R24_Value ++;
- }
- else if ((R55x - value) == FilterTarget)
- {
- RF_R24_Value ++;
- count ++;
- }
- else
- {
- break;
- }
-
- // prevent infinite loop cause driver hang.
- if (loopcnt++ > 100)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPFilterCalibration - can't find a valid value, loopcnt=%d stop calibrating", loopcnt));
- break;
- }
-
- // Write RF_R24 to program filter
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- }
-
- if (count > 0)
- {
- RF_R24_Value = RF_R24_Value - ((count) ? (1) : (0));
- }
-
- // Store for future usage
- if (loopcnt < 100)
- {
- if (loop++ == 0)
- {
- //BandWidth = 20 MHz
- pAd->Mlme.CaliBW20RfR24 = (UCHAR)RF_R24_Value;
- }
- else
- {
- //BandWidth = 40 MHz
- pAd->Mlme.CaliBW40RfR24 = (UCHAR)RF_R24_Value;
- break;
- }
- }
- else
- break;
-
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
-
- // reset count
- count = 0;
- } while(TRUE);
-
- //
- // Set back to initial state
- //
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0);
-
- RT30xxReadRFRegister(pAd, RF_R22, &value);
- value &= ~(0x01);
- RT30xxWriteRFRegister(pAd, RF_R22, value);
-
- // set BBP back to BW20
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPFilterCalibration - CaliBW20RfR24=0x%x, CaliBW40RfR24=0x%x\n", pAd->Mlme.CaliBW20RfR24, pAd->Mlme.CaliBW40RfR24));
-}
-
-VOID NICInitRT30xxRFRegisters(IN PRTMP_ADAPTER pAd)
-{
- INT i;
- // Driver must read EEPROM to get RfIcType before initial RF registers
- // Initialize RF register to default value
- if (IS_RT3070(pAd) || IS_RT3071(pAd))
- {
- // Init RF calibration
- // Driver should toggle RF R30 bit7 before init RF registers
- UINT32 RfReg = 0;
- UINT32 data;
-
- RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
- RfReg |= 0x80;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
- RTMPusecDelay(1000);
- RfReg &= 0x7F;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
-
- // Initialize RF register to default value
- for (i = 0; i < NUM_RF_REG_PARMS; i++)
- {
- RT30xxWriteRFRegister(pAd, RT30xx_RFRegTable[i].Register, RT30xx_RFRegTable[i].Value);
- }
-
- if (IS_RT3070(pAd))
- {
- // Update MAC 0x05D4 from 01xxxxxx to 0Dxxxxxx (voltage 1.2V to 1.35V) for RT3070 to improve yield rate
- RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
- data = ((data & 0xF0FFFFFF) | 0x0D000000);
- RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
- }
- else if (IS_RT3071(pAd))
- {
- // Driver should set RF R6 bit6 on before init RF registers
- RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
- RfReg |= 0x40;
- RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
-
- // init R31
- RT30xxWriteRFRegister(pAd, RF_R31, 0x14);
-
- // RT3071 version E has fixed this issue
- if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
- {
- // patch tx EVM issue temporarily
- RTUSBReadMACRegister(pAd, LDO_CFG0, &data);
- data = ((data & 0xE0FFFFFF) | 0x0D000000);
- RTUSBWriteMACRegister(pAd, LDO_CFG0, data);
- }
- else
- {
- RTMP_IO_READ32(pAd, LDO_CFG0, &data);
- data = ((data & 0xE0FFFFFF) | 0x01000000);
- RTMP_IO_WRITE32(pAd, LDO_CFG0, data);
- }
-
- // patch LNA_PE_G1 failed issue
- RTUSBReadMACRegister(pAd, GPIO_SWITCH, &data);
- data &= ~(0x20);
- RTUSBWriteMACRegister(pAd, GPIO_SWITCH, data);
- }
-
- //For RF filter Calibration
- RTMPFilterCalibration(pAd);
-
- // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
-
- // set led open drain enable
- RTUSBReadMACRegister(pAd, OPT_14, &data);
- data |= 0x01;
- RTUSBWriteMACRegister(pAd, OPT_14, data);
-
- if (IS_RT3071(pAd))
- {
- // add by johnli, RF power sequence setup, load RF normal operation-mode setup
- RT30xxLoadRFNormalModeSetup(pAd);
- }
- }
-}
-#endif // RT2870 //
-
-
/*
========================================================================
@@ -1310,6 +692,18 @@ VOID NICReadEEPROMParameters(
DBGPRINT(RT_DEBUG_TRACE, ("--> NICReadEEPROMParameters\n"));
+ if (pAd->chipOps.eeinit)
+ pAd->chipOps.eeinit(pAd);
+#ifdef RTMP_EFUSE_SUPPORT
+#ifdef RT30xx
+ if(!pAd->bFroceEEPROMBuffer && pAd->bEEPROMFile)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("--> NICReadEEPROMParameters::(Efuse)Load to EEPROM Buffer Mode\n"));
+ eFuseLoadEEPROM(pAd);
+ }
+#endif // RT30xx //
+#endif // RTMP_EFUSE_SUPPORT //
+
// Init EEPROM Address Number, before access EEPROM; if 93c46, EEPROMAddressNum=6, else if 93c66, EEPROMAddressNum=8
RTMP_IO_READ32(pAd, E2PROM_CSR, &data);
DBGPRINT(RT_DEBUG_TRACE, ("--> E2PROM_CSR = 0x%x\n", data));
@@ -1325,7 +719,7 @@ VOID NICReadEEPROMParameters(
// RT2860 MAC no longer auto load MAC address from E2PROM. Driver has to intialize
// MAC address registers according to E2PROM setting
if (mac_addr == NULL ||
- strlen(mac_addr) != 17 ||
+ strlen((PSTRING) mac_addr) != 17 ||
mac_addr[2] != ':' || mac_addr[5] != ':' || mac_addr[8] != ':' ||
mac_addr[11] != ':' || mac_addr[14] != ':')
{
@@ -1347,9 +741,9 @@ VOID NICReadEEPROMParameters(
else
{
INT j;
- PUCHAR macptr;
+ PSTRING macptr;
- macptr = mac_addr;
+ macptr = (PSTRING) mac_addr;
for (j=0; j<MAC_ADDR_LEN; j++)
{
@@ -1389,9 +783,7 @@ VOID NICReadEEPROMParameters(
csr3.field.U2MeMask = 0xff;
RTMP_IO_WRITE32(pAd, MAC_ADDR_DW1, csr3.word);
DBGPRINT_RAW(RT_DEBUG_TRACE,("E2PROM MAC: =%02x:%02x:%02x:%02x:%02x:%02x\n",
- pAd->PermanentAddress[0], pAd->PermanentAddress[1],
- pAd->PermanentAddress[2], pAd->PermanentAddress[3],
- pAd->PermanentAddress[4], pAd->PermanentAddress[5]));
+ PRINT_MAC(pAd->PermanentAddress)));
}
}
@@ -1450,7 +842,8 @@ VOID NICReadEEPROMParameters(
Antenna.word = pAd->EEPROMDefaultValue[0];
if (Antenna.word == 0xFFFF)
{
- if(IS_RT3090(pAd))
+#ifdef RT30xx
+ if(IS_RT3090(pAd)|| IS_RT3390(pAd))
{
Antenna.word = 0;
Antenna.field.RfIcType = RFIC_3020;
@@ -1458,7 +851,9 @@ VOID NICReadEEPROMParameters(
Antenna.field.RxPath = 1;
}
else
+#endif // RT30xx //
{
+
Antenna.word = 0;
Antenna.field.RfIcType = RFIC_2820;
Antenna.field.TxPath = 1;
@@ -1514,11 +909,26 @@ VOID NICReadEEPROMParameters(
// Save the antenna for future use
pAd->Antenna.word = Antenna.word;
+ // Set the RfICType here, then we can initialize RFIC related operation callbacks
+ pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath;
+ pAd->RfIcType = (UCHAR) Antenna.field.RfIcType;
+
+#ifdef RTMP_RF_RW_SUPPORT
+ RtmpChipOpsRFHook(pAd);
+#endif // RTMP_RF_RW_SUPPORT //
+
+#ifdef RTMP_MAC_PCI
+ sprintf((PSTRING) pAd->nickname, "RT2860STA");
+#endif // RTMP_MAC_PCI //
+
+
//
// Reset PhyMode if we don't support 802.11a
// Only RFIC_2850 & RFIC_2750 support 802.11a
//
- if ((Antenna.field.RfIcType != RFIC_2850) && (Antenna.field.RfIcType != RFIC_2750))
+ if ((Antenna.field.RfIcType != RFIC_2850)
+ && (Antenna.field.RfIcType != RFIC_2750)
+ && (Antenna.field.RfIcType != RFIC_3052))
{
if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED) ||
(pAd->CommonCfg.PhyMode == PHY_11A))
@@ -1671,11 +1081,31 @@ VOID NICReadEEPROMParameters(
if ((pAd->ARssiOffset2 < -10) || (pAd->ARssiOffset2 > 10))
pAd->ARssiOffset2 = 0;
+#ifdef RT30xx
+ //
+ // Get TX mixer gain setting
+ // 0xff are invalid value
+ // Note: RT30xX default value is 0x00 and will program to RF_R17 only when this value is not zero.
+ // RT359X default value is 0x02
+ //
+ if (IS_RT30xx(pAd) || IS_RT3572(pAd))
+ {
+ RT28xx_EEPROM_READ16(pAd, EEPROM_TXMIXER_GAIN_2_4G, value);
+ pAd->TxMixerGain24G = 0;
+ value &= 0x00ff;
+ if (value != 0xff)
+ {
+ value &= 0x07;
+ pAd->TxMixerGain24G = (UCHAR)value;
+ }
+ }
+#endif // RT30xx //
+
//
// Get LED Setting.
//
RT28xx_EEPROM_READ16(pAd, 0x3a, value);
- pAd->LedCntl.word = (value&0xff00) >> 8;
+ pAd->LedCntl.word = (value>>8);
RT28xx_EEPROM_READ16(pAd, EEPROM_LED1_OFFSET, value);
pAd->Led1 = value;
RT28xx_EEPROM_READ16(pAd, EEPROM_LED2_OFFSET, value);
@@ -1685,6 +1115,12 @@ VOID NICReadEEPROMParameters(
RTMPReadTxPwrPerRate(pAd);
+#ifdef RT30xx
+#ifdef RTMP_EFUSE_SUPPORT
+ RtmpEfuseSupportCheck(pAd);
+#endif // RTMP_EFUSE_SUPPORT //
+#endif // RT30xx //
+
DBGPRINT(RT_DEBUG_TRACE, ("<-- NICReadEEPROMParameters\n"));
}
@@ -1712,7 +1148,7 @@ VOID NICInitAsicFromEEPROM(
UINT32 data = 0;
UCHAR BBPR1 = 0;
USHORT i;
- EEPROM_ANTENNA_STRUC Antenna;
+// EEPROM_ANTENNA_STRUC Antenna;
EEPROM_NIC_CONFIG2_STRUC NicConfig2;
UCHAR BBPR3 = 0;
@@ -1729,28 +1165,9 @@ VOID NICInitAsicFromEEPROM(
}
}
-#ifndef RT2870
- Antenna.word = pAd->Antenna.word;
-#else
- Antenna.word = pAd->EEPROMDefaultValue[0];
- if (Antenna.word == 0xFFFF)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("E2PROM error, hard code as 0x%04x\n", Antenna.word));
- BUG_ON(Antenna.word == 0xFFFF);
- }
-#endif
- pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath;
- pAd->RfIcType = (UCHAR) Antenna.field.RfIcType;
-
-#ifdef RT2870
- DBGPRINT(RT_DEBUG_WARN, ("pAd->RfIcType = %d, RealRxPath=%d, TxPath = %d\n", pAd->RfIcType, pAd->Mlme.RealRxPath,Antenna.field.TxPath));
- // Save the antenna for future use
- pAd->Antenna.word = Antenna.word;
-#endif
NicConfig2.word = pAd->EEPROMDefaultValue[1];
-#ifdef RT2870
{
if ((NicConfig2.word & 0x00ff) == 0xff)
{
@@ -1762,15 +1179,16 @@ VOID NICInitAsicFromEEPROM(
NicConfig2.word &= 0x00ff;
}
}
-#endif
+
// Save the antenna for future use
pAd->NicConfig2.word = NicConfig2.word;
-#ifdef RT2870
+#ifdef RT30xx
// set default antenna as main
if (pAd->RfIcType == RFIC_3020)
AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
-#endif
+#endif // RT30xx //
+
//
// Send LED Setting to MCU.
//
@@ -1779,19 +1197,21 @@ VOID NICInitAsicFromEEPROM(
pAd->LedCntl.word = 0x01;
pAd->Led1 = 0x5555;
pAd->Led2 = 0x2221;
-#ifdef RT2860
- pAd->Led3 = 0xA9F8;
-#endif
-#ifdef RT2870
+#ifdef RTMP_MAC_PCI
+ pAd->Led3 = 0xA9F8;
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
pAd->Led3 = 0x5627;
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
}
AsicSendCommandToMcu(pAd, 0x52, 0xff, (UCHAR)pAd->Led1, (UCHAR)(pAd->Led1 >> 8));
AsicSendCommandToMcu(pAd, 0x53, 0xff, (UCHAR)pAd->Led2, (UCHAR)(pAd->Led2 >> 8));
AsicSendCommandToMcu(pAd, 0x54, 0xff, (UCHAR)pAd->Led3, (UCHAR)(pAd->Led3 >> 8));
- pAd->LedIndicatorStregth = 0xFF;
+ AsicSendCommandToMcu(pAd, 0x51, 0xff, 0, pAd->LedCntl.field.Polarity);
+
+ pAd->LedIndicatorStrength = 0xFF;
RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, before link up
{
@@ -1806,6 +1226,7 @@ VOID NICInitAsicFromEEPROM(
{
pAd->StaCfg.bHwRadio = FALSE;
pAd->StaCfg.bRadio = FALSE;
+// RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x00001818);
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
}
}
@@ -1819,26 +1240,58 @@ VOID NICInitAsicFromEEPROM(
else
{
RTMPSetLED(pAd, LED_RADIO_ON);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
+#ifdef RT3090
+ AsicSendCommandToMcu(pAd, 0x30, PowerRadioOffCID, 0xff, 0x02);
+ AsicCheckCommanOk(pAd, PowerRadioOffCID);
+#endif // RT3090 //
+#ifndef RT3090
AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
+#endif // RT3090 //
AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x00);
// 2-1. wait command ok.
AsicCheckCommanOk(pAd, PowerWakeCID);
-#endif
+#endif // RTMP_MAC_PCI //
}
}
+#ifdef RTMP_MAC_PCI
+#ifdef RT30xx
+ if (IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd))
+ {
+ RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
+ if (pChipOps->AsicReverseRfFromSleepMode)
+ pChipOps->AsicReverseRfFromSleepMode(pAd);
+ }
+ // 3090 MCU Wakeup command needs more time to be stable.
+ // Before stable, don't issue other MCU command to prevent from firmware error.
+
+ if ((IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
+ && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
+ && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
+ {
+ DBGPRINT(RT_DEBUG_TRACE,("%s::%d,release Mcu Lock\n",__FUNCTION__,__LINE__));
+ RTMP_SEM_LOCK(&pAd->McuCmdLock);
+ pAd->brt30xxBanMcuCmd = FALSE;
+ RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
+ }
+#endif // RT30xx //
+#endif // RTMP_MAC_PCI //
+
// Turn off patching for cardbus controller
if (NicConfig2.field.CardbusAcceleration == 1)
{
+// pAd->bTest1 = TRUE;
}
if (NicConfig2.field.DynamicTxAgcControl == 1)
pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = TRUE;
else
pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = FALSE;
-
- /* BBP has been programmed so reset to UNKNOWN_BAND */
+ //
+ // Since BBP has been progamed, to make sure BBP setting will be
+ // upate inside of AsicAntennaSelect, so reset to UNKNOWN_BAND!!
+ //
pAd->CommonCfg.BandState = UNKNOWN_BAND;
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
@@ -1866,10 +1319,53 @@ VOID NICInitAsicFromEEPROM(
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BBPR1);
- DBGPRINT(RT_DEBUG_TRACE, ("Use Hw Radio Control Pin=%d; if used Pin=%d;\n", pAd->CommonCfg.bHardwareRadio, pAd->CommonCfg.bHardwareRadio));
+ DBGPRINT(RT_DEBUG_TRACE, ("Use Hw Radio Control Pin=%d; if used Pin=%d;\n",
+ pAd->CommonCfg.bHardwareRadio, pAd->CommonCfg.bHardwareRadio));
}
- DBGPRINT(RT_DEBUG_TRACE, ("TxPath = %d, RxPath = %d, RFIC=%d, Polar+LED mode=%x\n", pAd->Antenna.field.TxPath, pAd->Antenna.field.RxPath, pAd->RfIcType, pAd->LedCntl.word));
+#ifdef RTMP_MAC_USB
+#ifdef RT30xx
+ // update registers from EEPROM for RT3071 or later(3572/3592).
+
+ if (IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
+ {
+ UCHAR RegIdx, RegValue;
+ USHORT value;
+
+ // after RT3071, write BBP from EEPROM 0xF0 to 0x102
+ for (i = 0xF0; i <= 0x102; i = i+2)
+ {
+ value = 0xFFFF;
+ RT28xx_EEPROM_READ16(pAd, i, value);
+ if ((value != 0xFFFF) && (value != 0))
+ {
+ RegIdx = (UCHAR)(value >> 8);
+ RegValue = (UCHAR)(value & 0xff);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, RegIdx, RegValue);
+ DBGPRINT(RT_DEBUG_TRACE, ("Update BBP Registers from EEPROM(0x%0x), BBP(0x%x) = 0x%x\n", i, RegIdx, RegValue));
+ }
+ }
+
+ // after RT3071, write RF from EEPROM 0x104 to 0x116
+ for (i = 0x104; i <= 0x116; i = i+2)
+ {
+ value = 0xFFFF;
+ RT28xx_EEPROM_READ16(pAd, i, value);
+ if ((value != 0xFFFF) && (value != 0))
+ {
+ RegIdx = (UCHAR)(value >> 8);
+ RegValue = (UCHAR)(value & 0xff);
+ RT30xxWriteRFRegister(pAd, RegIdx, RegValue);
+ DBGPRINT(RT_DEBUG_TRACE, ("Update RF Registers from EEPROM0x%x), BBP(0x%x) = 0x%x\n", i, RegIdx, RegValue));
+ }
+ }
+ }
+#endif // RT30xx //
+#endif // RTMP_MAC_USB //
+
+ DBGPRINT(RT_DEBUG_TRACE, ("TxPath = %d, RxPath = %d, RFIC=%d, Polar+LED mode=%x\n",
+ pAd->Antenna.field.TxPath, pAd->Antenna.field.RxPath,
+ pAd->RfIcType, pAd->LedCntl.word));
DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitAsicFromEEPROM\n"));
}
@@ -1897,10 +1393,11 @@ NDIS_STATUS NICInitializeAdapter(
{
NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
WPDMA_GLO_CFG_STRUC GloCfg;
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
UINT32 Value;
DELAY_INT_CFG_STRUC IntCfg;
-#endif
+#endif // RTMP_MAC_PCI //
+// INT_MASK_CSR_STRUC IntMask;
ULONG i =0, j=0;
AC_TXOP_CSR0_STRUC csr0;
@@ -1939,11 +1436,11 @@ retry:
// asic simulation sequence put this ahead before loading firmware.
// pbf hardware reset
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
RTMP_IO_WRITE32(pAd, WPDMA_RST_IDX, 0x1003f); // 0x10000 for reset rx, 0x3f resets all 6 tx rings.
RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe1f);
RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe00);
-#endif
+#endif // RTMP_MAC_PCI //
// Initialze ASIC for TX & Rx operation
if (NICInitializeAsic(pAd , bHardReset) != NDIS_STATUS_SUCCESS)
@@ -1957,7 +1454,7 @@ retry:
}
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
// Write AC_BK base address register
Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_BK].Cell[0].AllocPa);
RTMP_IO_WRITE32(pAd, TX_BASE_PTR1, Value);
@@ -1978,11 +1475,6 @@ retry:
RTMP_IO_WRITE32(pAd, TX_BASE_PTR3, Value);
DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR3 : 0x%x\n", Value));
- // Write HCCA base address register
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_HCCA].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR4, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR4 : 0x%x\n", Value));
-
// Write MGMT_BASE_CSR register
Value = RTMP_GetPhysicalAddressLow(pAd->MgmtRing.Cell[0].AllocPa);
RTMP_IO_WRITE32(pAd, TX_BASE_PTR5, Value);
@@ -2030,7 +1522,7 @@ retry:
// Write RX_RING_CSR register
Value = RX_RING_SIZE;
RTMP_IO_WRITE32(pAd, RX_MAX_CNT, Value);
-#endif /* RT2860 */
+#endif // RTMP_MAC_PCI //
// WMM parameter
@@ -2049,7 +1541,7 @@ retry:
RTMP_IO_WRITE32(pAd, WMM_TXOP1_CFG, csr0.word);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
// 3. Set DMA global configuration except TX_DMA_EN and RX_DMA_EN bits:
i = 0;
do
@@ -2068,7 +1560,7 @@ retry:
IntCfg.word = 0;
RTMP_IO_WRITE32(pAd, DELAY_INT_CFG, IntCfg.word);
-#endif
+#endif // RTMP_MAC_PCI //
// reset action
@@ -2104,26 +1596,44 @@ NDIS_STATUS NICInitializeAsic(
ULONG Index = 0;
UCHAR R0 = 0xff;
UINT32 MacCsr12 = 0, Counter = 0;
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
UINT32 MacCsr0 = 0;
NTSTATUS Status;
UCHAR Value = 0xff;
- UINT32 eFuseCtrl;
-#endif
+#endif // RTMP_MAC_USB //
+#ifdef RT30xx
+ UCHAR bbpreg=0;
+ UCHAR RFValue=0;
+#endif // RT30xx //
USHORT KeyIdx;
INT i,apidx;
DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n"));
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
+ RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x3); // To fix driver disable/enable hang issue when radio off
if (bHardReset == TRUE)
{
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x3);
}
else
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x1);
-#endif
-#ifdef RT2870
+
+ RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0);
+ // Initialize MAC register to default value
+ for (Index = 0; Index < NUM_MAC_REG_PARMS; Index++)
+ {
+ RTMP_IO_WRITE32(pAd, MACRegTable[Index].Register, MACRegTable[Index].Value);
+ }
+
+ {
+ for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++)
+ {
+ RTMP_IO_WRITE32(pAd, STAMACRegTable[Index].Register, STAMACRegTable[Index].Value);
+ }
+ }
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
//
// Make sure MAC gets ready after NICLoadFirmware().
//
@@ -2151,44 +1661,32 @@ NDIS_STATUS NICInitializeAsic(
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x3);
RTMP_IO_WRITE32(pAd, USB_DMA_CFG, 0x0);
Status = RTUSBVenderReset(pAd);
-#endif
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0);
// Initialize MAC register to default value
-#ifdef RT2860
- for (Index = 0; Index < NUM_MAC_REG_PARMS; Index++)
- {
- RTMP_IO_WRITE32(pAd, MACRegTable[Index].Register, MACRegTable[Index].Value);
- }
-#endif
-#ifdef RT2870
for(Index=0; Index<NUM_MAC_REG_PARMS; Index++)
{
-#ifdef RT3070
- if ((MACRegTable[Index].Register == TX_SW_CFG0) && (IS_RT3070(pAd) || IS_RT3071(pAd)))
+#ifdef RT30xx
+ if ((MACRegTable[Index].Register == TX_SW_CFG0) && (IS_RT3070(pAd) || IS_RT3071(pAd) || IS_RT3572(pAd) || IS_RT3090(pAd) || IS_RT3390(pAd)))
{
MACRegTable[Index].Value = 0x00000400;
}
-#endif // RT3070 //
+#endif // RT30xx //
RTMP_IO_WRITE32(pAd, (USHORT)MACRegTable[Index].Register, MACRegTable[Index].Value);
}
-#endif // RT2870 //
{
for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++)
{
-#ifdef RT2860
- RTMP_IO_WRITE32(pAd, STAMACRegTable[Index].Register, STAMACRegTable[Index].Value);
-#endif
-#ifdef RT2870
RTMP_IO_WRITE32(pAd, (USHORT)STAMACRegTable[Index].Register, STAMACRegTable[Index].Value);
-#endif
}
}
+#endif // RTMP_MAC_USB //
- // Initialize RT3070 serial MAc registers which is different from RT2870 serial
- if (IS_RT3090(pAd))
+#ifdef RT30xx
+ // Initialize RT3070 serial MAC registers which is different from RT2870 serial
+ if (IS_RT3090(pAd) || IS_RT3572(pAd)||IS_RT3390(pAd))
{
RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0);
@@ -2197,7 +1695,7 @@ NDIS_STATUS NICInitializeAsic(
{
if (pAd->NicConfig2.field.DACTestBit == 1)
{
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x1F); // To fix throughput drop drastically
+ RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x2C); // To fix throughput drop drastically
}
else
{
@@ -2209,11 +1707,17 @@ NDIS_STATUS NICInitializeAsic(
RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0);
}
}
-#ifdef RT2870
else if (IS_RT3070(pAd))
{
+ if (((pAd->MACVersion & 0xffff) < 0x0201))
+ {
RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0);
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x1F); // To fix throughput drop drastically
+ RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x2C); // To fix throughput drop drastically
+ }
+ else
+ {
+ RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0);
+ }
}
#endif // RT30xx //
@@ -2236,6 +1740,11 @@ NDIS_STATUS NICInitializeAsic(
// PCI and USB are not the same because PCI driver needs to wait for PCI bus ready
RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, 0); // initialize BBP R/W access agent
RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, 0);
+#ifdef RT3090
+ //2008/11/28:KH add to fix the dead rf frequency offset bug<--
+ AsicSendCommandToMcu(pAd, 0x72, 0, 0, 0);
+ //2008/11/28:KH add to fix the dead rf frequency offset bug-->
+#endif // RT3090 //
RTMPusecDelay(1000);
// Read BBP register, make sure BBP is up and running before write new data
@@ -2256,28 +1765,42 @@ NDIS_STATUS NICInitializeAsic(
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[Index].Register, BBPRegTable[Index].Value);
}
-#ifndef RT2870
- // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT.
- if ((pAd->MACVersion&0xffff) != 0x0101)
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x19);
-#else
+#ifdef RTMP_MAC_PCI
+ // TODO: shiang, check MACVersion, currently, rbus-based chip use this.
+ if (pAd->MACVersion == 0x28720200)
+ {
+ //UCHAR value;
+ ULONG value2;
+
+ //disable MLD by Bruce 20080704
+ //BBP_IO_READ8_BY_REG_ID(pAd, BBP_R105, &value);
+ //BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R105, value | 4);
+
+ //Maximum PSDU length from 16K to 32K bytes
+ RTMP_IO_READ32(pAd, MAX_LEN_CFG, &value2);
+ value2 &= ~(0x3<<12);
+ value2 |= (0x2<<12);
+ RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, value2);
+ }
+#endif // RTMP_MAC_PCI //
+
// for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT.
// RT3090 should not program BBP R84 to 0x19, otherwise TX will block.
- if (((pAd->MACVersion&0xffff) != 0x0101) && (!IS_RT30xx(pAd)))
+ //3070/71/72,3090,3090A( are included in RT30xx),3572,3390
+ if (((pAd->MACVersion & 0xffff) != 0x0101) && !(IS_RT30xx(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd)))
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x19);
+#ifdef RT30xx
// add by johnli, RF power sequence setup
- if (IS_RT30xx(pAd))
- { //update for RT3070/71/72/90/91/92.
+ if (IS_RT30xx(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
+ { //update for RT3070/71/72/90/91/92,3572,3390.
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R79, 0x13);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R80, 0x05);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R81, 0x33);
}
- if (IS_RT3090(pAd))
+ if (IS_RT3090(pAd)||IS_RT3390(pAd)) // RT309x, RT3071/72
{
- UCHAR bbpreg=0;
-
// enable DC filter
if ((pAd->MACVersion & 0xffff) >= 0x0211)
{
@@ -2307,7 +1830,38 @@ NDIS_STATUS NICInitializeAsic(
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R31, bbpreg);
}
}
-#endif
+ else if (IS_RT3070(pAd))
+ {
+ if ((pAd->MACVersion & 0xffff) >= 0x0201)
+ {
+ // enable DC filter
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R103, 0xc0);
+
+ // improve power consumption in RT3070 Ver.F
+ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R31, &bbpreg);
+ bbpreg &= (~0x3);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R31, bbpreg);
+ }
+
+ // TX_LO1_en, RF R17 register Bit 3 to 0
+ RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
+ RFValue &= (~0x08);
+ // to fix rx long range issue
+ if (pAd->NicConfig2.field.ExternalLNAForG == 0)
+ {
+ RFValue |= 0x20;
+ }
+ // set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h
+ if (pAd->TxMixerGain24G >= 1)
+ {
+ RFValue &= (~0x7); // clean bit [2:0]
+ RFValue |= pAd->TxMixerGain24G;
+ }
+ RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
+ }
+// end johnli
+#endif // RT30xx //
+
if (pAd->MACVersion == 0x28600100)
{
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
@@ -2324,7 +1878,7 @@ NDIS_STATUS NICInitializeAsic(
RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, csr);
}
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
{
UCHAR MAC_Value[]={0xff,0xff,0xff,0xff,0xff,0xff,0xff,0,0};
@@ -2335,7 +1889,7 @@ NDIS_STATUS NICInitializeAsic(
RTUSBMultiWrite(pAd, (USHORT)(MAC_WCID_BASE + Index * 8), MAC_Value, 8);
}
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// Add radio off control
{
@@ -2356,7 +1910,7 @@ NDIS_STATUS NICInitializeAsic(
RTMP_IO_READ32(pAd, TX_STA_CNT2, &Counter);
// ASIC will keep garbage value after boot
- // Clear all seared key table when initial
+ // Clear all shared key table when initial
// This routine can be ignored in radio-ON/OFF operation.
if (bHardReset)
{
@@ -2372,6 +1926,9 @@ NDIS_STATUS NICInitializeAsic(
}
}
+ // assert HOST ready bit
+// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x0); // 2004-09-14 asked by Mark
+// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x4);
// It isn't necessary to clear this space when not hard reset.
if (bHardReset == TRUE)
@@ -2383,7 +1940,8 @@ NDIS_STATUS NICInitializeAsic(
RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[apidx] + i, 0x00);
}
}
-#ifdef RT2870
+
+#ifdef RTMP_MAC_USB
AsicDisableSync(pAd);
// Clear raw counters
RTMP_IO_READ32(pAd, RX_STA_CNT0, &Counter);
@@ -2397,19 +1955,7 @@ NDIS_STATUS NICInitializeAsic(
Counter&=0xffffff00;
Counter|=0x000001e;
RTMP_IO_WRITE32(pAd, USB_CYC_CFG, Counter);
-
- pAd->bUseEfuse=FALSE;
- RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrl);
- pAd->bUseEfuse = ( (eFuseCtrl & 0x80000000) == 0x80000000) ? 1 : 0;
- if(pAd->bUseEfuse)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("NVM is Efuse\n"));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("NVM is EEPROM\n"));
- }
-#endif
+#endif // RTMP_MAC_USB //
{
// for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT.
@@ -2421,133 +1967,6 @@ NDIS_STATUS NICInitializeAsic(
return NDIS_STATUS_SUCCESS;
}
-
-#ifdef RT2860
-VOID NICRestoreBBPValue(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR index;
- UCHAR Value = 0;
- ULONG Data;
-
- DBGPRINT(RT_DEBUG_TRACE, ("---> NICRestoreBBPValue !!!!!!!!!!!!!!!!!!!!!!! \n"));
- // Initialize BBP register to default value (rtmp_init.c)
- for (index = 0; index < NUM_BBP_REG_PARMS; index++)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[index].Register, BBPRegTable[index].Value);
- }
- // copy from (rtmp_init.c)
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x12);
- }
-
- // copy from (connect.c LinkUp function)
- if (INFRA_ON(pAd))
- {
- // Change to AP channel
- if ((pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- // Must using 40MHz.
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- Value |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- // RX : control channel at lower
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value &= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
- // Record BBPR3 setting, But don't keep R Antenna # information.
- pAd->StaCfg.BBPR3 = Value;
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data &= 0xfffffffe;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- else if ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- // Must using 40MHz.
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- Value |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data |= 0x1;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value |= (0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
- // Record BBPR3 setting, But don't keep R Antenna # information.
- pAd->StaCfg.BBPR3 = Value;
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- else
- {
- pAd->CommonCfg.BBPCurrentBW = BW_20;
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data &= 0xfffffffe;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value &= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
- // Record BBPR3 setting, But don't keep R Antenna # information.
- pAd->StaCfg.BBPR3 = Value;
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz LINK UP !!! \n" ));
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<--- NICRestoreBBPValue !!!!!!!!!!!!!!!!!!!!!!! \n"));
-}
-#endif /* RT2860 */
-
/*
========================================================================
@@ -2573,6 +1992,9 @@ VOID NICIssueReset(
UINT32 Value = 0;
DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n"));
+ // Abort Tx, prevent ASIC from writing to Host memory
+ //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x001f0000);
+
// Disable Rx, register value supposed will remain after reset
RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
Value &= (0xfffffff3);
@@ -2644,10 +2066,6 @@ VOID NICUpdateFifoStaCounters(
if (StaFifo.field.TxBF) // 3*3
pEntry->TxBFCount++;
-#ifdef UAPSD_AP_SUPPORT
- UAPSD_SP_AUE_Handle(pAd, pEntry, StaFifo.field.TxSuccess);
-#endif // UAPSD_AP_SUPPORT //
-
if (!StaFifo.field.TxSuccess)
{
pEntry->FIFOCount++;
@@ -2676,7 +2094,9 @@ VOID NICUpdateFifoStaCounters(
pEntry->FIFOCount = 0;
pEntry->ContinueTxFailCnt = 0;
}
+ //pEntry->FIFOCount = 0;
}
+ //pEntry->bSendBAR = TRUE;
}
else
{
@@ -2752,7 +2172,9 @@ VOID NICUpdateFifoStaCounters(
VOID NICUpdateRawCounters(
IN PRTMP_ADAPTER pAd)
{
- UINT32 OldValue;
+ UINT32 OldValue;//, Value2;
+ //ULONG PageSum, OneSecTransmitCount;
+ //ULONG TxErrorRatio, Retry, Fail;
RX_STA_CNT0_STRUC RxStaCnt0;
RX_STA_CNT1_STRUC RxStaCnt1;
RX_STA_CNT2_STRUC RxStaCnt2;
@@ -2768,6 +2190,10 @@ VOID NICUpdateRawCounters(
TX_AGG_CNT5_STRUC TxAggCnt5;
TX_AGG_CNT6_STRUC TxAggCnt6;
TX_AGG_CNT7_STRUC TxAggCnt7;
+ COUNTER_RALINK *pRalinkCounters;
+
+
+ pRalinkCounters = &pAd->RalinkCounters;
RTMP_IO_READ32(pAd, RX_STA_CNT0, &RxStaCnt0.word);
RTMP_IO_READ32(pAd, RX_STA_CNT2, &RxStaCnt2.word);
@@ -2787,22 +2213,23 @@ VOID NICUpdateRawCounters(
pAd->WlanCounters.FCSErrorCount.u.HighPart++;
// Add FCS error count to private counters
- pAd->RalinkCounters.OneSecRxFcsErrCnt += RxStaCnt0.field.CrcErr;
- OldValue = pAd->RalinkCounters.RealFcsErrCount.u.LowPart;
- pAd->RalinkCounters.RealFcsErrCount.u.LowPart += RxStaCnt0.field.CrcErr;
- if (pAd->RalinkCounters.RealFcsErrCount.u.LowPart < OldValue)
- pAd->RalinkCounters.RealFcsErrCount.u.HighPart++;
+ pRalinkCounters->OneSecRxFcsErrCnt += RxStaCnt0.field.CrcErr;
+ OldValue = pRalinkCounters->RealFcsErrCount.u.LowPart;
+ pRalinkCounters->RealFcsErrCount.u.LowPart += RxStaCnt0.field.CrcErr;
+ if (pRalinkCounters->RealFcsErrCount.u.LowPart < OldValue)
+ pRalinkCounters->RealFcsErrCount.u.HighPart++;
// Update Duplicate Rcv check
- pAd->RalinkCounters.DuplicateRcv += RxStaCnt2.field.RxDupliCount;
+ pRalinkCounters->DuplicateRcv += RxStaCnt2.field.RxDupliCount;
pAd->WlanCounters.FrameDuplicateCount.u.LowPart += RxStaCnt2.field.RxDupliCount;
// Update RX Overflow counter
pAd->Counters8023.RxNoBuffer += (RxStaCnt2.field.RxFifoOverflowCount);
-#ifdef RT2870
- if (pAd->RalinkCounters.RxCount != pAd->watchDogRxCnt)
+ //pAd->RalinkCounters.RxCount = 0;
+#ifdef RTMP_MAC_USB
+ if (pRalinkCounters->RxCount != pAd->watchDogRxCnt)
{
- pAd->watchDogRxCnt = pAd->RalinkCounters.RxCount;
+ pAd->watchDogRxCnt = pRalinkCounters->RxCount;
pAd->watchDogRxOverFlowCnt = 0;
}
else
@@ -2812,24 +2239,28 @@ VOID NICUpdateRawCounters(
else
pAd->watchDogRxOverFlowCnt = 0;
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
+ //if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) ||
+ // (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) && (pAd->MacTab.Size != 1)))
if (!pAd->bUpdateBcnCntDone)
{
// Update BEACON sent count
RTMP_IO_READ32(pAd, TX_STA_CNT0, &TxStaCnt0.word);
RTMP_IO_READ32(pAd, TX_STA_CNT1, &StaTx1.word);
RTMP_IO_READ32(pAd, TX_STA_CNT2, &StaTx2.word);
- pAd->RalinkCounters.OneSecBeaconSentCnt += TxStaCnt0.field.TxBeaconCount;
- pAd->RalinkCounters.OneSecTxRetryOkCount += StaTx1.field.TxRetransmit;
- pAd->RalinkCounters.OneSecTxNoRetryOkCount += StaTx1.field.TxSuccess;
- pAd->RalinkCounters.OneSecTxFailCount += TxStaCnt0.field.TxFailCount;
+ pRalinkCounters->OneSecBeaconSentCnt += TxStaCnt0.field.TxBeaconCount;
+ pRalinkCounters->OneSecTxRetryOkCount += StaTx1.field.TxRetransmit;
+ pRalinkCounters->OneSecTxNoRetryOkCount += StaTx1.field.TxSuccess;
+ pRalinkCounters->OneSecTxFailCount += TxStaCnt0.field.TxFailCount;
pAd->WlanCounters.TransmittedFragmentCount.u.LowPart += StaTx1.field.TxSuccess;
pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit;
pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
}
+
+ //if (pAd->bStaFifoTest == TRUE)
{
RTMP_IO_READ32(pAd, TX_AGG_CNT, &TxAggCnt.word);
RTMP_IO_READ32(pAd, TX_AGG_CNT0, &TxAggCnt0.word);
@@ -2840,53 +2271,53 @@ VOID NICUpdateRawCounters(
RTMP_IO_READ32(pAd, TX_AGG_CNT5, &TxAggCnt5.word);
RTMP_IO_READ32(pAd, TX_AGG_CNT6, &TxAggCnt6.word);
RTMP_IO_READ32(pAd, TX_AGG_CNT7, &TxAggCnt7.word);
- pAd->RalinkCounters.TxAggCount += TxAggCnt.field.AggTxCount;
- pAd->RalinkCounters.TxNonAggCount += TxAggCnt.field.NonAggTxCount;
- pAd->RalinkCounters.TxAgg1MPDUCount += TxAggCnt0.field.AggSize1Count;
- pAd->RalinkCounters.TxAgg2MPDUCount += TxAggCnt0.field.AggSize2Count;
+ pRalinkCounters->TxAggCount += TxAggCnt.field.AggTxCount;
+ pRalinkCounters->TxNonAggCount += TxAggCnt.field.NonAggTxCount;
+ pRalinkCounters->TxAgg1MPDUCount += TxAggCnt0.field.AggSize1Count;
+ pRalinkCounters->TxAgg2MPDUCount += TxAggCnt0.field.AggSize2Count;
- pAd->RalinkCounters.TxAgg3MPDUCount += TxAggCnt1.field.AggSize3Count;
- pAd->RalinkCounters.TxAgg4MPDUCount += TxAggCnt1.field.AggSize4Count;
- pAd->RalinkCounters.TxAgg5MPDUCount += TxAggCnt2.field.AggSize5Count;
- pAd->RalinkCounters.TxAgg6MPDUCount += TxAggCnt2.field.AggSize6Count;
+ pRalinkCounters->TxAgg3MPDUCount += TxAggCnt1.field.AggSize3Count;
+ pRalinkCounters->TxAgg4MPDUCount += TxAggCnt1.field.AggSize4Count;
+ pRalinkCounters->TxAgg5MPDUCount += TxAggCnt2.field.AggSize5Count;
+ pRalinkCounters->TxAgg6MPDUCount += TxAggCnt2.field.AggSize6Count;
- pAd->RalinkCounters.TxAgg7MPDUCount += TxAggCnt3.field.AggSize7Count;
- pAd->RalinkCounters.TxAgg8MPDUCount += TxAggCnt3.field.AggSize8Count;
- pAd->RalinkCounters.TxAgg9MPDUCount += TxAggCnt4.field.AggSize9Count;
- pAd->RalinkCounters.TxAgg10MPDUCount += TxAggCnt4.field.AggSize10Count;
+ pRalinkCounters->TxAgg7MPDUCount += TxAggCnt3.field.AggSize7Count;
+ pRalinkCounters->TxAgg8MPDUCount += TxAggCnt3.field.AggSize8Count;
+ pRalinkCounters->TxAgg9MPDUCount += TxAggCnt4.field.AggSize9Count;
+ pRalinkCounters->TxAgg10MPDUCount += TxAggCnt4.field.AggSize10Count;
- pAd->RalinkCounters.TxAgg11MPDUCount += TxAggCnt5.field.AggSize11Count;
- pAd->RalinkCounters.TxAgg12MPDUCount += TxAggCnt5.field.AggSize12Count;
- pAd->RalinkCounters.TxAgg13MPDUCount += TxAggCnt6.field.AggSize13Count;
- pAd->RalinkCounters.TxAgg14MPDUCount += TxAggCnt6.field.AggSize14Count;
+ pRalinkCounters->TxAgg11MPDUCount += TxAggCnt5.field.AggSize11Count;
+ pRalinkCounters->TxAgg12MPDUCount += TxAggCnt5.field.AggSize12Count;
+ pRalinkCounters->TxAgg13MPDUCount += TxAggCnt6.field.AggSize13Count;
+ pRalinkCounters->TxAgg14MPDUCount += TxAggCnt6.field.AggSize14Count;
- pAd->RalinkCounters.TxAgg15MPDUCount += TxAggCnt7.field.AggSize15Count;
- pAd->RalinkCounters.TxAgg16MPDUCount += TxAggCnt7.field.AggSize16Count;
+ pRalinkCounters->TxAgg15MPDUCount += TxAggCnt7.field.AggSize15Count;
+ pRalinkCounters->TxAgg16MPDUCount += TxAggCnt7.field.AggSize16Count;
// Calculate the transmitted A-MPDU count
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += TxAggCnt0.field.AggSize1Count;
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt0.field.AggSize2Count / 2);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += TxAggCnt0.field.AggSize1Count;
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt0.field.AggSize2Count / 2);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize3Count / 3);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize4Count / 4);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize3Count / 3);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize4Count / 4);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize5Count / 5);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize6Count / 6);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize5Count / 5);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize6Count / 6);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize7Count / 7);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize8Count / 8);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize7Count / 7);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize8Count / 8);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize9Count / 9);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize10Count / 10);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize9Count / 9);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize10Count / 10);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize11Count / 11);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize12Count / 12);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize11Count / 11);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize12Count / 12);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize13Count / 13);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize14Count / 14);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize13Count / 13);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize14Count / 14);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize15Count / 15);
- pAd->RalinkCounters.TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize16Count / 16);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize15Count / 15);
+ pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize16Count / 16);
}
@@ -2932,112 +2363,38 @@ VOID NICResetFromError(
AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
}
-/*
- ========================================================================
- Routine Description:
- erase 8051 firmware image in MAC ASIC
-
- Arguments:
- Adapter Pointer to our adapter
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID NICEraseFirmware(
+NDIS_STATUS NICLoadFirmware(
IN PRTMP_ADAPTER pAd)
{
- ULONG i;
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ if (pAd->chipOps.loadFirmware)
+ status = pAd->chipOps.loadFirmware(pAd);
- for(i=0; i<MAX_FIRMWARE_IMAGE_SIZE; i+=4)
- RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0);
+ return status;
+}
-}/* End of NICEraseFirmware */
/*
========================================================================
Routine Description:
- Load 8051 firmware RT2561.BIN file into MAC ASIC
+ erase 8051 firmware image in MAC ASIC
Arguments:
Adapter Pointer to our adapter
- Return Value:
- NDIS_STATUS_SUCCESS firmware image load ok
- NDIS_STATUS_FAILURE image not found
-
IRQL = PASSIVE_LEVEL
========================================================================
*/
-NDIS_STATUS NICLoadFirmware(
+VOID NICEraseFirmware(
IN PRTMP_ADAPTER pAd)
{
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- PUCHAR pFirmwareImage;
- ULONG FileLength, Index;
- //ULONG firm;
- UINT32 MacReg = 0;
-#ifdef RT2870
- UINT32 Version = (pAd->MACVersion >> 16);
-#endif // RT2870 //
-
- pFirmwareImage = FirmwareImage;
- FileLength = sizeof(FirmwareImage);
-#ifdef RT2870
- // New 8k byte firmware size for RT3071/RT3072
- //printk("Usb Chip\n");
- if (FIRMWAREIMAGE_LENGTH == FIRMWAREIMAGE_MAX_LENGTH)
- //The firmware image consists of two parts. One is the origianl and the other is the new.
- //Use Second Part
- {
- if ((Version != 0x2860) && (Version != 0x2872) && (Version != 0x3070))
- { // Use Firmware V2.
- //printk("KH:Use New Version,part2\n");
- pFirmwareImage = (PUCHAR)&FirmwareImage[FIRMWAREIMAGEV1_LENGTH];
- FileLength = FIRMWAREIMAGEV2_LENGTH;
- }
- else
- {
- //printk("KH:Use New Version,part1\n");
- pFirmwareImage = FirmwareImage;
- FileLength = FIRMWAREIMAGEV1_LENGTH;
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("KH: bin file should be 8KB.\n"));
- Status = NDIS_STATUS_FAILURE;
- }
-
-#endif // RT2870 //
-
- RT28XX_WRITE_FIRMWARE(pAd, pFirmwareImage, FileLength);
-
- /* check if MCU is ready */
- Index = 0;
- do
- {
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &MacReg);
-
- if (MacReg & 0x80)
- break;
-
- RTMPusecDelay(1000);
- } while (Index++ < 1000);
+ if (pAd->chipOps.eraseFirmware)
+ pAd->chipOps.eraseFirmware(pAd);
- if (Index > 1000)
- {
- Status = NDIS_STATUS_FAILURE;
- DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));
- } /* End of if */
-
- DBGPRINT(RT_DEBUG_TRACE,
- ("<=== %s (status=%d)\n", __func__, Status));
- return Status;
-} /* End of NICLoadFirmware */
+}/* End of NICEraseFirmware */
/*
@@ -3067,52 +2424,6 @@ NDIS_STATUS NICLoadRateSwitchingParams(
return NDIS_STATUS_SUCCESS;
}
-/*
- ========================================================================
-
- Routine Description:
- if pSrc1 all zero with length Length, return 0.
- If not all zero, return 1
-
- Arguments:
- pSrc1
-
- Return Value:
- 1: not all zero
- 0: all zero
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-ULONG RTMPNotAllZero(
- IN PVOID pSrc1,
- IN ULONG Length)
-{
- PUCHAR pMem1;
- ULONG Index = 0;
-
- pMem1 = (PUCHAR) pSrc1;
-
- for (Index = 0; Index < Length; Index++)
- {
- if (pMem1[Index] != 0x0)
- {
- break;
- }
- }
-
- if (Index == Length)
- {
- return (0);
- }
- else
- {
- return (1);
- }
-}
/*
========================================================================
@@ -3194,21 +2505,6 @@ VOID RTMPZeroMemory(
}
}
-VOID RTMPFillMemory(
- IN PVOID pSrc,
- IN ULONG Length,
- IN UCHAR Fill)
-{
- PUCHAR pMem;
- ULONG Index = 0;
-
- pMem = (PUCHAR) pSrc;
-
- for (Index = 0; Index < Length; Index++)
- {
- pMem[Index] = Fill;
- }
-}
/*
========================================================================
@@ -3279,7 +2575,7 @@ VOID UserCfgInit(
//
// part I. intialize common configuration
//
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
pAd->BulkOutReq = 0;
pAd->BulkOutComplete = 0;
@@ -3294,7 +2590,7 @@ VOID UserCfgInit(
pAd->bUsbTxBulkAggre = 0;
// init as unsed value to ensure driver will set to MCU once.
- pAd->LedIndicatorStregth = 0xFF;
+ pAd->LedIndicatorStrength = 0xFF;
pAd->CommonCfg.MaxPktOneTxBulk = 2;
pAd->CommonCfg.TxBulkFactor = 1;
@@ -3303,7 +2599,7 @@ VOID UserCfgInit(
pAd->CommonCfg.TxPower = 100; //mW
NdisZeroMemory(&pAd->CommonCfg.IOTestParm, sizeof(pAd->CommonCfg.IOTestParm));
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
for(key_index=0; key_index<SHARE_KEY_NUM; key_index++)
{
@@ -3314,19 +2610,19 @@ VOID UserCfgInit(
}
}
-#ifdef RT2870
pAd->EepromAccess = FALSE;
-#endif
+
pAd->Antenna.word = 0;
pAd->CommonCfg.BBPCurrentBW = BW_20;
pAd->LedCntl.word = 0;
-#ifdef RT2860
- pAd->LedIndicatorStregth = 0;
+#ifdef RTMP_MAC_PCI
+ pAd->LedIndicatorStrength = 0;
pAd->RLnkCtrlOffset = 0;
pAd->HostLnkCtrlOffset = 0;
+ pAd->StaCfg.PSControl.field.EnableNewPS=TRUE;
pAd->CheckDmaBusyCount = 0;
-#endif
+#endif // RTMP_MAC_PCI //
pAd->bAutoTxAgcA = FALSE; // Default is OFF
pAd->bAutoTxAgcG = FALSE; // Default is OFF
@@ -3338,8 +2634,6 @@ VOID UserCfgInit(
pAd->bForcePrintRX = FALSE;
pAd->bStaFifoTest = FALSE;
pAd->bProtectionTest = FALSE;
- pAd->bHCCATest = FALSE;
- pAd->bGenOneHCCA = FALSE;
pAd->CommonCfg.Dsifs = 10; // in units of usec
pAd->CommonCfg.TxPower = 100; //mW
pAd->CommonCfg.TxPowerPercentage = 0xffffffff; // AUTO
@@ -3355,6 +2649,10 @@ VOID UserCfgInit(
pAd->CommonCfg.RadarDetect.CSPeriod = 10;
pAd->CommonCfg.RadarDetect.CSCount = 0;
pAd->CommonCfg.RadarDetect.RDMode = RD_NORMAL_MODE;
+
+
+
+
pAd->CommonCfg.RadarDetect.ChMovingTime = 65;
pAd->CommonCfg.RadarDetect.LongPulseRadarTh = 3;
pAd->CommonCfg.bAPSDCapable = FALSE;
@@ -3386,10 +2684,18 @@ VOID UserCfgInit(
pAd->CommonCfg.bExtChannelSwitchAnnouncement = 1;
pAd->CommonCfg.bHTProtect = 1;
pAd->CommonCfg.bMIMOPSEnable = TRUE;
+ //2008/11/05:KH add to support Antenna power-saving of AP<--
+ pAd->CommonCfg.bGreenAPEnable=FALSE;
+ //2008/11/05:KH add to support Antenna power-saving of AP-->
pAd->CommonCfg.bBADecline = FALSE;
pAd->CommonCfg.bDisableReordering = FALSE;
+ if (pAd->MACVersion == 0x28720200)
+ {
+ pAd->CommonCfg.TxBASize = 13; //by Jerry recommend
+ }else{
pAd->CommonCfg.TxBASize = 7;
+ }
pAd->CommonCfg.REGBACapability.word = pAd->CommonCfg.BACapability.word;
@@ -3446,6 +2752,15 @@ VOID UserCfgInit(
pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
}
+#ifdef PCIE_PS_SUPPORT
+pAd->brt30xxBanMcuCmd = FALSE;
+pAd->b3090ESpecialChip = FALSE;
+//KH Debug:the following must be removed
+pAd->StaCfg.PSControl.field.rt30xxPowerMode=3;
+pAd->StaCfg.PSControl.field.rt30xxForceASPMTest=0;
+pAd->StaCfg.PSControl.field.rt30xxFollowHostASPM=1;
+#endif // PCIE_PS_SUPPORT //
+
// global variables mXXXX used in MAC protocol state machines
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
@@ -3467,12 +2782,6 @@ VOID UserCfgInit(
// Patch for Ndtest
pAd->StaCfg.ScanCnt = 0;
- // CCX 2.0 control flag init
- pAd->StaCfg.CCXEnable = FALSE;
- pAd->StaCfg.CCXReqType = MSRN_TYPE_UNUSED;
- pAd->StaCfg.CCXQosECWMin = 4;
- pAd->StaCfg.CCXQosECWMax = 10;
-
pAd->StaCfg.bHwRadio = TRUE; // Default Hardware Radio status is On
pAd->StaCfg.bSwRadio = TRUE; // Default Software Radio status is On
pAd->StaCfg.bRadio = TRUE; // bHwRadio && bSwRadio
@@ -3484,14 +2793,33 @@ VOID UserCfgInit(
// Save the init time as last scan time, the system should do scan after 2 seconds.
// This patch is for driver wake up from standby mode, system will do scan right away.
- pAd->StaCfg.LastScanTime = 0;
+ NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
+ if (pAd->StaCfg.LastScanTime > 10 * OS_HZ)
+ pAd->StaCfg.LastScanTime -= (10 * OS_HZ);
+
NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE+1);
- sprintf(pAd->nickname, "%s", STA_NIC_DEVICE_NAME);
+#ifdef RTMP_MAC_PCI
+ sprintf((PSTRING) pAd->nickname, "RT2860STA");
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ sprintf((PSTRING) pAd->nickname, "RT2870STA");
+#endif // RTMP_MAC_USB //
RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer, GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc), pAd, FALSE);
pAd->StaCfg.IEEE8021X = FALSE;
pAd->StaCfg.IEEE8021x_required_keys = FALSE;
pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE;
+ pAd->StaCfg.bRSN_IE_FromWpaSupplicant = FALSE;
pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE;
+
+ NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
+
+
+ pAd->StaCfg.bAutoConnectByBssid = FALSE;
+ pAd->StaCfg.BeaconLostTime = BEACON_LOST_TIME;
+ NdisZeroMemory(pAd->StaCfg.WpaPassPhrase, 64);
+ pAd->StaCfg.WpaPassPhraseLen = 0;
+ pAd->StaCfg.bAutoRoaming = FALSE;
+ pAd->StaCfg.bForceTxBurst = FALSE;
}
// Default for extra information is not valid
@@ -3524,22 +2852,30 @@ VOID UserCfgInit(
pAd->Bbp94 = BBPR94_DEFAULT;
pAd->BbpForCCK = FALSE;
+ // Default is FALSE for test bit 1
+ //pAd->bTest1 = FALSE;
+
// initialize MAC table and allocate spin lock
NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE));
InitializeQueueHeader(&pAd->MacTab.McastPsQueue);
NdisAllocateSpinLock(&pAd->MacTabLock);
+ //RTMPInitTimer(pAd, &pAd->RECBATimer, RECBATimerTimeout, pAd, TRUE);
+ //RTMPSetTimer(&pAd->RECBATimer, REORDER_EXEC_INTV);
+
+
+
pAd->CommonCfg.bWiFiTest = FALSE;
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
pAd->bPCIclkOff = FALSE;
+#endif // RTMP_MAC_PCI //
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#endif
+RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
DBGPRINT(RT_DEBUG_TRACE, ("<-- UserCfgInit\n"));
}
// IRQL = PASSIVE_LEVEL
-UCHAR BtoH(char ch)
+UCHAR BtoH(STRING ch)
{
if (ch >= '0' && ch <= '9') return (ch - '0'); // Handle numerals
if (ch >= 'A' && ch <= 'F') return (ch - 'A' + 0xA); // Handle capitol hex digits
@@ -3564,9 +2900,9 @@ UCHAR BtoH(char ch)
//
// IRQL = PASSIVE_LEVEL
-void AtoH(char * src, UCHAR * dest, int destlen)
+void AtoH(PSTRING src, PUCHAR dest, int destlen)
{
- char * srcptr;
+ PSTRING srcptr;
PUCHAR destTemp;
srcptr = src;
@@ -3580,24 +2916,10 @@ void AtoH(char * src, UCHAR * dest, int destlen)
}
}
-VOID RTMPPatchMacBbpBug(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG Index;
- // Initialize BBP register to default value
- for (Index = 0; Index < NUM_BBP_REG_PARMS; Index++)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[Index].Register, (UCHAR)BBPRegTable[Index].Value);
- }
+//+++Mark by shiang, not use now, need to remove after confirm
+//---Mark by shiang, not use now, need to remove after confirm
- // Initialize RF register to default value
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- // Re-init BBP register from EEPROM value
- NICInitAsicFromEEPROM(pAd);
-}
/*
========================================================================
@@ -3636,9 +2958,9 @@ VOID RTMPInitTimer(
pTimer->State = FALSE;
pTimer->cookie = (ULONG) pData;
-#ifdef RT2870
+#ifdef RTMP_TIMER_TASK_SUPPORT
pTimer->pAd = pAd;
-#endif // RT2870 //
+#endif // RTMP_TIMER_TASK_SUPPORT //
RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (PVOID) pTimer);
}
@@ -3760,24 +3082,20 @@ VOID RTMPCancelTimer(
{
if (pTimer->State == FALSE)
pTimer->Repeat = FALSE;
+
RTMP_OS_Del_Timer(&pTimer->TimerObj, pCancelled);
if (*pCancelled == TRUE)
pTimer->State = TRUE;
-#ifdef RT2870
+#ifdef RTMP_TIMER_TASK_SUPPORT
// We need to go-through the TimerQ to findout this timer handler and remove it if
// it's still waiting for execution.
-
- RT2870_TimerQ_Remove(pTimer->pAd, pTimer);
-#endif // RT2870 //
+ RtmpTimerQRemove(pTimer->pAd, pTimer);
+#endif // RTMP_TIMER_TASK_SUPPORT //
}
else
{
- //
- // NdisMCancelTimer just canced the timer and not mean release the timer.
- // And don't set the "Valid" to False. So that we can use this timer again.
- //
DBGPRINT_ERR(("RTMPCancelTimer failed, Timer hasn't been initialize!\n"));
}
}
@@ -3816,7 +3134,7 @@ VOID RTMPSetLED(
case LED_LINK_DOWN:
HighByte = 0x20;
AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- pAd->LedIndicatorStregth = 0;
+ pAd->LedIndicatorStrength = 0;
break;
case LED_LINK_UP:
if (pAd->CommonCfg.Channel > 14)
@@ -3895,14 +3213,8 @@ VOID RTMPSetSignalLED(
{
UCHAR nLed = 0;
- //
- // if not Signal Stregth, then do nothing.
- //
- if (pAd->LedCntl.field.LedMode != LED_MODE_SIGNAL_STREGTH)
+ if (pAd->LedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH)
{
- return;
- }
-
if (Dbm <= -90)
nLed = 0;
else if (Dbm <= -81)
@@ -3919,10 +3231,11 @@ VOID RTMPSetSignalLED(
//
// Update Signal Stregth to firmware if changed.
//
- if (pAd->LedIndicatorStregth != nLed)
+ if (pAd->LedIndicatorStrength != nLed)
{
AsicSendCommandToMcu(pAd, 0x51, 0xff, nLed, pAd->LedCntl.field.Polarity);
- pAd->LedIndicatorStregth = nLed;
+ pAd->LedIndicatorStrength = nLed;
+ }
}
}
@@ -3947,6 +3260,10 @@ VOID RTMPSetSignalLED(
VOID RTMPEnableRxTx(
IN PRTMP_ADAPTER pAd)
{
+// WPDMA_GLO_CFG_STRUC GloCfg;
+// ULONG i = 0;
+ UINT32 rx_filter_flag;
+
DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n"));
// Enable Rx DMA.
@@ -3955,14 +3272,18 @@ VOID RTMPEnableRxTx(
// enable RX of MAC block
if (pAd->OpMode == OPMODE_AP)
{
- UINT32 rx_filter_flag = APNORMAL;
+ rx_filter_flag = APNORMAL;
RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, rx_filter_flag); // enable RX of DMA block
}
else
{
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, STANORMAL); // Staion not drop control frame will fail WiFi Certification.
+ if (pAd->CommonCfg.PSPXlink)
+ rx_filter_flag = PSPXLINK;
+ else
+ rx_filter_flag = STANORMAL; // Staion not drop control frame will fail WiFi Certification.
+ RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, rx_filter_flag);
}
RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0xc);
@@ -3970,3 +3291,390 @@ VOID RTMPEnableRxTx(
}
+//+++Add by shiang, move from os/linux/rt_main_dev.c
+void CfgInitHook(PRTMP_ADAPTER pAd)
+{
+ pAd->bBroadComHT = TRUE;
+}
+
+
+int rt28xx_init(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING pDefaultMac,
+ IN PSTRING pHostName)
+{
+ UINT index;
+ UCHAR TmpPhy;
+ NDIS_STATUS Status;
+ UINT32 MacCsr0 = 0;
+
+
+#ifdef RTMP_MAC_PCI
+ {
+ // If dirver doesn't wake up firmware here,
+ // NICLoadFirmware will hang forever when interface is up again.
+ // RT2860 PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) &&
+ OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
+ {
+ AUTO_WAKEUP_STRUC AutoWakeupCfg;
+ AsicForceWakeup(pAd, TRUE);
+ AutoWakeupCfg.word = 0;
+ RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
+ }
+ }
+#endif // RTMP_MAC_PCI //
+
+
+ // reset Adapter flags
+ RTMP_CLEAR_FLAGS(pAd);
+
+ // Init BssTab & ChannelInfo tabbles for auto channel select.
+
+ // Allocate BA Reordering memory
+ ba_reordering_resource_init(pAd, MAX_REORDERING_MPDU_NUM);
+
+ // Make sure MAC gets ready.
+ index = 0;
+ do
+ {
+ RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
+ pAd->MACVersion = MacCsr0;
+
+ if ((pAd->MACVersion != 0x00) && (pAd->MACVersion != 0xFFFFFFFF))
+ break;
+
+ RTMPusecDelay(10);
+ } while (index++ < 100);
+ DBGPRINT(RT_DEBUG_TRACE, ("MAC_CSR0 [ Ver:Rev=0x%08x]\n", pAd->MACVersion));
+
+#ifdef RTMP_MAC_PCI
+#ifdef PCIE_PS_SUPPORT
+ /*Iverson patch PCIE L1 issue to make sure that driver can be read,write ,BBP and RF register at pcie L.1 level */
+ if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))&&OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
+ {
+ RTMP_IO_READ32(pAd, AUX_CTRL, &MacCsr0);
+ MacCsr0 |= 0x402;
+ RTMP_IO_WRITE32(pAd, AUX_CTRL, MacCsr0);
+ DBGPRINT(RT_DEBUG_TRACE, ("AUX_CTRL = 0x%x\n", MacCsr0));
+ }
+#endif // PCIE_PS_SUPPORT //
+
+ // To fix driver disable/enable hang issue when radio off
+ RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x2);
+#endif // RTMP_MAC_PCI //
+
+ // Disable DMA
+ RT28XXDMADisable(pAd);
+
+
+ // Load 8051 firmware
+ Status = NICLoadFirmware(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT_ERR(("NICLoadFirmware failed, Status[=0x%08x]\n", Status));
+ goto err1;
+ }
+
+ NICLoadRateSwitchingParams(pAd);
+
+ // Disable interrupts here which is as soon as possible
+ // This statement should never be true. We might consider to remove it later
+#ifdef RTMP_MAC_PCI
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
+ {
+ RTMP_ASIC_INTERRUPT_DISABLE(pAd);
+ }
+#endif // RTMP_MAC_PCI //
+
+ Status = RTMPAllocTxRxRingMemory(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT_ERR(("RTMPAllocDMAMemory failed, Status[=0x%08x]\n", Status));
+ goto err1;
+ }
+
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
+
+ // initialize MLME
+ //
+
+ Status = RtmpMgmtTaskInit(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ goto err2;
+
+ Status = MlmeInit(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT_ERR(("MlmeInit failed, Status[=0x%08x]\n", Status));
+ goto err2;
+ }
+
+ // Initialize pAd->StaCfg, pAd->ApCfg, pAd->CommonCfg to manufacture default
+ //
+ UserCfgInit(pAd);
+ Status = RtmpNetTaskInit(pAd);
+ if (Status != NDIS_STATUS_SUCCESS)
+ goto err3;
+
+// COPY_MAC_ADDR(pAd->ApCfg.MBSSID[apidx].Bssid, netif->hwaddr);
+// pAd->bForcePrintTX = TRUE;
+
+ CfgInitHook(pAd);
+
+ NdisAllocateSpinLock(&pAd->MacTabLock);
+
+ MeasureReqTabInit(pAd);
+ TpcReqTabInit(pAd);
+
+ //
+ // Init the hardware, we need to init asic before read registry, otherwise mac register will be reset
+ //
+ Status = NICInitializeAdapter(pAd, TRUE);
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT_ERR(("NICInitializeAdapter failed, Status[=0x%08x]\n", Status));
+ if (Status != NDIS_STATUS_SUCCESS)
+ goto err3;
+ }
+
+ // Read parameters from Config File
+ Status = RTMPReadParametersHook(pAd);
+
+ DBGPRINT(RT_DEBUG_OFF, ("1. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
+ if (Status != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT_ERR(("NICReadRegParameters failed, Status[=0x%08x]\n",Status));
+// goto err4;
+ Status = 0;
+ }
+
+#ifdef RTMP_MAC_USB
+ pAd->CommonCfg.bMultipleIRP = FALSE;
+
+ if (pAd->CommonCfg.bMultipleIRP)
+ pAd->CommonCfg.NumOfBulkInIRP = RX_RING_SIZE;
+ else
+ pAd->CommonCfg.NumOfBulkInIRP = 1;
+#endif // RTMP_MAC_USB //
+
+ //Init Ba Capability parameters.
+// RT28XX_BA_INIT(pAd);
+ pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
+ pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable;
+ pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
+ pAd->CommonCfg.DesiredHtPhy.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
+ // UPdata to HT IE
+ pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
+ pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
+ pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
+
+ // after reading Registry, we now know if in AP mode or STA mode
+
+ // Load 8051 firmware; crash when FW image not existent
+ // Status = NICLoadFirmware(pAd);
+ // if (Status != NDIS_STATUS_SUCCESS)
+ // break;
+
+ DBGPRINT(RT_DEBUG_OFF, ("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
+
+ // We should read EEPROM for all cases. rt2860b
+ NICReadEEPROMParameters(pAd, (PUCHAR)pDefaultMac);
+
+ DBGPRINT(RT_DEBUG_OFF, ("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
+
+ NICInitAsicFromEEPROM(pAd); //rt2860b
+
+ // Set PHY to appropriate mode
+ TmpPhy = pAd->CommonCfg.PhyMode;
+ pAd->CommonCfg.PhyMode = 0xff;
+ RTMPSetPhyMode(pAd, TmpPhy);
+ SetCommonHT(pAd);
+
+ // No valid channels.
+ if (pAd->ChannelListNum == 0)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Wrong configuration. No valid channel found. Check \"ContryCode\" and \"ChannelGeography\" setting.\n"));
+ goto err4;
+ }
+
+ DBGPRINT(RT_DEBUG_OFF, ("MCS Set = %02x %02x %02x %02x %02x\n", pAd->CommonCfg.HtCapability.MCSSet[0],
+ pAd->CommonCfg.HtCapability.MCSSet[1], pAd->CommonCfg.HtCapability.MCSSet[2],
+ pAd->CommonCfg.HtCapability.MCSSet[3], pAd->CommonCfg.HtCapability.MCSSet[4]));
+
+#ifdef RTMP_RF_RW_SUPPORT
+ //Init RT30xx RFRegisters after read RFIC type from EEPROM
+ NICInitRFRegisters(pAd);
+#endif // RTMP_RF_RW_SUPPORT //
+
+// APInitialize(pAd);
+
+
+ //
+ // Initialize RF register to default value
+ //
+ AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
+ AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+
+ // 8051 firmware require the signal during booting time.
+ //2008/11/28:KH marked the following codes to patch Frequency offset bug
+ //AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00);
+
+ if (pAd && (Status != NDIS_STATUS_SUCCESS))
+ {
+ //
+ // Undo everything if it failed
+ //
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
+ {
+// NdisMDeregisterInterrupt(&pAd->Interrupt);
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
+ }
+// RTMPFreeAdapter(pAd); // we will free it in disconnect()
+ }
+ else if (pAd)
+ {
+ // Microsoft HCT require driver send a disconnect event after driver initialization.
+ OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
+// pAd->IndicateMediaState = NdisMediaStateDisconnected;
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n"));
+
+#ifdef RTMP_MAC_USB
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS);
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
+
+ //
+ // Support multiple BulkIn IRP,
+ // the value on pAd->CommonCfg.NumOfBulkInIRP may be large than 1.
+ //
+ for(index=0; index<pAd->CommonCfg.NumOfBulkInIRP; index++)
+ {
+ RTUSBBulkReceive(pAd);
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBBulkReceive!\n" ));
+ }
+#endif // RTMP_MAC_USB //
+ }// end of else
+
+
+ // Set up the Mac address
+ RtmpOSNetDevAddrSet(pAd->net_dev, &pAd->CurrentAddress[0]);
+
+ DBGPRINT_S(Status, ("<==== rt28xx_init, Status=%x\n", Status));
+
+ return TRUE;
+
+
+err4:
+err3:
+ MlmeHalt(pAd);
+err2:
+ RTMPFreeTxRxRingMemory(pAd);
+err1:
+
+ os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool
+
+ // shall not set priv to NULL here because the priv didn't been free yet.
+ //net_dev->ml_priv = 0;
+#ifdef ST
+err0:
+#endif // ST //
+
+ DBGPRINT(RT_DEBUG_ERROR, ("!!! rt28xx Initialized fail !!!\n"));
+ return FALSE;
+}
+//---Add by shiang, move from os/linux/rt_main_dev.c
+
+
+static INT RtmpChipOpsRegister(
+ IN RTMP_ADAPTER *pAd,
+ IN INT infType)
+{
+ RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
+ int status;
+
+ memset(pChipOps, 0, sizeof(RTMP_CHIP_OP));
+
+ /* set eeprom related hook functions */
+ status = RtmpChipOpsEepromHook(pAd, infType);
+
+ /* set mcu related hook functions */
+ switch(infType)
+ {
+#ifdef RTMP_PCI_SUPPORT
+ case RTMP_DEV_INF_PCI:
+ pChipOps->loadFirmware = RtmpAsicLoadFirmware;
+ pChipOps->eraseFirmware = RtmpAsicEraseFirmware;
+ pChipOps->sendCommandToMcu = RtmpAsicSendCommandToMcu;
+ break;
+#endif // RTMP_PCI_SUPPORT //
+#ifdef RTMP_USB_SUPPORT
+ case RTMP_DEV_INF_USB:
+ pChipOps->loadFirmware = RtmpAsicLoadFirmware;
+ pChipOps->sendCommandToMcu = RtmpAsicSendCommandToMcu;
+ break;
+#endif // RTMP_USB_SUPPORT //
+ default:
+ break;
+ }
+
+ return status;
+}
+
+
+INT RtmpRaDevCtrlInit(
+ IN RTMP_ADAPTER *pAd,
+ IN RTMP_INF_TYPE infType)
+{
+ //VOID *handle;
+
+ // Assign the interface type. We need use it when do register/EEPROM access.
+ pAd->infType = infType;
+
+
+ pAd->OpMode = OPMODE_STA;
+ DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
+
+#ifdef RTMP_MAC_USB
+ init_MUTEX(&(pAd->UsbVendorReq_semaphore));
+ os_alloc_mem(pAd, (PUCHAR)&pAd->UsbVendorReqBuf, MAX_PARAM_BUFFER_SIZE - 1);
+ if (pAd->UsbVendorReqBuf == NULL)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Allocate vendor request temp buffer failed!\n"));
+ return FALSE;
+ }
+#endif // RTMP_MAC_USB //
+
+ RtmpChipOpsRegister(pAd, infType);
+
+
+ return 0;
+}
+
+
+BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER *pAd)
+{
+
+
+ RTMPFreeAdapter(pAd);
+
+ return TRUE;
+}
+
+
+// not yet support MBSS
+PNET_DEV get_netdev_from_bssid(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR FromWhichBSSID)
+{
+ PNET_DEV dev_p = NULL;
+
+ {
+ dev_p = pAd->net_dev;
+ }
+
+ ASSERT(dev_p);
+ return dev_p; /* return one of MBSS */
+}
diff --git a/drivers/staging/rt2860/common/rtmp_mcu.c b/drivers/staging/rt2860/common/rtmp_mcu.c
new file mode 100644
index 000000000000..229ea05e9336
--- /dev/null
+++ b/drivers/staging/rt2860/common/rtmp_mcu.c
@@ -0,0 +1,311 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+
+ Module Name:
+ rtmp_mcu.c
+
+ Abstract:
+ Miniport generic portion header file
+
+ Revision History:
+ Who When What
+ -------- ---------- ----------------------------------------------
+*/
+
+
+#include "../rt_config.h"
+
+#if defined(RT2860) || defined(RT3090)
+#include "firmware.h"
+#include "../../rt3090/firmware.h"
+#endif
+#ifdef RT2870
+#include "../../rt3070/firmware.h"
+#include "firmware_3070.h"
+#endif
+
+#include <linux/bitrev.h>
+
+//#define BIN_IN_FILE /* use *.bin firmware */
+
+#ifdef RTMP_MAC_USB
+//
+// RT2870 Firmware Spec only used 1 oct for version expression
+//
+#define FIRMWARE_MINOR_VERSION 7
+#endif // RTMP_MAC_USB //
+
+// New 8k byte firmware size for RT3071/RT3072
+#define FIRMWAREIMAGE_MAX_LENGTH 0x2000
+#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(UCHAR))
+#define FIRMWARE_MAJOR_VERSION 0
+
+#define FIRMWAREIMAGEV1_LENGTH 0x1000
+#define FIRMWAREIMAGEV2_LENGTH 0x1000
+
+#ifdef RTMP_MAC_PCI
+#define FIRMWARE_MINOR_VERSION 2
+#endif // RTMP_MAC_PCI //
+
+/*
+ ========================================================================
+
+ Routine Description:
+ erase 8051 firmware image in MAC ASIC
+
+ Arguments:
+ Adapter Pointer to our adapter
+
+ IRQL = PASSIVE_LEVEL
+
+ ========================================================================
+*/
+INT RtmpAsicEraseFirmware(
+ IN PRTMP_ADAPTER pAd)
+{
+ ULONG i;
+
+ for(i=0; i<MAX_FIRMWARE_IMAGE_SIZE; i+=4)
+ RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0);
+
+ return 0;
+}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Load 8051 firmware file into MAC ASIC
+
+ Arguments:
+ Adapter Pointer to our adapter
+
+ Return Value:
+ NDIS_STATUS_SUCCESS firmware image load ok
+ NDIS_STATUS_FAILURE image not found
+
+ IRQL = PASSIVE_LEVEL
+
+ ========================================================================
+*/
+NDIS_STATUS RtmpAsicLoadFirmware(
+ IN PRTMP_ADAPTER pAd)
+{
+
+ NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
+ PUCHAR pFirmwareImage = NULL;
+ ULONG FileLength, Index;
+ UINT32 MacReg = 0;
+ UINT32 Version = (pAd->MACVersion >> 16);
+
+ // New 8k byte firmware size for RT3071/RT3072
+ {
+#ifdef RTMP_MAC_PCI
+ if (IS_RT3090(pAd) || IS_RT3390(pAd)) {
+ pFirmwareImage = FirmwareImage_3090;
+ FileLength = FIRMWAREIMAGE_MAX_LENGTH;
+ } else {
+ pFirmwareImage = FirmwareImage_2860;
+ FileLength = FIRMWAREIMAGE_MAX_LENGTH;
+ }
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ /* the firmware image consists of two parts */
+ if ((Version != 0x2860) && (Version != 0x2872) && (Version != 0x3070))
+ { /* use the second part */
+ //printk("KH:Use New Version,part2\n");
+ pFirmwareImage = (PUCHAR)&FirmwareImage_3070[FIRMWAREIMAGEV1_LENGTH];
+ FileLength = FIRMWAREIMAGEV2_LENGTH;
+ }
+ else
+ {
+ //printk("KH:Use New Version,part1\n");
+ if (Version == 0x3070)
+ pFirmwareImage = FirmwareImage_3070;
+ else
+ pFirmwareImage = FirmwareImage_2870;
+ FileLength = FIRMWAREIMAGEV1_LENGTH;
+ }
+#endif // RTMP_MAC_USB //
+ }
+
+ RTMP_WRITE_FIRMWARE(pAd, pFirmwareImage, FileLength);
+
+
+ /* check if MCU is ready */
+ Index = 0;
+ do
+ {
+ RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &MacReg);
+
+ if (MacReg & 0x80)
+ break;
+
+ RTMPusecDelay(1000);
+ } while (Index++ < 1000);
+
+ if (Index > 1000)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));
+ Status = NDIS_STATUS_FAILURE;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== %s (status=%d)\n", __func__, Status));
+
+ return Status;
+}
+
+
+INT RtmpAsicSendCommandToMcu(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Command,
+ IN UCHAR Token,
+ IN UCHAR Arg0,
+ IN UCHAR Arg1)
+{
+ HOST_CMD_CSR_STRUC H2MCmd;
+ H2M_MAILBOX_STRUC H2MMailbox;
+ ULONG i = 0;
+
+#ifdef PCIE_PS_SUPPORT
+ // 3090F power solution 3 has hw limitation that needs to ban all mcu command
+ // when firmware is in radio state. For other chip doesn't have this limitation.
+ if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
+ && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
+ && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
+ {
+ RTMP_SEM_LOCK(&pAd->McuCmdLock);
+ if ((pAd->brt30xxBanMcuCmd == TRUE)
+ && (Command != WAKE_MCU_CMD) && (Command != RFOFF_MCU_CMD))
+ {
+ RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
+ DBGPRINT(RT_DEBUG_TRACE, (" Ban Mcu Cmd %x in sleep mode\n", Command));
+ return FALSE;
+ }
+ else if ((Command == SLEEP_MCU_CMD)
+ ||(Command == RFOFF_MCU_CMD))
+ {
+ pAd->brt30xxBanMcuCmd = TRUE;
+ }
+ else if (Command != WAKE_MCU_CMD)
+ {
+ pAd->brt30xxBanMcuCmd = FALSE;
+ }
+
+ RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
+
+ }
+ if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
+ && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
+ && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
+ && (Command == WAKE_MCU_CMD))
+ {
+
+ do
+ {
+ RTMP_IO_FORCE_READ32(pAd, H2M_MAILBOX_CSR, &H2MMailbox.word);
+ if (H2MMailbox.field.Owner == 0)
+ break;
+
+ RTMPusecDelay(2);
+ DBGPRINT(RT_DEBUG_INFO, ("AsicSendCommanToMcu::Mail box is busy\n"));
+ } while(i++ < 100);
+
+ if (i >= 100)
+ {
+ DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
+ return FALSE;
+ }
+
+ H2MMailbox.field.Owner = 1; // pass ownership to MCU
+ H2MMailbox.field.CmdToken = Token;
+ H2MMailbox.field.HighByte = Arg1;
+ H2MMailbox.field.LowByte = Arg0;
+ RTMP_IO_FORCE_WRITE32(pAd, H2M_MAILBOX_CSR, H2MMailbox.word);
+
+ H2MCmd.word = 0;
+ H2MCmd.field.HostCommand = Command;
+ RTMP_IO_FORCE_WRITE32(pAd, HOST_CMD_CSR, H2MCmd.word);
+
+
+ }
+ else
+#endif // PCIE_PS_SUPPORT //
+ {
+ do
+ {
+ RTMP_IO_READ32(pAd, H2M_MAILBOX_CSR, &H2MMailbox.word);
+ if (H2MMailbox.field.Owner == 0)
+ break;
+
+ RTMPusecDelay(2);
+ } while(i++ < 100);
+
+ if (i > 100)
+ {
+#ifdef RTMP_MAC_PCI
+#endif // RTMP_MAC_PCI //
+ {
+ DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
+ }
+ return FALSE;
+ }
+
+#ifdef RTMP_MAC_PCI
+#endif // RTMP_MAC_PCI //
+
+ H2MMailbox.field.Owner = 1; // pass ownership to MCU
+ H2MMailbox.field.CmdToken = Token;
+ H2MMailbox.field.HighByte = Arg1;
+ H2MMailbox.field.LowByte = Arg0;
+ RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, H2MMailbox.word);
+
+ H2MCmd.word = 0;
+ H2MCmd.field.HostCommand = Command;
+ RTMP_IO_WRITE32(pAd, HOST_CMD_CSR, H2MCmd.word);
+
+ if (Command != 0x80)
+ {
+ }
+}
+#ifdef PCIE_PS_SUPPORT
+ // 3090 MCU Wakeup command needs more time to be stable.
+ // Before stable, don't issue other MCU command to prevent from firmware error.
+ if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
+ && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
+ && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
+ && (Command == WAKE_MCU_CMD))
+ {
+ RTMPusecDelay(2000);
+ //Put this is after RF programming.
+ //NdisAcquireSpinLock(&pAd->McuCmdLock);
+ //pAd->brt30xxBanMcuCmd = FALSE;
+ //NdisReleaseSpinLock(&pAd->McuCmdLock);
+ }
+#endif // PCIE_PS_SUPPORT //
+
+ return TRUE;
+}
diff --git a/drivers/staging/rt3090/common/rtmp_timer.c b/drivers/staging/rt2860/common/rtmp_timer.c
index 5253e8768145..fa77f5d26c73 100644
--- a/drivers/staging/rt3090/common/rtmp_timer.c
+++ b/drivers/staging/rt2860/common/rtmp_timer.c
@@ -46,9 +46,10 @@ BUILD_TIMER_FUNCTION(MlmePeriodicExec);
BUILD_TIMER_FUNCTION(AsicRxAntEvalTimeout);
BUILD_TIMER_FUNCTION(APSDPeriodicExec);
BUILD_TIMER_FUNCTION(AsicRfTuningExec);
+#ifdef RTMP_MAC_USB
+BUILD_TIMER_FUNCTION(BeaconUpdateExec);
+#endif // RTMP_MAC_USB //
-
-#ifdef CONFIG_STA_SUPPORT
BUILD_TIMER_FUNCTION(BeaconTimeout);
BUILD_TIMER_FUNCTION(ScanTimeout);
BUILD_TIMER_FUNCTION(AuthTimeout);
@@ -62,14 +63,9 @@ BUILD_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
BUILD_TIMER_FUNCTION(PsPollWakeExec);
BUILD_TIMER_FUNCTION(RadioOnExec);
#endif // RTMP_MAC_PCI //
-#ifdef QOS_DLS_SUPPORT
-BUILD_TIMER_FUNCTION(DlsTimeoutAction);
-#endif // QOS_DLS_SUPPORT //
-
-
-#endif // CONFIG_STA_SUPPORT //
-
-
+#ifdef RTMP_MAC_USB
+BUILD_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout);
+#endif // RTMP_MAC_USB //
#if defined(AP_LED) || defined(STA_LED)
extern void LedCtrlMain(
@@ -162,7 +158,7 @@ INT RtmpTimerQThread(
RtmpTimerQHandle(pAd);
- DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__));
#ifndef KTHREAD_SUPPORT
pTask->taskPID = THREAD_PID_INIT_VALUE;
#endif
diff --git a/drivers/staging/rt2860/common/rtmp_tkip.c b/drivers/staging/rt2860/common/rtmp_tkip.c
deleted file mode 100644
index 4a7fda69f9b4..000000000000
--- a/drivers/staging/rt2860/common/rtmp_tkip.c
+++ /dev/null
@@ -1,1586 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_tkip.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Wu 02-25-02 Initial
-*/
-
-#include "../rt_config.h"
-
-// Rotation functions on 32 bit values
-#define ROL32( A, n ) \
- ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
-#define ROR32( A, n ) ROL32( (A), 32-(n) )
-
-UINT Tkip_Sbox_Lower[256] =
-{
- 0xA5,0x84,0x99,0x8D,0x0D,0xBD,0xB1,0x54,
- 0x50,0x03,0xA9,0x7D,0x19,0x62,0xE6,0x9A,
- 0x45,0x9D,0x40,0x87,0x15,0xEB,0xC9,0x0B,
- 0xEC,0x67,0xFD,0xEA,0xBF,0xF7,0x96,0x5B,
- 0xC2,0x1C,0xAE,0x6A,0x5A,0x41,0x02,0x4F,
- 0x5C,0xF4,0x34,0x08,0x93,0x73,0x53,0x3F,
- 0x0C,0x52,0x65,0x5E,0x28,0xA1,0x0F,0xB5,
- 0x09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x0D,0x0F,
- 0xE0,0x7C,0x71,0xCC,0x90,0x06,0xF7,0x1C,
- 0xC2,0x6A,0xAE,0x69,0x17,0x99,0x3A,0x27,
- 0xD9,0xEB,0x2B,0x22,0xD2,0xA9,0x07,0x33,
- 0x2D,0x3C,0x15,0xC9,0x87,0xAA,0x50,0xA5,
- 0x03,0x59,0x09,0x1A,0x65,0xD7,0x84,0xD0,
- 0x82,0x29,0x5A,0x1E,0x7B,0xA8,0x6D,0x2C
-};
-
-/*****************************/
-/******** SBOX Table *********/
-/*****************************/
-
-UCHAR SboxTable[256] =
-{
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
- 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
- 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc,
- 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a,
- 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,
- 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b,
- 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85,
- 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,
- 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17,
- 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88,
- 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c,
- 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9,
- 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
- 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
- 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
- 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
- 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
-};
-
-VOID xor_32(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out);
-
-VOID xor_128(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out);
-
-VOID next_key(
- IN PUCHAR key,
- IN INT round);
-
-VOID byte_sub(
- IN PUCHAR in,
- OUT PUCHAR out);
-
-VOID shift_row(
- IN PUCHAR in,
- OUT PUCHAR out);
-
-VOID mix_column(
- IN PUCHAR in,
- OUT PUCHAR out);
-
-UCHAR RTMPCkipSbox(
- IN UCHAR a);
-//
-// Expanded IV for TKIP function.
-//
-typedef struct PACKED _IV_CONTROL_
-{
- union PACKED
- {
- struct PACKED
- {
- UCHAR rc0;
- UCHAR rc1;
- UCHAR rc2;
-
- union PACKED
- {
- struct PACKED
- {
- UCHAR Rsvd:5;
- UCHAR ExtIV:1;
- UCHAR KeyID:2;
- } field;
- UCHAR Byte;
- } CONTROL;
- } field;
-
- ULONG word;
- } IV16;
-
- ULONG IV32;
-} TKIP_IV, *PTKIP_IV;
-
-
-/*
- ========================================================================
-
- Routine Description:
- Convert from UCHAR[] to ULONG in a portable way
-
- Arguments:
- pMICKey pointer to MIC Key
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-ULONG RTMPTkipGetUInt32(
- IN PUCHAR pMICKey)
-{
- ULONG res = 0;
- INT i;
-
- for (i = 0; i < 4; i++)
- {
- res |= (*pMICKey++) << (8 * i);
- }
-
- return res;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Convert from ULONG to UCHAR[] in a portable way
-
- Arguments:
- pDst pointer to destination for convert ULONG to UCHAR[]
- val the value for convert
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPTkipPutUInt32(
- IN OUT PUCHAR pDst,
- IN ULONG val)
-{
- INT i;
-
- for(i = 0; i < 4; i++)
- {
- *pDst++ = (UCHAR) (val & 0xff);
- val >>= 8;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Set the MIC Key.
-
- Arguments:
- pAd Pointer to our adapter
- pMICKey pointer to MIC Key
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPTkipSetMICKey(
- IN PTKIP_KEY_INFO pTkip,
- IN PUCHAR pMICKey)
-{
- // Set the key
- pTkip->K0 = RTMPTkipGetUInt32(pMICKey);
- pTkip->K1 = RTMPTkipGetUInt32(pMICKey + 4);
- // and reset the message
- pTkip->L = pTkip->K0;
- pTkip->R = pTkip->K1;
- pTkip->nBytesInM = 0;
- pTkip->M = 0;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Calculate the MIC Value.
-
- Arguments:
- pAd Pointer to our adapter
- uChar Append this uChar
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPTkipAppendByte(
- IN PTKIP_KEY_INFO pTkip,
- IN UCHAR uChar)
-{
- // Append the byte to our word-sized buffer
- pTkip->M |= (uChar << (8* pTkip->nBytesInM));
- pTkip->nBytesInM++;
- // Process the word if it is full.
- if( pTkip->nBytesInM >= 4 )
- {
- pTkip->L ^= pTkip->M;
- pTkip->R ^= ROL32( pTkip->L, 17 );
- pTkip->L += pTkip->R;
- pTkip->R ^= ((pTkip->L & 0xff00ff00) >> 8) | ((pTkip->L & 0x00ff00ff) << 8);
- pTkip->L += pTkip->R;
- pTkip->R ^= ROL32( pTkip->L, 3 );
- pTkip->L += pTkip->R;
- pTkip->R ^= ROR32( pTkip->L, 2 );
- pTkip->L += pTkip->R;
- // Clear the buffer
- pTkip->M = 0;
- pTkip->nBytesInM = 0;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Calculate the MIC Value.
-
- Arguments:
- pAd Pointer to our adapter
- pSrc Pointer to source data for Calculate MIC Value
- Len Indicate the length of the source data
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPTkipAppend(
- IN PTKIP_KEY_INFO pTkip,
- IN PUCHAR pSrc,
- IN UINT nBytes)
-{
- // This is simple
- while(nBytes > 0)
- {
- RTMPTkipAppendByte(pTkip, *pSrc++);
- nBytes--;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Get the MIC Value.
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
- the MIC Value is store in pAd->PrivateInfo.MIC
- ========================================================================
-*/
-VOID RTMPTkipGetMIC(
- IN PTKIP_KEY_INFO pTkip)
-{
- // Append the minimum padding
- RTMPTkipAppendByte(pTkip, 0x5a );
- RTMPTkipAppendByte(pTkip, 0 );
- RTMPTkipAppendByte(pTkip, 0 );
- RTMPTkipAppendByte(pTkip, 0 );
- RTMPTkipAppendByte(pTkip, 0 );
- // and then zeroes until the length is a multiple of 4
- while( pTkip->nBytesInM != 0 )
- {
- RTMPTkipAppendByte(pTkip, 0 );
- }
- // The appendByte function has already computed the result.
- RTMPTkipPutUInt32(pTkip->MIC, pTkip->L);
- RTMPTkipPutUInt32(pTkip->MIC + 4, pTkip->R);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Init Tkip function.
-
- Arguments:
- pAd Pointer to our adapter
- pTKey Pointer to the Temporal Key (TK), TK shall be 128bits.
- KeyId TK Key ID
- pTA Pointer to transmitter address
- pMICKey pointer to MIC Key
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPInitTkipEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN UCHAR KeyId,
- IN PUCHAR pTA,
- IN PUCHAR pMICKey,
- IN PUCHAR pTSC,
- OUT PULONG pIV16,
- OUT PULONG pIV32)
-{
- TKIP_IV tkipIv;
-
- // Prepare 8 bytes TKIP encapsulation for MPDU
- NdisZeroMemory(&tkipIv, sizeof(TKIP_IV));
- tkipIv.IV16.field.rc0 = *(pTSC + 1);
- tkipIv.IV16.field.rc1 = (tkipIv.IV16.field.rc0 | 0x20) & 0x7f;
- tkipIv.IV16.field.rc2 = *pTSC;
- tkipIv.IV16.field.CONTROL.field.ExtIV = 1; // 0: non-extended IV, 1: an extended IV
- tkipIv.IV16.field.CONTROL.field.KeyID = KeyId;
- NdisMoveMemory(&tkipIv.IV32, (pTSC + 2), 4); // Copy IV
-
- *pIV16 = tkipIv.IV16.word;
- *pIV32 = tkipIv.IV32;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Init MIC Value calculation function which include set MIC key &
- calculate first 16 bytes (DA + SA + priority + 0)
-
- Arguments:
- pAd Pointer to our adapter
- pTKey Pointer to the Temporal Key (TK), TK shall be 128bits.
- pDA Pointer to DA address
- pSA Pointer to SA address
- pMICKey pointer to MIC Key
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPInitMICEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN UCHAR UserPriority,
- IN PUCHAR pMICKey)
-{
- ULONG Priority = UserPriority;
-
- // Init MIC value calculation
- RTMPTkipSetMICKey(&pAd->PrivateInfo.Tx, pMICKey);
- // DA
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pDA, MAC_ADDR_LEN);
- // SA
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSA, MAC_ADDR_LEN);
- // Priority + 3 bytes of 0
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, (PUCHAR)&Priority, 4);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Compare MIC value of received MSDU
-
- Arguments:
- pAd Pointer to our adapter
- pSrc Pointer to the received Plain text data
- pDA Pointer to DA address
- pSA Pointer to SA address
- pMICKey pointer to MIC Key
- Len the length of the received plain text data exclude MIC value
-
- Return Value:
- TRUE MIC value matched
- FALSE MIC value mismatched
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-BOOLEAN RTMPTkipCompareMICValue(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UCHAR UserPriority,
- IN UINT Len)
-{
- UCHAR OldMic[8];
- ULONG Priority = UserPriority;
-
- // Init MIC value calculation
- RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey);
- // DA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pDA, MAC_ADDR_LEN);
- // SA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN);
- // Priority + 3 bytes of 0
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, (PUCHAR)&Priority, 4);
-
- // Calculate MIC value from plain text data
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len);
-
- // Get MIC valude from received frame
- NdisMoveMemory(OldMic, pSrc + Len, 8);
-
- // Get MIC value from decrypted plain data
- RTMPTkipGetMIC(&pAd->PrivateInfo.Rx);
-
- // Move MIC value from MSDU, this steps should move to data path.
- // Since the MIC value might cross MPDUs.
- if(!NdisEqualMemory(pAd->PrivateInfo.Rx.MIC, OldMic, 8))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("RTMPTkipCompareMICValue(): TKIP MIC Error !\n")); //MIC error.
-
-
- return (FALSE);
- }
- return (TRUE);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Compare MIC value of received MSDU
-
- Arguments:
- pAd Pointer to our adapter
- pLLC LLC header
- pSrc Pointer to the received Plain text data
- pDA Pointer to DA address
- pSA Pointer to SA address
- pMICKey pointer to MIC Key
- Len the length of the received plain text data exclude MIC value
-
- Return Value:
- TRUE MIC value matched
- FALSE MIC value mismatched
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-BOOLEAN RTMPTkipCompareMICValueWithLLC(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pLLC,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UINT Len)
-{
- UCHAR OldMic[8];
- ULONG Priority = 0;
-
- // Init MIC value calculation
- RTMPTkipSetMICKey(&pAd->PrivateInfo.Rx, pMICKey);
- // DA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pDA, MAC_ADDR_LEN);
- // SA
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSA, MAC_ADDR_LEN);
- // Priority + 3 bytes of 0
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, (PUCHAR)&Priority, 4);
-
- // Start with LLC header
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pLLC, 8);
-
- // Calculate MIC value from plain text data
- RTMPTkipAppend(&pAd->PrivateInfo.Rx, pSrc, Len);
-
- // Get MIC valude from received frame
- NdisMoveMemory(OldMic, pSrc + Len, 8);
-
- // Get MIC value from decrypted plain data
- RTMPTkipGetMIC(&pAd->PrivateInfo.Rx);
-
- // Move MIC value from MSDU, this steps should move to data path.
- // Since the MIC value might cross MPDUs.
- if(!NdisEqualMemory(pAd->PrivateInfo.Rx.MIC, OldMic, 8))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("RTMPTkipCompareMICValueWithLLC(): TKIP MIC Error !\n")); //MIC error.
-
-
- return (FALSE);
- }
- return (TRUE);
-}
-/*
- ========================================================================
-
- Routine Description:
- Copy frame from waiting queue into relative ring buffer and set
- appropriate ASIC register to kick hardware transmit function
-
- Arguments:
- pAd Pointer to our adapter
- PNDIS_PACKET Pointer to Ndis Packet for MIC calculation
- pEncap Pointer to LLC encap data
- LenEncap Total encap length, might be 0 which indicates no encap
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPCalculateMICValue(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pEncap,
- IN PCIPHER_KEY pKey,
- IN UCHAR apidx)
-{
- PACKET_INFO PacketInfo;
- PUCHAR pSrcBufVA;
- UINT SrcBufLen;
- PUCHAR pSrc;
- UCHAR UserPriority;
- UCHAR vlan_offset = 0;
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
-
- UserPriority = RTMP_GET_PACKET_UP(pPacket);
- pSrc = pSrcBufVA;
-
- // determine if this is a vlan packet
- if (((*(pSrc + 12) << 8) + *(pSrc + 13)) == 0x8100)
- vlan_offset = 4;
-
- {
- RTMPInitMICEngine(
- pAd,
- pKey->Key,
- pSrc,
- pSrc + 6,
- UserPriority,
- pKey->TxMic);
- }
-
-
- if (pEncap != NULL)
- {
- // LLC encapsulation
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pEncap, 6);
- // Protocol Type
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSrc + 12 + vlan_offset, 2);
- }
- SrcBufLen -= (14 + vlan_offset);
- pSrc += (14 + vlan_offset);
- do
- {
- if (SrcBufLen > 0)
- {
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pSrc, SrcBufLen);
- }
-
- break; // No need handle next packet
-
- } while (TRUE); // End of copying payload
-
- // Compute the final MIC Value
- RTMPTkipGetMIC(&pAd->PrivateInfo.Tx);
-}
-
-
-/************************************************************/
-/* tkip_sbox() */
-/* Returns a 16 bit value from a 64K entry table. The Table */
-/* is synthesized from two 256 entry byte wide tables. */
-/************************************************************/
-
-UINT tkip_sbox(UINT index)
-{
- UINT index_low;
- UINT index_high;
- UINT left, right;
-
- index_low = (index % 256);
- index_high = ((index >> 8) % 256);
-
- left = Tkip_Sbox_Lower[index_low] + (Tkip_Sbox_Upper[index_low] * 256);
- right = Tkip_Sbox_Upper[index_high] + (Tkip_Sbox_Lower[index_high] * 256);
-
- return (left ^ right);
-}
-
-UINT rotr1(UINT a)
-{
- unsigned int b;
-
- if ((a & 0x01) == 0x01)
- {
- b = (a >> 1) | 0x8000;
- }
- else
- {
- b = (a >> 1) & 0x7fff;
- }
- b = b % 65536;
- return b;
-}
-
-VOID RTMPTkipMixKey(
- UCHAR *key,
- UCHAR *ta,
- ULONG pnl, /* Least significant 16 bits of PN */
- ULONG pnh, /* Most significant 32 bits of PN */
- UCHAR *rc4key,
- UINT *p1k)
-{
-
- UINT tsc0;
- UINT tsc1;
- UINT tsc2;
-
- UINT ppk0;
- UINT ppk1;
- UINT ppk2;
- UINT ppk3;
- UINT ppk4;
- UINT ppk5;
-
- INT i;
- INT j;
-
- tsc0 = (unsigned int)((pnh >> 16) % 65536); /* msb */
- tsc1 = (unsigned int)(pnh % 65536);
- tsc2 = (unsigned int)(pnl % 65536); /* lsb */
-
- /* Phase 1, step 1 */
- p1k[0] = tsc1;
- p1k[1] = tsc0;
- p1k[2] = (UINT)(ta[0] + (ta[1]*256));
- p1k[3] = (UINT)(ta[2] + (ta[3]*256));
- p1k[4] = (UINT)(ta[4] + (ta[5]*256));
-
- /* Phase 1, step 2 */
- for (i=0; i<8; i++)
- {
- j = 2*(i & 1);
- p1k[0] = (p1k[0] + tkip_sbox( (p1k[4] ^ ((256*key[1+j]) + key[j])) % 65536 )) % 65536;
- p1k[1] = (p1k[1] + tkip_sbox( (p1k[0] ^ ((256*key[5+j]) + key[4+j])) % 65536 )) % 65536;
- p1k[2] = (p1k[2] + tkip_sbox( (p1k[1] ^ ((256*key[9+j]) + key[8+j])) % 65536 )) % 65536;
- p1k[3] = (p1k[3] + tkip_sbox( (p1k[2] ^ ((256*key[13+j]) + key[12+j])) % 65536 )) % 65536;
- p1k[4] = (p1k[4] + tkip_sbox( (p1k[3] ^ (((256*key[1+j]) + key[j]))) % 65536 )) % 65536;
- p1k[4] = (p1k[4] + i) % 65536;
- }
-
- /* Phase 2, Step 1 */
- ppk0 = p1k[0];
- ppk1 = p1k[1];
- ppk2 = p1k[2];
- ppk3 = p1k[3];
- ppk4 = p1k[4];
- ppk5 = (p1k[4] + tsc2) % 65536;
-
- /* Phase2, Step 2 */
- ppk0 = ppk0 + tkip_sbox( (ppk5 ^ ((256*key[1]) + key[0])) % 65536);
- ppk1 = ppk1 + tkip_sbox( (ppk0 ^ ((256*key[3]) + key[2])) % 65536);
- ppk2 = ppk2 + tkip_sbox( (ppk1 ^ ((256*key[5]) + key[4])) % 65536);
- ppk3 = ppk3 + tkip_sbox( (ppk2 ^ ((256*key[7]) + key[6])) % 65536);
- ppk4 = ppk4 + tkip_sbox( (ppk3 ^ ((256*key[9]) + key[8])) % 65536);
- ppk5 = ppk5 + tkip_sbox( (ppk4 ^ ((256*key[11]) + key[10])) % 65536);
-
- ppk0 = ppk0 + rotr1(ppk5 ^ ((256*key[13]) + key[12]));
- ppk1 = ppk1 + rotr1(ppk0 ^ ((256*key[15]) + key[14]));
- ppk2 = ppk2 + rotr1(ppk1);
- ppk3 = ppk3 + rotr1(ppk2);
- ppk4 = ppk4 + rotr1(ppk3);
- ppk5 = ppk5 + rotr1(ppk4);
-
- /* Phase 2, Step 3 */
- /* Phase 2, Step 3 */
-
- tsc0 = (unsigned int)((pnh >> 16) % 65536); /* msb */
- tsc1 = (unsigned int)(pnh % 65536);
- tsc2 = (unsigned int)(pnl % 65536); /* lsb */
-
- rc4key[0] = (tsc2 >> 8) % 256;
- rc4key[1] = (((tsc2 >> 8) % 256) | 0x20) & 0x7f;
- rc4key[2] = tsc2 % 256;
- rc4key[3] = ((ppk5 ^ ((256*key[1]) + key[0])) >> 1) % 256;
-
- rc4key[4] = ppk0 % 256;
- rc4key[5] = (ppk0 >> 8) % 256;
-
- rc4key[6] = ppk1 % 256;
- rc4key[7] = (ppk1 >> 8) % 256;
-
- rc4key[8] = ppk2 % 256;
- rc4key[9] = (ppk2 >> 8) % 256;
-
- rc4key[10] = ppk3 % 256;
- rc4key[11] = (ppk3 >> 8) % 256;
-
- rc4key[12] = ppk4 % 256;
- rc4key[13] = (ppk4 >> 8) % 256;
-
- rc4key[14] = ppk5 % 256;
- rc4key[15] = (ppk5 >> 8) % 256;
-}
-
-
-/************************************************/
-/* construct_mic_header1() */
-/* Builds the first MIC header block from */
-/* header fields. */
-/************************************************/
-
-void construct_mic_header1(
- unsigned char *mic_header1,
- int header_length,
- unsigned char *mpdu)
-{
- mic_header1[0] = (unsigned char)((header_length - 2) / 256);
- mic_header1[1] = (unsigned char)((header_length - 2) % 256);
- mic_header1[2] = mpdu[0] & 0xcf; /* Mute CF poll & CF ack bits */
- mic_header1[3] = mpdu[1] & 0xc7; /* Mute retry, more data and pwr mgt bits */
- mic_header1[4] = mpdu[4]; /* A1 */
- mic_header1[5] = mpdu[5];
- mic_header1[6] = mpdu[6];
- mic_header1[7] = mpdu[7];
- mic_header1[8] = mpdu[8];
- mic_header1[9] = mpdu[9];
- mic_header1[10] = mpdu[10]; /* A2 */
- mic_header1[11] = mpdu[11];
- mic_header1[12] = mpdu[12];
- mic_header1[13] = mpdu[13];
- mic_header1[14] = mpdu[14];
- mic_header1[15] = mpdu[15];
-}
-
-/************************************************/
-/* construct_mic_header2() */
-/* Builds the last MIC header block from */
-/* header fields. */
-/************************************************/
-
-void construct_mic_header2(
- unsigned char *mic_header2,
- unsigned char *mpdu,
- int a4_exists,
- int qc_exists)
-{
- int i;
-
- for (i = 0; i<16; i++) mic_header2[i]=0x00;
-
- mic_header2[0] = mpdu[16]; /* A3 */
- mic_header2[1] = mpdu[17];
- mic_header2[2] = mpdu[18];
- mic_header2[3] = mpdu[19];
- mic_header2[4] = mpdu[20];
- mic_header2[5] = mpdu[21];
-
- // In Sequence Control field, mute sequence numer bits (12-bit)
- mic_header2[6] = mpdu[22] & 0x0f; /* SC */
- mic_header2[7] = 0x00; /* mpdu[23]; */
-
- if ((!qc_exists) & a4_exists)
- {
- for (i=0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */
-
- }
-
- if (qc_exists && (!a4_exists))
- {
- mic_header2[8] = mpdu[24] & 0x0f; /* mute bits 15 - 4 */
- mic_header2[9] = mpdu[25] & 0x00;
- }
-
- if (qc_exists && a4_exists)
- {
- for (i=0;i<6;i++) mic_header2[8+i] = mpdu[24+i]; /* A4 */
-
- mic_header2[14] = mpdu[30] & 0x0f;
- mic_header2[15] = mpdu[31] & 0x00;
- }
-}
-
-
-/************************************************/
-/* construct_mic_iv() */
-/* Builds the MIC IV from header fields and PN */
-/************************************************/
-
-void construct_mic_iv(
- unsigned char *mic_iv,
- int qc_exists,
- int a4_exists,
- unsigned char *mpdu,
- unsigned int payload_length,
- unsigned char *pn_vector)
-{
- int i;
-
- mic_iv[0] = 0x59;
- if (qc_exists && a4_exists)
- mic_iv[1] = mpdu[30] & 0x0f; /* QoS_TC */
- if (qc_exists && !a4_exists)
- mic_iv[1] = mpdu[24] & 0x0f; /* mute bits 7-4 */
- if (!qc_exists)
- mic_iv[1] = 0x00;
- for (i = 2; i < 8; i++)
- mic_iv[i] = mpdu[i + 8]; /* mic_iv[2:7] = A2[0:5] = mpdu[10:15] */
-#ifdef CONSISTENT_PN_ORDER
- for (i = 8; i < 14; i++)
- mic_iv[i] = pn_vector[i - 8]; /* mic_iv[8:13] = PN[0:5] */
-#else
- for (i = 8; i < 14; i++)
- mic_iv[i] = pn_vector[13 - i]; /* mic_iv[8:13] = PN[5:0] */
-#endif
- i = (payload_length / 256);
- i = (payload_length % 256);
- mic_iv[14] = (unsigned char) (payload_length / 256);
- mic_iv[15] = (unsigned char) (payload_length % 256);
-
-}
-
-
-
-/************************************/
-/* bitwise_xor() */
-/* A 128 bit, bitwise exclusive or */
-/************************************/
-
-void bitwise_xor(unsigned char *ina, unsigned char *inb, unsigned char *out)
-{
- int i;
- for (i=0; i<16; i++)
- {
- out[i] = ina[i] ^ inb[i];
- }
-}
-
-
-void aes128k128d(unsigned char *key, unsigned char *data, unsigned char *ciphertext)
-{
- int round;
- int i;
- unsigned char intermediatea[16];
- unsigned char intermediateb[16];
- unsigned char round_key[16];
-
- for(i=0; i<16; i++) round_key[i] = key[i];
-
- for (round = 0; round < 11; round++)
- {
- if (round == 0)
- {
- xor_128(round_key, data, ciphertext);
- next_key(round_key, round);
- }
- else if (round == 10)
- {
- byte_sub(ciphertext, intermediatea);
- shift_row(intermediatea, intermediateb);
- xor_128(intermediateb, round_key, ciphertext);
- }
- else /* 1 - 9 */
- {
- byte_sub(ciphertext, intermediatea);
- shift_row(intermediatea, intermediateb);
- mix_column(&intermediateb[0], &intermediatea[0]);
- mix_column(&intermediateb[4], &intermediatea[4]);
- mix_column(&intermediateb[8], &intermediatea[8]);
- mix_column(&intermediateb[12], &intermediatea[12]);
- xor_128(intermediatea, round_key, ciphertext);
- next_key(round_key, round);
- }
- }
-
-}
-
-void construct_ctr_preload(
- unsigned char *ctr_preload,
- int a4_exists,
- int qc_exists,
- unsigned char *mpdu,
- unsigned char *pn_vector,
- int c)
-{
-
- int i = 0;
- for (i=0; i<16; i++) ctr_preload[i] = 0x00;
- i = 0;
-
- ctr_preload[0] = 0x01; /* flag */
- if (qc_exists && a4_exists) ctr_preload[1] = mpdu[30] & 0x0f; /* QoC_Control */
- if (qc_exists && !a4_exists) ctr_preload[1] = mpdu[24] & 0x0f;
-
- for (i = 2; i < 8; i++)
- ctr_preload[i] = mpdu[i + 8]; /* ctr_preload[2:7] = A2[0:5] = mpdu[10:15] */
-#ifdef CONSISTENT_PN_ORDER
- for (i = 8; i < 14; i++)
- ctr_preload[i] = pn_vector[i - 8]; /* ctr_preload[8:13] = PN[0:5] */
-#else
- for (i = 8; i < 14; i++)
- ctr_preload[i] = pn_vector[13 - i]; /* ctr_preload[8:13] = PN[5:0] */
-#endif
- ctr_preload[14] = (unsigned char) (c / 256); // Ctr
- ctr_preload[15] = (unsigned char) (c % 256);
-
-}
-
-
-//
-// TRUE: Success!
-// FALSE: Decrypt Error!
-//
-BOOLEAN RTMPSoftDecryptTKIP(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN UCHAR UserPriority,
- IN PCIPHER_KEY pWpaKey)
-{
- UCHAR KeyID;
- UINT HeaderLen;
- UCHAR fc0;
- UCHAR fc1;
- USHORT fc;
- UINT frame_type;
- UINT frame_subtype;
- UINT from_ds;
- UINT to_ds;
- INT a4_exists;
- INT qc_exists;
- USHORT duration;
- USHORT seq_control;
- USHORT qos_control;
- UCHAR TA[MAC_ADDR_LEN];
- UCHAR DA[MAC_ADDR_LEN];
- UCHAR SA[MAC_ADDR_LEN];
- UCHAR RC4Key[16];
- UINT p1k[5]; //for mix_key;
- ULONG pnl;/* Least significant 16 bits of PN */
- ULONG pnh;/* Most significant 32 bits of PN */
- UINT num_blocks;
- UINT payload_remainder;
- ARCFOURCONTEXT ArcFourContext;
- UINT crc32 = 0;
- UINT trailfcs = 0;
- UCHAR MIC[8];
- UCHAR TrailMIC[8];
-
- fc0 = *pData;
- fc1 = *(pData + 1);
-
- fc = *((PUSHORT)pData);
-
- frame_type = ((fc0 >> 2) & 0x03);
- frame_subtype = ((fc0 >> 4) & 0x0f);
-
- from_ds = (fc1 & 0x2) >> 1;
- to_ds = (fc1 & 0x1);
-
- a4_exists = (from_ds & to_ds);
- qc_exists = ((frame_subtype == 0x08) || /* Assumed QoS subtypes */
- (frame_subtype == 0x09) || /* Likely to change. */
- (frame_subtype == 0x0a) ||
- (frame_subtype == 0x0b)
- );
-
- HeaderLen = 24;
- if (a4_exists)
- HeaderLen += 6;
-
- KeyID = *((PUCHAR)(pData+ HeaderLen + 3));
- KeyID = KeyID >> 6;
-
- if (pWpaKey[KeyID].KeyLen == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSoftDecryptTKIP failed!(KeyID[%d] Length can not be 0)\n", KeyID));
- return FALSE;
- }
-
- duration = *((PUSHORT)(pData+2));
-
- seq_control = *((PUSHORT)(pData+22));
-
- if (qc_exists)
- {
- if (a4_exists)
- {
- qos_control = *((PUSHORT)(pData+30));
- }
- else
- {
- qos_control = *((PUSHORT)(pData+24));
- }
- }
-
- if (to_ds == 0 && from_ds == 1)
- {
- NdisMoveMemory(DA, pData+4, MAC_ADDR_LEN);
- NdisMoveMemory(SA, pData+16, MAC_ADDR_LEN);
- NdisMoveMemory(TA, pData+10, MAC_ADDR_LEN); //BSSID
- }
- else if (to_ds == 0 && from_ds == 0 )
- {
- NdisMoveMemory(TA, pData+10, MAC_ADDR_LEN);
- NdisMoveMemory(DA, pData+4, MAC_ADDR_LEN);
- NdisMoveMemory(SA, pData+10, MAC_ADDR_LEN);
- }
- else if (to_ds == 1 && from_ds == 0)
- {
- NdisMoveMemory(SA, pData+10, MAC_ADDR_LEN);
- NdisMoveMemory(TA, pData+10, MAC_ADDR_LEN);
- NdisMoveMemory(DA, pData+16, MAC_ADDR_LEN);
- }
- else if (to_ds == 1 && from_ds == 1)
- {
- NdisMoveMemory(TA, pData+10, MAC_ADDR_LEN);
- NdisMoveMemory(DA, pData+16, MAC_ADDR_LEN);
- NdisMoveMemory(SA, pData+22, MAC_ADDR_LEN);
- }
-
- num_blocks = (DataByteCnt - 16) / 16;
- payload_remainder = (DataByteCnt - 16) % 16;
-
- pnl = (*(pData + HeaderLen)) * 256 + *(pData + HeaderLen + 2);
- pnh = *((PULONG)(pData + HeaderLen + 4));
- pnh = cpu2le32(pnh);
- RTMPTkipMixKey(pWpaKey[KeyID].Key, TA, pnl, pnh, RC4Key, p1k);
-
- ARCFOUR_INIT(&ArcFourContext, RC4Key, 16);
-
- ARCFOUR_DECRYPT(&ArcFourContext, pData + HeaderLen, pData + HeaderLen + 8, DataByteCnt - HeaderLen - 8);
- NdisMoveMemory(&trailfcs, pData + DataByteCnt - 8 - 4, 4);
- crc32 = RTMP_CALC_FCS32(PPPINITFCS32, pData + HeaderLen, DataByteCnt - HeaderLen - 8 - 4); //Skip IV+EIV 8 bytes & Skip last 4 bytes(FCS).
- crc32 ^= 0xffffffff; /* complement */
-
- if(crc32 != cpu2le32(trailfcs))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSoftDecryptTKIP, WEP Data ICV Error !\n")); //ICV error.
-
- return (FALSE);
- }
-
- NdisMoveMemory(TrailMIC, pData + DataByteCnt - 8 - 8 - 4, 8);
- RTMPInitMICEngine(pAd, pWpaKey[KeyID].Key, DA, SA, UserPriority, pWpaKey[KeyID].RxMic);
- RTMPTkipAppend(&pAd->PrivateInfo.Tx, pData + HeaderLen, DataByteCnt - HeaderLen - 8 - 12);
- RTMPTkipGetMIC(&pAd->PrivateInfo.Tx);
- NdisMoveMemory(MIC, pAd->PrivateInfo.Tx.MIC, 8);
-
- if (!NdisEqualMemory(MIC, TrailMIC, 8))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPSoftDecryptTKIP, WEP Data MIC Error !\n")); //MIC error.
- return (FALSE);
- }
-
- return TRUE;
-}
-
-
-
-
-BOOLEAN RTMPSoftDecryptAES(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN PCIPHER_KEY pWpaKey)
-{
- UCHAR KeyID;
- UINT HeaderLen;
- UCHAR PN[6];
- UINT payload_len;
- UINT num_blocks;
- UINT payload_remainder;
- USHORT fc;
- UCHAR fc0;
- UCHAR fc1;
- UINT frame_type;
- UINT frame_subtype;
- UINT from_ds;
- UINT to_ds;
- INT a4_exists;
- INT qc_exists;
- UCHAR aes_out[16];
- int payload_index;
- UINT i;
- UCHAR ctr_preload[16];
- UCHAR chain_buffer[16];
- UCHAR padded_buffer[16];
- UCHAR mic_iv[16];
- UCHAR mic_header1[16];
- UCHAR mic_header2[16];
- UCHAR MIC[8];
- UCHAR TrailMIC[8];
-
- fc0 = *pData;
- fc1 = *(pData + 1);
-
- fc = *((PUSHORT)pData);
-
- frame_type = ((fc0 >> 2) & 0x03);
- frame_subtype = ((fc0 >> 4) & 0x0f);
-
- from_ds = (fc1 & 0x2) >> 1;
- to_ds = (fc1 & 0x1);
-
- a4_exists = (from_ds & to_ds);
- qc_exists = ((frame_subtype == 0x08) || /* Assumed QoS subtypes */
- (frame_subtype == 0x09) || /* Likely to change. */
- (frame_subtype == 0x0a) ||
- (frame_subtype == 0x0b)
- );
-
- HeaderLen = 24;
- if (a4_exists)
- HeaderLen += 6;
-
- KeyID = *((PUCHAR)(pData+ HeaderLen + 3));
- KeyID = KeyID >> 6;
-
- if (pWpaKey[KeyID].KeyLen == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSoftDecryptAES failed!(KeyID[%d] Length can not be 0)\n", KeyID));
- return FALSE;
- }
-
- PN[0] = *(pData+ HeaderLen);
- PN[1] = *(pData+ HeaderLen + 1);
- PN[2] = *(pData+ HeaderLen + 4);
- PN[3] = *(pData+ HeaderLen + 5);
- PN[4] = *(pData+ HeaderLen + 6);
- PN[5] = *(pData+ HeaderLen + 7);
-
- payload_len = DataByteCnt - HeaderLen - 8 - 8; // 8 bytes for CCMP header , 8 bytes for MIC
- payload_remainder = (payload_len) % 16;
- num_blocks = (payload_len) / 16;
-
-
-
- // Find start of payload
- payload_index = HeaderLen + 8; //IV+EIV
-
- for (i=0; i< num_blocks; i++)
- {
- construct_ctr_preload(ctr_preload,
- a4_exists,
- qc_exists,
- pData,
- PN,
- i+1 );
-
- aes128k128d(pWpaKey[KeyID].Key, ctr_preload, aes_out);
-
- bitwise_xor(aes_out, pData + payload_index, chain_buffer);
- NdisMoveMemory(pData + payload_index - 8, chain_buffer, 16);
- payload_index += 16;
- }
-
- //
- // If there is a short final block, then pad it
- // encrypt it and copy the unpadded part back
- //
- if (payload_remainder > 0)
- {
- construct_ctr_preload(ctr_preload,
- a4_exists,
- qc_exists,
- pData,
- PN,
- num_blocks + 1);
-
- NdisZeroMemory(padded_buffer, 16);
- NdisMoveMemory(padded_buffer, pData + payload_index, payload_remainder);
-
- aes128k128d(pWpaKey[KeyID].Key, ctr_preload, aes_out);
-
- bitwise_xor(aes_out, padded_buffer, chain_buffer);
- NdisMoveMemory(pData + payload_index - 8, chain_buffer, payload_remainder);
- payload_index += payload_remainder;
- }
-
- //
- // Descrypt the MIC
- //
- construct_ctr_preload(ctr_preload,
- a4_exists,
- qc_exists,
- pData,
- PN,
- 0);
- NdisZeroMemory(padded_buffer, 16);
- NdisMoveMemory(padded_buffer, pData + payload_index, 8);
-
- aes128k128d(pWpaKey[KeyID].Key, ctr_preload, aes_out);
-
- bitwise_xor(aes_out, padded_buffer, chain_buffer);
-
- NdisMoveMemory(TrailMIC, chain_buffer, 8);
-
- //
- // Calculate MIC
- //
-
- //Force the protected frame bit on
- *(pData + 1) = *(pData + 1) | 0x40;
-
- // Find start of payload
- // Because the CCMP header has been removed
- payload_index = HeaderLen;
-
- construct_mic_iv(
- mic_iv,
- qc_exists,
- a4_exists,
- pData,
- payload_len,
- PN);
-
- construct_mic_header1(
- mic_header1,
- HeaderLen,
- pData);
-
- construct_mic_header2(
- mic_header2,
- pData,
- a4_exists,
- qc_exists);
-
- aes128k128d(pWpaKey[KeyID].Key, mic_iv, aes_out);
- bitwise_xor(aes_out, mic_header1, chain_buffer);
- aes128k128d(pWpaKey[KeyID].Key, chain_buffer, aes_out);
- bitwise_xor(aes_out, mic_header2, chain_buffer);
- aes128k128d(pWpaKey[KeyID].Key, chain_buffer, aes_out);
-
- // iterate through each 16 byte payload block
- for (i = 0; i < num_blocks; i++)
- {
- bitwise_xor(aes_out, pData + payload_index, chain_buffer);
- payload_index += 16;
- aes128k128d(pWpaKey[KeyID].Key, chain_buffer, aes_out);
- }
-
- // Add on the final payload block if it needs padding
- if (payload_remainder > 0)
- {
- NdisZeroMemory(padded_buffer, 16);
- NdisMoveMemory(padded_buffer, pData + payload_index, payload_remainder);
-
- bitwise_xor(aes_out, padded_buffer, chain_buffer);
- aes128k128d(pWpaKey[KeyID].Key, chain_buffer, aes_out);
- }
- // aes_out contains padded mic, discard most significant
- // 8 bytes to generate 64 bit MIC
- for (i = 0 ; i < 8; i++) MIC[i] = aes_out[i];
-
- if (!NdisEqualMemory(MIC, TrailMIC, 8))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPSoftDecryptAES, MIC Error !\n")); //MIC error.
- return FALSE;
- }
-
- return TRUE;
-}
-
-/****************************************/
-/* aes128k128d() */
-/* Performs a 128 bit AES encrypt with */
-/* 128 bit data. */
-/****************************************/
-VOID xor_128(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0;i<16; i++)
- {
- out[i] = a[i] ^ b[i];
- }
-}
-
-VOID next_key(
- IN PUCHAR key,
- IN INT round)
-{
- UCHAR rcon;
- UCHAR sbox_key[4];
- UCHAR rcon_table[12] =
- {
- 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
- 0x1b, 0x36, 0x36, 0x36
- };
-
- sbox_key[0] = RTMPCkipSbox(key[13]);
- sbox_key[1] = RTMPCkipSbox(key[14]);
- sbox_key[2] = RTMPCkipSbox(key[15]);
- sbox_key[3] = RTMPCkipSbox(key[12]);
-
- rcon = rcon_table[round];
-
- xor_32(&key[0], sbox_key, &key[0]);
- key[0] = key[0] ^ rcon;
-
- xor_32(&key[4], &key[0], &key[4]);
- xor_32(&key[8], &key[4], &key[8]);
- xor_32(&key[12], &key[8], &key[12]);
-}
-
-VOID xor_32(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0;i<4; i++)
- {
- out[i] = a[i] ^ b[i];
- }
-}
-
-VOID byte_sub(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0; i< 16; i++)
- {
- out[i] = RTMPCkipSbox(in[i]);
- }
-}
-
-UCHAR RTMPCkipSbox(
- IN UCHAR a)
-{
- return SboxTable[(int)a];
-}
-
-VOID shift_row(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- out[0] = in[0];
- out[1] = in[5];
- out[2] = in[10];
- out[3] = in[15];
- out[4] = in[4];
- out[5] = in[9];
- out[6] = in[14];
- out[7] = in[3];
- out[8] = in[8];
- out[9] = in[13];
- out[10] = in[2];
- out[11] = in[7];
- out[12] = in[12];
- out[13] = in[1];
- out[14] = in[6];
- out[15] = in[11];
-}
-
-VOID mix_column(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- INT i;
- UCHAR add1b[4];
- UCHAR add1bf7[4];
- UCHAR rotl[4];
- UCHAR swap_halfs[4];
- UCHAR andf7[4];
- UCHAR rotr[4];
- UCHAR temp[4];
- UCHAR tempb[4];
-
- for (i=0 ; i<4; i++)
- {
- if ((in[i] & 0x80)== 0x80)
- add1b[i] = 0x1b;
- else
- add1b[i] = 0x00;
- }
-
- swap_halfs[0] = in[2]; /* Swap halfs */
- swap_halfs[1] = in[3];
- swap_halfs[2] = in[0];
- swap_halfs[3] = in[1];
-
- rotl[0] = in[3]; /* Rotate left 8 bits */
- rotl[1] = in[0];
- rotl[2] = in[1];
- rotl[3] = in[2];
-
- andf7[0] = in[0] & 0x7f;
- andf7[1] = in[1] & 0x7f;
- andf7[2] = in[2] & 0x7f;
- andf7[3] = in[3] & 0x7f;
-
- for (i = 3; i>0; i--) /* logical shift left 1 bit */
- {
- andf7[i] = andf7[i] << 1;
- if ((andf7[i-1] & 0x80) == 0x80)
- {
- andf7[i] = (andf7[i] | 0x01);
- }
- }
- andf7[0] = andf7[0] << 1;
- andf7[0] = andf7[0] & 0xfe;
-
- xor_32(add1b, andf7, add1bf7);
-
- xor_32(in, add1bf7, rotr);
-
- temp[0] = rotr[0]; /* Rotate right 8 bits */
- rotr[0] = rotr[1];
- rotr[1] = rotr[2];
- rotr[2] = rotr[3];
- rotr[3] = temp[0];
-
- xor_32(add1bf7, rotr, temp);
- xor_32(swap_halfs, rotl,tempb);
- xor_32(temp, tempb, out);
-}
-
diff --git a/drivers/staging/rt2860/common/rtmp_wep.c b/drivers/staging/rt2860/common/rtmp_wep.c
deleted file mode 100644
index 8e833e7011bd..000000000000
--- a/drivers/staging/rt2860/common/rtmp_wep.c
+++ /dev/null
@@ -1,497 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_wep.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Wu 10-28-02 Initial
-*/
-
-#include "../rt_config.h"
-
-UINT FCSTAB_32[256] =
-{
- 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
- 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
- 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
- 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91,
- 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de,
- 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7,
- 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec,
- 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5,
- 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172,
- 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b,
- 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940,
- 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59,
- 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116,
- 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f,
- 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924,
- 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d,
- 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a,
- 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433,
- 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818,
- 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01,
- 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e,
- 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457,
- 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c,
- 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65,
- 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2,
- 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb,
- 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0,
- 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9,
- 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086,
- 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f,
- 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4,
- 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad,
- 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a,
- 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683,
- 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8,
- 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1,
- 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe,
- 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7,
- 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc,
- 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5,
- 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252,
- 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b,
- 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60,
- 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79,
- 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236,
- 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f,
- 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04,
- 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d,
- 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a,
- 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713,
- 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38,
- 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21,
- 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e,
- 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777,
- 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c,
- 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45,
- 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2,
- 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db,
- 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0,
- 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9,
- 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6,
- 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf,
- 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94,
- 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d
-};
-
-/*
- ========================================================================
-
- Routine Description:
- Init WEP function.
-
- Arguments:
- pAd Pointer to our adapter
- pKey Pointer to the WEP KEY
- KeyId WEP Key ID
- KeyLen the length of WEP KEY
- pDest Pointer to the destination which Encryption data will store in.
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPInitWepEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN UCHAR KeyId,
- IN UCHAR KeyLen,
- IN OUT PUCHAR pDest)
-{
- UINT i;
- UCHAR WEPKEY[] = {
- //IV
- 0x00, 0x11, 0x22,
- //WEP KEY
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC
- };
-
- pAd->PrivateInfo.FCSCRC32 = PPPINITFCS32; //Init crc32.
-
- if (pAd->StaCfg.bCkipOn && (pAd->StaCfg.CkipFlag & 0x10) && (pAd->OpMode == OPMODE_STA))
- {
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, pKey, KeyLen); //INIT SBOX, KEYLEN+3(IV)
- NdisMoveMemory(pDest, pKey, 3); //Append Init Vector
- }
- else
- {
- NdisMoveMemory(WEPKEY + 3, pKey, KeyLen);
-
- for(i = 0; i < 3; i++)
- WEPKEY[i] = RandomByte(pAd); //Call mlme RandomByte() function.
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, WEPKEY, KeyLen + 3); //INIT SBOX, KEYLEN+3(IV)
-
- NdisMoveMemory(pDest, WEPKEY, 3); //Append Init Vector
- }
- *(pDest+3) = (KeyId << 6); //Append KEYID
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Encrypt transimitted data
-
- Arguments:
- pAd Pointer to our adapter
- pSrc Pointer to the transimitted source data that will be encrypt
- pDest Pointer to the destination where entryption data will be store in.
- Len Indicate the length of the source data
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPEncryptData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrc,
- IN PUCHAR pDest,
- IN UINT Len)
-{
- pAd->PrivateInfo.FCSCRC32 = RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, pSrc, Len);
- ARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, pDest, pSrc, Len);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Decrypt received WEP data
-
- Arguments:
- pAdapter Pointer to our adapter
- pSrc Pointer to the received data
- Len the length of the received data
-
- Return Value:
- TRUE Decrypt WEP data success
- FALSE Decrypt WEP data failed
-
- Note:
-
- ========================================================================
-*/
-BOOLEAN RTMPSoftDecryptWEP(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN PCIPHER_KEY pGroupKey)
-{
- UINT trailfcs;
- UINT crc32;
- UCHAR KeyIdx;
- UCHAR WEPKEY[] = {
- //IV
- 0x00, 0x11, 0x22,
- //WEP KEY
- 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0xBB, 0xCC
- };
- UCHAR *pPayload = (UCHAR *)pData + LENGTH_802_11;
- ULONG payload_len = DataByteCnt - LENGTH_802_11;
-
- NdisMoveMemory(WEPKEY, pPayload, 3); //Get WEP IV
-
- KeyIdx = (*(pPayload + 3) & 0xc0) >> 6;
- if (pGroupKey[KeyIdx].KeyLen == 0)
- return (FALSE);
-
- NdisMoveMemory(WEPKEY + 3, pGroupKey[KeyIdx].Key, pGroupKey[KeyIdx].KeyLen);
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, WEPKEY, pGroupKey[KeyIdx].KeyLen + 3);
- ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, pPayload, pPayload + 4, payload_len - 4);
- NdisMoveMemory(&trailfcs, pPayload + payload_len - 8, 4);
- crc32 = RTMP_CALC_FCS32(PPPINITFCS32, pPayload, payload_len - 8); //Skip last 4 bytes(FCS).
- crc32 ^= 0xffffffff; /* complement */
-
- if(crc32 != cpu2le32(trailfcs))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("! WEP Data CRC Error !\n")); //CRC error.
- return (FALSE);
- }
- return (TRUE);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- The Stream Cipher Encryption Algorithm "ARCFOUR" initialize
-
- Arguments:
- Ctx Pointer to ARCFOUR CONTEXT (SBOX)
- pKey Pointer to the WEP KEY
- KeyLen Indicate the length fo the WEP KEY
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID ARCFOUR_INIT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pKey,
- IN UINT KeyLen)
-{
- UCHAR t, u;
- UINT keyindex;
- UINT stateindex;
- PUCHAR state;
- UINT counter;
-
- state = Ctx->STATE;
- Ctx->X = 0;
- Ctx->Y = 0;
- for (counter = 0; counter < 256; counter++)
- state[counter] = (UCHAR)counter;
- keyindex = 0;
- stateindex = 0;
- for (counter = 0; counter < 256; counter++)
- {
- t = state[counter];
- stateindex = (stateindex + pKey[keyindex] + t) & 0xff;
- u = state[stateindex];
- state[stateindex] = t;
- state[counter] = u;
- if (++keyindex >= KeyLen)
- keyindex = 0;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Get bytes from ARCFOUR CONTEXT (S-BOX)
-
- Arguments:
- Ctx Pointer to ARCFOUR CONTEXT (SBOX)
-
- Return Value:
- UCHAR - the value of the ARCFOUR CONTEXT (S-BOX)
-
- Note:
-
- ========================================================================
-*/
-UCHAR ARCFOUR_BYTE(
- IN PARCFOURCONTEXT Ctx)
-{
- UINT x;
- UINT y;
- UCHAR sx, sy;
- PUCHAR state;
-
- state = Ctx->STATE;
- x = (Ctx->X + 1) & 0xff;
- sx = state[x];
- y = (sx + Ctx->Y) & 0xff;
- sy = state[y];
- Ctx->X = x;
- Ctx->Y = y;
- state[y] = sx;
- state[x] = sy;
-
- return(state[(sx + sy) & 0xff]);
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- The Stream Cipher Decryption Algorithm
-
- Arguments:
- Ctx Pointer to ARCFOUR CONTEXT (SBOX)
- pDest Pointer to the Destination
- pSrc Pointer to the Source data
- Len Indicate the length of the Source data
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID ARCFOUR_DECRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len)
-{
- UINT i;
-
- for (i = 0; i < Len; i++)
- pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- The Stream Cipher Encryption Algorithm
-
- Arguments:
- Ctx Pointer to ARCFOUR CONTEXT (SBOX)
- pDest Pointer to the Destination
- pSrc Pointer to the Source data
- Len Indicate the length of the Source dta
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID ARCFOUR_ENCRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len)
-{
- UINT i;
-
- for (i = 0; i < Len; i++)
- pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- The Stream Cipher Encryption Algorithm which conform to the special requirement to encrypt GTK.
-
- Arguments:
- Ctx Pointer to ARCFOUR CONTEXT (SBOX)
- pDest Pointer to the Destination
- pSrc Pointer to the Source data
- Len Indicate the length of the Source dta
-
-
- ========================================================================
-*/
-
-VOID WPAARCFOUR_ENCRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len)
-{
- UINT i;
- //discard first 256 bytes
- for (i = 0; i < 256; i++)
- ARCFOUR_BYTE(Ctx);
-
- for (i = 0; i < Len; i++)
- pDest[i] = pSrc[i] ^ ARCFOUR_BYTE(Ctx);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Calculate a new FCS given the current FCS and the new data.
-
- Arguments:
- Fcs the original FCS value
- Cp pointer to the data which will be calculate the FCS
- Len the length of the data
-
- Return Value:
- UINT - FCS 32 bits
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-UINT RTMP_CALC_FCS32(
- IN UINT Fcs,
- IN PUCHAR Cp,
- IN INT Len)
-{
- while (Len--)
- Fcs = (((Fcs) >> 8) ^ FCSTAB_32[((Fcs) ^ (*Cp++)) & 0xff]);
-
- return (Fcs);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Get last FCS and encrypt it to the destination
-
- Arguments:
- pDest Pointer to the Destination
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPSetICV(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDest)
-{
- pAd->PrivateInfo.FCSCRC32 ^= 0xffffffff; /* complement */
- pAd->PrivateInfo.FCSCRC32 = cpu2le32(pAd->PrivateInfo.FCSCRC32);
-
- ARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, pDest, (PUCHAR) &pAd->PrivateInfo.FCSCRC32, 4);
-}
-
diff --git a/drivers/staging/rt2860/common/spectrum.c b/drivers/staging/rt2860/common/spectrum.c
index c658bf3082c3..7fd715ad39b1 100644
--- a/drivers/staging/rt2860/common/spectrum.c
+++ b/drivers/staging/rt2860/common/spectrum.c
@@ -40,6 +40,239 @@
#include "../rt_config.h"
#include "action.h"
+
+/* The regulatory information in the USA (US) */
+DOT11_REGULATORY_INFORMATION USARegulatoryInfo[] =
+{
+/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
+ {0, {0, 0, {0}}}, // Invlid entry
+ {1, {4, 16, {36, 40, 44, 48}}},
+ {2, {4, 23, {52, 56, 60, 64}}},
+ {3, {4, 29, {149, 153, 157, 161}}},
+ {4, {11, 23, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}},
+ {5, {5, 30, {149, 153, 157, 161, 165}}},
+ {6, {10, 14, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}},
+ {7, {10, 27, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}},
+ {8, {5, 17, {11, 13, 15, 17, 19}}},
+ {9, {5, 30, {11, 13, 15, 17, 19}}},
+ {10, {2, 20, {21, 25}}},
+ {11, {2, 33, {21, 25}}},
+ {12, {11, 30, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}}
+};
+#define USA_REGULATORY_INFO_SIZE (sizeof(USARegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
+
+
+/* The regulatory information in Europe */
+DOT11_REGULATORY_INFORMATION EuropeRegulatoryInfo[] =
+{
+/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
+ {0, {0, 0, {0}}}, // Invalid entry
+ {1, {4, 20, {36, 40, 44, 48}}},
+ {2, {4, 20, {52, 56, 60, 64}}},
+ {3, {11, 30, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}},
+ {4, {13, 20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}}
+};
+#define EU_REGULATORY_INFO_SIZE (sizeof(EuropeRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
+
+
+/* The regulatory information in Japan */
+DOT11_REGULATORY_INFORMATION JapanRegulatoryInfo[] =
+{
+/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
+ {0, {0, 0, {0}}}, // Invalid entry
+ {1, {4, 22, {34, 38, 42, 46}}},
+ {2, {3, 24, {8, 12, 16}}},
+ {3, {3, 24, {8, 12, 16}}},
+ {4, {3, 24, {8, 12, 16}}},
+ {5, {3, 24, {8, 12, 16}}},
+ {6, {3, 22, {8, 12, 16}}},
+ {7, {4, 24, {184, 188, 192, 196}}},
+ {8, {4, 24, {184, 188, 192, 196}}},
+ {9, {4, 24, {184, 188, 192, 196}}},
+ {10, {4, 24, {184, 188, 192, 196}}},
+ {11, {4, 22, {184, 188, 192, 196}}},
+ {12, {4, 24, {7, 8, 9, 11}}},
+ {13, {4, 24, {7, 8, 9, 11}}},
+ {14, {4, 24, {7, 8, 9, 11}}},
+ {15, {4, 24, {7, 8, 9, 11}}},
+ {16, {6, 24, {183, 184, 185, 187, 188, 189}}},
+ {17, {6, 24, {183, 184, 185, 187, 188, 189}}},
+ {18, {6, 24, {183, 184, 185, 187, 188, 189}}},
+ {19, {6, 24, {183, 184, 185, 187, 188, 189}}},
+ {20, {6, 17, {183, 184, 185, 187, 188, 189}}},
+ {21, {6, 24, {6, 7, 8, 9, 10, 11}}},
+ {22, {6, 24, {6, 7, 8, 9, 10, 11}}},
+ {23, {6, 24, {6, 7, 8, 9, 10, 11}}},
+ {24, {6, 24, {6, 7, 8, 9, 10, 11}}},
+ {25, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
+ {26, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
+ {27, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
+ {28, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
+ {29, {8, 17, {182, 183, 184, 185, 186, 187, 188, 189}}},
+ {30, {13, 23, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}},
+ {31, {1, 23, {14}}},
+ {32, {4, 22, {52, 56, 60, 64}}}
+};
+#define JP_REGULATORY_INFO_SIZE (sizeof(JapanRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
+
+
+CHAR RTMP_GetTxPwr(
+ IN PRTMP_ADAPTER pAd,
+ IN HTTRANSMIT_SETTING HTTxMode)
+{
+typedef struct __TX_PWR_CFG
+{
+ UINT8 Mode;
+ UINT8 MCS;
+ UINT16 req;
+ UINT8 shift;
+ UINT32 BitMask;
+} TX_PWR_CFG;
+
+ UINT32 Value;
+ INT Idx;
+ UINT8 PhyMode;
+ CHAR CurTxPwr;
+ UINT8 TxPwrRef = 0;
+ CHAR DaltaPwr;
+ ULONG TxPwr[5];
+
+
+ TX_PWR_CFG TxPwrCfg[] = {
+ {MODE_CCK, 0, 0, 4, 0x000000f0},
+ {MODE_CCK, 1, 0, 0, 0x0000000f},
+ {MODE_CCK, 2, 0, 12, 0x0000f000},
+ {MODE_CCK, 3, 0, 8, 0x00000f00},
+
+ {MODE_OFDM, 0, 0, 20, 0x00f00000},
+ {MODE_OFDM, 1, 0, 16, 0x000f0000},
+ {MODE_OFDM, 2, 0, 28, 0xf0000000},
+ {MODE_OFDM, 3, 0, 24, 0x0f000000},
+ {MODE_OFDM, 4, 1, 4, 0x000000f0},
+ {MODE_OFDM, 5, 1, 0, 0x0000000f},
+ {MODE_OFDM, 6, 1, 12, 0x0000f000},
+ {MODE_OFDM, 7, 1, 8, 0x00000f00}
+ ,{MODE_HTMIX, 0, 1, 20, 0x00f00000},
+ {MODE_HTMIX, 1, 1, 16, 0x000f0000},
+ {MODE_HTMIX, 2, 1, 28, 0xf0000000},
+ {MODE_HTMIX, 3, 1, 24, 0x0f000000},
+ {MODE_HTMIX, 4, 2, 4, 0x000000f0},
+ {MODE_HTMIX, 5, 2, 0, 0x0000000f},
+ {MODE_HTMIX, 6, 2, 12, 0x0000f000},
+ {MODE_HTMIX, 7, 2, 8, 0x00000f00},
+ {MODE_HTMIX, 8, 2, 20, 0x00f00000},
+ {MODE_HTMIX, 9, 2, 16, 0x000f0000},
+ {MODE_HTMIX, 10, 2, 28, 0xf0000000},
+ {MODE_HTMIX, 11, 2, 24, 0x0f000000},
+ {MODE_HTMIX, 12, 3, 4, 0x000000f0},
+ {MODE_HTMIX, 13, 3, 0, 0x0000000f},
+ {MODE_HTMIX, 14, 3, 12, 0x0000f000},
+ {MODE_HTMIX, 15, 3, 8, 0x00000f00}
+ };
+#define MAX_TXPWR_TAB_SIZE (sizeof(TxPwrCfg) / sizeof(TX_PWR_CFG))
+
+ CurTxPwr = 19;
+
+ /* check Tx Power setting from UI. */
+ if (pAd->CommonCfg.TxPowerPercentage > 90)
+ ;
+ else if (pAd->CommonCfg.TxPowerPercentage > 60) /* reduce Pwr for 1 dB. */
+ CurTxPwr -= 1;
+ else if (pAd->CommonCfg.TxPowerPercentage > 30) /* reduce Pwr for 3 dB. */
+ CurTxPwr -= 3;
+ else if (pAd->CommonCfg.TxPowerPercentage > 15) /* reduce Pwr for 6 dB. */
+ CurTxPwr -= 6;
+ else if (pAd->CommonCfg.TxPowerPercentage > 9) /* reduce Pwr for 9 dB. */
+ CurTxPwr -= 9;
+ else /* reduce Pwr for 12 dB. */
+ CurTxPwr -= 12;
+
+ if (pAd->CommonCfg.BBPCurrentBW == BW_40)
+ {
+ if (pAd->CommonCfg.CentralChannel > 14)
+ {
+ TxPwr[0] = pAd->Tx40MPwrCfgABand[0];
+ TxPwr[1] = pAd->Tx40MPwrCfgABand[1];
+ TxPwr[2] = pAd->Tx40MPwrCfgABand[2];
+ TxPwr[3] = pAd->Tx40MPwrCfgABand[3];
+ TxPwr[4] = pAd->Tx40MPwrCfgABand[4];
+ }
+ else
+ {
+ TxPwr[0] = pAd->Tx40MPwrCfgGBand[0];
+ TxPwr[1] = pAd->Tx40MPwrCfgGBand[1];
+ TxPwr[2] = pAd->Tx40MPwrCfgGBand[2];
+ TxPwr[3] = pAd->Tx40MPwrCfgGBand[3];
+ TxPwr[4] = pAd->Tx40MPwrCfgGBand[4];
+ }
+ }
+ else
+ {
+ if (pAd->CommonCfg.Channel > 14)
+ {
+ TxPwr[0] = pAd->Tx20MPwrCfgABand[0];
+ TxPwr[1] = pAd->Tx20MPwrCfgABand[1];
+ TxPwr[2] = pAd->Tx20MPwrCfgABand[2];
+ TxPwr[3] = pAd->Tx20MPwrCfgABand[3];
+ TxPwr[4] = pAd->Tx20MPwrCfgABand[4];
+ }
+ else
+ {
+ TxPwr[0] = pAd->Tx20MPwrCfgGBand[0];
+ TxPwr[1] = pAd->Tx20MPwrCfgGBand[1];
+ TxPwr[2] = pAd->Tx20MPwrCfgGBand[2];
+ TxPwr[3] = pAd->Tx20MPwrCfgGBand[3];
+ TxPwr[4] = pAd->Tx20MPwrCfgGBand[4];
+ }
+ }
+
+
+ switch(HTTxMode.field.MODE)
+ {
+ case MODE_CCK:
+ case MODE_OFDM:
+ Value = TxPwr[1];
+ TxPwrRef = (Value & 0x00000f00) >> 8;
+
+ break;
+
+ case MODE_HTMIX:
+ case MODE_HTGREENFIELD:
+ if (pAd->CommonCfg.TxStream == 1)
+ {
+ Value = TxPwr[2];
+ TxPwrRef = (Value & 0x00000f00) >> 8;
+ }
+ else if (pAd->CommonCfg.TxStream == 2)
+ {
+ Value = TxPwr[3];
+ TxPwrRef = (Value & 0x00000f00) >> 8;
+ }
+ break;
+ }
+
+ PhyMode =
+ (HTTxMode.field.MODE == MODE_HTGREENFIELD)
+ ? MODE_HTMIX :
+ HTTxMode.field.MODE;
+
+ for (Idx = 0; Idx < MAX_TXPWR_TAB_SIZE; Idx++)
+ {
+ if ((TxPwrCfg[Idx].Mode == PhyMode)
+ && (TxPwrCfg[Idx].MCS == HTTxMode.field.MCS))
+ {
+ Value = TxPwr[TxPwrCfg[Idx].req];
+ DaltaPwr = TxPwrRef - (CHAR)((Value & TxPwrCfg[Idx].BitMask)
+ >> TxPwrCfg[Idx].shift);
+ CurTxPwr -= DaltaPwr;
+ break;
+ }
+ }
+
+ return CurTxPwr;
+}
+
+
VOID MeasureReqTabInit(
IN PRTMP_ADAPTER pAd)
{
@@ -57,7 +290,7 @@ VOID MeasureReqTabInit(
VOID MeasureReqTabExit(
IN PRTMP_ADAPTER pAd)
{
- NdisFreeSpinLock(pAd->CommonCfg.MeasureReqTabLock);
+ NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
if (pAd->CommonCfg.pMeasureReqTab)
kfree(pAd->CommonCfg.pMeasureReqTab);
@@ -66,7 +299,7 @@ VOID MeasureReqTabExit(
return;
}
-static PMEASURE_REQ_ENTRY MeasureReqLookUp(
+PMEASURE_REQ_ENTRY MeasureReqLookUp(
IN PRTMP_ADAPTER pAd,
IN UINT8 DialogToken)
{
@@ -102,7 +335,7 @@ static PMEASURE_REQ_ENTRY MeasureReqLookUp(
return pEntry;
}
-static PMEASURE_REQ_ENTRY MeasureReqInsert(
+PMEASURE_REQ_ENTRY MeasureReqInsert(
IN PRTMP_ADAPTER pAd,
IN UINT8 DialogToken)
{
@@ -201,7 +434,7 @@ static PMEASURE_REQ_ENTRY MeasureReqInsert(
return pEntry;
}
-static VOID MeasureReqDelete(
+VOID MeasureReqDelete(
IN PRTMP_ADAPTER pAd,
IN UINT8 DialogToken)
{
@@ -275,7 +508,7 @@ VOID TpcReqTabInit(
VOID TpcReqTabExit(
IN PRTMP_ADAPTER pAd)
{
- NdisFreeSpinLock(pAd->CommonCfg.TpcReqTabLock);
+ NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
if (pAd->CommonCfg.pTpcReqTab)
kfree(pAd->CommonCfg.pTpcReqTab);
@@ -514,6 +747,72 @@ static UINT8 GetCurTxPwr(
/*
==========================================================================
Description:
+ Get Current Transmit Power.
+
+ Parametrs:
+
+ Return : Current Time Stamp.
+ ==========================================================================
+ */
+VOID InsertChannelRepIE(
+ IN PRTMP_ADAPTER pAd,
+ OUT PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN PSTRING pCountry,
+ IN UINT8 RegulatoryClass)
+{
+ ULONG TempLen;
+ UINT8 Len;
+ UINT8 IEId = IE_AP_CHANNEL_REPORT;
+ PUCHAR pChListPtr = NULL;
+
+ Len = 1;
+ if (strncmp(pCountry, "US", 2) == 0)
+ {
+ if (RegulatoryClass >= USA_REGULATORY_INFO_SIZE)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: USA Unknow Requlatory class (%d)\n",
+ __func__, RegulatoryClass));
+ return;
+ }
+
+ Len += USARegulatoryInfo[RegulatoryClass].ChannelSet.NumberOfChannels;
+ pChListPtr = USARegulatoryInfo[RegulatoryClass].ChannelSet.ChannelList;
+ }
+ else if (strncmp(pCountry, "JP", 2) == 0)
+ {
+ if (RegulatoryClass >= JP_REGULATORY_INFO_SIZE)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: JP Unknow Requlatory class (%d)\n",
+ __func__, RegulatoryClass));
+ return;
+ }
+
+ Len += JapanRegulatoryInfo[RegulatoryClass].ChannelSet.NumberOfChannels;
+ pChListPtr = JapanRegulatoryInfo[RegulatoryClass].ChannelSet.ChannelList;
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: Unknow Country (%s)\n",
+ __func__, pCountry));
+ return;
+ }
+
+ MakeOutgoingFrame(pFrameBuf, &TempLen,
+ 1, &IEId,
+ 1, &Len,
+ 1, &RegulatoryClass,
+ Len -1, pChListPtr,
+ END_OF_ARGS);
+
+ *pFrameLen = *pFrameLen + TempLen;
+
+ return;
+}
+
+/*
+ ==========================================================================
+ Description:
Insert Dialog Token into frame.
Parametrs:
@@ -524,7 +823,7 @@ static UINT8 GetCurTxPwr(
Return : None.
==========================================================================
*/
-static VOID InsertDialogToken(
+VOID InsertDialogToken(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pFrameBuf,
OUT PULONG pFrameLen,
@@ -585,7 +884,7 @@ static VOID InsertDialogToken(
Return : None.
==========================================================================
*/
- static VOID InsertTpcReportIE(
+VOID InsertTpcReportIE(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pFrameBuf,
OUT PULONG pFrameLen,
@@ -679,16 +978,16 @@ static VOID InsertMeasureReqIE(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pFrameBuf,
OUT PULONG pFrameLen,
+ IN UINT8 Len,
IN PMEASURE_REQ_INFO pMeasureReqIE)
{
ULONG TempLen;
- UINT8 Len = sizeof(MEASURE_REQ_INFO);
UINT8 ElementID = IE_MEASUREMENT_REQUEST;
MakeOutgoingFrame(pFrameBuf, &TempLen,
1, &ElementID,
1, &Len,
- Len, pMeasureReqIE,
+ sizeof(MEASURE_REQ_INFO), pMeasureReqIE,
END_OF_ARGS);
*pFrameLen = *pFrameLen + TempLen;
@@ -758,53 +1057,43 @@ static VOID InsertMeasureReportIE(
Return : None.
==========================================================================
*/
-VOID EnqueueMeasurementReq(
+VOID MakeMeasurementReqFrame(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
+ OUT PUCHAR pOutBuffer,
+ OUT PULONG pFrameLen,
+ IN UINT8 TotalLen,
+ IN UINT8 Category,
+ IN UINT8 Action,
IN UINT8 MeasureToken,
IN UINT8 MeasureReqMode,
IN UINT8 MeasureReqType,
- IN UINT8 MeasureCh,
- IN UINT16 MeasureDuration)
+ IN UINT8 NumOfRepetitions)
{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
- HEADER_802_11 ActHdr;
+ ULONG TempLen;
MEASURE_REQ_INFO MeasureReqIE;
- UINT8 RmReqDailogToken = RandomByte(pAd);
- UINT64 MeasureStartTime = GetCurrentTimeStamp(pAd);
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
- pAd->CurrentAddress);
+ InsertActField(pAd, (pOutBuffer + *pFrameLen), pFrameLen, Category, Action);
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__));
- return;
- }
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
+ // fill Dialog Token
+ InsertDialogToken(pAd, (pOutBuffer + *pFrameLen), pFrameLen, MeasureToken);
- InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, CATEGORY_SPECTRUM, SPEC_MRQ);
+ /* fill Number of repetitions. */
+ if (Category == CATEGORY_RM)
+ {
+ MakeOutgoingFrame((pOutBuffer+*pFrameLen), &TempLen,
+ 2, &NumOfRepetitions,
+ END_OF_ARGS);
- // fill Dialog Token
- InsertDialogToken(pAd, (pOutBuffer + FrameLen), &FrameLen, MeasureToken);
+ *pFrameLen += TempLen;
+ }
// prepare Measurement IE.
NdisZeroMemory(&MeasureReqIE, sizeof(MEASURE_REQ_INFO));
- MeasureReqIE.Token = RmReqDailogToken;
+ MeasureReqIE.Token = MeasureToken;
MeasureReqIE.ReqMode.word = MeasureReqMode;
MeasureReqIE.ReqType = MeasureReqType;
- MeasureReqIE.MeasureReq.ChNum = MeasureCh;
- MeasureReqIE.MeasureReq.MeasureStartTime = cpu2le64(MeasureStartTime);
- MeasureReqIE.MeasureReq.MeasureDuration = cpu2le16(MeasureDuration);
- InsertMeasureReqIE(pAd, (pOutBuffer + FrameLen), &FrameLen, &MeasureReqIE);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
+ InsertMeasureReqIE(pAd, (pOutBuffer+*pFrameLen), pFrameLen,
+ TotalLen, &MeasureReqIE);
return;
}
@@ -858,7 +1147,7 @@ VOID EnqueueMeasurementRep(
// prepare Measurement IE.
NdisZeroMemory(&MeasureRepIE, sizeof(MEASURE_REPORT_INFO));
MeasureRepIE.Token = MeasureToken;
- MeasureRepIE.ReportMode.word = MeasureReqMode;
+ MeasureRepIE.ReportMode = MeasureReqMode;
MeasureRepIE.ReportType = MeasureReqType;
InsertMeasureReportIE(pAd, (pOutBuffer + FrameLen), &FrameLen, &MeasureRepIE, ReportInfoLen, pReportInfo);
@@ -1159,7 +1448,8 @@ static BOOLEAN PeerMeasureReqSanity(
IN VOID *pMsg,
IN ULONG MsgLen,
OUT PUINT8 pDialogToken,
- OUT PMEASURE_REQ_INFO pMeasureReqInfo)
+ OUT PMEASURE_REQ_INFO pMeasureReqInfo,
+ OUT PMEASURE_REQ pMeasureReq)
{
PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
PUCHAR pFramePtr = Fr->Octet;
@@ -1192,12 +1482,12 @@ static BOOLEAN PeerMeasureReqSanity(
NdisMoveMemory(&pMeasureReqInfo->Token, eid_ptr->Octet, 1);
NdisMoveMemory(&pMeasureReqInfo->ReqMode.word, eid_ptr->Octet + 1, 1);
NdisMoveMemory(&pMeasureReqInfo->ReqType, eid_ptr->Octet + 2, 1);
- ptr = eid_ptr->Octet + 3;
- NdisMoveMemory(&pMeasureReqInfo->MeasureReq.ChNum, ptr, 1);
+ ptr = (PUCHAR)(eid_ptr->Octet + 3);
+ NdisMoveMemory(&pMeasureReq->ChNum, ptr, 1);
NdisMoveMemory(&MeasureStartTime, ptr + 1, 8);
- pMeasureReqInfo->MeasureReq.MeasureStartTime = SWAP64(MeasureStartTime);
+ pMeasureReq->MeasureStartTime = SWAP64(MeasureStartTime);
NdisMoveMemory(&MeasureDuration, ptr + 9, 2);
- pMeasureReqInfo->MeasureReq.MeasureDuration = SWAP16(MeasureDuration);
+ pMeasureReq->MeasureDuration = SWAP16(MeasureDuration);
result = TRUE;
break;
@@ -1285,7 +1575,7 @@ static BOOLEAN PeerMeasureReportSanity(
if (pMeasureReportInfo->ReportType == RM_BASIC)
{
PMEASURE_BASIC_REPORT pReport = (PMEASURE_BASIC_REPORT)pReportBuf;
- ptr = eid_ptr->Octet + 3;
+ ptr = (PUCHAR)(eid_ptr->Octet + 3);
NdisMoveMemory(&pReport->ChNum, ptr, 1);
NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
@@ -1295,7 +1585,7 @@ static BOOLEAN PeerMeasureReportSanity(
else if (pMeasureReportInfo->ReportType == RM_CCA)
{
PMEASURE_CCA_REPORT pReport = (PMEASURE_CCA_REPORT)pReportBuf;
- ptr = eid_ptr->Octet + 3;
+ ptr = (PUCHAR)(eid_ptr->Octet + 3);
NdisMoveMemory(&pReport->ChNum, ptr, 1);
NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
@@ -1305,7 +1595,7 @@ static BOOLEAN PeerMeasureReportSanity(
else if (pMeasureReportInfo->ReportType == RM_RPI_HISTOGRAM)
{
PMEASURE_RPI_REPORT pReport = (PMEASURE_RPI_REPORT)pReportBuf;
- ptr = eid_ptr->Octet + 3;
+ ptr = (PUCHAR)(eid_ptr->Octet + 3);
NdisMoveMemory(&pReport->ChNum, ptr, 1);
NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
@@ -1533,9 +1823,10 @@ static VOID PeerMeasureReqAction(
PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
UINT8 DialogToken;
MEASURE_REQ_INFO MeasureReqInfo;
+ MEASURE_REQ MeasureReq;
MEASURE_REPORT_MODE ReportMode;
- if(PeerMeasureReqSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken, &MeasureReqInfo))
+ if(PeerMeasureReqSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken, &MeasureReqInfo, &MeasureReq))
{
ReportMode.word = 0;
ReportMode.field.Incapable = 1;
@@ -1729,8 +2020,8 @@ VOID PeerSpectrumAction(
break;
case SPEC_CHANNEL_SWITCH:
-{
-}
+
+
PeerChSwAnnAction(pAd, Elem);
break;
}
@@ -1749,16 +2040,31 @@ VOID PeerSpectrumAction(
*/
INT Set_MeasureReq_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UINT Aid = 1;
UINT ArgIdx;
- PUCHAR thisChar;
+ PSTRING thisChar;
MEASURE_REQ_MODE MeasureReqMode;
UINT8 MeasureReqToken = RandomByte(pAd);
UINT8 MeasureReqType = RM_BASIC;
UINT8 MeasureCh = 1;
+ UINT64 MeasureStartTime = GetCurrentTimeStamp(pAd);
+ MEASURE_REQ MeasureReq;
+ UINT8 TotalLen;
+
+ HEADER_802_11 ActHdr;
+ PUCHAR pOutBuffer = NULL;
+ NDIS_STATUS NStatus;
+ ULONG FrameLen;
+
+ NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
+ if(NStatus != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __func__));
+ goto END_OF_MEASURE_REQ;
+ }
ArgIdx = 1;
while ((thisChar = strsep((char **)&arg, "-")) != NULL)
@@ -1766,7 +2072,7 @@ INT Set_MeasureReq_Proc(
switch(ArgIdx)
{
case 1: // Aid.
- Aid = simple_strtol(thisChar, 0, 16);
+ Aid = (UINT8) simple_strtol(thisChar, 0, 16);
break;
case 2: // Measurement Request Type.
@@ -1774,12 +2080,12 @@ INT Set_MeasureReq_Proc(
if (MeasureReqType > 3)
{
DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow MeasureReqType(%d)\n", __func__, MeasureReqType));
- return TRUE;
+ goto END_OF_MEASURE_REQ;
}
break;
case 3: // Measurement channel.
- MeasureCh = simple_strtol(thisChar, 0, 16);
+ MeasureCh = (UINT8) simple_strtol(thisChar, 0, 16);
break;
}
ArgIdx++;
@@ -1789,7 +2095,7 @@ INT Set_MeasureReq_Proc(
if (!VALID_WCID(Aid))
{
DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __func__, Aid));
- return TRUE;
+ goto END_OF_MEASURE_REQ;
}
MeasureReqMode.word = 0;
@@ -1797,21 +2103,49 @@ INT Set_MeasureReq_Proc(
MeasureReqInsert(pAd, MeasureReqToken);
- EnqueueMeasurementReq(pAd, pAd->MacTab.Content[Aid].Addr,
- MeasureReqToken, MeasureReqMode.word, MeasureReqType, MeasureCh, 2000);
+ // build action frame header.
+ MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pAd->MacTab.Content[Aid].Addr,
+ pAd->CurrentAddress);
+
+ NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
+ FrameLen = sizeof(HEADER_802_11);
+
+ TotalLen = sizeof(MEASURE_REQ_INFO) + sizeof(MEASURE_REQ);
+
+ MakeMeasurementReqFrame(pAd, pOutBuffer, &FrameLen,
+ sizeof(MEASURE_REQ_INFO), CATEGORY_RM, RM_BASIC,
+ MeasureReqToken, MeasureReqMode.word,
+ MeasureReqType, 0);
+
+ MeasureReq.ChNum = MeasureCh;
+ MeasureReq.MeasureStartTime = cpu2le64(MeasureStartTime);
+ MeasureReq.MeasureDuration = cpu2le16(2000);
+
+ {
+ ULONG TempLen;
+ MakeOutgoingFrame( pOutBuffer+FrameLen, &TempLen,
+ sizeof(MEASURE_REQ), &MeasureReq,
+ END_OF_ARGS);
+ FrameLen += TempLen;
+ }
+
+ MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (UINT)FrameLen);
+
+END_OF_MEASURE_REQ:
+ MlmeFreeMemory(pAd, pOutBuffer);
return TRUE;
}
INT Set_TpcReq_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UINT Aid;
UINT8 TpcReqToken = RandomByte(pAd);
- Aid = simple_strtol(arg, 0, 16);
+ Aid = (UINT) simple_strtol(arg, 0, 16);
DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __func__, Aid));
if (!VALID_WCID(Aid))
diff --git a/drivers/staging/rt2860/config.mk b/drivers/staging/rt2860/config.mk
deleted file mode 100644
index 25bd55a7aab3..000000000000
--- a/drivers/staging/rt2860/config.mk
+++ /dev/null
@@ -1,241 +0,0 @@
-# Support ATE function
-HAS_ATE=n
-
-# Support 28xx QA ATE function
-HAS_28xx_QA=n
-
-# Support Wpa_Supplicant
-HAS_WPA_SUPPLICANT=n
-
-# Support Native WpaSupplicant for Network Maganger
-HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
-
-#Support Net interface block while Tx-Sw queue full
-HAS_BLOCK_NET_IF=n
-
-#Support DFS function
-HAS_DFS_SUPPORT=n
-
-#Support Carrier-Sense function
-HAS_CS_SUPPORT=n
-
-#ifdef MULTI_CARD
-# Support for Multiple Cards
-HAS_MC_SUPPORT=n
-#endif // MULTI_CARD //
-
-#Support for IEEE802.11e DLS
-HAS_QOS_DLS_SUPPORT=n
-
-#Support for EXT_CHANNEL
-HAS_EXT_BUILD_CHANNEL_LIST=n
-
-#Support for Net-SNMP
-HAS_SNMP_SUPPORT=n
-
-#Support features of Single SKU.
-HAS_SINGLE_SKU_SUPPORT=n
-
-#Support features of 802.11n
-HAS_DOT11_N_SUPPORT=y
-
-
-#################################################
-
-CC := $(CROSS_COMPILE)gcc
-LD := $(CROSS_COMPILE)ld
-
-WFLAGS := -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs
-
-
-#################################################
-
-#ifdef CONFIG_STA_SUPPORT
-# config for STA mode
-
-ifeq ($(RT28xx_MODE),STA)
-WFLAGS += -DCONFIG_STA_SUPPORT -DDBG
-
-ifeq ($(HAS_WPA_SUPPLICANT),y)
-WFLAGS += -DWPA_SUPPLICANT_SUPPORT
-endif
-
-ifeq ($(HAS_NATIVE_WPA_SUPPLICANT_SUPPORT),y)
-WFLAGS += -DNATIVE_WPA_SUPPLICANT_SUPPORT
-endif
-
-ifeq ($(HAS_ATE),y)
-WFLAGS += -DRALINK_ATE
-ifeq ($(HAS_28xx_QA),y)
-WFLAGS += -DRALINK_28xx_QA
-endif
-endif
-
-ifeq ($(HAS_SNMP_SUPPORT),y)
-WFLAGS += -DSNMP_SUPPORT
-endif
-
-ifeq ($(HAS_QOS_DLS_SUPPORT),y)
-WFLAGS += -DQOS_DLS_SUPPORT
-endif
-
-ifeq ($(HAS_DOT11_N_SUPPORT),y)
-WFLAGS += -DDOT11_N_SUPPORT
-endif
-
-ifeq ($(HAS_CS_SUPPORT),y)
-WFLAGS += -DCARRIER_DETECTION_SUPPORT
-endif
-
-ifeq ($(HAS_SINGLE_SKU_SUPPORT),y)
-WFLAGS += -DSINGLE_SKU
-endif
-
-endif
-# endif of ifeq ($(RT28xx_MODE),STA)
-#endif // CONFIG_STA_SUPPORT //
-
-#################################################
-
-#################################################
-
-#
-# Common compiler flag
-#
-
-
-ifeq ($(HAS_EXT_BUILD_CHANNEL_LIST),y)
-WFLAGS += -DEXT_BUILD_CHANNEL_LIST
-endif
-
-ifeq ($(CHIPSET),2870)
-WFLAGS +=-DRT2870
-endif
-
-ifeq ($(PLATFORM),5VT)
-#WFLAGS += -DCONFIG_5VT_ENHANCE
-endif
-
-ifeq ($(HAS_BLOCK_NET_IF),y)
-WFLAGS += -DBLOCK_NET_IF
-endif
-
-ifeq ($(HAS_DFS_SUPPORT),y)
-WFLAGS += -DDFS_SUPPORT
-endif
-
-#ifdef MULTI_CARD
-ifeq ($(HAS_MC_SUPPORT),y)
-WFLAGS += -DMULTIPLE_CARD_SUPPORT
-endif
-#endif // MULTI_CARD //
-
-ifeq ($(HAS_LLTD),y)
-WFLAGS += -DLLTD_SUPPORT
-endif
-
-ifeq ($(PLATFORM),IXP)
-WFLAGS += -DRT_BIG_ENDIAN
-endif
-
-ifeq ($(PLATFORM),IKANOS_V160)
-WFLAGS += -DRT_BIG_ENDIAN -DIKANOS_VX_1X0
-endif
-
-ifeq ($(PLATFORM),IKANOS_V180)
-WFLAGS += -DRT_BIG_ENDIAN -DIKANOS_VX_1X0
-endif
-
-ifeq ($(PLATFORM),INF_TWINPASS)
-WFLAGS += -DRT_BIG_ENDIAN -DINF_TWINPASS
-endif
-
-ifeq ($(PLATFORM),INF_DANUBE)
-WFLAGS += -DINF_DANUBE -DRT_BIG_ENDIAN
-endif
-
-ifeq ($(PLATFORM),CAVM_OCTEON)
-WFLAGS += -DRT_BIG_ENDIAN
-endif
-
-ifeq ($(PLATFORM),BRCM_6358)
-WFLAGS += -DRT_BIG_ENDIAN
-endif
-
-ifeq ($(PLATFORM),INF_AMAZON_SE)
-#WFLAGS += -DRT_BIG_ENDIAN -DINF_AMAZON_SE -DBG_FT_SUPPORT
-WFLAGS += -DRT_BIG_ENDIAN -DINF_AMAZON_SE
-endif
-
-#kernel build options for 2.4
-# move to Makefile outside LINUX_SRC := /opt/star/kernel/linux-2.4.27-star
-
-ifeq ($(PLATFORM),STAR)
-CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mshort-load-bytes -msoft-float -Uarm -DMODULE -DMODVERSIONS -include $(LINUX_SRC)/include/linux/modversions.h $(WFLAGS)
-
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),SIGMA)
-CFLAGS := -D__KERNEL__ -I$(RT28xx_DIR)/include -I$(LINUX_SRC)/include -I$(LINUX_SRC)/include/asm/gcc -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -DEM86XX_CHIP=EM86XX_CHIPID_TANGO2 -DEM86XX_REVISION=6 -I$(LINUX_SRC)/include/asm-mips/mach-generic -I$(RT2860_DIR)/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -mabi=32 -march=mips32r2 -Wa,-32 -Wa,-march=mips32r2 -Wa,-mips32r2 -Wa,--trap -DMODULE $(WFLAGS)
-
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),SIGMA_8622)
-CFLAGS := -D__KERNEL__ -I$(CROSS_COMPILE_INCLUDE)/include -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fno-common -pipe -fno-builtin -D__linux__ -DNO_MM -mapcs-32 -march=armv4 -mtune=arm7tdmi -msoft-float -DMODULE -mshort-load-bytes -nostdinc -iwithprefix -DMODULE $(WFLAGS)
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),5VT)
-CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -mlittle-endian -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -O3 -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=apcs-gnu -mno-thumb-interwork -D__LINUX_ARM_ARCH__=5 -march=armv5te -mtune=arm926ej-s --param max-inline-insns-single=40000 -Uarm -Wdeclaration-after-statement -Wno-pointer-sign -DMODULE $(WFLAGS)
-
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),IKANOS_V160)
-CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(LINUX_SRC)/include/asm/gcc -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -I$(LINUX_SRC)/include/asm-mips/mach-generic -I$(RT28xx_DIR)/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -march=lx4189 -Wa, -DMODULE $(WFLAGS)
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),IKANOS_V180)
-CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(LINUX_SRC)/include/asm/gcc -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -I$(LINUX_SRC)/include/asm-mips/mach-tango2 -I$(LINUX_SRC)/include/asm-mips/mach-generic -I$(RT28xx_DIR)/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -ffreestanding -O2 -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -mips32r2 -Wa, -DMODULE $(WFLAGS)
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),INF_TWINPASS)
-CFLAGS := -D__KERNEL__ -DMODULE -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -G 0 -mno-abicalls -fno-pic -march=4kc -mips32 -Wa,--trap -pipe -mlong-calls $(WFLAGS)
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),INF_DANUBE)
-CFLAGS := -I$(RT28xx_DIR)/include $(WFLAGS) -Wundef -fno-strict-aliasing -fno-common -ffreestanding -Os -fomit-frame-pointer -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -I$(LINUX_SRC)/include/asm-mips/mach-generic
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),BRCM_6358)
-CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include -nostdinc -iwithprefix include -D__KERNEL__ -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -I $(LINUX_SRC)/include/asm/gcc -G 0 -mno-abicalls -fno-pic -pipe -finline-limit=100000 -mabi=32 -march=mips32 -Wa,-32 -Wa,-march=mips32 -Wa,-mips32 -Wa,--trap -I$(LINUX_SRC)/include/asm-mips/mach-bcm963xx -I$(LINUX_SRC)/include/asm-mips/mach-generic -Os -fomit-frame-pointer -Wdeclaration-after-statement -DMODULE -mlong-calls
-export CFLAGS
-endif
-
-ifeq ($(PLATFORM),PC)
- ifneq (,$(findstring 2.4,$(LINUX_SRC)))
- # Linux 2.4
- CFLAGS := -D__KERNEL__ -I$(LINUX_SRC)/include -I$(RT28xx_DIR)/include -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include $(LINUX_SRC)/include/linux/modversions.h $(WFLAGS)
- export CFLAGS
- else
- # Linux 2.6
- EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include
- endif
-endif
-
-ifeq ($(PLATFORM),IXP)
- EXTRA_CFLAGS := -v $(WFLAGS) -I$(RT28xx_DIR)/include -mbig-endian
-endif
-
-ifeq ($(PLATFORM),CAVM_OCTEON)
- EXTRA_CFLAGS := $(WFLAGS) -I$(RT28xx_DIR)/include \
- -mabi=64 $(WFLAGS)
-export CFLAGS
-endif
-
diff --git a/drivers/staging/rt3090/crypt_hmac.h b/drivers/staging/rt2860/crypt_hmac.h
index 557ca733d398..9314ff7547b5 100644
--- a/drivers/staging/rt3090/crypt_hmac.h
+++ b/drivers/staging/rt2860/crypt_hmac.h
@@ -23,19 +23,20 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
+ */
+/****************************************************************************
Module Name:
- crypt_hmac.h
+ HMAC
Abstract:
- Miniport generic portion header file
+ FIPS 198: The Keyed-Hash Message Authentication Code (HMAC)
Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
+ Who When What
+ -------- ---------- ------------------------------------------
Eddy 2008/11/24 Create HMAC-SHA1, HMAC-SHA256
-*/
-
+***************************************************************************/
#ifndef __CRYPT_HMAC_H__
#define __CRYPT_HMAC_H__
diff --git a/drivers/staging/rt3090/crypt_md5.h b/drivers/staging/rt2860/crypt_md5.h
index 7ee3f4233fad..66ae42466cea 100644
--- a/drivers/staging/rt3090/crypt_md5.h
+++ b/drivers/staging/rt2860/crypt_md5.h
@@ -23,18 +23,20 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
+ */
+/****************************************************************************
Module Name:
- crypt_md5.h
+ MD5
Abstract:
- Miniport generic portion header file
+ RFC1321: The MD5 Message-Digest Algorithm
Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
+ Who When What
+ -------- ---------- ------------------------------------------
Eddy 2008/11/24 Create md5
-*/
+***************************************************************************/
#ifndef __CRYPT_MD5_H__
#define __CRYPT_MD5_H__
diff --git a/drivers/staging/rt3090/crypt_sha2.h b/drivers/staging/rt2860/crypt_sha2.h
index 85c0403d725a..055efb15a45f 100644
--- a/drivers/staging/rt3090/crypt_sha2.h
+++ b/drivers/staging/rt2860/crypt_sha2.h
@@ -23,19 +23,21 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
+ */
+/****************************************************************************
Module Name:
- crypt_sha2.h
+ SHA2
Abstract:
- Miniport generic portion header file
+ FIPS 180-2: Secure Hash Standard (SHS)
Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
+ Who When What
+ -------- ---------- ------------------------------------------
Eddy 2008/11/24 Create SHA1
Eddy 2008/07/23 Create SHA256
-*/
+***************************************************************************/
#ifndef __CRYPT_SHA2_H__
#define __CRYPT_SHA2_H__
@@ -60,7 +62,7 @@ typedef struct _SHA1_CTX_STRUC {
UINT BlockLen;
} SHA1_CTX_STRUC, *PSHA1_CTX_STRUC;
-VOID SHA1_Init (
+VOID RT_SHA1_Init (
IN SHA1_CTX_STRUC *pSHA_CTX);
VOID SHA1_Hash (
IN SHA1_CTX_STRUC *pSHA_CTX);
diff --git a/drivers/staging/rt2860/dfs.h b/drivers/staging/rt2860/dfs.h
index f34f6183625c..9ab445c736df 100644
--- a/drivers/staging/rt2860/dfs.h
+++ b/drivers/staging/rt2860/dfs.h
@@ -36,53 +36,6 @@
Fonchi 03-12-2007 created
*/
-#define RADAR_PULSE 1
-#define RADAR_WIDTH 2
-
-#define WIDTH_RD_IDLE 0
-#define WIDTH_RD_CHECK 1
-
-
-VOID BbpRadarDetectionStart(
- IN PRTMP_ADAPTER pAd);
-
-VOID BbpRadarDetectionStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID RadarDetectionStart(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN CTS_Protect,
- IN UINT8 CTSPeriod);
-
-VOID RadarDetectionStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID RadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd);
-
-
BOOLEAN RadarChannelCheck(
IN PRTMP_ADAPTER pAd,
IN UCHAR Ch);
-
-ULONG JapRadarType(
- IN PRTMP_ADAPTER pAd);
-
-ULONG RTMPBbpReadRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-ULONG RTMPReadRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPCleanRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-INT Set_ChMovingTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-INT Set_LongPulseRadarTh_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-
diff --git a/drivers/staging/rt3090/eeprom.h b/drivers/staging/rt2860/eeprom.h
index ee0e807decb4..f1aef0c17b00 100644
--- a/drivers/staging/rt3090/eeprom.h
+++ b/drivers/staging/rt2860/eeprom.h
@@ -24,15 +24,16 @@
* *
*************************************************************************
- Module Name:
- eeprom.h
- Abstract:
- Miniport generic portion header file
+ Module Name:
+ eeprom.h
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
+ Abstract:
+ Miniport header file for eeprom related information
+
+ Revision History:
+ Who When What
+ -------- ---------- ----------------------------------------------
*/
#ifndef __EEPROM_H__
#define __EEPROM_H__
@@ -53,10 +54,20 @@ int rtmp_ee_prom_write16(
IN USHORT Offset,
IN USHORT value);
#endif // RTMP_PCI_SUPPORT //
+#ifdef RTMP_USB_SUPPORT
+/*************************************************************************
+ * Public function declarations for usb-based prom chipset
+ ************************************************************************/
+NTSTATUS RTUSBReadEEPROM16(
+ IN PRTMP_ADAPTER pAd,
+ IN USHORT offset,
+ OUT PUSHORT pData);
-
-
-
+NTSTATUS RTUSBWriteEEPROM16(
+ IN RTMP_ADAPTER *pAd,
+ IN USHORT offset,
+ IN USHORT value);
+#endif // RTMP_USB_SUPPORT //
#ifdef RT30xx
#ifdef RTMP_EFUSE_SUPPORT
diff --git a/drivers/staging/rt3090/rtmp_pci.h b/drivers/staging/rt2860/iface/rtmp_pci.h
index c2fed29058f4..7d7efbd9e272 100644
--- a/drivers/staging/rt3090/rtmp_pci.h
+++ b/drivers/staging/rt2860/iface/rtmp_pci.h
@@ -25,7 +25,6 @@
*************************************************************************
*/
-
#ifndef __RTMP_PCI_H__
#define __RTMP_PCI_H__
@@ -39,26 +38,25 @@
#define RT28XX_PUT_DEVICE(dev_p)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
#define SA_SHIRQ IRQF_SHARED
-#endif
#ifdef PCI_MSI_SUPPORT
#define RTMP_MSI_ENABLE(_pAd) \
-{ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; }
+ { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
+ (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; \
+ }
#define RTMP_MSI_DISABLE(_pAd) \
-{ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- if (_pAd->HaveMsi == TRUE) \
- pci_disable_msi(_pObj->pci_dev); \
- _pAd->HaveMsi = FALSE; }
+ { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
+ if (_pAd->HaveMsi == TRUE) \
+ pci_disable_msi(_pObj->pci_dev); \
+ _pAd->HaveMsi = FALSE; \
+ }
#else
-#define RTMP_MSI_ENABLE(_pAd)
-#define RTMP_MSI_DISABLE(_pAd)
+#define RTMP_MSI_ENABLE(_pAd) do{}while(0)
+#define RTMP_MSI_DISABLE(_pAd) do{}while(0)
#endif // PCI_MSI_SUPPORT //
-
#define RTMP_PCI_DEV_UNMAP() \
{ if (net_dev->base_addr) { \
iounmap((void *)(net_dev->base_addr)); \
@@ -67,31 +65,6 @@
if (net_dev->irq) pci_release_regions(dev_p); }
-#define RTMP_IRQ_REQUEST(net_dev) \
-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)(RTMP_OS_NETDEV_GET_PRIV(net_dev)); \
- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- RTMP_MSI_ENABLE(_pAd); \
- if ((retval = request_irq(_pObj->pci_dev->irq, \
- rt2860_interrupt, SA_SHIRQ, \
- (net_dev)->name, (net_dev)))) { \
- DBGPRINT(RT_DEBUG_ERROR, ("request_irq error(%d)\n", retval)); \
- return retval; } }
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#define RTMP_IRQ_RELEASE(net_dev) \
-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)(RTMP_OS_NETDEV_GET_PRIV(net_dev)); \
- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- synchronize_irq(_pObj->pci_dev->irq); \
- free_irq(_pObj->pci_dev->irq, (net_dev)); \
- RTMP_MSI_DISABLE(_pAd); }
-#else
-#define RTMP_IRQ_RELEASE(net_dev) \
-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)(RTMP_OS_NETDEV_GET_PRIV(net_dev)); \
- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- free_irq(_pObj->pci_dev->irq, (net_dev)); \
- RTMP_MSI_DISABLE(_pAd); }
-#endif
-
#define PCI_REG_READ_WORD(pci_dev, offset, Configuration) \
if (pci_read_config_word(pci_dev, offset, &reg16) == 0) \
Configuration = le2cpu16(reg16); \
@@ -100,11 +73,9 @@
#define PCI_REG_WIRTE_WORD(pci_dev, offset, Configuration) \
reg16 = cpu2le16(Configuration); \
- pci_write_config_word(pci_dev, offset, reg16); \
+ pci_write_config_word(pci_dev, offset, reg16);
#endif // LINUX //
-
-
#endif // __RTMP_PCI_H__ //
diff --git a/drivers/staging/rt2860/iface/rtmp_usb.h b/drivers/staging/rt2860/iface/rtmp_usb.h
new file mode 100644
index 000000000000..2e9165effb99
--- /dev/null
+++ b/drivers/staging/rt2860/iface/rtmp_usb.h
@@ -0,0 +1,200 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef __RTMP_USB_H__
+#define __RTMP_USB_H__
+
+
+#include "../rtusb_io.h"
+
+
+#ifdef LINUX
+#include <linux/usb.h>
+
+typedef struct usb_device * PUSB_DEV;
+typedef struct urb *purbb_t;
+typedef struct usb_ctrlrequest devctrlrequest;
+#endif // LINUX //
+
+extern UCHAR EpToQueue[6];
+
+
+#define RXBULKAGGRE_ZISE 12
+#define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_ZISE-1))
+#define MAX_TXBULK_SIZE (LOCAL_TXBUF_SIZE*BULKAGGRE_ZISE)
+#define MAX_RXBULK_SIZE (LOCAL_TXBUF_SIZE*RXBULKAGGRE_ZISE)
+#define MAX_MLME_HANDLER_MEMORY 20
+
+
+// Flags for Bulkflags control for bulk out data
+//
+#define fRTUSB_BULK_OUT_DATA_NULL 0x00000001
+#define fRTUSB_BULK_OUT_RTS 0x00000002
+#define fRTUSB_BULK_OUT_MLME 0x00000004
+
+#define fRTUSB_BULK_OUT_PSPOLL 0x00000010
+#define fRTUSB_BULK_OUT_DATA_FRAG 0x00000020
+#define fRTUSB_BULK_OUT_DATA_FRAG_2 0x00000040
+#define fRTUSB_BULK_OUT_DATA_FRAG_3 0x00000080
+#define fRTUSB_BULK_OUT_DATA_FRAG_4 0x00000100
+
+#define fRTUSB_BULK_OUT_DATA_NORMAL 0x00010000
+#define fRTUSB_BULK_OUT_DATA_NORMAL_2 0x00020000
+#define fRTUSB_BULK_OUT_DATA_NORMAL_3 0x00040000
+#define fRTUSB_BULK_OUT_DATA_NORMAL_4 0x00080000
+
+// TODO:move to ./ate/include/iface/ate_usb.h
+
+
+#define FREE_HTTX_RING(_pCookie, _pipeId, _txContext) \
+{ \
+ if ((_txContext)->ENextBulkOutPosition == (_txContext)->CurWritePosition) \
+ { \
+ (_txContext)->bRingEmpty = TRUE; \
+ } \
+ /*NdisInterlockedDecrement(&(_p)->TxCount); */\
+}
+
+
+
+/******************************************************************************
+
+ USB Bulk operation related definitions
+
+******************************************************************************/
+
+#ifdef LINUX
+#define BULKAGGRE_ZISE 100
+#define RT28XX_PUT_DEVICE usb_put_dev
+#define RTUSB_ALLOC_URB(iso) usb_alloc_urb(iso, GFP_ATOMIC)
+#define RTUSB_SUBMIT_URB(pUrb) usb_submit_urb(pUrb, GFP_ATOMIC)
+#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_buffer_alloc(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
+#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_buffer_free(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
+
+#define RTUSB_FREE_URB(pUrb) usb_free_urb(pUrb)
+
+// unlink urb
+#define RTUSB_UNLINK_URB(pUrb) usb_kill_urb(pUrb)
+
+extern void dump_urb(struct urb* purb);
+
+#define InterlockedIncrement atomic_inc
+#define NdisInterlockedIncrement atomic_inc
+#define InterlockedDecrement atomic_dec
+#define NdisInterlockedDecrement atomic_dec
+#define InterlockedExchange atomic_set
+
+#endif // LINUX //
+
+
+
+#define NT_SUCCESS(status) (((status) >=0) ? (TRUE):(FALSE))
+
+
+
+#define USBD_TRANSFER_DIRECTION_OUT 0
+#define USBD_TRANSFER_DIRECTION_IN 0
+#define USBD_SHORT_TRANSFER_OK 0
+#define PURB purbb_t
+
+#define PIRP PVOID
+#define NDIS_OID UINT
+#ifndef USB_ST_NOERROR
+#define USB_ST_NOERROR 0
+#endif
+
+// vendor-specific control operations
+#define CONTROL_TIMEOUT_JIFFIES ( (100 * OS_HZ) / 1000)
+#define UNLINK_TIMEOUT_MS 3
+
+
+VOID RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs);
+VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs);
+VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
+VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
+VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs);
+VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
+
+
+#ifdef KTHREAD_SUPPORT
+#define RTUSBMlmeUp(pAd) \
+ do{ \
+ RTMP_OS_TASK *_pTask = &((pAd)->mlmeTask);\
+ if (_pTask->kthread_task) \
+ { \
+ _pTask->kthread_running = TRUE; \
+ wake_up(&_pTask->kthread_q); \
+ } \
+ }while(0)
+#else
+#define RTUSBMlmeUp(pAd) \
+ do{ \
+ RTMP_OS_TASK *_pTask = &((pAd)->mlmeTask);\
+ CHECK_PID_LEGALITY(_pTask->taskPID) \
+ { \
+ RTMP_SEM_EVENT_UP(&(_pTask->taskSema)); \
+ }\
+ }while(0)
+#endif
+
+#ifdef KTHREAD_SUPPORT
+#define RTUSBCMDUp(pAd) \
+ do{ \
+ RTMP_OS_TASK *_pTask = &((pAd)->cmdQTask); \
+ { \
+ _pTask->kthread_running = TRUE; \
+ wake_up(&_pTask->kthread_q); \
+ } \
+ }while(0)
+
+#else
+#define RTUSBCMDUp(pAd) \
+ do{ \
+ RTMP_OS_TASK *_pTask = &((pAd)->cmdQTask); \
+ CHECK_PID_LEGALITY(_pTask->taskPID) \
+ {\
+ RTMP_SEM_EVENT_UP(&(_pTask->taskSema)); \
+ }\
+ }while(0)
+#endif
+
+#define DEVICE_VENDOR_REQUEST_OUT 0x40
+#define DEVICE_VENDOR_REQUEST_IN 0xc0
+//#define INTERFACE_VENDOR_REQUEST_OUT 0x41
+//#define INTERFACE_VENDOR_REQUEST_IN 0xc1
+
+#define BULKOUT_MGMT_RESET_FLAG 0x80
+
+#define RTUSB_SET_BULK_FLAG(_M, _F) ((_M)->BulkFlags |= (_F))
+#define RTUSB_CLEAR_BULK_FLAG(_M, _F) ((_M)->BulkFlags &= ~(_F))
+#define RTUSB_TEST_BULK_FLAG(_M, _F) (((_M)->BulkFlags & (_F)) != 0)
+
+#define RTMP_IRQ_REQUEST(net_dev) do{}while(0)
+#define RTMP_IRQ_RELEASE(net_dev) do{}while(0)
+
+
+#endif // __RTMP_USB_H__ //
diff --git a/drivers/staging/rt2860/md5.h b/drivers/staging/rt2860/md5.h
deleted file mode 100644
index d85db12170d5..000000000000
--- a/drivers/staging/rt2860/md5.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- md5.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- jan 10-28-03 Initial
- Rita 11-23-04 Modify MD5 and SHA-1
-*/
-
-#ifndef uint8
-#define uint8 unsigned char
-#endif
-
-#ifndef uint32
-#define uint32 unsigned long int
-#endif
-
-
-#ifndef __MD5_H__
-#define __MD5_H__
-
-#define MD5_MAC_LEN 16
-
-typedef struct _MD5_CTX {
- UINT32 Buf[4]; // buffers of four states
- UCHAR Input[64]; // input message
- UINT32 LenInBitCount[2]; // length counter for input message, 0 up to 64 bits
-} MD5_CTX;
-
-VOID MD5Init(MD5_CTX *pCtx);
-VOID MD5Update(MD5_CTX *pCtx, UCHAR *pData, UINT32 LenInBytes);
-VOID MD5Final(UCHAR Digest[16], MD5_CTX *pCtx);
-VOID MD5Transform(UINT32 Buf[4], UINT32 Mes[16]);
-
-void md5_mac(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
-void hmac_md5(u8 *key, size_t key_len, u8 *data, size_t data_len, u8 *mac);
-
-//
-// SHA context
-//
-typedef struct _SHA_CTX
-{
- UINT32 Buf[5]; // buffers of five states
- UCHAR Input[80]; // input message
- UINT32 LenInBitCount[2]; // length counter for input message, 0 up to 64 bits
-
-} SHA_CTX;
-
-VOID SHAInit(SHA_CTX *pCtx);
-UCHAR SHAUpdate(SHA_CTX *pCtx, UCHAR *pData, UINT32 LenInBytes);
-VOID SHAFinal(SHA_CTX *pCtx, UCHAR Digest[20]);
-VOID SHATransform(UINT32 Buf[5], UINT32 Mes[20]);
-
-#define SHA_DIGEST_LEN 20
-#endif // __MD5_H__
-
-/******************************************************************************/
-#ifndef _AES_H
-#define _AES_H
-
-typedef struct
-{
- uint32 erk[64]; /* encryption round keys */
- uint32 drk[64]; /* decryption round keys */
- int nr; /* number of rounds */
-}
-aes_context;
-
-int rtmp_aes_set_key( aes_context *ctx, uint8 *key, int nbits );
-void rtmp_aes_encrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
-void rtmp_aes_decrypt( aes_context *ctx, uint8 input[16], uint8 output[16] );
-
-void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output);
-int PasswordHash(char *password, unsigned char *ssid, int ssidlength, unsigned char *output);
-
-#endif /* aes.h */
-
diff --git a/drivers/staging/rt2860/mlme.h b/drivers/staging/rt2860/mlme.h
index 3d1a8284fbd4..f609ea5660a1 100644
--- a/drivers/staging/rt2860/mlme.h
+++ b/drivers/staging/rt2860/mlme.h
@@ -39,6 +39,10 @@
#ifndef __MLME_H__
#define __MLME_H__
+#include "rtmp_dot11.h"
+
+
+
// maximum supported capability information -
// ESS, IBSS, Privacy, Short Preamble, Spectrum mgmt, Short Slot
#define SUPPORTED_CAPABILITY_INFO 0x0533
@@ -58,23 +62,24 @@
#define JAP_W56 4
#define MAX_RD_REGION 5
-#ifdef NDIS51_MINIPORT
-#define BEACON_LOST_TIME 4000 // 2048 msec = 2 sec
-#else
#define BEACON_LOST_TIME 4 * OS_HZ // 2048 msec = 2 sec
-#endif
#define DLS_TIMEOUT 1200 // unit: msec
#define AUTH_TIMEOUT 300 // unit: msec
#define ASSOC_TIMEOUT 300 // unit: msec
-#define JOIN_TIMEOUT 2 * OS_HZ // unit: msec
+#define JOIN_TIMEOUT 2000 // unit: msec
#define SHORT_CHANNEL_TIME 90 // unit: msec
#define MIN_CHANNEL_TIME 110 // unit: msec, for dual band scan
#define MAX_CHANNEL_TIME 140 // unit: msec, for single band scan
#define FAST_ACTIVE_SCAN_TIME 30 // Active scan waiting for probe response time
#define CW_MIN_IN_BITS 4 // actual CwMin = 2^CW_MIN_IN_BITS - 1
+#define LINK_DOWN_TIMEOUT 20000 // unit: msec
+#define AUTO_WAKEUP_TIMEOUT 70 //unit: msec
+
+
#define CW_MAX_IN_BITS 10 // actual CwMax = 2^CW_MAX_IN_BITS - 1
+
// Note: RSSI_TO_DBM_OFFSET has been changed to variable for new RF (2004-0720).
// SHould not refer to this constant anymore
//#define RSSI_TO_DBM_OFFSET 120 // for RT2530 RSSI-115 = dBm
@@ -290,7 +295,7 @@ typedef struct PACKED _HT_CAPABILITY_IE{
#define dot11BSSWidthTriggerScanInterval 300 // in sec. max interval between scan operations to be performed to detect BSS channel width trigger events.
#define dot11OBSSScanPassiveTotalPerChannel 200 // in TU. min total amount of time that the STA scans each channel when performing a passive OBSS scan.
#define dot11OBSSScanActiveTotalPerChannel 20 //in TU. min total amount of time that the STA scans each channel when performing a active OBSS scan
-#define dot11BSSWidthChannelTransactionDelayFactor 5 // min ratio between the delay time in performing a switch from 20MHz BSS to 20/40 BSS operation and the maxima
+#define dot11BSSWidthChannelTransactionDelayFactor 5 // min ratio between the delay time in performing a switch from 20MHz BSS to 20/40 BSS operation and the maximum
// interval between overlapping BSS scan operations.
#define dot11BSSScanActivityThreshold 25 // in %%, max total time that a STA may be active on the medium during a period of
// (dot11BSSWidthChannelTransactionDelayFactor * dot11BSSWidthTriggerScanInterval) seconds without
@@ -382,7 +387,7 @@ typedef struct {
BOOLEAN bHtEnable; // If we should use ht rate.
BOOLEAN bPreNHt; // If we should use ht rate.
//Substract from HT Capability IE
- UCHAR MCSSet[16]; //only supoort MCS=0-15,32 ,
+ UCHAR MCSSet[16];
} RT_HT_PHY_INFO, *PRT_HT_PHY_INFO;
//This structure substracts ralink supports from all 802.11n-related features.
@@ -460,60 +465,6 @@ typedef struct PACKED{
UCHAR NewExtChanOffset;
} NEW_EXT_CHAN_IE, *PNEW_EXT_CHAN_IE;
-
-// 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1.
-typedef struct PACKED {
- UINT32 MA:1; //management action payload exist in (QoS Null+HTC)
- UINT32 TRQ:1; //sounding request
- UINT32 MRQ:1; //MCS feedback. Request for a MCS feedback
- UINT32 MRSorASI:3; // MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110.
- UINT32 MFS:3; //SET to the received value of MRS. 0x111 for unsolicited MFB.
- UINT32 MFBorASC:7; //Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available
- UINT32 CalPos:2; // calibration position
- UINT32 CalSeq:2; //calibration sequence
- UINT32 FBKReq:2; //feedback request
- UINT32 CSISTEERING:2; //CSI/ STEERING
- UINT32 ZLFAnnouce:1; // ZLF announcement
- UINT32 rsv:5; //calibration sequence
- UINT32 ACConstraint:1; //feedback request
- UINT32 RDG:1; //RDG / More PPDU
-} HT_CONTROL, *PHT_CONTROL;
-
-// 2-byte QOS CONTROL field
-typedef struct PACKED {
- USHORT TID:4;
- USHORT EOSP:1;
- USHORT AckPolicy:2; //0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA
- USHORT AMsduPresent:1;
- USHORT Txop_QueueSize:8;
-} QOS_CONTROL, *PQOS_CONTROL;
-
-// 2-byte Frame control field
-typedef struct PACKED {
- USHORT Ver:2; // Protocol version
- USHORT Type:2; // MSDU type
- USHORT SubType:4; // MSDU subtype
- USHORT ToDs:1; // To DS indication
- USHORT FrDs:1; // From DS indication
- USHORT MoreFrag:1; // More fragment bit
- USHORT Retry:1; // Retry status bit
- USHORT PwrMgmt:1; // Power management bit
- USHORT MoreData:1; // More data bit
- USHORT Wep:1; // Wep data
- USHORT Order:1; // Strict order expected
-} FRAME_CONTROL, *PFRAME_CONTROL;
-
-typedef struct PACKED _HEADER_802_11 {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- UCHAR Addr3[MAC_ADDR_LEN];
- USHORT Frag:4;
- USHORT Sequence:12;
- UCHAR Octet[0];
-} HEADER_802_11, *PHEADER_802_11;
-
typedef struct PACKED _FRAME_802_11 {
HEADER_802_11 Hdr;
UCHAR Octet[1];
@@ -595,20 +546,6 @@ typedef struct {
} EACH_TID, *PEACH_TID;
-typedef struct PACKED _PSPOLL_FRAME {
- FRAME_CONTROL FC;
- USHORT Aid;
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR Ta[MAC_ADDR_LEN];
-} PSPOLL_FRAME, *PPSPOLL_FRAME;
-
-typedef struct PACKED _RTS_FRAME {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
-}RTS_FRAME, *PRTS_FRAME;
-
// BAREQ AND MTBAREQ have the same subtype BAR, 802.11n BAR use compressed bitmap.
typedef struct PACKED _FRAME_BA_REQ {
FRAME_CONTROL FC;
@@ -1059,7 +996,7 @@ typedef struct _MLME_START_REQ_STRUCT {
typedef struct PACKED {
UCHAR Eid;
UCHAR Len;
- CHAR Octet[1];
+ UCHAR Octet[1];
} EID_STRUCT,*PEID_STRUCT, BEACON_EID_STRUCT, *PBEACON_EID_STRUCT;
typedef struct PACKED _RTMP_TX_RATE_SWITCH
diff --git a/drivers/staging/rt2860/oid.h b/drivers/staging/rt2860/oid.h
index 0227c4a38f9f..a03293cabd87 100644
--- a/drivers/staging/rt2860/oid.h
+++ b/drivers/staging/rt2860/oid.h
@@ -37,9 +37,14 @@
#ifndef _OID_H_
#define _OID_H_
+//#include <linux/wireless.h>
+#ifndef TRUE
#define TRUE 1
+#endif
+#ifndef FALSE
#define FALSE 0
+#endif
//
// IEEE 802.11 Structures and definitions
//
@@ -73,24 +78,25 @@
#define NDIS_802_11_LENGTH_RATES 8
#define NDIS_802_11_LENGTH_RATES_EX 16
#define MAC_ADDR_LENGTH 6
-#define MAX_NUM_OF_CHS 49 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc
+//#define MAX_NUM_OF_CHS 49 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc
+#define MAX_NUM_OF_CHS 54 // 14 channels @2.4G + 12@UNII(lower/middle) + 16@HiperLAN2 + 11@UNII(upper) + 0 @Japan + 1 as NULL termination
#define MAX_NUMBER_OF_EVENT 10 // entry # in EVENT table
#define MAX_NUMBER_OF_MAC 32 // if MAX_MBSSID_NUM is 8, this value can't be larger than 211
#define MAX_NUMBER_OF_ACL 64
#define MAX_LENGTH_OF_SUPPORT_RATES 12 // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
#define MAX_NUMBER_OF_DLS_ENTRY 4
-#define OID_GEN_MACHINE_NAME 0x0001021A
#define RT_QUERY_SIGNAL_CONTEXT 0x0402
#define RT_SET_IAPP_PID 0x0404
#define RT_SET_APD_PID 0x0405
#define RT_SET_DEL_MAC_ENTRY 0x0406
-
+#define RT_QUERY_EVENT_TABLE 0x0407
//
// IEEE 802.11 OIDs
//
#define OID_GET_SET_TOGGLE 0x8000
+#define OID_GET_SET_FROM_UI 0x4000
#define OID_802_11_ADD_WEP 0x0112
#define OID_802_11_DISASSOCIATE 0x0114
@@ -101,22 +107,28 @@
#define RT_OID_DEVICE_NAME 0x0607
#define RT_OID_VERSION_INFO 0x0608
+#define OID_802_11_BSSID_LIST 0x0609
+#define OID_802_3_CURRENT_ADDRESS 0x060A
#define OID_GEN_MEDIA_CONNECT_STATUS 0x060B
+#define RT_OID_802_11_QUERY_LINK_STATUS 0x060C
+#define OID_802_11_RSSI 0x060D
+#define OID_802_11_STATISTICS 0x060E
#define OID_GEN_RCV_OK 0x060F
#define OID_GEN_RCV_NO_BUFFER 0x0610
-
+#define RT_OID_802_11_QUERY_EEPROM_VERSION 0x0611
+#define RT_OID_802_11_QUERY_FIRMWARE_VERSION 0x0612
+#define RT_OID_802_11_QUERY_LAST_RX_RATE 0x0613
+#define RT_OID_802_11_TX_POWER_LEVEL_1 0x0614
+#define RT_OID_802_11_QUERY_PIDVID 0x0615
+//for WPA_SUPPLICANT_SUPPORT
#define OID_SET_COUNTERMEASURES 0x0616
#define RT_OID_WPA_SUPPLICANT_SUPPORT 0x0621
#define RT_OID_WE_VERSION_COMPILED 0x0622
#define RT_OID_NEW_DRIVER 0x0623
-//rt2860 , kathy
#define RT_OID_DRIVER_DEVICE_NAME 0x0645
#define RT_OID_QUERY_MULTIPLE_CARD_SUPPORT 0x0647
-// Ralink defined OIDs
-// Dennis Lee move to platform specific
-
typedef enum _NDIS_802_11_STATUS_TYPE
{
Ndis802_11StatusType_Authentication,
@@ -169,10 +181,10 @@ typedef enum _NDIS_802_11_NETWORK_TYPE
Ndis802_11FH,
Ndis802_11DS,
Ndis802_11OFDM5,
- Ndis802_11OFDM5_N,
Ndis802_11OFDM24,
- Ndis802_11OFDM24_N,
Ndis802_11Automode,
+ Ndis802_11OFDM5_N,
+ Ndis802_11OFDM24_N,
Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound
} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
@@ -271,13 +283,15 @@ typedef struct PACKED _RADIUS_CONF
UINT32 own_ip_addr;
UINT32 retry_interval;
UINT32 session_timeout_interval;
- UCHAR EAPifname[IFNAMSIZ];
- UCHAR EAPifname_len;
- UCHAR PreAuthifname[IFNAMSIZ];
- UCHAR PreAuthifname_len;
- RADIUS_KEY_INFO RadiusInfo[8/*MAX_MBSSID_NUM*/];
+ UCHAR EAPifname[8][IFNAMSIZ];
+ UCHAR EAPifname_len[8];
+ UCHAR PreAuthifname[8][IFNAMSIZ];
+ UCHAR PreAuthifname_len[8];
+ RADIUS_KEY_INFO RadiusInfo[8];
} RADIUS_CONF, *PRADIUS_CONF;
+
+
// Key mapping keys require a BSSID
typedef struct _NDIS_802_11_KEY
{
@@ -289,6 +303,13 @@ typedef struct _NDIS_802_11_KEY
UCHAR KeyMaterial[1]; // variable length depending on above field
} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
+typedef struct _NDIS_802_11_PASSPHRASE
+{
+ UINT KeyLength; // length of key in bytes
+ NDIS_802_11_MAC_ADDRESS BSSID;
+ UCHAR KeyMaterial[1]; // variable length depending on above field
+} NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE;
+
typedef struct _NDIS_802_11_REMOVE_KEY
{
UINT Length; // Length of this structure
@@ -481,6 +502,19 @@ typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
+/*
+typedef struct _NDIS_802_11_TEST
+{
+ ULONG Length;
+ ULONG Type;
+ union
+ {
+ NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
+ NDIS_802_11_RSSI RssiTrigger;
+ };
+} NDIS_802_11_TEST, *PNDIS_802_11_TEST;
+ */
+
// 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE
typedef enum _NDIS_802_11_MEDIA_STREAM_MODE
{
@@ -519,14 +553,18 @@ typedef struct _NDIS_802_11_CAPABILITY
NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
-#define RT_PRIV_IOCTL_EXT (SIOCIWFIRSTPRIV + 0x01) // Sync. with AP for wsc upnp daemon
+#ifdef LINUX
+#endif // LINUX //
+
+
+#define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x01) // Sync. with AP for wsc upnp daemon
#define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02)
#define RTPRIV_IOCTL_STATISTICS (SIOCIWFIRSTPRIV + 0x09)
#define RTPRIV_IOCTL_ADD_PMKID_CACHE (SIOCIWFIRSTPRIV + 0x0A)
#define RTPRIV_IOCTL_RADIUS_DATA (SIOCIWFIRSTPRIV + 0x0C)
#define RTPRIV_IOCTL_GSITESURVEY (SIOCIWFIRSTPRIV + 0x0D)
-#define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x0E) // Sync. with RT61 (for wpa_supplicant)
+#define RT_PRIV_IOCTL_EXT (SIOCIWFIRSTPRIV + 0x0E) // Sync. with RT61 (for wpa_supplicant)
#define RTPRIV_IOCTL_GET_MAC_TABLE (SIOCIWFIRSTPRIV + 0x0F)
#define RTPRIV_IOCTL_SHOW (SIOCIWFIRSTPRIV + 0x11)
@@ -535,27 +573,54 @@ enum {
SHOW_DRVIER_VERION = 5,
SHOW_BA_INFO = 6,
SHOW_DESC_INFO = 7,
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
SHOW_RXBULK_INFO = 8,
SHOW_TXBULK_INFO = 9,
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
RAIO_OFF = 10,
RAIO_ON = 11,
SHOW_CFG_VALUE = 20,
-#if !defined(RT2860)
SHOW_ADHOC_ENTRY_INFO = 21,
-#endif
};
-#ifdef LLTD_SUPPORT
+
+
+
+
+
+#define OID_802_11_BUILD_CHANNEL_EX 0x0714
+#define OID_802_11_GET_CH_LIST 0x0715
+#define OID_802_11_GET_COUNTRY_CODE 0x0716
+#define OID_802_11_GET_CHANNEL_GEOGRAPHY 0x0717
+
+//#define RT_OID_802_11_STATISTICS (OID_GET_SET_TOGGLE | OID_802_11_STATISTICS)
+
+#define RT_OID_WSC_SET_PASSPHRASE 0x0740 // passphrase for wpa(2)-psk
+#define RT_OID_WSC_DRIVER_AUTO_CONNECT 0x0741
+#define RT_OID_WSC_QUERY_DEFAULT_PROFILE 0x0742
+#define RT_OID_WSC_SET_CONN_BY_PROFILE_INDEX 0x0743
+#define RT_OID_WSC_SET_ACTION 0x0744
+#define RT_OID_WSC_SET_SSID 0x0745
+#define RT_OID_WSC_SET_PIN_CODE 0x0746
+#define RT_OID_WSC_SET_MODE 0x0747 // PIN or PBC
+#define RT_OID_WSC_SET_CONF_MODE 0x0748 // Enrollee or Registrar
+#define RT_OID_WSC_SET_PROFILE 0x0749
+#define RT_OID_WSC_CONFIG_STATUS 0x074F
+#define RT_OID_802_11_WSC_QUERY_PROFILE 0x0750
// for consistency with RT61
-#define RT_OID_GET_PHY_MODE 0x761
-#endif // LLTD_SUPPORT //
+#define RT_OID_WSC_QUERY_STATUS 0x0751
+#define RT_OID_WSC_PIN_CODE 0x0752
+#define RT_OID_WSC_UUID 0x0753
+#define RT_OID_WSC_SET_SELECTED_REGISTRAR 0x0754
+#define RT_OID_WSC_EAPMSG 0x0755
+#define RT_OID_WSC_MANUFACTURER 0x0756
+#define RT_OID_WSC_MODEL_NAME 0x0757
+#define RT_OID_WSC_MODEL_NO 0x0758
+#define RT_OID_WSC_SERIAL_NO 0x0759
+#define RT_OID_WSC_MAC_ADDRESS 0x0760
-#if defined(RT2860) || defined(RT30xx)
// New for MeetingHouse Api support
#define OID_MH_802_1X_SUPPORTED 0xFFEDC100
-#endif
// MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!!
typedef union _HTTRANSMIT_SETTING {
@@ -564,6 +629,7 @@ typedef union _HTTRANSMIT_SETTING {
USHORT BW:1; //channel bandwidth 20MHz or 40 MHz
USHORT ShortGI:1;
USHORT STBC:2; //SPACE
+// USHORT rsv:3;
USHORT rsv:2;
USHORT TxBF:1;
USHORT MODE:2; // Use definition MODE_xxx.
@@ -577,7 +643,6 @@ typedef enum _RT_802_11_PREAMBLE {
Rt802_11PreambleAuto
} RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE;
-// Only for STA, need to sync with AP
typedef enum _RT_802_11_PHY_MODE {
PHY_11BG_MIXED = 0,
PHY_11B,
@@ -744,19 +809,6 @@ typedef struct {
UCHAR rsv;
} OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE;
-#ifdef LLTD_SUPPORT
-typedef struct _RT_LLTD_ASSOICATION_ENTRY {
- UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
- unsigned short MOR; // maximum operational rate
- UCHAR phyMode;
-} RT_LLTD_ASSOICATION_ENTRY, *PRT_LLTD_ASSOICATION_ENTRY;
-
-typedef struct _RT_LLTD_ASSOICATION_TABLE {
- unsigned int Num;
- RT_LLTD_ASSOICATION_ENTRY Entry[MAX_NUMBER_OF_MAC];
-} RT_LLTD_ASSOICATION_TABLE, *PRT_LLTD_ASSOICATION_TABLE;
-#endif // LLTD_SUPPORT //
-
#define MAX_CUSTOM_LEN 128
typedef enum _RT_802_11_D_CLIENT_MODE
@@ -772,7 +824,6 @@ typedef struct _RT_CHANNEL_LIST_INFO
UCHAR ChannelListNum; // number of channel in ChannelList[]
} RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
-#ifdef RT2870
// WSC configured credential
typedef struct _WSC_CREDENTIAL
{
@@ -790,9 +841,9 @@ typedef struct _WSC_CREDENTIAL
typedef struct _WSC_PROFILE
{
UINT ProfileCnt;
+ UINT ApplyProfileIdx; // add by johnli, fix WPS test plan 5.1.1
WSC_CREDENTIAL Profile[8]; // Support up to 8 profiles
} WSC_PROFILE, *PWSC_PROFILE;
-#endif
#endif // _OID_H_
diff --git a/drivers/staging/rt3090/pci_main_dev.c b/drivers/staging/rt2860/pci_main_dev.c
index 1410156b90c6..1436a60e894b 100644
--- a/drivers/staging/rt3090/pci_main_dev.c
+++ b/drivers/staging/rt2860/pci_main_dev.c
@@ -24,18 +24,17 @@
* *
*************************************************************************
- Module Name:
- pci_main_dev.c
+ Module Name:
+ pci_main_dev.c
- Abstract:
+ Abstract:
+ Create and register network interface for PCI based chipsets in Linux platform.
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
+ Revision History:
+ Who When What
+ -------- ---------- ----------------------------------------------
*/
-
#include "rt_config.h"
#include <linux/pci.h>
@@ -43,8 +42,9 @@
// *** If you have a solution for the bug in current version of driver, please mail to me.
// Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. ***
MODULE_AUTHOR("Jett Chen <jett_chen@ralinktech.com>");
-MODULE_DESCRIPTION("RT3090 Wireless Lan Linux Driver");
+MODULE_DESCRIPTION("RT2860/RT3090 Wireless Lan Linux Driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("rt3090sta");
//
// Function declarations
@@ -57,21 +57,13 @@ static INT __devinit rt2860_probe(struct pci_dev *pci_dev, const struct pci_devi
static void __exit rt2860_cleanup_module(void);
static int __init rt2860_init_module(void);
-
static VOID RTMPInitPCIeDevice(
IN struct pci_dev *pci_dev,
IN PRTMP_ADAPTER pAd);
-
#ifdef CONFIG_PM
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,10)
-#define pm_message_t u32
-#endif
-
static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state);
static int rt2860_resume(struct pci_dev *pci_dev);
-#endif
#endif // CONFIG_PM //
//
@@ -79,11 +71,24 @@ static int rt2860_resume(struct pci_dev *pci_dev);
//
static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
{
+#ifdef RT2860
+ {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2860_PCI_DEVICE_ID)}, //RT28602.4G
+ {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2860_PCIe_DEVICE_ID)},
+ {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2760_PCI_DEVICE_ID)},
+ {PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC2790_PCIe_DEVICE_ID)},
+ {PCI_DEVICE(VEN_AWT_PCI_VENDOR_ID, VEN_AWT_PCIe_DEVICE_ID)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7708)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7728)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7758)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7727)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7738)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7748)},
+ {PCI_DEVICE(EDIMAX_PCI_VENDOR_ID, 0x7768)},
+#endif
#ifdef RT3090
{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC3090_PCIe_DEVICE_ID)},
{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC3091_PCIe_DEVICE_ID)},
{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC3092_PCIe_DEVICE_ID)},
- {PCI_DEVICE(0x1462, 0x891A)},
#endif // RT3090 //
#ifdef RT3390
{PCI_DEVICE(NIC_PCI_VENDOR_ID, NIC3390_PCIe_DEVICE_ID)},
@@ -94,11 +99,9 @@ static struct pci_device_id rt2860_pci_tbl[] __devinitdata =
};
MODULE_DEVICE_TABLE(pci, rt2860_pci_tbl);
-#ifdef CONFIG_STA_SUPPORT
#ifdef MODULE_VERSION
MODULE_VERSION(STA_DRIVER_VERSION);
#endif
-#endif // CONFIG_STA_SUPPORT //
//
@@ -106,21 +109,14 @@ MODULE_VERSION(STA_DRIVER_VERSION);
//
static struct pci_driver rt2860_driver =
{
- name: "rt3090",
+ name: "rt2860",
id_table: rt2860_pci_tbl,
probe: rt2860_probe,
-#if LINUX_VERSION_CODE >= 0x20412
remove: __devexit_p(rt2860_remove_one),
-#else
- remove: __devexit(rt2860_remove_one),
-#endif
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#ifdef CONFIG_PM
suspend: rt2860_suspend,
resume: rt2860_resume,
#endif
-#endif
};
@@ -129,7 +125,6 @@ static struct pci_driver rt2860_driver =
* PCI device initialization related procedures.
*
***************************************************************************/
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
#ifdef CONFIG_PM
VOID RT2860RejectPendingPackets(
@@ -156,7 +151,7 @@ static int rt2860_suspend(
}
else
{
- pAd = (PRTMP_ADAPTER)RTMP_OS_NETDEV_GET_PRIV(net_dev);
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
/* we can not use IFF_UP because ra0 down but ra1 up */
/* and 1 suspend/resume function for 1 module, not for each interface */
@@ -183,7 +178,6 @@ static int rt2860_suspend(
}
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
// reference to http://vovo2000.com/type-lab/linux/kernel-api/linux-kernel-api.html
// enable device to generate PME# when suspended
// pci_choose_state(): Choose the power state of a PCI device to be suspended
@@ -194,7 +188,6 @@ static int rt2860_suspend(
pci_disable_device(pci_dev);
retval = pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));
-#endif
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_suspend()\n"));
return retval;
@@ -205,8 +198,6 @@ static int rt2860_resume(
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)NULL;
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
INT32 retval;
@@ -231,7 +222,6 @@ static int rt2860_resume(
printk("pci enable fail!\n");
return 0;
}
-#endif
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_resume()\n"));
@@ -240,7 +230,7 @@ static int rt2860_resume(
DBGPRINT(RT_DEBUG_ERROR, ("net_dev == NULL!\n"));
}
else
- pAd = (PRTMP_ADAPTER)RTMP_OS_NETDEV_GET_PRIV(net_dev);
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
if (pAd != NULL)
{
@@ -275,16 +265,11 @@ static int rt2860_resume(
return 0;
}
#endif // CONFIG_PM //
-#endif
static INT __init rt2860_init_module(VOID)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return pci_register_driver(&rt2860_driver);
-#else
- return pci_module_init(&rt2860_driver);
-#endif
}
@@ -325,11 +310,7 @@ static INT __devinit rt2860_probe(
return rv;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- print_name = pci_dev ? pci_name(pci_dev) : "rt3090";
-#else
- print_name = pci_dev ? pci_dev->slot_name : "rt3090";
-#endif // LINUX_VERSION_CODE //
+ print_name = pci_name(pci_dev);
if ((rv = pci_request_regions(pci_dev, print_name)) != 0)
{
@@ -360,7 +341,7 @@ static INT __devinit rt2860_probe(
handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL);
if (handle == NULL)
{
- DBGPRINT(RT_DEBUG_ERROR, ("%s(): Allocate memory for os handle failed!\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_ERROR, ("%s(): Allocate memory for os handle failed!\n", __func__));
goto err_out_iounmap;
}
@@ -385,15 +366,11 @@ static INT __devinit rt2860_probe(
net_dev->base_addr = csr_addr; // Save CSR virtual address and irq to device structure
pci_set_drvdata(pci_dev, net_dev); // Set driver data
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
/* for supporting Network Manager */
/* Set the sysfs physical device reference for the network logical device
* if set prior to registration will cause a symlink during initialization.
*/
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
SET_NETDEV_DEV(net_dev, &(pci_dev->dev));
-#endif
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
//All done, it's time to register the net device to linux kernel.
@@ -402,10 +379,8 @@ static INT __devinit rt2860_probe(
if (rv)
goto err_out_free_netdev;
-#ifdef CONFIG_STA_SUPPORT
pAd->StaCfg.OriDevType = net_dev->type;
-#endif // CONFIG_STA_SUPPORT //
-RTMPInitPCIeDevice(pci_dev, pAd);
+ RTMPInitPCIeDevice(pci_dev, pAd);
DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_probe\n"));
@@ -440,9 +415,11 @@ static VOID __devexit rt2860_remove_one(
IN struct pci_dev *pci_dev)
{
PNET_DEV net_dev = pci_get_drvdata(pci_dev);
- RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
+ RTMP_ADAPTER *pAd = NULL;
ULONG csr_addr = net_dev->base_addr; // pAd->CSRBaseAddress;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
DBGPRINT(RT_DEBUG_TRACE, ("===> rt2860_remove_one\n"));
if (pAd != NULL)
@@ -501,7 +478,6 @@ BOOLEAN RT28XXChipsetCheck(
}
-
/***************************************************************************
*
* PCIe device initialization related procedures.
@@ -519,6 +495,11 @@ BOOLEAN RT28XXChipsetCheck(
device_id = le2cpu16(device_id);
pObj->DeviceID = device_id;
if (
+#ifdef RT2860
+ (device_id == NIC2860_PCIe_DEVICE_ID) ||
+ (device_id == NIC2790_PCIe_DEVICE_ID) ||
+ (device_id == VEN_AWT_PCIe_DEVICE_ID) ||
+#endif
#ifdef RT3090
(device_id == NIC3090_PCIe_DEVICE_ID) ||
(device_id == NIC3091_PCIe_DEVICE_ID) ||
@@ -546,7 +527,7 @@ BOOLEAN RT28XXChipsetCheck(
}
}
-#ifdef CONFIG_STA_SUPPORT
+
VOID RTMPInitPCIeLinkCtrlValue(
IN PRTMP_ADAPTER pAd)
{
@@ -561,12 +542,13 @@ VOID RTMPInitPCIeLinkCtrlValue(
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
return;
- DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __func__));
// Init EEPROM, and save settings
if (!(IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)))
{
RT28xx_EEPROM_READ16(pAd, 0x22, PCIePowerSaveLevel);
pAd->PCIePowerSaveLevel = PCIePowerSaveLevel & 0xff;
+
pAd->LnkCtrlBitMask = 0;
if ((PCIePowerSaveLevel&0xff) == 0xff)
{
@@ -707,7 +689,6 @@ VOID RTMPInitPCIeLinkCtrlValue(
DBGPRINT(RT_DEBUG_TRACE, ("====> rt30xxF LinkCtrlSetting = 0x%x.\n", LinkCtrlSetting));
AsicSendCommandToMcu(pAd, 0x83, 0xff, (UCHAR)PCIePowerSaveLevel, LinkCtrlSetting);
}
-
}
// Find Ralink PCIe Device's Express Capability Offset
@@ -724,6 +705,16 @@ VOID RTMPInitPCIeLinkCtrlValue(
pAd->RLnkCtrlConfiguration = (Configuration & 0x103);
Configuration &= 0xfefc;
Configuration |= (0x0);
+#ifdef RT2860
+ if ((pObj->DeviceID == NIC2860_PCIe_DEVICE_ID)
+ ||(pObj->DeviceID == NIC2790_PCIe_DEVICE_ID))
+ {
+ reg16 = cpu2le16(Configuration);
+ pci_write_config_word(pObj->pci_dev, pAd->RLnkCtrlOffset, reg16);
+ DBGPRINT(RT_DEBUG_TRACE, ("Write (Ralink PCIe Link Control Register) offset 0x%x = 0x%x\n",
+ pos + PCI_EXP_LNKCTL, Configuration));
+ }
+#endif // RT2860 //
RTMPFindHostPCIDev(pAd);
if (pObj->parent_pci_dev)
@@ -737,17 +728,7 @@ VOID RTMPInitPCIeLinkCtrlValue(
bFindIntel = TRUE;
RTMP_SET_PSFLAG(pAd, fRTMP_PS_TOGGLE_L1);
}
- /*
- else if ((vendor_id == PCIBUS_AMD_VENDOR1)
- && (DeviceID == 0x96000000))
- {
- //Verified 2792 Aspire 8530 AMD NB (S3/S4/CBoot/WBoot/Chariot) by customer and ourselves.
- // So use L1 Toggle method in this NB.
- bFindIntel = TRUE;
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_TOGGLE_L1);
- DBGPRINT(RT_DEBUG_TRACE, ("PSM : Aspire 8530 AMD NB. Use L1 Toggle. \n"));
- }
- */
+
// Find PCI-to-PCI Bridge Express Capability Offset
pos = pci_find_capability(pObj->parent_pci_dev, PCI_CAP_ID_EXP);
@@ -766,12 +747,18 @@ VOID RTMPInitPCIeLinkCtrlValue(
switch (pObj->DeviceID)
{
+#ifdef RT2860
+ case NIC2860_PCIe_DEVICE_ID:
+ case NIC2790_PCIe_DEVICE_ID:
+ bChange = TRUE;
+ break;
+#endif // RT2860 //
#ifdef RT3090
case NIC3090_PCIe_DEVICE_ID:
case NIC3091_PCIe_DEVICE_ID:
case NIC3092_PCIe_DEVICE_ID:
if (bFindIntel == FALSE)
- bChange = TRUE;
+ bChange = TRUE;
break;
#endif // RT3090 //
default:
@@ -789,7 +776,7 @@ VOID RTMPInitPCIeLinkCtrlValue(
else
{
pAd->HostLnkCtrlOffset = 0;
- DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot find PCI-to-PCI Bridge PCI Express Capability!\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot find PCI-to-PCI Bridge PCI Express Capability!\n", __func__));
}
}
}
@@ -797,7 +784,7 @@ VOID RTMPInitPCIeLinkCtrlValue(
{
pAd->RLnkCtrlOffset = 0;
pAd->HostLnkCtrlOffset = 0;
- DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot find Ralink PCIe Device's PCI Express Capability!\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot find Ralink PCIe Device's PCI Express Capability!\n", __func__));
}
if (bFindIntel == FALSE)
@@ -842,18 +829,14 @@ VOID RTMPFindHostPCIDev(
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
return;
- DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __func__));
pObj->parent_pci_dev = NULL;
if (pObj->pci_dev->bus->parent)
{
for (DevFn = 0; DevFn < 255; DevFn++)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
pPci_dev = pci_get_slot(pObj->pci_dev->bus->parent, DevFn);
-#else
- pPci_dev = pci_find_slot(pObj->pci_dev->bus->parent->number, DevFn);
-#endif
if (pPci_dev)
{
pci_read_config_word(pPci_dev, PCI_CLASS_DEVICE, &reg16);
@@ -893,6 +876,11 @@ VOID RTMPPCIeLinkCtrlValueRestore(
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
return;
+#ifdef RT2860
+ if (!((pObj->DeviceID == NIC2860_PCIe_DEVICE_ID)
+ ||(pObj->DeviceID == NIC2790_PCIe_DEVICE_ID)))
+ return;
+#endif // RT2860 //
// Check PSControl Configuration
if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
return TRUE;
@@ -906,7 +894,8 @@ VOID RTMPPCIeLinkCtrlValueRestore(
||(pObj->DeviceID == NIC3092_PCIe_DEVICE_ID))
return;
#endif // RT3090 //
- DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __FUNCTION__));
+
+ DBGPRINT(RT_DEBUG_TRACE, ("%s.===>\n", __func__));
PCIePowerSaveLevel = pAd->PCIePowerSaveLevel;
if ((PCIePowerSaveLevel&0xff) == 0xff)
{
@@ -954,7 +943,7 @@ VOID RTMPPCIeLinkCtrlValueRestore(
DBGPRINT(RT_DEBUG_ERROR, ("Restore Ralink : PCI_REG_READ_WORD failed (Configuration = 0x%x)\n", Configuration));
}
- DBGPRINT(RT_DEBUG_TRACE,("%s <===\n", __FUNCTION__));
+ DBGPRINT(RT_DEBUG_TRACE,("%s <===\n", __func__));
}
/*
@@ -981,6 +970,11 @@ VOID RTMPPCIeLinkCtrlSetting(
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
return;
+#ifdef RT2860
+ if (!((pObj->DeviceID == NIC2860_PCIe_DEVICE_ID)
+ ||(pObj->DeviceID == NIC2790_PCIe_DEVICE_ID)))
+ return;
+#endif // RT2860 //
// Check PSControl Configuration
if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
return TRUE;
@@ -999,7 +993,8 @@ VOID RTMPPCIeLinkCtrlSetting(
DBGPRINT(RT_DEBUG_INFO, ("RTMPPCIePowerLinkCtrl return on fRTMP_PS_CAN_GO_SLEEP flag\n"));
return;
}
- DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __FUNCTION__));
+
+ DBGPRINT(RT_DEBUG_TRACE,("%s===>\n", __func__));
PCIePowerSaveLevel = pAd->PCIePowerSaveLevel;
if ((PCIePowerSaveLevel&0xff) == 0xff)
{
@@ -1078,6 +1073,7 @@ VOID RTMPPCIeLinkCtrlSetting(
DBGPRINT(RT_DEBUG_TRACE,("RTMPPCIePowerLinkCtrl <==============\n"));
}
+
/*
========================================================================
@@ -1189,7 +1185,4 @@ VOID RTMPrt3xSetPCIePowerLinkCtrl(
DBGPRINT(RT_DEBUG_TRACE, ("PSM :Write Ralink device L1/L0s Value = 0x%x\n", Configuration));
}
DBGPRINT(RT_DEBUG_INFO,("PSM :RTMPrt3xSetPCIePowerLinkCtrl <==============\n"));
-
}
-
-#endif // CONFIG_STA_SUPPORT //
diff --git a/drivers/staging/rt2860/rt2860.h b/drivers/staging/rt2860/rt2860.h
deleted file mode 100644
index ed28fe5757c9..000000000000
--- a/drivers/staging/rt2860/rt2860.h
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#ifndef __RT2860_H__
-#define __RT2860_H__
-
-#define RT28xx_CHIP_NAME "RT2860"
-
-#define TXINFO_SIZE 0
-#define TXPADDING_SIZE 0
-
-/* ----------------- EEPROM Related MACRO ----------------- */
-#define RT28xx_EEPROM_READ16(pAd, offset, var) \
- var = RTMP_EEPROM_READ16(pAd, offset)
-
-#define RT28xx_EEPROM_WRITE16(pAd, offset, var) \
- RTMP_EEPROM_WRITE16(pAd, offset, var)
-
-/* ----------------- TASK/THREAD Related MACRO ----------------- */
-#define RT28XX_TASK_THREAD_INIT(pAd, Status) \
- init_thread_task(pAd); NICInitTxRxRingAndBacklogQueue(pAd); \
- Status = NDIS_STATUS_SUCCESS;
-
-/* function declarations */
-#define IRQ_HANDLE_TYPE irqreturn_t
-
-IRQ_HANDLE_TYPE
-rt2860_interrupt(int irq, void *dev_instance);
-
-/* ----------------- Frimware Related MACRO ----------------- */
-#define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
- do{ \
- ULONG _i, _firm; \
- RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x10000); \
- \
- for(_i=0; _i<_FwLen; _i+=4) \
- { \
- _firm = _pFwImage[_i] + \
- (_pFwImage[_i+3] << 24) + \
- (_pFwImage[_i+2] << 16) + \
- (_pFwImage[_i+1] << 8); \
- RTMP_IO_WRITE32(_pAd, FIRMWARE_IMAGE_BASE + _i, _firm); \
- } \
- RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x00000); \
- RTMP_IO_WRITE32(_pAd, PBF_SYS_CTRL, 0x00001); \
- \
- /* initialize BBP R/W access agent */ \
- RTMP_IO_WRITE32(_pAd, H2M_BBP_AGENT, 0); \
- RTMP_IO_WRITE32(_pAd, H2M_MAILBOX_CSR, 0); \
- }while(0)
-
-/* ----------------- TX Related MACRO ----------------- */
-#define RT28XX_START_DEQUEUE(pAd, QueIdx, irqFlags) do{}while(0)
-#define RT28XX_STOP_DEQUEUE(pAd, QueIdx, irqFlags) do{}while(0)
-
-
-#define RT28XX_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \
- ((freeNum) >= (ULONG)(pTxBlk->TotalFragNum + RTMP_GET_PACKET_FRAGMENTS(pPacket) + 3)) /* rough estimate we will use 3 more descriptor. */
-#define RT28XX_RELEASE_DESC_RESOURCE(pAd, QueIdx) \
- do{}while(0)
-
-#define NEED_QUEUE_BACK_FOR_AGG(pAd, QueIdx, freeNum, _TxFrameType) \
- (((freeNum != (TX_RING_SIZE-1)) && (pAd->TxSwQueue[QueIdx].Number == 0)) || (freeNum<3))
- //(((freeNum) != (TX_RING_SIZE-1)) && (pAd->TxSwQueue[QueIdx].Number == 1 /*0*/))
-
-
-#define HAL_KickOutMgmtTx(_pAd, _QueIdx, _pPacket, _pSrcBufVA, _SrcBufLen) \
- RtmpPCIMgmtKickOut(_pAd, _QueIdx, _pPacket, _pSrcBufVA, _SrcBufLen)
-
-#define RTMP_PKT_TAIL_PADDING 0
-
-#define fRTMP_ADAPTER_NEED_STOP_TX 0
-
-#define HAL_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber) \
- /* RtmpPCI_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber)*/
-
-#define HAL_WriteTxResource(pAd, pTxBlk,bIsLast, pFreeNumber) \
- RtmpPCI_WriteSingleTxResource(pAd, pTxBlk, bIsLast, pFreeNumber)
-
-#define HAL_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber) \
- RtmpPCI_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber)
-
-#define HAL_WriteMultiTxResource(pAd, pTxBlk,frameNum, pFreeNumber) \
- RtmpPCI_WriteMultiTxResource(pAd, pTxBlk, frameNum, pFreeNumber)
-
-#define HAL_FinalWriteTxResource(_pAd, _pTxBlk, _TotalMPDUSize, _FirstTxIdx) \
- RtmpPCI_FinalWriteTxResource(_pAd, _pTxBlk, _TotalMPDUSize, _FirstTxIdx)
-
-#define HAL_LastTxIdx(_pAd, _QueIdx,_LastTxIdx) \
- /*RtmpPCIDataLastTxIdx(_pAd, _QueIdx,_LastTxIdx)*/
-
-#define HAL_KickOutTx(_pAd, _pTxBlk, _QueIdx) \
- RTMP_IO_WRITE32((_pAd), TX_CTX_IDX0+((_QueIdx)*0x10), (_pAd)->TxRing[(_QueIdx)].TxCpuIdx)
-/* RtmpPCIDataKickOut(_pAd, _pTxBlk, _QueIdx)*/
-
-#define HAL_KickOutNullFrameTx(_pAd, _QueIdx, _pNullFrame, _frameLen) \
- MiniportMMRequest(_pAd, _QueIdx, _pNullFrame, _frameLen)
-
-#define GET_TXRING_FREENO(_pAd, _QueIdx) \
- (_pAd->TxRing[_QueIdx].TxSwFreeIdx > _pAd->TxRing[_QueIdx].TxCpuIdx) ? \
- (_pAd->TxRing[_QueIdx].TxSwFreeIdx - _pAd->TxRing[_QueIdx].TxCpuIdx - 1) \
- : \
- (_pAd->TxRing[_QueIdx].TxSwFreeIdx + TX_RING_SIZE - _pAd->TxRing[_QueIdx].TxCpuIdx - 1);
-
-
-#define GET_MGMTRING_FREENO(_pAd) \
- (_pAd->MgmtRing.TxSwFreeIdx > _pAd->MgmtRing.TxCpuIdx) ? \
- (_pAd->MgmtRing.TxSwFreeIdx - _pAd->MgmtRing.TxCpuIdx - 1) \
- : \
- (_pAd->MgmtRing.TxSwFreeIdx + MGMT_RING_SIZE - _pAd->MgmtRing.TxCpuIdx - 1);
-
-
-/* ----------------- RX Related MACRO ----------------- */
-
-// no use
-#define RT28XX_RCV_PKT_GET_INIT(pAd)
-#define RT28XX_RV_A_BUF_END
-//#define RT28XX_RV_ALL_BUF_END
-
-
-/* ----------------- ASIC Related MACRO ----------------- */
-// no use
-#define RT28XX_DMA_POST_WRITE(pAd)
-
-// reset MAC of a station entry to 0x000000000000
-#define RT28XX_STA_ENTRY_MAC_RESET(pAd, Wcid) \
- AsicDelWcidTab(pAd, Wcid);
-
-// add this entry into ASIC RX WCID search table
-#define RT28XX_STA_ENTRY_ADD(pAd, pEntry) \
- AsicUpdateRxWCIDTable(pAd, pEntry->Aid, pEntry->Addr);
-
-// remove Pair-wise key material from ASIC
-#define RT28XX_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid) \
- AsicRemovePairwiseKeyEntry(pAd, BssIdx, (UCHAR)Wcid);
-
-// add Client security information into ASIC WCID table and IVEIV table
-#define RT28XX_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
- RTMPAddWcidAttributeEntry(pAd, apidx, KeyID, \
- pAd->SharedKey[apidx][KeyID].CipherAlg, pEntry);
-
-#define RT28XX_SECURITY_KEY_ADD(pAd, apidx, KeyID, pEntry) \
- { /* update pairwise key information to ASIC Shared Key Table */ \
- AsicAddSharedKeyEntry(pAd, apidx, KeyID, \
- pAd->SharedKey[apidx][KeyID].CipherAlg, \
- pAd->SharedKey[apidx][KeyID].Key, \
- pAd->SharedKey[apidx][KeyID].TxMic, \
- pAd->SharedKey[apidx][KeyID].RxMic); \
- /* update ASIC WCID attribute table and IVEIV table */ \
- RTMPAddWcidAttributeEntry(pAd, apidx, KeyID, \
- pAd->SharedKey[apidx][KeyID].CipherAlg, \
- pEntry); }
-
-
-// Insert the BA bitmap to ASIC for the Wcid entry
-#define RT28XX_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
- do{ \
- UINT32 _Value = 0, _Offset; \
- _Offset = MAC_WCID_BASE + (_Aid) * HW_WCID_ENTRY_SIZE + 4; \
- RTMP_IO_READ32((_pAd), _Offset, &_Value); \
- _Value |= (0x10000<<(_TID)); \
- RTMP_IO_WRITE32((_pAd), _Offset, _Value); \
- }while(0)
-
-
-// Remove the BA bitmap from ASIC for the Wcid entry
-// bitmap field starts at 0x10000 in ASIC WCID table
-#define RT28XX_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
- do{ \
- UINT32 _Value = 0, _Offset; \
- _Offset = MAC_WCID_BASE + (_Wcid) * HW_WCID_ENTRY_SIZE + 4; \
- RTMP_IO_READ32((_pAd), _Offset, &_Value); \
- _Value &= (~(0x10000 << (_TID))); \
- RTMP_IO_WRITE32((_pAd), _Offset, _Value); \
- }while(0)
-
-
-/* ----------------- PCI/USB Related MACRO ----------------- */
-
-#define RT28XX_HANDLE_DEV_ASSIGN(handle, dev_p) \
- ((POS_COOKIE)handle)->pci_dev = dev_p;
-
-// set driver data
-#define RT28XX_DRVDATA_SET(_a) pci_set_drvdata(_a, net_dev);
-
-#define RT28XX_UNMAP() \
-{ if (net_dev->base_addr) { \
- iounmap((void *)(net_dev->base_addr)); \
- release_mem_region(pci_resource_start(dev_p, 0), \
- pci_resource_len(dev_p, 0)); } \
- if (net_dev->irq) pci_release_regions(dev_p); }
-
-#ifdef PCI_MSI_SUPPORT
-#define RTMP_MSI_ENABLE(_pAd) \
-{ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; }
-
-#define RTMP_MSI_DISABLE(_pAd) \
-{ POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- if (_pAd->HaveMsi == TRUE) \
- pci_disable_msi(_pObj->pci_dev); \
- _pAd->HaveMsi = FALSE; }
-#else
-#define RTMP_MSI_ENABLE(_pAd)
-#define RTMP_MSI_DISABLE(_pAd)
-#endif // PCI_MSI_SUPPORT //
-
-#define SA_SHIRQ IRQF_SHARED
-
-#define RT28XX_IRQ_REQUEST(net_dev) \
-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- RTMP_MSI_ENABLE(_pAd); \
- if ((retval = request_irq(_pObj->pci_dev->irq, \
- rt2860_interrupt, SA_SHIRQ, \
- (net_dev)->name, (net_dev)))) { \
- printk("RT2860: request_irq ERROR(%d)\n", retval); \
- return retval; } }
-
-#define RT28XX_IRQ_RELEASE(net_dev) \
-{ PRTMP_ADAPTER _pAd = (PRTMP_ADAPTER)((net_dev)->ml_priv); \
- POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \
- synchronize_irq(_pObj->pci_dev->irq); \
- free_irq(_pObj->pci_dev->irq, (net_dev)); \
- RTMP_MSI_DISABLE(_pAd); }
-
-#define RT28XX_IRQ_INIT(pAd) \
- { pAd->int_enable_reg = ((DELAYINTMASK) | \
- (RxINT|TxDataInt|TxMgmtInt)) & ~(0x03); \
- pAd->int_disable_mask = 0; \
- pAd->int_pending = 0; }
-
-#define RT28XX_IRQ_ENABLE(pAd) \
- { /* clear garbage ints */ \
- RTMP_IO_WRITE32(pAd, INT_SOURCE_CSR, 0xffffffff); \
- NICEnableInterrupt(pAd); }
-
-#define RT28XX_PUT_DEVICE(dev_p)
-
-
-/* ----------------- MLME Related MACRO ----------------- */
-#define RT28XX_MLME_HANDLER(pAd) MlmeHandler(pAd)
-
-#define RT28XX_MLME_PRE_SANITY_CHECK(pAd)
-
-#define RT28XX_MLME_STA_QUICK_RSP_WAKE_UP(pAd) \
- RTMPSetTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, 100);
-
-#define RT28XX_MLME_RESET_STATE_MACHINE(pAd) \
- MlmeRestartStateMachine(pAd)
-
-#define RT28XX_HANDLE_COUNTER_MEASURE(_pAd, _pEntry) \
- HandleCounterMeasure(_pAd, _pEntry)
-
-/* ----------------- Power Save Related MACRO ----------------- */
-#define RT28XX_PS_POLL_ENQUEUE(pAd) EnqueuePsPoll(pAd)
-
-//
-// Device ID & Vendor ID, these values should match EEPROM value
-//
-#define NIC2860_PCI_DEVICE_ID 0x0601
-#define NIC2860_PCIe_DEVICE_ID 0x0681
-#define NIC2760_PCI_DEVICE_ID 0x0701 // 1T/2R Cardbus ???
-#define NIC2790_PCIe_DEVICE_ID 0x0781 // 1T/2R miniCard
-
-#define NIC_PCI_VENDOR_ID 0x1814
-
-#define VEN_AWT_PCIe_DEVICE_ID 0x1059
-#define VEN_AWT_PCI_VENDOR_ID 0x1A3B
-
-#define EDIMAX_PCI_VENDOR_ID 0x1432
-
-// For RTMPPCIePowerLinkCtrlRestore () function
-#define RESTORE_HALT 1
-#define RESTORE_WAKEUP 2
-#define RESTORE_CLOSE 3
-
-#define PowerSafeCID 1
-#define PowerRadioOffCID 2
-#define PowerWakeCID 3
-#define CID0MASK 0x000000ff
-#define CID1MASK 0x0000ff00
-#define CID2MASK 0x00ff0000
-#define CID3MASK 0xff000000
-
-#define PCI_REG_READ_WORD(pci_dev, offset, Configuration) \
- if (pci_read_config_word(pci_dev, offset, &reg16) == 0) \
- Configuration = le2cpu16(reg16); \
- else \
- Configuration = 0;
-
-#define PCI_REG_WIRTE_WORD(pci_dev, offset, Configuration) \
- reg16 = cpu2le16(Configuration); \
- pci_write_config_word(pci_dev, offset, reg16); \
-
-#define RT28XX_STA_FORCE_WAKEUP(pAd, Level) \
- RT28xxPciStaAsicForceWakeup(pAd, Level);
-
-#define RT28XX_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp) \
- RT28xxPciStaAsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
-
-#define RT28XX_MLME_RADIO_ON(pAd) \
- RT28xxPciMlmeRadioOn(pAd);
-
-#define RT28XX_MLME_RADIO_OFF(pAd) \
- RT28xxPciMlmeRadioOFF(pAd);
-
-#endif //__RT2860_H__
-
diff --git a/drivers/staging/rt2860/rt_config.h b/drivers/staging/rt2860/rt_config.h
index 2093a80b19df..67b957b271e9 100644
--- a/drivers/staging/rt2860/rt_config.h
+++ b/drivers/staging/rt2860/rt_config.h
@@ -41,29 +41,37 @@
#define __RT_CONFIG_H__
#include "rtmp_type.h"
-#ifdef LINUX
-#include "rt_linux.h"
-#endif
-#include "rtmp_def.h"
-#include "rt28xx.h"
+#include "rtmp_os.h"
-#ifdef RT2860
-#include "rt2860.h"
-#endif
-#ifdef RT2870
-#include "../rt2870/rt2870.h"
-#endif // RT2870 //
+#include "rtmp_def.h"
+#include "rtmp_chip.h"
+#include "rtmp_timer.h"
#include "oid.h"
#include "mlme.h"
#include "wpa.h"
-#include "md5.h"
+#include "crypt_md5.h"
+#include "crypt_sha2.h"
+#include "crypt_hmac.h"
#include "rtmp.h"
#include "ap.h"
#include "dfs.h"
#include "chlist.h"
#include "spectrum.h"
+#include "eeprom.h"
+#if defined(RTMP_PCI_SUPPORT) || defined(RTMP_USB_SUPPORT)
+#include "rtmp_mcu.h"
+#endif
+
+#undef AP_WSC_INCLUDED
+#undef STA_WSC_INCLUDED
+#undef WSC_INCLUDED
+
+
+
+
+
#ifdef IGMP_SNOOP_SUPPORT
#include "igmp_snoop.h"
#endif // IGMP_SNOOP_SUPPORT //
diff --git a/drivers/staging/rt2860/rt_linux.c b/drivers/staging/rt2860/rt_linux.c
index ed27b8545a1b..b57836086600 100644
--- a/drivers/staging/rt2860/rt_linux.c
+++ b/drivers/staging/rt2860/rt_linux.c
@@ -30,27 +30,6 @@
ULONG RTDebugLevel = RT_DEBUG_ERROR;
-BUILD_TIMER_FUNCTION(MlmePeriodicExec);
-BUILD_TIMER_FUNCTION(AsicRxAntEvalTimeout);
-BUILD_TIMER_FUNCTION(APSDPeriodicExec);
-BUILD_TIMER_FUNCTION(AsicRfTuningExec);
-#ifdef RT2870
-BUILD_TIMER_FUNCTION(BeaconUpdateExec);
-#endif // RT2870 //
-
-BUILD_TIMER_FUNCTION(BeaconTimeout);
-BUILD_TIMER_FUNCTION(ScanTimeout);
-BUILD_TIMER_FUNCTION(AuthTimeout);
-BUILD_TIMER_FUNCTION(AssocTimeout);
-BUILD_TIMER_FUNCTION(ReassocTimeout);
-BUILD_TIMER_FUNCTION(DisassocTimeout);
-BUILD_TIMER_FUNCTION(LinkDownExec);
-BUILD_TIMER_FUNCTION(StaQuickResponeForRateUpExec);
-BUILD_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
-#ifdef RT2860
-BUILD_TIMER_FUNCTION(PsPollWakeExec);
-BUILD_TIMER_FUNCTION(RadioOnExec);
-#endif
// for wireless system event message
char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = {
@@ -106,7 +85,7 @@ VOID RTMP_SetPeriodicTimer(
IN NDIS_MINIPORT_TIMER *pTimer,
IN unsigned long timeout)
{
- timeout = ((timeout*HZ) / 1000);
+ timeout = ((timeout*OS_HZ) / 1000);
pTimer->expires = jiffies + timeout;
add_timer(pTimer);
}
@@ -131,7 +110,7 @@ VOID RTMP_OS_Add_Timer(
if (timer_pending(pTimer))
return;
- timeout = ((timeout*HZ) / 1000);
+ timeout = ((timeout*OS_HZ) / 1000);
pTimer->expires = jiffies + timeout;
add_timer(pTimer);
}
@@ -140,7 +119,7 @@ VOID RTMP_OS_Mod_Timer(
IN NDIS_MINIPORT_TIMER *pTimer,
IN unsigned long timeout)
{
- timeout = ((timeout*HZ) / 1000);
+ timeout = ((timeout*OS_HZ) / 1000);
mod_timer(pTimer, jiffies + timeout);
}
@@ -186,8 +165,8 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time)
// pAd MUST allow to be NULL
NDIS_STATUS os_alloc_mem(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR *mem,
+ IN RTMP_ADAPTER *pAd,
+ OUT UCHAR **mem,
IN ULONG size)
{
*mem = (PUCHAR) kmalloc(size, GFP_ATOMIC);
@@ -200,7 +179,7 @@ NDIS_STATUS os_alloc_mem(
// pAd MUST allow to be NULL
NDIS_STATUS os_free_mem(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR mem)
+ IN PVOID mem)
{
ASSERT(mem);
@@ -209,6 +188,20 @@ NDIS_STATUS os_free_mem(
}
+
+
+PNDIS_PACKET RtmpOSNetPktAlloc(
+ IN RTMP_ADAPTER *pAd,
+ IN int size)
+{
+ struct sk_buff *skb;
+ /* Add 2 more bytes for ip header alignment*/
+ skb = dev_alloc_skb(size+2);
+
+ return ((PNDIS_PACKET)skb);
+}
+
+
PNDIS_PACKET RTMP_AllocateFragPacketBuffer(
IN PRTMP_ADAPTER pAd,
IN ULONG Length)
@@ -283,13 +276,19 @@ VOID RTMPFreeAdapter(
os_cookie=(POS_COOKIE)pAd->OS_Cookie;
+ if (pAd->BeaconBuf)
kfree(pAd->BeaconBuf);
NdisFreeSpinLock(&pAd->MgmtRingLock);
-#ifdef RT2860
+
+#ifdef RTMP_MAC_PCI
NdisFreeSpinLock(&pAd->RxRingLock);
-#endif
+#ifdef RT3090
+NdisFreeSpinLock(&pAd->McuCmdLock);
+#endif // RT3090 //
+#endif // RTMP_MAC_PCI //
+
for (index =0 ; index < NUM_OF_TX_RING; index++)
{
NdisFreeSpinLock(&pAd->TxSwQueueLock[index]);
@@ -299,7 +298,9 @@ VOID RTMPFreeAdapter(
NdisFreeSpinLock(&pAd->irq_lock);
+
vfree(pAd); // pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa);
+ if (os_cookie)
kfree(os_cookie);
}
@@ -379,7 +380,7 @@ NDIS_STATUS RTMPAllocateNdisPacket(
ASSERT(DataLen);
// 1. Allocate a packet
- pPacket = (PNDIS_PACKET *) dev_alloc_skb(HeaderLen + DataLen + TXPADDING_SIZE);
+ pPacket = (PNDIS_PACKET *) dev_alloc_skb(HeaderLen + DataLen + RTMP_PKT_TAIL_PADDING);
if (pPacket == NULL)
{
*ppPacket = NULL;
@@ -442,7 +443,7 @@ void RTMP_QueryPacketInfo(
OUT UINT *pSrcBufLen)
{
pPacketInfo->BufferCount = 1;
- pPacketInfo->pFirstBuffer = GET_OS_PKT_DATAPTR(pPacket);
+ pPacketInfo->pFirstBuffer = (PNDIS_BUFFER)GET_OS_PKT_DATAPTR(pPacket);
pPacketInfo->PhysicalBufferCount = 1;
pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket);
@@ -464,7 +465,7 @@ void RTMP_QueryNextPacketInfo(
if (pPacket)
{
pPacketInfo->BufferCount = 1;
- pPacketInfo->pFirstBuffer = GET_OS_PKT_DATAPTR(pPacket);
+ pPacketInfo->pFirstBuffer = (PNDIS_BUFFER)GET_OS_PKT_DATAPTR(pPacket);
pPacketInfo->PhysicalBufferCount = 1;
pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket);
@@ -485,18 +486,6 @@ void RTMP_QueryNextPacketInfo(
}
}
-// not yet support MBSS
-PNET_DEV get_netdev_from_bssid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR FromWhichBSSID)
-{
- PNET_DEV dev_p = NULL;
-
- dev_p = pAd->net_dev;
-
- ASSERT(dev_p);
- return dev_p; /* return one of MBSS */
-}
PNDIS_PACKET DuplicatePacket(
IN PRTMP_ADAPTER pAd,
@@ -538,9 +527,9 @@ PNDIS_PACKET duplicate_pkt(
if ((skb = __dev_alloc_skb(HdrLen + DataSize + 2, MEM_ALLOC_FLAG)) != NULL)
{
skb_reserve(skb, 2);
- NdisMoveMemory(skb_tail_pointer(skb), pHeader802_3, HdrLen);
+ NdisMoveMemory(skb->tail, pHeader802_3, HdrLen);
skb_put(skb, HdrLen);
- NdisMoveMemory(skb_tail_pointer(skb), pData, DataSize);
+ NdisMoveMemory(skb->tail, pData, DataSize);
skb_put(skb, DataSize);
skb->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
pPacket = OSPKT_TO_RTPKT(skb);
@@ -649,7 +638,9 @@ void wlan_802_11_to_802_3_packet(
//
NdisMoveMemory(skb_push(pOSPkt, LENGTH_802_3), pHeader802_3, LENGTH_802_3);
-}
+ }
+
+
void announce_802_3_packet(
IN PRTMP_ADAPTER pAd,
@@ -726,8 +717,8 @@ VOID RTMPSendWirelessEvent(
IN CHAR Rssi)
{
- union iwreq_data wrqu;
- PUCHAR pBuf = NULL, pBufPtr = NULL;
+ //union iwreq_data wrqu;
+ PSTRING pBuf = NULL, pBufPtr = NULL;
USHORT event, type, BufLen;
UCHAR event_table_len = 0;
@@ -788,13 +779,7 @@ VOID RTMPSendWirelessEvent(
pBufPtr[pBufPtr - pBuf] = '\0';
BufLen = pBufPtr - pBuf;
- memset(&wrqu, 0, sizeof(wrqu));
- wrqu.data.flags = Event_flag;
- wrqu.data.length = BufLen;
-
- //send wireless event
- wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, pBuf);
-
+ RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, Event_flag, NULL, (PUCHAR)pBuf, BufLen);
//DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __func__, pBuf));
kfree(pBuf);
@@ -896,7 +881,7 @@ void send_monitor_packets(
ph->msgcode = DIDmsg_lnxind_wlansniffrm;
ph->msglen = sizeof(wlan_ng_prism2_header);
- strcpy(ph->devname, pAd->net_dev->name);
+ strcpy((PSTRING) ph->devname, (PSTRING) pAd->net_dev->name);
ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime;
ph->hosttime.status = 0;
@@ -972,18 +957,275 @@ err_free_sk_buff:
}
-void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify)
+
+/*******************************************************************************
+
+ Device IRQ related functions.
+
+ *******************************************************************************/
+int RtmpOSIRQRequest(IN PNET_DEV pNetDev)
+{
+ struct net_device *net_dev = pNetDev;
+ PRTMP_ADAPTER pAd = NULL;
+ int retval = 0;
+
+ GET_PAD_FROM_NET_DEV(pAd, pNetDev);
+
+ ASSERT(pAd);
+
+#ifdef RTMP_PCI_SUPPORT
+ if (pAd->infType == RTMP_DEV_INF_PCI)
+ {
+ POS_COOKIE _pObj = (POS_COOKIE)(pAd->OS_Cookie);
+ RTMP_MSI_ENABLE(pAd);
+ retval = request_irq(_pObj->pci_dev->irq, rt2860_interrupt, SA_SHIRQ, (net_dev)->name, (net_dev));
+ if (retval != 0)
+ printk("RT2860: request_irq ERROR(%d)\n", retval);
+ }
+#endif // RTMP_PCI_SUPPORT //
+
+
+ return retval;
+
+}
+
+
+int RtmpOSIRQRelease(IN PNET_DEV pNetDev)
{
- daemonize(pThreadName /*"%s",pAd->net_dev->name*/);
+ struct net_device *net_dev = pNetDev;
+ PRTMP_ADAPTER pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
+ ASSERT(pAd);
+
+#ifdef RTMP_PCI_SUPPORT
+ if (pAd->infType == RTMP_DEV_INF_PCI)
+ {
+ POS_COOKIE pObj = (POS_COOKIE)(pAd->OS_Cookie);
+ synchronize_irq(pObj->pci_dev->irq);
+ free_irq(pObj->pci_dev->irq, (net_dev));
+ RTMP_MSI_DISABLE(pAd);
+ }
+#endif // RTMP_PCI_SUPPORT //
+
+
+ return 0;
+}
+
+
+/*******************************************************************************
+
+ File open/close related functions.
+
+ *******************************************************************************/
+RTMP_OS_FD RtmpOSFileOpen(char *pPath, int flag, int mode)
+{
+ struct file *filePtr;
+
+ filePtr = filp_open(pPath, flag, 0);
+ if (IS_ERR(filePtr))
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s(): Error %ld opening %s\n", __func__, -PTR_ERR(filePtr), pPath));
+ }
+
+ return (RTMP_OS_FD)filePtr;
+}
+
+int RtmpOSFileClose(RTMP_OS_FD osfd)
+{
+ filp_close(osfd, NULL);
+ return 0;
+}
+
+
+void RtmpOSFileSeek(RTMP_OS_FD osfd, int offset)
+{
+ osfd->f_pos = offset;
+}
+
+
+int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
+{
+ // The object must have a read method
+ if (osfd->f_op && osfd->f_op->read)
+ {
+ return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
+ return -1;
+ }
+}
+
+
+int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
+{
+ return osfd->f_op->write(osfd, pDataPtr, (size_t)writeLen, &osfd->f_pos);
+}
+
+
+void RtmpOSFSInfoChange(RTMP_OS_FS_INFO *pOSFSInfo, BOOLEAN bSet)
+{
+ if (bSet)
+ {
+ // Save uid and gid used for filesystem access.
+ // Set user and group to 0 (root)
+ pOSFSInfo->fsuid = current_fsuid();
+ pOSFSInfo->fsgid = current_fsgid();
+ pOSFSInfo->fs = get_fs();
+ set_fs(KERNEL_DS);
+ }
+ else
+ {
+ set_fs(pOSFSInfo->fs);
+ }
+}
+
+
+
+/*******************************************************************************
+
+ Task create/management/kill related functions.
+
+ *******************************************************************************/
+NDIS_STATUS RtmpOSTaskKill(
+ IN RTMP_OS_TASK *pTask)
+{
+ RTMP_ADAPTER *pAd;
+ int ret = NDIS_STATUS_FAILURE;
+
+ pAd = (RTMP_ADAPTER *)pTask->priv;
+
+#ifdef KTHREAD_SUPPORT
+ if (pTask->kthread_task)
+ {
+ kthread_stop(pTask->kthread_task);
+ ret = NDIS_STATUS_SUCCESS;
+ }
+#else
+ CHECK_PID_LEGALITY(pTask->taskPID)
+ {
+ printk("Terminate the task(%s) with pid(%d)!\n", pTask->taskName, GET_PID_NUMBER(pTask->taskPID));
+ mb();
+ pTask->task_killed = 1;
+ mb();
+ ret = KILL_THREAD_PID(pTask->taskPID, SIGTERM, 1);
+ if (ret)
+ {
+ printk(KERN_WARNING "kill task(%s) with pid(%d) failed(retVal=%d)!\n",
+ pTask->taskName, GET_PID_NUMBER(pTask->taskPID), ret);
+ }
+ else
+ {
+ wait_for_completion(&pTask->taskComplete);
+ pTask->taskPID = THREAD_PID_INIT_VALUE;
+ pTask->task_killed = 0;
+ ret = NDIS_STATUS_SUCCESS;
+ }
+ }
+#endif
+
+ return ret;
+
+}
+
+
+INT RtmpOSTaskNotifyToExit(
+ IN RTMP_OS_TASK *pTask)
+{
+
+#ifndef KTHREAD_SUPPORT
+ complete_and_exit(&pTask->taskComplete, 0);
+#endif
+
+ return 0;
+}
+
+
+void RtmpOSTaskCustomize(
+ IN RTMP_OS_TASK *pTask)
+{
+
+#ifndef KTHREAD_SUPPORT
+
+ daemonize((PSTRING)&pTask->taskName[0]/*"%s",pAd->net_dev->name*/);
allow_signal(SIGTERM);
allow_signal(SIGKILL);
current->flags |= PF_NOFREEZE;
/* signal that we've started the thread */
- complete(pNotify);
+ complete(&pTask->taskComplete);
+
+#endif
}
+
+NDIS_STATUS RtmpOSTaskAttach(
+ IN RTMP_OS_TASK *pTask,
+ IN int (*fn)(void *),
+ IN void *arg)
+{
+ NDIS_STATUS status = NDIS_STATUS_SUCCESS;
+ pid_t pid_number = -1;
+
+#ifdef KTHREAD_SUPPORT
+ pTask->task_killed = 0;
+ pTask->kthread_task = NULL;
+ pTask->kthread_task = kthread_run(fn, arg, pTask->taskName);
+ if (IS_ERR(pTask->kthread_task))
+ status = NDIS_STATUS_FAILURE;
+#else
+ pid_number = kernel_thread(fn, arg, RTMP_OS_MGMT_TASK_FLAGS);
+ if (pid_number < 0)
+ {
+ DBGPRINT (RT_DEBUG_ERROR, ("Attach task(%s) failed!\n", pTask->taskName));
+ status = NDIS_STATUS_FAILURE;
+ }
+ else
+ {
+ pTask->taskPID = GET_PID(pid_number);
+
+ // Wait for the thread to start
+ wait_for_completion(&pTask->taskComplete);
+ status = NDIS_STATUS_SUCCESS;
+ }
+#endif
+ return status;
+}
+
+
+NDIS_STATUS RtmpOSTaskInit(
+ IN RTMP_OS_TASK *pTask,
+ IN PSTRING pTaskName,
+ IN VOID *pPriv)
+{
+ int len;
+
+ ASSERT(pTask);
+
+#ifndef KTHREAD_SUPPORT
+ NdisZeroMemory((PUCHAR)(pTask), sizeof(RTMP_OS_TASK));
+#endif
+
+ len = strlen(pTaskName);
+ len = len > (RTMP_OS_TASK_NAME_LEN -1) ? (RTMP_OS_TASK_NAME_LEN-1) : len;
+ NdisMoveMemory(&pTask->taskName[0], pTaskName, len);
+ pTask->priv = pPriv;
+
+#ifndef KTHREAD_SUPPORT
+ RTMP_SEM_EVENT_INIT_LOCKED(&(pTask->taskSema));
+ pTask->taskPID = THREAD_PID_INIT_VALUE;
+
+ init_completion (&pTask->taskComplete);
+#endif
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
void RTMP_IndicateMediaState(
IN PRTMP_ADAPTER pAd)
{
@@ -1000,3 +1242,259 @@ void RTMP_IndicateMediaState(
}
}
+int RtmpOSWrielessEventSend(
+ IN RTMP_ADAPTER *pAd,
+ IN UINT32 eventType,
+ IN INT flags,
+ IN PUCHAR pSrcMac,
+ IN PUCHAR pData,
+ IN UINT32 dataLen)
+{
+ union iwreq_data wrqu;
+
+ memset(&wrqu, 0, sizeof(wrqu));
+
+ if (flags>-1)
+ wrqu.data.flags = flags;
+
+ if (pSrcMac)
+ memcpy(wrqu.ap_addr.sa_data, pSrcMac, MAC_ADDR_LEN);
+
+ if ((pData!= NULL) && (dataLen > 0))
+ wrqu.data.length = dataLen;
+
+ wireless_send_event(pAd->net_dev, eventType, &wrqu, (char *)pData);
+ return 0;
+}
+
+
+int RtmpOSNetDevAddrSet(
+ IN PNET_DEV pNetDev,
+ IN PUCHAR pMacAddr)
+{
+ struct net_device *net_dev;
+ RTMP_ADAPTER *pAd;
+
+ net_dev = pNetDev;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
+ // work-around for the SuSE due to it has it's own interface name management system.
+ {
+ NdisZeroMemory(pAd->StaCfg.dev_name, 16);
+ NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name));
+ }
+
+ NdisMoveMemory(net_dev->dev_addr, pMacAddr, 6);
+
+ return 0;
+}
+
+
+
+/*
+ * Assign the network dev name for created Ralink WiFi interface.
+ */
+static int RtmpOSNetDevRequestName(
+ IN RTMP_ADAPTER *pAd,
+ IN PNET_DEV dev,
+ IN PSTRING pPrefixStr,
+ IN INT devIdx)
+{
+ PNET_DEV existNetDev;
+ STRING suffixName[IFNAMSIZ];
+ STRING desiredName[IFNAMSIZ];
+ int ifNameIdx, prefixLen, slotNameLen;
+ int Status;
+
+
+ prefixLen = strlen(pPrefixStr);
+ ASSERT((prefixLen < IFNAMSIZ));
+
+ for (ifNameIdx = devIdx; ifNameIdx < 32; ifNameIdx++)
+ {
+ memset(suffixName, 0, IFNAMSIZ);
+ memset(desiredName, 0, IFNAMSIZ);
+ strncpy(&desiredName[0], pPrefixStr, prefixLen);
+
+ sprintf(suffixName, "%d", ifNameIdx);
+
+ slotNameLen = strlen(suffixName);
+ ASSERT(((slotNameLen + prefixLen) < IFNAMSIZ));
+ strcat(desiredName, suffixName);
+
+ existNetDev = RtmpOSNetDevGetByName(dev, &desiredName[0]);
+ if (existNetDev == NULL)
+ break;
+ else
+ RtmpOSNetDeviceRefPut(existNetDev);
+ }
+
+ if(ifNameIdx < 32)
+ {
+ strcpy(&dev->name[0], &desiredName[0]);
+ Status = NDIS_STATUS_SUCCESS;
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR,
+ ("Cannot request DevName with preifx(%s) and in range(0~32) as suffix from OS!\n", pPrefixStr));
+ Status = NDIS_STATUS_FAILURE;
+ }
+
+ return Status;
+}
+
+
+void RtmpOSNetDevClose(
+ IN PNET_DEV pNetDev)
+{
+ dev_close(pNetDev);
+}
+
+
+void RtmpOSNetDevFree(PNET_DEV pNetDev)
+{
+ ASSERT(pNetDev);
+
+ free_netdev(pNetDev);
+}
+
+
+INT RtmpOSNetDevAlloc(
+ IN PNET_DEV *new_dev_p,
+ IN UINT32 privDataSize)
+{
+ // assign it as null first.
+ *new_dev_p = NULL;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("Allocate a net device with private data size=%d!\n", privDataSize));
+ *new_dev_p = alloc_etherdev(privDataSize);
+ if (*new_dev_p)
+ return NDIS_STATUS_SUCCESS;
+ else
+ return NDIS_STATUS_FAILURE;
+}
+
+
+PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, PSTRING pDevName)
+{
+ PNET_DEV pTargetNetDev = NULL;
+
+ pTargetNetDev = dev_get_by_name(dev_net(pNetDev), pDevName);
+
+ return pTargetNetDev;
+}
+
+
+void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev)
+{
+ /*
+ every time dev_get_by_name is called, and it has returned a valid struct
+ net_device*, dev_put should be called afterwards, because otherwise the
+ machine hangs when the device is unregistered (since dev->refcnt > 1).
+ */
+ if(pNetDev)
+ dev_put(pNetDev);
+}
+
+
+INT RtmpOSNetDevDestory(
+ IN RTMP_ADAPTER *pAd,
+ IN PNET_DEV pNetDev)
+{
+
+ // TODO: Need to fix this
+ printk("WARNING: This function(%s) not implement yet!!!\n", __func__);
+ return 0;
+}
+
+
+void RtmpOSNetDevDetach(PNET_DEV pNetDev)
+{
+ unregister_netdev(pNetDev);
+}
+
+
+int RtmpOSNetDevAttach(
+ IN PNET_DEV pNetDev,
+ IN RTMP_OS_NETDEV_OP_HOOK *pDevOpHook)
+{
+ int ret, rtnl_locked = FALSE;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("RtmpOSNetDevAttach()--->\n"));
+ // If we need hook some callback function to the net device structrue, now do it.
+ if (pDevOpHook)
+ {
+ PRTMP_ADAPTER pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, pNetDev);
+
+ pNetDev->netdev_ops = pDevOpHook->netdev_ops;
+
+ /* OS specific flags, here we used to indicate if we are virtual interface */
+ pNetDev->priv_flags = pDevOpHook->priv_flags;
+
+
+ if (pAd->OpMode == OPMODE_STA)
+ {
+ pNetDev->wireless_handlers = &rt28xx_iw_handler_def;
+ }
+
+
+ // copy the net device mac address to the net_device structure.
+ NdisMoveMemory(pNetDev->dev_addr, &pDevOpHook->devAddr[0], MAC_ADDR_LEN);
+
+ rtnl_locked = pDevOpHook->needProtcted;
+ }
+
+ if (rtnl_locked)
+ ret = register_netdevice(pNetDev);
+ else
+ ret = register_netdev(pNetDev);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<---RtmpOSNetDevAttach(), ret=%d\n", ret));
+ if (ret == 0)
+ return NDIS_STATUS_SUCCESS;
+ else
+ return NDIS_STATUS_FAILURE;
+}
+
+
+PNET_DEV RtmpOSNetDevCreate(
+ IN RTMP_ADAPTER *pAd,
+ IN INT devType,
+ IN INT devNum,
+ IN INT privMemSize,
+ IN PSTRING pNamePrefix)
+{
+ struct net_device *pNetDev = NULL;
+ int status;
+
+
+ /* allocate a new network device */
+ status = RtmpOSNetDevAlloc(&pNetDev, 0 /*privMemSize*/);
+ if (status != NDIS_STATUS_SUCCESS)
+ {
+ /* allocation fail, exit */
+ DBGPRINT(RT_DEBUG_ERROR, ("Allocate network device fail (%s)...\n", pNamePrefix));
+ return NULL;
+ }
+
+
+ /* find a available interface name, max 32 interfaces */
+ status = RtmpOSNetDevRequestName(pAd, pNetDev, pNamePrefix, devNum);
+ if (status != NDIS_STATUS_SUCCESS)
+ {
+ /* error! no any available ra name can be used! */
+ DBGPRINT(RT_DEBUG_ERROR, ("Assign interface name (%s with suffix 0~32) failed...\n", pNamePrefix));
+ RtmpOSNetDevFree(pNetDev);
+
+ return NULL;
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("The name of the new %s interface is %s...\n", pNamePrefix, pNetDev->name));
+ }
+
+ return pNetDev;
+}
diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h
index e8d64c30b906..e8c7d887de1e 100644
--- a/drivers/staging/rt2860/rt_linux.h
+++ b/drivers/staging/rt2860/rt_linux.h
@@ -23,27 +23,22 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
- */
-/***********************************************************************/
-/* */
-/* Program: rt_linux.c */
-/* Created: 4/21/2006 1:17:38 PM */
-/* Author: Wu Xi-Kun */
-/* Comments: `description` */
-/* */
-/*---------------------------------------------------------------------*/
-/* */
-/* History: */
-/* Revision 1.1 4/21/2006 1:17:38 PM xsikun */
-/* Initial revision */
-/* */
-/***********************************************************************/
-
-#include "rtmp_type.h"
+ Module Name:
+ rt_linux.h
+
+ Abstract:
+
+ Revision History:
+ Who When What
+ --------- ---------- ----------------------------------------------
+*/
+
+#ifndef __RT_LINUX_H__
+#define __RT_LINUX_H__
+
#include <linux/module.h>
#include <linux/kernel.h>
-
#include <linux/spinlock.h>
#include <linux/init.h>
#include <linux/string.h>
@@ -69,60 +64,80 @@
#define __KERNEL_SYSCALLS__
#include <linux/unistd.h>
#include <asm/uaccess.h>
+#include <asm/types.h>
+#include <asm/unaligned.h> // for get_unaligned()
+#define KTHREAD_SUPPORT 1
+// RT2870 2.1.0.0 has it disabled
-#define MEM_ALLOC_FLAG (GFP_ATOMIC) //(GFP_DMA | GFP_ATOMIC)
+#ifdef KTHREAD_SUPPORT
+#include <linux/err.h>
+#include <linux/kthread.h>
+#endif // KTHREAD_SUPPORT //
+
+#undef AP_WSC_INCLUDED
+#undef STA_WSC_INCLUDED
+#undef WSC_INCLUDED
+
+
+
+
+#ifdef KTHREAD_SUPPORT
+#endif // KTHREAD_SUPPORT //
+
+/***********************************************************************************
+ * Profile related sections
+ ***********************************************************************************/
-#ifndef IFNAMSIZ
-#define IFNAMSIZ 16
-#endif
-//#define CONFIG_CKIP_SUPPORT
+#ifdef RTMP_MAC_PCI
+#define STA_PROFILE_PATH "/etc/Wireless/RT2860STA/RT2860STA.dat"
+#define STA_DRIVER_VERSION "2.1.0.0"
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+#define STA_PROFILE_PATH "/etc/Wireless/RT2870STA/RT2870STA.dat"
+#define STA_DRIVER_VERSION "2.1.0.0"
+// RT3070 version: 2.1.1.0
+#endif // RTMP_MAC_USB //
+extern const struct iw_handler_def rt28xx_iw_handler_def;
+
+
+/***********************************************************************************
+ * Compiler related definitions
+ ***********************************************************************************/
#undef __inline
#define __inline static inline
+#define IN
+#define OUT
+#define INOUT
+#define NDIS_STATUS INT
-typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_dev);
-// add by kathy
-
-/* order of "if defined()" is important, because for 3070 driver
- both RT2870 and RT3070 are defined */
-#if defined(RT2860)
- #define STA_PROFILE_PATH "/etc/Wireless/RT2860STA/RT2860STA.dat"
- #define STA_RTMP_FIRMWARE_FILE_NAME "/etc/Wireless/RT2860STA/RT2860STA.bin"
- #define STA_NIC_DEVICE_NAME "RT2860STA"
- #define STA_DRIVER_VERSION "1.8.1.1"
-#elif defined(RT3070)
- #define STA_PROFILE_PATH "/etc/Wireless/RT3070STA/RT3070STA.dat"
- #define STA_RT2870_IMAGE_FILE_NAME "/etc/Wireless/RT3070STA/rt2870.bin"
- #define STA_NIC_DEVICE_NAME "RT3070STA"
- #define STA_DRIVER_VERSION "2.0.1.0"
-#elif defined(RT2870)
- #define STA_PROFILE_PATH "/etc/Wireless/RT2870STA/RT2870STA.dat"
- #define STA_RT2870_IMAGE_FILE_NAME "/etc/Wireless/RT2870STA/rt2870.bin"
- #define STA_NIC_DEVICE_NAME "RT2870STA"
- #define STA_DRIVER_VERSION "1.4.0.0"
-#endif
+/***********************************************************************************
+ * OS Specific definitions and data structures
+ ***********************************************************************************/
+typedef struct pci_dev * PPCI_DEV;
+typedef struct net_device * PNET_DEV;
+typedef void * PNDIS_PACKET;
+typedef char NDIS_PACKET;
+typedef PNDIS_PACKET * PPNDIS_PACKET;
+typedef dma_addr_t NDIS_PHYSICAL_ADDRESS;
+typedef dma_addr_t * PNDIS_PHYSICAL_ADDRESS;
+typedef void * NDIS_HANDLE;
+typedef char * PNDIS_BUFFER;
+typedef struct pid * RTMP_OS_PID;
+typedef struct semaphore RTMP_OS_SEM;
+
+typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_dev);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
#ifndef PCI_DEVICE
#define PCI_DEVICE(vend,dev) \
.vendor = (vend), .device = (dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
#endif // PCI_DEVICE //
-#endif
-
-#define RTMP_TIME_AFTER(a,b) \
- (typecheck(unsigned long, (unsigned long)a) && \
- typecheck(unsigned long, (unsigned long)b) && \
- ((long)(b) - (long)(a) < 0))
-
-#define RTMP_TIME_AFTER_EQ(a,b) \
- (typecheck(unsigned long, (unsigned long)a) && \
- typecheck(unsigned long, (unsigned long)b) && \
- ((long)(a) - (long)(b) >= 0))
-#define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a)
+#endif // RTMP_MAC_PCI //
#define RT_MOD_INC_USE_COUNT() \
if (!try_module_get(THIS_MODULE)) \
@@ -133,220 +148,336 @@ typedef int (*HARD_START_XMIT_FUNC)(struct sk_buff *skb, struct net_device *net_
#define RT_MOD_DEC_USE_COUNT() module_put(THIS_MODULE);
-#define OS_HZ HZ
+#define RTMP_INC_REF(_A) 0
+#define RTMP_DEC_REF(_A) 0
+#define RTMP_GET_REF(_A) 0
-#define ETH_LENGTH_OF_ADDRESS 6
-#define IN
-#define OUT
+// This function will be called when query /proc
+struct iw_statistics *rt28xx_get_wireless_stats(
+ IN struct net_device *net_dev);
+
+
+/***********************************************************************************
+ * Network related constant definitions
+ ***********************************************************************************/
+#ifndef IFNAMSIZ
+#define IFNAMSIZ 16
+#endif
+
+#define ETH_LENGTH_OF_ADDRESS 6
-#define NDIS_STATUS INT
#define NDIS_STATUS_SUCCESS 0x00
#define NDIS_STATUS_FAILURE 0x01
#define NDIS_STATUS_INVALID_DATA 0x02
#define NDIS_STATUS_RESOURCES 0x03
+#define NDIS_SET_PACKET_STATUS(_p, _status) do{} while(0)
+#define NdisWriteErrorLogEntry(_a, _b, _c, _d) do{} while(0)
+
+/* statistics counter */
+#define STATS_INC_RX_PACKETS(_pAd, _dev)
+#define STATS_INC_TX_PACKETS(_pAd, _dev)
+
+#define STATS_INC_RX_BYTESS(_pAd, _dev, len)
+#define STATS_INC_TX_BYTESS(_pAd, _dev, len)
+
+#define STATS_INC_RX_ERRORS(_pAd, _dev)
+#define STATS_INC_TX_ERRORS(_pAd, _dev)
+
+#define STATS_INC_RX_DROPPED(_pAd, _dev)
+#define STATS_INC_TX_DROPPED(_pAd, _dev)
+
+
+/***********************************************************************************
+ * Ralink Specific network related constant definitions
+ ***********************************************************************************/
#define MIN_NET_DEVICE_FOR_AID 0x00 //0x00~0x3f
#define MIN_NET_DEVICE_FOR_MBSSID 0x00 //0x00,0x10,0x20,0x30
#define MIN_NET_DEVICE_FOR_WDS 0x10 //0x40,0x50,0x60,0x70
#define MIN_NET_DEVICE_FOR_APCLI 0x20
#define MIN_NET_DEVICE_FOR_MESH 0x30
#define MIN_NET_DEVICE_FOR_DLS 0x40
+#define NET_DEVICE_REAL_IDX_MASK 0x0f // for each operation mode, we maximum support 15 entities.
+
#define NDIS_PACKET_TYPE_DIRECTED 0
#define NDIS_PACKET_TYPE_MULTICAST 1
#define NDIS_PACKET_TYPE_BROADCAST 2
#define NDIS_PACKET_TYPE_ALL_MULTICAST 3
+#define NDIS_PACKET_TYPE_PROMISCUOUS 4
+
+
+/***********************************************************************************
+ * OS signaling related constant definitions
+ ***********************************************************************************/
+
+
+/***********************************************************************************
+ * OS file operation related data structure definitions
+ ***********************************************************************************/
+typedef struct file* RTMP_OS_FD;
+
+typedef struct _RTMP_OS_FS_INFO_
+{
+ int fsuid;
+ int fsgid;
+ mm_segment_t fs;
+}RTMP_OS_FS_INFO;
+
+#define IS_FILE_OPEN_ERR(_fd) IS_ERR((_fd))
+
+/***********************************************************************************
+ * OS semaphore related data structure and definitions
+ ***********************************************************************************/
struct os_lock {
spinlock_t lock;
- unsigned long flags;
+ unsigned long flags;
};
+typedef spinlock_t NDIS_SPIN_LOCK;
-struct os_cookie {
-#ifdef RT2860
- struct pci_dev *pci_dev;
- struct pci_dev *parent_pci_dev;
- dma_addr_t pAd_pa;
-#endif
-#ifdef RT2870
- struct usb_device *pUsb_Dev;
+//
+// spin_lock enhanced for Nested spin lock
+//
+#define NdisAllocateSpinLock(__lock) \
+{ \
+ spin_lock_init((spinlock_t *)(__lock)); \
+}
- struct pid *MLMEThr_pid;
- struct pid *RTUSBCmdThr_pid;
- struct pid *TimerQThr_pid;
-#endif // RT2870 //
-
- struct tasklet_struct rx_done_task;
- struct tasklet_struct mgmt_dma_done_task;
- struct tasklet_struct ac0_dma_done_task;
- struct tasklet_struct ac1_dma_done_task;
- struct tasklet_struct ac2_dma_done_task;
- struct tasklet_struct ac3_dma_done_task;
- struct tasklet_struct hcca_dma_done_task;
- struct tasklet_struct tbtt_task;
-#ifdef RT2860
- struct tasklet_struct fifo_statistic_full_task;
-#endif
-#ifdef RT2870
- struct tasklet_struct null_frame_complete_task;
- struct tasklet_struct rts_frame_complete_task;
- struct tasklet_struct pspoll_frame_complete_task;
-#endif // RT2870 //
+#define NdisFreeSpinLock(lock) \
+ do{}while(0)
- unsigned long apd_pid; //802.1x daemon pid
- INT ioctl_if_type;
- INT ioctl_if;
-};
-#undef ASSERT
-#define ASSERT(x)
+#define RTMP_SEM_LOCK(__lock) \
+{ \
+ spin_lock_bh((spinlock_t *)(__lock)); \
+}
-typedef struct os_cookie * POS_COOKIE;
-typedef struct pci_dev * PPCI_DEV;
-typedef struct net_device * PNET_DEV;
-typedef void * PNDIS_PACKET;
-typedef char NDIS_PACKET;
-typedef PNDIS_PACKET * PPNDIS_PACKET;
-typedef dma_addr_t NDIS_PHYSICAL_ADDRESS;
-typedef dma_addr_t * PNDIS_PHYSICAL_ADDRESS;
-typedef spinlock_t NDIS_SPIN_LOCK;
-typedef struct timer_list NDIS_MINIPORT_TIMER;
-typedef void * NDIS_HANDLE;
-typedef char * PNDIS_BUFFER;
+#define RTMP_SEM_UNLOCK(__lock) \
+{ \
+ spin_unlock_bh((spinlock_t *)(__lock)); \
+}
+// sample, use semaphore lock to replace IRQ lock, 2007/11/15
+#define RTMP_IRQ_LOCK(__lock, __irqflags) \
+{ \
+ __irqflags = 0; \
+ spin_lock_bh((spinlock_t *)(__lock)); \
+ pAd->irq_disabled |= 1; \
+}
-void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen);
+#define RTMP_IRQ_UNLOCK(__lock, __irqflag) \
+{ \
+ pAd->irq_disabled &= 0; \
+ spin_unlock_bh((spinlock_t *)(__lock)); \
+}
-dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, int sd_idx, int direction);
-void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, int direction);
+#define RTMP_INT_LOCK(__lock, __irqflags) \
+{ \
+ spin_lock_irqsave((spinlock_t *)__lock, __irqflags); \
+}
+#define RTMP_INT_UNLOCK(__lock, __irqflag) \
+{ \
+ spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \
+}
-////////////////////////////////////////
-// MOVE TO rtmp.h ?
-/////////////////////////////////////////
-#define PKTSRC_NDIS 0x7f
-#define PKTSRC_DRIVER 0x0f
-#define PRINT_MAC(addr) \
- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
+#define NdisAcquireSpinLock RTMP_SEM_LOCK
+#define NdisReleaseSpinLock RTMP_SEM_UNLOCK
+#ifndef wait_event_interruptible_timeout
+#define __wait_event_interruptible_timeout(wq, condition, ret) \
+do { \
+ wait_queue_t __wait; \
+ init_waitqueue_entry(&__wait, current); \
+ add_wait_queue(&wq, &__wait); \
+ for (;;) { \
+ set_current_state(TASK_INTERRUPTIBLE); \
+ if (condition) \
+ break; \
+ if (!signal_pending(current)) { \
+ ret = schedule_timeout(ret); \
+ if (!ret) \
+ break; \
+ continue; \
+ } \
+ ret = -ERESTARTSYS; \
+ break; \
+ } \
+ current->state = TASK_RUNNING; \
+ remove_wait_queue(&wq, &__wait); \
+} while (0)
-#define RT2860_PCI_DEVICE_ID 0x0601
+#define wait_event_interruptible_timeout(wq, condition, timeout) \
+({ \
+ long __ret = timeout; \
+ if (!(condition)) \
+ __wait_event_interruptible_timeout(wq, condition, __ret); \
+ __ret; \
+})
+#endif
-#ifdef RT2860
-#define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \
- linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir)
+#define RTMP_SEM_EVENT_INIT_LOCKED(_pSema) sema_init((_pSema), 0)
+#define RTMP_SEM_EVENT_INIT(_pSema) sema_init((_pSema), 1)
+#define RTMP_SEM_EVENT_WAIT(_pSema, _status) ((_status) = down_interruptible((_pSema)))
+#define RTMP_SEM_EVENT_UP(_pSema) up(_pSema)
+
+#ifdef KTHREAD_SUPPORT
+#define RTMP_WAIT_EVENT_INTERRUPTIBLE(_pAd, _pTask) \
+{ \
+ wait_event_interruptible(_pTask->kthread_q, \
+ _pTask->kthread_running || kthread_should_stop()); \
+ _pTask->kthread_running = FALSE; \
+ if (kthread_should_stop()) \
+ { \
+ RTMP_SET_FLAG(_pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); \
+ break; \
+ } \
+}
+#endif
-#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) \
- linux_pci_unmap_single(_handle, _ptr, _size, _dir)
+#ifdef KTHREAD_SUPPORT
+#define WAKE_UP(_pTask) \
+ do{ \
+ if ((_pTask)->kthread_task) \
+ { \
+ (_pTask)->kthread_running = TRUE; \
+ wake_up(&(_pTask)->kthread_q); \
+ } \
+ }while(0)
+#endif
-#define PCI_ALLOC_CONSISTENT(_pci_dev, _size, _ptr) \
- pci_alloc_consistent(_pci_dev, _size, _ptr)
+/***********************************************************************************
+ * OS Memory Access related data structure and definitions
+ ***********************************************************************************/
+#define MEM_ALLOC_FLAG (GFP_ATOMIC) //(GFP_DMA | GFP_ATOMIC)
-#define PCI_FREE_CONSISTENT(_pci_dev, _size, _virtual_addr, _physical_addr) \
- pci_free_consistent(_pci_dev, _size, _virtual_addr, _physical_addr)
+#define NdisMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length)
+#define NdisCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length)
+#define NdisZeroMemory(Destination, Length) memset(Destination, 0, Length)
+#define NdisFillMemory(Destination, Length, Fill) memset(Destination, Fill, Length)
+#define NdisCmpMemory(Destination, Source, Length) memcmp(Destination, Source, Length)
+#define NdisEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
+#define RTMPEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
-#define DEV_ALLOC_SKB(_length) \
- dev_alloc_skb(_length)
-#endif
-#ifdef RT2870
-#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (ULONG)0
+#define MlmeAllocateMemory(_pAd, _ppVA) os_alloc_mem(_pAd, _ppVA, MGMT_DMA_BUFFER_SIZE)
+#define MlmeFreeMemory(_pAd, _pVA) os_free_mem(_pAd, _pVA)
-#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir)
-#endif // RT2870 //
+#define COPY_MAC_ADDR(Addr1, Addr2) memcpy((Addr1), (Addr2), MAC_ADDR_LEN)
-#define BEACON_FRAME_DMA_CACHE_WBACK(_ptr, _size) \
- dma_cache_wback(_ptr, _size)
+/***********************************************************************************
+ * OS task related data structure and definitions
+ ***********************************************************************************/
+#define RTMP_OS_MGMT_TASK_FLAGS CLONE_VM
+typedef struct pid * THREAD_PID;
+#define THREAD_PID_INIT_VALUE NULL
+#define GET_PID(_v) find_get_pid((_v))
+#define GET_PID_NUMBER(_v) pid_nr((_v))
+#define CHECK_PID_LEGALITY(_pid) if (pid_nr((_pid)) > 0)
+#define KILL_THREAD_PID(_A, _B, _C) kill_pid((_A), (_B), (_C))
-//////////////////////////////////////////
-//
-//////////////////////////////////////////
+typedef struct tasklet_struct RTMP_NET_TASK_STRUCT;
+typedef struct tasklet_struct *PRTMP_NET_TASK_STRUCT;
-#define NdisMIndicateStatus(_w, _x, _y, _z)
+/***********************************************************************************
+ * Timer related definitions and data structures.
+ **********************************************************************************/
+#define OS_HZ HZ
+typedef struct timer_list NDIS_MINIPORT_TIMER;
typedef struct timer_list RTMP_OS_TIMER;
+typedef void (*TIMER_FUNCTION)(unsigned long);
-#ifdef RT2870
-/* ----------------- Timer Related MARCO ---------------*/
-// In RT2870, we have a lot of timer functions and will read/write register, it's
-// not allowed in Linux USB sub-system to do it ( because of sleep issue when submit
-// to ctrl pipe). So we need a wrapper function to take care it.
-
-typedef VOID (*RT2870_TIMER_HANDLE)(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-#endif // RT2870 //
-
-
-typedef struct _RALINK_TIMER_STRUCT {
- RTMP_OS_TIMER TimerObj; // Ndis Timer object
- BOOLEAN Valid; // Set to True when call RTMPInitTimer
- BOOLEAN State; // True if timer cancelled
- BOOLEAN PeriodicType; // True if timer is periodic timer
- BOOLEAN Repeat; // True if periodic timer
- ULONG TimerValue; // Timer value in milliseconds
- ULONG cookie; // os specific object
-#ifdef RT2870
- RT2870_TIMER_HANDLE handle;
- void *pAd;
-#endif // RT2870 //
-} RALINK_TIMER_STRUCT, *PRALINK_TIMER_STRUCT;
-
-
-#ifdef RT2870
-
-typedef enum _RT2870_KERNEL_THREAD_STATUS_
-{
- RT2870_THREAD_UNKNOWN = 0,
- RT2870_THREAD_INITED = 1,
- RT2870_THREAD_RUNNING = 2,
- RT2870_THREAD_STOPED = 4,
-}RT2870_KERNEL_THREAD_STATUS;
-#define RT2870_THREAD_CAN_DO_INSERT (RT2870_THREAD_INITED |RT2870_THREAD_RUNNING)
+#define OS_WAIT(_time) \
+{ int _i; \
+ long _loop = ((_time)/(1000/OS_HZ)) > 0 ? ((_time)/(1000/OS_HZ)) : 1;\
+ wait_queue_head_t _wait; \
+ init_waitqueue_head(&_wait); \
+ for (_i=0; _i<(_loop); _i++) \
+ wait_event_interruptible_timeout(_wait, 0, ONE_TICK); }
+
+#define RTMP_TIME_AFTER(a,b) \
+ (typecheck(unsigned long, (unsigned long)a) && \
+ typecheck(unsigned long, (unsigned long)b) && \
+ ((long)(b) - (long)(a) < 0))
-typedef struct _RT2870_TIMER_ENTRY_
-{
- RALINK_TIMER_STRUCT *pRaTimer;
- struct _RT2870_TIMER_ENTRY_ *pNext;
-}RT2870_TIMER_ENTRY;
+#define RTMP_TIME_AFTER_EQ(a,b) \
+ (typecheck(unsigned long, (unsigned long)a) && \
+ typecheck(unsigned long, (unsigned long)b) && \
+ ((long)(a) - (long)(b) >= 0))
+#define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a)
+#define ONE_TICK 1
-#define TIMER_QUEUE_SIZE_MAX 128
-typedef struct _RT2870_TIMER_QUEUE_
+static inline void NdisGetSystemUpTime(ULONG *time)
{
- unsigned int status;
- UCHAR *pTimerQPoll;
- RT2870_TIMER_ENTRY *pQPollFreeList;
- RT2870_TIMER_ENTRY *pQHead;
- RT2870_TIMER_ENTRY *pQTail;
-}RT2870_TIMER_QUEUE;
-#endif // RT2870 //
+ *time = jiffies;
+}
-//#define DBG 1
+/***********************************************************************************
+ * OS specific cookie data structure binding to RTMP_ADAPTER
+ ***********************************************************************************/
-//
-// MACRO for debugging information
-//
+struct os_cookie {
+#ifdef RTMP_MAC_PCI
+ struct pci_dev *pci_dev;
+ struct pci_dev *parent_pci_dev;
+ USHORT DeviceID;
+ dma_addr_t pAd_pa;
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ struct usb_device *pUsb_Dev;
+#endif // RTMP_MAC_USB //
+
+ RTMP_NET_TASK_STRUCT rx_done_task;
+ RTMP_NET_TASK_STRUCT mgmt_dma_done_task;
+ RTMP_NET_TASK_STRUCT ac0_dma_done_task;
+ RTMP_NET_TASK_STRUCT ac1_dma_done_task;
+ RTMP_NET_TASK_STRUCT ac2_dma_done_task;
+ RTMP_NET_TASK_STRUCT ac3_dma_done_task;
+ RTMP_NET_TASK_STRUCT tbtt_task;
+#ifdef RTMP_MAC_PCI
+ RTMP_NET_TASK_STRUCT fifo_statistic_full_task;
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTMP_NET_TASK_STRUCT null_frame_complete_task;
+ RTMP_NET_TASK_STRUCT rts_frame_complete_task;
+ RTMP_NET_TASK_STRUCT pspoll_frame_complete_task;
+#endif // RTMP_MAC_USB //
+
+ unsigned long apd_pid; //802.1x daemon pid
+ INT ioctl_if_type;
+ INT ioctl_if;
+};
+
+typedef struct os_cookie * POS_COOKIE;
+
+
+
+/***********************************************************************************
+ * OS debugging and printing related definitions and data structure
+ ***********************************************************************************/
+#define PRINT_MAC(addr) \
+ addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
#ifdef DBG
extern ULONG RTDebugLevel;
#define DBGPRINT_RAW(Level, Fmt) \
-{ \
+do{ \
if (Level <= RTDebugLevel) \
{ \
printk Fmt; \
} \
-}
+}while(0)
#define DBGPRINT(Level, Fmt) DBGPRINT_RAW(Level, Fmt)
@@ -370,55 +501,83 @@ extern ULONG RTDebugLevel;
#define DBGPRINT_ERR(Fmt)
#endif
+#define ASSERT(x)
-//
-// spin_lock enhanced for Nested spin lock
-//
-#define NdisAllocateSpinLock(__lock) \
-{ \
- spin_lock_init((spinlock_t *)(__lock)); \
-}
+void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen);
-#define NdisFreeSpinLock(lock) \
-{ \
-}
+/*********************************************************************************************************
+ The following code are not revised, temporary put it here.
+ *********************************************************************************************************/
-#define RTMP_SEM_LOCK(__lock) \
-{ \
- spin_lock_bh((spinlock_t *)(__lock)); \
-}
-#define RTMP_SEM_UNLOCK(__lock) \
-{ \
- spin_unlock_bh((spinlock_t *)(__lock)); \
-}
+/***********************************************************************************
+ * Device DMA Access related definitions and data structures.
+ **********************************************************************************/
+#ifdef RTMP_MAC_PCI
+dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, int sd_idx, int direction);
+void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, int direction);
-// sample, use semaphore lock to replace IRQ lock, 2007/11/15
-#define RTMP_IRQ_LOCK(__lock, __irqflags) \
-{ \
- __irqflags = 0; \
- spin_lock_bh((spinlock_t *)(__lock)); \
- pAd->irq_disabled |= 1; \
-}
+#define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \
+ linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir)
-#define RTMP_IRQ_UNLOCK(__lock, __irqflag) \
-{ \
- pAd->irq_disabled &= 0; \
- spin_unlock_bh((spinlock_t *)(__lock)); \
-}
+#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) \
+ linux_pci_unmap_single(_handle, _ptr, _size, _dir)
-#define RTMP_INT_LOCK(__lock, __irqflags) \
-{ \
- spin_lock_irqsave((spinlock_t *)__lock, __irqflags); \
-}
+#define PCI_ALLOC_CONSISTENT(_pci_dev, _size, _ptr) \
+ pci_alloc_consistent(_pci_dev, _size, _ptr)
-#define RTMP_INT_UNLOCK(__lock, __irqflag) \
-{ \
- spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \
-}
+#define PCI_FREE_CONSISTENT(_pci_dev, _size, _virtual_addr, _physical_addr) \
+ pci_free_consistent(_pci_dev, _size, _virtual_addr, _physical_addr)
+
+#define DEV_ALLOC_SKB(_length) \
+ dev_alloc_skb(_length)
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+#define PCI_MAP_SINGLE(_handle, _ptr, _size, _dir) (ULONG)0
+
+#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir)
+#endif // RTMP_MAC_USB //
+
+/*
+ * ULONG
+ * RTMP_GetPhysicalAddressLow(
+ * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
+ */
+#define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress)
+
+/*
+ * ULONG
+ * RTMP_GetPhysicalAddressHigh(
+ * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
+ */
+#define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0)
+
+/*
+ * VOID
+ * RTMP_SetPhysicalAddressLow(
+ * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
+ * IN ULONG Value);
+ */
+#define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \
+ PhysicalAddress = Value;
-#ifdef RT2860
+/*
+ * VOID
+ * RTMP_SetPhysicalAddressHigh(
+ * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
+ * IN ULONG Value);
+ */
+#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
+
+#define NdisMIndicateStatus(_w, _x, _y, _z)
+
+
+
+/***********************************************************************************
+ * Device Register I/O Access related definitions and data structures.
+ **********************************************************************************/
+#ifdef RTMP_MAC_PCI
//Patch for ASIC turst read/write bug, needs to remove after metel fix
#define RTMP_IO_READ32(_A, _R, _pV) \
{ \
@@ -430,11 +589,13 @@ extern ULONG RTDebugLevel;
else \
*_pV = 0; \
}
+
#define RTMP_IO_FORCE_READ32(_A, _R, _pV) \
{ \
(*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
(*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \
}
+
#define RTMP_IO_READ8(_A, _R, _pV) \
{ \
(*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
@@ -446,153 +607,97 @@ extern ULONG RTDebugLevel;
{ \
UINT Val; \
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \
+ writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \
} \
}
+
+#define RTMP_IO_FORCE_WRITE32(_A, _R, _V) \
+{ \
+ UINT Val; \
+ Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
+ writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \
+}
+
+#if defined(RALINK_2880) || defined(RALINK_3052)
+#define RTMP_IO_WRITE8(_A, _R, _V) \
+{ \
+ ULONG Val; \
+ UCHAR _i; \
+ _i = ((_R) & 0x3); \
+ Val = readl((void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
+ Val = Val & (~(0x000000ff << ((_i)*8))); \
+ Val = Val | ((ULONG)(_V) << ((_i)*8)); \
+ writel((Val), (void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
+}
+#else
#define RTMP_IO_WRITE8(_A, _R, _V) \
{ \
UINT Val; \
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
writeb((_V), (PUCHAR)((_A)->CSRBaseAddress + (_R))); \
}
+#endif // #if defined(BRCM_6358) || defined(RALINK_2880) //
+
#define RTMP_IO_WRITE16(_A, _R, _V) \
{ \
UINT Val; \
Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
writew((_V), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \
}
-#endif /* RT2860 */
-#ifdef RT2870
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
//Patch for ASIC turst read/write bug, needs to remove after metel fix
#define RTMP_IO_READ32(_A, _R, _pV) \
- RTUSBReadMACRegister(_A, _R, _pV)
+ RTUSBReadMACRegister((_A), (_R), (PUINT32) (_pV))
#define RTMP_IO_READ8(_A, _R, _pV) \
{ \
}
#define RTMP_IO_WRITE32(_A, _R, _V) \
- RTUSBWriteMACRegister(_A, _R, _V)
-
+ RTUSBWriteMACRegister((_A), (_R), (UINT32) (_V))
#define RTMP_IO_WRITE8(_A, _R, _V) \
{ \
USHORT _Val = _V; \
- RTUSBSingleWrite(_A, _R, _Val); \
+ RTUSBSingleWrite((_A), (_R), (USHORT) (_Val)); \
}
-
#define RTMP_IO_WRITE16(_A, _R, _V) \
{ \
- RTUSBSingleWrite(_A, _R, _V); \
+ RTUSBSingleWrite((_A), (_R), (USHORT) (_V)); \
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
-#ifndef wait_event_interruptible_timeout
-#define __wait_event_interruptible_timeout(wq, condition, ret) \
-do { \
- wait_queue_t __wait; \
- init_waitqueue_entry(&__wait, current); \
- add_wait_queue(&wq, &__wait); \
- for (;;) { \
- set_current_state(TASK_INTERRUPTIBLE); \
- if (condition) \
- break; \
- if (!signal_pending(current)) { \
- ret = schedule_timeout(ret); \
- if (!ret) \
- break; \
- continue; \
- } \
- ret = -ERESTARTSYS; \
- break; \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&wq, &__wait); \
-} while (0)
+/***********************************************************************************
+ * Network Related data structure and marco definitions
+ ***********************************************************************************/
+#define PKTSRC_NDIS 0x7f
+#define PKTSRC_DRIVER 0x0f
-#define wait_event_interruptible_timeout(wq, condition, timeout) \
-({ \
- long __ret = timeout; \
- if (!(condition)) \
- __wait_event_interruptible_timeout(wq, condition, __ret); \
- __ret; \
-})
-#endif
-#define ONE_TICK 1
-#define OS_WAIT(_time) \
-{ int _i; \
- long _loop = ((_time)/(1000/OS_HZ)) > 0 ? ((_time)/(1000/OS_HZ)) : 1;\
- wait_queue_head_t _wait; \
- init_waitqueue_head(&_wait); \
- for (_i=0; _i<(_loop); _i++) \
- wait_event_interruptible_timeout(_wait, 0, ONE_TICK); }
+#define RTMP_OS_NETDEV_SET_PRIV(_pNetDev, _pPriv) ((_pNetDev)->ml_priv = (_pPriv))
+#define RTMP_OS_NETDEV_GET_PRIV(_pNetDev) ((_pNetDev)->ml_priv)
+#define RTMP_OS_NETDEV_GET_DEVNAME(_pNetDev) ((_pNetDev)->name)
+#define RTMP_OS_NETDEV_GET_PHYADDR(_PNETDEV) ((_PNETDEV)->dev_addr)
+#define RTMP_OS_NETDEV_START_QUEUE(_pNetDev) netif_start_queue((_pNetDev))
+#define RTMP_OS_NETDEV_STOP_QUEUE(_pNetDev) netif_stop_queue((_pNetDev))
+#define RTMP_OS_NETDEV_WAKE_QUEUE(_pNetDev) netif_wake_queue((_pNetDev))
+#define RTMP_OS_NETDEV_CARRIER_OFF(_pNetDev) netif_carrier_off((_pNetDev))
-typedef void (*TIMER_FUNCTION)(unsigned long);
+#define QUEUE_ENTRY_TO_PACKET(pEntry) \
+ (PNDIS_PACKET)(pEntry)
-#define COPY_MAC_ADDR(Addr1, Addr2) memcpy((Addr1), (Addr2), MAC_ADDR_LEN)
+#define PACKET_TO_QUEUE_ENTRY(pPacket) \
+ (PQUEUE_ENTRY)(pPacket)
-#define MlmeAllocateMemory(_pAd, _ppVA) os_alloc_mem(_pAd, _ppVA, MGMT_DMA_BUFFER_SIZE)
-#define MlmeFreeMemory(_pAd, _pVA) os_free_mem(_pAd, _pVA)
+#define GET_SG_LIST_FROM_PACKET(_p, _sc) \
+ rt_get_sg_list_from_packet(_p, _sc)
-#ifdef RT2860
-#define BUILD_TIMER_FUNCTION(_func) \
-void linux_##_func(unsigned long data) \
-{ \
- PRALINK_TIMER_STRUCT pTimer = (PRALINK_TIMER_STRUCT) data; \
- \
- _func(NULL, (PVOID) pTimer->cookie, NULL, pTimer); \
- if (pTimer->Repeat) \
- RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue); \
-}
-#endif
-#ifdef RT2870
-#define BUILD_TIMER_FUNCTION(_func) \
-void linux_##_func(unsigned long data) \
-{ \
- PRALINK_TIMER_STRUCT _pTimer = (PRALINK_TIMER_STRUCT)data; \
- RT2870_TIMER_ENTRY *_pQNode; \
- RTMP_ADAPTER *_pAd; \
- \
- _pTimer->handle = _func; \
- _pAd = (RTMP_ADAPTER *)_pTimer->pAd; \
- _pQNode = RT2870_TimerQ_Insert(_pAd, _pTimer); \
- if ((_pQNode == NULL) && (_pAd->TimerQ.status & RT2870_THREAD_CAN_DO_INSERT)) \
- RTMP_OS_Add_Timer(&_pTimer->TimerObj, HZ); \
+#define RELEASE_NDIS_PACKET(_pAd, _pPacket, _Status) \
+{ \
+ RTMPFreeNdisPacket(_pAd, _pPacket); \
}
-#endif // RT2870 //
-
-
-#define DECLARE_TIMER_FUNCTION(_func) \
-void linux_##_func(unsigned long data)
-
-#define GET_TIMER_FUNCTION(_func) \
- linux_##_func
-
-DECLARE_TIMER_FUNCTION(MlmePeriodicExec);
-DECLARE_TIMER_FUNCTION(MlmeRssiReportExec);
-DECLARE_TIMER_FUNCTION(AsicRxAntEvalTimeout);
-DECLARE_TIMER_FUNCTION(APSDPeriodicExec);
-DECLARE_TIMER_FUNCTION(AsicRfTuningExec);
-#ifdef RT2870
-DECLARE_TIMER_FUNCTION(BeaconUpdateExec);
-#endif // RT2870 //
-
-DECLARE_TIMER_FUNCTION(BeaconTimeout);
-DECLARE_TIMER_FUNCTION(ScanTimeout);
-DECLARE_TIMER_FUNCTION(AuthTimeout);
-DECLARE_TIMER_FUNCTION(AssocTimeout);
-DECLARE_TIMER_FUNCTION(ReassocTimeout);
-DECLARE_TIMER_FUNCTION(DisassocTimeout);
-DECLARE_TIMER_FUNCTION(LinkDownExec);
-DECLARE_TIMER_FUNCTION(StaQuickResponeForRateUpExec);
-DECLARE_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
-DECLARE_TIMER_FUNCTION(PsPollWakeExec);
-DECLARE_TIMER_FUNCTION(RadioOnExec);
-
-void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
-
/*
* packet helper
@@ -604,12 +709,18 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
#define GET_OS_PKT_DATAPTR(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->data)
+#define SET_OS_PKT_DATAPTR(_pkt, _dataPtr) \
+ (RTPKT_TO_OSPKT(_pkt)->data) = (_dataPtr)
#define GET_OS_PKT_LEN(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->len)
+#define SET_OS_PKT_LEN(_pkt, _len) \
+ (RTPKT_TO_OSPKT(_pkt)->len) = (_len)
#define GET_OS_PKT_DATATAIL(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->tail)
+#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
+ ((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
#define GET_OS_PKT_HEAD(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->head)
@@ -619,6 +730,8 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
#define GET_OS_PKT_NETDEV(_pkt) \
(RTPKT_TO_OSPKT(_pkt)->dev)
+#define SET_OS_PKT_NETDEV(_pkt, _pNetDev) \
+ (RTPKT_TO_OSPKT(_pkt)->dev) = (_pNetDev)
#define GET_OS_PKT_TYPE(_pkt) \
(RTPKT_TO_OSPKT(_pkt))
@@ -627,6 +740,8 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
(RTPKT_TO_OSPKT(_pkt)->next)
+#define OS_PKT_CLONED(_pkt) skb_cloned(RTPKT_TO_OSPKT(_pkt))
+
#define OS_NTOHS(_Val) \
(ntohs(_Val))
#define OS_HTONS(_Val) \
@@ -636,27 +751,8 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
#define OS_HTONL(_Val) \
(htonl(_Val))
-/* statistics counter */
-#define STATS_INC_RX_PACKETS(_pAd, _dev)
-#define STATS_INC_TX_PACKETS(_pAd, _dev)
-
-#define STATS_INC_RX_BYTESS(_pAd, _dev, len)
-#define STATS_INC_TX_BYTESS(_pAd, _dev, len)
-
-#define STATS_INC_RX_ERRORS(_pAd, _dev)
-#define STATS_INC_TX_ERRORS(_pAd, _dev)
-
-#define STATS_INC_RX_DROPPED(_pAd, _dev)
-#define STATS_INC_TX_DROPPED(_pAd, _dev)
-
-
#define CB_OFF 10
-
-// check DDK NDIS_PACKET data structure and find out only MiniportReservedEx[0..7] can be used by our driver without
-// ambiguity. Fields after pPacket->MiniportReservedEx[8] may be used by other wrapper layer thus crashes the driver
-//
-
// User Priority
#define RTMP_SET_PACKET_UP(_p, _prio) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0] = _prio)
#define RTMP_GET_PACKET_UP(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0])
@@ -782,137 +878,38 @@ void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
#define RTMP_SET_PACKET_CLEAR_EAP_FRAME(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12] = _flg)
#define RTMP_GET_PACKET_CLEAR_EAP_FRAME(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12])
-#define RTMP_SET_PACKET_5VT(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22] = _flg)
-#define RTMP_GET_PACKET_5VT(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22])
-
-#ifdef CONFIG_5VT_ENHANCE
-#define BRIDGE_TAG 0x35564252 // depends on 5VT define in br_input.c
-#endif
-
-
-#define NDIS_SET_PACKET_STATUS(_p, _status)
-
-
-#define GET_SG_LIST_FROM_PACKET(_p, _sc) \
- rt_get_sg_list_from_packet(_p, _sc)
-
-#define NdisMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length)
-#define NdisZeroMemory(Destination, Length) memset(Destination, 0, Length)
-#define NdisFillMemory(Destination, Length, Fill) memset(Destination, Fill, Length)
-#define NdisEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
-#define RTMPEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
-
-
-#define RTMP_INC_REF(_A) 0
-#define RTMP_DEC_REF(_A) 0
-#define RTMP_GET_REF(_A) 0
-
-
-
-/*
- * ULONG
- * RTMP_GetPhysicalAddressLow(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
- */
-#define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress)
-
-/*
- * ULONG
- * RTMP_GetPhysicalAddressHigh(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
- */
-#define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0)
-
-/*
- * VOID
- * RTMP_SetPhysicalAddressLow(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
- * IN ULONG Value);
- */
-#define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \
- PhysicalAddress = Value;
-
-/*
- * VOID
- * RTMP_SetPhysicalAddressHigh(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
- * IN ULONG Value);
- */
-#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
-//CONTAINING_RECORD(pEntry, NDIS_PACKET, MiniportReservedEx);
-#define QUEUE_ENTRY_TO_PACKET(pEntry) \
- (PNDIS_PACKET)(pEntry)
-
-#define PACKET_TO_QUEUE_ENTRY(pPacket) \
- (PQUEUE_ENTRY)(pPacket)
-
-
-#ifndef CONTAINING_RECORD
-#define CONTAINING_RECORD(address, type, field) \
-((type *)((PCHAR)(address) - offsetof(type, field)))
-#endif
-
-
-#define RELEASE_NDIS_PACKET(_pAd, _pPacket, _Status) \
-{ \
- RTMPFreeNdisPacket(_pAd, _pPacket); \
-}
-
-
-#define SWITCH_PhyAB(_pAA, _pBB) \
-{ \
- ULONG AABasePaHigh; \
- ULONG AABasePaLow; \
- ULONG BBBasePaHigh; \
- ULONG BBBasePaLow; \
- BBBasePaHigh = RTMP_GetPhysicalAddressHigh(_pBB); \
- BBBasePaLow = RTMP_GetPhysicalAddressLow(_pBB); \
- AABasePaHigh = RTMP_GetPhysicalAddressHigh(_pAA); \
- AABasePaLow = RTMP_GetPhysicalAddressLow(_pAA); \
- RTMP_SetPhysicalAddressHigh(_pAA, BBBasePaHigh); \
- RTMP_SetPhysicalAddressLow(_pAA, BBBasePaLow); \
- RTMP_SetPhysicalAddressHigh(_pBB, AABasePaHigh); \
- RTMP_SetPhysicalAddressLow(_pBB, AABasePaLow); \
-}
-
-
-#define NdisWriteErrorLogEntry(_a, _b, _c, _d)
-#define NdisMAllocateMapRegisters(_a, _b, _c, _d, _e) NDIS_STATUS_SUCCESS
+/* use bit3 of cb[CB_OFF+16] */
+#define RTMP_SET_PACKET_5VT(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22] = _flg)
+#define RTMP_GET_PACKET_5VT(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22])
-#define NdisAcquireSpinLock RTMP_SEM_LOCK
-#define NdisReleaseSpinLock RTMP_SEM_UNLOCK
+/* Max skb->cb = 48B = [CB_OFF+38] */
-static inline void NdisGetSystemUpTime(ULONG *time)
-{
- *time = jiffies;
-}
-//pPacket = CONTAINING_RECORD(pEntry, NDIS_PACKET, MiniportReservedEx);
-#define QUEUE_ENTRY_TO_PKT(pEntry) \
- ((PNDIS_PACKET) (pEntry))
+/***********************************************************************************
+ * Other function prototypes definitions
+ ***********************************************************************************/
+void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
int rt28xx_packet_xmit(struct sk_buff *skb);
+#ifdef RTMP_MAC_PCI
+/* function declarations */
+#define IRQ_HANDLE_TYPE irqreturn_t
+IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance);
+#endif // RTMP_MAC_PCI //
-void rtmp_os_thread_init(PUCHAR pThreadName, PVOID pNotify);
-
-#ifdef RT2860
-#if !defined(PCI_CAP_ID_EXP)
-#define PCI_CAP_ID_EXP 0x10
-#endif
+INT rt28xx_sta_ioctl(
+ IN PNET_DEV net_dev,
+ IN OUT struct ifreq *rq,
+ IN INT cmd);
-#if !defined(PCI_EXP_LNKCTL)
-#define PCI_EXP_LNKCTL 0x10
-#endif
+extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char *buf);
+extern int ra_mtd_read(int num, loff_t from, size_t len, u_char *buf);
-#if !defined(PCI_CLASS_BRIDGE_PCI)
-#define PCI_CLASS_BRIDGE_PCI 0x0604
-#endif
-
-#define PCIBUS_INTEL_VENDOR 0x8086
-#endif
+#define GET_PAD_FROM_NET_DEV(_pAd, _net_dev) (_pAd) = (PRTMP_ADAPTER)(_net_dev)->ml_priv;
+#endif // __RT_LINUX_H__ //
diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c
index 22f37cfbefbe..7ea85e6a3363 100644
--- a/drivers/staging/rt2860/rt_main_dev.c
+++ b/drivers/staging/rt2860/rt_main_dev.c
@@ -33,20 +33,18 @@
Revision History:
Who When What
-------- ---------- ----------------------------------------------
- Sample Mar/21/07 Merge RT2870 and RT2860 drivers.
*/
#include "rt_config.h"
-#define FORTY_MHZ_INTOLERANT_INTERVAL (60*1000) // 1 min
+
/*---------------------------------------------------------------------*/
/* Private Variables Used */
/*---------------------------------------------------------------------*/
-//static RALINK_TIMER_STRUCT PeriodicTimer;
-char *mac = ""; // default 00:00:00:00:00:00
-char *hostname = ""; // default CMPC
+PSTRING mac = ""; // default 00:00:00:00:00:00
+PSTRING hostname = ""; // default CMPC
module_param (mac, charp, 0);
MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr");
@@ -54,31 +52,16 @@ MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr");
/*---------------------------------------------------------------------*/
/* Prototypes of Functions Used */
/*---------------------------------------------------------------------*/
-extern BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num);
-extern void ba_reordering_resource_release(PRTMP_ADAPTER pAd);
-extern NDIS_STATUS NICLoadRateSwitchingParams(IN PRTMP_ADAPTER pAd);
-
-#ifdef RT2860
-extern void init_thread_task(PRTMP_ADAPTER pAd);
-#endif
// public function prototype
-INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p,
- IN UINT argc, OUT PRTMP_ADAPTER *ppAd);
+int rt28xx_close(IN struct net_device *net_dev);
+int rt28xx_open(struct net_device *net_dev);
// private function prototype
-static int rt28xx_init(IN struct net_device *net_dev);
-INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev);
-
-static void CfgInitHook(PRTMP_ADAPTER pAd);
+static INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev);
-extern const struct iw_handler_def rt28xx_iw_handler_def;
-// This function will be called when query /proc
-struct iw_statistics *rt28xx_get_wireless_stats(
- IN struct net_device *net_dev);
-
-struct net_device_stats *RT28xx_get_ether_stats(
+static struct net_device_stats *RT28xx_get_ether_stats(
IN struct net_device *net_dev);
/*
@@ -103,7 +86,9 @@ Note:
*/
int MainVirtualIF_close(IN struct net_device *net_dev)
{
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
+ RTMP_ADAPTER *pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
// Sanity check for pAd
if (pAd == NULL)
@@ -112,6 +97,40 @@ int MainVirtualIF_close(IN struct net_device *net_dev)
netif_carrier_off(pAd->net_dev);
netif_stop_queue(pAd->net_dev);
+ {
+ BOOLEAN Cancelled;
+
+ if (INFRA_ON(pAd) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
+ {
+ MLME_DISASSOC_REQ_STRUCT DisReq;
+ MLME_QUEUE_ELEM *MsgElem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
+
+ if (MsgElem)
+ {
+ COPY_MAC_ADDR(DisReq.Addr, pAd->CommonCfg.Bssid);
+ DisReq.Reason = REASON_DEAUTH_STA_LEAVING;
+
+ MsgElem->Machine = ASSOC_STATE_MACHINE;
+ MsgElem->MsgType = MT2_MLME_DISASSOC_REQ;
+ MsgElem->MsgLen = sizeof(MLME_DISASSOC_REQ_STRUCT);
+ NdisMoveMemory(MsgElem->Msg, &DisReq, sizeof(MLME_DISASSOC_REQ_STRUCT));
+
+ // Prevent to connect AP again in STAMlmePeriodicExec
+ pAd->MlmeAux.AutoReconnectSsidLen= 32;
+ NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
+
+ pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
+ MlmeDisassocReqAction(pAd, MsgElem);
+ kfree(MsgElem);
+ }
+
+ RTMPusecDelay(1000);
+ }
+
+ RTMPCancelTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, &Cancelled);
+ RTMPCancelTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, &Cancelled);
+ }
VIRTUAL_IF_DOWN(pAd);
@@ -142,7 +161,9 @@ Note:
*/
int MainVirtualIF_open(IN struct net_device *net_dev)
{
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
+ RTMP_ADAPTER *pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
// Sanity check for pAd
if (pAd == NULL)
@@ -184,83 +205,46 @@ Note:
int rt28xx_close(IN PNET_DEV dev)
{
struct net_device * net_dev = (struct net_device *)dev;
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
- BOOLEAN Cancelled = FALSE;
+ RTMP_ADAPTER *pAd = NULL;
+ BOOLEAN Cancelled;
UINT32 i = 0;
-#ifdef RT2870
- DECLARE_WAIT_QUEUE_HEAD_ONSTACK(unlink_wakeup);
+
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
+#ifdef RTMP_MAC_USB
+ DECLARE_WAIT_QUEUE_HEAD(unlink_wakeup);
DECLARE_WAITQUEUE(wait, current);
//RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
-#endif // RT2870 //
-
+#endif // RTMP_MAC_USB //
DBGPRINT(RT_DEBUG_TRACE, ("===> rt28xx_close\n"));
+ Cancelled = FALSE;
// Sanity check for pAd
if (pAd == NULL)
return 0; // close ok
{
+#ifdef RTMP_MAC_PCI
+ RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_CLOSE);
+#endif // RTMP_MAC_PCI //
+
// If dirver doesn't wake up firmware here,
// NICLoadFirmware will hang forever when interface is up again.
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ||
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
-#endif
-#ifdef RT2870
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
-#endif
{
-#ifdef RT2860
- AsicForceWakeup(pAd, RTMP_HALT);
-#endif
-#ifdef RT2870
AsicForceWakeup(pAd, TRUE);
-#endif
}
- if (INFRA_ON(pAd) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
- {
- MLME_DISASSOC_REQ_STRUCT DisReq;
- MLME_QUEUE_ELEM *MsgElem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
-
- COPY_MAC_ADDR(DisReq.Addr, pAd->CommonCfg.Bssid);
- DisReq.Reason = REASON_DEAUTH_STA_LEAVING;
-
- MsgElem->Machine = ASSOC_STATE_MACHINE;
- MsgElem->MsgType = MT2_MLME_DISASSOC_REQ;
- MsgElem->MsgLen = sizeof(MLME_DISASSOC_REQ_STRUCT);
- NdisMoveMemory(MsgElem->Msg, &DisReq, sizeof(MLME_DISASSOC_REQ_STRUCT));
-
- // Prevent to connect AP again in STAMlmePeriodicExec
- pAd->MlmeAux.AutoReconnectSsidLen= 32;
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
- MlmeDisassocReqAction(pAd, MsgElem);
- kfree(MsgElem);
-
- RTMPusecDelay(1000);
- }
-
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
-#endif // RT2870 //
-
-#ifdef CCX_SUPPORT
- RTMPCancelTimer(&pAd->StaCfg.LeapAuthTimer, &Cancelled);
-#endif
-
- RTMPCancelTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, &Cancelled);
- RTMPCancelTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, &Cancelled);
+#endif // RTMP_MAC_USB //
MlmeRadioOff(pAd);
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
pAd->bPCIclkOff = FALSE;
-#endif
+#endif // RTMP_MAC_PCI //
}
RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
@@ -269,12 +253,12 @@ int rt28xx_close(IN PNET_DEV dev)
{
while (pAd->DeQueueRunning[i] == TRUE)
{
- printk("Waiting for TxQueue[%d] done..........\n", i);
+ DBGPRINT(RT_DEBUG_TRACE, ("Waiting for TxQueue[%d] done..........\n", i));
RTMPusecDelay(1000);
}
}
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
// ensure there are no more active urbs.
add_wait_queue (&unlink_wakeup, &wait);
pAd->wait = &unlink_wakeup;
@@ -299,290 +283,93 @@ int rt28xx_close(IN PNET_DEV dev)
}
pAd->wait = NULL;
remove_wait_queue (&unlink_wakeup, &wait);
-#endif // RT2870 //
-
-#ifdef RT2870
- // We need clear timerQ related structure before exits of the timer thread.
- RT2870_TimerQ_Exit(pAd);
- // Close kernel threads or tasklets
- RT28xxThreadTerminate(pAd);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// Stop Mlme state machine
MlmeHalt(pAd);
- // Close kernel threads or tasklets
- kill_thread_task(pAd);
-
- MacTableReset(pAd);
-
- MeasureReqTabExit(pAd);
- TpcReqTabExit(pAd);
+ // Close net tasklets
+ RtmpNetTaskExit(pAd);
-#ifdef RT2860
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
- {
- NICDisableInterrupt(pAd);
- }
-
- // Disable Rx, register value supposed will remain after reset
- NICIssueReset(pAd);
-
- // Free IRQ
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
- // Deregister interrupt function
- RT28XX_IRQ_RELEASE(net_dev)
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
+ MacTableReset(pAd);
}
-#endif
-
- // Free Ring or USB buffers
- RTMPFreeTxRxRingMemory(pAd);
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
-
- // Free BA reorder resource
- ba_reordering_resource_release(pAd);
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_START_UP);
-
- return 0; // close ok
-} /* End of rt28xx_close */
-
-static int rt28xx_init(IN struct net_device *net_dev)
-{
-#ifdef RT2860
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)net_dev->ml_priv;
-#endif
-#ifdef RT2870
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
-#endif
- UINT index;
- UCHAR TmpPhy;
- NDIS_STATUS Status;
- UINT32 MacCsr0 = 0;
-
- // Allocate BA Reordering memory
- ba_reordering_resource_init(pAd, MAX_REORDERING_MPDU_NUM);
-
- // Make sure MAC gets ready.
- index = 0;
- do
- {
- RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
- pAd->MACVersion = MacCsr0;
- if ((pAd->MACVersion != 0x00) && (pAd->MACVersion != 0xFFFFFFFF))
- break;
- RTMPusecDelay(10);
- } while (index++ < 100);
+ MeasureReqTabExit(pAd);
+ TpcReqTabExit(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("MAC_CSR0 [ Ver:Rev=0x%08x]\n", pAd->MACVersion));
-/*Iverson patch PCIE L1 issue */
- // Disable DMA
- RT28XXDMADisable(pAd);
+ // Close kernel threads
+ RtmpMgmtTaskExit(pAd);
- // Load 8051 firmware
- Status = NICLoadFirmware(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
+#ifdef RTMP_MAC_PCI
{
- DBGPRINT_ERR(("NICLoadFirmware failed, Status[=0x%08x]\n", Status));
- goto err1;
- }
-
- NICLoadRateSwitchingParams(pAd);
+ BOOLEAN brc;
+ // ULONG Value;
- // Disable interrupts here which is as soon as possible
- // This statement should never be true. We might consider to remove it later
-#ifdef RT2860
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
{
- NICDisableInterrupt(pAd);
+ RTMP_ASIC_INTERRUPT_DISABLE(pAd);
}
-#endif
- Status = RTMPAllocTxRxRingMemory(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("RTMPAllocDMAMemory failed, Status[=0x%08x]\n", Status));
- goto err1;
- }
+ // Receive packets to clear DMA index after disable interrupt.
+ //RTMPHandleRxDoneInterrupt(pAd);
+ // put to radio off to save power when driver unload. After radiooff, can't write /read register. So need to finish all
+ // register access before Radio off.
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
- // initialize MLME
- //
+ brc=RT28xxPciAsicRadioOff(pAd, RTMP_HALT, 0);
- Status = MlmeInit(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("MlmeInit failed, Status[=0x%08x]\n", Status));
- goto err2;
- }
+//In solution 3 of 3090F, the bPCIclkOff will be set to TRUE after calling RT28xxPciAsicRadioOff
+ pAd->bPCIclkOff = FALSE;
- // Initialize pAd->StaCfg, pAd->ApCfg, pAd->CommonCfg to manufacture default
- //
- UserCfgInit(pAd);
-
-#ifdef RT2870
- // We need init timerQ related structure before create the timer thread.
- RT2870_TimerQ_Init(pAd);
-#endif // RT2870 //
-
- RT28XX_TASK_THREAD_INIT(pAd, Status);
- if (Status != NDIS_STATUS_SUCCESS)
- goto err1;
-
- CfgInitHook(pAd);
-
- NdisAllocateSpinLock(&pAd->MacTabLock);
-
- MeasureReqTabInit(pAd);
- TpcReqTabInit(pAd);
-
- //
- // Init the hardware, we need to init asic before read registry, otherwise mac register will be reset
- //
- Status = NICInitializeAdapter(pAd, TRUE);
- if (Status != NDIS_STATUS_SUCCESS)
+ if (brc==FALSE)
{
- DBGPRINT_ERR(("NICInitializeAdapter failed, Status[=0x%08x]\n", Status));
- if (Status != NDIS_STATUS_SUCCESS)
- goto err3;
+ DBGPRINT(RT_DEBUG_ERROR,("%s call RT28xxPciAsicRadioOff fail !!\n", __func__));
}
-
- // Read parameters from Config File
- Status = RTMPReadParametersHook(pAd);
-
- printk("1. Phy Mode = %d\n", pAd->CommonCfg.PhyMode);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("NICReadRegParameters failed, Status[=0x%08x]\n",Status));
- goto err4;
}
-#ifdef RT2870
- pAd->CommonCfg.bMultipleIRP = FALSE;
-
- if (pAd->CommonCfg.bMultipleIRP)
- pAd->CommonCfg.NumOfBulkInIRP = RX_RING_SIZE;
- else
- pAd->CommonCfg.NumOfBulkInIRP = 1;
-#endif // RT2870 //
-
-
- //Init Ba Capability parameters.
- pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable;
- pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.DesiredHtPhy.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
- // UPdata to HT IE
- pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
- pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
-
- printk("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode);
-
- // We should read EEPROM for all cases. rt2860b
- NICReadEEPROMParameters(pAd, mac);
-
- printk("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode);
-
- NICInitAsicFromEEPROM(pAd); //rt2860b
- // Set PHY to appropriate mode
- TmpPhy = pAd->CommonCfg.PhyMode;
- pAd->CommonCfg.PhyMode = 0xff;
- RTMPSetPhyMode(pAd, TmpPhy);
- SetCommonHT(pAd);
-
- // No valid channels.
- if (pAd->ChannelListNum == 0)
+/*
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
{
- printk("Wrong configuration. No valid channel found. Check \"ContryCode\" and \"ChannelGeography\" setting.\n");
- goto err4;
+ RTMP_ASIC_INTERRUPT_DISABLE(pAd);
}
- printk("MCS Set = %02x %02x %02x %02x %02x\n", pAd->CommonCfg.HtCapability.MCSSet[0],
- pAd->CommonCfg.HtCapability.MCSSet[1], pAd->CommonCfg.HtCapability.MCSSet[2],
- pAd->CommonCfg.HtCapability.MCSSet[3], pAd->CommonCfg.HtCapability.MCSSet[4]);
-
-#ifdef RT2870
- //Init RT30xx RFRegisters after read RFIC type from EEPROM
- NICInitRT30xxRFRegisters(pAd);
-#endif // RT2870 //
-
-
- //
- // Initialize RF register to default value
- //
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
-#ifndef RT2870
- // 8051 firmware require the signal during booting time.
- AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00);
-#endif
+ // Disable Rx, register value supposed will remain after reset
+ NICIssueReset(pAd);
+*/
+#endif // RTMP_MAC_PCI //
- if (pAd && (Status != NDIS_STATUS_SUCCESS))
- {
- //
- // Undo everything if it failed
- //
+ // Free IRQ
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
+#ifdef RTMP_MAC_PCI
+ // Deregister interrupt function
+ RtmpOSIRQRelease(net_dev);
+#endif // RTMP_MAC_PCI //
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
}
- }
- else if (pAd)
- {
- // Microsoft HCT require driver send a disconnect event after driver initialization.
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n"));
-
-
-#ifdef RT2870
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_REMOVE_IN_PROGRESS);
-
- //
- // Support multiple BulkIn IRP,
- // the value on pAd->CommonCfg.NumOfBulkInIRP may be large than 1.
- //
- for(index=0; index<pAd->CommonCfg.NumOfBulkInIRP; index++)
- {
- RTUSBBulkReceive(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("RTUSBBulkReceive!\n" ));
- }
-#endif // RT2870 //
- }// end of else
+ // Free Ring or USB buffers
+ RTMPFreeTxRxRingMemory(pAd);
- DBGPRINT_S(Status, ("<==== RTMPInitialize, Status=%x\n", Status));
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- return TRUE;
+ // Free BA reorder resource
+ ba_reordering_resource_release(pAd);
-err4:
-err3:
- MlmeHalt(pAd);
-err2:
- RTMPFreeTxRxRingMemory(pAd);
-err1:
- os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool
- RT28XX_IRQ_RELEASE(net_dev);
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_START_UP);
- // shall not set ml_priv to NULL here because the ml_priv didn't been free yet.
- //net_dev->ml_priv = 0;
+/*+++Modify by woody to solve the bulk fail+++*/
+ {
+ }
- printk("!!! %s Initialized fail !!!\n", RT28xx_CHIP_NAME);
- return FALSE;
-} /* End of rt28xx_init */
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== rt28xx_close\n"));
+ return 0; // close ok
+} /* End of rt28xx_close */
/*
@@ -603,10 +390,11 @@ Note:
int rt28xx_open(IN PNET_DEV dev)
{
struct net_device * net_dev = (struct net_device *)dev;
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
int retval = 0;
- POS_COOKIE pObj;
+ //POS_COOKIE pObj;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
// Sanity check for pAd
if (pAd == NULL)
@@ -616,37 +404,27 @@ int rt28xx_open(IN PNET_DEV dev)
return -1;
}
- // Init
- pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- // reset Adapter flags
- RTMP_CLEAR_FLAGS(pAd);
+ if (net_dev->priv_flags == INT_MAIN)
+ {
+ if (pAd->OpMode == OPMODE_STA)
+ net_dev->wireless_handlers = (struct iw_handler_def *) &rt28xx_iw_handler_def;
+ }
// Request interrupt service routine for PCI device
// register the interrupt routine with the os
- RT28XX_IRQ_REQUEST(net_dev);
-
+ RtmpOSIRQRequest(net_dev);
- // Init BssTab & ChannelInfo tabbles for auto channel select.
+ // Init IRQ parameters stored in pAd
+ RTMP_IRQ_INIT(pAd);
// Chip & other init
- if (rt28xx_init(net_dev) == FALSE)
+ if (rt28xx_init(pAd, mac, hostname) == FALSE)
goto err;
- NdisZeroMemory(pAd->StaCfg.dev_name, 16);
- NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name));
-
- // Set up the Mac address
- NdisMoveMemory(net_dev->dev_addr, (void *) pAd->CurrentAddress, 6);
-
- // Init IRQ parameters
- RT28XX_IRQ_INIT(pAd);
-
- // Various AP function init
// Enable Interrupt
- RT28XX_IRQ_ENABLE(pAd);
+ RTMP_IRQ_ENABLE(pAd);
// Now Enable RxTx
RTMPEnableRxTx(pAd);
@@ -658,12 +436,28 @@ int rt28xx_open(IN PNET_DEV dev)
printk("0x1300 = %08x\n", reg);
}
-#ifdef RT2860
+ {
+// u32 reg;
+// UINT8 byte;
+// u16 tmp;
+
+// RTMP_IO_READ32(pAd, XIFS_TIME_CFG, &reg);
+
+// tmp = 0x0805;
+// reg = (reg & 0xffff0000) | tmp;
+// RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg);
+
+ }
+#ifdef RTMP_MAC_PCI
RTMPInitPCIeLinkCtrlValue(pAd);
-#endif
+#endif // RTMP_MAC_PCI //
+
return (retval);
err:
+//+++Add by shiang, move from rt28xx_init() to here.
+ RtmpOSIRQRelease(net_dev);
+//---Add by shiang, move from rt28xx_init() to here.
return (-1);
} /* End of rt28xx_open */
@@ -678,155 +472,33 @@ static const struct net_device_ops rt2860_netdev_ops = {
.ndo_start_xmit = rt28xx_send_packets,
};
-/* Must not be called for mdev and apdev */
-static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd)
+PNET_DEV RtmpPhyNetDevInit(
+ IN RTMP_ADAPTER *pAd,
+ IN RTMP_OS_NETDEV_OP_HOOK *pNetDevHook)
{
- NDIS_STATUS Status;
- INT i=0;
- CHAR slot_name[IFNAMSIZ];
- struct net_device *device;
-
- if (pAd->OpMode == OPMODE_STA)
- {
- dev->wireless_handlers = &rt28xx_iw_handler_def;
- }
-
- dev->priv_flags = INT_MAIN;
- dev->netdev_ops = &rt2860_netdev_ops;
- // find available device name
- for (i = 0; i < 8; i++)
- {
- sprintf(slot_name, "wlan%d", i);
-
- device = dev_get_by_name(dev_net(dev), slot_name);
- if (device != NULL)
- dev_put(device);
-
- if (device == NULL)
- break;
- }
-
- if(i == 8)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("No available slot name\n"));
- Status = NDIS_STATUS_FAILURE;
- }
- else
- {
- sprintf(dev->name, "wlan%d", i);
- Status = NDIS_STATUS_SUCCESS;
- }
-
- return Status;
+ struct net_device *net_dev = NULL;
+// NDIS_STATUS Status;
-}
-
-/*
-========================================================================
-Routine Description:
- Probe RT28XX chipset.
-
-Arguments:
- _dev_p Point to the PCI or USB device
- _dev_id_p Point to the PCI or USB device ID
-
-Return Value:
- 0 Probe OK
- -ENODEV Probe Fail
-
-Note:
-========================================================================
-*/
-INT __devinit rt28xx_probe(
- IN void *_dev_p,
- IN void *_dev_id_p,
- IN UINT argc,
- OUT PRTMP_ADAPTER *ppAd)
-{
- struct net_device *net_dev;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) NULL;
- INT status;
- PVOID handle;
-#ifdef RT2860
- struct pci_dev *dev_p = (struct pci_dev *)_dev_p;
-#endif
-#ifdef RT2870
- struct usb_interface *intf = (struct usb_interface *)_dev_p;
- struct usb_device *dev_p = interface_to_usbdev(intf);
-
- dev_p = usb_get_dev(dev_p);
-#endif // RT2870 //
-
- DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
-
- net_dev = alloc_etherdev(sizeof(PRTMP_ADAPTER));
+ net_dev = RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER), INF_MAIN_DEV_NAME);
if (net_dev == NULL)
{
- printk("alloc_netdev failed\n");
-
- goto err_out;
+ printk("RtmpPhyNetDevInit(): creation failed for main physical net device!\n");
+ return NULL;
}
- netif_stop_queue(net_dev);
-
-/* for supporting Network Manager */
-/* Set the sysfs physical device reference for the network logical device
- * if set prior to registration will cause a symlink during initialization.
- */
- SET_NETDEV_DEV(net_dev, &(dev_p->dev));
-
- // Allocate RTMP_ADAPTER miniport adapter structure
- handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL);
- if (handle == NULL)
- goto err_out_free_netdev;;
- RT28XX_HANDLE_DEV_ASSIGN(handle, dev_p);
-
- status = RTMPAllocAdapterBlock(handle, &pAd);
- if (status != NDIS_STATUS_SUCCESS)
- goto err_out_free_netdev;
+ NdisZeroMemory((unsigned char *)pNetDevHook, sizeof(RTMP_OS_NETDEV_OP_HOOK));
+ pNetDevHook->netdev_ops = &rt2860_netdev_ops;
+ pNetDevHook->priv_flags = INT_MAIN;
+ pNetDevHook->needProtcted = FALSE;
net_dev->ml_priv = (PVOID)pAd;
- pAd->net_dev = net_dev; // must be before RT28XXNetDevInit()
-
- RT28XXNetDevInit(_dev_p, net_dev, pAd);
-
- pAd->StaCfg.OriDevType = net_dev->type;
-
- // Post config
- if (RT28XXProbePostConfig(_dev_p, pAd, 0) == FALSE)
- goto err_out_unmap;
-
- pAd->OpMode = OPMODE_STA;
-
- // sample move
- if (rt_ieee80211_if_setup(net_dev, pAd) != NDIS_STATUS_SUCCESS)
- goto err_out_unmap;
-
- // Register this device
- status = register_netdev(net_dev);
- if (status)
- goto err_out_unmap;
-
- // Set driver data
- RT28XX_DRVDATA_SET(_dev_p);
-
- *ppAd = pAd;
- return 0; // probe ok
-
-
- /* --------------------------- ERROR HANDLE --------------------------- */
-err_out_unmap:
- RTMPFreeAdapter(pAd);
- RT28XX_UNMAP();
+ pAd->net_dev = net_dev;
-err_out_free_netdev:
- free_netdev(net_dev);
+ netif_stop_queue(net_dev);
-err_out:
- RT28XX_PUT_DEVICE(dev_p);
+ return net_dev;
- return -ENODEV; /* probe fail */
-} /* End of rt28xx_probe */
+}
/*
@@ -849,10 +521,14 @@ Note:
int rt28xx_packet_xmit(struct sk_buff *skb)
{
struct net_device *net_dev = skb->dev;
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
int status = NETDEV_TX_OK;
PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
+ /* RT2870STA does this in RTMPSendPackets() */
+
{
// Drop send request since we are in monitor mode
if (MONITOR_ON(pAd))
@@ -872,12 +548,6 @@ int rt28xx_packet_xmit(struct sk_buff *skb)
}
RTMP_SET_PACKET_5VT(pPacket, 0);
-#ifdef CONFIG_5VT_ENHANCE
- if (*(int*)(skb->cb) == BRIDGE_TAG) {
- RTMP_SET_PACKET_5VT(pPacket, 1);
- }
-#endif
-
STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1);
status = NETDEV_TX_OK;
@@ -903,11 +573,14 @@ Return Value:
Note:
========================================================================
*/
-INT rt28xx_send_packets(
+static int rt28xx_send_packets(
IN struct sk_buff *skb_p,
IN struct net_device *net_dev)
{
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
+ RTMP_ADAPTER *pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
if (!(net_dev->flags & IFF_UP))
{
RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
@@ -918,36 +591,35 @@ INT rt28xx_send_packets(
RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
return rt28xx_packet_xmit(skb_p);
-
-} /* End of MBSS_VirtualIF_PacketSend */
-
-
-
-
-void CfgInitHook(PRTMP_ADAPTER pAd)
-{
- pAd->bBroadComHT = TRUE;
-} /* End of CfgInitHook */
+}
// This function will be called when query /proc
struct iw_statistics *rt28xx_get_wireless_stats(
IN struct net_device *net_dev)
{
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n"));
pAd->iw_stats.status = 0; // Status - device dependent for now
// link quality
+ if (pAd->OpMode == OPMODE_STA)
pAd->iw_stats.qual.qual = ((pAd->Mlme.ChannelQuality * 12)/10 + 10);
+
if(pAd->iw_stats.qual.qual > 100)
pAd->iw_stats.qual.qual = 100;
if (pAd->OpMode == OPMODE_STA)
- pAd->iw_stats.qual.level = RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2);
+ {
+ pAd->iw_stats.qual.level =
+ RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0,
+ pAd->StaCfg.RssiSample.LastRssi1,
+ pAd->StaCfg.RssiSample.LastRssi2);
+ }
pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; // noise level (dBm)
@@ -962,13 +634,12 @@ struct iw_statistics *rt28xx_get_wireless_stats(
DBGPRINT(RT_DEBUG_TRACE, ("<--- rt28xx_get_wireless_stats\n"));
return &pAd->iw_stats;
-} /* End of rt28xx_get_wireless_stats */
-
+}
void tbtt_tasklet(unsigned long data)
{
-#define MAX_TX_IN_TBTT (16)
+//#define MAX_TX_IN_TBTT (16)
}
@@ -988,13 +659,13 @@ void tbtt_tasklet(unsigned long data)
========================================================================
*/
-struct net_device_stats *RT28xx_get_ether_stats(
+static struct net_device_stats *RT28xx_get_ether_stats(
IN struct net_device *net_dev)
{
RTMP_ADAPTER *pAd = NULL;
if (net_dev)
- pAd = net_dev->ml_priv;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
if (pAd)
{
@@ -1038,3 +709,55 @@ struct net_device_stats *RT28xx_get_ether_stats(
return NULL;
}
+
+BOOLEAN RtmpPhyNetDevExit(
+ IN RTMP_ADAPTER *pAd,
+ IN PNET_DEV net_dev)
+{
+
+
+
+ // Unregister network device
+ if (net_dev != NULL)
+ {
+ printk("RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=%s!\n", net_dev->name);
+ RtmpOSNetDevDetach(net_dev);
+ }
+
+ return TRUE;
+
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Allocate memory for adapter control block.
+
+Arguments:
+ pAd Pointer to our adapter
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+ NDIS_STATUS_FAILURE
+ NDIS_STATUS_RESOURCES
+
+Note:
+========================================================================
+*/
+NDIS_STATUS AdapterBlockAllocateMemory(
+ IN PVOID handle,
+ OUT PVOID *ppAd)
+{
+
+ *ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER)); //pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr);
+
+ if (*ppAd)
+ {
+ NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
+ ((PRTMP_ADAPTER)*ppAd)->OS_Cookie = handle;
+ return (NDIS_STATUS_SUCCESS);
+ } else {
+ return (NDIS_STATUS_FAILURE);
+ }
+}
diff --git a/drivers/staging/rt3090/rt_pci_rbus.c b/drivers/staging/rt2860/rt_pci_rbus.c
index 29913191273b..59900011b552 100644
--- a/drivers/staging/rt3090/rt_pci_rbus.c
+++ b/drivers/staging/rt2860/rt_pci_rbus.c
@@ -38,14 +38,7 @@
#include "rt_config.h"
#include <linux/pci.h>
-
-IRQ_HANDLE_TYPE
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-rt2860_interrupt(int irq, void *dev_instance);
-#else
-rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-#endif
-
+IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance);
static void rx_done_tasklet(unsigned long data);
static void mgmt_dma_done_tasklet(unsigned long data);
@@ -53,7 +46,6 @@ static void ac0_dma_done_tasklet(unsigned long data);
static void ac1_dma_done_tasklet(unsigned long data);
static void ac2_dma_done_tasklet(unsigned long data);
static void ac3_dma_done_tasklet(unsigned long data);
-/*static void hcca_dma_done_tasklet(unsigned long data);*/
static void fifo_statistic_full_tasklet(unsigned long data);
@@ -70,9 +62,6 @@ static void fifo_statistic_full_tasklet(unsigned long data);
#define RT2860_INT_AC3_DMA_DONE (1<<6) // bit 6
#define RT2860_INT_HCCA_DMA_DONE (1<<7) // bit 7
#define RT2860_INT_MGMT_DONE (1<<8) // bit 8
-#ifdef TONE_RADAR_DETECT_SUPPORT
-#define RT2860_INT_TONE_RADAR (1<<20) // bit 20
-#endif // TONE_RADAR_DETECT_SUPPORT //
#define INT_RX RT2860_INT_RX_DONE
@@ -82,9 +71,6 @@ static void fifo_statistic_full_tasklet(unsigned long data);
#define INT_AC3_DLY (RT2860_INT_AC3_DMA_DONE) //| RT2860_INT_TX_DLY)
#define INT_HCCA_DLY (RT2860_INT_HCCA_DMA_DONE) //| RT2860_INT_TX_DLY)
#define INT_MGMT_DLY RT2860_INT_MGMT_DONE
-#ifdef TONE_RADAR_DETECT_SUPPORT
-#define INT_TONE_RADAR (RT2860_INT_TONE_RADAR)
-#endif // TONE_RADAR_DETECT_SUPPORT //
/***************************************************************************
@@ -231,11 +217,7 @@ PNDIS_PACKET RTMP_AllocateRxPacketBuffer(
if (pkt) {
RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
*VirtualAddress = (PVOID) pkt->data;
-//#ifdef CONFIG_5VT_ENHANCE
-// *PhysicalAddress = PCI_MAP_SINGLE(pAd, *VirtualAddress, 1600, PCI_DMA_FROMDEVICE);
-//#else
*PhysicalAddress = PCI_MAP_SINGLE(pAd, *VirtualAddress, Length, -1, PCI_DMA_FROMDEVICE);
-//#endif
} else {
*VirtualAddress = (PVOID) NULL;
*PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL;
@@ -254,65 +236,6 @@ VOID Invalid_Remaining_Packet(
PhysicalAddress = PCI_MAP_SINGLE(pAd, (void *)(VirtualAddress+1600), RX_BUFFER_NORMSIZE-1600, -1, PCI_DMA_FROMDEVICE);
}
-
-int RtmpOSIRQRequest(IN struct net_device *net_dev)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)(RTMP_OS_NETDEV_GET_PRIV(net_dev));
- int retval = 0;
-
- ASSERT(pAd);
-
- if (pAd->infType != RTMP_DEV_INF_RBUS)
- {
- POS_COOKIE _pObj = (POS_COOKIE)(pAd->OS_Cookie);
- RTMP_MSI_ENABLE(pAd);
- retval = request_irq(_pObj->pci_dev->irq, rt2860_interrupt, SA_SHIRQ, (net_dev)->name, (net_dev));
- if (retval != 0)
- printk("RT2860: request_irq ERROR(%d)\n", retval);
- }
- else
- {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
- if ((retval = request_irq(net_dev->irq, rt2860_interrupt, IRQF_SHARED, net_dev->name ,net_dev)))
-#else
- if ((retval = request_irq(net_dev->irq,rt2860_interrupt, SA_INTERRUPT, net_dev->name ,net_dev)))
-#endif
- {
- printk("RT2860: request_irq ERROR(%d)\n", retval);
- }
- }
-
- return retval;
-
-}
-
-
-int RtmpOSIRQRelease(IN struct net_device *net_dev)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)(RTMP_OS_NETDEV_GET_PRIV(net_dev));
-
- ASSERT(pAd);
- if (pAd->infType != RTMP_DEV_INF_RBUS)
- {
- POS_COOKIE pObj = (POS_COOKIE)(pAd->OS_Cookie);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- synchronize_irq(pObj->pci_dev->irq);
-#endif
- free_irq(pObj->pci_dev->irq, (net_dev));
- RTMP_MSI_DISABLE(pAd);
- }
- else
- {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- synchronize_irq(net_dev->irq);
-#endif
- free_irq(net_dev->irq, (net_dev));
- }
-
- return 0;
-}
-
-
NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER *pAd)
{
POS_COOKIE pObj;
@@ -325,7 +248,6 @@ NDIS_STATUS RtmpNetTaskInit(IN RTMP_ADAPTER *pAd)
tasklet_init(&pObj->ac1_dma_done_task, ac1_dma_done_tasklet, (unsigned long)pAd);
tasklet_init(&pObj->ac2_dma_done_task, ac2_dma_done_tasklet, (unsigned long)pAd);
tasklet_init(&pObj->ac3_dma_done_task, ac3_dma_done_tasklet, (unsigned long)pAd);
- /*tasklet_init(&pObj->hcca_dma_done_task, hcca_dma_done_tasklet, (unsigned long)pAd);*/
tasklet_init(&pObj->tbtt_task, tbtt_tasklet, (unsigned long)pAd);
tasklet_init(&pObj->fifo_statistic_full_task, fifo_statistic_full_tasklet, (unsigned long)pAd);
@@ -345,7 +267,6 @@ void RtmpNetTaskExit(IN RTMP_ADAPTER *pAd)
tasklet_kill(&pObj->ac1_dma_done_task);
tasklet_kill(&pObj->ac2_dma_done_task);
tasklet_kill(&pObj->ac3_dma_done_task);
- /*tasklet_kill(&pObj->hcca_dma_done_task);*/
tasklet_kill(&pObj->tbtt_task);
tasklet_kill(&pObj->fifo_statistic_full_task);
}
@@ -472,21 +393,10 @@ static void rx_done_tasklet(unsigned long data)
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
return;
-#ifdef UAPSD_AP_SUPPORT
- UAPSD_TIMING_RECORD(pAd, UAPSD_TIMING_RECORD_TASKLET);
-#endif // UAPSD_AP_SUPPORT //
-
pObj = (POS_COOKIE) pAd->OS_Cookie;
pAd->int_pending &= ~(INT_RX);
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
bReschedule = STARxDoneInterruptHandle(pAd, 0);
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef UAPSD_AP_SUPPORT
- UAPSD_TIMING_RECORD_STOP();
-#endif // UAPSD_AP_SUPPORT //
RTMP_INT_LOCK(&pAd->irq_lock, flags);
/*
@@ -540,9 +450,6 @@ void fifo_statistic_full_tasklet(unsigned long data)
}
-
-
-
static void ac3_dma_done_tasklet(unsigned long data)
{
unsigned long flags;
@@ -709,18 +616,15 @@ static void ac0_dma_done_tasklet(unsigned long data)
**************************************************************************/
int print_int_count;
-IRQ_HANDLE_TYPE
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-rt2860_interrupt(int irq, void *dev_instance)
-#else
-rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
-#endif
+IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance)
{
struct net_device *net_dev = (struct net_device *) dev_instance;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) RTMP_OS_NETDEV_GET_PRIV(net_dev);
+ PRTMP_ADAPTER pAd = NULL;
INT_SOURCE_CSR_STRUC IntSource;
POS_COOKIE pObj;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
pObj = (POS_COOKIE) pAd->OS_Cookie;
@@ -767,11 +671,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
// Do nothing if Reset in progress
if (RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |fRTMP_ADAPTER_HALT_IN_PROGRESS)))
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED;
-#else
- return;
-#endif
}
//
@@ -795,11 +695,7 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
if (IntSource.word == 0xffffffff)
{
RTMP_SET_FLAG(pAd, (fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED;
-#else
- return;
-#endif
}
if (IntSource.word & TxCoherent)
@@ -847,7 +743,6 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
pAd->int_pending |= INT_RX;
}
-
if (IntSource.word & INT_AC3_DLY)
{
@@ -918,21 +813,12 @@ rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
RTMPHandleTBTTInterrupt(pAd);
}
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
{
if (IntSource.word & AutoWakeupInt)
RTMPHandleTwakeupInterrupt(pAd);
}
-#endif // CONFIG_STA_SUPPORT //
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
return IRQ_HANDLED;
-#endif
-
}
/*
diff --git a/drivers/staging/rt2860/rt_profile.c b/drivers/staging/rt2860/rt_profile.c
index 3bc41f83f624..4355331a2f2c 100644
--- a/drivers/staging/rt2860/rt_profile.c
+++ b/drivers/staging/rt2860/rt_profile.c
@@ -23,1840 +23,73 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
- */
-#include "rt_config.h"
-
-static void HTParametersHook(
- IN PRTMP_ADAPTER pAd,
- IN CHAR *pValueStr,
- IN CHAR *pInput);
-
-#define ETH_MAC_ADDR_STR_LEN 17 // in format of xx:xx:xx:xx:xx:xx
-
-// We assume the s1 is a sting, s2 is a memory space with 6 bytes. and content of s1 will be changed.
-BOOLEAN rtstrmactohex(char *s1, char *s2)
-{
- int i = 0;
- char *ptokS = s1, *ptokE = s1;
-
- if (strlen(s1) != ETH_MAC_ADDR_STR_LEN)
- return FALSE;
-
- while((*ptokS) != '\0')
- {
- if((ptokE = strchr(ptokS, ':')) != NULL)
- *ptokE++ = '\0';
- if ((strlen(ptokS) != 2) || (!isxdigit(*ptokS)) || (!isxdigit(*(ptokS+1))))
- break; // fail
- AtoH(ptokS, &s2[i++], 1);
- ptokS = ptokE;
- if (i == 6)
- break; // parsing finished
- }
-
- return ( i == 6 ? TRUE : FALSE);
-
-}
-
-
-// we assume the s1 and s2 both are strings.
-BOOLEAN rtstrcasecmp(char *s1, char *s2)
-{
- char *p1 = s1, *p2 = s2;
-
- if (strlen(s1) != strlen(s2))
- return FALSE;
-
- while(*p1 != '\0')
- {
- if((*p1 != *p2) && ((*p1 ^ *p2) != 0x20))
- return FALSE;
- p1++;
- p2++;
- }
-
- return TRUE;
-}
-
-// we assume the s1 (buffer) and s2 (key) both are strings.
-char * rtstrstruncasecmp(char * s1, char * s2)
-{
- INT l1, l2, i;
- char temp1, temp2;
-
- l2 = strlen(s2);
- if (!l2)
- return (char *) s1;
-
- l1 = strlen(s1);
-
- while (l1 >= l2)
- {
- l1--;
-
- for(i=0; i<l2; i++)
- {
- temp1 = *(s1+i);
- temp2 = *(s2+i);
-
- if (('a' <= temp1) && (temp1 <= 'z'))
- temp1 = 'A'+(temp1-'a');
- if (('a' <= temp2) && (temp2 <= 'z'))
- temp2 = 'A'+(temp2-'a');
-
- if (temp1 != temp2)
- break;
- }
-
- if (i == l2)
- return (char *) s1;
-
- s1++;
- }
-
- return NULL; // not found
-}
-
-//add by kathy
-
- /**
- * strstr - Find the first substring in a %NUL terminated string
- * @s1: The string to be searched
- * @s2: The string to search for
- */
-char * rtstrstr(const char * s1,const char * s2)
-{
- INT l1, l2;
-
- l2 = strlen(s2);
- if (!l2)
- return (char *) s1;
-
- l1 = strlen(s1);
-
- while (l1 >= l2)
- {
- l1--;
- if (!memcmp(s1,s2,l2))
- return (char *) s1;
- s1++;
- }
-
- return NULL;
-}
-
-/**
- * rstrtok - Split a string into tokens
- * @s: The string to be searched
- * @ct: The characters to search for
- * * WARNING: strtok is deprecated, use strsep instead. However strsep is not compatible with old architecture.
- */
-char * __rstrtok;
-char * rstrtok(char * s,const char * ct)
-{
- char *sbegin, *send;
-
- sbegin = s ? s : __rstrtok;
- if (!sbegin)
- {
- return NULL;
- }
-
- sbegin += strspn(sbegin,ct);
- if (*sbegin == '\0')
- {
- __rstrtok = NULL;
- return( NULL );
- }
-
- send = strpbrk( sbegin, ct);
- if (send && *send != '\0')
- *send++ = '\0';
-
- __rstrtok = send;
-
- return (sbegin);
-}
-
-/**
- * delimitcnt - return the count of a given delimiter in a given string.
- * @s: The string to be searched.
- * @ct: The delimiter to search for.
- * Notice : We suppose the delimiter is a single-char string(for example : ";").
- */
-INT delimitcnt(char * s,const char * ct)
-{
- INT count = 0;
- /* point to the beginning of the line */
- const char *token = s;
-
- for ( ;; )
- {
- token = strpbrk(token, ct); /* search for delimiters */
-
- if ( token == NULL )
- {
- /* advanced to the terminating null character */
- break;
- }
- /* skip the delimiter */
- ++token;
-
- /*
- * Print the found text: use len with %.*s to specify field width.
- */
-
- /* accumulate delimiter count */
- ++count;
- }
- return count;
-}
+ Module Name:
+ rt_profile.c
-/*
- * converts the Internet host address from the standard numbers-and-dots notation
- * into binary data.
- * returns nonzero if the address is valid, zero if not.
- */
-int rtinet_aton(const char *cp, unsigned int *addr)
-{
- unsigned int val;
- int base, n;
- char c;
- unsigned int parts[4];
- unsigned int *pp = parts;
+ Abstract:
- for (;;)
- {
- /*
- * Collect number up to ``.''.
- * Values are specified as for C:
- * 0x=hex, 0=octal, other=decimal.
- */
- val = 0;
- base = 10;
- if (*cp == '0')
- {
- if (*++cp == 'x' || *cp == 'X')
- base = 16, cp++;
- else
- base = 8;
- }
- while ((c = *cp) != '\0')
- {
- if (isdigit((unsigned char) c))
- {
- val = (val * base) + (c - '0');
- cp++;
- continue;
- }
- if (base == 16 && isxdigit((unsigned char) c))
- {
- val = (val << 4) +
- (c + 10 - (islower((unsigned char) c) ? 'a' : 'A'));
- cp++;
- continue;
- }
- break;
- }
- if (*cp == '.')
- {
- /*
- * Internet format: a.b.c.d a.b.c (with c treated as 16-bits)
- * a.b (with b treated as 24 bits)
- */
- if (pp >= parts + 3 || val > 0xff)
- return 0;
- *pp++ = val, cp++;
- }
- else
- break;
- }
-
- /*
- * Check for trailing junk.
+ Revision History:
+ Who When What
+ --------- ---------- ----------------------------------------------
*/
- while (*cp)
- if (!isspace((unsigned char) *cp++))
- return 0;
-
- /*
- * Concoct the address according to the number of parts specified.
- */
- n = pp - parts + 1;
- switch (n)
- {
-
- case 1: /* a -- 32 bits */
- break;
-
- case 2: /* a.b -- 8.24 bits */
- if (val > 0xffffff)
- return 0;
- val |= parts[0] << 24;
- break;
-
- case 3: /* a.b.c -- 8.8.16 bits */
- if (val > 0xffff)
- return 0;
- val |= (parts[0] << 24) | (parts[1] << 16);
- break;
-
- case 4: /* a.b.c.d -- 8.8.8.8 bits */
- if (val > 0xff)
- return 0;
- val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8);
- break;
- }
-
- *addr = htonl(val);
- return 1;
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Find key section for Get key parameter.
-
- Arguments:
- buffer Pointer to the buffer to start find the key section
- section the key of the secion to be find
-
- Return Value:
- NULL Fail
- Others Success
- ========================================================================
-*/
-PUCHAR RTMPFindSection(
- IN PCHAR buffer)
-{
- CHAR temp_buf[32];
- PUCHAR ptr;
-
- strcpy(temp_buf, "Default");
-
- if((ptr = rtstrstr(buffer, temp_buf)) != NULL)
- return (ptr+strlen("\n"));
- else
- return NULL;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Get key parameter.
- Arguments:
- key Pointer to key string
- dest Pointer to destination
- destsize The datasize of the destination
- buffer Pointer to the buffer to start find the key
-
- Return Value:
- TRUE Success
- FALSE Fail
-
- Note:
- This routine get the value with the matched key (case case-sensitive)
- ========================================================================
-*/
-INT RTMPGetKeyParameter(
- IN PCHAR key,
- OUT PCHAR dest,
- IN INT destsize,
- IN PCHAR buffer)
-{
- UCHAR *temp_buf1 = NULL;
- UCHAR *temp_buf2 = NULL;
- CHAR *start_ptr;
- CHAR *end_ptr;
- CHAR *ptr;
- CHAR *offset = 0;
- INT len;
-
- //temp_buf1 = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- os_alloc_mem(NULL, &temp_buf1, MAX_PARAM_BUFFER_SIZE);
-
- if(temp_buf1 == NULL)
- return (FALSE);
-
- //temp_buf2 = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- os_alloc_mem(NULL, &temp_buf2, MAX_PARAM_BUFFER_SIZE);
- if(temp_buf2 == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- return (FALSE);
- }
-
- //find section
- if((offset = RTMPFindSection(buffer)) == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- strcpy(temp_buf1, "\n");
- strcat(temp_buf1, key);
- strcat(temp_buf1, "=");
-
- //search key
- if((start_ptr=rtstrstr(offset, temp_buf1))==NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- start_ptr+=strlen("\n");
- if((end_ptr=rtstrstr(start_ptr, "\n"))==NULL)
- end_ptr=start_ptr+strlen(start_ptr);
-
- if (end_ptr<start_ptr)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- NdisMoveMemory(temp_buf2, start_ptr, end_ptr-start_ptr);
- temp_buf2[end_ptr-start_ptr]='\0';
- len = strlen(temp_buf2);
- strcpy(temp_buf1, temp_buf2);
- if((start_ptr=rtstrstr(temp_buf1, "=")) == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- strcpy(temp_buf2, start_ptr+1);
- ptr = temp_buf2;
- //trim space or tab
- while(*ptr != 0x00)
- {
- if( (*ptr == ' ') || (*ptr == '\t') )
- ptr++;
- else
- break;
- }
-
- len = strlen(ptr);
- memset(dest, 0x00, destsize);
- strncpy(dest, ptr, len >= destsize ? destsize: len);
-
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Get key parameter.
-
- Arguments:
- key Pointer to key string
- dest Pointer to destination
- destsize The datasize of the destination
- buffer Pointer to the buffer to start find the key
+#include "rt_config.h"
- Return Value:
- TRUE Success
- FALSE Fail
- Note:
- This routine get the value with the matched key (case case-sensitive).
- It is called for parsing SSID and any key string.
- ========================================================================
-*/
-INT RTMPGetCriticalParameter(
- IN PCHAR key,
- OUT PCHAR dest,
- IN INT destsize,
- IN PCHAR buffer)
+NDIS_STATUS RTMPReadParametersHook(
+ IN PRTMP_ADAPTER pAd)
{
- UCHAR *temp_buf1 = NULL;
- UCHAR *temp_buf2 = NULL;
- CHAR *start_ptr;
- CHAR *end_ptr;
- CHAR *ptr;
- CHAR *offset = 0;
- INT len;
+ PSTRING src = NULL;
+ RTMP_OS_FD srcf;
+ RTMP_OS_FS_INFO osFSInfo;
+ INT retval = NDIS_STATUS_FAILURE;
+ PSTRING buffer;
- //temp_buf1 = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- os_alloc_mem(NULL, &temp_buf1, MAX_PARAM_BUFFER_SIZE);
-
- if(temp_buf1 == NULL)
- return (FALSE);
-
- //temp_buf2 = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- os_alloc_mem(NULL, &temp_buf2, MAX_PARAM_BUFFER_SIZE);
- if(temp_buf2 == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- return (FALSE);
- }
-
- //find section
- if((offset = RTMPFindSection(buffer)) == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- strcpy(temp_buf1, "\n");
- strcat(temp_buf1, key);
- strcat(temp_buf1, "=");
-
- //search key
- if((start_ptr=rtstrstr(offset, temp_buf1))==NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- start_ptr+=strlen("\n");
- if((end_ptr=rtstrstr(start_ptr, "\n"))==NULL)
- end_ptr=start_ptr+strlen(start_ptr);
-
- if (end_ptr<start_ptr)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
+ buffer = kmalloc(MAX_INI_BUFFER_SIZE, MEM_ALLOC_FLAG);
+ if(buffer == NULL)
+ return NDIS_STATUS_FAILURE;
+ memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);
- NdisMoveMemory(temp_buf2, start_ptr, end_ptr-start_ptr);
- temp_buf2[end_ptr-start_ptr]='\0';
- len = strlen(temp_buf2);
- strcpy(temp_buf1, temp_buf2);
- if((start_ptr=rtstrstr(temp_buf1, "=")) == NULL)
{
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- strcpy(temp_buf2, start_ptr+1);
- ptr = temp_buf2;
-
- //trim tab
- /* We cannot trim space(' ') for SSID and key string. */
- while(*ptr != 0x00)
{
- //if( (*ptr == ' ') || (*ptr == '\t') )
- if( (*ptr == '\t') )
- ptr++;
- else
- break;
+ src = STA_PROFILE_PATH;
}
-
- len = strlen(ptr);
- memset(dest, 0x00, destsize);
- strncpy(dest, ptr, len >= destsize ? destsize: len);
-
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Get multiple key parameter.
-
- Arguments:
- key Pointer to key string
- dest Pointer to destination
- destsize The datasize of the destination
- buffer Pointer to the buffer to start find the key
-
- Return Value:
- TRUE Success
- FALSE Fail
-
- Note:
- This routine get the value with the matched key (case case-sensitive)
- ========================================================================
-*/
-INT RTMPGetKeyParameterWithOffset(
- IN PCHAR key,
- OUT PCHAR dest,
- OUT USHORT *end_offset,
- IN INT destsize,
- IN PCHAR buffer,
- IN BOOLEAN bTrimSpace)
-{
- UCHAR *temp_buf1 = NULL;
- UCHAR *temp_buf2 = NULL;
- CHAR *start_ptr;
- CHAR *end_ptr;
- CHAR *ptr;
- CHAR *offset = 0;
- INT len;
-
- if (*end_offset >= MAX_INI_BUFFER_SIZE)
- return (FALSE);
-
- os_alloc_mem(NULL, &temp_buf1, MAX_PARAM_BUFFER_SIZE);
-
- if(temp_buf1 == NULL)
- return (FALSE);
-
- os_alloc_mem(NULL, &temp_buf2, MAX_PARAM_BUFFER_SIZE);
- if(temp_buf2 == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- return (FALSE);
}
- //find section
- if(*end_offset == 0)
+ if (src && *src)
{
- if ((offset = RTMPFindSection(buffer)) == NULL)
+ RtmpOSFSInfoChange(&osFSInfo, TRUE);
+ srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
+ if (IS_FILE_OPEN_ERR(srcf))
{
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
+ DBGPRINT(RT_DEBUG_ERROR, ("Open file \"%s\" failed!\n", src));
}
else
- offset = buffer + (*end_offset);
-
- strcpy(temp_buf1, "\n");
- strcat(temp_buf1, key);
- strcat(temp_buf1, "=");
-
- //search key
- if((start_ptr=rtstrstr(offset, temp_buf1))==NULL)
{
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- start_ptr+=strlen("\n");
- if((end_ptr=rtstrstr(start_ptr, "\n"))==NULL)
- end_ptr=start_ptr+strlen(start_ptr);
-
- if (end_ptr<start_ptr)
+ retval =RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE);
+ if (retval > 0)
{
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
+ RTMPSetProfileParameters(pAd, buffer);
+ retval = NDIS_STATUS_SUCCESS;
}
-
- *end_offset = end_ptr - buffer;
-
- NdisMoveMemory(temp_buf2, start_ptr, end_ptr-start_ptr);
- temp_buf2[end_ptr-start_ptr]='\0';
- len = strlen(temp_buf2);
- strcpy(temp_buf1, temp_buf2);
- if((start_ptr=rtstrstr(temp_buf1, "=")) == NULL)
- {
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return (FALSE);
- }
-
- strcpy(temp_buf2, start_ptr+1);
- ptr = temp_buf2;
- //trim space or tab
- while(*ptr != 0x00)
- {
- if((bTrimSpace && (*ptr == ' ')) || (*ptr == '\t') )
- ptr++;
- else
- break;
- }
-
- len = strlen(ptr);
- memset(dest, 0x00, destsize);
- strncpy(dest, ptr, len >= destsize ? destsize: len);
-
- os_free_mem(NULL, temp_buf1);
- os_free_mem(NULL, temp_buf2);
- return TRUE;
-}
-
-
-static int rtmp_parse_key_buffer_from_file(IN PRTMP_ADAPTER pAd,IN char *buffer,IN ULONG KeyType,IN INT BSSIdx,IN INT KeyIdx)
-{
- PUCHAR keybuff;
- INT i = BSSIdx, idx = KeyIdx;
- ULONG KeyLen;
- UCHAR CipherAlg = CIPHER_WEP64;
-
- keybuff = buffer;
- KeyLen = strlen(keybuff);
-
- if (KeyType == 1)
- {//Ascii
- if( (KeyLen == 5) || (KeyLen == 13))
- {
- pAd->SharedKey[i][idx].KeyLen = KeyLen;
- NdisMoveMemory(pAd->SharedKey[i][idx].Key, keybuff, KeyLen);
- if (KeyLen == 5)
- CipherAlg = CIPHER_WEP64;
- else
- CipherAlg = CIPHER_WEP128;
- pAd->SharedKey[i][idx].CipherAlg = CipherAlg;
-
- DBGPRINT(RT_DEBUG_TRACE, ("I/F(wlan%d) Key%dStr=%s and type=%s\n", i, idx+1, keybuff, (KeyType == 0) ? "Hex":"Ascii"));
- return 1;
- }
- else
- {//Invalid key length
- DBGPRINT(RT_DEBUG_ERROR, ("Key%dStr is Invalid key length! KeyLen = %ld!\n", idx+1, KeyLen));
- return 0;
- }
- }
- else
- {//Hex type
- if( (KeyLen == 10) || (KeyLen == 26))
- {
- pAd->SharedKey[i][idx].KeyLen = KeyLen / 2;
- AtoH(keybuff, pAd->SharedKey[i][idx].Key, KeyLen / 2);
- if (KeyLen == 10)
- CipherAlg = CIPHER_WEP64;
- else
- CipherAlg = CIPHER_WEP128;
- pAd->SharedKey[i][idx].CipherAlg = CipherAlg;
-
- DBGPRINT(RT_DEBUG_TRACE, ("I/F(wlan%d) Key%dStr=%s and type=%s\n", i, idx+1, keybuff, (KeyType == 0) ? "Hex":"Ascii"));
- return 1;
- }
- else
- {//Invalid key length
- DBGPRINT(RT_DEBUG_ERROR, ("I/F(wlan%d) Key%dStr is Invalid key length! KeyLen = %ld!\n", i, idx+1, KeyLen));
- return 0;
- }
- }
-}
-static void rtmp_read_key_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbuf, char *buffer)
-{
- char tok_str[16];
- PUCHAR macptr;
- INT i = 0, idx;
- ULONG KeyType[MAX_MBSSID_NUM];
- ULONG KeyIdx;
-
- NdisZeroMemory(KeyType, MAX_MBSSID_NUM);
-
- //DefaultKeyID
- if(RTMPGetKeyParameter("DefaultKeyID", tmpbuf, 25, buffer))
- {
- {
- KeyIdx = simple_strtol(tmpbuf, 0, 10);
- if((KeyIdx >= 1 ) && (KeyIdx <= 4))
- pAd->StaCfg.DefaultKeyId = (UCHAR) (KeyIdx - 1);
- else
- pAd->StaCfg.DefaultKeyId = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("DefaultKeyID(0~3)=%d\n", pAd->StaCfg.DefaultKeyId));
- }
- }
-
-
- for (idx = 0; idx < 4; idx++)
- {
- sprintf(tok_str, "Key%dType", idx + 1);
- //Key1Type
- if (RTMPGetKeyParameter(tok_str, tmpbuf, 128, buffer))
- {
- for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
- {
- KeyType[i] = simple_strtol(macptr, 0, 10);
- }
-
- {
- sprintf(tok_str, "Key%dStr", idx + 1);
- if (RTMPGetCriticalParameter(tok_str, tmpbuf, 128, buffer))
- {
- rtmp_parse_key_buffer_from_file(pAd, tmpbuf, KeyType[BSS0], BSS0, idx);
- }
- }
- }
- }
-}
-
-static void rtmp_read_sta_wmm_parms_from_file(IN PRTMP_ADAPTER pAd, char *tmpbuf, char *buffer)
-{
- PUCHAR macptr;
- INT i=0;
- BOOLEAN bWmmEnable = FALSE;
-
- //WmmCapable
- if(RTMPGetKeyParameter("WmmCapable", tmpbuf, 32, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- {
- pAd->CommonCfg.bWmmCapable = TRUE;
- bWmmEnable = TRUE;
- }
- else //Disable
- {
- pAd->CommonCfg.bWmmCapable = FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("WmmCapable=%d\n", pAd->CommonCfg.bWmmCapable));
- }
-
- //AckPolicy for AC_BK, AC_BE, AC_VI, AC_VO
- if(RTMPGetKeyParameter("AckPolicy", tmpbuf, 32, buffer))
- {
- for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
- {
- pAd->CommonCfg.AckPolicy[i] = (UCHAR)simple_strtol(macptr, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("AckPolicy[%d]=%d\n", i, pAd->CommonCfg.AckPolicy[i]));
- }
- }
-
- if (bWmmEnable)
- {
- //APSDCapable
- if(RTMPGetKeyParameter("APSDCapable", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- pAd->CommonCfg.bAPSDCapable = TRUE;
else
- pAd->CommonCfg.bAPSDCapable = FALSE;
+ DBGPRINT(RT_DEBUG_ERROR, ("Read file \"%s\" failed(errCode=%d)!\n", src, retval));
- DBGPRINT(RT_DEBUG_TRACE, ("APSDCapable=%d\n", pAd->CommonCfg.bAPSDCapable));
- }
-
- //APSDAC for AC_BE, AC_BK, AC_VI, AC_VO
- if(RTMPGetKeyParameter("APSDAC", tmpbuf, 32, buffer))
+ retval = RtmpOSFileClose(srcf);
+ if ( retval != 0)
{
- BOOLEAN apsd_ac[4];
-
- for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
- {
- apsd_ac[i] = (BOOLEAN)simple_strtol(macptr, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("APSDAC%d %d\n", i, apsd_ac[i]));
- }
-
- pAd->CommonCfg.bAPSDAC_BE = apsd_ac[0];
- pAd->CommonCfg.bAPSDAC_BK = apsd_ac[1];
- pAd->CommonCfg.bAPSDAC_VI = apsd_ac[2];
- pAd->CommonCfg.bAPSDAC_VO = apsd_ac[3];
+ retval = NDIS_STATUS_FAILURE;
+ DBGPRINT(RT_DEBUG_ERROR, ("Close file \"%s\" failed(errCode=%d)!\n", src, retval));
}
}
-}
-
-NDIS_STATUS RTMPReadParametersHook(
- IN PRTMP_ADAPTER pAd)
-{
- PUCHAR src = NULL;
- struct file *srcf;
- INT retval;
- mm_segment_t orgfs;
- CHAR *buffer;
- CHAR *tmpbuf;
- ULONG RtsThresh;
- ULONG FragThresh;
- UCHAR keyMaterial[40];
-
- PUCHAR macptr;
- INT i = 0;
-
- buffer = kmalloc(MAX_INI_BUFFER_SIZE, MEM_ALLOC_FLAG);
- if(buffer == NULL)
- return NDIS_STATUS_FAILURE;
-
- tmpbuf = kmalloc(MAX_PARAM_BUFFER_SIZE, MEM_ALLOC_FLAG);
- if(tmpbuf == NULL)
- {
- kfree(buffer);
- return NDIS_STATUS_FAILURE;
- }
-
- src = STA_PROFILE_PATH;
-
- orgfs = get_fs();
- set_fs(KERNEL_DS);
-
- if (src && *src)
- {
- srcf = filp_open(src, O_RDONLY, 0);
- if (IS_ERR(srcf))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error %ld opening %s\n", -PTR_ERR(srcf),src));
- }
- else
- {
- // The object must have a read method
- if (srcf->f_op && srcf->f_op->read)
- {
- memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);
- retval=srcf->f_op->read(srcf, buffer, MAX_INI_BUFFER_SIZE, &srcf->f_pos);
- if (retval < 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> Read %s error %d\n", src, -retval));
- }
- else
- {
- // set file parameter to portcfg
- //CountryRegion
- if(RTMPGetKeyParameter("CountryRegion", tmpbuf, 25, buffer))
- {
- pAd->CommonCfg.CountryRegion = (UCHAR) simple_strtol(tmpbuf, 0, 10);
- DBGPRINT(RT_DEBUG_TRACE, ("CountryRegion=%d\n", pAd->CommonCfg.CountryRegion));
- }
- //CountryRegionABand
- if(RTMPGetKeyParameter("CountryRegionABand", tmpbuf, 25, buffer))
- {
- pAd->CommonCfg.CountryRegionForABand= (UCHAR) simple_strtol(tmpbuf, 0, 10);
- DBGPRINT(RT_DEBUG_TRACE, ("CountryRegionABand=%d\n", pAd->CommonCfg.CountryRegionForABand));
- }
- //CountryCode
- if(RTMPGetKeyParameter("CountryCode", tmpbuf, 25, buffer))
- {
- NdisMoveMemory(pAd->CommonCfg.CountryCode, tmpbuf , 2);
-
- if (strlen(pAd->CommonCfg.CountryCode) != 0)
- {
- pAd->CommonCfg.bCountryFlag = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("CountryCode=%s\n", pAd->CommonCfg.CountryCode));
- }
- //ChannelGeography
- if(RTMPGetKeyParameter("ChannelGeography", tmpbuf, 25, buffer))
- {
- UCHAR Geography = (UCHAR) simple_strtol(tmpbuf, 0, 10);
- if (Geography <= BOTH)
- {
- pAd->CommonCfg.Geography = Geography;
- pAd->CommonCfg.CountryCode[2] =
- (pAd->CommonCfg.Geography == BOTH) ? ' ' : ((pAd->CommonCfg.Geography == IDOR) ? 'I' : 'O');
- DBGPRINT(RT_DEBUG_TRACE, ("ChannelGeography=%d\n", pAd->CommonCfg.Geography));
- }
- }
- else
- {
- pAd->CommonCfg.Geography = BOTH;
- pAd->CommonCfg.CountryCode[2] = ' ';
- }
-
- {
- //SSID
- if (RTMPGetCriticalParameter("SSID", tmpbuf, 256, buffer))
- {
- if (strlen(tmpbuf) <= 32)
- {
- pAd->CommonCfg.SsidLen = (UCHAR) strlen(tmpbuf);
- NdisZeroMemory(pAd->CommonCfg.Ssid, NDIS_802_11_LENGTH_SSID);
- NdisMoveMemory(pAd->CommonCfg.Ssid, tmpbuf, pAd->CommonCfg.SsidLen);
- pAd->MlmeAux.AutoReconnectSsidLen = pAd->CommonCfg.SsidLen;
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, NDIS_802_11_LENGTH_SSID);
- NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, tmpbuf, pAd->MlmeAux.AutoReconnectSsidLen);
- pAd->MlmeAux.SsidLen = pAd->CommonCfg.SsidLen;
- NdisZeroMemory(pAd->MlmeAux.Ssid, NDIS_802_11_LENGTH_SSID);
- NdisMoveMemory(pAd->MlmeAux.Ssid, tmpbuf, pAd->MlmeAux.SsidLen);
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(SSID=%s)\n", __func__, tmpbuf));
- }
- }
- }
-
- {
- //NetworkType
- if (RTMPGetKeyParameter("NetworkType", tmpbuf, 25, buffer))
- {
- pAd->bConfigChanged = TRUE;
- if (strcmp(tmpbuf, "Adhoc") == 0)
- pAd->StaCfg.BssType = BSS_ADHOC;
- else //Default Infrastructure mode
- pAd->StaCfg.BssType = BSS_INFRA;
- // Reset Ralink supplicant to not use, it will be set to start when UI set PMK key
- pAd->StaCfg.WpaState = SS_NOTUSE;
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(NetworkType=%d)\n", __func__, pAd->StaCfg.BssType));
- }
- }
-
- //Channel
- if(RTMPGetKeyParameter("Channel", tmpbuf, 10, buffer))
- {
- pAd->CommonCfg.Channel = (UCHAR) simple_strtol(tmpbuf, 0, 10);
- DBGPRINT(RT_DEBUG_TRACE, ("Channel=%d\n", pAd->CommonCfg.Channel));
- }
- //WirelessMode
- if(RTMPGetKeyParameter("WirelessMode", tmpbuf, 10, buffer))
- {
- int value = 0, maxPhyMode = PHY_11G;
-
- maxPhyMode = PHY_11N_5G;
-
- value = simple_strtol(tmpbuf, 0, 10);
-
- if (value <= maxPhyMode)
- {
- pAd->CommonCfg.PhyMode = value;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("PhyMode=%d\n", pAd->CommonCfg.PhyMode));
- }
- //BasicRate
- if(RTMPGetKeyParameter("BasicRate", tmpbuf, 10, buffer))
- {
- pAd->CommonCfg.BasicRateBitmap = (ULONG) simple_strtol(tmpbuf, 0, 10);
- DBGPRINT(RT_DEBUG_TRACE, ("BasicRate=%ld\n", pAd->CommonCfg.BasicRateBitmap));
- }
- //BeaconPeriod
- if(RTMPGetKeyParameter("BeaconPeriod", tmpbuf, 10, buffer))
- {
- pAd->CommonCfg.BeaconPeriod = (USHORT) simple_strtol(tmpbuf, 0, 10);
- DBGPRINT(RT_DEBUG_TRACE, ("BeaconPeriod=%d\n", pAd->CommonCfg.BeaconPeriod));
- }
- //TxPower
- if(RTMPGetKeyParameter("TxPower", tmpbuf, 10, buffer))
- {
- pAd->CommonCfg.TxPowerPercentage = (ULONG) simple_strtol(tmpbuf, 0, 10);
-
- pAd->CommonCfg.TxPowerDefault = pAd->CommonCfg.TxPowerPercentage;
-
- DBGPRINT(RT_DEBUG_TRACE, ("TxPower=%ld\n", pAd->CommonCfg.TxPowerPercentage));
- }
- //BGProtection
- if(RTMPGetKeyParameter("BGProtection", tmpbuf, 10, buffer))
- {
- switch (simple_strtol(tmpbuf, 0, 10))
- {
- case 1: //Always On
- pAd->CommonCfg.UseBGProtection = 1;
- break;
- case 2: //Always OFF
- pAd->CommonCfg.UseBGProtection = 2;
- break;
- case 0: //AUTO
- default:
- pAd->CommonCfg.UseBGProtection = 0;
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("BGProtection=%ld\n", pAd->CommonCfg.UseBGProtection));
- }
- //OLBCDetection
- if(RTMPGetKeyParameter("DisableOLBC", tmpbuf, 10, buffer))
- {
- switch (simple_strtol(tmpbuf, 0, 10))
- {
- case 1: //disable OLBC Detection
- pAd->CommonCfg.DisableOLBCDetect = 1;
- break;
- case 0: //enable OLBC Detection
- pAd->CommonCfg.DisableOLBCDetect = 0;
- break;
- default:
- pAd->CommonCfg.DisableOLBCDetect= 0;
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("OLBCDetection=%ld\n", pAd->CommonCfg.DisableOLBCDetect));
- }
- //TxPreamble
- if(RTMPGetKeyParameter("TxPreamble", tmpbuf, 10, buffer))
- {
- switch (simple_strtol(tmpbuf, 0, 10))
- {
- case Rt802_11PreambleShort:
- pAd->CommonCfg.TxPreamble = Rt802_11PreambleShort;
- break;
- case Rt802_11PreambleLong:
- default:
- pAd->CommonCfg.TxPreamble = Rt802_11PreambleLong;
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("TxPreamble=%ld\n", pAd->CommonCfg.TxPreamble));
- }
- //RTSThreshold
- if(RTMPGetKeyParameter("RTSThreshold", tmpbuf, 10, buffer))
- {
- RtsThresh = simple_strtol(tmpbuf, 0, 10);
- if( (RtsThresh >= 1) && (RtsThresh <= MAX_RTS_THRESHOLD) )
- pAd->CommonCfg.RtsThreshold = (USHORT)RtsThresh;
- else
- pAd->CommonCfg.RtsThreshold = MAX_RTS_THRESHOLD;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTSThreshold=%d\n", pAd->CommonCfg.RtsThreshold));
- }
- //FragThreshold
- if(RTMPGetKeyParameter("FragThreshold", tmpbuf, 10, buffer))
- {
- FragThresh = simple_strtol(tmpbuf, 0, 10);
- pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;
-
- if (FragThresh > MAX_FRAG_THRESHOLD || FragThresh < MIN_FRAG_THRESHOLD)
- { //illegal FragThresh so we set it to default
- pAd->CommonCfg.FragmentThreshold = MAX_FRAG_THRESHOLD;
- pAd->CommonCfg.bUseZeroToDisableFragment = TRUE;
- }
- else if (FragThresh % 2 == 1)
- {
- // The length of each fragment shall always be an even number of octets, except for the last fragment
- // of an MSDU or MMPDU, which may be either an even or an odd number of octets.
- pAd->CommonCfg.FragmentThreshold = (USHORT)(FragThresh - 1);
- }
- else
- {
- pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh;
- }
- //pAd->CommonCfg.AllowFragSize = (pAd->CommonCfg.FragmentThreshold) - LENGTH_802_11 - LENGTH_CRC;
- DBGPRINT(RT_DEBUG_TRACE, ("FragThreshold=%d\n", pAd->CommonCfg.FragmentThreshold));
- }
- //TxBurst
- if(RTMPGetKeyParameter("TxBurst", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- pAd->CommonCfg.bEnableTxBurst = TRUE;
- else //Disable
- pAd->CommonCfg.bEnableTxBurst = FALSE;
- DBGPRINT(RT_DEBUG_TRACE, ("TxBurst=%d\n", pAd->CommonCfg.bEnableTxBurst));
- }
-
-#ifdef AGGREGATION_SUPPORT
- //PktAggregate
- if(RTMPGetKeyParameter("PktAggregate", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- pAd->CommonCfg.bAggregationCapable = TRUE;
- else //Disable
- pAd->CommonCfg.bAggregationCapable = FALSE;
-#ifdef PIGGYBACK_SUPPORT
- pAd->CommonCfg.bPiggyBackCapable = pAd->CommonCfg.bAggregationCapable;
-#endif // PIGGYBACK_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE, ("PktAggregate=%d\n", pAd->CommonCfg.bAggregationCapable));
- }
-#else
- pAd->CommonCfg.bAggregationCapable = FALSE;
- pAd->CommonCfg.bPiggyBackCapable = FALSE;
-#endif // AGGREGATION_SUPPORT //
-
- // WmmCapable
- rtmp_read_sta_wmm_parms_from_file(pAd, tmpbuf, buffer);
-
- //ShortSlot
- if(RTMPGetKeyParameter("ShortSlot", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0) //Enable
- pAd->CommonCfg.bUseShortSlotTime = TRUE;
- else //Disable
- pAd->CommonCfg.bUseShortSlotTime = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ShortSlot=%d\n", pAd->CommonCfg.bUseShortSlotTime));
- }
- //IEEE80211H
- if(RTMPGetKeyParameter("IEEE80211H", tmpbuf, 10, buffer))
- {
- for (i = 0, macptr = rstrtok(tmpbuf,";"); macptr; macptr = rstrtok(NULL,";"), i++)
- {
- if(simple_strtol(macptr, 0, 10) != 0) //Enable
- pAd->CommonCfg.bIEEE80211H = TRUE;
- else //Disable
- pAd->CommonCfg.bIEEE80211H = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("IEEE80211H=%d\n", pAd->CommonCfg.bIEEE80211H));
- }
- }
- //CSPeriod
- if(RTMPGetKeyParameter("CSPeriod", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.RadarDetect.CSPeriod = simple_strtol(tmpbuf, 0, 10);
- else
- pAd->CommonCfg.RadarDetect.CSPeriod = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("CSPeriod=%d\n", pAd->CommonCfg.RadarDetect.CSPeriod));
- }
-
- //RDRegion
- if(RTMPGetKeyParameter("RDRegion", tmpbuf, 128, buffer))
- {
- if ((strncmp(tmpbuf, "JAP_W53", 7) == 0) || (strncmp(tmpbuf, "jap_w53", 7) == 0))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = JAP_W53;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 15;
- }
- else if ((strncmp(tmpbuf, "JAP_W56", 7) == 0) || (strncmp(tmpbuf, "jap_w56", 7) == 0))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = JAP_W56;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 13;
- }
- else if ((strncmp(tmpbuf, "JAP", 3) == 0) || (strncmp(tmpbuf, "jap", 3) == 0))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = JAP;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 5;
- }
- else if ((strncmp(tmpbuf, "FCC", 3) == 0) || (strncmp(tmpbuf, "fcc", 3) == 0))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = FCC;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 5;
- }
- else if ((strncmp(tmpbuf, "CE", 2) == 0) || (strncmp(tmpbuf, "ce", 2) == 0))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = CE;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 13;
- }
- else
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = CE;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 13;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("RDRegion=%d\n", pAd->CommonCfg.RadarDetect.RDDurRegion));
- }
- else
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = CE;
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 13;
- }
-
- //WirelessEvent
- if(RTMPGetKeyParameter("WirelessEvent", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.bWirelessEvent = simple_strtol(tmpbuf, 0, 10);
- else
- pAd->CommonCfg.bWirelessEvent = 0; // disable
- DBGPRINT(RT_DEBUG_TRACE, ("WirelessEvent=%d\n", pAd->CommonCfg.bWirelessEvent));
- }
- if(RTMPGetKeyParameter("WiFiTest", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) != 0)
- pAd->CommonCfg.bWiFiTest= simple_strtol(tmpbuf, 0, 10);
- else
- pAd->CommonCfg.bWiFiTest = 0; // disable
-
- DBGPRINT(RT_DEBUG_TRACE, ("WiFiTest=%d\n", pAd->CommonCfg.bWiFiTest));
- }
- //AuthMode
- if(RTMPGetKeyParameter("AuthMode", tmpbuf, 128, buffer))
- {
- {
- if ((strcmp(tmpbuf, "WEPAUTO") == 0) || (strcmp(tmpbuf, "wepauto") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeAutoSwitch;
- else if ((strcmp(tmpbuf, "SHARED") == 0) || (strcmp(tmpbuf, "shared") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeShared;
- else if ((strcmp(tmpbuf, "WPAPSK") == 0) || (strcmp(tmpbuf, "wpapsk") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPAPSK;
- else if ((strcmp(tmpbuf, "WPANONE") == 0) || (strcmp(tmpbuf, "wpanone") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
- else if ((strcmp(tmpbuf, "WPA2PSK") == 0) || (strcmp(tmpbuf, "wpa2psk") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
- else if ((strcmp(tmpbuf, "WPA") == 0) || (strcmp(tmpbuf, "wpa") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
- else if ((strcmp(tmpbuf, "WPA2") == 0) || (strcmp(tmpbuf, "wpa2") == 0))
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
- else
- pAd->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
-
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
- }
- }
- //EncrypType
- if(RTMPGetKeyParameter("EncrypType", tmpbuf, 128, buffer))
- {
- {
- if ((strcmp(tmpbuf, "WEP") == 0) || (strcmp(tmpbuf, "wep") == 0))
- pAd->StaCfg.WepStatus = Ndis802_11WEPEnabled;
- else if ((strcmp(tmpbuf, "TKIP") == 0) || (strcmp(tmpbuf, "tkip") == 0))
- pAd->StaCfg.WepStatus = Ndis802_11Encryption2Enabled;
- else if ((strcmp(tmpbuf, "AES") == 0) || (strcmp(tmpbuf, "aes") == 0))
- pAd->StaCfg.WepStatus = Ndis802_11Encryption3Enabled;
- else
- pAd->StaCfg.WepStatus = Ndis802_11WEPDisabled;
-
- // Update all wepstatus related
- pAd->StaCfg.PairCipher = pAd->StaCfg.WepStatus;
- pAd->StaCfg.GroupCipher = pAd->StaCfg.WepStatus;
- pAd->StaCfg.OrigWepStatus = pAd->StaCfg.WepStatus;
- pAd->StaCfg.bMixCipher = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(EncrypType=%d)\n", __func__, pAd->StaCfg.WepStatus));
- }
- }
-
- {
- if(RTMPGetCriticalParameter("WPAPSK", tmpbuf, 512, buffer))
- {
- int err=0;
-
- tmpbuf[strlen(tmpbuf)] = '\0'; // make STA can process .$^& for WPAPSK input
-
- if ((pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPAPSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPA2PSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPANone)
- )
- {
- err = 1;
- }
- else if ((strlen(tmpbuf) >= 8) && (strlen(tmpbuf) < 64))
- {
- PasswordHash((char *)tmpbuf, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, keyMaterial);
- NdisMoveMemory(pAd->StaCfg.PMK, keyMaterial, 32);
-
- }
- else if (strlen(tmpbuf) == 64)
- {
- AtoH(tmpbuf, keyMaterial, 32);
- NdisMoveMemory(pAd->StaCfg.PMK, keyMaterial, 32);
- }
- else
- {
- err = 1;
- DBGPRINT(RT_DEBUG_ERROR, ("%s::(WPAPSK key-string required 8 ~ 64 characters!)\n", __func__));
- }
-
- if (err == 0)
- {
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- // Start STA supplicant state machine
- pAd->StaCfg.WpaState = SS_START;
- }
- else if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- pAd->StaCfg.WpaState = SS_NOTUSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(WPAPSK=%s)\n", __func__, tmpbuf));
- }
- }
- }
-
- //DefaultKeyID, KeyType, KeyStr
- rtmp_read_key_parms_from_file(pAd, tmpbuf, buffer);
-
- HTParametersHook(pAd, tmpbuf, buffer);
-
- {
- //PSMode
-#ifdef RT2860
- if (RTMPGetKeyParameter("PSMode", tmpbuf, 32, buffer))
-#endif
-#ifdef RT2870
- if (RTMPGetKeyParameter("PSMode", tmpbuf, 10, buffer))
-#endif
- {
- if (pAd->StaCfg.BssType == BSS_INFRA)
- {
- if ((strcmp(tmpbuf, "MAX_PSP") == 0) || (strcmp(tmpbuf, "max_psp") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
- // to exclude certain situations.
- // MlmeSetPsm(pAd, PWR_SAVE);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
- if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
- pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeMAX_PSP;
- pAd->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeMAX_PSP;
- pAd->StaCfg.DefaultListenCount = 5;
- }
- else if ((strcmp(tmpbuf, "Fast_PSP") == 0) || (strcmp(tmpbuf, "fast_psp") == 0)
- || (strcmp(tmpbuf, "FAST_PSP") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
- // to exclude certain situations.
- // MlmeSetPsmBit(pAd, PWR_SAVE);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
- if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
- pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeFast_PSP;
- pAd->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeFast_PSP;
- pAd->StaCfg.DefaultListenCount = 3;
- }
- else if ((strcmp(tmpbuf, "Legacy_PSP") == 0) || (strcmp(tmpbuf, "legacy_psp") == 0)
- || (strcmp(tmpbuf, "LEGACY_PSP") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
- // to exclude certain situations.
- // MlmeSetPsmBit(pAd, PWR_SAVE);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
- if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
- pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeLegacy_PSP;
- pAd->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeLegacy_PSP;
- pAd->StaCfg.DefaultListenCount = 3;
- }
- else
- { //Default Ndis802_11PowerModeCAM
- // clear PSM bit immediately
- MlmeSetPsmBit(pAd, PWR_ACTIVE);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
- if (pAd->StaCfg.bWindowsACCAMEnable == FALSE)
- pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeCAM;
- pAd->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeCAM;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("PSMode=%ld\n", pAd->StaCfg.WindowsPowerMode));
- }
- }
- // FastRoaming
- if (RTMPGetKeyParameter("FastRoaming", tmpbuf, 32, buffer))
- {
- if (simple_strtol(tmpbuf, 0, 10) == 0)
- pAd->StaCfg.bFastRoaming = FALSE;
- else
- pAd->StaCfg.bFastRoaming = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("FastRoaming=%d\n", pAd->StaCfg.bFastRoaming));
- }
- // RoamThreshold
- if (RTMPGetKeyParameter("RoamThreshold", tmpbuf, 32, buffer))
- {
- long lInfo = simple_strtol(tmpbuf, 0, 10);
-
- if (lInfo > 90 || lInfo < 60)
- pAd->StaCfg.dBmToRoam = -70;
- else
- pAd->StaCfg.dBmToRoam = (CHAR)(-1)*lInfo;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RoamThreshold=%d dBm\n", pAd->StaCfg.dBmToRoam));
- }
-
- if(RTMPGetKeyParameter("TGnWifiTest", tmpbuf, 10, buffer))
- {
- if(simple_strtol(tmpbuf, 0, 10) == 0)
- pAd->StaCfg.bTGnWifiTest = FALSE;
- else
- pAd->StaCfg.bTGnWifiTest = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("TGnWifiTest=%d\n", pAd->StaCfg.bTGnWifiTest));
- }
- }
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> %s does not have a write method\n", src));
- }
-
- retval=filp_close(srcf,NULL);
-
- if (retval)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> Error %d closing %s\n", -retval, src));
- }
- }
+ RtmpOSFSInfoChange(&osFSInfo, FALSE);
}
- set_fs(orgfs);
-
kfree(buffer);
- kfree(tmpbuf);
-
- return (NDIS_STATUS_SUCCESS);
-}
-
-static void HTParametersHook(
- IN PRTMP_ADAPTER pAd,
- IN CHAR *pValueStr,
- IN CHAR *pInput)
-{
-
- INT Value;
-
- if (RTMPGetKeyParameter("HT_PROTECT", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bHTProtect = FALSE;
- }
- else
- {
- pAd->CommonCfg.bHTProtect = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Protection = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
- if (RTMPGetKeyParameter("HT_MIMOPSEnable", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bMIMOPSEnable = FALSE;
- }
- else
- {
- pAd->CommonCfg.bMIMOPSEnable = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MIMOPSEnable = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
-
- if (RTMPGetKeyParameter("HT_MIMOPSMode", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value > MMPS_ENABLE)
- {
- pAd->CommonCfg.BACapability.field.MMPSmode = MMPS_ENABLE;
- }
- else
- {
- //TODO: add mimo power saving mechanism
- pAd->CommonCfg.BACapability.field.MMPSmode = MMPS_ENABLE;
- //pAd->CommonCfg.BACapability.field.MMPSmode = Value;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MIMOPS Mode = %d\n", Value));
- }
-
- if (RTMPGetKeyParameter("HT_BADecline", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bBADecline = FALSE;
- }
- else
- {
- pAd->CommonCfg.bBADecline = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: BA Decline = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
-
- if (RTMPGetKeyParameter("HT_DisableReordering", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bDisableReordering = FALSE;
- }
- else
- {
- pAd->CommonCfg.bDisableReordering = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: DisableReordering = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
- if (RTMPGetKeyParameter("HT_AutoBA", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
- pAd->CommonCfg.BACapability.field.Policy = BA_NOTUSE;
- }
- else
- {
- pAd->CommonCfg.BACapability.field.AutoBA = TRUE;
- pAd->CommonCfg.BACapability.field.Policy = IMMED_BA;
- }
- pAd->CommonCfg.REGBACapability.field.AutoBA = pAd->CommonCfg.BACapability.field.AutoBA;
- pAd->CommonCfg.REGBACapability.field.Policy = pAd->CommonCfg.BACapability.field.Policy;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Auto BA = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
- // Tx_+HTC frame
- if (RTMPGetKeyParameter("HT_HTC", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->HTCEnable = FALSE;
- }
- else
- {
- pAd->HTCEnable = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Tx +HTC frame = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
- // Enable HT Link Adaptation Control
- if (RTMPGetKeyParameter("HT_LinkAdapt", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->bLinkAdapt = FALSE;
- }
- else
- {
- pAd->HTCEnable = TRUE;
- pAd->bLinkAdapt = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Link Adaptation Control = %s\n", (Value==0) ? "Disable" : "Enable(+HTC)"));
- }
-
- // Reverse Direction Mechanism
- if (RTMPGetKeyParameter("HT_RDG", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bRdg = FALSE;
- }
- else
- {
- pAd->HTCEnable = TRUE;
- pAd->CommonCfg.bRdg = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: RDG = %s\n", (Value==0) ? "Disable" : "Enable(+HTC)"));
- }
-
-
-
-
- // Tx A-MSUD ?
- if (RTMPGetKeyParameter("HT_AMSDU", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.BACapability.field.AmsduEnable = FALSE;
- }
- else
- {
- pAd->CommonCfg.BACapability.field.AmsduEnable = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Tx A-MSDU = %s\n", (Value==0) ? "Disable" : "Enable"));
- }
-
- // MPDU Density
- if (RTMPGetKeyParameter("HT_MpduDensity", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value <=7 && Value >= 0)
- {
- pAd->CommonCfg.BACapability.field.MpduDensity = Value;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MPDU Density = %d\n", Value));
- }
- else
- {
- pAd->CommonCfg.BACapability.field.MpduDensity = 4;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MPDU Density = %d (Default)\n", 4));
- }
- }
-
- // Max Rx BA Window Size
- if (RTMPGetKeyParameter("HT_BAWinSize", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if (Value >=1 && Value <= 64)
- {
- pAd->CommonCfg.REGBACapability.field.RxBAWinLimit = Value;
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = Value;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: BA Windw Size = %d\n", Value));
- }
- else
- {
- pAd->CommonCfg.REGBACapability.field.RxBAWinLimit = 64;
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = 64;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: BA Windw Size = 64 (Defualt)\n"));
- }
-
- }
-
- // Guard Interval
- if (RTMPGetKeyParameter("HT_GI", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if (Value == GI_400)
- {
- pAd->CommonCfg.RegTransmitSetting.field.ShortGI = GI_400;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.ShortGI = GI_800;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Guard Interval = %s\n", (Value==GI_400) ? "400" : "800" ));
- }
-
- // HT Operation Mode : Mixed Mode , Green Field
- if (RTMPGetKeyParameter("HT_OpMode", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if (Value == HTMODE_GF)
- {
-
- pAd->CommonCfg.RegTransmitSetting.field.HTMODE = HTMODE_GF;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.HTMODE = HTMODE_MM;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Operate Mode = %s\n", (Value==HTMODE_GF) ? "Green Field" : "Mixed Mode" ));
- }
-
- // Fixed Tx mode : CCK, OFDM
- if (RTMPGetKeyParameter("FixedTxMode", pValueStr, 25, pInput))
- {
- UCHAR fix_tx_mode;
-
- {
- fix_tx_mode = FIXED_TXMODE_HT;
-
- if (strcmp(pValueStr, "OFDM") == 0 || strcmp(pValueStr, "ofdm") == 0)
- {
- fix_tx_mode = FIXED_TXMODE_OFDM;
- }
- else if (strcmp(pValueStr, "CCK") == 0 || strcmp(pValueStr, "cck") == 0)
- {
- fix_tx_mode = FIXED_TXMODE_CCK;
- }
- else if (strcmp(pValueStr, "HT") == 0 || strcmp(pValueStr, "ht") == 0)
- {
- fix_tx_mode = FIXED_TXMODE_HT;
- }
- else
- {
- Value = simple_strtol(pValueStr, 0, 10);
- // 1 : CCK
- // 2 : OFDM
- // otherwise : HT
- if (Value == FIXED_TXMODE_CCK || Value == FIXED_TXMODE_OFDM)
- fix_tx_mode = Value;
- else
- fix_tx_mode = FIXED_TXMODE_HT;
- }
-
- pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode = fix_tx_mode;
- DBGPRINT(RT_DEBUG_TRACE, ("Fixed Tx Mode = %d\n", fix_tx_mode));
-
- }
- }
-
-
- // Channel Width
- if (RTMPGetKeyParameter("HT_BW", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if (Value == BW_40)
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- }
-
-#ifdef MCAST_RATE_SPECIFIC
- pAd->CommonCfg.MCastPhyMode.field.BW = pAd->CommonCfg.RegTransmitSetting.field.BW;
-#endif // MCAST_RATE_SPECIFIC //
-
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Channel Width = %s\n", (Value==BW_40) ? "40 MHz" : "20 MHz" ));
- }
-
- if (RTMPGetKeyParameter("HT_EXTCHA", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if (Value == 0)
- {
-
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Ext Channel = %s\n", (Value==0) ? "BELOW" : "ABOVE" ));
- }
-
- // MSC
- if (RTMPGetKeyParameter("HT_MCS", pValueStr, 50, pInput))
- {
- {
- Value = simple_strtol(pValueStr, 0, 10);
-
- if ((Value >= 0 && Value <= 23) || (Value == 32)) // 3*3
- {
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = Value;
- pAd->StaCfg.bAutoTxRateSwitch = FALSE;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MCS = %d\n", pAd->StaCfg.DesiredTransmitSetting.field.MCS));
- }
- else
- {
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- pAd->StaCfg.bAutoTxRateSwitch = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("HT: MCS = AUTO\n"));
- }
- }
- }
-
- // STBC
- if (RTMPGetKeyParameter("HT_STBC", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == STBC_USE)
- {
- pAd->CommonCfg.RegTransmitSetting.field.STBC = STBC_USE;
- }
- else
- {
- pAd->CommonCfg.RegTransmitSetting.field.STBC = STBC_NONE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: STBC = %d\n", pAd->CommonCfg.RegTransmitSetting.field.STBC));
- }
-
- // 40_Mhz_Intolerant
- if (RTMPGetKeyParameter("HT_40MHZ_INTOLERANT", pValueStr, 25, pInput))
- {
- Value = simple_strtol(pValueStr, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.bForty_Mhz_Intolerant = FALSE;
- }
- else
- {
- pAd->CommonCfg.bForty_Mhz_Intolerant = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: 40MHZ INTOLERANT = %d\n", pAd->CommonCfg.bForty_Mhz_Intolerant));
- }
- //HT_TxStream
- if(RTMPGetKeyParameter("HT_TxStream", pValueStr, 10, pInput))
- {
- switch (simple_strtol(pValueStr, 0, 10))
- {
- case 1:
- pAd->CommonCfg.TxStream = 1;
- break;
- case 2:
- pAd->CommonCfg.TxStream = 2;
- break;
- case 3: // 3*3
- default:
- pAd->CommonCfg.TxStream = 3;
-
- if (pAd->MACVersion < RALINK_2883_VERSION)
- pAd->CommonCfg.TxStream = 2; // only 2 tx streams for RT2860 series
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Tx Stream = %d\n", pAd->CommonCfg.TxStream));
- }
- //HT_RxStream
- if(RTMPGetKeyParameter("HT_RxStream", pValueStr, 10, pInput))
- {
- switch (simple_strtol(pValueStr, 0, 10))
- {
- case 1:
- pAd->CommonCfg.RxStream = 1;
- break;
- case 2:
- pAd->CommonCfg.RxStream = 2;
- break;
- case 3:
- default:
- pAd->CommonCfg.RxStream = 3;
-
- if (pAd->MACVersion < RALINK_2883_VERSION)
- pAd->CommonCfg.RxStream = 2; // only 2 rx streams for RT2860 series
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("HT: Rx Stream = %d\n", pAd->CommonCfg.RxStream));
- }
+ return (retval);
}
+
diff --git a/drivers/staging/rt2860/rt_usb.c b/drivers/staging/rt2860/rt_usb.c
new file mode 100644
index 000000000000..1e6d347a9663
--- /dev/null
+++ b/drivers/staging/rt2860/rt_usb.c
@@ -0,0 +1,828 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+
+ Module Name:
+ rtusb_bulk.c
+
+ Abstract:
+
+ Revision History:
+ Who When What
+ -------- ---------- ----------------------------------------------
+ Name Date Modification logs
+
+*/
+
+#include "rt_config.h"
+
+ void dump_urb(struct urb* purb)
+{
+ printk("urb :0x%08lx\n", (unsigned long)purb);
+ printk("\tdev :0x%08lx\n", (unsigned long)purb->dev);
+ printk("\t\tdev->state :0x%d\n", purb->dev->state);
+ printk("\tpipe :0x%08x\n", purb->pipe);
+ printk("\tstatus :%d\n", purb->status);
+ printk("\ttransfer_flags :0x%08x\n", purb->transfer_flags);
+ printk("\ttransfer_buffer :0x%08lx\n", (unsigned long)purb->transfer_buffer);
+ printk("\ttransfer_buffer_length:%d\n", purb->transfer_buffer_length);
+ printk("\tactual_length :%d\n", purb->actual_length);
+ printk("\tsetup_packet :0x%08lx\n", (unsigned long)purb->setup_packet);
+ printk("\tstart_frame :%d\n", purb->start_frame);
+ printk("\tnumber_of_packets :%d\n", purb->number_of_packets);
+ printk("\tinterval :%d\n", purb->interval);
+ printk("\terror_count :%d\n", purb->error_count);
+ printk("\tcontext :0x%08lx\n", (unsigned long)purb->context);
+ printk("\tcomplete :0x%08lx\n\n", (unsigned long)purb->complete);
+}
+
+/*
+========================================================================
+Routine Description:
+ Create kernel threads & tasklets.
+
+Arguments:
+ *net_dev Pointer to wireless net device interface
+
+Return Value:
+ NDIS_STATUS_SUCCESS
+ NDIS_STATUS_FAILURE
+
+Note:
+========================================================================
+*/
+NDIS_STATUS RtmpMgmtTaskInit(
+ IN RTMP_ADAPTER *pAd)
+{
+ RTMP_OS_TASK *pTask;
+ NDIS_STATUS status;
+
+ /*
+ Creat TimerQ Thread, We need init timerQ related structure before create the timer thread.
+ */
+ RtmpTimerQInit(pAd);
+
+ pTask = &pAd->timerTask;
+ RtmpOSTaskInit(pTask, "RtmpTimerTask", pAd);
+ status = RtmpOSTaskAttach(pTask, RtmpTimerQThread, pTask);
+ if (status == NDIS_STATUS_FAILURE)
+ {
+ printk (KERN_WARNING "%s: unable to start RtmpTimerQThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev));
+ return NDIS_STATUS_FAILURE;
+ }
+
+ /* Creat MLME Thread */
+ pTask = &pAd->mlmeTask;
+ RtmpOSTaskInit(pTask, "RtmpMlmeTask", pAd);
+ status = RtmpOSTaskAttach(pTask, MlmeThread, pTask);
+ if (status == NDIS_STATUS_FAILURE)
+ {
+ printk (KERN_WARNING "%s: unable to start MlmeThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev));
+ return NDIS_STATUS_FAILURE;
+ }
+
+ /* Creat Command Thread */
+ pTask = &pAd->cmdQTask;
+ RtmpOSTaskInit(pTask, "RtmpCmdQTask", pAd);
+ status = RtmpOSTaskAttach(pTask, RTUSBCmdThread, pTask);
+ if (status == NDIS_STATUS_FAILURE)
+ {
+ printk (KERN_WARNING "%s: unable to start RTUSBCmdThread\n", RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev));
+ return NDIS_STATUS_FAILURE;
+ }
+
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+
+/*
+========================================================================
+Routine Description:
+ Close kernel threads.
+
+Arguments:
+ *pAd the raxx interface data pointer
+
+Return Value:
+ NONE
+
+Note:
+========================================================================
+*/
+VOID RtmpMgmtTaskExit(
+ IN RTMP_ADAPTER *pAd)
+{
+ INT ret;
+ RTMP_OS_TASK *pTask;
+
+ // Sleep 50 milliseconds so pending io might finish normally
+ RTMPusecDelay(50000);
+
+ // We want to wait until all pending receives and sends to the
+ // device object. We cancel any
+ // irps. Wait until sends and receives have stopped.
+ RTUSBCancelPendingIRPs(pAd);
+
+ // We need clear timerQ related structure before exits of the timer thread.
+ RtmpTimerQExit(pAd);
+
+ /* Terminate Mlme Thread */
+ pTask = &pAd->mlmeTask;
+ ret = RtmpOSTaskKill(pTask);
+ if (ret == NDIS_STATUS_FAILURE)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: kill task(%s) failed!\n",
+ RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev), pTask->taskName));
+ }
+
+ /* Terminate cmdQ thread */
+ pTask = &pAd->cmdQTask;
+#ifdef KTHREAD_SUPPORT
+ if (pTask->kthread_task)
+#else
+ CHECK_PID_LEGALITY(pTask->taskPID)
+#endif
+ {
+ mb();
+ NdisAcquireSpinLock(&pAd->CmdQLock);
+ pAd->CmdQ.CmdQState = RTMP_TASK_STAT_STOPED;
+ NdisReleaseSpinLock(&pAd->CmdQLock);
+ mb();
+ //RTUSBCMDUp(pAd);
+ ret = RtmpOSTaskKill(pTask);
+ if (ret == NDIS_STATUS_FAILURE)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: kill task(%s) failed!\n",
+ RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev), pTask->taskName));
+ }
+ pAd->CmdQ.CmdQState = RTMP_TASK_STAT_UNKNOWN;
+ }
+
+ /* Terminate timer thread */
+ pTask = &pAd->timerTask;
+ ret = RtmpOSTaskKill(pTask);
+ if (ret == NDIS_STATUS_FAILURE)
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("%s: kill task(%s) failed!\n",
+ RTMP_OS_NETDEV_GET_DEVNAME(pAd->net_dev), pTask->taskName));
+ }
+
+
+}
+
+
+static void rtusb_dataout_complete(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ purbb_t pUrb;
+ POS_COOKIE pObj;
+ PHT_TX_CONTEXT pHTTXContext;
+ UCHAR BulkOutPipeId;
+ NTSTATUS Status;
+ unsigned long IrqFlags;
+
+
+ pUrb = (purbb_t)data;
+ pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
+ pAd = pHTTXContext->pAd;
+ pObj = (POS_COOKIE) pAd->OS_Cookie;
+ Status = pUrb->status;
+
+ // Store BulkOut PipeId
+ BulkOutPipeId = pHTTXContext->BulkOutPipeId;
+ pAd->BulkOutDataOneSecCount++;
+
+ //DBGPRINT(RT_DEBUG_LOUD, ("Done-B(%d):I=0x%lx, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", BulkOutPipeId, in_interrupt(), pHTTXContext->CurWritePosition,
+ // pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
+
+ RTMP_IRQ_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
+ pAd->BulkOutPending[BulkOutPipeId] = FALSE;
+ pHTTXContext->IRPPending = FALSE;
+ pAd->watchDogTxPendingCnt[BulkOutPipeId] = 0;
+
+ if (Status == USB_ST_NOERROR)
+ {
+ pAd->BulkOutComplete++;
+
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
+
+ pAd->Counters8023.GoodTransmits++;
+ //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
+ FREE_HTTX_RING(pAd, BulkOutPipeId, pHTTXContext);
+ //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
+
+
+ }
+ else // STATUS_OTHER
+ {
+ PUCHAR pBuf;
+
+ pAd->BulkOutCompleteOther++;
+
+ pBuf = &pHTTXContext->TransferBuffer->field.WirelessPacket[pHTTXContext->NextBulkOutPosition];
+
+ if (!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST |
+ fRTMP_ADAPTER_BULKOUT_RESET)))
+ {
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
+ pAd->bulkResetPipeid = BulkOutPipeId;
+ pAd->bulkResetReq[BulkOutPipeId] = pAd->BulkOutReq;
+ }
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
+
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("BulkOutDataPacket failed: ReasonCode=%d!\n", Status));
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("\t>>BulkOut Req=0x%lx, Complete=0x%lx, Other=0x%lx\n", pAd->BulkOutReq, pAd->BulkOutComplete, pAd->BulkOutCompleteOther));
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("\t>>BulkOut Header:%x %x %x %x %x %x %x %x\n", pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5], pBuf[6], pBuf[7]));
+ //DBGPRINT_RAW(RT_DEBUG_ERROR, (">>BulkOutCompleteCancel=0x%x, BulkOutCompleteOther=0x%x\n", pAd->BulkOutCompleteCancel, pAd->BulkOutCompleteOther));
+
+ }
+
+ //
+ // bInUse = TRUE, means some process are filling TX data, after that must turn on bWaitingBulkOut
+ // bWaitingBulkOut = TRUE, means the TX data are waiting for bulk out.
+ //
+ //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
+ if ((pHTTXContext->ENextBulkOutPosition != pHTTXContext->CurWritePosition) &&
+ (pHTTXContext->ENextBulkOutPosition != (pHTTXContext->CurWritePosition+8)) &&
+ !RTUSB_TEST_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId)))
+ {
+ // Indicate There is data avaliable
+ RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
+ }
+ //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
+
+ // Always call Bulk routine, even reset bulk.
+ // The protection of rest bulk should be in BulkOut routine
+ RTUSBKickBulkOut(pAd);
+}
+
+
+static void rtusb_null_frame_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PTX_CONTEXT pNullContext;
+ purbb_t pUrb;
+ NTSTATUS Status;
+ unsigned long irqFlag;
+
+
+ pUrb = (purbb_t)data;
+ pNullContext = (PTX_CONTEXT)pUrb->context;
+ pAd = pNullContext->pAd;
+ Status = pUrb->status;
+
+ // Reset Null frame context flags
+ RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
+ pNullContext->IRPPending = FALSE;
+ pNullContext->InUse = FALSE;
+ pAd->BulkOutPending[0] = FALSE;
+ pAd->watchDogTxPendingCnt[0] = 0;
+
+ if (Status == USB_ST_NOERROR)
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+
+ RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
+ }
+ else // STATUS_OTHER
+ {
+ if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
+ {
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out Null Frame Failed, ReasonCode=%d!\n", Status));
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
+ pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+ }
+ }
+
+ // Always call Bulk routine, even reset bulk.
+ // The protectioon of rest bulk should be in BulkOut routine
+ RTUSBKickBulkOut(pAd);
+}
+
+
+static void rtusb_rts_frame_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PTX_CONTEXT pRTSContext;
+ purbb_t pUrb;
+ NTSTATUS Status;
+ unsigned long irqFlag;
+
+
+ pUrb = (purbb_t)data;
+ pRTSContext = (PTX_CONTEXT)pUrb->context;
+ pAd = pRTSContext->pAd;
+ Status = pUrb->status;
+
+ // Reset RTS frame context flags
+ RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
+ pRTSContext->IRPPending = FALSE;
+ pRTSContext->InUse = FALSE;
+
+ if (Status == USB_ST_NOERROR)
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+ RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
+ }
+ else // STATUS_OTHER
+ {
+ if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
+ {
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out RTS Frame Failed\n"));
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
+ pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
+ }
+ }
+
+ RTMP_SEM_LOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
+ pAd->BulkOutPending[pRTSContext->BulkOutPipeId] = FALSE;
+ RTMP_SEM_UNLOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
+
+ // Always call Bulk routine, even reset bulk.
+ // The protectioon of rest bulk should be in BulkOut routine
+ RTUSBKickBulkOut(pAd);
+
+
+}
+
+
+static void rtusb_pspoll_frame_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PTX_CONTEXT pPsPollContext;
+ purbb_t pUrb;
+ NTSTATUS Status;
+
+
+
+ pUrb = (purbb_t)data;
+ pPsPollContext = (PTX_CONTEXT)pUrb->context;
+ pAd = pPsPollContext->pAd;
+ Status = pUrb->status;
+
+ // Reset PsPoll context flags
+ pPsPollContext->IRPPending = FALSE;
+ pPsPollContext->InUse = FALSE;
+ pAd->watchDogTxPendingCnt[0] = 0;
+
+ if (Status == USB_ST_NOERROR)
+ {
+ RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
+ }
+ else // STATUS_OTHER
+ {
+ if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
+ {
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out PSPoll Failed\n"));
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
+ pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ }
+
+ RTMP_SEM_LOCK(&pAd->BulkOutLock[0]);
+ pAd->BulkOutPending[0] = FALSE;
+ RTMP_SEM_UNLOCK(&pAd->BulkOutLock[0]);
+
+ // Always call Bulk routine, even reset bulk.
+ // The protectioon of rest bulk should be in BulkOut routine
+ RTUSBKickBulkOut(pAd);
+
+}
+
+
+/*
+========================================================================
+Routine Description:
+ Handle received packets.
+
+Arguments:
+ data - URB information pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+static void rx_done_tasklet(unsigned long data)
+{
+ purbb_t pUrb;
+ PRX_CONTEXT pRxContext;
+ PRTMP_ADAPTER pAd;
+ NTSTATUS Status;
+ unsigned int IrqFlags;
+
+ pUrb = (purbb_t)data;
+ pRxContext = (PRX_CONTEXT)pUrb->context;
+ pAd = pRxContext->pAd;
+ Status = pUrb->status;
+
+
+ RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
+ pRxContext->InUse = FALSE;
+ pRxContext->IRPPending = FALSE;
+ pRxContext->BulkInOffset += pUrb->actual_length;
+ //NdisInterlockedDecrement(&pAd->PendingRx);
+ pAd->PendingRx--;
+
+ if (Status == USB_ST_NOERROR)
+ {
+ pAd->BulkInComplete++;
+ pAd->NextRxBulkInPosition = 0;
+ if (pRxContext->BulkInOffset) // As jan's comment, it may bulk-in success but size is zero.
+ {
+ pRxContext->Readable = TRUE;
+ INC_RING_INDEX(pAd->NextRxBulkInIndex, RX_RING_SIZE);
+ }
+ RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
+ }
+ else // STATUS_OTHER
+ {
+ pAd->BulkInCompleteFail++;
+ // Still read this packet although it may comtain wrong bytes.
+ pRxContext->Readable = FALSE;
+ RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
+
+ // Parsing all packets. because after reset, the index will reset to all zero.
+ if ((!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_BULKIN_RESET |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk In Failed. Status=%d, BIIdx=0x%x, BIRIdx=0x%x, actual_length= 0x%x\n",
+ Status, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex, pRxContext->pUrb->actual_length));
+
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET);
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_IN, NULL, 0);
+ }
+ }
+
+ ASSERT((pRxContext->InUse == pRxContext->IRPPending));
+
+ RTUSBBulkReceive(pAd);
+
+
+ return;
+
+}
+
+
+static void rtusb_mgmt_dma_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PTX_CONTEXT pMLMEContext;
+ int index;
+ PNDIS_PACKET pPacket;
+ purbb_t pUrb;
+ NTSTATUS Status;
+ unsigned long IrqFlags;
+
+
+ pUrb = (purbb_t)data;
+ pMLMEContext = (PTX_CONTEXT)pUrb->context;
+ pAd = pMLMEContext->pAd;
+ Status = pUrb->status;
+ index = pMLMEContext->SelfIdx;
+
+ ASSERT((pAd->MgmtRing.TxDmaIdx == index));
+
+ RTMP_IRQ_LOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
+
+
+ if (Status != USB_ST_NOERROR)
+ {
+ //Bulk-Out fail status handle
+ if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
+ (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
+ {
+ DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out MLME Failed, Status=%d!\n", Status));
+ // TODO: How to handle about the MLMEBulkOut failed issue. Need to resend the mgmt pkt?
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
+ pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
+ }
+ }
+
+ pAd->BulkOutPending[MGMTPIPEIDX] = FALSE;
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
+
+ RTMP_IRQ_LOCK(&pAd->MLMEBulkOutLock, IrqFlags);
+ // Reset MLME context flags
+ pMLMEContext->IRPPending = FALSE;
+ pMLMEContext->InUse = FALSE;
+ pMLMEContext->bWaitingBulkOut = FALSE;
+ pMLMEContext->BulkOutSize = 0;
+
+ pPacket = pAd->MgmtRing.Cell[index].pNdisPacket;
+ pAd->MgmtRing.Cell[index].pNdisPacket = NULL;
+
+ // Increase MgmtRing Index
+ INC_RING_INDEX(pAd->MgmtRing.TxDmaIdx, MGMT_RING_SIZE);
+ pAd->MgmtRing.TxSwFreeIdx++;
+ RTMP_IRQ_UNLOCK(&pAd->MLMEBulkOutLock, IrqFlags);
+
+ // No-matter success or fail, we free the mgmt packet.
+ if (pPacket)
+ RTMPFreeNdisPacket(pAd, pPacket);
+
+ if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ // do nothing and return directly.
+ }
+ else
+ {
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET) &&
+ ((pAd->bulkResetPipeid & BULKOUT_MGMT_RESET_FLAG) == BULKOUT_MGMT_RESET_FLAG))
+ { // For Mgmt Bulk-Out failed, ignore it now.
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ {
+
+ // Always call Bulk routine, even reset bulk.
+ // The protectioon of rest bulk should be in BulkOut routine
+ if (pAd->MgmtRing.TxSwFreeIdx < MGMT_RING_SIZE /* pMLMEContext->bWaitingBulkOut == TRUE */)
+ {
+ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME);
+ }
+ RTUSBKickBulkOut(pAd);
+ }
+ }
+
+
+}
+
+static void rtusb_ac3_dma_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PHT_TX_CONTEXT pHTTXContext;
+ UCHAR BulkOutPipeId = 3;
+ purbb_t pUrb;
+
+
+ pUrb = (purbb_t)data;
+ pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
+ pAd = pHTTXContext->pAd;
+
+ rtusb_dataout_complete((unsigned long)pUrb);
+
+ if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ // do nothing and return directly.
+ }
+ else
+ {
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
+ {
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
+ if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
+ /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
+ (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
+ (pHTTXContext->bCurWriting == FALSE))
+ {
+ RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
+ }
+
+ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<3);
+ RTUSBKickBulkOut(pAd);
+ }
+ }
+
+
+ return;
+}
+
+
+static void rtusb_ac2_dma_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PHT_TX_CONTEXT pHTTXContext;
+ UCHAR BulkOutPipeId = 2;
+ purbb_t pUrb;
+
+
+ pUrb = (purbb_t)data;
+ pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
+ pAd = pHTTXContext->pAd;
+
+ rtusb_dataout_complete((unsigned long)pUrb);
+
+ if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ // do nothing and return directly.
+ }
+ else
+ {
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
+ {
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
+ if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
+ /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
+ (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
+ (pHTTXContext->bCurWriting == FALSE))
+ {
+ RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
+ }
+
+ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<2);
+ RTUSBKickBulkOut(pAd);
+ }
+ }
+
+
+ return;
+}
+
+
+static void rtusb_ac1_dma_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PHT_TX_CONTEXT pHTTXContext;
+ UCHAR BulkOutPipeId = 1;
+ purbb_t pUrb;
+
+
+ pUrb = (purbb_t)data;
+ pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
+ pAd = pHTTXContext->pAd;
+
+ rtusb_dataout_complete((unsigned long)pUrb);
+
+ if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ // do nothing and return directly.
+ }
+ else
+ {
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
+ {
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
+ if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
+ /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
+ (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
+ (pHTTXContext->bCurWriting == FALSE))
+ {
+ RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
+ }
+
+ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<1);
+ RTUSBKickBulkOut(pAd);
+ }
+ }
+ return;
+
+}
+
+
+static void rtusb_ac0_dma_done_tasklet(unsigned long data)
+{
+ PRTMP_ADAPTER pAd;
+ PHT_TX_CONTEXT pHTTXContext;
+ UCHAR BulkOutPipeId = 0;
+ purbb_t pUrb;
+
+
+ pUrb = (purbb_t)data;
+ pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
+ pAd = pHTTXContext->pAd;
+
+ rtusb_dataout_complete((unsigned long)pUrb);
+
+ if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ // do nothing and return directly.
+ }
+ else
+ {
+ if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
+ {
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
+ }
+ else
+ { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
+ if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
+ /* ((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
+ (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
+ (pHTTXContext->bCurWriting == FALSE))
+ {
+ RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
+ }
+
+ RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL);
+ RTUSBKickBulkOut(pAd);
+ }
+ }
+
+
+ return;
+
+}
+
+
+NDIS_STATUS RtmpNetTaskInit(
+ IN RTMP_ADAPTER *pAd)
+{
+ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+
+ // Create receive tasklet
+ tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (ULONG)pAd);
+ tasklet_init(&pObj->mgmt_dma_done_task, rtusb_mgmt_dma_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->ac0_dma_done_task, rtusb_ac0_dma_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->ac1_dma_done_task, rtusb_ac1_dma_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->ac2_dma_done_task, rtusb_ac2_dma_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->ac3_dma_done_task, rtusb_ac3_dma_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->tbtt_task, tbtt_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->null_frame_complete_task, rtusb_null_frame_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->rts_frame_complete_task, rtusb_rts_frame_done_tasklet, (unsigned long)pAd);
+ tasklet_init(&pObj->pspoll_frame_complete_task, rtusb_pspoll_frame_done_tasklet, (unsigned long)pAd);
+
+ return NDIS_STATUS_SUCCESS;
+}
+
+
+void RtmpNetTaskExit(IN RTMP_ADAPTER *pAd)
+{
+ POS_COOKIE pObj;
+
+ pObj = (POS_COOKIE) pAd->OS_Cookie;
+
+ tasklet_kill(&pObj->rx_done_task);
+ tasklet_kill(&pObj->mgmt_dma_done_task);
+ tasklet_kill(&pObj->ac0_dma_done_task);
+ tasklet_kill(&pObj->ac1_dma_done_task);
+ tasklet_kill(&pObj->ac2_dma_done_task);
+ tasklet_kill(&pObj->ac3_dma_done_task);
+ tasklet_kill(&pObj->tbtt_task);
+ tasklet_kill(&pObj->null_frame_complete_task);
+ tasklet_kill(&pObj->rts_frame_complete_task);
+ tasklet_kill(&pObj->pspoll_frame_complete_task);
+}
diff --git a/drivers/staging/rt2860/rtmp.h b/drivers/staging/rt2860/rtmp.h
index 90fd40f24734..12b14654e67e 100644
--- a/drivers/staging/rt2860/rtmp.h
+++ b/drivers/staging/rt2860/rtmp.h
@@ -42,140 +42,45 @@
#include "spectrum_def.h"
-#include "aironet.h"
+#include "rtmp_dot11.h"
-#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++)
-#define VIRTUAL_IF_DEC(__pAd) ((__pAd)->VirtualIfCnt--)
-#define VIRTUAL_IF_NUM(__pAd) ((__pAd)->VirtualIfCnt)
+#undef AP_WSC_INCLUDED
+#undef STA_WSC_INCLUDED
+#undef WSC_INCLUDED
-#ifdef RT2870
-////////////////////////////////////////////////////////////////////////////
-// The TX_BUFFER structure forms the transmitted USB packet to the device
-////////////////////////////////////////////////////////////////////////////
-typedef struct __TX_BUFFER{
- union {
- UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
- HEADER_802_11 NullFrame;
- PSPOLL_FRAME PsPollPacket;
- RTS_FRAME RTSFrame;
- }field;
- UCHAR Aggregation[4]; //Buffer for save Aggregation size.
-} TX_BUFFER, *PTX_BUFFER;
-
-typedef struct __HTTX_BUFFER{
- union {
- UCHAR WirelessPacket[MAX_TXBULK_SIZE];
- HEADER_802_11 NullFrame;
- PSPOLL_FRAME PsPollPacket;
- RTS_FRAME RTSFrame;
- }field;
- UCHAR Aggregation[4]; //Buffer for save Aggregation size.
-} HTTX_BUFFER, *PHTTX_BUFFER;
-
-
-// used to track driver-generated write irps
-typedef struct _TX_CONTEXT
-{
- PVOID pAd; //Initialized in MiniportInitialize
- PURB pUrb; //Initialized in MiniportInitialize
- PIRP pIrp; //used to cancel pending bulk out.
- //Initialized in MiniportInitialize
- PTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
- ULONG BulkOutSize;
- UCHAR BulkOutPipeId;
- UCHAR SelfIdx;
- BOOLEAN InUse;
- BOOLEAN bWaitingBulkOut; // at least one packet is in this TxContext, ready for making IRP anytime.
- BOOLEAN bFullForBulkOut; // all tx buffer are full , so waiting for tx bulkout.
- BOOLEAN IRPPending;
- BOOLEAN LastOne;
- BOOLEAN bAggregatible;
- UCHAR Header_802_3[LENGTH_802_3];
- UCHAR Rsv[2];
- ULONG DataOffset;
- UINT TxRate;
- dma_addr_t data_dma; // urb dma on linux
-
-} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
-
-
-// used to track driver-generated write irps
-typedef struct _HT_TX_CONTEXT
-{
- PVOID pAd; //Initialized in MiniportInitialize
- PURB pUrb; //Initialized in MiniportInitialize
- PIRP pIrp; //used to cancel pending bulk out.
- //Initialized in MiniportInitialize
- PHTTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
- ULONG BulkOutSize; // Indicate the total bulk-out size in bytes in one bulk-transmission
- UCHAR BulkOutPipeId;
- BOOLEAN IRPPending;
- BOOLEAN LastOne;
- BOOLEAN bCurWriting;
- BOOLEAN bRingEmpty;
- BOOLEAN bCopySavePad;
- UCHAR SavedPad[8];
- UCHAR Header_802_3[LENGTH_802_3];
- ULONG CurWritePosition; // Indicate the buffer offset which packet will be inserted start from.
- ULONG CurWriteRealPos; // Indicate the buffer offset which packet now are writing to.
- ULONG NextBulkOutPosition; // Indicate the buffer start offset of a bulk-transmission
- ULONG ENextBulkOutPosition; // Indicate the buffer end offset of a bulk-transmission
- UINT TxRate;
- dma_addr_t data_dma; // urb dma on linux
-} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
-//
-// Structure to keep track of receive packets and buffers to indicate
-// receive data to the protocol.
-//
-typedef struct _RX_CONTEXT
-{
- PUCHAR TransferBuffer;
- PVOID pAd;
- PIRP pIrp;//used to cancel pending bulk in.
- PURB pUrb;
- //These 2 Boolean shouldn't both be 1 at the same time.
- ULONG BulkInOffset; // number of packets waiting for reordering .
- BOOLEAN bRxHandling; // Notify this packet is being process now.
- BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet.
- BOOLEAN Readable; // Receive Complete back. OK for driver to indicate receiving packet.
- BOOLEAN IRPPending; // TODO: To be removed
- atomic_t IrpLock;
- NDIS_SPIN_LOCK RxContextLock;
- dma_addr_t data_dma; // urb dma on linux
-} RX_CONTEXT, *PRX_CONTEXT;
-#endif // RT2870 //
+#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
+#define WSC_INCLUDED
+#endif
+#include "rtmp_chip.h"
-//
-// NDIS Version definitions
-//
-#ifdef NDIS50_MINIPORT
-#define RTMP_NDIS_MAJOR_VERSION 5
-#define RTMP_NDIS_MINOR_VERSION 0
-#endif
-#ifdef NDIS51_MINIPORT
-#define RTMP_NDIS_MAJOR_VERSION 5
-#define RTMP_NDIS_MINOR_VERSION 1
-#endif
-extern char NIC_VENDOR_DESC[];
-extern int NIC_VENDOR_DESC_LEN;
+typedef struct _RTMP_ADAPTER RTMP_ADAPTER;
+typedef struct _RTMP_ADAPTER *PRTMP_ADAPTER;
+
+typedef struct _RTMP_CHIP_OP_ RTMP_CHIP_OP;
+
+
+//#define DBG 1
+
+//#define DBG_DIAGNOSE 1
+
+
+//+++Add by shiang for merge MiniportMMRequest() and MiniportDataMMRequest() into one function
+#define MAX_DATAMM_RETRY 3
+#define MGMT_USE_QUEUE_FLAG 0x80
+//---Add by shiang for merge MiniportMMRequest() and MiniportDataMMRequest() into one function
+
+#define MAXSEQ (0xFFF)
extern unsigned char SNAP_AIRONET[];
-extern unsigned char CipherSuiteCiscoCCKM[];
-extern unsigned char CipherSuiteCiscoCCKMLen;
-extern unsigned char CipherSuiteCiscoCCKM24[];
-extern unsigned char CipherSuiteCiscoCCKM24Len;
-extern unsigned char CipherSuiteCCXTkip[];
-extern unsigned char CipherSuiteCCXTkipLen;
extern unsigned char CISCO_OUI[];
extern UCHAR BaSizeArray[4];
extern UCHAR BROADCAST_ADDR[MAC_ADDR_LEN];
-extern UCHAR MULTICAST_ADDR[MAC_ADDR_LEN];
extern UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN];
extern ULONG BIT32[32];
extern UCHAR BIT8[8];
@@ -231,9 +136,11 @@ extern UCHAR WpaIe;
extern UCHAR Wpa2Ie;
extern UCHAR IbssIe;
extern UCHAR Ccx2Ie;
+extern UCHAR WapiIe;
extern UCHAR WPA_OUI[];
extern UCHAR RSN_OUI[];
+extern UCHAR WAPI_OUI[];
extern UCHAR WME_INFO_ELEM[];
extern UCHAR WME_PARM_ELEM[];
extern UCHAR Ccx2QosInfo[];
@@ -256,28 +163,8 @@ extern UCHAR RateSwitchTable11N2SForABand[];
extern UCHAR PRE_N_HT_OUI[];
-#define MAXSEQ (0xFFF)
-
-struct reordering_mpdu
-{
- struct reordering_mpdu *next;
- PNDIS_PACKET pPacket; /* coverted to 802.3 frame */
- int Sequence; /* sequence number of MPDU */
- BOOLEAN bAMSDU;
-};
-struct reordering_list
-{
- struct reordering_mpdu *next;
- int qlen;
-};
-struct reordering_mpdu_pool
-{
- PVOID mem;
- NDIS_SPIN_LOCK lock;
- struct reordering_list freelist;
-};
typedef struct _RSSI_SAMPLE {
CHAR LastRssi0; // last received RSSI
@@ -318,6 +205,7 @@ typedef struct _QUEUE_HEADER {
if ((QueueHeader)->Head != NULL) \
{ \
pNext = (QueueHeader)->Head->Next; \
+ (QueueHeader)->Head->Next = NULL; \
(QueueHeader)->Head = pNext; \
if (pNext == NULL) \
(QueueHeader)->Tail = NULL; \
@@ -345,6 +233,19 @@ typedef struct _QUEUE_HEADER {
(QueueHeader)->Number++; \
}
+#define InsertTailQueueAc(pAd, pEntry, QueueHeader, QueueEntry) \
+{ \
+ ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
+ if ((QueueHeader)->Tail) \
+ (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
+ else \
+ (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
+ (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
+ (QueueHeader)->Number++; \
+}
+
+
+
//
// Macros for flag and ref count operations
//
@@ -353,15 +254,12 @@ typedef struct _QUEUE_HEADER {
#define RTMP_CLEAR_FLAGS(_M) ((_M)->Flags = 0)
#define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)
#define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
-
-#ifdef RT2860
// Macro for power save flag.
#define RTMP_SET_PSFLAG(_M, _F) ((_M)->PSFlags |= (_F))
#define RTMP_CLEAR_PSFLAG(_M, _F) ((_M)->PSFlags &= ~(_F))
#define RTMP_CLEAR_PSFLAGS(_M) ((_M)->PSFlags = 0)
#define RTMP_TEST_PSFLAG(_M, _F) (((_M)->PSFlags & (_F)) != 0)
#define RTMP_TEST_PSFLAGS(_M, _F) (((_M)->PSFlags & (_F)) == (_F))
-#endif
#define OPSTATUS_SET_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags |= (_F))
#define OPSTATUS_CLEAR_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags &= ~(_F))
@@ -391,51 +289,6 @@ typedef struct _QUEUE_HEADER {
(_idx) = (_idx+1) % (_RingSize); \
}
-#ifdef RT2870
-// We will have a cost down version which mac version is 0x3090xxxx
-#define IS_RT3090(_pAd) ((((_pAd)->MACVersion & 0xffff0000) == 0x30710000) || (((_pAd)->MACVersion & 0xffff0000) == 0x30900000))
-#else
-#define IS_RT3090(_pAd) 0
-#endif
-#define IS_RT3070(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30700000)
-#ifdef RT2870
-#define IS_RT3071(_pAd) (((_pAd)->MACVersion & 0xffff0000) == 0x30710000)
-#define IS_RT30xx(_pAd) (((_pAd)->MACVersion & 0xfff00000) == 0x30700000)
-#endif
-
-#define RING_PACKET_INIT(_TxRing, _idx) \
-{ \
- _TxRing->Cell[_idx].pNdisPacket = NULL; \
- _TxRing->Cell[_idx].pNextNdisPacket = NULL; \
-}
-
-#define TXDT_INIT(_TxD) \
-{ \
- NdisZeroMemory(_TxD, TXD_SIZE); \
- _TxD->DMADONE = 1; \
-}
-
-//Set last data segment
-#define RING_SET_LASTDS(_TxD, _IsSD0) \
-{ \
- if (_IsSD0) {_TxD->LastSec0 = 1;} \
- else {_TxD->LastSec1 = 1;} \
-}
-
-// Increase TxTsc value for next transmission
-// TODO:
-// When i==6, means TSC has done one full cycle, do re-keying stuff follow specs
-// Should send a special event microsoft defined to request re-key
-#define INC_TX_TSC(_tsc) \
-{ \
- int i=0; \
- while (++_tsc[i] == 0x0) \
- { \
- i++; \
- if (i == 6) \
- break; \
- } \
-}
// StaActive.SupportedHtPhy.MCSSet is copied from AP beacon. Don't need to update here.
#define COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(_pAd) \
@@ -475,301 +328,12 @@ typedef struct _QUEUE_HEADER {
// ULONG Value)
//
-//
-// BBP & RF are using indirect access. Before write any value into it.
-// We have to make sure there is no outstanding command pending via checking busy bit.
-//
-#define MAX_BUSY_COUNT 100 // Number of retry before failing access BBP & RF indirect register
-//
-#ifdef RT2860
-#define RTMP_RF_IO_WRITE32(_A, _V) \
-{ \
- PHY_CSR4_STRUC Value; \
- ULONG BusyCnt = 0; \
- if ((_A)->bPCIclkOff) \
- { \
- return; \
- } \
- do { \
- RTMP_IO_READ32(_A, RF_CSR_CFG0, &Value.word); \
- if (Value.field.Busy == IDLE) \
- break; \
- BusyCnt++; \
- } while (BusyCnt < MAX_BUSY_COUNT); \
- if (BusyCnt < MAX_BUSY_COUNT) \
- { \
- RTMP_IO_WRITE32(_A, RF_CSR_CFG0, _V); \
- } \
-}
-
-#define BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int i, k; \
- for (i=0; i<MAX_BUSY_COUNT; i++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- continue; \
- } \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 1; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
- for (k=0; k<MAX_BUSY_COUNT; k++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == IDLE) \
- break; \
- } \
- if ((BbpCsr.field.Busy == IDLE) && \
- (BbpCsr.field.RegNum == _I)) \
- { \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
- break; \
- } \
- } \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- DBGPRINT_ERR(("DFS BBP read R%d fail\n", _I)); \
- *(_pV) = (_A)->BbpWriteLatch[_I]; \
- } \
-}
-
-//#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) {}
-// Read BBP register by register's ID. Generate PER to test BA
-#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int i, k; \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- for (i=0; i<MAX_BUSY_COUNT; i++) \
- { \
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- continue; \
- } \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 1; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
- AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
- RTMPusecDelay(1000); \
- for (k=0; k<MAX_BUSY_COUNT; k++) \
- { \
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
- if (BbpCsr.field.Busy == IDLE) \
- break; \
- } \
- if ((BbpCsr.field.Busy == IDLE) && \
- (BbpCsr.field.RegNum == _I)) \
- { \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
- break; \
- } \
- } \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- DBGPRINT_ERR(("BBP read R%d=0x%x fail\n", _I, BbpCsr.word)); \
- *(_pV) = (_A)->BbpWriteLatch[_I]; \
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
- BbpCsr.field.Busy = 0; \
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
- } \
- } \
-}
-
-#define BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int BusyCnt; \
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- continue; \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 0; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.Value = _V; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
- (_A)->BbpWriteLatch[_I] = _V; \
- break; \
- } \
- if (BusyCnt == MAX_BUSY_COUNT) \
- { \
- DBGPRINT_ERR(("BBP write R%d fail\n", _I)); \
- } \
-}
-
-// Write BBP register by register's ID & value
-#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int BusyCnt; \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
- { \
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- continue; \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 0; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.Value = _V; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
- AsicSendCommandToMcu(_A, 0x80, 0xff, 0x0, 0x0); \
- if (_A->OpMode == OPMODE_AP) \
- RTMPusecDelay(1000); \
- (_A)->BbpWriteLatch[_I] = _V; \
- break; \
- } \
- if (BusyCnt == MAX_BUSY_COUNT) \
- { \
- DBGPRINT_ERR(("BBP write R%d=0x%x fail\n", _I, BbpCsr.word)); \
- RTMP_IO_READ32(_A, H2M_BBP_AGENT, &BbpCsr.word); \
- BbpCsr.field.Busy = 0; \
- RTMP_IO_WRITE32(_A, H2M_BBP_AGENT, BbpCsr.word); \
- } \
- } \
-}
-#endif /* RT2860 */
-#ifdef RT2870
-#define RTMP_RF_IO_WRITE32(_A, _V) RTUSBWriteRFRegister(_A, _V)
-#define RTMP_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTUSBReadBBPRegister(_A, _I, _pV)
-#define RTMP_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTUSBWriteBBPRegister(_A, _I, _V)
-
-#define BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTUSBWriteBBPRegister(_A, _I, _V)
-#define BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) RTUSBReadBBPRegister(_A, _I, _pV)
-#endif // RT2870 //
-
-#define MAP_CHANNEL_ID_TO_KHZ(ch, khz) { \
- switch (ch) \
- { \
- case 1: khz = 2412000; break; \
- case 2: khz = 2417000; break; \
- case 3: khz = 2422000; break; \
- case 4: khz = 2427000; break; \
- case 5: khz = 2432000; break; \
- case 6: khz = 2437000; break; \
- case 7: khz = 2442000; break; \
- case 8: khz = 2447000; break; \
- case 9: khz = 2452000; break; \
- case 10: khz = 2457000; break; \
- case 11: khz = 2462000; break; \
- case 12: khz = 2467000; break; \
- case 13: khz = 2472000; break; \
- case 14: khz = 2484000; break; \
- case 36: /* UNII */ khz = 5180000; break; \
- case 40: /* UNII */ khz = 5200000; break; \
- case 44: /* UNII */ khz = 5220000; break; \
- case 48: /* UNII */ khz = 5240000; break; \
- case 52: /* UNII */ khz = 5260000; break; \
- case 56: /* UNII */ khz = 5280000; break; \
- case 60: /* UNII */ khz = 5300000; break; \
- case 64: /* UNII */ khz = 5320000; break; \
- case 149: /* UNII */ khz = 5745000; break; \
- case 153: /* UNII */ khz = 5765000; break; \
- case 157: /* UNII */ khz = 5785000; break; \
- case 161: /* UNII */ khz = 5805000; break; \
- case 165: /* UNII */ khz = 5825000; break; \
- case 100: /* HiperLAN2 */ khz = 5500000; break; \
- case 104: /* HiperLAN2 */ khz = 5520000; break; \
- case 108: /* HiperLAN2 */ khz = 5540000; break; \
- case 112: /* HiperLAN2 */ khz = 5560000; break; \
- case 116: /* HiperLAN2 */ khz = 5580000; break; \
- case 120: /* HiperLAN2 */ khz = 5600000; break; \
- case 124: /* HiperLAN2 */ khz = 5620000; break; \
- case 128: /* HiperLAN2 */ khz = 5640000; break; \
- case 132: /* HiperLAN2 */ khz = 5660000; break; \
- case 136: /* HiperLAN2 */ khz = 5680000; break; \
- case 140: /* HiperLAN2 */ khz = 5700000; break; \
- case 34: /* Japan MMAC */ khz = 5170000; break; \
- case 38: /* Japan MMAC */ khz = 5190000; break; \
- case 42: /* Japan MMAC */ khz = 5210000; break; \
- case 46: /* Japan MMAC */ khz = 5230000; break; \
- case 184: /* Japan */ khz = 4920000; break; \
- case 188: /* Japan */ khz = 4940000; break; \
- case 192: /* Japan */ khz = 4960000; break; \
- case 196: /* Japan */ khz = 4980000; break; \
- case 208: /* Japan, means J08 */ khz = 5040000; break; \
- case 212: /* Japan, means J12 */ khz = 5060000; break; \
- case 216: /* Japan, means J16 */ khz = 5080000; break; \
- default: khz = 2412000; break; \
- } \
- }
-
-#define MAP_KHZ_TO_CHANNEL_ID(khz, ch) { \
- switch (khz) \
- { \
- case 2412000: ch = 1; break; \
- case 2417000: ch = 2; break; \
- case 2422000: ch = 3; break; \
- case 2427000: ch = 4; break; \
- case 2432000: ch = 5; break; \
- case 2437000: ch = 6; break; \
- case 2442000: ch = 7; break; \
- case 2447000: ch = 8; break; \
- case 2452000: ch = 9; break; \
- case 2457000: ch = 10; break; \
- case 2462000: ch = 11; break; \
- case 2467000: ch = 12; break; \
- case 2472000: ch = 13; break; \
- case 2484000: ch = 14; break; \
- case 5180000: ch = 36; /* UNII */ break; \
- case 5200000: ch = 40; /* UNII */ break; \
- case 5220000: ch = 44; /* UNII */ break; \
- case 5240000: ch = 48; /* UNII */ break; \
- case 5260000: ch = 52; /* UNII */ break; \
- case 5280000: ch = 56; /* UNII */ break; \
- case 5300000: ch = 60; /* UNII */ break; \
- case 5320000: ch = 64; /* UNII */ break; \
- case 5745000: ch = 149; /* UNII */ break; \
- case 5765000: ch = 153; /* UNII */ break; \
- case 5785000: ch = 157; /* UNII */ break; \
- case 5805000: ch = 161; /* UNII */ break; \
- case 5825000: ch = 165; /* UNII */ break; \
- case 5500000: ch = 100; /* HiperLAN2 */ break; \
- case 5520000: ch = 104; /* HiperLAN2 */ break; \
- case 5540000: ch = 108; /* HiperLAN2 */ break; \
- case 5560000: ch = 112; /* HiperLAN2 */ break; \
- case 5580000: ch = 116; /* HiperLAN2 */ break; \
- case 5600000: ch = 120; /* HiperLAN2 */ break; \
- case 5620000: ch = 124; /* HiperLAN2 */ break; \
- case 5640000: ch = 128; /* HiperLAN2 */ break; \
- case 5660000: ch = 132; /* HiperLAN2 */ break; \
- case 5680000: ch = 136; /* HiperLAN2 */ break; \
- case 5700000: ch = 140; /* HiperLAN2 */ break; \
- case 5170000: ch = 34; /* Japan MMAC */ break; \
- case 5190000: ch = 38; /* Japan MMAC */ break; \
- case 5210000: ch = 42; /* Japan MMAC */ break; \
- case 5230000: ch = 46; /* Japan MMAC */ break; \
- case 4920000: ch = 184; /* Japan */ break; \
- case 4940000: ch = 188; /* Japan */ break; \
- case 4960000: ch = 192; /* Japan */ break; \
- case 4980000: ch = 196; /* Japan */ break; \
- case 5040000: ch = 208; /* Japan, means J08 */ break; \
- case 5060000: ch = 212; /* Japan, means J12 */ break; \
- case 5080000: ch = 216; /* Japan, means J16 */ break; \
- default: ch = 1; break; \
- } \
- }
//
// Common fragment list structure - Identical to the scatter gather frag list structure
//
+//#define RTMP_SCATTER_GATHER_ELEMENT SCATTER_GATHER_ELEMENT
+//#define PRTMP_SCATTER_GATHER_ELEMENT PSCATTER_GATHER_ELEMENT
#define NIC_MAX_PHYS_BUF_COUNT 8
typedef struct _RTMP_SCATTER_GATHER_ELEMENT {
@@ -893,18 +457,11 @@ typedef struct _RTMP_SCATTER_GATHER_LIST {
} \
}
-#define SWITCH_AB( _pAA, _pBB) \
-{ \
- PVOID pCC; \
- pCC = _pBB; \
- _pBB = _pAA; \
- _pAA = pCC; \
-}
// Enqueue this frame to MLME engine
// We need to enqueue the whole frame because MLME need to pass data type
// information from 802.11 header
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
#define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \
{ \
UINT32 High32TSF, Low32TSF; \
@@ -912,49 +469,14 @@ typedef struct _RTMP_SCATTER_GATHER_LIST {
RTMP_IO_READ32(_pAd, TSF_TIMER_DW0, &Low32TSF); \
MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \
}
-#endif
-#ifdef RT2870
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
#define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \
{ \
UINT32 High32TSF=0, Low32TSF=0; \
MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \
}
-#endif // RT2870 //
-
-//Need to collect each ant's rssi concurrently
-//rssi1 is report to pair2 Ant and rss2 is reprot to pair1 Ant when 4 Ant
-#define COLLECT_RX_ANTENNA_AVERAGE_RSSI(_pAd, _rssi1, _rssi2) \
-{ \
- SHORT AvgRssi; \
- UCHAR UsedAnt; \
- if (_pAd->RxAnt.EvaluatePeriod == 0) \
- { \
- UsedAnt = _pAd->RxAnt.Pair1PrimaryRxAnt; \
- AvgRssi = _pAd->RxAnt.Pair1AvgRssi[UsedAnt]; \
- if (AvgRssi < 0) \
- AvgRssi = AvgRssi - (AvgRssi >> 3) + _rssi1; \
- else \
- AvgRssi = _rssi1 << 3; \
- _pAd->RxAnt.Pair1AvgRssi[UsedAnt] = AvgRssi; \
- } \
- else \
- { \
- UsedAnt = _pAd->RxAnt.Pair1SecondaryRxAnt; \
- AvgRssi = _pAd->RxAnt.Pair1AvgRssi[UsedAnt]; \
- if ((AvgRssi < 0) && (_pAd->RxAnt.FirstPktArrivedWhenEvaluate)) \
- AvgRssi = AvgRssi - (AvgRssi >> 3) + _rssi1; \
- else \
- { \
- _pAd->RxAnt.FirstPktArrivedWhenEvaluate = TRUE; \
- AvgRssi = _rssi1 << 3; \
- } \
- _pAd->RxAnt.Pair1AvgRssi[UsedAnt] = AvgRssi; \
- _pAd->RxAnt.RcvPktNumWhenEvaluate++; \
- } \
-}
-
-#define NDIS_QUERY_BUFFER(_NdisBuf, _ppVA, _pBufLen) \
- NdisQueryBuffer(_NdisBuf, _ppVA, _pBufLen)
+#endif // RTMP_MAC_USB //
#define MAC_ADDR_EQUAL(pAddr1,pAddr2) RTMPEqualMemory((PVOID)(pAddr1), (PVOID)(pAddr2), MAC_ADDR_LEN)
#define SSID_EQUAL(ssid1, len1, ssid2, len2) ((len1==len2) && (RTMPEqualMemory(ssid1, ssid2, len1)))
@@ -964,59 +486,21 @@ typedef struct _RTMP_SCATTER_GATHER_LIST {
//
#define JapanChannelCheck(channel) ((channel == 52) || (channel == 56) || (channel == 60) || (channel == 64))
-#ifdef RT2860
+#define STA_EXTRA_SETTING(_pAd)
+
#define STA_PORT_SECURED(_pAd) \
{ \
- _pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \
- RTMP_SET_PSFLAG(_pAd, fRTMP_PS_CAN_GO_SLEEP); \
- NdisAcquireSpinLock(&(_pAd)->MacTabLock); \
- _pAd->MacTab.Content[BSSID_WCID].PortSecured = _pAd->StaCfg.PortSecured; \
+ BOOLEAN Cancelled; \
+ (_pAd)->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \
+ NdisAcquireSpinLock(&((_pAd)->MacTabLock)); \
+ (_pAd)->MacTab.Content[BSSID_WCID].PortSecured = (_pAd)->StaCfg.PortSecured; \
+ (_pAd)->MacTab.Content[BSSID_WCID].PrivacyFilter = Ndis802_11PrivFilterAcceptAll;\
NdisReleaseSpinLock(&(_pAd)->MacTabLock); \
+ RTMPCancelTimer(&((_pAd)->Mlme.LinkDownTimer), &Cancelled);\
+ STA_EXTRA_SETTING(_pAd); \
}
-#endif
-#ifdef RT2870
-#define STA_PORT_SECURED(_pAd) \
-{ \
- _pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \
- NdisAcquireSpinLock(&_pAd->MacTabLock); \
- _pAd->MacTab.Content[BSSID_WCID].PortSecured = _pAd->StaCfg.PortSecured; \
- NdisReleaseSpinLock(&_pAd->MacTabLock); \
-}
-#endif
-
-//
-// Register set pair for initialzation register set definition
-//
-typedef struct _RTMP_REG_PAIR
-{
- ULONG Register;
- ULONG Value;
-} RTMP_REG_PAIR, *PRTMP_REG_PAIR;
-typedef struct _REG_PAIR
-{
- UCHAR Register;
- UCHAR Value;
-} REG_PAIR, *PREG_PAIR;
-//
-// Register set pair for initialzation register set definition
-//
-typedef struct _RTMP_RF_REGS
-{
- UCHAR Channel;
- ULONG R1;
- ULONG R2;
- ULONG R3;
- ULONG R4;
-} RTMP_RF_REGS, *PRTMP_RF_REGS;
-
-typedef struct _FREQUENCY_ITEM {
- UCHAR Channel;
- UCHAR N;
- UCHAR R;
- UCHAR K;
-} FREQUENCY_ITEM, *PFREQUENCY_ITEM;
//
// Data buffer for DMA operation, the buffer must be contiguous physical memory
@@ -1030,35 +514,6 @@ typedef struct _RTMP_DMABUF
} RTMP_DMABUF, *PRTMP_DMABUF;
-typedef union _HEADER_802_11_SEQ{
- struct {
- USHORT Frag:4;
- USHORT Sequence:12;
- } field;
- USHORT value;
-} HEADER_802_11_SEQ, *PHEADER_802_11_SEQ;
-
-//
-// Data buffer for DMA operation, the buffer must be contiguous physical memory
-// Both DMA to / from CPU use the same structure.
-//
-typedef struct _RTMP_REORDERBUF
-{
- BOOLEAN IsFull;
- PVOID AllocVa; // TxBuf virtual address
- UCHAR Header802_3[14];
- HEADER_802_11_SEQ Sequence; //support compressed bitmap BA, so no consider fragment in BA
- UCHAR DataOffset;
- USHORT Datasize;
- ULONG AllocSize;
-#ifdef RT2860
- NDIS_PHYSICAL_ADDRESS AllocPa; // TxBuf physical address
-#endif
-#ifdef RT2870
- PUCHAR AllocPa;
-#endif // RT2870 //
-} RTMP_REORDERBUF, *PRTMP_REORDERBUF;
-
//
// Control block (Descriptor) for all ring descriptor DMA operation, buffer must be
// contiguous physical memory. NDIS_PACKET stored the binding Rx packet descriptor
@@ -1078,21 +533,7 @@ typedef struct _RTMP_DMACB
RTMP_DMABUF DmaBuf; // Associated DMA buffer structure
} RTMP_DMACB, *PRTMP_DMACB;
-typedef struct _RTMP_TX_BUF
-{
- PQUEUE_ENTRY Next;
- UCHAR Index;
- ULONG AllocSize; // Control block size
- PVOID AllocVa; // Control block virtual address
- NDIS_PHYSICAL_ADDRESS AllocPa; // Control block physical address
-} RTMP_TXBUF, *PRTMP_TXBUF;
-typedef struct _RTMP_RX_BUF
-{
- BOOLEAN InUse;
- ULONG ByBaRecIndex;
- RTMP_REORDERBUF MAP_RXBuf[MAX_RX_REORDERBUF];
-} RTMP_RXBUF, *PRTMP_RXBUF;
typedef struct _RTMP_TX_RING
{
RTMP_DMACB Cell[TX_RING_SIZE];
@@ -1155,9 +596,6 @@ typedef struct _COUNTER_802_11 {
typedef struct _COUNTER_RALINK {
ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput
-#ifdef RT2860
- ULONG LastReceivedByteCount;
-#endif
ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput
ULONG BeenDisassociatedCount;
ULONG BadCQIAutoRecoveryCount;
@@ -1177,13 +615,10 @@ typedef struct _COUNTER_RALINK {
ULONG OneSecRxCount;
UINT32 OneSecTxAggregationCount;
UINT32 OneSecRxAggregationCount;
-
+ UINT32 OneSecReceivedByteCount;
UINT32 OneSecFrameDuplicateCount;
-#ifdef RT2870
- ULONG OneSecTransmittedByteCount; // both successful and failure, used to calculate TX throughput
-#endif // RT2870 //
-
+ UINT32 OneSecTransmittedByteCount; // both successful and failure, used to calculate TX throughput
UINT32 OneSecTxNoRetryOkCount;
UINT32 OneSecTxRetryOkCount;
UINT32 OneSecTxFailCount;
@@ -1224,12 +659,6 @@ typedef struct _COUNTER_RALINK {
LARGE_INTEGER MPDUInReceivedAMPDUCount;
} COUNTER_RALINK, *PCOUNTER_RALINK;
-typedef struct _PID_COUNTER {
- ULONG TxAckRequiredCount; // CRC error
- ULONG TxAggreCount;
- ULONG TxSuccessCount; // OneSecTxNoRetryOkCount + OneSecTxRetryOkCount + OneSecTxFailCount
- ULONG LastSuccessRate;
-} PID_COUNTER, *PPID_COUNTER;
typedef struct _COUNTER_DRS {
// to record the each TX rate's quality. 0 is best, the bigger the worse.
@@ -1244,33 +673,12 @@ typedef struct _COUNTER_DRS {
ULONG LastTxOkCount;
} COUNTER_DRS, *PCOUNTER_DRS;
-//
-// Arcfour Structure Added by PaulWu
-//
-typedef struct _ARCFOUR
-{
- UINT X;
- UINT Y;
- UCHAR STATE[256];
-} ARCFOURCONTEXT, *PARCFOURCONTEXT;
-// MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI too. just copy to TXWI.
-typedef struct _RECEIVE_SETTING {
- USHORT NumOfRX:2; // MIMO. WE HAVE 3R
- USHORT Mode:2; //channel bandwidth 20MHz or 40 MHz
- USHORT ShortGI:1;
- USHORT STBC:2; //SPACE
- USHORT rsv:3;
- USHORT OFDM:1;
- USHORT MIMO:1;
- } RECEIVE_SETTING, *PRECEIVE_SETTING;
-
-// Shared key data structure
-typedef struct _WEP_KEY {
- UCHAR KeyLen; // Key length for each key, 0: entry is invalid
- UCHAR Key[MAX_LEN_OF_KEY]; // right now we implement 4 keys, 128 bits max
-} WEP_KEY, *PWEP_KEY;
+
+/***************************************************************************
+ * security key related data structure
+ **************************************************************************/
typedef struct _CIPHER_KEY {
UCHAR Key[16]; // right now we implement 4 keys, 128 bits max
UCHAR RxMic[8]; // make alignment
@@ -1284,42 +692,47 @@ typedef struct _CIPHER_KEY {
UCHAR Type; // Indicate Pairwise/Group when reporting MIC error
} CIPHER_KEY, *PCIPHER_KEY;
-typedef struct _BBP_TUNING_STRUCT {
- BOOLEAN Enable;
- UCHAR FalseCcaCountUpperBound; // 100 per sec
- UCHAR FalseCcaCountLowerBound; // 10 per sec
- UCHAR R17LowerBound; // specified in E2PROM
- UCHAR R17UpperBound; // 0x68 according to David Tung
- UCHAR CurrentR17Value;
-} BBP_TUNING, *PBBP_TUNING;
-typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
- UCHAR EvaluatePeriod; // 0:not evalute status, 1: evaluate status, 2: switching status
-#ifdef RT2870
- UCHAR EvaluateStableCnt;
-#endif
- UCHAR Pair1PrimaryRxAnt; // 0:Ant-E1, 1:Ant-E2
- UCHAR Pair1SecondaryRxAnt; // 0:Ant-E1, 1:Ant-E2
- UCHAR Pair2PrimaryRxAnt; // 0:Ant-E3, 1:Ant-E4
- UCHAR Pair2SecondaryRxAnt; // 0:Ant-E3, 1:Ant-E4
- SHORT Pair1AvgRssi[2]; // AvgRssi[0]:E1, AvgRssi[1]:E2
- SHORT Pair2AvgRssi[2]; // AvgRssi[0]:E3, AvgRssi[1]:E4
- SHORT Pair1LastAvgRssi; //
- SHORT Pair2LastAvgRssi; //
- ULONG RcvPktNumWhenEvaluate;
- BOOLEAN FirstPktArrivedWhenEvaluate;
- RALINK_TIMER_STRUCT RxAntDiversityTimer;
-} SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;
+// structure to define WPA Group Key Rekey Interval
+typedef struct PACKED _RT_802_11_WPA_REKEY {
+ ULONG ReKeyMethod; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
+ ULONG ReKeyInterval; // time-based: seconds, packet-based: kilo-packets
+} RT_WPA_REKEY,*PRT_WPA_REKEY, RT_802_11_WPA_REKEY, *PRT_802_11_WPA_REKEY;
-typedef struct _LEAP_AUTH_INFO {
- BOOLEAN Enabled; //Ture: Enable LEAP Authentication
- BOOLEAN CCKM; //Ture: Use Fast Reauthentication with CCKM
- UCHAR Reserve[2];
- UCHAR UserName[256]; //LEAP, User name
- ULONG UserNameLen;
- UCHAR Password[256]; //LEAP, User Password
- ULONG PasswordLen;
-} LEAP_AUTH_INFO, *PLEAP_AUTH_INFO;
+#ifdef RTMP_MAC_USB
+/***************************************************************************
+ * RTUSB I/O related data structure
+ **************************************************************************/
+typedef struct _RT_SET_ASIC_WCID {
+ ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
+ ULONG SetTid; // time-based: seconds, packet-based: kilo-packets
+ ULONG DeleteTid; // time-based: seconds, packet-based: kilo-packets
+ UCHAR Addr[MAC_ADDR_LEN]; // avoid in interrupt when write key
+} RT_SET_ASIC_WCID,*PRT_SET_ASIC_WCID;
+
+typedef struct _RT_SET_ASIC_WCID_ATTRI {
+ ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
+ ULONG Cipher; // ASIC Cipher definition
+ UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
+} RT_SET_ASIC_WCID_ATTRI,*PRT_SET_ASIC_WCID_ATTRI;
+
+// for USB interface, avoid in interrupt when write key
+typedef struct RT_ADD_PAIRWISE_KEY_ENTRY {
+ UCHAR MacAddr[6];
+ USHORT MacTabMatchWCID; // ASIC
+ CIPHER_KEY CipherKey;
+} RT_ADD_PAIRWISE_KEY_ENTRY,*PRT_ADD_PAIRWISE_KEY_ENTRY;
+
+// Cipher suite type for mixed mode group cipher, P802.11i-2004
+typedef enum _RT_802_11_CIPHER_SUITE_TYPE {
+ Cipher_Type_NONE,
+ Cipher_Type_WEP40,
+ Cipher_Type_TKIP,
+ Cipher_Type_RSVD,
+ Cipher_Type_CCMP,
+ Cipher_Type_WEP104
+} RT_802_11_CIPHER_SUITE_TYPE, *PRT_802_11_CIPHER_SUITE_TYPE;
+#endif // RTMP_MAC_USB //
typedef struct {
UCHAR Addr[MAC_ADDR_LEN];
@@ -1335,25 +748,30 @@ typedef struct {
ROGUEAP_ENTRY RogueApEntry[MAX_LEN_OF_BSS_TABLE];
} ROGUEAP_TABLE, *PROGUEAP_TABLE;
-typedef struct {
- BOOLEAN Enable;
- UCHAR Delta;
- BOOLEAN PlusSign;
-} CCK_TX_POWER_CALIBRATE, *PCCK_TX_POWER_CALIBRATE;
-
//
-// Receive Tuple Cache Format
+// Cisco IAPP format
//
-typedef struct _TUPLE_CACHE {
- BOOLEAN Valid;
- UCHAR MacAddress[MAC_ADDR_LEN];
- USHORT Sequence;
- USHORT Frag;
-} TUPLE_CACHE, *PTUPLE_CACHE;
+typedef struct _CISCO_IAPP_CONTENT_
+{
+ USHORT Length; //IAPP Length
+ UCHAR MessageType; //IAPP type
+ UCHAR FunctionCode; //IAPP function type
+ UCHAR DestinaionMAC[MAC_ADDR_LEN];
+ UCHAR SourceMAC[MAC_ADDR_LEN];
+ USHORT Tag; //Tag(element IE) - Adjacent AP report
+ USHORT TagLength; //Length of element not including 4 byte header
+ UCHAR OUI[4]; //0x00, 0x40, 0x96, 0x00
+ UCHAR PreviousAP[MAC_ADDR_LEN]; //MAC Address of access point
+ USHORT Channel;
+ USHORT SsidLen;
+ UCHAR Ssid[MAX_LEN_OF_SSID];
+ USHORT Seconds; //Seconds that the client has been disassociated.
+} CISCO_IAPP_CONTENT, *PCISCO_IAPP_CONTENT;
-//
-// Fragment Frame structure
-//
+
+/*
+ * Fragment Frame structure
+ */
typedef struct _FRAGMENT_FRAME {
PNDIS_PACKET pFragPacket;
ULONG RxSize;
@@ -1373,6 +791,18 @@ typedef struct _PACKET_INFO {
PNDIS_BUFFER pFirstBuffer; // Pointer to first buffer descriptor
} PACKET_INFO, *PPACKET_INFO;
+
+//
+// Arcfour Structure Added by PaulWu
+//
+typedef struct _ARCFOUR
+{
+ UINT X;
+ UINT Y;
+ UCHAR STATE[256];
+} ARCFOURCONTEXT, *PARCFOURCONTEXT;
+
+
//
// Tkip Key structure which RC4 key & MIC calculation
//
@@ -1404,6 +834,10 @@ typedef struct __PRIVATE_STRUC {
TKIP_KEY_INFO Rx;
} PRIVATE_STRUC, *PPRIVATE_STRUC;
+
+/***************************************************************************
+ * Channel and BBP related data structures
+ **************************************************************************/
// structure to tune BBP R66 (BBP TUNING)
typedef struct _BBP_R66_TUNING {
BOOLEAN bEnable;
@@ -1433,12 +867,70 @@ typedef struct _CHANNEL_11J_TX_POWER {
USHORT RemainingTimeForUse; //unit: sec
} CHANNEL_11J_TX_POWER, *PCHANNEL_11J_TX_POWER;
+typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
+ UCHAR EvaluatePeriod; // 0:not evalute status, 1: evaluate status, 2: switching status
+ UCHAR EvaluateStableCnt;
+ UCHAR Pair1PrimaryRxAnt; // 0:Ant-E1, 1:Ant-E2
+ UCHAR Pair1SecondaryRxAnt; // 0:Ant-E1, 1:Ant-E2
+ UCHAR Pair2PrimaryRxAnt; // 0:Ant-E3, 1:Ant-E4
+ UCHAR Pair2SecondaryRxAnt; // 0:Ant-E3, 1:Ant-E4
+ SHORT Pair1AvgRssi[2]; // AvgRssi[0]:E1, AvgRssi[1]:E2
+ SHORT Pair2AvgRssi[2]; // AvgRssi[0]:E3, AvgRssi[1]:E4
+ SHORT Pair1LastAvgRssi; //
+ SHORT Pair2LastAvgRssi; //
+ ULONG RcvPktNumWhenEvaluate;
+ BOOLEAN FirstPktArrivedWhenEvaluate;
+ RALINK_TIMER_STRUCT RxAntDiversityTimer;
+} SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;
+
+
+/***************************************************************************
+ * structure for radar detection and channel switch
+ **************************************************************************/
+typedef struct _RADAR_DETECT_STRUCT {
+ //BOOLEAN IEEE80211H; // 0: disable, 1: enable IEEE802.11h
+ UCHAR CSCount; //Channel switch counter
+ UCHAR CSPeriod; //Channel switch period (beacon count)
+ UCHAR RDCount; //Radar detection counter
+ UCHAR RDMode; //Radar Detection mode
+ UCHAR RDDurRegion; //Radar detection duration region
+ UCHAR BBPR16;
+ UCHAR BBPR17;
+ UCHAR BBPR18;
+ UCHAR BBPR21;
+ UCHAR BBPR22;
+ UCHAR BBPR64;
+ ULONG InServiceMonitorCount; // unit: sec
+ UINT8 DfsSessionTime;
+ BOOLEAN bFastDfs;
+ UINT8 ChMovingTime;
+ UINT8 LongPulseRadarTh;
+} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;
+
typedef enum _ABGBAND_STATE_ {
UNKNOWN_BAND,
BG_BAND,
A_BAND,
} ABGBAND_STATE;
+#ifdef RTMP_MAC_PCI
+// Power save method control
+typedef union _PS_CONTROL {
+ struct {
+ ULONG EnablePSinIdle:1; // Enable radio off when not connect to AP. radio on only when sitesurvey,
+ ULONG EnableNewPS:1; // Enable new Chip power save fucntion . New method can only be applied in chip version after 2872. and PCIe.
+ ULONG rt30xxPowerMode:2; // Power Level Mode for rt30xx chip
+ ULONG rt30xxFollowHostASPM:1; // Card Follows Host's setting for rt30xx chip.
+ ULONG rt30xxForceASPMTest:1; // Force enable L1 for rt30xx chip. This has higher priority than rt30xxFollowHostASPM Mode.
+ ULONG rsv:26; // Radio Measurement Enable
+ } field;
+ ULONG word;
+} PS_CONTROL, *PPS_CONTROL;
+#endif // RTMP_MAC_PCI //
+
+/***************************************************************************
+ * structure for MLME state machine
+ **************************************************************************/
typedef struct _MLME_STRUCT {
// STA state machines
STATE_MACHINE CntlMachine;
@@ -1448,17 +940,23 @@ typedef struct _MLME_STRUCT {
STATE_MACHINE SyncMachine;
STATE_MACHINE WpaPskMachine;
STATE_MACHINE LeapMachine;
- STATE_MACHINE AironetMachine;
STATE_MACHINE_FUNC AssocFunc[ASSOC_FUNC_SIZE];
STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE];
STATE_MACHINE_FUNC AuthRspFunc[AUTH_RSP_FUNC_SIZE];
STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE];
- STATE_MACHINE_FUNC WpaPskFunc[WPA_PSK_FUNC_SIZE];
- STATE_MACHINE_FUNC AironetFunc[AIRONET_FUNC_SIZE];
STATE_MACHINE_FUNC ActFunc[ACT_FUNC_SIZE];
// Action
STATE_MACHINE ActMachine;
+
+
+
+ // common WPA state machine
+ STATE_MACHINE WpaMachine;
+ STATE_MACHINE_FUNC WpaFunc[WPA_FUNC_SIZE];
+
+
+
ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
ULONG Now32; // latch the value of NdisGetSystemUpTime()
ULONG LastSendNULLpsmTime;
@@ -1473,11 +971,11 @@ typedef struct _MLME_STRUCT {
RALINK_TIMER_STRUCT APSDPeriodicTimer;
RALINK_TIMER_STRUCT LinkDownTimer;
RALINK_TIMER_STRUCT LinkUpTimer;
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
UCHAR bPsPollTimerRunning;
RALINK_TIMER_STRUCT PsPollTimer;
RALINK_TIMER_STRUCT RadioOnOffTimer;
-#endif
+#endif // RTMP_MAC_PCI //
ULONG PeriodicRound;
ULONG OneSecPeriodicRound;
@@ -1486,31 +984,41 @@ typedef struct _MLME_STRUCT {
BOOLEAN bEnableAutoAntennaCheck;
RALINK_TIMER_STRUCT RxAntEvalTimer;
-#ifdef RT2870
+#ifdef RT30xx
UCHAR CaliBW40RfR24;
UCHAR CaliBW20RfR24;
-#endif // RT2870 //
+#endif // RT30xx //
+
+#ifdef RTMP_MAC_USB
+ RALINK_TIMER_STRUCT AutoWakeupTimer;
+ BOOLEAN AutoWakeupTimerRunning;
+#endif // RTMP_MAC_USB //
} MLME_STRUCT, *PMLME_STRUCT;
-// structure for radar detection and channel switch
-typedef struct _RADAR_DETECT_STRUCT {
- UCHAR CSCount; //Channel switch counter
- UCHAR CSPeriod; //Channel switch period (beacon count)
- UCHAR RDCount; //Radar detection counter
- UCHAR RDMode; //Radar Detection mode
- UCHAR RDDurRegion; //Radar detection duration region
- UCHAR BBPR16;
- UCHAR BBPR17;
- UCHAR BBPR18;
- UCHAR BBPR21;
- UCHAR BBPR22;
- UCHAR BBPR64;
- ULONG InServiceMonitorCount; // unit: sec
- UINT8 DfsSessionTime;
- BOOLEAN bFastDfs;
- UINT8 ChMovingTime;
- UINT8 LongPulseRadarTh;
-} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;
+
+/***************************************************************************
+ * 802.11 N related data structures
+ **************************************************************************/
+struct reordering_mpdu
+{
+ struct reordering_mpdu *next;
+ PNDIS_PACKET pPacket; /* coverted to 802.3 frame */
+ int Sequence; /* sequence number of MPDU */
+ BOOLEAN bAMSDU;
+};
+
+struct reordering_list
+{
+ struct reordering_mpdu *next;
+ int qlen;
+};
+
+struct reordering_mpdu_pool
+{
+ PVOID mem;
+ NDIS_SPIN_LOCK lock;
+ struct reordering_list freelist;
+};
typedef enum _REC_BLOCKACK_STATUS
{
@@ -1545,14 +1053,21 @@ typedef struct _BA_REC_ENTRY {
UCHAR Wcid;
UCHAR TID;
UCHAR BAWinSize; // 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU.
+ //UCHAR NumOfRxPkt;
+ //UCHAR Curindidx; // the head in the RX reordering buffer
USHORT LastIndSeq;
+// USHORT LastIndSeqAtTimer;
USHORT TimeOutValue;
RALINK_TIMER_STRUCT RECBATimer;
ULONG LastIndSeqAtTimer;
ULONG nDropPacket;
ULONG rcvSeq;
REC_BLOCKACK_STATUS REC_BA_Status;
+// UCHAR RxBufIdxUsed;
+ // corresponding virtual address for RX reordering packet storage.
+ //RTMP_REORDERDMABUF MAP_RXBuf[MAX_RX_REORDERBUF];
NDIS_SPIN_LOCK RxReRingLock; // Rx Ring spinlock
+// struct _BA_REC_ENTRY *pNext;
PVOID pAdapter;
struct reordering_list list;
} BA_REC_ENTRY, *PBA_REC_ENTRY;
@@ -1561,6 +1076,7 @@ typedef struct _BA_REC_ENTRY {
typedef struct {
ULONG numAsRecipient; // I am recipient of numAsRecipient clients. These client are in the BARecEntry[]
ULONG numAsOriginator; // I am originator of numAsOriginator clients. These clients are in the BAOriEntry[]
+ ULONG numDoneOriginator; // count Done Originator sessions
BA_ORI_ENTRY BAOriEntry[MAX_LEN_OF_BA_ORI_TABLE];
BA_REC_ENTRY BARecEntry[MAX_LEN_OF_BA_REC_TABLE];
} BA_TABLE, *PBA_TABLE;
@@ -1607,6 +1123,29 @@ typedef union _BACAP_STRUC {
UINT32 word;
} BACAP_STRUC, *PBACAP_STRUC;
+
+typedef struct {
+ BOOLEAN IsRecipient;
+ UCHAR MACAddr[MAC_ADDR_LEN];
+ UCHAR TID;
+ UCHAR nMSDU;
+ USHORT TimeOut;
+ BOOLEAN bAllTid; // If True, delete all TID for BA sessions with this MACaddr.
+} OID_ADD_BA_ENTRY, *POID_ADD_BA_ENTRY;
+
+
+
+#define IS_HT_STA(_pMacEntry) \
+ (_pMacEntry->MaxHTPhyMode.field.MODE >= MODE_HTMIX)
+
+#define IS_HT_RATE(_pMacEntry) \
+ (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
+
+#define PEER_IS_HT_RATE(_pMacEntry) \
+ (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
+
+
+
//This structure is for all 802.11n card InterOptibilityTest action. Reset all Num every n second. (Details see MLMEPeriodic)
typedef struct _IOT_STRUC {
UCHAR Threshold[2];
@@ -1630,6 +1169,8 @@ typedef struct _IOT_STRUC {
// This is the registry setting for 802.11n transmit setting. Used in advanced page.
typedef union _REG_TRANSMIT_SETTING {
struct {
+ //UINT32 PhyMode:4;
+ //UINT32 MCS:7; // MCS
UINT32 rsv0:10;
UINT32 TxBF:1;
UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
@@ -1653,18 +1194,26 @@ typedef union _DESIRED_TRANSMIT_SETTING {
USHORT word;
} DESIRED_TRANSMIT_SETTING, *PDESIRED_TRANSMIT_SETTING;
-typedef struct {
- BOOLEAN IsRecipient;
- UCHAR MACAddr[MAC_ADDR_LEN];
- UCHAR TID;
- UCHAR nMSDU;
- USHORT TimeOut;
- BOOLEAN bAllTid; // If True, delete all TID for BA sessions with this MACaddr.
-} OID_ADD_BA_ENTRY, *POID_ADD_BA_ENTRY;
+#ifdef RTMP_MAC_USB
+/***************************************************************************
+ * USB-based chip Beacon related data structures
+ **************************************************************************/
+#define BEACON_BITMAP_MASK 0xff
+typedef struct _BEACON_SYNC_STRUCT_
+{
+ UCHAR BeaconBuf[HW_BEACON_MAX_COUNT][HW_BEACON_OFFSET];
+ UCHAR BeaconTxWI[HW_BEACON_MAX_COUNT][TXWI_SIZE];
+ ULONG TimIELocationInBeacon[HW_BEACON_MAX_COUNT];
+ ULONG CapabilityInfoLocationInBeacon[HW_BEACON_MAX_COUNT];
+ BOOLEAN EnableBeacon; // trigger to enable beacon transmission.
+ UCHAR BeaconBitMap; // NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change.
+ UCHAR DtimBitOn; // NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change.
+}BEACON_SYNC_STRUCT;
+#endif // RTMP_MAC_USB //
-//
-// Multiple SSID structure
-//
+/***************************************************************************
+ * Multiple SSID related data structures
+ **************************************************************************/
#define WLAN_MAX_NUM_OF_TIM ((MAX_LEN_OF_MAC_TABLE >> 3) + 1) /* /8 + 1 */
#define WLAN_CT_TIM_BCMC_OFFSET 0 /* unit: 32B */
@@ -1688,124 +1237,6 @@ typedef struct {
UCHAR bit_offset = wcid & 0x7; \
ad_p->ApCfg.MBSSID[apidx].TimBitmaps[tim_offset] |= BIT8[bit_offset]; }
-#ifdef RT2870
-#define BEACON_BITMAP_MASK 0xff
-typedef struct _BEACON_SYNC_STRUCT_
-{
- UCHAR BeaconBuf[HW_BEACON_MAX_COUNT][HW_BEACON_OFFSET];
- UCHAR BeaconTxWI[HW_BEACON_MAX_COUNT][TXWI_SIZE];
- ULONG TimIELocationInBeacon[HW_BEACON_MAX_COUNT];
- ULONG CapabilityInfoLocationInBeacon[HW_BEACON_MAX_COUNT];
- BOOLEAN EnableBeacon; // trigger to enable beacon transmission.
- UCHAR BeaconBitMap; // NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change.
- UCHAR DtimBitOn; // NOTE: If the MAX_MBSSID_NUM is larger than 8, this parameter need to change.
-}BEACON_SYNC_STRUCT;
-#endif // RT2870 //
-
-typedef struct _MULTISSID_STRUCT {
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR SsidLen;
- CHAR Ssid[MAX_LEN_OF_SSID];
- USHORT CapabilityInfo;
-
- PNET_DEV MSSIDDev;
-
- NDIS_802_11_AUTHENTICATION_MODE AuthMode;
- NDIS_802_11_WEP_STATUS WepStatus;
- NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
- WPA_MIX_PAIR_CIPHER WpaMixPairCipher;
-
- ULONG TxCount;
- ULONG RxCount;
- ULONG ReceivedByteCount;
- ULONG TransmittedByteCount;
- ULONG RxErrorCount;
- ULONG RxDropCount;
-
- HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
- RT_HT_PHY_INFO DesiredHtPhyInfo;
- DESIRED_TRANSMIT_SETTING DesiredTransmitSetting; // Desired transmit setting. this is for reading registry setting only. not useful.
- BOOLEAN bAutoTxRateSwitch;
-
- UCHAR DefaultKeyId;
-
- UCHAR TxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11, ...
- UCHAR DesiredRates[MAX_LEN_OF_SUPPORTED_RATES];// OID_802_11_DESIRED_RATES
- UCHAR DesiredRatesIndex;
- UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
-
- UCHAR TimBitmaps[WLAN_MAX_NUM_OF_TIM];
-
- // WPA
- UCHAR GMK[32];
- UCHAR PMK[32];
- UCHAR GTK[32];
- BOOLEAN IEEE8021X;
- BOOLEAN PreAuth;
- UCHAR GNonce[32];
- UCHAR PortSecured;
- NDIS_802_11_PRIVACY_FILTER PrivacyFilter;
- UCHAR BANClass3Data;
- ULONG IsolateInterStaTraffic;
-
- UCHAR RSNIE_Len[2];
- UCHAR RSN_IE[2][MAX_LEN_OF_RSNIE];
-
-
- UCHAR TimIELocationInBeacon;
- UCHAR CapabilityInfoLocationInBeacon;
- // outgoing BEACON frame buffer and corresponding TXWI
- // PTXWI_STRUC BeaconTxWI; //
- CHAR BeaconBuf[MAX_BEACON_SIZE]; // NOTE: BeaconBuf should be 4-byte aligned
-
- BOOLEAN bHideSsid;
- UINT16 StationKeepAliveTime; // unit: second
-
- USHORT VLAN_VID;
- USHORT VLAN_Priority;
-
- RT_802_11_ACL AccessControlList;
-
- // EDCA Qos
- BOOLEAN bWmmCapable; // 0:disable WMM, 1:enable WMM
- BOOLEAN bDLSCapable; // 0:disable DLS, 1:enable DLS
-
- UCHAR DlsPTK[64]; // Due to windows dirver count on meetinghouse to handle 4-way shake
-
- // For 802.1x daemon setting per BSS
- UCHAR radius_srv_num;
- RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM];
-
-#ifdef RTL865X_SOC
- unsigned int mylinkid;
-#endif
-
-
- UINT32 RcvdConflictSsidCount;
- UINT32 RcvdSpoofedAssocRespCount;
- UINT32 RcvdSpoofedReassocRespCount;
- UINT32 RcvdSpoofedProbeRespCount;
- UINT32 RcvdSpoofedBeaconCount;
- UINT32 RcvdSpoofedDisassocCount;
- UINT32 RcvdSpoofedAuthCount;
- UINT32 RcvdSpoofedDeauthCount;
- UINT32 RcvdSpoofedUnknownMgmtCount;
- UINT32 RcvdReplayAttackCount;
-
- CHAR RssiOfRcvdConflictSsid;
- CHAR RssiOfRcvdSpoofedAssocResp;
- CHAR RssiOfRcvdSpoofedReassocResp;
- CHAR RssiOfRcvdSpoofedProbeResp;
- CHAR RssiOfRcvdSpoofedBeacon;
- CHAR RssiOfRcvdSpoofedDisassoc;
- CHAR RssiOfRcvdSpoofedAuth;
- CHAR RssiOfRcvdSpoofedDeauth;
- CHAR RssiOfRcvdSpoofedUnknownMgmt;
- CHAR RssiOfRcvdReplayAttack;
-
- BOOLEAN bBcnSntReq;
- UCHAR BcnBufIdx;
-} MULTISSID_STRUCT, *PMULTISSID_STRUCT;
// configuration common to OPMODE_AP as well as OPMODE_STA
typedef struct _COMMON_CONFIG {
@@ -1818,6 +1249,7 @@ typedef struct _COMMON_CONFIG {
UCHAR PhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
USHORT Dsifs; // in units of usec
ULONG PacketFilter; // Packet filter for receiving
+ UINT8 RegulatoryClass;
CHAR Ssid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
UCHAR SsidLen; // the actual ssid length in used
@@ -1846,16 +1278,27 @@ typedef struct _COMMON_CONFIG {
BOOLEAN bAPSDAC_BK;
BOOLEAN bAPSDAC_VI;
BOOLEAN bAPSDAC_VO;
+
+ /* because TSPEC can modify the APSD flag, we need to keep the APSD flag
+ requested in association stage from the station;
+ we need to recover the APSD flag after the TSPEC is deleted. */
+ BOOLEAN bACMAPSDBackup[4]; /* for delivery-enabled & trigger-enabled both */
+ BOOLEAN bACMAPSDTr[4]; /* no use */
+
BOOLEAN bNeedSendTriggerFrame;
BOOLEAN bAPSDForcePowerSave; // Force power save mode, should only use in APSD-STAUT
ULONG TriggerTimerCount;
UCHAR MaxSPLength;
UCHAR BBPCurrentBW; // BW_10, BW_20, BW_40
+ // move to MULTISSID_STRUCT for MBSS
+ //HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
REG_TRANSMIT_SETTING RegTransmitSetting; //registry transmit setting. this is for reading registry setting only. not useful.
+ //UCHAR FixedTxMode; // Fixed Tx Mode (CCK, OFDM), for HT fixed tx mode (GF, MIX) , refer to RegTransmitSetting.field.HTMode
UCHAR TxRate; // Same value to fill in TXD. TxRate is 6-bit
UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
UCHAR TxRateIndex; // Tx rate index in RateSwitchTable
UCHAR TxRateTableSize; // Valid Tx rate table size in RateSwitchTable
+ //BOOLEAN bAutoTxRateSwitch;
UCHAR MinTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
UCHAR RtsRate; // RATE_xxx
HTTRANSMIT_SETTING MlmeTransmit; // MGMT frame PHY rate setting when operatin at Ht rate.
@@ -1868,6 +1311,7 @@ typedef struct _COMMON_CONFIG {
UCHAR TxPower; // in unit of mW
ULONG TxPowerPercentage; // 0~100 %
ULONG TxPowerDefault; // keep for TxPowerPercentage
+ UINT8 PwrConstraint;
BACAP_STRUC BACapability; // NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0
BACAP_STRUC REGBACapability; // NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0
@@ -1877,7 +1321,7 @@ typedef struct _COMMON_CONFIG {
BOOLEAN bUseZeroToDisableFragment; // Microsoft use 0 as disable
ULONG UseBGProtection; // 0: auto, 1: always use, 2: always not use
BOOLEAN bUseShortSlotTime; // 0: disable, 1 - use short slot (9us)
- BOOLEAN bEnableTxBurst; // 1: enble TX PACKET BURST, 0: disable TX PACKET BURST
+ BOOLEAN bEnableTxBurst; // 1: enble TX PACKET BURST (when BA is established or AP is not a legacy WMM AP), 0: disable TX PACKET BURST
BOOLEAN bAggregationCapable; // 1: enable TX aggregation when the peer supports it
BOOLEAN bPiggyBackCapable; // 1: enable TX piggy-back according MAC's version
BOOLEAN bIEEE80211H; // 1: enable IEEE802.11h spec.
@@ -1916,6 +1360,9 @@ typedef struct _COMMON_CONFIG {
BOOLEAN bHTProtect;
BOOLEAN bMIMOPSEnable;
BOOLEAN bBADecline;
+//2008/11/05: KH add to support Antenna power-saving of AP<--
+ BOOLEAN bGreenAPEnable;
+//2008/11/05: KH add to support Antenna power-saving of AP-->
BOOLEAN bDisableReordering;
BOOLEAN bForty_Mhz_Intolerant;
BOOLEAN bExtChannelSwitchAnnouncement;
@@ -1932,15 +1379,9 @@ typedef struct _COMMON_CONFIG {
UCHAR TxStream;
UCHAR RxStream;
- // transmit phy mode, trasmit rate for Multicast.
-#ifdef MCAST_RATE_SPECIFIC
- UCHAR McastTransmitMcs;
- UCHAR McastTransmitPhyMode;
-#endif // MCAST_RATE_SPECIFIC //
-
BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
BOOLEAN bMultipleIRP; // Multiple Bulk IN flag
UCHAR NumOfBulkInIRP; // if bMultipleIRP == TRUE, NumOfBulkInIRP will be 4 otherwise be 1
RT_HT_CAPABILITY SupportedHtPhy;
@@ -1948,13 +1389,13 @@ typedef struct _COMMON_CONFIG {
UCHAR TxBulkFactor;
UCHAR RxBulkFactor;
+ BOOLEAN IsUpdateBeacon;
BEACON_SYNC_STRUCT *pBeaconSync;
RALINK_TIMER_STRUCT BeaconUpdateTimer;
UINT32 BeaconAdjust;
UINT32 BeaconFactor;
UINT32 BeaconRemain;
-#endif // RT2870 //
-
+#endif // RTMP_MAC_USB //
NDIS_SPIN_LOCK MeasureReqTabLock;
PMEASURE_REQ_TAB pMeasureReqTab;
@@ -1962,12 +1403,17 @@ typedef struct _COMMON_CONFIG {
NDIS_SPIN_LOCK TpcReqTabLock;
PTPC_REQ_TAB pTpcReqTab;
- // transmit phy mode, trasmit rate for Multicast.
-#ifdef MCAST_RATE_SPECIFIC
- HTTRANSMIT_SETTING MCastPhyMode;
-#endif // MCAST_RATE_SPECIFIC //
+ BOOLEAN PSPXlink; // 0: Disable. 1: Enable
+
+#if defined(RT305x)||defined(RT30xx)
+ // request by Gary, for High Power issue
+ UCHAR HighPowerPatchDisabled;
+#endif
+
+ BOOLEAN HT_DisallowTKIP; /* Restrict the encryption type in 11n HT mode */
} COMMON_CONFIG, *PCOMMON_CONFIG;
+
/* Modified by Wu Xi-Kun 4/21/2006 */
// STA configuration and status
typedef struct _STA_ADMIN_CONFIG {
@@ -2016,6 +1462,8 @@ typedef struct _STA_ADMIN_CONFIG {
NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
+ UCHAR WpaPassPhrase[64]; // WPA PSK pass phrase
+ UINT WpaPassPhraseLen; // the length of WPA PSK pass phrase
UCHAR PMK[32]; // WPA PSK mode PMK
UCHAR PTK[64]; // WPA PSK mode PTK
UCHAR GTK[32]; // GTK from authenticator
@@ -2055,11 +1503,7 @@ typedef struct _STA_ADMIN_CONFIG {
BOOLEAN bRadio; // Radio state, And of Sw & Hw radio state
BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
BOOLEAN bShowHiddenSSID; // Show all known SSID in SSID list get operation
-#ifdef RT2860
- BOOLEAN AdhocBOnlyJoined; // Indicate Adhoc B Join.
- BOOLEAN AdhocBGJoined; // Indicate Adhoc B/G Join.
- BOOLEAN Adhoc20NJoined; // Indicate Adhoc 20MHz N Join.
-#endif
+
// New for WPA, windows want us to keep association information and
// Fixed IEs from last association response
NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
@@ -2071,43 +1515,9 @@ typedef struct _STA_ADMIN_CONFIG {
UCHAR RSNIE_Len;
UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; // The content saved here should be little-endian format.
- // New variables used for CCX 1.0
- BOOLEAN bCkipOn;
- BOOLEAN bCkipCmicOn;
- UCHAR CkipFlag;
- UCHAR GIV[3]; //for CCX iv
- UCHAR RxSEQ[4];
- UCHAR TxSEQ[4];
- UCHAR CKIPMIC[4];
- UCHAR LeapAuthMode;
- LEAP_AUTH_INFO LeapAuthInfo;
- UCHAR HashPwd[16];
- UCHAR NetworkChallenge[8];
- UCHAR NetworkChallengeResponse[24];
- UCHAR PeerChallenge[8];
-
- UCHAR PeerChallengeResponse[24];
- UCHAR SessionKey[16]; //Network session keys (NSK)
- RALINK_TIMER_STRUCT LeapAuthTimer;
- ROGUEAP_TABLE RogueApTab; //Cisco CCX1 Rogue AP Detection
-
- // New control flags for CCX
- CCX_CONTROL CCXControl; // Master administration state
- BOOLEAN CCXEnable; // Actual CCX state
- UCHAR CCXScanChannel; // Selected channel for CCX beacon request
- USHORT CCXScanTime; // Time out to wait for beacon and probe response
- UCHAR CCXReqType; // Current processing CCX request type
- BSS_TABLE CCXBssTab; // BSS Table
- UCHAR FrameReportBuf[2048]; // Buffer for creating frame report
- USHORT FrameReportLen; // Current Frame report length
ULONG CLBusyBytes; // Save the total bytes received durning channel load scan time
USHORT RPIDensity[8]; // Array for RPI density collection
- // Start address of each BSS table within FrameReportBuf
- // It's important to update the RxPower of the corresponding Bss
- USHORT BssReportOffset[MAX_LEN_OF_BSS_TABLE];
- USHORT BeaconToken; // Token for beacon report
- ULONG LastBssIndex; // Most current reported Bss index
- RM_REQUEST_ACTION MeasurementRequest[16]; // Saved measurement request
+
UCHAR RMReqCnt; // Number of measurement request saved.
UCHAR CurrentRMReqIdx; // Number of measurement request saved.
BOOLEAN ParallelReq; // Parallel measurement, only one request performed,
@@ -2115,26 +1525,10 @@ typedef struct _STA_ADMIN_CONFIG {
USHORT ParallelDuration; // Maximum duration for parallel measurement
UCHAR ParallelChannel; // Only one channel with parallel measurement
USHORT IAPPToken; // IAPP dialog token
- UCHAR CCXQosECWMin; // Cisco QOS ECWMin for AC 0
- UCHAR CCXQosECWMax; // Cisco QOS ECWMax for AC 0
// Hack for channel load and noise histogram parameters
UCHAR NHFactor; // Parameter for Noise histogram
UCHAR CLFactor; // Parameter for channel load
- UCHAR KRK[16]; //Key Refresh Key.
- UCHAR BTK[32]; //Base Transient Key
- BOOLEAN CCKMLinkUpFlag;
- ULONG CCKMRN; //(Re)Association request number.
- LARGE_INTEGER CCKMBeaconAtJoinTimeStamp; //TSF timer for Re-assocaite to the new AP
- UCHAR AironetCellPowerLimit; //in dBm
- UCHAR AironetIPAddress[4]; //eg. 192.168.1.1
- BOOLEAN CCXAdjacentAPReportFlag; //flag for determining report Assoc Lost time
- CHAR CCXAdjacentAPSsid[MAX_LEN_OF_SSID]; //Adjacent AP's SSID report
- UCHAR CCXAdjacentAPSsidLen; // the actual ssid length in used
- UCHAR CCXAdjacentAPBssid[MAC_ADDR_LEN]; //Adjacent AP's BSSID report
- USHORT CCXAdjacentAPChannel;
- ULONG CCXAdjacentAPLinkDownTime; //for Spec S32.
-
RALINK_TIMER_STRUCT StaQuickResponeForRateUpTimer;
BOOLEAN StaQuickResponeForRateUpTimerRunning;
@@ -2148,7 +1542,7 @@ typedef struct _STA_ADMIN_CONFIG {
RALINK_TIMER_STRUCT WpaDisassocAndBlockAssocTimer;
// Fast Roaming
- BOOLEAN bFastRoaming; // 0:disable fast roaming, 1:enable fast roaming
+ BOOLEAN bAutoRoaming; // 0:disable auto roaming by RSSI, 1:enable auto roaming by RSSI
CHAR dBmToRoam; // the condition to roam when receiving Rssi less than this value. It's negative value.
BOOLEAN IEEE8021X;
@@ -2161,6 +1555,7 @@ typedef struct _STA_ADMIN_CONFIG {
// 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters
UCHAR WpaSupplicantUP;
UCHAR WpaSupplicantScanCount;
+ BOOLEAN bRSN_IE_FromWpaSupplicant;
CHAR dev_name[16];
USHORT OriDevType;
@@ -2173,9 +1568,20 @@ typedef struct _STA_ADMIN_CONFIG {
RT_HT_PHY_INFO DesiredHtPhyInfo;
BOOLEAN bAutoTxRateSwitch;
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
UCHAR BBPR3;
-#endif
+ // PS Control has 2 meanings for advanced power save function.
+ // 1. EnablePSinIdle : When no connection, always radio off except need to do site survey.
+ // 2. EnableNewPS : will save more current in sleep or radio off mode.
+ PS_CONTROL PSControl;
+#endif // RTMP_MAC_PCI //
+
+
+
+
+ BOOLEAN bAutoConnectByBssid;
+ ULONG BeaconLostTime; // seconds
+ BOOLEAN bForceTxBurst; // 1: force enble TX PACKET BURST, 0: disable
} STA_ADMIN_CONFIG, *PSTA_ADMIN_CONFIG;
// This data structure keep the current active BSS/IBSS's configuration that this STA
@@ -2202,28 +1608,10 @@ typedef struct _STA_ACTIVE_CONFIG {
RT_HT_CAPABILITY SupportedHtPhy;
} STA_ACTIVE_CONFIG, *PSTA_ACTIVE_CONFIG;
-#ifdef RT2870
-// for USB interface, avoid in interrupt when write key
-typedef struct RT_ADD_PAIRWISE_KEY_ENTRY {
- NDIS_802_11_MAC_ADDRESS MacAddr;
- USHORT MacTabMatchWCID; // ASIC
- CIPHER_KEY CipherKey;
-} RT_ADD_PAIRWISE_KEY_ENTRY,*PRT_ADD_PAIRWISE_KEY_ENTRY;
-#endif // RT2870 //
-// ----------- start of AP --------------------------
-// AUTH-RSP State Machine Aux data structure
-typedef struct _AP_MLME_AUX {
- UCHAR Addr[MAC_ADDR_LEN];
- USHORT Alg;
- CHAR Challenge[CIPHER_TEXT_LEN];
-} AP_MLME_AUX, *PAP_MLME_AUX;
-// structure to define WPA Group Key Rekey Interval
-typedef struct PACKED _RT_802_11_WPA_REKEY {
- ULONG ReKeyMethod; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
- ULONG ReKeyInterval; // time-based: seconds, packet-based: kilo-packets
-} RT_WPA_REKEY,*PRT_WPA_REKEY, RT_802_11_WPA_REKEY, *PRT_802_11_WPA_REKEY;
+
+
typedef struct _MAC_TABLE_ENTRY {
//Choose 1 from ValidAsWDS and ValidAsCLI to validize.
@@ -2243,6 +1631,7 @@ typedef struct _MAC_TABLE_ENTRY {
UCHAR RSNIE_Len;
UCHAR RSN_IE[MAX_LEN_OF_RSNIE];
UCHAR ANonce[LEN_KEY_DESC_NONCE];
+ UCHAR SNonce[LEN_KEY_DESC_NONCE];
UCHAR R_Counter[LEN_KEY_DESC_REPLAY];
UCHAR PTK[64];
UCHAR ReTryCounter;
@@ -2250,6 +1639,7 @@ typedef struct _MAC_TABLE_ENTRY {
RALINK_TIMER_STRUCT EnqueueStartForPSKTimer; // A timer which enqueue EAPoL-Start for triggering PSK SM
NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
NDIS_802_11_WEP_STATUS WepStatus;
+ NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
AP_WPA_STATE WpaState;
GTK_STATE GTKState;
USHORT PortSecured;
@@ -2288,13 +1678,14 @@ typedef struct _MAC_TABLE_ENTRY {
//====================================================
//WDS entry needs these
-// rt2860 add this. if ValidAsWDS==TRUE, MatchWDSTabIdx is the index in WdsTab.MacTab
+// if ValidAsWDS==TRUE, MatchWDSTabIdx is the index in WdsTab.MacTab
UINT MatchWDSTabIdx;
UCHAR MaxSupportedRate;
UCHAR CurrTxRate;
UCHAR CurrTxRateIndex;
// to record the each TX rate's quality. 0 is best, the bigger the worse.
USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH];
+// USHORT OneSecTxOkCount;
UINT32 OneSecTxNoRetryOkCount;
UINT32 OneSecTxRetryOkCount;
UINT32 OneSecTxFailCount;
@@ -2348,9 +1739,10 @@ typedef struct _MAC_TABLE_ENTRY {
UINT32 TXMCSSuccessful[16];
UINT32 TXMCSFailed[16];
UINT32 TXMCSAutoFallBack[16][16];
-#ifdef RT2870
+
ULONG LastBeaconRxTime;
-#endif
+
+ ULONG AssocDeadLine;
} MAC_TABLE_ENTRY, *PMAC_TABLE_ENTRY;
typedef struct _MAC_TABLE {
@@ -2362,134 +1754,20 @@ typedef struct _MAC_TABLE {
BOOLEAN fAnyStationInPsm;
BOOLEAN fAnyStationBadAtheros; // Check if any Station is atheros 802.11n Chip. We need to use RTS/CTS with Atheros 802,.11n chip.
BOOLEAN fAnyTxOPForceDisable; // Check if it is necessary to disable BE TxOP
-#ifdef RT2870
BOOLEAN fAllStationAsRalink; // Check if all stations are ralink-chipset
-#endif
BOOLEAN fAnyStationIsLegacy; // Check if I use legacy rate to transmit to my BSS Station/
BOOLEAN fAnyStationNonGF; // Check if any Station can't support GF.
BOOLEAN fAnyStation20Only; // Check if any Station can't support GF.
BOOLEAN fAnyStationMIMOPSDynamic; // Check if any Station is MIMO Dynamic
BOOLEAN fAnyBASession; // Check if there is BA session. Force turn on RTS/CTS
+//2008/10/28: KH add to support Antenna power-saving of AP<--
+//2008/10/28: KH add to support Antenna power-saving of AP-->
} MAC_TABLE, *PMAC_TABLE;
-#define IS_HT_STA(_pMacEntry) \
- (_pMacEntry->MaxHTPhyMode.field.MODE >= MODE_HTMIX)
-#define IS_HT_RATE(_pMacEntry) \
- (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
-#define PEER_IS_HT_RATE(_pMacEntry) \
- (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
-typedef struct _WDS_ENTRY {
- BOOLEAN Valid;
- UCHAR Addr[MAC_ADDR_LEN];
- ULONG NoDataIdleCount;
- struct _WDS_ENTRY *pNext;
-} WDS_ENTRY, *PWDS_ENTRY;
-typedef struct _WDS_TABLE_ENTRY {
- USHORT Size;
- UCHAR WdsAddr[MAC_ADDR_LEN];
- WDS_ENTRY *Hash[HASH_TABLE_SIZE];
- WDS_ENTRY Content[MAX_LEN_OF_MAC_TABLE];
- UCHAR MaxSupportedRate;
- UCHAR CurrTxRate;
- USHORT TxQuality[MAX_LEN_OF_SUPPORTED_RATES];
- USHORT OneSecTxOkCount;
- USHORT OneSecTxRetryOkCount;
- USHORT OneSecTxFailCount;
- ULONG CurrTxRateStableTime; // # of second in current TX rate
- UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
-} WDS_TABLE_ENTRY, *PWDS_TABLE_ENTRY;
-
-typedef struct _RT_802_11_WDS_ENTRY {
- PNET_DEV dev;
- UCHAR Valid;
- UCHAR PhyMode;
- UCHAR PeerWdsAddr[MAC_ADDR_LEN];
- UCHAR MacTabMatchWCID; // ASIC
- NDIS_802_11_WEP_STATUS WepStatus;
- UCHAR KeyIdx;
- CIPHER_KEY WdsKey;
- HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;
- RT_HT_PHY_INFO DesiredHtPhyInfo;
- BOOLEAN bAutoTxRateSwitch;
- DESIRED_TRANSMIT_SETTING DesiredTransmitSetting; // Desired transmit setting.
-} RT_802_11_WDS_ENTRY, *PRT_802_11_WDS_ENTRY;
-
-typedef struct _WDS_TABLE {
- UCHAR Mode;
- ULONG Size;
- RT_802_11_WDS_ENTRY WdsEntry[MAX_WDS_ENTRY];
-} WDS_TABLE, *PWDS_TABLE;
-
-typedef struct _APCLI_STRUCT {
- PNET_DEV dev;
-#ifdef RTL865X_SOC
- unsigned int mylinkid;
-#endif
- BOOLEAN Enable; // Set it as 1 if the apcli interface was configured to "1" or by iwpriv cmd "ApCliEnable"
- BOOLEAN Valid; // Set it as 1 if the apcli interface associated success to remote AP.
- UCHAR MacTabWCID; //WCID value, which point to the entry of ASIC Mac table.
- UCHAR SsidLen;
- CHAR Ssid[MAX_LEN_OF_SSID];
-
- UCHAR CfgSsidLen;
- CHAR CfgSsid[MAX_LEN_OF_SSID];
- UCHAR CfgApCliBssid[ETH_LENGTH_OF_ADDRESS];
- UCHAR CurrentAddress[ETH_LENGTH_OF_ADDRESS];
-
- ULONG ApCliRcvBeaconTime;
-
- ULONG CtrlCurrState;
- ULONG SyncCurrState;
- ULONG AuthCurrState;
- ULONG AssocCurrState;
- ULONG WpaPskCurrState;
-
- USHORT AuthReqCnt;
- USHORT AssocReqCnt;
-
- ULONG ClientStatusFlags;
- UCHAR MpduDensity;
-
- NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
- NDIS_802_11_WEP_STATUS WepStatus;
-
- // Add to support different cipher suite for WPA2/WPA mode
- NDIS_802_11_ENCRYPTION_STATUS GroupCipher; // Multicast cipher suite
- NDIS_802_11_ENCRYPTION_STATUS PairCipher; // Unicast cipher suite
- BOOLEAN bMixCipher; // Indicate current Pair & Group use different cipher suites
- USHORT RsnCapability;
-
- UCHAR PSK[100]; // reserve PSK key material
- UCHAR PSKLen;
- UCHAR PMK[32]; // WPA PSK mode PMK
- UCHAR GTK[32]; // GTK from authenticator
-
- CIPHER_KEY SharedKey[SHARE_KEY_NUM];
- UCHAR DefaultKeyId;
-
- // store RSN_IE built by driver
- UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; // The content saved here should be convert to little-endian format.
- UCHAR RSNIE_Len;
-
- // For WPA countermeasures
- ULONG LastMicErrorTime; // record last MIC error time
- BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred.
-
- // For WPA-PSK supplicant state
- UCHAR SNonce[32]; // SNonce for WPA-PSK
- UCHAR GNonce[32]; // GNonce for WPA-PSK from authenticator
-
- HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;
- RT_HT_PHY_INFO DesiredHtPhyInfo;
- BOOLEAN bAutoTxRateSwitch;
- DESIRED_TRANSMIT_SETTING DesiredTransmitSetting; // Desired transmit setting.
-} APCLI_STRUCT, *PAPCLI_STRUCT;
-
-// ----------- end of AP ----------------------------
struct wificonf
{
@@ -2498,48 +1776,72 @@ struct wificonf
};
-
-
-typedef struct _INF_PCI_CONFIG
+typedef struct _RTMP_DEV_INFO_
{
- PUCHAR CSRBaseAddress; // PCI MMIO Base Address, all access will use
-}INF_PCI_CONFIG;
+ UCHAR chipName[16];
+ RTMP_INF_TYPE infType;
+}RTMP_DEV_INFO;
-typedef struct _INF_USB_CONFIG
-{
- UINT BulkInEpAddr; // bulk-in endpoint address
- UINT BulkOutEpAddr[6]; // bulk-out endpoint address
-}INF_USB_CONFIG;
+struct _RTMP_CHIP_OP_
+{
+ /* Calibration access related callback functions */
+ int (*eeinit)(RTMP_ADAPTER *pAd); /* int (*eeinit)(RTMP_ADAPTER *pAd); */
+ int (*eeread)(RTMP_ADAPTER *pAd, USHORT offset, PUSHORT pValue); /* int (*eeread)(RTMP_ADAPTER *pAd, int offset, PUSHORT pValue); */
+ int (*eewrite)(RTMP_ADAPTER *pAd, USHORT offset, USHORT value);; /* int (*eewrite)(RTMP_ADAPTER *pAd, int offset, USHORT value); */
+
+ /* MCU related callback functions */
+ int (*loadFirmware)(RTMP_ADAPTER *pAd); /* int (*loadFirmware)(RTMP_ADAPTER *pAd); */
+ int (*eraseFirmware)(RTMP_ADAPTER *pAd); /* int (*eraseFirmware)(RTMP_ADAPTER *pAd); */
+ int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1);; /* int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1); */
+
+ /* RF access related callback functions */
+ REG_PAIR *pRFRegTable;
+ void (*AsicRfInit)(RTMP_ADAPTER *pAd);
+ void (*AsicRfTurnOn)(RTMP_ADAPTER *pAd);
+ void (*AsicRfTurnOff)(RTMP_ADAPTER *pAd);
+ void (*AsicReverseRfFromSleepMode)(RTMP_ADAPTER *pAd);
+ void (*AsicHaltAction)(RTMP_ADAPTER *pAd);
+};
+
//
// The miniport adapter structure
//
-typedef struct _RTMP_ADAPTER
+struct _RTMP_ADAPTER
{
PVOID OS_Cookie; // save specific structure relative to OS
PNET_DEV net_dev;
ULONG VirtualIfCnt;
-#ifdef RT2860
+ RTMP_CHIP_OP chipOps;
+ USHORT ThisTbttNumToNextWakeUp;
+
+#ifdef RTMP_MAC_PCI
+/*****************************************************************************************/
+/* PCI related parameters */
+/*****************************************************************************************/
+ PUCHAR CSRBaseAddress; // PCI MMIO Base Address, all access will use
+ unsigned int irq_num;
+
USHORT LnkCtrlBitMask;
USHORT RLnkCtrlConfiguration;
USHORT RLnkCtrlOffset;
USHORT HostLnkCtrlConfiguration;
USHORT HostLnkCtrlOffset;
USHORT PCIePowerSaveLevel;
+ ULONG Rt3xxHostLinkCtrl; // USed for 3090F chip
+ ULONG Rt3xxRalinkLinkCtrl; // USed for 3090F chip
+ USHORT DeviceID; // Read from PCI config
+ ULONG AccessBBPFailCount;
BOOLEAN bPCIclkOff; // flag that indicate if the PICE power status in Configuration SPace..
- ULONG CheckDmaBusyCount; // Check Interrupt Status Register Count.
- USHORT ThisTbttNumToNextWakeUp;
- ULONG SameRxByteCount;
-
+ BOOLEAN bPCIclkOffDisableTx; //
-/*****************************************************************************************/
-/* PCI related parameters */
-/*****************************************************************************************/
- PUCHAR CSRBaseAddress; // PCI MMIO Base Address, all access will use
+ BOOLEAN brt30xxBanMcuCmd; //when = 0xff means all commands are ok to set .
+ BOOLEAN b3090ESpecialChip; //3090E special chip that write EEPROM 0x24=0x9280.
+ ULONG CheckDmaBusyCount; // Check Interrupt Status Register Count.
UINT int_enable_reg;
UINT int_disable_mask;
@@ -2550,12 +1852,13 @@ typedef struct _RTMP_ADAPTER
RTMP_DMABUF RxDescRing; // Shared memory for RX descriptors
RTMP_DMABUF TxDescRing[NUM_OF_TX_RING]; // Shared memory for Tx descriptors
RTMP_TX_RING TxRing[NUM_OF_TX_RING]; // AC0~4 + HCCA
-#endif
+#endif // RTMP_MAC_PCI //
+
NDIS_SPIN_LOCK irq_lock;
UCHAR irq_disabled;
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
/*****************************************************************************************/
/* USB related parameters */
/*****************************************************************************************/
@@ -2572,34 +1875,38 @@ typedef struct _RTMP_ADAPTER
ULONG BulkFlags;
BOOLEAN bUsbTxBulkAggre; // Flags for bulk out data priority
-
- //======Timer Thread
- RT2870_TIMER_QUEUE TimerQ;
- NDIS_SPIN_LOCK TimerQLock;
-
-
//======Cmd Thread
CmdQ CmdQ;
NDIS_SPIN_LOCK CmdQLock; // CmdQLock spinlock
-
- BOOLEAN TimerFunc_kill;
- BOOLEAN mlme_kill;
-
+ RTMP_OS_TASK cmdQTask;
//======Semaphores (event)
- struct semaphore mlme_semaphore; /* to sleep thread on */
- struct semaphore RTUSBCmd_semaphore; /* to sleep thread on */
- struct semaphore RTUSBTimer_semaphore;
- struct completion TimerQComplete;
- struct completion mlmeComplete;
- struct completion CmdQComplete;
+ RTMP_OS_SEM UsbVendorReq_semaphore;
+ PVOID UsbVendorReqBuf;
wait_queue_head_t *wait;
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
+
+/*****************************************************************************************/
+/* RBUS related parameters */
+/*****************************************************************************************/
/*****************************************************************************************/
- /* Both PCI/USB related parameters */
+/* Both PCI/USB related parameters */
+/*****************************************************************************************/
+ //RTMP_DEV_INFO chipInfo;
+ RTMP_INF_TYPE infType;
+
+/*****************************************************************************************/
+/* Driver Mgmt related parameters */
/*****************************************************************************************/
+ RTMP_OS_TASK mlmeTask;
+#ifdef RTMP_TIMER_TASK_SUPPORT
+ // If you want use timer task to handle the timer related jobs, enable this.
+ RTMP_TIMER_TASK_QUEUE TimerQ;
+ NDIS_SPIN_LOCK TimerQLock;
+ RTMP_OS_TASK timerTask;
+#endif // RTMP_TIMER_TASK_SUPPORT //
/*****************************************************************************************/
@@ -2608,7 +1915,7 @@ typedef struct _RTMP_ADAPTER
BOOLEAN DeQueueRunning[NUM_OF_TX_RING]; // for ensuring RTUSBDeQueuePacket get call once
NDIS_SPIN_LOCK DeQueueLock[NUM_OF_TX_RING];
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
// Data related context and AC specified, 4 AC supported
NDIS_SPIN_LOCK BulkOutLock[6]; // BulkOut spinlock for 4 ACs
NDIS_SPIN_LOCK MLMEBulkOutLock; // MLME BulkOut lock
@@ -2623,7 +1930,7 @@ typedef struct _RTMP_ADAPTER
UCHAR bulkResetPipeid;
BOOLEAN MgmtBulkPending;
ULONG bulkResetReq[6];
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// resource for software backlog queues
QUEUE_HEADER TxSwQueue[NUM_OF_TX_RING]; // 4 AC + 1 HCCA
@@ -2637,21 +1944,24 @@ typedef struct _RTMP_ADAPTER
/*****************************************************************************************/
/* Rx related parameters */
/*****************************************************************************************/
-#ifdef RT2860
+
+#ifdef RTMP_MAC_PCI
RTMP_RX_RING RxRing;
NDIS_SPIN_LOCK RxRingLock; // Rx Ring spinlock
-#endif
-#ifdef RT2870
+#ifdef RT3090
+ NDIS_SPIN_LOCK McuCmdLock; //MCU Command Queue spinlock
+#endif // RT3090 //
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
RX_CONTEXT RxContext[RX_RING_SIZE]; // 1 for redundant multiple IRP bulk in.
NDIS_SPIN_LOCK BulkInLock; // BulkIn spinlock for 4 ACs
- UCHAR PendingRx; // The Maxima pending Rx value should be RX_RING_SIZE.
+ UCHAR PendingRx; // The Maximum pending Rx value should be RX_RING_SIZE.
UCHAR NextRxBulkInIndex; // Indicate the current RxContext Index which hold by Host controller.
UCHAR NextRxBulkInReadIndex; // Indicate the current RxContext Index which driver can read & process it.
ULONG NextRxBulkInPosition; // Want to contatenate 2 URB buffer while 1st is bulkin failed URB. This Position is 1st URB TransferLength.
ULONG TransferBufferLength; // current length of the packet buffer
ULONG ReadPosition; // current read position in a packet buffer
-#endif // RT2870 //
-
+#endif // RTMP_MAC_USB //
/*****************************************************************************************/
/* ASIC related parameters */
@@ -2662,18 +1972,18 @@ typedef struct _RTMP_ADAPTER
// E2PROM
// ---------------------------
ULONG EepromVersion; // byte 0: version, byte 1: revision, byte 2~3: unused
- UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
+ ULONG FirmwareVersion; // byte 0: Minor version, byte 1: Major version, otherwise unused.
USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
-#ifdef RT2870
+ UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
BOOLEAN EepromAccess;
-#endif
- ULONG FirmwareVersion; // byte 0: Minor version, byte 1: Major version, otherwise unused.
+ UCHAR EFuseTag;
+
// ---------------------------
// BBP Control
// ---------------------------
UCHAR BbpWriteLatch[140]; // record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID
- UCHAR BbpRssiToDbmDelta;
+ CHAR BbpRssiToDbmDelta; // change from UCHAR to CHAR for high power
BBP_R66_TUNING BbpTuning;
// ----------------------------
@@ -2718,23 +2028,26 @@ typedef struct _RTMP_ADAPTER
UCHAR TxAgcStepG; // Store Tx TSSI delta increment / decrement value
CHAR TxAgcCompensateG; // Store the compensation (TxAgcStep * (idx-1))
- //+++For RT2870, the parameteres is start from BGRssiOffset1 ~ BGRssiOffset3
CHAR BGRssiOffset0; // Store B/G RSSI#0 Offset value on EEPROM 0x46h
CHAR BGRssiOffset1; // Store B/G RSSI#1 Offset value
CHAR BGRssiOffset2; // Store B/G RSSI#2 Offset value
- //---
- //+++For RT2870, the parameteres is start from ARssiOffset1 ~ ARssiOffset3
CHAR ARssiOffset0; // Store A RSSI#0 Offset value on EEPROM 0x4Ah
CHAR ARssiOffset1; // Store A RSSI#1 Offset value
CHAR ARssiOffset2; // Store A RSSI#2 Offset value
- //---
CHAR BLNAGain; // Store B/G external LNA#0 value on EEPROM 0x44h
CHAR ALNAGain0; // Store A external LNA#0 value for ch36~64
CHAR ALNAGain1; // Store A external LNA#1 value for ch100~128
CHAR ALNAGain2; // Store A external LNA#2 value for ch132~165
-
+#ifdef RT30xx
+ // for 3572
+ UCHAR Bbp25;
+ UCHAR Bbp26;
+
+ UCHAR TxMixerGain24G; // Tx mixer gain value from EEPROM to improve Tx EVM / Tx DAC, 2.4G
+ UCHAR TxMixerGain5G;
+#endif // RT30xx //
// ----------------------------
// LED control
// ----------------------------
@@ -2742,7 +2055,7 @@ typedef struct _RTMP_ADAPTER
USHORT Led1; // read from EEPROM 0x3c
USHORT Led2; // EEPROM 0x3e
USHORT Led3; // EEPROM 0x40
- UCHAR LedIndicatorStregth;
+ UCHAR LedIndicatorStrength;
UCHAR RssiSingalstrengthOffet;
BOOLEAN bLedOnScanning;
UCHAR LedStatus;
@@ -2759,20 +2072,17 @@ typedef struct _RTMP_ADAPTER
PSPOLL_FRAME PsPollFrame;
HEADER_802_11 NullFrame;
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
TX_CONTEXT BeaconContext[BEACON_RING_SIZE];
TX_CONTEXT NullContext;
TX_CONTEXT PsPollContext;
TX_CONTEXT RTSContext;
-#endif // RT2870 //
-
-
+#endif // RTMP_MAC_USB //
//=========AP===========
//=======STA===========
-/* Modified by Wu Xi-Kun 4/21/2006 */
// -----------------------------------------------
// STA specific configuration & operation status
// used only when pAd->OpMode == OPMODE_STA
@@ -2789,6 +2099,8 @@ typedef struct _RTMP_ADAPTER
NDIS_MEDIA_STATE IndicateMediaState; // Base on Indication state, default is NdisMediaStateDisConnected
+ /* MAT related parameters */
+
// configuration: read from Registry & E2PROM
BOOLEAN bLocalAdminMAC; // Use user changed MAC
UCHAR PermanentAddress[MAC_ADDR_LEN]; // Factory default MAC address
@@ -2828,9 +2140,7 @@ typedef struct _RTMP_ADAPTER
// flags, see fRTMP_ADAPTER_xxx flags
ULONG Flags; // Represent current device status
-#ifdef RT2860
ULONG PSFlags; // Power Save operation flag.
-#endif
// current TX sequence #
USHORT Sequence;
@@ -2863,40 +2173,40 @@ typedef struct _RTMP_ADAPTER
/*****************************************************************************************/
/* Statistic related parameters */
/*****************************************************************************************/
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
ULONG BulkOutDataOneSecCount;
ULONG BulkInDataOneSecCount;
ULONG BulkLastOneSecCount; // BulkOutDataOneSecCount + BulkInDataOneSecCount
ULONG watchDogRxCnt;
ULONG watchDogRxOverFlowCnt;
ULONG watchDogTxPendingCnt[NUM_OF_TX_RING];
-#endif // RT2870 //
+ INT TransferedLength[NUM_OF_TX_RING];
+#endif // RTMP_MAC_USB //
BOOLEAN bUpdateBcnCntDone;
ULONG watchDogMacDeadlock; // prevent MAC/BBP into deadlock condition
// ----------------------------
// DEBUG paramerts
// ----------------------------
+ //ULONG DebugSetting[4];
BOOLEAN bBanAllBaSetup;
BOOLEAN bPromiscuous;
// ----------------------------
// rt2860c emulation-use Parameters
// ----------------------------
- ULONG rtsaccu[30];
- ULONG ctsaccu[30];
- ULONG cfendaccu[30];
- ULONG bacontent[16];
- ULONG rxint[RX_RING_SIZE+1];
- UCHAR rcvba[60];
+ //ULONG rtsaccu[30];
+ //ULONG ctsaccu[30];
+ //ULONG cfendaccu[30];
+ //ULONG bacontent[16];
+ //ULONG rxint[RX_RING_SIZE+1];
+ //UCHAR rcvba[60];
BOOLEAN bLinkAdapt;
BOOLEAN bForcePrintTX;
BOOLEAN bForcePrintRX;
- BOOLEAN bDisablescanning; //defined in RT2870 USB
+ //BOOLEAN bDisablescanning; //defined in RT2870 USB
BOOLEAN bStaFifoTest;
BOOLEAN bProtectionTest;
- BOOLEAN bHCCATest;
- BOOLEAN bGenOneHCCA;
BOOLEAN bBroadComHT;
//+++Following add from RT2870 USB.
ULONG BulkOutReq;
@@ -2914,9 +2224,15 @@ typedef struct _RTMP_ADAPTER
ULONG OneSecondnonBEpackets; // record non BE packets per second
+#ifdef LINUX
struct iw_statistics iw_stats;
struct net_device_stats stats;
+#endif // LINUX //
+
+
+
+
ULONG TbttTickCount;
#ifdef PCI_MSI_SUPPORT
@@ -2933,32 +2249,24 @@ typedef struct _RTMP_ADAPTER
+
+
+
+
+ UINT8 FlgCtsEnabled;
UINT8 PM_FlgSuspend;
-#ifdef RT2870
+#ifdef RT30xx
+#ifdef RTMP_EFUSE_SUPPORT
BOOLEAN bUseEfuse;
-#endif
-} RTMP_ADAPTER, *PRTMP_ADAPTER;
+ BOOLEAN bEEPROMFile;
+ BOOLEAN bFroceEEPROMBuffer;
+ UCHAR EEPROMImage[1024];
+#endif // RTMP_EFUSE_SUPPORT //
+#endif // RT30xx //
+};
+
-//
-// Cisco IAPP format
-//
-typedef struct _CISCO_IAPP_CONTENT_
-{
- USHORT Length; //IAPP Length
- UCHAR MessageType; //IAPP type
- UCHAR FunctionCode; //IAPP function type
- UCHAR DestinaionMAC[MAC_ADDR_LEN];
- UCHAR SourceMAC[MAC_ADDR_LEN];
- USHORT Tag; //Tag(element IE) - Adjacent AP report
- USHORT TagLength; //Length of element not including 4 byte header
- UCHAR OUI[4]; //0x00, 0x40, 0x96, 0x00
- UCHAR PreviousAP[MAC_ADDR_LEN]; //MAC Address of access point
- USHORT Channel;
- USHORT SsidLen;
- UCHAR Ssid[MAX_LEN_OF_SSID];
- USHORT Seconds; //Seconds that the client has been disassociated.
-} CISCO_IAPP_CONTENT, *PCISCO_IAPP_CONTENT;
#define DELAYINTMASK 0x0003fffb
#define INTMASK 0x0003fffb
@@ -2976,8 +2284,12 @@ typedef struct _CISCO_IAPP_CONTENT_
#define FifoStaFullInt 0x00002000 // fifo statistics full interrupt
+/***************************************************************************
+ * Rx Path software control block related data structures
+ **************************************************************************/
typedef struct _RX_BLK_
{
+// RXD_STRUC RxD; // sample
RT28XX_RXD_STRUC RxD;
PRXWI_STRUC pRxWI;
PHEADER_802_11 pHeader;
@@ -3012,6 +2324,10 @@ typedef struct _RX_BLK_
#define LENGTH_ARALINK_SUBFRAMEHEAD 14
#define LENGTH_ARALINK_HEADER_FIELD 2
+
+/***************************************************************************
+ * Tx Path software control block related data structures
+ **************************************************************************/
#define TX_UNKOWN_FRAME 0x00
#define TX_MCAST_FRAME 0x01
#define TX_LEGACY_FRAME 0x02
@@ -3040,7 +2356,10 @@ typedef struct _TX_BLK_
PUCHAR pSrcBufData; // Reference to the sk_buff->data, will changed depends on hanlding progresss
UINT SrcBufLen; // Length of packet payload which not including Layer 2 header
PUCHAR pExtraLlcSnapEncap; // NULL means no extra LLC/SNAP is required
- UCHAR HeaderBuf[80]; // TempBuffer for TX_INFO + TX_WI + 802.11 Header + padding + AMSDU SubHeader + LLC/SNAP
+ UCHAR HeaderBuf[128]; // TempBuffer for TX_INFO + TX_WI + 802.11 Header + padding + AMSDU SubHeader + LLC/SNAP
+ //RT2870 2.1.0.0 uses only 80 bytes
+ //RT3070 2.1.1.0 uses only 96 bytes
+ //RT3090 2.1.0.0 uses only 96 bytes
UCHAR MpduHeaderLen; // 802.11 header length NOT including the padding
UCHAR HdrPadLen; // recording Header Padding Length;
UCHAR apidx; // The interface associated to this packet
@@ -3069,17 +2388,8 @@ typedef struct _TX_BLK_
#define fTX_bAllowFrag 0x0020 // allow to fragment the packet, A-MPDU, A-MSDU, A-Ralink is not allowed to fragment
#define fTX_bMoreData 0x0040 // there are more data packets in PowerSave Queue
#define fTX_bWMM 0x0080 // QOS Data
-
#define fTX_bClearEAPFrame 0x0100
-#define TX_BLK_ASSIGN_FLAG(_pTxBlk, _flag, value) \
- do { \
- if (value) \
- (_pTxBlk->Flags |= _flag) \
- else \
- (_pTxBlk->Flags &= ~(_flag)) \
- }while(0)
-
#define TX_BLK_SET_FLAG(_pTxBlk, _flag) (_pTxBlk->Flags |= _flag)
#define TX_BLK_TEST_FLAG(_pTxBlk, _flag) (((_pTxBlk->Flags & _flag) == _flag) ? 1 : 0)
#define TX_BLK_CLEAR_FLAG(_pTxBlk, _flag) (_pTxBlk->Flags &= ~(_flag))
@@ -3088,42 +2398,10 @@ typedef struct _TX_BLK_
-//------------------------------------------------------------------------------------------
-
-#ifdef RT2860
-//
-// Enable & Disable NIC interrupt via writing interrupt mask register
-// Since it use ADAPTER structure, it have to be put after structure definition.
-//
-__inline VOID NICDisableInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, 0x0); // 0: disable
- //RTMP_IO_WRITE32(pAd, PBF_INT_ENA, 0x0); // 0x418 is for firmware . SW doesn't handle here.
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE);
-}
-
-__inline VOID NICEnableInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- //
- // Flag "fOP_STATUS_DOZE" On, means ASIC put to sleep, else means ASIC WakeUp
- // To prevent System hang, we should enalbe the interrupt when
- // ASIC is already Wake Up.
- //
- // RT2661 => when ASIC is sleeping, MAC register cannot be read and written.
- // RT2860 => when ASIC is sleeping, MAC register can be read and written.
- //if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- RTMP_IO_WRITE32(pAd, INT_MASK_CSR, pAd->int_enable_reg /*DELAYINTMASK*/); // 1:enable
- }
- //else
- // DBGPRINT(RT_DEBUG_TRACE, ("fOP_STATUS_DOZE !\n"));
-
- //RTMP_IO_WRITE32(pAd, PBF_INT_ENA, 0x00000030); // 1 : enable
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE);
-}
+/***************************************************************************
+ * Other static inline function definitions
+ **************************************************************************/
static inline VOID ConvertMulticastIP2MAC(
IN PUCHAR pIpAddr,
IN PUCHAR *ppMacAddr,
@@ -3161,37 +2439,59 @@ static inline VOID ConvertMulticastIP2MAC(
return;
}
-#endif /* RT2860 */
+
+
+char *GetPhyMode(int Mode);
+char* GetBW(int BW);
//
// Private routines in rtmp_init.c
//
NDIS_STATUS RTMPAllocAdapterBlock(
IN PVOID handle,
- OUT PRTMP_ADAPTER *ppAdapter
- );
+ OUT PRTMP_ADAPTER *ppAdapter);
NDIS_STATUS RTMPAllocTxRxRingMemory(
- IN PRTMP_ADAPTER pAd
- );
+ IN PRTMP_ADAPTER pAd);
NDIS_STATUS RTMPReadParametersHook(
- IN PRTMP_ADAPTER pAd
- );
+ IN PRTMP_ADAPTER pAd);
+
+NDIS_STATUS RTMPSetProfileParameters(
+ IN RTMP_ADAPTER *pAd,
+ IN PSTRING pBuffer);
+
+INT RTMPGetKeyParameter(
+ IN PSTRING key,
+ OUT PSTRING dest,
+ IN INT destsize,
+ IN PSTRING buffer,
+ IN BOOLEAN bTrimSpace);
VOID RTMPFreeAdapter(
- IN PRTMP_ADAPTER pAd
- );
+ IN PRTMP_ADAPTER pAd);
NDIS_STATUS NICReadRegParameters(
IN PRTMP_ADAPTER pAd,
- IN NDIS_HANDLE WrapperConfigurationContext
- );
+ IN NDIS_HANDLE WrapperConfigurationContext);
-#ifdef RT2870
-VOID NICInitRT30xxRFRegisters(
+#ifdef RTMP_RF_RW_SUPPORT
+VOID NICInitRFRegisters(
IN PRTMP_ADAPTER pAd);
-#endif // RT2870 //
+
+VOID RtmpChipOpsRFHook(
+ IN RTMP_ADAPTER *pAd);
+
+NDIS_STATUS RT30xxWriteRFRegister(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR regID,
+ IN UCHAR value);
+
+NDIS_STATUS RT30xxReadRFRegister(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR regID,
+ IN PUCHAR pValue);
+#endif // RTMP_RF_RW_SUPPORT //
VOID NICReadEEPROMParameters(
IN PRTMP_ADAPTER pAd,
@@ -3200,8 +2500,6 @@ VOID NICReadEEPROMParameters(
VOID NICInitAsicFromEEPROM(
IN PRTMP_ADAPTER pAd);
-VOID NICInitTxRxRingAndBacklogQueue(
- IN PRTMP_ADAPTER pAd);
NDIS_STATUS NICInitializeAdapter(
IN PRTMP_ADAPTER pAd,
@@ -3210,10 +2508,7 @@ NDIS_STATUS NICInitializeAdapter(
NDIS_STATUS NICInitializeAsic(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bHardReset);
-#ifdef RT2860
-VOID NICRestoreBBPValue(
- IN PRTMP_ADAPTER pAd);
-#endif
+
VOID NICIssueReset(
IN PRTMP_ADAPTER pAd);
@@ -3227,10 +2522,10 @@ VOID UserCfgInit(
VOID NICResetFromError(
IN PRTMP_ADAPTER pAd);
-VOID NICEraseFirmware(
+NDIS_STATUS NICLoadFirmware(
IN PRTMP_ADAPTER pAd);
-NDIS_STATUS NICLoadFirmware(
+VOID NICEraseFirmware(
IN PRTMP_ADAPTER pAd);
NDIS_STATUS NICLoadRateSwitchingParams(
@@ -3245,10 +2540,6 @@ VOID NICUpdateFifoStaCounters(
VOID NICUpdateRawCounters(
IN PRTMP_ADAPTER pAd);
-ULONG RTMPNotAllZero(
- IN PVOID pSrc1,
- IN ULONG Length);
-
VOID RTMPZeroMemory(
IN PVOID pSrc,
IN ULONG Length);
@@ -3264,8 +2555,8 @@ VOID RTMPMoveMemory(
IN ULONG Length);
VOID AtoH(
- char *src,
- UCHAR *dest,
+ PSTRING src,
+ PUCHAR dest,
int destlen);
UCHAR BtoH(
@@ -3383,6 +2674,7 @@ VOID SendRefreshBAR(
IN PRTMP_ADAPTER pAd,
IN MAC_TABLE_ENTRY *pEntry);
+
VOID ActHeaderInit(
IN PRTMP_ADAPTER pAd,
IN OUT PHEADER_802_11 pHdr80211,
@@ -3444,6 +2736,7 @@ BOOLEAN PeerIsAggreOn(
IN ULONG TxRate,
IN PMAC_TABLE_ENTRY pMacEntry);
+
NDIS_STATUS Sniff2BytesFromNdisBuffer(
IN PNDIS_BUFFER pFirstBuffer,
IN UCHAR DesiredOffset,
@@ -3498,11 +2791,24 @@ NDIS_STATUS MlmeHardTransmitMgmtRing(
IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket);
+#ifdef RTMP_MAC_PCI
NDIS_STATUS MlmeHardTransmitTxRing(
IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx,
IN PNDIS_PACKET pPacket);
+NDIS_STATUS MlmeDataHardTransmit(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR QueIdx,
+ IN PNDIS_PACKET pPacket);
+
+VOID RTMPWriteTxDescriptor(
+ IN PRTMP_ADAPTER pAd,
+ IN PTXD_STRUC pTxD,
+ IN BOOLEAN bWIV,
+ IN UCHAR QSEL);
+#endif // RTMP_MAC_PCI //
+
USHORT RTMPCalcDuration(
IN PRTMP_ADAPTER pAd,
IN UCHAR Rate,
@@ -3539,12 +2845,6 @@ VOID RTMPWriteTxWI_Cache(
IN OUT PTXWI_STRUC pTxWI,
IN TX_BLK *pTxBlk);
-VOID RTMPWriteTxDescriptor(
- IN PRTMP_ADAPTER pAd,
- IN PTXD_STRUC pTxD,
- IN BOOLEAN bWIV,
- IN UCHAR QSEL);
-
VOID RTMPSuspendMsduTransmission(
IN PRTMP_ADAPTER pAd);
@@ -3557,6 +2857,9 @@ NDIS_STATUS MiniportMMRequest(
IN PUCHAR pData,
IN UINT Length);
+//+++mark by shiang, now this function merge to MiniportMMRequest()
+//---mark by shiang, now this function merge to MiniportMMRequest()
+
VOID RTMPSendNullFrame(
IN PRTMP_ADAPTER pAd,
IN UCHAR TxRate,
@@ -3593,6 +2896,12 @@ VOID WpaDisassocApAndBlockAssoc(
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
+VOID WpaStaPairwiseKeySetting(
+ IN PRTMP_ADAPTER pAd);
+
+VOID WpaStaGroupKeySetting(
+ IN PRTMP_ADAPTER pAd);
+
NDIS_STATUS RTMPCloneNdisPacket(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN pInsAMSDUHdr,
@@ -3713,6 +3022,9 @@ VOID AsicRfTuningExec(
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
+VOID AsicResetBBPAgent(
+ IN PRTMP_ADAPTER pAd);
+
VOID AsicSleepThenAutoWakeup(
IN PRTMP_ADAPTER pAd,
IN USHORT TbttNumToNextWakeUp);
@@ -3722,12 +3034,7 @@ VOID AsicForceSleep(
VOID AsicForceWakeup(
IN PRTMP_ADAPTER pAd,
-#ifdef RT2860
- IN UCHAR Level);
-#endif
-#ifdef RT2870
IN BOOLEAN bFromTx);
-#endif
VOID AsicSetBssid(
IN PRTMP_ADAPTER pAd,
@@ -3821,11 +3128,14 @@ BOOLEAN AsicSendCommandToMcu(
IN UCHAR Token,
IN UCHAR Arg0,
IN UCHAR Arg1);
-#ifdef RT2860
+
+
+#ifdef RTMP_MAC_PCI
BOOLEAN AsicCheckCommanOk(
IN PRTMP_ADAPTER pAd,
IN UCHAR Command);
-#endif
+#endif // RTMP_MAC_PCI //
+
VOID MacAddrRandomBssid(
IN PRTMP_ADAPTER pAd,
OUT PUCHAR pAddr);
@@ -3871,6 +3181,11 @@ ULONG BssTableSearchWithSSID(
IN UCHAR SsidLen,
IN UCHAR Channel);
+ULONG BssSsidTableSearchBySSID(
+ IN BSS_TABLE *Tab,
+ IN PUCHAR pSsid,
+ IN UCHAR SsidLen);
+
VOID BssTableDeleteEntry(
IN OUT PBSS_TABLE pTab,
IN PUCHAR pBssid,
@@ -4095,9 +3410,6 @@ VOID Cls3errAction(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pAddr);
-VOID SwitchBetweenWepAndCkip(
- IN PRTMP_ADAPTER pAd);
-
VOID InvalidStateWhenAssoc(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem);
@@ -4110,12 +3422,12 @@ VOID InvalidStateWhenDisassociate(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem);
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
VOID MlmeCntlConfirm(
IN PRTMP_ADAPTER pAd,
IN ULONG MsgType,
IN USHORT Msg);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
VOID ComposePsPoll(
IN PRTMP_ADAPTER pAd);
@@ -4325,7 +3637,7 @@ VOID AssocParmFill(
VOID ScanParmFill(
IN PRTMP_ADAPTER pAd,
IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
- IN CHAR Ssid[],
+ IN STRING Ssid[],
IN UCHAR SsidLen,
IN UCHAR BssType,
IN UCHAR ScanType);
@@ -4396,9 +3708,6 @@ VOID ScanNextChannel(
ULONG MakeIbssBeacon(
IN PRTMP_ADAPTER pAd);
-VOID CCXAdjacentAPReport(
- IN PRTMP_ADAPTER pAd);
-
BOOLEAN MlmeScanReqSanity(
IN PRTMP_ADAPTER pAd,
IN VOID *Msg,
@@ -4527,6 +3836,13 @@ BOOLEAN PeerDisassocSanity(
OUT PUCHAR pAddr2,
OUT USHORT *Reason);
+BOOLEAN PeerWpaMessageSanity(
+ IN PRTMP_ADAPTER pAd,
+ IN PEAPOL_PACKET pMsg,
+ IN ULONG MsgLen,
+ IN UCHAR MsgType,
+ IN MAC_TABLE_ENTRY *pEntry);
+
BOOLEAN PeerDeauthSanity(
IN PRTMP_ADAPTER pAd,
IN VOID *Msg,
@@ -4570,7 +3886,7 @@ BOOLEAN MlmeAddBAReqSanity(
OUT PUCHAR pAddr2);
ULONG MakeOutgoingFrame(
- OUT CHAR *Buffer,
+ OUT UCHAR *Buffer,
OUT ULONG *Length, ...);
VOID LfsrInit(
@@ -4613,9 +3929,8 @@ VOID MlmeCheckForRoaming(
IN PRTMP_ADAPTER pAd,
IN ULONG Now32);
-VOID MlmeCheckForFastRoaming(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now);
+BOOLEAN MlmeCheckForFastRoaming(
+ IN PRTMP_ADAPTER pAd);
VOID MlmeDynamicTxRateSwitching(
IN PRTMP_ADAPTER pAd);
@@ -4634,6 +3949,7 @@ VOID MlmeSelectTxRateTable(
VOID MlmeCalculateChannelQuality(
IN PRTMP_ADAPTER pAd,
+ IN PMAC_TABLE_ENTRY pMacEntry,
IN ULONG Now);
VOID MlmeCheckPsmChange(
@@ -4691,10 +4007,95 @@ CHAR RTMPMaxRssi(
IN CHAR Rssi1,
IN CHAR Rssi2);
+#ifdef RT30xx
VOID AsicSetRxAnt(
IN PRTMP_ADAPTER pAd,
IN UCHAR Ant);
+VOID RTMPFilterCalibration(
+ IN PRTMP_ADAPTER pAd);
+
+#ifdef RTMP_EFUSE_SUPPORT
+//2008/09/11:KH add to support efuse<--
+INT set_eFuseGetFreeBlockCount_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT set_eFusedump_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT set_eFuseLoadFromBin_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+VOID eFusePhysicalReadRegisters(
+ IN PRTMP_ADAPTER pAd,
+ IN USHORT Offset,
+ IN USHORT Length,
+ OUT USHORT* pData);
+
+int RtmpEfuseSupportCheck(
+ IN RTMP_ADAPTER *pAd);
+
+INT set_eFuseBufferModeWriteBack_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT eFuseLoadEEPROM(
+ IN PRTMP_ADAPTER pAd);
+
+INT eFuseWriteEeeppromBuf(
+ IN PRTMP_ADAPTER pAd);
+
+VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd,
+ PUINT EfuseFreeBlock);
+
+INT eFuse_init(
+ IN PRTMP_ADAPTER pAd);
+
+NTSTATUS eFuseRead(
+ IN PRTMP_ADAPTER pAd,
+ IN USHORT Offset,
+ OUT PUCHAR pData,
+ IN USHORT Length);
+
+NTSTATUS eFuseWrite(
+ IN PRTMP_ADAPTER pAd,
+ IN USHORT Offset,
+ IN PUCHAR pData,
+ IN USHORT length);
+//2008/09/11:KH add to support efuse-->
+#endif // RTMP_EFUSE_SUPPORT //
+
+// add by johnli, RF power sequence setup
+VOID RT30xxLoadRFNormalModeSetup(
+ IN PRTMP_ADAPTER pAd);
+
+VOID RT30xxLoadRFSleepModeSetup(
+ IN PRTMP_ADAPTER pAd);
+
+VOID RT30xxReverseRFSleepModeSetup(
+ IN PRTMP_ADAPTER pAd);
+// end johnli
+
+#ifdef RT3070
+VOID NICInitRT3070RFRegisters(
+ IN RTMP_ADAPTER *pAd);
+#endif // RT3070 //
+#ifdef RT3090
+VOID NICInitRT3090RFRegisters(
+ IN RTMP_ADAPTER *pAd);
+#endif // RT3090 //
+
+VOID RT30xxHaltAction(
+ IN PRTMP_ADAPTER pAd);
+
+VOID RT30xxSetRxAnt(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Ant);
+#endif // RT30xx //
+
VOID AsicEvaluateRxAnt(
IN PRTMP_ADAPTER pAd);
@@ -4751,15 +4152,6 @@ VOID ChangeToCellPowerLimit(
IN PRTMP_ADAPTER pAd,
IN UCHAR AironetCellPowerLimit);
-USHORT RTMP_EEPROM_READ16(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset);
-
-VOID RTMP_EEPROM_WRITE16(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Data);
-
//
// Prototypes of function definition in rtmp_tkip.c
//
@@ -4797,15 +4189,6 @@ VOID RTMPCalculateMICValue(
IN PCIPHER_KEY pKey,
IN UCHAR apidx);
-BOOLEAN RTMPTkipCompareMICValueWithLLC(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pLLC,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UINT Len);
-
VOID RTMPTkipAppendByte(
IN PTKIP_KEY_INFO pTkip,
IN UCHAR uChar);
@@ -4831,6 +4214,39 @@ BOOLEAN RTMPSoftDecryptAES(
IN ULONG DataByteCnt,
IN PCIPHER_KEY pWpaKey);
+
+
+//
+// Prototypes of function definition in cmm_info.c
+//
+INT RT_CfgSetCountryRegion(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg,
+ IN INT band);
+
+INT RT_CfgSetWirelessMode(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT RT_CfgSetShortSlot(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT RT_CfgSetWepKey(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING keyString,
+ IN CIPHER_KEY *pSharedKey,
+ IN INT keyIdx);
+
+INT RT_CfgSetWPAPSKKey(
+ IN RTMP_ADAPTER *pAd,
+ IN PSTRING keyString,
+ IN UCHAR *pHashStr,
+ IN INT hashStrLen,
+ OUT PUCHAR pPMKBuf);
+
+
+
//
// Prototypes of function definition in cmm_info.c
//
@@ -4862,26 +4278,12 @@ VOID RTMPAddWcidAttributeEntry(
IN UCHAR CipherAlg,
IN MAC_TABLE_ENTRY *pEntry);
-CHAR *GetEncryptType(
+PSTRING GetEncryptType(
CHAR enc);
-CHAR *GetAuthMode(
+PSTRING GetAuthMode(
CHAR auth);
-VOID RTMPIoctlGetSiteSurvey(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlGetMacTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPAddBSSIDCipher(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Aid,
- IN PNDIS_802_11_KEY pKey,
- IN UCHAR CipherAlg);
-
VOID RTMPSetHT(
IN PRTMP_ADAPTER pAd,
IN OID_SET_HT_PHYMODE *pHTPhyMode);
@@ -4897,88 +4299,24 @@ VOID RTMPSendWirelessEvent(
IN UCHAR BssIdx,
IN CHAR Rssi);
-//
-// prototype in wpa.c
-//
-BOOLEAN WpaMsgTypeSubst(
- IN UCHAR EAPType,
- OUT INT *MsgType);
-
-VOID WpaPskStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID WpaEAPOLKeyAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID WpaPairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID WpaPairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID WpaGroupMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID WpaMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR wep,
- IN PUCHAR pAddr1);
-
-VOID Wpa2PairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID Wpa2PairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-BOOLEAN ParseKeyData(
+CHAR ConvertToRssi(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKeyData,
- IN UCHAR KeyDataLen,
- IN UCHAR bPairewise);
+ IN CHAR Rssi,
+ IN UCHAR RssiNumber);
+/*===================================
+ Function prototype in cmm_wpa.c
+ =================================== */
VOID RTMPToWirelessSta(
IN PRTMP_ADAPTER pAd,
+ IN PMAC_TABLE_ENTRY pEntry,
IN PUCHAR pHeader802_3,
IN UINT HdrLen,
IN PUCHAR pData,
IN UINT DataLen,
- IN BOOLEAN is4wayFrame);
-
-VOID HMAC_SHA1(
- IN UCHAR *text,
- IN UINT text_len,
- IN UCHAR *key,
- IN UINT key_len,
- IN UCHAR *digest);
+ IN BOOLEAN bClearFrame);
-VOID PRF(
- IN UCHAR *key,
- IN INT key_len,
- IN UCHAR *prefix,
- IN INT prefix_len,
- IN UCHAR *data,
- IN INT data_len,
- OUT UCHAR *output,
- IN INT len);
-
-VOID CCKMPRF(
- IN UCHAR *key,
- IN INT key_len,
- IN UCHAR *data,
- IN INT data_len,
- OUT UCHAR *output,
- IN INT len);
-
-VOID WpaCountPTK(
+VOID WpaDerivePTK(
IN PRTMP_ADAPTER pAd,
IN UCHAR *PMK,
IN UCHAR *ANonce,
@@ -4993,95 +4331,129 @@ VOID GenRandom(
IN UCHAR *macAddr,
OUT UCHAR *random);
-//
-// prototype in aironet.c
-//
-VOID AironetStateMachineInit(
+BOOLEAN RTMPCheckWPAframe(
IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[]);
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN PUCHAR pData,
+ IN ULONG DataByteCount,
+ IN UCHAR FromWhichBSSID);
-VOID AironetMsgAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
+VOID AES_GTK_KEY_UNWRAP(
+ IN UCHAR *key,
+ OUT UCHAR *plaintext,
+ IN UINT32 c_len,
+ IN UCHAR *ciphertext);
-VOID AironetRequestAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
+BOOLEAN RTMPParseEapolKeyData(
+ IN PRTMP_ADAPTER pAd,
+ IN PUCHAR pKeyData,
+ IN UCHAR KeyDataLen,
+ IN UCHAR GroupKeyIndex,
+ IN UCHAR MsgType,
+ IN BOOLEAN bWPA2,
+ IN MAC_TABLE_ENTRY *pEntry);
+
+VOID ConstructEapolMsg(
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN UCHAR GroupKeyWepStatus,
+ IN UCHAR MsgType,
+ IN UCHAR DefaultKeyIdx,
+ IN UCHAR *KeyNonce,
+ IN UCHAR *TxRSC,
+ IN UCHAR *GTK,
+ IN UCHAR *RSNIE,
+ IN UCHAR RSNIE_Len,
+ OUT PEAPOL_PACKET pMsg);
+
+NDIS_STATUS RTMPSoftDecryptBroadCastData(
+ IN PRTMP_ADAPTER pAd,
+ IN RX_BLK *pRxBlk,
+ IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher,
+ IN PCIPHER_KEY pShard_key);
-VOID ChannelLoadRequestAction(
+VOID RTMPMakeRSNIE(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN UINT AuthMode,
+ IN UINT WepStatus,
+ IN UCHAR apidx);
-VOID NoiseHistRequestAction(
+//
+// function prototype in ap_wpa.c
+//
+VOID RTMPGetTxTscFromAsic(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN UCHAR apidx,
+ OUT PUCHAR pTxTsc);
-VOID BeaconRequestAction(
+VOID APInstallPairwiseKey(
+ PRTMP_ADAPTER pAd,
+ PMAC_TABLE_ENTRY pEntry);
+
+UINT APValidateRSNIE(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN PUCHAR pRsnIe,
+ IN UCHAR rsnie_len);
-VOID AironetReportAction(
+VOID HandleCounterMeasure(
IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
+ IN MAC_TABLE_ENTRY *pEntry);
-VOID ChannelLoadReportAction(
+VOID WPAStart4WayHS(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN ULONG TimeInterval);
-VOID NoiseHistReportAction(
+VOID WPAStart2WayGroupHS(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN MAC_TABLE_ENTRY *pEntry);
-VOID AironetFinalReportAction(
- IN PRTMP_ADAPTER pAd);
+VOID PeerPairMsg1Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem);
-VOID BeaconReportAction(
+VOID PeerPairMsg2Action(
IN PRTMP_ADAPTER pAd,
- IN UCHAR Index);
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem);
-VOID AironetAddBeaconReport(
+VOID PeerPairMsg3Action(
IN PRTMP_ADAPTER pAd,
- IN ULONG Index,
- IN PMLME_QUEUE_ELEM pElem);
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem);
-VOID AironetCreateBeaconReportFromBssTable(
- IN PRTMP_ADAPTER pAd);
+VOID PeerPairMsg4Action(
+ IN PRTMP_ADAPTER pAd,
+ IN MAC_TABLE_ENTRY *pEntry,
+ IN MLME_QUEUE_ELEM *Elem);
-CHAR ConvertToRssi(
+VOID PeerGroupMsg1Action(
IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi,
- IN UCHAR RssiNumber);
+ IN PMAC_TABLE_ENTRY pEntry,
+ IN MLME_QUEUE_ELEM *Elem);
-//
-// function prototype in cmm_wpa.c
-//
-BOOLEAN RTMPCheckWPAframe(
+VOID PeerGroupMsg2Action(
IN PRTMP_ADAPTER pAd,
IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pData,
- IN ULONG DataByteCount,
- IN UCHAR FromWhichBSSID);
+ IN VOID *Msg,
+ IN UINT MsgLen);
-VOID AES_GTK_KEY_UNWRAP(
- IN UCHAR *key,
- OUT UCHAR *plaintext,
- IN UCHAR c_len,
- IN UCHAR *ciphertext);
+VOID WpaDeriveGTK(
+ IN UCHAR *PMK,
+ IN UCHAR *GNonce,
+ IN UCHAR *AA,
+ OUT UCHAR *output,
+ IN UINT len);
-VOID RTMPMakeRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN UINT AuthMode,
- IN UINT WepStatus,
- IN UCHAR apidx);
+VOID AES_GTK_KEY_WRAP(
+ IN UCHAR *key,
+ IN UCHAR *plaintext,
+ IN UINT32 p_len,
+ OUT UCHAR *ciphertext);
-//
-// function prototype in ap_wpa.c
-//
+//typedef void (*TIMER_FUNCTION)(unsigned long);
-VOID HandleCounterMeasure(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
/* timeout -- ms */
VOID RTMP_SetPeriodicTimer(
@@ -5116,13 +4488,13 @@ VOID RTMPusecDelay(
IN ULONG usec);
NDIS_STATUS os_alloc_mem(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR *mem,
+ IN RTMP_ADAPTER *pAd,
+ OUT UCHAR **mem,
IN ULONG size);
NDIS_STATUS os_free_mem(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR mem);
+ IN PVOID mem);
void RTMP_AllocateSharedMemory(
@@ -5155,6 +4527,13 @@ void RTMP_AllocateFirstTxBuffer(
OUT PVOID *VirtualAddress,
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
+void RTMP_FreeFirstTxBuffer(
+ IN PRTMP_ADAPTER pAd,
+ IN ULONG Length,
+ IN BOOLEAN Cached,
+ IN PVOID VirtualAddress,
+ IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
+
void RTMP_AllocateMgmtDescMemory(
IN PRTMP_ADAPTER pAd,
IN ULONG Length,
@@ -5169,6 +4548,16 @@ void RTMP_AllocateRxDescMemory(
OUT PVOID *VirtualAddress,
OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
+void RTMP_FreeDescMemory(
+ IN PRTMP_ADAPTER pAd,
+ IN ULONG Length,
+ IN PVOID VirtualAddress,
+ IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
+
+PNDIS_PACKET RtmpOSNetPktAlloc(
+ IN RTMP_ADAPTER *pAd,
+ IN int size);
+
PNDIS_PACKET RTMP_AllocateRxPacketBuffer(
IN PRTMP_ADAPTER pAd,
IN ULONG Length,
@@ -5279,203 +4668,210 @@ VOID BARecSessionTearDown(
BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num);
void ba_reordering_resource_release(PRTMP_ADAPTER pAd);
+
+
+
BOOLEAN rtstrmactohex(
- IN char *s1,
- IN char *s2);
+ IN PSTRING s1,
+ IN PSTRING s2);
BOOLEAN rtstrcasecmp(
- IN char *s1,
- IN char *s2);
+ IN PSTRING s1,
+ IN PSTRING s2);
-char *rtstrstruncasecmp(
- IN char *s1,
- IN char *s2);
+PSTRING rtstrstruncasecmp(
+ IN PSTRING s1,
+ IN PSTRING s2);
-char *rtstrstr(
- IN const char * s1,
- IN const char * s2);
+PSTRING rtstrstr(
+ IN const PSTRING s1,
+ IN const PSTRING s2);
-char *rstrtok(
- IN char * s,
- IN const char * ct);
+PSTRING rstrtok(
+ IN PSTRING s,
+ IN const PSTRING ct);
int rtinet_aton(
- const char *cp,
+ const PSTRING cp,
unsigned int *addr);
////////// common ioctl functions //////////
INT Set_DriverVersion_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_CountryRegion_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_CountryRegionABand_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_WirelessMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_Channel_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_ShortSlot_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_TxPower_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_BGProtection_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_TxPreamble_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_RTSThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_FragThreshold_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_TxBurst_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
#ifdef AGGREGATION_SUPPORT
INT Set_PktAggregate_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-#endif
+ IN PSTRING arg);
+#endif // AGGREGATION_SUPPORT //
INT Set_IEEE80211H_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
#ifdef DBG
INT Set_Debug_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
#endif
INT Show_DescInfo_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_ResetStatCounter_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_BASetup_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_BADecline_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_BAOriTearDown_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_BARecTearDown_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtBw_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtMcs_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtGi_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtOpMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtStbc_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtHtc_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtExtcha_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtMpduDensity_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtBaWinSize_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtRdg_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtLinkAdapt_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtAmsdu_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtAutoBa_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtProtect_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtMimoPs_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_ForceShortGI_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_ForceGF_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT SetCommonHT(
IN PRTMP_ADAPTER pAd);
INT Set_SendPSMPAction_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtMIMOPSmode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_HtTxBASize_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
+
+INT Set_HtDisallowTKIP_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
INT WpaCheckEapCode(
IN PRTMP_ADAPTER pAd,
@@ -5528,12 +4924,6 @@ void wlan_802_11_to_802_3_packet(
IN PUCHAR pHeader802_3,
IN UCHAR FromWhichBSSID);
-UINT deaggregate_AMSDU_announce(
- IN PRTMP_ADAPTER pAd,
- PNDIS_PACKET pPacket,
- IN PUCHAR pData,
- IN ULONG DataSize);
-
// remove LLC and get 802_3 Header
#define RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(_pRxBlk, _pHeader802_3) \
{ \
@@ -5604,11 +4994,28 @@ VOID Update_Rssi_Sample(
IN RSSI_SAMPLE *pRssi,
IN PRXWI_STRUC pRxWI);
+PNDIS_PACKET GetPacketFromRxRing(
+ IN PRTMP_ADAPTER pAd,
+ OUT PRT28XX_RXD_STRUC pSaveRxD,
+ OUT BOOLEAN *pbReschedule,
+ IN OUT UINT32 *pRxPending);
+
PNDIS_PACKET RTMPDeFragmentDataFrame(
IN PRTMP_ADAPTER pAd,
IN RX_BLK *pRxBlk);
////////////////////////////////////////
+
+VOID RTMPIoctlGetSiteSurvey(
+ IN PRTMP_ADAPTER pAdapter,
+ IN struct iwreq *wrq);
+
+
+
+
+
+
+
enum {
DIDmsg_lnxind_wlansniffrm = 0x00000044,
DIDmsg_lnxind_wlansniffrm_hosttime = 0x00010044,
@@ -5712,9 +5119,6 @@ void send_monitor_packets(
IN PRTMP_ADAPTER pAd,
IN RX_BLK *pRxBlk);
-// This function will be called when query /proc
-struct iw_statistics *rt28xx_get_wireless_stats(
- IN struct net_device *net_dev);
VOID RTMPSetDesiredRates(
IN PRTMP_ADAPTER pAdapter,
@@ -5722,62 +5126,20 @@ VOID RTMPSetDesiredRates(
INT Set_FixedTxMode_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-static inline char* GetPhyMode(
- int Mode)
-{
- switch(Mode)
- {
- case MODE_CCK:
- return "CCK";
+ IN PSTRING arg);
- case MODE_OFDM:
- return "OFDM";
- case MODE_HTMIX:
- return "HTMIX";
-
- case MODE_HTGREENFIELD:
- return "GREEN";
- default:
- return "N/A";
- }
-}
-
-
-static inline char* GetBW(
- int BW)
-{
- switch(BW)
- {
- case BW_10:
- return "10M";
-
- case BW_20:
- return "20M";
- case BW_40:
- return "40M";
- default:
- return "N/A";
- }
-}
+INT Set_LongRetryLimit_Proc(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PSTRING arg);
-VOID RT28xxThreadTerminate(
- IN RTMP_ADAPTER *pAd);
+INT Set_ShortRetryLimit_Proc(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PSTRING arg);
BOOLEAN RT28XXChipsetCheck(
IN void *_dev_p);
-BOOLEAN RT28XXNetDevInit(
- IN void *_dev_p,
- IN struct net_device *net_dev,
- IN RTMP_ADAPTER *pAd);
-
-BOOLEAN RT28XXProbePostConfig(
- IN void *_dev_p,
- IN RTMP_ADAPTER *pAd,
- IN INT32 argc);
VOID RT28XXDMADisable(
IN RTMP_ADAPTER *pAd);
@@ -5791,26 +5153,45 @@ VOID RT28xx_UpdateBeaconToAsic(
IN ULONG BeaconLen,
IN ULONG UpdatePos);
-INT rt28xx_sta_ioctl(
- IN struct net_device *net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd);
-
-////////////////////////////////////////
-PNDIS_PACKET GetPacketFromRxRing(
+int rt28xx_init(
IN PRTMP_ADAPTER pAd,
- OUT PRT28XX_RXD_STRUC pSaveRxD,
- OUT BOOLEAN *pbReschedule,
- IN OUT UINT32 *pRxPending);
+ IN PSTRING pDefaultMac,
+ IN PSTRING pHostName);
+
+NDIS_STATUS RtmpNetTaskInit(
+ IN RTMP_ADAPTER *pAd);
+VOID RtmpNetTaskExit(
+ IN PRTMP_ADAPTER pAd);
+
+NDIS_STATUS RtmpMgmtTaskInit(
+ IN RTMP_ADAPTER *pAd);
-void kill_thread_task(PRTMP_ADAPTER pAd);
+VOID RtmpMgmtTaskExit(
+ IN RTMP_ADAPTER *pAd);
void tbtt_tasklet(unsigned long data);
-#ifdef RT2860
+
+PNET_DEV RtmpPhyNetDevInit(
+ IN RTMP_ADAPTER *pAd,
+ IN RTMP_OS_NETDEV_OP_HOOK *pNetHook);
+
+BOOLEAN RtmpPhyNetDevExit(
+ IN RTMP_ADAPTER *pAd,
+ IN PNET_DEV net_dev);
+
+INT RtmpRaDevCtrlInit(
+ IN RTMP_ADAPTER *pAd,
+ IN RTMP_INF_TYPE infType);
+
+BOOLEAN RtmpRaDevCtrlExit(
+ IN RTMP_ADAPTER *pAd);
+
+
+#ifdef RTMP_MAC_PCI
//
-// Function Prototype in cmm_data_2860.c
+// Function Prototype in cmm_data_pci.c
//
USHORT RtmpPCI_WriteTxResource(
IN PRTMP_ADAPTER pAd,
@@ -5873,6 +5254,15 @@ NDIS_STATUS RTMPCheckRxError(
IN PRXWI_STRUC pRxWI,
IN PRT28XX_RXD_STRUC pRxD);
+BOOLEAN RT28xxPciAsicRadioOff(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Level,
+ IN USHORT TbttNumToNextWakeUp);
+
+BOOLEAN RT28xxPciAsicRadioOn(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Level);
+
VOID RTMPInitPCIeLinkCtrlValue(
IN PRTMP_ADAPTER pAd);
@@ -5887,22 +5277,8 @@ VOID RTMPPCIeLinkCtrlSetting(
IN PRTMP_ADAPTER pAd,
IN USHORT Max);
-VOID RT28xxPciAsicRadioOff(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level,
- IN USHORT TbttNumToNextWakeUp);
-
-BOOLEAN RT28xxPciAsicRadioOn(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level);
-
-VOID RT28xxPciStaAsicForceWakeup(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level);
-
-VOID RT28xxPciStaAsicSleepThenAutoWakeup(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TbttNumToNextWakeUp);
+VOID RTMPrt3xSetPCIePowerLinkCtrl(
+ IN PRTMP_ADAPTER pAd);
VOID PsPollWakeExec(
IN PVOID SystemSpecific1,
@@ -5916,111 +5292,23 @@ VOID RadioOnExec(
IN PVOID SystemSpecific2,
IN PVOID SystemSpecific3);
-VOID RT28xxPciMlmeRadioOn(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT28xxPciMlmeRadioOFF(
- IN PRTMP_ADAPTER pAd);
-#endif /* RT2860 */
-
-VOID AsicTurnOffRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel);
-
-VOID AsicTurnOnRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel);
-
-NTSTATUS RT30xxWriteRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RegID,
- IN UCHAR Value);
-
-NTSTATUS RT30xxReadRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RegID,
- IN PUCHAR pValue);
-
-UCHAR eFuseReadRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData);
-
-VOID eFuseReadPhysical(
- IN PRTMP_ADAPTER pAd,
- IN PUSHORT lpInBuffer,
- IN ULONG nInBufferSize,
- OUT PUSHORT lpOutBuffer,
- IN ULONG nOutBufferSize
-);
-
-NTSTATUS eFuseRead(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- OUT PUCHAR pData,
- IN USHORT Length);
-
-VOID eFusePhysicalWriteRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData);
-
-NTSTATUS eFuseWriteRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- IN USHORT* pData);
-
-VOID eFuseWritePhysical(
- IN PRTMP_ADAPTER pAd,
- PUSHORT lpInBuffer,
- ULONG nInBufferSize,
- PUCHAR lpOutBuffer,
- ULONG nOutBufferSize
-);
-
-NTSTATUS eFuseWrite(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN PUCHAR pData,
- IN USHORT length);
-
-INT set_eFuseGetFreeBlockCount_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-INT set_eFusedump_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-INT set_eFuseLoadFromBin_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-NTSTATUS eFuseWriteRegistersFromBin(
+VOID RT28xxPciStaAsicForceWakeup(
IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- IN USHORT* pData);
+ IN BOOLEAN bFromTx);
-VOID eFusePhysicalReadRegisters(
+VOID RT28xxPciStaAsicSleepThenAutoWakeup(
IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData);
+ IN USHORT TbttNumToNextWakeUp);
-VOID RT30xxLoadRFNormalModeSetup(
- IN PRTMP_ADAPTER pAd);
-VOID RT30xxLoadRFSleepModeSetup(
+VOID RT28xxPciMlmeRadioOn(
IN PRTMP_ADAPTER pAd);
-VOID RT30xxReverseRFSleepModeSetup(
+VOID RT28xxPciMlmeRadioOFF(
IN PRTMP_ADAPTER pAd);
+#endif // RTMP_MAC_PCI //
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
//
// Function Prototype in rtusb_bulk.c
//
@@ -6037,6 +5325,10 @@ VOID RTUSBInitHTTxDesc(
IN ULONG BulkOutSize,
IN usb_complete_t Func);
+VOID RTUSBInitRxDesc(
+ IN PRTMP_ADAPTER pAd,
+ IN PRX_CONTEXT pRxContext);
+
VOID RTUSBCleanUpDataBulkOutQueue(
IN PRTMP_ADAPTER pAd);
@@ -6083,6 +5375,9 @@ VOID RTUSBInitRxDesc(
IN PRTMP_ADAPTER pAd,
IN PRX_CONTEXT pRxContext);
+VOID RTUSBBulkRxHandle(
+ IN unsigned long data);
+
//
// Function Prototype in rtusb_io.c
//
@@ -6168,36 +5463,19 @@ VOID RTUSBDequeueCmd(
INT RTUSBCmdThread(
IN OUT PVOID Context);
-INT TimerQThread(
- IN OUT PVOID Context);
-
-RT2870_TIMER_ENTRY *RT2870_TimerQ_Insert(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer);
-
-BOOLEAN RT2870_TimerQ_Remove(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer);
-
-void RT2870_TimerQ_Exit(
+VOID RTUSBBssBeaconExit(
IN RTMP_ADAPTER *pAd);
-void RT2870_TimerQ_Init(
+VOID RTUSBBssBeaconStop(
IN RTMP_ADAPTER *pAd);
-VOID RT2870_BssBeaconExit(
- IN RTMP_ADAPTER *pAd);
-
-VOID RT2870_BssBeaconStop(
- IN RTMP_ADAPTER *pAd);
-
-VOID RT2870_BssBeaconStart(
+VOID RTUSBBssBeaconStart(
IN RTMP_ADAPTER * pAd);
-VOID RT2870_BssBeaconInit(
+VOID RTUSBBssBeaconInit(
IN RTMP_ADAPTER *pAd);
-VOID RT2870_WatchDog(
+VOID RTUSBWatchDog(
IN RTMP_ADAPTER *pAd);
NTSTATUS RTUSBWriteMACRegister(
@@ -6215,28 +5493,27 @@ NTSTATUS RTUSBSingleWrite(
IN USHORT Offset,
IN USHORT Value);
-NTSTATUS RTUSBFirmwareRun(
- IN PRTMP_ADAPTER pAd);
-
NTSTATUS RTUSBFirmwareWrite(
IN PRTMP_ADAPTER pAd,
IN PUCHAR pFwImage,
IN ULONG FwLen);
-NTSTATUS RTUSBFirmwareOpmode(
- IN PRTMP_ADAPTER pAd,
- OUT PUINT32 pValue);
-
NTSTATUS RTUSBVenderReset(
IN PRTMP_ADAPTER pAd);
-VOID CMDHandler(
- IN PRTMP_ADAPTER pAd);
+NDIS_STATUS RTUSBSetHardWareRegister(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PVOID pBuf);
+NDIS_STATUS RTUSBQueryHardWareRegister(
+ IN PRTMP_ADAPTER pAdapter,
+ IN PVOID pBuf);
-NDIS_STATUS CreateThreads(
- IN struct net_device *net_dev );
+VOID CMDHandler(
+ IN PRTMP_ADAPTER pAd);
+NDIS_STATUS RTUSBWriteHWMACAddress(
+ IN PRTMP_ADAPTER pAdapter);
VOID MacTableInitialize(
IN PRTMP_ADAPTER pAd);
@@ -6252,12 +5529,30 @@ NDIS_STATUS RTMPWPAAddKeyProc(
VOID AsicRxAntEvalAction(
IN PRTMP_ADAPTER pAd);
+void append_pkt(
+ IN PRTMP_ADAPTER pAd,
+ IN PUCHAR pHeader802_3,
+ IN UINT HdrLen,
+ IN PUCHAR pData,
+ IN ULONG DataSize,
+ OUT PNDIS_PACKET *ppPacket);
+
+UINT deaggregate_AMSDU_announce(
+ IN PRTMP_ADAPTER pAd,
+ PNDIS_PACKET pPacket,
+ IN PUCHAR pData,
+ IN ULONG DataSize);
+
NDIS_STATUS RTMPCheckRxError(
IN PRTMP_ADAPTER pAd,
IN PHEADER_802_11 pHeader,
IN PRXWI_STRUC pRxWI,
IN PRT28XX_RXD_STRUC pRxINFO);
+VOID RTUSBMlmeHardTransmit(
+ IN PRTMP_ADAPTER pAd,
+ IN PMGMT_STRUC pMgmt);
+
INT MlmeThread(
IN PVOID Context);
@@ -6285,7 +5580,7 @@ VOID RTMPWriteTxInfo(
IN UCHAR TxBurst);
//
-// Function Prototype in cmm_data_2870.c
+// Function Prototype in cmm_data_usb.c
//
USHORT RtmpUSB_WriteSubTxResource(
IN PRTMP_ADAPTER pAd,
@@ -6315,9 +5610,6 @@ VOID RtmpUSB_FinalWriteTxResource(
IN PRTMP_ADAPTER pAd,
IN TX_BLK *pTxBlk,
IN USHORT totalMPDUSize,
-#ifdef RT2860
- IN USHORT FirstTxIdx);
-#endif
IN USHORT TxIdx);
VOID RtmpUSBDataLastTxIdx(
@@ -6344,6 +5636,12 @@ VOID RtmpUSBNullFrameKickOut(
IN UCHAR *pNullFrame,
IN UINT32 frameLen);
+VOID RtmpUsbStaAsicForceWakeupTimeout(
+ IN PVOID SystemSpecific1,
+ IN PVOID FunctionContext,
+ IN PVOID SystemSpecific2,
+ IN PVOID SystemSpecific3);
+
VOID RT28xxUsbStaAsicForceWakeup(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bFromTx);
@@ -6357,44 +5655,72 @@ VOID RT28xxUsbMlmeRadioOn(
VOID RT28xxUsbMlmeRadioOFF(
IN PRTMP_ADAPTER pAd);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
+
+VOID AsicTurnOffRFClk(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Channel);
+VOID AsicTurnOnRFClk(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR Channel);
+
+
+
+#ifdef RTMP_TIMER_TASK_SUPPORT
+INT RtmpTimerQThread(
+ IN OUT PVOID Context);
+
+RTMP_TIMER_TASK_ENTRY *RtmpTimerQInsert(
+ IN RTMP_ADAPTER *pAd,
+ IN RALINK_TIMER_STRUCT *pTimer);
+
+BOOLEAN RtmpTimerQRemove(
+ IN RTMP_ADAPTER *pAd,
+ IN RALINK_TIMER_STRUCT *pTimer);
+
+void RtmpTimerQExit(
+ IN RTMP_ADAPTER *pAd);
+
+void RtmpTimerQInit(
+ IN RTMP_ADAPTER *pAd);
+#endif // RTMP_TIMER_TASK_SUPPORT //
+
+///////////////////////////////////////
INT RTMPShowCfgValue(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pName,
- IN PUCHAR pBuf);
+ IN PSTRING pName,
+ IN PSTRING pBuf);
-PCHAR RTMPGetRalinkAuthModeStr(
+PSTRING RTMPGetRalinkAuthModeStr(
IN NDIS_802_11_AUTHENTICATION_MODE authMode);
-PCHAR RTMPGetRalinkEncryModeStr(
+PSTRING RTMPGetRalinkEncryModeStr(
IN USHORT encryMode);
+//////////////////////////////////////
VOID AsicStaBbpTuning(
IN PRTMP_ADAPTER pAd);
-#ifdef RT2860
-VOID AsicResetFromDMABusy(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicResetBBP(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicResetMAC(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicResetPBF(
- IN PRTMP_ADAPTER pAd);
-#endif
-#ifdef RT2870
BOOLEAN StaAddMacTableEntry(
IN PRTMP_ADAPTER pAd,
IN PMAC_TABLE_ENTRY pEntry,
IN UCHAR MaxSupportedRateIn500Kbps,
IN HT_CAPABILITY_IE *pHtCapability,
IN UCHAR HtCapabilityLen,
+ IN ADD_HT_INFO_IE *pAddHtInfo,
+ IN UCHAR AddHtInfoLen,
IN USHORT CapabilityInfo);
-#endif
+
+
+BOOLEAN AUTH_ReqSend(
+ IN PRTMP_ADAPTER pAd,
+ IN PMLME_QUEUE_ELEM pElem,
+ IN PRALINK_TIMER_STRUCT pAuthTimer,
+ IN PSTRING pSMName,
+ IN USHORT SeqNo,
+ IN PUCHAR pNewElement,
+ IN ULONG ElementLen);
void RTMP_IndicateMediaState(
IN PRTMP_ADAPTER pAd);
@@ -6409,13 +5735,23 @@ VOID RTMPSetAGCInitValue(
int rt28xx_close(IN PNET_DEV dev);
int rt28xx_open(IN PNET_DEV dev);
+
+#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++)
+#define VIRTUAL_IF_DEC(__pAd) ((__pAd)->VirtualIfCnt--)
+#define VIRTUAL_IF_NUM(__pAd) ((__pAd)->VirtualIfCnt)
+
+
+#ifdef LINUX
__inline INT VIRTUAL_IF_UP(PRTMP_ADAPTER pAd)
{
if (VIRTUAL_IF_NUM(pAd) == 0)
{
if (rt28xx_open(pAd->net_dev) != 0)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_open return fail!\n"));
return -1;
}
+ }
else
{
}
@@ -6430,6 +5766,107 @@ __inline VOID VIRTUAL_IF_DOWN(PRTMP_ADAPTER pAd)
rt28xx_close(pAd->net_dev);
return;
}
+#endif // LINUX //
+
+
+/*
+ OS Related funciton prototype definitions.
+ TODO: Maybe we need to move these function prototypes to other proper place.
+*/
+int RtmpOSWrielessEventSend(
+ IN RTMP_ADAPTER *pAd,
+ IN UINT32 eventType,
+ IN INT flags,
+ IN PUCHAR pSrcMac,
+ IN PUCHAR pData,
+ IN UINT32 dataLen);
+
+int RtmpOSNetDevAddrSet(
+ IN PNET_DEV pNetDev,
+ IN PUCHAR pMacAddr);
+
+int RtmpOSNetDevAttach(
+ IN PNET_DEV pNetDev,
+ IN RTMP_OS_NETDEV_OP_HOOK *pDevOpHook);
+
+void RtmpOSNetDevClose(
+ IN PNET_DEV pNetDev);
+
+void RtmpOSNetDevDetach(
+ IN PNET_DEV pNetDev);
+
+INT RtmpOSNetDevAlloc(
+ IN PNET_DEV *pNewNetDev,
+ IN UINT32 privDataSize);
+
+void RtmpOSNetDevFree(
+ IN PNET_DEV pNetDev);
+
+PNET_DEV RtmpOSNetDevGetByName(
+ IN PNET_DEV pNetDev,
+ IN PSTRING pDevName);
+
+void RtmpOSNetDeviceRefPut(
+ IN PNET_DEV pNetDev);
+
+PNET_DEV RtmpOSNetDevCreate(
+ IN RTMP_ADAPTER *pAd,
+ IN INT devType,
+ IN INT devNum,
+ IN INT privMemSize,
+ IN PSTRING pNamePrefix);
+
+/*
+ Task operation related function prototypes
+*/
+void RtmpOSTaskCustomize(
+ IN RTMP_OS_TASK *pTask);
+
+INT RtmpOSTaskNotifyToExit(
+ IN RTMP_OS_TASK *pTask);
+
+NDIS_STATUS RtmpOSTaskKill(
+ IN RTMP_OS_TASK *pTask);
+
+NDIS_STATUS RtmpOSTaskInit(
+ IN RTMP_OS_TASK *pTask,
+ PSTRING pTaskName,
+ VOID *pPriv);
+
+NDIS_STATUS RtmpOSTaskAttach(
+ IN RTMP_OS_TASK *pTask,
+ IN int (*fn)(void *),
+ IN void *arg);
+
+
+/*
+ File operation related function prototypes
+*/
+RTMP_OS_FD RtmpOSFileOpen(
+ IN char *pPath,
+ IN int flag,
+ IN int mode);
+
+int RtmpOSFileClose(
+ IN RTMP_OS_FD osfd);
+
+void RtmpOSFileSeek(
+ IN RTMP_OS_FD osfd,
+ IN int offset);
+
+int RtmpOSFileRead(
+ IN RTMP_OS_FD osfd,
+ IN char *pDataPtr,
+ IN int readLen);
+
+int RtmpOSFileWrite(
+ IN RTMP_OS_FD osfd,
+ IN char *pDataPtr,
+ IN int writeLen);
+
+void RtmpOSFSInfoChange(
+ IN RTMP_OS_FS_INFO *pOSFSInfo,
+ IN BOOLEAN bSet);
#endif // __RTMP_H__
diff --git a/drivers/staging/rt3090/rtmp_chip.h b/drivers/staging/rt2860/rtmp_chip.h
index a0b4bf06cca0..1284a446786e 100644
--- a/drivers/staging/rt3090/rtmp_chip.h
+++ b/drivers/staging/rt2860/rtmp_chip.h
@@ -40,18 +40,19 @@
#include "rtmp_type.h"
+#ifdef RT2860
+#include "chip/rt2860.h"
+#endif // RT2860 //
+#ifdef RT2870
+#include "chip/rt2870.h"
+#endif // RT2870 //
+#ifdef RT3070
+#include "chip/rt3070.h"
+#endif // RT3070 //
#ifdef RT3090
-#include "rt3090.h"
+#include "chip/rt3090.h"
#endif // RT3090 //
-#ifdef RT3370
-#include "rt3370.h"
-#endif // RT3370 //
-
-#ifdef RT3390
-#include "rt3390.h"
-#endif // RT3390 //
-
// We will have a cost down version which mac version is 0x3090xxxx
//
// RT3090A facts
@@ -180,13 +181,8 @@
//
typedef union _MCU_LEDCS_STRUC {
struct {
-#ifdef RT_BIG_ENDIAN
- UCHAR Polarity:1;
- UCHAR LedMode:7;
-#else
UCHAR LedMode:7;
UCHAR Polarity:1;
-#endif // RT_BIG_ENDIAN //
} field;
UCHAR word;
} MCU_LEDCS_STRUC, *PMCU_LEDCS_STRUC;
@@ -195,17 +191,6 @@ typedef union _MCU_LEDCS_STRUC {
//
// EEPROM antenna select format
//
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_ANTENNA_STRUC {
- struct {
- USHORT Rsv:4;
- USHORT RfIcType:4; // see E2PROM document
- USHORT TxPath:4; // 1: 1T, 2: 2T
- USHORT RxPath:4; // 1: 1R, 2: 2R, 3: 3R
- } field;
- USHORT word;
-} EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
-#else
typedef union _EEPROM_ANTENNA_STRUC {
struct {
USHORT RxPath:4; // 1: 1R, 2: 2R, 3: 3R
@@ -215,29 +200,7 @@ typedef union _EEPROM_ANTENNA_STRUC {
} field;
USHORT word;
} EEPROM_ANTENNA_STRUC, *PEEPROM_ANTENNA_STRUC;
-#endif
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_NIC_CINFIG2_STRUC {
- struct {
- USHORT DACTestBit:1; // control if driver should patch the DAC issue
- USHORT Rsv2:3; // must be 0
- USHORT AntDiversity:1; // Antenna diversity
- USHORT Rsv1:1; // must be 0
- USHORT BW40MAvailForA:1; // 0:enable, 1:disable
- USHORT BW40MAvailForG:1; // 0:enable, 1:disable
- USHORT EnableWPSPBC:1; // WPS PBC Control bit
- USHORT BW40MSidebandForA:1;
- USHORT BW40MSidebandForG:1;
- USHORT CardbusAcceleration:1; // !!! NOTE: 0 - enable, 1 - disable
- USHORT ExternalLNAForA:1; // external LNA enable for 5G
- USHORT ExternalLNAForG:1; // external LNA enable for 2.4G
- USHORT DynamicTxAgcControl:1; //
- USHORT HardwareRadioControl:1; // Whether RF is controlled by driver or HW. 1:enable hw control, 0:disable
- } field;
- USHORT word;
-} EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
-#else
typedef union _EEPROM_NIC_CINFIG2_STRUC {
struct {
USHORT HardwareRadioControl:1; // 1:enable, 0:disable
@@ -257,20 +220,10 @@ typedef union _EEPROM_NIC_CINFIG2_STRUC {
} field;
USHORT word;
} EEPROM_NIC_CONFIG2_STRUC, *PEEPROM_NIC_CONFIG2_STRUC;
-#endif
//
// TX_PWR Value valid range 0xFA(-6) ~ 0x24(36)
//
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_TX_PWR_STRUC {
- struct {
- CHAR Byte1; // High Byte
- CHAR Byte0; // Low Byte
- } field;
- USHORT word;
-} EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
-#else
typedef union _EEPROM_TX_PWR_STRUC {
struct {
CHAR Byte0; // Low Byte
@@ -278,17 +231,7 @@ typedef union _EEPROM_TX_PWR_STRUC {
} field;
USHORT word;
} EEPROM_TX_PWR_STRUC, *PEEPROM_TX_PWR_STRUC;
-#endif
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_VERSION_STRUC {
- struct {
- UCHAR Version; // High Byte
- UCHAR FaeReleaseNumber; // Low Byte
- } field;
- USHORT word;
-} EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
-#else
typedef union _EEPROM_VERSION_STRUC {
struct {
UCHAR FaeReleaseNumber; // Low Byte
@@ -296,25 +239,7 @@ typedef union _EEPROM_VERSION_STRUC {
} field;
USHORT word;
} EEPROM_VERSION_STRUC, *PEEPROM_VERSION_STRUC;
-#endif
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_LED_STRUC {
- struct {
- USHORT Rsvd:3; // Reserved
- USHORT LedMode:5; // Led mode.
- USHORT PolarityGPIO_4:1; // Polarity GPIO#4 setting.
- USHORT PolarityGPIO_3:1; // Polarity GPIO#3 setting.
- USHORT PolarityGPIO_2:1; // Polarity GPIO#2 setting.
- USHORT PolarityGPIO_1:1; // Polarity GPIO#1 setting.
- USHORT PolarityGPIO_0:1; // Polarity GPIO#0 setting.
- USHORT PolarityACT:1; // Polarity ACT setting.
- USHORT PolarityRDY_A:1; // Polarity RDY_A setting.
- USHORT PolarityRDY_G:1; // Polarity RDY_G setting.
- } field;
- USHORT word;
-} EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
-#else
typedef union _EEPROM_LED_STRUC {
struct {
USHORT PolarityRDY_G:1; // Polarity RDY_G setting.
@@ -330,18 +255,7 @@ typedef union _EEPROM_LED_STRUC {
} field;
USHORT word;
} EEPROM_LED_STRUC, *PEEPROM_LED_STRUC;
-#endif
-#ifdef RT_BIG_ENDIAN
-typedef union _EEPROM_TXPOWER_DELTA_STRUC {
- struct {
- UCHAR TxPowerEnable:1;// Enable
- UCHAR Type:1; // 1: plus the delta value, 0: minus the delta value
- UCHAR DeltaValue:6; // Tx Power dalta value (MAX=4)
- } field;
- UCHAR value;
-} EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
-#else
typedef union _EEPROM_TXPOWER_DELTA_STRUC {
struct {
UCHAR DeltaValue:6; // Tx Power dalta value (MAX=4)
@@ -350,6 +264,5 @@ typedef union _EEPROM_TXPOWER_DELTA_STRUC {
} field;
UCHAR value;
} EEPROM_TXPOWER_DELTA_STRUC, *PEEPROM_TXPOWER_DELTA_STRUC;
-#endif
#endif // __RTMP_CHIP_H__ //
diff --git a/drivers/staging/rt2860/rtmp_def.h b/drivers/staging/rt2860/rtmp_def.h
index f5fee57fbe3e..ca700d064a91 100644
--- a/drivers/staging/rt2860/rtmp_def.h
+++ b/drivers/staging/rt2860/rtmp_def.h
@@ -41,6 +41,15 @@
#include "oid.h"
+#undef AP_WSC_INCLUDED
+#undef STA_WSC_INCLUDED
+#undef WSC_INCLUDED
+
+
+
+#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
+#define WSC_INCLUDED
+#endif
//
// Debug information verbosity: lower values indicate higher urgency
//
@@ -54,55 +63,28 @@
#define NIC_TAG ((ULONG)'0682')
#define NIC_DBG_STRING ("**RT28xx**")
+#ifdef RTMP_MAC_USB
+#define TX_RING_SIZE 8 // 1
+#define PRIO_RING_SIZE 8
+#define MGMT_RING_SIZE 32 // PRIO_RING_SIZE
+#define RX_RING_SIZE 8
+#define MAX_TX_PROCESS 4
+#define LOCAL_TXBUF_SIZE 2048
+#endif // RTMP_MAC_USB //
+
+//#define PACKED
+
#define RALINK_2883_VERSION ((UINT32)0x28830300)
#define RALINK_2880E_VERSION ((UINT32)0x28720200)
#define RALINK_3070_VERSION ((UINT32)0x30700200)
-//
-// NDIS version in use by the NIC driver.
-// The high byte is the major version. The low byte is the minor version.
-//
-#ifdef NDIS51_MINIPORT
-#define NIC_DRIVER_VERSION 0x0501
-#else
-#define NIC_DRIVER_VERSION 0x0500
-#endif
-
-//
-// NDIS media type, current is ethernet, change if native wireless supported
-//
-#define NIC_MEDIA_TYPE NdisMedium802_3
-#define NIC_PCI_HDR_LENGTH 0xe2
-#define NIC_MAX_PACKET_SIZE 2304
-#define NIC_HEADER_SIZE 14
-#define MAX_MAP_REGISTERS_NEEDED 32
-#define MIN_MAP_REGISTERS_NEEDED 2 //Todo: should consider fragment issue.
-
-//
-// interface type, we use PCI
-//
-#define NIC_INTERFACE_TYPE NdisInterfacePci
-#define NIC_INTERRUPT_MODE NdisInterruptLevelSensitive
-
-//
-// buffer size passed in NdisMQueryAdapterResources
-// We should only need three adapter resources (IO, interrupt and memory),
-// Some devices get extra resources, so have room for 10 resources
-// UF_SIZE (sizeof(NDIS_RESOURCE_LIST) + (10*sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR)))
-
-
-#define NIC_RESOURCE_B//
-// IO space length
-//
-#define NIC_MAP_IOSPACE_LENGTH sizeof(CSR_STRUC)
-
#define MAX_RX_PKT_LEN 1520
//
// Entry number for each DMA descriptor ring
//
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
#define TX_RING_SIZE 64 //64
#define MGMT_RING_SIZE 128
#define RX_RING_SIZE 128 //64
@@ -110,15 +92,7 @@
#define MAX_DMA_DONE_PROCESS TX_RING_SIZE
#define MAX_TX_DONE_PROCESS TX_RING_SIZE //8
#define LOCAL_TXBUF_SIZE 2
-#endif
-#ifdef RT2870
-#define TX_RING_SIZE 8 // 1
-#define PRIO_RING_SIZE 8
-#define MGMT_RING_SIZE 32 // PRIO_RING_SIZE
-#define RX_RING_SIZE 8
-#define MAX_TX_PROCESS 4
-#define LOCAL_TXBUF_SIZE 2048
-#endif // RT2870 //
+#endif // RTMP_MAC_PCI //
#define MAX_RX_PROCESS 128 //64 //32
#define NUM_OF_LOCAL_TXBUF 2
@@ -143,16 +117,43 @@
#define MAX_RX_PROCESS_CNT (RX_RING_SIZE)
+/*
+ WMM Note: If memory of your system is not much, please reduce the definition;
+ or when you do WMM test, the queue for low priority AC will be full, i.e.
+ TX_RING_SIZE + MAX_PACKETS_IN_QUEUE packets for the AC will be buffered in
+ WLAN, maybe no any packet buffer can be got in Ethernet driver.
+
+ Sometimes no packet buffer can be got in Ethernet driver, the system will
+ send flow control packet to the sender to slow down its sending rate.
+ So no WMM can be saw in the air.
+*/
+
+/*
+ Need to use 64 in vxworks for test case WMM A5-T07
+ Two dnlink (10Mbps) from a WMM station to a non-WMM station.
+ If use 256, queue is not enough.
+ And in rt_main_end.c, clConfig.clNum = RX_RING_SIZE * 3; is changed to
+ clConfig.clNum = RX_RING_SIZE * 4;
+*/
+// TODO: For VxWorks the size is 256. Shall we cahnge the value as 256 for all OS?????
#define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK
+
#define MAX_PACKETS_IN_MCAST_PS_QUEUE 32
#define MAX_PACKETS_IN_PS_QUEUE 128 //32
#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */
+
+#ifdef RTMP_EFUSE_SUPPORT
+//2008/09/11:KH add to support efuse<--
#define MAX_EEPROM_BIN_FILE_SIZE 1024
+#define EFUSE_BUFFER_PATH "/tmp/RT30xxEEPROM.bin"
+//2008/09/11:KH add to support efuse-->
+#endif // RTMP_EFUSE_SUPPORT //
// RxFilter
#define STANORMAL 0x17f97
#define APNORMAL 0x15f97
+#define PSPXLINK 0x17f93
//
// RTMP_ADAPTER flags
//
@@ -203,9 +204,9 @@
#define fOP_STATUS_TX_AMSDU_INUSED 0x00002000
#define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000
#define fOP_STATUS_WAKEUP_NOW 0x00008000
-#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE 0x00020000
+#define fOP_STATUS_PCIE_DEVICE 0x00020000
+#define fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE fOP_STATUS_PCIE_DEVICE
-#ifdef RT2860
//
// RTMP_ADAPTER PSFlags : related to advanced power save.
//
@@ -218,7 +219,13 @@
// Indicate driver should IMMEDIATELY fo to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me
//. This flag is used ONLY in RTMPHandleRxDoneInterrupt routine.
#define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008
-#endif
+#define fRTMP_PS_TOGGLE_L1 0x00000010 // Use Toggle L1 mechanism for rt28xx PCIe
+
+#ifdef RT3090
+#define WAKE_MCU_CMD 0x31
+#define SLEEP_MCU_CMD 0x30
+#define RFOFF_MCU_CMD 0x35
+#endif // RT3090 //
#define CCKSETPROTECT 0x1
#define OFDMSETPROTECT 0x2
@@ -266,6 +273,7 @@
#define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST
#define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST
#define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST
+#define fRX_FILTER_ACCEPT_PROMISCUOUS NDIS_PACKET_TYPE_PROMISCUOUS
//
// Error code section
@@ -321,17 +329,15 @@
#define MAX_APCLI_NUM 0
#define MAX_MBSSID_NUM 1
-#if defined(RT2860) || defined(RT30xx)
#ifdef MBSS_SUPPORT
#undef MAX_MBSSID_NUM
#define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM)
#endif // MBSS_SUPPORT //
-#endif
/* sanity check for apidx */
#define MBSS_MR_APIDX_SANITY_CHECK(apidx) \
{ if (apidx > MAX_MBSSID_NUM) { \
- printk("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx); \
+ DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __func__, apidx)); \
apidx = MAIN_MBSSID; } }
#define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE )
@@ -397,6 +403,7 @@
#define HASH_TABLE_SIZE 256
#define MAX_VIE_LEN 1024 // New for WPA cipher suite variable IE sizes.
#define MAX_SUPPORT_MCS 32
+#define MAX_NUM_OF_BBP_LATCH 140
//============================================================
// ASIC WCID Table definition.
@@ -515,6 +522,9 @@
#define MLME_QOS_UNSPECIFY 32
#define MLME_REQUEST_DECLINED 37
#define MLME_REQUEST_WITH_INVALID_PARAM 38
+#define MLME_INVALID_GROUP_CIPHER 41
+#define MLME_INVALID_PAIRWISE_CIPHER 42
+#define MLME_INVALID_AKMP 43
#define MLME_DLS_NOT_ALLOW_IN_QBSS 48
#define MLME_DEST_STA_NOT_IN_QBSS 49
#define MLME_DEST_STA_IS_NOT_A_QSTA 50
@@ -569,6 +579,7 @@
// For 802.11n D3.03
//#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet
#define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element
+#define IE_WAPI 68 // WAPI information element
#define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3
#define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03
#define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03
@@ -605,17 +616,22 @@
#define SYNC_STATE_MACHINE 4
#define MLME_CNTL_STATE_MACHINE 5
#define WPA_PSK_STATE_MACHINE 6
-#define LEAP_STATE_MACHINE 7
+//#define LEAP_STATE_MACHINE 7
#define AIRONET_STATE_MACHINE 8
#define ACTION_STATE_MACHINE 9
// AP MLME state machines
#define AP_ASSOC_STATE_MACHINE 11
#define AP_AUTH_STATE_MACHINE 12
-#define AP_AUTH_RSP_STATE_MACHINE 13
#define AP_SYNC_STATE_MACHINE 14
#define AP_CNTL_STATE_MACHINE 15
-#define AP_WPA_STATE_MACHINE 16
+#define WSC_STATE_MACHINE 17
+#define WSC_UPNP_STATE_MACHINE 18
+
+
+#define WPA_STATE_MACHINE 23
+
+
//
// STA's CONTROL/CONNECT state machine: states, events, total function #
@@ -630,9 +646,9 @@
#define CNTL_WAIT_AUTH2 7
#define CNTL_WAIT_OID_LIST_SCAN 8
#define CNTL_WAIT_OID_DISASSOC 9
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
#define CNTL_WAIT_SCAN_FOR_CONNECT 10
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
#define MT2_ASSOC_CONF 34
#define MT2_AUTH_CONF 35
@@ -646,6 +662,7 @@
#define MT2_GET_CONF 43
#define MT2_SET_CONF 44
#define MT2_RESET_CONF 45
+#define MT2_FT_OTD_CONF 46
#define MT2_MLME_ROAMING_REQ 52
#define CNTL_FUNC_SIZE 1
@@ -691,8 +708,11 @@
#define MT2_PEER_BA_CATE 3
#define MT2_PEER_PUBLIC_CATE 4
#define MT2_PEER_RM_CATE 5
+/* "FT_CATEGORY_BSS_TRANSITION equal to 6" is defined file of "dot11r_ft.h" */
#define MT2_PEER_HT_CATE 7 // 7.4.7
#define MAX_PEER_CATE_MSG 7
+
+
#define MT2_MLME_ADD_BA_CATE 8
#define MT2_MLME_ORI_DELBA_CATE 9
#define MT2_MLME_REC_DELBA_CATE 10
@@ -822,35 +842,8 @@
#define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG)
//
-// STA's WPA-PSK State machine: states, events, total function #
+// WSC State machine: states, events, total function #
//
-#define WPA_PSK_IDLE 0
-#define MAX_WPA_PSK_STATE 1
-
-#define WPA_MACHINE_BASE 0
-#define MT2_EAPPacket 0
-#define MT2_EAPOLStart 1
-#define MT2_EAPOLLogoff 2
-#define MT2_EAPOLKey 3
-#define MT2_EAPOLASFAlert 4
-#define MAX_WPA_PSK_MSG 5
-
-#define WPA_PSK_FUNC_SIZE (MAX_WPA_PSK_STATE * MAX_WPA_PSK_MSG)
-
-//
-// STA's CISCO-AIRONET State machine: states, events, total function #
-//
-#define AIRONET_IDLE 0
-#define AIRONET_SCANNING 1
-#define MAX_AIRONET_STATE 2
-
-#define AIRONET_MACHINE_BASE 0
-#define MT2_AIRONET_MSG 0
-#define MT2_AIRONET_SCAN_REQ 1
-#define MT2_AIRONET_SCAN_DONE 2
-#define MAX_AIRONET_MSG 3
-
-#define AIRONET_FUNC_SIZE (MAX_AIRONET_STATE * MAX_AIRONET_MSG)
//
// AP's CONTROL/CONNECT state machine: states, events, total function #
@@ -882,23 +875,12 @@
#define AP_AUTH_MACHINE_BASE 0
#define APMT2_MLME_DEAUTH_REQ 0
#define APMT2_CLS2ERR 1
-#define AP_MAX_AUTH_MSG 2
-
-#define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG)
-
-//
-// AP's AUTH-RSP state machine: states, events, total function #
-//
-#define AP_AUTH_RSP_IDLE 0
-#define AP_MAX_AUTH_RSP_STATE 1
-
-#define AP_AUTH_RSP_MACHINE_BASE 0
-#define APMT2_AUTH_CHALLENGE_TIMEOUT 0
-#define APMT2_PEER_AUTH_ODD 1
#define APMT2_PEER_DEAUTH 2
-#define AP_MAX_AUTH_RSP_MSG 3
+#define APMT2_PEER_AUTH_REQ 3
+#define APMT2_PEER_AUTH_CONFIRM 4
+#define AP_MAX_AUTH_MSG 5
-#define AP_AUTH_RSP_FUNC_SIZE (AP_MAX_AUTH_RSP_STATE * AP_MAX_AUTH_RSP_MSG)
+#define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG)
//
// AP's SYNC state machine: states, events, total function #
@@ -919,20 +901,22 @@
#define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG)
//
-// AP's WPA state machine: states, events, total function #
+// Common WPA state machine: states, events, total function #
//
-#define AP_WPA_PTK 0
-#define AP_MAX_WPA_PTK_STATE 1
+#define WPA_PTK 0
+#define MAX_WPA_PTK_STATE 1
+
+#define WPA_MACHINE_BASE 0
+#define MT2_EAPPacket 0
+#define MT2_EAPOLStart 1
+#define MT2_EAPOLLogoff 2
+#define MT2_EAPOLKey 3
+#define MT2_EAPOLASFAlert 4
+#define MAX_WPA_MSG 5
+
+#define WPA_FUNC_SIZE (MAX_WPA_PTK_STATE * MAX_WPA_MSG)
-#define AP_WPA_MACHINE_BASE 0
-#define APMT2_EAPPacket 0
-#define APMT2_EAPOLStart 1
-#define APMT2_EAPOLLogoff 2
-#define APMT2_EAPOLKey 3
-#define APMT2_EAPOLASFAlert 4
-#define AP_MAX_WPA_MSG 5
-#define AP_WPA_FUNC_SIZE (AP_MAX_WPA_PTK_STATE * AP_MAX_WPA_MSG)
// =============================================================================
@@ -1178,12 +1162,16 @@
#define REGION_4_A_BAND 4 // 149, 153, 157, 161, 165
#define REGION_5_A_BAND 5 // 149, 153, 157, 161
#define REGION_6_A_BAND 6 // 36, 40, 44, 48
-#define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165
+#define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173
#define REGION_8_A_BAND 8 // 52, 56, 60, 64
#define REGION_9_A_BAND 9 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165
#define REGION_10_A_BAND 10 // 36, 40, 44, 48, 149, 153, 157, 161, 165
#define REGION_11_A_BAND 11 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161
-#define REGION_MAXIMUM_A_BAND 11
+#define REGION_12_A_BAND 12 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
+#define REGION_13_A_BAND 13 // 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161
+#define REGION_14_A_BAND 14 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165
+#define REGION_15_A_BAND 15 // 149, 153, 157, 161, 165, 169, 173
+#define REGION_MAXIMUM_A_BAND 15
// pTxD->CipherAlg
#define CIPHER_NONE 0
@@ -1196,15 +1184,6 @@
#define CIPHER_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
#define CIPHER_SMS4 8
-// value domain of pAd->RfIcType
-#define RFIC_2820 1 // 2.4G 2T3R
-#define RFIC_2850 2 // 2.4G/5G 2T3R
-#define RFIC_2720 3 // 2.4G 1T2R
-#define RFIC_2750 4 // 2.4G/5G 1T2R
-#define RFIC_3020 5 // 2.4G 1T1R
-#define RFIC_2020 6 // 2.4G B/G
-#define RFIC_3021 7 // 2.4G 1T2R
-#define RFIC_3022 8 // 2.4G 2T2R
// LED Status.
#define LED_LINK_DOWN 0
@@ -1219,7 +1198,8 @@
// value domain of pAd->LedCntl.LedMode and E2PROM
#define LED_MODE_DEFAULT 0
#define LED_MODE_TWO_LED 1
-#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8
+//#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8
+#define LED_MODE_SIGNAL_STREGTH 0x40 // EEPROM define = 64
// RC4 init value, used fro WEP & TKIP
#define PPPINITFCS32 0xffffffff /* Initial FCS value */
@@ -1305,7 +1285,12 @@
#define INT_APCLI 0x0400
#define INT_MESH 0x0500
-// Use bitmap to allow coexist of ATE_TXFRAME and ATE_RXFRAME(i.e.,to support LoopBack mode)
+#define INF_MAIN_DEV_NAME "wlan"
+#define INF_MBSSID_DEV_NAME "ra"
+#define INF_WDS_DEV_NAME "wds"
+#define INF_APCLI_DEV_NAME "apcli"
+#define INF_MESH_DEV_NAME "mesh"
+
// WEP Key TYPE
#define WEP_HEXADECIMAL_TYPE 0
@@ -1380,7 +1365,7 @@
#define MAX_NUM_OF_INIT_DLS_ENTRY 1
#define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY
-//Block ACK , rt2860, kathy
+//Block ACK, kathy
#define MAX_TX_REORDERBUF 64
#define MAX_RX_REORDERBUF 64
#define DEFAULT_TX_TIMEOUT 30
@@ -1392,29 +1377,13 @@
#define IW_ESSID_MAX_SIZE 32
#endif
-#ifdef MCAST_RATE_SPECIFIC
-#define MCAST_DISABLE 0
-#define MCAST_CCK 1
-#define MCAST_OFDM 2
-#define MCAST_HTMIX 3
-#endif // MCAST_RATE_SPECIFIC //
-
-#ifdef RT2860
-// For AsicRadioOff/AsicRadioOn/AsicForceWakeup function
-// This is to indicate from where to call this function.
-#define DOT11POWERSAVE 0 // TO do .11 power save sleep
-#define GUIRADIO_OFF 1 // To perform Radio OFf command from GUI
-#define RTMP_HALT 2 // Called from Halt handler.
-#define GUI_IDLE_POWER_SAVE 3 // Call to sleep before link up with AP
-#define FROM_TX 4 // Force wake up from Tx packet.
-#endif
-#ifdef RT2870
// For AsicRadioOff/AsicRadioOn function
#define DOT11POWERSAVE 0
#define GUIRADIO_OFF 1
#define RTMP_HALT 2
#define GUI_IDLE_POWER_SAVE 3
-#endif
+// --
+
// definition for WpaSupport flag
#define WPA_SUPPLICANT_DISABLE 0
@@ -1458,6 +1427,41 @@
#define cpu2be16(x) SWAP16((x))
#define be2cpu16(x) SWAP16((x))
+
+#define ABS(_x, _y) ((_x) > (_y)) ? ((_x) -(_y)) : ((_y) -(_x))
+
+
+#define A2Dec(_X, _p) \
+{ \
+ UCHAR *p; \
+ _X = 0; \
+ p = _p; \
+ while (((*p >= '0') && (*p <= '9'))) \
+ { \
+ if ((*p >= '0') && (*p <= '9')) \
+ _X = _X * 10 + *p - 48; \
+ p++; \
+ } \
+}
+
+
+#define A2Hex(_X, _p) \
+do{ \
+ char *__p; \
+ (_X) = 0; \
+ __p = (char *)(_p); \
+ while (((*__p >= 'a') && (*__p <= 'f')) || ((*__p >= 'A') && (*__p <= 'F')) || ((*__p >= '0') && (*__p <= '9'))) \
+ { \
+ if ((*__p >= 'a') && (*__p <= 'f')) \
+ (_X) = (_X) * 16 + *__p - 87; \
+ else if ((*__p >= 'A') && (*__p <= 'F')) \
+ (_X) = (_X) * 16 + *__p - 55; \
+ else if ((*__p >= '0') && (*__p <= '9')) \
+ (_X) = (_X) * 16 + *__p - 48; \
+ __p++; \
+ } \
+}while(0)
+
#endif // __RTMP_DEF_H__
diff --git a/drivers/staging/rt3090/rtmp_dot11.h b/drivers/staging/rt2860/rtmp_dot11.h
index a637825afe9c..f6887a83ea2c 100644
--- a/drivers/staging/rt3090/rtmp_dot11.h
+++ b/drivers/staging/rt2860/rtmp_dot11.h
@@ -33,22 +33,6 @@
// 4-byte HTC field. maybe included in any frame except non-QOS data frame. The Order bit must set 1.
typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- UINT32 RDG:1; //RDG / More PPDU
- UINT32 ACConstraint:1; //feedback request
- UINT32 rsv:5; //calibration sequence
- UINT32 ZLFAnnouce:1; // ZLF announcement
- UINT32 CSISTEERING:2; //CSI/ STEERING
- UINT32 FBKReq:2; //feedback request
- UINT32 CalSeq:2; //calibration sequence
- UINT32 CalPos:2; // calibration position
- UINT32 MFBorASC:7; //Link adaptation feedback containing recommended MCS. 0x7f for no feedback or not available
- UINT32 MFS:3; //SET to the received value of MRS. 0x111 for unsolicited MFB.
- UINT32 MRSorASI:3; // MRQ Sequence identifier. unchanged during entire procedure. 0x000-0x110.
- UINT32 MRQ:1; //MCS feedback. Request for a MCS feedback
- UINT32 TRQ:1; //sounding request
- UINT32 MA:1; //management action payload exist in (QoS Null+HTC)
-#else
UINT32 MA:1; //management action payload exist in (QoS Null+HTC)
UINT32 TRQ:1; //sounding request
UINT32 MRQ:1; //MCS feedback. Request for a MCS feedback
@@ -63,42 +47,20 @@ typedef struct PACKED {
UINT32 rsv:5; //calibration sequence
UINT32 ACConstraint:1; //feedback request
UINT32 RDG:1; //RDG / More PPDU
-#endif /* !RT_BIG_ENDIAN */
} HT_CONTROL, *PHT_CONTROL;
// 2-byte QOS CONTROL field
typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT Txop_QueueSize:8;
- USHORT AMsduPresent:1;
- USHORT AckPolicy:2; //0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA
- USHORT EOSP:1;
- USHORT TID:4;
-#else
USHORT TID:4;
USHORT EOSP:1;
USHORT AckPolicy:2; //0: normal ACK 1:No ACK 2:scheduled under MTBA/PSMP 3: BA
USHORT AMsduPresent:1;
USHORT Txop_QueueSize:8;
-#endif /* !RT_BIG_ENDIAN */
} QOS_CONTROL, *PQOS_CONTROL;
// 2-byte Frame control field
typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT Order:1; // Strict order expected
- USHORT Wep:1; // Wep data
- USHORT MoreData:1; // More data bit
- USHORT PwrMgmt:1; // Power management bit
- USHORT Retry:1; // Retry status bit
- USHORT MoreFrag:1; // More fragment bit
- USHORT FrDs:1; // From DS indication
- USHORT ToDs:1; // To DS indication
- USHORT SubType:4; // MSDU subtype
- USHORT Type:2; // MSDU type
- USHORT Ver:2; // Protocol version
-#else
USHORT Ver:2; // Protocol version
USHORT Type:2; // MSDU type
USHORT SubType:4; // MSDU subtype
@@ -110,7 +72,6 @@ typedef struct PACKED {
USHORT MoreData:1; // More data bit
USHORT Wep:1; // Wep data
USHORT Order:1; // Strict order expected
-#endif /* !RT_BIG_ENDIAN */
} FRAME_CONTROL, *PFRAME_CONTROL;
typedef struct PACKED _HEADER_802_11 {
@@ -119,13 +80,8 @@ typedef struct PACKED _HEADER_802_11 {
UCHAR Addr1[MAC_ADDR_LEN];
UCHAR Addr2[MAC_ADDR_LEN];
UCHAR Addr3[MAC_ADDR_LEN];
-#ifdef RT_BIG_ENDIAN
- USHORT Sequence:12;
- USHORT Frag:4;
-#else
USHORT Frag:4;
USHORT Sequence:12;
-#endif /* !RT_BIG_ENDIAN */
UCHAR Octet[0];
} HEADER_802_11, *PHEADER_802_11;
diff --git a/drivers/staging/rt3090/rtmp_iface.h b/drivers/staging/rt2860/rtmp_iface.h
index 168d0797fb6a..c24ece5b7244 100644
--- a/drivers/staging/rt3090/rtmp_iface.h
+++ b/drivers/staging/rt2860/rtmp_iface.h
@@ -37,10 +37,13 @@
#ifndef __RTMP_IFACE_H__
#define __RTMP_IFACE_H__
+
#ifdef RTMP_PCI_SUPPORT
-#include "rtmp_pci.h"
+#include "iface/rtmp_pci.h"
#endif // RTMP_PCI_SUPPORT //
-
+#ifdef RTMP_USB_SUPPORT
+#include "iface/rtmp_usb.h"
+#endif // RTMP_USB_SUPPORT //
typedef struct _INF_PCI_CONFIG_
{
diff --git a/drivers/staging/rt3090/rtmp_mcu.h b/drivers/staging/rt2860/rtmp_mcu.h
index e1b2fee9e105..e1b2fee9e105 100644
--- a/drivers/staging/rt3090/rtmp_mcu.h
+++ b/drivers/staging/rt2860/rtmp_mcu.h
diff --git a/drivers/staging/rt3090/rtmp_os.h b/drivers/staging/rt2860/rtmp_os.h
index 5646b2dfd6a8..350621d59d1b 100644
--- a/drivers/staging/rt3090/rtmp_os.h
+++ b/drivers/staging/rt2860/rtmp_os.h
@@ -43,6 +43,7 @@
#endif // LINUX //
+
/*
This data structure mainly strip some callback function defined in
"struct net_device" in kernel source "include/linux/netdevice.h".
@@ -90,4 +91,8 @@ typedef struct _RTMP_OS_TASK_
#endif
}RTMP_OS_TASK;
+
+int RtmpOSIRQRequest(IN PNET_DEV pNetDev);
+int RtmpOSIRQRelease(IN PNET_DEV pNetDev);
+
#endif // __RMTP_OS_H__ //
diff --git a/drivers/staging/rt3090/rtmp_timer.h b/drivers/staging/rt2860/rtmp_timer.h
index dfac124ebf14..5f6e3ce368a0 100644
--- a/drivers/staging/rt3090/rtmp_timer.h
+++ b/drivers/staging/rt2860/rtmp_timer.h
@@ -128,9 +128,10 @@ DECLARE_TIMER_FUNCTION(MlmeRssiReportExec);
DECLARE_TIMER_FUNCTION(AsicRxAntEvalTimeout);
DECLARE_TIMER_FUNCTION(APSDPeriodicExec);
DECLARE_TIMER_FUNCTION(AsicRfTuningExec);
+#ifdef RTMP_MAC_USB
+DECLARE_TIMER_FUNCTION(BeaconUpdateExec);
+#endif // RTMP_MAC_USB //
-
-#ifdef CONFIG_STA_SUPPORT
DECLARE_TIMER_FUNCTION(BeaconTimeout);
DECLARE_TIMER_FUNCTION(ScanTimeout);
DECLARE_TIMER_FUNCTION(AuthTimeout);
@@ -143,20 +144,13 @@ DECLARE_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc);
DECLARE_TIMER_FUNCTION(PsPollWakeExec);
DECLARE_TIMER_FUNCTION(RadioOnExec);
-#ifdef QOS_DLS_SUPPORT
-DECLARE_TIMER_FUNCTION(DlsTimeoutAction);
-#endif // QOS_DLS_SUPPORT //
-
-
-#endif // CONFIG_STA_SUPPORT //
-
-
-
+#ifdef RTMP_MAC_USB
+DECLARE_TIMER_FUNCTION(RtmpUsbStaAsicForceWakeupTimeout);
+#endif // RTMP_MAC_USB //
#if defined(AP_LED) || defined(STA_LED)
DECLARE_TIMER_FUNCTION(LedCtrlMain);
#endif
-
#endif // __RTMP_TIMER_H__ //
diff --git a/drivers/staging/rt2860/rtmp_type.h b/drivers/staging/rt2860/rtmp_type.h
index 1fd7df1e1791..f99cd2b4c48e 100644
--- a/drivers/staging/rt2860/rtmp_type.h
+++ b/drivers/staging/rt2860/rtmp_type.h
@@ -38,8 +38,10 @@
#ifndef __RTMP_TYPE_H__
#define __RTMP_TYPE_H__
+
#define PACKED __attribute__ ((packed))
+#ifdef LINUX
// Put platform dependent declaration here
// For example, linux type definition
typedef unsigned char UINT8;
@@ -48,6 +50,7 @@ typedef unsigned int UINT32;
typedef unsigned long long UINT64;
typedef int INT32;
typedef long long INT64;
+#endif // LINUX //
typedef unsigned char * PUINT8;
typedef unsigned short * PUINT16;
@@ -56,22 +59,30 @@ typedef unsigned long long * PUINT64;
typedef int * PINT32;
typedef long long * PINT64;
+// modified for fixing compile warning on Sigma 8634 platform
+typedef char STRING;
typedef signed char CHAR;
+
typedef signed short SHORT;
typedef signed int INT;
typedef signed long LONG;
typedef signed long long LONGLONG;
+#ifdef LINUX
typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned int UINT;
typedef unsigned long ULONG;
+#endif // LINUX //
typedef unsigned long long ULONGLONG;
typedef unsigned char BOOLEAN;
+#ifdef LINUX
typedef void VOID;
+#endif // LINUX //
+typedef char * PSTRING;
typedef VOID * PVOID;
typedef CHAR * PCHAR;
typedef UCHAR * PUCHAR;
@@ -90,5 +101,47 @@ typedef union _LARGE_INTEGER {
INT64 QuadPart;
} LARGE_INTEGER;
-#endif // __RTMP_TYPE_H__
+
+//
+// Register set pair for initialzation register set definition
+//
+typedef struct _RTMP_REG_PAIR
+{
+ ULONG Register;
+ ULONG Value;
+} RTMP_REG_PAIR, *PRTMP_REG_PAIR;
+
+typedef struct _REG_PAIR
+{
+ UCHAR Register;
+ UCHAR Value;
+} REG_PAIR, *PREG_PAIR;
+
+//
+// Register set pair for initialzation register set definition
+//
+typedef struct _RTMP_RF_REGS
+{
+ UCHAR Channel;
+ ULONG R1;
+ ULONG R2;
+ ULONG R3;
+ ULONG R4;
+} RTMP_RF_REGS, *PRTMP_RF_REGS;
+
+typedef struct _FREQUENCY_ITEM {
+ UCHAR Channel;
+ UCHAR N;
+ UCHAR R;
+ UCHAR K;
+} FREQUENCY_ITEM, *PFREQUENCY_ITEM;
+
+
+typedef int NTSTATUS;
+
+
+#define STATUS_SUCCESS 0x00
+#define STATUS_UNSUCCESSFUL 0x01
+
+#endif // __RTMP_TYPE_H__ //
diff --git a/drivers/staging/rt2860/rtusb_io.h b/drivers/staging/rt2860/rtusb_io.h
new file mode 100644
index 000000000000..055e4efac2f8
--- /dev/null
+++ b/drivers/staging/rt2860/rtusb_io.h
@@ -0,0 +1,189 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************
+*/
+
+
+#ifndef __RTUSB_IO_H__
+#define __RTUSB_IO_H__
+
+#include "rtmp_type.h"
+
+// New for MeetingHouse Api support
+#define CMDTHREAD_VENDOR_RESET 0x0D730101 // cmd
+#define CMDTHREAD_VENDOR_UNPLUG 0x0D730102 // cmd
+#define CMDTHREAD_VENDOR_SWITCH_FUNCTION 0x0D730103 // cmd
+#define CMDTHREAD_MULTI_WRITE_MAC 0x0D730107 // cmd
+#define CMDTHREAD_MULTI_READ_MAC 0x0D730108 // cmd
+#define CMDTHREAD_VENDOR_EEPROM_WRITE 0x0D73010A // cmd
+#define CMDTHREAD_VENDOR_EEPROM_READ 0x0D73010B // cmd
+#define CMDTHREAD_VENDOR_ENTER_TESTMODE 0x0D73010C // cmd
+#define CMDTHREAD_VENDOR_EXIT_TESTMODE 0x0D73010D // cmd
+#define CMDTHREAD_VENDOR_WRITE_BBP 0x0D730119 // cmd
+#define CMDTHREAD_VENDOR_READ_BBP 0x0D730118 // cmd
+#define CMDTHREAD_VENDOR_WRITE_RF 0x0D73011A // cmd
+#define CMDTHREAD_VENDOR_FLIP_IQ 0x0D73011D // cmd
+#define CMDTHREAD_RESET_BULK_OUT 0x0D730210 // cmd
+#define CMDTHREAD_RESET_BULK_IN 0x0D730211 // cmd
+#define CMDTHREAD_SET_PSM_BIT 0x0D730212 // cmd
+#define CMDTHREAD_SET_RADIO 0x0D730214 // cmd
+#define CMDTHREAD_UPDATE_TX_RATE 0x0D730216 // cmd
+#define CMDTHREAD_802_11_ADD_KEY_WEP 0x0D730218 // cmd
+#define CMDTHREAD_RESET_FROM_ERROR 0x0D73021A // cmd
+#define CMDTHREAD_LINK_DOWN 0x0D73021B // cmd
+#define CMDTHREAD_RESET_FROM_NDIS 0x0D73021C // cmd
+#define CMDTHREAD_CHECK_GPIO 0x0D730215 // cmd
+#define CMDTHREAD_FORCE_WAKE_UP 0x0D730222 // cmd
+#define CMDTHREAD_SET_BW 0x0D730225 // cmd
+#define CMDTHREAD_SET_ASIC_WCID 0x0D730226 // cmd
+#define CMDTHREAD_SET_ASIC_WCID_CIPHER 0x0D730227 // cmd
+#define CMDTHREAD_QKERIODIC_EXECUT 0x0D73023D // cmd
+#define RT_CMD_SET_KEY_TABLE 0x0D730228 // cmd
+#define RT_CMD_SET_RX_WCID_TABLE 0x0D730229 // cmd
+#define CMDTHREAD_SET_CLIENT_MAC_ENTRY 0x0D73023E // cmd
+#define CMDTHREAD_SET_GROUP_KEY 0x0D73023F // cmd
+#define CMDTHREAD_SET_PAIRWISE_KEY 0x0D730240 // cmd
+
+#define CMDTHREAD_802_11_QUERY_HARDWARE_REGISTER 0x0D710105 // cmd
+#define CMDTHREAD_802_11_SET_PHY_MODE 0x0D79010C // cmd
+#define CMDTHREAD_802_11_SET_STA_CONFIG 0x0D790111 // cmd
+#define CMDTHREAD_802_11_SET_PREAMBLE 0x0D790101 // cmd
+#define CMDTHREAD_802_11_COUNTER_MEASURE 0x0D790102 // cmd
+// add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
+#define CMDTHREAD_UPDATE_PROTECT 0x0D790103 // cmd
+// end johnli
+
+
+//CMDTHREAD_MULTI_READ_MAC
+//CMDTHREAD_MULTI_WRITE_MAC
+//CMDTHREAD_VENDOR_EEPROM_READ
+//CMDTHREAD_VENDOR_EEPROM_WRITE
+typedef struct _CMDHandler_TLV {
+ USHORT Offset;
+ USHORT Length;
+ UCHAR DataFirst;
+} CMDHandler_TLV, *PCMDHandler_TLV;
+
+
+typedef struct _CmdQElmt {
+ UINT command;
+ PVOID buffer;
+ ULONG bufferlength;
+ BOOLEAN CmdFromNdis;
+ BOOLEAN SetOperation;
+ struct _CmdQElmt *next;
+} CmdQElmt, *PCmdQElmt;
+
+typedef struct _CmdQ {
+ UINT size;
+ CmdQElmt *head;
+ CmdQElmt *tail;
+ UINT32 CmdQState;
+}CmdQ, *PCmdQ;
+
+
+#define EnqueueCmd(cmdq, cmdqelmt) \
+{ \
+ if (cmdq->size == 0) \
+ cmdq->head = cmdqelmt; \
+ else \
+ cmdq->tail->next = cmdqelmt; \
+ cmdq->tail = cmdqelmt; \
+ cmdqelmt->next = NULL; \
+ cmdq->size++; \
+}
+
+
+/******************************************************************************
+
+ USB Cmd to ASIC Related MACRO
+
+******************************************************************************/
+// reset MAC of a station entry to 0xFFFFFFFFFFFF
+#define RTMP_STA_ENTRY_MAC_RESET(pAd, Wcid) \
+ { RT_SET_ASIC_WCID SetAsicWcid; \
+ SetAsicWcid.WCID = Wcid; \
+ SetAsicWcid.SetTid = 0xffffffff; \
+ SetAsicWcid.DeleteTid = 0xffffffff; \
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID, \
+ &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); }
+
+// add this entry into ASIC RX WCID search table
+#define RTMP_STA_ENTRY_ADD(pAd, pEntry) \
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_CLIENT_MAC_ENTRY, \
+ pEntry, sizeof(MAC_TABLE_ENTRY));
+
+// add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
+// Set MAC register value according operation mode
+#define RTMP_UPDATE_PROTECT(pAd) \
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_UPDATE_PROTECT, NULL, 0);
+// end johnli
+
+// remove Pair-wise key material from ASIC
+// yet implement
+#define RTMP_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid)
+
+// add Client security information into ASIC WCID table and IVEIV table
+#define RTMP_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
+ { RTMP_STA_ENTRY_MAC_RESET(pAd, pEntry->Aid); \
+ if (pEntry->Aid >= 1) { \
+ RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri; \
+ SetAsicWcidAttri.WCID = pEntry->Aid; \
+ if ((pEntry->AuthMode <= Ndis802_11AuthModeAutoSwitch) && \
+ (pEntry->WepStatus == Ndis802_11Encryption1Enabled)) \
+ { \
+ SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
+ } \
+ else if (pEntry->AuthMode == Ndis802_11AuthModeWPANone) \
+ { \
+ SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
+ } \
+ else SetAsicWcidAttri.Cipher = 0; \
+ DBGPRINT(RT_DEBUG_TRACE, ("aid cipher = %ld\n",SetAsicWcidAttri.Cipher)); \
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID_CIPHER, \
+ &SetAsicWcidAttri, sizeof(RT_SET_ASIC_WCID_ATTRI)); } }
+
+// Insert the BA bitmap to ASIC for the Wcid entry
+#define RTMP_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
+ do{ \
+ RT_SET_ASIC_WCID SetAsicWcid; \
+ SetAsicWcid.WCID = (_Aid); \
+ SetAsicWcid.SetTid = (0x10000<<(_TID)); \
+ SetAsicWcid.DeleteTid = 0xffffffff; \
+ RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); \
+ }while(0)
+
+// Remove the BA bitmap from ASIC for the Wcid entry
+#define RTMP_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
+ do{ \
+ RT_SET_ASIC_WCID SetAsicWcid; \
+ SetAsicWcid.WCID = (_Wcid); \
+ SetAsicWcid.SetTid = (0xffffffff); \
+ SetAsicWcid.DeleteTid = (0x10000<<(_TID) ); \
+ RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); \
+ }while(0)
+
+
+#endif // __RTUSB_IO_H__ //
diff --git a/drivers/staging/rt2860/spectrum.h b/drivers/staging/rt2860/spectrum.h
index 0a878ba81b48..b9fc67603385 100644
--- a/drivers/staging/rt2860/spectrum.h
+++ b/drivers/staging/rt2860/spectrum.h
@@ -23,7 +23,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
*************************************************************************
-*/
+ */
#ifndef __SPECTRUM_H__
#define __SPECTRUM_H__
@@ -31,112 +31,10 @@
#include "rtmp_type.h"
#include "spectrum_def.h"
-typedef struct PACKED _TPC_REPORT_INFO
-{
- UINT8 TxPwr;
- UINT8 LinkMargin;
-} TPC_REPORT_INFO, *PTPC_REPORT_INFO;
-
-typedef struct PACKED _CH_SW_ANN_INFO
-{
- UINT8 ChSwMode;
- UINT8 Channel;
- UINT8 ChSwCnt;
-} CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
-
-typedef union PACKED _MEASURE_REQ_MODE
-{
- struct PACKED
- {
- UINT8 Rev0:1;
- UINT8 Enable:1;
- UINT8 Request:1;
- UINT8 Report:1;
- UINT8 Rev1:4;
- } field;
- UINT8 word;
-} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
-
-typedef struct PACKED _MEASURE_REQ
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
-} MEASURE_REQ, *PMEASURE_REQ;
-
-typedef struct PACKED _MEASURE_REQ_INFO
-{
- UINT8 Token;
- MEASURE_REQ_MODE ReqMode;
- UINT8 ReqType;
- MEASURE_REQ MeasureReq;
-} MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
-
-typedef union PACKED _MEASURE_BASIC_REPORT_MAP
-{
- struct PACKED
- {
- UINT8 BSS:1;
- UINT8 OfdmPreamble:1;
- UINT8 UnidentifiedSignal:1;
- UINT8 Radar:1;
- UINT8 Unmeasure:1;
- UINT8 Rev:3;
- } field;
- UINT8 word;
-} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
-
-typedef struct PACKED _MEASURE_BASIC_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- MEASURE_BASIC_REPORT_MAP Map;
-} MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
-
-typedef struct PACKED _MEASURE_CCA_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- UINT8 CCA_Busy_Fraction;
-} MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
-
-typedef struct PACKED _MEASURE_RPI_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- UINT8 RPI_Density[8];
-} MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
-
-typedef union PACKED _MEASURE_REPORT_MODE
-{
- struct PACKED
- {
- UINT8 Late:1;
- UINT8 Incapable:1;
- UINT8 Refused:1;
- UINT8 Rev:5;
- } field;
- UINT8 word;
-} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
-
-typedef struct PACKED _MEASURE_REPORT_INFO
-{
- UINT8 Token;
- MEASURE_REPORT_MODE ReportMode;
- UINT8 ReportType;
- UINT8 Octect[0];
-} MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
-
-typedef struct PACKED _QUIET_INFO
-{
- UINT8 QuietCnt;
- UINT8 QuietPeriod;
- UINT8 QuietDuration;
- UINT8 QuietOffset;
-} QUIET_INFO, *PQUIET_INFO;
+
+CHAR RTMP_GetTxPwr(
+ IN PRTMP_ADAPTER pAd,
+ IN HTTRANSMIT_SETTING HTTxMode);
/*
==========================================================================
@@ -150,14 +48,17 @@ typedef struct PACKED _QUIET_INFO
Return : None.
==========================================================================
*/
-VOID EnqueueMeasurementReq(
+VOID MakeMeasurementReqFrame(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
+ OUT PUCHAR pOutBuffer,
+ OUT PULONG pFrameLen,
+ IN UINT8 TotalLen,
+ IN UINT8 Category,
+ IN UINT8 Action,
IN UINT8 MeasureToken,
IN UINT8 MeasureReqMode,
IN UINT8 MeasureReqType,
- IN UINT8 MeasureCh,
- IN UINT16 MeasureDuration);
+ IN UINT8 NumOfRepetitions);
/*
==========================================================================
@@ -264,11 +165,16 @@ VOID PeerSpectrumAction(
*/
INT Set_MeasureReq_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_TpcReq_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
+
+INT Set_PwrConstraint(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
VOID MeasureReqTabInit(
IN PRTMP_ADAPTER pAd);
@@ -276,6 +182,38 @@ VOID MeasureReqTabInit(
VOID MeasureReqTabExit(
IN PRTMP_ADAPTER pAd);
+PMEASURE_REQ_ENTRY MeasureReqLookUp(
+ IN PRTMP_ADAPTER pAd,
+ IN UINT8 DialogToken);
+
+PMEASURE_REQ_ENTRY MeasureReqInsert(
+ IN PRTMP_ADAPTER pAd,
+ IN UINT8 DialogToken);
+
+VOID MeasureReqDelete(
+ IN PRTMP_ADAPTER pAd,
+ IN UINT8 DialogToken);
+
+VOID InsertChannelRepIE(
+ IN PRTMP_ADAPTER pAd,
+ OUT PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN PSTRING pCountry,
+ IN UINT8 RegulatoryClass);
+
+VOID InsertTpcReportIE(
+ IN PRTMP_ADAPTER pAd,
+ OUT PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN UINT8 TxPwr,
+ IN UINT8 LinkMargin);
+
+VOID InsertDialogToken(
+ IN PRTMP_ADAPTER pAd,
+ OUT PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN UINT8 DialogToken);
+
VOID TpcReqTabInit(
IN PRTMP_ADAPTER pAd);
@@ -288,5 +226,10 @@ VOID NotifyChSwAnnToPeerAPs(
IN PUCHAR pTA,
IN UINT8 ChSwMode,
IN UINT8 Channel);
+
+VOID RguClass_BuildBcnChList(
+ IN PRTMP_ADAPTER pAd,
+ OUT PUCHAR pBuf,
+ OUT PULONG pBufLen);
#endif // __SPECTRUM_H__ //
diff --git a/drivers/staging/rt2860/spectrum_def.h b/drivers/staging/rt2860/spectrum_def.h
index 4ca4817bba05..ae67014a4703 100644
--- a/drivers/staging/rt2860/spectrum_def.h
+++ b/drivers/staging/rt2860/spectrum_def.h
@@ -39,21 +39,15 @@
#ifndef __SPECTRUM_DEF_H__
#define __SPECTRUM_DEF_H__
-#define MAX_MEASURE_REQ_TAB_SIZE 3
+
+#define MAX_MEASURE_REQ_TAB_SIZE 32
#define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE
-#define MAX_TPC_REQ_TAB_SIZE 3
+#define MAX_TPC_REQ_TAB_SIZE 32
#define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE
#define MIN_RCV_PWR 100 /* Negative value ((dBm) */
-#define RM_TPC_REQ 0
-#define RM_MEASURE_REQ 1
-
-#define RM_BASIC 0
-#define RM_CCA 1
-#define RM_RPI_HISTOGRAM 2
-
#define TPC_REQ_AGE_OUT 500 /* ms */
#define MQ_REQ_AGE_OUT 500 /* ms */
@@ -91,5 +85,141 @@ typedef struct _TPC_REQ_TAB
TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE];
} TPC_REQ_TAB, *PTPC_REQ_TAB;
+
+/* The regulatory information */
+typedef struct _DOT11_CHANNEL_SET
+{
+ UCHAR NumberOfChannels;
+ UINT8 MaxTxPwr;
+ UCHAR ChannelList[16];
+} DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET;
+
+typedef struct _DOT11_REGULATORY_INFORMATION
+{
+ UCHAR RegulatoryClass;
+ DOT11_CHANNEL_SET ChannelSet;
+} DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION;
+
+
+
+#define RM_TPC_REQ 0
+#define RM_MEASURE_REQ 1
+
+#define RM_BASIC 0
+#define RM_CCA 1
+#define RM_RPI_HISTOGRAM 2
+#define RM_CH_LOAD 3
+#define RM_NOISE_HISTOGRAM 4
+
+
+typedef struct PACKED _TPC_REPORT_INFO
+{
+ UINT8 TxPwr;
+ UINT8 LinkMargin;
+} TPC_REPORT_INFO, *PTPC_REPORT_INFO;
+
+typedef struct PACKED _CH_SW_ANN_INFO
+{
+ UINT8 ChSwMode;
+ UINT8 Channel;
+ UINT8 ChSwCnt;
+} CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
+
+typedef union PACKED _MEASURE_REQ_MODE
+{
+ struct PACKED
+ {
+ UINT8 Parallel:1;
+ UINT8 Enable:1;
+ UINT8 Request:1;
+ UINT8 Report:1;
+ UINT8 DurationMandatory:1;
+ UINT8 :3;
+ } field;
+ UINT8 word;
+} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
+
+typedef struct PACKED _MEASURE_REQ
+{
+ UINT8 ChNum;
+ UINT64 MeasureStartTime;
+ UINT16 MeasureDuration;
+} MEASURE_REQ, *PMEASURE_REQ;
+
+typedef struct PACKED _MEASURE_REQ_INFO
+{
+ UINT8 Token;
+ MEASURE_REQ_MODE ReqMode;
+ UINT8 ReqType;
+ UINT8 Oct[0];
+} MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
+
+typedef union PACKED _MEASURE_BASIC_REPORT_MAP
+{
+ struct PACKED
+ {
+ UINT8 BSS:1;
+
+ UINT8 OfdmPreamble:1;
+ UINT8 UnidentifiedSignal:1;
+ UINT8 Radar:1;
+ UINT8 Unmeasure:1;
+ UINT8 Rev:3;
+ } field;
+ UINT8 word;
+} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
+
+typedef struct PACKED _MEASURE_BASIC_REPORT
+{
+ UINT8 ChNum;
+ UINT64 MeasureStartTime;
+ UINT16 MeasureDuration;
+ MEASURE_BASIC_REPORT_MAP Map;
+} MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
+
+typedef struct PACKED _MEASURE_CCA_REPORT
+{
+ UINT8 ChNum;
+ UINT64 MeasureStartTime;
+ UINT16 MeasureDuration;
+ UINT8 CCA_Busy_Fraction;
+} MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
+
+typedef struct PACKED _MEASURE_RPI_REPORT
+{
+ UINT8 ChNum;
+ UINT64 MeasureStartTime;
+ UINT16 MeasureDuration;
+ UINT8 RPI_Density[8];
+} MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
+
+typedef union PACKED _MEASURE_REPORT_MODE
+{
+ struct PACKED
+ {
+ UINT8 Late:1;
+ UINT8 Incapable:1;
+ UINT8 Refused:1;
+ UINT8 Rev:5;
+ } field;
+ UINT8 word;
+} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
+
+typedef struct PACKED _MEASURE_REPORT_INFO
+{
+ UINT8 Token;
+ UINT8 ReportMode;
+ UINT8 ReportType;
+ UINT8 Octect[0];
+} MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
+
+typedef struct PACKED _QUIET_INFO
+{
+ UINT8 QuietCnt;
+ UINT8 QuietPeriod;
+ UINT16 QuietDuration;
+ UINT16 QuietOffset;
+} QUIET_INFO, *PQUIET_INFO;
+
#endif // __SPECTRUM_DEF_H__ //
diff --git a/drivers/staging/rt2860/sta/aironet.c b/drivers/staging/rt2860/sta/aironet.c
deleted file mode 100644
index 4af4a1906181..000000000000
--- a/drivers/staging/rt2860/sta/aironet.c
+++ /dev/null
@@ -1,1312 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- aironet.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 04-06-15 Initial
-*/
-#include "../rt_config.h"
-
-/*
- ==========================================================================
- Description:
- association state machine init, including state transition and timer init
- Parameters:
- S - pointer to the association state machine
- ==========================================================================
- */
-VOID AironetStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(S, Trans, MAX_AIRONET_STATE, MAX_AIRONET_MSG, (STATE_MACHINE_FUNC)Drop, AIRONET_IDLE, AIRONET_MACHINE_BASE);
- StateMachineSetAction(S, AIRONET_IDLE, MT2_AIRONET_MSG, (STATE_MACHINE_FUNC)AironetMsgAction);
- StateMachineSetAction(S, AIRONET_IDLE, MT2_AIRONET_SCAN_REQ, (STATE_MACHINE_FUNC)AironetRequestAction);
- StateMachineSetAction(S, AIRONET_SCANNING, MT2_AIRONET_SCAN_DONE, (STATE_MACHINE_FUNC)AironetReportAction);
-}
-
-/*
- ==========================================================================
- Description:
- This is state machine function.
- When receiving EAPOL packets which is for 802.1x key management.
- Use both in WPA, and WPAPSK case.
- In this function, further dispatch to different functions according to the received packet. 3 categories are :
- 1. normal 4-way pairwisekey and 2-way groupkey handshake
- 2. MIC error (Countermeasures attack) report packet from STA.
- 3. Request for pairwise/group key update from STA
- Return:
- ==========================================================================
-*/
-VOID AironetMsgAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Length;
- UCHAR Index, i;
- PUCHAR pData;
- PAIRONET_RM_REQUEST_FRAME pRMReq;
- PRM_REQUEST_ACTION pReqElem;
-
- DBGPRINT(RT_DEBUG_TRACE, ("-----> AironetMsgAction\n"));
-
- // 0. Get Aironet IAPP header first
- pRMReq = (PAIRONET_RM_REQUEST_FRAME) &Elem->Msg[LENGTH_802_11];
- pData = (PUCHAR) &Elem->Msg[LENGTH_802_11];
-
- // 1. Change endian format form network to little endian
- Length = be2cpu16(pRMReq->IAPP.Length);
-
- // 2.0 Sanity check, this should only happen when CCX 2.0 support is enabled
- if (pAd->StaCfg.CCXEnable != TRUE)
- return;
-
- // 2.1 Radio measurement must be on
- if (pAd->StaCfg.CCXControl.field.RMEnable != 1)
- return;
-
- // 2.2. Debug print all bit information
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP ID & Length %d\n", Length));
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP Type %x\n", pRMReq->IAPP.Type));
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP SubType %x\n", pRMReq->IAPP.SubType));
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP Dialog Token %x\n", pRMReq->IAPP.Token));
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP Activation Delay %x\n", pRMReq->Delay));
- DBGPRINT(RT_DEBUG_TRACE, ("IAPP Measurement Offset %x\n", pRMReq->Offset));
-
- // 3. Check IAPP frame type, it must be 0x32 for Cisco Aironet extension
- if (pRMReq->IAPP.Type != AIRONET_IAPP_TYPE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Wrong IAPP type for Cisco Aironet extension\n"));
- return;
- }
-
- // 4. Check IAPP frame subtype, it must be 0x01 for Cisco Aironet extension request.
- // Since we are acting as client only, we will disregards reply subtype.
- if (pRMReq->IAPP.SubType != AIRONET_IAPP_SUBTYPE_REQUEST)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Wrong IAPP subtype for Cisco Aironet extension\n"));
- return;
- }
-
- // 5. Verify Destination MAC and Source MAC, both should be all zeros.
- if (! MAC_ADDR_EQUAL(pRMReq->IAPP.DA, ZERO_MAC_ADDR))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Wrong IAPP DA for Cisco Aironet extension, it's not Zero\n"));
- return;
- }
-
- if (! MAC_ADDR_EQUAL(pRMReq->IAPP.SA, ZERO_MAC_ADDR))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Wrong IAPP SA for Cisco Aironet extension, it's not Zero\n"));
- return;
- }
-
- // 6. Reinit all report related fields
- NdisZeroMemory(pAd->StaCfg.FrameReportBuf, 2048);
- NdisZeroMemory(pAd->StaCfg.BssReportOffset, sizeof(USHORT) * MAX_LEN_OF_BSS_TABLE);
- NdisZeroMemory(pAd->StaCfg.MeasurementRequest, sizeof(RM_REQUEST_ACTION) * 4);
-
- // 7. Point to the start of first element report element
- pAd->StaCfg.FrameReportLen = LENGTH_802_11 + sizeof(AIRONET_IAPP_HEADER);
- DBGPRINT(RT_DEBUG_TRACE, ("FR len = %d\n", pAd->StaCfg.FrameReportLen));
- pAd->StaCfg.LastBssIndex = 0xff;
- pAd->StaCfg.RMReqCnt = 0;
- pAd->StaCfg.ParallelReq = FALSE;
- pAd->StaCfg.ParallelDuration = 0;
- pAd->StaCfg.ParallelChannel = 0;
- pAd->StaCfg.IAPPToken = pRMReq->IAPP.Token;
- pAd->StaCfg.CurrentRMReqIdx = 0;
- pAd->StaCfg.CLBusyBytes = 0;
- // Reset the statistics
- for (i = 0; i < 8; i++)
- pAd->StaCfg.RPIDensity[i] = 0;
-
- Index = 0;
-
- // 8. Save dialog token for report
- pAd->StaCfg.IAPPToken = pRMReq->IAPP.Token;
-
- // Save Activation delay & measurement offset, Not really needed
-
- // 9. Point to the first request element
- pData += sizeof(AIRONET_RM_REQUEST_FRAME);
- // Length should exclude the CISCO Aironet SNAP header
- Length -= (sizeof(AIRONET_RM_REQUEST_FRAME) - LENGTH_802_1_H);
-
- // 10. Start Parsing the Measurement elements.
- // Be careful about multiple MR elements within one frames.
- while (Length > 0)
- {
- pReqElem = (PRM_REQUEST_ACTION) pData;
- switch (pReqElem->ReqElem.Eid)
- {
- case IE_MEASUREMENT_REQUEST:
- // From the example, it seems we only need to support one request in one frame
- // There is no multiple request in one frame.
- // Besides, looks like we need to take care the measurement request only.
- // The measurement request is always 4 bytes.
-
- // Start parsing this type of request.
- // 0. Eid is IE_MEASUREMENT_REQUEST
- // 1. Length didn't include Eid and Length field, it always be 8.
- // 2. Measurement Token, we nned to save it for the corresponding report.
- // 3. Measurement Mode, Although there are definitions, but we din't see value other than
- // 0 from test specs examples.
- // 4. Measurement Type, this is what we need to do.
- switch (pReqElem->ReqElem.Type)
- {
- case MSRN_TYPE_CHANNEL_LOAD_REQ:
- case MSRN_TYPE_NOISE_HIST_REQ:
- case MSRN_TYPE_BEACON_REQ:
- // Check the Enable non-serving channel measurement control
- if (pAd->StaCfg.CCXControl.field.DCRMEnable == 0)
- {
- // Check channel before enqueue the action
- if (pReqElem->Measurement.Channel != pAd->CommonCfg.Channel)
- break;
- }
- else
- {
- // If off channel measurement, check the TU duration limit
- if (pReqElem->Measurement.Channel != pAd->CommonCfg.Channel)
- if (pReqElem->Measurement.Duration > pAd->StaCfg.CCXControl.field.TuLimit)
- break;
- }
-
- // Save requests and execute actions later
- NdisMoveMemory(&pAd->StaCfg.MeasurementRequest[Index], pReqElem, sizeof(RM_REQUEST_ACTION));
- Index += 1;
- break;
-
- case MSRN_TYPE_FRAME_REQ:
- // Since it's option, we will support later
- // FrameRequestAction(pAd, pData);
- break;
-
- default:
- break;
- }
-
- // Point to next Measurement request
- pData += sizeof(RM_REQUEST_ACTION);
- Length -= sizeof(RM_REQUEST_ACTION);
- break;
-
- // We accept request only, all others are dropped
- case IE_MEASUREMENT_REPORT:
- case IE_AP_TX_POWER:
- case IE_MEASUREMENT_CAPABILITY:
- default:
- return;
- }
- }
-
- // 11. Update some flags and index
- pAd->StaCfg.RMReqCnt = Index;
-
- if (Index)
- {
- MlmeEnqueue(pAd, AIRONET_STATE_MACHINE, MT2_AIRONET_SCAN_REQ, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<----- AironetMsgAction\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID AironetRequestAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PRM_REQUEST_ACTION pReq;
-
- // 1. Point to next request element
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[pAd->StaCfg.CurrentRMReqIdx];
-
- // 2. Parse measurement type and call appropriate functions
- if (pReq->ReqElem.Type == MSRN_TYPE_CHANNEL_LOAD_REQ)
- // Channel Load measurement request
- ChannelLoadRequestAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else if (pReq->ReqElem.Type == MSRN_TYPE_NOISE_HIST_REQ)
- // Noise Histogram measurement request
- NoiseHistRequestAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else if (pReq->ReqElem.Type == MSRN_TYPE_BEACON_REQ)
- // Beacon measurement request
- BeaconRequestAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else
- // Unknown. Do nothing and return, this should never happen
- return;
-
- // 3. Peek into the next request, if it's parallel, we will update the scan time to the largest one
- if ((pAd->StaCfg.CurrentRMReqIdx + 1) < pAd->StaCfg.RMReqCnt)
- {
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[pAd->StaCfg.CurrentRMReqIdx + 1];
- // Check for parallel bit
- if ((pReq->ReqElem.Mode & 0x01) && (pReq->Measurement.Channel == pAd->StaCfg.CCXScanChannel))
- {
- // Update parallel mode request information
- pAd->StaCfg.ParallelReq = TRUE;
- pAd->StaCfg.CCXScanTime = ((pReq->Measurement.Duration > pAd->StaCfg.CCXScanTime) ?
- (pReq->Measurement.Duration) : (pAd->StaCfg.CCXScanTime));
- }
- }
-
- // 4. Call RT28XX_MLME_HANDLER to execute the request mlme commands, Scan request is the only one used
- RT28XX_MLME_HANDLER(pAd);
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Prepare channel load report action, special scan operation added
- to support
-
- Arguments:
- pAd Pointer to our adapter
- pData Start from element ID
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID ChannelLoadRequestAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- PRM_REQUEST_ACTION pReq;
- MLME_SCAN_REQ_STRUCT ScanReq;
- UCHAR ZeroSsid[32];
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- PHEADER_802_11 pNullFrame;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ChannelLoadRequestAction ----->\n"));
-
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[Index];
- NdisZeroMemory(ZeroSsid, 32);
-
- // Prepare for special scan request
- // The scan definition is different with our Active, Passive scan definition.
- // For CCX2, Active means send out probe request with broadcast BSSID.
- // Passive means no probe request sent, only listen to the beacons.
- // The channel scanned is fixed as specified, no need to scan all channels.
- // The scan wait time is specified in the request too.
- // Passive scan Mode
-
- // Control state machine is not idle, reject the request
- if ((pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE) && (Index == 0))
- return;
-
- // Fill out stuff for scan request
- ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_CISCO_CHANNEL_LOAD);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
-
- // Reset some internal control flags to make sure this scan works.
- BssTableInit(&pAd->StaCfg.CCXBssTab);
- pAd->StaCfg.ScanCnt = 0;
- pAd->StaCfg.CCXScanChannel = pReq->Measurement.Channel;
- pAd->StaCfg.CCXScanTime = pReq->Measurement.Duration;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Duration %d, Channel %d!\n", pReq->Measurement.Duration, pReq->Measurement.Channel));
-
- // If it's non serving channel scan, send out a null frame with PSM bit on.
- if (pAd->StaCfg.CCXScanChannel != pAd->CommonCfg.Channel)
- {
- // Use MLME enqueue method
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- pNullFrame = (PHEADER_802_11) pOutBuffer;;
- // Make the power save Null frame with PSM bit on
- MgtMacHeaderInit(pAd, pNullFrame, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pNullFrame->Duration = 0;
- pNullFrame->FC.Type = BTYPE_DATA;
- pNullFrame->FC.PwrMgmt = PWR_SAVE;
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_TRACE, ("Send PSM Data frame for off channel RM\n"));
- RTMPusecDelay(5000);
- }
-
- pAd->StaCfg.CCXReqType = MSRN_TYPE_CHANNEL_LOAD_REQ;
- pAd->StaCfg.CLBusyBytes = 0;
- // Enable Rx with promiscuous reception
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, 0x1010);
-
- // Set channel load measurement flag
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_MEASUREMENT);
-
- pAd->Mlme.AironetMachine.CurrState = AIRONET_SCANNING;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ChannelLoadRequestAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Prepare noise histogram report action, special scan operation added
- to support
-
- Arguments:
- pAd Pointer to our adapter
- pData Start from element ID
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID NoiseHistRequestAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- PRM_REQUEST_ACTION pReq;
- MLME_SCAN_REQ_STRUCT ScanReq;
- UCHAR ZeroSsid[32], i;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- PHEADER_802_11 pNullFrame;
-
- DBGPRINT(RT_DEBUG_TRACE, ("NoiseHistRequestAction ----->\n"));
-
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[Index];
- NdisZeroMemory(ZeroSsid, 32);
-
- // Prepare for special scan request
- // The scan definition is different with our Active, Passive scan definition.
- // For CCX2, Active means send out probe request with broadcast BSSID.
- // Passive means no probe request sent, only listen to the beacons.
- // The channel scanned is fixed as specified, no need to scan all channels.
- // The scan wait time is specified in the request too.
- // Passive scan Mode
-
- // Control state machine is not idle, reject the request
- if ((pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE) && (Index == 0))
- return;
-
- // Fill out stuff for scan request
- ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_CISCO_NOISE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
-
- // Reset some internal control flags to make sure this scan works.
- BssTableInit(&pAd->StaCfg.CCXBssTab);
- pAd->StaCfg.ScanCnt = 0;
- pAd->StaCfg.CCXScanChannel = pReq->Measurement.Channel;
- pAd->StaCfg.CCXScanTime = pReq->Measurement.Duration;
- pAd->StaCfg.CCXReqType = MSRN_TYPE_NOISE_HIST_REQ;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Duration %d, Channel %d!\n", pReq->Measurement.Duration, pReq->Measurement.Channel));
-
- // If it's non serving channel scan, send out a null frame with PSM bit on.
- if (pAd->StaCfg.CCXScanChannel != pAd->CommonCfg.Channel)
- {
- // Use MLME enqueue method
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- pNullFrame = (PHEADER_802_11) pOutBuffer;
- // Make the power save Null frame with PSM bit on
- MgtMacHeaderInit(pAd, pNullFrame, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pNullFrame->Duration = 0;
- pNullFrame->FC.Type = BTYPE_DATA;
- pNullFrame->FC.PwrMgmt = PWR_SAVE;
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_TRACE, ("Send PSM Data frame for off channel RM\n"));
- RTMPusecDelay(5000);
- }
-
- // Reset the statistics
- for (i = 0; i < 8; i++)
- pAd->StaCfg.RPIDensity[i] = 0;
-
- // Enable Rx with promiscuous reception
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, 0x1010);
-
- // Set channel load measurement flag
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_MEASUREMENT);
-
- pAd->Mlme.AironetMachine.CurrState = AIRONET_SCANNING;
-
- DBGPRINT(RT_DEBUG_TRACE, ("NoiseHistRequestAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Prepare Beacon report action, special scan operation added
- to support
-
- Arguments:
- pAd Pointer to our adapter
- pData Start from element ID
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID BeaconRequestAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- PRM_REQUEST_ACTION pReq;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- PHEADER_802_11 pNullFrame;
- MLME_SCAN_REQ_STRUCT ScanReq;
- UCHAR ZeroSsid[32];
-
- DBGPRINT(RT_DEBUG_TRACE, ("BeaconRequestAction ----->\n"));
-
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[Index];
- NdisZeroMemory(ZeroSsid, 32);
-
- // Prepare for special scan request
- // The scan definition is different with our Active, Passive scan definition.
- // For CCX2, Active means send out probe request with broadcast BSSID.
- // Passive means no probe request sent, only listen to the beacons.
- // The channel scanned is fixed as specified, no need to scan all channels.
- // The scan wait time is specified in the request too.
- if (pReq->Measurement.ScanMode == MSRN_SCAN_MODE_PASSIVE)
- {
- // Passive scan Mode
- DBGPRINT(RT_DEBUG_TRACE, ("Passive Scan Mode!\n"));
-
- // Control state machine is not idle, reject the request
- if ((pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE) && (Index == 0))
- return;
-
- // Fill out stuff for scan request
- ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_CISCO_PASSIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
-
- // Reset some internal control flags to make sure this scan works.
- BssTableInit(&pAd->StaCfg.CCXBssTab);
- pAd->StaCfg.ScanCnt = 0;
- pAd->StaCfg.CCXScanChannel = pReq->Measurement.Channel;
- pAd->StaCfg.CCXScanTime = pReq->Measurement.Duration;
- pAd->StaCfg.CCXReqType = MSRN_TYPE_BEACON_REQ;
- DBGPRINT(RT_DEBUG_TRACE, ("Duration %d!\n", pReq->Measurement.Duration));
-
- // If it's non serving channel scan, send out a null frame with PSM bit on.
- if (pAd->StaCfg.CCXScanChannel != pAd->CommonCfg.Channel)
- {
- // Use MLME enqueue method
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- pNullFrame = (PHEADER_802_11) pOutBuffer;
- // Make the power save Null frame with PSM bit on
- MgtMacHeaderInit(pAd, pNullFrame, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pNullFrame->Duration = 0;
- pNullFrame->FC.Type = BTYPE_DATA;
- pNullFrame->FC.PwrMgmt = PWR_SAVE;
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_TRACE, ("Send PSM Data frame for off channel RM\n"));
- RTMPusecDelay(5000);
- }
-
- pAd->Mlme.AironetMachine.CurrState = AIRONET_SCANNING;
- }
- else if (pReq->Measurement.ScanMode == MSRN_SCAN_MODE_ACTIVE)
- {
- // Active scan Mode
- DBGPRINT(RT_DEBUG_TRACE, ("Active Scan Mode!\n"));
-
- // Control state machine is not idle, reject the request
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- return;
-
- // Fill out stuff for scan request
- ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_CISCO_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
-
- // Reset some internal control flags to make sure this scan works.
- BssTableInit(&pAd->StaCfg.CCXBssTab);
- pAd->StaCfg.ScanCnt = 0;
- pAd->StaCfg.CCXScanChannel = pReq->Measurement.Channel;
- pAd->StaCfg.CCXScanTime = pReq->Measurement.Duration;
- pAd->StaCfg.CCXReqType = MSRN_TYPE_BEACON_REQ;
- DBGPRINT(RT_DEBUG_TRACE, ("Duration %d!\n", pReq->Measurement.Duration));
-
- // If it's non serving channel scan, send out a null frame with PSM bit on.
- if (pAd->StaCfg.CCXScanChannel != pAd->CommonCfg.Channel)
- {
- // Use MLME enqueue method
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- pNullFrame = (PHEADER_802_11) pOutBuffer;
- // Make the power save Null frame with PSM bit on
- MgtMacHeaderInit(pAd, pNullFrame, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pNullFrame->Duration = 0;
- pNullFrame->FC.Type = BTYPE_DATA;
- pNullFrame->FC.PwrMgmt = PWR_SAVE;
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_TRACE, ("Send PSM Data frame for off channel RM\n"));
- RTMPusecDelay(5000);
- }
-
- pAd->Mlme.AironetMachine.CurrState = AIRONET_SCANNING;
- }
- else if (pReq->Measurement.ScanMode == MSRN_SCAN_MODE_BEACON_TABLE)
- {
- // Beacon report Mode, report all the APS in current bss table
- DBGPRINT(RT_DEBUG_TRACE, ("Beacon Report Mode!\n"));
-
- // Copy current BSS table to CCX table, we can omit this step later on.
- NdisMoveMemory(&pAd->StaCfg.CCXBssTab, &pAd->ScanTab, sizeof(BSS_TABLE));
-
- // Create beacon report from Bss table
- AironetCreateBeaconReportFromBssTable(pAd);
-
- // Set state to scanning
- pAd->Mlme.AironetMachine.CurrState = AIRONET_SCANNING;
-
- // Enqueue report request
- // Cisco scan request is finished, prepare beacon report
- MlmeEnqueue(pAd, AIRONET_STATE_MACHINE, MT2_AIRONET_SCAN_DONE, 0, NULL);
- }
- else
- {
- // Wrong scan Mode
- DBGPRINT(RT_DEBUG_TRACE, ("Wrong Scan Mode!\n"));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("BeaconRequestAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID AironetReportAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PRM_REQUEST_ACTION pReq;
- ULONG Now32;
-
- NdisGetSystemUpTime(&Now32);
- pAd->StaCfg.LastBeaconRxTime = Now32;
-
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[pAd->StaCfg.CurrentRMReqIdx];
-
- DBGPRINT(RT_DEBUG_TRACE, ("AironetReportAction ----->\n"));
-
- // 1. Parse measurement type and call appropriate functions
- if (pReq->ReqElem.Type == MSRN_TYPE_CHANNEL_LOAD_REQ)
- // Channel Load measurement request
- ChannelLoadReportAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else if (pReq->ReqElem.Type == MSRN_TYPE_NOISE_HIST_REQ)
- // Noise Histogram measurement request
- NoiseHistReportAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else if (pReq->ReqElem.Type == MSRN_TYPE_BEACON_REQ)
- // Beacon measurement request
- BeaconReportAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else
- // Unknown. Do nothing and return
- ;
-
- // 2. Point to the correct index of action element, start from 0
- pAd->StaCfg.CurrentRMReqIdx++;
-
- // 3. Check for parallel actions
- if (pAd->StaCfg.ParallelReq == TRUE)
- {
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[pAd->StaCfg.CurrentRMReqIdx];
-
- // Process next action right away
- if (pReq->ReqElem.Type == MSRN_TYPE_CHANNEL_LOAD_REQ)
- // Channel Load measurement request
- ChannelLoadReportAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
- else if (pReq->ReqElem.Type == MSRN_TYPE_NOISE_HIST_REQ)
- // Noise Histogram measurement request
- NoiseHistReportAction(pAd, pAd->StaCfg.CurrentRMReqIdx);
-
- pAd->StaCfg.ParallelReq = FALSE;
- pAd->StaCfg.CurrentRMReqIdx++;
- }
-
- if (pAd->StaCfg.CurrentRMReqIdx >= pAd->StaCfg.RMReqCnt)
- {
- // 4. There is no more unprocessed measurement request, go for transmit this report
- AironetFinalReportAction(pAd);
- pAd->Mlme.AironetMachine.CurrState = AIRONET_IDLE;
- }
- else
- {
- pReq = (PRM_REQUEST_ACTION) &pAd->StaCfg.MeasurementRequest[pAd->StaCfg.CurrentRMReqIdx];
-
- if (pReq->Measurement.Channel != pAd->CommonCfg.Channel)
- {
- RTMPusecDelay(100000);
- }
-
- // 5. There are more requests to be measure
- MlmeEnqueue(pAd, AIRONET_STATE_MACHINE, MT2_AIRONET_SCAN_REQ, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("AironetReportAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID AironetFinalReportAction(
- IN PRTMP_ADAPTER pAd)
-{
- PUCHAR pDest;
- PAIRONET_IAPP_HEADER pIAPP;
- PHEADER_802_11 pHeader;
- UCHAR AckRate = RATE_2;
- USHORT AckDuration = 0;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("AironetFinalReportAction ----->\n"));
-
- // 0. Set up the frame pointer, Frame was inited at the end of message action
- pDest = &pAd->StaCfg.FrameReportBuf[LENGTH_802_11];
-
- // 1. Update report IAPP fields
- pIAPP = (PAIRONET_IAPP_HEADER) pDest;
-
- // 2. Copy Cisco SNAP header
- NdisMoveMemory(pIAPP->CiscoSnapHeader, SNAP_AIRONET, LENGTH_802_1_H);
-
- // 3. network order for this 16bit length
- pIAPP->Length = cpu2be16(pAd->StaCfg.FrameReportLen - LENGTH_802_11 - LENGTH_802_1_H);
-
- // 3.1 sanity check the report length, ignore it if there is nothing to report
- if (be2cpu16(pIAPP->Length) <= 18)
- return;
-
- // 4. Type must be 0x32
- pIAPP->Type = AIRONET_IAPP_TYPE;
-
- // 5. SubType for report must be 0x81
- pIAPP->SubType = AIRONET_IAPP_SUBTYPE_REPORT;
-
- // 6. DA is not used and must be zero, although the whole frame was cleared at the start of function
- // We will do it again here. We can use BSSID instead
- COPY_MAC_ADDR(pIAPP->DA, pAd->CommonCfg.Bssid);
-
- // 7. SA is the client reporting which must be our MAC
- COPY_MAC_ADDR(pIAPP->SA, pAd->CurrentAddress);
-
- // 8. Copy the saved dialog token
- pIAPP->Token = pAd->StaCfg.IAPPToken;
-
- // 9. Make the Report frame 802.11 header
- // Reuse function in wpa.c
- pHeader = (PHEADER_802_11) pAd->StaCfg.FrameReportBuf;
- pAd->Sequence ++;
- WpaMacHeaderInit(pAd, pHeader, 0, pAd->CommonCfg.Bssid);
-
- // ACK size is 14 include CRC, and its rate is based on real time information
- AckRate = pAd->CommonCfg.ExpectedACKRate[pAd->CommonCfg.MlmeRate];
- AckDuration = RTMPCalcDuration(pAd, AckRate, 14);
- pHeader->Duration = pAd->CommonCfg.Dsifs + AckDuration;
-
- // Use MLME enqueue method
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- // 10. Prepare report frame with dynamic outbuffer. Just simply copy everything.
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- pAd->StaCfg.FrameReportLen, pAd->StaCfg.FrameReportBuf,
- END_OF_ARGS);
-
- // 11. Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- pAd->StaCfg.CCXReqType = MSRN_TYPE_UNUSED;
-
- DBGPRINT(RT_DEBUG_TRACE, ("AironetFinalReportAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID ChannelLoadReportAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- PMEASUREMENT_REPORT_ELEMENT pReport;
- PCHANNEL_LOAD_REPORT pLoad;
- PUCHAR pDest;
- UCHAR CCABusyFraction;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ChannelLoadReportAction ----->\n"));
-
- // Disable Rx with promiscuous reception, make it back to normal
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, STANORMAL); // Staion not drop control frame will fail WiFi Certification.
-
- // 0. Setup pointer for processing beacon & probe response
- pDest = (PUCHAR) &pAd->StaCfg.FrameReportBuf[pAd->StaCfg.FrameReportLen];
- pReport = (PMEASUREMENT_REPORT_ELEMENT) pDest;
-
- // 1. Fill Measurement report element field.
- pReport->Eid = IE_MEASUREMENT_REPORT;
- // Fixed Length at 9, not include Eid and length fields
- pReport->Length = 9;
- pReport->Token = pAd->StaCfg.MeasurementRequest[Index].ReqElem.Token;
- pReport->Mode = pAd->StaCfg.MeasurementRequest[Index].ReqElem.Mode;
- pReport->Type = MSRN_TYPE_CHANNEL_LOAD_REQ;
-
- // 2. Fill channel report measurement data
- pDest += sizeof(MEASUREMENT_REPORT_ELEMENT);
- pLoad = (PCHANNEL_LOAD_REPORT) pDest;
- pLoad->Channel = pAd->StaCfg.MeasurementRequest[Index].Measurement.Channel;
- pLoad->Spare = 0;
- pLoad->Duration = pAd->StaCfg.MeasurementRequest[Index].Measurement.Duration;
-
- // 3. Calculate the CCA Busy Fraction
- // (Bytes + ACK size) * 8 / Tx speed * 255 / 1000 / measurement duration, use 24 us Tx speed
- // = (Bytes + ACK) / 12 / duration
- // 9 is the good value for pAd->StaCfg.CLFactor
- // CCABusyFraction = (UCHAR) (pAd->StaCfg.CLBusyBytes / 9 / pLoad->Duration);
- CCABusyFraction = (UCHAR) (pAd->StaCfg.CLBusyBytes / pAd->StaCfg.CLFactor / pLoad->Duration);
- if (CCABusyFraction < 10)
- CCABusyFraction = (UCHAR) (pAd->StaCfg.CLBusyBytes / 3 / pLoad->Duration) + 1;
-
- pLoad->CCABusy = CCABusyFraction;
- DBGPRINT(RT_DEBUG_TRACE, ("CLBusyByte %ld, Duration %d, Result, %d\n", pAd->StaCfg.CLBusyBytes, pLoad->Duration, CCABusyFraction));
-
- DBGPRINT(RT_DEBUG_TRACE, ("FrameReportLen %d\n", pAd->StaCfg.FrameReportLen));
- pAd->StaCfg.FrameReportLen += (sizeof(MEASUREMENT_REPORT_ELEMENT) + sizeof(CHANNEL_LOAD_REPORT));
- DBGPRINT(RT_DEBUG_TRACE, ("FrameReportLen %d\n", pAd->StaCfg.FrameReportLen));
-
- // 4. Clear channel load measurement flag
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_MEASUREMENT);
-
- // 5. reset to idle state
- pAd->Mlme.AironetMachine.CurrState = AIRONET_IDLE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ChannelLoadReportAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID NoiseHistReportAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- PMEASUREMENT_REPORT_ELEMENT pReport;
- PNOISE_HIST_REPORT pNoise;
- PUCHAR pDest;
- UCHAR i,NoiseCnt;
- USHORT TotalRPICnt, TotalRPISum;
-
- DBGPRINT(RT_DEBUG_TRACE, ("NoiseHistReportAction ----->\n"));
-
- // 0. Disable Rx with promiscuous reception, make it back to normal
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, STANORMAL); // Staion not drop control frame will fail WiFi Certification.
- // 1. Setup pointer for processing beacon & probe response
- pDest = (PUCHAR) &pAd->StaCfg.FrameReportBuf[pAd->StaCfg.FrameReportLen];
- pReport = (PMEASUREMENT_REPORT_ELEMENT) pDest;
-
- // 2. Fill Measurement report element field.
- pReport->Eid = IE_MEASUREMENT_REPORT;
- // Fixed Length at 16, not include Eid and length fields
- pReport->Length = 16;
- pReport->Token = pAd->StaCfg.MeasurementRequest[Index].ReqElem.Token;
- pReport->Mode = pAd->StaCfg.MeasurementRequest[Index].ReqElem.Mode;
- pReport->Type = MSRN_TYPE_NOISE_HIST_REQ;
-
- // 3. Fill noise histogram report measurement data
- pDest += sizeof(MEASUREMENT_REPORT_ELEMENT);
- pNoise = (PNOISE_HIST_REPORT) pDest;
- pNoise->Channel = pAd->StaCfg.MeasurementRequest[Index].Measurement.Channel;
- pNoise->Spare = 0;
- pNoise->Duration = pAd->StaCfg.MeasurementRequest[Index].Measurement.Duration;
- // 4. Fill Noise histogram, the total RPI counts should be 0.4 * TU
- // We estimate 4000 normal packets received durning 10 seconds test.
- // Adjust it if required.
- // 3 is a good value for pAd->StaCfg.NHFactor
- // TotalRPICnt = pNoise->Duration * 3 / 10;
- TotalRPICnt = pNoise->Duration * pAd->StaCfg.NHFactor / 10;
- TotalRPISum = 0;
-
- for (i = 0; i < 8; i++)
- {
- TotalRPISum += pAd->StaCfg.RPIDensity[i];
- DBGPRINT(RT_DEBUG_TRACE, ("RPI %d Conuts %d\n", i, pAd->StaCfg.RPIDensity[i]));
- }
-
- // Double check if the counter is larger than our expectation.
- // We will replace it with the total number plus a fraction.
- if (TotalRPISum > TotalRPICnt)
- TotalRPICnt = TotalRPISum + pNoise->Duration / 20;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Total RPI Conuts %d\n", TotalRPICnt));
-
- // 5. Initialize noise count for the total summation of 0xff
- NoiseCnt = 0;
- for (i = 1; i < 8; i++)
- {
- pNoise->Density[i] = (UCHAR) (pAd->StaCfg.RPIDensity[i] * 255 / TotalRPICnt);
- if ((pNoise->Density[i] == 0) && (pAd->StaCfg.RPIDensity[i] != 0))
- pNoise->Density[i]++;
- NoiseCnt += pNoise->Density[i];
- DBGPRINT(RT_DEBUG_TRACE, ("Reported RPI[%d] = 0x%02x\n", i, pNoise->Density[i]));
- }
-
- // 6. RPI[0] represents the rest of counts
- pNoise->Density[0] = 0xff - NoiseCnt;
- DBGPRINT(RT_DEBUG_TRACE, ("Reported RPI[0] = 0x%02x\n", pNoise->Density[0]));
-
- pAd->StaCfg.FrameReportLen += (sizeof(MEASUREMENT_REPORT_ELEMENT) + sizeof(NOISE_HIST_REPORT));
-
- // 7. Clear channel load measurement flag
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_RADIO_MEASUREMENT);
-
- // 8. reset to idle state
- pAd->Mlme.AironetMachine.CurrState = AIRONET_IDLE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("NoiseHistReportAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Prepare Beacon report action,
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID BeaconReportAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Index)
-{
- DBGPRINT(RT_DEBUG_TRACE, ("BeaconReportAction ----->\n"));
-
- // Looks like we don't have anything thing need to do here.
- // All measurement report already finished in AddBeaconReport
- // The length is in the FrameReportLen
-
- // reset Beacon index for next beacon request
- pAd->StaCfg.LastBssIndex = 0xff;
-
- // reset to idle state
- pAd->Mlme.AironetMachine.CurrState = AIRONET_IDLE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("BeaconReportAction <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
- Index Current BSSID in CCXBsstab entry index
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-VOID AironetAddBeaconReport(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Index,
- IN PMLME_QUEUE_ELEM pElem)
-{
- PVOID pMsg;
- PUCHAR pSrc, pDest;
- UCHAR ReqIdx;
- ULONG MsgLen;
- USHORT Length;
- PFRAME_802_11 pFrame;
- PMEASUREMENT_REPORT_ELEMENT pReport;
- PEID_STRUCT pEid;
- PBEACON_REPORT pBeaconReport;
- PBSS_ENTRY pBss;
-
- // 0. Setup pointer for processing beacon & probe response
- pMsg = pElem->Msg;
- MsgLen = pElem->MsgLen;
- pFrame = (PFRAME_802_11) pMsg;
- pSrc = pFrame->Octet; // Start from AP TSF
- pBss = (PBSS_ENTRY) &pAd->StaCfg.CCXBssTab.BssEntry[Index];
- ReqIdx = pAd->StaCfg.CurrentRMReqIdx;
-
- // 1 Check the Index, if we already create this entry, only update the average RSSI
- if ((Index <= pAd->StaCfg.LastBssIndex) && (pAd->StaCfg.LastBssIndex != 0xff))
- {
- pDest = (PUCHAR) &pAd->StaCfg.FrameReportBuf[pAd->StaCfg.BssReportOffset[Index]];
- // Point to bss report information
- pDest += sizeof(MEASUREMENT_REPORT_ELEMENT);
- pBeaconReport = (PBEACON_REPORT) pDest;
-
- // Update Rx power, in dBm
- // Get the original RSSI readback from BBP
- pBeaconReport->RxPower += pAd->BbpRssiToDbmDelta;
- // Average the Rssi reading
- pBeaconReport->RxPower = (pBeaconReport->RxPower + pBss->Rssi) / 2;
- // Get to dBm format
- pBeaconReport->RxPower -= pAd->BbpRssiToDbmDelta;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Bssid %02x:%02x:%02x:%02x:%02x:%02x ",
- pBss->Bssid[0], pBss->Bssid[1], pBss->Bssid[2],
- pBss->Bssid[3], pBss->Bssid[4], pBss->Bssid[5]));
- DBGPRINT(RT_DEBUG_TRACE, ("RxPower[%ld] Rssi %d, Avg Rssi %d\n", Index, (pBss->Rssi - pAd->BbpRssiToDbmDelta), pBeaconReport->RxPower - 256));
- DBGPRINT(RT_DEBUG_TRACE, ("FrameReportLen = %d\n", pAd->StaCfg.BssReportOffset[Index]));
-
- // Update other information here
-
- // Done
- return;
- }
-
- // 2. Update reported Index
- pAd->StaCfg.LastBssIndex = Index;
-
- // 3. Setup the buffer address for copying this BSSID into reporting frame
- // The offset should start after 802.11 header and report frame header.
- pDest = (PUCHAR) &pAd->StaCfg.FrameReportBuf[pAd->StaCfg.FrameReportLen];
-
- // 4. Save the start offset of each Bss in report frame
- pAd->StaCfg.BssReportOffset[Index] = pAd->StaCfg.FrameReportLen;
-
- // 5. Fill Measurement report fields
- pReport = (PMEASUREMENT_REPORT_ELEMENT) pDest;
- pReport->Eid = IE_MEASUREMENT_REPORT;
- pReport->Length = 0;
- pReport->Token = pAd->StaCfg.MeasurementRequest[ReqIdx].ReqElem.Token;
- pReport->Mode = pAd->StaCfg.MeasurementRequest[ReqIdx].ReqElem.Mode;
- pReport->Type = MSRN_TYPE_BEACON_REQ;
- Length = sizeof(MEASUREMENT_REPORT_ELEMENT);
- pDest += sizeof(MEASUREMENT_REPORT_ELEMENT);
-
- // 6. Start thebeacon report format
- pBeaconReport = (PBEACON_REPORT) pDest;
- pDest += sizeof(BEACON_REPORT);
- Length += sizeof(BEACON_REPORT);
-
- // 7. Copy Channel number
- pBeaconReport->Channel = pBss->Channel;
- pBeaconReport->Spare = 0;
- pBeaconReport->Duration = pAd->StaCfg.MeasurementRequest[ReqIdx].Measurement.Duration;
- pBeaconReport->PhyType = ((pBss->SupRateLen+pBss->ExtRateLen > 4) ? PHY_ERP : PHY_DSS);
- // 8. Rx power, in dBm
- pBeaconReport->RxPower = pBss->Rssi - pAd->BbpRssiToDbmDelta;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Bssid %02x:%02x:%02x:%02x:%02x:%02x ",
- pBss->Bssid[0], pBss->Bssid[1], pBss->Bssid[2],
- pBss->Bssid[3], pBss->Bssid[4], pBss->Bssid[5]));
- DBGPRINT(RT_DEBUG_TRACE, ("RxPower[%ld], Rssi %d\n", Index, pBeaconReport->RxPower - 256));
- DBGPRINT(RT_DEBUG_TRACE, ("FrameReportLen = %d\n", pAd->StaCfg.FrameReportLen));
-
- pBeaconReport->BeaconInterval = pBss->BeaconPeriod;
- COPY_MAC_ADDR(pBeaconReport->BSSID, pFrame->Hdr.Addr3);
- NdisMoveMemory(pBeaconReport->ParentTSF, pSrc, 4);
- NdisMoveMemory(pBeaconReport->TargetTSF, &pElem->TimeStamp.u.LowPart, 4);
- NdisMoveMemory(&pBeaconReport->TargetTSF[4], &pElem->TimeStamp.u.HighPart, 4);
-
- // 9. Skip the beacon frame and offset to start of capabilityinfo since we already processed capabilityinfo
- pSrc += (TIMESTAMP_LEN + 2);
- pBeaconReport->CapabilityInfo = *(USHORT *)pSrc;
-
- // 10. Point to start of element ID
- pSrc += 2;
- pEid = (PEID_STRUCT) pSrc;
-
- // 11. Start process all variable Eid oayload and add the appropriate to the frame report
- while (((PUCHAR) pEid + pEid->Len + 1) < ((PUCHAR) pFrame + MsgLen))
- {
- // Only limited EID are required to report for CCX 2. It includes SSID, Supported rate,
- // FH paramenter set, DS parameter set, CF parameter set, IBSS parameter set,
- // TIM (report first 4 bytes only, radio measurement capability
- switch (pEid->Eid)
- {
- case IE_SSID:
- case IE_SUPP_RATES:
- case IE_FH_PARM:
- case IE_DS_PARM:
- case IE_CF_PARM:
- case IE_IBSS_PARM:
- NdisMoveMemory(pDest, pEid, pEid->Len + 2);
- pDest += (pEid->Len + 2);
- Length += (pEid->Len + 2);
- break;
-
- case IE_MEASUREMENT_CAPABILITY:
- // Since this IE is duplicated with WPA security IE, we has to do sanity check before
- // recognize it.
- // 1. It also has fixed 6 bytes IE length.
- if (pEid->Len != 6)
- break;
- // 2. Check the Cisco Aironet OUI
- if (NdisEqualMemory(CISCO_OUI, (pSrc + 2), 3))
- {
- // Matched, this is what we want
- NdisMoveMemory(pDest, pEid, pEid->Len + 2);
- pDest += (pEid->Len + 2);
- Length += (pEid->Len + 2);
- }
- break;
-
- case IE_TIM:
- if (pEid->Len > 4)
- {
- // May truncate and report the first 4 bytes only, with the eid & len, total should be 6
- NdisMoveMemory(pDest, pEid, 6);
- pDest += 6;
- Length += 6;
- }
- else
- {
- NdisMoveMemory(pDest, pEid, pEid->Len + 2);
- pDest += (pEid->Len + 2);
- Length += (pEid->Len + 2);
- }
- break;
-
- default:
- break;
- }
- // 12. Move to next element ID
- pSrc += (2 + pEid->Len);
- pEid = (PEID_STRUCT) pSrc;
- }
-
- // 13. Update the length in the header, not include EID and length
- pReport->Length = Length - 4;
-
- // 14. Update the frame report buffer data length
- pAd->StaCfg.FrameReportLen += Length;
- DBGPRINT(RT_DEBUG_TRACE, ("FR len = %d\n", pAd->StaCfg.FrameReportLen));
-}
-
-/*
- ========================================================================
-
- Routine Description:
-
- Arguments:
- Index Current BSSID in CCXBsstab entry index
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-VOID AironetCreateBeaconReportFromBssTable(
- IN PRTMP_ADAPTER pAd)
-{
- PMEASUREMENT_REPORT_ELEMENT pReport;
- PBEACON_REPORT pBeaconReport;
- UCHAR Index, ReqIdx;
- USHORT Length;
- PUCHAR pDest;
- PBSS_ENTRY pBss;
-
- // 0. setup base pointer
- ReqIdx = pAd->StaCfg.CurrentRMReqIdx;
-
- for (Index = 0; Index < pAd->StaCfg.CCXBssTab.BssNr; Index++)
- {
- // 1. Setup the buffer address for copying this BSSID into reporting frame
- // The offset should start after 802.11 header and report frame header.
- pDest = (PUCHAR) &pAd->StaCfg.FrameReportBuf[pAd->StaCfg.FrameReportLen];
- pBss = (PBSS_ENTRY) &pAd->StaCfg.CCXBssTab.BssEntry[Index];
- Length = 0;
-
- // 2. Fill Measurement report fields
- pReport = (PMEASUREMENT_REPORT_ELEMENT) pDest;
- pReport->Eid = IE_MEASUREMENT_REPORT;
- pReport->Length = 0;
- pReport->Token = pAd->StaCfg.MeasurementRequest[ReqIdx].ReqElem.Token;
- pReport->Mode = pAd->StaCfg.MeasurementRequest[ReqIdx].ReqElem.Mode;
- pReport->Type = MSRN_TYPE_BEACON_REQ;
- Length = sizeof(MEASUREMENT_REPORT_ELEMENT);
- pDest += sizeof(MEASUREMENT_REPORT_ELEMENT);
-
- // 3. Start the beacon report format
- pBeaconReport = (PBEACON_REPORT) pDest;
- pDest += sizeof(BEACON_REPORT);
- Length += sizeof(BEACON_REPORT);
-
- // 4. Copy Channel number
- pBeaconReport->Channel = pBss->Channel;
- pBeaconReport->Spare = 0;
- pBeaconReport->Duration = pAd->StaCfg.MeasurementRequest[ReqIdx].Measurement.Duration;
- pBeaconReport->PhyType = ((pBss->SupRateLen+pBss->ExtRateLen > 4) ? PHY_ERP : PHY_DSS);
- pBeaconReport->RxPower = pBss->Rssi - pAd->BbpRssiToDbmDelta;
- pBeaconReport->BeaconInterval = pBss->BeaconPeriod;
- pBeaconReport->CapabilityInfo = pBss->CapabilityInfo;
- COPY_MAC_ADDR(pBeaconReport->BSSID, pBss->Bssid);
- NdisMoveMemory(pBeaconReport->ParentTSF, pBss->PTSF, 4);
- NdisMoveMemory(pBeaconReport->TargetTSF, pBss->TTSF, 8);
-
- // 5. Create SSID
- *pDest++ = 0x00;
- *pDest++ = pBss->SsidLen;
- NdisMoveMemory(pDest, pBss->Ssid, pBss->SsidLen);
- pDest += pBss->SsidLen;
- Length += (2 + pBss->SsidLen);
-
- // 6. Create SupportRates
- *pDest++ = 0x01;
- *pDest++ = pBss->SupRateLen;
- NdisMoveMemory(pDest, pBss->SupRate, pBss->SupRateLen);
- pDest += pBss->SupRateLen;
- Length += (2 + pBss->SupRateLen);
-
- // 7. DS Parameter
- *pDest++ = 0x03;
- *pDest++ = 1;
- *pDest++ = pBss->Channel;
- Length += 3;
-
- // 8. IBSS parameter if presents
- if (pBss->BssType == BSS_ADHOC)
- {
- *pDest++ = 0x06;
- *pDest++ = 2;
- *(PUSHORT) pDest = pBss->AtimWin;
- pDest += 2;
- Length += 4;
- }
-
- // 9. Update length field, not include EID and length
- pReport->Length = Length - 4;
-
- // 10. Update total frame size
- pAd->StaCfg.FrameReportLen += Length;
- }
-}
diff --git a/drivers/staging/rt2860/sta/assoc.c b/drivers/staging/rt2860/sta/assoc.c
index 1a587153c75e..a67e213718d6 100644
--- a/drivers/staging/rt2860/sta/assoc.c
+++ b/drivers/staging/rt2860/sta/assoc.c
@@ -149,7 +149,7 @@ VOID AssocTimeout(IN PVOID SystemSpecific1,
return;
MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_ASSOC_TIMEOUT, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
/*
@@ -177,7 +177,7 @@ VOID ReassocTimeout(IN PVOID SystemSpecific1,
return;
MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_REASSOC_TIMEOUT, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
/*
@@ -205,7 +205,7 @@ VOID DisassocTimeout(IN PVOID SystemSpecific1,
return;
MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_DISASSOC_TIMEOUT, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
/*
@@ -236,7 +236,6 @@ VOID MlmeAssocReqAction(
{
UCHAR ApAddr[6];
HEADER_802_11 AssocHdr;
- UCHAR Ccx2Len = 5;
UCHAR WmeIe[9] = {IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
USHORT ListenIntv;
ULONG Timeout;
@@ -247,13 +246,6 @@ VOID MlmeAssocReqAction(
ULONG FrameLen = 0;
ULONG tmp;
USHORT VarIesOffset;
- UCHAR CkipFlag;
- UCHAR CkipNegotiationBuffer[CKIP_NEGOTIATION_LENGTH];
- UCHAR AironetCkipIe = IE_AIRONET_CKIP;
- UCHAR AironetCkipLen = CKIP_NEGOTIATION_LENGTH;
- UCHAR AironetIPAddressIE = IE_AIRONET_IPADDRESS;
- UCHAR AironetIPAddressLen = AIRONET_IPADDRESS_LENGTH;
- UCHAR AironetIPAddressBuffer[AIRONET_IPADDRESS_LENGTH] = {0x00, 0x40, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00};
USHORT Status;
// Block all authentication request durning WPA block period
@@ -454,7 +446,8 @@ VOID MlmeAssocReqAction(
RSNIe = IE_WPA2;
}
- if (pAd->StaCfg.WpaSupplicantUP != 1)
+ if ((pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE) &&
+ (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == FALSE))
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0);
// Check for WPA PMK cache list
@@ -471,7 +464,6 @@ VOID MlmeAssocReqAction(
break;
}
}
-
if (FoundPMK)
{
// Set PMK number
@@ -481,7 +473,8 @@ VOID MlmeAssocReqAction(
}
}
- if (pAd->StaCfg.WpaSupplicantUP == 1)
+ if ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) &&
+ (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == TRUE))
{
MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
@@ -498,7 +491,8 @@ VOID MlmeAssocReqAction(
FrameLen += tmp;
- if (pAd->StaCfg.WpaSupplicantUP != 1)
+ if ((pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE) ||
+ (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == FALSE))
{
// Append Variable IE
NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &RSNIe, 1);
@@ -513,53 +507,6 @@ VOID MlmeAssocReqAction(
pAd->StaCfg.ReqVarIELen = VarIesOffset;
}
- // We have update that at PeerBeaconAtJoinRequest()
- CkipFlag = pAd->StaCfg.CkipFlag;
- if (CkipFlag != 0)
- {
- NdisZeroMemory(CkipNegotiationBuffer, CKIP_NEGOTIATION_LENGTH);
- CkipNegotiationBuffer[2] = 0x66;
- // Make it try KP & MIC, since we have to follow the result from AssocRsp
- CkipNegotiationBuffer[8] = 0x18;
- CkipNegotiationBuffer[CKIP_NEGOTIATION_LENGTH - 1] = 0x22;
- CkipFlag = 0x18;
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &AironetCkipIe,
- 1, &AironetCkipLen,
- AironetCkipLen, CkipNegotiationBuffer,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
- // Add CCX v2 request if CCX2 admin state is on
- if (pAd->StaCfg.CCXControl.field.Enable == 1)
- {
-
- //
- // Add AironetIPAddressIE for Cisco CCX 2.X
- // Add CCX Version
- //
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &AironetIPAddressIE,
- 1, &AironetIPAddressLen,
- AironetIPAddressLen, AironetIPAddressBuffer,
- 1, &Ccx2Ie,
- 1, &Ccx2Len,
- Ccx2Len, Ccx2IeInfo,
- END_OF_ARGS);
- FrameLen += tmp;
-
- // Add by James 03/06/27
- // Set Variable IEs Length
- pAd->StaCfg.ReqVarIELen = VarIesOffset;
- pAd->StaCfg.AssocInfo.RequestIELength = VarIesOffset;
-
- // OffsetResponseIEs follow ReqVarIE
- pAd->StaCfg.AssocInfo.OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAd->StaCfg.ReqVarIELen;
- // End Add by James
- }
-
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
@@ -600,7 +547,6 @@ VOID MlmeReassocReqAction(
{
UCHAR ApAddr[6];
HEADER_802_11 ReassocHdr;
- UCHAR Ccx2Len = 5;
UCHAR WmeIe[9] = {IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
USHORT CapabilityInfo, ListenIntv;
ULONG Timeout;
@@ -749,20 +695,6 @@ VOID MlmeReassocReqAction(
FrameLen += TmpLen;
}
- // Add CCX v2 request if CCX2 admin state is on
- if (pAd->StaCfg.CCXControl.field.Enable == 1)
- {
- //
- // Add CCX Version
- //
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &Ccx2Ie,
- 1, &Ccx2Len,
- Ccx2Len, Ccx2IeInfo,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
MlmeFreeMemory(pAd, pOutBuffer);
@@ -800,9 +732,10 @@ VOID MlmeDisassocReqAction(
ULONG FrameLen = 0;
NDIS_STATUS NStatus;
BOOLEAN TimerCancelled;
- ULONG Timeout = 0;
+ ULONG Timeout = 500;
USHORT Status;
+
// skip sanity check
pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT)(Elem->Msg);
@@ -845,11 +778,9 @@ VOID MlmeDisassocReqAction(
RTMPSetTimer(&pAd->MlmeAux.DisassocTimer, Timeout); /* in mSec */
pAd->Mlme.AssocMachine.CurrState = DISASSOC_WAIT_RSP;
- {
- union iwreq_data wrqu;
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
+
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
+
}
/*
@@ -876,7 +807,7 @@ VOID PeerAssocRspAction(
EDCA_PARM EdcaParm;
HT_CAPABILITY_IE HtCapability;
ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen;
+ UCHAR HtCapabilityLen = 0;
UCHAR AddHtInfoLen;
UCHAR NewExtChannelOffset = 0xff;
@@ -889,24 +820,10 @@ VOID PeerAssocRspAction(
DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspAction():ASSOC - receive ASSOC_RSP to me (status=%d)\n", Status));
DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspAction():MacTable [%d].AMsduSize = %d. ClientStatusFlags = 0x%lx \n",Elem->Wcid, pAd->MacTab.Content[BSSID_WCID].AMsduSize, pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &TimerCancelled);
- if(Status == MLME_SUCCESS)
- {
-#ifdef RT2860
- // go to procedure listed on page 376
- AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen,
- &EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
- {
- union iwreq_data wrqu;
- wext_notify_event_assoc(pAd);
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
-#endif
-#ifdef RT2870
+ if(Status == MLME_SUCCESS)
+ {
UCHAR MaxSupportedRateIn500Kbps = 0;
UCHAR idx;
@@ -926,23 +843,14 @@ VOID PeerAssocRspAction(
AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen,
&EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
- StaAddMacTableEntry(pAd, &pAd->MacTab.Content[BSSID_WCID], MaxSupportedRateIn500Kbps, &HtCapability, HtCapabilityLen, CapabilityInfo);
-#endif
- pAd->StaCfg.CkipFlag = CkipFlag;
- if (CkipFlag & 0x18)
- {
- NdisZeroMemory(pAd->StaCfg.TxSEQ, 4);
- NdisZeroMemory(pAd->StaCfg.RxSEQ, 4);
- NdisZeroMemory(pAd->StaCfg.CKIPMIC, 4);
- pAd->StaCfg.GIV[0] = RandomByte(pAd);
- pAd->StaCfg.GIV[1] = RandomByte(pAd);
- pAd->StaCfg.GIV[2] = RandomByte(pAd);
- pAd->StaCfg.bCkipOn = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("<CCX> pAd->StaCfg.CkipFlag = 0x%02x\n", pAd->StaCfg.CkipFlag));
- }
- }
- else
- {
+ StaAddMacTableEntry(pAd,
+ &pAd->MacTab.Content[BSSID_WCID],
+ MaxSupportedRateIn500Kbps,
+ &HtCapability,
+ HtCapabilityLen,
+ &AddHtInfo,
+ AddHtInfoLen,
+ CapabilityInfo);
}
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
@@ -998,25 +906,19 @@ VOID PeerReassocRspAction(
AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen,
&EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
+
{
- union iwreq_data wrqu;
wext_notify_event_assoc(pAd);
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
-
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, &pAd->MlmeAux.Bssid[0], NULL, 0);
}
}
- {
// CkipFlag is no use for reassociate
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
}
}
- }
else
{
DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerReassocRspAction() sanity check fail\n"));
@@ -1123,6 +1025,10 @@ VOID AssocPostProc(
pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs;
len = pAd->ScanTab.BssEntry[Idx].VarIELen;
+ //KH need to check again
+ // Don't allow to go to sleep mode if authmode is WPA-related.
+ //This can make Authentication process more smoothly.
+ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
while (len > 0)
{
@@ -1147,6 +1053,8 @@ VOID AssocPostProc(
pVIE += (pEid->Len + 2);
len -= (pEid->Len + 2);
}
+
+
}
if (pAd->MacTab.Content[BSSID_WCID].RSNIE_Len == 0)
@@ -1190,19 +1098,12 @@ VOID PeerDisassocAction(
RTMPSendWirelessEvent(pAd, IW_DISASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
}
- //
- // Get Current System time and Turn on AdjacentAPReport
- //
- NdisGetSystemUpTime(&pAd->StaCfg.CCXAdjacentAPLinkDownTime);
- pAd->StaCfg.CCXAdjacentAPReportFlag = TRUE;
+
LinkDown(pAd, TRUE);
pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- {
- union iwreq_data wrqu;
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
+
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
}
}
else
@@ -1359,143 +1260,16 @@ VOID Cls3errAction(
COPY_MAC_ADDR(pAd->StaCfg.DisassocSta, pAddr);
}
- /*
- ==========================================================================
- Description:
- Switch between WEP and CKIP upon new association up.
- Parameters:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID SwitchBetweenWepAndCkip(
- IN PRTMP_ADAPTER pAd)
-{
- int i;
- SHAREDKEY_MODE_STRUC csr1;
-
- // if KP is required. change the CipherAlg in hardware shard key table from WEP
- // to CKIP. else remain as WEP
- if (pAd->StaCfg.bCkipOn && (pAd->StaCfg.CkipFlag & 0x10))
- {
- // modify hardware key table so that MAC use correct algorithm to decrypt RX
- RTMP_IO_READ32(pAd, SHARED_KEY_MODE_BASE, &csr1.word);
- if (csr1.field.Bss0Key0CipherAlg == CIPHER_WEP64)
- csr1.field.Bss0Key0CipherAlg = CIPHER_CKIP64;
- else if (csr1.field.Bss0Key0CipherAlg == CIPHER_WEP128)
- csr1.field.Bss0Key0CipherAlg = CIPHER_CKIP128;
-
- if (csr1.field.Bss0Key1CipherAlg == CIPHER_WEP64)
- csr1.field.Bss0Key1CipherAlg = CIPHER_CKIP64;
- else if (csr1.field.Bss0Key1CipherAlg == CIPHER_WEP128)
- csr1.field.Bss0Key1CipherAlg = CIPHER_CKIP128;
-
- if (csr1.field.Bss0Key2CipherAlg == CIPHER_WEP64)
- csr1.field.Bss0Key2CipherAlg = CIPHER_CKIP64;
- else if (csr1.field.Bss0Key2CipherAlg == CIPHER_WEP128)
- csr1.field.Bss0Key2CipherAlg = CIPHER_CKIP128;
-
- if (csr1.field.Bss0Key3CipherAlg == CIPHER_WEP64)
- csr1.field.Bss0Key3CipherAlg = CIPHER_CKIP64;
- else if (csr1.field.Bss0Key3CipherAlg == CIPHER_WEP128)
- csr1.field.Bss0Key3CipherAlg = CIPHER_CKIP128;
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE, csr1.word);
- DBGPRINT(RT_DEBUG_TRACE, ("SwitchBetweenWepAndCkip: modify BSS0 cipher to %s\n", CipherName[csr1.field.Bss0Key0CipherAlg]));
-
- // modify software key table so that driver can specify correct algorithm in TXD upon TX
- for (i=0; i<SHARE_KEY_NUM; i++)
- {
- if (pAd->SharedKey[BSS0][i].CipherAlg == CIPHER_WEP64)
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_CKIP64;
- else if (pAd->SharedKey[BSS0][i].CipherAlg == CIPHER_WEP128)
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_CKIP128;
- }
- }
-
- // else if KP NOT inused. change the CipherAlg in hardware shard key table from CKIP
- // to WEP.
- else
- {
- // modify hardware key table so that MAC use correct algorithm to decrypt RX
- RTMP_IO_READ32(pAd, SHARED_KEY_MODE_BASE, &csr1.word);
- if (csr1.field.Bss0Key0CipherAlg == CIPHER_CKIP64)
- csr1.field.Bss0Key0CipherAlg = CIPHER_WEP64;
- else if (csr1.field.Bss0Key0CipherAlg == CIPHER_CKIP128)
- csr1.field.Bss0Key0CipherAlg = CIPHER_WEP128;
-
- if (csr1.field.Bss0Key1CipherAlg == CIPHER_CKIP64)
- csr1.field.Bss0Key1CipherAlg = CIPHER_WEP64;
- else if (csr1.field.Bss0Key1CipherAlg == CIPHER_CKIP128)
- csr1.field.Bss0Key1CipherAlg = CIPHER_WEP128;
-
- if (csr1.field.Bss0Key2CipherAlg == CIPHER_CKIP64)
- csr1.field.Bss0Key2CipherAlg = CIPHER_WEP64;
- else if (csr1.field.Bss0Key2CipherAlg == CIPHER_CKIP128)
- csr1.field.Bss0Key2CipherAlg = CIPHER_WEP128;
-
- if (csr1.field.Bss0Key3CipherAlg == CIPHER_CKIP64)
- csr1.field.Bss0Key3CipherAlg = CIPHER_WEP64;
- else if (csr1.field.Bss0Key3CipherAlg == CIPHER_CKIP128)
- csr1.field.Bss0Key3CipherAlg = CIPHER_WEP128;
-
- // modify software key table so that driver can specify correct algorithm in TXD upon TX
- for (i=0; i<SHARE_KEY_NUM; i++)
- {
- if (pAd->SharedKey[BSS0][i].CipherAlg == CIPHER_CKIP64)
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_WEP64;
- else if (pAd->SharedKey[BSS0][i].CipherAlg == CIPHER_CKIP128)
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_WEP128;
- }
-
- //
- // On WPA-NONE, must update CipherAlg.
- // Because the OID_802_11_WEP_STATUS was been set after OID_802_11_ADD_KEY
- // and CipherAlg will be CIPHER_NONE by Windows ZeroConfig.
- // So we need to update CipherAlg after connect.
- //
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- for (i = 0; i < SHARE_KEY_NUM; i++)
- {
- if (pAd->SharedKey[BSS0][i].KeyLen != 0)
- {
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled)
- {
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_TKIP;
- }
- else if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_AES;
- }
- }
- else
- {
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_NONE;
- }
- }
-
- csr1.field.Bss0Key0CipherAlg = pAd->SharedKey[BSS0][0].CipherAlg;
- csr1.field.Bss0Key1CipherAlg = pAd->SharedKey[BSS0][1].CipherAlg;
- csr1.field.Bss0Key2CipherAlg = pAd->SharedKey[BSS0][2].CipherAlg;
- csr1.field.Bss0Key3CipherAlg = pAd->SharedKey[BSS0][3].CipherAlg;
- }
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE, csr1.word);
- DBGPRINT(RT_DEBUG_TRACE, ("SwitchBetweenWepAndCkip: modify BSS0 cipher to %s\n", CipherName[csr1.field.Bss0Key0CipherAlg]));
- }
-}
int wext_notify_event_assoc(
IN RTMP_ADAPTER *pAd)
{
- union iwreq_data wrqu;
char custom[IW_CUSTOM_MAX] = {0};
if (pAd->StaCfg.ReqVarIELen <= IW_CUSTOM_MAX)
{
- wrqu.data.length = pAd->StaCfg.ReqVarIELen;
- memcpy(custom, pAd->StaCfg.ReqVarIEs, pAd->StaCfg.ReqVarIELen);
- wireless_send_event(pAd->net_dev, IWEVASSOCREQIE, &wrqu, custom);
+ NdisMoveMemory(custom, pAd->StaCfg.ReqVarIEs, pAd->StaCfg.ReqVarIELen);
+ RtmpOSWrielessEventSend(pAd, IWEVASSOCREQIE, -1, NULL, custom, pAd->StaCfg.ReqVarIELen);
}
else
DBGPRINT(RT_DEBUG_TRACE, ("pAd->StaCfg.ReqVarIELen > MAX_CUSTOM_LEN\n"));
@@ -1504,13 +1278,15 @@ int wext_notify_event_assoc(
}
-#ifdef RT2870
+
BOOLEAN StaAddMacTableEntry(
IN PRTMP_ADAPTER pAd,
IN PMAC_TABLE_ENTRY pEntry,
IN UCHAR MaxSupportedRateIn500Kbps,
IN HT_CAPABILITY_IE *pHtCapability,
IN UCHAR HtCapabilityLen,
+ IN ADD_HT_INFO_IE *pAddHtInfo,
+ IN UCHAR AddHtInfoLen,
IN USHORT CapabilityInfo)
{
UCHAR MaxSupportedRate = RATE_11;
@@ -1586,6 +1362,7 @@ BOOLEAN StaAddMacTableEntry(
CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_PIGGYBACK_CAPABLE);
}
+ NdisZeroMemory(&pEntry->HTCapability, sizeof(pEntry->HTCapability));
// If this Entry supports 802.11n, upgrade to HT rate.
if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
{
@@ -1605,7 +1382,9 @@ BOOLEAN StaAddMacTableEntry(
pAd->CommonCfg.AddHTInfo.AddHtInfo2.NonGfPresent = 1;
}
- if ((pHtCapability->HtCapInfo.ChannelWidth) && (pAd->CommonCfg.DesiredHtPhy.ChannelWidth))
+ if ((pHtCapability->HtCapInfo.ChannelWidth) &&
+ (pAd->CommonCfg.DesiredHtPhy.ChannelWidth) &&
+ ((pAd->StaCfg.BssType == BSS_INFRA) || ((pAd->StaCfg.BssType == BSS_ADHOC) && (pAddHtInfo->AddHtInfo.ExtChanOffset == pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset))))
{
pEntry->MaxHTPhyMode.field.BW= BW_40;
pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor40)&(pHtCapability->HtCapInfo.ShortGIfor40));
@@ -1677,14 +1456,13 @@ BOOLEAN StaAddMacTableEntry(
CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE);
if (pHtCapability->ExtHtCapInfo.MCSFeedback == 0x03)
CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_MCSFEEDBACK_CAPABLE);
+ NdisMoveMemory(&pEntry->HTCapability, pHtCapability, HtCapabilityLen);
}
else
{
pAd->MacTab.fAnyStationIsLegacy = TRUE;
}
- NdisMoveMemory(&pEntry->HTCapability, pHtCapability, sizeof(HT_CAPABILITY_IE));
-
pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
pEntry->CurrTxRate = pEntry->MaxSupportedRate;
@@ -1726,4 +1504,3 @@ BOOLEAN StaAddMacTableEntry(
}
return TRUE;
}
-#endif /* RT2870 */
diff --git a/drivers/staging/rt2860/sta/auth.c b/drivers/staging/rt2860/sta/auth.c
index d8414eac42f8..7fb0760dabcc 100644
--- a/drivers/staging/rt2860/sta/auth.c
+++ b/drivers/staging/rt2860/sta/auth.c
@@ -108,7 +108,7 @@ VOID AuthTimeout(
MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_AUTH_TIMEOUT, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
@@ -124,59 +124,12 @@ VOID MlmeAuthReqAction(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
- UCHAR Addr[6];
- USHORT Alg, Seq, Status;
- ULONG Timeout;
- HEADER_802_11 AuthHdr;
- BOOLEAN TimerCancelled;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0;
-
- // Block all authentication request durning WPA block period
- if (pAd->StaCfg.bBlockAssoc == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Block Auth request durning WPA block period!\n"));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
- else if(MlmeAuthReqSanity(pAd, Elem->Msg, Elem->MsgLen, Addr, &Timeout, &Alg))
- {
- // reset timer
- RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &TimerCancelled);
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, Addr);
- pAd->MlmeAux.Alg = Alg;
- Seq = 1;
- Status = MLME_SUCCESS;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - MlmeAuthReqAction(Alg:%d) allocate memory failed\n", Alg));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Send AUTH request seq#1 (Alg=%d)...\n", Alg));
- MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, Addr, pAd->MlmeAux.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&AuthHdr,
- 2, &Alg,
- 2, &Seq,
- 2, &Status,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- RTMPSetTimer(&pAd->MlmeAux.AuthTimer, Timeout);
+ if (AUTH_ReqSend(pAd, Elem, &pAd->MlmeAux.AuthTimer, "AUTH", 1, NULL, 0))
pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ2;
- }
else
{
- DBGPRINT_ERR(("AUTH - MlmeAuthReqAction() sanity check failed\n"));
+ USHORT Status;
+
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
Status = MLME_INVALID_FORMAT;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
@@ -207,7 +160,7 @@ VOID PeerAuthRspAtSeq2Action(
ULONG FrameLen = 0;
USHORT Status2;
- if (PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, ChlgText))
+ if (PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, (PCHAR)ChlgText))
{
if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 2)
{
@@ -217,8 +170,7 @@ VOID PeerAuthRspAtSeq2Action(
if (Status == MLME_SUCCESS)
{
// Authentication Mode "LEAP" has allow for CCX 1.X
- if ((pAd->MlmeAux.Alg == Ndis802_11AuthModeOpen)
- )
+ if (pAd->MlmeAux.Alg == Ndis802_11AuthModeOpen)
{
pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
@@ -457,4 +409,82 @@ VOID Cls2errAction(
COPY_MAC_ADDR(pAd->StaCfg.DeauthSta, pAddr);
}
+BOOLEAN AUTH_ReqSend(
+ IN PRTMP_ADAPTER pAd,
+ IN PMLME_QUEUE_ELEM pElem,
+ IN PRALINK_TIMER_STRUCT pAuthTimer,
+ IN PSTRING pSMName,
+ IN USHORT SeqNo,
+ IN PUCHAR pNewElement,
+ IN ULONG ElementLen)
+{
+ USHORT Alg, Seq, Status;
+ UCHAR Addr[6];
+ ULONG Timeout;
+ HEADER_802_11 AuthHdr;
+ BOOLEAN TimerCancelled;
+ NDIS_STATUS NStatus;
+ PUCHAR pOutBuffer = NULL;
+ ULONG FrameLen = 0, tmp = 0;
+
+ // Block all authentication request durning WPA block period
+ if (pAd->StaCfg.bBlockAssoc == TRUE)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s - Block Auth request durning WPA block period!\n", pSMName));
+ pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
+ Status = MLME_STATE_MACHINE_REJECT;
+ MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
+ }
+ else if(MlmeAuthReqSanity(pAd, pElem->Msg, pElem->MsgLen, Addr, &Timeout, &Alg))
+ {
+ /* reset timer */
+ RTMPCancelTimer(pAuthTimer, &TimerCancelled);
+
+ COPY_MAC_ADDR(pAd->MlmeAux.Bssid, Addr);
+ pAd->MlmeAux.Alg = Alg;
+ Seq = SeqNo;
+ Status = MLME_SUCCESS;
+
+ NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
+ if(NStatus != NDIS_STATUS_SUCCESS)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("%s - MlmeAuthReqAction(Alg:%d) allocate memory failed\n", pSMName, Alg));
+ pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
+ Status = MLME_FAIL_NO_RESOURCE;
+ MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
+ return FALSE;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("%s - Send AUTH request seq#1 (Alg=%d)...\n", pSMName, Alg));
+ MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, Addr, pAd->MlmeAux.Bssid);
+ MakeOutgoingFrame(pOutBuffer, &FrameLen,
+ sizeof(HEADER_802_11),&AuthHdr,
+ 2, &Alg,
+ 2, &Seq,
+ 2, &Status,
+ END_OF_ARGS);
+
+ if (pNewElement && ElementLen)
+ {
+ MakeOutgoingFrame(pOutBuffer+FrameLen, &tmp,
+ ElementLen, pNewElement,
+ END_OF_ARGS);
+ FrameLen += tmp;
+ }
+
+ MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
+ MlmeFreeMemory(pAd, pOutBuffer);
+
+ RTMPSetTimer(pAuthTimer, Timeout);
+ return TRUE;
+ }
+ else
+ {
+ DBGPRINT_ERR(("%s - MlmeAuthReqAction() sanity check failed\n", pSMName));
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
diff --git a/drivers/staging/rt2860/sta/auth_rsp.c b/drivers/staging/rt2860/sta/auth_rsp.c
index cc639b1c6c13..9c2fde479afe 100644
--- a/drivers/staging/rt2860/sta/auth_rsp.c
+++ b/drivers/staging/rt2860/sta/auth_rsp.c
@@ -123,15 +123,15 @@ VOID PeerDeauthAction(
if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
{
- if (INFRA_ON(pAd) && MAC_ADDR_EQUAL(Addr2, pAd->CommonCfg.Bssid))
+ if (INFRA_ON(pAd)
+ && MAC_ADDR_EQUAL(Addr2, pAd->CommonCfg.Bssid)
+ )
{
DBGPRINT(RT_DEBUG_TRACE,("AUTH_RSP - receive DE-AUTH from our AP (Reason=%d)\n", Reason));
- {
- union iwreq_data wrqu;
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
+
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
+
// send wireless event - for deauthentication
if (pAd->CommonCfg.bWirelessEvent)
diff --git a/drivers/staging/rt2860/sta/connect.c b/drivers/staging/rt2860/sta/connect.c
index 7bc75ab971f9..7f263a66d79a 100644
--- a/drivers/staging/rt2860/sta/connect.c
+++ b/drivers/staging/rt2860/sta/connect.c
@@ -64,6 +64,7 @@ UCHAR CipherSuiteWpaNoneAesLen = (sizeof(CipherSuiteWpaNoneAes) / sizeof(UCHAR))
// and are copied to pAd->StaActive
#define COPY_SETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(_pAd) \
{ \
+ NdisZeroMemory((_pAd)->CommonCfg.Ssid, MAX_LEN_OF_SSID); \
(_pAd)->CommonCfg.SsidLen = (_pAd)->MlmeAux.SsidLen; \
NdisMoveMemory((_pAd)->CommonCfg.Ssid, (_pAd)->MlmeAux.Ssid, (_pAd)->MlmeAux.SsidLen); \
COPY_MAC_ADDR((_pAd)->CommonCfg.Bssid, (_pAd)->MlmeAux.Bssid); \
@@ -123,9 +124,7 @@ VOID MlmeCntlMachinePerformAction(
switch(pAd->Mlme.CntlMachine.CurrState)
{
case CNTL_IDLE:
- {
CntlIdleProc(pAd, Elem);
- }
break;
case CNTL_WAIT_DISASSOC:
CntlWaitDisassocProc(pAd, Elem);
@@ -163,11 +162,7 @@ VOID MlmeCntlMachinePerformAction(
// Resume TxRing after SCANING complete. We hope the out-of-service time
// won't be too long to let upper layer time-out the waiting frames
RTMPResumeMsduTransmission(pAd);
- if (pAd->StaCfg.CCXReqType != MSRN_TYPE_UNUSED)
- {
- // Cisco scan request is finished, prepare beacon report
- MlmeEnqueue(pAd, AIRONET_STATE_MACHINE, MT2_AIRONET_SCAN_DONE, 0, NULL);
- }
+
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
//
@@ -188,7 +183,7 @@ VOID MlmeCntlMachinePerformAction(
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
}
break;
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
//
// This state is for that we want to connect to an AP but
// it didn't find on BSS List table. So we need to scan the air first,
@@ -212,14 +207,14 @@ VOID MlmeCntlMachinePerformAction(
//
// Check if we can connect to.
//
- BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
+ BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, (CHAR *) pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
if (pAd->MlmeAux.SsidBssTab.BssNr > 0)
{
MlmeAutoReconnectLastSSID(pAd);
}
}
break;
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
default:
DBGPRINT_ERR(("!ERROR! CNTL - Illegal message type(=%ld)", Elem->MsgType));
break;
@@ -294,11 +289,13 @@ VOID CntlOidScanProc(
ULONG BssIdx = BSS_NOT_FOUND;
BSS_ENTRY CurrBss;
+
+
// record current BSS if network is connected.
// 2003-2-13 do not include current IBSS if this is the only STA in this IBSS.
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
{
- BssIdx = BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Channel);
+ BssIdx = BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid, (PUCHAR)pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Channel);
if (BssIdx != BSS_NOT_FOUND)
{
NdisMoveMemory(&CurrBss, &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
@@ -318,7 +315,7 @@ VOID CntlOidScanProc(
pAd->ScanTab.BssNr = 1;
}
- ScanParmFill(pAd, &ScanReq, "", 0, BSS_ANY, SCAN_ACTIVE);
+ ScanParmFill(pAd, &ScanReq, (PSTRING) Elem->Msg, Elem->MsgLen, BSS_ANY, SCAN_ACTIVE);
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
@@ -341,11 +338,6 @@ VOID CntlOidSsidProc(
MLME_DISASSOC_REQ_STRUCT DisassocReq;
ULONG Now;
-#ifdef RT2860
- // BBP and RF are not accessible in PS mode, we has to wake them up first
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- AsicForceWakeup(pAd, RTMP_HALT);
-#endif
// Step 1. record the desired user settings to MlmeAux
NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
@@ -354,6 +346,7 @@ VOID CntlOidSsidProc(
NdisZeroMemory(pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
+ pAd->StaCfg.bAutoConnectByBssid = FALSE;
//
// Update Reconnect Ssid, that user desired to connect.
@@ -364,7 +357,7 @@ VOID CntlOidSsidProc(
// step 2. find all matching BSS in the lastest SCAN result (inBssTab)
// & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order
- BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
+ BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - %d BSS of %d BSS match the desire (%d)SSID - %s\n",
pAd->MlmeAux.SsidBssTab.BssNr, pAd->ScanTab.BssNr, pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid));
@@ -423,15 +416,7 @@ VOID CntlOidSsidProc(
}
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- {
- union iwreq_data wrqu;
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
-
- }
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, &pAd->MlmeAux.Bssid[0], NULL, 0);
}
}
else if (INFRA_ON(pAd))
@@ -483,7 +468,7 @@ VOID CntlOidSsidProc(
MLME_SCAN_REQ_STRUCT ScanReq;
DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - No matching BSS, start a new scan\n"));
- ScanParmFill(pAd, &ScanReq, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
+ ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
// Reset Missed scan number
@@ -519,52 +504,41 @@ VOID CntlOidRTBssidProc(
COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pOidBssid);
pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
- //
- // Update Reconnect Ssid, that user desired to connect.
- //
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
- pAd->MlmeAux.AutoReconnectSsidLen = pAd->MlmeAux.SsidLen;
- NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
-
// find the desired BSS in the latest SCAN result table
BssIdx = BssTableSearch(&pAd->ScanTab, pOidBssid, pAd->MlmeAux.Channel);
if (BssIdx == BSS_NOT_FOUND)
{
+ MLME_SCAN_REQ_STRUCT ScanReq;
+
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - BSSID not found. reply NDIS_STATUS_NOT_ACCEPTED\n"));
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
+ //pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("CNTL - BSSID not found. start a new scan\n"));
+ ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
+ MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
+ pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
+ // Reset Missed scan number
+ NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
return;
}
+ //
+ // Update Reconnect Ssid, that user desired to connect.
+ //
+ NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
+ pAd->MlmeAux.AutoReconnectSsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
+ NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->ScanTab.BssEntry[BssIdx].SsidLen);
+
// copy the matched BSS entry from ScanTab to MlmeAux.SsidBssTab. Why?
// Because we need this entry to become the JOIN target in later on SYNC state machine
pAd->MlmeAux.BssIdx = 0;
pAd->MlmeAux.SsidBssTab.BssNr = 1;
NdisMoveMemory(&pAd->MlmeAux.SsidBssTab.BssEntry[0], &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
- // 2002-11-26 skip the following checking. i.e. if user wants to re-connect to same AP
- // we just follow normal procedure. The reason of user doing this may because he/she changed
- // AP to another channel, but we still received BEACON from it thus don't claim Link Down.
- // Since user knows he's changed AP channel, he'll re-connect again. By skipping the following
- // checking, we'll disassociate then re-do normal association with this AP at the new channel.
- // 2003-1-6 Re-enable this feature based on microsoft requirement which prefer not to re-do
- // connection when setting the same BSSID.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) &&
- MAC_ADDR_EQUAL(pAd->CommonCfg.Bssid, pOidBssid))
- {
- // already connected to the same BSSID, go back to idle state directly
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - already in this BSSID. ignore this SET_BSSID request\n"));
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- {
- union iwreq_data wrqu;
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
+ // Add SSID into MlmeAux for site surey joining hidden SSID
+ pAd->MlmeAux.SsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
+ NdisMoveMemory(pAd->MlmeAux.Ssid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->MlmeAux.SsidLen);
- }
- }
- else
{
if (INFRA_ON(pAd))
{
@@ -625,11 +599,11 @@ VOID CntlOidRTBssidProc(
// Set Mix cipher flag
pAd->StaCfg.bMixCipher = (pAd->StaCfg.PairCipher == pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
- if (pAd->StaCfg.bMixCipher == TRUE)
+ /*if (pAd->StaCfg.bMixCipher == TRUE)
{
// If mix cipher, re-build RSNIE
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
- }
+ }*/
// No active association, join the BSS immediately
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - joining %02x:%02x:%02x:%02x:%02x:%02x ...\n",
pOidBssid[0],pOidBssid[1],pOidBssid[2],pOidBssid[3],pOidBssid[4],pOidBssid[5]));
@@ -654,19 +628,26 @@ VOID CntlMlmeRoamingProc(
IN PRTMP_ADAPTER pAd,
IN MLME_QUEUE_ELEM *Elem)
{
- // TODO:
- // AP in different channel may show lower RSSI than actual value??
- // should we add a weighting factor to compensate it?
+ UCHAR BBPValue = 0;
+
DBGPRINT(RT_DEBUG_TRACE,("CNTL - Roaming in MlmeAux.RoamTab...\n"));
+ {
+ //Let BBP register at 20MHz to do (fast) roaming.
+ RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
+ BBPValue &= (~0x18);
+ RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
+
NdisMoveMemory(&pAd->MlmeAux.SsidBssTab, &pAd->MlmeAux.RoamTab, sizeof(pAd->MlmeAux.RoamTab));
pAd->MlmeAux.SsidBssTab.BssNr = pAd->MlmeAux.RoamTab.BssNr;
BssTableSortByRssi(&pAd->MlmeAux.SsidBssTab);
pAd->MlmeAux.BssIdx = 0;
IterateOnBssTab(pAd);
+ }
}
+
/*
==========================================================================
Description:
@@ -696,7 +677,7 @@ VOID CntlWaitDisassocProc(
if ((pAd->MlmeAux.SsidBssTab.BssNr==0) && (pAd->StaCfg.BssType == BSS_ADHOC))
{
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - No matching BSS, start a new ADHOC (Ssid=%s)...\n",pAd->MlmeAux.Ssid));
- StartParmFill(pAd, &StartReq, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
+ StartParmFill(pAd, &StartReq, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
}
@@ -763,15 +744,15 @@ VOID CntlWaitJoinProc(
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeShared) ||
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch))
{
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, Ndis802_11AuthModeShared);
+ AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_KEY);
}
else
{
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, Ndis802_11AuthModeOpen);
- }
+ AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_OPEN);
}
MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_MLME_AUTH_REQ,
sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq);
+ }
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_AUTH;
}
@@ -817,7 +798,7 @@ VOID CntlWaitStartProc(
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Channel=%d, Start adhoc on W53(52,56,60,64) Channels are not accepted\n", pAd->CommonCfg.Channel));
return;
}
-
+ NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16);
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
{
N_ChannelCheck(pAd);
@@ -825,7 +806,6 @@ VOID CntlWaitStartProc(
NdisMoveMemory(&pAd->MlmeAux.AddHtInfo, &pAd->CommonCfg.AddHTInfo, sizeof(ADD_HT_INFO_IE));
RTMPCheckHt(pAd, BSSID_WCID, &pAd->CommonCfg.HtCapability, &pAd->CommonCfg.AddHTInfo);
pAd->StaActive.SupportedPhyInfo.bHtEnable = TRUE;
- NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16);
NdisMoveMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], &pAd->CommonCfg.HtCapability.MCSSet[0], 16);
COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
@@ -911,16 +891,16 @@ VOID CntlWaitAuthProc(
(pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch))
{
// either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, Ndis802_11AuthModeShared);
+ AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_KEY);
}
else
{
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, Ndis802_11AuthModeOpen);
- }
+ AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_OPEN);
}
MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_MLME_AUTH_REQ,
sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq);
+ }
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_AUTH2;
}
}
@@ -950,11 +930,13 @@ VOID CntlWaitAuthProc2(
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid, pAd->MlmeAux.CapabilityInfo,
ASSOC_TIMEOUT, pAd->StaCfg.DefaultListenCount);
+ {
MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_ASSOC_REQ,
sizeof(MLME_ASSOC_REQ_STRUCT), &AssocReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_ASSOC;
}
+ }
else
{
if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch) &&
@@ -998,14 +980,14 @@ VOID CntlWaitAssocProc(
NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
if (Reason == MLME_SUCCESS)
{
- LinkUp(pAd, BSS_INFRA);
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Association successful on BSS #%ld\n",pAd->MlmeAux.BssIdx));
-
if (pAd->CommonCfg.bWirelessEvent)
{
RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
}
+
+ LinkUp(pAd, BSS_INFRA);
+ pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
+ DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Association successful on BSS #%ld\n",pAd->MlmeAux.BssIdx));
}
else
{
@@ -1036,15 +1018,16 @@ VOID CntlWaitReassocProc(
NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
if (Result == MLME_SUCCESS)
{
+ // send wireless event - for association
+ if (pAd->CommonCfg.bWirelessEvent)
+ RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
+
+
//
// NDIS requires a new Link UP indication but no Link Down for RE-ASSOC
//
LinkUp(pAd, BSS_INFRA);
- // send wireless event - for association
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Re-assocition successful on BSS #%ld\n", pAd->MlmeAux.RoamIdx));
}
@@ -1052,14 +1035,15 @@ VOID CntlWaitReassocProc(
{
// reassoc failed, try to pick next BSS in the BSS Table
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Re-assocition fails on BSS #%ld\n", pAd->MlmeAux.RoamIdx));
+ {
pAd->MlmeAux.RoamIdx++;
IterateOnBssTab2(pAd);
}
}
+ }
}
-#ifdef RT2870
VOID AdhocTurnOnQos(
IN PRTMP_ADAPTER pAd)
{
@@ -1094,7 +1078,6 @@ VOID AdhocTurnOnQos(
}
AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
}
-#endif /* RT2870 */
/*
==========================================================================
@@ -1111,17 +1094,19 @@ VOID LinkUp(
ULONG Now;
UINT32 Data;
BOOLEAN Cancelled;
- UCHAR Value = 0, idx;
- MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
+ UCHAR Value = 0, idx = 0, HashIdx = 0;
+ MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL;
-#ifdef RT2860
- if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
+ // Init ChannelQuality to prevent DEAD_CQI at initial LinkUp
+ pAd->Mlme.ChannelQuality = 50;
+
+ pEntry = MacTableLookup(pAd, pAd->CommonCfg.Bssid);
+ if (pEntry)
{
- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT);
- RTMPusecDelay(6000);
- pAd->bPCIclkOff = FALSE;
+ MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
+ pEntry = NULL;
}
-#endif
+
pEntry = &pAd->MacTab.Content[BSSID_WCID];
@@ -1140,13 +1125,7 @@ VOID LinkUp(
COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
- // It's quite difficult to tell if a newly added KEY is WEP or CKIP until a new BSS
- // is formed (either ASSOC/RE-ASSOC done or IBSS started. LinkUP should be a safe place
- // to examine if cipher algorithm switching is required.
- //rt2860b. Don't know why need this
- SwitchBetweenWepAndCkip(pAd);
-
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
// Before power save before link up function, We will force use 1R.
// So after link up, check Rx antenna # again.
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
@@ -1164,28 +1143,16 @@ VOID LinkUp(
}
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
pAd->StaCfg.BBPR3 = Value;
-#endif /* RT2860 */
+#endif // RTMP_MAC_PCI //
if (BssType == BSS_ADHOC)
{
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_ADHOC_ON);
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
- if ((pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
- (pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE))
- {
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2;
- }
- else if ((pAd->CommonCfg.Channel > 2) &&
- (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
- (pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW))
- {
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2;
- }
-#ifdef RT2870
+
if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
AdhocTurnOnQos(pAd);
-#endif
DBGPRINT(RT_DEBUG_TRACE, ("!!!Adhoc LINK UP !!! \n" ));
}
@@ -1221,9 +1188,9 @@ VOID LinkUp(
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
Value &= (~0x20);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RT2860
- pAd->StaCfg.BBPR3 = Value;
-#endif
+#ifdef RTMP_MAC_PCI
+ pAd->StaCfg.BBPR3 = Value;
+#endif // RTMP_MAC_PCI //
RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
Data &= 0xfffffffe;
@@ -1258,9 +1225,9 @@ VOID LinkUp(
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
Value |= (0x20);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RT2860
- pAd->StaCfg.BBPR3 = Value;
-#endif
+#ifdef RTMP_MAC_PCI
+ pAd->StaCfg.BBPR3 = Value;
+#endif // RTMP_MAC_PCI //
if (pAd->MACVersion == 0x28600100)
{
@@ -1290,9 +1257,9 @@ VOID LinkUp(
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
Value &= (~0x20);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RT2860
- pAd->StaCfg.BBPR3 = Value;
-#endif
+#ifdef RTMP_MAC_PCI
+ pAd->StaCfg.BBPR3 = Value;
+#endif // RTMP_MAC_PCI //
if (pAd->MACVersion == 0x28600100)
{
@@ -1306,6 +1273,7 @@ VOID LinkUp(
}
RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW);
+
//
// Save BBP_R66 value, it will be used in RTUSBResumeMsduTransmission
//
@@ -1467,25 +1435,23 @@ VOID LinkUp(
// On WPA mode, Remove All Keys if not connect to the last BSSID
// Key will be set after 4-way handshake.
//
- if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
+ if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
{
ULONG IV;
// Remove all WPA keys
+ RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
RTMPWPARemoveAllKeys(pAd);
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
// Fixed connection failed with Range Maximizer - 515 AP (Marvell Chip) when security is WPAPSK/TKIP
// If IV related values are too large in GroupMsg2, AP would ignore this message.
- IV = 0;
+ IV = 1;
IV |= (pAd->StaCfg.DefaultKeyId << 30);
AsicUpdateWCIDIVEIV(pAd, BSSID_WCID, IV, 0);
-
-#ifdef RT2860
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#endif
}
+
// NOTE:
// the decision of using "short slot time" or not may change dynamically due to
// new STA association to the AP. so we have to decide that upon parsing BEACON, not here
@@ -1502,28 +1468,6 @@ VOID LinkUp(
// Add BSSID to WCID search table
AsicUpdateRxWCIDTable(pAd, BSSID_WCID, pAd->CommonCfg.Bssid);
- NdisAcquireSpinLock(&pAd->MacTabLock);
- // add this BSSID entry into HASH table
- {
- UCHAR HashIdx;
-
- //pEntry = &pAd->MacTab.Content[BSSID_WCID];
- HashIdx = MAC_ADDR_HASH_INDEX(pAd->CommonCfg.Bssid);
- if (pAd->MacTab.Hash[HashIdx] == NULL)
- {
- pAd->MacTab.Hash[HashIdx] = pEntry;
- }
- else
- {
- pCurrEntry = pAd->MacTab.Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- pCurrEntry = pCurrEntry->pNext;
- pCurrEntry->pNext = pEntry;
- }
- }
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
-
// If WEP is enabled, add paiewise and shared key
if (((pAd->StaCfg.WpaSupplicantUP)&&
(pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)&&
@@ -1549,6 +1493,7 @@ VOID LinkUp(
// Assign group key info
RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, NULL);
+ pEntry->Aid = BSSID_WCID;
// Assign pairwise key info
RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, pEntry);
}
@@ -1565,26 +1510,55 @@ VOID LinkUp(
{
pAd->IndicateMediaState = NdisMediaStateConnected;
pAd->ExtraInfo = GENERAL_LINK_UP;
-#ifdef RT2870
RTMP_IndicateMediaState(pAd);
-#endif
+ }
+ else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
+ (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
+ {
+ if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
+ RTMPSetTimer(&pAd->Mlme.LinkDownTimer, LINK_DOWN_TIMEOUT);
}
// --
-#ifdef RT2860
- RTMP_IndicateMediaState(pAd);
-#endif
// Add BSSID in my MAC Table.
NdisAcquireSpinLock(&pAd->MacTabLock);
- RTMPMoveMemory(pAd->MacTab.Content[BSSID_WCID].Addr, pAd->CommonCfg.Bssid, MAC_ADDR_LEN);
- pAd->MacTab.Content[BSSID_WCID].Aid = BSSID_WCID;
- pAd->MacTab.Content[BSSID_WCID].pAd = pAd;
- pAd->MacTab.Content[BSSID_WCID].ValidAsCLI = TRUE; //Although this is bssid..still set ValidAsCl
+ // add this MAC entry into HASH table
+ if (pEntry)
+ {
+ HashIdx = MAC_ADDR_HASH_INDEX(pAd->CommonCfg.Bssid);
+ if (pAd->MacTab.Hash[HashIdx] == NULL)
+ {
+ pAd->MacTab.Hash[HashIdx] = pEntry;
+ }
+ else
+ {
+ pCurrEntry = pAd->MacTab.Hash[HashIdx];
+ while (pCurrEntry->pNext != NULL)
+ {
+ pCurrEntry = pCurrEntry->pNext;
+ }
+ pCurrEntry->pNext = pEntry;
+ }
+ }
+ RTMPMoveMemory(pEntry->Addr, pAd->CommonCfg.Bssid, MAC_ADDR_LEN);
+ pEntry->Aid = BSSID_WCID;
+ pEntry->pAd = pAd;
+ pEntry->ValidAsCLI = TRUE; //Although this is bssid..still set ValidAsCl
pAd->MacTab.Size = 1; // infra mode always set MACtab size =1.
- pAd->MacTab.Content[BSSID_WCID].Sst = SST_ASSOC;
- pAd->MacTab.Content[BSSID_WCID].AuthState = SST_ASSOC;
- pAd->MacTab.Content[BSSID_WCID].AuthMode = pAd->StaCfg.AuthMode;
- pAd->MacTab.Content[BSSID_WCID].WepStatus = pAd->StaCfg.WepStatus;
+ pEntry->Sst = SST_ASSOC;
+ pEntry->AuthState = SST_ASSOC;
+ pEntry->AuthMode = pAd->StaCfg.AuthMode;
+ pEntry->WepStatus = pAd->StaCfg.WepStatus;
+ if (pEntry->AuthMode < Ndis802_11AuthModeWPA)
+ {
+ pEntry->WpaState = AS_NOTUSE;
+ pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
+ }
+ else
+ {
+ pEntry->WpaState = AS_PTKSTART;
+ pEntry->PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
+ }
NdisReleaseSpinLock(&pAd->MacTabLock);
DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK UP !!! ClientStatusFlags=%lx)\n",
@@ -1598,32 +1572,34 @@ VOID LinkUp(
{
if ((pAd->CommonCfg.bPiggyBackCapable) && (pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)
{
-
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_PIGGYBACK_INUSED);
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
+ CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE);
+ CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_PIGGYBACK_CAPABLE);
RTMPSetPiggyBack(pAd, TRUE);
DBGPRINT(RT_DEBUG_TRACE, ("Turn on Piggy-Back\n"));
}
else if (pAd->MlmeAux.APRalinkIe & 0x00000001)
{
OPSTATUS_SET_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
+ CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE);
+ DBGPRINT(RT_DEBUG_TRACE, ("Ralink Aggregation\n"));
}
}
if (pAd->MlmeAux.APRalinkIe != 0x0)
{
- if (CLIENT_STATUS_TEST_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RDG_CAPABLE))
+ if (CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE))
{
AsicEnableRDG(pAd);
}
-
OPSTATUS_SET_FLAG(pAd, fCLIENT_STATUS_RALINK_CHIPSET);
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RALINK_CHIPSET);
+ CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RALINK_CHIPSET);
}
else
{
OPSTATUS_CLEAR_FLAG(pAd, fCLIENT_STATUS_RALINK_CHIPSET);
- CLIENT_STATUS_CLEAR_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RALINK_CHIPSET);
+ CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_RALINK_CHIPSET);
}
}
@@ -1707,8 +1683,8 @@ VOID LinkUp(
// Txop can only be modified when RDG is off, WMM is disable and TxBurst is enable
//
// if 1. Legacy AP WMM on, or 2. 11n AP, AMPDU disable. Force turn off burst no matter what bEnableTxBurst is.
- if (
- !(pAd->CommonCfg.RxStream == 1 && pAd->CommonCfg.TxStream == 1) &&
+ if (!((pAd->CommonCfg.RxStream == 1)&&(pAd->CommonCfg.TxStream == 1)) &&
+ (pAd->StaCfg.bForceTxBurst == FALSE) &&
(((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
|| ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE))))
{
@@ -1770,9 +1746,16 @@ VOID LinkUp(
if (pAd->StaCfg.WepStatus <= Ndis802_11WEPDisabled)
{
+ if (pAd->StaCfg.WpaSupplicantUP &&
+ (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) &&
+ (pAd->StaCfg.IEEE8021X == TRUE))
+ ;
+ else
+ {
pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
}
+ }
NdisAcquireSpinLock(&pAd->MacTabLock);
pEntry->PortSecured = pAd->StaCfg.PortSecured;
@@ -1792,9 +1775,8 @@ VOID LinkUp(
}
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
-#ifdef RT2860
+
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
-#endif
}
/*
@@ -1827,21 +1809,17 @@ VOID LinkDown(
IN BOOLEAN IsReqFromAP)
{
UCHAR i, ByteValue = 0;
-#ifdef RT2860
BOOLEAN Cancelled;
-#endif
// Do nothing if monitor mode is on
if (MONITOR_ON(pAd))
return;
-#ifdef RT2860
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
-
+ //Comment the codes, beasue the line 2291 call the same function.
+ //RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
// Not allow go to sleep within linkdown function.
RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#endif
if (pAd->CommonCfg.bWirelessEvent)
{
@@ -1851,24 +1829,32 @@ VOID LinkDown(
DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN !!!\n"));
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+#ifdef RTMP_MAC_PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
BOOLEAN Cancelled;
pAd->Mlme.bPsPollTimerRunning = FALSE;
RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
}
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) ||
- RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
+ pAd->bPCIclkOff = FALSE;
+#endif // RTMP_MAC_PCI //
+
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
+|| RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)
+ || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
{
- AsicForceWakeup(pAd, RTMP_HALT);
+ AUTO_WAKEUP_STRUC AutoWakeupCfg;
+ AsicForceWakeup(pAd, TRUE);
+ AutoWakeupCfg.word = 0;
+ RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
}
- pAd->bPCIclkOff = FALSE;
-#endif
+#ifdef RTMP_MAC_PCI
+ pAd->bPCIclkOff = FALSE;
+#endif // RTMP_MAC_PCI //
+
if (ADHOC_ON(pAd)) // Adhoc mode link down
{
DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 1!!!\n"));
@@ -1917,34 +1903,22 @@ VOID LinkDown(
// 3. short preamble
OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED);
- if (pAd->StaCfg.CCXAdjacentAPReportFlag == TRUE)
- {
- //
- // Record current AP's information.
- // for later used reporting Adjacent AP report.
- //
- pAd->StaCfg.CCXAdjacentAPChannel = pAd->CommonCfg.Channel;
- pAd->StaCfg.CCXAdjacentAPSsidLen = pAd->CommonCfg.SsidLen;
- NdisMoveMemory(pAd->StaCfg.CCXAdjacentAPSsid, pAd->CommonCfg.Ssid, pAd->StaCfg.CCXAdjacentAPSsidLen);
- COPY_MAC_ADDR(pAd->StaCfg.CCXAdjacentAPBssid, pAd->CommonCfg.Bssid);
- }
+
}
+
for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
{
if (pAd->MacTab.Content[i].ValidAsCLI == TRUE)
MacTableDeleteEntry(pAd, pAd->MacTab.Content[i].Aid, pAd->MacTab.Content[i].Addr);
}
- pAd->StaCfg.CCXQosECWMin = 4;
- pAd->StaCfg.CCXQosECWMax = 10;
-
AsicSetSlotTime(pAd, TRUE); //FALSE);
AsicSetEdcaParm(pAd, NULL);
// Set LED
RTMPSetLED(pAd, LED_LINK_DOWN);
- pAd->LedIndicatorStregth = 0xF0;
+ pAd->LedIndicatorStrength = 0xF0;
RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, firmware is not done it.
AsicDisableSync(pAd);
@@ -1971,8 +1945,8 @@ VOID LinkDown(
pAd->StaCfg.WpaState = SS_START;
// Clear Replay counter
NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
- }
+ }
//
// if link down come from AP, we need to remove all WPA keys on WPA mode.
@@ -2001,31 +1975,21 @@ VOID LinkDown(
}
NdisAcquireSpinLock(&pAd->MacTabLock);
+ NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE));
pAd->MacTab.Content[BSSID_WCID].PortSecured = pAd->StaCfg.PortSecured;
NdisReleaseSpinLock(&pAd->MacTabLock);
pAd->StaCfg.MicErrCnt = 0;
- // Turn off Ckip control flag
- pAd->StaCfg.bCkipOn = FALSE;
- pAd->StaCfg.CCXEnable = FALSE;
-
pAd->IndicateMediaState = NdisMediaStateDisconnected;
// Update extra information to link is up
pAd->ExtraInfo = GENERAL_LINK_DOWN;
-#ifdef RT2860
- pAd->StaCfg.AdhocBOnlyJoined = FALSE;
- pAd->StaCfg.AdhocBGJoined = FALSE;
- pAd->StaCfg.Adhoc20NJoined = FALSE;
-#endif
pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- // Reset the Current AP's IP address
- NdisZeroMemory(pAd->StaCfg.AironetIPAddress, 4);
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
pAd->bUsbTxBulkAggre = FALSE;
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// Clean association information
NdisZeroMemory(&pAd->StaCfg.AssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
@@ -2081,30 +2045,18 @@ VOID LinkDown(
RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff);
RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
-#ifdef RT2860
- // Allow go to sleep after linkdown steps.
+// Allow go to sleep after linkdown steps.
RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#endif
- {
- union iwreq_data wrqu;
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
- }
+ RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
- if (IS_RT3090(pAd))
+#ifdef RT30xx
+ if ((IS_RT30xx(pAd) || IS_RT3090(pAd)||IS_RT3390(pAd))
+ &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
{
- UINT32 macdata;
- // disable MMPS BBP control register
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &ByteValue);
- ByteValue &= ~(0x04); //bit 2
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, ByteValue);
-
- // disable MMPS MAC control register
- RTMP_IO_READ32(pAd, 0x1210, &macdata);
- macdata &= ~(0x09); //bit 0, 3
- RTMP_IO_WRITE32(pAd, 0x1210, macdata);
+ RTMP_ASIC_MMPS_DISABLE(pAd);
}
+#endif // RT30xx //
}
/*
@@ -2161,11 +2113,11 @@ VOID IterateOnBssTab(
// Set Mix cipher flag
pAd->StaCfg.bMixCipher = (pAd->StaCfg.PairCipher == pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
- if (pAd->StaCfg.bMixCipher == TRUE)
+ /*if (pAd->StaCfg.bMixCipher == TRUE)
{
// If mix cipher, re-build RSNIE
RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
- }
+ }*/
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - iterate BSS %ld of %d\n", BssIdx, pAd->MlmeAux.SsidBssTab.BssNr));
JoinParmFill(pAd, &JoinReq, BssIdx);
@@ -2176,15 +2128,19 @@ VOID IterateOnBssTab(
else if (pAd->StaCfg.BssType == BSS_ADHOC)
{
DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All BSS fail; start a new ADHOC (Ssid=%s)...\n",pAd->MlmeAux.Ssid));
- StartParmFill(pAd, &StartReq, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
+ StartParmFill(pAd, &StartReq, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
}
else // no more BSS
{
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All roaming failed, stay @ ch #%d\n", pAd->CommonCfg.Channel));
+
+ {
AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+ DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All roaming failed, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
+ }
+
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
}
}
@@ -2218,9 +2174,13 @@ VOID IterateOnBssTab2(
}
else // no more BSS
{
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All fast roaming failed, back to ch #%d\n",pAd->CommonCfg.Channel));
+
+ {
AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
AsicLockChannel(pAd, pAd->CommonCfg.Channel);
+ DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All roaming failed, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
+ }
+
pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
}
}
@@ -2252,7 +2212,7 @@ VOID JoinParmFill(
VOID ScanParmFill(
IN PRTMP_ADAPTER pAd,
IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
- IN CHAR Ssid[],
+ IN STRING Ssid[],
IN UCHAR SsidLen,
IN UCHAR BssType,
IN UCHAR ScanType)
@@ -2310,10 +2270,32 @@ VOID AuthParmFill(
==========================================================================
*/
+#ifdef RTMP_MAC_PCI
+VOID ComposePsPoll(
+ IN PRTMP_ADAPTER pAd)
+{
+ NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
+ pAd->PsPollFrame.FC.Type = BTYPE_CNTL;
+ pAd->PsPollFrame.FC.SubType = SUBTYPE_PS_POLL;
+ pAd->PsPollFrame.Aid = pAd->StaActive.Aid | 0xC000;
+ COPY_MAC_ADDR(pAd->PsPollFrame.Bssid, pAd->CommonCfg.Bssid);
+ COPY_MAC_ADDR(pAd->PsPollFrame.Ta, pAd->CurrentAddress);
+}
-
-#ifdef RT2870
-
+// IRQL = DISPATCH_LEVEL
+VOID ComposeNullFrame(
+ IN PRTMP_ADAPTER pAd)
+{
+ NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
+ pAd->NullFrame.FC.Type = BTYPE_DATA;
+ pAd->NullFrame.FC.SubType = SUBTYPE_NULL_FUNC;
+ pAd->NullFrame.FC.ToDs = 1;
+ COPY_MAC_ADDR(pAd->NullFrame.Addr1, pAd->CommonCfg.Bssid);
+ COPY_MAC_ADDR(pAd->NullFrame.Addr2, pAd->CurrentAddress);
+ COPY_MAC_ADDR(pAd->NullFrame.Addr3, pAd->CommonCfg.Bssid);
+}
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
VOID MlmeCntlConfirm(
IN PRTMP_ADAPTER pAd,
IN ULONG MsgType,
@@ -2321,29 +2303,23 @@ VOID MlmeCntlConfirm(
{
MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MsgType, sizeof(USHORT), &Msg);
}
-#endif
VOID ComposePsPoll(
IN PRTMP_ADAPTER pAd)
{
-#ifdef RT2870
PTXINFO_STRUC pTxInfo;
PTXWI_STRUC pTxWI;
DBGPRINT(RT_DEBUG_TRACE, ("ComposePsPoll\n"));
-#endif
NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
-#ifdef RT2870
pAd->PsPollFrame.FC.PwrMgmt = 0;
-#endif
pAd->PsPollFrame.FC.Type = BTYPE_CNTL;
pAd->PsPollFrame.FC.SubType = SUBTYPE_PS_POLL;
pAd->PsPollFrame.Aid = pAd->StaActive.Aid | 0xC000;
COPY_MAC_ADDR(pAd->PsPollFrame.Bssid, pAd->CommonCfg.Bssid);
COPY_MAC_ADDR(pAd->PsPollFrame.Ta, pAd->CurrentAddress);
-#ifdef RT2870
RTMPZeroMemory(&pAd->PsPollContext.TransferBuffer->field.WirelessPacket[0], 100);
pTxInfo = (PTXINFO_STRUC)&pAd->PsPollContext.TransferBuffer->field.WirelessPacket[0];
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT)(sizeof(PSPOLL_FRAME)+TXWI_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
@@ -2353,17 +2329,14 @@ VOID ComposePsPoll(
RTMPMoveMemory(&pAd->PsPollContext.TransferBuffer->field.WirelessPacket[TXWI_SIZE+TXINFO_SIZE], &pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
// Append 4 extra zero bytes.
pAd->PsPollContext.BulkOutSize = TXINFO_SIZE + TXWI_SIZE + sizeof(PSPOLL_FRAME) + 4;
-#endif
}
// IRQL = DISPATCH_LEVEL
VOID ComposeNullFrame(
IN PRTMP_ADAPTER pAd)
{
-#ifdef RT2870
PTXINFO_STRUC pTxInfo;
PTXWI_STRUC pTxWI;
-#endif
NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
pAd->NullFrame.FC.Type = BTYPE_DATA;
@@ -2372,7 +2345,6 @@ VOID ComposeNullFrame(
COPY_MAC_ADDR(pAd->NullFrame.Addr1, pAd->CommonCfg.Bssid);
COPY_MAC_ADDR(pAd->NullFrame.Addr2, pAd->CurrentAddress);
COPY_MAC_ADDR(pAd->NullFrame.Addr3, pAd->CommonCfg.Bssid);
-#ifdef RT2870
RTMPZeroMemory(&pAd->NullContext.TransferBuffer->field.WirelessPacket[0], 100);
pTxInfo = (PTXINFO_STRUC)&pAd->NullContext.TransferBuffer->field.WirelessPacket[0];
RTMPWriteTxInfo(pAd, pTxInfo, (USHORT)(sizeof(HEADER_802_11)+TXWI_SIZE), TRUE, EpToQueue[MGMTPIPEIDX], FALSE, FALSE);
@@ -2381,11 +2353,8 @@ VOID ComposeNullFrame(
0, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
RTMPMoveMemory(&pAd->NullContext.TransferBuffer->field.WirelessPacket[TXWI_SIZE+TXINFO_SIZE], &pAd->NullFrame, sizeof(HEADER_802_11));
pAd->NullContext.BulkOutSize = TXINFO_SIZE + TXWI_SIZE + sizeof(pAd->NullFrame) + 4;
-#endif
}
-
-
-
+#endif // RTMP_MAC_USB //
/*
==========================================================================
@@ -2407,7 +2376,7 @@ ULONG MakeIbssBeacon(
LARGE_INTEGER FakeTimestamp;
ULONG FrameLen = 0;
PTXWI_STRUC pTxWI = &pAd->BeaconTxWI;
- CHAR *pBeaconFrame = pAd->BeaconBuf;
+ UCHAR *pBeaconFrame = pAd->BeaconBuf;
BOOLEAN Privacy;
UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
UCHAR SupRateLen = 0;
@@ -2565,5 +2534,3 @@ ULONG MakeIbssBeacon(
FrameLen, SupRateLen, ExtRateLen, pAd->CommonCfg.Channel, pAd->CommonCfg.PhyMode));
return FrameLen;
}
-
-
diff --git a/drivers/staging/rt2860/sta/rtmp_data.c b/drivers/staging/rt2860/sta/rtmp_data.c
index f751ab61c438..0ab3dce5d1ae 100644
--- a/drivers/staging/rt2860/sta/rtmp_data.c
+++ b/drivers/staging/rt2860/sta/rtmp_data.c
@@ -33,8 +33,6 @@
Revision History:
Who When What
-------- ---------- ----------------------------------------------
- John Aug/17/04 major modification for RT2561/2661
- Jan Lee Mar/17/06 major modification for RT2860 New Ring Design
*/
#include "../rt_config.h"
@@ -64,6 +62,7 @@ VOID STARxEAPOLFrameIndicate(
int idx = 0;
DBGPRINT_RAW(RT_DEBUG_TRACE, ("Receive EAP-SUCCESS Packet\n"));
+ //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAd);
if (pAd->StaCfg.IEEE8021x_required_keys == FALSE)
@@ -74,7 +73,7 @@ VOID STARxEAPOLFrameIndicate(
if (pAd->StaCfg.DesireSharedKey[idx].KeyLen > 0)
{
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[BSSID_WCID];
// Set key material and cipherAlg to Asic
@@ -88,8 +87,8 @@ VOID STARxEAPOLFrameIndicate(
pAd->IndicateMediaState = NdisMediaStateConnected;
pAd->ExtraInfo = GENERAL_LINK_UP;
-#endif
-#ifdef RT2870
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
union
{
char buf[sizeof(NDIS_802_11_WEP)+MAX_LEN_OF_KEY- 1];
@@ -113,7 +112,7 @@ VOID STARxEAPOLFrameIndicate(
pAd->ExtraInfo = GENERAL_LINK_UP;
// need to enqueue cmd to thread
RTUSBEnqueueCmdFromNdis(pAd, OID_802_11_ADD_WEP, TRUE, &WepKey, sizeof(WepKey.keyinfo) + len - 1);
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
// For Preventing ShardKey Table is cleared by remove key procedure.
pAd->SharedKey[BSS0][idx].CipherAlg = CipherAlg;
pAd->SharedKey[BSS0][idx].KeyLen = pAd->StaCfg.DesireSharedKey[idx].KeyLen;
@@ -156,6 +155,7 @@ VOID STARxDataFrameAnnounce(
// non-EAP frame
if (!RTMPCheckWPAframe(pAd, pEntry, pRxBlk->pData, pRxBlk->DataSize, FromWhichBSSID))
{
+
{
// drop all non-EAP DATA frame before
// this client's Port-Access-Control is secured
@@ -309,13 +309,13 @@ VOID STAHandleRxDataFrame(
if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && (pHeader->FC.SubType & 0x08))
{
UCHAR *pData;
- DBGPRINT(RT_DEBUG_TRACE,("bAPSDCapable\n"));
+ DBGPRINT(RT_DEBUG_INFO,("bAPSDCapable\n"));
// Qos bit 4
pData = (PUCHAR)pHeader + LENGTH_802_11;
if ((*pData >> 4) & 0x01)
{
- DBGPRINT(RT_DEBUG_TRACE,("RxDone- Rcv EOSP frame, driver may fall into sleep\n"));
+ DBGPRINT(RT_DEBUG_INFO,("RxDone- Rcv EOSP frame, driver may fall into sleep\n"));
pAd->CommonCfg.bInServicePeriod = FALSE;
// Force driver to fall into sleep mode when rcv EOSP frame
@@ -332,7 +332,7 @@ VOID STAHandleRxDataFrame(
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM) && (TbttNumToNextWakeUp > NextDtim))
TbttNumToNextWakeUp = NextDtim;
- MlmeSetPsmBit(pAd, PWR_SAVE);
+ RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
// if WMM-APSD is failed, try to disable following line
AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
}
@@ -442,6 +442,23 @@ VOID STAHandleRxDataFrame(
}
pRxBlk->UserPriority = UserPriority;
+ /* check if need to resend PS Poll when received packet with MoreData = 1 */
+ if ((pAd->StaCfg.Psm == PWR_SAVE) && (pHeader->FC.MoreData == 1))
+ {
+ if ((((UserPriority == 0) || (UserPriority == 3)) &&
+ pAd->CommonCfg.bAPSDAC_BE == 0) ||
+ (((UserPriority == 1) || (UserPriority == 2)) &&
+ pAd->CommonCfg.bAPSDAC_BK == 0) ||
+ (((UserPriority == 4) || (UserPriority == 5)) &&
+ pAd->CommonCfg.bAPSDAC_VI == 0) ||
+ (((UserPriority == 6) || (UserPriority == 7)) &&
+ pAd->CommonCfg.bAPSDAC_VO == 0))
+ {
+ /* non-UAPSD delivery-enabled AC */
+ RTMP_PS_POLL_ENQUEUE(pAd);
+ }
+ }
+
// 3. Order bit: A-Ralink or HTC+
if (pHeader->FC.Order)
{
@@ -451,7 +468,7 @@ VOID STAHandleRxDataFrame(
RX_BLK_SET_FLAG(pRxBlk, fRX_ARALINK);
}
else
-#endif
+#endif // AGGREGATION_SUPPORT //
{
RX_BLK_SET_FLAG(pRxBlk, fRX_HTC);
// skip HTC contorl field
@@ -574,27 +591,31 @@ VOID STAHandleRxMgmtFrame(
do
{
+
+ /* check if need to resend PS Poll when received packet with MoreData = 1 */
+ if ((pAd->StaCfg.Psm == PWR_SAVE) && (pHeader->FC.MoreData == 1))
+ {
+ /* for UAPSD, all management frames will be VO priority */
+ if (pAd->CommonCfg.bAPSDAC_VO == 0)
+ {
+ /* non-UAPSD delivery-enabled AC */
+ RTMP_PS_POLL_ENQUEUE(pAd);
+ }
+ }
+
+ /* TODO: if MoreData == 0, station can go to sleep */
+
+
// We should collect RSSI not only U2M data but also my beacon
- if (pAd->RxAnt.EvaluatePeriod == 0 &&
- pHeader->FC.SubType == SUBTYPE_BEACON &&
- MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2)) {
+ if ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))
+ && (pAd->RxAnt.EvaluatePeriod == 0))
+ {
Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
pAd->StaCfg.LastSNR0 = (UCHAR)(pRxWI->SNR0);
pAd->StaCfg.LastSNR1 = (UCHAR)(pRxWI->SNR1);
}
-#ifdef RT2870
- // collect rssi information for antenna diversity
- if (pAd->NicConfig2.field.AntDiversity)
- {
- if ((pRxD->U2M) || ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))))
- {
- COLLECT_RX_ANTENNA_AVERAGE_RSSI(pAd, ConvertToRssi(pAd, (UCHAR)pRxWI->RSSI0, RSSI_0), 0); //Note: RSSI2 not used on RT73
- pAd->StaCfg.NumOfAvgRssiSample ++;
- }
- }
-#endif
// First check the size, it MUST not exceed the mlme queue size
if (pRxWI->MPDUtotalByteCount > MGMT_DMA_BUFFER_SIZE)
@@ -683,14 +704,14 @@ BOOLEAN STARxDoneInterruptHandle(
break;
}
-#ifdef RT2860
+#ifdef RTMP_MAC_PCI
if (RxProcessed++ > MAX_RX_PROCESS_CNT)
{
// need to reschedule rx handle
bReschedule = TRUE;
break;
}
-#endif
+#endif // RTMP_MAC_PCI //
RxProcessed ++; // test
@@ -725,6 +746,7 @@ BOOLEAN STARxDoneInterruptHandle(
// Increase Total receive byte counter after real data received no mater any error or not
pAd->RalinkCounters.ReceivedByteCount += pRxWI->MPDUtotalByteCount;
+ pAd->RalinkCounters.OneSecReceivedByteCount += pRxWI->MPDUtotalByteCount;
pAd->RalinkCounters.RxCount ++;
INC_COUNTER64(pAd->WlanCounters.ReceivedFragmentCount);
@@ -737,7 +759,8 @@ BOOLEAN STARxDoneInterruptHandle(
send_monitor_packets(pAd, &RxCell);
break;
}
- /* RT2870 invokes STARxDoneInterruptHandle() in rtusb_bulk.c */
+
+ /* STARxDoneInterruptHandle() is called in rtusb_bulk.c */
// Check for all RxD errors
Status = RTMPCheckRxError(pAd, pHeader, pRxWI, pRxD);
@@ -780,15 +803,6 @@ BOOLEAN STARxDoneInterruptHandle(
}
}
-#ifdef RT2860
- // fRTMP_PS_GO_TO_SLEEP_NOW is set if receiving beacon.
- if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW) && (INFRA_ON(pAd)))
- {
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
- AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp);
- bReschedule = FALSE;
- }
-#endif
return bReschedule;
}
@@ -806,12 +820,7 @@ BOOLEAN STARxDoneInterruptHandle(
VOID RTMPHandleTwakeupInterrupt(
IN PRTMP_ADAPTER pAd)
{
-#ifdef RT2860
- AsicForceWakeup(pAd, DOT11POWERSAVE);
-#endif
-#ifdef RT2870
AsicForceWakeup(pAd, FALSE);
-#endif
}
/*
@@ -914,6 +923,7 @@ NDIS_STATUS STASendPacket(
UINT SrcBufLen;
UINT AllowFragSize;
UCHAR NumberOfFrag;
+ UCHAR RTSRequired;
UCHAR QueIdx, UserPriority;
MAC_TABLE_ENTRY *pEntry = NULL;
unsigned int IrqFlags;
@@ -1052,7 +1062,14 @@ NDIS_STATUS STASendPacket(
// If multiple fragment required, RTS is required only for the first fragment
// if the fragment size large than RTS threshold
// For RT28xx, Let ASIC send RTS/CTS
- RTMP_SET_PACKET_RTS(pPacket, 0);
+// RTMP_SET_PACKET_RTS(pPacket, 0);
+ if (NumberOfFrag > 1)
+ RTSRequired = (pAd->CommonCfg.FragmentThreshold > pAd->CommonCfg.RtsThreshold) ? 1 : 0;
+ else
+ RTSRequired = (PacketInfo.TotalPacketLength > pAd->CommonCfg.RtsThreshold) ? 1 : 0;
+
+ // Save RTS requirement to Ndis packet reserved field
+ RTMP_SET_PACKET_RTS(pPacket, RTSRequired);
RTMP_SET_PACKET_TXRATE(pPacket, pAd->CommonCfg.TxRate);
//
@@ -1060,13 +1077,8 @@ NDIS_STATUS STASendPacket(
//
UserPriority = 0;
QueIdx = QID_AC_BE;
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
-#endif
-#ifdef RT2870
if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE))
-#endif
{
USHORT Protocol;
UCHAR LlcSnapLen = 0, Byte0, Byte1;
@@ -1102,6 +1114,11 @@ NDIS_STATUS STASendPacket(
// TODO: have to check ACM bit. apply TSPEC if ACM is ON
// TODO: downgrade UP & QueIdx before passing ACM
+ /*
+ Under WMM ACM control, we dont need to check the bit;
+ Or when a TSPEC is built for VO but we will change to issue
+ BA session for BE here, so we will not use BA to send VO packets.
+ */
if (pAd->CommonCfg.APEdcaParm.bACM[QueIdx])
{
UserPriority = 0;
@@ -1125,18 +1142,14 @@ NDIS_STATUS STASendPacket(
}
else
{
- InsertTailQueue(&pAd->TxSwQueue[QueIdx], PACKET_TO_QUEUE_ENTRY(pPacket));
+ InsertTailQueueAc(pAd, pEntry, &pAd->TxSwQueue[QueIdx], PACKET_TO_QUEUE_ENTRY(pPacket));
}
RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
if ((pAd->CommonCfg.BACapability.field.AutoBA == TRUE)&&
-#ifdef RT2860
- (pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE))
-#endif
-#ifdef RT2870
IS_HT_STA(pEntry))
-#endif
{
+ //PMAC_TABLE_ENTRY pMacEntry = &pAd->MacTab.Content[BSSID_WCID];
if (((pEntry->TXBAbitmap & (1<<UserPriority)) == 0) &&
((pEntry->BADeclineBitmap & (1<<UserPriority)) == 0) &&
(pEntry->PortSecured == WPA_802_1X_PORT_SECURED)
@@ -1145,10 +1158,10 @@ NDIS_STATUS STASendPacket(
// 2. It is OPEN or AES mode,
// then BA session can be bulit.
&& ((pEntry->ValidAsCLI && pAd->MlmeAux.APRalinkIe != 0x0) ||
- (pEntry->WepStatus == Ndis802_11WEPDisabled || pEntry->WepStatus == Ndis802_11Encryption3Enabled))
+ (pEntry->WepStatus != Ndis802_11WEPEnabled && pEntry->WepStatus != Ndis802_11Encryption2Enabled))
)
{
- BAOriSessionSetUp(pAd, pEntry, 0, 0, 10, FALSE);
+ BAOriSessionSetUp(pAd, pEntry, UserPriority, 0, 10, FALSE);
}
}
@@ -1179,27 +1192,15 @@ NDIS_STATUS STASendPacket(
========================================================================
*/
-
-#ifdef RT2870
-/*
- Actually, this function used to check if the TxHardware Queue still has frame need to send.
- If no frame need to send, go to sleep, else, still wake up.
-*/
-#endif
+#ifdef RTMP_MAC_PCI
NDIS_STATUS RTMPFreeTXDRequest(
IN PRTMP_ADAPTER pAd,
IN UCHAR QueIdx,
IN UCHAR NumberRequired,
IN PUCHAR FreeNumberIs)
{
-#ifdef RT2860
ULONG FreeNumber = 0;
-#endif
NDIS_STATUS Status = NDIS_STATUS_FAILURE;
-#ifdef RT2870
- unsigned long IrqFlags;
- HT_TX_CONTEXT *pHTTXContext;
-#endif
switch (QueIdx)
{
@@ -1207,8 +1208,6 @@ NDIS_STATUS RTMPFreeTXDRequest(
case QID_AC_BE:
case QID_AC_VI:
case QID_AC_VO:
- case QID_HCCA:
-#ifdef RT2860
if (pAd->TxRing[QueIdx].TxSwFreeIdx > pAd->TxRing[QueIdx].TxCpuIdx)
FreeNumber = pAd->TxRing[QueIdx].TxSwFreeIdx - pAd->TxRing[QueIdx].TxCpuIdx - 1;
else
@@ -1216,8 +1215,49 @@ NDIS_STATUS RTMPFreeTXDRequest(
if (FreeNumber >= NumberRequired)
Status = NDIS_STATUS_SUCCESS;
-#endif
-#ifdef RT2870
+ break;
+
+ case QID_MGMT:
+ if (pAd->MgmtRing.TxSwFreeIdx > pAd->MgmtRing.TxCpuIdx)
+ FreeNumber = pAd->MgmtRing.TxSwFreeIdx - pAd->MgmtRing.TxCpuIdx - 1;
+ else
+ FreeNumber = pAd->MgmtRing.TxSwFreeIdx + MGMT_RING_SIZE - pAd->MgmtRing.TxCpuIdx - 1;
+
+ if (FreeNumber >= NumberRequired)
+ Status = NDIS_STATUS_SUCCESS;
+ break;
+
+ default:
+ DBGPRINT(RT_DEBUG_ERROR,("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
+ break;
+ }
+ *FreeNumberIs = (UCHAR)FreeNumber;
+
+ return (Status);
+}
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+/*
+ Actually, this function used to check if the TxHardware Queue still has frame need to send.
+ If no frame need to send, go to sleep, else, still wake up.
+*/
+NDIS_STATUS RTMPFreeTXDRequest(
+ IN PRTMP_ADAPTER pAd,
+ IN UCHAR QueIdx,
+ IN UCHAR NumberRequired,
+ IN PUCHAR FreeNumberIs)
+{
+ //ULONG FreeNumber = 0;
+ NDIS_STATUS Status = NDIS_STATUS_FAILURE;
+ unsigned long IrqFlags;
+ HT_TX_CONTEXT *pHTTXContext;
+
+ switch (QueIdx)
+ {
+ case QID_AC_BK:
+ case QID_AC_BE:
+ case QID_AC_VI:
+ case QID_AC_VO:
{
pHTTXContext = &pAd->TxContext[QueIdx];
RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[QueIdx], IrqFlags);
@@ -1232,39 +1272,21 @@ NDIS_STATUS RTMPFreeTXDRequest(
}
RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[QueIdx], IrqFlags);
}
-#endif
break;
-
case QID_MGMT:
-#ifdef RT2860
- if (pAd->MgmtRing.TxSwFreeIdx > pAd->MgmtRing.TxCpuIdx)
- FreeNumber = pAd->MgmtRing.TxSwFreeIdx - pAd->MgmtRing.TxCpuIdx - 1;
- else
- FreeNumber = pAd->MgmtRing.TxSwFreeIdx + MGMT_RING_SIZE - pAd->MgmtRing.TxCpuIdx - 1;
-
- if (FreeNumber >= NumberRequired)
- Status = NDIS_STATUS_SUCCESS;
-#endif
-#ifdef RT2870
if (pAd->MgmtRing.TxSwFreeIdx != MGMT_RING_SIZE)
Status = NDIS_STATUS_FAILURE;
else
Status = NDIS_STATUS_SUCCESS;
-#endif
break;
-
default:
DBGPRINT(RT_DEBUG_ERROR,("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
break;
}
-#ifdef RT2860
- *FreeNumberIs = (UCHAR)FreeNumber;
-#endif
return (Status);
}
-
-
+#endif // RTMP_MAC_USB //
VOID RTMPSendDisassociationFrame(
IN PRTMP_ADAPTER pAd)
@@ -1527,6 +1549,9 @@ VOID STABuildCache802_11Header(
pMacEntry->TxSeq[pTxBlk->UserPriority] = (pMacEntry->TxSeq[pTxBlk->UserPriority]+1) & MAXSEQ;
{
+ // Check if the frame can be sent through DLS direct link interface
+ // If packet can be sent through DLS, then force aggregation disable. (Hard to determine peer STA's capability)
+
// The addr3 of normal packet send from DS is Dest Mac address.
if (ADHOC_ON(pAd))
COPY_MAC_ADDR(pHeader80211->Addr3, pAd->CommonCfg.Bssid);
@@ -1580,13 +1605,13 @@ static inline PUCHAR STA_Build_ARalink_Frame_Header(
// padding at front of LLC header. LLC header should at 4-bytes aligment.
pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PCHAR)ROUND_UP(pHeaderBufPtr, 4);
+ pHeaderBufPtr = (PUCHAR)ROUND_UP(pHeaderBufPtr, 4);
pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
// For RA Aggregation,
// put the 2nd MSDU length(extra 2-byte field) after QOS_CONTROL in little endian format
pQEntry = pTxBlk->TxPacketList.Head;
- pNextPacket = QUEUE_ENTRY_TO_PKT(pQEntry);
+ pNextPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
nextBufLen = GET_OS_PKT_LEN(pNextPacket);
if (RTMP_GET_PACKET_VLAN(pNextPacket))
nextBufLen -= LENGTH_802_1Q;
@@ -1641,7 +1666,7 @@ static inline PUCHAR STA_Build_AMSDU_Frame_Header(
// @@@ MpduHeaderLen excluding padding @@@
//
pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PCHAR) ROUND_UP(pHeaderBufPtr, 4);
+ pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
return pHeaderBufPtr;
@@ -1743,7 +1768,7 @@ VOID STA_AMPDU_Frame_Tx(
// @@@ MpduHeaderLen excluding padding @@@
//
pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PCHAR) ROUND_UP(pHeaderBufPtr, 4);
+ pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
{
@@ -1790,9 +1815,7 @@ VOID STA_AMPDU_Frame_Tx(
//
// Kick out Tx
//
-#ifdef RT2860
if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
-#endif
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
pAd->RalinkCounters.KickTxCount++;
@@ -1923,9 +1946,7 @@ VOID STA_AMSDU_Frame_Tx(
//
// Kick out Tx
//
-#ifdef RT2860
if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
-#endif
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
}
@@ -1991,7 +2012,7 @@ VOID STA_Legacy_Frame_Tx(
//
// build QOS Control bytes
//
- *pHeaderBufPtr = (pTxBlk->UserPriority & 0x0F);
+ *(pHeaderBufPtr) = ((pTxBlk->UserPriority & 0x0F) | (pAd->CommonCfg.AckPolicy[pTxBlk->QueIdx]<<5));
*(pHeaderBufPtr+1) = 0;
pHeaderBufPtr +=2;
pTxBlk->MpduHeaderLen += 2;
@@ -1999,7 +2020,7 @@ VOID STA_Legacy_Frame_Tx(
// The remaining content of MPDU header should locate at 4-octets aligment
pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PCHAR) ROUND_UP(pHeaderBufPtr, 4);
+ pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
{
@@ -2045,9 +2066,7 @@ VOID STA_Legacy_Frame_Tx(
//
// Kick out Tx
//
-#ifdef RT2860
if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
-#endif
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
}
@@ -2158,9 +2177,7 @@ VOID STA_ARalink_Frame_Tx(
//
// Kick out Tx
//
-#ifdef RT2860
if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
-#endif
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
}
@@ -2181,6 +2198,7 @@ VOID STA_Fragment_Frame_Tx(
UINT NextMpduSize;
BOOLEAN bVLANPkt;
PQUEUE_ENTRY pQEntry;
+ HTTRANSMIT_SETTING *pTransmit;
ASSERT(pTxBlk);
@@ -2243,7 +2261,7 @@ VOID STA_Fragment_Frame_Tx(
// LLC header should locate at 4-octets aligment
//
pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PCHAR) ROUND_UP(pHeaderBufPtr, 4);
+ pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
@@ -2276,6 +2294,7 @@ VOID STA_Fragment_Frame_Tx(
// MAC ASIC will only perform IV/EIV/ICV insertion but no TKIP MIC
if (pTxBlk->CipherAlg == CIPHER_TKIP)
{
+ RTMPCalculateMICValue(pAd, pTxBlk->pPacket, pTxBlk->pExtraLlcSnapEncap, pTxBlk->pKey, 0);
// NOTE: DON'T refer the skb->len directly after following copy. Becasue the length is not adjust
// to correct lenght, refer to pTxBlk->SrcBufLen for the packet length in following progress.
@@ -2301,8 +2320,20 @@ VOID STA_Fragment_Frame_Tx(
else
EncryptionOverhead = 0;
+ pTransmit = pTxBlk->pTransmit;
+ // Decide the TX rate
+ if (pTransmit->field.MODE == MODE_CCK)
+ pTxBlk->TxRate = pTransmit->field.MCS;
+ else if (pTransmit->field.MODE == MODE_OFDM)
+ pTxBlk->TxRate = pTransmit->field.MCS + RATE_FIRST_OFDM_RATE;
+ else
+ pTxBlk->TxRate = RATE_6_5;
+
// decide how much time an ACK/CTS frame will consume in the air
+ if (pTxBlk->TxRate <= RATE_LAST_OFDM_RATE)
AckDuration = RTMPCalcDuration(pAd, pAd->CommonCfg.ExpectedACKRate[pTxBlk->TxRate], 14);
+ else
+ AckDuration = RTMPCalcDuration(pAd, RATE_6_5, 14);
// Init the total payload length of this frame.
SrcRemainingBytes = pTxBlk->SrcBufLen;
@@ -2365,6 +2396,7 @@ VOID STA_Fragment_Frame_Tx(
//
// Kick out Tx
//
+ if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
}
@@ -2428,13 +2460,13 @@ NDIS_STATUS STAHardTransmit(
// not to change PSM bit, just send this frame out?
if ((pAd->StaCfg.Psm == PWR_SAVE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
{
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicForceWakeup At HardTx\n"));
-#ifdef RT2860
- AsicForceWakeup(pAd, FROM_TX);
-#endif
-#ifdef RT2870
+ DBGPRINT_RAW(RT_DEBUG_INFO, ("AsicForceWakeup At HardTx\n"));
+#ifdef RTMP_MAC_PCI
AsicForceWakeup(pAd, TRUE);
-#endif
+#endif // RTMP_MAC_PCI //
+#ifdef RTMP_MAC_USB
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_FORCE_WAKE_UP, NULL, 0);
+#endif // RTMP_MAC_USB //
}
// It should not change PSM bit, when APSD turn on.
@@ -2444,7 +2476,7 @@ NDIS_STATUS STAHardTransmit(
{
if ((pAd->StaCfg.Psm == PWR_SAVE) &&
(pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeFast_PSP))
- MlmeSetPsmBit(pAd, PWR_ACTIVE);
+ RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE);
}
switch (pTxBlk->TxFrameType)
diff --git a/drivers/staging/rt2860/sta/sanity.c b/drivers/staging/rt2860/sta/sanity.c
index 7d530f601602..292baa86196b 100644
--- a/drivers/staging/rt2860/sta/sanity.c
+++ b/drivers/staging/rt2860/sta/sanity.c
@@ -117,7 +117,7 @@ BOOLEAN PeerAssocRspSanity(
*pHtCapabilityLen = 0;
*pAddHtInfoLen = 0;
COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- Ptr = pFrame->Octet;
+ Ptr = (PCHAR)pFrame->Octet;
Length += LENGTH_802_11;
NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2);
@@ -213,28 +213,7 @@ BOOLEAN PeerAssocRspSanity(
DBGPRINT(RT_DEBUG_WARN, ("PeerAssocRspSanity - wrong IE_SECONDARY_CH_OFFSET. \n"));
}
break;
- case IE_AIRONET_CKIP:
- // 0. Check Aironet IE length, it must be larger or equal to 28
- // Cisco's AP VxWork version(will not be supported) used this IE length as 28
- // Cisco's AP IOS version used this IE length as 30
- if (pEid->Len < (CKIP_NEGOTIATION_LENGTH - 2))
- break;
-
- // 1. Copy CKIP flag byte to buffer for process
- *pCkipFlag = *(pEid->Octet + 8);
- break;
- case IE_AIRONET_IPADDRESS:
- if (pEid->Len != 0x0A)
- break;
-
- // Get Cisco Aironet IP information
- if (NdisEqualMemory(pEid->Octet, CISCO_OUI, 3) == 1)
- NdisMoveMemory(pAd->StaCfg.AironetIPAddress, pEid->Octet + 4, 4);
- break;
-
- // CCX2, WMM use the same IE value
- // case IE_CCX_V2:
case IE_VENDOR_SPECIFIC:
// handle WME PARAMTER ELEMENT
if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6) && (pEid->Len == 24))
@@ -250,7 +229,7 @@ BOOLEAN PeerAssocRspSanity(
//pEdcaParm->bMoreDataAck = FALSE; // pEid->Octet[0] & 0x80;
pEdcaParm->EdcaUpdateCount = pEid->Octet[6] & 0x0f;
pEdcaParm->bAPSDCapable = (pEid->Octet[6] & 0x80) ? 1 : 0;
- ptr = &pEid->Octet[8];
+ ptr = (PUCHAR)&pEid->Octet[8];
for (i=0; i<4; i++)
{
UCHAR aci = (*ptr & 0x60) >> 5; // b5~6 is AC INDEX
@@ -262,23 +241,7 @@ BOOLEAN PeerAssocRspSanity(
ptr += 4; // point to next AC
}
}
-
- // handle CCX IE
- else
- {
- // 0. Check the size and CCX admin control
- if (pAd->StaCfg.CCXControl.field.Enable == 0)
- break;
- if (pEid->Len != 5)
- break;
-
- // Turn CCX2 if matched
- if (NdisEqualMemory(pEid->Octet, Ccx2IeInfo, 5) == 1)
- pAd->StaCfg.CCXEnable = TRUE;
- break;
- }
break;
-
default:
DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspSanity - ignore unrecognized EID = %d\n", pEid->Eid));
break;
@@ -288,9 +251,6 @@ BOOLEAN PeerAssocRspSanity(
pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
}
- // Force CCX2 enable to TRUE for those AP didn't replay CCX v2 IE, we still force it to be on
- if (pAd->StaCfg.CCXControl.field.Enable == 1)
- pAd->StaCfg.CCXEnable = TRUE;
return TRUE;
}
diff --git a/drivers/staging/rt2860/sta/sync.c b/drivers/staging/rt2860/sta/sync.c
index a6e4362fc5cc..dc71c1dabc7b 100644
--- a/drivers/staging/rt2860/sta/sync.c
+++ b/drivers/staging/rt2860/sta/sync.c
@@ -37,45 +37,8 @@
*/
#include "../rt_config.h"
-#ifdef RT2860
-#define AC0_DEF_TXOP 0
-#define AC1_DEF_TXOP 0
-#define AC2_DEF_TXOP 94
-#define AC3_DEF_TXOP 47
-
-VOID AdhocTurnOnQos(
- IN PRTMP_ADAPTER pAd)
-{
- // Turn on QOs if use HT rate.
- if (pAd->CommonCfg.APEdcaParm.bValid == FALSE)
- {
- pAd->CommonCfg.APEdcaParm.bValid = TRUE;
- pAd->CommonCfg.APEdcaParm.Aifsn[0] = 3;
- pAd->CommonCfg.APEdcaParm.Aifsn[1] = 7;
- pAd->CommonCfg.APEdcaParm.Aifsn[2] = 1;
- pAd->CommonCfg.APEdcaParm.Aifsn[3] = 1;
-
- pAd->CommonCfg.APEdcaParm.Cwmin[0] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[1] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[2] = 3;
- pAd->CommonCfg.APEdcaParm.Cwmin[3] = 2;
-
- pAd->CommonCfg.APEdcaParm.Cwmax[0] = 10;
- pAd->CommonCfg.APEdcaParm.Cwmax[1] = 6;
- pAd->CommonCfg.APEdcaParm.Cwmax[2] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmax[3] = 3;
-
- pAd->CommonCfg.APEdcaParm.Txop[0] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[1] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[2] = AC2_DEF_TXOP;
- pAd->CommonCfg.APEdcaParm.Txop[3] = AC3_DEF_TXOP;
- }
- AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
-}
-#endif /* RT2860 */
-#ifdef RT2870
+
#define ADHOC_ENTRY_BEACON_LOST_TIME (2*OS_HZ) // 2 sec
-#endif
/*
==========================================================================
@@ -160,7 +123,7 @@ VOID BeaconTimeout(
}
MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_BEACON_TIMEOUT, 0, NULL);
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
}
/*
@@ -188,8 +151,8 @@ VOID ScanTimeout(
if (MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_SCAN_TIMEOUT, 0, NULL))
{
- RT28XX_MLME_HANDLER(pAd);
- }
+ RTMP_MLME_HANDLER(pAd);
+}
else
{
// To prevent SyncMachine.CurrState is SCAN_LISTEN forever.
@@ -231,38 +194,40 @@ VOID MlmeScanReqAction(
// Increase the scan retry counters.
pAd->StaCfg.ScanCnt++;
-#ifdef RT2860
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) &&
+#ifdef RTMP_MAC_PCI
+ if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) &&
(IDLE_ON(pAd)) &&
(pAd->StaCfg.bRadio == TRUE) &&
(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
{
+ if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
+ {
+ AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02);
+ AsicCheckCommanOk(pAd, PowerWakeCID);
+ RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
+ DBGPRINT(RT_DEBUG_TRACE, ("PSM - Issue Wake up command \n"));
+ }
+ else
+ {
RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
}
-#endif
+ }
+#endif // RTMP_MAC_PCI //
// first check the parameter sanity
if (MlmeScanReqSanity(pAd,
Elem->Msg,
Elem->MsgLen,
&BssType,
- Ssid,
+ (PCHAR)Ssid,
&SsidLen,
&ScanType))
{
// Check for channel load and noise hist request
// Suspend MSDU only at scan request, not the last two mentioned
- if ((ScanType == SCAN_CISCO_NOISE) || (ScanType == SCAN_CISCO_CHANNEL_LOAD))
- {
- if (pAd->StaCfg.CCXScanChannel != pAd->CommonCfg.Channel)
- RTMPSuspendMsduTransmission(pAd); // Suspend MSDU transmission here
- }
- else
- {
// Suspend MSDU transmission here
RTMPSuspendMsduTransmission(pAd);
- }
//
// To prevent data lost.
@@ -304,11 +269,6 @@ VOID MlmeScanReqAction(
// start from the first channel
pAd->MlmeAux.Channel = FirstChannel(pAd);
- // Change the scan channel when dealing with CCX beacon report
- if ((ScanType == SCAN_CISCO_PASSIVE) || (ScanType == SCAN_CISCO_ACTIVE) ||
- (ScanType == SCAN_CISCO_CHANNEL_LOAD) || (ScanType == SCAN_CISCO_NOISE))
- pAd->MlmeAux.Channel = pAd->StaCfg.CCXScanChannel;
-
// Let BBP register at 20MHz to do scan
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
BBPValue &= (~0x18);
@@ -352,15 +312,15 @@ VOID MlmeJoinReqAction(
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeJoinReqAction(BSS #%ld)\n", pInfo->BssIdx));
-#ifdef RT2860
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE)) &&
+#ifdef RTMP_MAC_PCI
+ if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) &&
(IDLE_ON(pAd)) &&
(pAd->StaCfg.bRadio == TRUE) &&
(RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
{
RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
}
-#endif
+#endif // RTMP_MAC_PCI //
// reset all the timers
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
@@ -374,6 +334,7 @@ VOID MlmeJoinReqAction(
// If AP's SSID is not hidden, it is OK for updating ssid to MlmeAux again.
if (pBss->Hidden == 0)
{
+ RTMPZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
NdisMoveMemory(pAd->MlmeAux.Ssid, pBss->Ssid, pBss->SsidLen);
pAd->MlmeAux.SsidLen = pBss->SsidLen;
}
@@ -382,10 +343,12 @@ VOID MlmeJoinReqAction(
pAd->MlmeAux.Channel = pBss->Channel;
pAd->MlmeAux.CentralChannel = pBss->CentralChannel;
+
// Let BBP register at 20MHz to do scan
RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
BBPValue &= (~0x18);
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
+
DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n"));
// switch channel and waiting for beacon timer
@@ -494,7 +457,7 @@ VOID MlmeStartReqAction(
TimeStamp.u.LowPart = 0;
TimeStamp.u.HighPart = 0;
- if (MlmeStartReqSanity(pAd, Elem->Msg, Elem->MsgLen, Ssid, &SsidLen))
+ if (MlmeStartReqSanity(pAd, Elem->Msg, Elem->MsgLen, (PCHAR)Ssid, &SsidLen))
{
// reset all the timers
RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
@@ -541,6 +504,7 @@ VOID MlmeStartReqAction(
{
pAd->MlmeAux.HtCapabilityLen = 0;
pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
+ NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16);
}
// temporarily not support QOS in IBSS
NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM));
@@ -601,6 +565,8 @@ VOID PeerBeaconAtScanAction(
UCHAR AddHtInfoLen;
UCHAR NewExtChannelOffset = 0xff;
+
+ // NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00);
pFrame = (PFRAME_802_11) Elem->Msg;
// Init Variable IE structure
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
@@ -615,7 +581,7 @@ VOID PeerBeaconAtScanAction(
Elem->Channel,
Addr2,
Bssid,
- Ssid,
+ (PCHAR)Ssid,
&SsidLen,
&BssType,
&BeaconPeriod,
@@ -661,24 +627,7 @@ VOID PeerBeaconAtScanAction(
if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0))
HtCapabilityLen = SIZE_HT_CAP_IE;
- if ((pAd->StaCfg.CCXReqType != MSRN_TYPE_UNUSED) && (Channel == pAd->StaCfg.CCXScanChannel))
- {
- Idx = BssTableSetEntry(pAd, &pAd->StaCfg.CCXBssTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod,
- &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen,ExtRate, ExtRateLen, &HtCapability,
- &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
- &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
- if (Idx != BSS_NOT_FOUND)
- {
- NdisMoveMemory(pAd->StaCfg.CCXBssTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4);
- NdisMoveMemory(&pAd->StaCfg.CCXBssTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
- NdisMoveMemory(&pAd->StaCfg.CCXBssTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
- if (pAd->StaCfg.CCXReqType == MSRN_TYPE_BEACON_REQ)
- AironetAddBeaconReport(pAd, Idx, Elem);
- }
- }
- else
- {
- Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod,
+ Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (PCHAR)Ssid, SsidLen, BssType, BeaconPeriod,
&CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
&AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
&EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
@@ -689,7 +638,7 @@ VOID PeerBeaconAtScanAction(
NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
}
- }
+
}
// sanity check fail, ignored
}
@@ -731,6 +680,7 @@ VOID PeerBeaconAtJoinAction(
UCHAR AddHtInfoLen;
UCHAR NewExtChannelOffset = 0xff;
UCHAR CentralChannel;
+ BOOLEAN bAllowNrate = FALSE;
// Init Variable IE structure
pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
@@ -745,7 +695,7 @@ VOID PeerBeaconAtJoinAction(
Elem->Channel,
Addr2,
Bssid,
- Ssid,
+ (PCHAR)Ssid,
&SsidLen,
&BssType,
&BeaconPeriod,
@@ -818,8 +768,24 @@ VOID PeerBeaconAtJoinAction(
{
Idx = BssSsidTableSearch(&pAd->ScanTab, Bssid, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, Channel);
+ if (Idx == BSS_NOT_FOUND)
+ {
+ CHAR Rssi = 0;
+ Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
+ Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (CHAR *) Ssid, SsidLen, BssType, BeaconPeriod,
+ &Cf, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
+ &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
+ &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
if (Idx != BSS_NOT_FOUND)
{
+ NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4);
+ NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
+ NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
+ CapabilityInfo = pAd->ScanTab.BssEntry[Idx].CapabilityInfo;
+ }
+ }
+ else
+ {
//
// Multiple SSID case, used correct CapabilityInfo
//
@@ -847,13 +813,21 @@ VOID PeerBeaconAtJoinAction(
NdisZeroMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, 16);
+
+ if (((pAd->StaCfg.WepStatus != Ndis802_11WEPEnabled) && (pAd->StaCfg.WepStatus != Ndis802_11Encryption2Enabled))
+ || (pAd->CommonCfg.HT_DisallowTKIP == FALSE))
+ {
+ bAllowNrate = TRUE;
+ }
+
pAd->MlmeAux.NewExtChannelOffset = NewExtChannelOffset;
pAd->MlmeAux.HtCapabilityLen = HtCapabilityLen;
+ RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
// filter out un-supported ht rates
- if (((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
+ if (((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) &&
+ ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && (bAllowNrate)))
{
- RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
RTMPMoveMemory(&pAd->MlmeAux.AddHtInfo, &AddHtInfo, SIZE_ADD_HT_INFO_IE);
// StaActive.SupportedHtPhy.MCSSet stores Peer AP's 11n Rx capability
@@ -897,7 +871,9 @@ VOID PeerBeaconAtJoinAction(
pAd->MlmeAux.CentralChannel = pAd->MlmeAux.Channel;
pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
+ pAd->MlmeAux.NewExtChannelOffset = 0xff;
RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
+ pAd->MlmeAux.HtCapabilityLen = 0;
RTMPZeroMemory(&pAd->MlmeAux.AddHtInfo, SIZE_ADD_HT_INFO_IE);
}
@@ -1116,8 +1092,6 @@ VOID PeerBeacon(
// Add the safeguard against the mismatch of adhoc wep status
if (pAd->StaCfg.WepStatus != pAd->ScanTab.BssEntry[Bssidx].WepStatus)
{
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - Not matched wep status %d %d\n", pAd->StaCfg.WepStatus, pAd->ScanTab.BssEntry[Bssidx].WepStatus));
- DBGPRINT(RT_DEBUG_TRACE, ("bssid=%s\n", pAd->ScanTab.BssEntry[Bssidx].Bssid));
return;
}
@@ -1181,200 +1155,8 @@ VOID PeerBeacon(
pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
}
-#ifdef RT2860
- // at least one 11b peer joined. downgrade the MaxTxRate to 11Mbps
- // after last 11b peer left for several seconds, we'll auto switch back to 11G rate
- // in MlmePeriodicExec()
-#endif
if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo)))
{
-#ifdef RT2860
- BOOLEAN bRestart;
- BOOLEAN bnRestart;
-
- bRestart = FALSE;
- bnRestart = FALSE;
-
- do
- {
- if ((SupRateLen+ExtRateLen <= 4) && (pAd->CommonCfg.MaxTxRate > RATE_11))
- {
- if (pAd->StaCfg.AdhocBOnlyJoined == FALSE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - 11b peer joined. down-grade to 11b TX rates \n"));
- bRestart = TRUE;
- NdisMoveMemory(pAd->StaActive.SupRate, SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- pAd->StaActive.SupRateLen = SupRateLen;
- NdisMoveMemory(pAd->StaActive.ExtRate, ExtRate, MAX_LEN_OF_SUPPORTED_RATES);
- pAd->StaActive.ExtRateLen = ExtRateLen;
- pAd->StaCfg.AdhocBOnlyJoined = TRUE;
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- AsicSetEdcaParm(pAd, NULL);
- }
-
- // this timestamp is for MlmePeriodicExec() to check if all 11B peers have left
- pAd->StaCfg.Last11bBeaconRxTime = Now;
- break;
- }
-
- // Update Ht Phy.
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) &&
- !pAd->StaCfg.AdhocBGJoined &&
- !pAd->StaCfg.AdhocBOnlyJoined)
- AdhocTurnOnQos(pAd);
-
- // Handle rate switch issue when Adhoc mode
- if ((SupRateLen+ExtRateLen >= 8) && (HtCapability.MCSSet[0] == 0) && (HtCapability.MCSSet[1] == 0))
- {
- if (pAd->StaCfg.AdhocBGJoined == FALSE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - 11g peer joined. down-grade to 11g TX rates \n"));
- bRestart = TRUE;
- NdisMoveMemory(pAd->StaActive.SupRate, SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- pAd->StaActive.SupRateLen = SupRateLen;
- NdisMoveMemory(pAd->StaActive.ExtRate, ExtRate, MAX_LEN_OF_SUPPORTED_RATES);
- pAd->StaActive.ExtRateLen = ExtRateLen;
- pAd->StaCfg.AdhocBGJoined = TRUE;
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- AsicSetEdcaParm(pAd, NULL);
- }
-
- // this timestamp is for MlmePeriodicExec() to check if all 11g peers have left
- pAd->StaCfg.Last11gBeaconRxTime = Now;
- break;
- }
- else if (!pAd->StaCfg.AdhocBGJoined &&
- !pAd->StaCfg.AdhocBOnlyJoined &&
- (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40) &&
- (HtCapability.HtCapInfo.ChannelWidth == BW_20))
- {
- if (pAd->StaCfg.Adhoc20NJoined == FALSE)
- {
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
-
- pAd->StaCfg.Adhoc20NJoined = TRUE;
- NdisMoveMemory(&pAd->MlmeAux.HtCapability, &HtCapability, SIZE_HT_CAP_IE);
- if (AddHtInfoLen != 0)
- NdisMoveMemory(&pAd->MlmeAux.AddHtInfo, &AddHtInfo, AddHtInfoLen);
- NdisMoveMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, HtCapability.MCSSet, 16);
-
- RTMPCheckHt(pAd, Elem->Wcid, &pAd->MlmeAux.HtCapability, &pAd->MlmeAux.AddHtInfo);
- COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
- pAd->StaActive.SupportedPhyInfo.bHtEnable = TRUE;
- bRestart = TRUE;
- bnRestart = TRUE;
- }
- // this timestamp is for MlmePeriodicExec() to check if all 20MHz N peers have left
- pAd->StaCfg.Last20NBeaconRxTime = Now;
- }
-
- }
- else
- {
- RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
- RTMPZeroMemory(&pAd->MlmeAux.AddHtInfo, SIZE_ADD_HT_INFO_IE);
- }
- }while (FALSE);
-
- // If peer Adhoc is legacy mode, I don't need to call MlmeUpdateHtTxRates no matter I support HT or not
- if ((bRestart == TRUE) && (bnRestart == FALSE))
- {
- MlmeUpdateTxRates(pAd, FALSE, 0);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy to on-chip memory
- }
- else if ((bRestart == TRUE) && (bnRestart == TRUE))
- {
- MlmeUpdateTxRates(pAd, FALSE, BSS0);
- MlmeUpdateHtTxRates(pAd, BSS0);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy to on-chip memory
- }
-
- // At least another peer in this IBSS, declare MediaState as CONNECTED
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
-
- pAd->IndicateMediaState = NdisMediaStateConnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_UP;
- AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
-
- // 2003/03/12 - john
- // Make sure this entry in "ScanTab" table, thus complies to Microsoft's policy that
- // "site survey" result should always include the current connected network.
- //
- Bssidx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
- if (Bssidx == BSS_NOT_FOUND)
- {
- Bssidx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod,
- &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
- &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, RealRssi, TimeStamp, 0,
- &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("ADHOC fOP_STATUS_MEDIA_STATE_CONNECTED.\n"));
- }
-
- // Ad-hoc mode is using MAC address as BA session. So we need to continuously find newly joined adhoc station by receiving beacon.
- // To prevent always check this, we use wcid == RESERVED_WCID to recognize it as newly joined adhoc station.
- if (ADHOC_ON(pAd) && (Elem->Wcid == RESERVED_WCID))
- {
- UCHAR idx;
- MAC_TABLE_ENTRY *pEntry;
-
- // look up the existing table
- pEntry = MacTableLookup(pAd, Addr2);
- if (pEntry == NULL)
- {
- // Another adhoc joining, add to our MAC table.
- pEntry = MacTableInsertEntry(pAd, Addr2, BSS0, FALSE);
- if (pEntry)
- {
- pEntry->Sst = SST_ASSOC;
- idx = pAd->StaCfg.DefaultKeyId;
- // After InsertEntry, Write to ASIC on-chip table.
- RT28XX_STA_SECURITY_INFO_ADD(pAd, BSS0, idx, pEntry);
- DBGPRINT(RT_DEBUG_TRACE, ("ADHOC %x:%x:%x:%x:%x:%x join in.Entry=%d\n", Addr2[0],Addr2[1],Addr2[2],Addr2[3],Addr2[4],Addr2[5], pEntry->Aid));
-
- pEntry->HTPhyMode.word = pAd->StaCfg.HTPhyMode.word;
- if (HtCapabilityLen <= 0)
- {
- pEntry->HTPhyMode.field.STBC = 0;
- pEntry->HTPhyMode.field.BW = 0;
- pEntry->HTPhyMode.field.ShortGI = 0;
- if ((SupRateLen+ExtRateLen <= 4) && (pAd->CommonCfg.Channel <= 14))
- {
- pEntry->HTPhyMode.field.MODE = MODE_CCK;
- }
- else
- {
- pEntry->HTPhyMode.field.MODE = MODE_OFDM;
- }
- MlmeUpdateTxRates(pAd, FALSE, 0);
- }
- else
- {
- MlmeUpdateTxRates(pAd, FALSE, 0);
- MlmeUpdateHtTxRates(pAd, BSS0);
- }
-
- {
- union iwreq_data wrqu;
- wext_notify_event_assoc(pAd);
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
-
- }
- }
- }
- }
-#endif /* RT2860 */
-#ifdef RT2870
UCHAR MaxSupportedRateIn500Kbps = 0;
UCHAR idx;
MAC_TABLE_ENTRY *pEntry;
@@ -1404,7 +1186,14 @@ VOID PeerBeacon(
// Another adhoc joining, add to our MAC table.
pEntry = MacTableInsertEntry(pAd, Addr2, BSS0, FALSE);
- if (StaAddMacTableEntry(pAd, pEntry, MaxSupportedRateIn500Kbps, &HtCapability, HtCapabilityLen, CapabilityInfo) == FALSE)
+ if (StaAddMacTableEntry(pAd,
+ pEntry,
+ MaxSupportedRateIn500Kbps,
+ &HtCapability,
+ HtCapabilityLen,
+ &AddHtInfo,
+ AddHtInfoLen,
+ CapabilityInfo) == FALSE)
{
DBGPRINT(RT_DEBUG_TRACE, ("ADHOC - Add Entry failed.\n"));
return;
@@ -1414,7 +1203,7 @@ VOID PeerBeacon(
(Elem->Wcid == RESERVED_WCID))
{
idx = pAd->StaCfg.DefaultKeyId;
- RT28XX_STA_SECURITY_INFO_ADD(pAd, BSS0, idx, pEntry);
+ RTMP_STA_SECURITY_INFO_ADD(pAd, BSS0, idx, pEntry);
}
}
@@ -1445,7 +1234,6 @@ VOID PeerBeacon(
}
DBGPRINT(RT_DEBUG_TRACE, ("ADHOC fOP_STATUS_MEDIA_STATE_CONNECTED.\n"));
}
-#endif /* RT2870 */
}
if (INFRA_ON(pAd))
@@ -1534,28 +1322,32 @@ VOID PeerBeacon(
// 5. otherwise, put PHY back to sleep to save battery.
if (MessageToMe)
{
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+#ifdef RTMP_MAC_PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
+ // Restore to correct BBP R3 value
+ if (pAd->Antenna.field.RxPath > 1)
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
+ // Turn clk to 80Mhz.
}
-#endif
+#endif // RTMP_MAC_PCI //
if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable &&
pAd->CommonCfg.bAPSDAC_BE && pAd->CommonCfg.bAPSDAC_BK && pAd->CommonCfg.bAPSDAC_VI && pAd->CommonCfg.bAPSDAC_VO)
{
pAd->CommonCfg.bNeedSendTriggerFrame = TRUE;
}
else
- RT28XX_PS_POLL_ENQUEUE(pAd);
+ RTMP_PS_POLL_ENQUEUE(pAd);
}
else if (BcastFlag && (DtimCount == 0) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM))
{
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+#ifdef RTMP_MAC_PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
+ if (pAd->Antenna.field.RxPath > 1)
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
}
-#endif
+#endif // RTMP_MAC_PCI //
}
else if ((pAd->TxSwQueue[QID_AC_BK].Number != 0) ||
(pAd->TxSwQueue[QID_AC_BE].Number != 0) ||
@@ -1569,12 +1361,42 @@ VOID PeerBeacon(
{
// TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme
// can we cheat here (i.e. just check MGMT & AC_BE) for better performance?
-#ifdef RT2860
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_ADVANCE_POWER_SAVE_PCIE_DEVICE))
+#ifdef RTMP_MAC_PCI
+ if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
{
+ if (pAd->Antenna.field.RxPath > 1)
RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
}
-#endif
+#endif // RTMP_MAC_PCI //
+ }
+ else
+ {
+ if ((pAd->CommonCfg.bACMAPSDTr[QID_AC_VO]) ||
+ (pAd->CommonCfg.bACMAPSDTr[QID_AC_VI]) ||
+ (pAd->CommonCfg.bACMAPSDTr[QID_AC_BK]) ||
+ (pAd->CommonCfg.bACMAPSDTr[QID_AC_BE]))
+ {
+ /*
+ WMM Spec v1.0 3.6.2.4,
+ The WMM STA shall remain awake until it receives a
+ QoS Data or Null frame addressed to it, with the
+ EOSP subfield in QoS Control field set to 1.
+
+ So we can not sleep here or we will suffer a case:
+
+ PS Management Frame -->
+ Trigger frame -->
+ Beacon (TIM=0) (Beacon is closer to Trig frame) -->
+ Station goes to sleep -->
+ AP delivery queued UAPSD packets -->
+ Station can NOT receive the reply
+
+ Maybe we need a timeout timer to avoid that we do
+ NOT receive the EOSP frame.
+
+ We can not use More Data to check if SP is ended
+ due to MaxSPLength.
+ */
}
else
{
@@ -1589,14 +1411,10 @@ VOID PeerBeacon(
if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
{
-#ifdef RT2860
// Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode.
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
pAd->ThisTbttNumToNextWakeUp = TbttNumToNextWakeUp;
-#endif
-#ifdef RT2870
- AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
-#endif
+ AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp);
+ }
}
}
}
@@ -1825,6 +1643,8 @@ VOID InvalidStateWhenStart(
VOID EnqueuePsPoll(
IN PRTMP_ADAPTER pAd)
{
+
+
if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP)
pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE;
MiniportMMRequest(pAd, 0, (PUCHAR)&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
diff --git a/drivers/staging/rt2860/sta/wpa.c b/drivers/staging/rt2860/sta/wpa.c
index 8c34e39f3860..c6c3f3bc418d 100644
--- a/drivers/staging/rt2860/sta/wpa.c
+++ b/drivers/staging/rt2860/sta/wpa.c
@@ -37,1818 +37,12 @@
*/
#include "../rt_config.h"
-#define WPARSNIE 0xdd
-#define WPA2RSNIE 0x30
-
-//extern UCHAR BIT8[];
-UCHAR CipherWpaPskTkip[] = {
- 0xDD, 0x16, // RSN IE
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x02, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x02, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x02 // authentication
- };
-UCHAR CipherWpaPskTkipLen = (sizeof(CipherWpaPskTkip) / sizeof(UCHAR));
-
-UCHAR CipherWpaPskAes[] = {
- 0xDD, 0x16, // RSN IE
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x04, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x04, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x02 // authentication
- };
-UCHAR CipherWpaPskAesLen = (sizeof(CipherWpaPskAes) / sizeof(UCHAR));
-
-UCHAR CipherSuiteCiscoCCKM[] = {
- 0xDD, 0x16, // RSN IE
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x40, 0x96, 0x01, // Multicast
- 0x01, 0x00, // Number of uicast
- 0x00, 0x40, 0x96, 0x01, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x40, 0x96, 0x00 // Authentication
- };
-UCHAR CipherSuiteCiscoCCKMLen = (sizeof(CipherSuiteCiscoCCKM) / sizeof(UCHAR));
-
-UCHAR CipherSuiteCiscoCCKM24[] = {
- 0xDD, 0x18, // RSN IE
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x40, 0x96, 0x01, // Multicast
- 0x01, 0x00, // Number of uicast
- 0x00, 0x40, 0x96, 0x01, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x40, 0x96, 0x00,
- 0x28, 0x00// Authentication
- };
-
-UCHAR CipherSuiteCiscoCCKM24Len = (sizeof(CipherSuiteCiscoCCKM24) / sizeof(UCHAR));
-
-UCHAR CipherSuiteCCXTkip[] = {
- 0xDD, 0x16, // RSN IE
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x02, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x02, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x01 // authentication
- };
-UCHAR CipherSuiteCCXTkipLen = (sizeof(CipherSuiteCCXTkip) / sizeof(UCHAR));
-
-UCHAR CCX_LLC_HDR[] = {0xAA, 0xAA, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02};
-UCHAR LLC_NORMAL[] = {0xAA, 0xAA, 0x03, 0x00, 0x00, 0x00};
-
-UCHAR EAPOL_FRAME[] = {0x88, 0x8E};
-
-BOOLEAN CheckRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN UCHAR DataLen,
- OUT UCHAR *Offset);
-
void inc_byte_array(UCHAR *counter, int len);
/*
========================================================================
Routine Description:
- Classify WPA EAP message type
-
- Arguments:
- EAPType Value of EAP message type
- MsgType Internal Message definition for MLME state machine
-
- Return Value:
- TRUE Found appropriate message type
- FALSE No appropriate message type
-
- IRQL = DISPATCH_LEVEL
-
- Note:
- All these constants are defined in wpa.h
- For supplicant, there is only EAPOL Key message avaliable
-
- ========================================================================
-*/
-BOOLEAN WpaMsgTypeSubst(
- IN UCHAR EAPType,
- OUT INT *MsgType)
-{
- switch (EAPType)
- {
- case EAPPacket:
- *MsgType = MT2_EAPPacket;
- break;
- case EAPOLStart:
- *MsgType = MT2_EAPOLStart;
- break;
- case EAPOLLogoff:
- *MsgType = MT2_EAPOLLogoff;
- break;
- case EAPOLKey:
- *MsgType = MT2_EAPOLKey;
- break;
- case EAPOLASFAlert:
- *MsgType = MT2_EAPOLASFAlert;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- association state machine init, including state transition and timer init
- Parameters:
- S - pointer to the association state machine
- ==========================================================================
- */
-VOID WpaPskStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(S, Trans, MAX_WPA_PSK_STATE, MAX_WPA_PSK_MSG, (STATE_MACHINE_FUNC)Drop, WPA_PSK_IDLE, WPA_MACHINE_BASE);
- StateMachineSetAction(S, WPA_PSK_IDLE, MT2_EAPOLKey, (STATE_MACHINE_FUNC)WpaEAPOLKeyAction);
-}
-
-/*
- ==========================================================================
- Description:
- This is state machine function.
- When receiving EAPOL packets which is for 802.1x key management.
- Use both in WPA, and WPAPSK case.
- In this function, further dispatch to different functions according to the received packet. 3 categories are :
- 1. normal 4-way pairwisekey and 2-way groupkey handshake
- 2. MIC error (Countermeasures attack) report packet from STA.
- 3. Request for pairwise/group key update from STA
- Return:
- ==========================================================================
-*/
-VOID WpaEAPOLKeyAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- INT MsgType = EAPOL_MSG_INVALID;
- PKEY_DESCRIPTER pKeyDesc;
- PHEADER_802_11 pHeader; //red
- UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
- UCHAR EapolVr;
- KEY_INFO peerKeyInfo;
-
- DBGPRINT(RT_DEBUG_TRACE, ("-----> WpaEAPOLKeyAction\n"));
-
- // Get 802.11 header first
- pHeader = (PHEADER_802_11) Elem->Msg;
-
- // Get EAPoL-Key Descriptor
- pKeyDesc = (PKEY_DESCRIPTER) &Elem->Msg[(LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H)];
-
- NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
- NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pKeyDesc->KeyInfo, sizeof(KEY_INFO));
-
- *((USHORT *)&peerKeyInfo) = cpu2le16(*((USHORT *)&peerKeyInfo));
-
-
- // 1. Check EAPOL frame version and type
- EapolVr = (UCHAR) Elem->Msg[LENGTH_802_11+LENGTH_802_1_H];
-
- if (((EapolVr != EAPOL_VER) && (EapolVr != EAPOL_VER2)) || ((pKeyDesc->Type != WPA1_KEY_DESC) && (pKeyDesc->Type != WPA2_KEY_DESC)))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Key descripter does not match with WPA rule\n"));
- return;
- }
-
- // First validate replay counter, only accept message with larger replay counter
- // Let equal pass, some AP start with all zero replay counter
- NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
-
- if((RTMPCompareMemory(pKeyDesc->ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY) != 1) &&
- (RTMPCompareMemory(pKeyDesc->ReplayCounter, ZeroReplay, LEN_KEY_DESC_REPLAY) != 0))
- {
- DBGPRINT(RT_DEBUG_ERROR, (" ReplayCounter not match \n"));
- return;
- }
-
- // Process WPA2PSK frame
- if(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
- {
- if((peerKeyInfo.KeyType == PAIRWISEKEY) &&
- (peerKeyInfo.EKD_DL == 0) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 0) &&
- (peerKeyInfo.Secure == 0) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_PAIR_MSG_1;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Pairwise Message 1\n"));
- } else if((peerKeyInfo.KeyType == PAIRWISEKEY) &&
- (peerKeyInfo.EKD_DL == 1) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 1) &&
- (peerKeyInfo.Secure == 1) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_PAIR_MSG_3;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Pairwise Message 3\n"));
- } else if((peerKeyInfo.KeyType == GROUPKEY) &&
- (peerKeyInfo.EKD_DL == 1) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 1) &&
- (peerKeyInfo.Secure == 1) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_GROUP_MSG_1;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Group Message 1\n"));
- }
-
- // We will assume link is up (assoc suceess and port not secured).
- // All state has to be able to process message from previous state
- switch(pAd->StaCfg.WpaState)
- {
- case SS_START:
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- Wpa2PairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- }
- break;
-
- case SS_WAIT_MSG_3:
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- Wpa2PairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- }
- else if(MsgType == EAPOL_PAIR_MSG_3)
- {
- Wpa2PairMsg3Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_GROUP;
- }
- break;
-
- case SS_WAIT_GROUP: // When doing group key exchange
- case SS_FINISH: // This happened when update group key
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- // Reset port secured variable
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- Wpa2PairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- }
- else if(MsgType == EAPOL_PAIR_MSG_3)
- {
- // Reset port secured variable
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- Wpa2PairMsg3Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_GROUP;
- }
- else if(MsgType == EAPOL_GROUP_MSG_1)
- {
- WpaGroupMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_FINISH;
- }
- break;
-
- default:
- break;
- }
- }
- // Process WPAPSK Frame
- // Classify message Type, either pairwise message 1, 3, or group message 1 for supplicant
- else if(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)
- {
- if((peerKeyInfo.KeyType == PAIRWISEKEY) &&
- (peerKeyInfo.KeyIndex == 0) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 0) &&
- (peerKeyInfo.Secure == 0) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_PAIR_MSG_1;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Pairwise Message 1\n"));
- }
- else if((peerKeyInfo.KeyType == PAIRWISEKEY) &&
- (peerKeyInfo.KeyIndex == 0) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 1) &&
- (peerKeyInfo.Secure == 0) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_PAIR_MSG_3;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Pairwise Message 3\n"));
- }
- else if((peerKeyInfo.KeyType == GROUPKEY) &&
- (peerKeyInfo.KeyIndex != 0) &&
- (peerKeyInfo.KeyAck == 1) &&
- (peerKeyInfo.KeyMic == 1) &&
- (peerKeyInfo.Secure == 1) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.Request == 0))
- {
- MsgType = EAPOL_GROUP_MSG_1;
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL Key Group Message 1\n"));
- }
-
- // We will assume link is up (assoc suceess and port not secured).
- // All state has to be able to process message from previous state
- switch(pAd->StaCfg.WpaState)
- {
- case SS_START:
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- WpaPairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- }
- break;
-
- case SS_WAIT_MSG_3:
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- WpaPairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- }
- else if(MsgType == EAPOL_PAIR_MSG_3)
- {
- WpaPairMsg3Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_GROUP;
- }
- break;
-
- case SS_WAIT_GROUP: // When doing group key exchange
- case SS_FINISH: // This happened when update group key
- if(MsgType == EAPOL_PAIR_MSG_1)
- {
- WpaPairMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_MSG_3;
- // Reset port secured variable
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- }
- else if(MsgType == EAPOL_PAIR_MSG_3)
- {
- WpaPairMsg3Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_WAIT_GROUP;
- // Reset port secured variable
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- }
- else if(MsgType == EAPOL_GROUP_MSG_1)
- {
- WpaGroupMsg1Action(pAd, Elem);
- pAd->StaCfg.WpaState = SS_FINISH;
- }
- break;
-
- default:
- break;
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<----- WpaEAPOLKeyAction\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Pairwise key 4-way handshaking
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID WpaPairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PHEADER_802_11 pHeader;
- UCHAR *mpool, *PTK, *digest;
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- PEAPOL_PACKET pMsg1;
- EAPOL_PACKET Packet;
- UCHAR Mic[16];
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaPairMsg1Action ----->\n"));
-
- // allocate memory pool
- os_alloc_mem(pAd, (PUCHAR *)&mpool, 256);
-
- if (mpool == NULL)
- return;
-
- // PTK Len = 80.
- PTK = (UCHAR *) ROUND_UP(mpool, 4);
- // digest Len = 80.
- digest = (UCHAR *) ROUND_UP(PTK + 80, 4);
-
- pHeader = (PHEADER_802_11) Elem->Msg;
-
- // Process message 1 from authenticator
- pMsg1 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- // 1. Save Replay counter, it will use to verify message 3 and construct message 2
- NdisMoveMemory(pAd->StaCfg.ReplayCounter, pMsg1->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // 2. Save ANonce
- NdisMoveMemory(pAd->StaCfg.ANonce, pMsg1->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
-
- // Generate random SNonce
- GenRandom(pAd, pAd->CurrentAddress, pAd->StaCfg.SNonce);
-
- // Calc PTK(ANonce, SNonce)
- WpaCountPTK(pAd,
- pAd->StaCfg.PMK,
- pAd->StaCfg.ANonce,
- pAd->CommonCfg.Bssid,
- pAd->StaCfg.SNonce,
- pAd->CurrentAddress,
- PTK,
- LEN_PTK);
-
- // Save key to PTK entry
- NdisMoveMemory(pAd->StaCfg.PTK, PTK, LEN_PTK);
-
- // init 802.3 header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero Message 2 body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- //
- // Message 2 as EAPOL-Key(0,1,0,0,0,P,0,SNonce,MIC,RSN IE)
- //
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
- // 1. Key descriptor version and appropriate RSN IE
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 2;
- }
- else // TKIP
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 1;
- }
-
- // fill in Data Material and its length
- Packet.KeyDesc.KeyData[0] = IE_WPA;
- Packet.KeyDesc.KeyData[1] = pAd->StaCfg.RSNIE_Len;
- Packet.KeyDesc.KeyDataLen[1] = pAd->StaCfg.RSNIE_Len + 2;
- NdisMoveMemory(&Packet.KeyDesc.KeyData[2], pAd->StaCfg.RSN_IE, pAd->StaCfg.RSNIE_Len);
-
- // Update packet length after decide Key data payload
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE + Packet.KeyDesc.KeyDataLen[1];
-
- // Update Key length
- Packet.KeyDesc.KeyLength[0] = pMsg1->KeyDesc.KeyLength[0];
- Packet.KeyDesc.KeyLength[1] = pMsg1->KeyDesc.KeyLength[1];
- // 2. Key Type PeerKey
- Packet.KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
-
- // 3. KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
-
- //Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
-
- // 4. Fill SNonce
- NdisMoveMemory(Packet.KeyDesc.KeyNonce, pAd->StaCfg.SNonce, LEN_KEY_DESC_NONCE);
-
- // 5. Key Replay Count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Send EAPOL(0, 1, 0, 0, 0, P, 0, SNonce, MIC, RSN_IE)
- // Out buffer for transmitting message 2
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- {
- os_free_mem(pAd, mpool);
- return;
- }
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // 6. Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- { // AES
-
- HMAC_SHA1(pOutBuffer, FrameLen, PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- { // TKIP
- hmac_md5(PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
- //hex_dump("MIC", Mic, LEN_KEY_DESC_MIC);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
-
- // 5. Copy frame to Tx ring and send Msg 2 to authenticator
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE);
-
- MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
- os_free_mem(pAd, (PUCHAR)mpool);
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaPairMsg1Action <-----\n"));
-}
-
-VOID Wpa2PairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PHEADER_802_11 pHeader;
- UCHAR *mpool, *PTK, *digest;
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- PEAPOL_PACKET pMsg1;
- EAPOL_PACKET Packet;
- UCHAR Mic[16];
-
- DBGPRINT(RT_DEBUG_TRACE, ("Wpa2PairMsg1Action ----->\n"));
-
- // allocate memory pool
- os_alloc_mem(pAd, (PUCHAR *)&mpool, 256);
-
- if (mpool == NULL)
- return;
-
- // PTK Len = 80.
- PTK = (UCHAR *) ROUND_UP(mpool, 4);
- // digest Len = 80.
- digest = (UCHAR *) ROUND_UP(PTK + 80, 4);
-
- pHeader = (PHEADER_802_11) Elem->Msg;
-
- // Process message 1 from authenticator
- pMsg1 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- // 1. Save Replay counter, it will use to verify message 3 and construct message 2
- NdisMoveMemory(pAd->StaCfg.ReplayCounter, pMsg1->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // 2. Save ANonce
- NdisMoveMemory(pAd->StaCfg.ANonce, pMsg1->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
-
- // Generate random SNonce
- GenRandom(pAd, pAd->CurrentAddress, pAd->StaCfg.SNonce);
-
- if(pMsg1->KeyDesc.KeyDataLen[1] > 0 )
- {
- // cached PMKID
- }
-
- // Calc PTK(ANonce, SNonce)
- WpaCountPTK(pAd,
- pAd->StaCfg.PMK,
- pAd->StaCfg.ANonce,
- pAd->CommonCfg.Bssid,
- pAd->StaCfg.SNonce,
- pAd->CurrentAddress,
- PTK,
- LEN_PTK);
-
- // Save key to PTK entry
- NdisMoveMemory(pAd->StaCfg.PTK, PTK, LEN_PTK);
-
- // init 802.3 header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero message 2 body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- //
- // Message 2 as EAPOL-Key(0,1,0,0,0,P,0,SNonce,MIC,RSN IE)
- //
- Packet.KeyDesc.Type = WPA2_KEY_DESC;
-
- // 1. Key descriptor version and appropriate RSN IE
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 2;
- }
- else // TKIP
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 1;
- }
-
- // fill in Data Material and its length
- Packet.KeyDesc.KeyData[0] = IE_WPA2;
- Packet.KeyDesc.KeyData[1] = pAd->StaCfg.RSNIE_Len;
- Packet.KeyDesc.KeyDataLen[1] = pAd->StaCfg.RSNIE_Len + 2;
- NdisMoveMemory(&Packet.KeyDesc.KeyData[2], pAd->StaCfg.RSN_IE, pAd->StaCfg.RSNIE_Len);
-
- // Update packet length after decide Key data payload
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE + Packet.KeyDesc.KeyDataLen[1];
-
- // 2. Key Type PeerKey
- Packet.KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
-
- // 3. KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
-
- // Update Key Length
- Packet.KeyDesc.KeyLength[0] = 0;
- Packet.KeyDesc.KeyLength[1] = pMsg1->KeyDesc.KeyLength[1];
-
- // 4. Fill SNonce
- NdisMoveMemory(Packet.KeyDesc.KeyNonce, pAd->StaCfg.SNonce, LEN_KEY_DESC_NONCE);
-
- // 5. Key Replay Count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
- // Send EAPOL-Key(0,1,0,0,0,P,0,SNonce,MIC,RSN IE)
- // Out buffer for transmitting message 2
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- {
- os_free_mem(pAd, mpool);
- return;
- }
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // 6. Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- HMAC_SHA1(pOutBuffer, FrameLen, PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- hmac_md5(PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
-
- // Make Transmitting frame
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
-
- // 5. Copy frame to Tx ring
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE);
-
- MlmeFreeMemory(pAd, pOutBuffer);
- os_free_mem(pAd, mpool);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Wpa2PairMsg1Action <-----\n"));
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Pairwise key 4-way handshaking
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID WpaPairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- PHEADER_802_11 pHeader;
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- PEAPOL_PACKET pMsg3;
- UCHAR Mic[16], OldMic[16];
- MAC_TABLE_ENTRY *pEntry = NULL;
- UCHAR skip_offset;
- KEY_INFO peerKeyInfo;
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaPairMsg3Action ----->\n"));
-
- // Record 802.11 header & the received EAPOL packet Msg3
- pHeader = (PHEADER_802_11) Elem->Msg;
- pMsg3 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
- NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pMsg3->KeyDesc.KeyInfo, sizeof(KEY_INFO));
-
- *((USHORT*)&peerKeyInfo) = cpu2le16(*((USHORT*)&peerKeyInfo));
-
-
- // 1. Verify cipher type match
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled && (peerKeyInfo.KeyDescVer != 2))
- {
- return;
- }
- else if(pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled && (peerKeyInfo.KeyDescVer != 1))
- {
- return;
- }
-
- // Verify RSN IE
- //if (!RTMPEqualMemory(pMsg3->KeyDesc.KeyData, pAd->MacTab.Content[BSSID_WCID].RSN_IE, pAd->MacTab.Content[BSSID_WCID].RSNIE_Len))
- if (!CheckRSNIE(pAd, pMsg3->KeyDesc.KeyData, pMsg3->KeyDesc.KeyDataLen[1], &skip_offset))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RSN_IE Different in Msg 3 of WPA1 4-way handshake!! \n"));
- hex_dump("The original RSN_IE", pAd->MacTab.Content[BSSID_WCID].RSN_IE, pAd->MacTab.Content[BSSID_WCID].RSNIE_Len);
- hex_dump("The received RSN_IE", pMsg3->KeyDesc.KeyData, pMsg3->KeyDesc.KeyDataLen[1]);
- return;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("RSN_IE VALID in Msg 3 of WPA1 4-way handshake!! \n"));
-
-
- // 2. Check MIC value
- // Save the MIC and replace with zero
- NdisMoveMemory(OldMic, pMsg3->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- NdisZeroMemory(pMsg3->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- UCHAR digest[80];
-
- HMAC_SHA1((PUCHAR) pMsg3, pMsg3->Body_Len[1] + 4, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else // TKIP
- {
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, (PUCHAR) pMsg3, pMsg3->Body_Len[1] + 4, Mic);
- }
-
- if(!NdisEqualMemory(OldMic, Mic, LEN_KEY_DESC_MIC))
- {
- DBGPRINT(RT_DEBUG_ERROR, (" MIC Different in msg 3 of 4-way handshake!!!!!!!!!! \n"));
- return;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, (" MIC VALID in msg 3 of 4-way handshake!!!!!!!!!! \n"));
-
- // 3. Check Replay Counter, it has to be larger than last one. No need to be exact one larger
- if(RTMPCompareMemory(pMsg3->KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY) != 1)
- return;
-
- // Update new replay counter
- NdisMoveMemory(pAd->StaCfg.ReplayCounter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // 4. Double check ANonce
- if(!NdisEqualMemory(pAd->StaCfg.ANonce, pMsg3->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE))
- return;
-
- // init 802.3 header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero Message 4 body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE; // No data field
-
- //
- // Message 4 as EAPOL-Key(0,1,0,0,0,P,0,0,MIC,0)
- //
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
-
- // Key descriptor version and appropriate RSN IE
- Packet.KeyDesc.KeyInfo.KeyDescVer = peerKeyInfo.KeyDescVer;
-
- // Update Key Length
- Packet.KeyDesc.KeyLength[0] = pMsg3->KeyDesc.KeyLength[0];
- Packet.KeyDesc.KeyLength[1] = pMsg3->KeyDesc.KeyLength[1];
-
- // Key Type PeerKey
- Packet.KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
-
- // KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
-
- // In Msg3, KeyInfo.secure =0 if Group Key HS to come. 1 if no group key HS
- // Station sends Msg4 KeyInfo.secure should be the same as that in Msg.3
- Packet.KeyDesc.KeyInfo.Secure= peerKeyInfo.Secure;
-
- // Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
- // Key Replay count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Out buffer for transmitting message 4
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- return;
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- UCHAR digest[80];
-
- HMAC_SHA1(pOutBuffer, FrameLen, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
- // Update PTK
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
- else
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_NONE;
-
- // Update these related information to MAC_TABLE_ENTRY
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
- pEntry->PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][0].CipherAlg;
-
- // Update pairwise key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pAd->SharedKey[BSS0][0].Key,
- pAd->SharedKey[BSS0][0].TxMic,
- pAd->SharedKey[BSS0][0].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pEntry);
-
- // Make transmitting frame
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
-
- // Copy frame to Tx ring and Send Message 4 to authenticator
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE);
-
- MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaPairMsg3Action <-----\n"));
-}
-
-VOID Wpa2PairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- PHEADER_802_11 pHeader;
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- PEAPOL_PACKET pMsg3;
- UCHAR Mic[16], OldMic[16];
- UCHAR *mpool, *KEYDATA, *digest;
- UCHAR Key[32];
- MAC_TABLE_ENTRY *pEntry = NULL;
- KEY_INFO peerKeyInfo;
-
- // allocate memory
- os_alloc_mem(pAd, (PUCHAR *)&mpool, 1024);
-
- if(mpool == NULL)
- return;
-
- // KEYDATA Len = 512.
- KEYDATA = (UCHAR *) ROUND_UP(mpool, 4);
- // digest Len = 80.
- digest = (UCHAR *) ROUND_UP(KEYDATA + 512, 4);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Wpa2PairMsg3Action ----->\n"));
-
- pHeader = (PHEADER_802_11) Elem->Msg;
-
- // Process message 3 frame.
- pMsg3 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
- NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pMsg3->KeyDesc.KeyInfo, sizeof(KEY_INFO));
-
- *((USHORT*)&peerKeyInfo) = cpu2le16(*((USHORT*)&peerKeyInfo));
-
- // 1. Verify cipher type match
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled && (peerKeyInfo.KeyDescVer!= 2))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
- else if(pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled && (peerKeyInfo.KeyDescVer != 1))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // 2. Check MIC value
- // Save the MIC and replace with zero
- NdisMoveMemory(OldMic, pMsg3->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- NdisZeroMemory(pMsg3->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- HMAC_SHA1((PUCHAR) pMsg3, pMsg3->Body_Len[1] + 4, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, (PUCHAR) pMsg3, pMsg3->Body_Len[1] + 4, Mic);
- }
-
- if(!NdisEqualMemory(OldMic, Mic, LEN_KEY_DESC_MIC))
- {
- DBGPRINT(RT_DEBUG_ERROR, (" MIC Different in msg 3 of 4-way handshake!!!!!!!!!! \n"));
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, (" MIC VALID in msg 3 of 4-way handshake!!!!!!!!!! \n"));
-
- // 3. Check Replay Counter, it has to be larger than last one. No need to be exact one larger
- if(RTMPCompareMemory(pMsg3->KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY) != 1)
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Update new replay counter
- NdisMoveMemory(pAd->StaCfg.ReplayCounter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // 4. Double check ANonce
- if(!NdisEqualMemory(pAd->StaCfg.ANonce, pMsg3->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Obtain GTK
- // 5. Decrypt GTK from Key Data
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("EKD = %d\n", peerKeyInfo.EKD_DL));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // Decrypt AES GTK
- AES_GTK_KEY_UNWRAP(&pAd->StaCfg.PTK[16], KEYDATA, pMsg3->KeyDesc.KeyDataLen[1],pMsg3->KeyDesc.KeyData);
- }
- else // TKIP
- {
- INT i;
- // Decrypt TKIP GTK
- // Construct 32 bytes RC4 Key
- NdisMoveMemory(Key, pMsg3->KeyDesc.KeyIv, 16);
- NdisMoveMemory(&Key[16], &pAd->StaCfg.PTK[16], 16);
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, Key, 32);
- //discard first 256 bytes
- for(i = 0; i < 256; i++)
- ARCFOUR_BYTE(&pAd->PrivateInfo.WEPCONTEXT);
- // Decrypt GTK. Becareful, there is no ICV to check the result is correct or not
- ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA, pMsg3->KeyDesc.KeyData, pMsg3->KeyDesc.KeyDataLen[1]);
- }
-
- if (!ParseKeyData(pAd, KEYDATA, pMsg3->KeyDesc.KeyDataLen[1], 1))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Update GTK to ASIC
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- NULL);
-
- // init 802.3 header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero message 4 body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE; // No data field
-
- //
- // Message 4 as EAPOL-Key(0,1,0,0,0,P,0,0,MIC,0)
- //
- Packet.KeyDesc.Type = WPA2_KEY_DESC;
-
- // Key descriptor version and appropriate RSN IE
- Packet.KeyDesc.KeyInfo.KeyDescVer = peerKeyInfo.KeyDescVer;
-
- // Update Key Length
- Packet.KeyDesc.KeyLength[0] = pMsg3->KeyDesc.KeyLength[0];
- Packet.KeyDesc.KeyLength[1] = pMsg3->KeyDesc.KeyLength[1];
-
- // Key Type PeerKey
- Packet.KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
-
- // KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
- Packet.KeyDesc.KeyInfo.Secure = 1;
-
- // Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
- // Key Replay count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Out buffer for transmitting message 4
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- HMAC_SHA1(pOutBuffer, FrameLen, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
- // Update PTK
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
- else
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_NONE;
-
- // Update these related information to MAC_TABLE_ENTRY
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- NdisMoveMemory(&pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(&pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(&pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
- pEntry->PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][0].CipherAlg;
-
- // Update pairwise key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pAd->SharedKey[BSS0][0].Key,
- pAd->SharedKey[BSS0][0].TxMic,
- pAd->SharedKey[BSS0][0].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pEntry);
-
- // Make Transmitting frame
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
-
- // Copy frame to Tx ring and Send Message 4 to authenticator
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, TRUE);
-
- // set 802.1x port control
- STA_PORT_SECURED(pAd);
-
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
-
- MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
- os_free_mem(pAd, (PUCHAR)mpool);
-
-
- // send wireless event - for set key done WPA2
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pEntry->Addr, BSS0, 0);
-
- DBGPRINT(RT_DEBUG_ERROR, ("Wpa2PairMsg3Action <-----\n"));
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Group key 2-way handshaking
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID WpaGroupMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- PEAPOL_PACKET pGroup;
- UCHAR *mpool, *digest, *KEYDATA;
- UCHAR Mic[16], OldMic[16];
- UCHAR GTK[32], Key[32];
- KEY_INFO peerKeyInfo;
-
- // allocate memory
- os_alloc_mem(pAd, (PUCHAR *)&mpool, 1024);
-
- if(mpool == NULL)
- return;
-
- // digest Len = 80.
- digest = (UCHAR *) ROUND_UP(mpool, 4);
- // KEYDATA Len = 512.
- KEYDATA = (UCHAR *) ROUND_UP(digest + 80, 4);
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaGroupMsg1Action ----->\n"));
-
- // Process Group Message 1 frame. skip 802.11 header(24) & LLC_SNAP header(8)
- pGroup = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
- NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pGroup->KeyDesc.KeyInfo, sizeof(KEY_INFO));
-
- *((USHORT*)&peerKeyInfo) = cpu2le16(*((USHORT*)&peerKeyInfo));
-
- // 0. Check cipher type match
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled && (peerKeyInfo.KeyDescVer != 2))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
- else if (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled && (peerKeyInfo.KeyDescVer != 1))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // 1. Verify Replay counter
- // Check Replay Counter, it has to be larger than last one. No need to be exact one larger
- if(RTMPCompareMemory(pGroup->KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY) != 1)
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Update new replay counter
- NdisMoveMemory(pAd->StaCfg.ReplayCounter, pGroup->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // 2. Verify MIC is valid
- // Save the MIC and replace with zero
- NdisMoveMemory(OldMic, pGroup->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- NdisZeroMemory(pGroup->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
-
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- { // AES
- HMAC_SHA1((PUCHAR) pGroup, pGroup->Body_Len[1] + 4, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- { // TKIP
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, (PUCHAR) pGroup, pGroup->Body_Len[1] + 4, Mic);
- }
-
- if(!NdisEqualMemory(OldMic, Mic, LEN_KEY_DESC_MIC))
- {
- DBGPRINT(RT_DEBUG_ERROR, (" MIC Different in group msg 1 of 2-way handshake!!!!!!!!!! \n"));
- MlmeFreeMemory(pAd, (PUCHAR)mpool);
- return;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, (" MIC VALID in group msg 1 of 2-way handshake!!!!!!!!!! \n"));
-
-
- // 3. Decrypt GTK from Key Data
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // Decrypt AES GTK
- AES_GTK_KEY_UNWRAP(&pAd->StaCfg.PTK[16], KEYDATA, pGroup->KeyDesc.KeyDataLen[1], pGroup->KeyDesc.KeyData);
- }
- else // TKIP
- {
- INT i;
-
- // Decrypt TKIP GTK
- // Construct 32 bytes RC4 Key
- NdisMoveMemory(Key, pGroup->KeyDesc.KeyIv, 16);
- NdisMoveMemory(&Key[16], &pAd->StaCfg.PTK[16], 16);
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, Key, 32);
- //discard first 256 bytes
- for(i = 0; i < 256; i++)
- ARCFOUR_BYTE(&pAd->PrivateInfo.WEPCONTEXT);
- // Decrypt GTK. Becareful, there is no ICV to check the result is correct or not
- ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA, pGroup->KeyDesc.KeyData, pGroup->KeyDesc.KeyDataLen[1]);
- }
-
- // Process decrypted key data material
- // Parse keyData to handle KDE format for WPA2PSK
- if (peerKeyInfo.EKD_DL)
- {
- if (!ParseKeyData(pAd, KEYDATA, pGroup->KeyDesc.KeyDataLen[1], 0))
- {
- os_free_mem(pAd, (PUCHAR)mpool);
- return;
- }
- }
- else // WPAPSK
- {
- // set key material, TxMic and RxMic for WPAPSK
- NdisMoveMemory(GTK, KEYDATA, 32);
- NdisMoveMemory(pAd->StaCfg.GTK, GTK, 32);
- pAd->StaCfg.DefaultKeyId = peerKeyInfo.KeyIndex;
-
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, GTK, LEN_TKIP_EK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, &GTK[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, &GTK[24], LEN_TKIP_TXMICK);
-
- // Update Shared Key CipherAlg
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_NONE;
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
-
- //hex_dump("Group Key :", pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, LEN_TKIP_EK);
- }
-
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- NULL);
-
- // set 802.1x port control
- STA_PORT_SECURED(pAd);
-
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
-
- // init header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero Group message 1 body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE; // No data field
-
- //
- // Group Message 2 as EAPOL-Key(1,0,0,0,G,0,0,MIC,0)
- //
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
- {
- Packet.KeyDesc.Type = WPA2_KEY_DESC;
- }
- else
- {
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
- }
-
- // Key descriptor version and appropriate RSN IE
- Packet.KeyDesc.KeyInfo.KeyDescVer = peerKeyInfo.KeyDescVer;
-
- // Update Key Length
- Packet.KeyDesc.KeyLength[0] = pGroup->KeyDesc.KeyLength[0];
- Packet.KeyDesc.KeyLength[1] = pGroup->KeyDesc.KeyLength[1];
-
- // Key Index as G-Msg 1
- if(pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)
- Packet.KeyDesc.KeyInfo.KeyIndex = peerKeyInfo.KeyIndex;
-
- // Key Type Group key
- Packet.KeyDesc.KeyInfo.KeyType = GROUPKEY;
-
- // KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
-
- // Secure bit
- Packet.KeyDesc.KeyInfo.Secure = 1;
-
- // Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
- // Key Replay count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pGroup->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Out buffer for transmitting group message 2
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- {
- MlmeFreeMemory(pAd, (PUCHAR)mpool);
- return;
- }
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- HMAC_SHA1(pOutBuffer, FrameLen, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
-
- // 5. Copy frame to Tx ring and prepare for encryption
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, FALSE);
-
- // 6 Free allocated memory
- MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
- os_free_mem(pAd, (PUCHAR)mpool);
-
- // send wireless event - for set key done WPA2
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaGroupMsg1Action <-----\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Init WPA MAC header
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID WpaMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR wep,
- IN PUCHAR pAddr1)
-{
- NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
- pHdr80211->FC.Type = BTYPE_DATA;
- pHdr80211->FC.ToDs = 1;
- if (wep == 1)
- pHdr80211->FC.Wep = 1;
-
- // Addr1: BSSID, Addr2: SA, Addr3: DA
- COPY_MAC_ADDR(pHdr80211->Addr1, pAddr1);
- COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHdr80211->Addr3, pAd->CommonCfg.Bssid);
- pHdr80211->Sequence = pAd->Sequence;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Copy frame from waiting queue into relative ring buffer and set
- appropriate ASIC register to kick hardware encryption before really
- sent out to air.
-
- Arguments:
- pAd Pointer to our adapter
- PNDIS_PACKET Pointer to outgoing Ndis frame
- NumberOfFrag Number of fragment required
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPToWirelessSta(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN UINT DataLen,
- IN BOOLEAN is4wayFrame)
-
-{
- NDIS_STATUS Status;
- PNDIS_PACKET pPacket;
- UCHAR Index;
-
- do
- {
- // 1. build a NDIS packet and call RTMPSendPacket();
- // be careful about how/when to release this internal allocated NDIS PACKET buffer
- Status = RTMPAllocateNdisPacket(pAd, &pPacket, pHeader802_3, HdrLen, pData, DataLen);
- if (Status != NDIS_STATUS_SUCCESS)
- break;
-
- if (is4wayFrame)
- RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 1);
- else
- RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 0);
-
- // 2. send out the packet
- Status = STASendPacket(pAd, pPacket);
- if(Status == NDIS_STATUS_SUCCESS)
- {
- // Dequeue one frame from TxSwQueue0..3 queue and process it
- // There are three place calling dequeue for TX ring.
- // 1. Here, right after queueing the frame.
- // 2. At the end of TxRingTxDone service routine.
- // 3. Upon NDIS call RTMPSendPackets
- if((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)))
- {
- for(Index = 0; Index < 5; Index ++)
- if(pAd->TxSwQueue[Index].Number > 0)
- RTMPDeQueuePacket(pAd, FALSE, Index, MAX_TX_PROCESS);
- }
- }
- } while(FALSE);
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Check Sanity RSN IE form AP
-
- Arguments:
-
- Return Value:
-
-
- ========================================================================
-*/
-BOOLEAN CheckRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN UCHAR DataLen,
- OUT UCHAR *Offset)
-{
- PUCHAR pVIE;
- UCHAR len;
- PEID_STRUCT pEid;
- BOOLEAN result = FALSE;
-
- pVIE = pData;
- len = DataLen;
- *Offset = 0;
-
- while (len > sizeof(RSNIE2))
- {
- pEid = (PEID_STRUCT) pVIE;
- // WPA RSN IE
- if ((pEid->Eid == IE_WPA) && (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)))
- {
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA || pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) &&
- (NdisEqualMemory(pVIE, pAd->MacTab.Content[BSSID_WCID].RSN_IE, pAd->MacTab.Content[BSSID_WCID].RSNIE_Len)) &&
- (pAd->MacTab.Content[BSSID_WCID].RSNIE_Len == (pEid->Len + 2)))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CheckRSNIE ==> WPA/WPAPSK RSN IE matched in Msg 3, Length(%d) \n", (pEid->Len + 2)));
- result = TRUE;
- }
-
- *Offset += (pEid->Len + 2);
- }
- // WPA2 RSN IE
- else if ((pEid->Eid == IE_RSN) && (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3)))
- {
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2 || pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) &&
- (NdisEqualMemory(pVIE, pAd->MacTab.Content[BSSID_WCID].RSN_IE, pAd->MacTab.Content[BSSID_WCID].RSNIE_Len)) &&
- (pAd->MacTab.Content[BSSID_WCID].RSNIE_Len == (pEid->Len + 2)))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CheckRSNIE ==> WPA2/WPA2PSK RSN IE matched in Msg 3, Length(%d) \n", (pEid->Len + 2)));
- result = TRUE;
- }
-
- *Offset += (pEid->Len + 2);
- }
- else
- {
- break;
- }
-
- pVIE += (pEid->Len + 2);
- len -= (pEid->Len + 2);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("CheckRSNIE ==> skip_offset(%d) \n", *Offset));
-
- return result;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Parse KEYDATA field. KEYDATA[] May contain 2 RSN IE and optionally GTK.
- GTK is encaptulated in KDE format at p.83 802.11i D10
-
- Arguments:
-
- Return Value:
-
- Note:
- 802.11i D10
-
- ========================================================================
-*/
-BOOLEAN ParseKeyData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKeyData,
- IN UCHAR KeyDataLen,
- IN UCHAR bPairewise)
-{
- PKDE_ENCAP pKDE = NULL;
- PUCHAR pMyKeyData = pKeyData;
- UCHAR KeyDataLength = KeyDataLen;
- UCHAR GTKLEN;
- UCHAR skip_offset;
-
- // Verify The RSN IE contained in Pairewise-Msg 3 and skip it
- if (bPairewise)
- {
- // Check RSN IE whether it is WPA2/WPA2PSK
- if (!CheckRSNIE(pAd, pKeyData, KeyDataLen, &skip_offset))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ParseKeyData ==> WPA2/WPA2PSK RSN IE mismatched \n"));
- hex_dump("Get KEYDATA :", pKeyData, KeyDataLen);
- return FALSE;
- }
- else
- {
- // skip RSN IE
- pMyKeyData += skip_offset;
- KeyDataLength -= skip_offset;
-
- //DBGPRINT(RT_DEBUG_TRACE, ("ParseKeyData ==> WPA2/WPA2PSK RSN IE matched in Msg 3, Length(%d) \n", skip_offset));
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("ParseKeyData ==> KeyDataLength %d without RSN_IE \n", KeyDataLength));
-
- // Parse EKD format
- if (KeyDataLength >= 8)
- {
- pKDE = (PKDE_ENCAP) pMyKeyData;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: KeyDataLength is too short \n"));
- return FALSE;
- }
-
-
- // Sanity check - shared key index should not be 0
- if (pKDE->GTKEncap.Kid == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key index zero \n"));
- return FALSE;
- }
-
- // Sanity check - KED length
- if (KeyDataLength < (pKDE->Len + 2))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: The len from KDE is too short \n"));
- return FALSE;
- }
-
- // Get GTK length - refer to IEEE 802.11i-2004 p.82
- GTKLEN = pKDE->Len -6;
-
- if (GTKLEN < LEN_AES_KEY)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN));
- return FALSE;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("GTK Key with KDE formet got index=%d, len=%d \n", pKDE->GTKEncap.Kid, GTKLEN));
-
- // Update GTK
- // set key material, TxMic and RxMic for WPAPSK
- NdisMoveMemory(pAd->StaCfg.GTK, pKDE->GTKEncap.GTK, 32);
- pAd->StaCfg.DefaultKeyId = pKDE->GTKEncap.Kid;
-
- // Update shared key table
- NdisZeroMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, pKDE->GTKEncap.GTK, LEN_TKIP_EK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, &pKDE->GTKEncap.GTK[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, &pKDE->GTKEncap.GTK[24], LEN_TKIP_TXMICK);
-
- // Update Shared Key CipherAlg
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_NONE;
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP64;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_WEP128;
-
- return TRUE;
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Cisco CCKM PRF function
-
- Arguments:
- key Cisco Base Transient Key (BTK)
- key_len The key length of the BTK
- data Ruquest Number(RN) + BSSID
- data_len The length of the data
- output Store for PTK(Pairwise transient keys)
- len The length of the output
- Return Value:
- None
-
- Note:
- 802.1i Annex F.9
-
- ========================================================================
-*/
-VOID CCKMPRF(
- IN UCHAR *key,
- IN INT key_len,
- IN UCHAR *data,
- IN INT data_len,
- OUT UCHAR *output,
- IN INT len)
-{
- INT i;
- UCHAR input[1024];
- INT currentindex = 0;
- INT total_len;
-
- NdisMoveMemory(input, data, data_len);
- total_len = data_len;
- input[total_len] = 0;
- total_len++;
- for (i = 0; i < (len + 19) / 20; i++)
- {
- HMAC_SHA1(input, total_len, key, key_len, &output[currentindex]);
- currentindex += 20;
- input[total_len - 1]++;
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
Process MIC error indication and record MIC error timer.
Arguments:
@@ -1872,7 +66,7 @@ VOID RTMPReportMicError(
UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1:0);
// Record Last MIC error time and count
- Now = jiffies;
+ NdisGetSystemUpTime(&Now);
if (pAd->StaCfg.MicErrCnt == 0)
{
pAd->StaCfg.MicErrCnt++;
@@ -1895,6 +89,17 @@ VOID RTMPReportMicError(
pAd->StaCfg.LastMicErrorTime = Now;
// Violate MIC error counts, MIC countermeasures kicks in
pAd->StaCfg.MicErrCnt++;
+ // We shall block all reception
+ // We shall clean all Tx ring and disassoicate from AP after next EAPOL frame
+ //
+ // No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets
+ // if pAd->StaCfg.MicErrCnt greater than 2.
+ //
+ // RTMPRingCleanUp(pAd, QID_AC_BK);
+ // RTMPRingCleanUp(pAd, QID_AC_BE);
+ // RTMPRingCleanUp(pAd, QID_AC_VI);
+ // RTMPRingCleanUp(pAd, QID_AC_VO);
+ // RTMPRingCleanUp(pAd, QID_HCCA);
}
}
else
@@ -1944,14 +149,13 @@ VOID WpaSendMicFailureToWpaSupplicant(
IN PRTMP_ADAPTER pAd,
IN BOOLEAN bUnicast)
{
- union iwreq_data wrqu;
char custom[IW_CUSTOM_MAX] = {0};
sprintf(custom, "MLME-MICHAELMICFAILURE.indication");
- if (bUnicast)
+ if(bUnicast)
sprintf(custom, "%s unicast", custom);
- wrqu.data.length = strlen(custom);
- wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, custom);
+
+ RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (PUCHAR)custom, strlen(custom));
return;
}
@@ -2002,7 +206,7 @@ VOID WpaMicFailureReportFrame(
Packet.KeyDesc.KeyInfo.Error = 1;
// Update packet length after decide Key data payload
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE;
+ SET_UINT16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG)
// Key Replay Count
NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
@@ -2021,7 +225,7 @@ VOID WpaMicFailureReportFrame(
// Prepare EAPOL frame for MIC calculation
// Be careful, only EAPOL frame is counted for MIC calculation
MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
+ CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, &Packet,
END_OF_ARGS);
// Prepare and Fill MIC value
@@ -2029,22 +233,20 @@ VOID WpaMicFailureReportFrame(
if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
{ // AES
UCHAR digest[20] = {0};
- HMAC_SHA1(pOutBuffer, FrameLen, pAd->StaCfg.PTK, LEN_EAP_MICK, digest);
+ HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
}
else
{ // TKIP
- hmac_md5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic);
+ HMAC_MD5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic, MD5_DIGEST_SIZE);
}
NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- LENGTH_802_3, &Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // opy frame to Tx ring and send MIC failure report frame to authenticator
- RTMPToWirelessSta(pAd, Header802_3, LENGTH_802_3, (PUCHAR)&Packet, Packet.Body_Len[1] + 4, FALSE);
+ // copy frame to Tx ring and send MIC failure report frame to authenticator
+ RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID],
+ Header802_3, LENGTH_802_3,
+ (PUCHAR)&Packet,
+ CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, FALSE);
MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
@@ -2089,3 +291,101 @@ VOID WpaDisassocApAndBlockAssoc(
pAd->StaCfg.bBlockAssoc = TRUE;
}
+VOID WpaStaPairwiseKeySetting(
+ IN PRTMP_ADAPTER pAd)
+{
+ PCIPHER_KEY pSharedKey;
+ PMAC_TABLE_ENTRY pEntry;
+
+ pEntry = &pAd->MacTab.Content[BSSID_WCID];
+
+ // Pairwise key shall use key#0
+ pSharedKey = &pAd->SharedKey[BSS0][0];
+
+ NdisMoveMemory(pAd->StaCfg.PTK, pEntry->PTK, LEN_PTK);
+
+ // Prepare pair-wise key information into shared key table
+ NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
+ pSharedKey->KeyLen = LEN_TKIP_EK;
+ NdisMoveMemory(pSharedKey->Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
+ NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
+
+ // Decide its ChiperAlg
+ if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
+ pSharedKey->CipherAlg = CIPHER_TKIP;
+ else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
+ pSharedKey->CipherAlg = CIPHER_AES;
+ else
+ pSharedKey->CipherAlg = CIPHER_NONE;
+
+ // Update these related information to MAC_TABLE_ENTRY
+ NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
+ NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
+ pEntry->PairwiseKey.CipherAlg = pSharedKey->CipherAlg;
+
+ // Update pairwise key information to ASIC Shared Key Table
+ AsicAddSharedKeyEntry(pAd,
+ BSS0,
+ 0,
+ pSharedKey->CipherAlg,
+ pSharedKey->Key,
+ pSharedKey->TxMic,
+ pSharedKey->RxMic);
+
+ // Update ASIC WCID attribute table and IVEIV table
+ RTMPAddWcidAttributeEntry(pAd,
+ BSS0,
+ 0,
+ pSharedKey->CipherAlg,
+ pEntry);
+ STA_PORT_SECURED(pAd);
+ pAd->IndicateMediaState = NdisMediaStateConnected;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("%s : AID(%d) port secured\n", __func__, pEntry->Aid));
+
+}
+
+VOID WpaStaGroupKeySetting(
+ IN PRTMP_ADAPTER pAd)
+{
+ PCIPHER_KEY pSharedKey;
+
+ pSharedKey = &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId];
+
+ // Prepare pair-wise key information into shared key table
+ NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
+ pSharedKey->KeyLen = LEN_TKIP_EK;
+ NdisMoveMemory(pSharedKey->Key, pAd->StaCfg.GTK, LEN_TKIP_EK);
+ NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.GTK[16], LEN_TKIP_RXMICK);
+ NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.GTK[24], LEN_TKIP_TXMICK);
+
+ // Update Shared Key CipherAlg
+ pSharedKey->CipherAlg = CIPHER_NONE;
+ if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
+ pSharedKey->CipherAlg = CIPHER_TKIP;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
+ pSharedKey->CipherAlg = CIPHER_AES;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
+ pSharedKey->CipherAlg = CIPHER_WEP64;
+ else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
+ pSharedKey->CipherAlg = CIPHER_WEP128;
+
+ // Update group key information to ASIC Shared Key Table
+ AsicAddSharedKeyEntry(pAd,
+ BSS0,
+ pAd->StaCfg.DefaultKeyId,
+ pSharedKey->CipherAlg,
+ pSharedKey->Key,
+ pSharedKey->TxMic,
+ pSharedKey->RxMic);
+
+ // Update ASIC WCID attribute table and IVEIV table
+ RTMPAddWcidAttributeEntry(pAd,
+ BSS0,
+ pAd->StaCfg.DefaultKeyId,
+ pSharedKey->CipherAlg,
+ NULL);
+
+}
diff --git a/drivers/staging/rt2860/sta_ioctl.c b/drivers/staging/rt2860/sta_ioctl.c
index c0e04251e126..e5e294284108 100644
--- a/drivers/staging/rt2860/sta_ioctl.c
+++ b/drivers/staging/rt2860/sta_ioctl.c
@@ -50,8 +50,6 @@ extern ULONG RTDebugLevel;
#define GROUP_KEY_NO 4
extern UCHAR CipherWpa2Template[];
-extern UCHAR CipherWpaPskTkip[];
-extern UCHAR CipherWpaPskTkipLen;
typedef struct PACKED _RT_VERSION_INFO{
UCHAR DriverVersionW;
@@ -68,25 +66,25 @@ struct iw_priv_args privtab[] = {
IW_PRIV_TYPE_CHAR | 1024, 0,
"set"},
-{ RTPRIV_IOCTL_SHOW, 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
- ""},
{ RTPRIV_IOCTL_SHOW, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
""},
/* --- sub-ioctls definitions --- */
{ SHOW_CONN_STATUS,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "connStatus" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "connStatus" },
{ SHOW_DRVIER_VERION,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "driverVer" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "driverVer" },
{ SHOW_BA_INFO,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "bainfo" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "bainfo" },
{ SHOW_DESC_INFO,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "descinfo" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "descinfo" },
{ RAIO_OFF,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_off" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_off" },
{ RAIO_ON,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_on" },
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_on" },
{ SHOW_CFG_VALUE,
IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "show" },
+ { SHOW_ADHOC_ENTRY_INFO,
+ IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "adhocEntry" },
/* --- sub-ioctls relations --- */
{ RTPRIV_IOCTL_STATISTICS,
@@ -95,62 +93,82 @@ struct iw_priv_args privtab[] = {
{ RTPRIV_IOCTL_GSITESURVEY,
0, IW_PRIV_TYPE_CHAR | 1024,
"get_site_survey"},
+
+
};
+static __s32 ralinkrate[] =
+ {2, 4, 11, 22, // CCK
+ 12, 18, 24, 36, 48, 72, 96, 108, // OFDM
+ 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, // 20MHz, 800ns GI, MCS: 0 ~ 15
+ 39, 78, 117, 156, 234, 312, 351, 390, // 20MHz, 800ns GI, MCS: 16 ~ 23
+ 27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540, // 40MHz, 800ns GI, MCS: 0 ~ 15
+ 81, 162, 243, 324, 486, 648, 729, 810, // 40MHz, 800ns GI, MCS: 16 ~ 23
+ 14, 29, 43, 57, 87, 115, 130, 144, 29, 59, 87, 115, 173, 230, 260, 288, // 20MHz, 400ns GI, MCS: 0 ~ 15
+ 43, 87, 130, 173, 260, 317, 390, 433, // 20MHz, 400ns GI, MCS: 16 ~ 23
+ 30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, // 40MHz, 400ns GI, MCS: 0 ~ 15
+ 90, 180, 270, 360, 540, 720, 810, 900};
+
INT Set_SSID_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
#ifdef WMM_SUPPORT
INT Set_WmmCapable_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
#endif
INT Set_NetworkType_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_AuthMode_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_EncrypType_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_DefaultKeyID_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_Key1_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_Key2_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_Key3_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_Key4_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_WPAPSK_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_PSMode_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
+
+#ifdef RT3090
+INT Set_PCIePSLevel_Proc(
+IN PRTMP_ADAPTER pAdapter,
+IN PUCHAR arg);
+#endif // RT3090 //
INT Set_Wpa_Support(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
NDIS_STATUS RTMPWPANoneAddKeyProc(
IN PRTMP_ADAPTER pAd,
@@ -158,23 +176,45 @@ NDIS_STATUS RTMPWPANoneAddKeyProc(
INT Set_FragTest_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_TGnWifiTest_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_LongRetryLimit_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
INT Set_ShortRetryLimit_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg);
+ IN PSTRING arg);
+
+
+
+INT Show_Adhoc_MacTable_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING extra);
+
+INT Set_BeaconLostTime_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT Set_AutoRoaming_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT Set_SiteSurvey_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
+
+INT Set_ForceTxBurst_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg);
static struct {
- CHAR *name;
- INT (*set_proc)(PRTMP_ADAPTER pAdapter, PUCHAR arg);
+ PSTRING name;
+ INT (*set_proc)(PRTMP_ADAPTER pAdapter, PSTRING arg);
} *PRTMP_PRIVATE_SET_PROC, RTMP_PRIVATE_SUPPORT_PROC[] = {
{"DriverVersion", Set_DriverVersion_Proc},
{"CountryRegion", Set_CountryRegion_Proc},
@@ -201,9 +241,10 @@ static struct {
{"HtBaDecline", Set_BADecline_Proc},
{"HtProtect", Set_HtProtect_Proc},
{"HtMimoPs", Set_HtMimoPs_Proc},
+ {"HtDisallowTKIP", Set_HtDisallowTKIP_Proc},
#ifdef AGGREGATION_SUPPORT
{"PktAggregate", Set_PktAggregate_Proc},
-#endif
+#endif // AGGREGATION_SUPPORT //
#ifdef WMM_SUPPORT
{"WmmCapable", Set_WmmCapable_Proc},
@@ -222,18 +263,36 @@ static struct {
{"PSMode", Set_PSMode_Proc},
#ifdef DBG
{"Debug", Set_Debug_Proc},
-#endif
+#endif // DBG //
+
+
{"WpaSupport", Set_Wpa_Support},
+
+
+
+
+
{"FixedTxMode", Set_FixedTxMode_Proc},
{"TGnWifiTest", Set_TGnWifiTest_Proc},
{"ForceGF", Set_ForceGF_Proc},
{"LongRetry", Set_LongRetryLimit_Proc},
{"ShortRetry", Set_ShortRetryLimit_Proc},
-#ifdef RT2870
+
+//2008/09/11:KH add to support efuse<--
+#ifdef RT30xx
+#ifdef RTMP_EFUSE_SUPPORT
{"efuseFreeNumber", set_eFuseGetFreeBlockCount_Proc},
{"efuseDump", set_eFusedump_Proc},
{"efuseLoadFromBin", set_eFuseLoadFromBin_Proc},
-#endif
+ {"efuseBufferModeWriteBack", set_eFuseBufferModeWriteBack_Proc},
+#endif // RTMP_EFUSE_SUPPORT //
+#endif // RT30xx //
+//2008/09/11:KH add to support efuse-->
+ {"BeaconLostTime", Set_BeaconLostTime_Proc},
+ {"AutoRoaming", Set_AutoRoaming_Proc},
+ {"SiteSurvey", Set_SiteSurvey_Proc},
+ {"ForceTxBurst", Set_ForceTxBurst_Proc},
+
{NULL,}
};
@@ -247,22 +306,6 @@ VOID RTMPAddKey(
DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n"));
-#ifdef RT2860
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- if (RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
- {
- if (pAd->StaCfg.bRadio == FALSE)
- {
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- return;
- }
- DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n"));
- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_HALT);
- RTMPusecDelay(6000);
- pAd->bPCIclkOff = FALSE;
- }
-#endif
-
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
{
if (pKey->KeyIndex & 0x80000000)
@@ -323,6 +366,7 @@ VOID RTMPAddKey(
if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
{
// set 802.1x port control
+ //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAd);
// Indicate Connected for GUI
@@ -372,6 +416,7 @@ VOID RTMPAddKey(
NULL);
// set 802.1x port control
+ //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAd);
// Indicate Connected for GUI
@@ -454,10 +499,6 @@ VOID RTMPAddKey(
}
}
end:
-#ifdef RT2860
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- DBGPRINT(RT_DEBUG_INFO, ("<------ RTMPAddKey\n"));
-#endif
return;
}
@@ -478,8 +519,9 @@ rt_ioctl_giwname(struct net_device *dev,
struct iw_request_info *info,
char *name, char *extra)
{
-// PRTMP_ADAPTER pAdapter = dev->ml_priv;
- strncpy(name, RT28xx_CHIP_NAME " Wireless", IFNAMSIZ);
+ strncpy(name, "Ralink STA", IFNAMSIZ);
+ // RT2870 2.1.0.0 uses "RT2870 Wireless"
+ // RT3090 2.1.0.0 uses "RT2860 Wireless"
return 0;
}
@@ -487,9 +529,11 @@ int rt_ioctl_siwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
int chan = -1;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -520,9 +564,13 @@ int rt_ioctl_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
- UCHAR ch = pAdapter->CommonCfg.Channel;
- ULONG m;
+ PRTMP_ADAPTER pAdapter = NULL;
+ UCHAR ch;
+ ULONG m = 2412000;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
+ ch = pAdapter->CommonCfg.Channel;
DBGPRINT(RT_DEBUG_TRACE,("==>rt_ioctl_giwfreq %d\n", ch));
@@ -536,7 +584,9 @@ int rt_ioctl_siwmode(struct net_device *dev,
struct iw_request_info *info,
__u32 *mode, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -571,7 +621,9 @@ int rt_ioctl_giwmode(struct net_device *dev,
struct iw_request_info *info,
__u32 *mode, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
if (ADHOC_ON(pAdapter))
*mode = IW_MODE_ADHOC;
@@ -592,7 +644,9 @@ int rt_ioctl_siwsens(struct net_device *dev,
struct iw_request_info *info,
char *name, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -615,11 +669,13 @@ int rt_ioctl_giwrange(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
struct iw_range *range = (struct iw_range *) extra;
u16 val;
int i;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
DBGPRINT(RT_DEBUG_TRACE ,("===>rt_ioctl_giwrange\n"));
data->length = sizeof(struct iw_range);
memset(range, 0, sizeof(struct iw_range));
@@ -651,10 +707,10 @@ int rt_ioctl_giwrange(struct net_device *dev,
val = 0;
for (i = 1; i <= range->num_channels; i++)
{
- u32 m;
+ u32 m = 2412000;
range->freq[val].i = pAdapter->ChannelList[i-1].Channel;
MAP_CHANNEL_ID_TO_KHZ(pAdapter->ChannelList[i-1].Channel, m);
- range->freq[val].m = m * 100; /* HZ */
+ range->freq[val].m = m * 100; /* OS_HZ */
range->freq[val].e = 1;
val++;
@@ -696,9 +752,11 @@ int rt_ioctl_siwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
NDIS_802_11_MAC_ADDRESS Bssid;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -708,7 +766,7 @@ int rt_ioctl_siwap(struct net_device *dev,
if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
{
- RT28XX_MLME_RESET_STATE_MACHINE(pAdapter);
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
}
@@ -736,7 +794,9 @@ int rt_ioctl_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *ap_addr, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
if (INFRA_ON(pAdapter) || ADHOC_ON(pAdapter))
{
@@ -802,12 +862,14 @@ int rt_ioctl_iwaplist(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
struct sockaddr addr[IW_MAX_AP];
struct iw_quality qual[IW_MAX_AP];
int i;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -837,11 +899,13 @@ int rt_ioctl_siwscan(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
ULONG Now;
int Status = NDIS_STATUS_SUCCESS;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -854,17 +918,8 @@ int rt_ioctl_siwscan(struct net_device *dev,
DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is in Monitor Mode now !!!\n"));
return -EINVAL;
}
-#ifdef RT2860
- if ((pAdapter->OpMode == OPMODE_STA) && (IDLE_ON(pAdapter))
- && (pAdapter->StaCfg.bRadio == TRUE)
- && (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
- {
- RT28xxPciAsicRadioOn(pAdapter, GUI_IDLE_POWER_SAVE);
- }
- // Check if still radio off.
- else if (pAdapter->bPCIclkOff == TRUE)
- return 0;
-#endif
+
+
if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
{
pAdapter->StaCfg.WpaSupplicantScanCount++;
@@ -872,7 +927,7 @@ int rt_ioctl_siwscan(struct net_device *dev,
pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- return 0;
+ return NDIS_STATUS_SUCCESS;
do{
Now = jiffies;
@@ -896,7 +951,7 @@ int rt_ioctl_siwscan(struct net_device *dev,
if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
{
- RT28XX_MLME_RESET_STATE_MACHINE(pAdapter);
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
}
@@ -914,23 +969,25 @@ int rt_ioctl_siwscan(struct net_device *dev,
NULL);
Status = NDIS_STATUS_SUCCESS;
- RT28XX_MLME_HANDLER(pAdapter);
+ RTMP_MLME_HANDLER(pAdapter);
}while(0);
- return 0;
+ return NDIS_STATUS_SUCCESS;
}
int rt_ioctl_giwscan(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
-
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
int i=0;
- char *current_ev = extra, *previous_ev = extra;
- char *end_buf;
- char *current_val, custom[MAX_CUSTOM_LEN] = {0};
+ PSTRING current_ev = extra, previous_ev = extra;
+ PSTRING end_buf;
+ PSTRING current_val;
+ STRING custom[MAX_CUSTOM_LEN] = {0};
struct iw_event iwe;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
{
/*
@@ -958,7 +1015,9 @@ int rt_ioctl_giwscan(struct net_device *dev,
for (i = 0; i < pAdapter->ScanTab.BssNr; i++)
{
if (current_ev >= end_buf)
+ {
return -E2BIG;
+ }
//MAC address
//================================
@@ -1043,7 +1102,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
}
previous_ev = current_ev;
- current_ev = iwe_stream_add_event(info, current_ev, end_buf, &iwe, IW_EV_ADDR_LEN);
+ current_ev = iwe_stream_add_event(info, current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
if (current_ev == previous_ev)
return -E2BIG;
@@ -1055,7 +1114,7 @@ int rt_ioctl_giwscan(struct net_device *dev,
iwe.u.data.flags = 1;
previous_ev = current_ev;
- current_ev = iwe_stream_add_point(info, current_ev,end_buf, &iwe, pAdapter->ScanTab.BssEntry[i].Ssid);
+ current_ev = iwe_stream_add_point(info, current_ev,end_buf, &iwe, (PSTRING) pAdapter->ScanTab.BssEntry[i].Ssid);
if (current_ev == previous_ev)
return -E2BIG;
@@ -1142,6 +1201,20 @@ int rt_ioctl_giwscan(struct net_device *dev,
else
iwe.u.bitrate.value = (tmpRate/2) * 1000000;
+ if (tmpRate == 0x6c && pAdapter->ScanTab.BssEntry[i].HtCapabilityLen > 0)
+ {
+ int rate_count = sizeof(ralinkrate)/sizeof(__s32);
+ HT_CAP_INFO capInfo = pAdapter->ScanTab.BssEntry[i].HtCapability.HtCapInfo;
+ int shortGI = capInfo.ChannelWidth ? capInfo.ShortGIfor40 : capInfo.ShortGIfor20;
+ int maxMCS = pAdapter->ScanTab.BssEntry[i].HtCapability.MCSSet[1] ? 15 : 7;
+ int rate_index = 12 + ((UCHAR)capInfo.ChannelWidth * 24) + ((UCHAR)shortGI *48) + ((UCHAR)maxMCS);
+ if (rate_index < 0)
+ rate_index = 0;
+ if (rate_index > rate_count)
+ rate_index = rate_count;
+ iwe.u.bitrate.value = ralinkrate[rate_index] * 500000;
+ }
+
iwe.u.bitrate.disabled = 0;
current_val = iwe_stream_add_value(info, current_ev,
current_val, end_buf, &iwe,
@@ -1192,7 +1265,9 @@ int rt_ioctl_siwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *essid)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1203,13 +1278,13 @@ int rt_ioctl_siwessid(struct net_device *dev,
if (data->flags)
{
- PCHAR pSsidString = NULL;
+ PSTRING pSsidString = NULL;
// Includes null character.
if (data->length > (IW_ESSID_MAX_SIZE + 1))
return -E2BIG;
- pSsidString = (CHAR *) kmalloc(MAX_LEN_OF_SSID+1, MEM_ALLOC_FLAG);
+ pSsidString = kmalloc(MAX_LEN_OF_SSID+1, MEM_ALLOC_FLAG);
if (pSsidString)
{
NdisZeroMemory(pSsidString, MAX_LEN_OF_SSID+1);
@@ -1233,7 +1308,9 @@ int rt_ioctl_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *essid)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
data->flags = 1;
if (MONITOR_ON(pAdapter))
@@ -1248,14 +1325,14 @@ int rt_ioctl_giwessid(struct net_device *dev,
data->length = pAdapter->CommonCfg.SsidLen;
memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen);
}
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
// Add for RT2870
else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
{
data->length = pAdapter->CommonCfg.SsidLen;
memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen);
}
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
else
{//the ANY ssid was specified
data->length = 0;
@@ -1270,7 +1347,9 @@ int rt_ioctl_siwnickn(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *nickname)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1293,10 +1372,12 @@ int rt_ioctl_giwnickn(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *nickname)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
- if (data->length > strlen(pAdapter->nickname) + 1)
- data->length = strlen(pAdapter->nickname) + 1;
+ if (data->length > strlen((PSTRING) pAdapter->nickname) + 1)
+ data->length = strlen((PSTRING) pAdapter->nickname) + 1;
if (data->length > 0) {
memcpy(nickname, pAdapter->nickname, data->length-1);
nickname[data->length-1] = '\0';
@@ -1308,9 +1389,11 @@ int rt_ioctl_siwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
u16 val;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -1337,7 +1420,9 @@ int rt_ioctl_giwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1357,9 +1442,11 @@ int rt_ioctl_siwfrag(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
u16 val;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -1384,7 +1471,9 @@ int rt_ioctl_giwfrag(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1406,7 +1495,9 @@ int rt_ioctl_siwencode(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *erq, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1424,8 +1515,10 @@ int rt_ioctl_siwencode(struct net_device *dev,
pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
goto done;
- } else if (
- (erq->flags & IW_ENCODE_RESTRICTED || erq->flags & IW_ENCODE_OPEN)) {
+ }
+ else if (erq->flags & IW_ENCODE_RESTRICTED || erq->flags & IW_ENCODE_OPEN)
+ {
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled;
@@ -1441,7 +1534,8 @@ int rt_ioctl_siwencode(struct net_device *dev,
{
int keyIdx = (erq->flags & IW_ENCODE_INDEX) - 1;
/* Check the size of the key */
- if (erq->length > MAX_WEP_KEY_SIZE) {
+ if (erq->length > MAX_WEP_KEY_SIZE)
+ {
return -EINVAL;
}
/* Check key index */
@@ -1454,7 +1548,7 @@ int rt_ioctl_siwencode(struct net_device *dev,
keyIdx = pAdapter->StaCfg.DefaultKeyId;
}
else
- pAdapter->StaCfg.DefaultKeyId=keyIdx;
+ pAdapter->StaCfg.DefaultKeyId = keyIdx;
NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
@@ -1473,7 +1567,8 @@ int rt_ioctl_siwencode(struct net_device *dev,
pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0;
/* Check if the key is not marked as invalid */
- if(!(erq->flags & IW_ENCODE_NOKEY)) {
+ if(!(erq->flags & IW_ENCODE_NOKEY))
+ {
/* Copy the key in the driver */
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, extra, erq->length);
}
@@ -1488,10 +1583,9 @@ int rt_ioctl_siwencode(struct net_device *dev,
}
else
/* Don't complain if only change the mode */
- if (!(erq->flags & IW_ENCODE_MODE)) {
+ if (!(erq->flags & IW_ENCODE_MODE))
return -EINVAL;
}
- }
done:
DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::erq->flags=%x\n",erq->flags));
@@ -1506,8 +1600,10 @@ rt_ioctl_giwencode(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *erq, char *key)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
int kid;
+ PRTMP_ADAPTER pAdapter = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
@@ -1564,12 +1660,15 @@ static int
rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
- POS_COOKIE pObj = (POS_COOKIE)pAdapter->OS_Cookie;
- char *this_char = extra;
- char *value;
+ PRTMP_ADAPTER pAdapter;
+ POS_COOKIE pObj;
+ PSTRING this_char = extra;
+ PSTRING value;
int Status=0;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
+ pObj = (POS_COOKIE) pAdapter->OS_Cookie;
{
pObj->ioctl_if_type = INT_MAIN;
pObj->ioctl_if = MAIN_MBSSID;
@@ -1588,13 +1687,16 @@ rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
if ((value = rtstrchr(this_char, '=')) != NULL)
*value++ = 0;
- if (!value)
+ if (!value && (strcmp(this_char, "SiteSurvey") != 0))
return -EINVAL;
+ else
+ goto SET_PROC;
// reject setting nothing besides ANY ssid(ssidLen=0)
if (!*value && (strcmp(this_char, "SSID") != 0))
return -EINVAL;
+SET_PROC:
for (PRTMP_PRIVATE_SET_PROC = RTMP_PRIVATE_SUPPORT_PROC; PRTMP_PRIVATE_SET_PROC->name; PRTMP_PRIVATE_SET_PROC++)
{
if (strcmp(this_char, PRTMP_PRIVATE_SET_PROC->name) == 0)
@@ -1622,7 +1724,9 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
struct iw_point *wrq, char *extra)
{
INT Status = 0;
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, dev);
if (extra == NULL)
{
@@ -1655,6 +1759,8 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
}
sprintf(extra+strlen(extra), "WpaSupplicantUP = %d\n\n", pAd->StaCfg.WpaSupplicantUP);
+
+
wrq->length = strlen(extra) + 1; // 1: size of '\0'
DBGPRINT(RT_DEBUG_TRACE, ("<== rt_private_get_statistics, wrq->length = %d\n", wrq->length));
@@ -1663,7 +1769,7 @@ rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
void getBaInfo(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR pOutBuf)
+ IN PSTRING pOutBuf)
{
INT i, j;
BA_ORI_ENTRY *pOriBAEntry;
@@ -1710,13 +1816,16 @@ void getBaInfo(
static int
rt_private_show(struct net_device *dev, struct iw_request_info *info,
- struct iw_point *wrq, char *extra)
+ struct iw_point *wrq, PSTRING extra)
{
INT Status = 0;
- PRTMP_ADAPTER pAd = dev->ml_priv;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+ PRTMP_ADAPTER pAd;
+ POS_COOKIE pObj;
u32 subcmd = wrq->flags;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
+ pObj = (POS_COOKIE) pAd->OS_Cookie;
if (extra == NULL)
{
wrq->length = 0;
@@ -1785,9 +1894,11 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
case RAIO_OFF:
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
{
- sprintf(extra, "Scanning\n");
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
+ if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
+ {
+ RTMP_MLME_RESET_STATE_MACHINE(pAd);
+ DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
+ }
}
pAd->StaCfg.bSwRadio = FALSE;
if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
@@ -1804,14 +1915,6 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
wrq->length = strlen(extra) + 1; // 1: size of '\0'
break;
case RAIO_ON:
-#ifdef RT2870
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- sprintf(extra, "Scanning\n");
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
- }
-#endif
pAd->StaCfg.bSwRadio = TRUE;
//if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
{
@@ -1827,13 +1930,19 @@ rt_private_show(struct net_device *dev, struct iw_request_info *info,
wrq->length = strlen(extra) + 1; // 1: size of '\0'
break;
+
+
case SHOW_CFG_VALUE:
{
- Status = RTMPShowCfgValue(pAd, wrq->pointer, extra);
+ Status = RTMPShowCfgValue(pAd, (PSTRING) wrq->pointer, extra);
if (Status == 0)
wrq->length = strlen(extra) + 1; // 1: size of '\0'
}
break;
+ case SHOW_ADHOC_ENTRY_INFO:
+ Show_Adhoc_MacTable_Proc(pAd, extra);
+ wrq->length = strlen(extra) + 1; // 1: size of '\0'
+ break;
default:
DBGPRINT(RT_DEBUG_TRACE, ("%s - unknow subcmd = %d\n", __func__, subcmd));
break;
@@ -1847,12 +1956,14 @@ int rt_ioctl_siwmlme(struct net_device *dev,
union iwreq_data *wrqu,
char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer;
MLME_QUEUE_ELEM MsgElem;
MLME_DISASSOC_REQ_STRUCT DisAssocReq;
MLME_DEAUTH_REQ_STRUCT DeAuthReq;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
DBGPRINT(RT_DEBUG_TRACE, ("====> %s\n", __func__));
if (pMlme == NULL)
@@ -1902,9 +2013,11 @@ int rt_ioctl_siwauth(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
struct iw_param *param = &wrqu->param;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -1992,6 +2105,7 @@ int rt_ioctl_siwauth(struct net_device *dev,
}
else if (param->value == 0)
{
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
}
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __func__, param->value));
@@ -1999,6 +2113,14 @@ int rt_ioctl_siwauth(struct net_device *dev,
case IW_AUTH_RX_UNENCRYPTED_EAPOL:
break;
case IW_AUTH_PRIVACY_INVOKED:
+ /*if (param->value == 0)
+ {
+ pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
+ pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
+ pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
+ pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
+ pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
+ }*/
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __func__, param->value));
break;
case IW_AUTH_DROP_UNENCRYPTED:
@@ -2006,6 +2128,7 @@ int rt_ioctl_siwauth(struct net_device *dev,
pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
else
{
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
}
DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __func__, param->value));
@@ -2037,9 +2160,11 @@ int rt_ioctl_giwauth(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
struct iw_param *param = &wrqu->param;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -2074,21 +2199,6 @@ void fnSetCipherKey(
IN BOOLEAN bGTK,
IN struct iw_encode_ext *ext)
{
-#ifdef RT2860
- RTMP_CLEAR_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
- if (RTMP_TEST_PSFLAG(pAdapter, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND))
- {
- if (pAdapter->StaCfg.bRadio == FALSE)
- {
- RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
- return;
- }
- DBGPRINT(RT_DEBUG_TRACE,("RTMPWPAAddKeyProc1==>\n"));
- RTMPPCIeLinkCtrlValueRestore(pAdapter, RESTORE_HALT);
- RTMPusecDelay(6000);
- pAdapter->bPCIclkOff = FALSE;
- }
-#endif
NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
pAdapter->SharedKey[BSS0][keyIdx].KeyLen = LEN_TKIP_EK;
NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, LEN_TKIP_EK);
@@ -2119,9 +2229,6 @@ void fnSetCipherKey(
keyIdx,
pAdapter->SharedKey[BSS0][keyIdx].CipherAlg,
&pAdapter->MacTab.Content[BSSID_WCID]);
-#ifdef RT2860
- RTMP_SET_PSFLAG(pAdapter, fRTMP_PS_CAN_GO_SLEEP);
-#endif
}
int rt_ioctl_siwencodeext(struct net_device *dev,
@@ -2129,11 +2236,13 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
union iwreq_data *wrqu,
char *extra)
{
- PRTMP_ADAPTER pAdapter = dev->ml_priv;
+ PRTMP_ADAPTER pAdapter = NULL;
struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int keyIdx, alg = ext->alg;
+ GET_PAD_FROM_NET_DEV(pAdapter, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -2210,7 +2319,9 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, FALSE, ext);
if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
{
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
}
}
else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
@@ -2218,7 +2329,9 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, TRUE, ext);
// set 802.1x port control
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
}
}
else
@@ -2229,14 +2342,18 @@ int rt_ioctl_siwencodeext(struct net_device *dev,
{
fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, FALSE, ext);
if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
}
else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
{
fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, TRUE, ext);
// set 802.1x port control
+ //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
STA_PORT_SECURED(pAdapter);
+ pAdapter->IndicateMediaState = NdisMediaStateConnected;
}
break;
default:
@@ -2252,12 +2369,14 @@ rt_ioctl_giwencodeext(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
PCHAR pKey = NULL;
struct iw_point *encoding = &wrqu->encoding;
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
int idx, max_key_len;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
DBGPRINT(RT_DEBUG_TRACE ,("===> rt_ioctl_giwencodeext\n"));
max_key_len = encoding->length - sizeof(*ext);
@@ -2300,7 +2419,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
else
{
ext->key_len = pAd->SharedKey[BSS0][idx].KeyLen;
- pKey = &(pAd->SharedKey[BSS0][idx].Key[0]);
+ pKey = (PCHAR)&(pAd->SharedKey[BSS0][idx].Key[0]);
}
break;
case Ndis802_11Encryption2Enabled:
@@ -2315,7 +2434,7 @@ rt_ioctl_giwencodeext(struct net_device *dev,
else
{
ext->key_len = 32;
- pKey = &pAd->StaCfg.PMK[0];
+ pKey = (PCHAR)&pAd->StaCfg.PMK[0];
}
break;
default:
@@ -2335,8 +2454,12 @@ int rt_ioctl_siwgenie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
+ DBGPRINT(RT_DEBUG_TRACE ,("===> rt_ioctl_siwgenie\n"));
+ pAd->StaCfg.bRSN_IE_FromWpaSupplicant = FALSE;
if (wrqu->data.length > MAX_LEN_OF_RSNIE ||
(wrqu->data.length && extra == NULL))
return -EINVAL;
@@ -2345,6 +2468,7 @@ int rt_ioctl_siwgenie(struct net_device *dev,
{
pAd->StaCfg.RSNIE_Len = wrqu->data.length;
NdisMoveMemory(&pAd->StaCfg.RSN_IE[0], extra, pAd->StaCfg.RSNIE_Len);
+ pAd->StaCfg.bRSN_IE_FromWpaSupplicant = TRUE;
}
else
{
@@ -2359,7 +2483,9 @@ int rt_ioctl_giwgenie(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
+
+ GET_PAD_FROM_NET_DEV(pAd, dev);
if ((pAd->StaCfg.RSNIE_Len == 0) ||
(pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA))
@@ -2401,10 +2527,12 @@ int rt_ioctl_siwpmksa(struct net_device *dev,
union iwreq_data *wrqu,
char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
INT CachedIdx = 0, idx = 0;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
if (pPmksa == NULL)
return -EINVAL;
@@ -2475,9 +2603,11 @@ int rt_ioctl_siwrate(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
+ GET_PAD_FROM_NET_DEV(pAd, dev);
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -2529,9 +2659,10 @@ int rt_ioctl_giwrate(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrqu, char *extra)
{
- PRTMP_ADAPTER pAd = dev->ml_priv;
+ PRTMP_ADAPTER pAd = NULL;
int rate_index = 0, rate_count = 0;
HTTRANSMIT_SETTING ht_setting;
+/* Remove to global variable
__s32 ralinkrate[] =
{2, 4, 11, 22, // CCK
12, 18, 24, 36, 48, 72, 96, 108, // OFDM
@@ -2543,6 +2674,8 @@ int rt_ioctl_giwrate(struct net_device *dev,
43, 87, 130, 173, 260, 317, 390, 433, // 20MHz, 400ns GI, MCS: 16 ~ 23
30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, // 40MHz, 400ns GI, MCS: 0 ~ 15
90, 180, 270, 360, 540, 720, 810, 900}; // 40MHz, 400ns GI, MCS: 16 ~ 23
+*/
+ GET_PAD_FROM_NET_DEV(pAd, dev);
rate_count = sizeof(ralinkrate)/sizeof(__s32);
//check if the interface is down
@@ -2561,6 +2694,7 @@ int rt_ioctl_giwrate(struct net_device *dev,
if (ht_setting.field.MODE >= MODE_HTMIX)
{
+// rate_index = 12 + ((UCHAR)ht_setting.field.BW *16) + ((UCHAR)ht_setting.field.ShortGI *32) + ((UCHAR)ht_setting.field.MCS);
rate_index = 12 + ((UCHAR)ht_setting.field.BW *24) + ((UCHAR)ht_setting.field.ShortGI *48) + ((UCHAR)ht_setting.field.MCS);
}
else
@@ -2661,7 +2795,9 @@ static const iw_handler rt_priv_handlers[] = {
(iw_handler) rt_private_show, /* + 0x11 */
(iw_handler) NULL, /* + 0x12 */
(iw_handler) NULL, /* + 0x13 */
+ (iw_handler) NULL, /* + 0x14 */
(iw_handler) NULL, /* + 0x15 */
+ (iw_handler) NULL, /* + 0x16 */
(iw_handler) NULL, /* + 0x17 */
(iw_handler) NULL, /* + 0x18 */
};
@@ -2685,12 +2821,16 @@ INT rt28xx_sta_ioctl(
IN OUT struct ifreq *rq,
IN INT cmd)
{
- RTMP_ADAPTER *pAd = net_dev->ml_priv;
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
+ POS_COOKIE pObj;
+ RTMP_ADAPTER *pAd = NULL;
struct iwreq *wrq = (struct iwreq *) rq;
BOOLEAN StateMachineTouched = FALSE;
INT Status = NDIS_STATUS_SUCCESS;
+ GET_PAD_FROM_NET_DEV(pAd, net_dev);
+
+ pObj = (POS_COOKIE) pAd->OS_Cookie;
+
//check if the interface is down
if(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
{
@@ -2747,14 +2887,16 @@ INT rt28xx_sta_ioctl(
}
case SIOCSIWNICKN: //set node name/nickname
{
- struct iw_point *data=&wrq->u.data;
- rt_ioctl_siwnickn(net_dev, NULL, data, NULL);
+ //struct iw_point *data=&wrq->u.data;
+ //rt_ioctl_siwnickn(net_dev, NULL, data, NULL);
break;
}
case SIOCGIWNICKN: //get node name/nickname
{
- struct iw_point *data=&wrq->u.data;
- rt_ioctl_giwnickn(net_dev, NULL, data, NULL);
+ struct iw_point *erq = NULL;
+ erq = &wrq->u.data;
+ erq->length = strlen((PSTRING) pAd->nickname);
+ Status = copy_to_user(erq->pointer, pAd->nickname, erq->length);
break;
}
case SIOCGIWRATE: //get default bit rate (bps)
@@ -2790,14 +2932,14 @@ INT rt28xx_sta_ioctl(
case SIOCGIWENCODE: //get encoding token & mode
{
struct iw_point *erq=&wrq->u.encoding;
- if(erq->pointer)
+ if(erq)
rt_ioctl_giwencode(net_dev, NULL, erq, erq->pointer);
break;
}
case SIOCSIWENCODE: //set encoding token & mode
{
struct iw_point *erq=&wrq->u.encoding;
- if(erq->pointer)
+ if(erq)
rt_ioctl_siwencode(net_dev, NULL, erq, erq->pointer);
break;
}
@@ -2865,7 +3007,7 @@ INT rt28xx_sta_ioctl(
}
if(StateMachineTouched) // Upper layer sent a MLME-related operations
- RT28XX_MLME_HANDLER(pAd);
+ RTMP_MLME_HANDLER(pAd);
return Status;
}
@@ -2880,7 +3022,7 @@ INT rt28xx_sta_ioctl(
*/
INT Set_SSID_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
NDIS_802_11_SSID Ssid, *pSsid=NULL;
BOOLEAN StateMachineTouched = FALSE;
@@ -2906,10 +3048,29 @@ INT Set_SSID_Proc(
if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
{
- RT28XX_MLME_RESET_STATE_MACHINE(pAdapter);
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
}
+ if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) &&
+ (pAdapter->StaCfg.WpaPassPhraseLen <= 64))
+ {
+ STRING passphrase_str[65] = {0};
+ UCHAR keyMaterial[40];
+
+ RTMPMoveMemory(passphrase_str, pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.WpaPassPhraseLen);
+ RTMPZeroMemory(pAdapter->StaCfg.PMK, 32);
+ if (pAdapter->StaCfg.WpaPassPhraseLen == 64)
+ {
+ AtoH((PSTRING) pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.PMK, 32);
+ }
+ else
+ {
+ PasswordHash((PSTRING) pAdapter->StaCfg.WpaPassPhrase, Ssid.Ssid, Ssid.SsidLength, keyMaterial);
+ NdisMoveMemory(pAdapter->StaCfg.PMK, keyMaterial, 32);
+ }
+ }
+
pAdapter->MlmeAux.CurrReqIsFromNdis = TRUE;
pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
pAdapter->bConfigChanged = TRUE;
@@ -2927,7 +3088,7 @@ INT Set_SSID_Proc(
success = FALSE;
if (StateMachineTouched) // Upper layer sent a MLME-related operations
- RT28XX_MLME_HANDLER(pAdapter);
+ RTMP_MLME_HANDLER(pAdapter);
return success;
}
@@ -2943,16 +3104,16 @@ INT Set_SSID_Proc(
*/
INT Set_WmmCapable_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
BOOLEAN bWmmCapable;
bWmmCapable = simple_strtol(arg, 0, 10);
if ((bWmmCapable == 1)
-#ifdef RT2870
+#ifdef RTMP_MAC_USB
&& (pAd->NumberOfPipes >= 5)
-#endif // RT2870 //
+#endif // RTMP_MAC_USB //
)
pAd->CommonCfg.bWmmCapable = TRUE;
else if (bWmmCapable == 0)
@@ -2977,7 +3138,7 @@ INT Set_WmmCapable_Proc(
*/
INT Set_NetworkType_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
UINT32 Value = 0;
@@ -3043,8 +3204,6 @@ INT Set_NetworkType_Proc(
pAdapter->StaCfg.BssType = BSS_INFRA;
pAdapter->net_dev->type = pAdapter->StaCfg.OriDevType;
DBGPRINT(RT_DEBUG_TRACE, ("===>Set_NetworkType_Proc::(INFRA)\n"));
-
- pAdapter->StaCfg.BssType = BSS_INFRA;
}
else if (strcmp(arg, "Monitor") == 0)
{
@@ -3056,7 +3215,7 @@ INT Set_NetworkType_Proc(
// disable all periodic state machine
pAdapter->StaCfg.bAutoReconnect = FALSE;
// reset all mlme state machine
- RT28XX_MLME_RESET_STATE_MACHINE(pAdapter);
+ RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
DBGPRINT(RT_DEBUG_TRACE, ("fOP_STATUS_MEDIA_STATE_CONNECTED \n"));
if (pAdapter->CommonCfg.CentralChannel == 0)
{
@@ -3164,7 +3323,7 @@ INT Set_NetworkType_Proc(
*/
INT Set_AuthMode_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
if ((strcmp(arg, "WEPAUTO") == 0) || (strcmp(arg, "wepauto") == 0))
pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeAutoSwitch;
@@ -3202,7 +3361,7 @@ INT Set_AuthMode_Proc(
*/
INT Set_EncrypType_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
if ((strcmp(arg, "NONE") == 0) || (strcmp(arg, "none") == 0))
{
@@ -3260,7 +3419,7 @@ INT Set_EncrypType_Proc(
*/
INT Set_DefaultKeyID_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
ULONG KeyIdx;
@@ -3285,7 +3444,7 @@ INT Set_DefaultKeyID_Proc(
*/
INT Set_Key1_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
int KeyLen;
int i;
@@ -3366,7 +3525,7 @@ INT Set_Key1_Proc(
*/
INT Set_Key2_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
int KeyLen;
int i;
@@ -3445,7 +3604,7 @@ INT Set_Key2_Proc(
*/
INT Set_Key3_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
int KeyLen;
int i;
@@ -3524,7 +3683,7 @@ INT Set_Key3_Proc(
*/
INT Set_Key4_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
int KeyLen;
int i;
@@ -3603,50 +3762,40 @@ INT Set_Key4_Proc(
==========================================================================
*/
INT Set_WPAPSK_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
{
- UCHAR keyMaterial[40];
+ int status;
- if ((pAdapter->StaCfg.AuthMode != Ndis802_11AuthModeWPAPSK) &&
- (pAdapter->StaCfg.AuthMode != Ndis802_11AuthModeWPA2PSK) &&
- (pAdapter->StaCfg.AuthMode != Ndis802_11AuthModeWPANone)
+ if ((pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPAPSK) &&
+ (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPA2PSK) &&
+ (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPANone)
)
return TRUE; // do nothing
DBGPRINT(RT_DEBUG_TRACE, ("Set_WPAPSK_Proc::(WPAPSK=%s)\n", arg));
- NdisZeroMemory(keyMaterial, 40);
-
- if ((strlen(arg) < 8) || (strlen(arg) > 64))
+ status = RT_CfgSetWPAPSKKey(pAd, arg, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, pAd->StaCfg.PMK);
+ if (status == FALSE)
{
- DBGPRINT(RT_DEBUG_TRACE, ("Set failed!!(WPAPSK=%s), WPAPSK key-string required 8 ~ 64 characters \n", arg));
+ DBGPRINT(RT_DEBUG_TRACE, ("Set_WPAPSK_Proc(): Set key failed!\n"));
return FALSE;
}
-
- if (strlen(arg) == 64)
- {
- AtoH(arg, keyMaterial, 32);
- NdisMoveMemory(pAdapter->StaCfg.PMK, keyMaterial, 32);
-
- }
- else
- {
- PasswordHash((char *)arg, pAdapter->MlmeAux.Ssid, pAdapter->MlmeAux.SsidLen, keyMaterial);
- NdisMoveMemory(pAdapter->StaCfg.PMK, keyMaterial, 32);
- }
+ NdisZeroMemory(pAd->StaCfg.WpaPassPhrase, 64);
+ NdisMoveMemory(pAd->StaCfg.WpaPassPhrase, arg, strlen(arg));
+ pAd->StaCfg.WpaPassPhraseLen = (UINT)strlen(arg);
- if(pAdapter->StaCfg.BssType == BSS_ADHOC &&
- pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
+ if(pAd->StaCfg.BssType == BSS_ADHOC &&
+ pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
{
- pAdapter->StaCfg.WpaState = SS_NOTUSE;
+ pAd->StaCfg.WpaState = SS_NOTUSE;
}
else
{
// Start STA supplicant state machine
- pAdapter->StaCfg.WpaState = SS_START;
+ pAd->StaCfg.WpaState = SS_START;
}
return TRUE;
@@ -3662,7 +3811,7 @@ INT Set_WPAPSK_Proc(
*/
INT Set_PSMode_Proc(
IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
if (pAdapter->StaCfg.BssType == BSS_INFRA)
{
@@ -3670,7 +3819,7 @@ INT Set_PSMode_Proc(
(strcmp(arg, "max_psp") == 0) ||
(strcmp(arg, "MAX_PSP") == 0))
{
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
+ // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
// to exclude certain situations.
if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeMAX_PSP;
@@ -3683,7 +3832,7 @@ INT Set_PSMode_Proc(
(strcmp(arg, "fast_psp") == 0) ||
(strcmp(arg, "FAST_PSP") == 0))
{
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
+ // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
// to exclude certain situations.
OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
@@ -3695,7 +3844,7 @@ INT Set_PSMode_Proc(
(strcmp(arg, "legacy_psp") == 0) ||
(strcmp(arg, "LEGACY_PSP") == 0))
{
- // do NOT turn on PSM bit here, wait until MlmeCheckForPsmChange()
+ // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
// to exclude certain situations.
OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
@@ -3707,7 +3856,7 @@ INT Set_PSMode_Proc(
{
//Default Ndis802_11PowerModeCAM
// clear PSM bit immediately
- MlmeSetPsmBit(pAdapter, PWR_ACTIVE);
+ RTMP_SET_PSM_BIT(pAdapter, PWR_ACTIVE);
OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeCAM;
@@ -3737,7 +3886,7 @@ INT Set_PSMode_Proc(
*/
INT Set_Wpa_Support(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
if ( simple_strtol(arg, 0, 10) == 0)
@@ -3756,7 +3905,7 @@ INT Set_Wpa_Support(
INT Set_TGnWifiTest_Proc(
IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
+ IN PSTRING arg)
{
if (simple_strtol(arg, 0, 10) == 0)
pAd->StaCfg.bTGnWifiTest = FALSE;
@@ -3767,30 +3916,161 @@ INT Set_TGnWifiTest_Proc(
return TRUE;
}
-INT Set_LongRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+
+
+
+INT Show_Adhoc_MacTable_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING extra)
{
- TX_RTY_CFG_STRUC tx_rty_cfg;
- UCHAR LongRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
+ INT i;
+
+ sprintf(extra, "\n");
+
+ sprintf(extra + strlen(extra), "HT Operating Mode : %d\n", pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode);
+
+ sprintf(extra + strlen(extra), "\n%-19s%-4s%-4s%-7s%-7s%-7s%-10s%-6s%-6s%-6s%-6s\n",
+ "MAC", "AID", "BSS", "RSSI0", "RSSI1", "RSSI2", "PhMd", "BW", "MCS", "SGI", "STBC");
+
+ for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
+ {
+ PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[i];
+
+ if (strlen(extra) > (IW_PRIV_SIZE_MASK - 30))
+ break;
+ if ((pEntry->ValidAsCLI || pEntry->ValidAsApCli) && (pEntry->Sst == SST_ASSOC))
+ {
+ sprintf(extra + strlen(extra), "%02X:%02X:%02X:%02X:%02X:%02X ",
+ pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2],
+ pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]);
+ sprintf(extra + strlen(extra), "%-4d", (int)pEntry->Aid);
+ sprintf(extra + strlen(extra), "%-4d", (int)pEntry->apidx);
+ sprintf(extra + strlen(extra), "%-7d", pEntry->RssiSample.AvgRssi0);
+ sprintf(extra + strlen(extra), "%-7d", pEntry->RssiSample.AvgRssi1);
+ sprintf(extra + strlen(extra), "%-7d", pEntry->RssiSample.AvgRssi2);
+ sprintf(extra + strlen(extra), "%-10s", GetPhyMode(pEntry->HTPhyMode.field.MODE));
+ sprintf(extra + strlen(extra), "%-6s", GetBW(pEntry->HTPhyMode.field.BW));
+ sprintf(extra + strlen(extra), "%-6d", pEntry->HTPhyMode.field.MCS);
+ sprintf(extra + strlen(extra), "%-6d", pEntry->HTPhyMode.field.ShortGI);
+ sprintf(extra + strlen(extra), "%-6d", pEntry->HTPhyMode.field.STBC);
+ sprintf(extra + strlen(extra), "%-10d, %d, %d%%\n", pEntry->DebugFIFOCount, pEntry->DebugTxCount,
+ (pEntry->DebugTxCount) ? ((pEntry->DebugTxCount-pEntry->DebugFIFOCount)*100/pEntry->DebugTxCount) : 0);
+ sprintf(extra, "%s\n", extra);
+ }
+ }
- RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.LongRtyLimit = LongRetryLimit;
- RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_LongRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
return TRUE;
}
-INT Set_ShortRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR arg)
+
+INT Set_BeaconLostTime_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
+{
+ ULONG ltmp = (ULONG)simple_strtol(arg, 0, 10);
+
+ if ((ltmp != 0) && (ltmp <= 60))
+ pAd->StaCfg.BeaconLostTime = (ltmp * OS_HZ);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("IF Set_BeaconLostTime_Proc::(BeaconLostTime=%ld)\n", pAd->StaCfg.BeaconLostTime));
+ return TRUE;
+}
+
+INT Set_AutoRoaming_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
+{
+ if (simple_strtol(arg, 0, 10) == 0)
+ pAd->StaCfg.bAutoRoaming = FALSE;
+ else
+ pAd->StaCfg.bAutoRoaming = TRUE;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("IF Set_AutoRoaming_Proc::(bAutoRoaming=%d)\n", pAd->StaCfg.bAutoRoaming));
+ return TRUE;
+}
+
+
+/*
+ ==========================================================================
+ Description:
+ Issue a site survey command to driver
+ Arguments:
+ pAdapter Pointer to our adapter
+ wrq Pointer to the ioctl argument
+
+ Return Value:
+ None
+
+ Note:
+ Usage:
+ 1.) iwpriv ra0 set site_survey
+ ==========================================================================
+*/
+INT Set_SiteSurvey_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
{
- TX_RTY_CFG_STRUC tx_rty_cfg;
- UCHAR ShortRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
+ NDIS_802_11_SSID Ssid;
+
+ //check if the interface is down
+ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
+ return -ENETDOWN;
+ }
+
+ if (MONITOR_ON(pAd))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is in Monitor Mode now !!!\n"));
+ return -EINVAL;
+ }
+
+ RTMPZeroMemory(&Ssid, sizeof(NDIS_802_11_SSID));
+ Ssid.SsidLength = 0;
+ if ((arg != NULL) &&
+ (strlen(arg) <= MAX_LEN_OF_SSID))
+ {
+ RTMPMoveMemory(Ssid.Ssid, arg, strlen(arg));
+ Ssid.SsidLength = strlen(arg);
+ }
+
+ pAd->StaCfg.bScanReqIsFromWebUI = TRUE;
+
+ if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
+ {
+ RTMP_MLME_RESET_STATE_MACHINE(pAd);
+ DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
+ }
+
+ // tell CNTL state machine to call NdisMSetInformationComplete() after completing
+ // this request, because this request is initiated by NDIS.
+ pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
+ // Reset allowed scan retries
+ pAd->StaCfg.ScanCnt = 0;
+ NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
+
+ MlmeEnqueue(pAd,
+ MLME_CNTL_STATE_MACHINE,
+ OID_802_11_BSSID_LIST_SCAN,
+ Ssid.SsidLength,
+ Ssid.Ssid);
+
+ RTMP_MLME_HANDLER(pAd);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("Set_SiteSurvey_Proc\n"));
+
+ return TRUE;
+}
+
+INT Set_ForceTxBurst_Proc(
+ IN PRTMP_ADAPTER pAd,
+ IN PSTRING arg)
+{
+ if (simple_strtol(arg, 0, 10) == 0)
+ pAd->StaCfg.bForceTxBurst = FALSE;
+ else
+ pAd->StaCfg.bForceTxBurst = TRUE;
- RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.ShortRtyLimit = ShortRetryLimit;
- RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_ShortRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
+ DBGPRINT(RT_DEBUG_TRACE, ("IF Set_ForceTxBurst_Proc::(bForceTxBurst=%d)\n", pAd->StaCfg.bForceTxBurst));
return TRUE;
}
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c
new file mode 100644
index 000000000000..16e1bbfce435
--- /dev/null
+++ b/drivers/staging/rt2860/usb_main_dev.c
@@ -0,0 +1,897 @@
+/*
+ *************************************************************************
+ * Ralink Tech Inc.
+ * 5F., No.36, Taiyuan St., Jhubei City,
+ * Hsinchu County 302,
+ * Taiwan, R.O.C.
+ *
+ * (c) Copyright 2002-2007, Ralink Technology, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * *
+ *************************************************************************/
+
+#include "rt_config.h"
+
+
+// Following information will be show when you run 'modinfo'
+// *** If you have a solution for the bug in current version of driver, please mail to me.
+// Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. ***
+MODULE_AUTHOR("Paul Lin <paul_lin@ralinktech.com>");
+MODULE_DESCRIPTION("RT2870/RT3070 Wireless Lan Linux Driver");
+MODULE_LICENSE("GPL");
+#ifdef MODULE_VERSION
+MODULE_VERSION(STA_DRIVER_VERSION);
+#endif
+
+
+/* module table */
+struct usb_device_id rtusb_usb_id[] = {
+#ifdef RT2870
+ {USB_DEVICE(0x148F,0x2770)}, /* Ralink */
+ {USB_DEVICE(0x148F,0x2870)}, /* Ralink */
+ {USB_DEVICE(0x07B8,0x2870)}, /* AboCom */
+ {USB_DEVICE(0x07B8,0x2770)}, /* AboCom */
+ {USB_DEVICE(0x0DF6,0x0039)}, /* Sitecom 2770 */
+ {USB_DEVICE(0x083A,0x7512)}, /* Arcadyan 2770 */
+ {USB_DEVICE(0x0789,0x0162)}, /* Logitec 2870 */
+ {USB_DEVICE(0x0789,0x0163)}, /* Logitec 2870 */
+ {USB_DEVICE(0x0789,0x0164)}, /* Logitec 2870 */
+ {USB_DEVICE(0x177f,0x0302)}, /* lsusb */
+ {USB_DEVICE(0x0B05,0x1731)}, /* Asus */
+ {USB_DEVICE(0x0B05,0x1732)}, /* Asus */
+ {USB_DEVICE(0x0B05,0x1742)}, /* Asus */
+ {USB_DEVICE(0x0DF6,0x0017)}, /* Sitecom */
+ {USB_DEVICE(0x0DF6,0x002B)}, /* Sitecom */
+ {USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */
+ {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */
+ {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */
+ {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */
+ {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */
+ {USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */
+ {USB_DEVICE(0x07D1,0x3C11)}, /* D-Link */
+ {USB_DEVICE(0x14B2,0x3C07)}, /* AL */
+ {USB_DEVICE(0x050D,0x8053)}, /* Belkin */
+ {USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */
+ {USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */
+ {USB_DEVICE(0x07AA,0x002F)}, /* Corega */
+ {USB_DEVICE(0x07AA,0x003C)}, /* Corega */
+ {USB_DEVICE(0x07AA,0x003F)}, /* Corega */
+ {USB_DEVICE(0x1044,0x800B)}, /* Gigabyte */
+ {USB_DEVICE(0x15A9,0x0006)}, /* Sparklan */
+ {USB_DEVICE(0x083A,0xB522)}, /* SMC */
+ {USB_DEVICE(0x083A,0xA618)}, /* SMC */
+ {USB_DEVICE(0x083A,0x8522)}, /* Arcadyan */
+ {USB_DEVICE(0x083A,0x7522)}, /* Arcadyan */
+ {USB_DEVICE(0x0CDE,0x0022)}, /* ZCOM */
+ {USB_DEVICE(0x0586,0x3416)}, /* Zyxel */
+ {USB_DEVICE(0x0CDE,0x0025)}, /* Zyxel */
+ {USB_DEVICE(0x1740,0x9701)}, /* EnGenius */
+ {USB_DEVICE(0x1740,0x9702)}, /* EnGenius */
+ {USB_DEVICE(0x0471,0x200f)}, /* Philips */
+ {USB_DEVICE(0x14B2,0x3C25)}, /* Draytek */
+ {USB_DEVICE(0x13D3,0x3247)}, /* AzureWave */
+ {USB_DEVICE(0x083A,0x6618)}, /* Accton */
+ {USB_DEVICE(0x15c5,0x0008)}, /* Amit */
+ {USB_DEVICE(0x0E66,0x0001)}, /* Hawking */
+ {USB_DEVICE(0x0E66,0x0003)}, /* Hawking */
+ {USB_DEVICE(0x129B,0x1828)}, /* Siemens */
+ {USB_DEVICE(0x157E,0x300E)}, /* U-Media */
+ {USB_DEVICE(0x050d,0x805c)},
+ {USB_DEVICE(0x050d,0x815c)},
+ {USB_DEVICE(0x1482,0x3C09)}, /* Abocom*/
+ {USB_DEVICE(0x14B2,0x3C09)}, /* Alpha */
+ {USB_DEVICE(0x04E8,0x2018)}, /* samsung */
+ {USB_DEVICE(0x5A57,0x0280)}, /* Zinwell */
+ {USB_DEVICE(0x5A57,0x0282)}, /* Zinwell */
+ {USB_DEVICE(0x7392,0x7718)},
+ {USB_DEVICE(0x7392,0x7717)},
+ {USB_DEVICE(0x1737,0x0070)}, /* Linksys WUSB100 */
+ {USB_DEVICE(0x1737,0x0071)}, /* Linksys WUSB600N */
+ {USB_DEVICE(0x0411,0x00e8)}, /* Buffalo WLI-UC-G300N*/
+ {USB_DEVICE(0x050d,0x815c)}, /* Belkin F5D8053 */
+#endif // RT2870 //
+#ifdef RT3070
+ {USB_DEVICE(0x148F,0x3070)}, /* Ralink 3070 */
+ {USB_DEVICE(0x148F,0x3071)}, /* Ralink 3071 */
+ {USB_DEVICE(0x148F,0x3072)}, /* Ralink 3072 */
+ {USB_DEVICE(0x0DB0,0x3820)}, /* Ralink 3070 */
+ {USB_DEVICE(0x0DF6,0x003E)}, /* Sitecom 3070 */
+ {USB_DEVICE(0x0DF6,0x0042)}, /* Sitecom 3072 */
+ {USB_DEVICE(0x14B2,0x3C12)}, /* AL 3070 */
+ {USB_DEVICE(0x18C5,0x0012)}, /* Corega 3070 */
+ {USB_DEVICE(0x083A,0x7511)}, /* Arcadyan 3070 */
+ {USB_DEVICE(0x1740,0x9703)}, /* EnGenius 3070 */
+ {USB_DEVICE(0x1740,0x9705)}, /* EnGenius 3071 */
+ {USB_DEVICE(0x1740,0x9706)}, /* EnGenius 3072 */
+ {USB_DEVICE(0x13D3,0x3273)}, /* AzureWave 3070*/
+ {USB_DEVICE(0x1044,0x800D)}, /* Gigabyte GN-WB32L 3070 */
+ {USB_DEVICE(0x2019,0xAB25)}, /* Planex Communications, Inc. RT3070 */
+ {USB_DEVICE(0x07B8,0x3070)}, /* AboCom 3070 */
+ {USB_DEVICE(0x07B8,0x3071)}, /* AboCom 3071 */
+ {USB_DEVICE(0x07B8,0x3072)}, /* Abocom 3072 */
+ {USB_DEVICE(0x7392,0x7711)}, /* Edimax 3070 */
+ {USB_DEVICE(0x1A32,0x0304)}, /* Quanta 3070 */
+ {USB_DEVICE(0x1EDA,0x2310)}, /* AirTies 3070 */
+ {USB_DEVICE(0x07D1,0x3C0A)}, /* D-Link 3072 */
+ {USB_DEVICE(0x07D1,0x3C0D)}, /* D-Link 3070 */
+ {USB_DEVICE(0x07D1,0x3C0E)}, /* D-Link 3070 */
+ {USB_DEVICE(0x07D1,0x3C0F)}, /* D-Link 3070 */
+ {USB_DEVICE(0x1D4D,0x000C)}, /* Pegatron Corporation 3070 */
+ {USB_DEVICE(0x1D4D,0x000E)}, /* Pegatron Corporation 3070 */
+ {USB_DEVICE(0x5A57,0x5257)}, /* Zinwell 3070 */
+ {USB_DEVICE(0x5A57,0x0283)}, /* Zinwell 3072 */
+ {USB_DEVICE(0x04BB,0x0945)}, /* I-O DATA 3072 */
+ {USB_DEVICE(0x203D,0x1480)}, /* Encore 3070 */
+#endif // RT3070 //
+ { USB_DEVICE(0x0DF6, 0x003F) }, /* Sitecom WL-608 */
+ { USB_DEVICE(0x1737, 0x0077) }, /* Linksys WUSB54GC-EU v3 */
+ { USB_DEVICE(0x2001, 0x3C09) }, /* D-Link */
+ { USB_DEVICE(0x2001, 0x3C0A) }, /* D-Link 3072*/
+ { USB_DEVICE(0x2019, 0xED14) }, /* Planex Communications, Inc. */
+ { }/* Terminating entry */
+};
+
+INT const rtusb_usb_id_len = sizeof(rtusb_usb_id) / sizeof(struct usb_device_id);
+
+MODULE_DEVICE_TABLE(usb, rtusb_usb_id);
+
+static void rt2870_disconnect(
+ IN struct usb_device *dev,
+ IN PRTMP_ADAPTER pAd);
+
+static int __devinit rt2870_probe(
+ IN struct usb_interface *intf,
+ IN struct usb_device *usb_dev,
+ IN const struct usb_device_id *dev_id,
+ IN RTMP_ADAPTER **ppAd);
+
+#ifndef PF_NOFREEZE
+#define PF_NOFREEZE 0
+#endif
+
+
+extern int rt28xx_close(IN struct net_device *net_dev);
+extern int rt28xx_open(struct net_device *net_dev);
+
+static BOOLEAN USBDevConfigInit(
+ IN struct usb_device *dev,
+ IN struct usb_interface *intf,
+ IN RTMP_ADAPTER *pAd);
+
+
+/*
+========================================================================
+Routine Description:
+ Check the chipset vendor/product ID.
+
+Arguments:
+ _dev_p Point to the PCI or USB device
+
+Return Value:
+ TRUE Check ok
+ FALSE Check fail
+
+Note:
+========================================================================
+*/
+BOOLEAN RT28XXChipsetCheck(
+ IN void *_dev_p)
+{
+ struct usb_interface *intf = (struct usb_interface *)_dev_p;
+ struct usb_device *dev_p = interface_to_usbdev(intf);
+ UINT32 i;
+
+
+ for(i=0; i<rtusb_usb_id_len; i++)
+ {
+ if (dev_p->descriptor.idVendor == rtusb_usb_id[i].idVendor &&
+ dev_p->descriptor.idProduct == rtusb_usb_id[i].idProduct)
+ {
+ printk("rt2870: idVendor = 0x%x, idProduct = 0x%x\n",
+ dev_p->descriptor.idVendor, dev_p->descriptor.idProduct);
+ break;
+ }
+ }
+
+ if (i == rtusb_usb_id_len)
+ {
+ printk("rt2870: Error! Device Descriptor not matching!\n");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/**************************************************************************/
+/**************************************************************************/
+//tested for kernel 2.6series
+/**************************************************************************/
+/**************************************************************************/
+
+#ifdef CONFIG_PM
+static int rt2870_suspend(struct usb_interface *intf, pm_message_t state);
+static int rt2870_resume(struct usb_interface *intf);
+#endif // CONFIG_PM //
+
+static int rtusb_probe (struct usb_interface *intf,
+ const struct usb_device_id *id);
+static void rtusb_disconnect(struct usb_interface *intf);
+
+static BOOLEAN USBDevConfigInit(
+ IN struct usb_device *dev,
+ IN struct usb_interface *intf,
+ IN RTMP_ADAPTER *pAd)
+{
+ struct usb_host_interface *iface_desc;
+ ULONG BulkOutIdx;
+ UINT32 i;
+
+
+ /* get the active interface descriptor */
+ iface_desc = intf->cur_altsetting;
+
+ /* get # of enpoints */
+ pAd->NumberOfPipes = iface_desc->desc.bNumEndpoints;
+ DBGPRINT(RT_DEBUG_TRACE, ("NumEndpoints=%d\n", iface_desc->desc.bNumEndpoints));
+
+ /* Configure Pipes */
+ BulkOutIdx = 0;
+
+ for(i=0; i<pAd->NumberOfPipes; i++)
+ {
+ if ((iface_desc->endpoint[i].desc.bmAttributes ==
+ USB_ENDPOINT_XFER_BULK) &&
+ ((iface_desc->endpoint[i].desc.bEndpointAddress &
+ USB_ENDPOINT_DIR_MASK) == USB_DIR_IN))
+ {
+ pAd->BulkInEpAddr = iface_desc->endpoint[i].desc.bEndpointAddress;
+ pAd->BulkInMaxPacketSize = le2cpu16(iface_desc->endpoint[i].desc.wMaxPacketSize);
+
+ DBGPRINT_RAW(RT_DEBUG_TRACE, ("BULK IN MaxPacketSize = %d\n", pAd->BulkInMaxPacketSize));
+ DBGPRINT_RAW(RT_DEBUG_TRACE, ("EP address = 0x%2x\n", iface_desc->endpoint[i].desc.bEndpointAddress));
+ }
+ else if ((iface_desc->endpoint[i].desc.bmAttributes ==
+ USB_ENDPOINT_XFER_BULK) &&
+ ((iface_desc->endpoint[i].desc.bEndpointAddress &
+ USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT))
+ {
+ // there are 6 bulk out EP. EP6 highest priority.
+ // EP1-4 is EDCA. EP5 is HCCA.
+ pAd->BulkOutEpAddr[BulkOutIdx++] = iface_desc->endpoint[i].desc.bEndpointAddress;
+ pAd->BulkOutMaxPacketSize = le2cpu16(iface_desc->endpoint[i].desc.wMaxPacketSize);
+
+ DBGPRINT_RAW(RT_DEBUG_TRACE, ("BULK OUT MaxPacketSize = %d\n", pAd->BulkOutMaxPacketSize));
+ DBGPRINT_RAW(RT_DEBUG_TRACE, ("EP address = 0x%2x \n", iface_desc->endpoint[i].desc.bEndpointAddress));
+ }
+ }
+
+ if (!(pAd->BulkInEpAddr && pAd->BulkOutEpAddr[0]))
+ {
+ printk("%s: Could not find both bulk-in and bulk-out endpoints\n", __FUNCTION__);
+ return FALSE;
+ }
+
+ pAd->config = &dev->config->desc;
+ usb_set_intfdata(intf, pAd);
+
+ return TRUE;
+
+}
+
+
+
+static int rtusb_probe (struct usb_interface *intf,
+ const struct usb_device_id *id)
+{
+ RTMP_ADAPTER *pAd;
+ struct usb_device *dev;
+ int rv;
+
+ dev = interface_to_usbdev(intf);
+ dev = usb_get_dev(dev);
+
+ rv = rt2870_probe(intf, dev, id, &pAd);
+ if (rv != 0)
+ usb_put_dev(dev);
+
+ return rv;
+}
+
+
+static void rtusb_disconnect(struct usb_interface *intf)
+{
+ struct usb_device *dev = interface_to_usbdev(intf);
+ PRTMP_ADAPTER pAd;
+
+
+ pAd = usb_get_intfdata(intf);
+ usb_set_intfdata(intf, NULL);
+
+ rt2870_disconnect(dev, pAd);
+}
+
+
+struct usb_driver rtusb_driver = {
+ .name="rt2870",
+ .probe=rtusb_probe,
+ .disconnect=rtusb_disconnect,
+ .id_table=rtusb_usb_id,
+
+#ifdef CONFIG_PM
+ suspend: rt2870_suspend,
+ resume: rt2870_resume,
+#endif
+ };
+
+#ifdef CONFIG_PM
+
+VOID RT2870RejectPendingPackets(
+ IN PRTMP_ADAPTER pAd)
+{
+ // clear PS packets
+ // clear TxSw packets
+}
+
+static int rt2870_suspend(
+ struct usb_interface *intf,
+ pm_message_t state)
+{
+ struct net_device *net_dev;
+ PRTMP_ADAPTER pAd = usb_get_intfdata(intf);
+
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> rt2870_suspend()\n"));
+ net_dev = pAd->net_dev;
+ netif_device_detach(net_dev);
+
+ pAd->PM_FlgSuspend = 1;
+ if (netif_running(net_dev)) {
+ RTUSBCancelPendingBulkInIRP(pAd);
+ RTUSBCancelPendingBulkOutIRP(pAd);
+ }
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2870_suspend()\n"));
+ return 0;
+}
+
+static int rt2870_resume(
+ struct usb_interface *intf)
+{
+ struct net_device *net_dev;
+ PRTMP_ADAPTER pAd = usb_get_intfdata(intf);
+
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===> rt2870_resume()\n"));
+
+ pAd->PM_FlgSuspend = 0;
+ net_dev = pAd->net_dev;
+ netif_device_attach(net_dev);
+ netif_start_queue(net_dev);
+ netif_carrier_on(net_dev);
+ netif_wake_queue(net_dev);
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2870_resume()\n"));
+ return 0;
+}
+#endif // CONFIG_PM //
+
+// Init driver module
+INT __init rtusb_init(void)
+{
+ printk("rtusb init --->\n");
+ return usb_register(&rtusb_driver);
+}
+
+// Deinit driver module
+VOID __exit rtusb_exit(void)
+{
+ usb_deregister(&rtusb_driver);
+ printk("<--- rtusb exit\n");
+}
+
+module_init(rtusb_init);
+module_exit(rtusb_exit);
+
+
+
+
+/*--------------------------------------------------------------------- */
+/* function declarations */
+/*--------------------------------------------------------------------- */
+
+/*
+========================================================================
+Routine Description:
+ MLME kernel thread.
+
+Arguments:
+ *Context the pAd, driver control block pointer
+
+Return Value:
+ 0 close the thread
+
+Note:
+========================================================================
+*/
+INT MlmeThread(
+ IN void *Context)
+{
+ RTMP_ADAPTER *pAd;
+ RTMP_OS_TASK *pTask;
+ int status;
+ status = 0;
+
+ pTask = (RTMP_OS_TASK *)Context;
+ pAd = (PRTMP_ADAPTER)pTask->priv;
+
+ RtmpOSTaskCustomize(pTask);
+
+ while(!pTask->task_killed)
+ {
+#ifdef KTHREAD_SUPPORT
+ RTMP_WAIT_EVENT_INTERRUPTIBLE(pAd, pTask);
+#else
+ RTMP_SEM_EVENT_WAIT(&(pTask->taskSema), status);
+
+ /* unlock the device pointers */
+ if (status != 0)
+ {
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
+ break;
+ }
+#endif
+
+ /* lock the device pointers , need to check if required*/
+ //down(&(pAd->usbdev_semaphore));
+
+ if (!pAd->PM_FlgSuspend)
+ MlmeHandler(pAd);
+ }
+
+ /* notify the exit routine that we're actually exiting now
+ *
+ * complete()/wait_for_completion() is similar to up()/down(),
+ * except that complete() is safe in the case where the structure
+ * is getting deleted in a parallel mode of execution (i.e. just
+ * after the down() -- that's necessary for the thread-shutdown
+ * case.
+ *
+ * complete_and_exit() goes even further than this -- it is safe in
+ * the case that the thread of the caller is going away (not just
+ * the structure) -- this is necessary for the module-remove case.
+ * This is important in preemption kernels, which transfer the flow
+ * of execution immediately upon a complete().
+ */
+ DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__FUNCTION__));
+#ifndef KTHREAD_SUPPORT
+ pTask->taskPID = THREAD_PID_INIT_VALUE;
+ complete_and_exit (&pTask->taskComplete, 0);
+#endif
+ return 0;
+
+}
+
+
+/*
+========================================================================
+Routine Description:
+ USB command kernel thread.
+
+Arguments:
+ *Context the pAd, driver control block pointer
+
+Return Value:
+ 0 close the thread
+
+Note:
+========================================================================
+*/
+INT RTUSBCmdThread(
+ IN void * Context)
+{
+ RTMP_ADAPTER *pAd;
+ RTMP_OS_TASK *pTask;
+ int status;
+ status = 0;
+
+ pTask = (RTMP_OS_TASK *)Context;
+ pAd = (PRTMP_ADAPTER)pTask->priv;
+
+ RtmpOSTaskCustomize(pTask);
+
+ NdisAcquireSpinLock(&pAd->CmdQLock);
+ pAd->CmdQ.CmdQState = RTMP_TASK_STAT_RUNNING;
+ NdisReleaseSpinLock(&pAd->CmdQLock);
+
+ while (pAd && pAd->CmdQ.CmdQState == RTMP_TASK_STAT_RUNNING)
+ {
+#ifdef KTHREAD_SUPPORT
+ RTMP_WAIT_EVENT_INTERRUPTIBLE(pAd, pTask);
+#else
+ /* lock the device pointers */
+ RTMP_SEM_EVENT_WAIT(&(pTask->taskSema), status);
+
+ if (status != 0)
+ {
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
+ break;
+ }
+#endif
+
+ if (pAd->CmdQ.CmdQState == RTMP_TASK_STAT_STOPED)
+ break;
+
+ if (!pAd->PM_FlgSuspend)
+ CMDHandler(pAd);
+ }
+
+ if (pAd && !pAd->PM_FlgSuspend)
+ { // Clear the CmdQElements.
+ CmdQElmt *pCmdQElmt = NULL;
+
+ NdisAcquireSpinLock(&pAd->CmdQLock);
+ pAd->CmdQ.CmdQState = RTMP_TASK_STAT_STOPED;
+ while(pAd->CmdQ.size)
+ {
+ RTUSBDequeueCmd(&pAd->CmdQ, &pCmdQElmt);
+ if (pCmdQElmt)
+ {
+ if (pCmdQElmt->CmdFromNdis == TRUE)
+ {
+ if (pCmdQElmt->buffer != NULL)
+ os_free_mem(pAd, pCmdQElmt->buffer);
+ os_free_mem(pAd, (PUCHAR)pCmdQElmt);
+ }
+ else
+ {
+ if ((pCmdQElmt->buffer != NULL) && (pCmdQElmt->bufferlength != 0))
+ os_free_mem(pAd, pCmdQElmt->buffer);
+ os_free_mem(pAd, (PUCHAR)pCmdQElmt);
+ }
+ }
+ }
+
+ NdisReleaseSpinLock(&pAd->CmdQLock);
+ }
+ /* notify the exit routine that we're actually exiting now
+ *
+ * complete()/wait_for_completion() is similar to up()/down(),
+ * except that complete() is safe in the case where the structure
+ * is getting deleted in a parallel mode of execution (i.e. just
+ * after the down() -- that's necessary for the thread-shutdown
+ * case.
+ *
+ * complete_and_exit() goes even further than this -- it is safe in
+ * the case that the thread of the caller is going away (not just
+ * the structure) -- this is necessary for the module-remove case.
+ * This is important in preemption kernels, which transfer the flow
+ * of execution immediately upon a complete().
+ */
+ DBGPRINT(RT_DEBUG_TRACE,( "<---RTUSBCmdThread\n"));
+
+#ifndef KTHREAD_SUPPORT
+ pTask->taskPID = THREAD_PID_INIT_VALUE;
+ complete_and_exit (&pTask->taskComplete, 0);
+#endif
+ return 0;
+
+}
+
+
+VOID RTUSBWatchDog(IN RTMP_ADAPTER *pAd)
+{
+ PHT_TX_CONTEXT pHTTXContext;
+ int idx;
+ ULONG irqFlags;
+ PURB pUrb;
+ BOOLEAN needDumpSeq = FALSE;
+ UINT32 MACValue;
+ UINT32 TxRxQ_Pcnt;
+
+ idx = 0;
+ RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
+ if ((MACValue & 0xff) !=0 )
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("TX QUEUE 0 Not EMPTY(Value=0x%0x). !!!!!!!!!!!!!!!\n", MACValue));
+ RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40012);
+ while((MACValue &0xff) != 0 && (idx++ < 10))
+ {
+ RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
+ RTMPusecDelay(1);
+ }
+ RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40006);
+ }
+
+ if (pAd->watchDogRxOverFlowCnt >= 2)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("Maybe the Rx Bulk-In hanged! Cancel the pending Rx bulks request!\n"));
+ if ((!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
+ fRTMP_ADAPTER_BULKIN_RESET |
+ fRTMP_ADAPTER_HALT_IN_PROGRESS |
+ fRTMP_ADAPTER_NIC_NOT_EXIST))))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("Call CMDTHREAD_RESET_BULK_IN to cancel the pending Rx Bulk!\n"));
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET);
+ RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_IN, NULL, 0);
+ needDumpSeq = TRUE;
+ }
+ pAd->watchDogRxOverFlowCnt = 0;
+ }
+
+ RTUSBReadMACRegister(pAd, 0x438, &TxRxQ_Pcnt);
+
+ for (idx = 0; idx < NUM_OF_TX_RING; idx++)
+ {
+ pUrb = NULL;
+
+ RTMP_IRQ_LOCK(&pAd->BulkOutLock[idx], irqFlags);
+ if ((pAd->BulkOutPending[idx] == TRUE) && pAd->watchDogTxPendingCnt)
+ {
+ INT actual_length=0,transfer_buffer_length=0;
+ BOOLEAN isDataPacket=FALSE;
+ pAd->watchDogTxPendingCnt[idx]++;
+
+ if ((pAd->watchDogTxPendingCnt[idx] > 2) &&
+ (!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_BULKOUT_RESET)))
+ )
+ {
+ // FIXME: Following code just support single bulk out. If you wanna support multiple bulk out. Modify it!
+ pHTTXContext = (PHT_TX_CONTEXT)(&pAd->TxContext[idx]);
+ if (pHTTXContext->IRPPending)
+ { // Check TxContext.
+ pUrb = pHTTXContext->pUrb;
+
+ actual_length=pUrb->actual_length;
+ transfer_buffer_length=pUrb->transfer_buffer_length;
+ isDataPacket=TRUE;
+ }
+ else if (idx == MGMTPIPEIDX)
+ {
+ PTX_CONTEXT pMLMEContext, pNULLContext, pPsPollContext;
+
+ //Check MgmtContext.
+ pMLMEContext = (PTX_CONTEXT)(pAd->MgmtRing.Cell[pAd->MgmtRing.TxDmaIdx].AllocVa);
+ pPsPollContext = (PTX_CONTEXT)(&pAd->PsPollContext);
+ pNULLContext = (PTX_CONTEXT)(&pAd->NullContext);
+
+ if (pMLMEContext->IRPPending)
+ {
+ ASSERT(pMLMEContext->IRPPending);
+ pUrb = pMLMEContext->pUrb;
+ }
+ else if (pNULLContext->IRPPending)
+ {
+ ASSERT(pNULLContext->IRPPending);
+ pUrb = pNULLContext->pUrb;
+ }
+ else if (pPsPollContext->IRPPending)
+ {
+ ASSERT(pPsPollContext->IRPPending);
+ pUrb = pPsPollContext->pUrb;
+ }
+ }
+
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
+
+
+ printk("%d:%d LTL=%d , TL=%d L:%d\n",idx,pAd->watchDogTxPendingCnt[idx],pAd->TransferedLength[idx]
+ ,actual_length,transfer_buffer_length);
+
+ if (pUrb)
+ {
+ if ((isDataPacket
+ && pAd->TransferedLength[idx]==actual_length
+ && pAd->TransferedLength[idx]<transfer_buffer_length
+ && actual_length!=0
+// && TxRxQ_Pcnt==0
+ && pAd->watchDogTxPendingCnt[idx]>3)
+ || isDataPacket==FALSE || pAd->watchDogTxPendingCnt[idx]>6)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("Maybe the Tx Bulk-Out hanged! Cancel the pending Tx bulks request of idx(%d)!\n", idx));
+ DBGPRINT(RT_DEBUG_TRACE, ("Unlink the pending URB!\n"));
+ // unlink it now
+ RTUSB_UNLINK_URB(pUrb);
+ // Sleep 200 microseconds to give cancellation time to work
+ //RTMPusecDelay(200);
+ needDumpSeq = TRUE;
+ }
+ }
+ else
+ {
+ DBGPRINT(RT_DEBUG_ERROR, ("Unkonw bulkOut URB maybe hanged!!!!!!!!!!!!\n"));
+ }
+ }
+ else
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
+ }
+
+ if (isDataPacket==TRUE)
+ pAd->TransferedLength[idx]=actual_length;
+ }
+ else
+ {
+ RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
+ }
+ }
+
+ // For Sigma debug, dump the ba_reordering sequence.
+ if((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0))
+ {
+ USHORT Idx;
+ PBA_REC_ENTRY pBAEntry = NULL;
+ UCHAR count = 0;
+ struct reordering_mpdu *mpdu_blk;
+
+ Idx = pAd->MacTab.Content[BSSID_WCID].BARecWcidArray[0];
+
+ pBAEntry = &pAd->BATable.BARecEntry[Idx];
+ if((pBAEntry->list.qlen > 0) && (pBAEntry->list.next != NULL))
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("NICUpdateRawCounters():The Queueing pkt in reordering buffer:\n"));
+ NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
+ mpdu_blk = pBAEntry->list.next;
+ while (mpdu_blk)
+ {
+ DBGPRINT(RT_DEBUG_TRACE, ("\t%d:Seq-%d, bAMSDU-%d!\n", count, mpdu_blk->Sequence, mpdu_blk->bAMSDU));
+ mpdu_blk = mpdu_blk->next;
+ count++;
+ }
+
+ DBGPRINT(RT_DEBUG_TRACE, ("\npBAEntry->LastIndSeq=%d!\n", pBAEntry->LastIndSeq));
+ NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
+ }
+ }
+}
+
+/*
+========================================================================
+Routine Description:
+ Release allocated resources.
+
+Arguments:
+ *dev Point to the PCI or USB device
+ pAd driver control block pointer
+
+Return Value:
+ None
+
+Note:
+========================================================================
+*/
+static void rt2870_disconnect(struct usb_device *dev, PRTMP_ADAPTER pAd)
+{
+ DBGPRINT(RT_DEBUG_ERROR, ("rtusb_disconnect: unregister usbnet usb-%s-%s\n",
+ dev->bus->bus_name, dev->devpath));
+ if (!pAd)
+ {
+ usb_put_dev(dev);
+ printk("rtusb_disconnect: pAd == NULL!\n");
+ return;
+ }
+ RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
+
+ // for debug, wait to show some messages to /proc system
+ udelay(1);
+
+
+ RtmpPhyNetDevExit(pAd, pAd->net_dev);
+
+ // FIXME: Shall we need following delay and flush the schedule??
+ udelay(1);
+ flush_scheduled_work();
+ udelay(1);
+
+ // free the root net_device
+ RtmpOSNetDevFree(pAd->net_dev);
+
+ RtmpRaDevCtrlExit(pAd);
+
+ // release a use of the usb device structure
+ usb_put_dev(dev);
+ udelay(1);
+
+ DBGPRINT(RT_DEBUG_ERROR, (" RTUSB disconnect successfully\n"));
+}
+
+
+static int __devinit rt2870_probe(
+ IN struct usb_interface *intf,
+ IN struct usb_device *usb_dev,
+ IN const struct usb_device_id *dev_id,
+ IN RTMP_ADAPTER **ppAd)
+{
+ struct net_device *net_dev = NULL;
+ RTMP_ADAPTER *pAd = (RTMP_ADAPTER *) NULL;
+ INT status, rv;
+ PVOID handle;
+ RTMP_OS_NETDEV_OP_HOOK netDevHook;
+
+
+ DBGPRINT(RT_DEBUG_TRACE, ("===>rt2870_probe()!\n"));
+
+ // Check chipset vendor/product ID
+ //if (RT28XXChipsetCheck(_dev_p) == FALSE)
+ // goto err_out;
+
+//RtmpDevInit=============================================
+ // Allocate RTMP_ADAPTER adapter structure
+ handle = kmalloc(sizeof(struct os_cookie), GFP_KERNEL);
+ if (handle == NULL)
+ {
+ printk("rt2870_probe(): Allocate memory for os handle failed!\n");
+ return -ENOMEM;
+ }
+ ((POS_COOKIE)handle)->pUsb_Dev = usb_dev;
+
+ rv = RTMPAllocAdapterBlock(handle, &pAd);
+ if (rv != NDIS_STATUS_SUCCESS)
+ {
+ kfree(handle);
+ goto err_out;
+ }
+
+//USBDevInit==============================================
+ if (USBDevConfigInit(usb_dev, intf, pAd) == FALSE)
+ goto err_out_free_radev;
+
+ RtmpRaDevCtrlInit(pAd, RTMP_DEV_INF_USB);
+
+//NetDevInit==============================================
+ net_dev = RtmpPhyNetDevInit(pAd, &netDevHook);
+ if (net_dev == NULL)
+ goto err_out_free_radev;
+
+ // Here are the net_device structure with usb specific parameters.
+ /* for supporting Network Manager.
+ * Set the sysfs physical device reference for the network logical device if set prior to registration will
+ * cause a symlink during initialization.
+ */
+ SET_NETDEV_DEV(net_dev, &(usb_dev->dev));
+
+ pAd->StaCfg.OriDevType = net_dev->type;
+
+//All done, it's time to register the net device to linux kernel.
+ // Register this device
+ status = RtmpOSNetDevAttach(net_dev, &netDevHook);
+ if (status != 0)
+ goto err_out_free_netdev;
+
+#ifdef KTHREAD_SUPPORT
+ init_waitqueue_head(&pAd->mlmeTask.kthread_q);
+ init_waitqueue_head(&pAd->timerTask.kthread_q);
+ init_waitqueue_head(&pAd->cmdQTask.kthread_q);
+#endif
+
+ *ppAd = pAd;
+
+ DBGPRINT(RT_DEBUG_TRACE, ("<===rt2870_probe()!\n"));
+
+ return 0;
+
+ /* --------------------------- ERROR HANDLE --------------------------- */
+err_out_free_netdev:
+ RtmpOSNetDevFree(net_dev);
+
+err_out_free_radev:
+ RTMPFreeAdapter(pAd);
+
+err_out:
+ *ppAd = NULL;
+
+ return -1;
+
+}
diff --git a/drivers/staging/rt2860/wpa.h b/drivers/staging/rt2860/wpa.h
index 7006e389e323..27e5aab82855 100644
--- a/drivers/staging/rt2860/wpa.h
+++ b/drivers/staging/rt2860/wpa.h
@@ -67,7 +67,6 @@
// Key Descriptor Version of Key Information
#define DESC_TYPE_TKIP 1
#define DESC_TYPE_AES 2
-#define DESC_TYPE_MESH 3
#define LEN_MSG1_2WAY 0x7f
#define MAX_LEN_OF_EAP_HS 256
@@ -90,11 +89,17 @@
#define TKIP_AP_RXMICK_OFFSET (TKIP_AP_TXMICK_OFFSET+LEN_TKIP_TXMICK)
#define TKIP_GTK_LENGTH ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK))
#define LEN_PTK ((LEN_EAP_KEY)+(LEN_TKIP_KEY))
+#define MIN_LEN_OF_GTK 5
+#define LEN_PMK 32
+#define LEN_PMK_NAME 16
+#define LEN_NONCE 32
// RSN IE Length definition
-#define MAX_LEN_OF_RSNIE 90
+#define MAX_LEN_OF_RSNIE 255
#define MIN_LEN_OF_RSNIE 8
+#define KEY_LIFETIME 3600
+
//EAP Packet Type
#define EAPPacket 0
#define EAPOLStart 1
@@ -119,6 +124,29 @@
#define PEER_MSG3_RETRY_TIMER_CTR 10
#define GROUP_MSG1_RETRY_TIMER_CTR 20
+//#ifdef CONFIG_AP_SUPPORT
+// WPA mechanism retry timer interval
+#define PEER_MSG1_RETRY_EXEC_INTV 1000 // 1 sec
+#define PEER_MSG3_RETRY_EXEC_INTV 3000 // 3 sec
+#define GROUP_KEY_UPDATE_EXEC_INTV 1000 // 1 sec
+#define PEER_GROUP_KEY_UPDATE_INIV 2000 // 2 sec
+
+#define ENQUEUE_EAPOL_START_TIMER 200 // 200 ms
+
+// group rekey interval
+#define TIME_REKEY 0
+#define PKT_REKEY 1
+#define DISABLE_REKEY 2
+#define MAX_REKEY 2
+
+#define MAX_REKEY_INTER 0x3ffffff
+//#endif // CONFIG_AP_SUPPORT //
+
+#define GROUP_SUITE 0
+#define PAIRWISE_SUITE 1
+#define AKM_SUITE 2
+#define PMKID_LIST 3
+
#define EAPOL_START_DISABLE 0
#define EAPOL_START_PSK 1
@@ -129,8 +157,30 @@
#define MIX_CIPHER_WPA2_TKIP_ON(x) (((x) & 0x02) != 0)
#define MIX_CIPHER_WPA2_AES_ON(x) (((x) & 0x01) != 0)
+#ifndef ROUND_UP
#define ROUND_UP(__x, __y) \
(((ULONG)((__x)+((__y)-1))) & ((ULONG)~((__y)-1)))
+#endif
+
+#define SET_UINT16_TO_ARRARY(_V, _LEN) \
+{ \
+ _V[0] = (_LEN & 0xFF00) >> 8; \
+ _V[1] = (_LEN & 0xFF); \
+}
+
+#define INC_UINT16_TO_ARRARY(_V, _LEN) \
+{ \
+ UINT16 var_len; \
+ \
+ var_len = (_V[0]<<8) | (_V[1]); \
+ var_len += _LEN; \
+ \
+ _V[0] = (var_len & 0xFF00) >> 8; \
+ _V[1] = (var_len & 0xFF); \
+}
+
+#define CONV_ARRARY_TO_UINT16(_V) ((_V[0]<<8) | (_V[1]))
+
#define ADD_ONE_To_64BIT_VAR(_V) \
{ \
@@ -324,4 +374,47 @@ typedef struct PACKED _RSN_CAPABILITY {
USHORT PreAuth:1;
} RSN_CAPABILITY, *PRSN_CAPABILITY;
+
+/*========================================
+ The prototype is defined in cmm_wpa.c
+ ========================================*/
+BOOLEAN WpaMsgTypeSubst(
+ IN UCHAR EAPType,
+ OUT INT *MsgType);
+
+VOID PRF(
+ IN UCHAR *key,
+ IN INT key_len,
+ IN UCHAR *prefix,
+ IN INT prefix_len,
+ IN UCHAR *data,
+ IN INT data_len,
+ OUT UCHAR *output,
+ IN INT len);
+
+int PasswordHash(
+ char *password,
+ unsigned char *ssid,
+ int ssidlength,
+ unsigned char *output);
+
+PUINT8 GetSuiteFromRSNIE(
+ IN PUINT8 rsnie,
+ IN UINT rsnie_len,
+ IN UINT8 type,
+ OUT UINT8 *count);
+
+VOID WpaShowAllsuite(
+ IN PUINT8 rsnie,
+ IN UINT rsnie_len);
+
+VOID RTMPInsertRSNIE(
+ IN PUCHAR pFrameBuf,
+ OUT PULONG pFrameLen,
+ IN PUINT8 rsnie_ptr,
+ IN UINT8 rsnie_len,
+ IN PUINT8 pmkid_ptr,
+ IN UINT8 pmkid_len);
+
+
#endif
diff --git a/drivers/staging/rt2870/2870_main_dev.c b/drivers/staging/rt2870/2870_main_dev.c
deleted file mode 100644
index d0ed48bed2bb..000000000000
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ /dev/null
@@ -1,1530 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_main.c
-
- Abstract:
- main initialization routines
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- Jan Lee 01-10-2005 modified
- Sample Jun/01/07 Merge RT2870 and RT2860 drivers.
-*/
-
-#include "rt_config.h"
-
-
-// Following information will be show when you run 'modinfo'
-// *** If you have a solution for the bug in current version of driver, please mail to me.
-// Otherwise post to forum in ralinktech's web site(www.ralinktech.com) and let all users help you. ***
-MODULE_AUTHOR("Paul Lin <paul_lin@ralinktech.com>");
-MODULE_DESCRIPTION(RT28xx_CHIP_NAME " Wireless LAN Linux Driver");
-MODULE_LICENSE("GPL");
-#ifdef MODULE_VERSION
-MODULE_VERSION(STA_DRIVER_VERSION);
-#endif
-MODULE_ALIAS("rt3070sta");
-
-/* Kernel thread and vars, which handles packets that are completed. Only
- * packets that have a "complete" function are sent here. This way, the
- * completion is run out of kernel context, and doesn't block the rest of
- * the stack. */
-
-extern INT __devinit rt28xx_probe(IN void *_dev_p, IN void *_dev_id_p,
- IN UINT argc, OUT PRTMP_ADAPTER *ppAd);
-
-struct usb_device_id rtusb_usb_id[] = {
- { USB_DEVICE(0x148F, 0x2770) }, /* Ralink */
- { USB_DEVICE(0x1737, 0x0071) }, /* Linksys WUSB600N */
- { USB_DEVICE(0x1737, 0x0070) }, /* Linksys */
- { USB_DEVICE(0x148F, 0x2870) }, /* Ralink */
- { USB_DEVICE(0x148F, 0x3070) }, /* Ralink 3070 */
- { USB_DEVICE(0x148F, 0x3071) }, /* Ralink 3071 */
- { USB_DEVICE(0x148F, 0x3072) }, /* Ralink 3072 */
- { USB_DEVICE(0x0B05, 0x1731) }, /* Asus */
- { USB_DEVICE(0x0B05, 0x1732) }, /* Asus */
- { USB_DEVICE(0x0B05, 0x1742) }, /* Asus */
- { USB_DEVICE(0x0DF6, 0x0017) }, /* Sitecom */
- { USB_DEVICE(0x0DF6, 0x002B) }, /* Sitecom */
- { USB_DEVICE(0x0DF6, 0x002C) }, /* Sitecom */
- { USB_DEVICE(0x0DF6, 0x003E) }, /* Sitecom 3070 */
- { USB_DEVICE(0x0DF6, 0x002D) }, /* Sitecom */
- { USB_DEVICE(0x0DF6, 0x0039) }, /* Sitecom 2770 */
- { USB_DEVICE(0x0DF6, 0x003F) }, /* Sitecom WL-608 */
- { USB_DEVICE(0x14B2, 0x3C06) }, /* Conceptronic */
- { USB_DEVICE(0x14B2, 0x3C28) }, /* Conceptronic */
- { USB_DEVICE(0x2019, 0xED06) }, /* Planex Communications, Inc. */
- { USB_DEVICE(0x2019, 0xED14) }, /* Planex Communications, Inc. */
- { USB_DEVICE(0x2019, 0xAB25) }, /* Planex Communications, Inc. RT3070 */
- { USB_DEVICE(0x07D1, 0x3C09) }, /* D-Link */
- { USB_DEVICE(0x07D1, 0x3C11) }, /* D-Link */
- { USB_DEVICE(0x2001, 0x3C09) }, /* D-Link */
- { USB_DEVICE(0x2001, 0x3C0A) }, /* D-Link 3072*/
- { USB_DEVICE(0x14B2, 0x3C07) }, /* AL */
- { USB_DEVICE(0x14B2, 0x3C12) }, /* AL 3070 */
- { USB_DEVICE(0x050D, 0x8053) }, /* Belkin */
- { USB_DEVICE(0x050D, 0x815C) }, /* Belkin */
- { USB_DEVICE(0x050D, 0x825a) }, /* Belkin */
- { USB_DEVICE(0x14B2, 0x3C23) }, /* Airlink */
- { USB_DEVICE(0x14B2, 0x3C27) }, /* Airlink */
- { USB_DEVICE(0x07AA, 0x002F) }, /* Corega */
- { USB_DEVICE(0x07AA, 0x003C) }, /* Corega */
- { USB_DEVICE(0x07AA, 0x003F) }, /* Corega */
- { USB_DEVICE(0x18C5, 0x0012) }, /* Corega 3070 */
- { USB_DEVICE(0x1044, 0x800B) }, /* Gigabyte */
- { USB_DEVICE(0x1044, 0x800D) }, /* Gigabyte GN-WB32L 3070 */
- { USB_DEVICE(0x15A9, 0x0006) }, /* Sparklan */
- { USB_DEVICE(0x083A, 0xB522) }, /* SMC */
- { USB_DEVICE(0x083A, 0xA618) }, /* SMC */
- { USB_DEVICE(0x083A, 0x8522) }, /* Arcadyan */
- { USB_DEVICE(0x083A, 0x7512) }, /* Arcadyan 2770 */
- { USB_DEVICE(0x083A, 0x7522) }, /* Arcadyan */
- { USB_DEVICE(0x083A, 0x7511) }, /* Arcadyan 3070 */
- { USB_DEVICE(0x0CDE, 0x0022) }, /* ZCOM */
- { USB_DEVICE(0x0586, 0x3416) }, /* Zyxel */
- { USB_DEVICE(0x0CDE, 0x0025) }, /* Zyxel */
- { USB_DEVICE(0x1740, 0x9701) }, /* EnGenius */
- { USB_DEVICE(0x1740, 0x9702) }, /* EnGenius */
- { USB_DEVICE(0x1740, 0x9703) }, /* EnGenius 3070 */
- { USB_DEVICE(0x0471, 0x200f) }, /* Philips */
- { USB_DEVICE(0x14B2, 0x3C25) }, /* Draytek */
- { USB_DEVICE(0x13D3, 0x3247) }, /* AzureWave */
- { USB_DEVICE(0x13D3, 0x3273) }, /* AzureWave 3070*/
- { USB_DEVICE(0x083A, 0x6618) }, /* Accton */
- { USB_DEVICE(0x15c5, 0x0008) }, /* Amit */
- { USB_DEVICE(0x0E66, 0x0001) }, /* Hawking */
- { USB_DEVICE(0x0E66, 0x0003) }, /* Hawking */
- { USB_DEVICE(0x129B, 0x1828) }, /* Siemens */
- { USB_DEVICE(0x157E, 0x300E) }, /* U-Media */
- { USB_DEVICE(0x050d, 0x805c) },
- { USB_DEVICE(0x1482, 0x3C09) }, /* Abocom*/
- { USB_DEVICE(0x14B2, 0x3C09) }, /* Alpha */
- { USB_DEVICE(0x04E8, 0x2018) }, /* samsung */
- { USB_DEVICE(0x07B8, 0x3070) }, /* AboCom 3070 */
- { USB_DEVICE(0x07B8, 0x3071) }, /* AboCom 3071 */
- { USB_DEVICE(0x07B8, 0x2870) }, /* AboCom */
- { USB_DEVICE(0x07B8, 0x2770) }, /* AboCom */
- { USB_DEVICE(0x07B8, 0x3072) }, /* Abocom 3072 */
- { USB_DEVICE(0x7392, 0x7711) }, /* Edimax 3070 */
- { USB_DEVICE(0x5A57, 0x0280) }, /* Zinwell */
- { USB_DEVICE(0x5A57, 0x0282) }, /* Zinwell */
- { USB_DEVICE(0x1A32, 0x0304) }, /* Quanta 3070 */
- { USB_DEVICE(0x0789, 0x0162) }, /* Logitec 2870 */
- { USB_DEVICE(0x0789, 0x0163) }, /* Logitec 2870 */
- { USB_DEVICE(0x0789, 0x0164) }, /* Logitec 2870 */
- { USB_DEVICE(0x7392, 0x7717) }, /* Edimax */
- { USB_DEVICE(0x1EDA, 0x2310) }, /* AirTies 3070 */
- { USB_DEVICE(0x1737, 0x0077) }, /* Linksys WUSB54GC-EU v3 */
- { } /* Terminating entry */
-};
-
-INT const rtusb_usb_id_len = sizeof(rtusb_usb_id) / sizeof(struct usb_device_id);
-MODULE_DEVICE_TABLE(usb, rtusb_usb_id);
-
-#ifndef PF_NOFREEZE
-#define PF_NOFREEZE 0
-#endif
-
-
-#ifdef CONFIG_PM
-static int rt2870_suspend(struct usb_interface *intf, pm_message_t state);
-static int rt2870_resume(struct usb_interface *intf);
-#endif // CONFIG_PM //
-
-/**************************************************************************/
-/**************************************************************************/
-//tested for kernel 2.6series
-/**************************************************************************/
-/**************************************************************************/
-static int rtusb_probe (struct usb_interface *intf,
- const struct usb_device_id *id);
-static void rtusb_disconnect(struct usb_interface *intf);
-
-struct usb_driver rtusb_driver = {
- .name="rt2870",
- .probe=rtusb_probe,
- .disconnect=rtusb_disconnect,
- .id_table=rtusb_usb_id,
-
-#ifdef CONFIG_PM
- suspend: rt2870_suspend,
- resume: rt2870_resume,
-#endif
- };
-
-#ifdef CONFIG_PM
-
-VOID RT2860RejectPendingPackets(
- IN PRTMP_ADAPTER pAd)
-{
- // clear PS packets
- // clear TxSw packets
-}
-
-static int rt2870_suspend(
- struct usb_interface *intf,
- pm_message_t state)
-{
- struct net_device *net_dev;
- PRTMP_ADAPTER pAd = usb_get_intfdata(intf);
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2870_suspend()\n"));
- net_dev = pAd->net_dev;
- netif_device_detach (net_dev);
-
- pAd->PM_FlgSuspend = 1;
- if (netif_running(net_dev)) {
- RTUSBCancelPendingBulkInIRP(pAd);
- RTUSBCancelPendingBulkOutIRP(pAd);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2870_suspend()\n"));
- return 0;
-}
-
-static int rt2870_resume(
- struct usb_interface *intf)
-{
- struct net_device *net_dev;
- PRTMP_ADAPTER pAd = usb_get_intfdata(intf);
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt2870_resume()\n"));
-
- pAd->PM_FlgSuspend = 0;
- net_dev = pAd->net_dev;
- netif_device_attach (net_dev);
- netif_start_queue(net_dev);
- netif_carrier_on(net_dev);
- netif_wake_queue(net_dev);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2870_resume()\n"));
- return 0;
-}
-#endif // CONFIG_PM //
-
-
-// Init driver module
-INT __init rtusb_init(void)
-{
- printk("rtusb init --->\n");
- return usb_register(&rtusb_driver);
-}
-
-// Deinit driver module
-VOID __exit rtusb_exit(void)
-{
- usb_deregister(&rtusb_driver);
- printk("<--- rtusb exit\n");
-}
-
-module_init(rtusb_init);
-module_exit(rtusb_exit);
-
-
-
-
-/*--------------------------------------------------------------------- */
-/* function declarations */
-/*--------------------------------------------------------------------- */
-
-/*
-========================================================================
-Routine Description:
- MLME kernel thread.
-
-Arguments:
- *Context the pAd, driver control block pointer
-
-Return Value:
- 0 close the thread
-
-Note:
-========================================================================
-*/
-INT MlmeThread(
- IN void *Context)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)Context;
- POS_COOKIE pObj;
- int status;
-
- pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- rtmp_os_thread_init("rt2870MlmeThread", (PVOID)&(pAd->mlmeComplete));
-
- while (pAd->mlme_kill == 0)
- {
- /* lock the device pointers */
- //down(&(pAd->mlme_semaphore));
- status = down_interruptible(&(pAd->mlme_semaphore));
-
- /* lock the device pointers , need to check if required*/
- //down(&(pAd->usbdev_semaphore));
-
- if (!pAd->PM_FlgSuspend)
- MlmeHandler(pAd);
-
- /* unlock the device pointers */
- //up(&(pAd->usbdev_semaphore));
- if (status != 0)
- {
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- break;
- }
- }
-
- /* notify the exit routine that we're actually exiting now
- *
- * complete()/wait_for_completion() is similar to up()/down(),
- * except that complete() is safe in the case where the structure
- * is getting deleted in a parallel mode of execution (i.e. just
- * after the down() -- that's necessary for the thread-shutdown
- * case.
- *
- * complete_and_exit() goes even further than this -- it is safe in
- * the case that the thread of the caller is going away (not just
- * the structure) -- this is necessary for the module-remove case.
- * This is important in preemption kernels, which transfer the flow
- * of execution immediately upon a complete().
- */
- DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__));
-
- pObj->MLMEThr_pid = NULL;
-
- complete_and_exit (&pAd->mlmeComplete, 0);
- return 0;
-
-}
-
-
-/*
-========================================================================
-Routine Description:
- USB command kernel thread.
-
-Arguments:
- *Context the pAd, driver control block pointer
-
-Return Value:
- 0 close the thread
-
-Note:
-========================================================================
-*/
-INT RTUSBCmdThread(
- IN void * Context)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)Context;
- POS_COOKIE pObj;
- int status;
-
- pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- rtmp_os_thread_init("rt2870CmdThread", (PVOID)&(pAd->CmdQComplete));
-
- NdisAcquireSpinLock(&pAd->CmdQLock);
- pAd->CmdQ.CmdQState = RT2870_THREAD_RUNNING;
- NdisReleaseSpinLock(&pAd->CmdQLock);
-
- while (pAd->CmdQ.CmdQState == RT2870_THREAD_RUNNING)
- {
- /* lock the device pointers */
- //down(&(pAd->RTUSBCmd_semaphore));
- status = down_interruptible(&(pAd->RTUSBCmd_semaphore));
-
- if (pAd->CmdQ.CmdQState == RT2870_THREAD_STOPED)
- break;
-
- if (status != 0)
- {
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- break;
- }
- /* lock the device pointers , need to check if required*/
- //down(&(pAd->usbdev_semaphore));
-
- if (!pAd->PM_FlgSuspend)
- CMDHandler(pAd);
-
- /* unlock the device pointers */
- //up(&(pAd->usbdev_semaphore));
- }
-
- if (!pAd->PM_FlgSuspend)
- { // Clear the CmdQElements.
- CmdQElmt *pCmdQElmt = NULL;
-
- NdisAcquireSpinLock(&pAd->CmdQLock);
- pAd->CmdQ.CmdQState = RT2870_THREAD_STOPED;
- while(pAd->CmdQ.size)
- {
- RTUSBDequeueCmd(&pAd->CmdQ, &pCmdQElmt);
- if (pCmdQElmt)
- {
- if (pCmdQElmt->CmdFromNdis == TRUE)
- {
- if (pCmdQElmt->buffer != NULL)
- NdisFreeMemory(pCmdQElmt->buffer, pCmdQElmt->bufferlength, 0);
-
- NdisFreeMemory(pCmdQElmt, sizeof(CmdQElmt), 0);
- }
- else
- {
- if ((pCmdQElmt->buffer != NULL) && (pCmdQElmt->bufferlength != 0))
- NdisFreeMemory(pCmdQElmt->buffer, pCmdQElmt->bufferlength, 0);
- {
- NdisFreeMemory(pCmdQElmt, sizeof(CmdQElmt), 0);
- }
- }
- }
- }
-
- NdisReleaseSpinLock(&pAd->CmdQLock);
- }
- /* notify the exit routine that we're actually exiting now
- *
- * complete()/wait_for_completion() is similar to up()/down(),
- * except that complete() is safe in the case where the structure
- * is getting deleted in a parallel mode of execution (i.e. just
- * after the down() -- that's necessary for the thread-shutdown
- * case.
- *
- * complete_and_exit() goes even further than this -- it is safe in
- * the case that the thread of the caller is going away (not just
- * the structure) -- this is necessary for the module-remove case.
- * This is important in preemption kernels, which transfer the flow
- * of execution immediately upon a complete().
- */
- DBGPRINT(RT_DEBUG_TRACE,( "<---RTUSBCmdThread\n"));
-
- pObj->RTUSBCmdThr_pid = NULL;
-
- complete_and_exit (&pAd->CmdQComplete, 0);
- return 0;
-
-}
-
-
-static void RT2870_TimerQ_Handle(RTMP_ADAPTER *pAd)
-{
- int status;
- RALINK_TIMER_STRUCT *pTimer;
- RT2870_TIMER_ENTRY *pEntry;
- unsigned long irqFlag;
-
- while(!pAd->TimerFunc_kill)
- {
-// printk("waiting for event!\n");
- pTimer = NULL;
-
- status = down_interruptible(&(pAd->RTUSBTimer_semaphore));
-
- if (pAd->TimerQ.status == RT2870_THREAD_STOPED)
- break;
-
- // event happened.
- while(pAd->TimerQ.pQHead)
- {
- RTMP_IRQ_LOCK(&pAd->TimerQLock, irqFlag);
- pEntry = pAd->TimerQ.pQHead;
- if (pEntry)
- {
- pTimer = pEntry->pRaTimer;
-
- // update pQHead
- pAd->TimerQ.pQHead = pEntry->pNext;
- if (pEntry == pAd->TimerQ.pQTail)
- pAd->TimerQ.pQTail = NULL;
-
- // return this queue entry to timerQFreeList.
- pEntry->pNext = pAd->TimerQ.pQPollFreeList;
- pAd->TimerQ.pQPollFreeList = pEntry;
- }
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlag);
-
- if (pTimer)
- {
- if (pTimer->handle != NULL)
- if (!pAd->PM_FlgSuspend)
- pTimer->handle(NULL, (PVOID) pTimer->cookie, NULL, pTimer);
- if ((pTimer->Repeat) && (pTimer->State == FALSE))
- RTMP_OS_Add_Timer(&pTimer->TimerObj, pTimer->TimerValue);
- }
- }
-
- if (status != 0)
- {
- pAd->TimerQ.status = RT2870_THREAD_STOPED;
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
- break;
- }
- }
-}
-
-
-INT TimerQThread(
- IN OUT PVOID Context)
-{
- PRTMP_ADAPTER pAd;
- POS_COOKIE pObj;
-
- pAd = (PRTMP_ADAPTER)Context;
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- rtmp_os_thread_init("rt2870TimerQHandle", (PVOID)&(pAd->TimerQComplete));
-
- RT2870_TimerQ_Handle(pAd);
-
- /* notify the exit routine that we're actually exiting now
- *
- * complete()/wait_for_completion() is similar to up()/down(),
- * except that complete() is safe in the case where the structure
- * is getting deleted in a parallel mode of execution (i.e. just
- * after the down() -- that's necessary for the thread-shutdown
- * case.
- *
- * complete_and_exit() goes even further than this -- it is safe in
- * the case that the thread of the caller is going away (not just
- * the structure) -- this is necessary for the module-remove case.
- * This is important in preemption kernels, which transfer the flow
- * of execution immediately upon a complete().
- */
- DBGPRINT(RT_DEBUG_TRACE,( "<---%s\n",__func__));
-
- pObj->TimerQThr_pid = NULL;
-
- complete_and_exit(&pAd->TimerQComplete, 0);
- return 0;
-
-}
-
-
-RT2870_TIMER_ENTRY *RT2870_TimerQ_Insert(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer)
-{
- RT2870_TIMER_ENTRY *pQNode = NULL, *pQTail;
- unsigned long irqFlags;
-
-
- RTMP_IRQ_LOCK(&pAd->TimerQLock, irqFlags);
- if (pAd->TimerQ.status & RT2870_THREAD_CAN_DO_INSERT)
- {
- if(pAd->TimerQ.pQPollFreeList)
- {
- pQNode = pAd->TimerQ.pQPollFreeList;
- pAd->TimerQ.pQPollFreeList = pQNode->pNext;
-
- pQNode->pRaTimer = pTimer;
- pQNode->pNext = NULL;
-
- pQTail = pAd->TimerQ.pQTail;
- if (pAd->TimerQ.pQTail != NULL)
- pQTail->pNext = pQNode;
- pAd->TimerQ.pQTail = pQNode;
- if (pAd->TimerQ.pQHead == NULL)
- pAd->TimerQ.pQHead = pQNode;
- }
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlags);
-
- if (pQNode)
- up(&pAd->RTUSBTimer_semaphore);
- //wake_up(&timerWaitQ);
- }
- else
- {
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlags);
- }
- return pQNode;
-}
-
-
-BOOLEAN RT2870_TimerQ_Remove(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer)
-{
- RT2870_TIMER_ENTRY *pNode, *pPrev = NULL;
- unsigned long irqFlags;
-
- RTMP_IRQ_LOCK(&pAd->TimerQLock, irqFlags);
- if (pAd->TimerQ.status >= RT2870_THREAD_INITED)
- {
- pNode = pAd->TimerQ.pQHead;
- while (pNode)
- {
- if (pNode->pRaTimer == pTimer)
- break;
- pPrev = pNode;
- pNode = pNode->pNext;
- }
-
- // Now move it to freeList queue.
- if (pNode)
- {
- if (pNode == pAd->TimerQ.pQHead)
- pAd->TimerQ.pQHead = pNode->pNext;
- if (pNode == pAd->TimerQ.pQTail)
- pAd->TimerQ.pQTail = pPrev;
- if (pPrev != NULL)
- pPrev->pNext = pNode->pNext;
-
- // return this queue entry to timerQFreeList.
- pNode->pNext = pAd->TimerQ.pQPollFreeList;
- pAd->TimerQ.pQPollFreeList = pNode;
- }
- }
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlags);
-
- return TRUE;
-}
-
-
-void RT2870_TimerQ_Exit(RTMP_ADAPTER *pAd)
-{
- RT2870_TIMER_ENTRY *pTimerQ;
- unsigned long irqFlags;
-
- RTMP_IRQ_LOCK(&pAd->TimerQLock, irqFlags);
- while (pAd->TimerQ.pQHead)
- {
- pTimerQ = pAd->TimerQ.pQHead;
- pAd->TimerQ.pQHead = pTimerQ->pNext;
- // remove the timeQ
- }
- pAd->TimerQ.pQPollFreeList = NULL;
- os_free_mem(pAd, pAd->TimerQ.pTimerQPoll);
- pAd->TimerQ.pQTail = NULL;
- pAd->TimerQ.pQHead = NULL;
- pAd->TimerQ.status = RT2870_THREAD_STOPED;
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlags);
-
-}
-
-
-void RT2870_TimerQ_Init(RTMP_ADAPTER *pAd)
-{
- int i;
- RT2870_TIMER_ENTRY *pQNode, *pEntry;
- unsigned long irqFlags;
-
- NdisAllocateSpinLock(&pAd->TimerQLock);
-
- RTMP_IRQ_LOCK(&pAd->TimerQLock, irqFlags);
- NdisZeroMemory(&pAd->TimerQ, sizeof(pAd->TimerQ));
- //InterlockedExchange(&pAd->TimerQ.count, 0);
-
- /* Initialise the wait q head */
- //init_waitqueue_head(&timerWaitQ);
-
- os_alloc_mem(pAd, &pAd->TimerQ.pTimerQPoll, sizeof(RT2870_TIMER_ENTRY) * TIMER_QUEUE_SIZE_MAX);
- if (pAd->TimerQ.pTimerQPoll)
- {
- pEntry = NULL;
- pQNode = (RT2870_TIMER_ENTRY *)pAd->TimerQ.pTimerQPoll;
- for (i = 0 ;i <TIMER_QUEUE_SIZE_MAX; i++)
- {
- pQNode->pNext = pEntry;
- pEntry = pQNode;
- pQNode++;
- }
- pAd->TimerQ.pQPollFreeList = pEntry;
- pAd->TimerQ.pQHead = NULL;
- pAd->TimerQ.pQTail = NULL;
- pAd->TimerQ.status = RT2870_THREAD_INITED;
- }
- RTMP_IRQ_UNLOCK(&pAd->TimerQLock, irqFlags);
-}
-
-
-VOID RT2870_WatchDog(IN RTMP_ADAPTER *pAd)
-{
- PHT_TX_CONTEXT pHTTXContext;
- int idx;
- ULONG irqFlags;
- PURB pUrb;
- BOOLEAN needDumpSeq = FALSE;
- UINT32 MACValue;
-
-
- idx = 0;
- RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
- if ((MACValue & 0xff) !=0 )
- {
- DBGPRINT(RT_DEBUG_TRACE, ("TX QUEUE 0 Not EMPTY(Value=0x%0x). !!!!!!!!!!!!!!!\n", MACValue));
- RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40012);
- while((MACValue &0xff) != 0 && (idx++ < 10))
- {
- RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
- NdisMSleep(1);
- }
- RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40006);
- }
-
-//PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
- idx = 0;
- if ((MACValue & 0xff00) !=0 )
- {
- DBGPRINT(RT_DEBUG_TRACE, ("TX QUEUE 1 Not EMPTY(Value=0x%0x). !!!!!!!!!!!!!!!\n", MACValue));
- RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf4000a);
- while((MACValue &0xff00) != 0 && (idx++ < 10))
- {
- RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
- NdisMSleep(1);
- }
- RTMP_IO_WRITE32(pAd, PBF_CFG, 0xf40006);
- }
-
- if (pAd->watchDogRxOverFlowCnt >= 2)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Maybe the Rx Bulk-In hanged! Cancel the pending Rx bulks request!\n"));
- if ((!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_BULKIN_RESET |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Call CMDTHREAD_RESET_BULK_IN to cancel the pending Rx Bulk!\n"));
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET);
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_IN, NULL, 0);
- needDumpSeq = TRUE;
- }
- pAd->watchDogRxOverFlowCnt = 0;
- }
-
-
- for (idx = 0; idx < NUM_OF_TX_RING; idx++)
- {
- pUrb = NULL;
-
- RTMP_IRQ_LOCK(&pAd->BulkOutLock[idx], irqFlags);
- if ((pAd->BulkOutPending[idx] == TRUE) && pAd->watchDogTxPendingCnt)
- {
- pAd->watchDogTxPendingCnt[idx]++;
-
- if ((pAd->watchDogTxPendingCnt[idx] > 2) &&
- (!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_BULKOUT_RESET)))
- )
- {
- // FIXME: Following code just support single bulk out. If you wanna support multiple bulk out. Modify it!
- pHTTXContext = (PHT_TX_CONTEXT)(&pAd->TxContext[idx]);
- if (pHTTXContext->IRPPending)
- { // Check TxContext.
- pUrb = pHTTXContext->pUrb;
- }
- else if (idx == MGMTPIPEIDX)
- {
- PTX_CONTEXT pMLMEContext, pNULLContext, pPsPollContext;
-
- //Check MgmtContext.
- pMLMEContext = (PTX_CONTEXT)(pAd->MgmtRing.Cell[pAd->MgmtRing.TxDmaIdx].AllocVa);
- pPsPollContext = (PTX_CONTEXT)(&pAd->PsPollContext);
- pNULLContext = (PTX_CONTEXT)(&pAd->NullContext);
-
- if (pMLMEContext->IRPPending)
- {
- ASSERT(pMLMEContext->IRPPending);
- pUrb = pMLMEContext->pUrb;
- }
- else if (pNULLContext->IRPPending)
- {
- ASSERT(pNULLContext->IRPPending);
- pUrb = pNULLContext->pUrb;
- }
- else if (pPsPollContext->IRPPending)
- {
- ASSERT(pPsPollContext->IRPPending);
- pUrb = pPsPollContext->pUrb;
- }
- }
-
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Maybe the Tx Bulk-Out hanged! Cancel the pending Tx bulks request of idx(%d)!\n", idx));
- if (pUrb)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Unlink the pending URB!\n"));
- // unlink it now
- RTUSB_UNLINK_URB(pUrb);
- // Sleep 200 microseconds to give cancellation time to work
- RTMPusecDelay(200);
- needDumpSeq = TRUE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Unkonw bulkOut URB maybe hanged!!!!!!!!!!!!\n"));
- }
- }
- else
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
- }
- }
- else
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[idx], irqFlags);
- }
- }
-
- // For Sigma debug, dump the ba_reordering sequence.
- if((needDumpSeq == TRUE) && (pAd->CommonCfg.bDisableReordering == 0))
- {
- USHORT Idx;
- PBA_REC_ENTRY pBAEntry = NULL;
- UCHAR count = 0;
- struct reordering_mpdu *mpdu_blk;
-
- Idx = pAd->MacTab.Content[BSSID_WCID].BARecWcidArray[0];
-
- pBAEntry = &pAd->BATable.BARecEntry[Idx];
- if((pBAEntry->list.qlen > 0) && (pBAEntry->list.next != NULL))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("NICUpdateRawCounters():The Queueing pkt in reordering buffer:\n"));
- NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
- mpdu_blk = pBAEntry->list.next;
- while (mpdu_blk)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("\t%d:Seq-%d, bAMSDU-%d!\n", count, mpdu_blk->Sequence, mpdu_blk->bAMSDU));
- mpdu_blk = mpdu_blk->next;
- count++;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("\npBAEntry->LastIndSeq=%d!\n", pBAEntry->LastIndSeq));
- NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
- }
- }
-}
-
-/*
-========================================================================
-Routine Description:
- Release allocated resources.
-
-Arguments:
- *dev Point to the PCI or USB device
- pAd driver control block pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-static void _rtusb_disconnect(struct usb_device *dev, PRTMP_ADAPTER pAd)
-{
- struct net_device *net_dev = NULL;
-
-
- DBGPRINT(RT_DEBUG_ERROR, ("rtusb_disconnect: unregister usbnet usb-%s-%s\n",
- dev->bus->bus_name, dev->devpath));
- if (!pAd)
- {
- usb_put_dev(dev);
-
- printk("rtusb_disconnect: pAd == NULL!\n");
- return;
- }
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST);
-
-
-
- // for debug, wait to show some messages to /proc system
- udelay(1);
-
-
-
-
- net_dev = pAd->net_dev;
- if (pAd->net_dev != NULL)
- {
- printk("rtusb_disconnect: unregister_netdev(), dev->name=%s!\n", net_dev->name);
- unregister_netdev (pAd->net_dev);
- }
- udelay(1);
- flush_scheduled_work();
- udelay(1);
-
- // free net_device memory
- free_netdev(net_dev);
-
- // free adapter memory
- RTMPFreeAdapter(pAd);
-
- // release a use of the usb device structure
- usb_put_dev(dev);
- udelay(1);
-
- DBGPRINT(RT_DEBUG_ERROR, (" RTUSB disconnect successfully\n"));
-}
-
-
-/*
-========================================================================
-Routine Description:
- Probe RT28XX chipset.
-
-Arguments:
- *dev Point to the PCI or USB device
- interface
- *id_table Point to the PCI or USB device ID
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-static int rtusb_probe (struct usb_interface *intf,
- const struct usb_device_id *id)
-{
- PRTMP_ADAPTER pAd;
- return (int)rt28xx_probe((void *)intf, (void *)id, 0, &pAd);
-}
-
-
-static void rtusb_disconnect(struct usb_interface *intf)
-{
- struct usb_device *dev = interface_to_usbdev(intf);
- PRTMP_ADAPTER pAd;
-
-
- pAd = usb_get_intfdata(intf);
- usb_set_intfdata(intf, NULL);
-
- _rtusb_disconnect(dev, pAd);
-}
-
-
-/*
-========================================================================
-Routine Description:
- Close kernel threads.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- NONE
-
-Note:
-========================================================================
-*/
-VOID RT28xxThreadTerminate(
- IN RTMP_ADAPTER *pAd)
-{
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
- INT ret;
-
-
- // Sleep 50 milliseconds so pending io might finish normally
- RTMPusecDelay(50000);
-
- // We want to wait until all pending receives and sends to the
- // device object. We cancel any
- // irps. Wait until sends and receives have stopped.
- RTUSBCancelPendingIRPs(pAd);
-
- // Terminate Threads
-
- if (pid_nr(pObj->TimerQThr_pid) > 0)
- {
- POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
-
- printk("Terminate the TimerQThr_pid=%d!\n", pid_nr(pObj->TimerQThr_pid));
- mb();
- pAd->TimerFunc_kill = 1;
- mb();
- ret = kill_pid(pObj->TimerQThr_pid, SIGTERM, 1);
- if (ret)
- {
- printk(KERN_WARNING "%s: unable to stop TimerQThread, pid=%d, ret=%d!\n",
- pAd->net_dev->name, pid_nr(pObj->TimerQThr_pid), ret);
- }
- else
- {
- wait_for_completion(&pAd->TimerQComplete);
- pObj->TimerQThr_pid = NULL;
- }
- }
-
- if (pid_nr(pObj->MLMEThr_pid) > 0)
- {
- printk("Terminate the MLMEThr_pid=%d!\n", pid_nr(pObj->MLMEThr_pid));
- mb();
- pAd->mlme_kill = 1;
- //RT28XX_MLME_HANDLER(pAd);
- mb();
- ret = kill_pid(pObj->MLMEThr_pid, SIGTERM, 1);
- if (ret)
- {
- printk (KERN_WARNING "%s: unable to Mlme thread, pid=%d, ret=%d!\n",
- pAd->net_dev->name, pid_nr(pObj->MLMEThr_pid), ret);
- }
- else
- {
- //wait_for_completion (&pAd->notify);
- wait_for_completion (&pAd->mlmeComplete);
- pObj->MLMEThr_pid = NULL;
- }
- }
-
- if (pid_nr(pObj->RTUSBCmdThr_pid) > 0)
- {
- printk("Terminate the RTUSBCmdThr_pid=%d!\n", pid_nr(pObj->RTUSBCmdThr_pid));
- mb();
- NdisAcquireSpinLock(&pAd->CmdQLock);
- pAd->CmdQ.CmdQState = RT2870_THREAD_STOPED;
- NdisReleaseSpinLock(&pAd->CmdQLock);
- mb();
- //RTUSBCMDUp(pAd);
- ret = kill_pid(pObj->RTUSBCmdThr_pid, SIGTERM, 1);
- if (ret)
- {
- printk(KERN_WARNING "%s: unable to RTUSBCmd thread, pid=%d, ret=%d!\n",
- pAd->net_dev->name, pid_nr(pObj->RTUSBCmdThr_pid), ret);
- }
- else
- {
- //wait_for_completion (&pAd->notify);
- wait_for_completion (&pAd->CmdQComplete);
- pObj->RTUSBCmdThr_pid = NULL;
- }
- }
-
- // Kill tasklets
- pAd->mlme_kill = 0;
- pAd->CmdQ.CmdQState = RT2870_THREAD_UNKNOWN;
- pAd->TimerFunc_kill = 0;
-}
-
-
-void kill_thread_task(IN PRTMP_ADAPTER pAd)
-{
- POS_COOKIE pObj;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- tasklet_kill(&pObj->rx_done_task);
- tasklet_kill(&pObj->mgmt_dma_done_task);
- tasklet_kill(&pObj->ac0_dma_done_task);
- tasklet_kill(&pObj->ac1_dma_done_task);
- tasklet_kill(&pObj->ac2_dma_done_task);
- tasklet_kill(&pObj->ac3_dma_done_task);
- tasklet_kill(&pObj->hcca_dma_done_task);
- tasklet_kill(&pObj->tbtt_task);
-
-}
-
-
-/*
-========================================================================
-Routine Description:
- Check the chipset vendor/product ID.
-
-Arguments:
- _dev_p Point to the PCI or USB device
-
-Return Value:
- TRUE Check ok
- FALSE Check fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXChipsetCheck(
- IN void *_dev_p)
-{
- struct usb_interface *intf = (struct usb_interface *)_dev_p;
- struct usb_device *dev_p = interface_to_usbdev(intf);
- UINT32 i;
-
-
- for(i=0; i<rtusb_usb_id_len; i++)
- {
- if (dev_p->descriptor.idVendor == rtusb_usb_id[i].idVendor &&
- dev_p->descriptor.idProduct == rtusb_usb_id[i].idProduct)
- {
- printk("rt2870: idVendor = 0x%x, idProduct = 0x%x\n",
- dev_p->descriptor.idVendor, dev_p->descriptor.idProduct);
- break;
- }
- }
-
- if (i == rtusb_usb_id_len)
- {
- printk("rt2870: Error! Device Descriptor not matching!\n");
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Init net device structure.
-
-Arguments:
- _dev_p Point to the PCI or USB device
- *net_dev Point to the net device
- *pAd the raxx interface data pointer
-
-Return Value:
- TRUE Init ok
- FALSE Init fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXNetDevInit(
- IN void *_dev_p,
- IN struct net_device *net_dev,
- IN RTMP_ADAPTER *pAd)
-{
- struct usb_interface *intf = (struct usb_interface *)_dev_p;
- struct usb_device *dev_p = interface_to_usbdev(intf);
-
-
- pAd->config = &dev_p->config->desc;
- return TRUE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Init net device structure.
-
-Arguments:
- _dev_p Point to the PCI or USB device
- *pAd the raxx interface data pointer
-
-Return Value:
- TRUE Config ok
- FALSE Config fail
-
-Note:
-========================================================================
-*/
-BOOLEAN RT28XXProbePostConfig(
- IN void *_dev_p,
- IN RTMP_ADAPTER *pAd,
- IN INT32 interface)
-{
- struct usb_interface *intf = (struct usb_interface *)_dev_p;
- struct usb_host_interface *iface_desc;
- ULONG BulkOutIdx;
- UINT32 i;
-
-
- /* get the active interface descriptor */
- iface_desc = intf->cur_altsetting;
-
- /* get # of enpoints */
- pAd->NumberOfPipes = iface_desc->desc.bNumEndpoints;
- DBGPRINT(RT_DEBUG_TRACE,
- ("NumEndpoints=%d\n", iface_desc->desc.bNumEndpoints));
-
- /* Configure Pipes */
- BulkOutIdx = 0;
-
- for(i=0; i<pAd->NumberOfPipes; i++)
- {
- if ((iface_desc->endpoint[i].desc.bmAttributes ==
- USB_ENDPOINT_XFER_BULK) &&
- ((iface_desc->endpoint[i].desc.bEndpointAddress &
- USB_ENDPOINT_DIR_MASK) == USB_DIR_IN))
- {
- pAd->BulkInEpAddr = iface_desc->endpoint[i].desc.bEndpointAddress;
- pAd->BulkInMaxPacketSize = iface_desc->endpoint[i].desc.wMaxPacketSize;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,
- ("BULK IN MaximumPacketSize = %d\n", pAd->BulkInMaxPacketSize));
- DBGPRINT_RAW(RT_DEBUG_TRACE,
- ("EP address = 0x%2x\n", iface_desc->endpoint[i].desc.bEndpointAddress));
- }
- else if ((iface_desc->endpoint[i].desc.bmAttributes ==
- USB_ENDPOINT_XFER_BULK) &&
- ((iface_desc->endpoint[i].desc.bEndpointAddress &
- USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT))
- {
- // there are 6 bulk out EP. EP6 highest priority.
- // EP1-4 is EDCA. EP5 is HCCA.
- pAd->BulkOutEpAddr[BulkOutIdx++] = iface_desc->endpoint[i].desc.bEndpointAddress;
- pAd->BulkOutMaxPacketSize = iface_desc->endpoint[i].desc.wMaxPacketSize;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,
- ("BULK OUT MaximumPacketSize = %d\n", pAd->BulkOutMaxPacketSize));
- DBGPRINT_RAW(RT_DEBUG_TRACE,
- ("EP address = 0x%2x \n", iface_desc->endpoint[i].desc.bEndpointAddress));
- }
- }
-
- if (!(pAd->BulkInEpAddr && pAd->BulkOutEpAddr[0]))
- {
- printk("%s: Could not find both bulk-in and bulk-out endpoints\n", __func__);
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Disable DMA.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28XXDMADisable(
- IN RTMP_ADAPTER *pAd)
-{
- // no use
-}
-
-
-
-/*
-========================================================================
-Routine Description:
- Enable DMA.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28XXDMAEnable(
- IN RTMP_ADAPTER *pAd)
-{
- WPDMA_GLO_CFG_STRUC GloCfg;
- USB_DMA_CFG_STRUC UsbCfg;
- int i = 0;
-
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x4);
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> DMABusy\n"));
- RTMPusecDelay(1000);
- i++;
- }while ( i <200);
-
-
- RTMPusecDelay(50);
- GloCfg.field.EnTXWriteBackDDONE = 1;
- GloCfg.field.EnableRxDMA = 1;
- GloCfg.field.EnableTxDMA = 1;
- DBGPRINT(RT_DEBUG_TRACE, ("<== WRITE DMA offset 0x208 = 0x%x\n", GloCfg.word));
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-
- UsbCfg.word = 0;
- UsbCfg.field.phyclear = 0;
- /* usb version is 1.1,do not use bulk in aggregation */
- if (pAd->BulkInMaxPacketSize == 512)
- UsbCfg.field.RxBulkAggEn = 1;
- /* for last packet, PBF might use more than limited, so minus 2 to prevent from error */
- UsbCfg.field.RxBulkAggLmt = (MAX_RXBULK_SIZE /1024)-3;
- UsbCfg.field.RxBulkAggTOut = 0x80; /* 2006-10-18 */
- UsbCfg.field.RxBulkEn = 1;
- UsbCfg.field.TxBulkEn = 1;
-
- RTUSBWriteMACRegister(pAd, USB_DMA_CFG, UsbCfg.word);
-
-}
-
-/*
-========================================================================
-Routine Description:
- Write Beacon buffer to Asic.
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RT28xx_UpdateBeaconToAsic(
- IN RTMP_ADAPTER *pAd,
- IN INT apidx,
- IN ULONG FrameLen,
- IN ULONG UpdatePos)
-{
- PUCHAR pBeaconFrame = NULL;
- UCHAR *ptr;
- UINT i, padding;
- BEACON_SYNC_STRUCT *pBeaconSync = pAd->CommonCfg.pBeaconSync;
- UINT32 longValue;
- BOOLEAN bBcnReq = FALSE;
- UCHAR bcn_idx = 0;
-
-
- if (pBeaconFrame == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR,("pBeaconFrame is NULL!\n"));
- return;
- }
-
- if (pBeaconSync == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR,("pBeaconSync is NULL!\n"));
- return;
- }
-
- //if ((pAd->WdsTab.Mode == WDS_BRIDGE_MODE) ||
- // ((pAd->ApCfg.MBSSID[apidx].MSSIDDev == NULL) || !(pAd->ApCfg.MBSSID[apidx].MSSIDDev->flags & IFF_UP))
- // )
- if (bBcnReq == FALSE)
- {
- /* when the ra interface is down, do not send its beacon frame */
- /* clear all zero */
- for(i=0; i<TXWI_SIZE; i+=4) {
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, 0x00);
- }
- pBeaconSync->BeaconBitMap &= (~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
- NdisZeroMemory(pBeaconSync->BeaconTxWI[bcn_idx], TXWI_SIZE);
- }
- else
- {
- ptr = (PUCHAR)&pAd->BeaconTxWI;
-
- if (NdisEqualMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE) == FALSE)
- { // If BeaconTxWI changed, we need to rewrite the TxWI for the Beacon frames.
- pBeaconSync->BeaconBitMap &= (~(BEACON_BITMAP_MASK & (1 << bcn_idx)));
- NdisMoveMemory(pBeaconSync->BeaconTxWI[bcn_idx], &pAd->BeaconTxWI, TXWI_SIZE);
- }
-
- if ((pBeaconSync->BeaconBitMap & (1 << bcn_idx)) != (1 << bcn_idx))
- {
- for (i=0; i<TXWI_SIZE; i+=4) // 16-byte TXWI field
- {
- longValue = *ptr + (*(ptr+1)<<8) + (*(ptr+2)<<16) + (*(ptr+3)<<24);
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[bcn_idx] + i, longValue);
- ptr += 4;
- }
- }
-
- ptr = pBeaconSync->BeaconBuf[bcn_idx];
- padding = (FrameLen & 0x01);
- NdisZeroMemory((PUCHAR)(pBeaconFrame + FrameLen), padding);
- FrameLen += padding;
- for (i = 0 ; i < FrameLen /*HW_BEACON_OFFSET*/; i += 2)
- {
- if (NdisEqualMemory(ptr, pBeaconFrame, 2) == FALSE)
- {
- NdisMoveMemory(ptr, pBeaconFrame, 2);
- //shortValue = *ptr + (*(ptr+1)<<8);
- //RTMP_IO_WRITE8(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, shortValue);
- RTUSBMultiWrite(pAd, pAd->BeaconOffset[bcn_idx] + TXWI_SIZE + i, ptr, 2);
- }
- ptr +=2;
- pBeaconFrame += 2;
- }
-
- pBeaconSync->BeaconBitMap |= (1 << bcn_idx);
-
- // For AP interface, set the DtimBitOn so that we can send Bcast/Mcast frame out after this beacon frame.
- }
-
-}
-
-
-VOID RT2870_BssBeaconStop(
- IN RTMP_ADAPTER *pAd)
-{
- BEACON_SYNC_STRUCT *pBeaconSync;
- int i, offset;
- BOOLEAN Cancelled = TRUE;
-
- pBeaconSync = pAd->CommonCfg.pBeaconSync;
- if (pBeaconSync && pBeaconSync->EnableBeacon)
- {
- INT NumOfBcn;
-
- NumOfBcn = MAX_MESH_NUM;
-
- RTMPCancelTimer(&pAd->CommonCfg.BeaconUpdateTimer, &Cancelled);
-
- for(i=0; i<NumOfBcn; i++)
- {
- NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
- NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
-
- for (offset=0; offset<HW_BEACON_OFFSET; offset+=4)
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[i] + offset, 0x00);
-
- pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
- pBeaconSync->TimIELocationInBeacon[i] = 0;
- }
- pBeaconSync->BeaconBitMap = 0;
- pBeaconSync->DtimBitOn = 0;
- }
-}
-
-
-VOID RT2870_BssBeaconStart(
- IN RTMP_ADAPTER *pAd)
-{
- int apidx;
- BEACON_SYNC_STRUCT *pBeaconSync;
-// LARGE_INTEGER tsfTime, deltaTime;
-
- pBeaconSync = pAd->CommonCfg.pBeaconSync;
- if (pBeaconSync && pBeaconSync->EnableBeacon)
- {
- INT NumOfBcn;
-
- NumOfBcn = MAX_MESH_NUM;
-
- for(apidx=0; apidx<NumOfBcn; apidx++)
- {
- UCHAR CapabilityInfoLocationInBeacon = 0;
- UCHAR TimIELocationInBeacon = 0;
-
- NdisZeroMemory(pBeaconSync->BeaconBuf[apidx], HW_BEACON_OFFSET);
- pBeaconSync->CapabilityInfoLocationInBeacon[apidx] = CapabilityInfoLocationInBeacon;
- pBeaconSync->TimIELocationInBeacon[apidx] = TimIELocationInBeacon;
- NdisZeroMemory(pBeaconSync->BeaconTxWI[apidx], TXWI_SIZE);
- }
- pBeaconSync->BeaconBitMap = 0;
- pBeaconSync->DtimBitOn = 0;
- pAd->CommonCfg.BeaconUpdateTimer.Repeat = TRUE;
-
- pAd->CommonCfg.BeaconAdjust = 0;
- pAd->CommonCfg.BeaconFactor = 0xffffffff / (pAd->CommonCfg.BeaconPeriod << 10);
- pAd->CommonCfg.BeaconRemain = (0xffffffff % (pAd->CommonCfg.BeaconPeriod << 10)) + 1;
- printk(RT28xx_CHIP_NAME "_BssBeaconStart:BeaconFactor=%d, BeaconRemain=%d!\n", pAd->CommonCfg.BeaconFactor, pAd->CommonCfg.BeaconRemain);
- RTMPSetTimer(&pAd->CommonCfg.BeaconUpdateTimer, pAd->CommonCfg.BeaconPeriod);
-
- }
-}
-
-
-VOID RT2870_BssBeaconInit(
- IN RTMP_ADAPTER *pAd)
-{
- BEACON_SYNC_STRUCT *pBeaconSync;
- int i;
-
- NdisAllocMemory(pAd->CommonCfg.pBeaconSync, sizeof(BEACON_SYNC_STRUCT), MEM_ALLOC_FLAG);
- if (pAd->CommonCfg.pBeaconSync)
- {
- pBeaconSync = pAd->CommonCfg.pBeaconSync;
- NdisZeroMemory(pBeaconSync, sizeof(BEACON_SYNC_STRUCT));
- for(i=0; i < HW_BEACON_MAX_COUNT; i++)
- {
- NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
- pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
- pBeaconSync->TimIELocationInBeacon[i] = 0;
- NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
- }
- pBeaconSync->BeaconBitMap = 0;
-
- //RTMPInitTimer(pAd, &pAd->CommonCfg.BeaconUpdateTimer, GET_TIMER_FUNCTION(BeaconUpdateExec), pAd, TRUE);
- pBeaconSync->EnableBeacon = TRUE;
- }
-}
-
-
-VOID RT2870_BssBeaconExit(
- IN RTMP_ADAPTER *pAd)
-{
- BEACON_SYNC_STRUCT *pBeaconSync;
- BOOLEAN Cancelled = TRUE;
- int i;
-
- if (pAd->CommonCfg.pBeaconSync)
- {
- pBeaconSync = pAd->CommonCfg.pBeaconSync;
- pBeaconSync->EnableBeacon = FALSE;
- RTMPCancelTimer(&pAd->CommonCfg.BeaconUpdateTimer, &Cancelled);
- pBeaconSync->BeaconBitMap = 0;
-
- for(i=0; i<HW_BEACON_MAX_COUNT; i++)
- {
- NdisZeroMemory(pBeaconSync->BeaconBuf[i], HW_BEACON_OFFSET);
- pBeaconSync->CapabilityInfoLocationInBeacon[i] = 0;
- pBeaconSync->TimIELocationInBeacon[i] = 0;
- NdisZeroMemory(pBeaconSync->BeaconTxWI[i], TXWI_SIZE);
- }
-
- NdisFreeMemory(pAd->CommonCfg.pBeaconSync, HW_BEACON_OFFSET * HW_BEACON_MAX_COUNT, 0);
- pAd->CommonCfg.pBeaconSync = NULL;
- }
-}
-
-VOID BeaconUpdateExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)FunctionContext;
- LARGE_INTEGER tsfTime_a;//, tsfTime_b, deltaTime_exp, deltaTime_ab;
- UINT32 delta, remain, remain_low, remain_high;
-// BOOLEAN positive;
-
- ReSyncBeaconTime(pAd);
-
-
-
- RTMP_IO_READ32(pAd, TSF_TIMER_DW0, &tsfTime_a.u.LowPart);
- RTMP_IO_READ32(pAd, TSF_TIMER_DW1, &tsfTime_a.u.HighPart);
-
-
- //positive=getDeltaTime(tsfTime_a, expectedTime, &deltaTime_exp);
- remain_high = pAd->CommonCfg.BeaconRemain * tsfTime_a.u.HighPart;
- remain_low = tsfTime_a.u.LowPart % (pAd->CommonCfg.BeaconPeriod << 10);
- remain = (remain_high + remain_low)%(pAd->CommonCfg.BeaconPeriod << 10);
- delta = (pAd->CommonCfg.BeaconPeriod << 10) - remain;
-
- pAd->CommonCfg.BeaconUpdateTimer.TimerValue = (delta >> 10) + 10;
-
-}
-
diff --git a/drivers/staging/rt2870/Makefile b/drivers/staging/rt2870/Makefile
index 306c33113c58..661cdf9b6157 100644
--- a/drivers/staging/rt2870/Makefile
+++ b/drivers/staging/rt2870/Makefile
@@ -1,27 +1,36 @@
+#
obj-$(CONFIG_RT2870) += rt2870sta.o
# TODO: all of these should be removed
EXTRA_CFLAGS += -DLINUX -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT
-EXTRA_CFLAGS += -DRT2870 -DRT3070
+EXTRA_CFLAGS += -DRTMP_MAC_USB -DRTMP_USB_SUPPORT -DRT2870 -DRTMP_TIMER_TASK_SUPPORT
+EXTRA_CFLAGS += -DRTMP_RF_RW_SUPPORT -DRTMP_EFUSE_SUPPORT -DRT30xx -DRT3070
EXTRA_CFLAGS += -DDBG
rt2870sta-objs := \
- common/md5.o \
+ common/crypt_md5.o \
+ common/crypt_sha2.o \
+ common/crypt_hmac.o \
common/mlme.o \
- common/rtmp_wep.o \
+ common/cmm_wep.o \
common/action.o \
common/cmm_data.o \
common/rtmp_init.o \
- common/rtmp_tkip.o \
+ common/cmm_tkip.o \
+ common/cmm_aes.o \
common/cmm_sync.o \
common/eeprom.o \
common/cmm_sanity.o \
common/cmm_info.o \
+ common/cmm_cfg.o \
common/cmm_wpa.o \
common/dfs.o \
common/spectrum.o \
+ common/rtmp_timer.o \
+ common/rt_channel.o \
+ common/cmm_profile.o \
+ common/cmm_asic.o \
sta/assoc.o \
- sta/aironet.o \
sta/auth.o \
sta/auth_rsp.o \
sta/sync.o \
@@ -34,10 +43,15 @@ rt2870sta-objs := \
rt_main_dev.o \
sta_ioctl.o \
common/ba_action.o \
- 2870_main_dev.o \
- common/2870_rtmp_init.o \
+ usb_main_dev.o \
+ rt_usb.o \
+ common/cmm_mac_usb.o \
common/rtusb_io.o \
common/rtusb_bulk.o \
common/rtusb_data.o \
- common/cmm_data_2870.o
-
+ common/cmm_data_usb.o \
+ common/rtmp_mcu.o \
+ common/ee_efuse.o \
+ chips/rt30xx.o \
+ common/rt_rf.o \
+ chips/rt3070.o
diff --git a/drivers/staging/rt2870/chips/rt3070.c b/drivers/staging/rt2870/chips/rt3070.c
new file mode 100644
index 000000000000..3a6db5ea89ab
--- /dev/null
+++ b/drivers/staging/rt2870/chips/rt3070.c
@@ -0,0 +1 @@
+#include "../../rt2860/chips/rt3070.c"
diff --git a/drivers/staging/rt2870/chips/rt30xx.c b/drivers/staging/rt2870/chips/rt30xx.c
new file mode 100644
index 000000000000..6c56b84c75d9
--- /dev/null
+++ b/drivers/staging/rt2870/chips/rt30xx.c
@@ -0,0 +1 @@
+#include "../../rt2860/chips/rt30xx.c"
diff --git a/drivers/staging/rt2870/common/2870_rtmp_init.c b/drivers/staging/rt2870/common/2870_rtmp_init.c
deleted file mode 100644
index f517d9e90271..000000000000
--- a/drivers/staging/rt2870/common/2870_rtmp_init.c
+++ /dev/null
@@ -1,1730 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- 2870_rtmp_init.c
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 2002-08-01 created
- John Chang 2004-08-20 RT2561/2661 use scatter-gather scheme
- Jan Lee 2006-09-15 RT2860. Change for 802.11n , EEPROM, Led, BA, HT.
- Sample Lin 2007-05-31 Merge RT2860 and RT2870 drivers.
-*/
-
-#include "../rt_config.h"
-
-
-static void rx_done_tasklet(unsigned long data);
-static void rt2870_hcca_dma_done_tasklet(unsigned long data);
-static void rt2870_ac3_dma_done_tasklet(unsigned long data);
-static void rt2870_ac2_dma_done_tasklet(unsigned long data);
-static void rt2870_ac1_dma_done_tasklet(unsigned long data);
-static void rt2870_ac0_dma_done_tasklet(unsigned long data);
-static void rt2870_mgmt_dma_done_tasklet(unsigned long data);
-static void rt2870_null_frame_complete_tasklet(unsigned long data);
-static void rt2870_rts_frame_complete_tasklet(unsigned long data);
-static void rt2870_pspoll_frame_complete_tasklet(unsigned long data);
-static void rt2870_dataout_complete_tasklet(unsigned long data);
-
-
-/*
-========================================================================
-Routine Description:
- Initialize receive data structures.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_RESOURCES
-
-Note:
- Initialize all receive releated private buffer, include those define
- in RTMP_ADAPTER structure and all private data structures. The mahor
- work is to allocate buffer for each packet and chain buffer to
- NDIS packet descriptor.
-========================================================================
-*/
-NDIS_STATUS NICInitRecv(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR i;
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n"));
- pObj = pObj;
-
- //InterlockedExchange(&pAd->PendingRx, 0);
- pAd->PendingRx = 0;
- pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index
- pAd->NextRxBulkInIndex = 0 ; //RX_RING_SIZE -1; // Rx Bulk pointer
- pAd->NextRxBulkInPosition = 0;
-
- for (i = 0; i < (RX_RING_SIZE); i++)
- {
- PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
-
- //Allocate URB
- pRxContext->pUrb = RTUSB_ALLOC_URB(0);
- if (pRxContext->pUrb == NULL)
- {
- Status = NDIS_STATUS_RESOURCES;
- goto out1;
- }
-
- // Allocate transfer buffer
- pRxContext->TransferBuffer = RTUSB_URB_ALLOC_BUFFER(pObj->pUsb_Dev, MAX_RXBULK_SIZE, &pRxContext->data_dma);
- if (pRxContext->TransferBuffer == NULL)
- {
- Status = NDIS_STATUS_RESOURCES;
- goto out1;
- }
-
- NdisZeroMemory(pRxContext->TransferBuffer, MAX_RXBULK_SIZE);
-
- pRxContext->pAd = pAd;
- pRxContext->pIrp = NULL;
- pRxContext->InUse = FALSE;
- pRxContext->IRPPending = FALSE;
- pRxContext->Readable = FALSE;
- //pRxContext->ReorderInUse = FALSE;
- pRxContext->bRxHandling = FALSE;
- pRxContext->BulkInOffset = 0;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitRecv\n"));
- return Status;
-
-out1:
- for (i = 0; i < (RX_RING_SIZE); i++)
- {
- PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
-
- if (NULL != pRxContext->TransferBuffer)
- {
- RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, MAX_RXBULK_SIZE,
- pRxContext->TransferBuffer, pRxContext->data_dma);
- pRxContext->TransferBuffer = NULL;
- }
-
- if (NULL != pRxContext->pUrb)
- {
- RTUSB_UNLINK_URB(pRxContext->pUrb);
- RTUSB_FREE_URB(pRxContext->pUrb);
- pRxContext->pUrb = NULL;
- }
- }
-
- return Status;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Initialize transmit data structures.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_RESOURCES
-
-Note:
-========================================================================
-*/
-NDIS_STATUS NICInitTransmit(
- IN PRTMP_ADAPTER pAd)
-{
-#define LM_USB_ALLOC(pObj, Context, TB_Type, BufferSize, Status, msg1, err1, msg2, err2) \
- Context->pUrb = RTUSB_ALLOC_URB(0); \
- if (Context->pUrb == NULL) { \
- DBGPRINT(RT_DEBUG_ERROR, msg1); \
- Status = NDIS_STATUS_RESOURCES; \
- goto err1; } \
- \
- Context->TransferBuffer = \
- (TB_Type)RTUSB_URB_ALLOC_BUFFER(pObj->pUsb_Dev, BufferSize, &Context->data_dma); \
- if (Context->TransferBuffer == NULL) { \
- DBGPRINT(RT_DEBUG_ERROR, msg2); \
- Status = NDIS_STATUS_RESOURCES; \
- goto err2; }
-
-#define LM_URB_FREE(pObj, Context, BufferSize) \
- if (NULL != Context->pUrb) { \
- RTUSB_UNLINK_URB(Context->pUrb); \
- RTUSB_FREE_URB(Context->pUrb); \
- Context->pUrb = NULL; } \
- if (NULL != Context->TransferBuffer) { \
- RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, BufferSize, \
- Context->TransferBuffer, \
- Context->data_dma); \
- Context->TransferBuffer = NULL; }
-
- UCHAR i, acidx;
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- PTX_CONTEXT pNullContext = &(pAd->NullContext);
- PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext);
- PTX_CONTEXT pRTSContext = &(pAd->RTSContext);
- PTX_CONTEXT pMLMEContext = NULL;
-// PHT_TX_CONTEXT pHTTXContext = NULL;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
- PVOID RingBaseVa;
-// RTMP_TX_RING *pTxRing;
- RTMP_MGMT_RING *pMgmtRing;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitTransmit\n"));
- pObj = pObj;
-
- // Init 4 set of Tx parameters
- for(acidx = 0; acidx < NUM_OF_TX_RING; acidx++)
- {
- // Initialize all Transmit releated queues
- InitializeQueueHeader(&pAd->TxSwQueue[acidx]);
-
- // Next Local tx ring pointer waiting for buck out
- pAd->NextBulkOutIndex[acidx] = acidx;
- pAd->BulkOutPending[acidx] = FALSE; // Buck Out control flag
- //pAd->DataBulkDoneIdx[acidx] = 0;
- }
-
- //pAd->NextMLMEIndex = 0;
- //pAd->PushMgmtIndex = 0;
- //pAd->PopMgmtIndex = 0;
- //InterlockedExchange(&pAd->MgmtQueueSize, 0);
- //InterlockedExchange(&pAd->TxCount, 0);
-
- //pAd->PrioRingFirstIndex = 0;
- //pAd->PrioRingTxCnt = 0;
-
- do
- {
- //
- // TX_RING_SIZE, 4 ACs
- //
- for(acidx=0; acidx<4; acidx++)
- {
- PHT_TX_CONTEXT pHTTXContext = &(pAd->TxContext[acidx]);
-
- NdisZeroMemory(pHTTXContext, sizeof(HT_TX_CONTEXT));
- //Allocate URB
- LM_USB_ALLOC(pObj, pHTTXContext, PHTTX_BUFFER, sizeof(HTTX_BUFFER), Status,
- ("<-- ERROR in Alloc TX TxContext[%d] urb!! \n", acidx),
- done,
- ("<-- ERROR in Alloc TX TxContext[%d] HTTX_BUFFER !! \n", acidx),
- out1);
-
- NdisZeroMemory(pHTTXContext->TransferBuffer->Aggregation, 4);
- pHTTXContext->pAd = pAd;
- pHTTXContext->pIrp = NULL;
- pHTTXContext->IRPPending = FALSE;
- pHTTXContext->NextBulkOutPosition = 0;
- pHTTXContext->ENextBulkOutPosition = 0;
- pHTTXContext->CurWritePosition = 0;
- pHTTXContext->CurWriteRealPos = 0;
- pHTTXContext->BulkOutSize = 0;
- pHTTXContext->BulkOutPipeId = acidx;
- pHTTXContext->bRingEmpty = TRUE;
- pHTTXContext->bCopySavePad = FALSE;
-
- pAd->BulkOutPending[acidx] = FALSE;
- }
-
-
- //
- // MGMT_RING_SIZE
- //
- // Allocate MGMT ring descriptor's memory
- pAd->MgmtDescRing.AllocSize = MGMT_RING_SIZE * sizeof(TX_CONTEXT);
- RTMPAllocateMemory(&pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize);
- if (pAd->MgmtDescRing.AllocVa == NULL)
- {
- DBGPRINT_ERR(("Failed to allocate a big buffer for MgmtDescRing!\n"));
- Status = NDIS_STATUS_RESOURCES;
- goto out1;
- }
- NdisZeroMemory(pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize);
- RingBaseVa = pAd->MgmtDescRing.AllocVa;
-
- // Initialize MGMT Ring and associated buffer memory
- pMgmtRing = &pAd->MgmtRing;
- for (i = 0; i < MGMT_RING_SIZE; i++)
- {
- // link the pre-allocated Mgmt buffer to MgmtRing.Cell
- pMgmtRing->Cell[i].AllocSize = sizeof(TX_CONTEXT);
- pMgmtRing->Cell[i].AllocVa = RingBaseVa;
- pMgmtRing->Cell[i].pNdisPacket = NULL;
- pMgmtRing->Cell[i].pNextNdisPacket = NULL;
-
- //Allocate URB for MLMEContext
- pMLMEContext = (PTX_CONTEXT) pAd->MgmtRing.Cell[i].AllocVa;
- pMLMEContext->pUrb = RTUSB_ALLOC_URB(0);
- if (pMLMEContext->pUrb == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("<-- ERROR in Alloc TX MLMEContext[%d] urb!! \n", i));
- Status = NDIS_STATUS_RESOURCES;
- goto out2;
- }
- pMLMEContext->pAd = pAd;
- pMLMEContext->pIrp = NULL;
- pMLMEContext->TransferBuffer = NULL;
- pMLMEContext->InUse = FALSE;
- pMLMEContext->IRPPending = FALSE;
- pMLMEContext->bWaitingBulkOut = FALSE;
- pMLMEContext->BulkOutSize = 0;
- pMLMEContext->SelfIdx = i;
-
- // Offset to next ring descriptor address
- RingBaseVa = (PUCHAR) RingBaseVa + sizeof(TX_CONTEXT);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("MGMT Ring: total %d entry allocated\n", i));
-
- //pAd->MgmtRing.TxSwFreeIdx = (MGMT_RING_SIZE - 1);
- pAd->MgmtRing.TxSwFreeIdx = MGMT_RING_SIZE;
- pAd->MgmtRing.TxCpuIdx = 0;
- pAd->MgmtRing.TxDmaIdx = 0;
-
- //
- // BEACON_RING_SIZE
- //
- for(i=0; i<BEACON_RING_SIZE; i++) // 2
- {
- PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
-
-
- NdisZeroMemory(pBeaconContext, sizeof(TX_CONTEXT));
-
- //Allocate URB
- LM_USB_ALLOC(pObj, pBeaconContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
- ("<-- ERROR in Alloc TX BeaconContext[%d] urb!! \n", i),
- out2,
- ("<-- ERROR in Alloc TX BeaconContext[%d] TX_BUFFER !! \n", i),
- out3);
-
- pBeaconContext->pAd = pAd;
- pBeaconContext->pIrp = NULL;
- pBeaconContext->InUse = FALSE;
- pBeaconContext->IRPPending = FALSE;
- }
-
- //
- // NullContext
- //
- NdisZeroMemory(pNullContext, sizeof(TX_CONTEXT));
-
- //Allocate URB
- LM_USB_ALLOC(pObj, pNullContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
- ("<-- ERROR in Alloc TX NullContext urb!! \n"),
- out3,
- ("<-- ERROR in Alloc TX NullContext TX_BUFFER !! \n"),
- out4);
-
- pNullContext->pAd = pAd;
- pNullContext->pIrp = NULL;
- pNullContext->InUse = FALSE;
- pNullContext->IRPPending = FALSE;
-
- //
- // RTSContext
- //
- NdisZeroMemory(pRTSContext, sizeof(TX_CONTEXT));
-
- //Allocate URB
- LM_USB_ALLOC(pObj, pRTSContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
- ("<-- ERROR in Alloc TX RTSContext urb!! \n"),
- out4,
- ("<-- ERROR in Alloc TX RTSContext TX_BUFFER !! \n"),
- out5);
-
- pRTSContext->pAd = pAd;
- pRTSContext->pIrp = NULL;
- pRTSContext->InUse = FALSE;
- pRTSContext->IRPPending = FALSE;
-
- //
- // PsPollContext
- //
- //NdisZeroMemory(pPsPollContext, sizeof(TX_CONTEXT));
- //Allocate URB
- LM_USB_ALLOC(pObj, pPsPollContext, PTX_BUFFER, sizeof(TX_BUFFER), Status,
- ("<-- ERROR in Alloc TX PsPollContext urb!! \n"),
- out5,
- ("<-- ERROR in Alloc TX PsPollContext TX_BUFFER !! \n"),
- out6);
-
- pPsPollContext->pAd = pAd;
- pPsPollContext->pIrp = NULL;
- pPsPollContext->InUse = FALSE;
- pPsPollContext->IRPPending = FALSE;
- pPsPollContext->bAggregatible = FALSE;
- pPsPollContext->LastOne = TRUE;
-
- } while (FALSE);
-
-
-done:
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitTransmit\n"));
-
- return Status;
-
- /* --------------------------- ERROR HANDLE --------------------------- */
-out6:
- LM_URB_FREE(pObj, pPsPollContext, sizeof(TX_BUFFER));
-
-out5:
- LM_URB_FREE(pObj, pRTSContext, sizeof(TX_BUFFER));
-
-out4:
- LM_URB_FREE(pObj, pNullContext, sizeof(TX_BUFFER));
-
-out3:
- for(i=0; i<BEACON_RING_SIZE; i++)
- {
- PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
- if (pBeaconContext)
- LM_URB_FREE(pObj, pBeaconContext, sizeof(TX_BUFFER));
- }
-
-out2:
- if (pAd->MgmtDescRing.AllocVa)
- {
- pMgmtRing = &pAd->MgmtRing;
- for(i=0; i<MGMT_RING_SIZE; i++)
- {
- pMLMEContext = (PTX_CONTEXT) pAd->MgmtRing.Cell[i].AllocVa;
- if (pMLMEContext)
- LM_URB_FREE(pObj, pMLMEContext, sizeof(TX_BUFFER));
- }
- NdisFreeMemory(pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize, 0);
- pAd->MgmtDescRing.AllocVa = NULL;
- }
-
-out1:
- for (acidx = 0; acidx < 4; acidx++)
- {
- PHT_TX_CONTEXT pTxContext = &(pAd->TxContext[acidx]);
- if (pTxContext)
- LM_URB_FREE(pObj, pTxContext, sizeof(HTTX_BUFFER));
- }
-
- // Here we didn't have any pre-allocated memory need to free.
-
- return Status;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Allocate DMA memory blocks for send, receive.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
- NDIS_STATUS_RESOURCES
-
-Note:
-========================================================================
-*/
-NDIS_STATUS RTMPAllocTxRxRingMemory(
- IN PRTMP_ADAPTER pAd)
-{
-// COUNTER_802_11 pCounter = &pAd->WlanCounters;
- NDIS_STATUS Status;
- INT num;
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n"));
-
-
- do
- {
- // Init the CmdQ and CmdQLock
- NdisAllocateSpinLock(&pAd->CmdQLock);
- NdisAcquireSpinLock(&pAd->CmdQLock);
- RTUSBInitializeCmdQ(&pAd->CmdQ);
- NdisReleaseSpinLock(&pAd->CmdQLock);
-
-
- NdisAllocateSpinLock(&pAd->MLMEBulkOutLock);
- //NdisAllocateSpinLock(&pAd->MLMEWaitQueueLock);
- NdisAllocateSpinLock(&pAd->BulkOutLock[0]);
- NdisAllocateSpinLock(&pAd->BulkOutLock[1]);
- NdisAllocateSpinLock(&pAd->BulkOutLock[2]);
- NdisAllocateSpinLock(&pAd->BulkOutLock[3]);
- NdisAllocateSpinLock(&pAd->BulkOutLock[4]);
- NdisAllocateSpinLock(&pAd->BulkOutLock[5]);
- NdisAllocateSpinLock(&pAd->BulkInLock);
-
- for (num = 0; num < NUM_OF_TX_RING; num++)
- {
- NdisAllocateSpinLock(&pAd->TxContextQueueLock[num]);
- }
-
-// NdisAllocateSpinLock(&pAd->MemLock); // Not used in RT28XX
-
-// NdisAllocateSpinLock(&pAd->MacTabLock); // init it in UserCfgInit()
-// NdisAllocateSpinLock(&pAd->BATabLock); // init it in BATableInit()
-
-// for(num=0; num<MAX_LEN_OF_BA_REC_TABLE; num++)
-// {
-// NdisAllocateSpinLock(&pAd->BATable.BARecEntry[num].RxReRingLock);
-// }
-
- //
- // Init Mac Table
- //
-// MacTableInitialize(pAd);
-
- //
- // Init send data structures and related parameters
- //
- Status = NICInitTransmit(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- break;
-
- //
- // Init receive data structures and related parameters
- //
- Status = NICInitRecv(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- break;
-
- pAd->PendingIoCount = 1;
-
- } while (FALSE);
-
- NdisZeroMemory(&pAd->FragFrame, sizeof(FRAGMENT_FRAME));
- pAd->FragFrame.pFragPacket = RTMP_AllocateFragPacketBuffer(pAd, RX_BUFFER_NORMSIZE);
-
- if (pAd->FragFrame.pFragPacket == NULL)
- {
- Status = NDIS_STATUS_RESOURCES;
- }
-
- DBGPRINT_S(Status, ("<-- RTMPAllocTxRxRingMemory, Status=%x\n", Status));
- return Status;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Calls USB_InterfaceStop and frees memory allocated for the URBs
- calls NdisMDeregisterDevice and frees the memory
- allocated in VNetInitialize for the Adapter Object
-
-Arguments:
- *pAd the raxx interface data pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-VOID RTMPFreeTxRxRingMemory(
- IN PRTMP_ADAPTER pAd)
-{
-#define LM_URB_FREE(pObj, Context, BufferSize) \
- if (NULL != Context->pUrb) { \
- RTUSB_UNLINK_URB(Context->pUrb); \
- RTUSB_FREE_URB(Context->pUrb); \
- Context->pUrb = NULL; } \
- if (NULL != Context->TransferBuffer) { \
- RTUSB_URB_FREE_BUFFER(pObj->pUsb_Dev, BufferSize, \
- Context->TransferBuffer, \
- Context->data_dma); \
- Context->TransferBuffer = NULL; }
-
-
- UINT i, acidx;
- PTX_CONTEXT pNullContext = &pAd->NullContext;
- PTX_CONTEXT pPsPollContext = &pAd->PsPollContext;
- PTX_CONTEXT pRTSContext = &pAd->RTSContext;
-// PHT_TX_CONTEXT pHTTXContext;
- //PRTMP_REORDERBUF pReorderBuf;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
-// RTMP_TX_RING *pTxRing;
-
- DBGPRINT(RT_DEBUG_ERROR, ("---> RTMPFreeTxRxRingMemory\n"));
- pObj = pObj;
-
- // Free all resources for the RECEIVE buffer queue.
- for(i=0; i<(RX_RING_SIZE); i++)
- {
- PRX_CONTEXT pRxContext = &(pAd->RxContext[i]);
- if (pRxContext)
- LM_URB_FREE(pObj, pRxContext, MAX_RXBULK_SIZE);
- }
-
- // Free PsPoll frame resource
- LM_URB_FREE(pObj, pPsPollContext, sizeof(TX_BUFFER));
-
- // Free NULL frame resource
- LM_URB_FREE(pObj, pNullContext, sizeof(TX_BUFFER));
-
- // Free RTS frame resource
- LM_URB_FREE(pObj, pRTSContext, sizeof(TX_BUFFER));
-
-
- // Free beacon frame resource
- for(i=0; i<BEACON_RING_SIZE; i++)
- {
- PTX_CONTEXT pBeaconContext = &(pAd->BeaconContext[i]);
- if (pBeaconContext)
- LM_URB_FREE(pObj, pBeaconContext, sizeof(TX_BUFFER));
- }
-
-
- // Free mgmt frame resource
- for(i = 0; i < MGMT_RING_SIZE; i++)
- {
- PTX_CONTEXT pMLMEContext = (PTX_CONTEXT)pAd->MgmtRing.Cell[i].AllocVa;
- //LM_URB_FREE(pObj, pMLMEContext, sizeof(TX_BUFFER));
- if (NULL != pAd->MgmtRing.Cell[i].pNdisPacket)
- {
- RTMPFreeNdisPacket(pAd, pAd->MgmtRing.Cell[i].pNdisPacket);
- pAd->MgmtRing.Cell[i].pNdisPacket = NULL;
- pMLMEContext->TransferBuffer = NULL;
- }
-
- if (pMLMEContext)
- {
- if (NULL != pMLMEContext->pUrb)
- {
- RTUSB_UNLINK_URB(pMLMEContext->pUrb);
- RTUSB_FREE_URB(pMLMEContext->pUrb);
- pMLMEContext->pUrb = NULL;
- }
- }
- }
- if (pAd->MgmtDescRing.AllocVa)
- NdisFreeMemory(pAd->MgmtDescRing.AllocVa, pAd->MgmtDescRing.AllocSize, 0);
-
-
- // Free Tx frame resource
- for(acidx=0; acidx<4; acidx++)
- {
- PHT_TX_CONTEXT pHTTXContext = &(pAd->TxContext[acidx]);
- if (pHTTXContext)
- LM_URB_FREE(pObj, pHTTXContext, sizeof(HTTX_BUFFER));
- }
-
- if (pAd->FragFrame.pFragPacket)
- RELEASE_NDIS_PACKET(pAd, pAd->FragFrame.pFragPacket, NDIS_STATUS_SUCCESS);
-
- for(i=0; i<6; i++)
- {
- NdisFreeSpinLock(&pAd->BulkOutLock[i]);
- }
-
- NdisFreeSpinLock(&pAd->BulkInLock);
- NdisFreeSpinLock(&pAd->MLMEBulkOutLock);
-
- NdisFreeSpinLock(&pAd->CmdQLock);
-
- // Clear all pending bulk-out request flags.
- RTUSB_CLEAR_BULK_FLAG(pAd, 0xffffffff);
-
-// NdisFreeSpinLock(&pAd->MacTabLock);
-
-// for(i=0; i<MAX_LEN_OF_BA_REC_TABLE; i++)
-// {
-// NdisFreeSpinLock(&pAd->BATable.BARecEntry[i].RxReRingLock);
-// }
-
- DBGPRINT(RT_DEBUG_ERROR, ("<--- ReleaseAdapter\n"));
-}
-
-
-/*
-========================================================================
-Routine Description:
- Allocate memory for adapter control block.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
- NDIS_STATUS_RESOURCES
-
-Note:
-========================================================================
-*/
-NDIS_STATUS AdapterBlockAllocateMemory(
- IN PVOID handle,
- OUT PVOID *ppAd)
-{
- PUSB_DEV usb_dev;
- POS_COOKIE pObj = (POS_COOKIE) handle;
-
-
- usb_dev = pObj->pUsb_Dev;
-
- pObj->MLMEThr_pid = NULL;
- pObj->RTUSBCmdThr_pid = NULL;
-
- *ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER));
-
- if (*ppAd)
- {
- NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
- ((PRTMP_ADAPTER)*ppAd)->OS_Cookie = handle;
- return (NDIS_STATUS_SUCCESS);
- }
- else
- {
- return (NDIS_STATUS_FAILURE);
- }
-}
-
-
-/*
-========================================================================
-Routine Description:
- Create kernel threads & tasklets.
-
-Arguments:
- *net_dev Pointer to wireless net device interface
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
-
-Note:
-========================================================================
-*/
-NDIS_STATUS CreateThreads(
- IN struct net_device *net_dev)
-{
- PRTMP_ADAPTER pAd = net_dev->ml_priv;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
- pid_t pid_number;
-
- //init_MUTEX(&(pAd->usbdev_semaphore));
-
- init_MUTEX_LOCKED(&(pAd->mlme_semaphore));
- init_completion (&pAd->mlmeComplete);
-
- init_MUTEX_LOCKED(&(pAd->RTUSBCmd_semaphore));
- init_completion (&pAd->CmdQComplete);
-
- init_MUTEX_LOCKED(&(pAd->RTUSBTimer_semaphore));
- init_completion (&pAd->TimerQComplete);
-
- // Creat MLME Thread
- pObj->MLMEThr_pid = NULL;
- pid_number = kernel_thread(MlmeThread, pAd, CLONE_VM);
- if (pid_number < 0)
- {
- printk (KERN_WARNING "%s: unable to start Mlme thread\n",pAd->net_dev->name);
- return NDIS_STATUS_FAILURE;
- }
-
- pObj->MLMEThr_pid = find_get_pid(pid_number);
-
- // Wait for the thread to start
- wait_for_completion(&(pAd->mlmeComplete));
-
- // Creat Command Thread
- pObj->RTUSBCmdThr_pid = NULL;
- pid_number = kernel_thread(RTUSBCmdThread, pAd, CLONE_VM);
- if (pid_number < 0)
- {
- printk (KERN_WARNING "%s: unable to start RTUSBCmd thread\n",pAd->net_dev->name);
- return NDIS_STATUS_FAILURE;
- }
-
- pObj->RTUSBCmdThr_pid = find_get_pid(pid_number);
-
- wait_for_completion(&(pAd->CmdQComplete));
-
- pObj->TimerQThr_pid = NULL;
- pid_number = kernel_thread(TimerQThread, pAd, CLONE_VM);
- if (pid_number < 0)
- {
- printk (KERN_WARNING "%s: unable to start TimerQThread\n",pAd->net_dev->name);
- return NDIS_STATUS_FAILURE;
- }
-
- pObj->TimerQThr_pid = find_get_pid(pid_number);
-
- // Wait for the thread to start
- wait_for_completion(&(pAd->TimerQComplete));
-
- // Create receive tasklet
- tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (ULONG)pAd);
- tasklet_init(&pObj->mgmt_dma_done_task, rt2870_mgmt_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac0_dma_done_task, rt2870_ac0_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac1_dma_done_task, rt2870_ac1_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac2_dma_done_task, rt2870_ac2_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->ac3_dma_done_task, rt2870_ac3_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->hcca_dma_done_task, rt2870_hcca_dma_done_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->tbtt_task, tbtt_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->null_frame_complete_task, rt2870_null_frame_complete_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->rts_frame_complete_task, rt2870_rts_frame_complete_tasklet, (unsigned long)pAd);
- tasklet_init(&pObj->pspoll_frame_complete_task, rt2870_pspoll_frame_complete_tasklet, (unsigned long)pAd);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-/*
-========================================================================
-Routine Description:
- As STA's BSSID is a WC too, it uses shared key table.
- This function write correct unicast TX key to ASIC WCID.
- And we still make a copy in our MacTab.Content[BSSID_WCID].PairwiseKey.
- Caller guarantee TKIP/AES always has keyidx = 0. (pairwise key)
- Caller guarantee WEP calls this function when set Txkey, default key index=0~3.
-
-Arguments:
- pAd Pointer to our adapter
- pKey Pointer to the where the key stored
-
-Return Value:
- NDIS_SUCCESS Add key successfully
-
-Note:
-========================================================================
-*/
-VOID RTMPAddBSSIDCipher(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Aid,
- IN PNDIS_802_11_KEY pKey,
- IN UCHAR CipherAlg)
-{
- PUCHAR pTxMic, pRxMic;
- BOOLEAN bKeyRSC, bAuthenticator; // indicate the receive SC set by KeyRSC value
-// UCHAR CipherAlg;
- UCHAR i;
- ULONG WCIDAttri;
- USHORT offset;
- UCHAR KeyIdx, IVEIV[8];
- UINT32 Value;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddBSSIDCipher==> Aid = %d\n",Aid));
-
- // Bit 29 of Add-key KeyRSC
- bKeyRSC = (pKey->KeyIndex & 0x20000000) ? TRUE : FALSE;
-
- // Bit 28 of Add-key Authenticator
- bAuthenticator = (pKey->KeyIndex & 0x10000000) ? TRUE : FALSE;
- KeyIdx = (UCHAR)pKey->KeyIndex&0xff;
-
- if (KeyIdx > 4)
- return;
-
-
- if (pAd->MacTab.Content[Aid].PairwiseKey.CipherAlg == CIPHER_TKIP)
- { if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- // for WPA-None Tx, Rx MIC is the same
- pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
- pRxMic = pTxMic;
- }
- else if (bAuthenticator == TRUE)
- {
- pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
- pRxMic = (PUCHAR) (&pKey->KeyMaterial) + 24;
- }
- else
- {
- pRxMic = (PUCHAR) (&pKey->KeyMaterial) + 16;
- pTxMic = (PUCHAR) (&pKey->KeyMaterial) + 24;
- }
-
- offset = PAIRWISE_KEY_TABLE_BASE + (Aid * HW_KEY_ENTRY_SIZE) + 0x10;
- for (i=0; i<8; )
- {
- Value = *(pTxMic+i);
- Value += (*(pTxMic+i+1)<<8);
- Value += (*(pTxMic+i+2)<<16);
- Value += (*(pTxMic+i+3)<<24);
- RTUSBWriteMACRegister(pAd, offset+i, Value);
- i+=4;
- }
-
- offset = PAIRWISE_KEY_TABLE_BASE + (Aid * HW_KEY_ENTRY_SIZE) + 0x18;
- for (i=0; i<8; )
- {
- Value = *(pRxMic+i);
- Value += (*(pRxMic+i+1)<<8);
- Value += (*(pRxMic+i+2)<<16);
- Value += (*(pRxMic+i+3)<<24);
- RTUSBWriteMACRegister(pAd, offset+i, Value);
- i+=4;
- }
-
- // Only Key lenth equal to TKIP key have these
- NdisMoveMemory(pAd->MacTab.Content[Aid].PairwiseKey.RxMic, pRxMic, 8);
- NdisMoveMemory(pAd->MacTab.Content[Aid].PairwiseKey.TxMic, pTxMic, 8);
-
- DBGPRINT(RT_DEBUG_TRACE,
- (" TxMIC = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x \n",
- pTxMic[0],pTxMic[1],pTxMic[2],pTxMic[3],
- pTxMic[4],pTxMic[5],pTxMic[6],pTxMic[7]));
- DBGPRINT(RT_DEBUG_TRACE,
- (" RxMIC = %02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x \n",
- pRxMic[0],pRxMic[1],pRxMic[2],pRxMic[3],
- pRxMic[4],pRxMic[5],pRxMic[6],pRxMic[7]));
- }
-
- // 2. Record Security Key.
- pAd->MacTab.Content[BSSID_WCID].PairwiseKey.KeyLen= (UCHAR)pKey->KeyLength;
- NdisMoveMemory(pAd->MacTab.Content[Aid].PairwiseKey.Key, &pKey->KeyMaterial, pKey->KeyLength);
-
- // 3. Check RxTsc. And used to init to ASIC IV.
- if (bKeyRSC == TRUE)
- NdisMoveMemory(pAd->MacTab.Content[Aid].PairwiseKey.RxTsc, &pKey->KeyRSC, 6);
- else
- NdisZeroMemory(pAd->MacTab.Content[Aid].PairwiseKey.RxTsc, 6);
-
- // 4. Init TxTsc to one based on WiFi WPA specs
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[0] = 1;
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[1] = 0;
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[2] = 0;
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[3] = 0;
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[4] = 0;
- pAd->MacTab.Content[Aid].PairwiseKey.TxTsc[5] = 0;
-
- CipherAlg = pAd->MacTab.Content[Aid].PairwiseKey.CipherAlg;
-
- offset = PAIRWISE_KEY_TABLE_BASE + (Aid * HW_KEY_ENTRY_SIZE);
- RTUSBMultiWrite(pAd, (USHORT) offset, pKey->KeyMaterial,
- ((pKey->KeyLength == LEN_TKIP_KEY) ? 16 : (USHORT)pKey->KeyLength));
-
- offset = SHARED_KEY_TABLE_BASE + (KeyIdx * HW_KEY_ENTRY_SIZE);
- RTUSBMultiWrite(pAd, (USHORT) offset, pKey->KeyMaterial, (USHORT)pKey->KeyLength);
-
- offset = PAIRWISE_IVEIV_TABLE_BASE + (Aid * HW_IVEIV_ENTRY_SIZE);
- NdisZeroMemory(IVEIV, 8);
-
- // IV/EIV
- if ((CipherAlg == CIPHER_TKIP) ||
- (CipherAlg == CIPHER_TKIP_NO_MIC) ||
- (CipherAlg == CIPHER_AES))
- {
- IVEIV[3] = 0x20; // Eiv bit on. keyid always 0 for pairwise key
- }
- // default key idx needs to set.
- // in TKIP/AES KeyIdx = 0 , WEP KeyIdx is default tx key.
- else
- {
- IVEIV[3] |= (KeyIdx<< 6);
- }
- RTUSBMultiWrite(pAd, (USHORT) offset, IVEIV, 8);
-
- // WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0
- if ((CipherAlg == CIPHER_TKIP) ||
- (CipherAlg == CIPHER_TKIP_NO_MIC) ||
- (CipherAlg == CIPHER_AES))
- {
- WCIDAttri = (CipherAlg<<1)|SHAREDKEYTABLE;
- }
- else
- WCIDAttri = (CipherAlg<<1)|SHAREDKEYTABLE;
-
- offset = MAC_WCID_ATTRIBUTE_BASE + (Aid* HW_WCID_ATTRI_SIZE);
- RTUSBWriteMACRegister(pAd, offset, WCIDAttri);
- RTUSBReadMACRegister(pAd, offset, &Value);
-
- DBGPRINT(RT_DEBUG_TRACE, ("BSSID_WCID : offset = %x, WCIDAttri = %lx\n",
- offset, WCIDAttri));
-
- // pAddr
- // Add Bssid mac address at linkup. not here. check!
- /*offset = MAC_WCID_BASE + (BSSID_WCID * HW_WCID_ENTRY_SIZE);
- *for (i=0; i<MAC_ADDR_LEN; i++)
- {
- RTMP_IO_WRITE8(pAd, offset+i, pKey->BSSID[i]);
- }
- */
-
- DBGPRINT(RT_DEBUG_ERROR, ("AddBSSIDasWCIDEntry: Alg=%s, KeyLength = %d\n",
- CipherName[CipherAlg], pKey->KeyLength));
- DBGPRINT(RT_DEBUG_TRACE, ("Key [idx=%x] [KeyLen = %d]\n",
- pKey->KeyIndex, pKey->KeyLength));
- for(i=0; i<pKey->KeyLength; i++)
- DBGPRINT_RAW(RT_DEBUG_TRACE,(" %x:", pKey->KeyMaterial[i]));
- DBGPRINT(RT_DEBUG_TRACE,(" \n"));
-}
-
-/*
-========================================================================
-Routine Description:
- Get a received packet.
-
-Arguments:
- pAd device control block
- pSaveRxD receive descriptor information
- *pbReschedule need reschedule flag
- *pRxPending pending received packet flag
-
-Return Value:
- the recieved packet
-
-Note:
-========================================================================
-*/
-#define RT2870_RXDMALEN_FIELD_SIZE 4
-PNDIS_PACKET GetPacketFromRxRing(
- IN PRTMP_ADAPTER pAd,
- OUT PRT28XX_RXD_STRUC pSaveRxD,
- OUT BOOLEAN *pbReschedule,
- IN OUT UINT32 *pRxPending)
-{
- PRX_CONTEXT pRxContext;
- PNDIS_PACKET pSkb;
- PUCHAR pData;
- ULONG ThisFrameLen;
- ULONG RxBufferLength;
- PRXWI_STRUC pRxWI;
-
- pRxContext = &pAd->RxContext[pAd->NextRxBulkInReadIndex];
- if ((pRxContext->Readable == FALSE) || (pRxContext->InUse == TRUE))
- return NULL;
-
- RxBufferLength = pRxContext->BulkInOffset - pAd->ReadPosition;
- if (RxBufferLength < (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXWI_STRUC) + sizeof(RXINFO_STRUC)))
- {
- goto label_null;
- }
-
- pData = &pRxContext->TransferBuffer[pAd->ReadPosition]; /* 4KB */
- // The RXDMA field is 4 bytes, now just use the first 2 bytes. The Length including the (RXWI + MSDU + Padding)
- ThisFrameLen = *pData + (*(pData+1)<<8);
- if (ThisFrameLen == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("BIRIdx(%d): RXDMALen is zero.[%ld], BulkInBufLen = %ld)\n",
- pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset));
- goto label_null;
- }
- if ((ThisFrameLen&0x3) != 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("BIRIdx(%d): RXDMALen not multiple of 4.[%ld], BulkInBufLen = %ld)\n",
- pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset));
- goto label_null;
- }
-
- if ((ThisFrameLen + 8)> RxBufferLength) // 8 for (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXINFO_STRUC))
- {
- DBGPRINT(RT_DEBUG_TRACE,("BIRIdx(%d):FrameLen(0x%lx) outranges. BulkInLen=0x%lx, remaining RxBufLen=0x%lx, ReadPos=0x%lx\n",
- pAd->NextRxBulkInReadIndex, ThisFrameLen, pRxContext->BulkInOffset, RxBufferLength, pAd->ReadPosition));
-
- // error frame. finish this loop
- goto label_null;
- }
-
- // skip USB frame length field
- pData += RT2870_RXDMALEN_FIELD_SIZE;
- pRxWI = (PRXWI_STRUC)pData;
-
- if (pRxWI->MPDUtotalByteCount > ThisFrameLen)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():pRxWIMPDUtotalByteCount(%d) large than RxDMALen(%ld)\n",
- __func__, pRxWI->MPDUtotalByteCount, ThisFrameLen));
- goto label_null;
- }
-
- // allocate a rx packet
- pSkb = dev_alloc_skb(ThisFrameLen);
- if (pSkb == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR,("%s():Cannot Allocate sk buffer for this Bulk-In buffer!\n", __func__));
- goto label_null;
- }
-
- // copy the rx packet
- memcpy(skb_put(pSkb, ThisFrameLen), pData, ThisFrameLen);
- RTPKT_TO_OSPKT(pSkb)->dev = get_netdev_from_bssid(pAd, BSS0);
- RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pSkb), PKTSRC_NDIS);
-
- // copy RxD
- *pSaveRxD = *(PRXINFO_STRUC)(pData + ThisFrameLen);
-
- // update next packet read position.
- pAd->ReadPosition += (ThisFrameLen + RT2870_RXDMALEN_FIELD_SIZE + RXINFO_SIZE); // 8 for (RT2870_RXDMALEN_FIELD_SIZE + sizeof(RXINFO_STRUC))
-
- return pSkb;
-
-label_null:
-
- return NULL;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Handle received packets.
-
-Arguments:
- data - URB information pointer
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-static void rx_done_tasklet(unsigned long data)
-{
- purbb_t pUrb;
- PRX_CONTEXT pRxContext;
- PRTMP_ADAPTER pAd;
- NTSTATUS Status;
- unsigned int IrqFlags;
-
- pUrb = (purbb_t)data;
- pRxContext = (PRX_CONTEXT)pUrb->context;
- pAd = pRxContext->pAd;
- Status = pUrb->status;
-
-
- RTMP_IRQ_LOCK(&pAd->BulkInLock, IrqFlags);
- pRxContext->InUse = FALSE;
- pRxContext->IRPPending = FALSE;
- pRxContext->BulkInOffset += pUrb->actual_length;
- //NdisInterlockedDecrement(&pAd->PendingRx);
- pAd->PendingRx--;
-
- if (Status == USB_ST_NOERROR)
- {
- pAd->BulkInComplete++;
- pAd->NextRxBulkInPosition = 0;
- if (pRxContext->BulkInOffset) // As jan's comment, it may bulk-in success but size is zero.
- {
- pRxContext->Readable = TRUE;
- INC_RING_INDEX(pAd->NextRxBulkInIndex, RX_RING_SIZE);
- }
- RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
- }
- else // STATUS_OTHER
- {
- pAd->BulkInCompleteFail++;
- // Still read this packet although it may comtain wrong bytes.
- pRxContext->Readable = FALSE;
- RTMP_IRQ_UNLOCK(&pAd->BulkInLock, IrqFlags);
-
- // Parsing all packets. because after reset, the index will reset to all zero.
- if ((!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_BULKIN_RESET |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
-
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk In Failed. Status=%d, BIIdx=0x%x, BIRIdx=0x%x, actual_length= 0x%x\n",
- Status, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex, pRxContext->pUrb->actual_length));
-
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKIN_RESET);
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_IN, NULL, 0);
- }
- }
-
- ASSERT((pRxContext->InUse == pRxContext->IRPPending));
-
- RTUSBBulkReceive(pAd);
-
- return;
-
-}
-
-
-static void rt2870_mgmt_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PTX_CONTEXT pMLMEContext;
- int index;
- PNDIS_PACKET pPacket;
- purbb_t pUrb;
- NTSTATUS Status;
- unsigned long IrqFlags;
-
-
- pUrb = (purbb_t)data;
- pMLMEContext = (PTX_CONTEXT)pUrb->context;
- pAd = pMLMEContext->pAd;
- Status = pUrb->status;
- index = pMLMEContext->SelfIdx;
-
- ASSERT((pAd->MgmtRing.TxDmaIdx == index));
-
- RTMP_IRQ_LOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
-
-
- if (Status != USB_ST_NOERROR)
- {
- //Bulk-Out fail status handle
- if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out MLME Failed, Status=%d!\n", Status));
- // TODO: How to handle about the MLMEBulkOut failed issue. Need to resend the mgmt pkt?
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
- pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
- }
- }
-
- pAd->BulkOutPending[MGMTPIPEIDX] = FALSE;
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[MGMTPIPEIDX], IrqFlags);
-
- RTMP_IRQ_LOCK(&pAd->MLMEBulkOutLock, IrqFlags);
- // Reset MLME context flags
- pMLMEContext->IRPPending = FALSE;
- pMLMEContext->InUse = FALSE;
- pMLMEContext->bWaitingBulkOut = FALSE;
- pMLMEContext->BulkOutSize = 0;
-
- pPacket = pAd->MgmtRing.Cell[index].pNdisPacket;
- pAd->MgmtRing.Cell[index].pNdisPacket = NULL;
-
- // Increase MgmtRing Index
- INC_RING_INDEX(pAd->MgmtRing.TxDmaIdx, MGMT_RING_SIZE);
- pAd->MgmtRing.TxSwFreeIdx++;
- RTMP_IRQ_UNLOCK(&pAd->MLMEBulkOutLock, IrqFlags);
-
- // No-matter success or fail, we free the mgmt packet.
- if (pPacket)
- RTMPFreeNdisPacket(pAd, pPacket);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET) &&
- ((pAd->bulkResetPipeid & BULKOUT_MGMT_RESET_FLAG) == BULKOUT_MGMT_RESET_FLAG))
- { // For Mgmt Bulk-Out failed, ignore it now.
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- {
-
- // Always call Bulk routine, even reset bulk.
- // The protectioon of rest bulk should be in BulkOut routine
- if (pAd->MgmtRing.TxSwFreeIdx < MGMT_RING_SIZE /* pMLMEContext->bWaitingBulkOut == TRUE */)
- {
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME);
- }
- RTUSBKickBulkOut(pAd);
- }
- }
-
-}
-
-
-static void rt2870_hcca_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 4;
- purbb_t pUrb;
-
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("--->hcca_dma_done_tasklet\n"));
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
-
- rt2870_dataout_complete_tasklet((unsigned long)pUrb);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
- {
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
- if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
- /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
- (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
- (pHTTXContext->bCurWriting == FALSE))
- {
- RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
- }
-
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<4);
- RTUSBKickBulkOut(pAd);
- }
- }
-
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("<---hcca_dma_done_tasklet\n"));
-}
-
-
-static void rt2870_ac3_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 3;
- purbb_t pUrb;
-
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
-
- rt2870_dataout_complete_tasklet((unsigned long)pUrb);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
- {
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
- if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
- /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
- (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
- (pHTTXContext->bCurWriting == FALSE))
- {
- RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
- }
-
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<3);
- RTUSBKickBulkOut(pAd);
- }
- }
-
-
- return;
-}
-
-
-static void rt2870_ac2_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 2;
- purbb_t pUrb;
-
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
-
- rt2870_dataout_complete_tasklet((unsigned long)pUrb);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
- {
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
- if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
- /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
- (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
- (pHTTXContext->bCurWriting == FALSE))
- {
- RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
- }
-
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<2);
- RTUSBKickBulkOut(pAd);
- }
- }
-
- return;
-}
-
-
-static void rt2870_ac1_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 1;
- purbb_t pUrb;
-
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
-
- rt2870_dataout_complete_tasklet((unsigned long)pUrb);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
- {
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
- if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
- /*((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
- (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
- (pHTTXContext->bCurWriting == FALSE))
- {
- RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
- }
-
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL<<1);
- RTUSBKickBulkOut(pAd);
- }
- }
-
-
- return;
-}
-
-
-static void rt2870_ac0_dma_done_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId = 0;
- purbb_t pUrb;
-
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
-
- rt2870_dataout_complete_tasklet((unsigned long)pUrb);
-
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- // do nothing and return directly.
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET))
- {
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- { pHTTXContext = &pAd->TxContext[BulkOutPipeId];
- if ((pAd->TxSwQueue[BulkOutPipeId].Number > 0) &&
- /* ((pHTTXContext->CurWritePosition > (pHTTXContext->NextBulkOutPosition + 0x6000)) || (pHTTXContext->NextBulkOutPosition > pHTTXContext->CurWritePosition + 0x6000)) && */
- (pAd->DeQueueRunning[BulkOutPipeId] == FALSE) &&
- (pHTTXContext->bCurWriting == FALSE))
- {
- RTMPDeQueuePacket(pAd, FALSE, BulkOutPipeId, MAX_TX_PROCESS);
- }
-
- RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL);
- RTUSBKickBulkOut(pAd);
- }
- }
-
-
- return;
-
-}
-
-
-static void rt2870_null_frame_complete_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PTX_CONTEXT pNullContext;
- purbb_t pUrb;
- NTSTATUS Status;
- unsigned long irqFlag;
-
-
- pUrb = (purbb_t)data;
- pNullContext = (PTX_CONTEXT)pUrb->context;
- pAd = pNullContext->pAd;
- Status = pUrb->status;
-
- // Reset Null frame context flags
- RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
- pNullContext->IRPPending = FALSE;
- pNullContext->InUse = FALSE;
- pAd->BulkOutPending[0] = FALSE;
- pAd->watchDogTxPendingCnt[0] = 0;
-
- if (Status == USB_ST_NOERROR)
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
-
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
- }
- else // STATUS_OTHER
- {
- if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out Null Frame Failed, ReasonCode=%d!\n", Status));
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
- pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
- }
- }
-
- // Always call Bulk routine, even reset bulk.
- // The protectioon of rest bulk should be in BulkOut routine
- RTUSBKickBulkOut(pAd);
-
-}
-
-
-static void rt2870_rts_frame_complete_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PTX_CONTEXT pRTSContext;
- purbb_t pUrb;
- NTSTATUS Status;
- unsigned long irqFlag;
-
-
- pUrb = (purbb_t)data;
- pRTSContext = (PTX_CONTEXT)pUrb->context;
- pAd = pRTSContext->pAd;
- Status = pUrb->status;
-
- // Reset RTS frame context flags
- RTMP_IRQ_LOCK(&pAd->BulkOutLock[0], irqFlag);
- pRTSContext->IRPPending = FALSE;
- pRTSContext->InUse = FALSE;
-
- if (Status == USB_ST_NOERROR)
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
- }
- else // STATUS_OTHER
- {
- if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out RTS Frame Failed\n"));
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
- pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- else
- {
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[0], irqFlag);
- }
- }
-
- RTMP_SEM_LOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
- pAd->BulkOutPending[pRTSContext->BulkOutPipeId] = FALSE;
- RTMP_SEM_UNLOCK(&pAd->BulkOutLock[pRTSContext->BulkOutPipeId]);
-
- // Always call Bulk routine, even reset bulk.
- // The protectioon of rest bulk should be in BulkOut routine
- RTUSBKickBulkOut(pAd);
-
-}
-
-
-static void rt2870_pspoll_frame_complete_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- PTX_CONTEXT pPsPollContext;
- purbb_t pUrb;
- NTSTATUS Status;
-
-
- pUrb = (purbb_t)data;
- pPsPollContext = (PTX_CONTEXT)pUrb->context;
- pAd = pPsPollContext->pAd;
- Status = pUrb->status;
-
- // Reset PsPoll context flags
- pPsPollContext->IRPPending = FALSE;
- pPsPollContext->InUse = FALSE;
- pAd->watchDogTxPendingCnt[0] = 0;
-
- if (Status == USB_ST_NOERROR)
- {
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
- }
- else // STATUS_OTHER
- {
- if ((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET)))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Bulk Out PSPoll Failed\n"));
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
- pAd->bulkResetPipeid = (MGMTPIPEIDX | BULKOUT_MGMT_RESET_FLAG);
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_RESET_BULK_OUT, NULL, 0);
- }
- }
-
- RTMP_SEM_LOCK(&pAd->BulkOutLock[0]);
- pAd->BulkOutPending[0] = FALSE;
- RTMP_SEM_UNLOCK(&pAd->BulkOutLock[0]);
-
- // Always call Bulk routine, even reset bulk.
- // The protectioon of rest bulk should be in BulkOut routine
- RTUSBKickBulkOut(pAd);
-
-}
-
-
-static void rt2870_dataout_complete_tasklet(unsigned long data)
-{
- PRTMP_ADAPTER pAd;
- purbb_t pUrb;
- POS_COOKIE pObj;
- PHT_TX_CONTEXT pHTTXContext;
- UCHAR BulkOutPipeId;
- NTSTATUS Status;
- unsigned long IrqFlags;
-
-
- pUrb = (purbb_t)data;
- pHTTXContext = (PHT_TX_CONTEXT)pUrb->context;
- pAd = pHTTXContext->pAd;
- pObj = (POS_COOKIE) pAd->OS_Cookie;
- Status = pUrb->status;
-
- // Store BulkOut PipeId
- BulkOutPipeId = pHTTXContext->BulkOutPipeId;
- pAd->BulkOutDataOneSecCount++;
-
- //DBGPRINT(RT_DEBUG_LOUD, ("Done-B(%d):I=0x%lx, CWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", BulkOutPipeId, in_interrupt(), pHTTXContext->CurWritePosition,
- // pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
-
- RTMP_IRQ_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
- pAd->BulkOutPending[BulkOutPipeId] = FALSE;
- pHTTXContext->IRPPending = FALSE;
- pAd->watchDogTxPendingCnt[BulkOutPipeId] = 0;
-
- if (Status == USB_ST_NOERROR)
- {
- pAd->BulkOutComplete++;
-
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
-
- pAd->Counters8023.GoodTransmits++;
- //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
- FREE_HTTX_RING(pAd, BulkOutPipeId, pHTTXContext);
- //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
-
-
- }
- else // STATUS_OTHER
- {
- PUCHAR pBuf;
-
- pAd->BulkOutCompleteOther++;
-
- pBuf = &pHTTXContext->TransferBuffer->field.WirelessPacket[pHTTXContext->NextBulkOutPosition];
-
- if (!RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST |
- fRTMP_ADAPTER_BULKOUT_RESET)))
- {
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BULKOUT_RESET);
- pAd->bulkResetPipeid = BulkOutPipeId;
- pAd->bulkResetReq[BulkOutPipeId] = pAd->BulkOutReq;
- }
- RTMP_IRQ_UNLOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags);
-
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("BulkOutDataPacket failed: ReasonCode=%d!\n", Status));
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("\t>>BulkOut Req=0x%lx, Complete=0x%lx, Other=0x%lx\n", pAd->BulkOutReq, pAd->BulkOutComplete, pAd->BulkOutCompleteOther));
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("\t>>BulkOut Header:%x %x %x %x %x %x %x %x\n", pBuf[0], pBuf[1], pBuf[2], pBuf[3], pBuf[4], pBuf[5], pBuf[6], pBuf[7]));
- //DBGPRINT_RAW(RT_DEBUG_ERROR, (">>BulkOutCompleteCancel=0x%x, BulkOutCompleteOther=0x%x\n", pAd->BulkOutCompleteCancel, pAd->BulkOutCompleteOther));
-
- }
-
- //
- // bInUse = TRUE, means some process are filling TX data, after that must turn on bWaitingBulkOut
- // bWaitingBulkOut = TRUE, means the TX data are waiting for bulk out.
- //
- //RTMP_IRQ_LOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
- if ((pHTTXContext->ENextBulkOutPosition != pHTTXContext->CurWritePosition) &&
- (pHTTXContext->ENextBulkOutPosition != (pHTTXContext->CurWritePosition+8)) &&
- !RTUSB_TEST_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_FRAG << BulkOutPipeId)))
- {
- // Indicate There is data avaliable
- RTUSB_SET_BULK_FLAG(pAd, (fRTUSB_BULK_OUT_DATA_NORMAL << BulkOutPipeId));
- }
- //RTMP_IRQ_UNLOCK(&pAd->TxContextQueueLock[BulkOutPipeId], IrqFlags);
-
- // Always call Bulk routine, even reset bulk.
- // The protection of rest bulk should be in BulkOut routine
- RTUSBKickBulkOut(pAd);
-}
-
-/* End of 2870_rtmp_init.c */
diff --git a/drivers/staging/rt2870/common/acction.c b/drivers/staging/rt2870/common/acction.c
new file mode 100644
index 000000000000..fd806c3871aa
--- /dev/null
+++ b/drivers/staging/rt2870/common/acction.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/action.c"
diff --git a/drivers/staging/rt2870/common/cmm_aes.c b/drivers/staging/rt2870/common/cmm_aes.c
new file mode 100644
index 000000000000..15d6a14d2d9c
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_aes.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_aes.c"
diff --git a/drivers/staging/rt2870/common/cmm_asic.c b/drivers/staging/rt2870/common/cmm_asic.c
new file mode 100644
index 000000000000..38de817991ff
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_asic.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_asic.c"
diff --git a/drivers/staging/rt2870/common/cmm_cfg.c b/drivers/staging/rt2870/common/cmm_cfg.c
new file mode 100644
index 000000000000..6b2bdd7d44ec
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_cfg.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_cfg.c"
diff --git a/drivers/staging/rt2870/common/cmm_data_usb.c b/drivers/staging/rt2870/common/cmm_data_usb.c
new file mode 100644
index 000000000000..704675fccb7d
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_data_usb.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_data_usb.c"
diff --git a/drivers/staging/rt2870/common/cmm_mac_usb.c b/drivers/staging/rt2870/common/cmm_mac_usb.c
new file mode 100644
index 000000000000..b26af4af890b
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_mac_usb.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_mac_usb.c"
diff --git a/drivers/staging/rt2870/common/cmm_profile.c b/drivers/staging/rt2870/common/cmm_profile.c
new file mode 100644
index 000000000000..9926e45aba3c
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_profile.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_profile.c"
diff --git a/drivers/staging/rt2870/common/cmm_tkip.c b/drivers/staging/rt2870/common/cmm_tkip.c
new file mode 100644
index 000000000000..f73c71bafe86
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_tkip.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_tkip.c"
diff --git a/drivers/staging/rt2870/common/cmm_wep.c b/drivers/staging/rt2870/common/cmm_wep.c
new file mode 100644
index 000000000000..5f681078387f
--- /dev/null
+++ b/drivers/staging/rt2870/common/cmm_wep.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/cmm_wep.c"
diff --git a/drivers/staging/rt2870/common/crypt_hmac.c b/drivers/staging/rt2870/common/crypt_hmac.c
new file mode 100644
index 000000000000..24d84e7724fb
--- /dev/null
+++ b/drivers/staging/rt2870/common/crypt_hmac.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/crypt_hmac.c"
diff --git a/drivers/staging/rt2870/common/crypt_md5.c b/drivers/staging/rt2870/common/crypt_md5.c
new file mode 100644
index 000000000000..457a2caca1e3
--- /dev/null
+++ b/drivers/staging/rt2870/common/crypt_md5.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/crypt_md5.c"
diff --git a/drivers/staging/rt2870/common/crypt_sha2.c b/drivers/staging/rt2870/common/crypt_sha2.c
new file mode 100644
index 000000000000..07ffb300c193
--- /dev/null
+++ b/drivers/staging/rt2870/common/crypt_sha2.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/crypt_sha2.c"
diff --git a/drivers/staging/rt2870/common/ee_efuse.c b/drivers/staging/rt2870/common/ee_efuse.c
new file mode 100644
index 000000000000..0e34e65e5f28
--- /dev/null
+++ b/drivers/staging/rt2870/common/ee_efuse.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/ee_efuse.c"
diff --git a/drivers/staging/rt2870/common/rt_channel.c b/drivers/staging/rt2870/common/rt_channel.c
new file mode 100644
index 000000000000..c8ceb4c177d9
--- /dev/null
+++ b/drivers/staging/rt2870/common/rt_channel.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/rt_channel.c"
diff --git a/drivers/staging/rt2870/common/rt_rf.c b/drivers/staging/rt2870/common/rt_rf.c
new file mode 100644
index 000000000000..b81cff34969b
--- /dev/null
+++ b/drivers/staging/rt2870/common/rt_rf.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/rt_rf.c"
diff --git a/drivers/staging/rt2870/common/rtmp_mcu.c b/drivers/staging/rt2870/common/rtmp_mcu.c
new file mode 100644
index 000000000000..20b7f13d60f8
--- /dev/null
+++ b/drivers/staging/rt2870/common/rtmp_mcu.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/rtmp_mcu.c"
diff --git a/drivers/staging/rt2870/common/rtmp_timer.c b/drivers/staging/rt2870/common/rtmp_timer.c
new file mode 100644
index 000000000000..fd4aedcd5e8b
--- /dev/null
+++ b/drivers/staging/rt2870/common/rtmp_timer.c
@@ -0,0 +1 @@
+#include "../../rt2860/common/rtmp_timer.c"
diff --git a/drivers/staging/rt2870/common/rtusb_bulk.c b/drivers/staging/rt2870/common/rtusb_bulk.c
index a4244b516440..82b23ae9facd 100644
--- a/drivers/staging/rt2870/common/rtusb_bulk.c
+++ b/drivers/staging/rt2870/common/rtusb_bulk.c
@@ -1,4 +1,4 @@
- /*
+/*
*************************************************************************
* Ralink Tech Inc.
* 5F., No.36, Taiyuan St., Jhubei City,
@@ -37,6 +37,9 @@
*/
+#ifdef RTMP_MAC_USB
+
+
#include "../rt_config.h"
// Match total 6 bulkout endpoint to corresponding queue.
UCHAR EpToQueue[6]={FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT};
@@ -317,11 +320,13 @@ VOID RTUSBBulkOutDataPacket(
break;
}
- //PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
if (pTxInfo->QSEL != FIFO_EDCA)
{
- printk("%s(): ====> pTxInfo->QueueSel(%d)!= FIFO_EDCA!!!!\n", __func__, pTxInfo->QSEL);
- printk("\tCWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n", pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad);
+ DBGPRINT(RT_DEBUG_ERROR, ("%s(): ====> pTxInfo->QueueSel(%d)!= FIFO_EDCA!!!!\n",
+ __FUNCTION__, pTxInfo->QSEL));
+ DBGPRINT(RT_DEBUG_ERROR, ("\tCWPos=%ld, NBPos=%ld, ENBPos=%ld, bCopy=%d!\n",
+ pHTTXContext->CurWritePosition, pHTTXContext->NextBulkOutPosition,
+ pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad));
hex_dump("Wrong QSel Pkt:", (PUCHAR)&pWirelessPkt[TmpBulkEndPos], (pHTTXContext->CurWritePosition - pHTTXContext->NextBulkOutPosition));
}
@@ -350,7 +355,7 @@ VOID RTUSBBulkOutDataPacket(
pLastTxInfo = pTxInfo;
// Make sure we use EDCA QUEUE.
- pTxInfo->QSEL = FIFO_EDCA; //PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
+ pTxInfo->QSEL = FIFO_EDCA;
ThisBulkSize += (pTxInfo->USBDMATxPktLen+4);
TmpBulkEndPos += (pTxInfo->USBDMATxPktLen+4);
@@ -366,8 +371,11 @@ VOID RTUSBBulkOutDataPacket(
bTxQLastRound = TRUE;
pHTTXContext->ENextBulkOutPosition = 8;
+
break;
}
+
+
}while (TRUE);
// adjust the pTxInfo->USBDMANextVLD value of last pTxInfo.
@@ -481,11 +489,9 @@ VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs)
pObj->ac3_dma_done_task.data = (unsigned long)pUrb;
tasklet_hi_schedule(&pObj->ac3_dma_done_task);
break;
- case 4:
- pObj->hcca_dma_done_task.data = (unsigned long)pUrb;
- tasklet_hi_schedule(&pObj->hcca_dma_done_task);
- break;
}
+
+
}
@@ -933,7 +939,7 @@ VOID RTUSBKickBulkOut(
}
// 5. Mlme frame is next
- else if ((RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME)) &&
+ else if ((RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_MLME)) ||
(pAd->MgmtRing.TxSwFreeIdx < MGMT_RING_SIZE))
{
RTUSBBulkOutMLMEPacket(pAd, pAd->MgmtRing.TxDmaIdx);
@@ -977,16 +983,6 @@ VOID RTUSBKickBulkOut(
}
}
- //PS packets use HCCA queue when dequeue from PS unicast queue (WiFi WPA2 MA9_DT1 for Marvell B STA)
- if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NORMAL_5))
- {
- if (((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) ||
- (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- ))
- {
- }
- }
-
// 7. Null frame is the last
else if (RTUSB_TEST_BULK_FLAG(pAd, fRTUSB_BULK_OUT_DATA_NULL))
{
@@ -1231,3 +1227,4 @@ VOID RTUSBCancelPendingBulkOutIRP(
}
}
+#endif // RTMP_MAC_USB //
diff --git a/drivers/staging/rt2870/common/rtusb_data.c b/drivers/staging/rt2870/common/rtusb_data.c
index 6b003f63372e..807b32a69cec 100644
--- a/drivers/staging/rt2870/common/rtusb_data.c
+++ b/drivers/staging/rt2870/common/rtusb_data.c
@@ -36,6 +36,10 @@
Jan 03-25-2006 created
*/
+
+#ifdef RTMP_MAC_USB
+
+
#include "../rt_config.h"
extern UCHAR Phy11BGNextRateUpward[]; // defined in mlme.c
@@ -68,6 +72,26 @@ VOID REPORT_AMSDU_FRAMES_TO_LLC(
}
}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ This subroutine will scan through releative ring descriptor to find
+ out avaliable free ring descriptor and compare with request size.
+
+ Arguments:
+ pAd Pointer to our adapter
+ RingType Selected Ring
+
+ Return Value:
+ NDIS_STATUS_FAILURE Not enough free descriptor
+ NDIS_STATUS_SUCCESS Enough free descriptor
+
+ Note:
+
+ ========================================================================
+*/
NDIS_STATUS RTUSBFreeDescriptorRequest(
IN PRTMP_ADAPTER pAd,
IN UCHAR BulkOutPipeId,
@@ -193,6 +217,36 @@ VOID RTUSBRejectPendingPackets(
}
+
+/*
+ ========================================================================
+
+ Routine Description:
+ Calculates the duration which is required to transmit out frames
+ with given size and specified rate.
+
+ Arguments:
+ pTxD Pointer to transmit descriptor
+ Ack Setting for Ack requirement bit
+ Fragment Setting for Fragment bit
+ RetryMode Setting for retry mode
+ Ifs Setting for IFS gap
+ Rate Setting for transmit rate
+ Service Setting for service
+ Length Frame length
+ TxPreamble Short or Long preamble when using CCK rates
+ QueIdx - 0-3, according to 802.11e/d4.4 June/2003
+
+ Return Value:
+ None
+
+ IRQL = PASSIVE_LEVEL
+ IRQL = DISPATCH_LEVEL
+
+ ========================================================================
+*/
+
+
VOID RTMPWriteTxInfo(
IN PRTMP_ADAPTER pAd,
IN PTXINFO_STRUC pTxInfo,
@@ -214,3 +268,4 @@ VOID RTMPWriteTxInfo(
pTxInfo->rsv2 = 0;
}
+#endif // RTMP_MAC_USB //
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c
index 1d69590421a3..a93fde5e5725 100644
--- a/drivers/staging/rt2870/common/rtusb_io.c
+++ b/drivers/staging/rt2870/common/rtusb_io.c
@@ -36,6 +36,9 @@
Paul Lin 06-25-2004 created
*/
+#ifdef RTMP_MAC_USB
+
+
#include "../rt_config.h"
@@ -55,7 +58,7 @@
========================================================================
*/
-NTSTATUS RTUSBFirmwareRun(
+static NTSTATUS RTUSBFirmwareRun(
IN PRTMP_ADAPTER pAd)
{
NTSTATUS Status;
@@ -110,48 +113,16 @@ NTSTATUS RTUSBFirmwareWrite(
Status = RTUSBWriteMACRegister(pAd, 0x701c, 0xffffffff);
Status = RTUSBFirmwareRun(pAd);
+ //2008/11/28:KH add to fix the dead rf frequency offset bug<--
RTMPusecDelay(10000);
RTUSBWriteMACRegister(pAd,H2M_MAILBOX_CSR,0);
- AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00);//reset rf by MCU supported by new firmware
+ AsicSendCommandToMcu(pAd, 0x72, 0x00, 0x00, 0x00); //reset rf by MCU supported by new firmware
+ //2008/11/28:KH add to fix the dead rf frequency offset bug-->
return Status;
}
-/*
- ========================================================================
-
- Routine Description: Get current firmware operation mode (Return Value)
-
- Arguments:
-
- Return Value:
- 0 or 1 = Downloaded by host driver
- others = Driver doesn't download firmware
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS RTUSBFirmwareOpmode(
- IN PRTMP_ADAPTER pAd,
- OUT PUINT32 pValue)
-{
- NTSTATUS Status;
-
- Status = RTUSB_VendorRequest(
- pAd,
- (USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK),
- DEVICE_VENDOR_REQUEST_IN,
- 0x1,
- 0x11,
- 0,
- pValue,
- 4);
- return Status;
-}
NTSTATUS RTUSBVenderReset(
IN PRTMP_ADAPTER pAd)
{
@@ -312,7 +283,7 @@ NTSTATUS RTUSBReadMACRegister(
IN USHORT Offset,
OUT PUINT32 pValue)
{
- NTSTATUS Status;
+ NTSTATUS Status = 0;
UINT32 localVal;
Status = RTUSB_VendorRequest(
@@ -368,7 +339,6 @@ NTSTATUS RTUSBWriteMACRegister(
-#if 1
/*
========================================================================
@@ -402,10 +372,9 @@ NTSTATUS RTUSBReadBBPRegister(
if (!(BbpCsr.field.Busy == BUSY))
break;
}
- printk("RTUSBReadBBPRegister(BBP_CSR_CFG_1):retry count=%d!\n", i);
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBReadBBPRegister(BBP_CSR_CFG_1):retry count=%d!\n", i));
i++;
- }
- while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
+ }while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
if ((i == RETRY_LIMIT) || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
{
@@ -438,10 +407,9 @@ NTSTATUS RTUSBReadBBPRegister(
break;
}
}
- printk("RTUSBReadBBPRegister(BBP_CSR_CFG_2):retry count=%d!\n", i);
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBReadBBPRegister(BBP_CSR_CFG_2):retry count=%d!\n", i));
i++;
- }
- while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
+ }while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
if ((i == RETRY_LIMIT) || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
{
@@ -456,67 +424,8 @@ NTSTATUS RTUSBReadBBPRegister(
return STATUS_SUCCESS;
}
-#else
-/*
- ========================================================================
-
- Routine Description: Read 8-bit BBP register via firmware
-
- Arguments:
-
- Return Value:
-
- IRQL =
- Note:
- ========================================================================
-*/
-NTSTATUS RTUSBReadBBPRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Id,
- IN PUCHAR pValue)
-{
- BBP_CSR_CFG_STRUC BbpCsr;
- int i, k;
- for (i=0; i<MAX_BUSY_COUNT; i++)
- {
- RTUSBReadMACRegister(pAd, H2M_BBP_AGENT, &BbpCsr.word);
- if (BbpCsr.field.Busy == BUSY)
- {
- continue;
- }
- BbpCsr.word = 0;
- BbpCsr.field.fRead = 1;
- BbpCsr.field.BBP_RW_MODE = 1;
- BbpCsr.field.Busy = 1;
- BbpCsr.field.RegNum = Id;
- RTUSBWriteMACRegister(pAd, H2M_BBP_AGENT, BbpCsr.word);
- AsicSendCommandToMcu(pAd, 0x80, 0xff, 0x0, 0x0);
- for (k=0; k<MAX_BUSY_COUNT; k++)
- {
- RTUSBReadMACRegister(pAd, H2M_BBP_AGENT, &BbpCsr.word);
- if (BbpCsr.field.Busy == IDLE)
- break;
- }
- if ((BbpCsr.field.Busy == IDLE) &&
- (BbpCsr.field.RegNum == Id))
- {
- *pValue = (UCHAR)BbpCsr.field.Value;
- break;
- }
- }
- if (BbpCsr.field.Busy == BUSY)
- {
- DBGPRINT_ERR(("BBP read R%d=0x%x fail\n", Id, BbpCsr.word));
- *pValue = pAd->BbpWriteLatch[Id];
- return STATUS_UNSUCCESSFUL;
- }
- return STATUS_SUCCESS;
-}
-#endif
-
-#if 1
/*
========================================================================
@@ -549,7 +458,7 @@ NTSTATUS RTUSBWriteBBPRegister(
if (!(BbpCsr.field.Busy == BUSY))
break;
}
- printk("RTUSBWriteBBPRegister(BBP_CSR_CFG):retry count=%d!\n", i);
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBWriteBBPRegister(BBP_CSR_CFG):retry count=%d!\n", i));
i++;
}
while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
@@ -572,55 +481,6 @@ NTSTATUS RTUSBWriteBBPRegister(
return STATUS_SUCCESS;
}
-#else
-/*
- ========================================================================
-
- Routine Description: Write 8-bit BBP register via firmware
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-
-NTSTATUS RTUSBWriteBBPRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Id,
- IN UCHAR Value)
-
-{
- BBP_CSR_CFG_STRUC BbpCsr;
- int BusyCnt;
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++)
- {
- RTMP_IO_READ32(pAd, H2M_BBP_AGENT, &BbpCsr.word);
- if (BbpCsr.field.Busy == BUSY)
- continue;
- BbpCsr.word = 0;
- BbpCsr.field.fRead = 0;
- BbpCsr.field.BBP_RW_MODE = 1;
- BbpCsr.field.Busy = 1;
- BbpCsr.field.Value = Value;
- BbpCsr.field.RegNum = Id;
- RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, BbpCsr.word);
- AsicSendCommandToMcu(pAd, 0x80, 0xff, 0x0, 0x0);
- pAd->BbpWriteLatch[Id] = Value;
- break;
- }
- if (BusyCnt == MAX_BUSY_COUNT)
- {
- DBGPRINT_ERR(("BBP write R%d=0x%x fail\n", Id, BbpCsr.word));
- return STATUS_UNSUCCESSFUL;
- }
- return STATUS_SUCCESS;
-}
-#endif
/*
========================================================================
@@ -653,7 +513,7 @@ NTSTATUS RTUSBWriteRFRegister(
if (!(PhyCsr4.field.Busy))
break;
}
- printk("RTUSBWriteRFRegister(RF_CSR_CFG0):retry count=%d!\n", i);
+ DBGPRINT(RT_DEBUG_TRACE, ("RTUSBWriteRFRegister(RF_CSR_CFG0):retry count=%d!\n", i));
i++;
}
while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
@@ -669,114 +529,6 @@ NTSTATUS RTUSBWriteRFRegister(
return STATUS_SUCCESS;
}
-/*
- ========================================================================
-
- Routine Description: Write RT30xx RF register through MAC
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS RT30xxWriteRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RegID,
- IN UCHAR Value)
-{
- RF_CSR_CFG_STRUC rfcsr;
- UINT i = 0;
-
- do
- {
- RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
-
- if (!rfcsr.field.RF_CSR_KICK)
- break;
- i++;
- }
- while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)));
-
- if ((i == RETRY_LIMIT) || (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR, ("Retry count exhausted or device removed!!!\n"));
- return STATUS_UNSUCCESSFUL;
- }
-
- rfcsr.field.RF_CSR_WR = 1;
- rfcsr.field.RF_CSR_KICK = 1;
- rfcsr.field.TESTCSR_RFACC_REGNUM = RegID;
- rfcsr.field.RF_CSR_DATA = Value;
-
- RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word);
-
- return STATUS_SUCCESS;
-}
-
-
-/*
- ========================================================================
-
- Routine Description: Read RT30xx RF register through MAC
-
- Arguments:
-
- Return Value:
-
- IRQL =
-
- Note:
-
- ========================================================================
-*/
-NTSTATUS RT30xxReadRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RegID,
- IN PUCHAR pValue)
-{
- RF_CSR_CFG_STRUC rfcsr;
- UINT i=0, k=0;
-
- for (i=0; i<MAX_BUSY_COUNT; i++)
- {
- RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
-
- if (rfcsr.field.RF_CSR_KICK == BUSY)
- {
- continue;
- }
- rfcsr.word = 0;
- rfcsr.field.RF_CSR_WR = 0;
- rfcsr.field.RF_CSR_KICK = 1;
- rfcsr.field.TESTCSR_RFACC_REGNUM = RegID;
- RTMP_IO_WRITE32(pAd, RF_CSR_CFG, rfcsr.word);
- for (k=0; k<MAX_BUSY_COUNT; k++)
- {
- RTMP_IO_READ32(pAd, RF_CSR_CFG, &rfcsr.word);
-
- if (rfcsr.field.RF_CSR_KICK == IDLE)
- break;
- }
- if ((rfcsr.field.RF_CSR_KICK == IDLE) &&
- (rfcsr.field.TESTCSR_RFACC_REGNUM == RegID))
- {
- *pValue = (UCHAR)rfcsr.field.RF_CSR_DATA;
- break;
- }
- }
- if (rfcsr.field.RF_CSR_KICK == BUSY)
- {
- DBGPRINT_ERR(("RF read R%d=0x%x fail, i[%d], k[%d]\n", RegID, rfcsr.word,i,k));
- return STATUS_UNSUCCESSFUL;
- }
-
- return STATUS_SUCCESS;
-}
/*
========================================================================
@@ -801,10 +553,6 @@ NTSTATUS RTUSBReadEEPROM(
{
NTSTATUS Status = STATUS_SUCCESS;
- if(pAd->bUseEfuse)
- Status =eFuseRead(pAd, Offset, pData, length);
- else
- {
Status = RTUSB_VendorRequest(
pAd,
(USBD_TRANSFER_DIRECTION_IN | USBD_SHORT_TRANSFER_OK),
@@ -814,7 +562,6 @@ NTSTATUS RTUSBReadEEPROM(
Offset,
pData,
length);
- }
return Status;
}
@@ -842,10 +589,6 @@ NTSTATUS RTUSBWriteEEPROM(
{
NTSTATUS Status = STATUS_SUCCESS;
- if(pAd->bUseEfuse)
- Status = eFuseWrite(pAd, Offset, pData, length);
- else
- {
Status = RTUSB_VendorRequest(
pAd,
USBD_TRANSFER_DIRECTION_OUT,
@@ -855,11 +598,38 @@ NTSTATUS RTUSBWriteEEPROM(
Offset,
pData,
length);
- }
return Status;
}
+
+NTSTATUS RTUSBReadEEPROM16(
+ IN PRTMP_ADAPTER pAd,
+ IN USHORT offset,
+ OUT PUSHORT pData)
+{
+ NTSTATUS status;
+ USHORT localData;
+
+ status = RTUSBReadEEPROM(pAd, offset, (PUCHAR)(&localData), 2);
+ if (status == STATUS_SUCCESS)
+ *pData = le2cpu16(localData);
+
+ return status;
+
+}
+
+NTSTATUS RTUSBWriteEEPROM16(
+ IN RTMP_ADAPTER *pAd,
+ IN USHORT offset,
+ IN USHORT value)
+{
+ USHORT tmpVal;
+
+ tmpVal = cpu2le16(value);
+ return RTUSBWriteEEPROM(pAd, offset, (PUCHAR)&(tmpVal), 2);
+}
+
/*
========================================================================
@@ -943,7 +713,7 @@ VOID RTUSBInitializeCmdQ(
cmdq->head = NULL;
cmdq->tail = NULL;
cmdq->size = 0;
- cmdq->CmdQState = RT2870_THREAD_INITED;
+ cmdq->CmdQState = RTMP_TASK_STAT_INITED;
}
/*
@@ -970,19 +740,26 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(
{
NDIS_STATUS status;
PCmdQElmt cmdqelmt = NULL;
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
+ RTMP_OS_TASK *pTask = &pAd->cmdQTask;
- if (pid_nr(pObj->RTUSBCmdThr_pid) > 0)
+#ifdef KTHREAD_SUPPORT
+ if (pTask->kthread_task == NULL)
+#else
+ CHECK_PID_LEGALITY(pTask->taskPID)
+ {
+ }
+ else
+#endif
return (NDIS_STATUS_RESOURCES);
- status = RTMPAllocateMemory((PVOID *)&cmdqelmt, sizeof(CmdQElmt));
+ status = os_alloc_mem(pAd, (PUCHAR *)(&cmdqelmt), sizeof(CmdQElmt));
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
return (NDIS_STATUS_RESOURCES);
cmdqelmt->buffer = NULL;
if (pInformationBuffer != NULL)
{
- status = RTMPAllocateMemory((PVOID *)&cmdqelmt->buffer, InformationBufferLength);
+ status = os_alloc_mem(pAd, (PUCHAR *)&cmdqelmt->buffer, InformationBufferLength);
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL))
{
kfree(cmdqelmt);
@@ -1005,7 +782,7 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(
cmdqelmt->SetOperation = FALSE;
NdisAcquireSpinLock(&pAd->CmdQLock);
- if (pAd->CmdQ.CmdQState & RT2870_THREAD_CAN_DO_INSERT)
+ if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT)
{
EnqueueCmd((&pAd->CmdQ), cmdqelmt);
status = NDIS_STATUS_SUCCESS;
@@ -1019,8 +796,8 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(
if (status == NDIS_STATUS_FAILURE)
{
if (cmdqelmt->buffer)
- NdisFreeMemory(cmdqelmt->buffer, cmdqelmt->bufferlength, 0);
- NdisFreeMemory(cmdqelmt, sizeof(CmdQElmt), 0);
+ os_free_mem(pAd, cmdqelmt->buffer);
+ os_free_mem(pAd, cmdqelmt);
}
else
RTUSBCMDUp(pAd);
@@ -1054,17 +831,17 @@ NDIS_STATUS RTUSBEnqueueInternalCmd(
PCmdQElmt cmdqelmt = NULL;
- status = RTMPAllocateMemory((PVOID *)&cmdqelmt, sizeof(CmdQElmt));
+ status = os_alloc_mem(pAd, (PUCHAR *)&cmdqelmt, sizeof(CmdQElmt));
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL))
return (NDIS_STATUS_RESOURCES);
NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt));
if(InformationBufferLength > 0)
{
- status = RTMPAllocateMemory((PVOID *)&cmdqelmt->buffer, InformationBufferLength);
+ status = os_alloc_mem(pAd, (PUCHAR *)&cmdqelmt->buffer, InformationBufferLength);
if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL))
{
- NdisFreeMemory(cmdqelmt, sizeof(CmdQElmt), 0);
+ os_free_mem(pAd, cmdqelmt);
return (NDIS_STATUS_RESOURCES);
}
else
@@ -1085,7 +862,7 @@ NDIS_STATUS RTUSBEnqueueInternalCmd(
if (cmdqelmt != NULL)
{
NdisAcquireSpinLock(&pAd->CmdQLock);
- if (pAd->CmdQ.CmdQState & RT2870_THREAD_CAN_DO_INSERT)
+ if (pAd->CmdQ.CmdQState & RTMP_TASK_CAN_DO_INSERT)
{
EnqueueCmd((&pAd->CmdQ), cmdqelmt);
status = NDIS_STATUS_SUCCESS;
@@ -1099,8 +876,8 @@ NDIS_STATUS RTUSBEnqueueInternalCmd(
if (status == NDIS_STATUS_FAILURE)
{
if (cmdqelmt->buffer)
- NdisFreeMemory(cmdqelmt->buffer, cmdqelmt->bufferlength, 0);
- NdisFreeMemory(cmdqelmt, sizeof(CmdQElmt), 0);
+ os_free_mem(pAd, cmdqelmt->buffer);
+ os_free_mem(pAd, cmdqelmt);
}
else
RTUSBCMDUp(pAd);
@@ -1185,7 +962,7 @@ NTSTATUS RTUSB_VendorRequest(
IN PVOID TransferBuffer,
IN UINT32 TransferBufferLength)
{
- int ret;
+ int ret = 0;
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie;
if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
@@ -1206,7 +983,18 @@ NTSTATUS RTUSB_VendorRequest(
int retryCount = 0;
void *tmpBuf = TransferBuffer;
- // Acquire Control token
+ ret = down_interruptible(&(pAd->UsbVendorReq_semaphore));
+ if (pAd->UsbVendorReqBuf)
+ {
+ ASSERT(TransferBufferLength <MAX_PARAM_BUFFER_SIZE);
+
+ tmpBuf = (void *)pAd->UsbVendorReqBuf;
+ NdisZeroMemory(pAd->UsbVendorReqBuf, TransferBufferLength);
+
+ if (RequestType == DEVICE_VENDOR_REQUEST_OUT)
+ NdisMoveMemory(tmpBuf, TransferBuffer, TransferBufferLength);
+ }
+
do {
if( RequestType == DEVICE_VENDOR_REQUEST_OUT)
ret=usb_control_msg(pObj->pUsb_Dev, usb_sndctrlpipe( pObj->pUsb_Dev, 0 ), Request, RequestType, Value,Index, tmpBuf, TransferBufferLength, CONTROL_TIMEOUT_JIFFIES);
@@ -1220,13 +1008,16 @@ NTSTATUS RTUSB_VendorRequest(
retryCount++;
if (ret < 0) {
- printk("#\n");
+ DBGPRINT(RT_DEBUG_OFF, ("#\n"));
RTMPusecDelay(5000);
}
} while((ret < 0) && (retryCount < MAX_RETRY_COUNT));
+ if ((pAd->UsbVendorReqBuf) && (RequestType == DEVICE_VENDOR_REQUEST_IN))
+ NdisMoveMemory(TransferBuffer, tmpBuf, TransferBufferLength);
+ up(&(pAd->UsbVendorReq_semaphore));
+
if (ret < 0) {
-// DBGPRINT(RT_DEBUG_ERROR, ("USBVendorRequest failed ret=%d \n",ret));
DBGPRINT(RT_DEBUG_ERROR, ("RTUSB_VendorRequest failed(%d),TxFlags=0x%x, ReqType=%s, Req=0x%x, Index=0x%x\n",
ret, TransferFlags, (RequestType == DEVICE_VENDOR_REQUEST_OUT ? "OUT" : "IN"), Request, Index));
if (Request == 0x2)
@@ -1235,8 +1026,14 @@ NTSTATUS RTUSB_VendorRequest(
if ((TransferBuffer!= NULL) && (TransferBufferLength > 0))
hex_dump("Failed TransferBuffer value", TransferBuffer, TransferBufferLength);
}
+
+
}
- return ret;
+
+ if (ret != -1)
+ return STATUS_SUCCESS;
+ else
+ return STATUS_UNSUCCESSFUL;
}
/*
@@ -1275,7 +1072,7 @@ VOID CMDHandler(
NTSTATUS ntStatus;
// unsigned long IrqFlags;
- while (pAd->CmdQ.size > 0)
+ while (pAd && pAd->CmdQ.size > 0)
{
NdisStatus = NDIS_STATUS_SUCCESS;
@@ -1410,8 +1207,6 @@ VOID CMDHandler(
//NdisReleaseSpinLock(&pAd->BulkOutLock[pAd->bulkResetPipeid]);
RTMP_INT_UNLOCK(&pAd->BulkOutLock[pAd->bulkResetPipeid], IrqFlags);
-/*-----------------------------------------------------------------------------------------------*/
-/*-----------------------------------------------------------------------------------------------*/
{
RTUSBInitHTTxDesc(pAd, pHTTXContext, pAd->bulkResetPipeid, pHTTXContext->BulkOutSize, (usb_complete_t)RTUSBBulkOutDataPacketComplete);
@@ -1522,8 +1317,7 @@ VOID CMDHandler(
// All transfers must be aborted or cancelled before attempting to reset the pipe.
{
UINT32 MACValue;
-/*-----------------------------------------------------------------------------------------------*/
-/*-----------------------------------------------------------------------------------------------*/
+
{
//while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
if((pAd->PendingRx > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
@@ -1612,6 +1406,8 @@ VOID CMDHandler(
}
else
{ // success
+ //DBGPRINT(RT_DEBUG_TRACE, ("BIDone, Pend=%d,BIIdx=%d,BIRIdx=%d!\n",
+ // pAd->PendingRx, pAd->NextRxBulkInIndex, pAd->NextRxBulkInReadIndex));
DBGPRINT_RAW(RT_DEBUG_TRACE, ("CMDTHREAD_RESET_BULK_IN: Submit Rx URB Done, status=%d!\n", pUrb->status));
ASSERT((pRxContext->InUse == pRxContext->IRPPending));
}
@@ -1722,6 +1518,40 @@ VOID CMDHandler(
}
}
break;
+
+//Benson modified for USB interface, avoid in interrupt when write key, 20080724 -->
+ case RT_CMD_SET_KEY_TABLE: //General call for AsicAddPairwiseKeyEntry()
+ {
+ RT_ADD_PAIRWISE_KEY_ENTRY KeyInfo;
+ KeyInfo = *((PRT_ADD_PAIRWISE_KEY_ENTRY)(pData));
+ AsicAddPairwiseKeyEntry(pAd,
+ KeyInfo.MacAddr,
+ (UCHAR)KeyInfo.MacTabMatchWCID,
+ &KeyInfo.CipherKey);
+ }
+ break;
+
+ case RT_CMD_SET_RX_WCID_TABLE: //General call for RTMPAddWcidAttributeEntry()
+ {
+ PMAC_TABLE_ENTRY pEntry ;
+ UCHAR KeyIdx = 0;
+ UCHAR CipherAlg = CIPHER_NONE;
+ UCHAR ApIdx = BSS0;
+
+ pEntry = (PMAC_TABLE_ENTRY)(pData);
+
+
+
+ RTMPAddWcidAttributeEntry(
+ pAd,
+ ApIdx,
+ KeyIdx,
+ CipherAlg,
+ pEntry);
+ }
+ break;
+//Benson modified for USB interface, avoid in interrupt when write key, 20080724 <--
+
case CMDTHREAD_SET_CLIENT_MAC_ENTRY:
{
MAC_TABLE_ENTRY *pEntry;
@@ -1731,7 +1561,7 @@ VOID CMDHandler(
AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)pEntry->Aid);
if ((pEntry->AuthMode <= Ndis802_11AuthModeAutoSwitch) && (pEntry->WepStatus == Ndis802_11Encryption1Enabled))
{
- UINT32 uIV = 0;
+ UINT32 uIV = 1;
PUCHAR ptr;
ptr = (PUCHAR) &uIV;
@@ -1741,7 +1571,7 @@ VOID CMDHandler(
}
else if (pEntry->AuthMode == Ndis802_11AuthModeWPANone)
{
- UINT32 uIV = 0;
+ UINT32 uIV = 1;
PUCHAR ptr;
ptr = (PUCHAR) &uIV;
@@ -1763,15 +1593,19 @@ VOID CMDHandler(
}
AsicUpdateRxWCIDTable(pAd, pEntry->Aid, pEntry->Addr);
- printk("UpdateRxWCIDTable(): Aid=%d, Addr=%02x:%02x:%02x:%02x:%02x:%02x!\n", pEntry->Aid,
- pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2], pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]);
+ DBGPRINT(RT_DEBUG_TRACE, ("UpdateRxWCIDTable(): Aid=%d, Addr=%02x:%02x:%02x:%02x:%02x:%02x!\n", pEntry->Aid,
+ pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2], pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]));
}
break;
+
+// add by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
case CMDTHREAD_UPDATE_PROTECT:
{
AsicUpdateProtect(pAd, 0, (ALLN_SETPROTECT), TRUE, 0);
}
break;
+// end johnli
+
case OID_802_11_ADD_WEP:
{
UINT i;
@@ -1852,6 +1686,25 @@ VOID CMDHandler(
case CMDTHREAD_802_11_COUNTER_MEASURE:
break;
+
+ case CMDTHREAD_SET_GROUP_KEY:
+ WpaStaGroupKeySetting(pAd);
+ break;
+
+ case CMDTHREAD_SET_PAIRWISE_KEY:
+ WpaStaPairwiseKeySetting(pAd);
+ break;
+
+ case CMDTHREAD_SET_PSM_BIT:
+ {
+ USHORT *pPsm = (USHORT *)pData;
+ MlmeSetPsmBit(pAd, *pPsm);
+ }
+ break;
+ case CMDTHREAD_FORCE_WAKE_UP:
+ AsicForceWakeup(pAd, TRUE);
+ break;
+
default:
DBGPRINT(RT_DEBUG_ERROR, ("--> Control Thread !! ERROR !! Unknown(cmdqelmt->command=0x%x) !! \n", cmdqelmt->command));
break;
@@ -1861,18 +1714,16 @@ VOID CMDHandler(
if (cmdqelmt->CmdFromNdis == TRUE)
{
if (cmdqelmt->buffer != NULL)
- NdisFreeMemory(cmdqelmt->buffer, cmdqelmt->bufferlength, 0);
-
- NdisFreeMemory(cmdqelmt, sizeof(CmdQElmt), 0);
+ os_free_mem(pAd, cmdqelmt->buffer);
+ os_free_mem(pAd, cmdqelmt);
}
else
{
if ((cmdqelmt->buffer != NULL) && (cmdqelmt->bufferlength != 0))
- NdisFreeMemory(cmdqelmt->buffer, cmdqelmt->bufferlength, 0);
- {
- NdisFreeMemory(cmdqelmt, sizeof(CmdQElmt), 0);
- }
+ os_free_mem(pAd, cmdqelmt->buffer);
+ os_free_mem(pAd, cmdqelmt);
}
} /* end of while */
}
+#endif // RTMP_MAC_USB //
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
deleted file mode 100644
index 4c67bafad4e6..000000000000
--- a/drivers/staging/rt2870/rt2870.h
+++ /dev/null
@@ -1,583 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#ifndef __RT2870_H__
-#define __RT2870_H__
-
-//usb header files
-#include <linux/usb.h>
-
-/* rtmp_def.h */
-//
-#define BULKAGGRE_ZISE 100
-#define RT28XX_DRVDATA_SET(_a) usb_set_intfdata(_a, pAd);
-#define RT28XX_PUT_DEVICE usb_put_dev
-#define RTUSB_ALLOC_URB(iso) usb_alloc_urb(iso, GFP_ATOMIC)
-#define RTUSB_SUBMIT_URB(pUrb) usb_submit_urb(pUrb, GFP_ATOMIC)
-#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr) usb_buffer_alloc(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
-#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr) usb_buffer_free(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
-
-#define RXBULKAGGRE_ZISE 12
-#define MAX_TXBULK_LIMIT (LOCAL_TXBUF_SIZE*(BULKAGGRE_ZISE-1))
-#define MAX_TXBULK_SIZE (LOCAL_TXBUF_SIZE*BULKAGGRE_ZISE)
-#define MAX_RXBULK_SIZE (LOCAL_TXBUF_SIZE*RXBULKAGGRE_ZISE)
-#define MAX_MLME_HANDLER_MEMORY 20
-#define RETRY_LIMIT 10
-#define BUFFER_SIZE 2400 //2048
-#define TX_RING 0xa
-#define PRIO_RING 0xc
-
-
-// Flags for Bulkflags control for bulk out data
-//
-#define fRTUSB_BULK_OUT_DATA_NULL 0x00000001
-#define fRTUSB_BULK_OUT_RTS 0x00000002
-#define fRTUSB_BULK_OUT_MLME 0x00000004
-
-#define fRTUSB_BULK_OUT_DATA_NORMAL 0x00010000
-#define fRTUSB_BULK_OUT_DATA_NORMAL_2 0x00020000
-#define fRTUSB_BULK_OUT_DATA_NORMAL_3 0x00040000
-#define fRTUSB_BULK_OUT_DATA_NORMAL_4 0x00080000
-#define fRTUSB_BULK_OUT_DATA_NORMAL_5 0x00100000
-
-#define fRTUSB_BULK_OUT_PSPOLL 0x00000020
-#define fRTUSB_BULK_OUT_DATA_FRAG 0x00000040
-#define fRTUSB_BULK_OUT_DATA_FRAG_2 0x00000080
-#define fRTUSB_BULK_OUT_DATA_FRAG_3 0x00000100
-#define fRTUSB_BULK_OUT_DATA_FRAG_4 0x00000200
-
-#define FREE_HTTX_RING(_p, _b, _t) \
-{ \
- if ((_t)->ENextBulkOutPosition == (_t)->CurWritePosition) \
- { \
- (_t)->bRingEmpty = TRUE; \
- } \
- /*NdisInterlockedDecrement(&(_p)->TxCount); */\
-}
-
-//
-// RXINFO appends at the end of each rx packet.
-//
-typedef struct PACKED _RXINFO_STRUC {
- UINT32 BA:1;
- UINT32 DATA:1;
- UINT32 NULLDATA:1;
- UINT32 FRAG:1;
- UINT32 U2M:1; // 1: this RX frame is unicast to me
- UINT32 Mcast:1; // 1: this is a multicast frame
- UINT32 Bcast:1; // 1: this is a broadcast frame
- UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
- UINT32 Crc:1; // 1: CRC error
- UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
- UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
- UINT32 HTC:1;
- UINT32 RSSI:1;
- UINT32 L2PAD:1;
- UINT32 AMPDU:1; // To be moved
- UINT32 Decrypted:1;
- UINT32 PlcpRssil:1;
- UINT32 CipherAlg:1;
- UINT32 LastAMSDU:1;
- UINT32 PlcpSignal:12;
-} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
-
-//
-// TXINFO
-//
-typedef struct _TXINFO_STRUC {
- // Word 0
- UINT32 USBDMATxPktLen:16; //used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame.
- UINT32 rsv:8;
- UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
- UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
- UINT32 SwUseLastRound:1; // Software use.
- UINT32 rsv2:2; // Software use.
- UINT32 USBDMANextVLD:1; //used ONLY in USB bulk Aggregation, NextValid
- UINT32 USBDMATxburst:1;//used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint
-} TXINFO_STRUC, *PTXINFO_STRUC;
-
-#define TXINFO_SIZE 4
-#define RXINFO_SIZE 4
-#define TXPADDING_SIZE 11
-
-//
-// Management ring buffer format
-//
-typedef struct _MGMT_STRUC {
- BOOLEAN Valid;
- PUCHAR pBuffer;
- ULONG Length;
-} MGMT_STRUC, *PMGMT_STRUC;
-
-
-/* ----------------- EEPROM Related MACRO ----------------- */
-#define RT28xx_EEPROM_READ16(pAd, offset, var) \
- do { \
- RTUSBReadEEPROM(pAd, offset, (PUCHAR)&(var), 2); \
- if(!pAd->bUseEfuse) \
- var = le2cpu16(var); \
- }while(0)
-
-#define RT28xx_EEPROM_WRITE16(pAd, offset, var) \
- do{ \
- USHORT _tmpVar=var; \
- if(!pAd->bUseEfuse) \
- _tmpVar = cpu2le16(var); \
- RTUSBWriteEEPROM(pAd, offset, (PUCHAR)&(_tmpVar), 2); \
- }while(0)
-
-/* ----------------- TASK/THREAD Related MACRO ----------------- */
-#define RT28XX_TASK_THREAD_INIT(pAd, Status) \
- Status = CreateThreads(net_dev);
-
-
-/* ----------------- Frimware Related MACRO ----------------- */
-#define RT28XX_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
- RTUSBFirmwareWrite(_pAd, _pFwImage, _FwLen)
-
-/* ----------------- TX Related MACRO ----------------- */
-#define RT28XX_START_DEQUEUE(pAd, QueIdx, irqFlags) \
- { \
- RTMP_IRQ_LOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
- if (pAd->DeQueueRunning[QueIdx]) \
- { \
- RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags);\
- printk("DeQueueRunning[%d]= TRUE!\n", QueIdx); \
- continue; \
- } \
- else \
- { \
- pAd->DeQueueRunning[QueIdx] = TRUE; \
- RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags);\
- } \
- }
-#define RT28XX_STOP_DEQUEUE(pAd, QueIdx, irqFlags) \
- do{ \
- RTMP_IRQ_LOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
- pAd->DeQueueRunning[QueIdx] = FALSE; \
- RTMP_IRQ_UNLOCK(&pAd->DeQueueLock[QueIdx], irqFlags); \
- }while(0)
-
-
-#define RT28XX_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, freeNum, pPacket) \
- (RTUSBFreeDescriptorRequest(pAd, pTxBlk->QueIdx, (pTxBlk->TotalFrameLen + GET_OS_PKT_LEN(pPacket))) == NDIS_STATUS_SUCCESS)
-
-#define RT28XX_RELEASE_DESC_RESOURCE(pAd, QueIdx) \
- do{}while(0)
-
-#define NEED_QUEUE_BACK_FOR_AGG(_pAd, _QueIdx, _freeNum, _TxFrameType) \
- ((_TxFrameType == TX_RALINK_FRAME) && (RTUSBNeedQueueBackForAgg(_pAd, _QueIdx)))
-
-
-
-#define fRTMP_ADAPTER_NEED_STOP_TX \
- (fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS | \
- fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_BULKOUT_RESET | \
- fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_REMOVE_IN_PROGRESS)
-
-
-#define HAL_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber) \
- RtmpUSB_WriteSubTxResource(pAd, pTxBlk, bIsLast, pFreeNumber)
-
-#define HAL_WriteTxResource(pAd, pTxBlk,bIsLast, pFreeNumber) \
- RtmpUSB_WriteSingleTxResource(pAd, pTxBlk,bIsLast, pFreeNumber)
-
-#define HAL_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber) \
- RtmpUSB_WriteFragTxResource(pAd, pTxBlk, fragNum, pFreeNumber)
-
-#define HAL_WriteMultiTxResource(pAd, pTxBlk,frameNum, pFreeNumber) \
- RtmpUSB_WriteMultiTxResource(pAd, pTxBlk,frameNum, pFreeNumber)
-
-#define HAL_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, TxIdx) \
- RtmpUSB_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, TxIdx)
-
-#define HAL_LastTxIdx(pAd, QueIdx,TxIdx) \
- /*RtmpUSBDataLastTxIdx(pAd, QueIdx,TxIdx)*/
-
-#define HAL_KickOutTx(pAd, pTxBlk, QueIdx) \
- RtmpUSBDataKickOut(pAd, pTxBlk, QueIdx)
-
-
-#define HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen) \
- RtmpUSBMgmtKickOut(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen)
-
-#define HAL_KickOutNullFrameTx(_pAd, _QueIdx, _pNullFrame, _frameLen) \
- RtmpUSBNullFrameKickOut(_pAd, _QueIdx, _pNullFrame, _frameLen)
-
-#define RTMP_PKT_TAIL_PADDING 11 // 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding)
-
-extern UCHAR EpToQueue[6];
-
-
-#ifdef RT2870
-#define GET_TXRING_FREENO(_pAd, _QueIdx) (_QueIdx) //(_pAd->TxRing[_QueIdx].TxSwFreeIdx)
-#define GET_MGMTRING_FREENO(_pAd) (_pAd->MgmtRing.TxSwFreeIdx)
-#endif // RT2870 //
-
-
-/* ----------------- RX Related MACRO ----------------- */
-//#define RT28XX_RX_ERROR_CHECK RTMPCheckRxWI
-
-#define RT28XX_RV_ALL_BUF_END(bBulkReceive) \
- /* We return STATUS_MORE_PROCESSING_REQUIRED so that the completion */ \
- /* routine (IofCompleteRequest) will stop working on the irp. */ \
- if (bBulkReceive == TRUE) RTUSBBulkReceive(pAd);
-
-
-/* ----------------- ASIC Related MACRO ----------------- */
-
-// reset MAC of a station entry to 0xFFFFFFFFFFFF
-#define RT28XX_STA_ENTRY_MAC_RESET(pAd, Wcid) \
- { RT_SET_ASIC_WCID SetAsicWcid; \
- SetAsicWcid.WCID = Wcid; \
- SetAsicWcid.SetTid = 0xffffffff; \
- SetAsicWcid.DeleteTid = 0xffffffff; \
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID, \
- &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); }
-
-// add this entry into ASIC RX WCID search table
-#define RT28XX_STA_ENTRY_ADD(pAd, pEntry) \
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_CLIENT_MAC_ENTRY, \
- pEntry, sizeof(MAC_TABLE_ENTRY));
-
-// remove Pair-wise key material from ASIC
-// yet implement
-#define RT28XX_STA_ENTRY_KEY_DEL(pAd, BssIdx, Wcid)
-
-// add Client security information into ASIC WCID table and IVEIV table
-#define RT28XX_STA_SECURITY_INFO_ADD(pAd, apidx, KeyID, pEntry) \
- { RT28XX_STA_ENTRY_MAC_RESET(pAd, pEntry->Aid); \
- if (pEntry->Aid >= 1) { \
- RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri; \
- SetAsicWcidAttri.WCID = pEntry->Aid; \
- if ((pEntry->AuthMode <= Ndis802_11AuthModeAutoSwitch) && \
- (pEntry->WepStatus == Ndis802_11Encryption1Enabled)) \
- { \
- SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
- } \
- else if (pEntry->AuthMode == Ndis802_11AuthModeWPANone) \
- { \
- SetAsicWcidAttri.Cipher = pAd->SharedKey[apidx][KeyID].CipherAlg; \
- } \
- else SetAsicWcidAttri.Cipher = 0; \
- DBGPRINT(RT_DEBUG_TRACE, ("aid cipher = %ld\n",SetAsicWcidAttri.Cipher)); \
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_SET_ASIC_WCID_CIPHER, \
- &SetAsicWcidAttri, sizeof(RT_SET_ASIC_WCID_ATTRI)); } }
-
-// Insert the BA bitmap to ASIC for the Wcid entry
-#define RT28XX_ADD_BA_SESSION_TO_ASIC(_pAd, _Aid, _TID) \
- do{ \
- RT_SET_ASIC_WCID SetAsicWcid; \
- SetAsicWcid.WCID = (_Aid); \
- SetAsicWcid.SetTid = (0x10000<<(_TID)); \
- SetAsicWcid.DeleteTid = 0xffffffff; \
- RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); \
- }while(0)
-
-// Remove the BA bitmap from ASIC for the Wcid entry
-#define RT28XX_DEL_BA_SESSION_FROM_ASIC(_pAd, _Wcid, _TID) \
- do{ \
- RT_SET_ASIC_WCID SetAsicWcid; \
- SetAsicWcid.WCID = (_Wcid); \
- SetAsicWcid.SetTid = (0xffffffff); \
- SetAsicWcid.DeleteTid = (0x10000<<(_TID) ); \
- RTUSBEnqueueInternalCmd((_pAd), CMDTHREAD_SET_ASIC_WCID, &SetAsicWcid, sizeof(RT_SET_ASIC_WCID)); \
- }while(0)
-
-
-/* ----------------- PCI/USB Related MACRO ----------------- */
-#define RT28XX_HANDLE_DEV_ASSIGN(handle, dev_p) \
- ((POS_COOKIE)handle)->pUsb_Dev = dev_p;
-
-// no use
-#define RT28XX_UNMAP()
-#define RT28XX_IRQ_REQUEST(net_dev)
-#define RT28XX_IRQ_RELEASE(net_dev)
-#define RT28XX_IRQ_INIT(pAd)
-#define RT28XX_IRQ_ENABLE(pAd)
-
-
-/* ----------------- MLME Related MACRO ----------------- */
-#define RT28XX_MLME_HANDLER(pAd) RTUSBMlmeUp(pAd)
-
-#define RT28XX_MLME_PRE_SANITY_CHECK(pAd) \
- { if ((pAd->CommonCfg.bHardwareRadio == TRUE) && \
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) && \
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) { \
- RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_CHECK_GPIO, NULL, 0); } }
-
-#define RT28XX_MLME_STA_QUICK_RSP_WAKE_UP(pAd) \
- { RTUSBEnqueueInternalCmd(pAd, CMDTHREAD_QKERIODIC_EXECUT, NULL, 0); \
- RTUSBMlmeUp(pAd); }
-
-#define RT28XX_MLME_RESET_STATE_MACHINE(pAd) \
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_RESET_CONF, 0, NULL); \
- RTUSBMlmeUp(pAd);
-
-#define RT28XX_HANDLE_COUNTER_MEASURE(_pAd, _pEntry) \
- { RTUSBEnqueueInternalCmd(_pAd, CMDTHREAD_802_11_COUNTER_MEASURE, _pEntry, sizeof(MAC_TABLE_ENTRY)); \
- RTUSBMlmeUp(_pAd); \
- }
-
-
-/* ----------------- Power Save Related MACRO ----------------- */
-#define RT28XX_PS_POLL_ENQUEUE(pAd) \
- { RTUSB_SET_BULK_FLAG(pAd, fRTUSB_BULK_OUT_PSPOLL); \
- RTUSBKickBulkOut(pAd); }
-
-#define RT28xx_CHIP_NAME "RTxx70"
-
-#define USB_CYC_CFG 0x02a4
-#define STATUS_SUCCESS 0x00
-#define STATUS_UNSUCCESSFUL 0x01
-#define NT_SUCCESS(status) (((status) > 0) ? (1):(0))
-#define InterlockedIncrement atomic_inc
-#define NdisInterlockedIncrement atomic_inc
-#define InterlockedDecrement atomic_dec
-#define NdisInterlockedDecrement atomic_dec
-#define InterlockedExchange atomic_set
-//#define NdisMSendComplete RTMP_SendComplete
-#define NdisMCancelTimer RTMPCancelTimer
-#define NdisAllocMemory(_ptr, _size, _flag) \
- do{_ptr = kmalloc((_size),(_flag));}while(0)
-#define NdisFreeMemory(a, b, c) kfree((a))
-#define NdisMSleep RTMPusecDelay /* unit: microsecond */
-
-
-#define USBD_TRANSFER_DIRECTION_OUT 0
-#define USBD_TRANSFER_DIRECTION_IN 0
-#define USBD_SHORT_TRANSFER_OK 0
-#define PURB purbb_t
-
-#define RTUSB_FREE_URB(pUrb) usb_free_urb(pUrb)
-
-//#undef MlmeAllocateMemory
-//#undef MlmeFreeMemory
-
-typedef struct usb_device * PUSB_DEV;
-
-/* MACRO for linux usb */
-typedef struct urb *purbb_t;
-typedef struct usb_ctrlrequest devctrlrequest;
-#define PIRP PVOID
-#define PMDL PVOID
-#define NDIS_OID UINT
-#ifndef USB_ST_NOERROR
-#define USB_ST_NOERROR 0
-#endif
-
-// vendor-specific control operations
-#define CONTROL_TIMEOUT_JIFFIES ( (100 * HZ) / 1000)
-#define UNLINK_TIMEOUT_MS 3
-
-/* unlink urb */
-#define RTUSB_UNLINK_URB(pUrb) usb_kill_urb(pUrb)
-
-// Prototypes of completion funuc.
-VOID RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs);
-VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs);
-VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
-VOID RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs);
-VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs);
-VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
-
-#define RTUSBMlmeUp(pAd) \
-{ \
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if (pid_nr(pObj->MLMEThr_pid) > 0) \
- up(&(pAd->mlme_semaphore)); \
-}
-
-#define RTUSBCMDUp(pAd) \
-{ \
- POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if (pid_nr(pObj->RTUSBCmdThr_pid) > 0) \
- up(&(pAd->RTUSBCmd_semaphore)); \
-}
-
-static inline NDIS_STATUS RTMPAllocateMemory(
- OUT PVOID *ptr,
- IN size_t size)
-{
- *ptr = kmalloc(size, GFP_ATOMIC);
- if(*ptr)
- return NDIS_STATUS_SUCCESS;
- else
- return NDIS_STATUS_RESOURCES;
-}
-
-/* rtmp.h */
-#define BEACON_RING_SIZE 2
-#define DEVICE_VENDOR_REQUEST_OUT 0x40
-#define DEVICE_VENDOR_REQUEST_IN 0xc0
-#define INTERFACE_VENDOR_REQUEST_OUT 0x41
-#define INTERFACE_VENDOR_REQUEST_IN 0xc1
-#define MGMTPIPEIDX 0 // EP6 is highest priority
-
-#define BULKOUT_MGMT_RESET_FLAG 0x80
-
-#define RTUSB_SET_BULK_FLAG(_M, _F) ((_M)->BulkFlags |= (_F))
-#define RTUSB_CLEAR_BULK_FLAG(_M, _F) ((_M)->BulkFlags &= ~(_F))
-#define RTUSB_TEST_BULK_FLAG(_M, _F) (((_M)->BulkFlags & (_F)) != 0)
-
-#define EnqueueCmd(cmdq, cmdqelmt) \
-{ \
- if (cmdq->size == 0) \
- cmdq->head = cmdqelmt; \
- else \
- cmdq->tail->next = cmdqelmt; \
- cmdq->tail = cmdqelmt; \
- cmdqelmt->next = NULL; \
- cmdq->size++; \
-}
-
-typedef struct _RT_SET_ASIC_WCID {
- ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
- ULONG SetTid; // time-based: seconds, packet-based: kilo-packets
- ULONG DeleteTid; // time-based: seconds, packet-based: kilo-packets
- UCHAR Addr[MAC_ADDR_LEN]; // avoid in interrupt when write key
-} RT_SET_ASIC_WCID,*PRT_SET_ASIC_WCID;
-
-typedef struct _RT_SET_ASIC_WCID_ATTRI {
- ULONG WCID; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
- ULONG Cipher; // ASIC Cipher definition
- UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
-} RT_SET_ASIC_WCID_ATTRI,*PRT_SET_ASIC_WCID_ATTRI;
-
-typedef struct _MLME_MEMORY_STRUCT {
- PVOID AllocVa; //Pointer to the base virtual address of the allocated memory
- struct _MLME_MEMORY_STRUCT *Next; //Pointer to the next virtual address of the allocated memory
-} MLME_MEMORY_STRUCT, *PMLME_MEMORY_STRUCT;
-
-typedef struct _MLME_MEMORY_HANDLER {
- BOOLEAN MemRunning; //The flag of the Mlme memory handler's status
- UINT MemoryCount; //Total nonpaged system-space memory not size
- UINT InUseCount; //Nonpaged system-space memory in used counts
- UINT UnUseCount; //Nonpaged system-space memory available counts
- INT PendingCount; //Nonpaged system-space memory for free counts
- PMLME_MEMORY_STRUCT pInUseHead; //Pointer to the first nonpaed memory not used
- PMLME_MEMORY_STRUCT pInUseTail; //Pointer to the last nonpaged memory not used
- PMLME_MEMORY_STRUCT pUnUseHead; //Pointer to the first nonpaged memory in used
- PMLME_MEMORY_STRUCT pUnUseTail; //Pointer to the last nonpaged memory in used
- PULONG MemFreePending[MAX_MLME_HANDLER_MEMORY]; //an array to keep pending free-memory's pointer (32bits)
-} MLME_MEMORY_HANDLER, *PMLME_MEMORY_HANDLER;
-
-typedef struct _CmdQElmt {
- UINT command;
- PVOID buffer;
- ULONG bufferlength;
- BOOLEAN CmdFromNdis;
- BOOLEAN SetOperation;
- struct _CmdQElmt *next;
-} CmdQElmt, *PCmdQElmt;
-
-typedef struct _CmdQ {
- UINT size;
- CmdQElmt *head;
- CmdQElmt *tail;
- UINT32 CmdQState;
-}CmdQ, *PCmdQ;
-
-/* oid.h */
-// Cipher suite type for mixed mode group cipher, P802.11i-2004
-typedef enum _RT_802_11_CIPHER_SUITE_TYPE {
- Cipher_Type_NONE,
- Cipher_Type_WEP40,
- Cipher_Type_TKIP,
- Cipher_Type_RSVD,
- Cipher_Type_CCMP,
- Cipher_Type_WEP104
-} RT_802_11_CIPHER_SUITE_TYPE, *PRT_802_11_CIPHER_SUITE_TYPE;
-
-//CMDTHREAD_MULTI_READ_MAC
-//CMDTHREAD_MULTI_WRITE_MAC
-//CMDTHREAD_VENDOR_EEPROM_READ
-//CMDTHREAD_VENDOR_EEPROM_WRITE
-typedef struct _CMDHandler_TLV {
- USHORT Offset;
- USHORT Length;
- UCHAR DataFirst;
-} CMDHandler_TLV, *PCMDHandler_TLV;
-
-// New for MeetingHouse Api support
-#define CMDTHREAD_VENDOR_RESET 0x0D730101 // cmd
-#define CMDTHREAD_VENDOR_UNPLUG 0x0D730102 // cmd
-#define CMDTHREAD_VENDOR_SWITCH_FUNCTION 0x0D730103 // cmd
-#define CMDTHREAD_MULTI_WRITE_MAC 0x0D730107 // cmd
-#define CMDTHREAD_MULTI_READ_MAC 0x0D730108 // cmd
-#define CMDTHREAD_VENDOR_EEPROM_WRITE 0x0D73010A // cmd
-#define CMDTHREAD_VENDOR_EEPROM_READ 0x0D73010B // cmd
-#define CMDTHREAD_VENDOR_ENTER_TESTMODE 0x0D73010C // cmd
-#define CMDTHREAD_VENDOR_EXIT_TESTMODE 0x0D73010D // cmd
-#define CMDTHREAD_VENDOR_WRITE_BBP 0x0D730119 // cmd
-#define CMDTHREAD_VENDOR_READ_BBP 0x0D730118 // cmd
-#define CMDTHREAD_VENDOR_WRITE_RF 0x0D73011A // cmd
-#define CMDTHREAD_VENDOR_FLIP_IQ 0x0D73011D // cmd
-#define CMDTHREAD_RESET_BULK_OUT 0x0D730210 // cmd
-#define CMDTHREAD_RESET_BULK_IN 0x0D730211 // cmd
-#define CMDTHREAD_SET_PSM_BIT_SAVE 0x0D730212 // cmd
-#define CMDTHREAD_SET_RADIO 0x0D730214 // cmd
-#define CMDTHREAD_UPDATE_TX_RATE 0x0D730216 // cmd
-#define CMDTHREAD_802_11_ADD_KEY_WEP 0x0D730218 // cmd
-#define CMDTHREAD_RESET_FROM_ERROR 0x0D73021A // cmd
-#define CMDTHREAD_LINK_DOWN 0x0D73021B // cmd
-#define CMDTHREAD_RESET_FROM_NDIS 0x0D73021C // cmd
-#define CMDTHREAD_CHECK_GPIO 0x0D730215 // cmd
-#define CMDTHREAD_FORCE_WAKE_UP 0x0D730222 // cmd
-#define CMDTHREAD_SET_BW 0x0D730225 // cmd
-#define CMDTHREAD_SET_ASIC_WCID 0x0D730226 // cmd
-#define CMDTHREAD_SET_ASIC_WCID_CIPHER 0x0D730227 // cmd
-#define CMDTHREAD_QKERIODIC_EXECUT 0x0D73023D // cmd
-#define CMDTHREAD_SET_CLIENT_MAC_ENTRY 0x0D73023E // cmd
-#define CMDTHREAD_802_11_QUERY_HARDWARE_REGISTER 0x0D710105 // cmd
-#define CMDTHREAD_802_11_SET_PHY_MODE 0x0D79010C // cmd
-#define CMDTHREAD_802_11_SET_STA_CONFIG 0x0D790111 // cmd
-#define CMDTHREAD_802_11_SET_PREAMBLE 0x0D790101 // cmd
-#define CMDTHREAD_802_11_COUNTER_MEASURE 0x0D790102 // cmd
-#define CMDTHREAD_UPDATE_PROTECT 0x0D790103 // cmd
-
-#define WPA1AKMBIT 0x01
-#define WPA2AKMBIT 0x02
-#define WPA1PSKAKMBIT 0x04
-#define WPA2PSKAKMBIT 0x08
-#define TKIPBIT 0x01
-#define CCMPBIT 0x02
-
-
-#define RT28XX_STA_FORCE_WAKEUP(pAd, bFromTx) \
- RT28xxUsbStaAsicForceWakeup(pAd, bFromTx);
-
-#define RT28XX_STA_SLEEP_THEN_AUTO_WAKEUP(pAd, TbttNumToNextWakeUp) \
- RT28xxUsbStaAsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
-
-#define RT28XX_MLME_RADIO_ON(pAd) \
- RT28xxUsbMlmeRadioOn(pAd);
-
-#define RT28XX_MLME_RADIO_OFF(pAd) \
- RT28xxUsbMlmeRadioOFF(pAd);
-
-#endif //__RT2870_H__
diff --git a/drivers/staging/rt2870/rt_usb.c b/drivers/staging/rt2870/rt_usb.c
new file mode 100644
index 000000000000..5e02d4c88d73
--- /dev/null
+++ b/drivers/staging/rt2870/rt_usb.c
@@ -0,0 +1 @@
+#include "../rt2860/rt_usb.c"
diff --git a/drivers/staging/rt2870/usb_main_dev.c b/drivers/staging/rt2870/usb_main_dev.c
new file mode 100644
index 000000000000..6e63bc50047a
--- /dev/null
+++ b/drivers/staging/rt2870/usb_main_dev.c
@@ -0,0 +1 @@
+#include "../rt2860/usb_main_dev.c"
diff --git a/drivers/staging/rt3070/firmware.h b/drivers/staging/rt3070/firmware.h
index b07783ed8dd0..d3c5d6c5ad53 100644
--- a/drivers/staging/rt3070/firmware.h
+++ b/drivers/staging/rt3070/firmware.h
@@ -43,7 +43,7 @@
/* AUTO GEN PLEASE DO NOT MODIFY IT */
-UCHAR FirmwareImage [] = {
+UCHAR FirmwareImage_2870 [] = {
0xff, 0xff, 0xff, 0x02, 0x10, 0x28, 0x02, 0x10, 0x32, 0x02, 0x10, 0x78, 0x02, 0x12, 0x67, 0x02,
0x12, 0x68, 0x02, 0x12, 0x87, 0x02, 0x12, 0x8c, 0x12, 0x12, 0x88, 0x22, 0x02, 0x16, 0x49, 0x02,
0x17, 0x1f, 0x02, 0x13, 0x77, 0x02, 0x12, 0x8d, 0x30, 0x05, 0x06, 0x20, 0x0d, 0x03, 0x12, 0x17,
diff --git a/drivers/staging/rt3090/Kconfig b/drivers/staging/rt3090/Kconfig
deleted file mode 100644
index 255e8eaa4836..000000000000
--- a/drivers/staging/rt3090/Kconfig
+++ /dev/null
@@ -1,5 +0,0 @@
-config RT3090
- tristate "Ralink 3090 wireless support"
- depends on PCI && X86 && WLAN_80211
- ---help---
- This is an experimental driver for the Ralink 3090 wireless chip.
diff --git a/drivers/staging/rt3090/Makefile b/drivers/staging/rt3090/Makefile
deleted file mode 100644
index 995491c91fce..000000000000
--- a/drivers/staging/rt3090/Makefile
+++ /dev/null
@@ -1,80 +0,0 @@
-obj-$(CONFIG_RT3090) += rt3090sta.o
-
-include drivers/staging/rt3090/config.mk
-
-rt3090sta-objs := \
- common/crypt_md5.o \
- common/crypt_sha2.o \
- common/crypt_hmac.o \
- common/mlme.o \
- common/cmm_wep.o \
- common/action.o \
- common/cmm_data.o \
- common/rtmp_init.o \
- common/cmm_tkip.o \
- common/cmm_aes.o \
- common/cmm_sync.o \
- common/eeprom.o \
- common/cmm_sanity.o \
- common/cmm_info.o \
- common/cmm_cfg.o \
- common/cmm_wpa.o \
- common/dfs.o \
- common/spectrum.o \
- common/rtmp_timer.o \
- common/rt_channel.o \
- common/cmm_profile.o \
- common/cmm_asic.o \
- sta/assoc.o \
- sta/auth.o \
- sta/auth_rsp.o \
- sta/sync.o \
- sta/sanity.o \
- sta/rtmp_data.o \
- sta/connect.o \
- sta/wpa.o \
- rt_linux.o \
- rt_profile.o \
- rt_main_dev.o \
- sta_ioctl.o
-
-#ifdef DOT11_N_SUPPORT
-ifeq ($(HAS_DOT11_N_SUPPORT),y)
-rt3090sta-objs += \
- common/ba_action.o
-endif
-#endif // DOT11_N_SUPPORT //
-
-#ifdef ETH_CONVERT
-ifeq ($(HAS_ETH_CONVERT_SUPPORT), y)
-rt3090sta-objs += \
- common/cmm_mat.o \
- common/cmm_mat_iparp.o \
- common/cmm_mat_pppoe.o \
- common/cmm_mat_ipv6.o
-endif
-#endif // ETH_CONVERT //
-
-ifeq ($(HAS_BLOCK_NET_IF),y)
-rt3090sta-objs += common/netif_block.o
-endif
-
-ifeq ($(HAS_QOS_DLS_SUPPORT),y)
-rt3090sta-objs += sta/dls.o
-endif
-
-rt3090sta-objs += \
- pci_main_dev.o \
- rt_pci_rbus.o \
- common/cmm_mac_pci.o \
- common/cmm_data_pci.o \
- common/ee_prom.o \
- common/ee_efuse.o \
- common/rtmp_mcu.o \
- chips/rt30xx.o \
- common/rt_rf.o \
- chips/rt3090.o
-
-ifeq ($(HAS_ATE),y)
-rt3090sta-objs += rt_ate.o
-endif
diff --git a/drivers/staging/rt3090/action.h b/drivers/staging/rt3090/action.h
deleted file mode 100644
index ac0a0a3c5ce4..000000000000
--- a/drivers/staging/rt3090/action.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- aironet.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- Paul Lin 04-06-15 Initial
-*/
-
-#ifndef __ACTION_H__
-#define __ACTION_H__
-
-typedef struct PACKED __HT_INFO_OCTET
-{
-#ifdef RT_BIG_ENDIAN
- UCHAR Reserved:5;
- UCHAR STA_Channel_Width:1;
- UCHAR Forty_MHz_Intolerant:1;
- UCHAR Request:1;
-#else
- UCHAR Request:1;
- UCHAR Forty_MHz_Intolerant:1;
- UCHAR STA_Channel_Width:1;
- UCHAR Reserved:5;
-#endif
-} HT_INFORMATION_OCTET;
-
-
-typedef struct PACKED __FRAME_HT_INFO
-{
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- HT_INFORMATION_OCTET HT_Info;
-} FRAME_HT_INFO, *PFRAME_HT_INFO;
-
-#endif /* __ACTION_H__ */
diff --git a/drivers/staging/rt3090/ap.h b/drivers/staging/rt3090/ap.h
deleted file mode 100644
index e89430381071..000000000000
--- a/drivers/staging/rt3090/ap.h
+++ /dev/null
@@ -1,512 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 08-01-2002 created
- James Tan 09-06-2002 modified (Revise NTCRegTable)
- John Chang 12-22-2004 modified for RT2561/2661. merge with STA driver
-*/
-#ifndef __AP_H__
-#define __AP_H__
-
-
-// =============================================================
-// Function Prototypes
-// =============================================================
-
-// ap_data.c
-
-BOOLEAN APBridgeToWirelessSta(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN UINT DataLen,
- IN ULONG fromwdsidx);
-
-
-VOID APSendPackets(
- IN NDIS_HANDLE MiniportAdapterContext,
- IN PPNDIS_PACKET ppPacketArray,
- IN UINT NumberOfPackets);
-
-NDIS_STATUS APSendPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-
-NDIS_STATUS APHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR QueIdx);
-
-VOID APRxEAPOLFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-NDIS_STATUS APCheckRxError(
- IN PRTMP_ADAPTER pAd,
- IN PRT28XX_RXD_STRUC pRxD,
- IN UCHAR Wcid);
-
-BOOLEAN APCheckClass2Class3Error(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN PHEADER_802_11 pHeader);
-
-VOID APHandleRxPsPoll(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN USHORT Aid,
- IN BOOLEAN isActive);
-
-VOID RTMPDescriptorEndianChange(
- IN PUCHAR pData,
- IN ULONG DescriptorType);
-
-VOID RTMPFrameEndianChange(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG Dir,
- IN BOOLEAN FromRxDoneInt);
-
-// ap_assoc.c
-
-VOID APAssocStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID APPeerAssocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APPeerReassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APPeerDisassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MbssKickOutStas(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx,
- IN USHORT Reason);
-
-VOID APMlmeKickOutSta(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pStaAddr,
- IN UCHAR Wcid,
- IN USHORT Reason);
-
-VOID APMlmeDisassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APCls3errAction(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN PHEADER_802_11 pHeader);
-
-
-USHORT APBuildAssociation(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN USHORT CapabilityInfo,
- IN UCHAR MaxSupportedRateIn500Kbps,
- IN UCHAR *RSN,
- IN UCHAR *pRSNLen,
- IN BOOLEAN bWmmCapable,
- IN ULONG RalinkIe,
-#ifdef DOT11N_DRAFT3
- IN EXT_CAP_INFO_ELEMENT ExtCapInfo,
-#endif // DOT11N_DRAFT3 //
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- OUT USHORT *pAid);
-
-/*
-VOID RTMPAddClientSec(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIdx,
- IN UCHAR KeyIdx,
- IN UCHAR CipherAlg,
- IN PUCHAR pKey,
- IN PUCHAR pTxMic,
- IN PUCHAR pRxMic,
- IN MAC_TABLE_ENTRY *pEntry);
-*/
-
-// ap_auth.c
-
-void APAuthStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID APCls2errAction(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN PHEADER_802_11 pHeader);
-
-// ap_connect.c
-
-
-VOID APMakeBssBeacon(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx);
-
-VOID APUpdateBeaconFrame(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx);
-
-VOID APMakeAllBssBeacon(
- IN PRTMP_ADAPTER pAd);
-
-VOID APUpdateAllBeaconFrame(
- IN PRTMP_ADAPTER pAd);
-
-
-// ap_sync.c
-
-VOID APSyncStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID APScanTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID APInvalidStateWhenScan(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APScanTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APPeerProbeReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APPeerBeaconAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APMlmeScanReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APPeerBeaconAtScanAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID APScanCnclAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ApSiteSurvey(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_802_11_SSID pSsid,
- IN UCHAR ScanType);
-
-VOID SupportRate(
- IN PUCHAR SupRate,
- IN UCHAR SupRateLen,
- IN PUCHAR ExtRate,
- IN UCHAR ExtRateLen,
- OUT PUCHAR *Rates,
- OUT PUCHAR RatesLen,
- OUT PUCHAR pMaxSupportRate);
-
-
-BOOLEAN ApScanRunning(
- IN PRTMP_ADAPTER pAd);
-
-#ifdef DOT11N_DRAFT3
-VOID APOverlappingBSSScan(
- IN RTMP_ADAPTER *pAd);
-#endif // DOT11N_DRAFT3 //
-
-// ap_wpa.c
-VOID WpaStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-// ap_mlme.c
-VOID APMlmePeriodicExec(
- IN PRTMP_ADAPTER pAd);
-
-VOID APMlmeSelectTxRateTable(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR *ppTable,
- IN PUCHAR pTableSize,
- IN PUCHAR pInitTxRateIdx);
-
-VOID APMlmeSetTxRate(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PRTMP_TX_RATE_SWITCH pTxRate);
-
-VOID APMlmeDynamicTxRateSwitching(
- IN PRTMP_ADAPTER pAd);
-
-VOID APQuickResponeForRateUpExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-BOOLEAN APMsgTypeSubst(
- IN PRTMP_ADAPTER pAd,
- IN PFRAME_802_11 pFrame,
- OUT INT *Machine,
- OUT INT *MsgType);
-
-VOID APQuickResponeForRateUpExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-
-VOID RTMPSetPiggyBack(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bPiggyBack);
-
-VOID APAsicEvaluateRxAnt(
- IN PRTMP_ADAPTER pAd);
-
-VOID APAsicRxAntEvalTimeout(
- IN PRTMP_ADAPTER pAd);
-
-// ap.c
-
-VOID APSwitchChannel(
- IN PRTMP_ADAPTER pAd,
- IN INT Channel);
-
-NDIS_STATUS APInitialize(
- IN PRTMP_ADAPTER pAd);
-
-VOID APShutdown(
- IN PRTMP_ADAPTER pAd);
-
-VOID APStartUp(
- IN PRTMP_ADAPTER pAd);
-
-VOID APStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID APCleanupPsQueue(
- IN PRTMP_ADAPTER pAd,
- IN PQUEUE_HEADER pQueue);
-
-VOID MacTableReset(
- IN PRTMP_ADAPTER pAd);
-
-MAC_TABLE_ENTRY *MacTableInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR apidx,
- IN BOOLEAN CleanAll);
-
-BOOLEAN MacTableDeleteEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT wcid,
- IN PUCHAR pAddr);
-
-MAC_TABLE_ENTRY *MacTableLookup(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-VOID MacTableMaintenance(
- IN PRTMP_ADAPTER pAd);
-
-UINT32 MacTableAssocStaNumGet(
- IN PRTMP_ADAPTER pAd);
-
-MAC_TABLE_ENTRY *APSsPsInquiry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- OUT SST *Sst,
- OUT USHORT *Aid,
- OUT UCHAR *PsMode,
- OUT UCHAR *Rate);
-
-BOOLEAN APPsIndicate(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN ULONG Wcid,
- IN UCHAR Psm);
-
-VOID ApLogEvent(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN USHORT Event);
-
-#ifdef DOT11_N_SUPPORT
-VOID APUpdateOperationMode(
- IN PRTMP_ADAPTER pAd);
-#endif // DOT11_N_SUPPORT //
-
-VOID APUpdateCapabilityAndErpIe(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN ApCheckAccessControlList(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR Apidx);
-
-VOID ApUpdateAccessControlList(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Apidx);
-
-VOID ApEnqueueNullFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR TxRate,
- IN UCHAR PID,
- IN UCHAR apidx,
- IN BOOLEAN bQosNull,
- IN BOOLEAN bEOSP,
- IN UCHAR OldUP);
-
-VOID ApSendFrame(
- IN PRTMP_ADAPTER pAd,
- IN PVOID pBuffer,
- IN ULONG Length,
- IN UCHAR TxRate,
- IN UCHAR PID);
-
-VOID ApEnqueueAckFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR TxRate,
- IN UCHAR apidx);
-
-// ap_sanity.c
-
-
-BOOLEAN PeerAssocReqCmmSanity(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN isRessoc,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pListenInterval,
- OUT PUCHAR pApAddr,
- OUT UCHAR *pSsidLen,
- OUT char *Ssid,
- OUT UCHAR *pRatesLen,
- OUT UCHAR Rates[],
- OUT UCHAR *RSN,
- OUT UCHAR *pRSNLen,
- OUT BOOLEAN *pbWmmCapable,
- OUT ULONG *pRalinkIe,
-#ifdef DOT11N_DRAFT3
- OUT EXT_CAP_INFO_ELEMENT *pExtCapInfo,
-#endif // DOT11N_DRAFT3 //
- OUT UCHAR *pHtCapabilityLen,
- OUT HT_CAPABILITY_IE *pHtCapability);
-
-
-BOOLEAN PeerDisassocReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *Reason);
-
-BOOLEAN PeerDeauthReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *Reason);
-
-BOOLEAN APPeerAuthSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr1,
- OUT PUCHAR pAddr2,
- OUT USHORT *Alg,
- OUT USHORT *Seq,
- OUT USHORT *Status,
- OUT CHAR *ChlgText
- );
-
-BOOLEAN APPeerProbeReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT CHAR Ssid[],
- OUT UCHAR *SsidLen);
-
-BOOLEAN APPeerBeaconAndProbeRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT PUCHAR pBssid,
- OUT CHAR Ssid[],
- OUT UCHAR *SsidLen,
- OUT UCHAR *BssType,
- OUT USHORT *BeaconPeriod,
- OUT UCHAR *Channel,
- OUT LARGE_INTEGER *Timestamp,
- OUT USHORT *CapabilityInfo,
- OUT UCHAR Rate[],
- OUT UCHAR *RateLen,
- OUT BOOLEAN *ExtendedRateIeExist,
- OUT UCHAR *Erp);
-#if defined(RT30xx) || defined(RT305x)
-VOID EnableAPMIMOPS(
- IN PRTMP_ADAPTER pAd);
-
-VOID DisableAPMIMOPS(
- IN PRTMP_ADAPTER pAd);
-#endif
-#endif // __AP_H__
diff --git a/drivers/staging/rt3090/ap_apcli.h b/drivers/staging/rt3090/ap_apcli.h
deleted file mode 100644
index d363c36b8287..000000000000
--- a/drivers/staging/rt3090/ap_apcli.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_apcli.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Shiang, Fonchi 02-13-2007 created
-*/
-
-#ifndef _AP_APCLI_H_
-#define _AP_APCLI_H_
-
-#ifdef APCLI_SUPPORT
-
-#include "rtmp.h"
-
-#define AUTH_TIMEOUT 300 // unit: msec
-#define ASSOC_TIMEOUT 300 // unit: msec
-//#define JOIN_TIMEOUT 2000 // unit: msec // not used in Ap-client mode, remove it
-#define PROBE_TIMEOUT 1000 // unit: msec
-
-#define APCLI_ROOT_BSSID_GET(pAd, wcid) ((pAd)->MacTab.Content[(wcid)].Addr)
-#define APCLI_IF_UP_CHECK(pAd, ifidx) ((pAd)->ApCfg.ApCliTab[(ifidx)].dev->flags & IFF_UP)
-
-/* sanity check for apidx */
-#define APCLI_MR_APIDX_SANITY_CHECK(idx) \
-{ \
- if ((idx) >= MAX_APCLI_NUM) \
- { \
- (idx) = 0; \
- DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apcli-idx > MAX_APCLI_NUM!\n", __FUNCTION__)); \
- } \
-}
-
-typedef struct _APCLI_MLME_JOIN_REQ_STRUCT {
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR SsidLen;
- UCHAR Ssid[MAX_LEN_OF_SSID];
-} APCLI_MLME_JOIN_REQ_STRUCT;
-
-typedef struct _STA_CTRL_JOIN_REQ_STRUCT {
- USHORT Status;
-} APCLI_CTRL_MSG_STRUCT, *PSTA_CTRL_MSG_STRUCT;
-
-BOOLEAN isValidApCliIf(
- SHORT ifIndex);
-
-//
-// Private routines in apcli_ctrl.c
-//
-VOID ApCliCtrlStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *Sm,
- OUT STATE_MACHINE_FUNC_EX Trans[]);
-
-//
-// Private routines in apcli_sync.c
-//
-VOID ApCliSyncStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *Sm,
- OUT STATE_MACHINE_FUNC_EX Trans[]);
-
-//
-// Private routines in apcli_auth.c
-//
-VOID ApCliAuthStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *Sm,
- OUT STATE_MACHINE_FUNC_EX Trans[]);
-
-//
-// Private routines in apcli_assoc.c
-//
-VOID ApCliAssocStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *Sm,
- OUT STATE_MACHINE_FUNC_EX Trans[]);
-
-MAC_TABLE_ENTRY *ApCliTableLookUpByWcid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR wcid,
- IN PUCHAR pAddrs);
-
-
-BOOLEAN ApCliAllowToSendPacket(
- IN RTMP_ADAPTER *pAd,
- IN PNDIS_PACKET pPacket,
- OUT UCHAR *pWcid);
-
-BOOLEAN ApCliValidateRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PEID_STRUCT pEid_ptr,
- IN USHORT eid_len,
- IN USHORT idx);
-
-VOID RT28xx_ApCli_Init(
- IN PRTMP_ADAPTER pAd,
- IN PNET_DEV pPhyNetDev);
-
-VOID RT28xx_ApCli_Close(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT28xx_ApCli_Remove(
- IN PRTMP_ADAPTER pAd);
-
-
-VOID RT28xx_ApCli_Remove(
- IN PRTMP_ADAPTER ad_p);
-
-INT ApCliIfLookUp(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-INT ApCli_VirtualIF_Open(
- IN PNET_DEV dev_p);
-
-INT ApCli_VirtualIF_Close(
- IN PNET_DEV dev_p);
-
-INT ApCli_VirtualIF_PacketSend(
- IN PNDIS_PACKET skb_p,
- IN PNET_DEV dev_p);
-
-INT ApCli_VirtualIF_Ioctl(
- IN PNET_DEV dev_p,
- IN OUT struct ifreq *rq_p,
- IN INT cmd);
-
-
-VOID ApCliMgtMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR SubType,
- IN UCHAR ToDs,
- IN PUCHAR pDA,
- IN PUCHAR pBssid,
- IN USHORT ifIndex);
-
-#ifdef DOT11_N_SUPPORT
-BOOLEAN ApCliCheckHt(
- IN PRTMP_ADAPTER pAd,
- IN USHORT IfIndex,
- IN OUT HT_CAPABILITY_IE *pHtCapability,
- IN OUT ADD_HT_INFO_IE *pAddHtInfo);
-#endif // DOT11_N_SUPPORT //
-
-BOOLEAN ApCliLinkUp(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR ifIndex);
-
-VOID ApCliLinkDown(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR ifIndex);
-
-VOID ApCliIfUp(
- IN PRTMP_ADAPTER pAd);
-
-VOID ApCliIfDown(
- IN PRTMP_ADAPTER pAd);
-
-VOID ApCliIfMonitor(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN ApCliMsgTypeSubst(
- IN PRTMP_ADAPTER pAd,
- IN PFRAME_802_11 pFrame,
- OUT INT *Machine,
- OUT INT *MsgType);
-
-BOOLEAN preCheckMsgTypeSubset(
- IN PRTMP_ADAPTER pAd,
- IN PFRAME_802_11 pFrame,
- OUT INT *Machine,
- OUT INT *MsgType);
-
-BOOLEAN ApCliPeerAssocRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pStatus,
- OUT USHORT *pAid,
- OUT UCHAR SupRate[],
- OUT UCHAR *pSupRateLen,
- OUT UCHAR ExtRate[],
- OUT UCHAR *pExtRateLen,
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- OUT UCHAR *pHtCapabilityLen,
- OUT UCHAR *pAddHtInfoLen,
- OUT UCHAR *pNewExtChannelOffset,
- OUT PEDCA_PARM pEdcaParm,
- OUT UCHAR *pCkipFlag);
-
-VOID ApCliPeerPairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ApCliPeerPairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ApCliPeerGroupMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-BOOLEAN ApCliCheckRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN UCHAR DataLen,
- IN MAC_TABLE_ENTRY *pEntry,
- OUT UCHAR *Offset);
-
-BOOLEAN ApCliParseKeyData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKeyData,
- IN UCHAR KeyDataLen,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR IfIdx,
- IN UCHAR bPairewise);
-
-BOOLEAN ApCliHandleRxBroadcastFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR FromWhichBSSID);
-
-VOID APCliUpdatePairwiseKeyTable(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR *KeyRsc,
- IN MAC_TABLE_ENTRY *pEntry);
-
-BOOLEAN APCliUpdateSharedKeyTable(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN UCHAR KeyLen,
- IN UCHAR DefaultKeyIdx,
- IN MAC_TABLE_ENTRY *pEntry);
-
-#endif // APCLI_SUPPORT //
-
-#endif /* _AP_APCLI_H_ */
diff --git a/drivers/staging/rt3090/ap_autoChSel.h b/drivers/staging/rt3090/ap_autoChSel.h
deleted file mode 100644
index 46881ff857ac..000000000000
--- a/drivers/staging/rt3090/ap_autoChSel.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_autoChSel.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "ap_autoChSel_cmm.h"
-
-#ifndef __AUTOCHSELECT_H__
-#define __AUTOCHSELECT_H__
-
-#ifdef AUTO_CH_SELECT_ENHANCE
-#define AP_AUTO_CH_SEL(__P, __O) New_APAutoSelectChannel((__P), (__O))
-#else
-#define AP_AUTO_CH_SEL(__P, __O) APAutoSelectChannel((__P), (__O))
-#endif
-
-
-ULONG AutoChBssInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pBssid,
- IN CHAR Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR ChannelNo,
- IN UCHAR ExtChOffset,
- IN CHAR Rssi);
-
-void AutoChBssTableInit(
- IN PRTMP_ADAPTER pAd);
-
-void ChannelInfoInit(
- IN PRTMP_ADAPTER pAd);
-
-void AutoChBssTableDestroy(
- IN PRTMP_ADAPTER pAd);
-
-void ChannelInfoDestroy(
- IN PRTMP_ADAPTER pAd);
-
-UCHAR New_APAutoSelectChannel(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN Optimal);
-
-UCHAR APAutoSelectChannel(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN Optimal);
-
-#endif // __AUTOCHSELECT_H__ //
diff --git a/drivers/staging/rt3090/ap_autoChSel_cmm.h b/drivers/staging/rt3090/ap_autoChSel_cmm.h
deleted file mode 100644
index ad77ec125625..000000000000
--- a/drivers/staging/rt3090/ap_autoChSel_cmm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_autoChSel_cmm.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-
-#ifndef __AUTOCHSELECT_CMM_H__
-#define __AUTOCHSELECT_CMM_H__
-
-#define RSSI_TO_DBM_OFFSET 120 // RSSI-115 = dBm
-
-
-typedef struct {
- ULONG dirtyness[MAX_NUM_OF_CHANNELS+1];
- ULONG max_rssi[MAX_NUM_OF_CHANNELS+1];
- ULONG total_rssi[MAX_NUM_OF_CHANNELS+1];
- UINT32 FalseCCA[MAX_NUM_OF_CHANNELS+1];
-} CHANNELINFO, *PCHANNELINFO;
-
-typedef struct {
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR SsidLen;
- CHAR Ssid[MAX_LEN_OF_SSID];
- UCHAR Channel;
- UCHAR ExtChOffset;
- UCHAR Rssi;
-} BSSENTRY, *PBSSENTRY;
-
-typedef struct {
- UCHAR BssNr;
- BSSENTRY BssEntry[MAX_LEN_OF_BSS_TABLE];
-} BSSINFO, *PBSSINFO;
-
-#endif // __AUTOCHSELECT_CMM_H__ //
diff --git a/drivers/staging/rt3090/ap_cfg.h b/drivers/staging/rt3090/ap_cfg.h
deleted file mode 100644
index 7c99423900ad..000000000000
--- a/drivers/staging/rt3090/ap_cfg.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_cfg.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-#ifndef __AP_CFG_H__
-#define __AP_CFG_H__
-
-
-#include "rt_config.h"
-
-INT RTMPAPPrivIoctlSet(
- IN RTMP_ADAPTER *pAd,
- IN struct iwreq *pIoctlCmdStr);
-
-INT RTMPAPPrivIoctlShow(
- IN RTMP_ADAPTER *pAd,
- IN struct iwreq *pIoctlCmdStr);
-
-INT RTMPAPSetInformation(
- IN PRTMP_ADAPTER pAd,
- IN OUT struct iwreq *rq,
- IN INT cmd);
-
-INT RTMPAPQueryInformation(
- IN PRTMP_ADAPTER pAd,
- IN OUT struct iwreq *rq,
- IN INT cmd);
-
-VOID RTMPIoctlStatistics(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlGetMacTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-#ifdef DBG
-VOID RTMPAPIoctlBBP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-VOID RTMPAPIoctlMAC(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-VOID RTMPAPIoctlE2PROM(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-#ifdef RTMP_RF_RW_SUPPORT
-VOID RTMPAPIoctlRF(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-#endif // RTMP_RF_RW_SUPPORT //
-
-#endif // DBG //
-
-VOID RT28XX_IOCTL_MaxRateGet(
- IN RTMP_ADAPTER *pAd,
- IN PHTTRANSMIT_SETTING pHtPhyMode,
- OUT UINT32 *pRate);
-
-
-#ifdef DOT11_N_SUPPORT
-VOID RTMPIoctlQueryBaTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-#endif // DOT11_N_SUPPORT //
-
-VOID RTMPIoctlStaticWepCopy(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlRadiusData(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlAddWPAKey(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlAddPMKIDCache(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-#endif // __AP_CFG_H__ //
diff --git a/drivers/staging/rt3090/ap_ids.h b/drivers/staging/rt3090/ap_ids.h
deleted file mode 100644
index cf8797f7f580..000000000000
--- a/drivers/staging/rt3090/ap_ids.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_ids.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-VOID RTMPIdsPeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-BOOLEAN RTMPSpoofedMgmtDetection(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHeader,
- IN CHAR Rssi0,
- IN CHAR Rssi1,
- IN CHAR Rssi2);
-
-VOID RTMPConflictSsidDetection(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen,
- IN CHAR Rssi0,
- IN CHAR Rssi1,
- IN CHAR Rssi2);
-
-BOOLEAN RTMPReplayAttackDetection(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr2,
- IN CHAR Rssi0,
- IN CHAR Rssi1,
- IN CHAR Rssi2);
-
-VOID RTMPUpdateStaMgmtCounter(
- IN PRTMP_ADAPTER pAd,
- IN USHORT type);
-
-VOID RTMPClearAllIdsCounter(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPIdsStart(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPIdsStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID rtmp_read_ids_from_file(
- IN PRTMP_ADAPTER pAd,
- char *tmpbuf,
- char *buffer);
diff --git a/drivers/staging/rt3090/ap_mbss.h b/drivers/staging/rt3090/ap_mbss.h
deleted file mode 100644
index f78556c529a8..000000000000
--- a/drivers/staging/rt3090/ap_mbss.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_mbss.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#ifndef MODULE_MBSS
-
-#define MBSS_EXTERN extern
-
-#else
-
-#define MBSS_EXTERN
-
-#endif // MODULE_MBSS //
-
-
-/* Public function list */
-MBSS_EXTERN VOID RT28xx_MBSS_Init(
- IN PRTMP_ADAPTER ad_p,
- IN PNET_DEV main_dev_p);
-
-MBSS_EXTERN VOID RT28xx_MBSS_Close(
- IN PRTMP_ADAPTER ad_p);
-
-MBSS_EXTERN VOID RT28xx_MBSS_Remove(
- IN PRTMP_ADAPTER ad_p);
-
-INT MBSS_VirtualIF_Open(
- IN PNET_DEV dev_p);
-INT MBSS_VirtualIF_Close(
- IN PNET_DEV dev_p);
-INT MBSS_VirtualIF_PacketSend(
- IN PNDIS_PACKET skb_p,
- IN PNET_DEV dev_p);
-INT MBSS_VirtualIF_Ioctl(
- IN PNET_DEV dev_p,
- IN OUT struct ifreq *rq_p,
- IN INT cmd);
-
-/* End of ap_mbss.h */
diff --git a/drivers/staging/rt3090/ap_uapsd.h b/drivers/staging/rt3090/ap_uapsd.h
deleted file mode 100644
index d49a9e7500b4..000000000000
--- a/drivers/staging/rt3090/ap_uapsd.h
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_uapsd.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-/* only for UAPSD_TIMING_RECORD */
-
-//#define UAPSD_TIMING_RECORD_FUNC
-
-#define UAPSD_TIMING_RECORD_MAX 1000
-#define UAPSD_TIMING_RECORD_DISPLAY_TIMES 10
-
-#define UAPSD_TIMING_RECORD_ISR 1
-#define UAPSD_TIMING_RECORD_TASKLET 2
-#define UAPSD_TIMING_RECORD_TRG_RCV 3
-#define UAPSD_TIMING_RECORD_MOVE2TX 4
-#define UAPSD_TIMING_RECORD_TX2AIR 5
-
-#define UAPSD_TIMING_CTRL_STOP 0
-#define UAPSD_TIMING_CTRL_START 1
-#define UAPSD_TIMING_CTRL_SUSPEND 2
-
-#define UAPSD_TIMESTAMP_GET(__pAd, __TimeStamp) \
- { \
- UINT32 __CSR=0; UINT64 __Value64; \
- RTMP_IO_READ32((__pAd), TSF_TIMER_DW0, &__CSR); \
- __TimeStamp = (UINT64)__CSR; \
- RTMP_IO_READ32((__pAd), TSF_TIMER_DW1, &__CSR); \
- __Value64 = (UINT64)__CSR; \
- __TimeStamp |= (__Value64 << 32); \
- }
-
-#ifdef LINUX
-#define UAPSD_TIME_GET(__pAd, __Time) \
- __Time = jiffies
-#endif // LINUX //
-
-
-#ifdef UAPSD_TIMING_RECORD_FUNC
-#define UAPSD_TIMING_RECORD_START() \
- UAPSD_TimingRecordCtrl(UAPSD_TIMING_CTRL_START);
-#define UAPSD_TIMING_RECORD_STOP() \
- UAPSD_TimingRecordCtrl(UAPSD_TIMING_CTRL_STOP);
-#define UAPSD_TIMING_RECORD(__pAd, __Type) \
- UAPSD_TimingRecord(__pAd, __Type);
-#define UAPSD_TIMING_RECORD_INDEX(__LoopIndex) \
- UAPSD_TimeingRecordLoopIndex(__LoopIndex);
-#else
-
-#define UAPSD_TIMING_RECORD_START()
-#define UAPSD_TIMING_RECORD_STOP()
-#define UAPSD_TIMING_RECORD(__pAd, __type)
-#define UAPSD_TIMING_RECORD_INDEX(__LoopIndex)
-#endif // UAPSD_TIMING_RECORD_FUNC //
-
-
-#ifndef MODULE_WMM_UAPSD
-
-#define UAPSD_EXTERN extern
-
-/* Public Marco list */
-
-/*
- Init some parameters in packet structure for QoS Null frame;
- purpose: is for management frame tx done use
-*/
-#define UAPSD_MR_QOS_NULL_HANDLE(__pAd, __pData, __pPacket) \
- { \
- PHEADER_802_11 __pHeader = (PHEADER_802_11)(__pData); \
- MAC_TABLE_ENTRY *__pEntry; \
- if (__pHeader->FC.SubType == SUBTYPE_QOS_NULL) \
- { \
- RTMP_SET_PACKET_QOS_NULL((__pPacket)); \
- __pEntry = MacTableLookup((__pAd), __pHeader->Addr1); \
- if (__pEntry != NULL) \
- { \
- RTMP_SET_PACKET_WCID((__pPacket), __pEntry->Aid); \
- } \
- } \
- else \
- { \
- RTMP_SET_PACKET_NON_QOS_NULL((__pPacket)); \
- } \
- }
-
-/*
- Init MAC entry UAPSD parameters;
- purpose: initialize UAPSD PS queue and control parameters
-*/
-#define UAPSD_MR_ENTRY_INIT(__pEntry) \
- { \
- UINT16 __IdAc; \
- for(__IdAc=0; __IdAc<WMM_NUM_OF_AC; __IdAc++) \
- InitializeQueueHeader(&(__pEntry)->UAPSDQueue[__IdAc]); \
- (__pEntry)->UAPSDTxNum = 0; \
- (__pEntry)->pUAPSDEOSPFrame = NULL; \
- (__pEntry)->bAPSDFlagSPStart = 0; \
- (__pEntry)->bAPSDFlagEOSPOK = 0; \
- (__pEntry)->MaxSPLength = 0; \
- }
-
-/*
- Reset MAC entry UAPSD parameters;
- purpose: clean all UAPSD PS queue; release the EOSP frame if exists;
- reset control parameters
-*/
-#define UAPSD_MR_ENTRY_RESET(__pAd, __pEntry) \
- { \
- MAC_TABLE_ENTRY *__pSta; \
- UINT32 __IdAc; \
- __pSta = (__pEntry); \
- /* clear all U-APSD queues */ \
- for(__IdAc=0; __IdAc<WMM_NUM_OF_AC; __IdAc++) \
- APCleanupPsQueue((__pAd), &__pSta->UAPSDQueue[__IdAc]); \
- /* clear EOSP frame */ \
- __pSta->UAPSDTxNum = 0; \
- if (__pSta->pUAPSDEOSPFrame != NULL) { \
- RELEASE_NDIS_PACKET((__pAd), \
- QUEUE_ENTRY_TO_PACKET(__pSta->pUAPSDEOSPFrame), \
- NDIS_STATUS_FAILURE); \
- __pSta->pUAPSDEOSPFrame = NULL; } \
- __pSta->bAPSDFlagSPStart = 0; \
- __pSta->bAPSDFlagEOSPOK = 0; }
-
-/*
- Enable or disable UAPSD flag in WMM element in beacon frame;
- purpose: set UAPSD enable/disable bit
-*/
-#define UAPSD_MR_IE_FILL(__QosCtrlField, __pAd) \
- (__QosCtrlField) |= ((__pAd)->CommonCfg.bAPSDCapable) ? 0x80 : 0x00;
-
-/*
- Check if we do NOT need to control TIM bit for the station;
- note: we control TIM bit only when all AC are UAPSD AC
-*/
-#define UAPSD_MR_IS_NOT_TIM_BIT_NEEDED_HANDLED(__pMacEntry, __QueIdx) \
- (CLIENT_STATUS_TEST_FLAG((__pMacEntry), fCLIENT_STATUS_APSD_CAPABLE) && \
- (!(__pMacEntry)->bAPSDDeliverEnabledPerAC[QID_AC_VO] || \
- !(__pMacEntry)->bAPSDDeliverEnabledPerAC[QID_AC_VI] || \
- !(__pMacEntry)->bAPSDDeliverEnabledPerAC[QID_AC_BE] || \
- !(__pMacEntry)->bAPSDDeliverEnabledPerAC[QID_AC_BK]) && \
- (__pMacEntry)->bAPSDDeliverEnabledPerAC[__QueIdx])
-
-/* check if the AC is UAPSD delivery-enabled AC */
-#define UAPSD_MR_IS_UAPSD_AC(__pMacEntry, __AcId) \
- (CLIENT_STATUS_TEST_FLAG((__pMacEntry), fCLIENT_STATUS_APSD_CAPABLE) && \
- ((0 <= (__AcId)) && ((__AcId) < WMM_NUM_OF_AC)) && /* 0 ~ 3 */ \
- (__pMacEntry)->bAPSDDeliverEnabledPerAC[(__AcId)])
-
-/* check if all AC are UAPSD delivery-enabled AC */
-#define UAPSD_MR_IS_ALL_AC_UAPSD(__FlgIsActive, __pMacEntry) \
- (((__FlgIsActive) == FALSE) && ((__pMacEntry)->bAPSDAllAC == 1))
-
-/* suspend SP */
-#define UAPSD_MR_SP_SUSPEND(__pAd) \
- (__pAd)->bAPSDFlagSPSuspend = 1;
-
-/* resume SP */
-#define UAPSD_MR_SP_RESUME(__pAd) \
- (__pAd)->bAPSDFlagSPSuspend = 0;
-
-/* mark PS poll frame sent in mix mode */
-#ifdef RTMP_MAC_PCI
-/*
- Note:
- (1) When SP is not started, try to mark a flag to record if the legacy ps
- packet is handled in statistics handler;
- (2) When SP is started, increase the UAPSD count number for the legacy PS.
-*/
-#define UAPSD_MR_MIX_PS_POLL_RCV(__pAd, __pMacEntry) \
- if ((__pMacEntry)->bAPSDFlagSpRoughUse == 0) \
- { \
- if ((__pMacEntry)->bAPSDFlagSPStart == 0) \
- { \
- if ((__pMacEntry)->bAPSDFlagLegacySent == 1) \
- NICUpdateFifoStaCounters((__pAd)); \
- (__pMacEntry)->bAPSDFlagLegacySent = 1; \
- } \
- else \
- { \
- (__pMacEntry)->UAPSDTxNum ++; \
- } \
- }
-#endif // RTMP_MAC_PCI //
-
-
-#else
-
-#define UAPSD_EXTERN
-#define UAPSD_QOS_NULL_QUE_ID 0x7f
-
-#ifdef RTMP_MAC_PCI
-/*
- In RT2870, FIFO counter is for all stations, not for per-entry,
- so we can not use accurate method in RT2870
-*/
-
-/*
- Note for SP ACCURATE Mechanism:
- 1. When traffic is busy for the PS station
- Statistics FIFO counter maybe overflow before we read it, so UAPSD
- counting mechanism will not accurately.
-
- Solution:
- We need to avoid the worse case so we suggest a maximum interval for
- a SP that the interval between last frame from QAP and data frame from
- QSTA is larger than UAPSD_EPT_SP_INT.
-
- 2. When traffic use CCK/1Mbps from QAP
- Statistics FIFO will not count the packet. There are 2 cases:
- (1) We force to downgrage ARP response & DHCP packet to 1Mbps;
- (2) After rate switch mechanism, tx rate is fixed to 1Mbps.
-
- Solution:
- Use old DMA UAPSD mechanism.
-
- 3. When part of AC uses legacy PS mode
- Statistics count will inclue packet statistics for legacy PS packets
- so we can not know which one is UAPSD, which one is legacy.
-
- Solution:
- Cound the legacy PS packet.
-
- 4. Check FIFO statistics count in Rx Done function
- We can not to check TX FIFO statistics count in Rx Done function or
- the real packet tx/rx sequence will be disarranged.
-
- Solution:
- Suspend SP handle before rx done and resume SP handle after rx done.
-*/
-#define UAPSD_SP_ACCURATE /* use more accurate method to send EOSP */
-#endif // RTMP_MAC_PCI //
-
-#define UAPSD_EPT_SP_INT (100000/(1000000/OS_HZ)) /* 100ms */
-
-#endif // MODULE_WMM_UAPSD //
-
-
-/* max UAPSD buffer queue size */
-#define MAX_PACKETS_IN_UAPSD_QUEUE 16 /* for each AC = 16*4 = 64 */
-
-
-/* Public function list */
-/*
-========================================================================
-Routine Description:
- UAPSD Module Init.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_Init(
- IN PRTMP_ADAPTER pAd);
-
-
-/*
-========================================================================
-Routine Description:
- UAPSD Module Release.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_Release(
- IN PRTMP_ADAPTER pAd);
-
-
-/*
-========================================================================
-Routine Description:
- Free all EOSP frames and close all SP.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_FreeAll(
- IN PRTMP_ADAPTER pAd);
-
-
-/*
-========================================================================
-Routine Description:
- Close current Service Period.
-
-Arguments:
- pAd Pointer to our adapter
- pEntry Close the SP of the entry
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_SP_Close(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-
-/*
-========================================================================
-Routine Description:
- Deliver all queued packets.
-
-Arguments:
- pAd Pointer to our adapter
- *pEntry STATION
-
-Return Value:
- None
-
-Note:
- SMP protection by caller for packet enqueue.
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_AllPacketDeliver(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-
-/*
-========================================================================
-Routine Description:
- Parse the UAPSD field in WMM element in (re)association request frame.
-
-Arguments:
- pAd Pointer to our adapter
- *pEntry STATION
- *pElm QoS information field
-
-Return Value:
- None
-
-Note:
- No protection is needed.
-
- 1. Association -> TSPEC:
- use static UAPSD settings in Association
- update UAPSD settings in TSPEC
-
- 2. Association -> TSPEC(11r) -> Reassociation:
- update UAPSD settings in TSPEC
- backup static UAPSD settings in Reassociation
-
- 3. Association -> Reassociation:
- update UAPSD settings in TSPEC
- backup static UAPSD settings in Reassociation
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_AssocParse(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR *pElm);
-
-
-/*
-========================================================================
-Routine Description:
- Enqueue a UAPSD packet.
-
-Arguments:
- pAd Pointer to our adapter
- *pEntry STATION
- pPacket UAPSD dnlink packet
- IdAc UAPSD AC ID (0 ~ 3)
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_PacketEnqueue(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN PNDIS_PACKET pPacket,
- IN UINT32 IdAc);
-
-
-/*
-========================================================================
-Routine Description:
- Handle QoS Null Frame Tx Done or Management Tx Done interrupt.
-
-Arguments:
- pAd Pointer to our adapter
- pPacket Completed TX packet
- pDstMac Destinated MAC address
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_QoSNullTxMgmtTxDoneHandle(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR *pDstMac);
-
-
-/*
-========================================================================
-Routine Description:
- Maintenance our UAPSD PS queue. Release all queued packet if timeout.
-
-Arguments:
- pAd Pointer to our adapter
- *pEntry STATION
-
-Return Value:
- None
-
-Note:
- If in RT2870, pEntry can not be removed during UAPSD_QueueMaintenance()
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_QueueMaintenance(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-
-/*
-========================================================================
-Routine Description:
- Close SP in Tx Done, not Tx DMA Done.
-
-Arguments:
- pAd Pointer to our adapter
- pEntry destination entry
- FlgSuccess 0:tx success, 1:tx fail
-
-Return Value:
- None
-
-Note:
- For RT28xx series, for packetID=0 or multicast frame, no statistics
- count can be got, ex: ARP response or DHCP packets, we will use
- low rate to set (CCK, MCS=0=packetID).
- So SP will not be close until UAPSD_EPT_SP_INT timeout.
-
- So if the tx rate is 1Mbps for a entry, we will use DMA done, not
- use UAPSD_SP_AUE_Handle().
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_SP_AUE_Handle(
- IN RTMP_ADAPTER *pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR FlgSuccess);
-
-
-/*
-========================================================================
-Routine Description:
- Close current Service Period.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- None
-
-Note:
- When we receive EOSP frame tx done interrupt and a uplink packet
- from the station simultaneously, we will regard it as a new trigger
- frame because the packet is received when EOSP frame tx done interrupt.
-
- We can not sure the uplink packet is sent after old SP or in the old SP.
- So we must close the old SP in receive done ISR to avoid the problem.
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_SP_CloseInRVDone(
- IN PRTMP_ADAPTER pAd);
-
-
-/*
-========================================================================
-Routine Description:
- Check if we need to close current SP.
-
-Arguments:
- pAd Pointer to our adapter
- pPacket Completed TX packet
- pDstMac Destinated MAC address
-
-Return Value:
- None
-
-Note:
- 1. We need to call the function in TxDone ISR.
- 2. SMP protection by caller for packet enqueue.
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_SP_PacketCheck(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR *pDstMac);
-
-
-#ifdef UAPSD_TIMING_RECORD_FUNC
-/*
-========================================================================
-Routine Description:
- Enable/Disable Timing Record Function.
-
-Arguments:
- pAd Pointer to our adapter
- Flag 1 (Enable) or 0 (Disable)
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_TimingRecordCtrl(
- IN UINT32 Flag);
-
-/*
-========================================================================
-Routine Description:
- Record some timings.
-
-Arguments:
- pAd Pointer to our adapter
- Type The timing is for what type
-
-Return Value:
- None
-
-Note:
- UAPSD_TIMING_RECORD_ISR
- UAPSD_TIMING_RECORD_TASKLET
- UAPSD_TIMING_RECORD_TRG_RCV
- UAPSD_TIMING_RECORD_MOVE2TX
- UAPSD_TIMING_RECORD_TX2AIR
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_TimingRecord(
- IN PRTMP_ADAPTER pAd,
- IN UINT32 Type);
-
-/*
-========================================================================
-Routine Description:
- Record the loop index for received packet handle.
-
-Arguments:
- pAd Pointer to our adapter
- LoopIndex The RxProcessed in APRxDoneInterruptHandle()
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_TimeingRecordLoopIndex(
- IN UINT32 LoopIndex);
-#endif // UAPSD_TIMING_RECORD_FUNC //
-
-
-/*
-========================================================================
-Routine Description:
- Handle UAPSD Trigger Frame.
-
-Arguments:
- pAd Pointer to our adapter
- *pEntry the source STATION
- UpOfFrame the UP of the trigger frame
-
-Return Value:
- None
-
-Note:
-========================================================================
-*/
-UAPSD_EXTERN VOID UAPSD_TriggerFrameHandle(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR UpOfFrame);
-
-
-
-/* End of ap_uapsd.h */
diff --git a/drivers/staging/rt3090/ap_wds.h b/drivers/staging/rt3090/ap_wds.h
deleted file mode 100644
index efcb107db4ff..000000000000
--- a/drivers/staging/rt3090/ap_wds.h
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_cfg.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi 02-13-2007 created
-*/
-
-#ifndef _AP_WDS_H_
-#define _AP_WDS_H_
-
-#define WDS_ENTRY_RETRY_INTERVAL (100 * OS_HZ / 1000)
-
-
-static inline BOOLEAN WDS_IF_UP_CHECK(
- IN PRTMP_ADAPTER pAd,
- IN ULONG ifidx)
-{
- if ((pAd->flg_wds_init != TRUE) ||
- (ifidx >= MAX_WDS_ENTRY))
- return FALSE;
-
-// if (pAd->WdsTab.WdsEntry[ifidx].dev->flags & IFF_UP)
-// Patch for wds ,when dirver call apmlmeperiod => APMlmeDynamicTxRateSwitching check if wds device ready
-if ((pAd->WdsTab.WdsEntry[ifidx].dev != NULL) && (pAd->WdsTab.WdsEntry[ifidx].dev->flags & IFF_UP))
- return TRUE;
-
- return FALSE;
-}
-
-LONG WdsEntryAlloc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-VOID WdsEntryDel(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-MAC_TABLE_ENTRY *MacTableInsertWDSEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- UINT WdsTabIdx);
-
-BOOLEAN MacTableDeleteWDSEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT wcid,
- IN PUCHAR pAddr);
-
-
-BOOLEAN ApWdsAllowToSendPacket(
- IN RTMP_ADAPTER *pAd,
- IN PNDIS_PACKET pPacket,
- OUT UCHAR *pWcid);
-
-MAC_TABLE_ENTRY *WdsTableLookupByWcid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR wcid,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount);
-
-MAC_TABLE_ENTRY *WdsTableLookup(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount);
-
-MAC_TABLE_ENTRY *FindWdsEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN PUCHAR pAddr,
- IN UINT32 PhyMode);
-
-VOID WdsTableMaintenance(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT28xx_WDS_Init(
- IN PRTMP_ADAPTER pAd,
- IN PNET_DEV net_dev);
-
-VOID RT28xx_WDS_Close(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT28xx_WDS_Remove(
- IN PRTMP_ADAPTER pAd);
-
-VOID WdsDown(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicUpdateWdsRxWCIDTable(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicUpdateWdsEncryption(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR wcid);
-
-VOID WdsPeerBeaconProc(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN USHORT CapabilityInfo,
- IN UCHAR MaxSupportedRateIn500Kbps,
- IN UCHAR MaxSupportedRateLen,
- IN BOOLEAN bWmmCapable,
- IN ULONG ClientRalinkIe,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen);
-
-VOID APWdsInitialize(
- IN PRTMP_ADAPTER pAd);
-
-INT Show_WdsTable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-VOID rtmp_read_wds_from_file(
- IN PRTMP_ADAPTER pAd,
- PSTRING tmpbuf,
- PSTRING buffer);
-
-VOID WdsPrepareWepKeyFromMainBss(
- IN PRTMP_ADAPTER pAd);
-
-INT WdsVirtualIFSendPackets(
- IN PNDIS_PACKET pSkb,
- IN PNET_DEV dev);
-
-INT WdsVirtualIF_open(
- IN PNET_DEV dev);
-
-INT WdsVirtualIF_close(
- IN PNET_DEV dev);
-
-INT WdsVirtualIF_ioctl(
- IN PNET_DEV net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd);
-
-/*
- ==========================================================================
- Description:
- Check the WDS Entry is valid or not.
- ==========================================================================
- */
-static inline BOOLEAN ValidWdsEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR WdsIndex)
-{
- BOOLEAN result;
- PMAC_TABLE_ENTRY pMacEntry;
-
- do
- {
- if (WdsIndex >= MAX_WDS_ENTRY)
- {
- result = FALSE;
- break;
- }
-
- if (pAd->WdsTab.WdsEntry[WdsIndex].Valid != TRUE)
- {
- result = FALSE;
- break;
- }
-
- if ((pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID==0)
- || (pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID >= MAX_LEN_OF_MAC_TABLE))
- {
- result = FALSE;
- break;
- }
-
- pMacEntry = &pAd->MacTab.Content[pAd->WdsTab.WdsEntry[WdsIndex].MacTabMatchWCID];
- if (pMacEntry->ValidAsWDS != TRUE)
- {
- result = FALSE;
- break;
- }
-
- result = TRUE;
- } while(FALSE);
-
- return result;
-}
-#endif // _AP_WDS_H_ //
diff --git a/drivers/staging/rt3090/chips/rt3370.c b/drivers/staging/rt3090/chips/rt3370.c
deleted file mode 100644
index 38ecb0623424..000000000000
--- a/drivers/staging/rt3090/chips/rt3370.c
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt3370.c
-
- Abstract:
- Specific funcitons and variables for RT30xx.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#ifdef RT3370
-
-#include "../rt_config.h"
-
-
-#ifndef RTMP_RF_RW_SUPPORT
-#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
-#endif // RTMP_RF_RW_SUPPORT //
-
-
-VOID NICInitRT3370RFRegisters(IN PRTMP_ADAPTER pAd)
-{
- INT i;
- // Driver must read EEPROM to get RfIcType before initial RF registers
- // Initialize RF register to default value
- if (IS_RT3090(pAd)||IS_RT3390(pAd)||IS_RT3572(pAd))
- {
- // Init RF calibration
- // Driver should toggle RF R30 bit7 before init RF registers
- UINT32 RfReg = 0, data;
-
- RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
- RfReg |= 0x80;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
- RTMPusecDelay(1000);
- RfReg &= 0x7F;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
-
- // init R24, R31
- RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
- RT30xxWriteRFRegister(pAd, RF_R31, 0x0F);
-
- if (IS_RT3390(pAd))
- {
- // patch LNA_PE_G1 failed issue
- RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
- data &= ~(0x20);
- RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
-
- // RF registers initialization
- for (i = 0; i < NUM_RF_REG_PARMS_OVER_RT3390; i++)
- {
- RT30xxWriteRFRegister(pAd, RFRegTableOverRT3390[i].Register, RFRegTableOverRT3390[i].Value);
- }
- }
-
- // patch LNA_PE_G1 failed issue
- RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
- data &= ~(0x20);
- RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
-
- // Initialize RF register to default value
- for (i = 0; i < NUM_RF_REG_PARMS_OVER_RT3390; i++)
- {
- RT30xxWriteRFRegister(pAd, RT30xx_RFRegTable[i].Register, RT30xx_RFRegTable[i].Value);
- }
-
- // Driver should set RF R6 bit6 on before calibration
- RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
- RfReg |= 0x40;
- RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
-
- //For RF filter Calibration
- RTMPFilterCalibration(pAd);
-
- // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
-
- // set led open drain enable
- RTMP_IO_READ32(pAd, OPT_14, &data);
- data |= 0x01;
- RTMP_IO_WRITE32(pAd, OPT_14, data);
-
- // set default antenna as main
- if (pAd->RfIcType == RFIC_3020)
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
-
- // add by johnli, RF power sequence setup, load RF normal operation-mode setup
- RT30xxLoadRFNormalModeSetup(pAd);
- }
-
-}
-#endif // RT3070 //
diff --git a/drivers/staging/rt3090/chips/rt3390.c b/drivers/staging/rt3090/chips/rt3390.c
deleted file mode 100644
index afed9e705e8d..000000000000
--- a/drivers/staging/rt3090/chips/rt3390.c
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt3390.c
-
- Abstract:
- Specific funcitons and variables for RT30xx.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#ifdef RT3390
-
-#include "../rt_config.h"
-
-
-#ifndef RTMP_RF_RW_SUPPORT
-#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
-#endif // RTMP_RF_RW_SUPPORT //
-
-
-VOID NICInitRT3390RFRegisters(IN PRTMP_ADAPTER pAd)
-{
- INT i;
- // Driver must read EEPROM to get RfIcType before initial RF registers
- // Initialize RF register to default value
- if (IS_RT3090(pAd)||IS_RT3390(pAd)||IS_RT3572(pAd))
- {
- // Init RF calibration
- // Driver should toggle RF R30 bit7 before init RF registers
- UINT32 RfReg = 0, data;
-
- RT30xxReadRFRegister(pAd, RF_R30, (PUCHAR)&RfReg);
- RfReg |= 0x80;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
- RTMPusecDelay(1000);
- RfReg &= 0x7F;
- RT30xxWriteRFRegister(pAd, RF_R30, (UCHAR)RfReg);
-
- // init R24, R31
- RT30xxWriteRFRegister(pAd, RF_R24, 0x0F);
- RT30xxWriteRFRegister(pAd, RF_R31, 0x0F);
-
- if (IS_RT3390(pAd))
- {
- // patch LNA_PE_G1 failed issue
- RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
- data &= ~(0x20);
- RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
-
- // RF registers initialization
- for (i = 0; i < NUM_RF_REG_PARMS_OVER_RT3390; i++)
- {
- RT30xxWriteRFRegister(pAd, RFRegTableOverRT3390[i].Register, RFRegTableOverRT3390[i].Value);
- }
- }
-
- // patch LNA_PE_G1 failed issue
- RTMP_IO_READ32(pAd, GPIO_SWITCH, &data);
- data &= ~(0x20);
- RTMP_IO_WRITE32(pAd, GPIO_SWITCH, data);
-
- // Initialize RF register to default value
- for (i = 0; i < NUM_RF_REG_PARMS_OVER_RT3390; i++)
- {
- RT30xxWriteRFRegister(pAd, RFRegTableOverRT3390[i].Register, RFRegTableOverRT3390[i].Value);
- }
-
- // Driver should set RF R6 bit6 on before calibration
- RT30xxReadRFRegister(pAd, RF_R06, (PUCHAR)&RfReg);
- RfReg |= 0x40;
- RT30xxWriteRFRegister(pAd, RF_R06, (UCHAR)RfReg);
-
- //For RF filter Calibration
- RTMPFilterCalibration(pAd);
-
- // Initialize RF R27 register, set RF R27 must be behind RTMPFilterCalibration()
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RT30xxWriteRFRegister(pAd, RF_R27, 0x3);
-
- // set led open drain enable
- RTMP_IO_READ32(pAd, OPT_14, &data);
- data |= 0x01;
- RTMP_IO_WRITE32(pAd, OPT_14, data);
-
- // set default antenna as main
- if (pAd->RfIcType == RFIC_3020)
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
-
- // add by johnli, RF power sequence setup, load RF normal operation-mode setup
- RT33xxLoadRFNormalModeSetup(pAd);
- }
-
-}
-
-#endif // RT3390 //
diff --git a/drivers/staging/rt3090/chips/rt33xx.c b/drivers/staging/rt3090/chips/rt33xx.c
deleted file mode 100644
index 56f376c88bda..000000000000
--- a/drivers/staging/rt3090/chips/rt33xx.c
+++ /dev/null
@@ -1,536 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt33xx.c
-
- Abstract:
- Specific funcitons and variables for RT30xx.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-
-#ifdef RT33xx
-
-
-#ifndef RTMP_RF_RW_SUPPORT
-#error "You Should Enable compile flag RTMP_RF_RW_SUPPORT for this chip"
-#endif // RTMP_RF_RW_SUPPORT //
-
-#include "../rt_config.h"
-
-
-//
-// RF register initialization set
-//
-REG_PAIR RFRegTableOverRT3390[] = {
- {RF_R00, 0xA0},
- {RF_R01, 0xE1},
- {RF_R02, 0xF1},
- {RF_R03, 0x62},
- {RF_R04, 0x40},
- {RF_R05, 0x8B},
- {RF_R06, 0x42},
- {RF_R07, 0x34},
- {RF_R08, 0x00}, // Read only
- {RF_R09, 0xC0},
-
- {RF_R10, 0x61},
- {RF_R11, 0x21},
- {RF_R12, 0x3B},
- {RF_R13, 0xE0},
- {RF_R14, 0x90},
- {RF_R15, 0x53},
- {RF_R16, 0x0E},
- {RF_R17, 0x94},
- {RF_R18, 0x5C},
- {RF_R19, 0x4A},
-
- {RF_R20, 0xB2},
- {RF_R21, 0xF6},
- {RF_R22, 0x00},
- {RF_R23, 0x14},
- {RF_R24, 0x08},
- {RF_R25, 0x3D},
- {RF_R26, 0x85},
- {RF_R27, 0x00},
- {RF_R28, 0x41},
- {RF_R29, 0x8F},
- {RF_R30, 0x20},
- {RF_R31, 0x0F},
-};
-
-UCHAR NUM_RF_REG_PARMS_OVER_RT3390=(sizeof(RFRegTableOverRT3390) / sizeof(REG_PAIR));
-
-
-
-// Antenna divesity use GPIO3 and EESK pin for control
-// Antenna and EEPROM access are both using EESK pin,
-// Therefor we should avoid accessing EESK at the same time
-// Then restore antenna after EEPROM access
-// The original name of this function is AsicSetRxAnt(), now change to
-//VOID AsicSetRxAnt(
-
-VOID RT33xxSetRxAnt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ant)
-{
- UINT32 Value;
- UINT32 x;
-
- if ((pAd->EepromAccess) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF)) ||
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
- {
- return;
- }
-
- // the antenna selection is through firmware and MAC register(GPIO3)
- if (Ant == 0)
- {
- // Main antenna
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x |= (EESK);
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &Value);
- Value &= ~(0x0808);
- RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to main antenna\n"));
- }
- else
- {
- // Aux antenna
- RTMP_IO_READ32(pAd, E2PROM_CSR, &x);
- x &= ~(EESK);
- RTMP_IO_WRITE32(pAd, E2PROM_CSR, x);
-
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &Value);
- Value &= ~(0x0808);
- Value |= 0x08;
- RTMP_IO_WRITE32(pAd, GPIO_CTRL_CFG, Value);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("AsicSetRxAnt, switch to aux antenna\n"));
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- For RF filter calibration purpose
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID RTMPFilterCalibration(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR R55x = 0, value, FilterTarget = 0x1E, BBPValue=0;
- UINT loop = 0, count = 0, loopcnt = 0, ReTry = 0;
- UCHAR RF_R24_Value = 0;
-
- // Give bbp filter initial value
- pAd->Mlme.CaliBW20RfR24 = 0x1F;
- pAd->Mlme.CaliBW40RfR24 = 0x2F; //Bit[5] must be 1 for BW 40
-
- do
- {
- if (loop == 1) //BandWidth = 40 MHz
- {
- // Write 0x27 to RF_R24 to program filter
- RF_R24_Value = 0x27;
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- if (IS_RT3090(pAd) || IS_RT3572(pAd)|| IS_RT3390(pAd))
- FilterTarget = 0x15;
- else
- FilterTarget = 0x19;
-
- // when calibrate BW40, BBP mask must set to BW40.
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- BBPValue|= (0x10);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-
- // set to BW40
- RT30xxReadRFRegister(pAd, RF_R31, &value);
- value |= 0x20;
- RT30xxWriteRFRegister(pAd, RF_R31, value);
- }
- else //BandWidth = 20 MHz
- {
- // Write 0x07 to RF_R24 to program filter
- RF_R24_Value = 0x07;
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- if (IS_RT3090(pAd) || IS_RT3572(pAd)|| IS_RT3390(pAd))
- FilterTarget = 0x13;
- else
- FilterTarget = 0x16;
-
- // set to BW20
- RT30xxReadRFRegister(pAd, RF_R31, &value);
- value &= (~0x20);
- RT30xxWriteRFRegister(pAd, RF_R31, value);
- }
-
- // Write 0x01 to RF_R22 to enable baseband loopback mode
- RT30xxReadRFRegister(pAd, RF_R22, &value);
- value |= 0x01;
- RT30xxWriteRFRegister(pAd, RF_R22, value);
-
- // Write 0x00 to BBP_R24 to set power & frequency of passband test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0);
-
- do
- {
- // Write 0x90 to BBP_R25 to transmit test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R25, 0x90);
-
- RTMPusecDelay(1000);
- // Read BBP_R55[6:0] for received power, set R55x = BBP_R55[6:0]
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R55, &value);
- R55x = value & 0xFF;
-
- } while ((ReTry++ < 100) && (R55x == 0));
-
- // Write 0x06 to BBP_R24 to set power & frequency of stopband test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0x06);
-
- while(TRUE)
- {
- // Write 0x90 to BBP_R25 to transmit test tone
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R25, 0x90);
-
- //We need to wait for calibration
- RTMPusecDelay(1000);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R55, &value);
- value &= 0xFF;
- if ((R55x - value) < FilterTarget)
- {
- RF_R24_Value ++;
- }
- else if ((R55x - value) == FilterTarget)
- {
- RF_R24_Value ++;
- count ++;
- }
- else
- {
- break;
- }
-
- // prevent infinite loop cause driver hang.
- if (loopcnt++ > 100)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPFilterCalibration - can't find a valid value, loopcnt=%d stop calibrating", loopcnt));
- break;
- }
-
- // Write RF_R24 to program filter
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
- }
-
- if (count > 0)
- {
- RF_R24_Value = RF_R24_Value - ((count) ? (1) : (0));
- }
-
- // Store for future usage
- if (loopcnt < 100)
- {
- if (loop++ == 0)
- {
- //BandWidth = 20 MHz
- pAd->Mlme.CaliBW20RfR24 = (UCHAR)RF_R24_Value;
- }
- else
- {
- //BandWidth = 40 MHz
- pAd->Mlme.CaliBW40RfR24 = (UCHAR)RF_R24_Value;
- break;
- }
- }
- else
- break;
-
- RT30xxWriteRFRegister(pAd, RF_R24, RF_R24_Value);
-
- // reset count
- count = 0;
- } while(TRUE);
-
- //
- // Set back to initial state
- //
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, 0);
-
- RT30xxReadRFRegister(pAd, RF_R22, &value);
- value &= ~(0x01);
- RT30xxWriteRFRegister(pAd, RF_R22, value);
-
- // set BBP back to BW20
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPFilterCalibration - CaliBW20RfR24=0x%x, CaliBW40RfR24=0x%x\n", pAd->Mlme.CaliBW20RfR24, pAd->Mlme.CaliBW40RfR24));
-}
-
-
-// add by johnli, RF power sequence setup
-/*
- ==========================================================================
- Description:
-
- Load RF normal operation-mode setup
-
- ==========================================================================
- */
-VOID RT33xxLoadRFNormalModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
-
- // RX0_PD & TX0_PD, RF R1 register Bit 2 & Bit 3 to 0 and RF_BLOCK_en,RX1_PD & TX1_PD, Bit0, Bit 4 & Bit5 to 1
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue = (RFValue & (~0x0C)) | 0x31;
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // TX_LO2_en, RF R15 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R15, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R15, RFValue);
-
- /* move to NICInitRT30xxRFRegisters
- // TX_LO1_en, RF R17 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
- RFValue &= (~0x08);
- // to fix rx long range issue
- if (((pAd->MACVersion & 0xffff) >= 0x0211) && (pAd->NicConfig2.field.ExternalLNAForG == 0))
- {
- RFValue |= 0x20;
- }
- // set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h
- if (pAd->TxMixerGain24G >= 2)
- {
- RFValue &= (~0x7); // clean bit [2:0]
- RFValue |= pAd->TxMixerGain24G;
- }
- RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
- */
-
- // RX_LO1_en, RF R20 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R20, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R20, RFValue);
-
- // RX_LO2_en, RF R21 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue &= (~0x08);
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
-
- /* add by johnli, reset RF_R27 when interface down & up to fix throughput problem*/
- // LDORF_VC, RF R27 register Bit 2 to 0
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- // TX to RX IQ glitch(RF_R27) has been fixed in RT3070(F).
- // Raising RF voltage is no longer needed for RT3070(F)
- if (IS_RT3090(pAd)) // RT309x and RT3071/72
- {
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RFValue = (RFValue & (~0x77)) | 0x3;
- else
- RFValue = (RFValue & (~0x77));
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
- }
- /* end johnli */
-}
-
-/*
- ==========================================================================
- Description:
-
- Load RF sleep-mode setup
-
- ==========================================================================
- */
-VOID RT33xxLoadRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
- UINT32 MACValue;
-
-
- {
- // RF_BLOCK_en. RF R1 register Bit 0 to 0
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue &= (~0x01);
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // VCO_IC, RF R7 register Bit 4 & Bit 5 to 0
- RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
- RFValue &= (~0x30);
- RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
-
- // Idoh, RF R9 register Bit 1, Bit 2 & Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R09, &RFValue);
- RFValue &= (~0x0E);
- RT30xxWriteRFRegister(pAd, RF_R09, RFValue);
-
- // RX_CTB_en, RF R21 register Bit 7 to 0
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue &= (~0x80);
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
- }
-
- if (IS_RT3090(pAd) || // IS_RT3090 including RT309x and RT3071/72
- IS_RT3572(pAd) ||
- IS_RT3390(pAd) ||
- (IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
- {
- {
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- RFValue |= 0x77;
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
- }
-
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue |= 0x1D000000;
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- Reverse RF sleep-mode setup
-
- ==========================================================================
- */
-VOID RT33xxReverseRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR RFValue;
- UINT32 MACValue;
-
- {
- // RF_BLOCK_en, RF R1 register Bit 0 to 1
- RT30xxReadRFRegister(pAd, RF_R01, &RFValue);
- RFValue |= 0x01;
- RT30xxWriteRFRegister(pAd, RF_R01, RFValue);
-
- // VCO_IC, RF R7 register Bit 4 & Bit 5 to 1
- RT30xxReadRFRegister(pAd, RF_R07, &RFValue);
- RFValue |= 0x30;
- RT30xxWriteRFRegister(pAd, RF_R07, RFValue);
-
- // Idoh, RF R9 register Bit 1, Bit 2 & Bit 3 to 1
- RT30xxReadRFRegister(pAd, RF_R09, &RFValue);
- RFValue |= 0x0E;
- RT30xxWriteRFRegister(pAd, RF_R09, RFValue);
-
- // RX_CTB_en, RF R21 register Bit 7 to 1
- RT30xxReadRFRegister(pAd, RF_R21, &RFValue);
- RFValue |= 0x80;
- RT30xxWriteRFRegister(pAd, RF_R21, RFValue);
- }
-
- if (IS_RT3090(pAd) || // IS_RT3090 including RT309x and RT3071/72
- IS_RT3572(pAd) ||
- IS_RT3390(pAd) ||
- (IS_RT3070(pAd) && ((pAd->MACVersion & 0xffff) < 0x0201)))
- {
- {
- RT30xxReadRFRegister(pAd, RF_R27, &RFValue);
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- RFValue = (RFValue & (~0x77)) | 0x3;
- else
- RFValue = (RFValue & (~0x77));
- RT30xxWriteRFRegister(pAd, RF_R27, RFValue);
- }
-
- // RT3071 version E has fixed this issue
- if ((pAd->NicConfig2.field.DACTestBit == 1) && ((pAd->MACVersion & 0xffff) < 0x0211))
- {
- // patch tx EVM issue temporarily
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue = ((MACValue & 0xE0FFFFFF) | 0x0D000000);
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
- }
- else
- {
- RTMP_IO_READ32(pAd, LDO_CFG0, &MACValue);
- MACValue = ((MACValue & 0xE0FFFFFF) | 0x01000000);
- RTMP_IO_WRITE32(pAd, LDO_CFG0, MACValue);
- }
- }
-
- if(IS_RT3572(pAd))
- RT30xxWriteRFRegister(pAd, RF_R08, 0x80);
-}
-// end johnli
-
-VOID RT33xxHaltAction(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 TxPinCfg = 0x00050F0F;
-
- //
- // Turn off LNA_PE or TRSW_POL
- //
- if (IS_RT3070(pAd) || IS_RT3071(pAd) || IS_RT3390(pAd)||IS_RT3572(pAd))
- {
- //KH? Both support 3390 usb and PCI
- if ((IS_RT3071(pAd) || IS_RT3572(pAd)||IS_RT3390(pAd))
-#ifdef RTMP_EFUSE_SUPPORT
- && (pAd->bUseEfuse)
-#endif // RTMP_EFUSE_SUPPORT //
- )
- {
- TxPinCfg &= 0xFFFBF0F0; // bit18 off
- }
- else
- {
- TxPinCfg &= 0xFFFFF0F0;
- }
-
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
- }
-}
-
-#endif // RT30xx //
diff --git a/drivers/staging/rt3090/chlist.h b/drivers/staging/rt3090/chlist.h
deleted file mode 100644
index d03cb4754394..000000000000
--- a/drivers/staging/rt3090/chlist.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- chlist.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi Wu 2007-12-19 created
-*/
-
-#ifndef __CHLIST_H__
-#define __CHLIST_H__
-
-#include "rtmp_type.h"
-#include "rtmp_def.h"
-
-
-#define ODOR 0
-#define IDOR 1
-#define BOTH 2
-
-#define BAND_5G 0
-#define BAND_24G 1
-#define BAND_BOTH 2
-
-typedef struct _CH_DESP {
- UCHAR FirstChannel;
- UCHAR NumOfCh;
- CHAR MaxTxPwr; // dBm
- UCHAR Geography; // 0:out door, 1:in door, 2:both
- BOOLEAN DfsReq; // Dfs require, 0: No, 1: yes.
-} CH_DESP, *PCH_DESP;
-
-typedef struct _CH_REGION {
- UCHAR CountReg[3];
- UCHAR DfsType; // 0: CE, 1: FCC, 2: JAP, 3:JAP_W53, JAP_W56
- CH_DESP ChDesp[10];
-} CH_REGION, *PCH_REGION;
-
-extern CH_REGION ChRegion[];
-
-typedef struct _CH_FREQ_MAP_{
- UINT16 channel;
- UINT16 freqKHz;
-}CH_FREQ_MAP;
-
-extern CH_FREQ_MAP CH_HZ_ID_MAP[];
-extern int CH_HZ_ID_MAP_NUM;
-
-
-#define MAP_CHANNEL_ID_TO_KHZ(_ch, _khz) \
- do{ \
- int _chIdx; \
- for (_chIdx = 0; _chIdx < CH_HZ_ID_MAP_NUM; _chIdx++)\
- { \
- if ((_ch) == CH_HZ_ID_MAP[_chIdx].channel) \
- { \
- (_khz) = CH_HZ_ID_MAP[_chIdx].freqKHz * 1000; \
- break; \
- } \
- } \
- if (_chIdx == CH_HZ_ID_MAP_NUM) \
- (_khz) = 2412000; \
- }while(0)
-
-#define MAP_KHZ_TO_CHANNEL_ID(_khz, _ch) \
- do{ \
- int _chIdx; \
- for (_chIdx = 0; _chIdx < CH_HZ_ID_MAP_NUM; _chIdx++)\
- { \
- if ((_khz) == CH_HZ_ID_MAP[_chIdx].freqKHz) \
- { \
- (_ch) = CH_HZ_ID_MAP[_chIdx].channel; \
- break; \
- } \
- } \
- if (_chIdx == CH_HZ_ID_MAP_NUM) \
- (_ch) = 1; \
- }while(0)
-
-
-VOID BuildChannelListEx(
- IN PRTMP_ADAPTER pAd);
-
-VOID BuildBeaconChList(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf,
- OUT PULONG pBufLen);
-
-#ifdef DOT11_N_SUPPORT
-VOID N_ChannelCheck(
- IN PRTMP_ADAPTER pAd);
-
-VOID N_SetCenCh(
- IN PRTMP_ADAPTER pAd);
-#endif // DOT11_N_SUPPORT //
-
-UINT8 GetCuntryMaxTxPwr(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 channel);
-
-#endif // __CHLIST_H__
diff --git a/drivers/staging/rt3090/common/action.c b/drivers/staging/rt3090/common/action.c
deleted file mode 100644
index 8e3b0a0c2d64..000000000000
--- a/drivers/staging/rt3090/common/action.c
+++ /dev/null
@@ -1,1057 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- action.c
-
- Abstract:
- Handle association related requests either from WSTA or from local MLME
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Jan Lee 2006 created for rt2860
- */
-
-#include "../rt_config.h"
-#include "../action.h"
-
-
-static VOID ReservedAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-
-/*
- ==========================================================================
- Description:
- association state machine init, including state transition and timer init
- Parameters:
- S - pointer to the association state machine
- Note:
- The state machine looks like the following
-
- ASSOC_IDLE
- MT2_MLME_DISASSOC_REQ mlme_disassoc_req_action
- MT2_PEER_DISASSOC_REQ peer_disassoc_action
- MT2_PEER_ASSOC_REQ drop
- MT2_PEER_REASSOC_REQ drop
- MT2_CLS3ERR cls3err_action
- ==========================================================================
- */
-VOID ActionStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(S, (STATE_MACHINE_FUNC *)Trans, MAX_ACT_STATE, MAX_ACT_MSG, (STATE_MACHINE_FUNC)Drop, ACT_IDLE, ACT_MACHINE_BASE);
-
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_SPECTRUM_CATE, (STATE_MACHINE_FUNC)PeerSpectrumAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_QOS_CATE, (STATE_MACHINE_FUNC)PeerQOSAction);
-
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_DLS_CATE, (STATE_MACHINE_FUNC)ReservedAction);
-#ifdef QOS_DLS_SUPPORT
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_DLS_CATE, (STATE_MACHINE_FUNC)PeerDLSAction);
-#endif // QOS_DLS_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_BA_CATE, (STATE_MACHINE_FUNC)PeerBAAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_HT_CATE, (STATE_MACHINE_FUNC)PeerHTAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_MLME_ADD_BA_CATE, (STATE_MACHINE_FUNC)MlmeADDBAAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_MLME_ORI_DELBA_CATE, (STATE_MACHINE_FUNC)MlmeDELBAAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_MLME_REC_DELBA_CATE, (STATE_MACHINE_FUNC)MlmeDELBAAction);
-#endif // DOT11_N_SUPPORT //
-
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_PUBLIC_CATE, (STATE_MACHINE_FUNC)PeerPublicAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_PEER_RM_CATE, (STATE_MACHINE_FUNC)PeerRMAction);
-
- StateMachineSetAction(S, ACT_IDLE, MT2_MLME_QOS_CATE, (STATE_MACHINE_FUNC)MlmeQOSAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_MLME_DLS_CATE, (STATE_MACHINE_FUNC)MlmeDLSAction);
- StateMachineSetAction(S, ACT_IDLE, MT2_ACT_INVALID, (STATE_MACHINE_FUNC)MlmeInvalidAction);
-
-
-}
-
-#ifdef DOT11_N_SUPPORT
-VOID MlmeADDBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- MLME_ADDBA_REQ_STRUCT *pInfo;
- UCHAR Addr[6];
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG Idx;
- FRAME_ADDBA_REQ Frame;
- ULONG FrameLen;
- BA_ORI_ENTRY *pBAEntry = NULL;
-
- pInfo = (MLME_ADDBA_REQ_STRUCT *)Elem->Msg;
- NdisZeroMemory(&Frame, sizeof(FRAME_ADDBA_REQ));
-
- if(MlmeAddBAReqSanity(pAd, Elem->Msg, Elem->MsgLen, Addr))
- {
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("BA - MlmeADDBAAction() allocate memory failed \n"));
- return;
- }
- // 1. find entry
- Idx = pAd->MacTab.Content[pInfo->Wcid].BAOriWcidArray[pInfo->TID];
- if (Idx == 0)
- {
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() can't find BAOriEntry \n"));
- return;
- }
- else
- {
- pBAEntry =&pAd->BATable.BAOriEntry[Idx];
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (ADHOC_ON(pAd))
- ActHeaderInit(pAd, &Frame.Hdr, pInfo->pAddr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#ifdef QOS_DLS_SUPPORT
- if (pAd->MacTab.Content[pInfo->Wcid].ValidAsDls)
- ActHeaderInit(pAd, &Frame.Hdr, pInfo->pAddr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#endif // QOS_DLS_SUPPORT //
- ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pInfo->pAddr);
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- Frame.Category = CATEGORY_BA;
- Frame.Action = ADDBA_REQ;
- Frame.BaParm.AMSDUSupported = 0;
- Frame.BaParm.BAPolicy = IMMED_BA;
- Frame.BaParm.TID = pInfo->TID;
- Frame.BaParm.BufSize = pInfo->BaBufSize;
- Frame.Token = pInfo->Token;
- Frame.TimeOutValue = pInfo->TimeOutValue;
- Frame.BaStartSeq.field.FragNum = 0;
- Frame.BaStartSeq.field.StartSeq = pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID];
-
- *(USHORT *)(&Frame.BaParm) = cpu2le16(*(USHORT *)(&Frame.BaParm));
- Frame.TimeOutValue = cpu2le16(Frame.TimeOutValue);
- Frame.BaStartSeq.word = cpu2le16(Frame.BaStartSeq.word);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_ADDBA_REQ), &Frame,
- END_OF_ARGS);
-
- MiniportMMRequest(pAd, (MGMT_USE_QUEUE_FLAG | MapUserPriorityToAccessCategory[pInfo->TID]), pOutBuffer, FrameLen);
-
- MlmeFreeMemory(pAd, pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("BA - Send ADDBA request. StartSeq = %x, FrameLen = %ld. BufSize = %d\n", Frame.BaStartSeq.field.StartSeq, FrameLen, Frame.BaParm.BufSize));
- }
-}
-
-/*
- ==========================================================================
- Description:
- send DELBA and delete BaEntry if any
- Parametrs:
- Elem - MLME message MLME_DELBA_REQ_STRUCT
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeDELBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MLME_DELBA_REQ_STRUCT *pInfo;
- PUCHAR pOutBuffer = NULL;
- PUCHAR pOutBuffer2 = NULL;
- NDIS_STATUS NStatus;
- ULONG Idx;
- FRAME_DELBA_REQ Frame;
- ULONG FrameLen;
- FRAME_BAR FrameBar;
-
- pInfo = (MLME_DELBA_REQ_STRUCT *)Elem->Msg;
- // must send back DELBA
- NdisZeroMemory(&Frame, sizeof(FRAME_DELBA_REQ));
- DBGPRINT(RT_DEBUG_TRACE, ("==> MlmeDELBAAction(), Initiator(%d) \n", pInfo->Initiator));
-
- if(MlmeDelBAReqSanity(pAd, Elem->Msg, Elem->MsgLen))
- {
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeDELBAAction() allocate memory failed 1. \n"));
- return;
- }
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer2); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_ERROR, ("BA - MlmeDELBAAction() allocate memory failed 2. \n"));
- return;
- }
-
- // SEND BAR (Send BAR to refresh peer reordering buffer.)
- Idx = pAd->MacTab.Content[pInfo->Wcid].BAOriWcidArray[pInfo->TID];
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pInfo->Wcid].Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
-
- FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL funciton.
- FrameBar.StartingSeq.field.StartSeq = pAd->MacTab.Content[pInfo->Wcid].TxSeq[pInfo->TID]; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.TID = pInfo->TID; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.ACKPolicy = IMMED_BA; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.Compressed = 1; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.MTID = 0; // make sure sequence not clear in DEL funciton.
-
- MakeOutgoingFrame(pOutBuffer2, &FrameLen,
- sizeof(FRAME_BAR), &FrameBar,
- END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer2, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer2);
- DBGPRINT(RT_DEBUG_TRACE,("BA - MlmeDELBAAction() . Send BAR to refresh peer reordering buffer \n"));
-
- // SEND DELBA FRAME
- FrameLen = 0;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (ADHOC_ON(pAd))
- ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[pInfo->Wcid].Addr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#ifdef QOS_DLS_SUPPORT
- if (pAd->MacTab.Content[pInfo->Wcid].ValidAsDls)
- ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[pInfo->Wcid].Addr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#endif // QOS_DLS_SUPPORT //
- ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[pInfo->Wcid].Addr);
- }
-#endif // CONFIG_STA_SUPPORT //
- Frame.Category = CATEGORY_BA;
- Frame.Action = DELBA;
- Frame.DelbaParm.Initiator = pInfo->Initiator;
- Frame.DelbaParm.TID = pInfo->TID;
- Frame.ReasonCode = 39; // Time Out
- *(USHORT *)(&Frame.DelbaParm) = cpu2le16(*(USHORT *)(&Frame.DelbaParm));
- Frame.ReasonCode = cpu2le16(Frame.ReasonCode);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_DELBA_REQ), &Frame,
- END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_TRACE, ("BA - MlmeDELBAAction() . 3 DELBA sent. Initiator(%d)\n", pInfo->Initiator));
- }
-}
-#endif // DOT11_N_SUPPORT //
-
-VOID MlmeQOSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-VOID MlmeDLSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-VOID MlmeInvalidAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- //PUCHAR pOutBuffer = NULL;
- //Return the receiving frame except the MSB of category filed set to 1. 7.3.1.11
-}
-
-VOID PeerQOSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-#ifdef QOS_DLS_SUPPORT
-VOID PeerDLSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Action = Elem->Msg[LENGTH_802_11+1];
-
- switch(Action)
- {
- case ACTION_DLS_REQUEST:
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- PeerDlsReqAction(pAd, Elem);
-#endif // CONFIG_STA_SUPPORT //
- break;
-
- case ACTION_DLS_RESPONSE:
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- PeerDlsRspAction(pAd, Elem);
-#endif // CONFIG_STA_SUPPORT //
- break;
-
- case ACTION_DLS_TEARDOWN:
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- PeerDlsTearDownAction(pAd, Elem);
-#endif // CONFIG_STA_SUPPORT //
- break;
- }
-}
-#endif // QOS_DLS_SUPPORT //
-
-
-
-#ifdef DOT11_N_SUPPORT
-VOID PeerBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Action = Elem->Msg[LENGTH_802_11+1];
-
- switch(Action)
- {
- case ADDBA_REQ:
- PeerAddBAReqAction(pAd,Elem);
- break;
- case ADDBA_RESP:
- PeerAddBARspAction(pAd,Elem);
- break;
- case DELBA:
- PeerDelBAAction(pAd,Elem);
- break;
- }
-}
-
-
-#ifdef DOT11N_DRAFT3
-
-#ifdef CONFIG_STA_SUPPORT
-VOID StaPublicAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Bss2040Coexist)
-{
- BSS_2040_COEXIST_IE BssCoexist;
- MLME_SCAN_REQ_STRUCT ScanReq;
-
- BssCoexist.word = Bss2040Coexist;
- // AP asks Station to return a 20/40 BSS Coexistence mgmt frame. So we first starts a scan, then send back 20/40 BSS Coexistence mgmt frame
- if ((BssCoexist.field.InfoReq == 1) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040)))
- {
- // Clear record first. After scan , will update those bit and send back to transmiter.
- pAd->CommonCfg.BSSCoexist2040.field.InfoReq = 1;
- pAd->CommonCfg.BSSCoexist2040.field.Intolerant40 = 0;
- pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 0;
- // Fill out stuff for scan request
- ScanParmFill(pAd, &ScanReq, ZeroSsid, 0, BSS_ANY, SCAN_2040_BSS_COEXIST);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
- }
-}
-
-
-/*
-Description : Build Intolerant Channel Rerpot from Trigger event table.
-return : how many bytes copied.
-*/
-ULONG BuildIntolerantChannelRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDest)
-{
- ULONG FrameLen = 0;
- ULONG ReadOffset = 0;
- UCHAR i;
- UCHAR LastRegClass = 0xff;
- PUCHAR pLen;
-
- for ( i = 0;i < MAX_TRIGGER_EVENT;i++)
- {
- if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid == TRUE)
- {
- if (pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass == LastRegClass)
- {
- *(pDest + ReadOffset) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel;
- *pLen++;
- ReadOffset++;
- FrameLen++;
- }
- else
- {
- *(pDest + ReadOffset) = IE_2040_BSS_INTOLERANT_REPORT; // IE
- *(pDest + ReadOffset + 1) = 2; // Len = RegClass byte + channel byte.
- pLen = pDest + ReadOffset + 1;
- LastRegClass = pAd->CommonCfg.TriggerEventTab.EventA[i].RegClass;
- *(pDest + ReadOffset + 2) = LastRegClass; // Len = RegClass byte + channel byte.
- *(pDest + ReadOffset + 3) = (UCHAR)pAd->CommonCfg.TriggerEventTab.EventA[i].Channel;
- FrameLen += 4;
- ReadOffset += 4;
- }
-
- }
- }
- return FrameLen;
-}
-
-
-/*
-Description : Send 20/40 BSS Coexistence Action frame If one trigger event is triggered.
-*/
-VOID Send2040CoexistAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN BOOLEAN bAddIntolerantCha)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- FRAME_ACTION_HDR Frame;
- ULONG FrameLen;
- ULONG IntolerantChaRepLen;
-
- IntolerantChaRepLen = 0;
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction() allocate memory failed \n"));
- return;
- }
- ActHeaderInit(pAd, &Frame.Hdr, pAd->MacTab.Content[Wcid].Addr, pAd->CommonCfg.Bssid);
- Frame.Category = CATEGORY_PUBLIC;
- Frame.Action = ACTION_BSS_2040_COEXIST;
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_ACTION_HDR), &Frame,
- END_OF_ARGS);
-
- *(pOutBuffer + FrameLen) = pAd->CommonCfg.BSSCoexist2040.word;
- FrameLen++;
-
- if (bAddIntolerantCha == TRUE)
- IntolerantChaRepLen = BuildIntolerantChannelRep(pAd, pOutBuffer + FrameLen);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen + IntolerantChaRepLen);
- DBGPRINT(RT_DEBUG_ERROR,("ACT - Send2040CoexistAction( BSSCoexist2040 = 0x%x ) \n", pAd->CommonCfg.BSSCoexist2040.word));
-
-}
-
-
-/*
- ==========================================================================
- Description:
- After scan, Update 20/40 BSS Coexistence IE and send out.
- According to 802.11n D3.03 11.14.10
-
- Parameters:
- ==========================================================================
- */
-VOID Update2040CoexistFrameAndNotify(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN BOOLEAN bAddIntolerantCha)
-{
- BSS_2040_COEXIST_IE OldValue;
-
- OldValue.word = pAd->CommonCfg.BSSCoexist2040.word;
- if ((pAd->CommonCfg.TriggerEventTab.EventANo > 0) || (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0))
- pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq = 1;
-
- // Need to check !!!!
- // How STA will set Intolerant40 if implementation dependent. Now we don't set this bit first.!!!!!
- // So Only check BSS20WidthReq change.
- if (OldValue.field.BSS20WidthReq != pAd->CommonCfg.BSSCoexist2040.field.BSS20WidthReq)
- {
- Send2040CoexistAction(pAd, Wcid, bAddIntolerantCha);
- }
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-BOOLEAN ChannelSwitchSanityCheck(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR NewChannel,
- IN UCHAR Secondary)
-{
- UCHAR i;
-
- if (Wcid >= MAX_LEN_OF_MAC_TABLE)
- return FALSE;
-
- if ((NewChannel > 7) && (Secondary == 1))
- return FALSE;
-
- if ((NewChannel < 5) && (Secondary == 3))
- return FALSE;
-
- // 0. Check if new channel is in the channellist.
- for (i = 0;i < pAd->ChannelListNum;i++)
- {
- if (pAd->ChannelList[i].Channel == NewChannel)
- {
- break;
- }
- }
-
- if (i == pAd->ChannelListNum)
- return FALSE;
-
- return TRUE;
-}
-
-
-VOID ChannelSwitchAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR NewChannel,
- IN UCHAR Secondary)
-{
- UCHAR BBPValue = 0;
- ULONG MACValue;
-
- DBGPRINT(RT_DEBUG_TRACE,("SPECTRUM - ChannelSwitchAction(NewChannel = %d , Secondary = %d) \n", NewChannel, Secondary));
-
- if (ChannelSwitchSanityCheck(pAd, Wcid, NewChannel, Secondary) == FALSE)
- return;
-
- // 1. Switches to BW = 20.
- if (Secondary == 0)
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
- pAd->CommonCfg.BBPCurrentBW = BW_20;
- pAd->CommonCfg.Channel = NewChannel;
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel,FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("!!!20MHz !!! \n" ));
- }
- // 1. Switches to BW = 40 And Station supports BW = 40.
- else if (((Secondary == 1) || (Secondary == 3)) && (pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == 1))
- {
- pAd->CommonCfg.Channel = NewChannel;
-
- if (Secondary == 1)
- {
- // Secondary above.
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel + 2;
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue);
- MACValue &= 0xfe;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- BBPValue|= (0x10);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue);
- BBPValue&= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- else
- {
- // Secondary below.
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel - 2;
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &MACValue);
- MACValue &= 0xfe;
- MACValue |= 0x1;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, MACValue);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue&= (~0x18);
- BBPValue|= (0x10);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPValue);
- BBPValue&= (~0x20);
- BBPValue|= (0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
- pAd->MacTab.Content[Wcid].HTPhyMode.field.BW = 1;
- }
-}
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-VOID PeerPublicAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- UCHAR Action = Elem->Msg[LENGTH_802_11+1];
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
- if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
- return;
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- switch(Action)
- {
- case ACTION_BSS_2040_COEXIST: // Format defined in IEEE 7.4.7a.1 in 11n Draf3.03
- {
- //UCHAR BssCoexist;
- BSS_2040_COEXIST_ELEMENT *pCoexistInfo;
- BSS_2040_COEXIST_IE *pBssCoexistIe;
- BSS_2040_INTOLERANT_CH_REPORT *pIntolerantReport = NULL;
-
- if (Elem->MsgLen <= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT)) )
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ACTION - 20/40 BSS Coexistence Management Frame length too short! len = %ld!\n", Elem->MsgLen));
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("ACTION - 20/40 BSS Coexistence Management action----> \n"));
- hex_dump("CoexistenceMgmtFrame", Elem->Msg, Elem->MsgLen);
-
-
- pCoexistInfo = (BSS_2040_COEXIST_ELEMENT *) &Elem->Msg[LENGTH_802_11+2];
- //hex_dump("CoexistInfo", (PUCHAR)pCoexistInfo, sizeof(BSS_2040_COEXIST_ELEMENT));
- if (Elem->MsgLen >= (LENGTH_802_11 + sizeof(BSS_2040_COEXIST_ELEMENT) + sizeof(BSS_2040_INTOLERANT_CH_REPORT)))
- {
- pIntolerantReport = (BSS_2040_INTOLERANT_CH_REPORT *)((PUCHAR)pCoexistInfo + sizeof(BSS_2040_COEXIST_ELEMENT));
- }
- //hex_dump("IntolerantReport ", (PUCHAR)pIntolerantReport, sizeof(BSS_2040_INTOLERANT_CH_REPORT));
-
- pBssCoexistIe = (BSS_2040_COEXIST_IE *)(&pCoexistInfo->BssCoexistIe);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (INFRA_ON(pAd))
- {
- StaPublicAction(pAd, pCoexistInfo);
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- }
- break;
- }
-
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-}
-
-
-static VOID ReservedAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Category;
-
- if (Elem->MsgLen <= LENGTH_802_11)
- {
- return;
- }
-
- Category = Elem->Msg[LENGTH_802_11];
- DBGPRINT(RT_DEBUG_TRACE,("Rcv reserved category(%d) Action Frame\n", Category));
- hex_dump("Reserved Action Frame", &Elem->Msg[0], Elem->MsgLen);
-}
-
-VOID PeerRMAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- return;
-}
-
-#ifdef DOT11_N_SUPPORT
-static VOID respond_ht_information_exchange_action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
- FRAME_HT_INFO HTINFOframe, *pFrame;
- UCHAR *pAddr;
-
-
- // 2. Always send back ADDBA Response
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
-
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("ACTION - respond_ht_information_exchange_action() allocate memory failed \n"));
- return;
- }
-
- // get RA
- pFrame = (FRAME_HT_INFO *) &Elem->Msg[0];
- pAddr = pFrame->Hdr.Addr2;
-
- NdisZeroMemory(&HTINFOframe, sizeof(FRAME_HT_INFO));
- // 2-1. Prepare ADDBA Response frame.
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (ADHOC_ON(pAd))
- ActHeaderInit(pAd, &HTINFOframe.Hdr, pAddr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
- ActHeaderInit(pAd, &HTINFOframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- HTINFOframe.Category = CATEGORY_HT;
- HTINFOframe.Action = HT_INFO_EXCHANGE;
- HTINFOframe.HT_Info.Request = 0;
- HTINFOframe.HT_Info.Forty_MHz_Intolerant = pAd->CommonCfg.HtCapability.HtCapInfo.Forty_Mhz_Intolerant;
- HTINFOframe.HT_Info.STA_Channel_Width = pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth;
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_HT_INFO), &HTINFOframe,
- END_OF_ARGS);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-}
-
-
-#ifdef DOT11N_DRAFT3
-VOID SendNotifyBWActionFrame(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR apidx)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- FRAME_ACTION_HDR Frame;
- ULONG FrameLen;
- PUCHAR pAddr1;
-
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("ACT - SendNotifyBWAction() allocate memory failed \n"));
- return;
- }
-
- if (Wcid == MCAST_WCID)
- pAddr1 = &BROADCAST_ADDR[0];
- else
- pAddr1 = pAd->MacTab.Content[Wcid].Addr;
- ActHeaderInit(pAd, &Frame.Hdr, pAddr1, pAd->ApCfg.MBSSID[apidx].Bssid, pAd->ApCfg.MBSSID[apidx].Bssid);
-
- Frame.Category = CATEGORY_HT;
- Frame.Action = NOTIFY_BW_ACTION;
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_ACTION_HDR), &Frame,
- END_OF_ARGS);
-
- *(pOutBuffer + FrameLen) = pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth;
- FrameLen++;
-
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- DBGPRINT(RT_DEBUG_TRACE,("ACT - SendNotifyBWAction(NotifyBW= %d)!\n", pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth));
-
-}
-#endif // DOT11N_DRAFT3 //
-
-
-VOID PeerHTAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Action = Elem->Msg[LENGTH_802_11+1];
-
- if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
- return;
-
- switch(Action)
- {
- case NOTIFY_BW_ACTION:
- DBGPRINT(RT_DEBUG_TRACE,("ACTION - HT Notify Channel bandwidth action----> \n"));
-#ifdef CONFIG_STA_SUPPORT
- if(pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE)
- {
- // Note, this is to patch DIR-1353 AP. When the AP set to Wep, it will use legacy mode. But AP still keeps
- // sending BW_Notify Action frame, and cause us to linkup and linkdown.
- // In legacy mode, don't need to parse HT action frame.
- DBGPRINT(RT_DEBUG_TRACE,("ACTION -Ignore HT Notify Channel BW when link as legacy mode. BW = %d---> \n",
- Elem->Msg[LENGTH_802_11+2] ));
- break;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- if (Elem->Msg[LENGTH_802_11+2] == 0) // 7.4.8.2. if value is 1, keep the same as supported channel bandwidth.
- pAd->MacTab.Content[Elem->Wcid].HTPhyMode.field.BW = 0;
-
- break;
-
- case SMPS_ACTION:
- // 7.3.1.25
- DBGPRINT(RT_DEBUG_TRACE,("ACTION - SMPS action----> \n"));
- if (((Elem->Msg[LENGTH_802_11+2]&0x1) == 0))
- {
- pAd->MacTab.Content[Elem->Wcid].MmpsMode = MMPS_ENABLE;
- }
- else if (((Elem->Msg[LENGTH_802_11+2]&0x2) == 0))
- {
- pAd->MacTab.Content[Elem->Wcid].MmpsMode = MMPS_STATIC;
- }
- else
- {
- pAd->MacTab.Content[Elem->Wcid].MmpsMode = MMPS_DYNAMIC;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("Aid(%d) MIMO PS = %d\n", Elem->Wcid, pAd->MacTab.Content[Elem->Wcid].MmpsMode));
- // rt2860c : add something for smps change.
- break;
-
- case SETPCO_ACTION:
- break;
-
- case MIMO_CHA_MEASURE_ACTION:
- break;
-
- case HT_INFO_EXCHANGE:
- {
- HT_INFORMATION_OCTET *pHT_info;
-
- pHT_info = (HT_INFORMATION_OCTET *) &Elem->Msg[LENGTH_802_11+2];
- // 7.4.8.10
- DBGPRINT(RT_DEBUG_TRACE,("ACTION - HT Information Exchange action----> \n"));
- if (pHT_info->Request)
- {
- respond_ht_information_exchange_action(pAd, Elem);
- }
- }
- break;
- }
-}
-
-
-/*
- ==========================================================================
- Description:
- Retry sending ADDBA Reqest.
-
- IRQL = DISPATCH_LEVEL
-
- Parametrs:
- p8023Header: if this is already 802.3 format, p8023Header is NULL
-
- Return : TRUE if put into rx reordering buffer, shouldn't indicaterxhere.
- FALSE , then continue indicaterx at this moment.
- ==========================================================================
- */
-VOID ORIBATimerTimeout(
- IN PRTMP_ADAPTER pAd)
-{
- MAC_TABLE_ENTRY *pEntry;
- INT i, total;
-// FRAME_BAR FrameBar;
-// ULONG FrameLen;
-// NDIS_STATUS NStatus;
-// PUCHAR pOutBuffer = NULL;
-// USHORT Sequence;
- UCHAR TID;
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- total = pAd->MacTab.Size * NUM_OF_TID;
-
- for (i = 1; ((i <MAX_LEN_OF_BA_ORI_TABLE) && (total > 0)) ; i++)
- {
- if (pAd->BATable.BAOriEntry[i].ORI_BA_Status == Originator_Done)
- {
- pEntry = &pAd->MacTab.Content[pAd->BATable.BAOriEntry[i].Wcid];
- TID = pAd->BATable.BAOriEntry[i].TID;
-
- ASSERT(pAd->BATable.BAOriEntry[i].Wcid < MAX_LEN_OF_MAC_TABLE);
- }
- total --;
- }
-}
-
-
-VOID SendRefreshBAR(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry)
-{
- FRAME_BAR FrameBar;
- ULONG FrameLen;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- USHORT Sequence;
- UCHAR i, TID;
- USHORT idx;
- BA_ORI_ENTRY *pBAEntry;
-
- for (i = 0; i <NUM_OF_TID; i++)
- {
- idx = pEntry->BAOriWcidArray[i];
- if (idx == 0)
- {
- continue;
- }
- pBAEntry = &pAd->BATable.BAOriEntry[idx];
-
- if (pBAEntry->ORI_BA_Status == Originator_Done)
- {
- TID = pBAEntry->TID;
-
- ASSERT(pBAEntry->Wcid < MAX_LEN_OF_MAC_TABLE);
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() allocate memory failed \n"));
- return;
- }
-
- Sequence = pEntry->TxSeq[TID];
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- BarHeaderInit(pAd, &FrameBar, pEntry->Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
-
- FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function.
- FrameBar.StartingSeq.field.StartSeq = Sequence; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.TID = TID; // make sure sequence not clear in DEL funciton.
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_BAR), &FrameBar,
- END_OF_ARGS);
- //if (!(CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_RALINK_CHIPSET)))
- if (1) // Now we always send BAR.
- {
- //MiniportMMRequestUnlock(pAd, 0, pOutBuffer, FrameLen);
- MiniportMMRequest(pAd, (MGMT_USE_QUEUE_FLAG | MapUserPriorityToAccessCategory[TID]), pOutBuffer, FrameLen);
-
- }
- MlmeFreeMemory(pAd, pOutBuffer);
- }
- }
-}
-#endif // DOT11_N_SUPPORT //
-
-VOID ActHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN PUCHAR Addr1,
- IN PUCHAR Addr2,
- IN PUCHAR Addr3)
-{
- NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
- pHdr80211->FC.Type = BTYPE_MGMT;
- pHdr80211->FC.SubType = SUBTYPE_ACTION;
-
- COPY_MAC_ADDR(pHdr80211->Addr1, Addr1);
- COPY_MAC_ADDR(pHdr80211->Addr2, Addr2);
- COPY_MAC_ADDR(pHdr80211->Addr3, Addr3);
-}
-
-VOID BarHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PFRAME_BAR pCntlBar,
- IN PUCHAR pDA,
- IN PUCHAR pSA)
-{
-// USHORT Duration;
-
- NdisZeroMemory(pCntlBar, sizeof(FRAME_BAR));
- pCntlBar->FC.Type = BTYPE_CNTL;
- pCntlBar->FC.SubType = SUBTYPE_BLOCK_ACK_REQ;
- pCntlBar->BarControl.MTID = 0;
- pCntlBar->BarControl.Compressed = 1;
- pCntlBar->BarControl.ACKPolicy = 0;
-
-
- pCntlBar->Duration = 16 + RTMPCalcDuration(pAd, RATE_1, sizeof(FRAME_BA));
-
- COPY_MAC_ADDR(pCntlBar->Addr1, pDA);
- COPY_MAC_ADDR(pCntlBar->Addr2, pSA);
-}
-
-
-/*
- ==========================================================================
- Description:
- Insert Category and action code into the action frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. category code of the frame.
- 4. action code of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID InsertActField(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 Category,
- IN UINT8 ActCode)
-{
- ULONG TempLen;
-
- MakeOutgoingFrame( pFrameBuf, &TempLen,
- 1, &Category,
- 1, &ActCode,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- return;
-}
diff --git a/drivers/staging/rt3090/common/ba_action.c b/drivers/staging/rt3090/common/ba_action.c
deleted file mode 100644
index c73248980690..000000000000
--- a/drivers/staging/rt3090/common/ba_action.c
+++ /dev/null
@@ -1,1779 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-
-#ifdef DOT11_N_SUPPORT
-
-#include "../rt_config.h"
-
-
-#define BA_ORI_INIT_SEQ (pEntry->TxSeq[TID]) //1 // inital sequence number of BA session
-
-#define ORI_SESSION_MAX_RETRY 8
-#define ORI_BA_SESSION_TIMEOUT (2000) // ms
-#define REC_BA_SESSION_IDLE_TIMEOUT (1000) // ms
-
-#define REORDERING_PACKET_TIMEOUT ((100 * OS_HZ)/1000) // system ticks -- 100 ms
-#define MAX_REORDERING_PACKET_TIMEOUT ((3000 * OS_HZ)/1000) // system ticks -- 100 ms
-
-#define RESET_RCV_SEQ (0xFFFF)
-
-static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd, struct reordering_mpdu *mpdu_blk);
-
-
-BA_ORI_ENTRY *BATableAllocOriEntry(
- IN PRTMP_ADAPTER pAd,
- OUT USHORT *Idx);
-
-BA_REC_ENTRY *BATableAllocRecEntry(
- IN PRTMP_ADAPTER pAd,
- OUT USHORT *Idx);
-
-VOID BAOriSessionSetupTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID BARecSessionIdleTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-
-BUILD_TIMER_FUNCTION(BAOriSessionSetupTimeout);
-BUILD_TIMER_FUNCTION(BARecSessionIdleTimeout);
-
-#define ANNOUNCE_REORDERING_PACKET(_pAd, _mpdu_blk) \
- Announce_Reordering_Packet(_pAd, _mpdu_blk);
-
-VOID BA_MaxWinSizeReasign(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntryPeer,
- OUT UCHAR *pWinSize)
-{
- UCHAR MaxSize;
-
-
- if (pAd->MACVersion >= RALINK_2883_VERSION) // 3*3
- {
- if (pAd->MACVersion >= RALINK_3070_VERSION)
- {
- if (pEntryPeer->WepStatus != Ndis802_11EncryptionDisabled)
- MaxSize = 7; // for non-open mode
- else
- MaxSize = 13;
- }
- else
- MaxSize = 31;
- }
- else if (pAd->MACVersion >= RALINK_2880E_VERSION) // 2880 e
- {
- if (pEntryPeer->WepStatus != Ndis802_11EncryptionDisabled)
- MaxSize = 7; // for non-open mode
- else
- MaxSize = 13;
- }
- else
- MaxSize = 7;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ba> Win Size = %d, Max Size = %d\n",
- *pWinSize, MaxSize));
-
- if ((*pWinSize) > MaxSize)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ba> reassign max win size from %d to %d\n",
- *pWinSize, MaxSize));
-
- *pWinSize = MaxSize;
- }
-}
-
-void Announce_Reordering_Packet(IN PRTMP_ADAPTER pAd,
- IN struct reordering_mpdu *mpdu)
-{
- PNDIS_PACKET pPacket;
-
- pPacket = mpdu->pPacket;
-
- if (mpdu->bAMSDU)
- {
- ASSERT(0);
- BA_Reorder_AMSDU_Annnounce(pAd, pPacket);
- }
- else
- {
- //
- // pass this 802.3 packet to upper layer or forward this packet to WM directly
- //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket, RTMP_GET_PACKET_IF(pPacket));
-#endif // CONFIG_STA_SUPPORT //
- }
-}
-
-/*
- * Insert a reordering mpdu into sorted linked list by sequence no.
- */
-BOOLEAN ba_reordering_mpdu_insertsorted(struct reordering_list *list, struct reordering_mpdu *mpdu)
-{
-
- struct reordering_mpdu **ppScan = &list->next;
-
- while (*ppScan != NULL)
- {
- if (SEQ_SMALLER((*ppScan)->Sequence, mpdu->Sequence, MAXSEQ))
- {
- ppScan = &(*ppScan)->next;
- }
- else if ((*ppScan)->Sequence == mpdu->Sequence)
- {
- /* give up this duplicated frame */
- return(FALSE);
- }
- else
- {
- /* find position */
- break;
- }
- }
-
- mpdu->next = *ppScan;
- *ppScan = mpdu;
- list->qlen++;
- return TRUE;
-}
-
-
-/*
- * caller lock critical section if necessary
- */
-static inline void ba_enqueue(struct reordering_list *list, struct reordering_mpdu *mpdu_blk)
-{
- list->qlen++;
- mpdu_blk->next = list->next;
- list->next = mpdu_blk;
-}
-
-/*
- * caller lock critical section if necessary
- */
-static inline struct reordering_mpdu * ba_dequeue(struct reordering_list *list)
-{
- struct reordering_mpdu *mpdu_blk = NULL;
-
- ASSERT(list);
-
- if (list->qlen)
- {
- list->qlen--;
- mpdu_blk = list->next;
- if (mpdu_blk)
- {
- list->next = mpdu_blk->next;
- mpdu_blk->next = NULL;
- }
- }
- return mpdu_blk;
-}
-
-
-static inline struct reordering_mpdu *ba_reordering_mpdu_dequeue(struct reordering_list *list)
-{
- return(ba_dequeue(list));
-}
-
-
-static inline struct reordering_mpdu *ba_reordering_mpdu_probe(struct reordering_list *list)
- {
- ASSERT(list);
-
- return(list->next);
- }
-
-
-/*
- * free all resource for reordering mechanism
- */
-void ba_reordering_resource_release(PRTMP_ADAPTER pAd)
-{
- BA_TABLE *Tab;
- PBA_REC_ENTRY pBAEntry;
- struct reordering_mpdu *mpdu_blk;
- int i;
-
- Tab = &pAd->BATable;
-
- /* I. release all pending reordering packet */
- NdisAcquireSpinLock(&pAd->BATabLock);
- for (i = 0; i < MAX_LEN_OF_BA_REC_TABLE; i++)
- {
- pBAEntry = &Tab->BARecEntry[i];
- if (pBAEntry->REC_BA_Status != Recipient_NONE)
- {
- while ((mpdu_blk = ba_reordering_mpdu_dequeue(&pBAEntry->list)))
- {
- ASSERT(mpdu_blk->pPacket);
- RELEASE_NDIS_PACKET(pAd, mpdu_blk->pPacket, NDIS_STATUS_FAILURE);
- ba_mpdu_blk_free(pAd, mpdu_blk);
- }
- }
- }
- NdisReleaseSpinLock(&pAd->BATabLock);
-
- ASSERT(pBAEntry->list.qlen == 0);
- /* II. free memory of reordering mpdu table */
- NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
- os_free_mem(pAd, pAd->mpdu_blk_pool.mem);
- NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
-}
-
-
-
-/*
- * Allocate all resource for reordering mechanism
- */
-BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num)
-{
- int i;
- PUCHAR mem;
- struct reordering_mpdu *mpdu_blk;
- struct reordering_list *freelist;
-
- /* allocate spinlock */
- NdisAllocateSpinLock(&pAd->mpdu_blk_pool.lock);
-
- /* initialize freelist */
- freelist = &pAd->mpdu_blk_pool.freelist;
- freelist->next = NULL;
- freelist->qlen = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Allocate %d memory for BA reordering\n", (UINT32)(num*sizeof(struct reordering_mpdu))));
-
- /* allocate number of mpdu_blk memory */
- os_alloc_mem(pAd, (PUCHAR *)&mem, (num*sizeof(struct reordering_mpdu)));
-
- pAd->mpdu_blk_pool.mem = mem;
-
- if (mem == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Can't Allocate Memory for BA Reordering\n"));
- return(FALSE);
- }
-
- /* build mpdu_blk free list */
- for (i=0; i<num; i++)
- {
- /* get mpdu_blk */
- mpdu_blk = (struct reordering_mpdu *) mem;
- /* initial mpdu_blk */
- NdisZeroMemory(mpdu_blk, sizeof(struct reordering_mpdu));
- /* next mpdu_blk */
- mem += sizeof(struct reordering_mpdu);
- /* insert mpdu_blk into freelist */
- ba_enqueue(freelist, mpdu_blk);
- }
-
- return(TRUE);
-}
-
-//static int blk_count=0; // sample take off, no use
-
-static struct reordering_mpdu *ba_mpdu_blk_alloc(PRTMP_ADAPTER pAd)
-{
- struct reordering_mpdu *mpdu_blk;
-
- NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
- mpdu_blk = ba_dequeue(&pAd->mpdu_blk_pool.freelist);
- if (mpdu_blk)
- {
-// blk_count++;
- /* reset mpdu_blk */
- NdisZeroMemory(mpdu_blk, sizeof(struct reordering_mpdu));
- }
- NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
- return mpdu_blk;
-}
-
-static void ba_mpdu_blk_free(PRTMP_ADAPTER pAd, struct reordering_mpdu *mpdu_blk)
-{
- ASSERT(mpdu_blk);
-
- NdisAcquireSpinLock(&pAd->mpdu_blk_pool.lock);
-// blk_count--;
- ba_enqueue(&pAd->mpdu_blk_pool.freelist, mpdu_blk);
- NdisReleaseSpinLock(&pAd->mpdu_blk_pool.lock);
-}
-
-
-static USHORT ba_indicate_reordering_mpdus_in_order(
- IN PRTMP_ADAPTER pAd,
- IN PBA_REC_ENTRY pBAEntry,
- IN USHORT StartSeq)
-{
- struct reordering_mpdu *mpdu_blk;
- USHORT LastIndSeq = RESET_RCV_SEQ;
-
- NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
-
- while ((mpdu_blk = ba_reordering_mpdu_probe(&pBAEntry->list)))
- {
- /* find in-order frame */
- if (!SEQ_STEPONE(mpdu_blk->Sequence, StartSeq, MAXSEQ))
- {
- break;
- }
- /* dequeue in-order frame from reodering list */
- mpdu_blk = ba_reordering_mpdu_dequeue(&pBAEntry->list);
- /* pass this frame up */
- ANNOUNCE_REORDERING_PACKET(pAd, mpdu_blk);
- /* move to next sequence */
- StartSeq = mpdu_blk->Sequence;
- LastIndSeq = StartSeq;
- /* free mpdu_blk */
- ba_mpdu_blk_free(pAd, mpdu_blk);
- }
-
- NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
-
- /* update last indicated sequence */
- return LastIndSeq;
-}
-
-static void ba_indicate_reordering_mpdus_le_seq(
- IN PRTMP_ADAPTER pAd,
- IN PBA_REC_ENTRY pBAEntry,
- IN USHORT Sequence)
-{
- struct reordering_mpdu *mpdu_blk;
-
- NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
- while ((mpdu_blk = ba_reordering_mpdu_probe(&pBAEntry->list)))
- {
- /* find in-order frame */
- if ((mpdu_blk->Sequence == Sequence) || SEQ_SMALLER(mpdu_blk->Sequence, Sequence, MAXSEQ))
- {
- /* dequeue in-order frame from reodering list */
- mpdu_blk = ba_reordering_mpdu_dequeue(&pBAEntry->list);
- /* pass this frame up */
- ANNOUNCE_REORDERING_PACKET(pAd, mpdu_blk);
- /* free mpdu_blk */
- ba_mpdu_blk_free(pAd, mpdu_blk);
- }
- else
- {
- break;
- }
- }
- NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
-}
-
-
-static void ba_refresh_reordering_mpdus(
- IN PRTMP_ADAPTER pAd,
- PBA_REC_ENTRY pBAEntry)
-{
- struct reordering_mpdu *mpdu_blk;
-
- NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
-
- /* dequeue in-order frame from reodering list */
- while ((mpdu_blk = ba_reordering_mpdu_dequeue(&pBAEntry->list)))
- {
- /* pass this frame up */
- ANNOUNCE_REORDERING_PACKET(pAd, mpdu_blk);
-
- pBAEntry->LastIndSeq = mpdu_blk->Sequence;
- ba_mpdu_blk_free(pAd, mpdu_blk);
-
- /* update last indicated sequence */
- }
- ASSERT(pBAEntry->list.qlen == 0);
- pBAEntry->LastIndSeq = RESET_RCV_SEQ;
- NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
-}
-
-
-//static
-void ba_flush_reordering_timeout_mpdus(
- IN PRTMP_ADAPTER pAd,
- IN PBA_REC_ENTRY pBAEntry,
- IN ULONG Now32)
-
-{
- USHORT Sequence;
-
-// if ((RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+REORDERING_PACKET_TIMEOUT)) &&
-// (pBAEntry->list.qlen > ((pBAEntry->BAWinSize*7)/8))) //||
-// (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(10*REORDERING_PACKET_TIMEOUT))) &&
-// (pBAEntry->list.qlen > (pBAEntry->BAWinSize/8)))
- if (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(MAX_REORDERING_PACKET_TIMEOUT/6)))
- &&(pBAEntry->list.qlen > 1)
- )
- {
- DBGPRINT(RT_DEBUG_TRACE,("timeout[%d] (%08lx-%08lx = %d > %d): %x, flush all!\n ", pBAEntry->list.qlen, Now32, (pBAEntry->LastIndSeqAtTimer),
- (int)((long) Now32 - (long)(pBAEntry->LastIndSeqAtTimer)), MAX_REORDERING_PACKET_TIMEOUT,
- pBAEntry->LastIndSeq));
- ba_refresh_reordering_mpdus(pAd, pBAEntry);
- pBAEntry->LastIndSeqAtTimer = Now32;
- }
- else
- if (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer+(REORDERING_PACKET_TIMEOUT)))
- && (pBAEntry->list.qlen > 0)
- )
- {
-// DBGPRINT(RT_DEBUG_OFF, ("timeout[%d] (%lx-%lx = %d > %d): %x, ", pBAEntry->list.qlen, Now32, (pBAEntry->LastIndSeqAtTimer),
-// (int)((long) Now32 - (long)(pBAEntry->LastIndSeqAtTimer)), REORDERING_PACKET_TIMEOUT,
-// pBAEntry->LastIndSeq));
- //
- // force LastIndSeq to shift to LastIndSeq+1
- //
- Sequence = (pBAEntry->LastIndSeq+1) & MAXSEQ;
- ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, Sequence);
- pBAEntry->LastIndSeqAtTimer = Now32;
- pBAEntry->LastIndSeq = Sequence;
- //
- // indicate in-order mpdus
- //
- Sequence = ba_indicate_reordering_mpdus_in_order(pAd, pBAEntry, Sequence);
- if (Sequence != RESET_RCV_SEQ)
- {
- pBAEntry->LastIndSeq = Sequence;
- }
-
- DBGPRINT(RT_DEBUG_OFF, ("%x, flush one!\n", pBAEntry->LastIndSeq));
-
- }
-}
-
-
-/*
- * generate ADDBA request to
- * set up BA agreement
- */
-VOID BAOriSessionSetUp(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR TID,
- IN USHORT TimeOut,
- IN ULONG DelayTime,
- IN BOOLEAN isForced)
-
-{
- //MLME_ADDBA_REQ_STRUCT AddbaReq;
- BA_ORI_ENTRY *pBAEntry = NULL;
- USHORT Idx;
- BOOLEAN Cancelled;
-
- if ((pAd->CommonCfg.BACapability.field.AutoBA != TRUE) && (isForced == FALSE))
- return;
-
- // if this entry is limited to use legacy tx mode, it doesn't generate BA.
- if (RTMPStaFixedTxMode(pAd, pEntry) != FIXED_TXMODE_HT)
- return;
-
- if ((pEntry->BADeclineBitmap & (1<<TID)) && (isForced == FALSE))
- {
- // try again after 3 secs
- DelayTime = 3000;
-// DBGPRINT(RT_DEBUG_TRACE, ("DeCline BA from Peer\n"));
-// return;
- }
-
-
- Idx = pEntry->BAOriWcidArray[TID];
- if (Idx == 0)
- {
- // allocate a BA session
- pBAEntry = BATableAllocOriEntry(pAd, &Idx);
- if (pBAEntry == NULL)
- {
- DBGPRINT(RT_DEBUG_TRACE,("ADDBA - MlmeADDBAAction() allocate BA session failed \n"));
- return;
- }
- }
- else
- {
- pBAEntry =&pAd->BATable.BAOriEntry[Idx];
- }
-
- if (pBAEntry->ORI_BA_Status >= Originator_WaitRes)
- {
- return;
- }
-
- pEntry->BAOriWcidArray[TID] = Idx;
-
- // Initialize BA session
- pBAEntry->ORI_BA_Status = Originator_WaitRes;
- pBAEntry->Wcid = pEntry->Aid;
- pBAEntry->BAWinSize = pAd->CommonCfg.BACapability.field.RxBAWinLimit;
- pBAEntry->Sequence = BA_ORI_INIT_SEQ;
- pBAEntry->Token = 1; // (2008-01-21) Jan Lee recommends it - this token can't be 0
- pBAEntry->TID = TID;
- pBAEntry->TimeOutValue = TimeOut;
- pBAEntry->pAdapter = pAd;
-
- if (!(pEntry->TXBAbitmap & (1<<TID)))
- {
- RTMPInitTimer(pAd, &pBAEntry->ORIBATimer, GET_TIMER_FUNCTION(BAOriSessionSetupTimeout), pBAEntry, FALSE);
- }
- else
- RTMPCancelTimer(&pBAEntry->ORIBATimer, &Cancelled);
-
- // set timer to send ADDBA request
- RTMPSetTimer(&pBAEntry->ORIBATimer, DelayTime);
-}
-
-VOID BAOriSessionAdd(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN PFRAME_ADDBA_RSP pFrame)
-{
- BA_ORI_ENTRY *pBAEntry = NULL;
- BOOLEAN Cancelled;
- UCHAR TID;
- USHORT Idx;
- PUCHAR pOutBuffer2 = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
- FRAME_BAR FrameBar;
-
- TID = pFrame->BaParm.TID;
- Idx = pEntry->BAOriWcidArray[TID];
- pBAEntry =&pAd->BATable.BAOriEntry[Idx];
-
- // Start fill in parameters.
- if ((Idx !=0) && (pBAEntry->TID == TID) && (pBAEntry->ORI_BA_Status == Originator_WaitRes))
- {
- pBAEntry->BAWinSize = min(pBAEntry->BAWinSize, ((UCHAR)pFrame->BaParm.BufSize));
- BA_MaxWinSizeReasign(pAd, pEntry, &pBAEntry->BAWinSize);
-
- pBAEntry->TimeOutValue = pFrame->TimeOutValue;
- pBAEntry->ORI_BA_Status = Originator_Done;
- pAd->BATable.numDoneOriginator ++;
-
- // reset sequence number
- pBAEntry->Sequence = BA_ORI_INIT_SEQ;
- // Set Bitmap flag.
- pEntry->TXBAbitmap |= (1<<TID);
- RTMPCancelTimer(&pBAEntry->ORIBATimer, &Cancelled);
-
- pBAEntry->ORIBATimer.TimerValue = 0; //pFrame->TimeOutValue;
-
- DBGPRINT(RT_DEBUG_TRACE,("%s : TXBAbitmap = %x, BAWinSize = %d, TimeOut = %ld\n", __FUNCTION__, pEntry->TXBAbitmap,
- pBAEntry->BAWinSize, pBAEntry->ORIBATimer.TimerValue));
-
- // SEND BAR ;
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer2); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("BA - BAOriSessionAdd() allocate memory failed \n"));
- return;
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- BarHeaderInit(pAd, &FrameBar, pAd->MacTab.Content[pBAEntry->Wcid].Addr, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
-
- FrameBar.StartingSeq.field.FragNum = 0; // make sure sequence not clear in DEL function.
- FrameBar.StartingSeq.field.StartSeq = pBAEntry->Sequence; // make sure sequence not clear in DEL funciton.
- FrameBar.BarControl.TID = pBAEntry->TID; // make sure sequence not clear in DEL funciton.
- MakeOutgoingFrame(pOutBuffer2, &FrameLen,
- sizeof(FRAME_BAR), &FrameBar,
- END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer2, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer2);
-
-
- if (pBAEntry->ORIBATimer.TimerValue)
- RTMPSetTimer(&pBAEntry->ORIBATimer, pBAEntry->ORIBATimer.TimerValue); // in mSec
- }
-}
-
-BOOLEAN BARecSessionAdd(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN PFRAME_ADDBA_REQ pFrame)
-{
- BA_REC_ENTRY *pBAEntry = NULL;
- BOOLEAN Status = TRUE;
- BOOLEAN Cancelled;
- USHORT Idx;
- UCHAR TID;
- UCHAR BAWinSize;
- //UINT32 Value;
- //UINT offset;
-
-
- ASSERT(pEntry);
-
- // find TID
- TID = pFrame->BaParm.TID;
-
- BAWinSize = min(((UCHAR)pFrame->BaParm.BufSize), (UCHAR)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
-
- // Intel patch
- if (BAWinSize == 0)
- {
- BAWinSize = 64;
- }
-
- Idx = pEntry->BARecWcidArray[TID];
-
-
- if (Idx == 0)
- {
- pBAEntry = BATableAllocRecEntry(pAd, &Idx);
- }
- else
- {
- pBAEntry = &pAd->BATable.BARecEntry[Idx];
- // flush all pending reordering mpdus
- ba_refresh_reordering_mpdus(pAd, pBAEntry);
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("%s(%ld): Idx = %d, BAWinSize(req %d) = %d\n", __FUNCTION__, pAd->BATable.numAsRecipient, Idx,
- pFrame->BaParm.BufSize, BAWinSize));
-
- // Start fill in parameters.
- if (pBAEntry != NULL)
- {
- ASSERT(pBAEntry->list.qlen == 0);
-
- pBAEntry->REC_BA_Status = Recipient_HandleRes;
- pBAEntry->BAWinSize = BAWinSize;
- pBAEntry->Wcid = pEntry->Aid;
- pBAEntry->TID = TID;
- pBAEntry->TimeOutValue = pFrame->TimeOutValue;
- pBAEntry->REC_BA_Status = Recipient_Accept;
- // initial sequence number
- pBAEntry->LastIndSeq = RESET_RCV_SEQ; //pFrame->BaStartSeq.field.StartSeq;
-
- DBGPRINT(RT_DEBUG_OFF, ("Start Seq = %08x\n", pFrame->BaStartSeq.field.StartSeq));
-
- if (pEntry->RXBAbitmap & (1<<TID))
- {
- RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled);
- }
- else
- {
- RTMPInitTimer(pAd, &pBAEntry->RECBATimer, GET_TIMER_FUNCTION(BARecSessionIdleTimeout), pBAEntry, TRUE);
- }
-
-
- // Set Bitmap flag.
- pEntry->RXBAbitmap |= (1<<TID);
- pEntry->BARecWcidArray[TID] = Idx;
-
- pEntry->BADeclineBitmap &= ~(1<<TID);
-
- // Set BA session mask in WCID table.
- RTMP_ADD_BA_SESSION_TO_ASIC(pAd, pEntry->Aid, TID);
-
- DBGPRINT(RT_DEBUG_TRACE,("MACEntry[%d]RXBAbitmap = 0x%x. BARecWcidArray=%d\n",
- pEntry->Aid, pEntry->RXBAbitmap, pEntry->BARecWcidArray[TID]));
- }
- else
- {
- Status = FALSE;
- DBGPRINT(RT_DEBUG_TRACE,("Can't Accept ADDBA for %02x:%02x:%02x:%02x:%02x:%02x TID = %d\n",
- PRINT_MAC(pEntry->Addr), TID));
- }
- return(Status);
-}
-
-
-BA_REC_ENTRY *BATableAllocRecEntry(
- IN PRTMP_ADAPTER pAd,
- OUT USHORT *Idx)
-{
- int i;
- BA_REC_ENTRY *pBAEntry = NULL;
-
-
- NdisAcquireSpinLock(&pAd->BATabLock);
-
- if (pAd->BATable.numAsRecipient >= MAX_BARECI_SESSION)
- {
- DBGPRINT(RT_DEBUG_OFF, ("BA Recipeint Session (%ld) > %d\n",
- pAd->BATable.numAsRecipient, MAX_BARECI_SESSION));
- goto done;
- }
-
- // reserve idx 0 to identify BAWcidArray[TID] as empty
- for (i=1; i < MAX_LEN_OF_BA_REC_TABLE; i++)
- {
- pBAEntry =&pAd->BATable.BARecEntry[i];
- if ((pBAEntry->REC_BA_Status == Recipient_NONE))
- {
- // get one
- pAd->BATable.numAsRecipient++;
- pBAEntry->REC_BA_Status = Recipient_USED;
- *Idx = i;
- break;
- }
- }
-
-done:
- NdisReleaseSpinLock(&pAd->BATabLock);
- return pBAEntry;
-}
-
-BA_ORI_ENTRY *BATableAllocOriEntry(
- IN PRTMP_ADAPTER pAd,
- OUT USHORT *Idx)
-{
- int i;
- BA_ORI_ENTRY *pBAEntry = NULL;
-
- NdisAcquireSpinLock(&pAd->BATabLock);
-
- if (pAd->BATable.numAsOriginator >= (MAX_LEN_OF_BA_ORI_TABLE))
- {
- goto done;
- }
-
- // reserve idx 0 to identify BAWcidArray[TID] as empty
- for (i=1; i<MAX_LEN_OF_BA_ORI_TABLE; i++)
- {
- pBAEntry =&pAd->BATable.BAOriEntry[i];
- if ((pBAEntry->ORI_BA_Status == Originator_NONE))
- {
- // get one
- pAd->BATable.numAsOriginator++;
- pBAEntry->ORI_BA_Status = Originator_USED;
- pBAEntry->pAdapter = pAd;
- *Idx = i;
- break;
- }
- }
-
-done:
- NdisReleaseSpinLock(&pAd->BATabLock);
- return pBAEntry;
-}
-
-
-VOID BATableFreeOriEntry(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Idx)
-{
- BA_ORI_ENTRY *pBAEntry = NULL;
- MAC_TABLE_ENTRY *pEntry;
-
-
- if ((Idx == 0) || (Idx >= MAX_LEN_OF_BA_ORI_TABLE))
- return;
-
- pBAEntry =&pAd->BATable.BAOriEntry[Idx];
-
- if (pBAEntry->ORI_BA_Status != Originator_NONE)
- {
- pEntry = &pAd->MacTab.Content[pBAEntry->Wcid];
- pEntry->BAOriWcidArray[pBAEntry->TID] = 0;
-
-
- NdisAcquireSpinLock(&pAd->BATabLock);
- if (pBAEntry->ORI_BA_Status == Originator_Done)
- {
- pAd->BATable.numDoneOriginator -= 1;
- pEntry->TXBAbitmap &= (~(1<<(pBAEntry->TID) ));
- DBGPRINT(RT_DEBUG_TRACE, ("BATableFreeOriEntry numAsOriginator= %ld\n", pAd->BATable.numAsRecipient));
- // Erase Bitmap flag.
- }
-
- ASSERT(pAd->BATable.numAsOriginator != 0);
-
- pAd->BATable.numAsOriginator -= 1;
-
- pBAEntry->ORI_BA_Status = Originator_NONE;
- pBAEntry->Token = 0;
- NdisReleaseSpinLock(&pAd->BATabLock);
- }
-}
-
-
-VOID BATableFreeRecEntry(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Idx)
-{
- BA_REC_ENTRY *pBAEntry = NULL;
- MAC_TABLE_ENTRY *pEntry;
-
-
- if ((Idx == 0) || (Idx >= MAX_LEN_OF_BA_REC_TABLE))
- return;
-
- pBAEntry =&pAd->BATable.BARecEntry[Idx];
-
- if (pBAEntry->REC_BA_Status != Recipient_NONE)
- {
- pEntry = &pAd->MacTab.Content[pBAEntry->Wcid];
- pEntry->BARecWcidArray[pBAEntry->TID] = 0;
-
- NdisAcquireSpinLock(&pAd->BATabLock);
-
- ASSERT(pAd->BATable.numAsRecipient != 0);
-
- pAd->BATable.numAsRecipient -= 1;
-
- pBAEntry->REC_BA_Status = Recipient_NONE;
- NdisReleaseSpinLock(&pAd->BATabLock);
- }
-}
-
-
-VOID BAOriSessionTearDown(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR TID,
- IN BOOLEAN bPassive,
- IN BOOLEAN bForceSend)
-{
- ULONG Idx = 0;
- BA_ORI_ENTRY *pBAEntry;
- BOOLEAN Cancelled;
-
- if (Wcid >= MAX_LEN_OF_MAC_TABLE)
- {
- return;
- }
-
- //
- // Locate corresponding BA Originator Entry in BA Table with the (pAddr,TID).
- //
- Idx = pAd->MacTab.Content[Wcid].BAOriWcidArray[TID];
- if ((Idx == 0) || (Idx >= MAX_LEN_OF_BA_ORI_TABLE))
- {
- if (bForceSend == TRUE)
- {
- // force send specified TID DelBA
- MLME_DELBA_REQ_STRUCT DelbaReq;
- MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem != NULL)
- {
- NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
- NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
-
- COPY_MAC_ADDR(DelbaReq.Addr, pAd->MacTab.Content[Wcid].Addr);
- DelbaReq.Wcid = Wcid;
- DelbaReq.TID = TID;
- DelbaReq.Initiator = ORIGINATOR;
- Elem->MsgLen = sizeof(DelbaReq);
- NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
- MlmeDELBAAction(pAd, Elem);
- kfree(Elem);
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s(bForceSend):alloc memory failed!\n", __FUNCTION__));
- }
- }
-
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __FUNCTION__, Wcid, TID));
-
- pBAEntry = &pAd->BATable.BAOriEntry[Idx];
- DBGPRINT(RT_DEBUG_TRACE,("\t===>Idx = %ld, Wcid=%d.TID=%d, ORI_BA_Status = %d \n", Idx, Wcid, TID, pBAEntry->ORI_BA_Status));
- //
- // Prepare DelBA action frame and send to the peer.
- //
- if ((bPassive == FALSE) && (TID == pBAEntry->TID) && (pBAEntry->ORI_BA_Status == Originator_Done))
- {
- MLME_DELBA_REQ_STRUCT DelbaReq;
- MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem != NULL)
- {
- NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
- NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
-
- COPY_MAC_ADDR(DelbaReq.Addr, pAd->MacTab.Content[Wcid].Addr);
- DelbaReq.Wcid = Wcid;
- DelbaReq.TID = pBAEntry->TID;
- DelbaReq.Initiator = ORIGINATOR;
- Elem->MsgLen = sizeof(DelbaReq);
- NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
- MlmeDELBAAction(pAd, Elem);
- kfree(Elem);
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():alloc memory failed!\n", __FUNCTION__));
- return;
- }
- }
- RTMPCancelTimer(&pBAEntry->ORIBATimer, &Cancelled);
- BATableFreeOriEntry(pAd, Idx);
-
- if (bPassive)
- {
- //BAOriSessionSetUp(pAd, &pAd->MacTab.Content[Wcid], TID, 0, 10000, TRUE);
- }
-}
-
-VOID BARecSessionTearDown(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR TID,
- IN BOOLEAN bPassive)
-{
- ULONG Idx = 0;
- BA_REC_ENTRY *pBAEntry;
-
- if (Wcid >= MAX_LEN_OF_MAC_TABLE)
- {
- return;
- }
-
- //
- // Locate corresponding BA Originator Entry in BA Table with the (pAddr,TID).
- //
- Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID];
- if (Idx == 0)
- return;
-
- DBGPRINT(RT_DEBUG_TRACE,("%s===>Wcid=%d.TID=%d \n", __FUNCTION__, Wcid, TID));
-
-
- pBAEntry = &pAd->BATable.BARecEntry[Idx];
- DBGPRINT(RT_DEBUG_TRACE,("\t===>Idx = %ld, Wcid=%d.TID=%d, REC_BA_Status = %d \n", Idx, Wcid, TID, pBAEntry->REC_BA_Status));
- //
- // Prepare DelBA action frame and send to the peer.
- //
- if ((TID == pBAEntry->TID) && (pBAEntry->REC_BA_Status == Recipient_Accept))
- {
- MLME_DELBA_REQ_STRUCT DelbaReq;
- BOOLEAN Cancelled;
- //ULONG offset;
- //UINT32 VALUE;
-
- RTMPCancelTimer(&pBAEntry->RECBATimer, &Cancelled);
-
- //
- // 1. Send DELBA Action Frame
- //
- if (bPassive == FALSE)
- {
- MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem != NULL)
- {
- NdisZeroMemory(&DelbaReq, sizeof(DelbaReq));
- NdisZeroMemory(Elem, sizeof(MLME_QUEUE_ELEM));
-
- COPY_MAC_ADDR(DelbaReq.Addr, pAd->MacTab.Content[Wcid].Addr);
- DelbaReq.Wcid = Wcid;
- DelbaReq.TID = TID;
- DelbaReq.Initiator = RECIPIENT;
- Elem->MsgLen = sizeof(DelbaReq);
- NdisMoveMemory(Elem->Msg, &DelbaReq, sizeof(DelbaReq));
- MlmeDELBAAction(pAd, Elem);
- kfree(Elem);
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():alloc memory failed!\n", __FUNCTION__));
- return;
- }
- }
-
-
- //
- // 2. Free resource of BA session
- //
- // flush all pending reordering mpdus
- ba_refresh_reordering_mpdus(pAd, pBAEntry);
-
- NdisAcquireSpinLock(&pAd->BATabLock);
-
- // Erase Bitmap flag.
- pBAEntry->LastIndSeq = RESET_RCV_SEQ;
- pBAEntry->BAWinSize = 0;
- // Erase Bitmap flag at software mactable
- pAd->MacTab.Content[Wcid].RXBAbitmap &= (~(1<<(pBAEntry->TID)));
- pAd->MacTab.Content[Wcid].BARecWcidArray[TID] = 0;
-
- RTMP_DEL_BA_SESSION_FROM_ASIC(pAd, Wcid, TID);
-
- NdisReleaseSpinLock(&pAd->BATabLock);
-
- }
-
- BATableFreeRecEntry(pAd, Idx);
-}
-
-VOID BASessionTearDownALL(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid)
-{
- int i;
-
- for (i=0; i<NUM_OF_TID; i++)
- {
- BAOriSessionTearDown(pAd, Wcid, i, FALSE, FALSE);
- BARecSessionTearDown(pAd, Wcid, i, FALSE);
- }
-}
-
-
-/*
- ==========================================================================
- Description:
- Retry sending ADDBA Reqest.
-
- IRQL = DISPATCH_LEVEL
-
- Parametrs:
- p8023Header: if this is already 802.3 format, p8023Header is NULL
-
- Return : TRUE if put into rx reordering buffer, shouldn't indicaterxhere.
- FALSE , then continue indicaterx at this moment.
- ==========================================================================
- */
-VOID BAOriSessionSetupTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- BA_ORI_ENTRY *pBAEntry = (BA_ORI_ENTRY *)FunctionContext;
- MAC_TABLE_ENTRY *pEntry;
- PRTMP_ADAPTER pAd;
-
- if (pBAEntry == NULL)
- return;
-
- pAd = pBAEntry->pAdapter;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Do nothing if monitor mode is on
- if (MONITOR_ON(pAd))
- return;
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RALINK_ATE
- // Nothing to do in ATE mode.
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- pEntry = &pAd->MacTab.Content[pBAEntry->Wcid];
-
- if ((pBAEntry->ORI_BA_Status == Originator_WaitRes) && (pBAEntry->Token < ORI_SESSION_MAX_RETRY))
- {
- MLME_ADDBA_REQ_STRUCT AddbaReq;
-
- NdisZeroMemory(&AddbaReq, sizeof(AddbaReq));
- COPY_MAC_ADDR(AddbaReq.pAddr, pEntry->Addr);
- AddbaReq.Wcid = (UCHAR)(pEntry->Aid);
- AddbaReq.TID = pBAEntry->TID;
- AddbaReq.BaBufSize = pAd->CommonCfg.BACapability.field.RxBAWinLimit;
- AddbaReq.TimeOutValue = 0;
- AddbaReq.Token = pBAEntry->Token;
- MlmeEnqueue(pAd, ACTION_STATE_MACHINE, MT2_MLME_ADD_BA_CATE, sizeof(MLME_ADDBA_REQ_STRUCT), (PVOID)&AddbaReq);
- RTMP_MLME_HANDLER(pAd);
- DBGPRINT(RT_DEBUG_TRACE,("BA Ori Session Timeout(%d) : Send ADD BA again\n", pBAEntry->Token));
-
- pBAEntry->Token++;
- RTMPSetTimer(&pBAEntry->ORIBATimer, ORI_BA_SESSION_TIMEOUT);
- }
- else
- {
- BATableFreeOriEntry(pAd, pEntry->BAOriWcidArray[pBAEntry->TID]);
- }
-}
-
-/*
- ==========================================================================
- Description:
- Retry sending ADDBA Reqest.
-
- IRQL = DISPATCH_LEVEL
-
- Parametrs:
- p8023Header: if this is already 802.3 format, p8023Header is NULL
-
- Return : TRUE if put into rx reordering buffer, shouldn't indicaterxhere.
- FALSE , then continue indicaterx at this moment.
- ==========================================================================
- */
-VOID BARecSessionIdleTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
-
- BA_REC_ENTRY *pBAEntry = (BA_REC_ENTRY *)FunctionContext;
- PRTMP_ADAPTER pAd;
- ULONG Now32;
-
- if (pBAEntry == NULL)
- return;
-
- if ((pBAEntry->REC_BA_Status == Recipient_Accept))
- {
- NdisGetSystemUpTime(&Now32);
-
- if (RTMP_TIME_AFTER((unsigned long)Now32, (unsigned long)(pBAEntry->LastIndSeqAtTimer + REC_BA_SESSION_IDLE_TIMEOUT)))
- {
- pAd = pBAEntry->pAdapter;
- // flush all pending reordering mpdus
- ba_refresh_reordering_mpdus(pAd, pBAEntry);
- DBGPRINT(RT_DEBUG_OFF, ("%ld: REC BA session Timeout\n", Now32));
- }
- }
-}
-
-
-VOID PeerAddBAReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- // 7.4.4.1
- //ULONG Idx;
- UCHAR Status = 1;
- UCHAR pAddr[6];
- FRAME_ADDBA_RSP ADDframe;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- PFRAME_ADDBA_REQ pAddreqFrame = NULL;
- //UCHAR BufSize;
- ULONG FrameLen;
- PULONG ptemp;
- PMAC_TABLE_ENTRY pMacEntry;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s ==> (Wcid = %d)\n", __FUNCTION__, Elem->Wcid));
-
- //hex_dump("AddBAReq", Elem->Msg, Elem->MsgLen);
-
- //ADDBA Request from unknown peer, ignore this.
- if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
- return;
-
- pMacEntry = &pAd->MacTab.Content[Elem->Wcid];
- DBGPRINT(RT_DEBUG_TRACE,("BA - PeerAddBAReqAction----> \n"));
- ptemp = (PULONG)Elem->Msg;
- //DBGPRINT_RAW(RT_DEBUG_EMU, ("%08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x:: %08x\n", *(ptemp), *(ptemp+1), *(ptemp+2), *(ptemp+3), *(ptemp+4), *(ptemp+5), *(ptemp+6), *(ptemp+7), *(ptemp+8)));
-
- if (PeerAddBAReqActionSanity(pAd, Elem->Msg, Elem->MsgLen, pAddr))
- {
-
- if ((pAd->CommonCfg.bBADecline == FALSE) && IS_HT_STA(pMacEntry))
- {
- pAddreqFrame = (PFRAME_ADDBA_REQ)(&Elem->Msg[0]);
- DBGPRINT(RT_DEBUG_OFF, ("Rcv Wcid(%d) AddBAReq\n", Elem->Wcid));
- if (BARecSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid], pAddreqFrame))
- Status = 0;
- else
- Status = 38; // more parameters have invalid values
- }
- else
- {
- Status = 37; // the request has been declined.
- }
- }
-
- if (pAd->MacTab.Content[Elem->Wcid].ValidAsCLI)
- ASSERT(pAd->MacTab.Content[Elem->Wcid].Sst == SST_ASSOC);
-
- pAddreqFrame = (PFRAME_ADDBA_REQ)(&Elem->Msg[0]);
- // 2. Always send back ADDBA Response
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("ACTION - PeerBAAction() allocate memory failed \n"));
- return;
- }
-
- NdisZeroMemory(&ADDframe, sizeof(FRAME_ADDBA_RSP));
- // 2-1. Prepare ADDBA Response frame.
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (ADHOC_ON(pAd))
- ActHeaderInit(pAd, &ADDframe.Hdr, pAddr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#ifdef QOS_DLS_SUPPORT
- if (pAd->MacTab.Content[Elem->Wcid].ValidAsDls)
- ActHeaderInit(pAd, &ADDframe.Hdr, pAddr, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- else
-#endif // QOS_DLS_SUPPORT //
- ActHeaderInit(pAd, &ADDframe.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAddr);
- }
-#endif // CONFIG_STA_SUPPORT //
- ADDframe.Category = CATEGORY_BA;
- ADDframe.Action = ADDBA_RESP;
- ADDframe.Token = pAddreqFrame->Token;
- // What is the Status code?? need to check.
- ADDframe.StatusCode = Status;
- ADDframe.BaParm.BAPolicy = IMMED_BA;
- ADDframe.BaParm.AMSDUSupported = 0;
- ADDframe.BaParm.TID = pAddreqFrame->BaParm.TID;
- ADDframe.BaParm.BufSize = min(((UCHAR)pAddreqFrame->BaParm.BufSize), (UCHAR)pAd->CommonCfg.BACapability.field.RxBAWinLimit);
- if (ADDframe.BaParm.BufSize == 0)
- {
- ADDframe.BaParm.BufSize = 64;
- }
- ADDframe.TimeOutValue = 0; //pAddreqFrame->TimeOutValue;
-
- *(USHORT *)(&ADDframe.BaParm) = cpu2le16(*(USHORT *)(&ADDframe.BaParm));
- ADDframe.StatusCode = cpu2le16(ADDframe.StatusCode);
- ADDframe.TimeOutValue = cpu2le16(ADDframe.TimeOutValue);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_ADDBA_RSP), &ADDframe,
- END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s(%d): TID(%d), BufSize(%d) <== \n", __FUNCTION__, Elem->Wcid, ADDframe.BaParm.TID,
- ADDframe.BaParm.BufSize));
-}
-
-
-VOID PeerAddBARspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- //UCHAR Idx, i;
- //PUCHAR pOutBuffer = NULL;
- PFRAME_ADDBA_RSP pFrame = NULL;
- //PBA_ORI_ENTRY pBAEntry;
-
- //ADDBA Response from unknown peer, ignore this.
- if (Elem->Wcid >= MAX_LEN_OF_MAC_TABLE)
- return;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s ==> Wcid(%d)\n", __FUNCTION__, Elem->Wcid));
-
- //hex_dump("PeerAddBARspAction()", Elem->Msg, Elem->MsgLen);
-
- if (PeerAddBARspActionSanity(pAd, Elem->Msg, Elem->MsgLen))
- {
- pFrame = (PFRAME_ADDBA_RSP)(&Elem->Msg[0]);
-
- DBGPRINT(RT_DEBUG_TRACE, ("\t\t StatusCode = %d\n", pFrame->StatusCode));
- switch (pFrame->StatusCode)
- {
- case 0:
- // I want a BAsession with this peer as an originator.
- BAOriSessionAdd(pAd, &pAd->MacTab.Content[Elem->Wcid], pFrame);
- break;
- default:
- // check status == USED ???
- BAOriSessionTearDown(pAd, Elem->Wcid, pFrame->BaParm.TID, TRUE, FALSE);
- break;
- }
- // Rcv Decline StatusCode
- if ((pFrame->StatusCode == 37)
-#ifdef CONFIG_STA_SUPPORT
- || ((pAd->OpMode == OPMODE_STA) && STA_TGN_WIFI_ON(pAd) && (pFrame->StatusCode != 0))
-#endif // CONFIG_STA_SUPPORT //
- )
- {
- pAd->MacTab.Content[Elem->Wcid].BADeclineBitmap |= 1<<pFrame->BaParm.TID;
- }
- }
-}
-
-VOID PeerDelBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-
-{
- //UCHAR Idx;
- //PUCHAR pOutBuffer = NULL;
- PFRAME_DELBA_REQ pDelFrame = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE,("%s ==>\n", __FUNCTION__));
- //DELBA Request from unknown peer, ignore this.
- if (PeerDelBAActionSanity(pAd, Elem->Wcid, Elem->Msg, Elem->MsgLen))
- {
- pDelFrame = (PFRAME_DELBA_REQ)(&Elem->Msg[0]);
- if (pDelFrame->DelbaParm.Initiator == ORIGINATOR)
- {
- DBGPRINT(RT_DEBUG_TRACE,("BA - PeerDelBAAction----> ORIGINATOR\n"));
- BARecSessionTearDown(pAd, Elem->Wcid, pDelFrame->DelbaParm.TID, TRUE);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("BA - PeerDelBAAction----> RECIPIENT, Reason = %d\n", pDelFrame->ReasonCode));
- //hex_dump("DelBA Frame", pDelFrame, Elem->MsgLen);
- BAOriSessionTearDown(pAd, Elem->Wcid, pDelFrame->DelbaParm.TID, TRUE, FALSE);
- }
- }
-}
-
-
-BOOLEAN CntlEnqueueForRecv(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN ULONG MsgLen,
- IN PFRAME_BA_REQ pMsg)
-{
- PFRAME_BA_REQ pFrame = pMsg;
- //PRTMP_REORDERBUF pBuffer;
- //PRTMP_REORDERBUF pDmaBuf;
- PBA_REC_ENTRY pBAEntry;
- //BOOLEAN Result;
- ULONG Idx;
- //UCHAR NumRxPkt;
- UCHAR TID;//, i;
-
- TID = (UCHAR)pFrame->BARControl.TID;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s(): BAR-Wcid(%ld), Tid (%d)\n", __FUNCTION__, Wcid, TID));
- //hex_dump("BAR", (PCHAR) pFrame, MsgLen);
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return FALSE;
-
- // First check the size, it MUST not exceed the mlme queue size
- if (MsgLen > MGMT_DMA_BUFFER_SIZE)
- {
- DBGPRINT_ERR(("CntlEnqueueForRecv: frame too large, size = %ld \n", MsgLen));
- return FALSE;
- }
- else if (MsgLen != sizeof(FRAME_BA_REQ))
- {
- DBGPRINT_ERR(("CntlEnqueueForRecv: BlockAck Request frame length size = %ld incorrect\n", MsgLen));
- return FALSE;
- }
- else if (MsgLen != sizeof(FRAME_BA_REQ))
- {
- DBGPRINT_ERR(("CntlEnqueueForRecv: BlockAck Request frame length size = %ld incorrect\n", MsgLen));
- return FALSE;
- }
-
- if ((Wcid < MAX_LEN_OF_MAC_TABLE) && (TID < 8))
- {
- // if this receiving packet is from SA that is in our OriEntry. Since WCID <9 has direct mapping. no need search.
- Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID];
- pBAEntry = &pAd->BATable.BARecEntry[Idx];
- }
- else
- {
- return FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("BAR(%ld) : Tid (%d) - %04x:%04x\n", Wcid, TID, pFrame->BAStartingSeq.field.StartSeq, pBAEntry->LastIndSeq ));
-
- if (SEQ_SMALLER(pBAEntry->LastIndSeq, pFrame->BAStartingSeq.field.StartSeq, MAXSEQ))
- {
- //DBGPRINT(RT_DEBUG_TRACE, ("BAR Seq = %x, LastIndSeq = %x\n", pFrame->BAStartingSeq.field.StartSeq, pBAEntry->LastIndSeq));
- ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, pFrame->BAStartingSeq.field.StartSeq);
- pBAEntry->LastIndSeq = (pFrame->BAStartingSeq.field.StartSeq == 0) ? MAXSEQ :(pFrame->BAStartingSeq.field.StartSeq -1);
- }
- //ba_refresh_reordering_mpdus(pAd, pBAEntry);
- return TRUE;
-}
-
-/*
-Description : Send PSMP Action frame If PSMP mode switches.
-*/
-VOID SendPSMPAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR Psmp)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- //ULONG Idx;
- FRAME_PSMP_ACTION Frame;
- ULONG FrameLen;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("BA - MlmeADDBAAction() allocate memory failed \n"));
- return;
- }
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ActHeaderInit(pAd, &Frame.Hdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->MacTab.Content[Wcid].Addr);
-#endif // CONFIG_STA_SUPPORT //
-
- Frame.Category = CATEGORY_HT;
- Frame.Action = SMPS_ACTION;
- switch (Psmp)
- {
- case MMPS_ENABLE:
-#ifdef RT30xx
- if (IS_RT30xx(pAd)
- &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
- {
- RTMP_ASIC_MMPS_DISABLE(pAd);
- }
-#endif // RT30xx //
- Frame.Psmp = 0;
- break;
- case MMPS_DYNAMIC:
- Frame.Psmp = 3;
- break;
- case MMPS_STATIC:
-#ifdef RT30xx
- if (IS_RT30xx(pAd)
- &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
- {
- RTMP_ASIC_MMPS_ENABLE(pAd);
- }
-#endif // RT30xx //
- Frame.Psmp = 1;
- break;
- }
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(FRAME_PSMP_ACTION), &Frame,
- END_OF_ARGS);
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- DBGPRINT(RT_DEBUG_ERROR,("HT - SendPSMPAction( %d ) \n", Frame.Psmp));
-}
-
-
-#define RADIO_MEASUREMENT_REQUEST_ACTION 0
-
-typedef struct PACKED
-{
- UCHAR RegulatoryClass;
- UCHAR ChannelNumber;
- USHORT RandomInterval;
- USHORT MeasurementDuration;
- UCHAR MeasurementMode;
- UCHAR BSSID[MAC_ADDR_LEN];
- UCHAR ReportingCondition;
- UCHAR Threshold;
- UCHAR SSIDIE[2]; // 2 byte
-} BEACON_REQUEST;
-
-typedef struct PACKED
-{
- UCHAR ID;
- UCHAR Length;
- UCHAR Token;
- UCHAR RequestMode;
- UCHAR Type;
-} MEASUREMENT_REQ;
-
-
-
-
-void convert_reordering_packet_to_preAMSDU_or_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- PNDIS_PACKET pRxPkt;
- UCHAR Header802_3[LENGTH_802_3];
-
- // 1. get 802.3 Header
- // 2. remove LLC
- // a. pointer pRxBlk->pData to payload
- // b. modify pRxBlk->DataSize
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
-
- ASSERT(pRxBlk->pRxPacket);
- pRxPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
-
- SET_OS_PKT_NETDEV(pRxPkt, get_netdev_from_bssid(pAd, FromWhichBSSID));
- SET_OS_PKT_DATAPTR(pRxPkt, pRxBlk->pData);
- SET_OS_PKT_LEN(pRxPkt, pRxBlk->DataSize);
- SET_OS_PKT_DATATAIL(pRxPkt, pRxBlk->pData, pRxBlk->DataSize);
-
- //
- // copy 802.3 header, if necessary
- //
- if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU))
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef LINUX
- NdisMoveMemory(skb_push(pRxPkt, LENGTH_802_3), Header802_3, LENGTH_802_3);
-#endif
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-}
-
-
-#define INDICATE_LEGACY_OR_AMSDU(_pAd, _pRxBlk, _fromWhichBSSID) \
- do \
- { \
- if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_AMSDU)) \
- { \
- Indicate_AMSDU_Packet(_pAd, _pRxBlk, _fromWhichBSSID); \
- } \
- else if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_EAP)) \
- { \
- Indicate_EAPOL_Packet(_pAd, _pRxBlk, _fromWhichBSSID); \
- } \
- else \
- { \
- Indicate_Legacy_Packet(_pAd, _pRxBlk, _fromWhichBSSID); \
- } \
- } while (0);
-
-
-
-static VOID ba_enqueue_reordering_packet(
- IN PRTMP_ADAPTER pAd,
- IN PBA_REC_ENTRY pBAEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- struct reordering_mpdu *mpdu_blk;
- UINT16 Sequence = (UINT16) pRxBlk->pHeader->Sequence;
-
- mpdu_blk = ba_mpdu_blk_alloc(pAd);
- if ((mpdu_blk != NULL) &&
- (!RX_BLK_TEST_FLAG(pRxBlk, fRX_EAP)))
- {
- // Write RxD buffer address & allocated buffer length
- NdisAcquireSpinLock(&pBAEntry->RxReRingLock);
-
- mpdu_blk->Sequence = Sequence;
-
- mpdu_blk->bAMSDU = RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU);
-
- convert_reordering_packet_to_preAMSDU_or_802_3_packet(pAd, pRxBlk, FromWhichBSSID);
-
- STATS_INC_RX_PACKETS(pAd, FromWhichBSSID);
-
- //
- // it is necessary for reordering packet to record
- // which BSS it come from
- //
- RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID);
-
- mpdu_blk->pPacket = pRxBlk->pRxPacket;
-
- if (ba_reordering_mpdu_insertsorted(&pBAEntry->list, mpdu_blk) == FALSE)
- {
- // had been already within reordering list
- // don't indicate
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_SUCCESS);
- ba_mpdu_blk_free(pAd, mpdu_blk);
- }
-
- ASSERT((0<= pBAEntry->list.qlen) && (pBAEntry->list.qlen <= pBAEntry->BAWinSize));
- NdisReleaseSpinLock(&pBAEntry->RxReRingLock);
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("!!! (%d) Can't allocate reordering mpdu blk\n",
- pBAEntry->list.qlen));
- /*
- * flush all pending reordering mpdus
- * and receving mpdu to upper layer
- * make tcp/ip to take care reordering mechanism
- */
- //ba_refresh_reordering_mpdus(pAd, pBAEntry);
- ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, Sequence);
-
- pBAEntry->LastIndSeq = Sequence;
- INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
- }
-}
-
-
-/*
- ==========================================================================
- Description:
- Indicate this packet to upper layer or put it into reordering buffer
-
- Parametrs:
- pRxBlk : carry necessary packet info 802.11 format
- FromWhichBSSID : the packet received from which BSS
-
- Return :
- none
-
- Note :
- the packet queued into reordering buffer need to cover to 802.3 format
- or pre_AMSDU format
- ==========================================================================
- */
-
-VOID Indicate_AMPDU_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- USHORT Idx;
- PBA_REC_ENTRY pBAEntry = NULL;
- UINT16 Sequence = pRxBlk->pHeader->Sequence;
- ULONG Now32;
- UCHAR Wcid = pRxBlk->pRxWI->WirelessCliID;
- UCHAR TID = pRxBlk->pRxWI->TID;
-
-
- if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU) && (pRxBlk->DataSize > MAX_RX_PKT_LEN))
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
-
-
- if (Wcid < MAX_LEN_OF_MAC_TABLE)
- {
- Idx = pAd->MacTab.Content[Wcid].BARecWcidArray[TID];
- if (Idx == 0)
- {
- /* Rec BA Session had been torn down */
- INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
- return;
- }
- pBAEntry = &pAd->BATable.BARecEntry[Idx];
- }
- else
- {
- // impossible !!!
- ASSERT(0);
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- ASSERT(pBAEntry);
-
- // update last rx time
- NdisGetSystemUpTime(&Now32);
-
- pBAEntry->rcvSeq = Sequence;
-
-
- ba_flush_reordering_timeout_mpdus(pAd, pBAEntry, Now32);
- pBAEntry->LastIndSeqAtTimer = Now32;
-
- //
- // Reset Last Indicate Sequence
- //
- if (pBAEntry->LastIndSeq == RESET_RCV_SEQ)
- {
- ASSERT((pBAEntry->list.qlen == 0) && (pBAEntry->list.next == NULL));
-
- // reset rcv sequence of BA session
- pBAEntry->LastIndSeq = Sequence;
- pBAEntry->LastIndSeqAtTimer = Now32;
- INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
- return;
- }
-
- //
- // I. Check if in order.
- //
- if (SEQ_STEPONE(Sequence, pBAEntry->LastIndSeq, MAXSEQ))
- {
- USHORT LastIndSeq;
-
- pBAEntry->LastIndSeq = Sequence;
- INDICATE_LEGACY_OR_AMSDU(pAd, pRxBlk, FromWhichBSSID);
- LastIndSeq = ba_indicate_reordering_mpdus_in_order(pAd, pBAEntry, pBAEntry->LastIndSeq);
- if (LastIndSeq != RESET_RCV_SEQ)
- {
- pBAEntry->LastIndSeq = LastIndSeq;
- }
- pBAEntry->LastIndSeqAtTimer = Now32;
- }
- //
- // II. Drop Duplicated Packet
- //
- else if (Sequence == pBAEntry->LastIndSeq)
- {
-
- // drop and release packet
- pBAEntry->nDropPacket++;
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- }
- //
- // III. Drop Old Received Packet
- //
- else if (SEQ_SMALLER(Sequence, pBAEntry->LastIndSeq, MAXSEQ))
- {
-
- // drop and release packet
- pBAEntry->nDropPacket++;
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- }
- //
- // IV. Receive Sequence within Window Size
- //
- else if (SEQ_SMALLER(Sequence, (((pBAEntry->LastIndSeq+pBAEntry->BAWinSize+1)) & MAXSEQ), MAXSEQ))
- {
- ba_enqueue_reordering_packet(pAd, pBAEntry, pRxBlk, FromWhichBSSID);
- }
- //
- // V. Receive seq surpasses Win(lastseq + nMSDU). So refresh all reorder buffer
- //
- else
- {
- LONG WinStartSeq, TmpSeq;
-
-
- TmpSeq = Sequence - (pBAEntry->BAWinSize) -1;
- if (TmpSeq < 0)
- {
- TmpSeq = (MAXSEQ+1) + TmpSeq;
- }
- WinStartSeq = (TmpSeq+1) & MAXSEQ;
- ba_indicate_reordering_mpdus_le_seq(pAd, pBAEntry, WinStartSeq);
- pBAEntry->LastIndSeq = WinStartSeq; //TmpSeq;
-
- pBAEntry->LastIndSeqAtTimer = Now32;
-
- ba_enqueue_reordering_packet(pAd, pBAEntry, pRxBlk, FromWhichBSSID);
-
- TmpSeq = ba_indicate_reordering_mpdus_in_order(pAd, pBAEntry, pBAEntry->LastIndSeq);
- if (TmpSeq != RESET_RCV_SEQ)
- {
- pBAEntry->LastIndSeq = TmpSeq;
- }
- }
-}
-
-#endif // DOT11_N_SUPPORT //
diff --git a/drivers/staging/rt3090/common/cmm_data.c b/drivers/staging/rt3090/common/cmm_data.c
deleted file mode 100644
index 634007163160..000000000000
--- a/drivers/staging/rt3090/common/cmm_data.c
+++ /dev/null
@@ -1,2763 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- cmm_data.c
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
-
-#include "../rt_config.h"
-
-
-UCHAR SNAP_802_1H[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00};
-UCHAR SNAP_BRIDGE_TUNNEL[] = {0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8};
-// Add Cisco Aironet SNAP heade for CCX2 support
-UCHAR SNAP_AIRONET[] = {0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x00};
-UCHAR CKIP_LLC_SNAP[] = {0xaa, 0xaa, 0x03, 0x00, 0x40, 0x96, 0x00, 0x02};
-UCHAR EAPOL_LLC_SNAP[]= {0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e};
-UCHAR EAPOL[] = {0x88, 0x8e};
-UCHAR TPID[] = {0x81, 0x00}; /* VLAN related */
-
-UCHAR IPX[] = {0x81, 0x37};
-UCHAR APPLE_TALK[] = {0x80, 0xf3};
-UCHAR RateIdToPlcpSignal[12] = {
- 0, /* RATE_1 */ 1, /* RATE_2 */ 2, /* RATE_5_5 */ 3, /* RATE_11 */ // see BBP spec
- 11, /* RATE_6 */ 15, /* RATE_9 */ 10, /* RATE_12 */ 14, /* RATE_18 */ // see IEEE802.11a-1999 p.14
- 9, /* RATE_24 */ 13, /* RATE_36 */ 8, /* RATE_48 */ 12 /* RATE_54 */ }; // see IEEE802.11a-1999 p.14
-
-UCHAR OfdmSignalToRateId[16] = {
- RATE_54, RATE_54, RATE_54, RATE_54, // OFDM PLCP Signal = 0, 1, 2, 3 respectively
- RATE_54, RATE_54, RATE_54, RATE_54, // OFDM PLCP Signal = 4, 5, 6, 7 respectively
- RATE_48, RATE_24, RATE_12, RATE_6, // OFDM PLCP Signal = 8, 9, 10, 11 respectively
- RATE_54, RATE_36, RATE_18, RATE_9, // OFDM PLCP Signal = 12, 13, 14, 15 respectively
-};
-
-UCHAR OfdmRateToRxwiMCS[12] = {
- 0, 0, 0, 0,
- 0, 1, 2, 3, // OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3
- 4, 5, 6, 7, // OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7
-};
-UCHAR RxwiMCSToOfdmRate[12] = {
- RATE_6, RATE_9, RATE_12, RATE_18,
- RATE_24, RATE_36, RATE_48, RATE_54, // OFDM rate 6,9,12,18 = rxwi mcs 0,1,2,3
- 4, 5, 6, 7, // OFDM rate 24,36,48,54 = rxwi mcs 4,5,6,7
-};
-
-char* MCSToMbps[] = {"1Mbps","2Mbps","5.5Mbps","11Mbps","06Mbps","09Mbps","12Mbps","18Mbps","24Mbps","36Mbps","48Mbps","54Mbps","MM-0","MM-1","MM-2","MM-3","MM-4","MM-5","MM-6","MM-7","MM-8","MM-9","MM-10","MM-11","MM-12","MM-13","MM-14","MM-15","MM-32","ee1","ee2","ee3"};
-
-UCHAR default_cwmin[]={CW_MIN_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1, CW_MIN_IN_BITS-2};
-//UCHAR default_cwmax[]={CW_MAX_IN_BITS, CW_MAX_IN_BITS, CW_MIN_IN_BITS, CW_MIN_IN_BITS-1};
-UCHAR default_sta_aifsn[]={3,7,2,2};
-
-UCHAR MapUserPriorityToAccessCategory[8] = {QID_AC_BE, QID_AC_BK, QID_AC_BK, QID_AC_BE, QID_AC_VI, QID_AC_VI, QID_AC_VO, QID_AC_VO};
-
-
-/*
- ========================================================================
-
- Routine Description:
- API for MLME to transmit management frame to AP (BSS Mode)
- or station (IBSS Mode)
-
- Arguments:
- pAd Pointer to our adapter
- pData Pointer to the outgoing 802.11 frame
- Length Size of outgoing management frame
-
- Return Value:
- NDIS_STATUS_FAILURE
- NDIS_STATUS_PENDING
- NDIS_STATUS_SUCCESS
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS MiniportMMRequest(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PUCHAR pData,
- IN UINT Length)
-{
- PNDIS_PACKET pPacket;
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- ULONG FreeNum;
- UCHAR rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; //RTMP_HW_HDR_LEN];
-#ifdef RTMP_MAC_PCI
- unsigned long IrqFlags = 0;
- UCHAR IrqState;
-#endif // RTMP_MAC_PCI //
- BOOLEAN bUseDataQ = FALSE;
- int retryCnt = 0;
-
- ASSERT(Length <= MGMT_DMA_BUFFER_SIZE);
-
- if ((QueIdx & MGMT_USE_QUEUE_FLAG) == MGMT_USE_QUEUE_FLAG)
- {
- bUseDataQ = TRUE;
- QueIdx &= (~MGMT_USE_QUEUE_FLAG);
- }
-
-#ifdef RTMP_MAC_PCI
- // 2860C use Tx Ring
- IrqState = pAd->irq_disabled;
- if (pAd->MACVersion == 0x28600100)
- {
- QueIdx = (bUseDataQ ==TRUE ? QueIdx : 3);
- bUseDataQ = TRUE;
- }
- if (bUseDataQ && (!IrqState))
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
-#endif // RTMP_MAC_PCI //
-
- do
- {
- // Reset is in progress, stop immediately
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)||
- !RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
- {
- Status = NDIS_STATUS_FAILURE;
- break;
- }
-
- // Check Free priority queue
- // Since we use PBF Queue2 for management frame. Its corresponding DMA ring should be using TxRing.
-#ifdef RTMP_MAC_PCI
- if (bUseDataQ)
- {
- retryCnt = MAX_DATAMM_RETRY;
- // free Tx(QueIdx) resources
- RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
- FreeNum = GET_TXRING_FREENO(pAd, QueIdx);
- }
- else
-#endif // RTMP_MAC_PCI //
- {
- FreeNum = GET_MGMTRING_FREENO(pAd);
- }
-
- if ((FreeNum > 0))
- {
- // We need to reserve space for rtmp hardware header. i.e., TxWI for RT2860 and TxInfo+TxWI for RT2870
- NdisZeroMemory(&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE));
- Status = RTMPAllocateNdisPacket(pAd, &pPacket, (PUCHAR)&rtmpHwHdr, (TXINFO_SIZE + TXWI_SIZE), pData, Length);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_WARN, ("MiniportMMRequest (error:: can't allocate NDIS PACKET)\n"));
- break;
- }
-
- //pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
- //pAd->CommonCfg.MlmeRate = RATE_2;
-
-
-#ifdef RTMP_MAC_PCI
- if (bUseDataQ)
- {
- Status = MlmeDataHardTransmit(pAd, QueIdx, pPacket);
- retryCnt--;
- }
- else
-#endif // RTMP_MAC_PCI //
- Status = MlmeHardTransmit(pAd, QueIdx, pPacket);
- if (Status == NDIS_STATUS_SUCCESS)
- retryCnt = 0;
- else
- RTMPFreeNdisPacket(pAd, pPacket);
- }
- else
- {
- pAd->RalinkCounters.MgmtRingFullCount++;
-#ifdef RTMP_MAC_PCI
- if (bUseDataQ)
- {
- retryCnt--;
- DBGPRINT(RT_DEBUG_TRACE, ("retryCnt %d\n", retryCnt));
- if (retryCnt == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in DataRing, MgmtRingFullCount=%ld!\n",
- QueIdx, pAd->RalinkCounters.MgmtRingFullCount));
- }
- }
-#endif // RTMP_MAC_PCI //
- DBGPRINT(RT_DEBUG_ERROR, ("Qidx(%d), not enough space in MgmtRing, MgmtRingFullCount=%ld!\n",
- QueIdx, pAd->RalinkCounters.MgmtRingFullCount));
-
-
-
- }
- } while (retryCnt > 0);
-
-
-#ifdef RTMP_MAC_PCI
- if (bUseDataQ && (!IrqState))
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
-#endif // RTMP_MAC_PCI //
-
- return Status;
-}
-
-
-
-
-/*
- ========================================================================
-
- Routine Description:
- Copy frame from waiting queue into relative ring buffer and set
- appropriate ASIC register to kick hardware transmit function
-
- Arguments:
- pAd Pointer to our adapter
- pBuffer Pointer to memory of outgoing frame
- Length Size of outgoing management frame
-
- Return Value:
- NDIS_STATUS_FAILURE
- NDIS_STATUS_PENDING
- NDIS_STATUS_SUCCESS
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS MlmeHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket)
-{
- PACKET_INFO PacketInfo;
- PUCHAR pSrcBufVA;
- UINT SrcBufLen;
- PHEADER_802_11 pHeader_802_11;
-
- if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
-#ifdef CARRIER_DETECTION_SUPPORT
-#endif // CARRIER_DETECTION_SUPPORT //
- )
- {
- return NDIS_STATUS_FAILURE;
- }
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
- if (pSrcBufVA == NULL)
- return NDIS_STATUS_FAILURE;
-
- pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE);
-
-
-#ifdef RTMP_MAC_PCI
- if ( pAd->MACVersion == 0x28600100 )
- return MlmeHardTransmitTxRing(pAd,QueIdx,pPacket);
- else
-#endif // RTMP_MAC_PCI //
- return MlmeHardTransmitMgmtRing(pAd,QueIdx,pPacket);
-
-}
-
-
-NDIS_STATUS MlmeHardTransmitMgmtRing(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket)
-{
- PACKET_INFO PacketInfo;
- PUCHAR pSrcBufVA;
- UINT SrcBufLen;
- PHEADER_802_11 pHeader_802_11;
- BOOLEAN bAckRequired, bInsertTimestamp;
- UCHAR MlmeRate;
- PTXWI_STRUC pFirstTxWI;
- MAC_TABLE_ENTRY *pMacEntry = NULL;
- UCHAR PID;
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
-
- // Make sure MGMT ring resource won't be used by other threads
- RTMP_SEM_LOCK(&pAd->MgmtRingLock);
- if (pSrcBufVA == NULL)
- {
- // The buffer shouldn't be NULL
- RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
- return NDIS_STATUS_FAILURE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // outgoing frame always wakeup PHY to prevent frame lost
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- AsicForceWakeup(pAd, TRUE);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- pFirstTxWI = (PTXWI_STRUC)(pSrcBufVA + TXINFO_SIZE);
- pHeader_802_11 = (PHEADER_802_11) (pSrcBufVA + TXINFO_SIZE + TXWI_SIZE); //TXWI_SIZE);
-
- if (pHeader_802_11->Addr1[0] & 0x01)
- {
- MlmeRate = pAd->CommonCfg.BasicMlmeRate;
- }
- else
- {
- MlmeRate = pAd->CommonCfg.MlmeRate;
- }
-
- // Verify Mlme rate for a / g bands.
- if ((pAd->LatchRfRegs.Channel > 14) && (MlmeRate < RATE_6)) // 11A band
- MlmeRate = RATE_6;
-
- if ((pHeader_802_11->FC.Type == BTYPE_DATA) &&
- (pHeader_802_11->FC.SubType == SUBTYPE_QOS_NULL))
- {
- pMacEntry = MacTableLookup(pAd, pHeader_802_11->Addr1);
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Fixed W52 with Activity scan issue in ABG_MIXED and ABGN_MIXED mode.
- if (pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED
-#ifdef DOT11_N_SUPPORT
- || pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED
-#endif // DOT11_N_SUPPORT //
- )
- {
- if (pAd->LatchRfRegs.Channel > 14)
- pAd->CommonCfg.MlmeTransmit.field.MODE = 1;
- else
- pAd->CommonCfg.MlmeTransmit.field.MODE = 0;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- //
- // Should not be hard code to set PwrMgmt to 0 (PWR_ACTIVE)
- // Snice it's been set to 0 while on MgtMacHeaderInit
- // By the way this will cause frame to be send on PWR_SAVE failed.
- //
- pHeader_802_11->FC.PwrMgmt = PWR_ACTIVE; // (pAd->StaCfg.Psm == PWR_SAVE);
-
-#ifdef CONFIG_STA_SUPPORT
- //
- // In WMM-UAPSD, mlme frame should be set psm as power saving but probe request frame
- // Data-Null packets alse pass through MMRequest in RT2860, however, we hope control the psm bit to pass APSD
-// if ((pHeader_802_11->FC.Type != BTYPE_DATA) && (pHeader_802_11->FC.Type != BTYPE_CNTL))
- {
- if ((pHeader_802_11->FC.SubType == SUBTYPE_ACTION) ||
- ((pHeader_802_11->FC.Type == BTYPE_DATA) &&
- ((pHeader_802_11->FC.SubType == SUBTYPE_QOS_NULL) ||
- (pHeader_802_11->FC.SubType == SUBTYPE_NULL_FUNC))))
- {
- if (pAd->StaCfg.Psm == PWR_SAVE)
- pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
- else
- pHeader_802_11->FC.PwrMgmt = pAd->CommonCfg.bAPSDForcePowerSave;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-
-
- bInsertTimestamp = FALSE;
- if (pHeader_802_11->FC.Type == BTYPE_CNTL) // must be PS-POLL
- {
-#ifdef CONFIG_STA_SUPPORT
- //Set PM bit in ps-poll, to fix WLK 1.2 PowerSaveMode_ext failure issue.
- if ((pAd->OpMode == OPMODE_STA) && (pHeader_802_11->FC.SubType == SUBTYPE_PS_POLL))
- {
- pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
- }
-#endif // CONFIG_STA_SUPPORT //
- bAckRequired = FALSE;
- }
- else // BTYPE_MGMT or BTYPE_DATA(must be NULL frame)
- {
- //pAd->Sequence++;
- //pHeader_802_11->Sequence = pAd->Sequence;
-
- if (pHeader_802_11->Addr1[0] & 0x01) // MULTICAST, BROADCAST
- {
- bAckRequired = FALSE;
- pHeader_802_11->Duration = 0;
- }
- else
- {
- bAckRequired = TRUE;
- pHeader_802_11->Duration = RTMPCalcDuration(pAd, MlmeRate, 14);
- if ((pHeader_802_11->FC.SubType == SUBTYPE_PROBE_RSP) && (pHeader_802_11->FC.Type == BTYPE_MGMT))
- {
- bInsertTimestamp = TRUE;
- bAckRequired = FALSE; // Disable ACK to prevent retry 0x1f for Probe Response
- }
- else if ((pHeader_802_11->FC.SubType == SUBTYPE_PROBE_REQ) && (pHeader_802_11->FC.Type == BTYPE_MGMT))
- {
- bAckRequired = FALSE; // Disable ACK to prevent retry 0x1f for Probe Request
- }
- }
- }
-
- pHeader_802_11->Sequence = pAd->Sequence++;
- if (pAd->Sequence >0xfff)
- pAd->Sequence = 0;
-
- // Before radar detection done, mgmt frame can not be sent but probe req
- // Because we need to use probe req to trigger driver to send probe req in passive scan
- if ((pHeader_802_11->FC.SubType != SUBTYPE_PROBE_REQ)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE))
- {
- DBGPRINT(RT_DEBUG_ERROR,("MlmeHardTransmit --> radar detect not in normal mode !!!\n"));
-// if (!IrqState)
- RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
- return (NDIS_STATUS_FAILURE);
- }
-
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pHeader_802_11, DIR_WRITE, FALSE);
-#endif
-
- //
- // fill scatter-and-gather buffer list into TXD. Internally created NDIS PACKET
- // should always has only one physical buffer, and the whole frame size equals
- // to the first scatter buffer size
- //
-
- // Initialize TX Descriptor
- // For inter-frame gap, the number is for this frame and next frame
- // For MLME rate, we will fix as 2Mb to match other vendor's implement
-// pAd->CommonCfg.MlmeTransmit.field.MODE = 1;
-
-// management frame doesn't need encryption. so use RESERVED_WCID no matter u are sending to specific wcid or not.
- PID = PID_MGMT;
-
-
- if (pMacEntry == NULL)
- {
- RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE, bInsertTimestamp, FALSE, bAckRequired, FALSE,
- 0, RESERVED_WCID, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE), PID, 0, (UCHAR)pAd->CommonCfg.MlmeTransmit.field.MCS, IFS_BACKOFF, FALSE, &pAd->CommonCfg.MlmeTransmit);
- }
- else
- {
- /* dont use low rate to send QoS Null data frame */
- RTMPWriteTxWI(pAd, pFirstTxWI, FALSE, FALSE,
- bInsertTimestamp, FALSE, bAckRequired, FALSE,
- 0, pMacEntry->Aid, (SrcBufLen - TXINFO_SIZE - TXWI_SIZE),
- pMacEntry->MaxHTPhyMode.field.MCS, 0,
- (UCHAR)pMacEntry->MaxHTPhyMode.field.MCS,
- IFS_BACKOFF, FALSE, &pMacEntry->MaxHTPhyMode);
- }
-
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)pFirstTxWI, TYPE_TXWI);
-#endif
-
- // Now do hardware-depened kick out.
- HAL_KickOutMgmtTx(pAd, QueIdx, pPacket, pSrcBufVA, SrcBufLen);
-
- // Make sure to release MGMT ring resource
-// if (!IrqState)
- RTMP_SEM_UNLOCK(&pAd->MgmtRingLock);
- return NDIS_STATUS_SUCCESS;
-}
-
-
-/********************************************************************************
-
- New DeQueue Procedures.
-
- ********************************************************************************/
-
-#define DEQUEUE_LOCK(lock, bIntContext, IrqFlags) \
- do{ \
- if (bIntContext == FALSE) \
- RTMP_IRQ_LOCK((lock), IrqFlags); \
- }while(0)
-
-#define DEQUEUE_UNLOCK(lock, bIntContext, IrqFlags) \
- do{ \
- if (bIntContext == FALSE) \
- RTMP_IRQ_UNLOCK((lock), IrqFlags); \
- }while(0)
-
-
-
-
-/*
- ========================================================================
- Tx Path design algorithm:
- Basically, we divide the packets into four types, Broadcast/Multicast, 11N Rate(AMPDU, AMSDU, Normal), B/G Rate(ARALINK, Normal),
- Specific Packet Type. Following show the classification rule and policy for each kinds of packets.
- Classification Rule=>
- Multicast: (*addr1 & 0x01) == 0x01
- Specific : bDHCPFrame, bARPFrame, bEAPOLFrame, etc.
- 11N Rate : If peer support HT
- (1).AMPDU -- If TXBA is negotiated.
- (2).AMSDU -- If AMSDU is capable for both peer and ourself.
- *). AMSDU can embedded in a AMPDU, but now we didn't support it.
- (3).Normal -- Other packets which send as 11n rate.
-
- B/G Rate : If peer is b/g only.
- (1).ARALINK-- If both of peer/us supprot Ralink proprietary Aggregation and the TxRate is large than RATE_6
- (2).Normal -- Other packets which send as b/g rate.
- Fragment:
- The packet must be unicast, NOT A-RALINK, NOT A-MSDU, NOT 11n, then can consider about fragment.
-
- Classified Packet Handle Rule=>
- Multicast:
- No ACK, //pTxBlk->bAckRequired = FALSE;
- No WMM, //pTxBlk->bWMM = FALSE;
- No piggyback, //pTxBlk->bPiggyBack = FALSE;
- Force LowRate, //pTxBlk->bForceLowRate = TRUE;
- Specific : Basically, for specific packet, we should handle it specifically, but now all specific packets are use
- the same policy to handle it.
- Force LowRate, //pTxBlk->bForceLowRate = TRUE;
-
- 11N Rate :
- No piggyback, //pTxBlk->bPiggyBack = FALSE;
-
- (1).AMSDU
- pTxBlk->bWMM = TRUE;
- (2).AMPDU
- pTxBlk->bWMM = TRUE;
- (3).Normal
-
- B/G Rate :
- (1).ARALINK
-
- (2).Normal
- ========================================================================
-*/
-static UCHAR TxPktClassification(
- IN RTMP_ADAPTER *pAd,
- IN PNDIS_PACKET pPacket)
-{
- UCHAR TxFrameType = TX_UNKOWN_FRAME;
- UCHAR Wcid;
- MAC_TABLE_ENTRY *pMacEntry = NULL;
-#ifdef DOT11_N_SUPPORT
- BOOLEAN bHTRate = FALSE;
-#endif // DOT11_N_SUPPORT //
-
- Wcid = RTMP_GET_PACKET_WCID(pPacket);
- if (Wcid == MCAST_WCID)
- { // Handle for RA is Broadcast/Multicast Address.
- return TX_MCAST_FRAME;
- }
-
- // Handle for unicast packets
- pMacEntry = &pAd->MacTab.Content[Wcid];
- if (RTMP_GET_PACKET_LOWRATE(pPacket))
- { // It's a specific packet need to force low rate, i.e., bDHCPFrame, bEAPOLFrame, bWAIFrame
- TxFrameType = TX_LEGACY_FRAME;
- }
-#ifdef DOT11_N_SUPPORT
- else if (IS_HT_RATE(pMacEntry))
- { // it's a 11n capable packet
-
- // Depends on HTPhyMode to check if the peer support the HTRate transmission.
- // Currently didn't support A-MSDU embedded in A-MPDU
- bHTRate = TRUE;
- if (RTMP_GET_PACKET_MOREDATA(pPacket) || (pMacEntry->PsMode == PWR_SAVE))
- TxFrameType = TX_LEGACY_FRAME;
-#ifdef UAPSD_AP_SUPPORT
- else if (RTMP_GET_PACKET_EOSP(pPacket))
- TxFrameType = TX_LEGACY_FRAME;
-#endif // UAPSD_AP_SUPPORT //
- else if((pMacEntry->TXBAbitmap & (1<<(RTMP_GET_PACKET_UP(pPacket)))) != 0)
- return TX_AMPDU_FRAME;
- else if(CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_AMSDU_INUSED))
- return TX_AMSDU_FRAME;
- else
- TxFrameType = TX_LEGACY_FRAME;
- }
-#endif // DOT11_N_SUPPORT //
- else
- { // it's a legacy b/g packet.
- if ((CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE) && pAd->CommonCfg.bAggregationCapable) &&
- (RTMP_GET_PACKET_TXRATE(pPacket) >= RATE_6) &&
- (!(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) && CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))))
- { // if peer support Ralink Aggregation, we use it.
- TxFrameType = TX_RALINK_FRAME;
- }
- else
- {
- TxFrameType = TX_LEGACY_FRAME;
- }
- }
-
- // Currently, our fragment only support when a unicast packet send as NOT-ARALINK, NOT-AMSDU and NOT-AMPDU.
- if ((RTMP_GET_PACKET_FRAGMENTS(pPacket) > 1) && (TxFrameType == TX_LEGACY_FRAME))
- TxFrameType = TX_FRAG_FRAME;
-
- return TxFrameType;
-}
-
-
-BOOLEAN RTMP_FillTxBlkInfo(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk)
-{
- PACKET_INFO PacketInfo;
- PNDIS_PACKET pPacket;
- PMAC_TABLE_ENTRY pMacEntry = NULL;
-
- pPacket = pTxBlk->pPacket;
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pTxBlk->pSrcBufHeader, &pTxBlk->SrcBufLen);
-
- pTxBlk->Wcid = RTMP_GET_PACKET_WCID(pPacket);
- pTxBlk->apidx = RTMP_GET_PACKET_IF(pPacket);
- pTxBlk->UserPriority = RTMP_GET_PACKET_UP(pPacket);
- pTxBlk->FrameGap = IFS_HTTXOP; // ASIC determine Frame Gap
-
- if (RTMP_GET_PACKET_CLEAR_EAP_FRAME(pTxBlk->pPacket))
- TX_BLK_SET_FLAG(pTxBlk, fTX_bClearEAPFrame);
- else
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bClearEAPFrame);
-
- // Default to clear this flag
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bForceNonQoS);
-
-
- if (pTxBlk->Wcid == MCAST_WCID)
- {
- pTxBlk->pMacEntry = NULL;
- {
-#ifdef MCAST_RATE_SPECIFIC
- PUCHAR pDA = GET_OS_PKT_DATAPTR(pPacket);
- if (((*pDA & 0x01) == 0x01) && (*pDA != 0xff))
- pTxBlk->pTransmit = &pAd->CommonCfg.MCastPhyMode;
- else
-#endif // MCAST_RATE_SPECIFIC //
- pTxBlk->pTransmit = &pAd->MacTab.Content[MCAST_WCID].HTPhyMode;
- }
-
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bAckRequired); // AckRequired = FALSE, when broadcast packet in Adhoc mode.
- //TX_BLK_SET_FLAG(pTxBlk, fTX_bForceLowRate);
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bAllowFrag);
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bWMM);
- if (RTMP_GET_PACKET_MOREDATA(pPacket))
- {
- TX_BLK_SET_FLAG(pTxBlk, fTX_bMoreData);
- }
-
- }
- else
- {
- pTxBlk->pMacEntry = &pAd->MacTab.Content[pTxBlk->Wcid];
- pTxBlk->pTransmit = &pTxBlk->pMacEntry->HTPhyMode;
-
- pMacEntry = pTxBlk->pMacEntry;
-
-
- // For all unicast packets, need Ack unless the Ack Policy is not set as NORMAL_ACK.
- if (pAd->CommonCfg.AckPolicy[pTxBlk->QueIdx] != NORMAL_ACK)
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bAckRequired);
- else
- TX_BLK_SET_FLAG(pTxBlk, fTX_bAckRequired);
-
-#ifdef CONFIG_STA_SUPPORT
- if ((pAd->OpMode == OPMODE_STA) &&
- (ADHOC_ON(pAd)) &&
- (RX_FILTER_TEST_FLAG(pAd, fRX_FILTER_ACCEPT_PROMISCUOUS)))
- {
- if(pAd->CommonCfg.PSPXlink)
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bAckRequired);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-
- // If support WMM, enable it.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
- CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))
- TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM);
-
-// if (pAd->StaCfg.bAutoTxRateSwitch)
-// TX_BLK_SET_FLAG(pTxBlk, fTX_AutoRateSwitch);
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- if (pTxBlk->TxFrameType == TX_LEGACY_FRAME)
- {
- if ( (RTMP_GET_PACKET_LOWRATE(pPacket)) ||
- ((pAd->OpMode == OPMODE_AP) && (pMacEntry->MaxHTPhyMode.field.MODE == MODE_CCK) && (pMacEntry->MaxHTPhyMode.field.MCS == RATE_1)))
- { // Specific packet, i.e., bDHCPFrame, bEAPOLFrame, bWAIFrame, need force low rate.
- pTxBlk->pTransmit = &pAd->MacTab.Content[MCAST_WCID].HTPhyMode;
-#ifdef DOT11_N_SUPPORT
- // Modify the WMM bit for ICV issue. If we have a packet with EOSP field need to set as 1, how to handle it???
- if (IS_HT_STA(pTxBlk->pMacEntry) &&
- (CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_RALINK_CHIPSET)) &&
- ((pAd->CommonCfg.bRdg == TRUE) && CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_RDG_CAPABLE)))
- {
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bWMM);
- TX_BLK_SET_FLAG(pTxBlk, fTX_bForceNonQoS);
- }
-#endif // DOT11_N_SUPPORT //
- }
-
-#ifdef DOT11_N_SUPPORT
- if ( (IS_HT_RATE(pMacEntry) == FALSE) &&
- (CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_PIGGYBACK_CAPABLE)))
- { // Currently piggy-back only support when peer is operate in b/g mode.
- TX_BLK_SET_FLAG(pTxBlk, fTX_bPiggyBack);
- }
-#endif // DOT11_N_SUPPORT //
-
- if (RTMP_GET_PACKET_MOREDATA(pPacket))
- {
- TX_BLK_SET_FLAG(pTxBlk, fTX_bMoreData);
- }
-#ifdef UAPSD_AP_SUPPORT
- if (RTMP_GET_PACKET_EOSP(pPacket))
- {
- TX_BLK_SET_FLAG(pTxBlk, fTX_bWMM_UAPSD_EOSP);
- }
-#endif // UAPSD_AP_SUPPORT //
- }
- else if (pTxBlk->TxFrameType == TX_FRAG_FRAME)
- {
- TX_BLK_SET_FLAG(pTxBlk, fTX_bAllowFrag);
- }
-
- pMacEntry->DebugTxCount++;
- }
-
- return TRUE;
-}
-
-
-BOOLEAN CanDoAggregateTransmit(
- IN RTMP_ADAPTER *pAd,
- IN NDIS_PACKET *pPacket,
- IN TX_BLK *pTxBlk)
-{
-
- //DBGPRINT(RT_DEBUG_TRACE, ("Check if can do aggregation! TxFrameType=%d!\n", pTxBlk->TxFrameType));
-
- if (RTMP_GET_PACKET_WCID(pPacket) == MCAST_WCID)
- return FALSE;
-
- if (RTMP_GET_PACKET_DHCP(pPacket) ||
- RTMP_GET_PACKET_EAPOL(pPacket) ||
- RTMP_GET_PACKET_WAI(pPacket))
- return FALSE;
-
- if ((pTxBlk->TxFrameType == TX_AMSDU_FRAME) &&
- ((pTxBlk->TotalFrameLen + GET_OS_PKT_LEN(pPacket))> (RX_BUFFER_AGGRESIZE - 100)))
- { // For AMSDU, allow the packets with total length < max-amsdu size
- return FALSE;
- }
-
- if ((pTxBlk->TxFrameType == TX_RALINK_FRAME) &&
- (pTxBlk->TxPacketList.Number == 2))
- { // For RALINK-Aggregation, allow two frames in one batch.
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- if ((INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA)) // must be unicast to AP
- return TRUE;
- else
-#endif // CONFIG_STA_SUPPORT //
- return FALSE;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- To do the enqueue operation and extract the first item of waiting
- list. If a number of available shared memory segments could meet
- the request of extracted item, the extracted item will be fragmented
- into shared memory segments.
-
- Arguments:
- pAd Pointer to our adapter
- pQueue Pointer to Waiting Queue
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPDeQueuePacket(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bIntContext,
- IN UCHAR QIdx, /* BulkOutPipeId */
- IN UCHAR Max_Tx_Packets)
-{
- PQUEUE_ENTRY pEntry = NULL;
- PNDIS_PACKET pPacket;
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- UCHAR Count=0;
- PQUEUE_HEADER pQueue;
- ULONG FreeNumber[NUM_OF_TX_RING];
- UCHAR QueIdx, sQIdx, eQIdx;
- unsigned long IrqFlags = 0;
- BOOLEAN hasTxDesc = FALSE;
- TX_BLK TxBlk;
- TX_BLK *pTxBlk;
-
-#ifdef DBG_DIAGNOSE
- BOOLEAN firstRound;
- RtmpDiagStruct *pDiagStruct = &pAd->DiagStruct;
-#endif
-
-
- if (QIdx == NUM_OF_TX_RING)
- {
- sQIdx = 0;
- eQIdx = 3; // 4 ACs, start from 0.
- }
- else
- {
- sQIdx = eQIdx = QIdx;
- }
-
- for (QueIdx=sQIdx; QueIdx <= eQIdx; QueIdx++)
- {
- Count=0;
-
- RTMP_START_DEQUEUE(pAd, QueIdx, IrqFlags);
-
-#ifdef DBG_DIAGNOSE
- firstRound = ((QueIdx == 0) ? TRUE : FALSE);
-#endif // DBG_DIAGNOSE //
-
- while (1)
- {
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS |
- fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST))))
- {
- RTMP_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
- return;
- }
-
- if (Count >= Max_Tx_Packets)
- break;
-
- DEQUEUE_LOCK(&pAd->irq_lock, bIntContext, IrqFlags);
- if (&pAd->TxSwQueue[QueIdx] == NULL)
- {
-#ifdef DBG_DIAGNOSE
- if (firstRound == TRUE)
- pDiagStruct->TxSWQueCnt[pDiagStruct->ArrayCurIdx][0]++;
-#endif // DBG_DIAGNOSE //
- DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
- break;
- }
-
-#ifdef RTMP_MAC_PCI
- FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
-
-#ifdef DBG_DIAGNOSE
- if (firstRound == TRUE)
- {
- UCHAR txDescNumLevel, txSwQNumLevel;
-
- txDescNumLevel = (TX_RING_SIZE - FreeNumber[QueIdx]); // Number of occupied hw desc.
- txDescNumLevel = ((txDescNumLevel <=15) ? txDescNumLevel : 15);
- pDiagStruct->TxDescCnt[pDiagStruct->ArrayCurIdx][txDescNumLevel]++;
-
- txSwQNumLevel = ((pAd->TxSwQueue[QueIdx].Number <=7) ? pAd->TxSwQueue[QueIdx].Number : 8);
- pDiagStruct->TxSWQueCnt[pDiagStruct->ArrayCurIdx][txSwQNumLevel]++;
-
- firstRound = FALSE;
- }
-#endif // DBG_DIAGNOSE //
-
- if (FreeNumber[QueIdx] <= 5)
- {
- // free Tx(QueIdx) resources
- RTMPFreeTXDUponTxDmaDone(pAd, QueIdx);
- FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
- }
-#endif // RTMP_MAC_PCI //
-
- // probe the Queue Head
- pQueue = &pAd->TxSwQueue[QueIdx];
- if ((pEntry = pQueue->Head) == NULL)
- {
- DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
- break;
- }
-
- pTxBlk = &TxBlk;
- NdisZeroMemory((PUCHAR)pTxBlk, sizeof(TX_BLK));
- //InitializeQueueHeader(&pTxBlk->TxPacketList); // Didn't need it because we already memzero it.
- pTxBlk->QueIdx = QueIdx;
-
- pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
-
-
- // Early check to make sure we have enoguh Tx Resource.
- hasTxDesc = RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
- if (!hasTxDesc)
- {
- pAd->PrivateInfo.TxRingFullCnt++;
-
- DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
-
- break;
- }
-
- pTxBlk->TxFrameType = TxPktClassification(pAd, pPacket);
- pEntry = RemoveHeadQueue(pQueue);
- pTxBlk->TotalFrameNum++;
- pTxBlk->TotalFragNum += RTMP_GET_PACKET_FRAGMENTS(pPacket); // The real fragment number maybe vary
- pTxBlk->TotalFrameLen += GET_OS_PKT_LEN(pPacket);
- pTxBlk->pPacket = pPacket;
- InsertTailQueue(&pTxBlk->TxPacketList, PACKET_TO_QUEUE_ENTRY(pPacket));
-
- if (pTxBlk->TxFrameType == TX_RALINK_FRAME || pTxBlk->TxFrameType == TX_AMSDU_FRAME)
- {
- // Enhance SW Aggregation Mechanism
- if (NEED_QUEUE_BACK_FOR_AGG(pAd, QueIdx, FreeNumber[QueIdx], pTxBlk->TxFrameType))
- {
- InsertHeadQueue(pQueue, PACKET_TO_QUEUE_ENTRY(pPacket));
- DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
- break;
- }
-
- do{
- if((pEntry = pQueue->Head) == NULL)
- break;
-
- // For TX_AMSDU_FRAME/TX_RALINK_FRAME, Need to check if next pakcet can do aggregation.
- pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
- FreeNumber[QueIdx] = GET_TXRING_FREENO(pAd, QueIdx);
- hasTxDesc = RTMP_HAS_ENOUGH_FREE_DESC(pAd, pTxBlk, FreeNumber[QueIdx], pPacket);
- if ((hasTxDesc == FALSE) || (CanDoAggregateTransmit(pAd, pPacket, pTxBlk) == FALSE))
- break;
-
- //Remove the packet from the TxSwQueue and insert into pTxBlk
- pEntry = RemoveHeadQueue(pQueue);
- ASSERT(pEntry);
- pPacket = QUEUE_ENTRY_TO_PACKET(pEntry);
- pTxBlk->TotalFrameNum++;
- pTxBlk->TotalFragNum += RTMP_GET_PACKET_FRAGMENTS(pPacket); // The real fragment number maybe vary
- pTxBlk->TotalFrameLen += GET_OS_PKT_LEN(pPacket);
- InsertTailQueue(&pTxBlk->TxPacketList, PACKET_TO_QUEUE_ENTRY(pPacket));
- }while(1);
-
- if (pTxBlk->TxPacketList.Number == 1)
- pTxBlk->TxFrameType = TX_LEGACY_FRAME;
- }
-
-
- Count += pTxBlk->TxPacketList.Number;
-
-
- // Do HardTransmit now.
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- Status = STAHardTransmit(pAd, pTxBlk, QueIdx);
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RTMP_MAC_PCI
- DEQUEUE_UNLOCK(&pAd->irq_lock, bIntContext, IrqFlags);
- // static rate also need NICUpdateFifoStaCounters() function.
- //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
- NICUpdateFifoStaCounters(pAd);
-#endif // RTMP_MAC_PCI //
-
- }
-
- RTMP_STOP_DEQUEUE(pAd, QueIdx, IrqFlags);
-
-
-#ifdef BLOCK_NET_IF
- if ((pAd->blockQueueTab[QueIdx].SwTxQueueBlockFlag == TRUE)
- && (pAd->TxSwQueue[QueIdx].Number < 1))
- {
- releaseNetIf(&pAd->blockQueueTab[QueIdx]);
- }
-#endif // BLOCK_NET_IF //
-
- }
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Calculates the duration which is required to transmit out frames
- with given size and specified rate.
-
- Arguments:
- pAd Pointer to our adapter
- Rate Transmit rate
- Size Frame size in units of byte
-
- Return Value:
- Duration number in units of usec
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-USHORT RTMPCalcDuration(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Rate,
- IN ULONG Size)
-{
- ULONG Duration = 0;
-
- if (Rate < RATE_FIRST_OFDM_RATE) // CCK
- {
- if ((Rate > RATE_1) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED))
- Duration = 96; // 72+24 preamble+plcp
- else
- Duration = 192; // 144+48 preamble+plcp
-
- Duration += (USHORT)((Size << 4) / RateIdTo500Kbps[Rate]);
- if ((Size << 4) % RateIdTo500Kbps[Rate])
- Duration ++;
- }
- else if (Rate <= RATE_LAST_OFDM_RATE)// OFDM rates
- {
- Duration = 20 + 6; // 16+4 preamble+plcp + Signal Extension
- Duration += 4 * (USHORT)((11 + Size * 4) / RateIdTo500Kbps[Rate]);
- if ((11 + Size * 4) % RateIdTo500Kbps[Rate])
- Duration += 4;
- }
- else //mimo rate
- {
- Duration = 20 + 6; // 16+4 preamble+plcp + Signal Extension
- }
-
- return (USHORT)Duration;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Calculates the duration which is required to transmit out frames
- with given size and specified rate.
-
- Arguments:
- pTxWI Pointer to head of each MPDU to HW.
- Ack Setting for Ack requirement bit
- Fragment Setting for Fragment bit
- RetryMode Setting for retry mode
- Ifs Setting for IFS gap
- Rate Setting for transmit rate
- Service Setting for service
- Length Frame length
- TxPreamble Short or Long preamble when using CCK rates
- QueIdx - 0-3, according to 802.11e/d4.4 June/2003
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- See also : BASmartHardTransmit() !!!
-
- ========================================================================
-*/
-VOID RTMPWriteTxWI(
- IN PRTMP_ADAPTER pAd,
- IN PTXWI_STRUC pOutTxWI,
- IN BOOLEAN FRAG,
- IN BOOLEAN CFACK,
- IN BOOLEAN InsTimestamp,
- IN BOOLEAN AMPDU,
- IN BOOLEAN Ack,
- IN BOOLEAN NSeq, // HW new a sequence.
- IN UCHAR BASize,
- IN UCHAR WCID,
- IN ULONG Length,
- IN UCHAR PID,
- IN UCHAR TID,
- IN UCHAR TxRate,
- IN UCHAR Txopmode,
- IN BOOLEAN CfAck,
- IN HTTRANSMIT_SETTING *pTransmit)
-{
- PMAC_TABLE_ENTRY pMac = NULL;
- TXWI_STRUC TxWI;
- PTXWI_STRUC pTxWI;
-
- if (WCID < MAX_LEN_OF_MAC_TABLE)
- pMac = &pAd->MacTab.Content[WCID];
-
- //
- // Always use Long preamble before verifiation short preamble functionality works well.
- // Todo: remove the following line if short preamble functionality works
- //
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
- NdisZeroMemory(&TxWI, TXWI_SIZE);
- pTxWI = &TxWI;
-
- pTxWI->FRAG= FRAG;
-
- pTxWI->CFACK = CFACK;
- pTxWI->TS= InsTimestamp;
- pTxWI->AMPDU = AMPDU;
- pTxWI->ACK = Ack;
- pTxWI->txop= Txopmode;
-
- pTxWI->NSEQ = NSeq;
- // John tune the performace with Intel Client in 20 MHz performance
-#ifdef DOT11_N_SUPPORT
- BASize = pAd->CommonCfg.TxBASize;
- if (pAd->MACVersion == 0x28720200)
- {
- if( BASize >13 )
- BASize =13;
- }
- else
- {
- if( BASize >7 )
- BASize =7;
- }
- pTxWI->BAWinSize = BASize;
- pTxWI->ShortGI = pTransmit->field.ShortGI;
- pTxWI->STBC = pTransmit->field.STBC;
-#endif // DOT11_N_SUPPORT //
-
- pTxWI->WirelessCliID = WCID;
- pTxWI->MPDUtotalByteCount = Length;
- pTxWI->PacketId = PID;
-
- // If CCK or OFDM, BW must be 20
- pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- if (pTxWI->BW)
- pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
- pTxWI->MCS = pTransmit->field.MCS;
- pTxWI->PHYMODE = pTransmit->field.MODE;
- pTxWI->CFACK = CfAck;
-
-#ifdef DOT11_N_SUPPORT
- if (pMac)
- {
- if (pAd->CommonCfg.bMIMOPSEnable)
- {
- if ((pMac->MmpsMode == MMPS_DYNAMIC) && (pTransmit->field.MCS > 7))
- {
- // Dynamic MIMO Power Save Mode
- pTxWI->MIMOps = 1;
- }
- else if (pMac->MmpsMode == MMPS_STATIC)
- {
- // Static MIMO Power Save Mode
- if (pTransmit->field.MODE >= MODE_HTMIX && pTransmit->field.MCS > 7)
- {
- pTxWI->MCS = 7;
- pTxWI->MIMOps = 0;
- }
- }
- }
- //pTxWI->MIMOps = (pMac->PsMode == PWR_MMPS)? 1:0;
- if (pMac->bIAmBadAtheros && (pMac->WepStatus != Ndis802_11WEPDisabled))
- {
- pTxWI->MpduDensity = 7;
- }
- else
- {
- pTxWI->MpduDensity = pMac->MpduDensity;
- }
- }
-#endif // DOT11_N_SUPPORT //
-
- pTxWI->PacketId = pTxWI->MCS;
- NdisMoveMemory(pOutTxWI, &TxWI, sizeof(TXWI_STRUC));
-}
-
-
-VOID RTMPWriteTxWI_Data(
- IN PRTMP_ADAPTER pAd,
- IN OUT PTXWI_STRUC pTxWI,
- IN TX_BLK *pTxBlk)
-{
- HTTRANSMIT_SETTING *pTransmit;
- PMAC_TABLE_ENTRY pMacEntry;
-#ifdef DOT11_N_SUPPORT
- UCHAR BASize;
-#endif // DOT11_N_SUPPORT //
-
-
- ASSERT(pTxWI);
-
- pTransmit = pTxBlk->pTransmit;
- pMacEntry = pTxBlk->pMacEntry;
-
-
- //
- // Always use Long preamble before verifiation short preamble functionality works well.
- // Todo: remove the following line if short preamble functionality works
- //
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
- NdisZeroMemory(pTxWI, TXWI_SIZE);
-
- pTxWI->FRAG = TX_BLK_TEST_FLAG(pTxBlk, fTX_bAllowFrag);
- pTxWI->ACK = TX_BLK_TEST_FLAG(pTxBlk, fTX_bAckRequired);
- pTxWI->txop = pTxBlk->FrameGap;
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- if (pMacEntry &&
- (pAd->StaCfg.BssType == BSS_INFRA) &&
- (pMacEntry->ValidAsDls == TRUE))
- pTxWI->WirelessCliID = BSSID_WCID;
- else
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- pTxWI->WirelessCliID = pTxBlk->Wcid;
-
- pTxWI->MPDUtotalByteCount = pTxBlk->MpduHeaderLen + pTxBlk->SrcBufLen;
- pTxWI->CFACK = TX_BLK_TEST_FLAG(pTxBlk, fTX_bPiggyBack);
-
- // If CCK or OFDM, BW must be 20
- pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- if (pTxWI->BW)
- pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
-#endif // DOT11N_DRAFT3 //
- pTxWI->AMPDU = ((pTxBlk->TxFrameType == TX_AMPDU_FRAME) ? TRUE : FALSE);
-
- // John tune the performace with Intel Client in 20 MHz performance
- BASize = pAd->CommonCfg.TxBASize;
- if((pTxBlk->TxFrameType == TX_AMPDU_FRAME) && (pMacEntry))
- {
- UCHAR RABAOriIdx = 0; //The RA's BA Originator table index.
-
- RABAOriIdx = pTxBlk->pMacEntry->BAOriWcidArray[pTxBlk->UserPriority];
- BASize = pAd->BATable.BAOriEntry[RABAOriIdx].BAWinSize;
- }
-
-
- pTxWI->TxBF = pTransmit->field.TxBF;
- pTxWI->BAWinSize = BASize;
- pTxWI->ShortGI = pTransmit->field.ShortGI;
- pTxWI->STBC = pTransmit->field.STBC;
-#endif // DOT11_N_SUPPORT //
-
- pTxWI->MCS = pTransmit->field.MCS;
- pTxWI->PHYMODE = pTransmit->field.MODE;
-
-
-#ifdef DOT11_N_SUPPORT
- if (pMacEntry)
- {
- if ((pMacEntry->MmpsMode == MMPS_DYNAMIC) && (pTransmit->field.MCS > 7))
- {
- // Dynamic MIMO Power Save Mode
- pTxWI->MIMOps = 1;
- }
- else if (pMacEntry->MmpsMode == MMPS_STATIC)
- {
- // Static MIMO Power Save Mode
- if (pTransmit->field.MODE >= MODE_HTMIX && pTransmit->field.MCS > 7)
- {
- pTxWI->MCS = 7;
- pTxWI->MIMOps = 0;
- }
- }
-
- if (pMacEntry->bIAmBadAtheros && (pMacEntry->WepStatus != Ndis802_11WEPDisabled))
- {
- pTxWI->MpduDensity = 7;
- }
- else
- {
- pTxWI->MpduDensity = pMacEntry->MpduDensity;
- }
- }
-#endif // DOT11_N_SUPPORT //
-
-#ifdef DBG_DIAGNOSE
- if (pTxBlk->QueIdx== 0)
- {
- pAd->DiagStruct.TxDataCnt[pAd->DiagStruct.ArrayCurIdx]++;
- pAd->DiagStruct.TxMcsCnt[pAd->DiagStruct.ArrayCurIdx][pTxWI->MCS]++;
- }
-#endif // DBG_DIAGNOSE //
-
- // for rate adapation
- pTxWI->PacketId = pTxWI->MCS;
-#ifdef INF_AMAZON_SE
-/*Iverson patch for WMM A5-T07 ,WirelessStaToWirelessSta do not bulk out aggregate */
- if( RTMP_GET_PACKET_NOBULKOUT(pTxBlk->pPacket))
- {
- if(pTxWI->PHYMODE == MODE_CCK)
- {
- pTxWI->PacketId = 6;
- }
- }
-#endif // INF_AMAZON_SE //
-}
-
-
-VOID RTMPWriteTxWI_Cache(
- IN PRTMP_ADAPTER pAd,
- IN OUT PTXWI_STRUC pTxWI,
- IN TX_BLK *pTxBlk)
-{
- PHTTRANSMIT_SETTING /*pTxHTPhyMode,*/ pTransmit;
- PMAC_TABLE_ENTRY pMacEntry;
-
- //
- // update TXWI
- //
- pMacEntry = pTxBlk->pMacEntry;
- pTransmit = pTxBlk->pTransmit;
-
- //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))
- //if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pMacEntry))
- //if (TX_BLK_TEST_FLAG(pTxBlk, fTX_AutoRateSwitch))
- if (pMacEntry->bAutoTxRateSwitch)
- {
- pTxWI->txop = IFS_HTTXOP;
-
- // If CCK or OFDM, BW must be 20
- pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
- pTxWI->ShortGI = pTransmit->field.ShortGI;
- pTxWI->STBC = pTransmit->field.STBC;
-
- pTxWI->MCS = pTransmit->field.MCS;
- pTxWI->PHYMODE = pTransmit->field.MODE;
-
- // set PID for TxRateSwitching
- pTxWI->PacketId = pTransmit->field.MCS;
- }
-
-#ifdef DOT11_N_SUPPORT
- pTxWI->AMPDU = ((pMacEntry->NoBADataCountDown == 0) ? TRUE: FALSE);
- pTxWI->MIMOps = 0;
-
-#ifdef DOT11N_DRAFT3
- if (pTxWI->BW)
- pTxWI->BW = (pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth == 0) ? (BW_20) : (pTransmit->field.BW);
-#endif // DOT11N_DRAFT3 //
-
- if (pAd->CommonCfg.bMIMOPSEnable)
- {
- // MIMO Power Save Mode
- if ((pMacEntry->MmpsMode == MMPS_DYNAMIC) && (pTransmit->field.MCS > 7))
- {
- // Dynamic MIMO Power Save Mode
- pTxWI->MIMOps = 1;
- }
- else if (pMacEntry->MmpsMode == MMPS_STATIC)
- {
- // Static MIMO Power Save Mode
- if ((pTransmit->field.MODE >= MODE_HTMIX) && (pTransmit->field.MCS > 7))
- {
- pTxWI->MCS = 7;
- pTxWI->MIMOps = 0;
- }
- }
- }
-#endif // DOT11_N_SUPPORT //
-
-#ifdef DBG_DIAGNOSE
- if (pTxBlk->QueIdx== 0)
- {
- pAd->DiagStruct.TxDataCnt[pAd->DiagStruct.ArrayCurIdx]++;
- pAd->DiagStruct.TxMcsCnt[pAd->DiagStruct.ArrayCurIdx][pTxWI->MCS]++;
- }
-#endif // DBG_DIAGNOSE //
-
- pTxWI->MPDUtotalByteCount = pTxBlk->MpduHeaderLen + pTxBlk->SrcBufLen;
-
-}
-
-
-// should be called only when -
-// 1. MEADIA_CONNECTED
-// 2. AGGREGATION_IN_USED
-// 3. Fragmentation not in used
-// 4. either no previous frame (pPrevAddr1=NULL) .OR. previoud frame is aggregatible
-BOOLEAN TxFrameIsAggregatible(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pPrevAddr1,
- IN PUCHAR p8023hdr)
-{
-
- // can't aggregate EAPOL (802.1x) frame
- if ((p8023hdr[12] == 0x88) && (p8023hdr[13] == 0x8e))
- return FALSE;
-
- // can't aggregate multicast/broadcast frame
- if (p8023hdr[0] & 0x01)
- return FALSE;
-
- if (INFRA_ON(pAd)) // must be unicast to AP
- return TRUE;
- else if ((pPrevAddr1 == NULL) || MAC_ADDR_EQUAL(pPrevAddr1, p8023hdr)) // unicast to same STA
- return TRUE;
- else
- return FALSE;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Check the MSDU Aggregation policy
- 1.HT aggregation is A-MSDU
- 2.legaacy rate aggregation is software aggregation by Ralink.
-
- Arguments:
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-BOOLEAN PeerIsAggreOn(
- IN PRTMP_ADAPTER pAd,
- IN ULONG TxRate,
- IN PMAC_TABLE_ENTRY pMacEntry)
-{
- ULONG AFlags = (fCLIENT_STATUS_AMSDU_INUSED | fCLIENT_STATUS_AGGREGATION_CAPABLE);
-
- if (pMacEntry != NULL && CLIENT_STATUS_TEST_FLAG(pMacEntry, AFlags))
- {
-#ifdef DOT11_N_SUPPORT
- if (pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
- {
- return TRUE;
- }
-#endif // DOT11_N_SUPPORT //
-
-#ifdef AGGREGATION_SUPPORT
- if (TxRate >= RATE_6 && pAd->CommonCfg.bAggregationCapable && (!(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) && CLIENT_STATUS_TEST_FLAG(pMacEntry, fCLIENT_STATUS_WMM_CAPABLE))))
- { // legacy Ralink Aggregation support
- return TRUE;
- }
-#endif // AGGREGATION_SUPPORT //
- }
-
- return FALSE;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Check and fine the packet waiting in SW queue with highest priority
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- pQueue Pointer to Waiting Queue
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-PQUEUE_HEADER RTMPCheckTxSwQueue(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pQueIdx)
-{
-
- ULONG Number;
- // 2004-11-15 to be removed. test aggregation only
-// if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)) && (*pNumber < 2))
-// return NULL;
-
- Number = pAd->TxSwQueue[QID_AC_BK].Number
- + pAd->TxSwQueue[QID_AC_BE].Number
- + pAd->TxSwQueue[QID_AC_VI].Number
- + pAd->TxSwQueue[QID_AC_VO].Number;
- /*+ pAd->TxSwQueue[QID_HCCA].Number;*/
-
- if (pAd->TxSwQueue[QID_AC_VO].Head != NULL)
- {
- *pQueIdx = QID_AC_VO;
- return (&pAd->TxSwQueue[QID_AC_VO]);
- }
- else if (pAd->TxSwQueue[QID_AC_VI].Head != NULL)
- {
- *pQueIdx = QID_AC_VI;
- return (&pAd->TxSwQueue[QID_AC_VI]);
- }
- else if (pAd->TxSwQueue[QID_AC_BE].Head != NULL)
- {
- *pQueIdx = QID_AC_BE;
- return (&pAd->TxSwQueue[QID_AC_BE]);
- }
- else if (pAd->TxSwQueue[QID_AC_BK].Head != NULL)
- {
- *pQueIdx = QID_AC_BK;
- return (&pAd->TxSwQueue[QID_AC_BK]);
- }
- /*
- else if (pAd->TxSwQueue[QID_HCCA].Head != NULL)
- {
- *pQueIdx = QID_HCCA;
- return (&pAd->TxSwQueue[QID_HCCA]);
- }
- */
-
- // No packet pending in Tx Sw queue
- *pQueIdx = QID_AC_BK;
-
- return (NULL);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Suspend MSDU transmission
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPSuspendMsduTransmission(
- IN PRTMP_ADAPTER pAd)
-{
- DBGPRINT(RT_DEBUG_TRACE,("SCANNING, suspend MSDU transmission ...\n"));
-
-
- //
- // Before BSS_SCAN_IN_PROGRESS, we need to keep Current R66 value and
- // use Lowbound as R66 value on ScanNextChannel(...)
- //
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue);
-
- // set BBP_R66 to 0x30/0x40 when scanning (AsicSwitchChannel will set R66 according to channel when scanning)
- //RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, (0x26 + GET_LNA_GAIN(pAd)));
- RTMPSetAGCInitValue(pAd, BW_20);
-
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
- //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x000f0000); // abort all TX rings
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Resume MSDU transmission
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPResumeMsduTransmission(
- IN PRTMP_ADAPTER pAd)
-{
-// UCHAR IrqState;
-
- DBGPRINT(RT_DEBUG_TRACE,("SCAN done, resume MSDU transmission ...\n"));
-
-
- // After finish BSS_SCAN_IN_PROGRESS, we need to restore Current R66 value
- // R66 should not be 0
- if (pAd->BbpTuning.R66CurrentValue == 0)
- {
- pAd->BbpTuning.R66CurrentValue = 0x38;
- DBGPRINT_ERR(("RTMPResumeMsduTransmission, R66CurrentValue=0...\n"));
- }
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, pAd->BbpTuning.R66CurrentValue);
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
-// sample, for IRQ LOCK to SEM LOCK
-// IrqState = pAd->irq_disabled;
-// if (IrqState)
-// RTMPDeQueuePacket(pAd, TRUE, NUM_OF_TX_RING, MAX_TX_PROCESS);
-// else
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
-}
-
-
-UINT deaggregate_AMSDU_announce(
- IN PRTMP_ADAPTER pAd,
- PNDIS_PACKET pPacket,
- IN PUCHAR pData,
- IN ULONG DataSize)
-{
- USHORT PayloadSize;
- USHORT SubFrameSize;
- PHEADER_802_3 pAMSDUsubheader;
- UINT nMSDU;
- UCHAR Header802_3[14];
-
- PUCHAR pPayload, pDA, pSA, pRemovedLLCSNAP;
- PNDIS_PACKET pClonePacket;
-
-
-
- nMSDU = 0;
-
- while (DataSize > LENGTH_802_3)
- {
-
- nMSDU++;
-
- //hex_dump("subheader", pData, 64);
- pAMSDUsubheader = (PHEADER_802_3)pData;
- //pData += LENGTH_802_3;
- PayloadSize = pAMSDUsubheader->Octet[1] + (pAMSDUsubheader->Octet[0]<<8);
- SubFrameSize = PayloadSize + LENGTH_802_3;
-
-
- if ((DataSize < SubFrameSize) || (PayloadSize > 1518 ))
- {
- break;
- }
-
- //DBGPRINT(RT_DEBUG_TRACE,("%d subframe: Size = %d\n", nMSDU, PayloadSize));
-
- pPayload = pData + LENGTH_802_3;
- pDA = pData;
- pSA = pData + MAC_ADDR_LEN;
-
- // convert to 802.3 header
- CONVERT_TO_802_3(Header802_3, pDA, pSA, pPayload, PayloadSize, pRemovedLLCSNAP);
-
-#ifdef CONFIG_STA_SUPPORT
- if ((Header802_3[12] == 0x88) && (Header802_3[13] == 0x8E) )
- {
- /* avoid local heap overflow, use dyanamic allocation */
- MLME_QUEUE_ELEM *Elem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (Elem != NULL)
- {
- memmove(Elem->Msg+(LENGTH_802_11 + LENGTH_802_1_H), pPayload, PayloadSize);
- Elem->MsgLen = LENGTH_802_11 + LENGTH_802_1_H + PayloadSize;
- //WpaEAPOLKeyAction(pAd, Elem);
- REPORT_MGMT_FRAME_TO_MLME(pAd, BSSID_WCID, Elem->Msg, Elem->MsgLen, 0, 0, 0, 0);
- kfree(Elem);
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pRemovedLLCSNAP)
- {
- pPayload -= LENGTH_802_3;
- PayloadSize += LENGTH_802_3;
- NdisMoveMemory(pPayload, &Header802_3[0], LENGTH_802_3);
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- pClonePacket = ClonePacket(pAd, pPacket, pPayload, PayloadSize);
- if (pClonePacket)
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pClonePacket, RTMP_GET_PACKET_IF(pPacket));
-#endif // CONFIG_STA_SUPPORT //
- }
-
-
- // A-MSDU has padding to multiple of 4 including subframe header.
- // align SubFrameSize up to multiple of 4
- SubFrameSize = (SubFrameSize+3)&(~0x3);
-
-
- if (SubFrameSize > 1528 || SubFrameSize < 32)
- {
- break;
- }
-
- if (DataSize > SubFrameSize)
- {
- pData += SubFrameSize;
- DataSize -= SubFrameSize;
- }
- else
- {
- // end of A-MSDU
- DataSize = 0;
- }
- }
-
- // finally release original rx packet
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
-
- return nMSDU;
-}
-
-
-UINT BA_Reorder_AMSDU_Annnounce(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- PUCHAR pData;
- USHORT DataSize;
- UINT nMSDU = 0;
-
- pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket);
- DataSize = (USHORT) GET_OS_PKT_LEN(pPacket);
-
- nMSDU = deaggregate_AMSDU_announce(pAd, pPacket, pData, DataSize);
-
- return nMSDU;
-}
-
-
-/*
- ==========================================================================
- Description:
- Look up the MAC address in the MAC table. Return NULL if not found.
- Return:
- pEntry - pointer to the MAC entry; NULL is not found
- ==========================================================================
-*/
-MAC_TABLE_ENTRY *MacTableLookup(
- IN PRTMP_ADAPTER pAd,
- PUCHAR pAddr)
-{
- ULONG HashIdx;
- MAC_TABLE_ENTRY *pEntry = NULL;
-
- HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
- pEntry = pAd->MacTab.Hash[HashIdx];
-
- while (pEntry && (pEntry->ValidAsCLI || pEntry->ValidAsWDS || pEntry->ValidAsApCli || pEntry->ValidAsMesh))
- {
- if (MAC_ADDR_EQUAL(pEntry->Addr, pAddr))
- {
- break;
- }
- else
- pEntry = pEntry->pNext;
- }
-
- return pEntry;
-}
-
-MAC_TABLE_ENTRY *MacTableInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR apidx,
- IN BOOLEAN CleanAll)
-{
- UCHAR HashIdx;
- int i, FirstWcid;
- MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry;
-// USHORT offset;
-// ULONG addr;
-
- // if FULL, return
- if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
- return NULL;
-
- FirstWcid = 1;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- if (pAd->StaCfg.BssType == BSS_INFRA)
- FirstWcid = 2;
-#endif // CONFIG_STA_SUPPORT //
-
- // allocate one MAC entry
- NdisAcquireSpinLock(&pAd->MacTabLock);
- for (i = FirstWcid; i< MAX_LEN_OF_MAC_TABLE; i++) // skip entry#0 so that "entry index == AID" for fast lookup
- {
- // pick up the first available vacancy
- if ((pAd->MacTab.Content[i].ValidAsCLI == FALSE) &&
- (pAd->MacTab.Content[i].ValidAsWDS == FALSE) &&
- (pAd->MacTab.Content[i].ValidAsApCli== FALSE) &&
- (pAd->MacTab.Content[i].ValidAsMesh == FALSE)
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- && (pAd->MacTab.Content[i].ValidAsDls == FALSE)
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- )
- {
- pEntry = &pAd->MacTab.Content[i];
- if (CleanAll == TRUE)
- {
- pEntry->MaxSupportedRate = RATE_11;
- pEntry->CurrTxRate = RATE_11;
- NdisZeroMemory(pEntry, sizeof(MAC_TABLE_ENTRY));
- pEntry->PairwiseKey.KeyLen = 0;
- pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
- }
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- if (apidx >= MIN_NET_DEVICE_FOR_DLS)
- {
- pEntry->ValidAsCLI = FALSE;
- pEntry->ValidAsWDS = FALSE;
- pEntry->ValidAsApCli = FALSE;
- pEntry->ValidAsMesh = FALSE;
- pEntry->ValidAsDls = TRUE;
- pEntry->isCached = FALSE;
- }
- else
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pEntry->ValidAsCLI = TRUE;
- pEntry->ValidAsWDS = FALSE;
- pEntry->ValidAsApCli = FALSE;
- pEntry->ValidAsMesh = FALSE;
- pEntry->ValidAsDls = FALSE;
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- pEntry->bIAmBadAtheros = FALSE;
- pEntry->pAd = pAd;
- pEntry->CMTimerRunning = FALSE;
- pEntry->EnqueueEapolStartTimerRunning = EAPOL_START_DISABLE;
- pEntry->RSNIE_Len = 0;
- NdisZeroMemory(pEntry->R_Counter, sizeof(pEntry->R_Counter));
- pEntry->ReTryCounter = PEER_MSG1_RETRY_TIMER_CTR;
-
- if (pEntry->ValidAsMesh)
- pEntry->apidx = (apidx - MIN_NET_DEVICE_FOR_MESH);
- else if (pEntry->ValidAsApCli)
- pEntry->apidx = (apidx - MIN_NET_DEVICE_FOR_APCLI);
- else if (pEntry->ValidAsWDS)
- pEntry->apidx = (apidx - MIN_NET_DEVICE_FOR_WDS);
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- else if (pEntry->ValidAsDls)
- pEntry->apidx = (apidx - MIN_NET_DEVICE_FOR_DLS);
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- else
- pEntry->apidx = apidx;
-
-
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pEntry->AuthMode = pAd->StaCfg.AuthMode;
- pEntry->WepStatus = pAd->StaCfg.WepStatus;
- pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
-#ifdef RTMP_MAC_PCI
- AsicRemovePairwiseKeyEntry(pAd, pEntry->apidx, (UCHAR)i);
-#endif // RTMP_MAC_PCI //
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- pEntry->GTKState = REKEY_NEGOTIATING;
- pEntry->PairwiseKey.KeyLen = 0;
- pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- if (pEntry->ValidAsDls == TRUE)
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- else
-#endif //QOS_DLS_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
- pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
-
- pEntry->PMKID_CacheIdx = ENTRY_NOT_FOUND;
- COPY_MAC_ADDR(pEntry->Addr, pAddr);
- pEntry->Sst = SST_NOT_AUTH;
- pEntry->AuthState = AS_NOT_AUTH;
- pEntry->Aid = (USHORT)i; //0;
- pEntry->CapabilityInfo = 0;
- pEntry->PsMode = PWR_ACTIVE;
- pEntry->PsQIdleCount = 0;
- pEntry->NoDataIdleCount = 0;
- pEntry->AssocDeadLine = MAC_TABLE_ASSOC_TIMEOUT;
- pEntry->ContinueTxFailCnt = 0;
-#ifdef WDS_SUPPORT
- pEntry->LockEntryTx = FALSE;
- pEntry->TimeStamp_toTxRing = 0;
-#endif // WDS_SUPPORT //
- InitializeQueueHeader(&pEntry->PsQueue);
-
-
- pAd->MacTab.Size ++;
- // Add this entry into ASIC RX WCID search table
- RTMP_STA_ENTRY_ADD(pAd, pEntry);
-
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("MacTableInsertEntry - allocate entry #%d, Total= %d\n",i, pAd->MacTab.Size));
- break;
- }
- }
-
- // add this MAC entry into HASH table
- if (pEntry)
- {
- HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
- if (pAd->MacTab.Hash[HashIdx] == NULL)
- {
- pAd->MacTab.Hash[HashIdx] = pEntry;
- }
- else
- {
- pCurrEntry = pAd->MacTab.Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- pCurrEntry = pCurrEntry->pNext;
- pCurrEntry->pNext = pEntry;
- }
- }
-
- NdisReleaseSpinLock(&pAd->MacTabLock);
- return pEntry;
-}
-
-/*
- ==========================================================================
- Description:
- Delete a specified client from MAC table
- ==========================================================================
- */
-BOOLEAN MacTableDeleteEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT wcid,
- IN PUCHAR pAddr)
-{
- USHORT HashIdx;
- MAC_TABLE_ENTRY *pEntry, *pPrevEntry, *pProbeEntry;
- BOOLEAN Cancelled;
- //USHORT offset; // unused variable
- //UCHAR j; // unused variable
-
- if (wcid >= MAX_LEN_OF_MAC_TABLE)
- return FALSE;
-
- NdisAcquireSpinLock(&pAd->MacTabLock);
-
- HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
- //pEntry = pAd->MacTab.Hash[HashIdx];
- pEntry = &pAd->MacTab.Content[wcid];
-
- if (pEntry && (pEntry->ValidAsCLI || pEntry->ValidAsApCli || pEntry->ValidAsWDS || pEntry->ValidAsMesh
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- || pEntry->ValidAsDls
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- ))
- {
- if (MAC_ADDR_EQUAL(pEntry->Addr, pAddr))
- {
-
- // Delete this entry from ASIC on-chip WCID Table
- RTMP_STA_ENTRY_MAC_RESET(pAd, wcid);
-
-#ifdef DOT11_N_SUPPORT
- // free resources of BA
- BASessionTearDownALL(pAd, pEntry->Aid);
-#endif // DOT11_N_SUPPORT //
-
-
- pPrevEntry = NULL;
- pProbeEntry = pAd->MacTab.Hash[HashIdx];
- ASSERT(pProbeEntry);
-
- // update Hash list
- do
- {
- if (pProbeEntry == pEntry)
- {
- if (pPrevEntry == NULL)
- {
- pAd->MacTab.Hash[HashIdx] = pEntry->pNext;
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- }
- break;
- }
-
- pPrevEntry = pProbeEntry;
- pProbeEntry = pProbeEntry->pNext;
- } while (pProbeEntry);
-
- // not found !!!
- ASSERT(pProbeEntry != NULL);
-
- RTMP_STA_ENTRY_KEY_DEL(pAd, BSS0, wcid);
-
-
- if (pEntry->EnqueueEapolStartTimerRunning != EAPOL_START_DISABLE)
- {
- RTMPCancelTimer(&pEntry->EnqueueStartForPSKTimer, &Cancelled);
- pEntry->EnqueueEapolStartTimerRunning = EAPOL_START_DISABLE;
- }
-
-
- NdisZeroMemory(pEntry, sizeof(MAC_TABLE_ENTRY));
- pAd->MacTab.Size --;
- DBGPRINT(RT_DEBUG_TRACE, ("MacTableDeleteEntry1 - Total= %d\n", pAd->MacTab.Size));
- }
- else
- {
- DBGPRINT(RT_DEBUG_OFF, ("\n%s: Impossible Wcid = %d !!!!!\n", __FUNCTION__, wcid));
- }
- }
-
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
- //Reset operating mode when no Sta.
- if (pAd->MacTab.Size == 0)
- {
-#ifdef DOT11_N_SUPPORT
- pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode = 0;
-#endif // DOT11_N_SUPPORT //
- //AsicUpdateProtect(pAd, 0 /*pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode*/, (ALLN_SETPROTECT), TRUE, 0 /*pAd->MacTab.fAnyStationNonGF*/);
- RTMP_UPDATE_PROTECT(pAd); // edit by johnli, fix "in_interrupt" error when call "MacTableDeleteEntry" in Rx tasklet
- }
-
- return TRUE;
-}
-
-
-/*
- ==========================================================================
- Description:
- This routine reset the entire MAC table. All packets pending in
- the power-saving queues are freed here.
- ==========================================================================
- */
-VOID MacTableReset(
- IN PRTMP_ADAPTER pAd)
-{
- int i;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MacTableReset\n"));
- //NdisAcquireSpinLock(&pAd->MacTabLock);
-
-
- for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
-#ifdef RTMP_MAC_PCI
- RTMP_STA_ENTRY_MAC_RESET(pAd, i);
-#endif // RTMP_MAC_PCI //
- if (pAd->MacTab.Content[i].ValidAsCLI == TRUE)
- {
-
-
-#ifdef DOT11_N_SUPPORT
- // free resources of BA
- BASessionTearDownALL(pAd, i);
-#endif // DOT11_N_SUPPORT //
-
- pAd->MacTab.Content[i].ValidAsCLI = FALSE;
-
-
-
-
- //AsicDelWcidTab(pAd, i);
- }
- }
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID AssocParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_ASSOC_REQ_STRUCT *AssocReq,
- IN PUCHAR pAddr,
- IN USHORT CapabilityInfo,
- IN ULONG Timeout,
- IN USHORT ListenIntv)
-{
- COPY_MAC_ADDR(AssocReq->Addr, pAddr);
- // Add mask to support 802.11b mode only
- AssocReq->CapabilityInfo = CapabilityInfo & SUPPORTED_CAPABILITY_INFO; // not cf-pollable, not cf-poll-request
- AssocReq->Timeout = Timeout;
- AssocReq->ListenIntv = ListenIntv;
-}
-
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID DisassocParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_DISASSOC_REQ_STRUCT *DisassocReq,
- IN PUCHAR pAddr,
- IN USHORT Reason)
-{
- COPY_MAC_ADDR(DisassocReq->Addr, pAddr);
- DisassocReq->Reason = Reason;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Check the out going frame, if this is an DHCP or ARP datagram
- will be duplicate another frame at low data rate transmit.
-
- Arguments:
- pAd Pointer to our adapter
- pPacket Pointer to outgoing Ndis frame
-
- Return Value:
- TRUE To be duplicate at Low data rate transmit. (1mb)
- FALSE Do nothing.
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- MAC header + IP Header + UDP Header
- 14 Bytes 20 Bytes
-
- UDP Header
- 00|01|02|03|04|05|06|07|08|09|10|11|12|13|14|15|
- Source Port
- 16|17|18|19|20|21|22|23|24|25|26|27|28|29|30|31|
- Destination Port
-
- port 0x43 means Bootstrap Protocol, server.
- Port 0x44 means Bootstrap Protocol, client.
-
- ========================================================================
-*/
-
-BOOLEAN RTMPCheckDHCPFrame(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- PACKET_INFO PacketInfo;
- ULONG NumberOfBytesRead = 0;
- ULONG CurrentOffset = 0;
- PVOID pVirtualAddress = NULL;
- UINT NdisBufferLength;
- PUCHAR pSrc;
- USHORT Protocol;
- UCHAR ByteOffset36 = 0;
- UCHAR ByteOffset38 = 0;
- BOOLEAN ReadFirstParm = TRUE;
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, (PUCHAR *)&pVirtualAddress, &NdisBufferLength);
-
- NumberOfBytesRead += NdisBufferLength;
- pSrc = (PUCHAR) pVirtualAddress;
- Protocol = *(pSrc + 12) * 256 + *(pSrc + 13);
-
- //
- // Check DHCP & BOOTP protocol
- //
- while (NumberOfBytesRead <= PacketInfo.TotalPacketLength)
- {
- if ((NumberOfBytesRead >= 35) && (ReadFirstParm == TRUE))
- {
- CurrentOffset = 35 - (NumberOfBytesRead - NdisBufferLength);
- ByteOffset36 = *(pSrc + CurrentOffset);
- ReadFirstParm = FALSE;
- }
-
- if (NumberOfBytesRead >= 37)
- {
- CurrentOffset = 37 - (NumberOfBytesRead - NdisBufferLength);
- ByteOffset38 = *(pSrc + CurrentOffset);
- //End of Read
- break;
- }
- return FALSE;
- }
-
- // Check for DHCP & BOOTP protocol
- if ((ByteOffset36 != 0x44) || (ByteOffset38 != 0x43))
- {
- //
- // 2054 (hex 0806) for ARP datagrams
- // if this packet is not ARP datagrams, then do nothing
- // ARP datagrams will also be duplicate at 1mb broadcast frames
- //
- if (Protocol != 0x0806 )
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-BOOLEAN RTMPCheckEtherType(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- USHORT TypeLen;
- UCHAR Byte0, Byte1;
- PUCHAR pSrcBuf;
- UINT32 pktLen;
- UINT16 srcPort, dstPort;
- BOOLEAN status = TRUE;
-
-
- pSrcBuf = GET_OS_PKT_DATAPTR(pPacket);
- pktLen = GET_OS_PKT_LEN(pPacket);
-
- ASSERT(pSrcBuf);
-
- RTMP_SET_PACKET_SPECIFIC(pPacket, 0);
-
- // get Ethernet protocol field
- TypeLen = (pSrcBuf[12] << 8) + pSrcBuf[13];
-
- pSrcBuf += LENGTH_802_3; // Skip the Ethernet Header.
-
- if (TypeLen <= 1500)
- { // 802.3, 802.3 LLC
- /*
- DestMAC(6) + SrcMAC(6) + Lenght(2) +
- DSAP(1) + SSAP(1) + Control(1) +
- if the DSAP = 0xAA, SSAP=0xAA, Contorl = 0x03, it has a 5-bytes SNAP header.
- => + SNAP (5, OriginationID(3) + etherType(2))
- */
- if (pSrcBuf[0] == 0xAA && pSrcBuf[1] == 0xAA && pSrcBuf[2] == 0x03)
- {
- Sniff2BytesFromNdisBuffer((PNDIS_BUFFER)pSrcBuf, 6, &Byte0, &Byte1);
- RTMP_SET_PACKET_LLCSNAP(pPacket, 1);
- TypeLen = (USHORT)((Byte0 << 8) + Byte1);
- pSrcBuf += 8; // Skip this LLC/SNAP header
- }
- else
- {
- //It just has 3-byte LLC header, maybe a legacy ether type frame. we didn't handle it.
- }
- }
-
- // If it's a VLAN packet, get the real Type/Length field.
- if (TypeLen == 0x8100)
- {
- /* 0x8100 means VLAN packets */
-
- /* Dest. MAC Address (6-bytes) +
- Source MAC Address (6-bytes) +
- Length/Type = 802.1Q Tag Type (2-byte) +
- Tag Control Information (2-bytes) +
- Length / Type (2-bytes) +
- data payload (0-n bytes) +
- Pad (0-p bytes) +
- Frame Check Sequence (4-bytes) */
-
- RTMP_SET_PACKET_VLAN(pPacket, 1);
- Sniff2BytesFromNdisBuffer((PNDIS_BUFFER)pSrcBuf, 2, &Byte0, &Byte1);
- TypeLen = (USHORT)((Byte0 << 8) + Byte1);
-
- pSrcBuf += 4; // Skip the VLAN Header.
- }
-
- switch (TypeLen)
- {
- case 0x0800:
- {
- ASSERT((pktLen > 34));
- if (*(pSrcBuf + 9) == 0x11)
- { // udp packet
- ASSERT((pktLen > 34)); // 14 for ethernet header, 20 for IP header
-
- pSrcBuf += 20; // Skip the IP header
- srcPort = OS_NTOHS(get_unaligned((PUINT16)(pSrcBuf)));
- dstPort = OS_NTOHS(get_unaligned((PUINT16)(pSrcBuf+2)));
-
- if ((srcPort==0x44 && dstPort==0x43) || (srcPort==0x43 && dstPort==0x44))
- { //It's a BOOTP/DHCP packet
- RTMP_SET_PACKET_DHCP(pPacket, 1);
- }
- }
- }
- break;
- case 0x0806:
- {
- //ARP Packet.
- RTMP_SET_PACKET_DHCP(pPacket, 1);
- }
- break;
- case 0x888e:
- {
- // EAPOL Packet.
- RTMP_SET_PACKET_EAPOL(pPacket, 1);
- }
- break;
- default:
- status = FALSE;
- break;
- }
-
- return status;
-
-}
-
-
-
-VOID Update_Rssi_Sample(
- IN PRTMP_ADAPTER pAd,
- IN RSSI_SAMPLE *pRssi,
- IN PRXWI_STRUC pRxWI)
- {
- CHAR rssi0 = pRxWI->RSSI0;
- CHAR rssi1 = pRxWI->RSSI1;
- CHAR rssi2 = pRxWI->RSSI2;
-
- if (rssi0 != 0)
- {
- pRssi->LastRssi0 = ConvertToRssi(pAd, (CHAR)rssi0, RSSI_0);
- pRssi->AvgRssi0X8 = (pRssi->AvgRssi0X8 - pRssi->AvgRssi0) + pRssi->LastRssi0;
- pRssi->AvgRssi0 = pRssi->AvgRssi0X8 >> 3;
- }
-
- if (rssi1 != 0)
- {
- pRssi->LastRssi1 = ConvertToRssi(pAd, (CHAR)rssi1, RSSI_1);
- pRssi->AvgRssi1X8 = (pRssi->AvgRssi1X8 - pRssi->AvgRssi1) + pRssi->LastRssi1;
- pRssi->AvgRssi1 = pRssi->AvgRssi1X8 >> 3;
- }
-
- if (rssi2 != 0)
- {
- pRssi->LastRssi2 = ConvertToRssi(pAd, (CHAR)rssi2, RSSI_2);
- pRssi->AvgRssi2X8 = (pRssi->AvgRssi2X8 - pRssi->AvgRssi2) + pRssi->LastRssi2;
- pRssi->AvgRssi2 = pRssi->AvgRssi2X8 >> 3;
- }
-}
-
-
-
-// Normal legacy Rx packet indication
-VOID Indicate_Legacy_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
- UCHAR Header802_3[LENGTH_802_3];
-
- // 1. get 802.3 Header
- // 2. remove LLC
- // a. pointer pRxBlk->pData to payload
- // b. modify pRxBlk->DataSize
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
-
- if (pRxBlk->DataSize > MAX_RX_PKT_LEN)
- {
-
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
-
- STATS_INC_RX_PACKETS(pAd, FromWhichBSSID);
-
-
- wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID);
-
- //
- // pass this 802.3 packet to upper layer or forward this packet to WM directly
- //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxPacket, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
-
-}
-
-
-// Normal, AMPDU or AMSDU
-VOID CmmRxnonRalinkFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
-#ifdef DOT11_N_SUPPORT
- if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMPDU) && (pAd->CommonCfg.bDisableReordering == 0))
- {
- Indicate_AMPDU_Packet(pAd, pRxBlk, FromWhichBSSID);
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
-#ifdef DOT11_N_SUPPORT
- if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMSDU))
- {
- // handle A-MSDU
- Indicate_AMSDU_Packet(pAd, pRxBlk, FromWhichBSSID);
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- Indicate_Legacy_Packet(pAd, pRxBlk, FromWhichBSSID);
- }
- }
-}
-
-
-VOID CmmRxRalinkFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- UCHAR Header802_3[LENGTH_802_3];
- UINT16 Msdu2Size;
- UINT16 Payload1Size, Payload2Size;
- PUCHAR pData2;
- PNDIS_PACKET pPacket2 = NULL;
-
-
-
- Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData+1) << 8);
-
- if ((Msdu2Size <= 1536) && (Msdu2Size < pRxBlk->DataSize))
- {
- /* skip two byte MSDU2 len */
- pRxBlk->pData += 2;
- pRxBlk->DataSize -= 2;
- }
- else
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- // get 802.3 Header and remove LLC
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(pRxBlk, Header802_3);
-#endif // CONFIG_STA_SUPPORT //
-
-
- ASSERT(pRxBlk->pRxPacket);
-
- // Ralink Aggregation frame
- pAd->RalinkCounters.OneSecRxAggregationCount ++;
- Payload1Size = pRxBlk->DataSize - Msdu2Size;
- Payload2Size = Msdu2Size - LENGTH_802_3;
-
- pData2 = pRxBlk->pData + Payload1Size + LENGTH_802_3;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pPacket2 = duplicate_pkt(pAd, (pData2-LENGTH_802_3), LENGTH_802_3, pData2, Payload2Size, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
-
- if (!pPacket2)
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- // update payload size of 1st packet
- pRxBlk->DataSize = Payload1Size;
- wlan_802_11_to_802_3_packet(pAd, pRxBlk, Header802_3, FromWhichBSSID);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pRxBlk->pRxPacket, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
-
- if (pPacket2)
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- ANNOUNCE_OR_FORWARD_802_3_PACKET(pAd, pPacket2, FromWhichBSSID);
-#endif // CONFIG_STA_SUPPORT //
- }
-}
-
-
-#define RESET_FRAGFRAME(_fragFrame) \
- { \
- _fragFrame.RxSize = 0; \
- _fragFrame.Sequence = 0; \
- _fragFrame.LastFrag = 0; \
- _fragFrame.Flags = 0; \
- }
-
-
-PNDIS_PACKET RTMPDeFragmentDataFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk)
-{
- PHEADER_802_11 pHeader = pRxBlk->pHeader;
- PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
- UCHAR *pData = pRxBlk->pData;
- USHORT DataSize = pRxBlk->DataSize;
- PNDIS_PACKET pRetPacket = NULL;
- UCHAR *pFragBuffer = NULL;
- BOOLEAN bReassDone = FALSE;
- UCHAR HeaderRoom = 0;
-
-
- ASSERT(pHeader);
-
- HeaderRoom = pData - (UCHAR *)pHeader;
-
- // Re-assemble the fragmented packets
- if (pHeader->Frag == 0) // Frag. Number is 0 : First frag or only one pkt
- {
- // the first pkt of fragment, record it.
- if (pHeader->FC.MoreFrag)
- {
- ASSERT(pAd->FragFrame.pFragPacket);
- pFragBuffer = GET_OS_PKT_DATAPTR(pAd->FragFrame.pFragPacket);
- pAd->FragFrame.RxSize = DataSize + HeaderRoom;
- NdisMoveMemory(pFragBuffer, pHeader, pAd->FragFrame.RxSize);
- pAd->FragFrame.Sequence = pHeader->Sequence;
- pAd->FragFrame.LastFrag = pHeader->Frag; // Should be 0
- ASSERT(pAd->FragFrame.LastFrag == 0);
- goto done; // end of processing this frame
- }
- }
- else //Middle & End of fragment
- {
- if ((pHeader->Sequence != pAd->FragFrame.Sequence) ||
- (pHeader->Frag != (pAd->FragFrame.LastFrag + 1)))
- {
- // Fragment is not the same sequence or out of fragment number order
- // Reset Fragment control blk
- RESET_FRAGFRAME(pAd->FragFrame);
- DBGPRINT(RT_DEBUG_ERROR, ("Fragment is not the same sequence or out of fragment number order.\n"));
- goto done; // give up this frame
- }
- else if ((pAd->FragFrame.RxSize + DataSize) > MAX_FRAME_SIZE)
- {
- // Fragment frame is too large, it exeeds the maximum frame size.
- // Reset Fragment control blk
- RESET_FRAGFRAME(pAd->FragFrame);
- DBGPRINT(RT_DEBUG_ERROR, ("Fragment frame is too large, it exeeds the maximum frame size.\n"));
- goto done; // give up this frame
- }
-
- //
- // Broadcom AP(BCM94704AGR) will send out LLC in fragment's packet, LLC only can accpet at first fragment.
- // In this case, we will dropt it.
- //
- if (NdisEqualMemory(pData, SNAP_802_1H, sizeof(SNAP_802_1H)))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Find another LLC at Middle or End fragment(SN=%d, Frag=%d)\n", pHeader->Sequence, pHeader->Frag));
- goto done; // give up this frame
- }
-
- pFragBuffer = GET_OS_PKT_DATAPTR(pAd->FragFrame.pFragPacket);
-
- // concatenate this fragment into the re-assembly buffer
- NdisMoveMemory((pFragBuffer + pAd->FragFrame.RxSize), pData, DataSize);
- pAd->FragFrame.RxSize += DataSize;
- pAd->FragFrame.LastFrag = pHeader->Frag; // Update fragment number
-
- // Last fragment
- if (pHeader->FC.MoreFrag == FALSE)
- {
- bReassDone = TRUE;
- }
- }
-
-done:
- // always release rx fragmented packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
-
- // return defragmented packet if packet is reassembled completely
- // otherwise return NULL
- if (bReassDone)
- {
- PNDIS_PACKET pNewFragPacket;
-
- // allocate a new packet buffer for fragment
- pNewFragPacket = RTMP_AllocateFragPacketBuffer(pAd, RX_BUFFER_NORMSIZE);
- if (pNewFragPacket)
- {
- // update RxBlk
- pRetPacket = pAd->FragFrame.pFragPacket;
- pAd->FragFrame.pFragPacket = pNewFragPacket;
- pRxBlk->pHeader = (PHEADER_802_11) GET_OS_PKT_DATAPTR(pRetPacket);
- pRxBlk->pData = (UCHAR *)pRxBlk->pHeader + HeaderRoom;
- pRxBlk->DataSize = pAd->FragFrame.RxSize - HeaderRoom;
- pRxBlk->pRxPacket = pRetPacket;
- }
- else
- {
- RESET_FRAGFRAME(pAd->FragFrame);
- }
- }
-
- return pRetPacket;
-}
-
-
-VOID Indicate_AMSDU_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- UINT nMSDU;
-
- update_os_packet_info(pAd, pRxBlk, FromWhichBSSID);
- RTMP_SET_PACKET_IF(pRxBlk->pRxPacket, FromWhichBSSID);
- nMSDU = deaggregate_AMSDU_announce(pAd, pRxBlk->pRxPacket, pRxBlk->pData, pRxBlk->DataSize);
-}
-
-VOID Indicate_EAPOL_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- MAC_TABLE_ENTRY *pEntry = NULL;
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- STARxEAPOLFrameIndicate(pAd, pEntry, pRxBlk, FromWhichBSSID);
- return;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- if (pEntry == NULL)
- {
- DBGPRINT(RT_DEBUG_WARN, ("Indicate_EAPOL_Packet: drop and release the invalid packet.\n"));
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-}
-
-#define BCN_TBTT_OFFSET 64 //defer 64 us
-VOID ReSyncBeaconTime(
- IN PRTMP_ADAPTER pAd)
-{
-
- UINT32 Offset;
-
-
- Offset = (pAd->TbttTickCount) % (BCN_TBTT_OFFSET);
-
- pAd->TbttTickCount++;
-
- //
- // The updated BeaconInterval Value will affect Beacon Interval after two TBTT
- // beacasue the original BeaconInterval had been loaded into next TBTT_TIMER
- //
- if (Offset == (BCN_TBTT_OFFSET-2))
- {
- BCN_TIME_CFG_STRUC csr;
- RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
- csr.field.BeaconInterval = (pAd->CommonCfg.BeaconPeriod << 4) - 1 ; // ASIC register in units of 1/16 TU = 64us
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
- }
- else
- {
- if (Offset == (BCN_TBTT_OFFSET-1))
- {
- BCN_TIME_CFG_STRUC csr;
-
- RTMP_IO_READ32(pAd, BCN_TIME_CFG, &csr.word);
- csr.field.BeaconInterval = (pAd->CommonCfg.BeaconPeriod) << 4; // ASIC register in units of 1/16 TU
- RTMP_IO_WRITE32(pAd, BCN_TIME_CFG, csr.word);
- }
- }
-}
diff --git a/drivers/staging/rt3090/common/cmm_info.c b/drivers/staging/rt3090/common/cmm_info.c
deleted file mode 100644
index 3e51e98b474c..000000000000
--- a/drivers/staging/rt3090/common/cmm_info.c
+++ /dev/null
@@ -1,3718 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- cmm_info.c
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
-
-#include <linux/sched.h>
-#include "../rt_config.h"
-
-
-INT Show_SSID_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_WirelessMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_TxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_TxPreamble_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_TxPower_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_Channel_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_BGProtection_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_RTSThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_FragThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-#ifdef DOT11_N_SUPPORT
-INT Show_HtBw_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtMcs_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtGi_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtOpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtExtcha_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtMpduDensity_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtBaWinSize_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtRdg_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtAmsdu_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_HtAutoBa_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-#endif // DOT11_N_SUPPORT //
-
-INT Show_CountryRegion_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_CountryRegionABand_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_CountryCode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-#ifdef AGGREGATION_SUPPORT
-INT Show_PktAggregate_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-#endif // AGGREGATION_SUPPORT //
-
-#ifdef WMM_SUPPORT
-INT Show_WmmCapable_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-#endif // WMM_SUPPORT //
-
-INT Show_IEEE80211H_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-#ifdef CONFIG_STA_SUPPORT
-INT Show_NetworkType_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-#endif // CONFIG_STA_SUPPORT //
-
-INT Show_AuthMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_EncrypType_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_DefaultKeyID_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_Key1_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_Key2_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_Key3_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_Key4_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-INT Show_WPAPSK_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf);
-
-static struct {
- PSTRING name;
- INT (*show_proc)(PRTMP_ADAPTER pAdapter, PSTRING arg);
-} *PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC, RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC[] = {
- {"SSID", Show_SSID_Proc},
- {"WirelessMode", Show_WirelessMode_Proc},
- {"TxBurst", Show_TxBurst_Proc},
- {"TxPreamble", Show_TxPreamble_Proc},
- {"TxPower", Show_TxPower_Proc},
- {"Channel", Show_Channel_Proc},
- {"BGProtection", Show_BGProtection_Proc},
- {"RTSThreshold", Show_RTSThreshold_Proc},
- {"FragThreshold", Show_FragThreshold_Proc},
-#ifdef DOT11_N_SUPPORT
- {"HtBw", Show_HtBw_Proc},
- {"HtMcs", Show_HtMcs_Proc},
- {"HtGi", Show_HtGi_Proc},
- {"HtOpMode", Show_HtOpMode_Proc},
- {"HtExtcha", Show_HtExtcha_Proc},
- {"HtMpduDensity", Show_HtMpduDensity_Proc},
- {"HtBaWinSize", Show_HtBaWinSize_Proc},
- {"HtRdg", Show_HtRdg_Proc},
- {"HtAmsdu", Show_HtAmsdu_Proc},
- {"HtAutoBa", Show_HtAutoBa_Proc},
-#endif // DOT11_N_SUPPORT //
- {"CountryRegion", Show_CountryRegion_Proc},
- {"CountryRegionABand", Show_CountryRegionABand_Proc},
- {"CountryCode", Show_CountryCode_Proc},
-#ifdef AGGREGATION_SUPPORT
- {"PktAggregate", Show_PktAggregate_Proc},
-#endif
-
-#ifdef WMM_SUPPORT
- {"WmmCapable", Show_WmmCapable_Proc},
-#endif
- {"IEEE80211H", Show_IEEE80211H_Proc},
-#ifdef CONFIG_STA_SUPPORT
- {"NetworkType", Show_NetworkType_Proc},
-#endif // CONFIG_STA_SUPPORT //
- {"AuthMode", Show_AuthMode_Proc},
- {"EncrypType", Show_EncrypType_Proc},
- {"DefaultKeyID", Show_DefaultKeyID_Proc},
- {"Key1", Show_Key1_Proc},
- {"Key2", Show_Key2_Proc},
- {"Key3", Show_Key3_Proc},
- {"Key4", Show_Key4_Proc},
- {"WPAPSK", Show_WPAPSK_Proc},
- {NULL, NULL}
-};
-
-/*
- ==========================================================================
- Description:
- Get Driver version.
-
- Return:
- ==========================================================================
-*/
-INT Set_DriverVersion_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- DBGPRINT(RT_DEBUG_TRACE, ("Driver version-%s\n", STA_DRIVER_VERSION));
-#endif // CONFIG_STA_SUPPORT //
-
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Country Region.
- This command will not work, if the field of CountryRegion in eeprom is programmed.
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_CountryRegion_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- int retval;
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- return -EOPNOTSUPP;
-#endif // EXT_BUILD_CHANNEL_LIST //
-
- retval = RT_CfgSetCountryRegion(pAd, arg, BAND_24G);
- if (retval == FALSE)
- return FALSE;
-
- // if set country region, driver needs to be reset
- BuildChannelList(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_CountryRegion_Proc::(CountryRegion=%d)\n", pAd->CommonCfg.CountryRegion));
-
- return TRUE;
-}
-
-
-/*
- ==========================================================================
- Description:
- Set Country Region for A band.
- This command will not work, if the field of CountryRegion in eeprom is programmed.
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_CountryRegionABand_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- int retval;
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- return -EOPNOTSUPP;
-#endif // EXT_BUILD_CHANNEL_LIST //
-
- retval = RT_CfgSetCountryRegion(pAd, arg, BAND_5G);
- if (retval == FALSE)
- return FALSE;
-
- // if set country region, driver needs to be reset
- BuildChannelList(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_CountryRegionABand_Proc::(CountryRegion=%d)\n", pAd->CommonCfg.CountryRegionForABand));
-
- return TRUE;
-}
-
-
-/*
- ==========================================================================
- Description:
- Set Wireless Mode
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_WirelessMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- INT success = TRUE;
-
- success = RT_CfgSetWirelessMode(pAd, arg);
- if (success)
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- LONG WirelessMode = pAd->CommonCfg.PhyMode;
-
- RTMPSetPhyMode(pAd, WirelessMode);
-#ifdef DOT11_N_SUPPORT
- if (WirelessMode >= PHY_11ABGN_MIXED)
- {
- pAd->CommonCfg.BACapability.field.AutoBA = TRUE;
- pAd->CommonCfg.REGBACapability.field.AutoBA = TRUE;
- }
- else
- {
- pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
- pAd->CommonCfg.REGBACapability.field.AutoBA = FALSE;
- }
-#endif // DOT11_N_SUPPORT //
- // Set AdhocMode rates
- if (pAd->StaCfg.BssType == BSS_ADHOC)
- {
- MlmeUpdateTxRates(pAd, FALSE, 0);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy to on-chip memory
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // it is needed to set SSID to take effect
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE, ("Set_WirelessMode_Proc::(=%d)\n", pAd->CommonCfg.PhyMode));
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Set_WirelessMode_Proc::parameters out of range\n"));
- }
-
- return success;
-}
-
-/*
- ==========================================================================
- Description:
- Set Channel
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Channel_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- INT success = TRUE;
- UCHAR Channel;
-
- Channel = (UCHAR) simple_strtol(arg, 0, 10);
-
- // check if this channel is valid
- if (ChannelSanity(pAd, Channel) == TRUE)
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pAd->CommonCfg.Channel = Channel;
-
- if (MONITOR_ON(pAd))
- {
-#ifdef DOT11_N_SUPPORT
- N_ChannelCheck(pAd);
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED &&
- pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)
- {
- N_SetCenCh(pAd);
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
- DBGPRINT(RT_DEBUG_TRACE, ("BW_40, control_channel(%d), CentralChannel(%d) \n",
- pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("BW_20, Channel(%d)\n", pAd->CommonCfg.Channel));
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
- success = TRUE;
- }
- else
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- success = FALSE;
-#endif // CONFIG_STA_SUPPORT //
- }
-
-
- if (success == TRUE)
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Channel_Proc::(Channel=%d)\n", pAd->CommonCfg.Channel));
-
- return success;
-}
-
-
-/*
- ==========================================================================
- Description:
- Set Short Slot Time Enable or Disable
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_ShortSlot_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- int retval;
-
- retval = RT_CfgSetShortSlot(pAd, arg);
- if (retval == TRUE)
- DBGPRINT(RT_DEBUG_TRACE, ("Set_ShortSlot_Proc::(ShortSlot=%d)\n", pAd->CommonCfg.bUseShortSlotTime));
-
- return retval;
-}
-
-
-/*
- ==========================================================================
- Description:
- Set Tx power
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_TxPower_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- LONG TxPower;
- INT success = FALSE;
-
- TxPower = simple_strtol(arg, 0, 10);
- if (TxPower <= 100)
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pAd->CommonCfg.TxPowerDefault = TxPower;
- pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
- }
-#endif // CONFIG_STA_SUPPORT //
- success = TRUE;
- }
- else
- success = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_TxPower_Proc::(TxPowerPercentage=%ld)\n", pAd->CommonCfg.TxPowerPercentage));
-
- return success;
-}
-
-/*
- ==========================================================================
- Description:
- Set 11B/11G Protection
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_BGProtection_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- switch (simple_strtol(arg, 0, 10))
- {
- case 0: //AUTO
- pAd->CommonCfg.UseBGProtection = 0;
- break;
- case 1: //Always On
- pAd->CommonCfg.UseBGProtection = 1;
- break;
- case 2: //Always OFF
- pAd->CommonCfg.UseBGProtection = 2;
- break;
- default: //Invalid argument
- return FALSE;
- }
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_BGProtection_Proc::(BGProtection=%ld)\n", pAd->CommonCfg.UseBGProtection));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set TxPreamble
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_TxPreamble_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- RT_802_11_PREAMBLE Preamble;
-
- Preamble = simple_strtol(arg, 0, 10);
-
-
- switch (Preamble)
- {
- case Rt802_11PreambleShort:
- pAd->CommonCfg.TxPreamble = Preamble;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- MlmeSetTxPreamble(pAd, Rt802_11PreambleShort);
-#endif // CONFIG_STA_SUPPORT //
- break;
- case Rt802_11PreambleLong:
-#ifdef CONFIG_STA_SUPPORT
- case Rt802_11PreambleAuto:
- // if user wants AUTO, initialize to LONG here, then change according to AP's
- // capability upon association.
-#endif // CONFIG_STA_SUPPORT //
- pAd->CommonCfg.TxPreamble = Preamble;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- MlmeSetTxPreamble(pAd, Rt802_11PreambleLong);
-#endif // CONFIG_STA_SUPPORT //
- break;
- default: //Invalid argument
- return FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_TxPreamble_Proc::(TxPreamble=%ld)\n", pAd->CommonCfg.TxPreamble));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set RTS Threshold
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_RTSThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- NDIS_802_11_RTS_THRESHOLD RtsThresh;
-
- RtsThresh = simple_strtol(arg, 0, 10);
-
- if((RtsThresh > 0) && (RtsThresh <= MAX_RTS_THRESHOLD))
- pAd->CommonCfg.RtsThreshold = (USHORT)RtsThresh;
-#ifdef CONFIG_STA_SUPPORT
- else if (RtsThresh == 0)
- pAd->CommonCfg.RtsThreshold = MAX_RTS_THRESHOLD;
-#endif // CONFIG_STA_SUPPORT //
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_RTSThreshold_Proc::(RTSThreshold=%d)\n", pAd->CommonCfg.RtsThreshold));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Fragment Threshold
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_FragThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- NDIS_802_11_FRAGMENTATION_THRESHOLD FragThresh;
-
- FragThresh = simple_strtol(arg, 0, 10);
-
- if (FragThresh > MAX_FRAG_THRESHOLD || FragThresh < MIN_FRAG_THRESHOLD)
- {
- //Illegal FragThresh so we set it to default
- pAd->CommonCfg.FragmentThreshold = MAX_FRAG_THRESHOLD;
- }
- else if (FragThresh % 2 == 1)
- {
- // The length of each fragment shall always be an even number of octets, except for the last fragment
- // of an MSDU or MMPDU, which may be either an even or an odd number of octets.
- pAd->CommonCfg.FragmentThreshold = (USHORT)(FragThresh - 1);
- }
- else
- {
- pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pAd->CommonCfg.FragmentThreshold == MAX_FRAG_THRESHOLD)
- pAd->CommonCfg.bUseZeroToDisableFragment = TRUE;
- else
- pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_FragThreshold_Proc::(FragThreshold=%d)\n", pAd->CommonCfg.FragmentThreshold));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set TxBurst
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_TxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- LONG TxBurst;
-
- TxBurst = simple_strtol(arg, 0, 10);
- if (TxBurst == 1)
- pAd->CommonCfg.bEnableTxBurst = TRUE;
- else if (TxBurst == 0)
- pAd->CommonCfg.bEnableTxBurst = FALSE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_TxBurst_Proc::(TxBurst=%d)\n", pAd->CommonCfg.bEnableTxBurst));
-
- return TRUE;
-}
-
-#ifdef AGGREGATION_SUPPORT
-/*
- ==========================================================================
- Description:
- Set TxBurst
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_PktAggregate_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- LONG aggre;
-
- aggre = simple_strtol(arg, 0, 10);
-
- if (aggre == 1)
- pAd->CommonCfg.bAggregationCapable = TRUE;
- else if (aggre == 0)
- pAd->CommonCfg.bAggregationCapable = FALSE;
- else
- return FALSE; //Invalid argument
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_PktAggregate_Proc::(AGGRE=%d)\n", pAd->CommonCfg.bAggregationCapable));
-
- return TRUE;
-}
-#endif
-
-
-#ifdef INF_AMAZON_PPA
-INT Set_INF_AMAZON_SE_PPA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- ULONG aggre;
- UINT status;
-
- aggre = simple_strtol(arg, 0, 10);
-
- if (aggre == 1)
- {
- if(pAd->PPAEnable==TRUE)
- {
- printk("INF_AMAZON_SE_PPA already enabled \n");
- }
- else
- {
- if (ppa_hook_directpath_register_dev_fn)
- {
- UINT32 g_if_id;
-
- if (pAd->pDirectpathCb == NULL)
- {
- pAd->pDirectpathCb = (PPA_DIRECTPATH_CB *) kmalloc (sizeof(PPA_DIRECTPATH_CB), GFP_ATOMIC);
- printk("Realloc memory for pDirectpathCb ??\n");
- }
-
- /* register callback */
- pAd->pDirectpathCb->rx_fn = NULL;
- pAd->pDirectpathCb->stop_tx_fn = NULL;
- pAd->pDirectpathCb->start_tx_fn = NULL;
-
- status = ppa_hook_directpath_register_dev_fn(&g_if_id, pAd->net_dev, pAd->pDirectpathCb, PPA_F_DIRECTPATH_ETH_IF);
-
- if(status==1)
- {
- pAd->g_if_id=g_if_id;
- printk("register INF_AMAZON_SE_PPA success :ret:%d id:%d:%d\n",status,pAd->g_if_id,g_if_id);
- pAd->PPAEnable=TRUE;
- }
- else
- {
- printk("register INF_AMAZON_SE_PPA fail :ret:%d\n",status);
- }
-
- }
- else
- {
- printk("INF_AMAZON_SE_PPA enable fail : there is no INF_AMAZON_SE_PPA module . \n");
- }
- }
-
-
- }
- else if (aggre == 0)
- {
- if(pAd->PPAEnable==FALSE)
- {
-
-printk("INF_AMAZON_SE_PPA already disable \n");
- }
- else
- {
- if (ppa_hook_directpath_register_dev_fn)
- {
- UINT32 g_if_id;
- g_if_id=pAd->g_if_id;
- printk("g_if_id=%d \n",pAd->g_if_id);
- status=ppa_hook_directpath_register_dev_fn(&g_if_id, pAd->net_dev, NULL, PPA_F_DIRECTPATH_DEREGISTER);
-
- if(status==1)
- {
- pAd->g_if_id=0;
- printk("unregister INF_AMAZON_SE_PPA success :ret:%d\n",status);
- pAd->PPAEnable=FALSE;
- }
- else
- {
- printk("unregister INF_AMAZON_SE_PPA fail :ret:%d\n",status);
- }
-
- }
- else
- {
- printk("INF_AMAZON_SE_PPA enable fail : there is no INF_AMAZON_SE_PPA module . \n");
- }
- }
-
- }
- else
- {
- printk("Invalid argument %d \n",aggre);
- return FALSE; //Invalid argument
- }
-
- return TRUE;
-
-}
-#endif // INF_AMAZON_PPA //
-
-
-/*
- ==========================================================================
- Description:
- Set IEEE80211H.
- This parameter is 1 when needs radar detection, otherwise 0
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_IEEE80211H_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- LONG ieee80211h;
-
- ieee80211h = simple_strtol(arg, 0, 10);
-
- if (ieee80211h == 1)
- pAd->CommonCfg.bIEEE80211H = TRUE;
- else if (ieee80211h == 0)
- pAd->CommonCfg.bIEEE80211H = FALSE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_IEEE80211H_Proc::(IEEE80211H=%d)\n", pAd->CommonCfg.bIEEE80211H));
-
- return TRUE;
-}
-
-
-#ifdef DBG
-/*
- ==========================================================================
- Description:
- For Debug information
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Debug_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- DBGPRINT(RT_DEBUG_TRACE, ("==> Set_Debug_Proc *******************\n"));
-
- if(simple_strtol(arg, 0, 10) <= RT_DEBUG_LOUD)
- RTDebugLevel = simple_strtol(arg, 0, 10);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== Set_Debug_Proc(RTDebugLevel = %ld)\n", RTDebugLevel));
-
- return TRUE;
-}
-#endif
-
-INT Show_DescInfo_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-#ifdef RTMP_MAC_PCI
- INT i, QueIdx=0;
-// ULONG RegValue;
- PRT28XX_RXD_STRUC pRxD;
- PTXD_STRUC pTxD;
- PRTMP_TX_RING pTxRing = &pAd->TxRing[QueIdx];
- PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing;
- PRTMP_RX_RING pRxRing = &pAd->RxRing;
-
- for(i=0;i<TX_RING_SIZE;i++)
- {
- pTxD = (PTXD_STRUC) pTxRing->Cell[i].AllocVa;
- DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
- hex_dump("Tx Descriptor", (PUCHAR)pTxD, 16);
- DBGPRINT(RT_DEBUG_OFF, ("pTxD->DMADONE = %x\n", pTxD->DMADONE));
- }
- DBGPRINT(RT_DEBUG_OFF, ("---------------------------------------------------\n"));
- for(i=0;i<MGMT_RING_SIZE;i++)
- {
- pTxD = (PTXD_STRUC) pMgmtRing->Cell[i].AllocVa;
- DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
- hex_dump("Mgmt Descriptor", (PUCHAR)pTxD, 16);
- DBGPRINT(RT_DEBUG_OFF, ("pMgmt->DMADONE = %x\n", pTxD->DMADONE));
- }
- DBGPRINT(RT_DEBUG_OFF, ("---------------------------------------------------\n"));
- for(i=0;i<RX_RING_SIZE;i++)
- {
- pRxD = (PRT28XX_RXD_STRUC) pRxRing->Cell[i].AllocVa;
- DBGPRINT(RT_DEBUG_OFF, ("Desc #%d\n",i));
- hex_dump("Rx Descriptor", (PUCHAR)pRxD, 16);
- DBGPRINT(RT_DEBUG_OFF, ("pRxD->DDONE = %x\n", pRxD->DDONE));
- }
-#endif // RTMP_MAC_PCI //
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Reset statistics counter
-
- Arguments:
- pAdapter Pointer to our adapter
- arg
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_ResetStatCounter_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- //UCHAR i;
- //MAC_TABLE_ENTRY *pEntry;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==>Set_ResetStatCounter_Proc\n"));
-
- // add the most up-to-date h/w raw counters into software counters
- NICUpdateRawCounters(pAd);
-
- NdisZeroMemory(&pAd->WlanCounters, sizeof(COUNTER_802_11));
- NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3));
- NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK));
-
- // Reset HotSpot counter
-
-
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Add WPA key process.
- In Adhoc WPANONE, bPairwise = 0; KeyIdx = 0;
-
- Arguments:
- pAd Pointer to our adapter
- pBuf Pointer to the where the key stored
-
- Return Value:
- NDIS_SUCCESS Add key successfully
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-
-BOOLEAN RTMPCheckStrPrintAble(
- IN CHAR *pInPutStr,
- IN UCHAR strLen)
-{
- UCHAR i=0;
-
- for (i=0; i<strLen; i++)
- {
- if ((pInPutStr[i] < 0x21) ||
- (pInPutStr[i] > 0x7E))
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Remove WPA Key process
-
- Arguments:
- pAd Pointer to our adapter
- pBuf Pointer to the where the key stored
-
- Return Value:
- NDIS_SUCCESS Add key successfully
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-#ifdef CONFIG_STA_SUPPORT
-VOID RTMPSetDesiredRates(
- IN PRTMP_ADAPTER pAdapter,
- IN LONG Rates)
-{
- NDIS_802_11_RATES aryRates;
-
- memset(&aryRates, 0x00, sizeof(NDIS_802_11_RATES));
- switch (pAdapter->CommonCfg.PhyMode)
- {
- case PHY_11A: // A only
- switch (Rates)
- {
- case 6000000: //6M
- aryRates[0] = 0x0c; // 6M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_0;
- break;
- case 9000000: //9M
- aryRates[0] = 0x12; // 9M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_1;
- break;
- case 12000000: //12M
- aryRates[0] = 0x18; // 12M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_2;
- break;
- case 18000000: //18M
- aryRates[0] = 0x24; // 18M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_3;
- break;
- case 24000000: //24M
- aryRates[0] = 0x30; // 24M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_4;
- break;
- case 36000000: //36M
- aryRates[0] = 0x48; // 36M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_5;
- break;
- case 48000000: //48M
- aryRates[0] = 0x60; // 48M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_6;
- break;
- case 54000000: //54M
- aryRates[0] = 0x6c; // 54M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_7;
- break;
- case -1: //Auto
- default:
- aryRates[0] = 0x6c; // 54Mbps
- aryRates[1] = 0x60; // 48Mbps
- aryRates[2] = 0x48; // 36Mbps
- aryRates[3] = 0x30; // 24Mbps
- aryRates[4] = 0x24; // 18M
- aryRates[5] = 0x18; // 12M
- aryRates[6] = 0x12; // 9M
- aryRates[7] = 0x0c; // 6M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- break;
- }
- break;
- case PHY_11BG_MIXED: // B/G Mixed
- case PHY_11B: // B only
- case PHY_11ABG_MIXED: // A/B/G Mixed
- default:
- switch (Rates)
- {
- case 1000000: //1M
- aryRates[0] = 0x02;
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_0;
- break;
- case 2000000: //2M
- aryRates[0] = 0x04;
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_1;
- break;
- case 5000000: //5.5M
- aryRates[0] = 0x0b; // 5.5M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_2;
- break;
- case 11000000: //11M
- aryRates[0] = 0x16; // 11M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_3;
- break;
- case 6000000: //6M
- aryRates[0] = 0x0c; // 6M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_0;
- break;
- case 9000000: //9M
- aryRates[0] = 0x12; // 9M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_1;
- break;
- case 12000000: //12M
- aryRates[0] = 0x18; // 12M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_2;
- break;
- case 18000000: //18M
- aryRates[0] = 0x24; // 18M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_3;
- break;
- case 24000000: //24M
- aryRates[0] = 0x30; // 24M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_4;
- break;
- case 36000000: //36M
- aryRates[0] = 0x48; // 36M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_5;
- break;
- case 48000000: //48M
- aryRates[0] = 0x60; // 48M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_6;
- break;
- case 54000000: //54M
- aryRates[0] = 0x6c; // 54M
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_7;
- break;
- case -1: //Auto
- default:
- if (pAdapter->CommonCfg.PhyMode == PHY_11B)
- { //B Only
- aryRates[0] = 0x16; // 11Mbps
- aryRates[1] = 0x0b; // 5.5Mbps
- aryRates[2] = 0x04; // 2Mbps
- aryRates[3] = 0x02; // 1Mbps
- }
- else
- { //(B/G) Mixed or (A/B/G) Mixed
- aryRates[0] = 0x6c; // 54Mbps
- aryRates[1] = 0x60; // 48Mbps
- aryRates[2] = 0x48; // 36Mbps
- aryRates[3] = 0x30; // 24Mbps
- aryRates[4] = 0x16; // 11Mbps
- aryRates[5] = 0x0b; // 5.5Mbps
- aryRates[6] = 0x04; // 2Mbps
- aryRates[7] = 0x02; // 1Mbps
- }
- pAdapter->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- break;
- }
- break;
- }
-
- NdisZeroMemory(pAdapter->CommonCfg.DesireRate, MAX_LEN_OF_SUPPORTED_RATES);
- NdisMoveMemory(pAdapter->CommonCfg.DesireRate, &aryRates, sizeof(NDIS_802_11_RATES));
- DBGPRINT(RT_DEBUG_TRACE, (" RTMPSetDesiredRates (%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x)\n",
- pAdapter->CommonCfg.DesireRate[0],pAdapter->CommonCfg.DesireRate[1],
- pAdapter->CommonCfg.DesireRate[2],pAdapter->CommonCfg.DesireRate[3],
- pAdapter->CommonCfg.DesireRate[4],pAdapter->CommonCfg.DesireRate[5],
- pAdapter->CommonCfg.DesireRate[6],pAdapter->CommonCfg.DesireRate[7] ));
- // Changing DesiredRate may affect the MAX TX rate we used to TX frames out
- MlmeUpdateTxRates(pAdapter, FALSE, 0);
-}
-
-NDIS_STATUS RTMPWPARemoveKeyProc(
- IN PRTMP_ADAPTER pAd,
- IN PVOID pBuf)
-{
- PNDIS_802_11_REMOVE_KEY pKey;
- ULONG KeyIdx;
- NDIS_STATUS Status = NDIS_STATUS_FAILURE;
- BOOLEAN bTxKey; // Set the key as transmit key
- BOOLEAN bPairwise; // Indicate the key is pairwise key
- BOOLEAN bKeyRSC; // indicate the receive SC set by KeyRSC value.
- // Otherwise, it will set by the NIC.
- BOOLEAN bAuthenticator; // indicate key is set by authenticator.
- INT i;
-
- DBGPRINT(RT_DEBUG_TRACE,("---> RTMPWPARemoveKeyProc\n"));
-
- pKey = (PNDIS_802_11_REMOVE_KEY) pBuf;
- KeyIdx = pKey->KeyIndex & 0xff;
- // Bit 31 of Add-key, Tx Key
- bTxKey = (pKey->KeyIndex & 0x80000000) ? TRUE : FALSE;
- // Bit 30 of Add-key PairwiseKey
- bPairwise = (pKey->KeyIndex & 0x40000000) ? TRUE : FALSE;
- // Bit 29 of Add-key KeyRSC
- bKeyRSC = (pKey->KeyIndex & 0x20000000) ? TRUE : FALSE;
- // Bit 28 of Add-key Authenticator
- bAuthenticator = (pKey->KeyIndex & 0x10000000) ? TRUE : FALSE;
-
- // 1. If bTx is TRUE, return failure information
- if (bTxKey == TRUE)
- return(NDIS_STATUS_INVALID_DATA);
-
- // 2. Check Pairwise Key
- if (bPairwise)
- {
- // a. If BSSID is broadcast, remove all pairwise keys.
- // b. If not broadcast, remove the pairwise specified by BSSID
- for (i = 0; i < SHARE_KEY_NUM; i++)
- {
- if (MAC_ADDR_EQUAL(pAd->SharedKey[BSS0][i].BssId, pKey->BSSID))
- {
- DBGPRINT(RT_DEBUG_TRACE,("RTMPWPARemoveKeyProc(KeyIdx=%d)\n", i));
- pAd->SharedKey[BSS0][i].KeyLen = 0;
- pAd->SharedKey[BSS0][i].CipherAlg = CIPHER_NONE;
- AsicRemoveSharedKeyEntry(pAd, BSS0, (UCHAR)i);
- Status = NDIS_STATUS_SUCCESS;
- break;
- }
- }
- }
- // 3. Group Key
- else
- {
- // a. If BSSID is broadcast, remove all group keys indexed
- // b. If BSSID matched, delete the group key indexed.
- DBGPRINT(RT_DEBUG_TRACE,("RTMPWPARemoveKeyProc(KeyIdx=%ld)\n", KeyIdx));
- pAd->SharedKey[BSS0][KeyIdx].KeyLen = 0;
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CIPHER_NONE;
- AsicRemoveSharedKeyEntry(pAd, BSS0, (UCHAR)KeyIdx);
- Status = NDIS_STATUS_SUCCESS;
- }
-
- return (Status);
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-#ifdef CONFIG_STA_SUPPORT
-/*
- ========================================================================
-
- Routine Description:
- Remove All WPA Keys
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPWPARemoveAllKeys(
- IN PRTMP_ADAPTER pAd)
-{
-
- UCHAR i;
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPWPARemoveAllKeys(AuthMode=%d, WepStatus=%d)\n", pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus));
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- // For WEP/CKIP, there is no need to remove it, since WinXP won't set it again after
- // Link up. And it will be replaced if user changed it.
- if (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)
- return;
-
- // For WPA-None, there is no need to remove it, since WinXP won't set it again after
- // Link up. And it will be replaced if user changed it.
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- return;
-
- // set BSSID wcid entry of the Pair-wise Key table as no-security mode
- AsicRemovePairwiseKeyEntry(pAd, BSS0, BSSID_WCID);
-
- // set all shared key mode as no-security.
- for (i = 0; i < SHARE_KEY_NUM; i++)
- {
- DBGPRINT(RT_DEBUG_TRACE,("remove %s key #%d\n", CipherName[pAd->SharedKey[BSS0][i].CipherAlg], i));
- NdisZeroMemory(&pAd->SharedKey[BSS0][i], sizeof(CIPHER_KEY));
-
- AsicRemoveSharedKeyEntry(pAd, BSS0, i);
- }
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-/*
- ========================================================================
-
- Routine Description:
- As STA's BSSID is a WC too, it uses shared key table.
- This function write correct unicast TX key to ASIC WCID.
- And we still make a copy in our MacTab.Content[BSSID_WCID].PairwiseKey.
- Caller guarantee TKIP/AES always has keyidx = 0. (pairwise key)
- Caller guarantee WEP calls this function when set Txkey, default key index=0~3.
-
- Arguments:
- pAd Pointer to our adapter
- pKey Pointer to the where the key stored
-
- Return Value:
- NDIS_SUCCESS Add key successfully
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-/*
- ========================================================================
- Routine Description:
- Change NIC PHY mode. Re-association may be necessary. possible settings
- include - PHY_11B, PHY_11BG_MIXED, PHY_11A, and PHY_11ABG_MIXED
-
- Arguments:
- pAd - Pointer to our adapter
- phymode -
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID RTMPSetPhyMode(
- IN PRTMP_ADAPTER pAd,
- IN ULONG phymode)
-{
- INT i;
- // the selected phymode must be supported by the RF IC encoded in E2PROM
-
- // if no change, do nothing
- /* bug fix
- if (pAd->CommonCfg.PhyMode == phymode)
- return;
- */
- pAd->CommonCfg.PhyMode = (UCHAR)phymode;
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPSetPhyMode : PhyMode=%d, channel=%d \n", pAd->CommonCfg.PhyMode, pAd->CommonCfg.Channel));
-#ifdef EXT_BUILD_CHANNEL_LIST
- BuildChannelListEx(pAd);
-#else
- BuildChannelList(pAd);
-#endif // EXT_BUILD_CHANNEL_LIST //
-
- // sanity check user setting
- for (i = 0; i < pAd->ChannelListNum; i++)
- {
- if (pAd->CommonCfg.Channel == pAd->ChannelList[i].Channel)
- break;
- }
-
- if (i == pAd->ChannelListNum)
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pAd->CommonCfg.Channel = FirstChannel(pAd);
-#endif // CONFIG_STA_SUPPORT //
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPSetPhyMode: channel is out of range, use first channel=%d \n", pAd->CommonCfg.Channel));
- }
-
- NdisZeroMemory(pAd->CommonCfg.SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- NdisZeroMemory(pAd->CommonCfg.ExtRate, MAX_LEN_OF_SUPPORTED_RATES);
- NdisZeroMemory(pAd->CommonCfg.DesireRate, MAX_LEN_OF_SUPPORTED_RATES);
- switch (phymode) {
- case PHY_11B:
- pAd->CommonCfg.SupRate[0] = 0x82; // 1 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[1] = 0x84; // 2 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[2] = 0x8B; // 5.5 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[3] = 0x96; // 11 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRateLen = 4;
- pAd->CommonCfg.ExtRateLen = 0;
- pAd->CommonCfg.DesireRate[0] = 2; // 1 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[1] = 4; // 2 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[2] = 11; // 5.5 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[3] = 22; // 11 mbps, in units of 0.5 Mbps
- //pAd->CommonCfg.HTPhyMode.field.MODE = MODE_CCK; // This MODE is only FYI. not use
- break;
-
- case PHY_11G:
- case PHY_11BG_MIXED:
- case PHY_11ABG_MIXED:
-#ifdef DOT11_N_SUPPORT
- case PHY_11N_2_4G:
- case PHY_11ABGN_MIXED:
- case PHY_11BGN_MIXED:
- case PHY_11GN_MIXED:
-#endif // DOT11_N_SUPPORT //
- pAd->CommonCfg.SupRate[0] = 0x82; // 1 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[1] = 0x84; // 2 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[2] = 0x8B; // 5.5 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[3] = 0x96; // 11 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[4] = 0x12; // 9 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[5] = 0x24; // 18 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[6] = 0x48; // 36 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRateLen = 8;
- pAd->CommonCfg.ExtRate[0] = 0x0C; // 6 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.ExtRate[1] = 0x18; // 12 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.ExtRate[2] = 0x30; // 24 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.ExtRate[3] = 0x60; // 48 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.ExtRateLen = 4;
- pAd->CommonCfg.DesireRate[0] = 2; // 1 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[1] = 4; // 2 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[2] = 11; // 5.5 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[3] = 22; // 11 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[4] = 12; // 6 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[5] = 18; // 9 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[6] = 24; // 12 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[7] = 36; // 18 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[8] = 48; // 24 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[9] = 72; // 36 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[10] = 96; // 48 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[11] = 108; // 54 mbps, in units of 0.5 Mbps
- break;
-
- case PHY_11A:
-#ifdef DOT11_N_SUPPORT
- case PHY_11AN_MIXED:
- case PHY_11AGN_MIXED:
- case PHY_11N_5G:
-#endif // DOT11_N_SUPPORT //
- pAd->CommonCfg.SupRate[0] = 0x8C; // 6 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[1] = 0x12; // 9 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[2] = 0x98; // 12 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[3] = 0x24; // 18 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[4] = 0xb0; // 24 mbps, in units of 0.5 Mbps, basic rate
- pAd->CommonCfg.SupRate[5] = 0x48; // 36 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[6] = 0x60; // 48 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.SupRateLen = 8;
- pAd->CommonCfg.ExtRateLen = 0;
- pAd->CommonCfg.DesireRate[0] = 12; // 6 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[1] = 18; // 9 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[2] = 24; // 12 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[3] = 36; // 18 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[4] = 48; // 24 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[5] = 72; // 36 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[6] = 96; // 48 mbps, in units of 0.5 Mbps
- pAd->CommonCfg.DesireRate[7] = 108; // 54 mbps, in units of 0.5 Mbps
- //pAd->CommonCfg.HTPhyMode.field.MODE = MODE_OFDM; // This MODE is only FYI. not use
- break;
-
- default:
- break;
- }
-
-
- pAd->CommonCfg.BandState = UNKNOWN_BAND;
-}
-
-
-#ifdef DOT11_N_SUPPORT
-/*
- ========================================================================
- Routine Description:
- Caller ensures we has 802.11n support.
- Calls at setting HT from AP/STASetinformation
-
- Arguments:
- pAd - Pointer to our adapter
- phymode -
-
- ========================================================================
-*/
-VOID RTMPSetHT(
- IN PRTMP_ADAPTER pAd,
- IN OID_SET_HT_PHYMODE *pHTPhyMode)
-{
- //ULONG *pmcs;
- UINT32 Value = 0;
- UCHAR BBPValue = 0;
- UCHAR BBP3Value = 0;
- UCHAR RxStream = pAd->CommonCfg.RxStream;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetHT : HT_mode(%d), ExtOffset(%d), MCS(%d), BW(%d), STBC(%d), SHORTGI(%d)\n",
- pHTPhyMode->HtMode, pHTPhyMode->ExtOffset,
- pHTPhyMode->MCS, pHTPhyMode->BW,
- pHTPhyMode->STBC, pHTPhyMode->SHORTGI));
-
- // Don't zero supportedHyPhy structure.
- RTMPZeroMemory(&pAd->CommonCfg.HtCapability, sizeof(pAd->CommonCfg.HtCapability));
- RTMPZeroMemory(&pAd->CommonCfg.AddHTInfo, sizeof(pAd->CommonCfg.AddHTInfo));
- RTMPZeroMemory(&pAd->CommonCfg.NewExtChanOffset, sizeof(pAd->CommonCfg.NewExtChanOffset));
- RTMPZeroMemory(&pAd->CommonCfg.DesiredHtPhy, sizeof(pAd->CommonCfg.DesiredHtPhy));
-
- if (pAd->CommonCfg.bRdg)
- {
- pAd->CommonCfg.HtCapability.ExtHtCapInfo.PlusHTC = 1;
- pAd->CommonCfg.HtCapability.ExtHtCapInfo.RDGSupport = 1;
- }
- else
- {
- pAd->CommonCfg.HtCapability.ExtHtCapInfo.PlusHTC = 0;
- pAd->CommonCfg.HtCapability.ExtHtCapInfo.RDGSupport = 0;
- }
-
- pAd->CommonCfg.HtCapability.HtCapParm.MaxRAmpduFactor = 3;
- pAd->CommonCfg.DesiredHtPhy.MaxRAmpduFactor = 3;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetHT : RxBAWinLimit = %d\n", pAd->CommonCfg.BACapability.field.RxBAWinLimit));
-
- // Mimo power save, A-MSDU size,
- pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable;
- pAd->CommonCfg.DesiredHtPhy.AmsduSize = (UCHAR)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.DesiredHtPhy.MimoPs = (UCHAR)pAd->CommonCfg.BACapability.field.MMPSmode;
- pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
-
- pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
- pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetHT : AMsduSize = %d, MimoPs = %d, MpduDensity = %d, MaxRAmpduFactor = %d\n",
- pAd->CommonCfg.DesiredHtPhy.AmsduSize,
- pAd->CommonCfg.DesiredHtPhy.MimoPs,
- pAd->CommonCfg.DesiredHtPhy.MpduDensity,
- pAd->CommonCfg.DesiredHtPhy.MaxRAmpduFactor));
-
- if(pHTPhyMode->HtMode == HTMODE_GF)
- {
- pAd->CommonCfg.HtCapability.HtCapInfo.GF = 1;
- pAd->CommonCfg.DesiredHtPhy.GF = 1;
- }
- else
- pAd->CommonCfg.DesiredHtPhy.GF = 0;
-
- // Decide Rx MCSSet
- switch (RxStream)
- {
- case 1:
- pAd->CommonCfg.HtCapability.MCSSet[0] = 0xff;
- pAd->CommonCfg.HtCapability.MCSSet[1] = 0x00;
- break;
-
- case 2:
- pAd->CommonCfg.HtCapability.MCSSet[0] = 0xff;
- pAd->CommonCfg.HtCapability.MCSSet[1] = 0xff;
- break;
-
- case 3: // 3*3
- pAd->CommonCfg.HtCapability.MCSSet[0] = 0xff;
- pAd->CommonCfg.HtCapability.MCSSet[1] = 0xff;
- pAd->CommonCfg.HtCapability.MCSSet[2] = 0xff;
- break;
- }
-
- if (pAd->CommonCfg.bForty_Mhz_Intolerant && (pAd->CommonCfg.Channel <= 14) && (pHTPhyMode->BW == BW_40) )
- {
- pHTPhyMode->BW = BW_20;
- pAd->CommonCfg.HtCapability.HtCapInfo.Forty_Mhz_Intolerant = 1;
- }
-
- if(pHTPhyMode->BW == BW_40)
- {
- pAd->CommonCfg.HtCapability.MCSSet[4] = 0x1; // MCS 32
- pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth = 1;
- if (pAd->CommonCfg.Channel <= 14)
- pAd->CommonCfg.HtCapability.HtCapInfo.CCKmodein40 = 1;
-
- pAd->CommonCfg.DesiredHtPhy.ChannelWidth = 1;
- pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth = 1;
- pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset = (pHTPhyMode->ExtOffset == EXTCHA_BELOW)? (EXTCHA_BELOW): EXTCHA_ABOVE;
- // Set Regsiter for extension channel position.
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Value);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBP3Value);
- if ((pHTPhyMode->ExtOffset == EXTCHA_BELOW))
- {
- Value |= 0x1;
- BBP3Value |= (0x20);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
- }
- else if ((pHTPhyMode->ExtOffset == EXTCHA_ABOVE))
- {
- Value &= 0xfe;
- BBP3Value &= (~0x20);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
- }
-
- // Turn on BBP 40MHz mode now only as AP .
- // Sta can turn on BBP 40MHz after connection with 40MHz AP. Sta only broadcast 40MHz capability before connection.
- if ((pAd->OpMode == OPMODE_AP) || INFRA_ON(pAd) || ADHOC_ON(pAd)
- )
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- BBPValue |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBP3Value);
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- }
- }
- else
- {
- pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth = 0;
- pAd->CommonCfg.DesiredHtPhy.ChannelWidth = 0;
- pAd->CommonCfg.AddHTInfo.AddHtInfo.RecomWidth = 0;
- pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset = EXTCHA_NONE;
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
- // Turn on BBP 20MHz mode by request here.
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- pAd->CommonCfg.BBPCurrentBW = BW_20;
- }
- }
-
- if(pHTPhyMode->STBC == STBC_USE)
- {
- pAd->CommonCfg.HtCapability.HtCapInfo.TxSTBC = 1;
- pAd->CommonCfg.DesiredHtPhy.TxSTBC = 1;
- pAd->CommonCfg.HtCapability.HtCapInfo.RxSTBC = 1;
- pAd->CommonCfg.DesiredHtPhy.RxSTBC = 1;
- }
- else
- {
- pAd->CommonCfg.DesiredHtPhy.TxSTBC = 0;
- pAd->CommonCfg.DesiredHtPhy.RxSTBC = 0;
- }
-
- if(pHTPhyMode->SHORTGI == GI_400)
- {
- pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor20 = 1;
- pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor40 = 1;
- pAd->CommonCfg.DesiredHtPhy.ShortGIfor20 = 1;
- pAd->CommonCfg.DesiredHtPhy.ShortGIfor40 = 1;
- }
- else
- {
- pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor20 = 0;
- pAd->CommonCfg.HtCapability.HtCapInfo.ShortGIfor40 = 0;
- pAd->CommonCfg.DesiredHtPhy.ShortGIfor20 = 0;
- pAd->CommonCfg.DesiredHtPhy.ShortGIfor40 = 0;
- }
-
- // We support link adaptation for unsolicit MCS feedback, set to 2.
- pAd->CommonCfg.HtCapability.ExtHtCapInfo.MCSFeedback = MCSFBK_NONE; //MCSFBK_UNSOLICIT;
- pAd->CommonCfg.AddHTInfo.ControlChan = pAd->CommonCfg.Channel;
- // 1, the extension channel above the control channel.
-
- // EDCA parameters used for AP's own transmission
- if (pAd->CommonCfg.APEdcaParm.bValid == FALSE)
- {
- pAd->CommonCfg.APEdcaParm.bValid = TRUE;
- pAd->CommonCfg.APEdcaParm.Aifsn[0] = 3;
- pAd->CommonCfg.APEdcaParm.Aifsn[1] = 7;
- pAd->CommonCfg.APEdcaParm.Aifsn[2] = 1;
- pAd->CommonCfg.APEdcaParm.Aifsn[3] = 1;
-
- pAd->CommonCfg.APEdcaParm.Cwmin[0] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[1] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[2] = 3;
- pAd->CommonCfg.APEdcaParm.Cwmin[3] = 2;
-
- pAd->CommonCfg.APEdcaParm.Cwmax[0] = 6;
- pAd->CommonCfg.APEdcaParm.Cwmax[1] = 10;
- pAd->CommonCfg.APEdcaParm.Cwmax[2] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmax[3] = 3;
-
- pAd->CommonCfg.APEdcaParm.Txop[0] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[1] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[2] = 94;
- pAd->CommonCfg.APEdcaParm.Txop[3] = 47;
- }
- AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- RTMPSetIndividualHT(pAd, 0);
- }
-#endif // CONFIG_STA_SUPPORT //
-
-}
-
-/*
- ========================================================================
- Routine Description:
- Caller ensures we has 802.11n support.
- Calls at setting HT from AP/STASetinformation
-
- Arguments:
- pAd - Pointer to our adapter
- phymode -
-
- ========================================================================
-*/
-VOID RTMPSetIndividualHT(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR apidx)
-{
- PRT_HT_PHY_INFO pDesired_ht_phy = NULL;
- UCHAR TxStream = pAd->CommonCfg.TxStream;
- UCHAR DesiredMcs = MCS_AUTO;
-
- do
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pDesired_ht_phy = &pAd->StaCfg.DesiredHtPhyInfo;
- DesiredMcs = pAd->StaCfg.DesiredTransmitSetting.field.MCS;
- //pAd->StaCfg.bAutoTxRateSwitch = (DesiredMcs == MCS_AUTO) ? TRUE : FALSE;
- break;
- }
-#endif // CONFIG_STA_SUPPORT //
- } while (FALSE);
-
- if (pDesired_ht_phy == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPSetIndividualHT: invalid apidx(%d)\n", apidx));
- return;
- }
- RTMPZeroMemory(pDesired_ht_phy, sizeof(RT_HT_PHY_INFO));
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetIndividualHT : Desired MCS = %d\n", DesiredMcs));
- // Check the validity of MCS
- if ((TxStream == 1) && ((DesiredMcs >= MCS_8) && (DesiredMcs <= MCS_15)))
- {
- DBGPRINT(RT_DEBUG_WARN, ("RTMPSetIndividualHT: MCS(%d) is invalid in 1S, reset it as MCS_7\n", DesiredMcs));
- DesiredMcs = MCS_7;
- }
-
- if ((pAd->CommonCfg.DesiredHtPhy.ChannelWidth == BW_20) && (DesiredMcs == MCS_32))
- {
- DBGPRINT(RT_DEBUG_WARN, ("RTMPSetIndividualHT: MCS_32 is only supported in 40-MHz, reset it as MCS_0\n"));
- DesiredMcs = MCS_0;
- }
-
- pDesired_ht_phy->bHtEnable = TRUE;
-
- // Decide desired Tx MCS
- switch (TxStream)
- {
- case 1:
- if (DesiredMcs == MCS_AUTO)
- {
- pDesired_ht_phy->MCSSet[0]= 0xff;
- pDesired_ht_phy->MCSSet[1]= 0x00;
- }
- else if (DesiredMcs <= MCS_7)
- {
- pDesired_ht_phy->MCSSet[0]= 1<<DesiredMcs;
- pDesired_ht_phy->MCSSet[1]= 0x00;
- }
- break;
-
- case 2:
- if (DesiredMcs == MCS_AUTO)
- {
- pDesired_ht_phy->MCSSet[0]= 0xff;
- pDesired_ht_phy->MCSSet[1]= 0xff;
- }
- else if (DesiredMcs <= MCS_15)
- {
- ULONG mode;
-
- mode = DesiredMcs / 8;
- if (mode < 2)
- pDesired_ht_phy->MCSSet[mode] = (1 << (DesiredMcs - mode * 8));
- }
- break;
-
- case 3: // 3*3
- if (DesiredMcs == MCS_AUTO)
- {
- /* MCS0 ~ MCS23, 3 bytes */
- pDesired_ht_phy->MCSSet[0]= 0xff;
- pDesired_ht_phy->MCSSet[1]= 0xff;
- pDesired_ht_phy->MCSSet[2]= 0xff;
- }
- else if (DesiredMcs <= MCS_23)
- {
- ULONG mode;
-
- mode = DesiredMcs / 8;
- if (mode < 3)
- pDesired_ht_phy->MCSSet[mode] = (1 << (DesiredMcs - mode * 8));
- }
- break;
- }
-
- if(pAd->CommonCfg.DesiredHtPhy.ChannelWidth == BW_40)
- {
- if (DesiredMcs == MCS_AUTO || DesiredMcs == MCS_32)
- pDesired_ht_phy->MCSSet[4] = 0x1;
- }
-
- // update HT Rate setting
- if (pAd->OpMode == OPMODE_STA)
- MlmeUpdateHtTxRates(pAd, BSS0);
- else
- MlmeUpdateHtTxRates(pAd, apidx);
-}
-
-
-/*
- ========================================================================
- Routine Description:
- Update HT IE from our capability.
-
- Arguments:
- Send all HT IE in beacon/probe rsp/assoc rsp/action frame.
-
-
- ========================================================================
-*/
-VOID RTMPUpdateHTIE(
- IN RT_HT_CAPABILITY *pRtHt,
- IN UCHAR *pMcsSet,
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT ADD_HT_INFO_IE *pAddHtInfo)
-{
- RTMPZeroMemory(pHtCapability, sizeof(HT_CAPABILITY_IE));
- RTMPZeroMemory(pAddHtInfo, sizeof(ADD_HT_INFO_IE));
-
- pHtCapability->HtCapInfo.ChannelWidth = pRtHt->ChannelWidth;
- pHtCapability->HtCapInfo.MimoPs = pRtHt->MimoPs;
- pHtCapability->HtCapInfo.GF = pRtHt->GF;
- pHtCapability->HtCapInfo.ShortGIfor20 = pRtHt->ShortGIfor20;
- pHtCapability->HtCapInfo.ShortGIfor40 = pRtHt->ShortGIfor40;
- pHtCapability->HtCapInfo.TxSTBC = pRtHt->TxSTBC;
- pHtCapability->HtCapInfo.RxSTBC = pRtHt->RxSTBC;
- pHtCapability->HtCapInfo.AMsduSize = pRtHt->AmsduSize;
- pHtCapability->HtCapParm.MaxRAmpduFactor = pRtHt->MaxRAmpduFactor;
- pHtCapability->HtCapParm.MpduDensity = pRtHt->MpduDensity;
-
- pAddHtInfo->AddHtInfo.ExtChanOffset = pRtHt->ExtChanOffset ;
- pAddHtInfo->AddHtInfo.RecomWidth = pRtHt->RecomWidth;
- pAddHtInfo->AddHtInfo2.OperaionMode = pRtHt->OperaionMode;
- pAddHtInfo->AddHtInfo2.NonGfPresent = pRtHt->NonGfPresent;
- RTMPMoveMemory(pAddHtInfo->MCSSet, /*pRtHt->MCSSet*/pMcsSet, 4); // rt2860 only support MCS max=32, no need to copy all 16 uchar.
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPUpdateHTIE <== \n"));
-}
-#endif // DOT11_N_SUPPORT //
-
-/*
- ========================================================================
- Description:
- Add Client security information into ASIC WCID table and IVEIV table.
- Return:
- ========================================================================
-*/
-VOID RTMPAddWcidAttributeEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIdx,
- IN UCHAR KeyIdx,
- IN UCHAR CipherAlg,
- IN MAC_TABLE_ENTRY *pEntry)
-{
- UINT32 WCIDAttri = 0;
- USHORT offset;
- UCHAR IVEIV = 0;
- USHORT Wcid = 0;
-
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (BssIdx > BSS0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("RTMPAddWcidAttributeEntry: The BSS-index(%d) is out of range for Infra link. \n", BssIdx));
- return;
- }
-
- // 1. In ADHOC mode, the AID is wcid number. And NO mesh link exists.
- // 2. In Infra mode, the AID:1 MUST be wcid of infra STA.
- // the AID:2~ assign to mesh link entry.
- if (pEntry)
- Wcid = pEntry->Aid;
- else
- Wcid = MCAST_WCID;
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- // Update WCID attribute table
- offset = MAC_WCID_ATTRIBUTE_BASE + (Wcid * HW_WCID_ATTRI_SIZE);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pEntry && pEntry->ValidAsMesh)
- WCIDAttri = (CipherAlg<<1) | PAIRWISEKEYTABLE;
-#ifdef QOS_DLS_SUPPORT
- else if ((pEntry) && (pEntry->ValidAsDls) &&
- ((CipherAlg == CIPHER_TKIP) ||
- (CipherAlg == CIPHER_TKIP_NO_MIC) ||
- (CipherAlg == CIPHER_AES) ||
- (CipherAlg == CIPHER_NONE)))
- WCIDAttri = (CipherAlg<<1) | PAIRWISEKEYTABLE;
-#endif // QOS_DLS_SUPPORT //
- else
- WCIDAttri = (CipherAlg<<1) | SHAREDKEYTABLE;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- RTMP_IO_WRITE32(pAd, offset, WCIDAttri);
-
-
- // Update IV/EIV table
- offset = MAC_IVEIV_TABLE_BASE + (Wcid * HW_IVEIV_ENTRY_SIZE);
-
- // WPA mode
- if ((CipherAlg == CIPHER_TKIP) || (CipherAlg == CIPHER_TKIP_NO_MIC) || (CipherAlg == CIPHER_AES))
- {
- // Eiv bit on. keyid always is 0 for pairwise key
- IVEIV = (KeyIdx <<6) | 0x20;
- }
- else
- {
- // WEP KeyIdx is default tx key.
- IVEIV = (KeyIdx << 6);
- }
-
- // For key index and ext IV bit, so only need to update the position(offset+3).
-#ifdef RTMP_MAC_PCI
- RTMP_IO_WRITE8(pAd, offset+3, IVEIV);
-#endif // RTMP_MAC_PCI //
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPAddWcidAttributeEntry: WCID #%d, KeyIndex #%d, Alg=%s\n",Wcid, KeyIdx, CipherName[CipherAlg]));
- DBGPRINT(RT_DEBUG_TRACE,(" WCIDAttri = 0x%x \n", WCIDAttri));
-
-}
-
-/*
- ==========================================================================
- Description:
- Parse encryption type
-Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- ==========================================================================
-*/
-PSTRING GetEncryptType(CHAR enc)
-{
- if(enc == Ndis802_11WEPDisabled)
- return "NONE";
- if(enc == Ndis802_11WEPEnabled)
- return "WEP";
- if(enc == Ndis802_11Encryption2Enabled)
- return "TKIP";
- if(enc == Ndis802_11Encryption3Enabled)
- return "AES";
- if(enc == Ndis802_11Encryption4Enabled)
- return "TKIPAES";
- else
- return "UNKNOW";
-}
-
-PSTRING GetAuthMode(CHAR auth)
-{
- if(auth == Ndis802_11AuthModeOpen)
- return "OPEN";
- if(auth == Ndis802_11AuthModeShared)
- return "SHARED";
- if(auth == Ndis802_11AuthModeAutoSwitch)
- return "AUTOWEP";
- if(auth == Ndis802_11AuthModeWPA)
- return "WPA";
- if(auth == Ndis802_11AuthModeWPAPSK)
- return "WPAPSK";
- if(auth == Ndis802_11AuthModeWPANone)
- return "WPANONE";
- if(auth == Ndis802_11AuthModeWPA2)
- return "WPA2";
- if(auth == Ndis802_11AuthModeWPA2PSK)
- return "WPA2PSK";
- if(auth == Ndis802_11AuthModeWPA1WPA2)
- return "WPA1WPA2";
- if(auth == Ndis802_11AuthModeWPA1PSKWPA2PSK)
- return "WPA1PSKWPA2PSK";
-
- return "UNKNOW";
-}
-
-
-/*
- ==========================================================================
- Description:
- Get site survey results
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) UI needs to wait 4 seconds after issue a site survey command
- 2.) iwpriv ra0 get_site_survey
- 3.) UI needs to prepare at least 4096bytes to get the results
- ==========================================================================
-*/
-#define LINE_LEN (4+33+20+23+9+7+3) // Channel+SSID+Bssid+Security+Signal+WiressMode+NetworkType
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-VOID RTMPCommSiteSurveyData(
- IN PSTRING msg,
- IN PBSS_ENTRY pBss)
-{
- INT Rssi = 0;
- UINT Rssi_Quality = 0;
- NDIS_802_11_NETWORK_TYPE wireless_mode;
- CHAR Ssid[MAX_LEN_OF_SSID +1];
- STRING SecurityStr[32] = {0};
- NDIS_802_11_ENCRYPTION_STATUS ap_cipher = Ndis802_11EncryptionDisabled;
- NDIS_802_11_AUTHENTICATION_MODE ap_auth_mode = Ndis802_11AuthModeOpen;
-
- memset(Ssid, 0 ,(MAX_LEN_OF_SSID +1));
-
- //Channel
- sprintf(msg+strlen(msg),"%-4d", pBss->Channel);
- //SSID
- memcpy(Ssid, pBss->Ssid, pBss->SsidLen);
- Ssid[pBss->SsidLen] = '\0';
- sprintf(msg+strlen(msg),"%-33s", Ssid);
- //BSSID
- sprintf(msg+strlen(msg),"%02x:%02x:%02x:%02x:%02x:%02x ",
- pBss->Bssid[0],
- pBss->Bssid[1],
- pBss->Bssid[2],
- pBss->Bssid[3],
- pBss->Bssid[4],
- pBss->Bssid[5]);
-
- //Security
- if ((Ndis802_11AuthModeWPA <= pBss->AuthMode) &&
- (pBss->AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK))
- {
- if (pBss->AuthModeAux == Ndis802_11AuthModeWPANone)
- {
- ap_auth_mode = pBss->AuthMode;
- if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
- ap_cipher = pBss->WPA.PairCipher;
- else
- ap_cipher = Ndis802_11Encryption4Enabled;
- }
- else if (pBss->AuthModeAux == Ndis802_11AuthModeOpen)
- {
- ap_auth_mode = pBss->AuthMode;
- if ((ap_auth_mode == Ndis802_11AuthModeWPA) ||
- (ap_auth_mode == Ndis802_11AuthModeWPAPSK))
- {
- if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
- ap_cipher = pBss->WPA.PairCipher;
- else
- ap_cipher = Ndis802_11Encryption4Enabled;
- }
- else if ((ap_auth_mode == Ndis802_11AuthModeWPA2) ||
- (ap_auth_mode == Ndis802_11AuthModeWPA2PSK))
- {
- if (pBss->WPA2.PairCipherAux == Ndis802_11WEPDisabled)
- ap_cipher = pBss->WPA2.PairCipher;
- else
- ap_cipher = Ndis802_11Encryption4Enabled;
- }
- }
- else if ((pBss->AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pBss->AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- if ((pBss->AuthModeAux == Ndis802_11AuthModeWPAPSK) ||
- (pBss->AuthModeAux == Ndis802_11AuthModeWPA2PSK))
- ap_auth_mode = Ndis802_11AuthModeWPA1PSKWPA2PSK;
- else
- ap_auth_mode = pBss->AuthMode;
-
- if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher)
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux))
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
- (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled))
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
- (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled))
- ap_cipher = pBss->WPA.PairCipher;
- }
- else if ((pBss->AuthMode == Ndis802_11AuthModeWPA) ||
- (pBss->AuthMode == Ndis802_11AuthModeWPA2))
- {
- if ((pBss->AuthModeAux == Ndis802_11AuthModeWPA) ||
- (pBss->AuthMode == Ndis802_11AuthModeWPA2))
- ap_auth_mode = Ndis802_11AuthModeWPA1WPA2;
- else
- ap_auth_mode = pBss->AuthMode;
-
- if (pBss->WPA.PairCipher != pBss->WPA2.PairCipher)
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux != pBss->WPA2.PairCipherAux))
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
- (pBss->WPA.PairCipherAux != Ndis802_11WEPDisabled))
- ap_cipher = Ndis802_11Encryption4Enabled;
- else if ((pBss->WPA.PairCipher == pBss->WPA2.PairCipher) &&
- (pBss->WPA.PairCipherAux == pBss->WPA2.PairCipherAux) &&
- (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled))
- ap_cipher = pBss->WPA.PairCipher;
- }
-
- sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));
- }
- else
- {
- ap_auth_mode = pBss->AuthMode;
- ap_cipher = pBss->WepStatus;
- if (ap_cipher == Ndis802_11WEPDisabled)
- sprintf(SecurityStr, "NONE");
- else if (ap_cipher == Ndis802_11WEPEnabled)
- sprintf(SecurityStr, "WEP");
- else
- sprintf(SecurityStr, "%s/%s", GetAuthMode((CHAR)ap_auth_mode), GetEncryptType((CHAR)ap_cipher));
- }
-
- sprintf(msg+strlen(msg), "%-23s", SecurityStr);
-
- // Rssi
- Rssi = (INT)pBss->Rssi;
- if (Rssi >= -50)
- Rssi_Quality = 100;
- else if (Rssi >= -80) // between -50 ~ -80dbm
- Rssi_Quality = (UINT)(24 + ((Rssi + 80) * 26)/10);
- else if (Rssi >= -90) // between -80 ~ -90dbm
- Rssi_Quality = (UINT)(((Rssi + 90) * 26)/10);
- else // < -84 dbm
- Rssi_Quality = 0;
- sprintf(msg+strlen(msg),"%-9d", Rssi_Quality);
- // Wireless Mode
- wireless_mode = NetworkTypeInUseSanity(pBss);
- if (wireless_mode == Ndis802_11FH ||
- wireless_mode == Ndis802_11DS)
- sprintf(msg+strlen(msg),"%-7s", "11b");
- else if (wireless_mode == Ndis802_11OFDM5)
- sprintf(msg+strlen(msg),"%-7s", "11a");
- else if (wireless_mode == Ndis802_11OFDM5_N)
- sprintf(msg+strlen(msg),"%-7s", "11a/n");
- else if (wireless_mode == Ndis802_11OFDM24)
- sprintf(msg+strlen(msg),"%-7s", "11b/g");
- else if (wireless_mode == Ndis802_11OFDM24_N)
- sprintf(msg+strlen(msg),"%-7s", "11b/g/n");
- else
- sprintf(msg+strlen(msg),"%-7s", "unknow");
- //Network Type
- if (pBss->BssType == BSS_ADHOC)
- sprintf(msg+strlen(msg),"%-3s", " Ad");
- else
- sprintf(msg+strlen(msg),"%-3s", " In");
-
- sprintf(msg+strlen(msg),"\n");
-
- return;
-}
-
-VOID RTMPIoctlGetSiteSurvey(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
-{
- PSTRING msg;
- INT i=0;
- INT WaitCnt;
- INT Status=0;
- INT max_len = LINE_LEN;
- PBSS_ENTRY pBss;
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
- os_alloc_mem(NULL, (PUCHAR *)&msg, sizeof(CHAR)*((MAX_LEN_OF_BSS_TABLE)*max_len));
-
- if (msg == NULL)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPIoctlGetSiteSurvey - msg memory alloc fail.\n"));
- return;
- }
-
- memset(msg, 0 ,(MAX_LEN_OF_BSS_TABLE)*max_len );
- sprintf(msg,"%s","\n");
- sprintf(msg+strlen(msg),"%-4s%-33s%-20s%-23s%-9s%-7s%-3s\n",
- "Ch", "SSID", "BSSID", "Security", "Siganl(%)", "W-Mode", " NT");
-
-#ifdef CONFIG_STA_SUPPORT
-
-#endif // CONFIG_STA_SUPPORT //
-
- WaitCnt = 0;
-#ifdef CONFIG_STA_SUPPORT
- pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
- while ((ScanRunning(pAdapter) == TRUE) && (WaitCnt++ < 200))
- OS_WAIT(500);
-#endif // CONFIG_STA_SUPPORT //
-
- for(i=0; i<pAdapter->ScanTab.BssNr ;i++)
- {
- pBss = &pAdapter->ScanTab.BssEntry[i];
-
- if( pBss->Channel==0)
- break;
-
- if((strlen(msg)+max_len ) >= IW_SCAN_MAX_DATA)
- break;
-
-
- RTMPCommSiteSurveyData(msg, pBss);
-
-#ifdef CONFIG_STA_SUPPORT
-
-#endif // CONFIG_STA_SUPPORT //
- }
-
-#ifdef CONFIG_STA_SUPPORT
- pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
-#endif // CONFIG_STA_SUPPORT //
- wrq->u.data.length = strlen(msg);
- Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPIoctlGetSiteSurvey - wrq->u.data.length = %d\n", wrq->u.data.length));
- os_free_mem(NULL, (PUCHAR)msg);
-}
-
-#define MAC_LINE_LEN (14+4+4+10+10+10+6+6) // Addr+aid+psm+datatime+rxbyte+txbyte+current tx rate+last tx rate
-VOID RTMPIoctlGetMacTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq)
-{
- INT i;
- RT_802_11_MAC_TABLE MacTab;
- char *msg;
-
- MacTab.Num = 0;
- for (i=0; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- if (pAd->MacTab.Content[i].ValidAsCLI && (pAd->MacTab.Content[i].Sst == SST_ASSOC))
- {
- COPY_MAC_ADDR(MacTab.Entry[MacTab.Num].Addr, &pAd->MacTab.Content[i].Addr);
- MacTab.Entry[MacTab.Num].Aid = (UCHAR)pAd->MacTab.Content[i].Aid;
- MacTab.Entry[MacTab.Num].Psm = pAd->MacTab.Content[i].PsMode;
-#ifdef DOT11_N_SUPPORT
- MacTab.Entry[MacTab.Num].MimoPs = pAd->MacTab.Content[i].MmpsMode;
-#endif // DOT11_N_SUPPORT //
-
- // Fill in RSSI per entry
- MacTab.Entry[MacTab.Num].AvgRssi0 = pAd->MacTab.Content[i].RssiSample.AvgRssi0;
- MacTab.Entry[MacTab.Num].AvgRssi1 = pAd->MacTab.Content[i].RssiSample.AvgRssi1;
- MacTab.Entry[MacTab.Num].AvgRssi2 = pAd->MacTab.Content[i].RssiSample.AvgRssi2;
-
- // the connected time per entry
- MacTab.Entry[MacTab.Num].ConnectedTime = pAd->MacTab.Content[i].StaConnectTime;
- MacTab.Entry[MacTab.Num].TxRate.field.MCS = pAd->MacTab.Content[i].HTPhyMode.field.MCS;
- MacTab.Entry[MacTab.Num].TxRate.field.BW = pAd->MacTab.Content[i].HTPhyMode.field.BW;
- MacTab.Entry[MacTab.Num].TxRate.field.ShortGI = pAd->MacTab.Content[i].HTPhyMode.field.ShortGI;
- MacTab.Entry[MacTab.Num].TxRate.field.STBC = pAd->MacTab.Content[i].HTPhyMode.field.STBC;
- MacTab.Entry[MacTab.Num].TxRate.field.rsv = pAd->MacTab.Content[i].HTPhyMode.field.rsv;
- MacTab.Entry[MacTab.Num].TxRate.field.MODE = pAd->MacTab.Content[i].HTPhyMode.field.MODE;
- MacTab.Entry[MacTab.Num].TxRate.word = pAd->MacTab.Content[i].HTPhyMode.word;
-
- MacTab.Num += 1;
- }
- }
- wrq->u.data.length = sizeof(RT_802_11_MAC_TABLE);
- if (copy_to_user(wrq->u.data.pointer, &MacTab, wrq->u.data.length))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s: copy_to_user() fail\n", __FUNCTION__));
- }
-
- msg = kmalloc(sizeof(CHAR)*(MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN), MEM_ALLOC_FLAG);
- if (msg == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():Alloc memory failed\n", __FUNCTION__));
- return;
- }
- memset(msg, 0 ,MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN );
- sprintf(msg,"%s","\n");
- sprintf(msg+strlen(msg),"%-14s%-4s%-4s%-10s%-10s%-10s%-6s%-6s\n",
- "MAC", "AID", "PSM", "LDT", "RxB", "TxB","CTxR", "LTxR");
-
- for (i=0; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[i];
- if (pEntry->ValidAsCLI && (pEntry->Sst == SST_ASSOC))
- {
- if((strlen(msg)+MAC_LINE_LEN ) >= (MAX_LEN_OF_MAC_TABLE*MAC_LINE_LEN) )
- break;
- sprintf(msg+strlen(msg),"%02x%02x%02x%02x%02x%02x ",
- pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2],
- pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]);
- sprintf(msg+strlen(msg),"%-4d", (int)pEntry->Aid);
- sprintf(msg+strlen(msg),"%-4d", (int)pEntry->PsMode);
- sprintf(msg+strlen(msg),"%-10d",0/*pAd->MacTab.Content[i].HSCounter.LastDataPacketTime*/); // ToDo
- sprintf(msg+strlen(msg),"%-10d",0/*pAd->MacTab.Content[i].HSCounter.TotalRxByteCount*/); // ToDo
- sprintf(msg+strlen(msg),"%-10d",0/*pAd->MacTab.Content[i].HSCounter.TotalTxByteCount*/); // ToDo
- sprintf(msg+strlen(msg),"%-6d",RateIdToMbps[pAd->MacTab.Content[i].CurrTxRate]);
- sprintf(msg+strlen(msg),"%-6d\n",0/*RateIdToMbps[pAd->MacTab.Content[i].LastTxRate]*/); // ToDo
- }
- }
- // for compatible with old API just do the printk to console
- //wrq->u.data.length = strlen(msg);
- //if (copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s", msg));
- }
-
- kfree(msg);
-}
-
-
-#ifdef DOT11_N_SUPPORT
-INT Set_BASetup_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR mac[6], tid;
- PSTRING token;
- STRING sepValue[] = ":", DASH = '-';
- INT i;
- MAC_TABLE_ENTRY *pEntry;
-
-/*
- The BASetup inupt string format should be xx:xx:xx:xx:xx:xx-d,
- =>The six 2 digit hex-decimal number previous are the Mac address,
- =>The seventh decimal number is the tid value.
-*/
- //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
-
- if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format.
- return FALSE;
-
- token = strchr(arg, DASH);
- if ((token != NULL) && (strlen(token)>1))
- {
- tid = (UCHAR) simple_strtol((token+1), 0, 10);
- if (tid > 15)
- return FALSE;
-
- *token = '\0';
- for (i = 0, token = rstrtok(arg, &sepValue[0]); token; token = rstrtok(NULL, &sepValue[0]), i++)
- {
- if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
- return FALSE;
- AtoH(token, (&mac[i]), 1);
- }
- if(i != 6)
- return FALSE;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x\n",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
-
- pEntry = MacTableLookup(pAd, (PUCHAR) mac);
-
- if (pEntry) {
- DBGPRINT(RT_DEBUG_OFF, ("\nSetup BA Session: Tid = %d\n", tid));
- BAOriSessionSetUp(pAd, pEntry, tid, 0, 100, TRUE);
- }
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-INT Set_BADecline_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG bBADecline;
-
- bBADecline = simple_strtol(arg, 0, 10);
-
- if (bBADecline == 0)
- {
- pAd->CommonCfg.bBADecline = FALSE;
- }
- else if (bBADecline == 1)
- {
- pAd->CommonCfg.bBADecline = TRUE;
- }
- else
- {
- return FALSE; //Invalid argument
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_BADecline_Proc::(BADecline=%d)\n", pAd->CommonCfg.bBADecline));
-
- return TRUE;
-}
-
-INT Set_BAOriTearDown_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR mac[6], tid;
- PSTRING token;
- STRING sepValue[] = ":", DASH = '-';
- INT i;
- MAC_TABLE_ENTRY *pEntry;
-
- //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
-/*
- The BAOriTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
- =>The six 2 digit hex-decimal number previous are the Mac address,
- =>The seventh decimal number is the tid value.
-*/
- if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format.
- return FALSE;
-
- token = strchr(arg, DASH);
- if ((token != NULL) && (strlen(token)>1))
- {
- tid = simple_strtol((token+1), 0, 10);
- if (tid > NUM_OF_TID)
- return FALSE;
-
- *token = '\0';
- for (i = 0, token = rstrtok(arg, &sepValue[0]); token; token = rstrtok(NULL, &sepValue[0]), i++)
- {
- if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
- return FALSE;
- AtoH(token, (&mac[i]), 1);
- }
- if(i != 6)
- return FALSE;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
-
- pEntry = MacTableLookup(pAd, (PUCHAR) mac);
-
- if (pEntry) {
- DBGPRINT(RT_DEBUG_OFF, ("\nTear down Ori BA Session: Tid = %d\n", tid));
- BAOriSessionTearDown(pAd, pEntry->Aid, tid, FALSE, TRUE);
- }
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-INT Set_BARecTearDown_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR mac[6], tid;
- PSTRING token;
- STRING sepValue[] = ":", DASH = '-';
- INT i;
- MAC_TABLE_ENTRY *pEntry;
-
- //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
-/*
- The BARecTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
- =>The six 2 digit hex-decimal number previous are the Mac address,
- =>The seventh decimal number is the tid value.
-*/
- if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and tid value in decimal format.
- return FALSE;
-
- token = strchr(arg, DASH);
- if ((token != NULL) && (strlen(token)>1))
- {
- tid = simple_strtol((token+1), 0, 10);
- if (tid > NUM_OF_TID)
- return FALSE;
-
- *token = '\0';
- for (i = 0, token = rstrtok(arg, &sepValue[0]); token; token = rstrtok(NULL, &sepValue[0]), i++)
- {
- if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
- return FALSE;
- AtoH(token, (&mac[i]), 1);
- }
- if(i != 6)
- return FALSE;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], tid));
-
- pEntry = MacTableLookup(pAd, (PUCHAR) mac);
-
- if (pEntry) {
- DBGPRINT(RT_DEBUG_OFF, ("\nTear down Rec BA Session: Tid = %d\n", tid));
- BARecSessionTearDown(pAd, pEntry->Aid, tid, FALSE);
- }
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-INT Set_HtBw_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG HtBw;
-
- HtBw = simple_strtol(arg, 0, 10);
- if (HtBw == BW_40)
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
- else if (HtBw == BW_20)
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtBw_Proc::(HtBw=%d)\n", pAd->CommonCfg.RegTransmitSetting.field.BW));
-
- return TRUE;
-}
-
-INT Set_HtMcs_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG HtMcs, Mcs_tmp;
-#ifdef CONFIG_STA_SUPPORT
- BOOLEAN bAutoRate = FALSE;
-#endif // CONFIG_STA_SUPPORT //
-
- Mcs_tmp = simple_strtol(arg, 0, 10);
-
- if (Mcs_tmp <= 15 || Mcs_tmp == 32)
- HtMcs = Mcs_tmp;
- else
- HtMcs = MCS_AUTO;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = HtMcs;
- pAd->StaCfg.bAutoTxRateSwitch = (HtMcs == MCS_AUTO) ? TRUE:FALSE;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtMcs_Proc::(HtMcs=%d, bAutoTxRateSwitch = %d)\n",
- pAd->StaCfg.DesiredTransmitSetting.field.MCS, pAd->StaCfg.bAutoTxRateSwitch));
-
- if ((pAd->CommonCfg.PhyMode < PHY_11ABGN_MIXED) ||
- (pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE < MODE_HTMIX))
- {
- if ((pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO) &&
- (HtMcs >= 0 && HtMcs <= 3) &&
- (pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode == FIXED_TXMODE_CCK))
- {
- RTMPSetDesiredRates(pAd, (LONG) (RateIdToMbps[HtMcs] * 1000000));
- }
- else if ((pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO) &&
- (HtMcs >= 0 && HtMcs <= 7) &&
- (pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode == FIXED_TXMODE_OFDM))
- {
- RTMPSetDesiredRates(pAd, (LONG) (RateIdToMbps[HtMcs+4] * 1000000));
- }
- else
- bAutoRate = TRUE;
-
- if (bAutoRate)
- {
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- RTMPSetDesiredRates(pAd, -1);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtMcs_Proc::(FixedTxMode=%d)\n",pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode));
- }
- if (ADHOC_ON(pAd))
- return TRUE;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- SetCommonHT(pAd);
-
- return TRUE;
-}
-
-INT Set_HtGi_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG HtGi;
-
- HtGi = simple_strtol(arg, 0, 10);
-
- if ( HtGi == GI_400)
- pAd->CommonCfg.RegTransmitSetting.field.ShortGI = GI_400;
- else if ( HtGi == GI_800 )
- pAd->CommonCfg.RegTransmitSetting.field.ShortGI = GI_800;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtGi_Proc::(ShortGI=%d)\n",pAd->CommonCfg.RegTransmitSetting.field.ShortGI));
-
- return TRUE;
-}
-
-
-INT Set_HtTxBASize_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR Size;
-
- Size = simple_strtol(arg, 0, 10);
-
- if (Size <=0 || Size >=64)
- {
- Size = 8;
- }
- pAd->CommonCfg.TxBASize = Size-1;
- DBGPRINT(RT_DEBUG_ERROR, ("Set_HtTxBASize ::(TxBASize= %d)\n", Size));
-
- return TRUE;
-}
-
-INT Set_HtDisallowTKIP_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value == 1)
- {
- pAd->CommonCfg.HT_DisallowTKIP = TRUE;
- }
- else
- {
- pAd->CommonCfg.HT_DisallowTKIP = FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtDisallowTKIP_Proc ::%s\n",
- (pAd->CommonCfg.HT_DisallowTKIP == TRUE) ? "enabled" : "disabled"));
-
- return TRUE;
-}
-
-INT Set_HtOpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value == HTMODE_GF)
- pAd->CommonCfg.RegTransmitSetting.field.HTMODE = HTMODE_GF;
- else if ( Value == HTMODE_MM )
- pAd->CommonCfg.RegTransmitSetting.field.HTMODE = HTMODE_MM;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtOpMode_Proc::(HtOpMode=%d)\n",pAd->CommonCfg.RegTransmitSetting.field.HTMODE));
-
- return TRUE;
-
-}
-
-INT Set_HtStbc_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value == STBC_USE)
- pAd->CommonCfg.RegTransmitSetting.field.STBC = STBC_USE;
- else if ( Value == STBC_NONE )
- pAd->CommonCfg.RegTransmitSetting.field.STBC = STBC_NONE;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Stbc_Proc::(HtStbc=%d)\n",pAd->CommonCfg.RegTransmitSetting.field.STBC));
-
- return TRUE;
-}
-
-INT Set_HtHtc_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->HTCEnable = FALSE;
- else if ( Value ==1 )
- pAd->HTCEnable = TRUE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtHtc_Proc::(HtHtc=%d)\n",pAd->HTCEnable));
-
- return TRUE;
-}
-
-INT Set_HtExtcha_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value == 0)
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_BELOW;
- else if ( Value ==1 )
- pAd->CommonCfg.RegTransmitSetting.field.EXTCHA = EXTCHA_ABOVE;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtExtcha_Proc::(HtExtcha=%d)\n",pAd->CommonCfg.RegTransmitSetting.field.EXTCHA));
-
- return TRUE;
-}
-
-INT Set_HtMpduDensity_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value <=7 && Value >= 0)
- pAd->CommonCfg.BACapability.field.MpduDensity = Value;
- else
- pAd->CommonCfg.BACapability.field.MpduDensity = 4;
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtMpduDensity_Proc::(HtMpduDensity=%d)\n",pAd->CommonCfg.BACapability.field.MpduDensity));
-
- return TRUE;
-}
-
-INT Set_HtBaWinSize_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
-
- if (Value >=1 && Value <= 64)
- {
- pAd->CommonCfg.REGBACapability.field.RxBAWinLimit = Value;
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = Value;
- }
- else
- {
- pAd->CommonCfg.REGBACapability.field.RxBAWinLimit = 64;
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = 64;
- }
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtBaWinSize_Proc::(HtBaWinSize=%d)\n",pAd->CommonCfg.BACapability.field.RxBAWinLimit));
-
- return TRUE;
-}
-
-INT Set_HtRdg_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value == 0)
- pAd->CommonCfg.bRdg = FALSE;
- else if ( Value ==1 )
- {
- pAd->HTCEnable = TRUE;
- pAd->CommonCfg.bRdg = TRUE;
- }
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtRdg_Proc::(HtRdg=%d)\n",pAd->CommonCfg.bRdg));
-
- return TRUE;
-}
-
-INT Set_HtLinkAdapt_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->bLinkAdapt = FALSE;
- else if ( Value ==1 )
- {
- pAd->HTCEnable = TRUE;
- pAd->bLinkAdapt = TRUE;
- }
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtLinkAdapt_Proc::(HtLinkAdapt=%d)\n",pAd->bLinkAdapt));
-
- return TRUE;
-}
-
-INT Set_HtAmsdu_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->CommonCfg.BACapability.field.AmsduEnable = FALSE;
- else if ( Value == 1 )
- pAd->CommonCfg.BACapability.field.AmsduEnable = TRUE;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtAmsdu_Proc::(HtAmsdu=%d)\n",pAd->CommonCfg.BACapability.field.AmsduEnable));
-
- return TRUE;
-}
-
-INT Set_HtAutoBa_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- {
- pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
- pAd->CommonCfg.BACapability.field.Policy = BA_NOTUSE;
- }
- else if (Value == 1)
- {
- pAd->CommonCfg.BACapability.field.AutoBA = TRUE;
- pAd->CommonCfg.BACapability.field.Policy = IMMED_BA;
- }
- else
- return FALSE; //Invalid argument
-
- pAd->CommonCfg.REGBACapability.field.AutoBA = pAd->CommonCfg.BACapability.field.AutoBA;
- pAd->CommonCfg.REGBACapability.field.Policy = pAd->CommonCfg.BACapability.field.Policy;
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtAutoBa_Proc::(HtAutoBa=%d)\n",pAd->CommonCfg.BACapability.field.AutoBA));
-
- return TRUE;
-
-}
-
-INT Set_HtProtect_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->CommonCfg.bHTProtect = FALSE;
- else if (Value == 1)
- pAd->CommonCfg.bHTProtect = TRUE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtProtect_Proc::(HtProtect=%d)\n",pAd->CommonCfg.bHTProtect));
-
- return TRUE;
-}
-
-INT Set_SendPSMPAction_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR mac[6], mode;
- PSTRING token;
- STRING sepValue[] = ":", DASH = '-';
- INT i;
- MAC_TABLE_ENTRY *pEntry;
-
- //DBGPRINT(RT_DEBUG_TRACE,("\n%s\n", arg));
-/*
- The BARecTearDown inupt string format should be xx:xx:xx:xx:xx:xx-d,
- =>The six 2 digit hex-decimal number previous are the Mac address,
- =>The seventh decimal number is the mode value.
-*/
- if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and mode value in decimal format.
- return FALSE;
-
- token = strchr(arg, DASH);
- if ((token != NULL) && (strlen(token)>1))
- {
- mode = simple_strtol((token+1), 0, 10);
- if (mode > MMPS_ENABLE)
- return FALSE;
-
- *token = '\0';
- for (i = 0, token = rstrtok(arg, &sepValue[0]); token; token = rstrtok(NULL, &sepValue[0]), i++)
- {
- if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
- return FALSE;
- AtoH(token, (&mac[i]), 1);
- }
- if(i != 6)
- return FALSE;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%02x",
- mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], mode));
-
- pEntry = MacTableLookup(pAd, mac);
-
- if (pEntry) {
- DBGPRINT(RT_DEBUG_OFF, ("\nSendPSMPAction MIPS mode = %d\n", mode));
- SendPSMPAction(pAd, pEntry->Aid, mode);
- }
-
- return TRUE;
- }
-
- return FALSE;
-
-
-}
-
-INT Set_HtMIMOPSmode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
- if (Value <=3 && Value >= 0)
- pAd->CommonCfg.BACapability.field.MMPSmode = Value;
- else
- pAd->CommonCfg.BACapability.field.MMPSmode = 3;
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtMIMOPSmode_Proc::(MIMOPS mode=%d)\n",pAd->CommonCfg.BACapability.field.MMPSmode));
-
- return TRUE;
-}
-
-
-INT Set_ForceShortGI_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->WIFItestbed.bShortGI = FALSE;
- else if (Value == 1)
- pAd->WIFItestbed.bShortGI = TRUE;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_ForceShortGI_Proc::(ForceShortGI=%d)\n", pAd->WIFItestbed.bShortGI));
-
- return TRUE;
-}
-
-
-
-INT Set_ForceGF_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->WIFItestbed.bGreenField = FALSE;
- else if (Value == 1)
- pAd->WIFItestbed.bGreenField = TRUE;
- else
- return FALSE; //Invalid argument
-
- SetCommonHT(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_ForceGF_Proc::(ForceGF=%d)\n", pAd->WIFItestbed.bGreenField));
-
- return TRUE;
-}
-
-INT Set_HtMimoPs_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
- if (Value == 0)
- pAd->CommonCfg.bMIMOPSEnable = FALSE;
- else if (Value == 1)
- pAd->CommonCfg.bMIMOPSEnable = TRUE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_HtMimoPs_Proc::(HtMimoPs=%d)\n",pAd->CommonCfg.bMIMOPSEnable));
-
- return TRUE;
-}
-#endif // DOT11_N_SUPPORT //
-
-
-#ifdef DOT11_N_SUPPORT
-INT SetCommonHT(
- IN PRTMP_ADAPTER pAd)
-{
- OID_SET_HT_PHYMODE SetHT;
-
- if (pAd->CommonCfg.PhyMode < PHY_11ABGN_MIXED)
- return FALSE;
-
- SetHT.PhyMode = pAd->CommonCfg.PhyMode;
- SetHT.TransmitNo = ((UCHAR)pAd->Antenna.field.TxPath);
- SetHT.HtMode = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.HTMODE;
- SetHT.ExtOffset = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.EXTCHA;
- SetHT.MCS = MCS_AUTO;
- SetHT.BW = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.BW;
- SetHT.STBC = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.STBC;
- SetHT.SHORTGI = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.ShortGI;
-
- RTMPSetHT(pAd, &SetHT);
-
- return TRUE;
-}
-#endif // DOT11_N_SUPPORT //
-
-INT Set_FixedTxMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR fix_tx_mode = FIXED_TXMODE_HT;
-
- if (strcmp(arg, "OFDM") == 0 || strcmp(arg, "ofdm") == 0)
- {
- fix_tx_mode = FIXED_TXMODE_OFDM;
- }
- else if (strcmp(arg, "CCK") == 0 || strcmp(arg, "cck") == 0)
- {
- fix_tx_mode = FIXED_TXMODE_CCK;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode = fix_tx_mode;
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_FixedTxMode_Proc::(FixedTxMode=%d)\n", fix_tx_mode));
-
- return TRUE;
-}
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-INT Set_OpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG Value;
-
- Value = simple_strtol(arg, 0, 10);
-
-#ifdef RTMP_MAC_PCI
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
-#endif // RTMP_MAC_PCI //
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Can not switch operate mode on interface up !! \n"));
- return FALSE;
- }
-
- if (Value == 0)
- pAd->OpMode = OPMODE_STA;
- else if (Value == 1)
- pAd->OpMode = OPMODE_AP;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_OpMode_Proc::(OpMode=%s)\n", pAd->OpMode == 1 ? "AP Mode" : "STA Mode"));
-
- return TRUE;
-}
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-
-
-INT Set_LongRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- TX_RTY_CFG_STRUC tx_rty_cfg;
- UCHAR LongRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
-
- RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.LongRtyLimit = LongRetryLimit;
- RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_LongRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
- return TRUE;
-}
-
-INT Set_ShortRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- TX_RTY_CFG_STRUC tx_rty_cfg;
- UCHAR ShortRetryLimit = (UCHAR)simple_strtol(arg, 0, 10);
-
- RTMP_IO_READ32(pAdapter, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.ShortRtyLimit = ShortRetryLimit;
- RTMP_IO_WRITE32(pAdapter, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_ShortRetryLimit_Proc::(tx_rty_cfg=0x%x)\n", tx_rty_cfg.word));
- return TRUE;
-}
-
-
-/////////////////////////////////////////////////////////////////////////
-PSTRING RTMPGetRalinkAuthModeStr(
- IN NDIS_802_11_AUTHENTICATION_MODE authMode)
-{
- switch(authMode)
- {
- case Ndis802_11AuthModeOpen:
- return "OPEN";
- case Ndis802_11AuthModeWPAPSK:
- return "WPAPSK";
- case Ndis802_11AuthModeShared:
- return "SHARED";
- case Ndis802_11AuthModeWPA:
- return "WPA";
- case Ndis802_11AuthModeWPA2:
- return "WPA2";
- case Ndis802_11AuthModeWPA2PSK:
- return "WPA2PSK";
- case Ndis802_11AuthModeWPA1PSKWPA2PSK:
- return "WPAPSKWPA2PSK";
- case Ndis802_11AuthModeWPA1WPA2:
- return "WPA1WPA2";
- case Ndis802_11AuthModeWPANone:
- return "WPANONE";
- default:
- return "UNKNOW";
- }
-}
-
-PSTRING RTMPGetRalinkEncryModeStr(
- IN USHORT encryMode)
-{
- switch(encryMode)
- {
- case Ndis802_11WEPDisabled:
- return "NONE";
- case Ndis802_11WEPEnabled:
- return "WEP";
- case Ndis802_11Encryption2Enabled:
- return "TKIP";
- case Ndis802_11Encryption3Enabled:
- return "AES";
- case Ndis802_11Encryption4Enabled:
- return "TKIPAES";
- default:
- return "UNKNOW";
- }
-}
-
-INT RTMPShowCfgValue(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING pName,
- IN PSTRING pBuf)
-{
- INT Status = 0;
-
- for (PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC = RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC++)
- {
- if (!strcmp(pName, PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name))
- {
- if(PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->show_proc(pAd, pBuf))
- Status = -EINVAL;
- break; //Exit for loop.
- }
- }
-
- if(PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name == NULL)
- {
- sprintf(pBuf, "\n");
- for (PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC = RTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name; PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC++)
- sprintf(pBuf, "%s%s\n", pBuf, PRTMP_PRIVATE_STA_SHOW_CFG_VALUE_PROC->name);
- }
-
- return Status;
-}
-
-INT Show_SSID_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- sprintf(pBuf, "\t%s", pAd->CommonCfg.Ssid);
-#endif // CONFIG_STA_SUPPORT //
- return 0;
-}
-
-INT Show_WirelessMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.PhyMode)
- {
- case PHY_11BG_MIXED:
- sprintf(pBuf, "\t11B/G");
- break;
- case PHY_11B:
- sprintf(pBuf, "\t11B");
- break;
- case PHY_11A:
- sprintf(pBuf, "\t11A");
- break;
- case PHY_11ABG_MIXED:
- sprintf(pBuf, "\t11A/B/G");
- break;
- case PHY_11G:
- sprintf(pBuf, "\t11G");
- break;
-#ifdef DOT11_N_SUPPORT
- case PHY_11ABGN_MIXED:
- sprintf(pBuf, "\t11A/B/G/N");
- break;
- case PHY_11N_2_4G:
- sprintf(pBuf, "\t11N only with 2.4G");
- break;
- case PHY_11GN_MIXED:
- sprintf(pBuf, "\t11G/N");
- break;
- case PHY_11AN_MIXED:
- sprintf(pBuf, "\t11A/N");
- break;
- case PHY_11BGN_MIXED:
- sprintf(pBuf, "\t11B/G/N");
- break;
- case PHY_11AGN_MIXED:
- sprintf(pBuf, "\t11A/G/N");
- break;
- case PHY_11N_5G:
- sprintf(pBuf, "\t11N only with 5G");
- break;
-#endif // DOT11_N_SUPPORT //
- default:
- sprintf(pBuf, "\tUnknow Value(%d)", pAd->CommonCfg.PhyMode);
- break;
- }
- return 0;
-}
-
-
-INT Show_TxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.bEnableTxBurst ? "TRUE":"FALSE");
- return 0;
-}
-
-INT Show_TxPreamble_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.TxPreamble)
- {
- case Rt802_11PreambleShort:
- sprintf(pBuf, "\tShort");
- break;
- case Rt802_11PreambleLong:
- sprintf(pBuf, "\tLong");
- break;
- case Rt802_11PreambleAuto:
- sprintf(pBuf, "\tAuto");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%lu)", pAd->CommonCfg.TxPreamble);
- break;
- }
-
- return 0;
-}
-
-INT Show_TxPower_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%lu", pAd->CommonCfg.TxPowerPercentage);
- return 0;
-}
-
-INT Show_Channel_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%d", pAd->CommonCfg.Channel);
- return 0;
-}
-
-INT Show_BGProtection_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.UseBGProtection)
- {
- case 1: //Always On
- sprintf(pBuf, "\tON");
- break;
- case 2: //Always OFF
- sprintf(pBuf, "\tOFF");
- break;
- case 0: //AUTO
- sprintf(pBuf, "\tAuto");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%lu)", pAd->CommonCfg.UseBGProtection);
- break;
- }
- return 0;
-}
-
-INT Show_RTSThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%u", pAd->CommonCfg.RtsThreshold);
- return 0;
-}
-
-INT Show_FragThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%u", pAd->CommonCfg.FragmentThreshold);
- return 0;
-}
-
-#ifdef DOT11_N_SUPPORT
-INT Show_HtBw_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- if (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40)
- {
- sprintf(pBuf, "\t40 MHz");
- }
- else
- {
- sprintf(pBuf, "\t20 MHz");
- }
- return 0;
-}
-
-INT Show_HtMcs_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- sprintf(pBuf, "\t%u", pAd->StaCfg.DesiredTransmitSetting.field.MCS);
-#endif // CONFIG_STA_SUPPORT //
- return 0;
-}
-
-INT Show_HtGi_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.RegTransmitSetting.field.ShortGI)
- {
- case GI_400:
- sprintf(pBuf, "\tGI_400");
- break;
- case GI_800:
- sprintf(pBuf, "\tGI_800");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%u)", pAd->CommonCfg.RegTransmitSetting.field.ShortGI);
- break;
- }
- return 0;
-}
-
-INT Show_HtOpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.RegTransmitSetting.field.HTMODE)
- {
- case HTMODE_GF:
- sprintf(pBuf, "\tGF");
- break;
- case HTMODE_MM:
- sprintf(pBuf, "\tMM");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%u)", pAd->CommonCfg.RegTransmitSetting.field.HTMODE);
- break;
- }
- return 0;
-}
-
-INT Show_HtExtcha_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->CommonCfg.RegTransmitSetting.field.EXTCHA)
- {
- case EXTCHA_BELOW:
- sprintf(pBuf, "\tBelow");
- break;
- case EXTCHA_ABOVE:
- sprintf(pBuf, "\tAbove");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%u)", pAd->CommonCfg.RegTransmitSetting.field.EXTCHA);
- break;
- }
- return 0;
-}
-
-
-INT Show_HtMpduDensity_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%u", pAd->CommonCfg.BACapability.field.MpduDensity);
- return 0;
-}
-
-INT Show_HtBaWinSize_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%u", pAd->CommonCfg.BACapability.field.RxBAWinLimit);
- return 0;
-}
-
-INT Show_HtRdg_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.bRdg ? "TRUE":"FALSE");
- return 0;
-}
-
-INT Show_HtAmsdu_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.BACapability.field.AmsduEnable ? "TRUE":"FALSE");
- return 0;
-}
-
-INT Show_HtAutoBa_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.BACapability.field.AutoBA ? "TRUE":"FALSE");
- return 0;
-}
-#endif // DOT11_N_SUPPORT //
-
-INT Show_CountryRegion_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%d", pAd->CommonCfg.CountryRegion);
- return 0;
-}
-
-INT Show_CountryRegionABand_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%d", pAd->CommonCfg.CountryRegionForABand);
- return 0;
-}
-
-INT Show_CountryCode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.CountryCode);
- return 0;
-}
-
-#ifdef AGGREGATION_SUPPORT
-INT Show_PktAggregate_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.bAggregationCapable ? "TRUE":"FALSE");
- return 0;
-}
-#endif // AGGREGATION_SUPPORT //
-
-#ifdef WMM_SUPPORT
-INT Show_WmmCapable_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- sprintf(pBuf, "\t%s", pAd->CommonCfg.bWmmCapable ? "TRUE":"FALSE");
-#endif // CONFIG_STA_SUPPORT //
-
- return 0;
-}
-#endif // WMM_SUPPORT //
-
-INT Show_IEEE80211H_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- sprintf(pBuf, "\t%s", pAd->CommonCfg.bIEEE80211H ? "TRUE":"FALSE");
- return 0;
-}
-
-#ifdef CONFIG_STA_SUPPORT
-INT Show_NetworkType_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- switch(pAd->StaCfg.BssType)
- {
- case BSS_ADHOC:
- sprintf(pBuf, "\tAdhoc");
- break;
- case BSS_INFRA:
- sprintf(pBuf, "\tInfra");
- break;
- case BSS_ANY:
- sprintf(pBuf, "\tAny");
- break;
- case BSS_MONITOR:
- sprintf(pBuf, "\tMonitor");
- break;
- default:
- sprintf(pBuf, "\tUnknow Value(%d)", pAd->StaCfg.BssType);
- break;
- }
- return 0;
-}
-
-
-#endif // CONFIG_STA_SUPPORT //
-
-INT Show_AuthMode_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- NDIS_802_11_AUTHENTICATION_MODE AuthMode = Ndis802_11AuthModeOpen;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- AuthMode = pAd->StaCfg.AuthMode;
-#endif // CONFIG_STA_SUPPORT //
-
- if ((AuthMode >= Ndis802_11AuthModeOpen) &&
- (AuthMode <= Ndis802_11AuthModeWPA1PSKWPA2PSK))
- sprintf(pBuf, "\t%s", RTMPGetRalinkAuthModeStr(AuthMode));
- else
- sprintf(pBuf, "\tUnknow Value(%d)", AuthMode);
-
- return 0;
-}
-
-INT Show_EncrypType_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- NDIS_802_11_WEP_STATUS WepStatus = Ndis802_11WEPDisabled;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- WepStatus = pAd->StaCfg.WepStatus;
-#endif // CONFIG_STA_SUPPORT //
-
- if ((WepStatus >= Ndis802_11WEPEnabled) &&
- (WepStatus <= Ndis802_11Encryption4KeyAbsent))
- sprintf(pBuf, "\t%s", RTMPGetRalinkEncryModeStr(WepStatus));
- else
- sprintf(pBuf, "\tUnknow Value(%d)", WepStatus);
-
- return 0;
-}
-
-INT Show_DefaultKeyID_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- UCHAR DefaultKeyId = 0;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- DefaultKeyId = pAd->StaCfg.DefaultKeyId;
-#endif // CONFIG_STA_SUPPORT //
-
- sprintf(pBuf, "\t%d", DefaultKeyId);
-
- return 0;
-}
-
-INT Show_WepKey_Proc(
- IN PRTMP_ADAPTER pAd,
- IN INT KeyIdx,
- OUT PSTRING pBuf)
-{
- UCHAR Key[16] = {0}, KeyLength = 0;
- INT index = BSS0;
-
- KeyLength = pAd->SharedKey[index][KeyIdx].KeyLen;
- NdisMoveMemory(Key, pAd->SharedKey[index][KeyIdx].Key, KeyLength);
-
- //check key string is ASCII or not
- if (RTMPCheckStrPrintAble((PCHAR)Key, KeyLength))
- sprintf(pBuf, "\t%s", Key);
- else
- {
- int idx;
- sprintf(pBuf, "\t");
- for (idx = 0; idx < KeyLength; idx++)
- sprintf(pBuf+strlen(pBuf), "%02X", Key[idx]);
- }
- return 0;
-}
-
-INT Show_Key1_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- Show_WepKey_Proc(pAd, 0, pBuf);
- return 0;
-}
-
-INT Show_Key2_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- Show_WepKey_Proc(pAd, 1, pBuf);
- return 0;
-}
-
-INT Show_Key3_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- Show_WepKey_Proc(pAd, 2, pBuf);
- return 0;
-}
-
-INT Show_Key4_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- Show_WepKey_Proc(pAd, 3, pBuf);
- return 0;
-}
-
-INT Show_WPAPSK_Proc(
- IN PRTMP_ADAPTER pAd,
- OUT PSTRING pBuf)
-{
- INT idx;
- UCHAR PMK[32] = {0};
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- NdisMoveMemory(PMK, pAd->StaCfg.PMK, 32);
-#endif // CONFIG_STA_SUPPORT //
-
- sprintf(pBuf, "\tPMK = ");
- for (idx = 0; idx < 32; idx++)
- sprintf(pBuf+strlen(pBuf), "%02X", PMK[idx]);
-
- return 0;
-}
diff --git a/drivers/staging/rt3090/common/cmm_sanity.c b/drivers/staging/rt3090/common/cmm_sanity.c
deleted file mode 100644
index de631c38a44e..000000000000
--- a/drivers/staging/rt3090/common/cmm_sanity.c
+++ /dev/null
@@ -1,1718 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- sanity.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2004-09-01 add WMM support
-*/
-
-#include "../rt_config.h"
-
-
-extern UCHAR CISCO_OUI[];
-
-extern UCHAR WPA_OUI[];
-extern UCHAR RSN_OUI[];
-extern UCHAR WME_INFO_ELEM[];
-extern UCHAR WME_PARM_ELEM[];
-extern UCHAR Ccx2QosInfo[];
-extern UCHAR RALINK_OUI[];
-extern UCHAR BROADCOM_OUI[];
-extern UCHAR WPS_OUI[];
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN MlmeAddBAReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2)
-{
- PMLME_ADDBA_REQ_STRUCT pInfo;
-
- pInfo = (MLME_ADDBA_REQ_STRUCT *)Msg;
-
- if ((MsgLen != sizeof(MLME_ADDBA_REQ_STRUCT)))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - message lenght not correct.\n"));
- return FALSE;
- }
-
- if ((pInfo->Wcid >= MAX_LEN_OF_MAC_TABLE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - The peer Mac is not associated yet.\n"));
- return FALSE;
- }
-
- /*
- if ((pInfo->BaBufSize > MAX_RX_REORDERBUF) || (pInfo->BaBufSize < 2))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - Rx Reordering buffer too big or too small\n"));
- return FALSE;
- }
- */
-
- if ((pInfo->pAddr[0]&0x01) == 0x01)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeAddBAReqSanity fail - broadcast address not support BA\n"));
- return FALSE;
- }
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN MlmeDelBAReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen)
-{
- MLME_DELBA_REQ_STRUCT *pInfo;
- pInfo = (MLME_DELBA_REQ_STRUCT *)Msg;
-
- if ((MsgLen != sizeof(MLME_DELBA_REQ_STRUCT)))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MlmeDelBAReqSanity fail - message lenght not correct.\n"));
- return FALSE;
- }
-
- if ((pInfo->Wcid >= MAX_LEN_OF_MAC_TABLE))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MlmeDelBAReqSanity fail - The peer Mac is not associated yet.\n"));
- return FALSE;
- }
-
- if ((pInfo->TID & 0xf0))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MlmeDelBAReqSanity fail - The peer TID is incorrect.\n"));
- return FALSE;
- }
-
- if (NdisEqualMemory(pAd->MacTab.Content[pInfo->Wcid].Addr, pInfo->Addr, MAC_ADDR_LEN) == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MlmeDelBAReqSanity fail - the peer addr dosen't exist.\n"));
- return FALSE;
- }
-
- return TRUE;
-}
-
-BOOLEAN PeerAddBAReqActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2)
-{
- PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
- PFRAME_ADDBA_REQ pAddFrame;
- pAddFrame = (PFRAME_ADDBA_REQ)(pMsg);
- if (MsgLen < (sizeof(FRAME_ADDBA_REQ)))
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Request frame length size = %ld incorrect\n", MsgLen));
- return FALSE;
- }
- // we support immediate BA.
-#ifdef UNALIGNMENT_SUPPORT
- {
- BA_PARM tmpBaParm;
-
- NdisMoveMemory((PUCHAR)(&tmpBaParm), (PUCHAR)(&pAddFrame->BaParm), sizeof(BA_PARM));
- *(USHORT *)(&tmpBaParm) = cpu2le16(*(USHORT *)(&tmpBaParm));
- NdisMoveMemory((PUCHAR)(&pAddFrame->BaParm), (PUCHAR)(&tmpBaParm), sizeof(BA_PARM));
- }
-#else
- *(USHORT *)(&pAddFrame->BaParm) = cpu2le16(*(USHORT *)(&pAddFrame->BaParm));
-#endif
- pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
- pAddFrame->BaStartSeq.word = cpu2le16(pAddFrame->BaStartSeq.word);
-
- if (pAddFrame->BaParm.BAPolicy != IMMED_BA)
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Request Ba Policy[%d] not support\n", pAddFrame->BaParm.BAPolicy));
- DBGPRINT(RT_DEBUG_ERROR,("ADDBA Request. tid=%x, Bufsize=%x, AMSDUSupported=%x \n", pAddFrame->BaParm.TID, pAddFrame->BaParm.BufSize, pAddFrame->BaParm.AMSDUSupported));
- return FALSE;
- }
-
- // we support immediate BA.
- if (pAddFrame->BaParm.TID &0xfff0)
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Request incorrect TID = %d\n", pAddFrame->BaParm.TID));
- return FALSE;
- }
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- return TRUE;
-}
-
-BOOLEAN PeerAddBARspActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen)
-{
- //PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
- PFRAME_ADDBA_RSP pAddFrame;
-
- pAddFrame = (PFRAME_ADDBA_RSP)(pMsg);
- if (MsgLen < (sizeof(FRAME_ADDBA_RSP)))
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBARspActionSanity: ADDBA Response frame length size = %ld incorrect\n", MsgLen));
- return FALSE;
- }
- // we support immediate BA.
-#ifdef UNALIGNMENT_SUPPORT
- {
- BA_PARM tmpBaParm;
-
- NdisMoveMemory((PUCHAR)(&tmpBaParm), (PUCHAR)(&pAddFrame->BaParm), sizeof(BA_PARM));
- *(USHORT *)(&tmpBaParm) = cpu2le16(*(USHORT *)(&tmpBaParm));
- NdisMoveMemory((PUCHAR)(&pAddFrame->BaParm), (PUCHAR)(&tmpBaParm), sizeof(BA_PARM));
- }
-#else
- *(USHORT *)(&pAddFrame->BaParm) = cpu2le16(*(USHORT *)(&pAddFrame->BaParm));
-#endif
- pAddFrame->StatusCode = cpu2le16(pAddFrame->StatusCode);
- pAddFrame->TimeOutValue = cpu2le16(pAddFrame->TimeOutValue);
-
- if (pAddFrame->BaParm.BAPolicy != IMMED_BA)
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBAReqActionSanity: ADDBA Response Ba Policy[%d] not support\n", pAddFrame->BaParm.BAPolicy));
- return FALSE;
- }
-
- // we support immediate BA.
- if (pAddFrame->BaParm.TID &0xfff0)
- {
- DBGPRINT(RT_DEBUG_ERROR,("PeerAddBARspActionSanity: ADDBA Response incorrect TID = %d\n", pAddFrame->BaParm.TID));
- return FALSE;
- }
- return TRUE;
-
-}
-
-BOOLEAN PeerDelBAActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN VOID *pMsg,
- IN ULONG MsgLen )
-{
- //PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
- PFRAME_DELBA_REQ pDelFrame;
- if (MsgLen != (sizeof(FRAME_DELBA_REQ)))
- return FALSE;
-
- if (Wcid >= MAX_LEN_OF_MAC_TABLE)
- return FALSE;
-
- pDelFrame = (PFRAME_DELBA_REQ)(pMsg);
-
- *(USHORT *)(&pDelFrame->DelbaParm) = cpu2le16(*(USHORT *)(&pDelFrame->DelbaParm));
- pDelFrame->ReasonCode = cpu2le16(pDelFrame->ReasonCode);
-
- if (pDelFrame->DelbaParm.TID &0xfff0)
- return FALSE;
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerBeaconAndProbeRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- IN UCHAR MsgChannel,
- OUT PUCHAR pAddr2,
- OUT PUCHAR pBssid,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen,
- OUT UCHAR *pBssType,
- OUT USHORT *pBeaconPeriod,
- OUT UCHAR *pChannel,
- OUT UCHAR *pNewChannel,
- OUT LARGE_INTEGER *pTimestamp,
- OUT CF_PARM *pCfParm,
- OUT USHORT *pAtimWin,
- OUT USHORT *pCapabilityInfo,
- OUT UCHAR *pErp,
- OUT UCHAR *pDtimCount,
- OUT UCHAR *pDtimPeriod,
- OUT UCHAR *pBcastFlag,
- OUT UCHAR *pMessageToMe,
- OUT UCHAR SupRate[],
- OUT UCHAR *pSupRateLen,
- OUT UCHAR ExtRate[],
- OUT UCHAR *pExtRateLen,
- OUT UCHAR *pCkipFlag,
- OUT UCHAR *pAironetCellPowerLimit,
- OUT PEDCA_PARM pEdcaParm,
- OUT PQBSS_LOAD_PARM pQbssLoad,
- OUT PQOS_CAPABILITY_PARM pQosCapability,
- OUT ULONG *pRalinkIe,
- OUT UCHAR *pHtCapabilityLen,
-#ifdef CONFIG_STA_SUPPORT
- OUT UCHAR *pPreNHtCapabilityLen,
-#endif // CONFIG_STA_SUPPORT //
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT UCHAR *AddHtInfoLen,
- OUT ADD_HT_INFO_IE *AddHtInfo,
- OUT UCHAR *NewExtChannelOffset, // Ht extension channel offset(above or below)
- OUT USHORT *LengthVIE,
- OUT PNDIS_802_11_VARIABLE_IEs pVIE)
-{
- UCHAR *Ptr;
-#ifdef CONFIG_STA_SUPPORT
- UCHAR TimLen;
-#endif // CONFIG_STA_SUPPORT //
- PFRAME_802_11 pFrame;
- PEID_STRUCT pEid;
- UCHAR SubType;
- UCHAR Sanity;
- //UCHAR ECWMin, ECWMax;
- //MAC_CSR9_STRUC Csr9;
- ULONG Length = 0;
-
- // For some 11a AP which didn't have DS_IE, we use two conditions to decide the channel
- // 1. If the AP is 11n enabled, then check the control channel.
- // 2. If the AP didn't have any info about channel, use the channel we received this frame as the channel. (May inaccuracy!!)
- UCHAR CtrlChannel = 0;
-
- // Add for 3 necessary EID field check
- Sanity = 0;
-
- *pAtimWin = 0;
- *pErp = 0;
- *pDtimCount = 0;
- *pDtimPeriod = 0;
- *pBcastFlag = 0;
- *pMessageToMe = 0;
- *pExtRateLen = 0;
- *pCkipFlag = 0; // Default of CkipFlag is 0
- *pAironetCellPowerLimit = 0xFF; // Default of AironetCellPowerLimit is 0xFF
- *LengthVIE = 0; // Set the length of VIE to init value 0
- *pHtCapabilityLen = 0; // Set the length of VIE to init value 0
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- *pPreNHtCapabilityLen = 0; // Set the length of VIE to init value 0
-#endif // CONFIG_STA_SUPPORT //
- *AddHtInfoLen = 0; // Set the length of VIE to init value 0
- *pRalinkIe = 0;
- *pNewChannel = 0;
- *NewExtChannelOffset = 0xff; //Default 0xff means no such IE
- pCfParm->bValid = FALSE; // default: no IE_CF found
- pQbssLoad->bValid = FALSE; // default: no IE_QBSS_LOAD found
- pEdcaParm->bValid = FALSE; // default: no IE_EDCA_PARAMETER found
- pQosCapability->bValid = FALSE; // default: no IE_QOS_CAPABILITY found
-
- pFrame = (PFRAME_802_11)Msg;
-
- // get subtype from header
- SubType = (UCHAR)pFrame->Hdr.FC.SubType;
-
- // get Addr2 and BSSID from header
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- COPY_MAC_ADDR(pBssid, pFrame->Hdr.Addr3);
-
-// hex_dump("Beacon", Msg, MsgLen);
-
- Ptr = pFrame->Octet;
- Length += LENGTH_802_11;
-
- // get timestamp from payload and advance the pointer
- NdisMoveMemory(pTimestamp, Ptr, TIMESTAMP_LEN);
-
- pTimestamp->u.LowPart = cpu2le32(pTimestamp->u.LowPart);
- pTimestamp->u.HighPart = cpu2le32(pTimestamp->u.HighPart);
-
- Ptr += TIMESTAMP_LEN;
- Length += TIMESTAMP_LEN;
-
- // get beacon interval from payload and advance the pointer
- NdisMoveMemory(pBeaconPeriod, Ptr, 2);
- Ptr += 2;
- Length += 2;
-
- // get capability info from payload and advance the pointer
- NdisMoveMemory(pCapabilityInfo, Ptr, 2);
- Ptr += 2;
- Length += 2;
-
- if (CAP_IS_ESS_ON(*pCapabilityInfo))
- *pBssType = BSS_INFRA;
- else
- *pBssType = BSS_ADHOC;
-
- pEid = (PEID_STRUCT) Ptr;
-
- // get variable fields from payload and advance the pointer
- while ((Length + 2 + pEid->Len) <= MsgLen)
- {
- //
- // Secure copy VIE to VarIE[MAX_VIE_LEN] didn't overflow.
- //
- if ((*LengthVIE + pEid->Len + 2) >= MAX_VIE_LEN)
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerBeaconAndProbeRspSanity - Variable IEs out of resource [len(=%d) > MAX_VIE_LEN(=%d)]\n",
- (*LengthVIE + pEid->Len + 2), MAX_VIE_LEN));
- break;
- }
-
- switch(pEid->Eid)
- {
- case IE_SSID:
- // Already has one SSID EID in this beacon, ignore the second one
- if (Sanity & 0x1)
- break;
- if(pEid->Len <= MAX_LEN_OF_SSID)
- {
- NdisMoveMemory(Ssid, pEid->Octet, pEid->Len);
- *pSsidLen = pEid->Len;
- Sanity |= 0x1;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SSID (len=%d)\n",pEid->Len));
- return FALSE;
- }
- break;
-
- case IE_SUPP_RATES:
- if(pEid->Len <= MAX_LEN_OF_SUPPORTED_RATES)
- {
- Sanity |= 0x2;
- NdisMoveMemory(SupRate, pEid->Octet, pEid->Len);
- *pSupRateLen = pEid->Len;
-
- // TODO: 2004-09-14 not a good design here, cause it exclude extra rates
- // from ScanTab. We should report as is. And filter out unsupported
- // rates in MlmeAux.
- // Check against the supported rates
- // RTMPCheckRates(pAd, SupRate, pSupRateLen);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SUPP_RATES (len=%d)\n",pEid->Len));
- return FALSE;
- }
- break;
-
- case IE_HT_CAP:
- if (pEid->Len >= SIZE_HT_CAP_IE) //Note: allow extension.!!
- {
- NdisMoveMemory(pHtCapability, pEid->Octet, sizeof(HT_CAPABILITY_IE));
- *pHtCapabilityLen = SIZE_HT_CAP_IE; // Nnow we only support 26 bytes.
-
- *(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo));
-#ifdef UNALIGNMENT_SUPPORT
- {
- EXT_HT_CAP_INFO extHtCapInfo;
- NdisMoveMemory((PUCHAR)(&extHtCapInfo), (PUCHAR)(&pHtCapability->ExtHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- *(USHORT *)(&extHtCapInfo) = cpu2le16(*(USHORT *)(&extHtCapInfo));
- NdisMoveMemory((PUCHAR)(&pHtCapability->ExtHtCapInfo), (PUCHAR)(&extHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- }
-#else
- *(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo));
-#endif // UNALIGNMENT_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- *pPreNHtCapabilityLen = 0; // Now we only support 26 bytes.
-
- Ptr = (PUCHAR) pVIE;
- NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
- *LengthVIE += (pEid->Len + 2);
- }
-#endif // CONFIG_STA_SUPPORT //
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerBeaconAndProbeRspSanity - wrong IE_HT_CAP. pEid->Len = %d\n", pEid->Len));
- }
-
- break;
- case IE_ADD_HT:
- if (pEid->Len >= sizeof(ADD_HT_INFO_IE))
- {
- // This IE allows extension, but we can ignore extra bytes beyond our knowledge , so only
- // copy first sizeof(ADD_HT_INFO_IE)
- NdisMoveMemory(AddHtInfo, pEid->Octet, sizeof(ADD_HT_INFO_IE));
- *AddHtInfoLen = SIZE_ADD_HT_INFO_IE;
-
- CtrlChannel = AddHtInfo->ControlChan;
-
- *(USHORT *)(&AddHtInfo->AddHtInfo2) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo2));
- *(USHORT *)(&AddHtInfo->AddHtInfo3) = cpu2le16(*(USHORT *)(&AddHtInfo->AddHtInfo3));
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- Ptr = (PUCHAR) pVIE;
- NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
- *LengthVIE += (pEid->Len + 2);
- }
-#endif // CONFIG_STA_SUPPORT //
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerBeaconAndProbeRspSanity - wrong IE_ADD_HT. \n"));
- }
-
- break;
- case IE_SECONDARY_CH_OFFSET:
- if (pEid->Len == 1)
- {
- *NewExtChannelOffset = pEid->Octet[0];
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerBeaconAndProbeRspSanity - wrong IE_SECONDARY_CH_OFFSET. \n"));
- }
-
- break;
- case IE_FH_PARM:
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity(IE_FH_PARM) \n"));
- break;
-
- case IE_DS_PARM:
- if(pEid->Len == 1)
- {
- *pChannel = *pEid->Octet;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (ChannelSanity(pAd, *pChannel) == 0)
- {
-
- return FALSE;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
- Sanity |= 0x4;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_DS_PARM (len=%d)\n",pEid->Len));
- return FALSE;
- }
- break;
-
- case IE_CF_PARM:
- if(pEid->Len == 6)
- {
- pCfParm->bValid = TRUE;
- pCfParm->CfpCount = pEid->Octet[0];
- pCfParm->CfpPeriod = pEid->Octet[1];
- pCfParm->CfpMaxDuration = pEid->Octet[2] + 256 * pEid->Octet[3];
- pCfParm->CfpDurRemaining = pEid->Octet[4] + 256 * pEid->Octet[5];
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_CF_PARM\n"));
- return FALSE;
- }
- break;
-
- case IE_IBSS_PARM:
- if(pEid->Len == 2)
- {
- NdisMoveMemory(pAtimWin, pEid->Octet, pEid->Len);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_IBSS_PARM\n"));
- return FALSE;
- }
- break;
-
-#ifdef CONFIG_STA_SUPPORT
- case IE_TIM:
- if(INFRA_ON(pAd) && SubType == SUBTYPE_BEACON)
- {
- GetTimBit((PCHAR)pEid, pAd->StaActive.Aid, &TimLen, pBcastFlag, pDtimCount, pDtimPeriod, pMessageToMe);
- }
- break;
-#endif // CONFIG_STA_SUPPORT //
- case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
- if(pEid->Len == 3)
- {
- *pNewChannel = pEid->Octet[1]; //extract new channel number
- }
- break;
-
- // New for WPA
- // CCX v2 has the same IE, we need to parse that too
- // Wifi WMM use the same IE vale, need to parse that too
- // case IE_WPA:
- case IE_VENDOR_SPECIFIC:
- // Check Broadcom/Atheros 802.11n OUI version, for HT Capability IE.
- // This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan.
- /*if (NdisEqualMemory(pEid->Octet, BROADCOM_OUI, 3) && (pEid->Len >= 4))
- {
- if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 30))
- {
- {
- NdisMoveMemory(pHtCapability, &pEid->Octet[4], sizeof(HT_CAPABILITY_IE));
- *pHtCapabilityLen = SIZE_HT_CAP_IE; // Nnow we only support 26 bytes.
- }
- }
- if ((pEid->Octet[3] == OUI_BROADCOM_HT) && (pEid->Len >= 26))
- {
- {
- NdisMoveMemory(AddHtInfo, &pEid->Octet[4], sizeof(ADD_HT_INFO_IE));
- *AddHtInfoLen = SIZE_ADD_HT_INFO_IE; // Nnow we only support 26 bytes.
- }
- }
- }
- */
- // Check the OUI version, filter out non-standard usage
- if (NdisEqualMemory(pEid->Octet, RALINK_OUI, 3) && (pEid->Len == 7))
- {
- //*pRalinkIe = pEid->Octet[3];
- if (pEid->Octet[3] != 0)
- *pRalinkIe = pEid->Octet[3];
- else
- *pRalinkIe = 0xf0000000; // Set to non-zero value (can't set bit0-2) to represent this is Ralink Chip. So at linkup, we will set ralinkchip flag.
- }
-#ifdef CONFIG_STA_SUPPORT
-#ifdef DOT11_N_SUPPORT
- // This HT IE is before IEEE draft set HT IE value.2006-09-28 by Jan.
-
- // Other vendors had production before IE_HT_CAP value is assigned. To backward support those old-firmware AP,
- // Check broadcom-defiend pre-802.11nD1.0 OUI for HT related IE, including HT Capatilities IE and HT Information IE
- else if ((*pHtCapabilityLen == 0) && NdisEqualMemory(pEid->Octet, PRE_N_HT_OUI, 3) && (pEid->Len >= 4) && (pAd->OpMode == OPMODE_STA))
- {
- if ((pEid->Octet[3] == OUI_PREN_HT_CAP) && (pEid->Len >= 30) && (*pHtCapabilityLen == 0))
- {
- NdisMoveMemory(pHtCapability, &pEid->Octet[4], sizeof(HT_CAPABILITY_IE));
- *pPreNHtCapabilityLen = SIZE_HT_CAP_IE;
- }
-
- if ((pEid->Octet[3] == OUI_PREN_ADD_HT) && (pEid->Len >= 26))
- {
- NdisMoveMemory(AddHtInfo, &pEid->Octet[4], sizeof(ADD_HT_INFO_IE));
- *AddHtInfoLen = SIZE_ADD_HT_INFO_IE;
- }
- }
-#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
- else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
- {
- // Copy to pVIE which will report to microsoft bssid list.
- Ptr = (PUCHAR) pVIE;
- NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
- *LengthVIE += (pEid->Len + 2);
- }
- else if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6) && (pEid->Len == 24))
- {
- PUCHAR ptr;
- int i;
-
- // parsing EDCA parameters
- pEdcaParm->bValid = TRUE;
- pEdcaParm->bQAck = FALSE; // pEid->Octet[0] & 0x10;
- pEdcaParm->bQueueRequest = FALSE; // pEid->Octet[0] & 0x20;
- pEdcaParm->bTxopRequest = FALSE; // pEid->Octet[0] & 0x40;
- pEdcaParm->EdcaUpdateCount = pEid->Octet[6] & 0x0f;
- pEdcaParm->bAPSDCapable = (pEid->Octet[6] & 0x80) ? 1 : 0;
- ptr = &pEid->Octet[8];
- for (i=0; i<4; i++)
- {
- UCHAR aci = (*ptr & 0x60) >> 5; // b5~6 is AC INDEX
- pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); // b5 is ACM
- pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; // b0~3 is AIFSN
- pEdcaParm->Cwmin[aci] = *(ptr+1) & 0x0f; // b0~4 is Cwmin
- pEdcaParm->Cwmax[aci] = *(ptr+1) >> 4; // b5~8 is Cwmax
- pEdcaParm->Txop[aci] = *(ptr+2) + 256 * (*(ptr+3)); // in unit of 32-us
- ptr += 4; // point to next AC
- }
- }
- else if (NdisEqualMemory(pEid->Octet, WME_INFO_ELEM, 6) && (pEid->Len == 7))
- {
- // parsing EDCA parameters
- pEdcaParm->bValid = TRUE;
- pEdcaParm->bQAck = FALSE; // pEid->Octet[0] & 0x10;
- pEdcaParm->bQueueRequest = FALSE; // pEid->Octet[0] & 0x20;
- pEdcaParm->bTxopRequest = FALSE; // pEid->Octet[0] & 0x40;
- pEdcaParm->EdcaUpdateCount = pEid->Octet[6] & 0x0f;
- pEdcaParm->bAPSDCapable = (pEid->Octet[6] & 0x80) ? 1 : 0;
-
- // use default EDCA parameter
- pEdcaParm->bACM[QID_AC_BE] = 0;
- pEdcaParm->Aifsn[QID_AC_BE] = 3;
- pEdcaParm->Cwmin[QID_AC_BE] = CW_MIN_IN_BITS;
- pEdcaParm->Cwmax[QID_AC_BE] = CW_MAX_IN_BITS;
- pEdcaParm->Txop[QID_AC_BE] = 0;
-
- pEdcaParm->bACM[QID_AC_BK] = 0;
- pEdcaParm->Aifsn[QID_AC_BK] = 7;
- pEdcaParm->Cwmin[QID_AC_BK] = CW_MIN_IN_BITS;
- pEdcaParm->Cwmax[QID_AC_BK] = CW_MAX_IN_BITS;
- pEdcaParm->Txop[QID_AC_BK] = 0;
-
- pEdcaParm->bACM[QID_AC_VI] = 0;
- pEdcaParm->Aifsn[QID_AC_VI] = 2;
- pEdcaParm->Cwmin[QID_AC_VI] = CW_MIN_IN_BITS-1;
- pEdcaParm->Cwmax[QID_AC_VI] = CW_MAX_IN_BITS;
- pEdcaParm->Txop[QID_AC_VI] = 96; // AC_VI: 96*32us ~= 3ms
-
- pEdcaParm->bACM[QID_AC_VO] = 0;
- pEdcaParm->Aifsn[QID_AC_VO] = 2;
- pEdcaParm->Cwmin[QID_AC_VO] = CW_MIN_IN_BITS-2;
- pEdcaParm->Cwmax[QID_AC_VO] = CW_MAX_IN_BITS-1;
- pEdcaParm->Txop[QID_AC_VO] = 48; // AC_VO: 48*32us ~= 1.5ms
- }
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-
- break;
-
- case IE_EXT_SUPP_RATES:
- if (pEid->Len <= MAX_LEN_OF_SUPPORTED_RATES)
- {
- NdisMoveMemory(ExtRate, pEid->Octet, pEid->Len);
- *pExtRateLen = pEid->Len;
-
- // TODO: 2004-09-14 not a good design here, cause it exclude extra rates
- // from ScanTab. We should report as is. And filter out unsupported
- // rates in MlmeAux.
- // Check against the supported rates
- // RTMPCheckRates(pAd, ExtRate, pExtRateLen);
- }
- break;
-
- case IE_ERP:
- if (pEid->Len == 1)
- {
- *pErp = (UCHAR)pEid->Octet[0];
- }
- break;
-
- case IE_AIRONET_CKIP:
- // 0. Check Aironet IE length, it must be larger or equal to 28
- // Cisco AP350 used length as 28
- // Cisco AP12XX used length as 30
- if (pEid->Len < (CKIP_NEGOTIATION_LENGTH - 2))
- break;
-
- // 1. Copy CKIP flag byte to buffer for process
- *pCkipFlag = *(pEid->Octet + 8);
- break;
-
- case IE_AP_TX_POWER:
- // AP Control of Client Transmit Power
- //0. Check Aironet IE length, it must be 6
- if (pEid->Len != 0x06)
- break;
-
- // Get cell power limit in dBm
- if (NdisEqualMemory(pEid->Octet, CISCO_OUI, 3) == 1)
- *pAironetCellPowerLimit = *(pEid->Octet + 4);
- break;
-
- // WPA2 & 802.11i RSN
- case IE_RSN:
- // There is no OUI for version anymore, check the group cipher OUI before copying
- if (RTMPEqualMemory(pEid->Octet + 2, RSN_OUI, 3))
- {
- // Copy to pVIE which will report to microsoft bssid list.
- Ptr = (PUCHAR) pVIE;
- NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
- *LengthVIE += (pEid->Len + 2);
- }
- break;
-#ifdef CONFIG_STA_SUPPORT
-#ifdef EXT_BUILD_CHANNEL_LIST
- case IE_COUNTRY:
- Ptr = (PUCHAR) pVIE;
- NdisMoveMemory(Ptr + *LengthVIE, &pEid->Eid, pEid->Len + 2);
- *LengthVIE += (pEid->Len + 2);
- break;
-#endif // EXT_BUILD_CHANNEL_LIST //
-#endif // CONFIG_STA_SUPPORT //
-
-
- default:
- break;
- }
-
- Length = Length + 2 + pEid->Len; // Eid[1] + Len[1]+ content[Len]
- pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
- }
-
- // For some 11a AP. it did not have the channel EID, patch here
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- UCHAR LatchRfChannel = MsgChannel;
- if ((pAd->LatchRfRegs.Channel > 14) && ((Sanity & 0x4) == 0))
- {
- if (CtrlChannel != 0)
- *pChannel = CtrlChannel;
- else
- *pChannel = LatchRfChannel;
- Sanity |= 0x4;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- if (Sanity != 0x7)
- {
- DBGPRINT(RT_DEBUG_LOUD, ("PeerBeaconAndProbeRspSanity - missing field, Sanity=0x%02x\n", Sanity));
- return FALSE;
- }
- else
- {
- return TRUE;
- }
-
-}
-
-#ifdef DOT11N_DRAFT3
-/*
- ==========================================================================
- Description:
- MLME message sanity check for some IE addressed in 802.11n d3.03.
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerBeaconAndProbeRspSanity2(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT UCHAR *RegClass)
-{
- CHAR *Ptr;
- PFRAME_802_11 pFrame;
- PEID_STRUCT pEid;
- ULONG Length = 0;
-
- pFrame = (PFRAME_802_11)Msg;
-
- *RegClass = 0;
- Ptr = (PCHAR) pFrame->Octet;
- Length += LENGTH_802_11;
-
- // get timestamp from payload and advance the pointer
- Ptr += TIMESTAMP_LEN;
- Length += TIMESTAMP_LEN;
-
- // get beacon interval from payload and advance the pointer
- Ptr += 2;
- Length += 2;
-
- // get capability info from payload and advance the pointer
- Ptr += 2;
- Length += 2;
-
- pEid = (PEID_STRUCT) Ptr;
-
- // get variable fields from payload and advance the pointer
- while ((Length + 2 + pEid->Len) <= MsgLen)
- {
- switch(pEid->Eid)
- {
- case IE_SUPP_REG_CLASS:
- if(pEid->Len > 0)
- {
- *RegClass = *pEid->Octet;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAndProbeRspSanity - wrong IE_SSID (len=%d)\n",pEid->Len));
- return FALSE;
- }
- break;
- }
-
- Length = Length + 2 + pEid->Len; // Eid[1] + Len[1]+ content[Len]
- pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
- }
-
- return TRUE;
-
-}
-#endif // DOT11N_DRAFT3 //
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
- */
-BOOLEAN MlmeScanReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT UCHAR *pBssType,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen,
- OUT UCHAR *pScanType)
-{
- MLME_SCAN_REQ_STRUCT *Info;
-
- Info = (MLME_SCAN_REQ_STRUCT *)(Msg);
- *pBssType = Info->BssType;
- *pSsidLen = Info->SsidLen;
- NdisMoveMemory(Ssid, Info->Ssid, *pSsidLen);
- *pScanType = Info->ScanType;
-
- if ((*pBssType == BSS_INFRA || *pBssType == BSS_ADHOC || *pBssType == BSS_ANY)
- && (*pScanType == SCAN_ACTIVE || *pScanType == SCAN_PASSIVE
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
- ))
- {
- return TRUE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeScanReqSanity fail - wrong BssType or ScanType\n"));
- return FALSE;
- }
-}
-
-// IRQL = DISPATCH_LEVEL
-UCHAR ChannelSanity(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR channel)
-{
- int i;
-
- for (i = 0; i < pAd->ChannelListNum; i ++)
- {
- if (channel == pAd->ChannelList[i].Channel)
- return 1;
- }
- return 0;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerDeauthSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pReason)
-{
- PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
-
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- NdisMoveMemory(pReason, &pFrame->Octet[0], 2);
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerAuthSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr,
- OUT USHORT *pAlg,
- OUT USHORT *pSeq,
- OUT USHORT *pStatus,
- CHAR *pChlgText)
-{
- PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
-
- COPY_MAC_ADDR(pAddr, pFrame->Hdr.Addr2);
- NdisMoveMemory(pAlg, &pFrame->Octet[0], 2);
- NdisMoveMemory(pSeq, &pFrame->Octet[2], 2);
- NdisMoveMemory(pStatus, &pFrame->Octet[4], 2);
-
- if (*pAlg == AUTH_MODE_OPEN)
- {
- if (*pSeq == 1 || *pSeq == 2)
- {
- return TRUE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAuthSanity fail - wrong Seg#\n"));
- return FALSE;
- }
- }
- else if (*pAlg == AUTH_MODE_KEY)
- {
- if (*pSeq == 1 || *pSeq == 4)
- {
- return TRUE;
- }
- else if (*pSeq == 2 || *pSeq == 3)
- {
- NdisMoveMemory(pChlgText, &pFrame->Octet[8], CIPHER_TEXT_LEN);
- return TRUE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAuthSanity fail - wrong Seg#\n"));
- return FALSE;
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAuthSanity fail - wrong algorithm\n"));
- return FALSE;
- }
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
- */
-BOOLEAN MlmeAuthReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr,
- OUT ULONG *pTimeout,
- OUT USHORT *pAlg)
-{
- MLME_AUTH_REQ_STRUCT *pInfo;
-
- pInfo = (MLME_AUTH_REQ_STRUCT *)Msg;
- COPY_MAC_ADDR(pAddr, pInfo->Addr);
- *pTimeout = pInfo->Timeout;
- *pAlg = pInfo->Alg;
-
- if (((*pAlg == AUTH_MODE_KEY) ||(*pAlg == AUTH_MODE_OPEN)
- ) &&
- ((*pAddr & 0x01) == 0))
- {
- return TRUE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeAuthReqSanity fail - wrong algorithm\n"));
- return FALSE;
- }
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN MlmeAssocReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pApAddr,
- OUT USHORT *pCapabilityInfo,
- OUT ULONG *pTimeout,
- OUT USHORT *pListenIntv)
-{
- MLME_ASSOC_REQ_STRUCT *pInfo;
-
- pInfo = (MLME_ASSOC_REQ_STRUCT *)Msg;
- *pTimeout = pInfo->Timeout; // timeout
- COPY_MAC_ADDR(pApAddr, pInfo->Addr); // AP address
- *pCapabilityInfo = pInfo->CapabilityInfo; // capability info
- *pListenIntv = pInfo->ListenIntv;
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerDisassocSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pReason)
-{
- PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
-
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- NdisMoveMemory(pReason, &pFrame->Octet[0], 2);
-
- return TRUE;
-}
-
-/*
- ========================================================================
- Routine Description:
- Sanity check NetworkType (11b, 11g or 11a)
-
- Arguments:
- pBss - Pointer to BSS table.
-
- Return Value:
- Ndis802_11DS .......(11b)
- Ndis802_11OFDM24....(11g)
- Ndis802_11OFDM5.....(11a)
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(
- IN PBSS_ENTRY pBss)
-{
- NDIS_802_11_NETWORK_TYPE NetWorkType;
- UCHAR rate, i;
-
- NetWorkType = Ndis802_11DS;
-
- if (pBss->Channel <= 14)
- {
- //
- // First check support Rate.
- //
- for (i = 0; i < pBss->SupRateLen; i++)
- {
- rate = pBss->SupRate[i] & 0x7f; // Mask out basic rate set bit
- if ((rate == 2) || (rate == 4) || (rate == 11) || (rate == 22))
- {
- continue;
- }
- else
- {
- //
- // Otherwise (even rate > 108) means Ndis802_11OFDM24
- //
- NetWorkType = Ndis802_11OFDM24;
- break;
- }
- }
-
- //
- // Second check Extend Rate.
- //
- if (NetWorkType != Ndis802_11OFDM24)
- {
- for (i = 0; i < pBss->ExtRateLen; i++)
- {
- rate = pBss->SupRate[i] & 0x7f; // Mask out basic rate set bit
- if ((rate == 2) || (rate == 4) || (rate == 11) || (rate == 22))
- {
- continue;
- }
- else
- {
- //
- // Otherwise (even rate > 108) means Ndis802_11OFDM24
- //
- NetWorkType = Ndis802_11OFDM24;
- break;
- }
- }
- }
- }
- else
- {
- NetWorkType = Ndis802_11OFDM5;
- }
-
- if (pBss->HtCapabilityLen != 0)
- {
- if (NetWorkType == Ndis802_11OFDM5)
- NetWorkType = Ndis802_11OFDM5_N;
- else
- NetWorkType = Ndis802_11OFDM24_N;
- }
-
- return NetWorkType;
-}
-
-/*
- ==========================================================================
- Description:
- Check the validity of the received EAPoL frame
- Return:
- TRUE if all parameters are OK,
- FALSE otherwise
- ==========================================================================
- */
-BOOLEAN PeerWpaMessageSanity(
- IN PRTMP_ADAPTER pAd,
- IN PEAPOL_PACKET pMsg,
- IN ULONG MsgLen,
- IN UCHAR MsgType,
- IN MAC_TABLE_ENTRY *pEntry)
-{
- UCHAR mic[LEN_KEY_DESC_MIC], digest[80], KEYDATA[MAX_LEN_OF_RSNIE];
- BOOLEAN bReplayDiff = FALSE;
- BOOLEAN bWPA2 = FALSE;
- KEY_INFO EapolKeyInfo;
- UCHAR GroupKeyIndex = 0;
-
-
- NdisZeroMemory(mic, sizeof(mic));
- NdisZeroMemory(digest, sizeof(digest));
- NdisZeroMemory(KEYDATA, sizeof(KEYDATA));
- NdisZeroMemory((PUCHAR)&EapolKeyInfo, sizeof(EapolKeyInfo));
-
- NdisMoveMemory((PUCHAR)&EapolKeyInfo, (PUCHAR)&pMsg->KeyDesc.KeyInfo, sizeof(KEY_INFO));
-
- *((USHORT *)&EapolKeyInfo) = cpu2le16(*((USHORT *)&EapolKeyInfo));
-
- // Choose WPA2 or not
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
- bWPA2 = TRUE;
-
- // 0. Check MsgType
- if ((MsgType > EAPOL_GROUP_MSG_2) || (MsgType < EAPOL_PAIR_MSG_1))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("The message type is invalid(%d)! \n", MsgType));
- return FALSE;
- }
-
- // 1. Replay counter check
- if (MsgType == EAPOL_PAIR_MSG_1 || MsgType == EAPOL_PAIR_MSG_3 || MsgType == EAPOL_GROUP_MSG_1) // For supplicant
- {
- // First validate replay counter, only accept message with larger replay counter.
- // Let equal pass, some AP start with all zero replay counter
- UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
-
- NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
- if ((RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY) != 1) &&
- (RTMPCompareMemory(pMsg->KeyDesc.ReplayCounter, ZeroReplay, LEN_KEY_DESC_REPLAY) != 0))
- {
- bReplayDiff = TRUE;
- }
- }
- else if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_4 || MsgType == EAPOL_GROUP_MSG_2) // For authenticator
- {
- // check Replay Counter coresponds to MSG from authenticator, otherwise discard
- if (!NdisEqualMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY))
- {
- bReplayDiff = TRUE;
- }
- }
-
- // Replay Counter different condition
- if (bReplayDiff)
- {
- // send wireless event - for replay counter different
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_REPLAY_COUNTER_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- if (MsgType < EAPOL_GROUP_MSG_1)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in pairwise msg %d of 4-way handshake!\n", MsgType));
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Replay Counter Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
- }
-
- hex_dump("Receive replay counter ", pMsg->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
- hex_dump("Current replay counter ", pEntry->R_Counter, LEN_KEY_DESC_REPLAY);
- return FALSE;
- }
-
- // 2. Verify MIC except Pairwise Msg1
- if (MsgType != EAPOL_PAIR_MSG_1)
- {
- UCHAR rcvd_mic[LEN_KEY_DESC_MIC];
-
- // Record the received MIC for check later
- NdisMoveMemory(rcvd_mic, pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- NdisZeroMemory(pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
-
- if (EapolKeyInfo.KeyDescVer == DESC_TYPE_TKIP) // TKIP
- {
- HMAC_MD5(pEntry->PTK, LEN_EAP_MICK, (PUCHAR)pMsg, MsgLen, mic, MD5_DIGEST_SIZE);
- }
- else if (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES) // AES
- {
- HMAC_SHA1(pEntry->PTK, LEN_EAP_MICK, (PUCHAR)pMsg, MsgLen, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
- }
-
- if (!NdisEqualMemory(rcvd_mic, mic, LEN_KEY_DESC_MIC))
- {
- // send wireless event - for MIC different
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_MIC_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- if (MsgType < EAPOL_GROUP_MSG_1)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in pairwise msg %d of 4-way handshake!\n", MsgType));
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in group msg %d of 2-way handshake!\n", (MsgType - EAPOL_PAIR_MSG_4)));
- }
-
- hex_dump("Received MIC", rcvd_mic, LEN_KEY_DESC_MIC);
- hex_dump("Desired MIC", mic, LEN_KEY_DESC_MIC);
-
- return FALSE;
- }
- }
-
- // 1. Decrypt the Key Data field if GTK is included.
- // 2. Extract the context of the Key Data field if it exist.
- // The field in pairwise_msg_2_WPA1(WPA2) & pairwise_msg_3_WPA1 is clear.
- // The field in group_msg_1_WPA1(WPA2) & pairwise_msg_3_WPA2 is encrypted.
- if (CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen) > 0)
- {
- // Decrypt this field
- if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1))
- {
- if(
- (EapolKeyInfo.KeyDescVer == DESC_TYPE_AES))
- {
- // AES
- AES_GTK_KEY_UNWRAP(&pEntry->PTK[16], KEYDATA,
- CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen),
- pMsg->KeyDesc.KeyData);
- }
- else
- {
- INT i;
- UCHAR Key[32];
- // Decrypt TKIP GTK
- // Construct 32 bytes RC4 Key
- NdisMoveMemory(Key, pMsg->KeyDesc.KeyIv, 16);
- NdisMoveMemory(&Key[16], &pEntry->PTK[16], 16);
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, Key, 32);
- //discard first 256 bytes
- for(i = 0; i < 256; i++)
- ARCFOUR_BYTE(&pAd->PrivateInfo.WEPCONTEXT);
- // Decrypt GTK. Becareful, there is no ICV to check the result is correct or not
- ARCFOUR_DECRYPT(&pAd->PrivateInfo.WEPCONTEXT, KEYDATA,
- pMsg->KeyDesc.KeyData,
- CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen));
- }
-
- if (!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))
- GroupKeyIndex = EapolKeyInfo.KeyIndex;
-
- }
- else if ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3 && !bWPA2))
- {
- NdisMoveMemory(KEYDATA, pMsg->KeyDesc.KeyData, CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen));
- }
- else
- {
-
- return TRUE;
- }
-
- // Parse Key Data field to
- // 1. verify RSN IE for pairwise_msg_2_WPA1(WPA2) ,pairwise_msg_3_WPA1(WPA2)
- // 2. verify KDE format for pairwise_msg_3_WPA2, group_msg_1_WPA2
- // 3. update shared key for pairwise_msg_3_WPA2, group_msg_1_WPA1(WPA2)
- if (!RTMPParseEapolKeyData(pAd, KEYDATA,
- CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyDataLen),
- GroupKeyIndex, MsgType, bWPA2, pEntry))
- {
- return FALSE;
- }
- }
-
- return TRUE;
-
-}
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
-BOOLEAN MlmeDlsReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PRT_802_11_DLS *pDLS,
- OUT PUSHORT pReason)
-{
- MLME_DLS_REQ_STRUCT *pInfo;
-
- pInfo = (MLME_DLS_REQ_STRUCT *)Msg;
-
- *pDLS = pInfo->pDLS;
- *pReason = pInfo->Reason;
-
- return TRUE;
-}
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef QOS_DLS_SUPPORT
-BOOLEAN PeerDlsReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pDlsTimeout,
- OUT UCHAR *pRatesLen,
- OUT UCHAR Rates[],
- OUT UCHAR *pHtCapabilityLen,
- OUT HT_CAPABILITY_IE *pHtCapability)
-{
- CHAR *Ptr;
- PFRAME_802_11 Fr = (PFRAME_802_11)Msg;
- PEID_STRUCT eid_ptr;
-
- // to prevent caller from using garbage output value
- *pCapabilityInfo = 0;
- *pDlsTimeout = 0;
- *pHtCapabilityLen = 0;
-
- Ptr = (PCHAR)Fr->Octet;
-
- // offset to destination MAC address (Category and Action field)
- Ptr += 2;
-
- // get DA from payload and advance the pointer
- NdisMoveMemory(pDA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- // get SA from payload and advance the pointer
- NdisMoveMemory(pSA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- // get capability info from payload and advance the pointer
- NdisMoveMemory(pCapabilityInfo, Ptr, 2);
- Ptr += 2;
-
- // get capability info from payload and advance the pointer
- NdisMoveMemory(pDlsTimeout, Ptr, 2);
- Ptr += 2;
-
- // Category and Action field + DA + SA + capability + Timeout
- eid_ptr = (PEID_STRUCT) &Fr->Octet[18];
-
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((UCHAR*)Fr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_SUPP_RATES:
- if ((eid_ptr->Len <= MAX_LEN_OF_SUPPORTED_RATES) && (eid_ptr->Len > 0))
- {
- NdisMoveMemory(Rates, eid_ptr->Octet, eid_ptr->Len);
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsReqSanity - IE_SUPP_RATES., Len=%d. Rates[0]=%x\n",eid_ptr->Len, Rates[0]));
- DBGPRINT(RT_DEBUG_TRACE, ("Rates[1]=%x %x %x %x %x %x %x\n", Rates[1], Rates[2], Rates[3], Rates[4], Rates[5], Rates[6], Rates[7]));
- *pRatesLen = eid_ptr->Len;
- }
- else
- {
- *pRatesLen = 8;
- Rates[0] = 0x82;
- Rates[1] = 0x84;
- Rates[2] = 0x8b;
- Rates[3] = 0x96;
- Rates[4] = 0x12;
- Rates[5] = 0x24;
- Rates[6] = 0x48;
- Rates[7] = 0x6c;
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsReqSanity - wrong IE_SUPP_RATES., Len=%d\n",eid_ptr->Len));
- }
- break;
-
- case IE_EXT_SUPP_RATES:
- if (eid_ptr->Len + *pRatesLen <= MAX_LEN_OF_SUPPORTED_RATES)
- {
- NdisMoveMemory(&Rates[*pRatesLen], eid_ptr->Octet, eid_ptr->Len);
- *pRatesLen = (*pRatesLen) + eid_ptr->Len;
- }
- else
- {
- NdisMoveMemory(&Rates[*pRatesLen], eid_ptr->Octet, MAX_LEN_OF_SUPPORTED_RATES - (*pRatesLen));
- *pRatesLen = MAX_LEN_OF_SUPPORTED_RATES;
- }
- break;
-
- case IE_HT_CAP:
- if (eid_ptr->Len >= sizeof(HT_CAPABILITY_IE))
- {
- NdisMoveMemory(pHtCapability, eid_ptr->Octet, sizeof(HT_CAPABILITY_IE));
-
- *(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo));
-#ifdef UNALIGNMENT_SUPPORT
- {
- EXT_HT_CAP_INFO extHtCapInfo;
-
- NdisMoveMemory((PUCHAR)(&extHtCapInfo), (PUCHAR)(&pHtCapability->ExtHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- *(USHORT *)(&extHtCapInfo) = cpu2le16(*(USHORT *)(&extHtCapInfo));
- NdisMoveMemory((PUCHAR)(&pHtCapability->ExtHtCapInfo), (PUCHAR)(&extHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- }
-#else
- *(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo));
-#endif // UNALIGNMENT_SUPPORT //
- *pHtCapabilityLen = sizeof(HT_CAPABILITY_IE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsReqSanity - IE_HT_CAP\n"));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsReqSanity - wrong IE_HT_CAP.eid_ptr->Len = %d\n", eid_ptr->Len));
- }
- break;
-
- default:
- break;
- }
-
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return TRUE;
-}
-
-BOOLEAN PeerDlsRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pStatus,
- OUT UCHAR *pRatesLen,
- OUT UCHAR Rates[],
- OUT UCHAR *pHtCapabilityLen,
- OUT HT_CAPABILITY_IE *pHtCapability)
-{
- CHAR *Ptr;
- PFRAME_802_11 Fr = (PFRAME_802_11)Msg;
- PEID_STRUCT eid_ptr;
-
- // to prevent caller from using garbage output value
- *pStatus = 0;
- *pCapabilityInfo = 0;
- *pHtCapabilityLen = 0;
-
- Ptr = (PCHAR)Fr->Octet;
-
- // offset to destination MAC address (Category and Action field)
- Ptr += 2;
-
- // get status code from payload and advance the pointer
- NdisMoveMemory(pStatus, Ptr, 2);
- Ptr += 2;
-
- // get DA from payload and advance the pointer
- NdisMoveMemory(pDA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- // get SA from payload and advance the pointer
- NdisMoveMemory(pSA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- if (pStatus == 0)
- {
- // get capability info from payload and advance the pointer
- NdisMoveMemory(pCapabilityInfo, Ptr, 2);
- Ptr += 2;
- }
-
- // Category and Action field + status code + DA + SA + capability
- eid_ptr = (PEID_STRUCT) &Fr->Octet[18];
-
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((UCHAR*)Fr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_SUPP_RATES:
- if ((eid_ptr->Len <= MAX_LEN_OF_SUPPORTED_RATES) && (eid_ptr->Len > 0))
- {
- NdisMoveMemory(Rates, eid_ptr->Octet, eid_ptr->Len);
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsRspSanity - IE_SUPP_RATES., Len=%d. Rates[0]=%x\n",eid_ptr->Len, Rates[0]));
- DBGPRINT(RT_DEBUG_TRACE, ("Rates[1]=%x %x %x %x %x %x %x\n", Rates[1], Rates[2], Rates[3], Rates[4], Rates[5], Rates[6], Rates[7]));
- *pRatesLen = eid_ptr->Len;
- }
- else
- {
- *pRatesLen = 8;
- Rates[0] = 0x82;
- Rates[1] = 0x84;
- Rates[2] = 0x8b;
- Rates[3] = 0x96;
- Rates[4] = 0x12;
- Rates[5] = 0x24;
- Rates[6] = 0x48;
- Rates[7] = 0x6c;
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsRspSanity - wrong IE_SUPP_RATES., Len=%d\n",eid_ptr->Len));
- }
- break;
-
- case IE_EXT_SUPP_RATES:
- if (eid_ptr->Len + *pRatesLen <= MAX_LEN_OF_SUPPORTED_RATES)
- {
- NdisMoveMemory(&Rates[*pRatesLen], eid_ptr->Octet, eid_ptr->Len);
- *pRatesLen = (*pRatesLen) + eid_ptr->Len;
- }
- else
- {
- NdisMoveMemory(&Rates[*pRatesLen], eid_ptr->Octet, MAX_LEN_OF_SUPPORTED_RATES - (*pRatesLen));
- *pRatesLen = MAX_LEN_OF_SUPPORTED_RATES;
- }
- break;
-
- case IE_HT_CAP:
- if (eid_ptr->Len >= sizeof(HT_CAPABILITY_IE))
- {
- NdisMoveMemory(pHtCapability, eid_ptr->Octet, sizeof(HT_CAPABILITY_IE));
-
- *(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo));
-#ifdef UNALIGNMENT_SUPPORT
- {
- EXT_HT_CAP_INFO extHtCapInfo;
-
- NdisMoveMemory((PUCHAR)(&extHtCapInfo), (PUCHAR)(&pHtCapability->ExtHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- *(USHORT *)(&extHtCapInfo) = cpu2le16(*(USHORT *)(&extHtCapInfo));
- NdisMoveMemory((PUCHAR)(&pHtCapability->ExtHtCapInfo), (PUCHAR)(&extHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- }
-#else
- *(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo));
-#endif // UNALIGNMENT_SUPPORT //
- *pHtCapabilityLen = sizeof(HT_CAPABILITY_IE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsRspSanity - IE_HT_CAP\n"));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerDlsRspSanity - wrong IE_HT_CAP.eid_ptr->Len = %d\n", eid_ptr->Len));
- }
- break;
-
- default:
- break;
- }
-
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return TRUE;
-}
-
-BOOLEAN PeerDlsTearDownSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pReason)
-{
- CHAR *Ptr;
- PFRAME_802_11 Fr = (PFRAME_802_11)Msg;
-
- // to prevent caller from using garbage output value
- *pReason = 0;
-
- Ptr = (PCHAR)Fr->Octet;
-
- // offset to destination MAC address (Category and Action field)
- Ptr += 2;
-
- // get DA from payload and advance the pointer
- NdisMoveMemory(pDA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- // get SA from payload and advance the pointer
- NdisMoveMemory(pSA, Ptr, MAC_ADDR_LEN);
- Ptr += MAC_ADDR_LEN;
-
- // get reason code from payload and advance the pointer
- NdisMoveMemory(pReason, Ptr, 2);
- Ptr += 2;
-
- return TRUE;
-}
-#endif // QOS_DLS_SUPPORT //
diff --git a/drivers/staging/rt3090/common/cmm_sync.c b/drivers/staging/rt3090/common/cmm_sync.c
deleted file mode 100644
index 6d7b974d7e15..000000000000
--- a/drivers/staging/rt3090/common/cmm_sync.c
+++ /dev/null
@@ -1,734 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- cmm_sync.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2004-09-01 modified for rt2561/2661
-*/
-
-#include "../rt_config.h"
-
-
-// 2.4 Ghz channel plan index in the TxPower arrays.
-#define BG_BAND_REGION_0_START 0 // 1,2,3,4,5,6,7,8,9,10,11
-#define BG_BAND_REGION_0_SIZE 11
-#define BG_BAND_REGION_1_START 0 // 1,2,3,4,5,6,7,8,9,10,11,12,13
-#define BG_BAND_REGION_1_SIZE 13
-#define BG_BAND_REGION_2_START 9 // 10,11
-#define BG_BAND_REGION_2_SIZE 2
-#define BG_BAND_REGION_3_START 9 // 10,11,12,13
-#define BG_BAND_REGION_3_SIZE 4
-#define BG_BAND_REGION_4_START 13 // 14
-#define BG_BAND_REGION_4_SIZE 1
-#define BG_BAND_REGION_5_START 0 // 1,2,3,4,5,6,7,8,9,10,11,12,13,14
-#define BG_BAND_REGION_5_SIZE 14
-#define BG_BAND_REGION_6_START 2 // 3,4,5,6,7,8,9
-#define BG_BAND_REGION_6_SIZE 7
-#define BG_BAND_REGION_7_START 4 // 5,6,7,8,9,10,11,12,13
-#define BG_BAND_REGION_7_SIZE 9
-#define BG_BAND_REGION_31_START 0 // 1,2,3,4,5,6,7,8,9,10,11,12,13,14
-#define BG_BAND_REGION_31_SIZE 14
-
-// 5 Ghz channel plan index in the TxPower arrays.
-UCHAR A_BAND_REGION_0_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165};
-UCHAR A_BAND_REGION_1_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
-UCHAR A_BAND_REGION_2_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64};
-UCHAR A_BAND_REGION_3_CHANNEL_LIST[]={52, 56, 60, 64, 149, 153, 157, 161};
-UCHAR A_BAND_REGION_4_CHANNEL_LIST[]={149, 153, 157, 161, 165};
-UCHAR A_BAND_REGION_5_CHANNEL_LIST[]={149, 153, 157, 161};
-UCHAR A_BAND_REGION_6_CHANNEL_LIST[]={36, 40, 44, 48};
-UCHAR A_BAND_REGION_7_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173};
-UCHAR A_BAND_REGION_8_CHANNEL_LIST[]={52, 56, 60, 64};
-UCHAR A_BAND_REGION_9_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165};
-UCHAR A_BAND_REGION_10_CHANNEL_LIST[]={36, 40, 44, 48, 149, 153, 157, 161, 165};
-UCHAR A_BAND_REGION_11_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161};
-UCHAR A_BAND_REGION_12_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
-UCHAR A_BAND_REGION_13_CHANNEL_LIST[]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161};
-UCHAR A_BAND_REGION_14_CHANNEL_LIST[]={36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165};
-UCHAR A_BAND_REGION_15_CHANNEL_LIST[]={149, 153, 157, 161, 165, 169, 173};
-
-
-//BaSizeArray follows the 802.11n definition as MaxRxFactor. 2^(13+factor) bytes. When factor =0, it's about Ba buffer size =8.
-UCHAR BaSizeArray[4] = {8,16,32,64};
-
-/*
- ==========================================================================
- Description:
- Update StaCfg->ChannelList[] according to 1) Country Region 2) RF IC type,
- and 3) PHY-mode user selected.
- The outcome is used by driver when doing site survey.
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID BuildChannelList(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR i, j, index=0, num=0;
- PUCHAR pChannelList = NULL;
-
- NdisZeroMemory(pAd->ChannelList, MAX_NUM_OF_CHANNELS * sizeof(CHANNEL_TX_POWER));
-
- // if not 11a-only mode, channel list starts from 2.4Ghz band
- if ((pAd->CommonCfg.PhyMode != PHY_11A)
-#ifdef DOT11_N_SUPPORT
- && (pAd->CommonCfg.PhyMode != PHY_11AN_MIXED) && (pAd->CommonCfg.PhyMode != PHY_11N_5G)
-#endif // DOT11_N_SUPPORT //
- )
- {
- switch (pAd->CommonCfg.CountryRegion & 0x7f)
- {
- case REGION_0_BG_BAND: // 1 -11
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_0_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_0_SIZE);
- index += BG_BAND_REGION_0_SIZE;
- break;
- case REGION_1_BG_BAND: // 1 - 13
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_1_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_1_SIZE);
- index += BG_BAND_REGION_1_SIZE;
- break;
- case REGION_2_BG_BAND: // 10 - 11
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_2_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_2_SIZE);
- index += BG_BAND_REGION_2_SIZE;
- break;
- case REGION_3_BG_BAND: // 10 - 13
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_3_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_3_SIZE);
- index += BG_BAND_REGION_3_SIZE;
- break;
- case REGION_4_BG_BAND: // 14
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_4_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_4_SIZE);
- index += BG_BAND_REGION_4_SIZE;
- break;
- case REGION_5_BG_BAND: // 1 - 14
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_5_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_5_SIZE);
- index += BG_BAND_REGION_5_SIZE;
- break;
- case REGION_6_BG_BAND: // 3 - 9
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_6_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_6_SIZE);
- index += BG_BAND_REGION_6_SIZE;
- break;
- case REGION_7_BG_BAND: // 5 - 13
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_7_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_7_SIZE);
- index += BG_BAND_REGION_7_SIZE;
- break;
- case REGION_31_BG_BAND: // 1 - 14
- NdisMoveMemory(&pAd->ChannelList[index], &pAd->TxPower[BG_BAND_REGION_31_START], sizeof(CHANNEL_TX_POWER) * BG_BAND_REGION_31_SIZE);
- index += BG_BAND_REGION_31_SIZE;
- break;
- default: // Error. should never happen
- break;
- }
- for (i=0; i<index; i++)
- pAd->ChannelList[i].MaxTxPwr = 20;
- }
-
- if ((pAd->CommonCfg.PhyMode == PHY_11A) || (pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
-#ifdef DOT11_N_SUPPORT
- || (pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED) || (pAd->CommonCfg.PhyMode == PHY_11AN_MIXED)
- || (pAd->CommonCfg.PhyMode == PHY_11AGN_MIXED) || (pAd->CommonCfg.PhyMode == PHY_11N_5G)
-#endif // DOT11_N_SUPPORT //
- )
- {
- switch (pAd->CommonCfg.CountryRegionForABand & 0x7f)
- {
- case REGION_0_A_BAND:
- num = sizeof(A_BAND_REGION_0_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_0_CHANNEL_LIST;
- break;
- case REGION_1_A_BAND:
- num = sizeof(A_BAND_REGION_1_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_1_CHANNEL_LIST;
- break;
- case REGION_2_A_BAND:
- num = sizeof(A_BAND_REGION_2_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_2_CHANNEL_LIST;
- break;
- case REGION_3_A_BAND:
- num = sizeof(A_BAND_REGION_3_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_3_CHANNEL_LIST;
- break;
- case REGION_4_A_BAND:
- num = sizeof(A_BAND_REGION_4_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_4_CHANNEL_LIST;
- break;
- case REGION_5_A_BAND:
- num = sizeof(A_BAND_REGION_5_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_5_CHANNEL_LIST;
- break;
- case REGION_6_A_BAND:
- num = sizeof(A_BAND_REGION_6_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_6_CHANNEL_LIST;
- break;
- case REGION_7_A_BAND:
- num = sizeof(A_BAND_REGION_7_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_7_CHANNEL_LIST;
- break;
- case REGION_8_A_BAND:
- num = sizeof(A_BAND_REGION_8_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_8_CHANNEL_LIST;
- break;
- case REGION_9_A_BAND:
- num = sizeof(A_BAND_REGION_9_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_9_CHANNEL_LIST;
- break;
- case REGION_10_A_BAND:
- num = sizeof(A_BAND_REGION_10_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_10_CHANNEL_LIST;
- break;
- case REGION_11_A_BAND:
- num = sizeof(A_BAND_REGION_11_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_11_CHANNEL_LIST;
- break;
- case REGION_12_A_BAND:
- num = sizeof(A_BAND_REGION_12_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_12_CHANNEL_LIST;
- break;
- case REGION_13_A_BAND:
- num = sizeof(A_BAND_REGION_13_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_13_CHANNEL_LIST;
- break;
- case REGION_14_A_BAND:
- num = sizeof(A_BAND_REGION_14_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_14_CHANNEL_LIST;
- break;
- case REGION_15_A_BAND:
- num = sizeof(A_BAND_REGION_15_CHANNEL_LIST)/sizeof(UCHAR);
- pChannelList = A_BAND_REGION_15_CHANNEL_LIST;
- break;
- default: // Error. should never happen
- DBGPRINT(RT_DEBUG_WARN,("countryregion=%d not support", pAd->CommonCfg.CountryRegionForABand));
- break;
- }
-
- if (num != 0)
- {
- UCHAR RadarCh[15]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
- for (i=0; i<num; i++)
- {
- for (j=0; j<MAX_NUM_OF_CHANNELS; j++)
- {
- if (pChannelList[i] == pAd->TxPower[j].Channel)
- NdisMoveMemory(&pAd->ChannelList[index+i], &pAd->TxPower[j], sizeof(CHANNEL_TX_POWER));
- }
- for (j=0; j<15; j++)
- {
- if (pChannelList[i] == RadarCh[j])
- pAd->ChannelList[index+i].DfsReq = TRUE;
- }
- pAd->ChannelList[index+i].MaxTxPwr = 20;
- }
- index += num;
- }
- }
-
- pAd->ChannelListNum = index;
- DBGPRINT(RT_DEBUG_TRACE,("country code=%d/%d, RFIC=%d, PHY mode=%d, support %d channels\n",
- pAd->CommonCfg.CountryRegion, pAd->CommonCfg.CountryRegionForABand, pAd->RfIcType, pAd->CommonCfg.PhyMode, pAd->ChannelListNum));
-#ifdef DBG
- for (i=0;i<pAd->ChannelListNum;i++)
- {
- DBGPRINT_RAW(RT_DEBUG_TRACE,("BuildChannel # %d :: Pwr0 = %d, Pwr1 =%d, \n ", pAd->ChannelList[i].Channel, pAd->ChannelList[i].Power, pAd->ChannelList[i].Power2));
- }
-#endif
-}
-
-/*
- ==========================================================================
- Description:
- This routine return the first channel number according to the country
- code selection and RF IC selection (signal band or dual band). It is called
- whenever driver need to start a site survey of all supported channels.
- Return:
- ch - the first channel number of current country code setting
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-UCHAR FirstChannel(
- IN PRTMP_ADAPTER pAd)
-{
- return pAd->ChannelList[0].Channel;
-}
-
-/*
- ==========================================================================
- Description:
- This routine returns the next channel number. This routine is called
- during driver need to start a site survey of all supported channels.
- Return:
- next_channel - the next channel number valid in current country code setting.
- Note:
- return 0 if no more next channel
- ==========================================================================
- */
-UCHAR NextChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR channel)
-{
- int i;
- UCHAR next_channel = 0;
-
- for (i = 0; i < (pAd->ChannelListNum - 1); i++)
- if (channel == pAd->ChannelList[i].Channel)
- {
- next_channel = pAd->ChannelList[i+1].Channel;
- break;
- }
- return next_channel;
-}
-
-/*
- ==========================================================================
- Description:
- This routine is for Cisco Compatible Extensions 2.X
- Spec31. AP Control of Client Transmit Power
- Return:
- None
- Note:
- Required by Aironet dBm(mW)
- 0dBm(1mW), 1dBm(5mW), 13dBm(20mW), 15dBm(30mW),
- 17dBm(50mw), 20dBm(100mW)
-
- We supported
- 3dBm(Lowest), 6dBm(10%), 9dBm(25%), 12dBm(50%),
- 14dBm(75%), 15dBm(100%)
-
- The client station's actual transmit power shall be within +/- 5dB of
- the minimum value or next lower value.
- ==========================================================================
- */
-VOID ChangeToCellPowerLimit(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR AironetCellPowerLimit)
-{
- //valud 0xFF means that hasn't found power limit information
- //from the AP's Beacon/Probe response.
- if (AironetCellPowerLimit == 0xFF)
- return;
-
- if (AironetCellPowerLimit < 6) //Used Lowest Power Percentage.
- pAd->CommonCfg.TxPowerPercentage = 6;
- else if (AironetCellPowerLimit < 9)
- pAd->CommonCfg.TxPowerPercentage = 10;
- else if (AironetCellPowerLimit < 12)
- pAd->CommonCfg.TxPowerPercentage = 25;
- else if (AironetCellPowerLimit < 14)
- pAd->CommonCfg.TxPowerPercentage = 50;
- else if (AironetCellPowerLimit < 15)
- pAd->CommonCfg.TxPowerPercentage = 75;
- else
- pAd->CommonCfg.TxPowerPercentage = 100; //else used maximum
-
- if (pAd->CommonCfg.TxPowerPercentage > pAd->CommonCfg.TxPowerDefault)
- pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
-
-}
-
-CHAR ConvertToRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi,
- IN UCHAR RssiNumber)
-{
- UCHAR RssiOffset, LNAGain;
-
- // Rssi equals to zero should be an invalid value
- if (Rssi == 0)
- return -99;
-
- LNAGain = GET_LNA_GAIN(pAd);
- if (pAd->LatchRfRegs.Channel > 14)
- {
- if (RssiNumber == 0)
- RssiOffset = pAd->ARssiOffset0;
- else if (RssiNumber == 1)
- RssiOffset = pAd->ARssiOffset1;
- else
- RssiOffset = pAd->ARssiOffset2;
- }
- else
- {
- if (RssiNumber == 0)
- RssiOffset = pAd->BGRssiOffset0;
- else if (RssiNumber == 1)
- RssiOffset = pAd->BGRssiOffset1;
- else
- RssiOffset = pAd->BGRssiOffset2;
- }
-
- return (-12 - RssiOffset - LNAGain - Rssi);
-}
-
-/*
- ==========================================================================
- Description:
- Scan next channel
- ==========================================================================
- */
-VOID ScanNextChannel(
- IN PRTMP_ADAPTER pAd)
-{
- HEADER_802_11 Hdr80211;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- UCHAR SsidLen = 0, ScanType = pAd->MlmeAux.ScanType, BBPValue = 0;
-#ifdef CONFIG_STA_SUPPORT
- USHORT Status;
- PHEADER_802_11 pHdr80211;
-#endif // CONFIG_STA_SUPPORT //
- UINT ScanTimeIn5gChannel = SHORT_CHANNEL_TIME;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (MONITOR_ON(pAd))
- return;
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RALINK_ATE
- // Nothing to do in ATE mode.
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- if (pAd->MlmeAux.Channel == 0)
- {
- if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
-#ifdef CONFIG_STA_SUPPORT
- && (INFRA_ON(pAd)
- || (pAd->OpMode == OPMODE_AP))
-#endif // CONFIG_STA_SUPPORT //
- )
- {
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- BBPValue |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to 40MHz channel %d, Total BSS[%02d]\n",pAd->CommonCfg.CentralChannel, pAd->ScanTab.BssNr));
- }
- else
- {
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- //
- // To prevent data lost.
- // Send an NULL data with turned PSM bit on to current associated AP before SCAN progress.
- // Now, we need to send an NULL data with turned PSM bit off to AP, when scan progress done
- //
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) && (INFRA_ON(pAd)))
- {
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer);
- if (NStatus == NDIS_STATUS_SUCCESS)
- {
- pHdr80211 = (PHEADER_802_11) pOutBuffer;
- MgtMacHeaderInit(pAd, pHdr80211, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pHdr80211->Duration = 0;
- pHdr80211->FC.Type = BTYPE_DATA;
- pHdr80211->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeScanReqAction -- Send PSM Data frame\n"));
- MlmeFreeMemory(pAd, pOutBuffer);
- RTMPusecDelay(5000);
- }
- }
-
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_SUCCESS;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
- }
- else
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // BBP and RF are not accessible in PS mode, we has to wake them up first
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- AsicForceWakeup(pAd, TRUE);
-
- // leave PSM during scanning. otherwise we may lost ProbeRsp & BEACON
- if (pAd->StaCfg.Psm == PWR_SAVE)
- RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, TRUE);
- AsicLockChannel(pAd, pAd->MlmeAux.Channel);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pAd->MlmeAux.Channel > 14)
- {
- if ((pAd->CommonCfg.bIEEE80211H == 1) && RadarChannelCheck(pAd, pAd->MlmeAux.Channel))
- {
- ScanType = SCAN_PASSIVE;
- ScanTimeIn5gChannel = MIN_CHANNEL_TIME;
- }
- }
-
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- // carrier detection
- if (pAd->CommonCfg.CarrierDetect.Enable == TRUE)
- {
- ScanType = SCAN_PASSIVE;
- ScanTimeIn5gChannel = MIN_CHANNEL_TIME;
- }
-#endif // CARRIER_DETECTION_SUPPORT //
- }
-
-#endif // CONFIG_STA_SUPPORT //
-
- //Global country domain(ch1-11:active scan, ch12-14 passive scan)
- if ((pAd->MlmeAux.Channel <= 14) && (pAd->MlmeAux.Channel >= 12) && ((pAd->CommonCfg.CountryRegion & 0x7f) == REGION_31_BG_BAND))
- {
- ScanType = SCAN_PASSIVE;
- }
-
- // We need to shorten active scan time in order for WZC connect issue
- // Chnage the channel scan time for CISCO stuff based on its IAPP announcement
- if (ScanType == FAST_SCAN_ACTIVE)
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, FAST_ACTIVE_SCAN_TIME);
- else // must be SCAN_PASSIVE or SCAN_ACTIVE
- {
- if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED)
-#ifdef DOT11_N_SUPPORT
- || (pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED) || (pAd->CommonCfg.PhyMode == PHY_11AGN_MIXED)
-#endif // DOT11_N_SUPPORT //
- )
- {
- if (pAd->MlmeAux.Channel > 14)
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, ScanTimeIn5gChannel);
- else
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, MIN_CHANNEL_TIME);
- }
- else
- RTMPSetTimer(&pAd->MlmeAux.ScanTimer, MAX_CHANNEL_TIME);
- }
-
- if ((ScanType == SCAN_ACTIVE)
- || (ScanType == FAST_SCAN_ACTIVE)
- )
- {
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - ScanNextChannel() allocate memory fail\n"));
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- return;
- }
-
- // There is no need to send broadcast probe request if active scan is in effect.
- if ((ScanType == SCAN_ACTIVE) || (ScanType == FAST_SCAN_ACTIVE)
- )
- SsidLen = pAd->MlmeAux.SsidLen;
- else
- SsidLen = 0;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, BROADCAST_ADDR, BROADCAST_ADDR);
-#endif // CONFIG_STA_SUPPORT //
-
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &Hdr80211,
- 1, &SsidIe,
- 1, &SsidLen,
- SsidLen, pAd->MlmeAux.Ssid,
- 1, &SupRateIe,
- 1, &pAd->CommonCfg.SupRateLen,
- pAd->CommonCfg.SupRateLen, pAd->CommonCfg.SupRate,
- END_OF_ARGS);
-
- if (pAd->CommonCfg.ExtRateLen)
- {
- ULONG Tmp;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &ExtRateIe,
- 1, &pAd->CommonCfg.ExtRateLen,
- pAd->CommonCfg.ExtRateLen, pAd->CommonCfg.ExtRate,
- END_OF_ARGS);
- FrameLen += Tmp;
- }
-
-#ifdef DOT11_N_SUPPORT
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- {
- ULONG Tmp;
- UCHAR HtLen;
- UCHAR BROADCOM[4] = {0x0, 0x90, 0x4c, 0x33};
-#ifdef RT_BIG_ENDIAN
- HT_CAPABILITY_IE HtCapabilityTmp;
-#endif
- if (pAd->bBroadComHT == TRUE)
- {
- HtLen = pAd->MlmeAux.HtCapabilityLen + 4;
-#ifdef RT_BIG_ENDIAN
- NdisMoveMemory(&HtCapabilityTmp, &pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
-#ifdef UNALIGNMENT_SUPPORT
- {
- EXT_HT_CAP_INFO extHtCapInfo;
-
- NdisMoveMemory((PUCHAR)(&extHtCapInfo), (PUCHAR)(&HtCapabilityTmp.ExtHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- *(USHORT *)(&extHtCapInfo) = cpu2le16(*(USHORT *)(&extHtCapInfo));
- NdisMoveMemory((PUCHAR)(&HtCapabilityTmp.ExtHtCapInfo), (PUCHAR)(&extHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- }
-#else
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = cpu2le16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-#endif // UNALIGNMENT_SUPPORT //
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &WpaIe,
- 1, &HtLen,
- 4, &BROADCOM[0],
- pAd->MlmeAux.HtCapabilityLen, &HtCapabilityTmp,
- END_OF_ARGS);
-#else
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &WpaIe,
- 1, &HtLen,
- 4, &BROADCOM[0],
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
-#endif // RT_BIG_ENDIAN //
- }
- else
- {
- HtLen = pAd->MlmeAux.HtCapabilityLen;
-#ifdef RT_BIG_ENDIAN
- NdisMoveMemory(&HtCapabilityTmp, &pAd->CommonCfg.HtCapability, SIZE_HT_CAP_IE);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
-#ifdef UNALIGNMENT_SUPPORT
- {
- EXT_HT_CAP_INFO extHtCapInfo;
-
- NdisMoveMemory((PUCHAR)(&extHtCapInfo), (PUCHAR)(&HtCapabilityTmp.ExtHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- *(USHORT *)(&extHtCapInfo) = cpu2le16(*(USHORT *)(&extHtCapInfo));
- NdisMoveMemory((PUCHAR)(&HtCapabilityTmp.ExtHtCapInfo), (PUCHAR)(&extHtCapInfo), sizeof(EXT_HT_CAP_INFO));
- }
-#else
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = cpu2le16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-#endif // UNALIGNMENT_SUPPORT //
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &HtCapabilityTmp,
- END_OF_ARGS);
-#else
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &pAd->CommonCfg.HtCapability,
- END_OF_ARGS);
-#endif // RT_BIG_ENDIAN //
- }
- FrameLen += Tmp;
-
-#ifdef DOT11N_DRAFT3
- if (pAd->CommonCfg.BACapability.field.b2040CoexistScanSup == 1)
- {
- ULONG Tmp;
- HtLen = 1;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &ExtHtCapIe,
- 1, &HtLen,
- 1, &pAd->CommonCfg.BSSCoexist2040.word,
- END_OF_ARGS);
-
- FrameLen += Tmp;
- }
-#endif // DOT11N_DRAFT3 //
- }
-#endif // DOT11_N_SUPPORT //
-
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- }
-
- // For SCAN_CISCO_PASSIVE, do nothing and silently wait for beacon or other probe reponse
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pAd->Mlme.SyncMachine.CurrState = SCAN_LISTEN;
-#endif // CONFIG_STA_SUPPORT //
-
- }
-}
-
-VOID MgtProbReqMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR SubType,
- IN UCHAR ToDs,
- IN PUCHAR pDA,
- IN PUCHAR pBssid)
-{
- NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
-
- pHdr80211->FC.Type = BTYPE_MGMT;
- pHdr80211->FC.SubType = SubType;
- if (SubType == SUBTYPE_ACK)
- pHdr80211->FC.Type = BTYPE_CNTL;
- pHdr80211->FC.ToDs = ToDs;
- COPY_MAC_ADDR(pHdr80211->Addr1, pDA);
- COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHdr80211->Addr3, pBssid);
-}
diff --git a/drivers/staging/rt3090/common/cmm_wpa.c b/drivers/staging/rt3090/common/cmm_wpa.c
deleted file mode 100644
index bf68ad8747ac..000000000000
--- a/drivers/staging/rt3090/common/cmm_wpa.c
+++ /dev/null
@@ -1,3149 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- wpa.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Jan Lee 03-07-22 Initial
- Paul Lin 03-11-28 Modify for supplicant
-*/
-
-#include "../rt_config.h"
-
-
-// WPA OUI
-UCHAR OUI_WPA_NONE_AKM[4] = {0x00, 0x50, 0xF2, 0x00};
-UCHAR OUI_WPA_VERSION[4] = {0x00, 0x50, 0xF2, 0x01};
-UCHAR OUI_WPA_WEP40[4] = {0x00, 0x50, 0xF2, 0x01};
-UCHAR OUI_WPA_TKIP[4] = {0x00, 0x50, 0xF2, 0x02};
-UCHAR OUI_WPA_CCMP[4] = {0x00, 0x50, 0xF2, 0x04};
-UCHAR OUI_WPA_WEP104[4] = {0x00, 0x50, 0xF2, 0x05};
-UCHAR OUI_WPA_8021X_AKM[4] = {0x00, 0x50, 0xF2, 0x01};
-UCHAR OUI_WPA_PSK_AKM[4] = {0x00, 0x50, 0xF2, 0x02};
-// WPA2 OUI
-UCHAR OUI_WPA2_WEP40[4] = {0x00, 0x0F, 0xAC, 0x01};
-UCHAR OUI_WPA2_TKIP[4] = {0x00, 0x0F, 0xAC, 0x02};
-UCHAR OUI_WPA2_CCMP[4] = {0x00, 0x0F, 0xAC, 0x04};
-UCHAR OUI_WPA2_8021X_AKM[4] = {0x00, 0x0F, 0xAC, 0x01};
-UCHAR OUI_WPA2_PSK_AKM[4] = {0x00, 0x0F, 0xAC, 0x02};
-UCHAR OUI_WPA2_WEP104[4] = {0x00, 0x0F, 0xAC, 0x05};
-
-
-
-static VOID ConstructEapolKeyData(
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR GroupKeyWepStatus,
- IN UCHAR keyDescVer,
- IN UCHAR MsgType,
- IN UCHAR DefaultKeyIdx,
- IN UCHAR *GTK,
- IN UCHAR *RSNIE,
- IN UCHAR RSNIE_LEN,
- OUT PEAPOL_PACKET pMsg);
-
-static VOID CalculateMIC(
- IN UCHAR KeyDescVer,
- IN UCHAR *PTK,
- OUT PEAPOL_PACKET pMsg);
-
-static VOID WpaEAPPacketAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-static VOID WpaEAPOLASFAlertAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-static VOID WpaEAPOLLogoffAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-static VOID WpaEAPOLStartAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-static VOID WpaEAPOLKeyAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-/*
- ==========================================================================
- Description:
- association state machine init, including state transition and timer init
- Parameters:
- S - pointer to the association state machine
- ==========================================================================
- */
-VOID WpaStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(S, (STATE_MACHINE_FUNC *)Trans, MAX_WPA_PTK_STATE, MAX_WPA_MSG, (STATE_MACHINE_FUNC)Drop, WPA_PTK, WPA_MACHINE_BASE);
-
- StateMachineSetAction(S, WPA_PTK, MT2_EAPPacket, (STATE_MACHINE_FUNC)WpaEAPPacketAction);
- StateMachineSetAction(S, WPA_PTK, MT2_EAPOLStart, (STATE_MACHINE_FUNC)WpaEAPOLStartAction);
- StateMachineSetAction(S, WPA_PTK, MT2_EAPOLLogoff, (STATE_MACHINE_FUNC)WpaEAPOLLogoffAction);
- StateMachineSetAction(S, WPA_PTK, MT2_EAPOLKey, (STATE_MACHINE_FUNC)WpaEAPOLKeyAction);
- StateMachineSetAction(S, WPA_PTK, MT2_EAPOLASFAlert, (STATE_MACHINE_FUNC)WpaEAPOLASFAlertAction);
-}
-
-/*
- ==========================================================================
- Description:
- this is state machine function.
- When receiving EAP packets which is for 802.1x authentication use.
- Not use in PSK case
- Return:
- ==========================================================================
-*/
-VOID WpaEAPPacketAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-VOID WpaEAPOLASFAlertAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-VOID WpaEAPOLLogoffAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-/*
- ==========================================================================
- Description:
- Start 4-way HS when rcv EAPOL_START which may create by our driver in assoc.c
- Return:
- ==========================================================================
-*/
-VOID WpaEAPOLStartAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MAC_TABLE_ENTRY *pEntry;
- PHEADER_802_11 pHeader;
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaEAPOLStartAction ===> \n"));
-
- pHeader = (PHEADER_802_11)Elem->Msg;
-
- //For normaol PSK, we enqueue an EAPOL-Start command to trigger the process.
- if (Elem->MsgLen == 6)
- pEntry = MacTableLookup(pAd, Elem->Msg);
- else
- {
- pEntry = MacTableLookup(pAd, pHeader->Addr2);
- }
-
- if (pEntry)
- {
- DBGPRINT(RT_DEBUG_TRACE, (" PortSecured(%d), WpaState(%d), AuthMode(%d), PMKID_CacheIdx(%d) \n", pEntry->PortSecured, pEntry->WpaState, pEntry->AuthMode, pEntry->PMKID_CacheIdx));
-
- if ((pEntry->PortSecured == WPA_802_1X_PORT_NOT_SECURED)
- && (pEntry->WpaState < AS_PTKSTART)
- && ((pEntry->AuthMode == Ndis802_11AuthModeWPAPSK) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK) || ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) && (pEntry->PMKID_CacheIdx != ENTRY_NOT_FOUND))))
- {
- pEntry->PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
- pEntry->WpaState = AS_INITPSK;
- pEntry->PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- NdisZeroMemory(pEntry->R_Counter, sizeof(pEntry->R_Counter));
- pEntry->ReTryCounter = PEER_MSG1_RETRY_TIMER_CTR;
-
- WPAStart4WayHS(pAd, pEntry, PEER_MSG1_RETRY_EXEC_INTV);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
- This is state machine function.
- When receiving EAPOL packets which is for 802.1x key management.
- Use both in WPA, and WPAPSK case.
- In this function, further dispatch to different functions according to the received packet. 3 categories are :
- 1. normal 4-way pairwisekey and 2-way groupkey handshake
- 2. MIC error (Countermeasures attack) report packet from STA.
- 3. Request for pairwise/group key update from STA
- Return:
- ==========================================================================
-*/
-VOID WpaEAPOLKeyAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MAC_TABLE_ENTRY *pEntry;
- PHEADER_802_11 pHeader;
- PEAPOL_PACKET pEapol_packet;
- KEY_INFO peerKeyInfo;
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaEAPOLKeyAction ===>\n"));
-
- pHeader = (PHEADER_802_11)Elem->Msg;
- pEapol_packet = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
-
- NdisZeroMemory((PUCHAR)&peerKeyInfo, sizeof(peerKeyInfo));
- NdisMoveMemory((PUCHAR)&peerKeyInfo, (PUCHAR)&pEapol_packet->KeyDesc.KeyInfo, sizeof(KEY_INFO));
-
- hex_dump("Received Eapol frame", (unsigned char *)pEapol_packet, (Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H));
-
- *((USHORT *)&peerKeyInfo) = cpu2le16(*((USHORT *)&peerKeyInfo));
-
- do
- {
- pEntry = MacTableLookup(pAd, pHeader->Addr2);
-
- if (!pEntry || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
- break;
-
- if (pEntry->AuthMode < Ndis802_11AuthModeWPA)
- break;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPoL-Key frame from STA %02X-%02X-%02X-%02X-%02X-%02X\n", PRINT_MAC(pEntry->Addr)));
-
- if (((pEapol_packet->ProVer != EAPOL_VER) && (pEapol_packet->ProVer != EAPOL_VER2)) ||
- ((pEapol_packet->KeyDesc.Type != WPA1_KEY_DESC) && (pEapol_packet->KeyDesc.Type != WPA2_KEY_DESC)))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Key descripter does not match with WPA rule\n"));
- break;
- }
-
- // The value 1 shall be used for all EAPOL-Key frames to and from a STA when
- // neither the group nor pairwise ciphers are CCMP for Key Descriptor 1.
- if ((pEntry->WepStatus == Ndis802_11Encryption2Enabled) && (peerKeyInfo.KeyDescVer != DESC_TYPE_TKIP))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Key descripter version not match(TKIP) \n"));
- break;
- }
- // The value 2 shall be used for all EAPOL-Key frames to and from a STA when
- // either the pairwise or the group cipher is AES-CCMP for Key Descriptor 2.
- else if ((pEntry->WepStatus == Ndis802_11Encryption3Enabled) && (peerKeyInfo.KeyDescVer != DESC_TYPE_AES))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Key descripter version not match(AES) \n"));
- break;
- }
-
- // Check if this STA is in class 3 state and the WPA state is started
- if ((pEntry->Sst == SST_ASSOC) && (pEntry->WpaState >= AS_INITPSK))
- {
- // Check the Key Ack (bit 7) of the Key Information to determine the Authenticator
- // or not.
- // An EAPOL-Key frame that is sent by the Supplicant in response to an EAPOL-
- // Key frame from the Authenticator must not have the Ack bit set.
- if (peerKeyInfo.KeyAck == 1)
- {
- // The frame is snet by Authenticator.
- // So the Supplicant side shall handle this.
-
- if ((peerKeyInfo.Secure == 0) && (peerKeyInfo.Request == 0) &&
- (peerKeyInfo.Error == 0) && (peerKeyInfo.KeyType == PAIRWISEKEY))
- {
- // Process 1. the message 1 of 4-way HS in WPA or WPA2
- // EAPOL-Key(0,0,1,0,P,0,0,ANonce,0,DataKD_M1)
- // 2. the message 3 of 4-way HS in WPA
- // EAPOL-Key(0,1,1,1,P,0,KeyRSC,ANonce,MIC,DataKD_M3)
- if (peerKeyInfo.KeyMic == 0)
- PeerPairMsg1Action(pAd, pEntry, Elem);
- else
- PeerPairMsg3Action(pAd, pEntry, Elem);
- }
- else if ((peerKeyInfo.Secure == 1) &&
- (peerKeyInfo.KeyMic == 1) &&
- (peerKeyInfo.Request == 0) &&
- (peerKeyInfo.Error == 0))
- {
- // Process 1. the message 3 of 4-way HS in WPA2
- // EAPOL-Key(1,1,1,1,P,0,KeyRSC,ANonce,MIC,DataKD_M3)
- // 2. the message 1 of group KS in WPA or WPA2
- // EAPOL-Key(1,1,1,0,G,0,Key RSC,0, MIC,GTK[N])
- if (peerKeyInfo.KeyType == PAIRWISEKEY)
- PeerPairMsg3Action(pAd, pEntry, Elem);
- else
- PeerGroupMsg1Action(pAd, pEntry, Elem);
- }
- }
- else
- {
- // The frame is snet by Supplicant.
- // So the Authenticator side shall handle this.
- if ((peerKeyInfo.Request == 0) &&
- (peerKeyInfo.Error == 0) &&
- (peerKeyInfo.KeyMic == 1))
- {
- if (peerKeyInfo.Secure == 0 && peerKeyInfo.KeyType == PAIRWISEKEY)
- {
- // EAPOL-Key(0,1,0,0,P,0,0,SNonce,MIC,Data)
- // Process 1. message 2 of 4-way HS in WPA or WPA2
- // 2. message 4 of 4-way HS in WPA
- if (CONV_ARRARY_TO_UINT16(pEapol_packet->KeyDesc.KeyDataLen) == 0)
- {
- PeerPairMsg4Action(pAd, pEntry, Elem);
- }
- else
- {
- PeerPairMsg2Action(pAd, pEntry, Elem);
- }
- }
- else if (peerKeyInfo.Secure == 1 && peerKeyInfo.KeyType == PAIRWISEKEY)
- {
- // EAPOL-Key(1,1,0,0,P,0,0,0,MIC,0)
- // Process message 4 of 4-way HS in WPA2
- PeerPairMsg4Action(pAd, pEntry, Elem);
- }
- else if (peerKeyInfo.Secure == 1 && peerKeyInfo.KeyType == GROUPKEY)
- {
- // EAPOL-Key(1,1,0,0,G,0,0,0,MIC,0)
- // Process message 2 of Group key HS in WPA or WPA2
- PeerGroupMsg2Action(pAd, pEntry, &Elem->Msg[LENGTH_802_11], (Elem->MsgLen - LENGTH_802_11));
- }
- }
- }
- }
- }while(FALSE);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Copy frame from waiting queue into relative ring buffer and set
- appropriate ASIC register to kick hardware encryption before really
- sent out to air.
-
- Arguments:
- pAd Pointer to our adapter
- PNDIS_PACKET Pointer to outgoing Ndis frame
- NumberOfFrag Number of fragment required
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPToWirelessSta(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN UINT DataLen,
- IN BOOLEAN bClearFrame)
-{
- PNDIS_PACKET pPacket;
- NDIS_STATUS Status;
-
- if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
- return;
-
- do {
- // build a NDIS packet
- Status = RTMPAllocateNdisPacket(pAd, &pPacket, pHeader802_3, HdrLen, pData, DataLen);
- if (Status != NDIS_STATUS_SUCCESS)
- break;
-
-
- if (bClearFrame)
- RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 1);
- else
- RTMP_SET_PACKET_CLEAR_EAP_FRAME(pPacket, 0);
- {
- RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS);
-
- RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPacket, MAIN_MBSSID); // set a default value
- if(pEntry->apidx != 0)
- RTMP_SET_PACKET_NET_DEVICE_MBSSID(pPacket, pEntry->apidx);
-
- RTMP_SET_PACKET_WCID(pPacket, (UCHAR)pEntry->Aid);
- RTMP_SET_PACKET_MOREDATA(pPacket, FALSE);
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // send out the packet
- Status = STASendPacket(pAd, pPacket);
- if (Status == NDIS_STATUS_SUCCESS)
- {
- UCHAR Index;
-
- // Dequeue one frame from TxSwQueue0..3 queue and process it
- // There are three place calling dequeue for TX ring.
- // 1. Here, right after queueing the frame.
- // 2. At the end of TxRingTxDone service routine.
- // 3. Upon NDIS call RTMPSendPackets
- if((!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS)))
- {
- for(Index = 0; Index < 5; Index ++)
- if(pAd->TxSwQueue[Index].Number > 0)
- RTMPDeQueuePacket(pAd, FALSE, Index, MAX_TX_PROCESS);
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- } while (FALSE);
-}
-
-/*
- ==========================================================================
- Description:
- This is a function to initilize 4-way handshake
-
- Return:
-
- ==========================================================================
-*/
-VOID WPAStart4WayHS(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN ULONG TimeInterval)
-{
- UCHAR Header802_3[14];
- EAPOL_PACKET EAPOLPKT;
- PUINT8 pBssid = NULL;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart4WayHS\n"));
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS | fRTMP_ADAPTER_HALT_IN_PROGRESS))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : The interface is closed...\n"));
- return;
- }
-
-
- if (pBssid == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : No corresponding Authenticator.\n"));
- return;
- }
-
- // Check the status
- if ((pEntry->WpaState > AS_PTKSTART) || (pEntry->WpaState < AS_INITPMK))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("[ERROR]WPAStart4WayHS : Not expect calling\n"));
- return;
- }
-
-
- // Increment replay counter by 1
- ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
-
- // Randomly generate ANonce
- GenRandom(pAd, (UCHAR *)pBssid, pEntry->ANonce);
-
- // Construct EAPoL message - Pairwise Msg 1
- // EAPOL-Key(0,0,1,0,P,0,0,ANonce,0,DataKD_M1)
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_PAIR_MSG_1,
- 0, // Default key index
- pEntry->ANonce,
- NULL, // TxRSC
- NULL, // GTK
- NULL, // RSNIE
- 0, // RSNIE length
- &EAPOLPKT);
-
-
- // Make outgoing frame
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
- RTMPToWirelessSta(pAd, pEntry, Header802_3,
- LENGTH_802_3, (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4,
- (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE);
-
- // Trigger Retry Timer
- RTMPModTimer(&pEntry->RetryTimer, TimeInterval);
-
- // Update State
- pEntry->WpaState = AS_PTKSTART;
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== WPAStart4WayHS: send Msg1 of 4-way \n"));
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Pairwise key Msg-1 of 4-way handshaking and send Msg-2
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID PeerPairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR PTK[80];
- UCHAR Header802_3[14];
- PEAPOL_PACKET pMsg1;
- UINT MsgLen;
- EAPOL_PACKET EAPOLPKT;
- PUINT8 pCurrentAddr = NULL;
- PUINT8 pmk_ptr = NULL;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
- PUINT8 rsnie_ptr = NULL;
- UCHAR rsnie_len = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg1Action \n"));
-
- if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
- return;
-
- if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
- return;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pCurrentAddr = pAd->CurrentAddress;
- pmk_ptr = pAd->StaCfg.PMK;
- group_cipher = pAd->StaCfg.GroupCipher;
- rsnie_ptr = pAd->StaCfg.RSN_IE;
- rsnie_len = pAd->StaCfg.RSNIE_Len;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Store the received frame
- pMsg1 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
- MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
-
- // Sanity Check peer Pairwise message 1 - Replay Counter
- if (PeerWpaMessageSanity(pAd, pMsg1, MsgLen, EAPOL_PAIR_MSG_1, pEntry) == FALSE)
- return;
-
- // Store Replay counter, it will use to verify message 3 and construct message 2
- NdisMoveMemory(pEntry->R_Counter, pMsg1->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Store ANonce
- NdisMoveMemory(pEntry->ANonce, pMsg1->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
-
- // Generate random SNonce
- GenRandom(pAd, (UCHAR *)pCurrentAddr, pEntry->SNonce);
-
- {
- // Calculate PTK(ANonce, SNonce)
- WpaDerivePTK(pAd,
- pmk_ptr,
- pEntry->ANonce,
- pEntry->Addr,
- pEntry->SNonce,
- pCurrentAddr,
- PTK,
- LEN_PTK);
-
- // Save key to PTK entry
- NdisMoveMemory(pEntry->PTK, PTK, LEN_PTK);
- }
-
- // Update WpaState
- pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
-
- // Construct EAPoL message - Pairwise Msg 2
- // EAPOL-Key(0,1,0,0,P,0,0,SNonce,MIC,DataKD_M2)
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_PAIR_MSG_2,
- 0, // DefaultKeyIdx
- pEntry->SNonce,
- NULL, // TxRsc
- NULL, // GTK
- (UCHAR *)rsnie_ptr,
- rsnie_len,
- &EAPOLPKT);
-
- // Make outgoing frame
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
-
- RTMPToWirelessSta(pAd, pEntry,
- Header802_3, sizeof(Header802_3), (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg1Action: send Msg2 of 4-way \n"));
-}
-
-
-/*
- ==========================================================================
- Description:
- When receiving the second packet of 4-way pairwisekey handshake.
- Return:
- ==========================================================================
-*/
-VOID PeerPairMsg2Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR PTK[80];
- BOOLEAN Cancelled;
- PHEADER_802_11 pHeader;
- EAPOL_PACKET EAPOLPKT;
- PEAPOL_PACKET pMsg2;
- UINT MsgLen;
- UCHAR Header802_3[LENGTH_802_3];
- UCHAR TxTsc[6];
- PUINT8 pBssid = NULL;
- PUINT8 pmk_ptr = NULL;
- PUINT8 gtk_ptr = NULL;
- UCHAR default_key = 0;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
- PUINT8 rsnie_ptr = NULL;
- UCHAR rsnie_len = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg2Action \n"));
-
- if ((!pEntry) || (!pEntry->ValidAsCLI))
- return;
-
- if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
- return;
-
- // check Entry in valid State
- if (pEntry->WpaState < AS_PTKSTART)
- return;
-
-
-
- // pointer to 802.11 header
- pHeader = (PHEADER_802_11)Elem->Msg;
-
- // skip 802.11_header(24-byte) and LLC_header(8)
- pMsg2 = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
- MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
-
- // Store SNonce
- NdisMoveMemory(pEntry->SNonce, pMsg2->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE);
-
- {
- // Derive PTK
- WpaDerivePTK(pAd,
- (UCHAR *)pmk_ptr,
- pEntry->ANonce, // ANONCE
- (UCHAR *)pBssid,
- pEntry->SNonce, // SNONCE
- pEntry->Addr,
- PTK,
- LEN_PTK);
-
- NdisMoveMemory(pEntry->PTK, PTK, LEN_PTK);
- }
-
- // Sanity Check peer Pairwise message 2 - Replay Counter, MIC, RSNIE
- if (PeerWpaMessageSanity(pAd, pMsg2, MsgLen, EAPOL_PAIR_MSG_2, pEntry) == FALSE)
- return;
-
- do
- {
- // delete retry timer
- RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
-
- // Change state
- pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
-
- // Increment replay counter by 1
- ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
-
- // Construct EAPoL message - Pairwise Msg 3
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_PAIR_MSG_3,
- default_key,
- pEntry->ANonce,
- TxTsc,
- (UCHAR *)gtk_ptr,
- (UCHAR *)rsnie_ptr,
- rsnie_len,
- &EAPOLPKT);
-
- // Make outgoing frame
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
- RTMPToWirelessSta(pAd, pEntry, Header802_3, LENGTH_802_3,
- (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4,
- (pEntry->PortSecured == WPA_802_1X_PORT_SECURED) ? FALSE : TRUE);
-
- pEntry->ReTryCounter = PEER_MSG3_RETRY_TIMER_CTR;
- RTMPSetTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
-
- // Update State
- pEntry->WpaState = AS_PTKINIT_NEGOTIATING;
- }while(FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg2Action: send Msg3 of 4-way \n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Pairwise key Msg 3 of 4-way handshaking and send Msg 4
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID PeerPairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PHEADER_802_11 pHeader;
- UCHAR Header802_3[14];
- EAPOL_PACKET EAPOLPKT;
- PEAPOL_PACKET pMsg3;
- UINT MsgLen;
- PUINT8 pCurrentAddr = NULL;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg3Action \n"));
-
- if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
- return;
-
- if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
- return;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pCurrentAddr = pAd->CurrentAddress;
- group_cipher = pAd->StaCfg.GroupCipher;
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Record 802.11 header & the received EAPOL packet Msg3
- pHeader = (PHEADER_802_11) Elem->Msg;
- pMsg3 = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
- MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
-
- // Sanity Check peer Pairwise message 3 - Replay Counter, MIC, RSNIE
- if (PeerWpaMessageSanity(pAd, pMsg3, MsgLen, EAPOL_PAIR_MSG_3, pEntry) == FALSE)
- return;
-
- // Save Replay counter, it will use construct message 4
- NdisMoveMemory(pEntry->R_Counter, pMsg3->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Double check ANonce
- if (!NdisEqualMemory(pEntry->ANonce, pMsg3->KeyDesc.KeyNonce, LEN_KEY_DESC_NONCE))
- {
- return;
- }
-
- // Construct EAPoL message - Pairwise Msg 4
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_PAIR_MSG_4,
- 0, // group key index not used in message 4
- NULL, // Nonce not used in message 4
- NULL, // TxRSC not used in message 4
- NULL, // GTK not used in message 4
- NULL, // RSN IE not used in message 4
- 0,
- &EAPOLPKT);
-
- // Update WpaState
- pEntry->WpaState = AS_PTKINITDONE;
-
- // Update pairwise key
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- PCIPHER_KEY pSharedKey;
-
- pSharedKey = &pAd->SharedKey[BSS0][0];
-
- NdisMoveMemory(pAd->StaCfg.PTK, pEntry->PTK, LEN_PTK);
-
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
- pSharedKey->KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pSharedKey->Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pSharedKey->CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pSharedKey->CipherAlg = CIPHER_AES;
- else
- pSharedKey->CipherAlg = CIPHER_NONE;
-
- // Update these related information to MAC_TABLE_ENTRY
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
- pEntry->PairwiseKey.CipherAlg = pSharedKey->CipherAlg;
-
- // Update pairwise key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pSharedKey->CipherAlg,
- pSharedKey->Key,
- pSharedKey->TxMic,
- pSharedKey->RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- pSharedKey->CipherAlg,
- pEntry);
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // open 802.1x port control and privacy filter
- if (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK ||
- pEntry->AuthMode == Ndis802_11AuthModeWPA2)
- {
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
-
-#ifdef CONFIG_STA_SUPPORT
- STA_PORT_SECURED(pAd);
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
-#endif // CONFIG_STA_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE, ("PeerPairMsg3Action: AuthMode(%s) PairwiseCipher(%s) GroupCipher(%s) \n",
- GetAuthMode(pEntry->AuthMode),
- GetEncryptType(pEntry->WepStatus),
- GetEncryptType(group_cipher)));
- }
- else
- {
- }
-
- // Init 802.3 header and send out
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
- RTMPToWirelessSta(pAd, pEntry,
- Header802_3, sizeof(Header802_3),
- (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, TRUE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerPairMsg3Action: send Msg4 of 4-way \n"));
-}
-
-/*
- ==========================================================================
- Description:
- When receiving the last packet of 4-way pairwisekey handshake.
- Initilize 2-way groupkey handshake following.
- Return:
- ==========================================================================
-*/
-VOID PeerPairMsg4Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PEAPOL_PACKET pMsg4;
- PHEADER_802_11 pHeader;
- UINT MsgLen;
- BOOLEAN Cancelled;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerPairMsg4Action\n"));
-
- do
- {
- if ((!pEntry) || (!pEntry->ValidAsCLI))
- break;
-
- if (Elem->MsgLen < (LENGTH_802_11 + LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2 ) )
- break;
-
- if (pEntry->WpaState < AS_PTKINIT_NEGOTIATING)
- break;
-
-
- // pointer to 802.11 header
- pHeader = (PHEADER_802_11)Elem->Msg;
-
- // skip 802.11_header(24-byte) and LLC_header(8)
- pMsg4 = (PEAPOL_PACKET)&Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
- MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
-
- // Sanity Check peer Pairwise message 4 - Replay Counter, MIC
- if (PeerWpaMessageSanity(pAd, pMsg4, MsgLen, EAPOL_PAIR_MSG_4, pEntry) == FALSE)
- break;
-
- // 3. uses the MLME.SETKEYS.request to configure PTK into MAC
- NdisZeroMemory(&pEntry->PairwiseKey, sizeof(CIPHER_KEY));
-
- // reset IVEIV in Asic
- AsicUpdateWCIDIVEIV(pAd, pEntry->Aid, 1, 0);
-
- pEntry->PairwiseKey.KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pEntry->PairwiseKey.Key, &pEntry->PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pEntry->PTK[TKIP_AP_RXMICK_OFFSET], LEN_TKIP_RXMICK);
- NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pEntry->PTK[TKIP_AP_TXMICK_OFFSET], LEN_TKIP_TXMICK);
-
- // Set pairwise key to Asic
- {
- pEntry->PairwiseKey.CipherAlg = CIPHER_NONE;
- if (pEntry->WepStatus == Ndis802_11Encryption2Enabled)
- pEntry->PairwiseKey.CipherAlg = CIPHER_TKIP;
- else if (pEntry->WepStatus == Ndis802_11Encryption3Enabled)
- pEntry->PairwiseKey.CipherAlg = CIPHER_AES;
-
- // Add Pair-wise key to Asic
- AsicAddPairwiseKeyEntry(
- pAd,
- pEntry->Addr,
- (UCHAR)pEntry->Aid,
- &pEntry->PairwiseKey);
-
- // update WCID attribute table and IVEIV table for this entry
- RTMPAddWcidAttributeEntry(
- pAd,
- pEntry->apidx,
- 0,
- pEntry->PairwiseKey.CipherAlg,
- pEntry);
- }
-
- // 4. upgrade state
- pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
- pEntry->WpaState = AS_PTKINITDONE;
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
-
-
- if (pEntry->AuthMode == Ndis802_11AuthModeWPA2 ||
- pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK)
- {
- pEntry->GTKState = REKEY_ESTABLISHED;
- RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
-
-
- // send wireless event - for set key done WPA2
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA2, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
- pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
- pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
- group_cipher,
- GetEncryptType(group_cipher)));
- }
- else
- {
- // 5. init Group 2-way handshake if necessary.
- WPAStart2WayGroupHS(pAd, pEntry);
-
- pEntry->ReTryCounter = GROUP_MSG1_RETRY_TIMER_CTR;
- RTMPModTimer(&pEntry->RetryTimer, PEER_MSG3_RETRY_EXEC_INTV);
- }
- }while(FALSE);
-
-}
-
-/*
- ==========================================================================
- Description:
- This is a function to send the first packet of 2-way groupkey handshake
- Return:
-
- ==========================================================================
-*/
-VOID WPAStart2WayGroupHS(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry)
-{
- UCHAR Header802_3[14];
- UCHAR TxTsc[6];
- EAPOL_PACKET EAPOLPKT;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
- UCHAR default_key = 0;
- PUINT8 gnonce_ptr = NULL;
- PUINT8 gtk_ptr = NULL;
- PUINT8 pBssid = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> WPAStart2WayGroupHS\n"));
-
- if ((!pEntry) || (!pEntry->ValidAsCLI))
- return;
-
-
- do
- {
- // Increment replay counter by 1
- ADD_ONE_To_64BIT_VAR(pEntry->R_Counter);
-
- // Construct EAPoL message - Group Msg 1
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_GROUP_MSG_1,
- default_key,
- (UCHAR *)gnonce_ptr,
- TxTsc,
- (UCHAR *)gtk_ptr,
- NULL,
- 0,
- &EAPOLPKT);
-
- // Make outgoing frame
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pBssid, EAPOL);
- RTMPToWirelessSta(pAd, pEntry,
- Header802_3, LENGTH_802_3,
- (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, FALSE);
-
-
-
- }while (FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== WPAStart2WayGroupHS : send out Group Message 1 \n"));
-
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Process Group key 2-way handshaking
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID PeerGroupMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Header802_3[14];
- EAPOL_PACKET EAPOLPKT;
- PEAPOL_PACKET pGroup;
- UINT MsgLen;
- BOOLEAN Cancelled;
- UCHAR default_key = 0;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
- PUINT8 pCurrentAddr = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg1Action \n"));
-
- if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
- return;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pCurrentAddr = pAd->CurrentAddress;
- group_cipher = pAd->StaCfg.GroupCipher;
- default_key = pAd->StaCfg.DefaultKeyId;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Process Group Message 1 frame. skip 802.11 header(24) & LLC_SNAP header(8)
- pGroup = (PEAPOL_PACKET) &Elem->Msg[LENGTH_802_11 + LENGTH_802_1_H];
- MsgLen = Elem->MsgLen - LENGTH_802_11 - LENGTH_802_1_H;
-
- // Sanity Check peer group message 1 - Replay Counter, MIC, RSNIE
- if (PeerWpaMessageSanity(pAd, pGroup, MsgLen, EAPOL_GROUP_MSG_1, pEntry) == FALSE)
- return;
-
- // delete retry timer
- RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
-
- // Save Replay counter, it will use to construct message 2
- NdisMoveMemory(pEntry->R_Counter, pGroup->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Construct EAPoL message - Group Msg 2
- NdisZeroMemory(&EAPOLPKT, sizeof(EAPOL_PACKET));
- ConstructEapolMsg(pEntry,
- group_cipher,
- EAPOL_GROUP_MSG_2,
- default_key,
- NULL, // Nonce not used
- NULL, // TxRSC not used
- NULL, // GTK not used
- NULL, // RSN IE not used
- 0,
- &EAPOLPKT);
-
- // open 802.1x port control and privacy filter
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
-
-#ifdef CONFIG_STA_SUPPORT
- STA_PORT_SECURED(pAd);
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("PeerGroupMsg1Action: AuthMode(%s) PairwiseCipher(%s) GroupCipher(%s) \n",
- GetAuthMode(pEntry->AuthMode),
- GetEncryptType(pEntry->WepStatus),
- GetEncryptType(group_cipher)));
-
- // init header and Fill Packet and send Msg 2 to authenticator
- MAKE_802_3_HEADER(Header802_3, pEntry->Addr, pCurrentAddr, EAPOL);
- RTMPToWirelessSta(pAd, pEntry,
- Header802_3, sizeof(Header802_3),
- (PUCHAR)&EAPOLPKT,
- CONV_ARRARY_TO_UINT16(EAPOLPKT.Body_Len) + 4, FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== PeerGroupMsg1Action: sned group message 2\n"));
-}
-
-/*
- ==========================================================================
- Description:
- When receiving the last packet of 2-way groupkey handshake.
- Return:
- ==========================================================================
-*/
-VOID PeerGroupMsg2Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN VOID *Msg,
- IN UINT MsgLen)
-{
- UINT Len;
- PUCHAR pData;
- BOOLEAN Cancelled;
- PEAPOL_PACKET pMsg2;
- UCHAR group_cipher = Ndis802_11WEPDisabled;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> PeerGroupMsg2Action \n"));
-
- do
- {
- if ((!pEntry) || (!pEntry->ValidAsCLI))
- break;
-
- if (MsgLen < (LENGTH_802_1_H + LENGTH_EAPOL_H + sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE - 2))
- break;
-
- if (pEntry->WpaState != AS_PTKINITDONE)
- break;
-
-
- pData = (PUCHAR)Msg;
- pMsg2 = (PEAPOL_PACKET) (pData + LENGTH_802_1_H);
- Len = MsgLen - LENGTH_802_1_H;
-
- // Sanity Check peer group message 2 - Replay Counter, MIC
- if (PeerWpaMessageSanity(pAd, pMsg2, Len, EAPOL_GROUP_MSG_2, pEntry) == FALSE)
- break;
-
- // 3. upgrade state
-
- RTMPCancelTimer(&pEntry->RetryTimer, &Cancelled);
- pEntry->GTKState = REKEY_ESTABLISHED;
-
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) || (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- // send wireless event - for set key done WPA2
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA2_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA2, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
- pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
- pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
- group_cipher, GetEncryptType(group_cipher)));
- }
- else
- {
- // send wireless event - for set key done WPA
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_SET_KEY_DONE_WPA1_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- DBGPRINT(RT_DEBUG_OFF, ("AP SETKEYS DONE - WPA1, AuthMode(%d)=%s, WepStatus(%d)=%s, GroupWepStatus(%d)=%s\n\n",
- pEntry->AuthMode, GetAuthMode(pEntry->AuthMode),
- pEntry->WepStatus, GetEncryptType(pEntry->WepStatus),
- group_cipher, GetEncryptType(group_cipher)));
- }
- }while(FALSE);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Classify WPA EAP message type
-
- Arguments:
- EAPType Value of EAP message type
- MsgType Internal Message definition for MLME state machine
-
- Return Value:
- TRUE Found appropriate message type
- FALSE No appropriate message type
-
- IRQL = DISPATCH_LEVEL
-
- Note:
- All these constants are defined in wpa.h
- For supplicant, there is only EAPOL Key message avaliable
-
- ========================================================================
-*/
-BOOLEAN WpaMsgTypeSubst(
- IN UCHAR EAPType,
- OUT INT *MsgType)
-{
- switch (EAPType)
- {
- case EAPPacket:
- *MsgType = MT2_EAPPacket;
- break;
- case EAPOLStart:
- *MsgType = MT2_EAPOLStart;
- break;
- case EAPOLLogoff:
- *MsgType = MT2_EAPOLLogoff;
- break;
- case EAPOLKey:
- *MsgType = MT2_EAPOLKey;
- break;
- case EAPOLASFAlert:
- *MsgType = MT2_EAPOLASFAlert;
- break;
- default:
- return FALSE;
- }
- return TRUE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- The pseudo-random function(PRF) that hashes various inputs to
- derive a pseudo-random value. To add liveness to the pseudo-random
- value, a nonce should be one of the inputs.
-
- It is used to generate PTK, GTK or some specific random value.
-
- Arguments:
- UCHAR *key, - the key material for HMAC_SHA1 use
- INT key_len - the length of key
- UCHAR *prefix - a prefix label
- INT prefix_len - the length of the label
- UCHAR *data - a specific data with variable length
- INT data_len - the length of a specific data
- INT len - the output lenght
-
- Return Value:
- UCHAR *output - the calculated result
-
- Note:
- 802.11i-2004 Annex H.3
-
- ========================================================================
-*/
-VOID PRF(
- IN UCHAR *key,
- IN INT key_len,
- IN UCHAR *prefix,
- IN INT prefix_len,
- IN UCHAR *data,
- IN INT data_len,
- OUT UCHAR *output,
- IN INT len)
-{
- INT i;
- UCHAR *input;
- INT currentindex = 0;
- INT total_len;
-
- // Allocate memory for input
- os_alloc_mem(NULL, (PUCHAR *)&input, 1024);
-
- if (input == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("!!!PRF: no memory!!!\n"));
- return;
- }
-
- // Generate concatenation input
- NdisMoveMemory(input, prefix, prefix_len);
-
- // Concatenate a single octet containing 0
- input[prefix_len] = 0;
-
- // Concatenate specific data
- NdisMoveMemory(&input[prefix_len + 1], data, data_len);
- total_len = prefix_len + 1 + data_len;
-
- // Concatenate a single octet containing 0
- // This octet shall be update later
- input[total_len] = 0;
- total_len++;
-
- // Iterate to calculate the result by hmac-sha-1
- // Then concatenate to last result
- for (i = 0; i < (len + 19) / 20; i++)
- {
- HMAC_SHA1(key, key_len, input, total_len, &output[currentindex], SHA1_DIGEST_SIZE);
- currentindex += 20;
-
- // update the last octet
- input[total_len - 1]++;
- }
- os_free_mem(NULL, input);
-}
-
-/*
-* F(P, S, c, i) = U1 xor U2 xor ... Uc
-* U1 = PRF(P, S || Int(i))
-* U2 = PRF(P, U1)
-* Uc = PRF(P, Uc-1)
-*/
-
-static void F(char *password, unsigned char *ssid, int ssidlength, int iterations, int count, unsigned char *output)
-{
- unsigned char digest[36], digest1[SHA1_DIGEST_SIZE];
- int i, j;
-
- /* U1 = PRF(P, S || int(i)) */
- memcpy(digest, ssid, ssidlength);
- digest[ssidlength] = (unsigned char)((count>>24) & 0xff);
- digest[ssidlength+1] = (unsigned char)((count>>16) & 0xff);
- digest[ssidlength+2] = (unsigned char)((count>>8) & 0xff);
- digest[ssidlength+3] = (unsigned char)(count & 0xff);
- HMAC_SHA1((unsigned char*) password, (int) strlen(password), digest, ssidlength+4, digest1, SHA1_DIGEST_SIZE); // for WPA update
-
- /* output = U1 */
- memcpy(output, digest1, SHA1_DIGEST_SIZE);
-
- for (i = 1; i < iterations; i++)
- {
- /* Un = PRF(P, Un-1) */
- HMAC_SHA1((unsigned char*) password, (int) strlen(password), digest1, SHA1_DIGEST_SIZE, digest, SHA1_DIGEST_SIZE); // for WPA update
- memcpy(digest1, digest, SHA1_DIGEST_SIZE);
-
- /* output = output xor Un */
- for (j = 0; j < SHA1_DIGEST_SIZE; j++)
- {
- output[j] ^= digest[j];
- }
- }
-}
-
-/*
-* password - ascii string up to 63 characters in length
-* ssid - octet string up to 32 octets
-* ssidlength - length of ssid in octets
-* output must be 40 octets in length and outputs 256 bits of key
-*/
-int PasswordHash(PSTRING password, PUCHAR ssid, INT ssidlength, PUCHAR output)
-{
- if ((strlen(password) > 63) || (ssidlength > 32))
- return 0;
-
- F(password, ssid, ssidlength, 4096, 1, output);
- F(password, ssid, ssidlength, 4096, 2, &output[SHA1_DIGEST_SIZE]);
- return 1;
-}
-
-
-
-/*
- ========================================================================
-
- Routine Description:
- It utilizes PRF-384 or PRF-512 to derive session-specific keys from a PMK.
- It shall be called by 4-way handshake processing.
-
- Arguments:
- pAd - pointer to our pAdapter context
- PMK - pointer to PMK
- ANonce - pointer to ANonce
- AA - pointer to Authenticator Address
- SNonce - pointer to SNonce
- SA - pointer to Supplicant Address
- len - indicate the length of PTK (octet)
-
- Return Value:
- Output pointer to the PTK
-
- Note:
- Refer to IEEE 802.11i-2004 8.5.1.2
-
- ========================================================================
-*/
-VOID WpaDerivePTK(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR *PMK,
- IN UCHAR *ANonce,
- IN UCHAR *AA,
- IN UCHAR *SNonce,
- IN UCHAR *SA,
- OUT UCHAR *output,
- IN UINT len)
-{
- UCHAR concatenation[76];
- UINT CurrPos = 0;
- UCHAR temp[32];
- UCHAR Prefix[] = {'P', 'a', 'i', 'r', 'w', 'i', 's', 'e', ' ', 'k', 'e', 'y', ' ',
- 'e', 'x', 'p', 'a', 'n', 's', 'i', 'o', 'n'};
-
- // initiate the concatenation input
- NdisZeroMemory(temp, sizeof(temp));
- NdisZeroMemory(concatenation, 76);
-
- // Get smaller address
- if (RTMPCompareMemory(SA, AA, 6) == 1)
- NdisMoveMemory(concatenation, AA, 6);
- else
- NdisMoveMemory(concatenation, SA, 6);
- CurrPos += 6;
-
- // Get larger address
- if (RTMPCompareMemory(SA, AA, 6) == 1)
- NdisMoveMemory(&concatenation[CurrPos], SA, 6);
- else
- NdisMoveMemory(&concatenation[CurrPos], AA, 6);
-
- // store the larger mac address for backward compatible of
- // ralink proprietary STA-key issue
- NdisMoveMemory(temp, &concatenation[CurrPos], MAC_ADDR_LEN);
- CurrPos += 6;
-
- // Get smaller Nonce
- if (RTMPCompareMemory(ANonce, SNonce, 32) == 0)
- NdisMoveMemory(&concatenation[CurrPos], temp, 32); // patch for ralink proprietary STA-key issue
- else if (RTMPCompareMemory(ANonce, SNonce, 32) == 1)
- NdisMoveMemory(&concatenation[CurrPos], SNonce, 32);
- else
- NdisMoveMemory(&concatenation[CurrPos], ANonce, 32);
- CurrPos += 32;
-
- // Get larger Nonce
- if (RTMPCompareMemory(ANonce, SNonce, 32) == 0)
- NdisMoveMemory(&concatenation[CurrPos], temp, 32); // patch for ralink proprietary STA-key issue
- else if (RTMPCompareMemory(ANonce, SNonce, 32) == 1)
- NdisMoveMemory(&concatenation[CurrPos], ANonce, 32);
- else
- NdisMoveMemory(&concatenation[CurrPos], SNonce, 32);
- CurrPos += 32;
-
- hex_dump("concatenation=", concatenation, 76);
-
- // Use PRF to generate PTK
- PRF(PMK, LEN_MASTER_KEY, Prefix, 22, concatenation, 76, output, len);
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Generate random number by software.
-
- Arguments:
- pAd - pointer to our pAdapter context
- macAddr - pointer to local MAC address
-
- Return Value:
-
- Note:
- 802.1ii-2004 Annex H.5
-
- ========================================================================
-*/
-VOID GenRandom(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR *macAddr,
- OUT UCHAR *random)
-{
- INT i, curr;
- UCHAR local[80], KeyCounter[32];
- UCHAR result[80];
- ULONG CurrentTime;
- UCHAR prefix[] = {'I', 'n', 'i', 't', ' ', 'C', 'o', 'u', 'n', 't', 'e', 'r'};
-
- // Zero the related information
- NdisZeroMemory(result, 80);
- NdisZeroMemory(local, 80);
- NdisZeroMemory(KeyCounter, 32);
-
- for (i = 0; i < 32; i++)
- {
- // copy the local MAC address
- COPY_MAC_ADDR(local, macAddr);
- curr = MAC_ADDR_LEN;
-
- // concatenate the current time
- NdisGetSystemUpTime(&CurrentTime);
- NdisMoveMemory(&local[curr], &CurrentTime, sizeof(CurrentTime));
- curr += sizeof(CurrentTime);
-
- // concatenate the last result
- NdisMoveMemory(&local[curr], result, 32);
- curr += 32;
-
- // concatenate a variable
- NdisMoveMemory(&local[curr], &i, 2);
- curr += 2;
-
- // calculate the result
- PRF(KeyCounter, 32, prefix,12, local, curr, result, 32);
- }
-
- NdisMoveMemory(random, result, 32);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Build cipher suite in RSN-IE.
- It only shall be called by RTMPMakeRSNIE.
-
- Arguments:
- pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
- WepStatus - indicate the encryption type
- bMixCipher - a boolean to indicate the pairwise cipher and group
- cipher are the same or not
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-static VOID RTMPMakeRsnIeCipher(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR ElementID,
- IN UINT WepStatus,
- IN BOOLEAN bMixCipher,
- IN UCHAR FlexibleCipher,
- OUT PUCHAR pRsnIe,
- OUT UCHAR *rsn_len)
-{
- UCHAR PairwiseCnt;
-
- *rsn_len = 0;
-
- // decide WPA2 or WPA1
- if (ElementID == Wpa2Ie)
- {
- RSNIE2 *pRsnie_cipher = (RSNIE2*)pRsnIe;
-
- // Assign the verson as 1
- pRsnie_cipher->version = 1;
-
- switch (WepStatus)
- {
- // TKIP mode
- case Ndis802_11Encryption2Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_TKIP, 4);
- pRsnie_cipher->ucount = 1;
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_TKIP, 4);
- *rsn_len = sizeof(RSNIE2);
- break;
-
- // AES mode
- case Ndis802_11Encryption3Enabled:
- if (bMixCipher)
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_TKIP, 4);
- else
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_CCMP, 4);
- pRsnie_cipher->ucount = 1;
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_CCMP, 4);
- *rsn_len = sizeof(RSNIE2);
- break;
-
- // TKIP-AES mix mode
- case Ndis802_11Encryption4Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_TKIP, 4);
-
- PairwiseCnt = 1;
- // Insert WPA2 TKIP as the first pairwise cipher
- if (MIX_CIPHER_WPA2_TKIP_ON(FlexibleCipher))
- {
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_TKIP, 4);
- // Insert WPA2 AES as the secondary pairwise cipher
- if (MIX_CIPHER_WPA2_AES_ON(FlexibleCipher))
- {
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA2_CCMP, 4);
- PairwiseCnt = 2;
- }
- }
- else
- {
- // Insert WPA2 AES as the first pairwise cipher
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA2_CCMP, 4);
- }
-
- pRsnie_cipher->ucount = PairwiseCnt;
- *rsn_len = sizeof(RSNIE2) + (4 * (PairwiseCnt - 1));
- break;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- if ((pAd->OpMode == OPMODE_STA) &&
- (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
- {
- UINT GroupCipher = pAd->StaCfg.GroupCipher;
- switch(GroupCipher)
- {
- case Ndis802_11GroupWEP40Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_WEP40, 4);
- break;
- case Ndis802_11GroupWEP104Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA2_WEP104, 4);
- break;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // swap for big-endian platform
- pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
- pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
- }
- else
- {
- RSNIE *pRsnie_cipher = (RSNIE*)pRsnIe;
-
- // Assign OUI and version
- NdisMoveMemory(pRsnie_cipher->oui, OUI_WPA_VERSION, 4);
- pRsnie_cipher->version = 1;
-
- switch (WepStatus)
- {
- // TKIP mode
- case Ndis802_11Encryption2Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_TKIP, 4);
- pRsnie_cipher->ucount = 1;
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_TKIP, 4);
- *rsn_len = sizeof(RSNIE);
- break;
-
- // AES mode
- case Ndis802_11Encryption3Enabled:
- if (bMixCipher)
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_TKIP, 4);
- else
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_CCMP, 4);
- pRsnie_cipher->ucount = 1;
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_CCMP, 4);
- *rsn_len = sizeof(RSNIE);
- break;
-
- // TKIP-AES mix mode
- case Ndis802_11Encryption4Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_TKIP, 4);
-
- PairwiseCnt = 1;
- // Insert WPA TKIP as the first pairwise cipher
- if (MIX_CIPHER_WPA_TKIP_ON(FlexibleCipher))
- {
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_TKIP, 4);
- // Insert WPA AES as the secondary pairwise cipher
- if (MIX_CIPHER_WPA_AES_ON(FlexibleCipher))
- {
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui + 4, OUI_WPA_CCMP, 4);
- PairwiseCnt = 2;
- }
- }
- else
- {
- // Insert WPA AES as the first pairwise cipher
- NdisMoveMemory(pRsnie_cipher->ucast[0].oui, OUI_WPA_CCMP, 4);
- }
-
- pRsnie_cipher->ucount = PairwiseCnt;
- *rsn_len = sizeof(RSNIE) + (4 * (PairwiseCnt - 1));
- break;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- if ((pAd->OpMode == OPMODE_STA) &&
- (pAd->StaCfg.GroupCipher != Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.GroupCipher != Ndis802_11Encryption3Enabled))
- {
- UINT GroupCipher = pAd->StaCfg.GroupCipher;
- switch(GroupCipher)
- {
- case Ndis802_11GroupWEP40Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_WEP40, 4);
- break;
- case Ndis802_11GroupWEP104Enabled:
- NdisMoveMemory(pRsnie_cipher->mcast, OUI_WPA_WEP104, 4);
- break;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // swap for big-endian platform
- pRsnie_cipher->version = cpu2le16(pRsnie_cipher->version);
- pRsnie_cipher->ucount = cpu2le16(pRsnie_cipher->ucount);
- }
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Build AKM suite in RSN-IE.
- It only shall be called by RTMPMakeRSNIE.
-
- Arguments:
- pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
- AuthMode - indicate the authentication mode
- apidx - indicate the interface index
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-static VOID RTMPMakeRsnIeAKM(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR ElementID,
- IN UINT AuthMode,
- IN UCHAR apidx,
- OUT PUCHAR pRsnIe,
- OUT UCHAR *rsn_len)
-{
- RSNIE_AUTH *pRsnie_auth;
- UCHAR AkmCnt = 1; // default as 1
-
- pRsnie_auth = (RSNIE_AUTH*)(pRsnIe + (*rsn_len));
-
- // decide WPA2 or WPA1
- if (ElementID == Wpa2Ie)
- {
-
- switch (AuthMode)
- {
- case Ndis802_11AuthModeWPA2:
- case Ndis802_11AuthModeWPA1WPA2:
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_8021X_AKM, 4);
- break;
-
- case Ndis802_11AuthModeWPA2PSK:
- case Ndis802_11AuthModeWPA1PSKWPA2PSK:
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA2_PSK_AKM, 4);
- break;
- default:
- AkmCnt = 0;
- break;
-
- }
- }
- else
- {
- switch (AuthMode)
- {
- case Ndis802_11AuthModeWPA:
- case Ndis802_11AuthModeWPA1WPA2:
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_8021X_AKM, 4);
- break;
-
- case Ndis802_11AuthModeWPAPSK:
- case Ndis802_11AuthModeWPA1PSKWPA2PSK:
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_PSK_AKM, 4);
- break;
-
- case Ndis802_11AuthModeWPANone:
- NdisMoveMemory(pRsnie_auth->auth[0].oui, OUI_WPA_NONE_AKM, 4);
- break;
- default:
- AkmCnt = 0;
- break;
- }
- }
-
- pRsnie_auth->acount = AkmCnt;
- pRsnie_auth->acount = cpu2le16(pRsnie_auth->acount);
-
- // update current RSNIE length
- (*rsn_len) += (sizeof(RSNIE_AUTH) + (4 * (AkmCnt - 1)));
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Build capability in RSN-IE.
- It only shall be called by RTMPMakeRSNIE.
-
- Arguments:
- pAd - pointer to our pAdapter context
- ElementID - indicate the WPA1 or WPA2
- apidx - indicate the interface index
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-static VOID RTMPMakeRsnIeCap(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR ElementID,
- IN UCHAR apidx,
- OUT PUCHAR pRsnIe,
- OUT UCHAR *rsn_len)
-{
- RSN_CAPABILITIES *pRSN_Cap;
-
- // it could be ignored in WPA1 mode
- if (ElementID == WpaIe)
- return;
-
- pRSN_Cap = (RSN_CAPABILITIES*)(pRsnIe + (*rsn_len));
-
-
- pRSN_Cap->word = cpu2le16(pRSN_Cap->word);
-
- (*rsn_len) += sizeof(RSN_CAPABILITIES); // update current RSNIE length
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Build RSN IE context. It is not included element-ID and length.
-
- Arguments:
- pAd - pointer to our pAdapter context
- AuthMode - indicate the authentication mode
- WepStatus - indicate the encryption type
- apidx - indicate the interface index
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPMakeRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN UINT AuthMode,
- IN UINT WepStatus,
- IN UCHAR apidx)
-{
- PUCHAR pRsnIe = NULL; // primary RSNIE
- UCHAR *rsnielen_cur_p = 0; // the length of the primary RSNIE
- UCHAR *rsnielen_ex_cur_p = 0; // the length of the secondary RSNIE
- UCHAR PrimaryRsnie;
- BOOLEAN bMixCipher = FALSE; // indicate the pairwise and group cipher are different
- UCHAR p_offset;
- WPA_MIX_PAIR_CIPHER FlexibleCipher = WPA_TKIPAES_WPA2_TKIPAES; // it provide the more flexible cipher combination in WPA-WPA2 and TKIPAES mode
-
- rsnielen_cur_p = NULL;
- rsnielen_ex_cur_p = NULL;
-
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
- {
- if (AuthMode < Ndis802_11AuthModeWPA)
- return;
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- // Support WPAPSK or WPA2PSK in STA-Infra mode
- // Support WPANone in STA-Adhoc mode
- if ((AuthMode != Ndis802_11AuthModeWPAPSK) &&
- (AuthMode != Ndis802_11AuthModeWPA2PSK) &&
- (AuthMode != Ndis802_11AuthModeWPANone)
- )
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("==> RTMPMakeRSNIE(STA)\n"));
-
- // Zero RSNIE context
- pAd->StaCfg.RSNIE_Len = 0;
- NdisZeroMemory(pAd->StaCfg.RSN_IE, MAX_LEN_OF_RSNIE);
-
- // Pointer to RSNIE
- rsnielen_cur_p = &pAd->StaCfg.RSNIE_Len;
- pRsnIe = pAd->StaCfg.RSN_IE;
-
- bMixCipher = pAd->StaCfg.bMixCipher;
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- // indicate primary RSNIE as WPA or WPA2
- if ((AuthMode == Ndis802_11AuthModeWPA) ||
- (AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (AuthMode == Ndis802_11AuthModeWPANone) ||
- (AuthMode == Ndis802_11AuthModeWPA1WPA2) ||
- (AuthMode == Ndis802_11AuthModeWPA1PSKWPA2PSK))
- PrimaryRsnie = WpaIe;
- else
- PrimaryRsnie = Wpa2Ie;
-
- {
- // Build the primary RSNIE
- // 1. insert cipher suite
- RTMPMakeRsnIeCipher(pAd, PrimaryRsnie, WepStatus, bMixCipher, FlexibleCipher, pRsnIe, &p_offset);
-
- // 2. insert AKM
- RTMPMakeRsnIeAKM(pAd, PrimaryRsnie, AuthMode, apidx, pRsnIe, &p_offset);
-
- // 3. insert capability
- RTMPMakeRsnIeCap(pAd, PrimaryRsnie, apidx, pRsnIe, &p_offset);
- }
-
- // 4. update the RSNIE length
- *rsnielen_cur_p = p_offset;
-
- hex_dump("The primary RSNIE", pRsnIe, (*rsnielen_cur_p));
-
-
-}
-
-/*
- ==========================================================================
- Description:
- Check whether the received frame is EAP frame.
-
- Arguments:
- pAd - pointer to our pAdapter context
- pEntry - pointer to active entry
- pData - the received frame
- DataByteCount - the received frame's length
- FromWhichBSSID - indicate the interface index
-
- Return:
- TRUE - This frame is EAP frame
- FALSE - otherwise
- ==========================================================================
-*/
-BOOLEAN RTMPCheckWPAframe(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pData,
- IN ULONG DataByteCount,
- IN UCHAR FromWhichBSSID)
-{
- ULONG Body_len;
- BOOLEAN Cancelled;
-
-
- if(DataByteCount < (LENGTH_802_1_H + LENGTH_EAPOL_H))
- return FALSE;
-
-
- // Skip LLC header
- if (NdisEqualMemory(SNAP_802_1H, pData, 6) ||
- // Cisco 1200 AP may send packet with SNAP_BRIDGE_TUNNEL
- NdisEqualMemory(SNAP_BRIDGE_TUNNEL, pData, 6))
- {
- pData += 6;
- }
- // Skip 2-bytes EAPoL type
- if (NdisEqualMemory(EAPOL, pData, 2))
-// if (*(UINT16 *)EAPOL == *(UINT16 *)pData)
- {
- pData += 2;
- }
- else
- return FALSE;
-
- switch (*(pData+1))
- {
- case EAPPacket:
- Body_len = (*(pData+2)<<8) | (*(pData+3));
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAP-Packet frame, TYPE = 0, Length = %ld\n", Body_len));
- break;
- case EAPOLStart:
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL-Start frame, TYPE = 1 \n"));
- if (pEntry->EnqueueEapolStartTimerRunning != EAPOL_START_DISABLE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Cancel the EnqueueEapolStartTimerRunning \n"));
- RTMPCancelTimer(&pEntry->EnqueueStartForPSKTimer, &Cancelled);
- pEntry->EnqueueEapolStartTimerRunning = EAPOL_START_DISABLE;
- }
- break;
- case EAPOLLogoff:
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOLLogoff frame, TYPE = 2 \n"));
- break;
- case EAPOLKey:
- Body_len = (*(pData+2)<<8) | (*(pData+3));
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOL-Key frame, TYPE = 3, Length = %ld\n", Body_len));
- break;
- case EAPOLASFAlert:
- DBGPRINT(RT_DEBUG_TRACE, ("Receive EAPOLASFAlert frame, TYPE = 4 \n"));
- break;
- default:
- return FALSE;
-
- }
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Report the EAP message type
-
- Arguments:
- msg - EAPOL_PAIR_MSG_1
- EAPOL_PAIR_MSG_2
- EAPOL_PAIR_MSG_3
- EAPOL_PAIR_MSG_4
- EAPOL_GROUP_MSG_1
- EAPOL_GROUP_MSG_2
-
- Return:
- message type string
-
- ==========================================================================
-*/
-PSTRING GetEapolMsgType(CHAR msg)
-{
- if(msg == EAPOL_PAIR_MSG_1)
- return "Pairwise Message 1";
- else if(msg == EAPOL_PAIR_MSG_2)
- return "Pairwise Message 2";
- else if(msg == EAPOL_PAIR_MSG_3)
- return "Pairwise Message 3";
- else if(msg == EAPOL_PAIR_MSG_4)
- return "Pairwise Message 4";
- else if(msg == EAPOL_GROUP_MSG_1)
- return "Group Message 1";
- else if(msg == EAPOL_GROUP_MSG_2)
- return "Group Message 2";
- else
- return "Invalid Message";
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Check Sanity RSN IE of EAPoL message
-
- Arguments:
-
- Return Value:
-
-
- ========================================================================
-*/
-BOOLEAN RTMPCheckRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN UCHAR DataLen,
- IN MAC_TABLE_ENTRY *pEntry,
- OUT UCHAR *Offset)
-{
- PUCHAR pVIE;
- UCHAR len;
- PEID_STRUCT pEid;
- BOOLEAN result = FALSE;
-
- pVIE = pData;
- len = DataLen;
- *Offset = 0;
-
- while (len > sizeof(RSNIE2))
- {
- pEid = (PEID_STRUCT) pVIE;
- // WPA RSN IE
- if ((pEid->Eid == IE_WPA) && (NdisEqualMemory(pEid->Octet, WPA_OUI, 4)))
- {
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA || pEntry->AuthMode == Ndis802_11AuthModeWPAPSK) &&
- (NdisEqualMemory(pVIE, pEntry->RSN_IE, pEntry->RSNIE_Len)) &&
- (pEntry->RSNIE_Len == (pEid->Len + 2)))
- {
- result = TRUE;
- }
-
- *Offset += (pEid->Len + 2);
- }
- // WPA2 RSN IE
- else if ((pEid->Eid == IE_RSN) && (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3)))
- {
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2 || pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK) &&
- (pEid->Eid == pEntry->RSN_IE[0]) &&
- ((pEid->Len + 2) >= pEntry->RSNIE_Len) &&
- (NdisEqualMemory(pEid->Octet, &pEntry->RSN_IE[2], pEntry->RSNIE_Len - 2)))
- {
-
- result = TRUE;
- }
-
- *Offset += (pEid->Len + 2);
- }
- else
- {
- break;
- }
-
- pVIE += (pEid->Len + 2);
- len -= (pEid->Len + 2);
- }
-
-
- return result;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Parse KEYDATA field. KEYDATA[] May contain 2 RSN IE and optionally GTK.
- GTK is encaptulated in KDE format at p.83 802.11i D10
-
- Arguments:
-
- Return Value:
-
- Note:
- 802.11i D10
-
- ========================================================================
-*/
-BOOLEAN RTMPParseEapolKeyData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKeyData,
- IN UCHAR KeyDataLen,
- IN UCHAR GroupKeyIndex,
- IN UCHAR MsgType,
- IN BOOLEAN bWPA2,
- IN MAC_TABLE_ENTRY *pEntry)
-{
- PKDE_ENCAP pKDE = NULL;
- PUCHAR pMyKeyData = pKeyData;
- UCHAR KeyDataLength = KeyDataLen;
- UCHAR GTKLEN = 0;
- UCHAR DefaultIdx = 0;
- UCHAR skip_offset;
-
- // Verify The RSN IE contained in pairewise_msg_2 && pairewise_msg_3 and skip it
- if (MsgType == EAPOL_PAIR_MSG_2 || MsgType == EAPOL_PAIR_MSG_3)
- {
- // Check RSN IE whether it is WPA2/WPA2PSK
- if (!RTMPCheckRSNIE(pAd, pKeyData, KeyDataLen, pEntry, &skip_offset))
- {
- // send wireless event - for RSN IE different
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_RSNIE_DIFF_EVENT_FLAG, pEntry->Addr, pEntry->apidx, 0);
-
- DBGPRINT(RT_DEBUG_ERROR, ("RSN_IE Different in msg %d of 4-way handshake!\n", MsgType));
- hex_dump("Receive RSN_IE ", pKeyData, KeyDataLen);
- hex_dump("Desired RSN_IE ", pEntry->RSN_IE, pEntry->RSNIE_Len);
-
- return FALSE;
- }
- else
- {
- if (bWPA2 && MsgType == EAPOL_PAIR_MSG_3)
- {
- WpaShowAllsuite(pMyKeyData, skip_offset);
-
- // skip RSN IE
- pMyKeyData += skip_offset;
- KeyDataLength -= skip_offset;
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPParseEapolKeyData ==> WPA2/WPA2PSK RSN IE matched in Msg 3, Length(%d) \n", skip_offset));
- }
- else
- return TRUE;
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("RTMPParseEapolKeyData ==> KeyDataLength %d without RSN_IE \n", KeyDataLength));
- //hex_dump("remain data", pMyKeyData, KeyDataLength);
-
-
- // Parse EKD format in pairwise_msg_3_WPA2 && group_msg_1_WPA2
- if (bWPA2 && (MsgType == EAPOL_PAIR_MSG_3 || MsgType == EAPOL_GROUP_MSG_1))
- {
- if (KeyDataLength >= 8) // KDE format exclude GTK length
- {
- pKDE = (PKDE_ENCAP) pMyKeyData;
-
-
- DefaultIdx = pKDE->GTKEncap.Kid;
-
- // Sanity check - KED length
- if (KeyDataLength < (pKDE->Len + 2))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: The len from KDE is too short \n"));
- return FALSE;
- }
-
- // Get GTK length - refer to IEEE 802.11i-2004 p.82
- GTKLEN = pKDE->Len -6;
- if (GTKLEN < LEN_AES_KEY)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key length is too short (%d) \n", GTKLEN));
- return FALSE;
- }
-
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: KDE format length is too short \n"));
- return FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("GTK in KDE format ,DefaultKeyID=%d, KeyLen=%d \n", DefaultIdx, GTKLEN));
- // skip it
- pMyKeyData += 8;
- KeyDataLength -= 8;
-
- }
- else if (!bWPA2 && MsgType == EAPOL_GROUP_MSG_1)
- {
- DefaultIdx = GroupKeyIndex;
- DBGPRINT(RT_DEBUG_TRACE, ("GTK DefaultKeyID=%d \n", DefaultIdx));
- }
-
- // Sanity check - shared key index must be 1 ~ 3
- if (DefaultIdx < 1 || DefaultIdx > 3)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR: GTK Key index(%d) is invalid in %s %s \n", DefaultIdx, ((bWPA2) ? "WPA2" : "WPA"), GetEapolMsgType(MsgType)));
- return FALSE;
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- PCIPHER_KEY pSharedKey;
-
- // set key material, TxMic and RxMic
- NdisMoveMemory(pAd->StaCfg.GTK, pMyKeyData, 32);
- pAd->StaCfg.DefaultKeyId = DefaultIdx;
-
- pSharedKey = &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId];
-
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
- pSharedKey->KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pSharedKey->Key, pAd->StaCfg.GTK, LEN_TKIP_EK);
- NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.GTK[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.GTK[24], LEN_TKIP_TXMICK);
-
- // Update Shared Key CipherAlg
- pSharedKey->CipherAlg = CIPHER_NONE;
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- pSharedKey->CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
- pSharedKey->CipherAlg = CIPHER_AES;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
- pSharedKey->CipherAlg = CIPHER_WEP64;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
- pSharedKey->CipherAlg = CIPHER_WEP128;
-
-
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pSharedKey->CipherAlg,
- pSharedKey->Key,
- pSharedKey->TxMic,
- pSharedKey->RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pSharedKey->CipherAlg,
- NULL);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- return TRUE;
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Construct EAPoL message for WPA handshaking
- Its format is below,
-
- +--------------------+
- | Protocol Version | 1 octet
- +--------------------+
- | Protocol Type | 1 octet
- +--------------------+
- | Body Length | 2 octets
- +--------------------+
- | Descriptor Type | 1 octet
- +--------------------+
- | Key Information | 2 octets
- +--------------------+
- | Key Length | 1 octet
- +--------------------+
- | Key Repaly Counter | 8 octets
- +--------------------+
- | Key Nonce | 32 octets
- +--------------------+
- | Key IV | 16 octets
- +--------------------+
- | Key RSC | 8 octets
- +--------------------+
- | Key ID or Reserved | 8 octets
- +--------------------+
- | Key MIC | 16 octets
- +--------------------+
- | Key Data Length | 2 octets
- +--------------------+
- | Key Data | n octets
- +--------------------+
-
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID ConstructEapolMsg(
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR GroupKeyWepStatus,
- IN UCHAR MsgType,
- IN UCHAR DefaultKeyIdx,
- IN UCHAR *KeyNonce,
- IN UCHAR *TxRSC,
- IN UCHAR *GTK,
- IN UCHAR *RSNIE,
- IN UCHAR RSNIE_Len,
- OUT PEAPOL_PACKET pMsg)
-{
- BOOLEAN bWPA2 = FALSE;
- UCHAR KeyDescVer;
-
- // Choose WPA2 or not
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) ||
- (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
- bWPA2 = TRUE;
-
- // Init Packet and Fill header
- pMsg->ProVer = EAPOL_VER;
- pMsg->ProType = EAPOLKey;
-
- // Default 95 bytes, the EAPoL-Key descriptor exclude Key-data field
- SET_UINT16_TO_ARRARY(pMsg->Body_Len, LEN_EAPOL_KEY_MSG);
-
- // Fill in EAPoL descriptor
- if (bWPA2)
- pMsg->KeyDesc.Type = WPA2_KEY_DESC;
- else
- pMsg->KeyDesc.Type = WPA1_KEY_DESC;
-
- // Key Descriptor Version (bits 0-2) specifies the key descriptor version type
- {
- // Fill in Key information, refer to IEEE Std 802.11i-2004 page 78
- // When either the pairwise or the group cipher is AES, the DESC_TYPE_AES(2) shall be used.
- KeyDescVer = (((pEntry->WepStatus == Ndis802_11Encryption3Enabled) ||
- (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)) ? (DESC_TYPE_AES) : (DESC_TYPE_TKIP));
- }
-
- pMsg->KeyDesc.KeyInfo.KeyDescVer = KeyDescVer;
-
- // Specify Key Type as Group(0) or Pairwise(1)
- if (MsgType >= EAPOL_GROUP_MSG_1)
- pMsg->KeyDesc.KeyInfo.KeyType = GROUPKEY;
- else
- pMsg->KeyDesc.KeyInfo.KeyType = PAIRWISEKEY;
-
- // Specify Key Index, only group_msg1_WPA1
- if (!bWPA2 && (MsgType >= EAPOL_GROUP_MSG_1))
- pMsg->KeyDesc.KeyInfo.KeyIndex = DefaultKeyIdx;
-
- if (MsgType == EAPOL_PAIR_MSG_3)
- pMsg->KeyDesc.KeyInfo.Install = 1;
-
- if ((MsgType == EAPOL_PAIR_MSG_1) || (MsgType == EAPOL_PAIR_MSG_3) || (MsgType == EAPOL_GROUP_MSG_1))
- pMsg->KeyDesc.KeyInfo.KeyAck = 1;
-
- if (MsgType != EAPOL_PAIR_MSG_1)
- pMsg->KeyDesc.KeyInfo.KeyMic = 1;
-
- if ((bWPA2 && (MsgType >= EAPOL_PAIR_MSG_3)) ||
- (!bWPA2 && (MsgType >= EAPOL_GROUP_MSG_1)))
- {
- pMsg->KeyDesc.KeyInfo.Secure = 1;
- }
-
- if (bWPA2 && ((MsgType == EAPOL_PAIR_MSG_3) ||
- (MsgType == EAPOL_GROUP_MSG_1)))
- {
- pMsg->KeyDesc.KeyInfo.EKD_DL = 1;
- }
-
- // key Information element has done.
- *(USHORT *)(&pMsg->KeyDesc.KeyInfo) = cpu2le16(*(USHORT *)(&pMsg->KeyDesc.KeyInfo));
-
- // Fill in Key Length
- {
- if (MsgType >= EAPOL_GROUP_MSG_1)
- {
- // the length of group key cipher
- pMsg->KeyDesc.KeyLength[1] = ((GroupKeyWepStatus == Ndis802_11Encryption2Enabled) ? TKIP_GTK_LENGTH : LEN_AES_KEY);
- }
- else
- {
- // the length of pairwise key cipher
- pMsg->KeyDesc.KeyLength[1] = ((pEntry->WepStatus == Ndis802_11Encryption2Enabled) ? LEN_TKIP_KEY : LEN_AES_KEY);
- }
- }
-
- // Fill in replay counter
- NdisMoveMemory(pMsg->KeyDesc.ReplayCounter, pEntry->R_Counter, LEN_KEY_DESC_REPLAY);
-
- // Fill Key Nonce field
- // ANonce : pairwise_msg1 & pairwise_msg3
- // SNonce : pairwise_msg2
- // GNonce : group_msg1_wpa1
- if ((MsgType <= EAPOL_PAIR_MSG_3) || ((!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))))
- NdisMoveMemory(pMsg->KeyDesc.KeyNonce, KeyNonce, LEN_KEY_DESC_NONCE);
-
- // Fill key IV - WPA2 as 0, WPA1 as random
- if (!bWPA2 && (MsgType == EAPOL_GROUP_MSG_1))
- {
- // Suggest IV be random number plus some number,
- NdisMoveMemory(pMsg->KeyDesc.KeyIv, &KeyNonce[16], LEN_KEY_DESC_IV);
- pMsg->KeyDesc.KeyIv[15] += 2;
- }
-
- // Fill Key RSC field
- // It contains the RSC for the GTK being installed.
- if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2) || (MsgType == EAPOL_GROUP_MSG_1))
- {
- NdisMoveMemory(pMsg->KeyDesc.KeyRsc, TxRSC, 6);
- }
-
- // Clear Key MIC field for MIC calculation later
- NdisZeroMemory(pMsg->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
-
- ConstructEapolKeyData(pEntry,
- GroupKeyWepStatus,
- KeyDescVer,
- MsgType,
- DefaultKeyIdx,
- GTK,
- RSNIE,
- RSNIE_Len,
- pMsg);
-
- // Calculate MIC and fill in KeyMic Field except Pairwise Msg 1.
- if (MsgType != EAPOL_PAIR_MSG_1)
- {
- CalculateMIC(KeyDescVer, pEntry->PTK, pMsg);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> ConstructEapolMsg for %s %s\n", ((bWPA2) ? "WPA2" : "WPA"), GetEapolMsgType(MsgType)));
- DBGPRINT(RT_DEBUG_TRACE, (" Body length = %d \n", CONV_ARRARY_TO_UINT16(pMsg->Body_Len)));
- DBGPRINT(RT_DEBUG_TRACE, (" Key length = %d \n", CONV_ARRARY_TO_UINT16(pMsg->KeyDesc.KeyLength)));
-
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Construct the Key Data field of EAPoL message
-
- Arguments:
- pAd Pointer to our adapter
- Elem Message body
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID ConstructEapolKeyData(
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR GroupKeyWepStatus,
- IN UCHAR keyDescVer,
- IN UCHAR MsgType,
- IN UCHAR DefaultKeyIdx,
- IN UCHAR *GTK,
- IN UCHAR *RSNIE,
- IN UCHAR RSNIE_LEN,
- OUT PEAPOL_PACKET pMsg)
-{
- UCHAR *mpool, *Key_Data, *Rc4GTK;
- UCHAR ekey[(LEN_KEY_DESC_IV+LEN_EAP_EK)];
- ULONG data_offset;
- BOOLEAN bWPA2Capable = FALSE;
- PRTMP_ADAPTER pAd = pEntry->pAd;
- BOOLEAN GTK_Included = FALSE;
-
- // Choose WPA2 or not
- if ((pEntry->AuthMode == Ndis802_11AuthModeWPA2) ||
- (pEntry->AuthMode == Ndis802_11AuthModeWPA2PSK))
- bWPA2Capable = TRUE;
-
- if (MsgType == EAPOL_PAIR_MSG_1 ||
- MsgType == EAPOL_PAIR_MSG_4 ||
- MsgType == EAPOL_GROUP_MSG_2)
- return;
-
- // allocate memory pool
- os_alloc_mem(NULL, (PUCHAR *)&mpool, 1500);
-
- if (mpool == NULL)
- return;
-
- /* Rc4GTK Len = 512 */
- Rc4GTK = (UCHAR *) ROUND_UP(mpool, 4);
- /* Key_Data Len = 512 */
- Key_Data = (UCHAR *) ROUND_UP(Rc4GTK + 512, 4);
-
- NdisZeroMemory(Key_Data, 512);
- SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, 0);
- data_offset = 0;
-
- // Encapsulate RSNIE in pairwise_msg2 & pairwise_msg3
- if (RSNIE_LEN && ((MsgType == EAPOL_PAIR_MSG_2) || (MsgType == EAPOL_PAIR_MSG_3)))
- {
- PUINT8 pmkid_ptr = NULL;
- UINT8 pmkid_len = 0;
-
-
- RTMPInsertRSNIE(&Key_Data[data_offset],
- (PULONG)&data_offset,
- RSNIE,
- RSNIE_LEN,
- pmkid_ptr,
- pmkid_len);
- }
-
-
- // Encapsulate KDE format in pairwise_msg3_WPA2 & group_msg1_WPA2
- if (bWPA2Capable && ((MsgType == EAPOL_PAIR_MSG_3) || (MsgType == EAPOL_GROUP_MSG_1)))
- {
- // Key Data Encapsulation (KDE) format - 802.11i-2004 Figure-43w and Table-20h
- Key_Data[data_offset + 0] = 0xDD;
-
- if (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)
- {
- Key_Data[data_offset + 1] = 0x16;// 4+2+16(OUI+DataType+DataField)
- }
- else
- {
- Key_Data[data_offset + 1] = 0x26;// 4+2+32(OUI+DataType+DataField)
- }
-
- Key_Data[data_offset + 2] = 0x00;
- Key_Data[data_offset + 3] = 0x0F;
- Key_Data[data_offset + 4] = 0xAC;
- Key_Data[data_offset + 5] = 0x01;
-
- // GTK KDE format - 802.11i-2004 Figure-43x
- Key_Data[data_offset + 6] = (DefaultKeyIdx & 0x03);
- Key_Data[data_offset + 7] = 0x00; // Reserved Byte
-
- data_offset += 8;
- }
-
-
- // Encapsulate GTK
- // Only for pairwise_msg3_WPA2 and group_msg1
- if ((MsgType == EAPOL_PAIR_MSG_3 && bWPA2Capable) || (MsgType == EAPOL_GROUP_MSG_1))
- {
- // Fill in GTK
- if (GroupKeyWepStatus == Ndis802_11Encryption3Enabled)
- {
- NdisMoveMemory(&Key_Data[data_offset], GTK, LEN_AES_KEY);
- data_offset += LEN_AES_KEY;
- }
- else
- {
- NdisMoveMemory(&Key_Data[data_offset], GTK, TKIP_GTK_LENGTH);
- data_offset += TKIP_GTK_LENGTH;
- }
-
- GTK_Included = TRUE;
- }
-
-
- // This whole key-data field shall be encrypted if a GTK is included.
- // Encrypt the data material in key data field with KEK
- if (GTK_Included)
- {
- //hex_dump("GTK_Included", Key_Data, data_offset);
-
- if (
- (keyDescVer == DESC_TYPE_AES))
- {
- UCHAR remainder = 0;
- UCHAR pad_len = 0;
-
- // Key Descriptor Version 2 or 3: AES key wrap, defined in IETF RFC 3394,
- // shall be used to encrypt the Key Data field using the KEK field from
- // the derived PTK.
-
- // If the Key Data field uses the NIST AES key wrap, then the Key Data field
- // shall be padded before encrypting if the key data length is less than 16
- // octets or if it is not a multiple of 8. The padding consists of appending
- // a single octet 0xdd followed by zero or more 0x00 octets.
- if ((remainder = data_offset & 0x07) != 0)
- {
- INT i;
-
- pad_len = (8 - remainder);
- Key_Data[data_offset] = 0xDD;
- for (i = 1; i < pad_len; i++)
- Key_Data[data_offset + i] = 0;
-
- data_offset += pad_len;
- }
-
- AES_GTK_KEY_WRAP(&pEntry->PTK[16], Key_Data, data_offset, Rc4GTK);
- // AES wrap function will grow 8 bytes in length
- data_offset += 8;
- }
- else
- {
- /* Key Descriptor Version 1: ARC4 is used to encrypt the Key Data field
- using the KEK field from the derived PTK. */
-
- // PREPARE Encrypted "Key DATA" field. (Encrypt GTK with RC4, usinf PTK[16]->[31] as Key, IV-field as IV)
- // put TxTsc in Key RSC field
- pAd->PrivateInfo.FCSCRC32 = PPPINITFCS32; //Init crc32.
-
- // ekey is the contanetion of IV-field, and PTK[16]->PTK[31]
- NdisMoveMemory(ekey, pMsg->KeyDesc.KeyIv, LEN_KEY_DESC_IV);
- NdisMoveMemory(&ekey[LEN_KEY_DESC_IV], &pEntry->PTK[16], LEN_EAP_EK);
- ARCFOUR_INIT(&pAd->PrivateInfo.WEPCONTEXT, ekey, sizeof(ekey)); //INIT SBOX, KEYLEN+3(IV)
- pAd->PrivateInfo.FCSCRC32 = RTMP_CALC_FCS32(pAd->PrivateInfo.FCSCRC32, Key_Data, data_offset);
- WPAARCFOUR_ENCRYPT(&pAd->PrivateInfo.WEPCONTEXT, Rc4GTK, Key_Data, data_offset);
- }
-
- NdisMoveMemory(pMsg->KeyDesc.KeyData, Rc4GTK, data_offset);
- }
- else
- {
- NdisMoveMemory(pMsg->KeyDesc.KeyData, Key_Data, data_offset);
- }
-
- // Update key data length field and total body length
- SET_UINT16_TO_ARRARY(pMsg->KeyDesc.KeyDataLen, data_offset);
- INC_UINT16_TO_ARRARY(pMsg->Body_Len, data_offset);
-
- os_free_mem(NULL, mpool);
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Calcaulate MIC. It is used during 4-ways handsharking.
-
- Arguments:
- pAd - pointer to our pAdapter context
- PeerWepStatus - indicate the encryption type
-
- Return Value:
-
- Note:
-
- ========================================================================
-*/
-static VOID CalculateMIC(
- IN UCHAR KeyDescVer,
- IN UCHAR *PTK,
- OUT PEAPOL_PACKET pMsg)
-{
- UCHAR *OutBuffer;
- ULONG FrameLen = 0;
- UCHAR mic[LEN_KEY_DESC_MIC];
- UCHAR digest[80];
-
- // allocate memory for MIC calculation
- os_alloc_mem(NULL, (PUCHAR *)&OutBuffer, 512);
-
- if (OutBuffer == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("!!!CalculateMIC: no memory!!!\n"));
- return;
- }
-
- // make a frame for calculating MIC.
- MakeOutgoingFrame(OutBuffer, &FrameLen,
- CONV_ARRARY_TO_UINT16(pMsg->Body_Len) + 4, pMsg,
- END_OF_ARGS);
-
- NdisZeroMemory(mic, sizeof(mic));
-
- // Calculate MIC
- if (KeyDescVer == DESC_TYPE_AES)
- {
- HMAC_SHA1(PTK, LEN_EAP_MICK, OutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- HMAC_MD5(PTK, LEN_EAP_MICK, OutBuffer, FrameLen, mic, MD5_DIGEST_SIZE);
- }
-
- // store the calculated MIC
- NdisMoveMemory(pMsg->KeyDesc.KeyMic, mic, LEN_KEY_DESC_MIC);
-
- os_free_mem(NULL, OutBuffer);
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Some received frames can't decrypt by Asic, so decrypt them by software.
-
- Arguments:
- pAd - pointer to our pAdapter context
- PeerWepStatus - indicate the encryption type
-
- Return Value:
- NDIS_STATUS_SUCCESS - decryption successful
- NDIS_STATUS_FAILURE - decryption failure
-
- ========================================================================
-*/
-NDIS_STATUS RTMPSoftDecryptBroadCastData(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher,
- IN PCIPHER_KEY pShard_key)
-{
- PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
-
-
-
- // handle WEP decryption
- if (GroupCipher == Ndis802_11Encryption1Enabled)
- {
- if (RTMPSoftDecryptWEP(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount, pShard_key))
- {
-
- //Minus IV[4] & ICV[4]
- pRxWI->MPDUtotalByteCount -= 8;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR : Software decrypt WEP data fails.\n"));
- // give up this frame
- return NDIS_STATUS_FAILURE;
- }
- }
- // handle TKIP decryption
- else if (GroupCipher == Ndis802_11Encryption2Enabled)
- {
- if (RTMPSoftDecryptTKIP(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount, 0, pShard_key))
- {
-
- //Minus 8 bytes MIC, 8 bytes IV/EIV, 4 bytes ICV
- pRxWI->MPDUtotalByteCount -= 20;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR : RTMPSoftDecryptTKIP Failed\n"));
- // give up this frame
- return NDIS_STATUS_FAILURE;
- }
- }
- // handle AES decryption
- else if (GroupCipher == Ndis802_11Encryption3Enabled)
- {
- if (RTMPSoftDecryptAES(pAd, pRxBlk->pData, pRxWI->MPDUtotalByteCount , pShard_key))
- {
-
- //8 bytes MIC, 8 bytes IV/EIV (CCMP Header)
- pRxWI->MPDUtotalByteCount -= 16;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("ERROR : RTMPSoftDecryptAES Failed\n"));
- // give up this frame
- return NDIS_STATUS_FAILURE;
- }
- }
- else
- {
- // give up this frame
- return NDIS_STATUS_FAILURE;
- }
-
- return NDIS_STATUS_SUCCESS;
-
-}
-
-
-PUINT8 GetSuiteFromRSNIE(
- IN PUINT8 rsnie,
- IN UINT rsnie_len,
- IN UINT8 type,
- OUT UINT8 *count)
-{
- PEID_STRUCT pEid;
- INT len;
- PUINT8 pBuf;
- INT offset = 0;
- PRSNIE_AUTH pAkm;
- UINT16 acount;
- BOOLEAN isWPA2 = FALSE;
-
- pEid = (PEID_STRUCT)rsnie;
- len = rsnie_len - 2; // exclude IE and length
- pBuf = (PUINT8)&pEid->Octet[0];
-
-
-
- // set default value
- *count = 0;
-
- // Check length
- if ((len <= 0) || (pEid->Len != len))
- {
- DBGPRINT_ERR(("%s : The length is invalid\n", __FUNCTION__));
- return NULL;
- }
-
- // Check WPA or WPA2
- if (pEid->Eid == IE_WPA)
- {
- PRSNIE pRsnie = (PRSNIE)pBuf;
- UINT16 ucount;
-
- if (len < sizeof(RSNIE))
- {
- DBGPRINT_ERR(("%s : The length is too short for WPA\n", __FUNCTION__));
- return NULL;
- }
-
- // Get the count of pairwise cipher
- ucount = cpu2le16(pRsnie->ucount);
- if (ucount > 2)
- {
- DBGPRINT_ERR(("%s : The count(%d) of pairwise cipher is invlaid\n",
- __FUNCTION__, ucount));
- return NULL;
- }
-
- // Get the group cipher
- if (type == GROUP_SUITE)
- {
- *count = 1;
- return pRsnie->mcast;
- }
- // Get the pairwise cipher suite
- else if (type == PAIRWISE_SUITE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of pairwise cipher is %d\n",
- __FUNCTION__, ucount));
- *count = ucount;
- return pRsnie->ucast[0].oui;
- }
-
- offset = sizeof(RSNIE) + (4 * (ucount - 1));
-
- }
- else if (pEid->Eid == IE_RSN)
- {
- PRSNIE2 pRsnie = (PRSNIE2)pBuf;
- UINT16 ucount;
-
- isWPA2 = TRUE;
-
- if (len < sizeof(RSNIE2))
- {
- DBGPRINT_ERR(("%s : The length is too short for WPA2\n", __FUNCTION__));
- return NULL;
- }
-
- // Get the count of pairwise cipher
- ucount = cpu2le16(pRsnie->ucount);
- if (ucount > 2)
- {
- DBGPRINT_ERR(("%s : The count(%d) of pairwise cipher is invlaid\n",
- __FUNCTION__, ucount));
- return NULL;
- }
-
- // Get the group cipher
- if (type == GROUP_SUITE)
- {
- *count = 1;
- return pRsnie->mcast;
- }
- // Get the pairwise cipher suite
- else if (type == PAIRWISE_SUITE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of pairwise cipher is %d\n",
- __FUNCTION__, ucount));
- *count = ucount;
- return pRsnie->ucast[0].oui;
- }
-
- offset = sizeof(RSNIE2) + (4 * (ucount - 1));
-
- }
- else
- {
- DBGPRINT_ERR(("%s : Unknown IE (%d)\n", __FUNCTION__, pEid->Eid));
- return NULL;
- }
-
- // skip group cipher and pairwise cipher suite
- pBuf += offset;
- len -= offset;
-
- if (len < sizeof(RSNIE_AUTH))
- {
- DBGPRINT_ERR(("%s : The length of RSNIE is too short\n", __FUNCTION__));
- return NULL;
- }
-
- // pointer to AKM count
- pAkm = (PRSNIE_AUTH)pBuf;
-
- // Get the count of pairwise cipher
- acount = cpu2le16(pAkm->acount);
- if (acount > 2)
- {
- DBGPRINT_ERR(("%s : The count(%d) of AKM is invlaid\n",
- __FUNCTION__, acount));
- return NULL;
- }
-
- // Get the AKM suite
- if (type == AKM_SUITE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s : The count of AKM is %d\n",
- __FUNCTION__, acount));
- *count = acount;
- return pAkm->auth[0].oui;
- }
- offset = sizeof(RSNIE_AUTH) + (4 * (acount - 1));
-
- pBuf += offset;
- len -= offset;
-
- // The remaining length must larger than (RSN-Capability(2) + PMKID-Count(2) + PMKID(16~))
- if (len >= (sizeof(RSN_CAPABILITIES) + 2 + LEN_PMKID))
- {
- // Skip RSN capability and PMKID-Count
- pBuf += (sizeof(RSN_CAPABILITIES) + 2);
- len -= (sizeof(RSN_CAPABILITIES) + 2);
-
- // Get PMKID
- if (type == PMKID_LIST)
- {
- *count = 1;
- return pBuf;
- }
- }
- else
- {
- DBGPRINT_ERR(("%s : it can't get any more information beyond AKM \n", __FUNCTION__));
- return NULL;
- }
-
- *count = 0;
- //DBGPRINT_ERR(("%s : The type(%d) doesn't support \n", __FUNCTION__, type));
- return NULL;
-
-}
-
-VOID WpaShowAllsuite(
- IN PUINT8 rsnie,
- IN UINT rsnie_len)
-{
- PUINT8 pSuite = NULL;
- UINT8 count;
-
- hex_dump("RSNIE", rsnie, rsnie_len);
-
- // group cipher
- if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, GROUP_SUITE, &count)) != NULL)
- {
- hex_dump("group cipher", pSuite, 4*count);
- }
-
- // pairwise cipher
- if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, PAIRWISE_SUITE, &count)) != NULL)
- {
- hex_dump("pairwise cipher", pSuite, 4*count);
- }
-
- // AKM
- if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, AKM_SUITE, &count)) != NULL)
- {
- hex_dump("AKM suite", pSuite, 4*count);
- }
-
- // PMKID
- if ((pSuite = GetSuiteFromRSNIE(rsnie, rsnie_len, PMKID_LIST, &count)) != NULL)
- {
- hex_dump("PMKID", pSuite, LEN_PMKID);
- }
-
-}
-
-VOID RTMPInsertRSNIE(
- IN PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN PUINT8 rsnie_ptr,
- IN UINT8 rsnie_len,
- IN PUINT8 pmkid_ptr,
- IN UINT8 pmkid_len)
-{
- PUCHAR pTmpBuf;
- ULONG TempLen = 0;
- UINT8 extra_len = 0;
- UINT16 pmk_count = 0;
- UCHAR ie_num;
- UINT8 total_len = 0;
- UCHAR WPA2_OUI[3]={0x00,0x0F,0xAC};
-
- pTmpBuf = pFrameBuf;
-
- /* PMKID-List Must larger than 0 and the multiple of 16. */
- if (pmkid_len > 0 && ((pmkid_len & 0x0f) == 0))
- {
- extra_len = sizeof(UINT16) + pmkid_len;
-
- pmk_count = (pmkid_len >> 4);
- pmk_count = cpu2le16(pmk_count);
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("%s : The length is PMKID-List is invalid (%d), so don't insert it.\n",
- __FUNCTION__, pmkid_len));
- }
-
- if (rsnie_len != 0)
- {
- ie_num = IE_WPA;
- total_len = rsnie_len;
-
- if (NdisEqualMemory(rsnie_ptr + 2, WPA2_OUI, sizeof(WPA2_OUI)))
- {
- ie_num = IE_RSN;
- total_len += extra_len;
- }
-
- /* construct RSNIE body */
- MakeOutgoingFrame(pTmpBuf, &TempLen,
- 1, &ie_num,
- 1, &total_len,
- rsnie_len, rsnie_ptr,
- END_OF_ARGS);
-
- pTmpBuf += TempLen;
- *pFrameLen = *pFrameLen + TempLen;
-
- if (ie_num == IE_RSN)
- {
- /* Insert PMKID-List field */
- if (extra_len > 0)
- {
- MakeOutgoingFrame(pTmpBuf, &TempLen,
- 2, &pmk_count,
- pmkid_len, pmkid_ptr,
- END_OF_ARGS);
-
- pTmpBuf += TempLen;
- *pFrameLen = *pFrameLen + TempLen;
- }
- }
- }
-
- return;
-}
diff --git a/drivers/staging/rt3090/common/crypt_aes.c b/drivers/staging/rt3090/common/crypt_aes.c
deleted file mode 100644
index f400f1eab516..000000000000
--- a/drivers/staging/rt3090/common/crypt_aes.c
+++ /dev/null
@@ -1,1007 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- crypt_aes.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Eddy 2009/01/19 Create AES-128, AES-192, AES-256, AES-CBC
-*/
-
-#include "crypt_aes.h"
-
-/* The value given by [x^(i-1),{00},{00},{00}], with x^(i-1) being powers of x in the field GF(2^8). */
-static const UINT32 aes_rcon[] = {
- 0x00000000, 0x01000000, 0x02000000, 0x04000000,
- 0x08000000, 0x10000000, 0x20000000, 0x40000000,
- 0x80000000, 0x1B000000, 0x36000000};
-
-static const UINT8 aes_sbox_enc[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7 ,0xab, 0x76, /* 0 */
- 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4 ,0x72, 0xc0, /* 1 */
- 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8 ,0x31, 0x15, /* 2 */
- 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27 ,0xb2, 0x75, /* 3 */
- 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3 ,0x2f, 0x84, /* 4 */
- 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c ,0x58, 0xcf, /* 5 */
- 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c ,0x9f, 0xa8, /* 6 */
- 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff ,0xf3, 0xd2, /* 7 */
- 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d ,0x19, 0x73, /* 8 */
- 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e ,0x0b, 0xdb, /* 9 */
- 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95 ,0xe4, 0x79, /* a */
- 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a ,0xae, 0x08, /* b */
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd ,0x8b, 0x8a, /* c */
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1 ,0x1d, 0x9e, /* d */
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55 ,0x28, 0xdf, /* e */
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54 ,0xbb, 0x16, /* f */
-};
-
-static const UINT8 aes_sbox_dec[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x52, 0x09, 0x6a, 0xd5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xbe, 0x1b, /* a */
- 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, /* b */
- 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, /* c */
- 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, /* d */
- 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, /* e */
- 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d, /* f */
-};
-
-/* ArrayIndex*{02} */
-static const UINT8 aes_mul_2[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x02, 0x04, 0x06, 0x08, 0x0a, 0x0c, 0x0e, 0x10, 0x12, 0x14, 0x16, 0x18, 0x1a, 0x1c, 0x1e, /* 0 */
- 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e, 0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, /* 1 */
- 0x40, 0x42, 0x44, 0x46, 0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e, /* 2 */
- 0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76, 0x78, 0x7a, 0x7c, 0x7e, /* 3 */
- 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e, 0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x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5, 0xeb, 0xe9, 0xef, 0xed, 0xe3, 0xe1, 0xe7, 0xe5, /* f */
-};
-
-/* ArrayIndex*{03} */
-static const UINT8 aes_mul_3[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x03, 0x06, 0x05, 0x0c, 0x0f, 0x0a, 0x09, 0x18, 0x1b, 0x1e, 0x1d, 0x14, 0x17, 0x12, 0x11, /* 0 */
- 0x30, 0x33, 0x36, 0x35, 0x3c, 0x3f, 0x3a, 0x39, 0x28, 0x2b, 0x2e, 0x2d, 0x24, 0x27, 0x22, 0x21, /* 1 */
- 0x60, 0x63, 0x66, 0x65, 0x6c, 0x6f, 0x6a, 0x69, 0x78, 0x7b, 0x7e, 0x7d, 0x74, 0x77, 0x72, 0x71, /* 2 */
- 0x50, 0x53, 0x56, 0x55, 0x5c, 0x5f, 0x5a, 0x59, 0x48, 0x4b, 0x4e, 0x4d, 0x44, 0x47, 0x42, 0x41, /* 3 */
- 0xc0, 0xc3, 0xc6, 0xc5, 0xcc, 0xcf, 0xca, 0xc9, 0xd8, 0xdb, 0xde, 0xdd, 0xd4, 0xd7, 0xd2, 0xd1, /* 4 */
- 0xf0, 0xf3, 0xf6, 0xf5, 0xfc, 0xff, 0xfa, 0xf9, 0xe8, 0xeb, 0xee, 0xed, 0xe4, 0xe7, 0xe2, 0xe1, /* 5 */
- 0xa0, 0xa3, 0xa6, 0xa5, 0xac, 0xaf, 0xaa, 0xa9, 0xb8, 0xbb, 0xbe, 0xbd, 0xb4, 0xb7, 0xb2, 0xb1, /* 6 */
- 0x90, 0x93, 0x96, 0x95, 0x9c, 0x9f, 0x9a, 0x99, 0x88, 0x8b, 0x8e, 0x8d, 0x84, 0x87, 0x82, 0x81, /* 7 */
- 0x9b, 0x98, 0x9d, 0x9e, 0x97, 0x94, 0x91, 0x92, 0x83, 0x80, 0x85, 0x86, 0x8f, 0x8c, 0x89, 0x8a, /* 8 */
- 0xab, 0xa8, 0xad, 0xae, 0xa7, 0xa4, 0xa1, 0xa2, 0xb3, 0xb0, 0xb5, 0xb6, 0xbf, 0xbc, 0xb9, 0xba, /* 9 */
- 0xfb, 0xf8, 0xfd, 0xfe, 0xf7, 0xf4, 0xf1, 0xf2, 0xe3, 0xe0, 0xe5, 0xe6, 0xef, 0xec, 0xe9, 0xea, /* a */
- 0xcb, 0xc8, 0xcd, 0xce, 0xc7, 0xc4, 0xc1, 0xc2, 0xd3, 0xd0, 0xd5, 0xd6, 0xdf, 0xdc, 0xd9, 0xda, /* b */
- 0x5b, 0x58, 0x5d, 0x5e, 0x57, 0x54, 0x51, 0x52, 0x43, 0x40, 0x45, 0x46, 0x4f, 0x4c, 0x49, 0x4a, /* c */
- 0x6b, 0x68, 0x6d, 0x6e, 0x67, 0x64, 0x61, 0x62, 0x73, 0x70, 0x75, 0x76, 0x7f, 0x7c, 0x79, 0x7a, /* d */
- 0x3b, 0x38, 0x3d, 0x3e, 0x37, 0x34, 0x31, 0x32, 0x23, 0x20, 0x25, 0x26, 0x2f, 0x2c, 0x29, 0x2a, /* e */
- 0x0b, 0x08, 0x0d, 0x0e, 0x07, 0x04, 0x01, 0x02, 0x13, 0x10, 0x15, 0x16, 0x1f, 0x1c, 0x19, 0x1a, /* f */
-};
-
-/* ArrayIndex*{09} */
-static const UINT8 aes_mul_9[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x09, 0x12, 0x1b, 0x24, 0x2d, 0x36, 0x3f, 0x48, 0x41, 0x5a, 0x53, 0x6c, 0x65, 0x7e, 0x77, /* 0 */
- 0x90, 0x99, 0x82, 0x8b, 0xb4, 0xbd, 0xa6, 0xaf, 0xd8, 0xd1, 0xca, 0xc3, 0xfc, 0xf5, 0xee, 0xe7, /* 1 */
- 0x3b, 0x32, 0x29, 0x20, 0x1f, 0x16, 0x0d, 0x04, 0x73, 0x7a, 0x61, 0x68, 0x57, 0x5e, 0x45, 0x4c, /* 2 */
- 0xab, 0xa2, 0xb9, 0xb0, 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0x7d, /* d */
- 0xa1, 0xa8, 0xb3, 0xba, 0x85, 0x8c, 0x97, 0x9e, 0xe9, 0xe0, 0xfb, 0xf2, 0xcd, 0xc4, 0xdf, 0xd6, /* e */
- 0x31, 0x38, 0x23, 0x2a, 0x15, 0x1c, 0x07, 0x0e, 0x79, 0x70, 0x6b, 0x62, 0x5d, 0x54, 0x4f, 0x46, /* f */
-};
-
-/* ArrayIndex*{0b} */
-static const UINT8 aes_mul_b[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x0b, 0x16, 0x1d, 0x2c, 0x27, 0x3a, 0x31, 0x58, 0x53, 0x4e, 0x45, 0x74, 0x7f, 0x62, 0x69, /* 0 */
- 0xb0, 0xbb, 0xa6, 0xad, 0x9c, 0x97, 0x8a, 0x81, 0xe8, 0xe3, 0xfe, 0xf5, 0xc4, 0xcf, 0xd2, 0xd9, /* 1 */
- 0x7b, 0x70, 0x6d, 0x66, 0x57, 0x5c, 0x41, 0x4a, 0x23, 0x28, 0x35, 0x3e, 0x0f, 0x04, 0x19, 0x12, /* 2 */
- 0xcb, 0xc0, 0xdd, 0xd6, 0xe7, 0xec, 0xf1, 0xfa, 0x93, 0x98, 0x85, 0x8e, 0xbf, 0xb4, 0xa9, 0xa2, /* 3 */
- 0xf6, 0xfd, 0xe0, 0xeb, 0xda, 0xd1, 0xcc, 0xc7, 0xae, 0xa5, 0xb8, 0xb3, 0x82, 0x89, 0x94, 0x9f, /* 4 */
- 0x46, 0x4d, 0x50, 0x5b, 0x6a, 0x61, 0x7c, 0x77, 0x1e, 0x15, 0x08, 0x03, 0x32, 0x39, 0x24, 0x2f, /* 5 */
- 0x8d, 0x86, 0x9b, 0x90, 0xa1, 0xaa, 0xb7, 0xbc, 0xd5, 0xde, 0xc3, 0xc8, 0xf9, 0xf2, 0xef, 0xe4, /* 6 */
- 0x3d, 0x36, 0x2b, 0x20, 0x11, 0x1a, 0x07, 0x0c, 0x65, 0x6e, 0x73, 0x78, 0x49, 0x42, 0x5f, 0x54, /* 7 */
- 0xf7, 0xfc, 0xe1, 0xea, 0xdb, 0xd0, 0xcd, 0xc6, 0xaf, 0xa4, 0xb9, 0xb2, 0x83, 0x88, 0x95, 0x9e, /* 8 */
- 0x47, 0x4c, 0x51, 0x5a, 0x6b, 0x60, 0x7d, 0x76, 0x1f, 0x14, 0x09, 0x02, 0x33, 0x38, 0x25, 0x2e, /* 9 */
- 0x8c, 0x87, 0x9a, 0x91, 0xa0, 0xab, 0xb6, 0xbd, 0xd4, 0xdf, 0xc2, 0xc9, 0xf8, 0xf3, 0xee, 0xe5, /* a */
- 0x3c, 0x37, 0x2a, 0x21, 0x10, 0x1b, 0x06, 0x0d, 0x64, 0x6f, 0x72, 0x79, 0x48, 0x43, 0x5e, 0x55, /* b */
- 0x01, 0x0a, 0x17, 0x1c, 0x2d, 0x26, 0x3b, 0x30, 0x59, 0x52, 0x4f, 0x44, 0x75, 0x7e, 0x63, 0x68, /* c */
- 0xb1, 0xba, 0xa7, 0xac, 0x9d, 0x96, 0x8b, 0x80, 0xe9, 0xe2, 0xff, 0xf4, 0xc5, 0xce, 0xd3, 0xd8, /* d */
- 0x7a, 0x71, 0x6c, 0x67, 0x56, 0x5d, 0x40, 0x4b, 0x22, 0x29, 0x34, 0x3f, 0x0e, 0x05, 0x18, 0x13, /* e */
- 0xca, 0xc1, 0xdc, 0xd7, 0xe6, 0xed, 0xf0, 0xfb, 0x92, 0x99, 0x84, 0x8f, 0xbe, 0xb5, 0xa8, 0xa3, /* f */
-};
-
-/* ArrayIndex*{0d} */
-static const UINT8 aes_mul_d[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x0d, 0x1a, 0x17, 0x34, 0x39, 0x2e, 0x23, 0x68, 0x65, 0x72, 0x7f, 0x5c, 0x51, 0x46, 0x4b, /* 0 */
- 0xd0, 0xdd, 0xca, 0xc7, 0xe4, 0xe9, 0xfe, 0xf3, 0xb8, 0xb5, 0xa2, 0xaf, 0x8c, 0x81, 0x96, 0x9b, /* 1 */
- 0xbb, 0xb6, 0xa1, 0xac, 0x8f, 0x82, 0x95, 0x98, 0xd3, 0xde, 0xc9, 0xc4, 0xe7, 0xea, 0xfd, 0xf0, /* 2 */
- 0x6b, 0x66, 0x71, 0x7c, 0x5f, 0x52, 0x45, 0x48, 0x03, 0x0e, 0x19, 0x14, 0x37, 0x3a, 0x2d, 0x20, /* 3 */
- 0x6d, 0x60, 0x77, 0x7a, 0x59, 0x54, 0x43, 0x4e, 0x05, 0x08, 0x1f, 0x12, 0x31, 0x3c, 0x2b, 0x26, /* 4 */
- 0xbd, 0xb0, 0xa7, 0xaa, 0x89, 0x84, 0x93, 0x9e, 0xd5, 0xd8, 0xcf, 0xc2, 0xe1, 0xec, 0xfb, 0xf6, /* 5 */
- 0xd6, 0xdb, 0xcc, 0xc1, 0xe2, 0xef, 0xf8, 0xf5, 0xbe, 0xb3, 0xa4, 0xa9, 0x8a, 0x87, 0x90, 0x9d, /* 6 */
- 0x06, 0x0b, 0x1c, 0x11, 0x32, 0x3f, 0x28, 0x25, 0x6e, 0x63, 0x74, 0x79, 0x5a, 0x57, 0x40, 0x4d, /* 7 */
- 0xda, 0xd7, 0xc0, 0xcd, 0xee, 0xe3, 0xf4, 0xf9, 0xb2, 0xbf, 0xa8, 0xa5, 0x86, 0x8b, 0x9c, 0x91, /* 8 */
- 0x0a, 0x07, 0x10, 0x1d, 0x3e, 0x33, 0x24, 0x29, 0x62, 0x6f, 0x78, 0x75, 0x56, 0x5b, 0x4c, 0x41, /* 9 */
- 0x61, 0x6c, 0x7b, 0x76, 0x55, 0x58, 0x4f, 0x42, 0x09, 0x04, 0x13, 0x1e, 0x3d, 0x30, 0x27, 0x2a, /* a */
- 0xb1, 0xbc, 0xab, 0xa6, 0x85, 0x88, 0x9f, 0x92, 0xd9, 0xd4, 0xc3, 0xce, 0xed, 0xe0, 0xf7, 0xfa, /* b */
- 0xb7, 0xba, 0xad, 0xa0, 0x83, 0x8e, 0x99, 0x94, 0xdf, 0xd2, 0xc5, 0xc8, 0xeb, 0xe6, 0xf1, 0xfc, /* c */
- 0x67, 0x6a, 0x7d, 0x70, 0x53, 0x5e, 0x49, 0x44, 0x0f, 0x02, 0x15, 0x18, 0x3b, 0x36, 0x21, 0x2c, /* d */
- 0x0c, 0x01, 0x16, 0x1b, 0x38, 0x35, 0x22, 0x2f, 0x64, 0x69, 0x7e, 0x73, 0x50, 0x5d, 0x4a, 0x47, /* e */
- 0xdc, 0xd1, 0xc6, 0xcb, 0xe8, 0xe5, 0xf2, 0xff, 0xb4, 0xb9, 0xae, 0xa3, 0x80, 0x8d, 0x9a, 0x97, /* f */
-};
-
-/* ArrayIndex*{0e} */
-static const UINT8 aes_mul_e[] = {
- /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
- 0x00, 0x0e, 0x1c, 0x12, 0x38, 0x36, 0x24, 0x2a, 0x70, 0x7e, 0x6c, 0x62, 0x48, 0x46, 0x54, 0x5a, /* 0 */
- 0xe0, 0xee, 0xfc, 0xf2, 0xd8, 0xd6, 0xc4, 0xca, 0x90, 0x9e, 0x8c, 0x82, 0xa8, 0xa6, 0xb4, 0xba, /* 1 */
- 0xdb, 0xd5, 0xc7, 0xc9, 0xe3, 0xed, 0xff, 0xf1, 0xab, 0xa5, 0xb7, 0xb9, 0x93, 0x9d, 0x8f, 0x81, /* 2 */
- 0x3b, 0x35, 0x27, 0x29, 0x03, 0x0d, 0x1f, 0x11, 0x4b, 0x45, 0x57, 0x59, 0x73, 0x7d, 0x6f, 0x61, /* 3 */
- 0xad, 0xa3, 0xb1, 0xbf, 0x95, 0x9b, 0x89, 0x87, 0xdd, 0xd3, 0xc1, 0xcf, 0xe5, 0xeb, 0xf9, 0xf7, /* 4 */
- 0x4d, 0x43, 0x51, 0x5f, 0x75, 0x7b, 0x69, 0x67, 0x3d, 0x33, 0x21, 0x2f, 0x05, 0x0b, 0x19, 0x17, /* 5 */
- 0x76, 0x78, 0x6a, 0x64, 0x4e, 0x40, 0x52, 0x5c, 0x06, 0x08, 0x1a, 0x14, 0x3e, 0x30, 0x22, 0x2c, /* 6 */
- 0x96, 0x98, 0x8a, 0x84, 0xae, 0xa0, 0xb2, 0xbc, 0xe6, 0xe8, 0xfa, 0xf4, 0xde, 0xd0, 0xc2, 0xcc, /* 7 */
- 0x41, 0x4f, 0x5d, 0x53, 0x79, 0x77, 0x65, 0x6b, 0x31, 0x3f, 0x2d, 0x23, 0x09, 0x07, 0x15, 0x1b, /* 8 */
- 0xa1, 0xaf, 0xbd, 0xb3, 0x99, 0x97, 0x85, 0x8b, 0xd1, 0xdf, 0xcd, 0xc3, 0xe9, 0xe7, 0xf5, 0xfb, /* 9 */
- 0x9a, 0x94, 0x86, 0x88, 0xa2, 0xac, 0xbe, 0xb0, 0xea, 0xe4, 0xf6, 0xf8, 0xd2, 0xdc, 0xce, 0xc0, /* a */
- 0x7a, 0x74, 0x66, 0x68, 0x42, 0x4c, 0x5e, 0x50, 0x0a, 0x04, 0x16, 0x18, 0x32, 0x3c, 0x2e, 0x20, /* b */
- 0xec, 0xe2, 0xf0, 0xfe, 0xd4, 0xda, 0xc8, 0xc6, 0x9c, 0x92, 0x80, 0x8e, 0xa4, 0xaa, 0xb8, 0xb6, /* c */
- 0x0c, 0x02, 0x10, 0x1e, 0x34, 0x3a, 0x28, 0x26, 0x7c, 0x72, 0x60, 0x6e, 0x44, 0x4a, 0x58, 0x56, /* d */
- 0x37, 0x39, 0x2b, 0x25, 0x0f, 0x01, 0x13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d, /* e */
- 0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d, /* f */
-};
-
-
-/* For AES_CMAC */
-#define AES_MAC_LENGTH 16 /* 128-bit string */
-static UINT8 Const_Zero[16] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-static UINT8 Const_Rb[16] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87};
-
-
-/*
-========================================================================
-Routine Description:
- AES key expansion (key schedule)
-
-Arguments:
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- paes_ctx Pointer to AES_CTX_STRUC
-
-Return Value:
- paes_ctx Retrun the KeyWordExpansion of AES_CTX_STRUC
-
-Note:
- Pseudo code for key expansion
- ------------------------------------------
- Nk = (key length/4);
-
- while (i < Nk)
- KeyWordExpansion[i] = word(key[4*i], key[4*i + 1], key[4*i + 2], key[4*i + 3]);
- i++;
- end while
-
- while (i < ((key length/4 + 6 + 1)*4) )
- temp = KeyWordExpansion[i - 1];
- if (i % Nk ==0)
- temp = SubWord(RotWord(temp)) ^ Rcon[i/Nk];
- else if ((Nk > 6) && (i % 4 == 4))
- temp = SubWord(temp);
- end if
-
- KeyWordExpansion[i] = KeyWordExpansion[i - Nk]^ temp;
- i++;
- end while
-========================================================================
-*/
-VOID AES_KeyExpansion (
- IN UINT8 Key[],
- IN UINT KeyLength,
- INOUT AES_CTX_STRUC *paes_ctx)
-{
- UINT KeyIndex = 0;
- UINT NumberOfWordOfKey, NumberOfWordOfKeyExpansion;
- UINT8 TempWord[AES_KEY_ROWS], Temp;
- UINT32 Temprcon;
-
- NumberOfWordOfKey = KeyLength >> 2;
- while (KeyIndex < NumberOfWordOfKey)
- {
- paes_ctx->KeyWordExpansion[0][KeyIndex] = Key[4*KeyIndex];
- paes_ctx->KeyWordExpansion[1][KeyIndex] = Key[4*KeyIndex + 1];
- paes_ctx->KeyWordExpansion[2][KeyIndex] = Key[4*KeyIndex + 2];
- paes_ctx->KeyWordExpansion[3][KeyIndex] = Key[4*KeyIndex + 3];
- KeyIndex++;
- } /* End of while */
-
- NumberOfWordOfKeyExpansion = ((UINT) AES_KEY_ROWS) * ((KeyLength >> 2) + 6 + 1);
- while (KeyIndex < NumberOfWordOfKeyExpansion)
- {
- TempWord[0] = paes_ctx->KeyWordExpansion[0][KeyIndex - 1];
- TempWord[1] = paes_ctx->KeyWordExpansion[1][KeyIndex - 1];
- TempWord[2] = paes_ctx->KeyWordExpansion[2][KeyIndex - 1];
- TempWord[3] = paes_ctx->KeyWordExpansion[3][KeyIndex - 1];
- if ((KeyIndex % NumberOfWordOfKey) == 0) {
- Temprcon = aes_rcon[KeyIndex/NumberOfWordOfKey];
- Temp = aes_sbox_enc[TempWord[1]]^((Temprcon >> 24) & 0xff);
- TempWord[1] = aes_sbox_enc[TempWord[2]]^((Temprcon >> 16) & 0xff);
- TempWord[2] = aes_sbox_enc[TempWord[3]]^((Temprcon >> 8) & 0xff);
- TempWord[3] = aes_sbox_enc[TempWord[0]]^((Temprcon ) & 0xff);
- TempWord[0] = Temp;
- } else if ((NumberOfWordOfKey > 6) && ((KeyIndex % NumberOfWordOfKey) == 4)) {
- Temp = aes_sbox_enc[TempWord[0]];
- TempWord[1] = aes_sbox_enc[TempWord[1]];
- TempWord[2] = aes_sbox_enc[TempWord[2]];
- TempWord[3] = aes_sbox_enc[TempWord[3]];
- TempWord[0] = Temp;
- }
- paes_ctx->KeyWordExpansion[0][KeyIndex] = paes_ctx->KeyWordExpansion[0][KeyIndex - NumberOfWordOfKey]^TempWord[0];
- paes_ctx->KeyWordExpansion[1][KeyIndex] = paes_ctx->KeyWordExpansion[1][KeyIndex - NumberOfWordOfKey]^TempWord[1];
- paes_ctx->KeyWordExpansion[2][KeyIndex] = paes_ctx->KeyWordExpansion[2][KeyIndex - NumberOfWordOfKey]^TempWord[2];
- paes_ctx->KeyWordExpansion[3][KeyIndex] = paes_ctx->KeyWordExpansion[3][KeyIndex - NumberOfWordOfKey]^TempWord[3];
- KeyIndex++;
- } /* End of while */
-} /* End of AES_KeyExpansion */
-
-
-/*
-========================================================================
-Routine Description:
- AES encryption
-
-Arguments:
- PlainBlock The block of plain text, 16 bytes(128 bits) each block
- PlainBlockSize The length of block of plain text in bytes
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- CipherBlockSize The length of allocated cipher block in bytes
-
-Return Value:
- CipherBlock Return cipher text
- CipherBlockSize Return the length of real used cipher block in bytes
-
-Note:
- Reference to FIPS-PUB 197
- 1. Check if block size is 16 bytes(128 bits) and if key length is 16, 24, or 32 bytes(128, 192, or 256 bits)
- 2. Transfer the plain block to state block
- 3. Main encryption rounds
- 4. Transfer the state block to cipher block
- ------------------------------------------
- NumberOfRound = (key length / 4) + 6;
- state block = plain block;
-
- AddRoundKey(state block, key);
- for round = 1 to NumberOfRound
- SubBytes(state block)
- ShiftRows(state block)
- MixColumns(state block)
- AddRoundKey(state block, key);
- end for
-
- SubBytes(state block)
- ShiftRows(state block)
- AddRoundKey(state block, key);
-
- cipher block = state block;
-========================================================================
-*/
-VOID AES_Encrypt (
- IN UINT8 PlainBlock[],
- IN UINT PlainBlockSize,
- IN UINT8 Key[],
- IN UINT KeyLength,
- OUT UINT8 CipherBlock[],
- INOUT UINT *CipherBlockSize)
-{
- AES_CTX_STRUC aes_ctx;
- UINT RowIndex, ColumnIndex;
- UINT RoundIndex, NumberOfRound = 0;
- UINT8 Temp, Row0, Row1, Row2, Row3;
-
- /*
- * 1. Check if block size is 16 bytes(128 bits) and if key length is 16, 24, or 32 bytes(128, 192, or 256 bits)
- */
- if (PlainBlockSize != AES_BLOCK_SIZES) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Encrypt: plain block size is %d bytes, it must be %d bytes(128 bits).\n",
- PlainBlockSize, AES_BLOCK_SIZES));
- return;
- } /* End of if */
- if ((KeyLength != AES_KEY128_LENGTH) && (KeyLength != AES_KEY192_LENGTH) && (KeyLength != AES_KEY256_LENGTH)) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Encrypt: key length is %d bytes, it must be %d, %d, or %d bytes(128, 192, or 256 bits).\n",
- KeyLength, AES_KEY128_LENGTH, AES_KEY192_LENGTH, AES_KEY256_LENGTH));
- return;
- } /* End of if */
- if (*CipherBlockSize < AES_BLOCK_SIZES) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Encrypt: cipher block size is %d bytes, it must be %d bytes(128 bits).\n",
- *CipherBlockSize, AES_BLOCK_SIZES));
- return;
- } /* End of if */
-
- /*
- * 2. Transfer the plain block to state block
- */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = PlainBlock[RowIndex + 4*ColumnIndex];
-
- /*
- * 3. Main encryption rounds
- */
- AES_KeyExpansion(Key, KeyLength, &aes_ctx);
- NumberOfRound = (KeyLength >> 2) + 6;
-
- /* AES_AddRoundKey */
- RoundIndex = 0;
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
-
- for (RoundIndex = 1; RoundIndex < NumberOfRound;RoundIndex++)
- {
- /* AES_SubBytes */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = aes_sbox_enc[aes_ctx.State[RowIndex][ColumnIndex]];
-
- /* AES_ShiftRows */
- Temp = aes_ctx.State[1][0];
- aes_ctx.State[1][0] = aes_ctx.State[1][1];
- aes_ctx.State[1][1] = aes_ctx.State[1][2];
- aes_ctx.State[1][2] = aes_ctx.State[1][3];
- aes_ctx.State[1][3] = Temp;
- Temp = aes_ctx.State[2][0];
- aes_ctx.State[2][0] = aes_ctx.State[2][2];
- aes_ctx.State[2][2] = Temp;
- Temp = aes_ctx.State[2][1];
- aes_ctx.State[2][1] = aes_ctx.State[2][3];
- aes_ctx.State[2][3] = Temp;
- Temp = aes_ctx.State[3][3];
- aes_ctx.State[3][3] = aes_ctx.State[3][2];
- aes_ctx.State[3][2] = aes_ctx.State[3][1];
- aes_ctx.State[3][1] = aes_ctx.State[3][0];
- aes_ctx.State[3][0] = Temp;
-
- /* AES_MixColumns */
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- {
- Row0 = aes_ctx.State[0][ColumnIndex];
- Row1 = aes_ctx.State[1][ColumnIndex];
- Row2 = aes_ctx.State[2][ColumnIndex];
- Row3 = aes_ctx.State[3][ColumnIndex];
- aes_ctx.State[0][ColumnIndex] = aes_mul_2[Row0]^aes_mul_3[Row1]^Row2^Row3;
- aes_ctx.State[1][ColumnIndex] = Row0^aes_mul_2[Row1]^aes_mul_3[Row2]^Row3;
- aes_ctx.State[2][ColumnIndex] = Row0^Row1^aes_mul_2[Row2]^aes_mul_3[Row3];
- aes_ctx.State[3][ColumnIndex] = aes_mul_3[Row0]^Row1^Row2^aes_mul_2[Row3];
- }
-
- /* AES_AddRoundKey */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
- } /* End of for */
-
- /* AES_SubBytes */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = aes_sbox_enc[aes_ctx.State[RowIndex][ColumnIndex]];
- /* AES_ShiftRows */
- Temp = aes_ctx.State[1][0];
- aes_ctx.State[1][0] = aes_ctx.State[1][1];
- aes_ctx.State[1][1] = aes_ctx.State[1][2];
- aes_ctx.State[1][2] = aes_ctx.State[1][3];
- aes_ctx.State[1][3] = Temp;
- Temp = aes_ctx.State[2][0];
- aes_ctx.State[2][0] = aes_ctx.State[2][2];
- aes_ctx.State[2][2] = Temp;
- Temp = aes_ctx.State[2][1];
- aes_ctx.State[2][1] = aes_ctx.State[2][3];
- aes_ctx.State[2][3] = Temp;
- Temp = aes_ctx.State[3][3];
- aes_ctx.State[3][3] = aes_ctx.State[3][2];
- aes_ctx.State[3][2] = aes_ctx.State[3][1];
- aes_ctx.State[3][1] = aes_ctx.State[3][0];
- aes_ctx.State[3][0] = Temp;
- /* AES_AddRoundKey */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
-
- /*
- * 4. Transfer the state block to cipher block
- */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- CipherBlock[RowIndex + 4*ColumnIndex] = aes_ctx.State[RowIndex][ColumnIndex];
-
- *CipherBlockSize = ((UINT) AES_STATE_ROWS)*((UINT) AES_STATE_COLUMNS);
-} /* End of AES_Encrypt */
-
-
-/*
-========================================================================
-Routine Description:
- AES decryption
-
-Arguments:
- CipherBlock The block of cipher text, 16 bytes(128 bits) each block
- CipherBlockSize The length of block of cipher text in bytes
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- PlainBlockSize The length of allocated plain block in bytes
-
-Return Value:
- PlainBlock Return plain text
- PlainBlockSize Return the length of real used plain block in bytes
-
-Note:
- Reference to FIPS-PUB 197
- 1. Check if block size is 16 bytes(128 bits) and if key length is 16, 24, or 32 bytes(128, 192, or 256 bits)
- 2. Transfer the cipher block to state block
- 3. Main decryption rounds
- 4. Transfer the state block to plain block
- ------------------------------------------
- NumberOfRound = (key length / 4) + 6;
- state block = cipher block;
-
- AddRoundKey(state block, key);
- for round = NumberOfRound to 1
- InvSubBytes(state block)
- InvShiftRows(state block)
- InvMixColumns(state block)
- AddRoundKey(state block, key);
- end for
-
- InvSubBytes(state block)
- InvShiftRows(state block)
- AddRoundKey(state block, key);
-
- plain block = state block;
-========================================================================
-*/
-VOID AES_Decrypt (
- IN UINT8 CipherBlock[],
- IN UINT CipherBlockSize,
- IN UINT8 Key[],
- IN UINT KeyLength,
- OUT UINT8 PlainBlock[],
- INOUT UINT *PlainBlockSize)
-{
- AES_CTX_STRUC aes_ctx;
- UINT RowIndex, ColumnIndex;
- UINT RoundIndex, NumberOfRound = 0;
- UINT8 Temp, Row0, Row1, Row2, Row3;
-
- /*
- * 1. Check if block size is 16 bytes(128 bits) and if key length is 16, 24, or 32 bytes(128, 192, or 256 bits)
- */
- if (*PlainBlockSize < AES_BLOCK_SIZES) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Decrypt: plain block size is %d bytes, it must be %d bytes(128 bits).\n",
- *PlainBlockSize, AES_BLOCK_SIZES));
- return;
- } /* End of if */
- if ((KeyLength != AES_KEY128_LENGTH) && (KeyLength != AES_KEY192_LENGTH) && (KeyLength != AES_KEY256_LENGTH)) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Decrypt: key length is %d bytes, it must be %d, %d, or %d bytes(128, 192, or 256 bits).\n",
- KeyLength, AES_KEY128_LENGTH, AES_KEY192_LENGTH, AES_KEY256_LENGTH));
- return;
- } /* End of if */
- if (CipherBlockSize != AES_BLOCK_SIZES) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_Decrypt: cipher block size is %d bytes, it must be %d bytes(128 bits).\n",
- CipherBlockSize, AES_BLOCK_SIZES));
- return;
- } /* End of if */
-
- /*
- * 2. Transfer the cipher block to state block
- */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = CipherBlock[RowIndex + 4*ColumnIndex];
-
- /*
- * 3. Main decryption rounds
- */
- AES_KeyExpansion(Key, KeyLength, &aes_ctx);
- NumberOfRound = (KeyLength >> 2) + 6;
-
- /* AES_AddRoundKey */
- RoundIndex = NumberOfRound;
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
-
- for (RoundIndex = (NumberOfRound - 1); RoundIndex > 0 ;RoundIndex--)
- {
- /* AES_InvShiftRows */
- Temp = aes_ctx.State[1][3];
- aes_ctx.State[1][3] = aes_ctx.State[1][2];
- aes_ctx.State[1][2] = aes_ctx.State[1][1];
- aes_ctx.State[1][1] = aes_ctx.State[1][0];
- aes_ctx.State[1][0] = Temp;
- Temp = aes_ctx.State[2][0];
- aes_ctx.State[2][0] = aes_ctx.State[2][2];
- aes_ctx.State[2][2] = Temp;
- Temp = aes_ctx.State[2][1];
- aes_ctx.State[2][1] = aes_ctx.State[2][3];
- aes_ctx.State[2][3] = Temp;
- Temp = aes_ctx.State[3][0];
- aes_ctx.State[3][0] = aes_ctx.State[3][1];
- aes_ctx.State[3][1] = aes_ctx.State[3][2];
- aes_ctx.State[3][2] = aes_ctx.State[3][3];
- aes_ctx.State[3][3] = Temp;
-
- /* AES_InvSubBytes */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = aes_sbox_dec[aes_ctx.State[RowIndex][ColumnIndex]];
-
- /* AES_AddRoundKey */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
-
- /* AES_InvMixColumns */
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- {
- Row0 = aes_ctx.State[0][ColumnIndex];
- Row1 = aes_ctx.State[1][ColumnIndex];
- Row2 = aes_ctx.State[2][ColumnIndex];
- Row3 = aes_ctx.State[3][ColumnIndex];
- aes_ctx.State[0][ColumnIndex] = aes_mul_e[Row0]^aes_mul_b[Row1]^aes_mul_d[Row2]^aes_mul_9[Row3];
- aes_ctx.State[1][ColumnIndex] = aes_mul_9[Row0]^aes_mul_e[Row1]^aes_mul_b[Row2]^aes_mul_d[Row3];
- aes_ctx.State[2][ColumnIndex] = aes_mul_d[Row0]^aes_mul_9[Row1]^aes_mul_e[Row2]^aes_mul_b[Row3];
- aes_ctx.State[3][ColumnIndex] = aes_mul_b[Row0]^aes_mul_d[Row1]^aes_mul_9[Row2]^aes_mul_e[Row3];
- }
- } /* End of for */
-
- /* AES_InvShiftRows */
- Temp = aes_ctx.State[1][3];
- aes_ctx.State[1][3] = aes_ctx.State[1][2];
- aes_ctx.State[1][2] = aes_ctx.State[1][1];
- aes_ctx.State[1][1] = aes_ctx.State[1][0];
- aes_ctx.State[1][0] = Temp;
- Temp = aes_ctx.State[2][0];
- aes_ctx.State[2][0] = aes_ctx.State[2][2];
- aes_ctx.State[2][2] = Temp;
- Temp = aes_ctx.State[2][1];
- aes_ctx.State[2][1] = aes_ctx.State[2][3];
- aes_ctx.State[2][3] = Temp;
- Temp = aes_ctx.State[3][0];
- aes_ctx.State[3][0] = aes_ctx.State[3][1];
- aes_ctx.State[3][1] = aes_ctx.State[3][2];
- aes_ctx.State[3][2] = aes_ctx.State[3][3];
- aes_ctx.State[3][3] = Temp;
- /* AES_InvSubBytes */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] = aes_sbox_dec[aes_ctx.State[RowIndex][ColumnIndex]];
- /* AES_AddRoundKey */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- aes_ctx.State[RowIndex][ColumnIndex] ^= aes_ctx.KeyWordExpansion[RowIndex][(RoundIndex*((UINT) AES_STATE_COLUMNS)) + ColumnIndex];
-
- /*
- * 4. Transfer the state block to plain block
- */
- for (RowIndex = 0; RowIndex < AES_STATE_ROWS;RowIndex++)
- for (ColumnIndex = 0; ColumnIndex < AES_STATE_COLUMNS;ColumnIndex++)
- PlainBlock[RowIndex + 4*ColumnIndex] = aes_ctx.State[RowIndex][ColumnIndex];
-
- *PlainBlockSize = ((UINT) AES_STATE_ROWS)*((UINT) AES_STATE_COLUMNS);
-} /* End of AES_Decrypt */
-
-
-/*
-========================================================================
-Routine Description:
- AES-CBC encryption
-
-Arguments:
- PlainText Plain text
- PlainTextLength The length of plain text in bytes
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- IV Initialization vector, it may be 16 bytes (128 bits)
- IVLength The length of initialization vector in bytes
- CipherTextLength The length of allocated cipher text in bytes
-
-Return Value:
- CipherText Return cipher text
- CipherTextLength Return the length of real used cipher text in bytes
-
-Note:
- Reference to RFC 3602 and NIST 800-38A
-========================================================================
-*/
-VOID AES_CBC_Encrypt (
- IN UINT8 PlainText[],
- IN UINT PlainTextLength,
- IN UINT8 Key[],
- IN UINT KeyLength,
- IN UINT8 IV[],
- IN UINT IVLength,
- OUT UINT8 CipherText[],
- INOUT UINT *CipherTextLength)
-{
- UINT PaddingSize, PlainBlockStart, CipherBlockStart, CipherBlockSize;
- UINT Index;
- UINT8 Block[AES_BLOCK_SIZES];
-
- /*
- * 1. Check the input parameters
- * - CipherTextLength > (PlainTextLength + Padding size), Padding size = block size - (PlainTextLength % block size)
- * - Key length must be 16, 24, or 32 bytes(128, 192, or 256 bits)
- * - IV length must be 16 bytes(128 bits)
- */
- PaddingSize = ((UINT) AES_BLOCK_SIZES) - (PlainTextLength % ((UINT)AES_BLOCK_SIZES));
- if (*CipherTextLength < (PlainTextLength + PaddingSize)) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Encrypt: cipher text length is %d bytes < (plain text length %d bytes + padding size %d bytes).\n",
- *CipherTextLength, PlainTextLength, PaddingSize));
- return;
- } /* End of if */
- if ((KeyLength != AES_KEY128_LENGTH) && (KeyLength != AES_KEY192_LENGTH) && (KeyLength != AES_KEY256_LENGTH)) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Encrypt: key length is %d bytes, it must be %d, %d, or %d bytes(128, 192, or 256 bits).\n",
- KeyLength, AES_KEY128_LENGTH, AES_KEY192_LENGTH, AES_KEY256_LENGTH));
- return;
- } /* End of if */
- if (IVLength != AES_CBC_IV_LENGTH) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Encrypt: IV length is %d bytes, it must be %d bytes(128bits).\n",
- IVLength, AES_CBC_IV_LENGTH));
- return;
- } /* End of if */
-
-
- /*
- * 2. Main algorithm
- * - Plain text divide into serveral blocks (16 bytes/block)
- * - If plain text is divided with no remainder by block, add a new block and padding size = block(16 bytes)
- * - If plain text is not divided with no remainder by block, padding size = (block - remainder plain text)
- * - Execute AES_Encrypt procedure.
- *
- * - Padding method: The remainder bytes will be filled with padding size (1 byte)
- */
- PlainBlockStart = 0;
- CipherBlockStart = 0;
- while ((PlainTextLength - PlainBlockStart) >= AES_BLOCK_SIZES)
- {
- if (CipherBlockStart == 0) {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Block[Index] = PlainText[PlainBlockStart + Index]^IV[Index];
- } else {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Block[Index] = PlainText[PlainBlockStart + Index]^CipherText[CipherBlockStart - ((UINT) AES_BLOCK_SIZES) + Index];
- } /* End of if */
-
- CipherBlockSize = *CipherTextLength - CipherBlockStart;
- AES_Encrypt(Block, AES_BLOCK_SIZES , Key, KeyLength, CipherText + CipherBlockStart, &CipherBlockSize);
-
- PlainBlockStart += ((UINT) AES_BLOCK_SIZES);
- CipherBlockStart += CipherBlockSize;
- } /* End of while */
-
- NdisMoveMemory(Block, (&PlainText[0] + PlainBlockStart), (PlainTextLength - PlainBlockStart));
- NdisFillMemory((Block + (((UINT) AES_BLOCK_SIZES) -PaddingSize)), PaddingSize, (UINT8) PaddingSize);
- if (CipherBlockStart == 0) {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Block[Index] ^= IV[Index];
- } else {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Block[Index] ^= CipherText[CipherBlockStart - ((UINT) AES_BLOCK_SIZES) + Index];
- } /* End of if */
- CipherBlockSize = *CipherTextLength - CipherBlockStart;
- AES_Encrypt(Block, AES_BLOCK_SIZES , Key, KeyLength, CipherText + CipherBlockStart, &CipherBlockSize);
- CipherBlockStart += CipherBlockSize;
- *CipherTextLength = CipherBlockStart;
-} /* End of AES_CBC_Encrypt */
-
-
-/*
-========================================================================
-Routine Description:
- AES-CBC decryption
-
-Arguments:
- CipherText Cipher text
- CipherTextLength The length of cipher text in bytes
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- IV Initialization vector, it may be 16 bytes (128 bits)
- IVLength The length of initialization vector in bytes
- PlainTextLength The length of allocated plain text in bytes
-
-Return Value:
- PlainText Return plain text
- PlainTextLength Return the length of real used plain text in bytes
-
-Note:
- Reference to RFC 3602 and NIST 800-38A
-========================================================================
-*/
-VOID AES_CBC_Decrypt (
- IN UINT8 CipherText[],
- IN UINT CipherTextLength,
- IN UINT8 Key[],
- IN UINT KeyLength,
- IN UINT8 IV[],
- IN UINT IVLength,
- OUT UINT8 PlainText[],
- INOUT UINT *PlainTextLength)
-{
- UINT PaddingSize, PlainBlockStart, CipherBlockStart, PlainBlockSize;
- UINT Index;
-
- /*
- * 1. Check the input parameters
- * - CipherTextLength must be divided with no remainder by block
- * - Key length must be 16, 24, or 32 bytes(128, 192, or 256 bits)
- * - IV length must be 16 bytes(128 bits)
- */
- if ((CipherTextLength % AES_BLOCK_SIZES) != 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Decrypt: cipher text length is %d bytes, it can't be divided with no remainder by block size(%d).\n",
- CipherTextLength, AES_BLOCK_SIZES));
- return;
- } /* End of if */
- if ((KeyLength != AES_KEY128_LENGTH) && (KeyLength != AES_KEY192_LENGTH) && (KeyLength != AES_KEY256_LENGTH)) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Decrypt: key length is %d bytes, it must be %d, %d, or %d bytes(128, 192, or 256 bits).\n",
- KeyLength, AES_KEY128_LENGTH, AES_KEY192_LENGTH, AES_KEY256_LENGTH));
- return;
- } /* End of if */
- if (IVLength != AES_CBC_IV_LENGTH) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CBC_Decrypt: IV length is %d bytes, it must be %d bytes(128bits).\n",
- IVLength, AES_CBC_IV_LENGTH));
- return;
- } /* End of if */
-
-
- /*
- * 2. Main algorithm
- * - Cypher text divide into serveral blocks (16 bytes/block)
- * - Execute AES_Decrypt procedure.
- * - Remove padding bytes, padding size is the last byte of plain text
- */
- CipherBlockStart = 0;
- PlainBlockStart = 0;
- while ((CipherTextLength - CipherBlockStart) >= AES_BLOCK_SIZES)
- {
- PlainBlockSize = *PlainTextLength - PlainBlockStart;
- AES_Decrypt(CipherText + CipherBlockStart, AES_BLOCK_SIZES , Key, KeyLength, PlainText + PlainBlockStart, &PlainBlockSize);
-
- if (PlainBlockStart == 0) {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- PlainText[PlainBlockStart + Index] ^= IV[Index];
- } else {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- PlainText[PlainBlockStart + Index] ^= CipherText[CipherBlockStart + Index - ((UINT) AES_BLOCK_SIZES)];
- } /* End of if */
-
- CipherBlockStart += AES_BLOCK_SIZES;
- PlainBlockStart += PlainBlockSize;
- } /* End of while */
-
- PaddingSize = (UINT8) PlainText[PlainBlockStart -1];
- *PlainTextLength = PlainBlockStart - PaddingSize;
-
-} /* End of AES_CBC_Encrypt */
-
-
-
-/*
-========================================================================
-Routine Description:
- AES-CMAC generate subkey
-
-Arguments:
- Key Cipher key 128 bits
- KeyLength The length of Cipher key in bytes
-
-Return Value:
- SubKey1 SubKey 1 128 bits
- SubKey2 SubKey 2 128 bits
-
-Note:
- Reference to RFC 4493
-
- Step 1. L := AES-128(K, const_Zero);
- Step 2. if MSB(L) is equal to 0
- then K1 := L << 1;
- else K1 := (L << 1) XOR const_Rb;
- Step 3. if MSB(K1) is equal to 0
- then K2 := K1 << 1;
- else K2 := (K1 << 1) XOR const_Rb;
- Step 4. return K1, K2;
-========================================================================
-*/
-VOID AES_CMAC_GenerateSubKey (
- IN UINT8 Key[],
- IN UINT KeyLength,
- OUT UINT8 SubKey1[],
- OUT UINT8 SubKey2[])
-{
- UINT8 MSB_L = 0, MSB_K1 = 0, Top_Bit = 0;
- UINT SubKey1_Length = 0;
- INT Index = 0;
-
- if (KeyLength != AES_KEY128_LENGTH) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CMAC_GenerateSubKey: key length is %d bytes, it must be %d bytes(128 bits).\n",
- KeyLength, AES_KEY128_LENGTH));
- return;
- } /* End of if */
-
- /* Step 1: L := AES-128(K, const_Zero); */
- SubKey1_Length = 16;
- AES_Encrypt(Const_Zero, sizeof(Const_Zero), Key, KeyLength, SubKey1, &SubKey1_Length);
-
- /*
- * Step 2. if MSB(L) is equal to 0
- * then K1 := L << 1;
- * else K1 := (L << 1) XOR const_Rb;
- */
- MSB_L = SubKey1[0] & 0x80;
- for(Index = 0; Index < 15; Index++) {
- Top_Bit = (SubKey1[Index + 1] & 0x80)?1:0;
- SubKey1[Index] <<= 1;
- SubKey1[Index] |= Top_Bit;
- }
- SubKey1[15] <<= 1;
- if (MSB_L > 0) {
- for(Index = 0; Index < 16; Index++)
- SubKey1[Index] ^= Const_Rb[Index];
- } /* End of if */
-
- /*
- * Step 3. if MSB(K1) is equal to 0
- * then K2 := K1 << 1;
- * else K2 := (K1 << 1) XOR const_Rb;
- */
- MSB_K1 = SubKey1[0] & 0x80;
- for(Index = 0; Index < 15; Index++) {
- Top_Bit = (SubKey1[Index + 1] & 0x80)?1:0;
- SubKey2[Index] = SubKey1[Index] << 1;
- SubKey2[Index] |= Top_Bit;
- }
- SubKey2[15] = SubKey1[15] << 1;
- if (MSB_K1 > 0) {
- for(Index = 0; Index < 16; Index++)
- SubKey2[Index] ^= Const_Rb[Index];
- } /* End of if */
-} /* End of AES_CMAC_GenerateSubKey */
-
-
-/*
-========================================================================
-Routine Description:
- AES-CMAC
-
-Arguments:
- PlainText Plain text
- PlainTextLength The length of plain text in bytes
- Key Cipher key, it may be 16, 24, or 32 bytes (128, 192, or 256 bits)
- KeyLength The length of cipher key in bytes
- MACTextLength The length of allocated memory spaces in bytes
-
-Return Value:
- MACText Message authentication code (128-bit string)
- MACTextLength Return the length of Message authentication code in bytes
-
-Note:
- Reference to RFC 4493
-========================================================================
-*/
-VOID AES_CMAC (
- IN UINT8 PlainText[],
- IN UINT PlainTextLength,
- IN UINT8 Key[],
- IN UINT KeyLength,
- OUT UINT8 MACText[],
- INOUT UINT *MACTextLength)
-{
- UINT PlainBlockStart;
- UINT8 X[AES_BLOCK_SIZES], Y[AES_BLOCK_SIZES];
- UINT8 SubKey1[16];
- UINT8 SubKey2[16];
- INT X_Length, Index;
-
- if (*MACTextLength < AES_MAC_LENGTH) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CMAC: MAC text length is less than %d bytes).\n",
- AES_MAC_LENGTH));
- return;
- } /* End of if */
- if (KeyLength != AES_KEY128_LENGTH) {
- DBGPRINT(RT_DEBUG_ERROR, ("AES_CMAC: key length is %d bytes, it must be %d bytes(128 bits).\n",
- KeyLength, AES_KEY128_LENGTH));
- return;
- } /* End of if */
-
- /* Step 1. (K1,K2) := Generate_Subkey(K); */
- NdisZeroMemory(SubKey1, 16);
- NdisZeroMemory(SubKey2, 16);
- AES_CMAC_GenerateSubKey(Key, KeyLength, SubKey1, SubKey2);
-
- /*
- * 2. Main algorithm
- * - Plain text divide into serveral blocks (16 bytes/block)
- * - If plain text is not divided with no remainder by block, padding size = (block - remainder plain text)
- * - Execute AES_Encrypt procedure.
- */
- PlainBlockStart = 0;
- NdisMoveMemory(X, Const_Zero, AES_BLOCK_SIZES);
- while ((PlainTextLength - PlainBlockStart) > AES_BLOCK_SIZES)
- {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Y[Index] = PlainText[PlainBlockStart + Index]^X[Index];
-
- X_Length = sizeof(X);
- AES_Encrypt(Y, sizeof(Y) , Key, KeyLength, X, &X_Length);
- PlainBlockStart += ((UINT) AES_BLOCK_SIZES);
- } /* End of while */
- if ((PlainTextLength - PlainBlockStart) == AES_BLOCK_SIZES) {
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Y[Index] = PlainText[PlainBlockStart + Index]^X[Index]^SubKey1[Index];
- } else {
- NdisZeroMemory(Y, AES_BLOCK_SIZES);
- NdisMoveMemory(Y, &PlainText[PlainBlockStart], (PlainTextLength - PlainBlockStart));
- Y[(PlainTextLength - PlainBlockStart)] = 0x80;
- for (Index = 0; Index < AES_BLOCK_SIZES; Index++)
- Y[Index] = Y[Index]^X[Index]^SubKey2[Index];
- } /* End of if */
- AES_Encrypt(Y, sizeof(Y) , Key, KeyLength, MACText, MACTextLength);
-} /* End of AES_CMAC */
diff --git a/drivers/staging/rt3090/common/crypt_biginteger.c b/drivers/staging/rt3090/common/crypt_biginteger.c
deleted file mode 100644
index b346c5f7fbd0..000000000000
--- a/drivers/staging/rt3090/common/crypt_biginteger.c
+++ /dev/null
@@ -1,1119 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- cmm_profile.c
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
-
-#include "crypt_biginteger.h"
-
-#ifdef __KERNEL__
-#define DEBUGPRINT(fmt, args...) printk(KERN_ERR fmt, ## args)
-#else
-#define DEBUGPRINT(fmt, args...) printf(fmt, ## args)
-#endif /* __KERNEL__ */
-
-#define UINT32_HBITS(value) (((value) >> 0x10) & 0xffff)
-#define UINT32_LBITS(value) ((value) & 0xffff)
-#define UINT32_GETBYTE(value, index) (((value) >> ((index)*8)) & 0xff)
-#define UINT64_HBITS(value) (((value) >> 0x20) & 0xffffffff)
-#define UINT64_LBITS(value) ((value) & 0xffffffff)
-
-static UINT8 WPS_DH_P_VALUE[192] =
-{
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 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, 0x73, 0x27,
- 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
-};
-
-static UINT8 WPS_DH_R_VALUE[193] =
-{
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00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f8, 0x8f, 0x69, 0x69, 0x92,
- 0x98, 0xf3, 0xca, 0xb1, 0xb5, 0x43, 0x67, 0xfb,
- 0x0e, 0x8b, 0x93, 0xf7, 0x35, 0xdc, 0x8c, 0xd8,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
-};
-
-static UINT8 WPS_DH_RRModP_VALUE[192] =
-{
- 0xe3, 0xb3, 0x3c, 0x72, 0x59, 0x54, 0x1c, 0x01,
- 0xee, 0x9c, 0x9a, 0x21, 0x6c, 0xc1, 0xeb, 0xd2,
- 0xae, 0x59, 0x41, 0x04, 0x79, 0x29, 0xa1, 0xc7,
- 0xe9, 0xc3, 0xfa, 0x02, 0xcc, 0x24, 0x56, 0xef,
- 0x10, 0x26, 0x30, 0xfa, 0x9a, 0x36, 0xa5, 0x1f,
- 0x57, 0xb5, 0x93, 0x48, 0x67, 0x98, 0x44, 0x60,
- 0x0b, 0xe4, 0x96, 0x47, 0xa8, 0x7c, 0x7b, 0x37,
- 0xf8, 0x05, 0x65, 0x64, 0x96, 0x9b, 0x7f, 0x02,
- 0xdc, 0x54, 0x1a, 0x4e, 0xd4, 0x05, 0x3f, 0x54,
- 0xd6, 0x2a, 0x0e, 0xea, 0xb2, 0x70, 0x52, 0x1b,
- 0x22, 0xc2, 0x96, 0xe9, 0xd4, 0x6f, 0xec, 0x23,
- 0x8e, 0x1a, 0xbd, 0x78, 0x02, 0x23, 0xb7, 0x6b,
- 0xb8, 0xfe, 0x61, 0x21, 0x19, 0x6b, 0x7e, 0x88,
- 0x1c, 0x72, 0x9c, 0x7e, 0x04, 0xb9, 0xf7, 0x96,
- 0x07, 0xcd, 0x0a, 0x62, 0x8e, 0x43, 0x41, 0x30,
- 0x04, 0xa5, 0x41, 0xff, 0x93, 0xae, 0x1c, 0xeb,
- 0xb0, 0x04, 0xa7, 0x50, 0xdb, 0x10, 0x2d, 0x39,
- 0xb9, 0x05, 0x2b, 0xb4, 0x7a, 0x58, 0xf1, 0x70,
- 0x7e, 0x8c, 0xd2, 0xac, 0x98, 0xb5, 0xfb, 0x62,
- 0x8f, 0x23, 0x31, 0xb1, 0x3b, 0x01, 0xe0, 0x18,
- 0xf4, 0x66, 0xee, 0x5f, 0xbc, 0xd4, 0x9d, 0x68,
- 0xd0, 0xab, 0x92, 0xe1, 0x83, 0x97, 0xf2, 0x45,
- 0x8e, 0x0e, 0x3e, 0x21, 0x67, 0x47, 0x8c, 0x73,
- 0xf1, 0x15, 0xd2, 0x7d, 0x32, 0xc6, 0x95, 0xe0,
-};
-
-static UINT8 Value_0[1] = {0x00};
-static UINT8 Value_1[1] = {0x01};
-static PBIG_INTEGER pBI_U = NULL, pBI_S = NULL, pBI_O = NULL;
-static UINT Bits_Of_R = 0;
-
-
-VOID BigInteger_Print (
- IN PBIG_INTEGER pBI)
-{
- int i = 0, j = 0;
-
- if ((pBI == NULL) || (pBI->pIntegerArray == NULL))
- return;
-
- if (strlen(pBI->Name) != 0)
- DEBUGPRINT("Name=%s\n", pBI->Name);
- DEBUGPRINT("AllocSize=%d, ArrayLength=%d, IntegerLength=%d, Signed=%d\n", pBI->AllocSize, pBI->ArrayLength, pBI->IntegerLength, pBI->Signed);
- for (i = (pBI->ArrayLength - 1), j = 0;i >=0;i--,j++) {
- DEBUGPRINT("%08x, ", pBI->pIntegerArray[i]);
- if ((j%8) == 7)
- DEBUGPRINT("\n");
- } /* End od for */
- DEBUGPRINT("\n\n");
-} /* End of BigInteger_Print */
-
-
-VOID BigInteger_Init (
- INOUT PBIG_INTEGER *pBI)
-{
- if (*pBI != NULL)
- BigInteger_Free(pBI);
-
- if ((*pBI = (PBIG_INTEGER) kmalloc(sizeof(BIG_INTEGER), GFP_ATOMIC)) == NULL) {
- DEBUGPRINT("BigInteger_Init: allocate %d bytes memory failure.\n", (sizeof(BIG_INTEGER)));
- return;
- } /* End of if */
-
- NdisZeroMemory(*pBI, sizeof(BIG_INTEGER));
- (*pBI)->pIntegerArray = NULL;
- (*pBI)->Signed = 1;
-} /* End of BigInteger_Init */
-
-
-VOID BigInteger_Free_AllocSize (
- IN PBIG_INTEGER *pBI)
-{
- if ((*pBI != NULL) && ((*pBI)->pIntegerArray != NULL)) {
- kfree((*pBI)->pIntegerArray);
- NdisZeroMemory(*pBI, sizeof(BIG_INTEGER));
- (*pBI)->pIntegerArray = NULL;
- (*pBI)->Signed = 1;
- } /* End of if */
-} /* End of BigInteger_Free_AllocSize */
-
-
-VOID BigInteger_Free (
- IN PBIG_INTEGER *pBI)
-{
- if (*pBI != NULL) {
- BigInteger_Free_AllocSize(pBI);
- kfree(*pBI);
- } /* End of if */
-
- *pBI = NULL;
-} /* End of BigInteger_Free */
-
-
-VOID BigInteger_AllocSize (
- IN PBIG_INTEGER *pBI,
- IN UINT Length)
-{
- UINT ArrayLength = 0;
-
- if (Length == 0)
- return;
-
- if (*pBI == NULL)
- BigInteger_Init(pBI);
-
- /* Caculate array size */
- ArrayLength = Length >> 0x2;
- if ((Length & 0x3) != 0)
- ArrayLength++;
-
- if (((*pBI)->pIntegerArray != NULL) && ((*pBI)->AllocSize < (sizeof(UINT32)*ArrayLength)))
- BigInteger_Free_AllocSize(pBI);
-
- if ((*pBI)->pIntegerArray == NULL) {
- if (((*pBI)->pIntegerArray = (UINT32 *) kmalloc(sizeof(UINT32)*ArrayLength, GFP_ATOMIC)) == NULL) {
- DEBUGPRINT("BigInteger_AllocSize: allocate %d bytes memory failure.\n", (sizeof(UINT32)*ArrayLength));
- return;
- } /* End of if */
- (*pBI)->AllocSize = sizeof(UINT32)*ArrayLength;
- } /* End of if */
-
- NdisZeroMemory((*pBI)->pIntegerArray, (*pBI)->AllocSize);
- (*pBI)->ArrayLength = ArrayLength;
- (*pBI)->IntegerLength = Length;
-} /* End of BigInteger_AllocSize */
-
-
-VOID BigInteger_ClearHighBits (
- IN PBIG_INTEGER pBI)
-{
- INT BIArrayIndex, ShiftIndex = 0;
- UINT8 value;
-
- if ((pBI == NULL) || (pBI->pIntegerArray == NULL))
- return;
-
- BIArrayIndex = pBI->ArrayLength - 1;
- while ((BIArrayIndex >= 0) && (pBI->pIntegerArray[BIArrayIndex] == 0))
- BIArrayIndex--;
-
- if (BIArrayIndex >= 0) {
- value = 0;
- ShiftIndex = 4;
- while (value == 0) {
- ShiftIndex--;
- value = UINT32_GETBYTE(pBI->pIntegerArray[BIArrayIndex], ShiftIndex);
- } /* End of while */
- } /* End of if */
-
- if ((BIArrayIndex == -1) && (ShiftIndex == -1)) {
- pBI->IntegerLength = 1;
- pBI->ArrayLength = 1;
- pBI->Signed = 1;
- } else {
- pBI->IntegerLength = (BIArrayIndex*4) + ShiftIndex + 1;
- pBI->ArrayLength = BIArrayIndex + 1;
- } /* End of if */
-} /* End of BigInteger_ClearHighBits */
-
-
-VOID BigInteger_BI2Bin (
- IN PBIG_INTEGER pBI,
- OUT UINT8 *pValue,
- OUT UINT *Length)
-{
- INT ValueIndex, BIArrayIndex, ShiftIndex;
- UINT32 Number;
-
- if (pBI == NULL) {
- DEBUGPRINT("BigInteger_BI2Bin: pBI is NUll\n");
- *Length = 0;
- return;
- } /* End of if */
-
- if (*Length < (sizeof(UINT8) * pBI->IntegerLength)) {
- DEBUGPRINT("BigInteger_BI2Bin: length(%d) is not enough.\n", *Length);
- *Length = 0;
- return;
- } /* End of if */
-
- if (pBI->pIntegerArray == NULL) {
- *Length = 0;
- return;
- } /* End of if */
-
- BigInteger_ClearHighBits(pBI);
- if ((ShiftIndex = pBI->IntegerLength & 0x3) == 0)
- ShiftIndex = 4;
- BIArrayIndex = pBI->ArrayLength - 1;
- ValueIndex = 0;
-
- Number = pBI->pIntegerArray[BIArrayIndex];
- while (ValueIndex < pBI->IntegerLength)
- {
- pValue[ValueIndex++] = (UINT8) UINT32_GETBYTE(Number, ShiftIndex - 1);
- if ((--ShiftIndex) == 0) {
- ShiftIndex = 4;
- BIArrayIndex--;
- Number = pBI->pIntegerArray[BIArrayIndex];
- } /* End of if */
- } /* End of while */
- *Length = pBI->IntegerLength;
-} /* End of BigInteger_BI2Bin */
-
-
-VOID BigInteger_Bin2BI (
- IN UINT8 *pValue,
- IN UINT Length,
- OUT PBIG_INTEGER *pBI)
-{
- INT ValueIndex, BIArrayIndex, ShiftIndex;
- UINT32 Number;
-
- BigInteger_AllocSize(pBI, Length);
-
- if ((*pBI)->pIntegerArray != NULL) {
- Number = 0;
- if ((ShiftIndex = Length & 0x3) == 0)
- ShiftIndex = 4;
- BIArrayIndex = (*pBI)->ArrayLength - 1;
- ValueIndex = 0;
- while (ValueIndex < Length)
- {
- Number = (Number << 8) | (UINT8) pValue[ValueIndex++];
- if ((--ShiftIndex) == 0) {
- (*pBI)->pIntegerArray[BIArrayIndex] = Number;
- ShiftIndex = 4;
- BIArrayIndex--;
- Number = 0;
- } /* End of if */
- } /* End of while */
- } /* End of if */
-} /* End of BigInteger_Bin2BI */
-
-
-/* Calculate the bits of BigInteger, the highest bit is 1 */
-VOID BigInteger_BitsOfBI (
- IN PBIG_INTEGER pBI,
- OUT UINT *Bits_Of_P)
-{
- UINT32 Number, Index;
-
- Number = pBI->pIntegerArray[pBI->ArrayLength - 1];
- Index = 0;
- while ((!(Number & 0x80000000)) && (Index < 32)) {
- Number <<= 1;
- Index++;
- } /* End of while */
- *Bits_Of_P = (pBI->ArrayLength*sizeof(UINT32)) - Index;
-} /* End of BigInteger_BitsOfBN */
-
-
-INT BigInteger_GetBitValue (
- IN PBIG_INTEGER pBI,
- IN UINT Index)
-{
- UINT Array = 0;
- UINT Shift = 0;
-
- if (Index > 0) {
- Array = (Index - 1) >> 0x5;
- Shift = (Index - 1) & 0x1F;
- }
- if (Array > pBI->ArrayLength)
- return 0;
-
- return ((pBI->pIntegerArray[Array] >> Shift) & 0x1);
-} /* End of BigInteger_GetBitValue */
-
-
-UINT8 BigInteger_GetByteValue (
- IN PBIG_INTEGER pBI,
- IN UINT Index)
-{
- UINT Array = 0;
- UINT Shift = 0;
-
- if (Index > 0) {
- Array = (Index - 1) >> 0x2;
- Shift = (Index - 1) & 0x3;
- }
- if ((Array > pBI->ArrayLength) || (Index > pBI->IntegerLength))
- return 0;
-
-
- return (UINT8) UINT32_GETBYTE(pBI->pIntegerArray[Array], Shift - 1);
-} /* End of BigInteger_GetByteValue */
-
-
-VOID BigInteger_Copy (
- IN PBIG_INTEGER pBI_Copied,
- OUT PBIG_INTEGER *pBI_Result)
-{
- BigInteger_AllocSize(pBI_Result, pBI_Copied->IntegerLength);
- NdisCopyMemory((*pBI_Result)->pIntegerArray, pBI_Copied->pIntegerArray, (sizeof(UINT32)*(*pBI_Result)->ArrayLength));
- (*pBI_Result)->ArrayLength = pBI_Copied->ArrayLength;
- (*pBI_Result)->IntegerLength = pBI_Copied->IntegerLength;
- (*pBI_Result)->Signed = pBI_Copied->Signed;
-} /* End of BigInteger_Copy */
-
-
-INT BigInteger_UnsignedCompare (
- IN PBIG_INTEGER pFirstOperand,
- IN PBIG_INTEGER pSecondOperand)
-{
- INT BIArrayIndex;
-
- if (pFirstOperand->IntegerLength > pSecondOperand->IntegerLength)
- return 1;
-
- if (pFirstOperand->IntegerLength < pSecondOperand->IntegerLength)
- return -1;
-
- if (pFirstOperand->IntegerLength == pSecondOperand->IntegerLength) {
- for(BIArrayIndex = (pFirstOperand->ArrayLength - 1);BIArrayIndex >= 0 ; BIArrayIndex--)
- {
- if (pFirstOperand->pIntegerArray[BIArrayIndex] > pSecondOperand->pIntegerArray[BIArrayIndex])
- return 1;
- else if (pFirstOperand->pIntegerArray[BIArrayIndex] < pSecondOperand->pIntegerArray[BIArrayIndex])
- return -1;
- } /* End of for */
- } /* End of if */
-
- return 0;
-} /* End of BigInteger_Compare */
-
-
-VOID BigInteger_Add (
- IN PBIG_INTEGER pFirstOperand,
- IN PBIG_INTEGER pSecondOperand,
- OUT PBIG_INTEGER *pBI_Result)
-{
- INT CompareResult;
- UINT32 BIArrayIndex;
- UINT64 Sum, Carry;
- PBIG_INTEGER pTempBI = NULL;
-
- if ((pFirstOperand == NULL) || (pFirstOperand->pIntegerArray == NULL)
- || (pSecondOperand == NULL) || (pSecondOperand->pIntegerArray == NULL)) {
- DEBUGPRINT("BigInteger_Add: first or second operand is NULL.\n");
- return;
- } /* End of if */
-
- if (*pBI_Result == NULL)
- BigInteger_Init(pBI_Result);
-
- CompareResult = BigInteger_UnsignedCompare(pFirstOperand, pSecondOperand);
- if ((CompareResult == 0) & ((pFirstOperand->Signed * pSecondOperand->Signed) < 0)) {
- BigInteger_AllocSize(pBI_Result, 1);
- return ;
- } /* End of if */
-
- /*
- * Singed table
- * A + B || A > B || A < B
- * ------------------------
- * + + || + || +
- * + - || + || -
- * - + || - || +
- * - - || - || -
- */
- if ((pFirstOperand->Signed * pSecondOperand->Signed) > 0) {
- if (pFirstOperand->IntegerLength > pSecondOperand->IntegerLength) {
- BigInteger_AllocSize(pBI_Result, pFirstOperand->IntegerLength + 1);
- } else {
- BigInteger_AllocSize(pBI_Result, pSecondOperand->IntegerLength + 1);
- } /* End of if */
-
- Carry = 0;
- for (BIArrayIndex=0; BIArrayIndex < (*pBI_Result)->ArrayLength; BIArrayIndex++)
- {
-
- Sum = 0;
- if (BIArrayIndex < pFirstOperand->ArrayLength)
- Sum += (UINT64) pFirstOperand->pIntegerArray[BIArrayIndex];
-
- if (BIArrayIndex < pSecondOperand->ArrayLength)
- Sum += (UINT64) pSecondOperand->pIntegerArray[BIArrayIndex];
-
- Sum += Carry;
- Carry = Sum >> 32;
- (*pBI_Result)->pIntegerArray[BIArrayIndex] = (UINT32) (Sum & 0xffffffffUL);
- } /* End of for */
- (*pBI_Result)->Signed = pFirstOperand->Signed;
- BigInteger_ClearHighBits(*pBI_Result);
- } else {
- if ((pFirstOperand->Signed == 1) & (pSecondOperand->Signed == -1)) {
- BigInteger_Copy(pSecondOperand, &pTempBI);
- pTempBI->Signed = 1;
- BigInteger_Sub(pFirstOperand, pTempBI, pBI_Result);
- } else if ((pFirstOperand->Signed == -1) & (pSecondOperand->Signed == 1)) {
- BigInteger_Copy(pFirstOperand, &pTempBI);
- pTempBI->Signed = 1;
- BigInteger_Sub(pSecondOperand, pTempBI, pBI_Result);
- } /* End of if */
- } /* End of if */
-
- BigInteger_Free(&pTempBI);
-} /* End of BigInteger_Add */
-
-
-VOID BigInteger_Sub (
- IN PBIG_INTEGER pFirstOperand,
- IN PBIG_INTEGER pSecondOperand,
- OUT PBIG_INTEGER *pBI_Result)
-{
- INT CompareResult;
- UINT32 BIArrayIndex, Carry;
- PBIG_INTEGER pTempBI = NULL, pTempBI2 = NULL;
-
- if ((pFirstOperand == NULL) || (pFirstOperand->pIntegerArray == NULL)
- || (pSecondOperand == NULL) || (pSecondOperand->pIntegerArray == NULL)) {
- DEBUGPRINT("BigInteger_Sub: first or second operand is NULL.\n");
- return;
- } /* End of if */
-
- if (*pBI_Result == NULL)
- BigInteger_Init(pBI_Result);
-
- CompareResult = BigInteger_UnsignedCompare(pFirstOperand, pSecondOperand);
- if ((CompareResult == 0) & ((pFirstOperand->Signed * pSecondOperand->Signed) > 0)) {
- BigInteger_AllocSize(pBI_Result, 1);
- return ;
- } /* End of if */
-
- BigInteger_Init(&pTempBI);
- BigInteger_Init(&pTempBI2);
-
- /*
- * Singed table
- * A - B || A > B || A < B
- * ------------------------
- * + + || + || -
- * + - || + || +
- * - + || - || -
- * - - || - || +
- */
- if ((pFirstOperand->Signed * pSecondOperand->Signed) > 0) {
- if (CompareResult == 1) {
- BigInteger_Copy(pFirstOperand, &pTempBI);
- BigInteger_Copy(pSecondOperand, &pTempBI2);
- } else if (CompareResult == -1) {
- BigInteger_Copy(pSecondOperand, &pTempBI);
- BigInteger_Copy(pFirstOperand, &pTempBI2);
- } /* End of if */
-
- BigInteger_Copy(pTempBI, pBI_Result);
- Carry = 0;
- for (BIArrayIndex=0; BIArrayIndex < (*pBI_Result)->ArrayLength; BIArrayIndex++)
- {
- if (BIArrayIndex < pTempBI2->ArrayLength) {
- if ((*pBI_Result)->pIntegerArray[BIArrayIndex] >= (pTempBI2->pIntegerArray[BIArrayIndex] - Carry)) {
- (*pBI_Result)->pIntegerArray[BIArrayIndex] = (*pBI_Result)->pIntegerArray[BIArrayIndex] - pTempBI2->pIntegerArray[BIArrayIndex] - Carry;
- Carry = 0;
- } else {
- (*pBI_Result)->pIntegerArray[BIArrayIndex] = 0xffffffffUL - pTempBI2->pIntegerArray[BIArrayIndex] - Carry + (*pBI_Result)->pIntegerArray[BIArrayIndex] + 1;
- Carry = 1;
- } /* End of if */
- } else {
- if ((*pBI_Result)->pIntegerArray[BIArrayIndex] >= Carry) {
- (*pBI_Result)->pIntegerArray[BIArrayIndex] -= Carry;
- Carry = 0;
- } else {
- (*pBI_Result)->pIntegerArray[BIArrayIndex] = 0xffffffffUL - Carry;
- Carry = 1;
- } /* End of if */
- } /* End of if */
- } /* End of for */
-
- if (((pFirstOperand->Signed == 1) & (pSecondOperand->Signed == 1) & (CompareResult == -1))
- || ((pFirstOperand->Signed == -1) & (pSecondOperand->Signed == -1) & (CompareResult == 1)))
- (*pBI_Result)->Signed = -1;
-
- BigInteger_ClearHighBits(*pBI_Result);
- } else {
- if ((pFirstOperand->Signed == 1) & (pSecondOperand->Signed == -1)) {
- BigInteger_Copy(pSecondOperand, &pTempBI);
- pTempBI->Signed = 1;
- BigInteger_Add(pFirstOperand, pTempBI, pBI_Result);
- } else if ((pFirstOperand->Signed == -1) & (pSecondOperand->Signed == 1)) {
- BigInteger_Copy(pFirstOperand, &pTempBI);
- pTempBI->Signed = 1;
- BigInteger_Add(pTempBI, pSecondOperand, pBI_Result);
- (*pBI_Result)->Signed = -1;
- } /* End of if */
- } /* End of if */
-
- BigInteger_Free(&pTempBI);
- BigInteger_Free(&pTempBI2);
-} /* End of BigInteger_Sub */
-
-
-VOID BigInteger_Mul (
- IN PBIG_INTEGER pFirstOperand,
- IN PBIG_INTEGER pSecondOperand,
- OUT PBIG_INTEGER *pBI_Result)
-{
-
- UINT32 BIFirstIndex, BISecondIndex;
- UINT64 FirstValue, SecondValue, Sum, Carry;
-
- if ((pFirstOperand == NULL) || (pFirstOperand->pIntegerArray == NULL)
- || (pSecondOperand == NULL) || (pSecondOperand->pIntegerArray == NULL)) {
- DEBUGPRINT("BigInteger_Mul: first or second operand is NULL.\n");
- return;
- } /* End of if */
-
- /* The first or second operand is zero */
- if (((pFirstOperand->IntegerLength == 1) && (pFirstOperand->pIntegerArray[0] == 0))
- ||((pSecondOperand->IntegerLength == 1) && (pSecondOperand->pIntegerArray[0] == 0))) {
- BigInteger_AllocSize(pBI_Result, 1);
- goto output;
- } /* End of if */
-
- /* The first or second operand is one */
- if ((pFirstOperand->IntegerLength == 1) && (pFirstOperand->pIntegerArray[0] == 1)) {
- BigInteger_Copy(pSecondOperand, pBI_Result);
- goto output;
- } /* End of if */
- if ((pSecondOperand->IntegerLength == 1) && (pSecondOperand->pIntegerArray[0] == 1)) {
- BigInteger_Copy(pFirstOperand, pBI_Result);
- goto output;
- } /* End of if */
-
- BigInteger_AllocSize(pBI_Result, pFirstOperand->IntegerLength + pSecondOperand->IntegerLength);
-
- for (BIFirstIndex=0; BIFirstIndex < pFirstOperand->ArrayLength; BIFirstIndex++)
- {
- Carry = 0;
- FirstValue = (UINT64) pFirstOperand->pIntegerArray[BIFirstIndex];
- if (FirstValue == 0) {
- continue;
- } else {
- for (BISecondIndex=0; BISecondIndex < pSecondOperand->ArrayLength; BISecondIndex++)
- {
- SecondValue = ((UINT64) pSecondOperand->pIntegerArray[BISecondIndex])*FirstValue;
- Sum = (UINT64) ((*pBI_Result)->pIntegerArray[BIFirstIndex + BISecondIndex] + SecondValue + Carry);
- Carry = Sum >> 32;
- (*pBI_Result)->pIntegerArray[BIFirstIndex + BISecondIndex] = (UINT32) (Sum & 0xffffffffUL);
- } /* End of for */
- while (Carry != 0) {
- Sum = (UINT64) (*pBI_Result)->pIntegerArray[BIFirstIndex + BISecondIndex];
- Sum += Carry;
-
- Carry = Sum >> 32;
- (*pBI_Result)->pIntegerArray[BIFirstIndex + BISecondIndex] = (UINT32) (Sum & 0xffffffffUL);
- BISecondIndex++;
- } /* End of while */
- } /* End of if */
- } /* End of for */
-
-output:
- (*pBI_Result)->Signed = pFirstOperand->Signed * pSecondOperand->Signed;
- BigInteger_ClearHighBits(*pBI_Result);
-} /* End of BigInteger_Mul */
-
-
-VOID BigInteger_Square (
- IN PBIG_INTEGER pBI,
- OUT PBIG_INTEGER *pBI_Result)
-{
- INT BIFirstIndex, BISecondIndex;
- UINT32 HBITS_Value, LBITS_Value, Temp1_Value, Temp2_Value, Carry32;
- UINT32 *Point_Of_S, *Point_Of_Result, *Point_Of_BI;
- UINT64 Result64_1, Result64_2, Carry64, TempValue64;
-
- if ((pBI == NULL) || (pBI->pIntegerArray == NULL)) {
- DEBUGPRINT("\tBigInteger_Square: the operand is NULL.\n");
- return;
- } /* End of if */
-
- /* The operand is zero */
- if ((pBI->IntegerLength == 1) && (pBI->pIntegerArray[0] == 0)) {
- BigInteger_AllocSize(pBI_Result, 1);
- goto output;
- } /* End of if */
-
- BigInteger_AllocSize(pBI_Result, (pBI->IntegerLength*2) + 20);
- BigInteger_AllocSize(&pBI_S, (pBI->IntegerLength*2) + 20);
- BigInteger_AllocSize(&pBI_O, (pBI->IntegerLength*2) + 20);
-
- /*
- * Input: pBI = {a_0, a_1, a_2, a_3, ..., a_n}
- * Step1. calculate a_0^2, a_1^2, a_2^2, a_3^2 ... a_n^2
- */
- Point_Of_S = pBI_S->pIntegerArray;
- for (BIFirstIndex=0; BIFirstIndex < pBI->ArrayLength; BIFirstIndex++)
- {
- HBITS_Value = UINT32_HBITS(pBI->pIntegerArray[BIFirstIndex]);
- LBITS_Value = UINT32_LBITS(pBI->pIntegerArray[BIFirstIndex]);
- Temp1_Value = HBITS_Value*LBITS_Value;
- Temp2_Value = (Temp1_Value & 0x7fff) << 0x11;
- Point_Of_S[0] = (LBITS_Value*LBITS_Value) + Temp2_Value;
- Point_Of_S[1] = (HBITS_Value*HBITS_Value) + ((Temp1_Value >> 0xf) & 0x1ffff);
- if (Point_Of_S[0] < Temp2_Value)
- Point_Of_S[1] += 1;
-
- Point_Of_S += 2;
- } /* End of for */
-
- /*
- * Step2. calculate a_0*{a_1, a_2, a_3, a_4, ..., a_n}
- */
- Point_Of_BI = pBI->pIntegerArray;
- Point_Of_Result = (*pBI_Result)->pIntegerArray;
- Point_Of_Result[0] = 0;
- TempValue64 = (UINT64) Point_Of_BI[0];
- Point_Of_Result++;
- Carry64 = 0;
- for (BIFirstIndex=1; BIFirstIndex < pBI->ArrayLength; BIFirstIndex++)
- {
- Result64_1 = (UINT64) Point_Of_BI[BIFirstIndex]*TempValue64;
- Result64_1 += Carry64;
- Carry64 = (Result64_1 >> 32);
- Point_Of_Result[0] = (UINT32) (Result64_1 & 0xffffffffUL);
- Point_Of_Result++;
- } /* End of for */
- if (Carry64 > 0)
- Point_Of_Result[0] = (UINT32) (Carry64 & 0xffffffffUL);
-
- /*
- * Step3. calculate
- * a_1*{a_2, a_3, a_4, ..., a_n}
- * a_2*{a_3, a_4, a_5, ..., a_n}
- * a_3*{a_4, a_5, a_6, ..., a_n}
- * a_4*{a_5, a_6, a_7, ..., a_n}
- * ...
- * a_n-1*{a_n}
- */
- Point_Of_BI = pBI->pIntegerArray;
- for (BIFirstIndex=1; BIFirstIndex < (pBI->ArrayLength - 1); BIFirstIndex++)
- {
- Point_Of_Result = (*pBI_Result)->pIntegerArray;
- Point_Of_Result += (BIFirstIndex*2) + 1;
- TempValue64 = (UINT64) Point_Of_BI[BIFirstIndex];
- Carry64 = 0;
- for (BISecondIndex=(BIFirstIndex + 1); BISecondIndex < pBI->ArrayLength; BISecondIndex++)
- {
- Result64_1 = ((UINT64) Point_Of_Result[0]) + Carry64;
- Result64_2 = (UINT64) Point_Of_BI[BISecondIndex]*TempValue64;
- Carry64 = (Result64_1 >> 32);
- Result64_1 = (Result64_1 & 0xffffffffUL);
- Result64_1 = Result64_1 + Result64_2;
- Carry64 += (Result64_1 >> 32);
- Point_Of_Result[0] = (UINT32) (Result64_1 & 0xffffffffUL);
- Point_Of_Result++;
- } /* End of for */
- if (Carry64 > 0)
- Point_Of_Result[0] += (UINT32) (Carry64 & 0xffffffffUL);
- } /* End of for */
-
- BigInteger_ClearHighBits(*pBI_Result);
- BigInteger_Copy(*pBI_Result, &pBI_O);
-
- Carry32 = 0;
- for (BIFirstIndex=0; BIFirstIndex < pBI_O->ArrayLength; BIFirstIndex++) {
- pBI_O->pIntegerArray[BIFirstIndex] = (pBI_O->pIntegerArray[BIFirstIndex] << 1) | Carry32;
- if (pBI_O->pIntegerArray[BIFirstIndex] < (*pBI_Result)->pIntegerArray[BIFirstIndex])
- Carry32 = 1;
- else
- Carry32 = 0;
- } /* End of for */
- pBI_O->pIntegerArray[BIFirstIndex] = Carry32;
- pBI_O->IntegerLength++;
- pBI_O->ArrayLength++;
- BigInteger_ClearHighBits(pBI_O);
-
- BigInteger_Add(pBI_O, pBI_S, pBI_Result);
-output:
- (*pBI_Result)->Signed = 1;
- BigInteger_ClearHighBits(*pBI_Result);
-} /* End of BigInteger_Square */
-
-
-VOID BigInteger_Div (
- IN PBIG_INTEGER pFirstOperand,
- IN PBIG_INTEGER pSecondOperand,
- OUT PBIG_INTEGER *pBI_Result,
- OUT PBIG_INTEGER *pBI_Remainder)
-{
- INT CompareResult;
- INT Index, MulIndex, ComputeSize;
- UINT32 MulStart;
- UINT AllocLength, ArrayIndex, ShiftIndex;
- PBIG_INTEGER pTempBI = NULL, pTempBI2 = NULL, pMulBI = NULL;
- UINT8 SecondHighByte;
-
- if ((pFirstOperand == NULL) || (pFirstOperand->pIntegerArray == NULL)
- || (pSecondOperand == NULL) || (pSecondOperand->pIntegerArray == NULL)) {
- DEBUGPRINT("BigInteger_Div: first or second operand is NULL.\n");
- return;
- } /* End of if */
-
- /* The second operand is zero */
- if ((pSecondOperand->IntegerLength == 1) && (pSecondOperand->pIntegerArray[0] == 0)) {
- DEBUGPRINT("BigInteger_Div: second operand is zero.\n");
- return;
- } /* End of if */
-
- if (*pBI_Result == NULL)
- BigInteger_Init(pBI_Result);
- if (*pBI_Remainder == NULL)
- BigInteger_Init(pBI_Remainder);
-
- /* The second operand is one */
- if ((pSecondOperand->IntegerLength == 1) && (pSecondOperand->pIntegerArray[0] == 1)) {
- BigInteger_Copy(pFirstOperand, pBI_Result);
- BigInteger_Bin2BI(Value_0, 1, pBI_Remainder);
- goto output;
- } /* End of if */
-
- CompareResult = BigInteger_UnsignedCompare(pFirstOperand, pSecondOperand);
- if (CompareResult == 0) {
- BigInteger_Bin2BI(Value_1, 1, pBI_Result);
- BigInteger_Bin2BI(Value_0, 1, pBI_Remainder);
- goto output;
- } else if (CompareResult == -1) {
- BigInteger_Bin2BI(Value_0, 1, pBI_Result);
- BigInteger_Copy(pFirstOperand, pBI_Remainder);
- goto output;
- } /* End of if */
- BigInteger_AllocSize(pBI_Result, pFirstOperand->IntegerLength - pSecondOperand->IntegerLength + 1);
- BigInteger_AllocSize(pBI_Remainder, pSecondOperand->IntegerLength);
-
- AllocLength = (UINT) (pFirstOperand->IntegerLength << 1);
- BigInteger_AllocSize(&pTempBI, AllocLength);
- BigInteger_AllocSize(&pTempBI2, AllocLength);
- BigInteger_AllocSize(&pMulBI, AllocLength);
-
- BigInteger_Copy(pFirstOperand, pBI_Remainder);
- SecondHighByte = BigInteger_GetByteValue(pSecondOperand, pSecondOperand->IntegerLength);
- ComputeSize = (INT) pFirstOperand->IntegerLength - pSecondOperand->IntegerLength + 1;
- for (Index = (INT) ComputeSize;Index >= 0;Index--) {
- if (BigInteger_UnsignedCompare(*pBI_Remainder, pSecondOperand) == -1)
- break;
-
- if (((pSecondOperand->IntegerLength + Index) - (*pBI_Remainder)->IntegerLength) <= 1) {
- BigInteger_AllocSize(&pMulBI, Index + 1);
- ArrayIndex = 0;
- if (Index > 0)
- ArrayIndex = (UINT) (Index - 1) >> 2 ;
- ShiftIndex = (Index & 0x03);
- if (ShiftIndex == 0)
- ShiftIndex = 4;
- ShiftIndex--;
- MulStart = 0;
- MulStart = (BigInteger_GetByteValue((*pBI_Remainder), pFirstOperand->IntegerLength + Index - ComputeSize + 1) & 0xFF) << 8;
- MulStart = MulStart | (BigInteger_GetByteValue((*pBI_Remainder), pFirstOperand->IntegerLength + Index - ComputeSize) & 0xFF);
- if (MulStart < (UINT32) SecondHighByte)
- continue;
-
- MulStart = MulStart / (UINT32) SecondHighByte;
-
- if (MulStart > 0xFF)
- MulStart = 0x100;
-
- for (MulIndex = (INT) MulStart;MulIndex <= 0x101;MulIndex++) { /* 0xFFFF / 0xFF = 0x101 */
- if ((MulIndex > 0xFF) && (ShiftIndex == 3))
- pMulBI->pIntegerArray[ArrayIndex + 1] = 0x01;
- pMulBI->pIntegerArray[ArrayIndex] = ((UINT) MulIndex << (8*ShiftIndex));
- BigInteger_Mul(pSecondOperand, pMulBI , &pTempBI);
- CompareResult = BigInteger_UnsignedCompare(*pBI_Remainder, pTempBI);
- if (CompareResult < 1) {
- if (MulIndex > 1) {
- if (CompareResult != 0) {
- if ((MulIndex == 0x100) && (ShiftIndex == 3))
- pMulBI->pIntegerArray[ArrayIndex + 1] = 0;
- pMulBI->pIntegerArray[ArrayIndex] = ((UINT) (MulIndex - 1) << (8*ShiftIndex));
- } /* End of if */
-
- BigInteger_Mul(pSecondOperand, pMulBI, &pTempBI);
- BigInteger_Sub(*pBI_Remainder, pTempBI, &pTempBI2);
- BigInteger_Copy(pTempBI2, pBI_Remainder);
- BigInteger_Add(*pBI_Result, pMulBI, &pTempBI2);
- BigInteger_Copy(pTempBI2, pBI_Result);
- } /* End of if */
- break;
- } /* End of if */
-
- if ((MulIndex >= 0x100) && (ShiftIndex == 3))
- pMulBI->pIntegerArray[ArrayIndex++] = 0;
- pMulBI->pIntegerArray[ArrayIndex] = 0;
- } /* End of for */
- } /* End of if */
- } /* End of for */
-
- BigInteger_Free(&pTempBI);
- BigInteger_Free(&pTempBI2);
- BigInteger_Free(&pMulBI);
-output:
- (*pBI_Result)->Signed = pFirstOperand->Signed * pSecondOperand->Signed;
- (*pBI_Remainder)->Signed = pFirstOperand->Signed * pSecondOperand->Signed;
- BigInteger_ClearHighBits(*pBI_Result);
- BigInteger_ClearHighBits(*pBI_Remainder);
-} /* End of BigInteger_Div */
-
-
-VOID BigInteger_Montgomery_Reduction (
- IN PBIG_INTEGER pBI_A,
- IN PBIG_INTEGER pBI_P,
- IN PBIG_INTEGER pBI_R,
- OUT PBIG_INTEGER *pBI_Result)
-{
- UINT32 *Point_P, *Point_Result;
- UINT32 LoopCount;
- UINT64 Result64_1, Result64_2, Carry64, TempValue64;
- INT FirstLoop, SecondLoop;
-
- BigInteger_AllocSize(pBI_Result, pBI_A->IntegerLength+ pBI_P->IntegerLength + 20);
- BigInteger_Copy(pBI_A, pBI_Result);
-
- Point_P = pBI_P->pIntegerArray;
- Point_Result = (*pBI_Result)->pIntegerArray;
-
- LoopCount = Bits_Of_R >> 0x5;
- for (FirstLoop = 0;FirstLoop < LoopCount;FirstLoop++) {
- Carry64 = 0;
- TempValue64 = (UINT64) Point_Result[0];
- for (SecondLoop = 0;SecondLoop < pBI_P->ArrayLength;SecondLoop++) {
- Result64_1 = ((UINT64) Point_Result[SecondLoop]) + Carry64;
- Result64_2 = (UINT64) Point_P[SecondLoop]*TempValue64;
- Carry64 = (Result64_1 >> 32);
- Result64_1 = (Result64_1 & 0xffffffffUL);
- Result64_1 = Result64_1 + Result64_2;
- Carry64 += (Result64_1 >> 32);
- Point_Result[SecondLoop] = (UINT32) (Result64_1 & 0xffffffffUL);
- } /* End of for */
- while (Carry64 != 0) {
- Result64_1 = ((UINT64) Point_Result[SecondLoop]) + Carry64;
- Carry64 = Result64_1 >> 32;
- Point_Result[SecondLoop] = (UINT32) (Result64_1 & 0xffffffffUL);
- SecondLoop++;
- } /* End of while */
- Point_Result++;
- } /* End of for */
-
- for (FirstLoop = 0;FirstLoop <= LoopCount;FirstLoop++) {
- (*pBI_Result)->pIntegerArray[FirstLoop] = (*pBI_Result)->pIntegerArray[FirstLoop + LoopCount];
- } /* End of for */
- if ((*pBI_Result)->pIntegerArray[LoopCount] != 0)
- (*pBI_Result)->ArrayLength = LoopCount + 1;
- else
- (*pBI_Result)->ArrayLength = LoopCount;
-
- (*pBI_Result)->IntegerLength = (*pBI_Result)->ArrayLength*4;
- BigInteger_ClearHighBits(*pBI_Result);
-
- if (BigInteger_UnsignedCompare(*pBI_Result, pBI_P) >= 0) {
- BigInteger_Sub(*pBI_Result, pBI_P, &pBI_U);
- BigInteger_Copy(pBI_U, pBI_Result);
- } /* End of if */
- BigInteger_ClearHighBits(*pBI_Result);
-} /* End of BigInteger_Montgomery_Reduction */
-
-
-VOID BigInteger_Montgomery_ExpMod (
- IN PBIG_INTEGER pBI_G,
- IN PBIG_INTEGER pBI_E,
- IN PBIG_INTEGER pBI_P,
- OUT PBIG_INTEGER *pBI_Result)
-{
- UINT Bits_Of_P;
- UINT32 Index, Index2, AllocLength;
- UINT32 Sliding_Value , Sliding_HighValue, Sliding_LowValue;
- PBIG_INTEGER pBI_Temp1 = NULL, pBI_Temp2 = NULL;
- PBIG_INTEGER pBI_X = NULL, pBI_R = NULL, pBI_RR = NULL, pBI_1 = NULL;
- BIG_INTEGER *pBI_A[SLIDING_WINDOW];
- UINT8 *pRValue = NULL;
-
- AllocLength = (pBI_G->IntegerLength + pBI_E->IntegerLength + pBI_P->IntegerLength + 300);
- BigInteger_AllocSize(&pBI_Temp1, AllocLength);
- BigInteger_AllocSize(&pBI_Temp2, AllocLength);
-
- /* Calculate the bits of P and E, the highest bit is 1 */
- BigInteger_BitsOfBI(pBI_P, &Bits_Of_P);
-
- if ((pBI_E->IntegerLength == 1) && (pBI_E->pIntegerArray[0] == 1)) {
- BigInteger_Div(pBI_G, pBI_P, &pBI_Temp1, pBI_Result);
- goto memory_free;
- } /* End of if */
-
- if ((pBI_E->IntegerLength == 1) && (pBI_E->pIntegerArray[0] == 2)) {
- BigInteger_Mul(pBI_G, pBI_G, &pBI_Temp1);
- BigInteger_Div(pBI_Temp1, pBI_P, &pBI_Temp2, pBI_Result);
- goto memory_free;
- } /* End of if */
-
- /*
- * Main algorithm
- */
- BigInteger_Init(&pBI_R);
- BigInteger_Init(&pBI_RR);
- BigInteger_Bin2BI(Value_1, 1, &pBI_1);
- BigInteger_AllocSize(&pBI_X, AllocLength);
- BigInteger_AllocSize(&pBI_U, AllocLength); // for BigInteger_Montgomery_Reduction
- BigInteger_AllocSize(&pBI_S, AllocLength); // for BigInteger_Square
- BigInteger_AllocSize(&pBI_O, AllocLength); // for BigInteger_Square
-
- for (Index = 0; Index < SLIDING_WINDOW; Index++) {
- pBI_A[Index] = NULL;
- BigInteger_AllocSize(&pBI_A[Index], 193);
- } /* End of for */
- BigInteger_Bin2BI(WPS_DH_P_VALUE, 192, &pBI_Temp1);
- if (NdisCmpMemory(pBI_P->pIntegerArray, pBI_Temp1->pIntegerArray, pBI_P->IntegerLength) == 0) {
- BigInteger_Bin2BI(WPS_DH_X_VALUE, 184, &pBI_X);
- BigInteger_Bin2BI(WPS_DH_R_VALUE, 193, &pBI_R);
- BigInteger_Bin2BI(WPS_DH_RRModP_VALUE, 192, &pBI_RR);
- Bits_Of_R = 1537;
- } else {
- if ((Bits_Of_P % 8) == 0) {
- AllocLength = pBI_P->IntegerLength + 1;
- } else {
- AllocLength = pBI_P->IntegerLength;
- } /* End of if */
- pRValue = (UINT8 *) kmalloc(sizeof(UINT8)*AllocLength, GFP_ATOMIC);
- if (pRValue == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():Alloc memory failed\n", __FUNCTION__));
- goto memory_free;
- }
- NdisZeroMemory(pRValue, sizeof(UINT8)*AllocLength);
- pRValue[0] = (UINT8) (1 << (Bits_Of_P & 0x7));
- BigInteger_Bin2BI(pRValue, AllocLength , &pBI_R);
-
- BigInteger_Mul(pBI_R, pBI_R, &pBI_Temp1);
- BigInteger_Div(pBI_Temp1, pBI_P, &pBI_A[1], &pBI_RR);
-
- /* X = 1*R (mod P) */
- BigInteger_Div(pBI_R, pBI_P, &pBI_Temp2, &pBI_X);
- } /* End of if */
-
- /* A = G*R (mod P) => A = MonMod(G, R^2 mod P) */
- BigInteger_Mul(pBI_G, pBI_RR, &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P , pBI_R, &pBI_A[1]);
- for (Index = 2; Index < SLIDING_WINDOW; Index++) {
- BigInteger_Mul(pBI_A[Index - 1], pBI_A[1], &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P, pBI_R, &pBI_A[Index]);
- } /* End of for */
-
- for (Index = pBI_E->IntegerLength ; Index > 0 ; Index--) {
- for (Index2 = 0; Index2 < 4 ; Index2++) {
- BigInteger_Square(pBI_X, &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P, pBI_R, &pBI_X);
- } /* End of for */
-
- Sliding_Value = BigInteger_GetByteValue(pBI_E, Index);
- Sliding_HighValue = (Sliding_Value >> 4);
- if (Sliding_HighValue != 0) {
- BigInteger_Mul(pBI_A[Sliding_HighValue], pBI_X, &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P, pBI_R, &pBI_X);
- } /* End of if */
-
- for (Index2 = 0; Index2 < 4 ; Index2++) {
- BigInteger_Square(pBI_X, &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P, pBI_R, &pBI_X);
- } /* End of for */
-
- Sliding_LowValue = Sliding_Value & 0x0f;
- if (Sliding_LowValue != 0) {
- BigInteger_Mul(pBI_A[Sliding_LowValue], pBI_X, &pBI_Temp1);
- BigInteger_Montgomery_Reduction(pBI_Temp1, pBI_P, pBI_R, &pBI_X);
- } /* End of if */
- } /* End of for */
- BigInteger_Montgomery_Reduction(pBI_X, pBI_P , pBI_R, pBI_Result);
-
- BigInteger_Free(&pBI_X);
- BigInteger_Free(&pBI_R);
- BigInteger_Free(&pBI_RR);
- BigInteger_Free(&pBI_1);
- BigInteger_Free(&pBI_U);
- BigInteger_Free(&pBI_S);
- BigInteger_Free(&pBI_O);
- for(Index = 0; Index < SLIDING_WINDOW; Index++)
- BigInteger_Free(&pBI_A[Index]);
- if (pRValue != NULL)
- kfree(pRValue);
-
-memory_free:
- BigInteger_Free(&pBI_Temp1);
- BigInteger_Free(&pBI_Temp2);
-} /* End of BigInteger_Montgomery_ExpMod */
-
-/* End of crypt_biginteger.c */
diff --git a/drivers/staging/rt3090/common/crypt_dh.c b/drivers/staging/rt3090/common/crypt_dh.c
deleted file mode 100644
index 0f69f2af9038..000000000000
--- a/drivers/staging/rt3090/common/crypt_dh.c
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- crypt_dh.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Eddy 2009/01/19 Create AES-128, AES-192, AES-256, AES-CBC
-*/
-
-#include "crypt_dh.h"
-#include "crypt_biginteger.h"
-
-/*
-========================================================================
-Routine Description:
- Diffie-Hellman public key generation
-
-Arguments:
- GValue Array in UINT8
- GValueLength The length of G in bytes
- PValue Array in UINT8
- PValueLength The length of P in bytes
- PrivateKey Private key
- PrivateKeyLength The length of Private key in bytes
-
-Return Value:
- PublicKey Public key
- PublicKeyLength The length of public key in bytes
-
-Note:
- Reference to RFC2631
- PublicKey = G^PrivateKey (mod P)
-========================================================================
-*/
-void DH_PublicKey_Generate (
- IN UINT8 GValue[],
- IN UINT GValueLength,
- IN UINT8 PValue[],
- IN UINT PValueLength,
- IN UINT8 PrivateKey[],
- IN UINT PrivateKeyLength,
- OUT UINT8 PublicKey[],
- INOUT UINT *PublicKeyLength)
-{
- PBIG_INTEGER pBI_G = NULL;
- PBIG_INTEGER pBI_P = NULL;
- PBIG_INTEGER pBI_PrivateKey = NULL;
- PBIG_INTEGER pBI_PublicKey = NULL;
-
- /*
- * 1. Check the input parameters
- * - GValueLength, PValueLength and PrivateLength must be large than zero
- * - PublicKeyLength must be large or equal than PValueLength
- * - PValue must be odd
- *
- * - PValue must be prime number (no implement)
- * - GValue must be greater than 0 but less than the PValue (no implement)
- */
- if (GValueLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_PublicKey_Generate: G length is (%d)\n", GValueLength));
- return;
- } /* End of if */
- if (PValueLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_PublicKey_Generate: P length is (%d)\n", PValueLength));
- return;
- } /* End of if */
- if (PrivateKeyLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_PublicKey_Generate: private key length is (%d)\n", PrivateKeyLength));
- return;
- } /* End of if */
- if (*PublicKeyLength < PValueLength) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_PublicKey_Generate: public key length(%d) must be large or equal than P length(%d)\n",
- *PublicKeyLength, PValueLength));
- return;
- } /* End of if */
- if (!(PValue[PValueLength - 1] & 0x1)) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_PublicKey_Generate: P value must be odd\n"));
- return;
- } /* End of if */
-
- /*
- * 2. Transfer parameters to BigInteger structure
- */
- BigInteger_Init(&pBI_G);
- BigInteger_Init(&pBI_P);
- BigInteger_Init(&pBI_PrivateKey);
- BigInteger_Init(&pBI_PublicKey);
- BigInteger_Bin2BI(GValue, GValueLength, &pBI_G);
- BigInteger_Bin2BI(PValue, PValueLength, &pBI_P);
- BigInteger_Bin2BI(PrivateKey, PrivateKeyLength, &pBI_PrivateKey);
-
- /*
- * 3. Calculate PublicKey = G^PrivateKey (mod P)
- * - BigInteger Operation
- * - Montgomery reduction
- */
- BigInteger_Montgomery_ExpMod(pBI_G, pBI_PrivateKey, pBI_P, &pBI_PublicKey);
-
- /*
- * 4. Transfer BigInteger structure to char array
- */
- BigInteger_BI2Bin(pBI_PublicKey, PublicKey, PublicKeyLength);
-
- BigInteger_Free(&pBI_G);
- BigInteger_Free(&pBI_P);
- BigInteger_Free(&pBI_PrivateKey);
- BigInteger_Free(&pBI_PublicKey);
-} /* End of DH_PublicKey_Generate */
-
-
-/*
-========================================================================
-Routine Description:
- Diffie-Hellman secret key generation
-
-Arguments:
- PublicKey Public key
- PublicKeyLength The length of Public key in bytes
- PValue Array in UINT8
- PValueLength The length of P in bytes
- PrivateKey Private key
- PrivateKeyLength The length of Private key in bytes
-
-Return Value:
- SecretKey Secret key
- SecretKeyLength The length of secret key in bytes
-
-Note:
- Reference to RFC2631
- SecretKey = PublicKey^PrivateKey (mod P)
-========================================================================
-*/
-void DH_SecretKey_Generate (
- IN UINT8 PublicKey[],
- IN UINT PublicKeyLength,
- IN UINT8 PValue[],
- IN UINT PValueLength,
- IN UINT8 PrivateKey[],
- IN UINT PrivateKeyLength,
- OUT UINT8 SecretKey[],
- INOUT UINT *SecretKeyLength)
-{
- PBIG_INTEGER pBI_P = NULL;
- PBIG_INTEGER pBI_SecretKey = NULL;
- PBIG_INTEGER pBI_PrivateKey = NULL;
- PBIG_INTEGER pBI_PublicKey = NULL;
-
- /*
- * 1. Check the input parameters
- * - PublicKeyLength, PValueLength and PrivateLength must be large than zero
- * - SecretKeyLength must be large or equal than PValueLength
- * - PValue must be odd
- *
- * - PValue must be prime number (no implement)
- */
- if (PublicKeyLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_SecretKey_Generate: public key length is (%d)\n", PublicKeyLength));
- return;
- } /* End of if */
- if (PValueLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_SecretKey_Generate: P length is (%d)\n", PValueLength));
- return;
- } /* End of if */
- if (PrivateKeyLength == 0) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_SecretKey_Generate: private key length is (%d)\n", PrivateKeyLength));
- return;
- } /* End of if */
- if (*SecretKeyLength < PValueLength) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_SecretKey_Generate: secret key length(%d) must be large or equal than P length(%d)\n",
- *SecretKeyLength, PValueLength));
- return;
- } /* End of if */
- if (!(PValue[PValueLength - 1] & 0x1)) {
- DBGPRINT(RT_DEBUG_ERROR, ("DH_SecretKey_Generate: P value must be odd\n"));
- return;
- } /* End of if */
-
- /*
- * 2. Transfer parameters to BigInteger structure
- */
- BigInteger_Init(&pBI_P);
- BigInteger_Init(&pBI_PrivateKey);
- BigInteger_Init(&pBI_PublicKey);
- BigInteger_Init(&pBI_SecretKey);
-
- BigInteger_Bin2BI(PublicKey, PublicKeyLength, &pBI_PublicKey);
- BigInteger_Bin2BI(PValue, PValueLength, &pBI_P);
- BigInteger_Bin2BI(PrivateKey, PrivateKeyLength, &pBI_PrivateKey);
-
- /*
- * 3. Calculate SecretKey = PublicKey^PrivateKey (mod P)
- * - BigInteger Operation
- * - Montgomery reduction
- */
- BigInteger_Montgomery_ExpMod(pBI_PublicKey, pBI_PrivateKey, pBI_P, &pBI_SecretKey);
-
- /*
- * 4. Transfer BigInteger structure to char array
- */
- BigInteger_BI2Bin(pBI_SecretKey, SecretKey, SecretKeyLength);
-
- BigInteger_Free(&pBI_P);
- BigInteger_Free(&pBI_PrivateKey);
- BigInteger_Free(&pBI_PublicKey);
- BigInteger_Free(&pBI_SecretKey);
-} /* End of DH_SecretKey_Generate */
diff --git a/drivers/staging/rt3090/common/dfs.c b/drivers/staging/rt3090/common/dfs.c
deleted file mode 100644
index c15704ae2f24..000000000000
--- a/drivers/staging/rt3090/common/dfs.c
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ap_dfs.c
-
- Abstract:
- Support DFS function.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "../rt_config.h"
-
-
-typedef struct _RADAR_DURATION_TABLE
-{
- ULONG RDDurRegion;
- ULONG RadarSignalDuration;
- ULONG Tolerance;
-} RADAR_DURATION_TABLE, *PRADAR_DURATION_TABLE;
-
-
-
-UCHAR RdIdleTimeTable[MAX_RD_REGION][4] =
-{
- {9, 250, 250, 250}, // CE
-#ifdef DFS_FCC_BW40_FIX
- {1, 250, 250, 250}, // FCC
-#else
- {4, 250, 250, 250}, // FCC
-#endif
- {4, 250, 250, 250}, // JAP
- {15, 250, 250, 250}, // JAP_W53
- {4, 250, 250, 250} // JAP_W56
-};
-
-#ifdef TONE_RADAR_DETECT_SUPPORT
-static void ToneRadarProgram(PRTMP_ADAPTER pAd);
-static void ToneRadarEnable(PRTMP_ADAPTER pAd);
-#endif // TONE_RADAR_DETECT_SUPPORT //
-
-#ifdef DFS_SUPPORT
-/*
- ========================================================================
-
- Routine Description:
- Bbp Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID BbpRadarDetectionStart(
- IN PRTMP_ADAPTER pAd)
-{
- UINT8 RadarPeriod;
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 114, 0x02);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 121, 0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 122, 0x00);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 123, 0x08/*0x80*/);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 124, 0x28);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, 125, 0xff);
-
-#ifdef MERGE_ARCH_TEAM
- if ((pAd->CommonCfg.RadarDetect.RDDurRegion == JAP) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53) || (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56))
- {
- pAd->CommonCfg.RadarDetect.RDDurRegion = JAP;
- pAd->CommonCfg.RadarDetect.RDDurRegion = JapRadarType(pAd);
- if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W56)
- {
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 13;
- }
- else if (pAd->CommonCfg.RadarDetect.RDDurRegion == JAP_W53)
- {
- pAd->CommonCfg.RadarDetect.DfsSessionTime = 15;
- }
-#ifdef CARRIER_DETECTION_SUPPORT
- pAd->CommonCfg.CarrierDetect.Enable = 1;
-#endif // CARRIER_DETECTION_SUPPORT //
- }
-#endif // MERGE_ARCH_TEAM //
-
- RadarPeriod = ((UINT)RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + (UINT)pAd->CommonCfg.RadarDetect.DfsSessionTime) < 250 ?
- (RdIdleTimeTable[pAd->CommonCfg.RadarDetect.RDDurRegion][0] + pAd->CommonCfg.RadarDetect.DfsSessionTime) : 250;
-
-#ifdef MERGE_ARCH_TEAM
-
-
-#else // Original RT28xx source code.
- RTMP_IO_WRITE8(pAd, 0x7020, 0x1d);
- RTMP_IO_WRITE8(pAd, 0x7021, 0x40);
-#endif // MERGE_ARCH_TEAM //
-
- RadarDetectionStart(pAd, 0, RadarPeriod);
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Bbp Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID BbpRadarDetectionStop(
- IN PRTMP_ADAPTER pAd)
-{
- RTMP_IO_WRITE8(pAd, 0x7020, 0x1d);
- RTMP_IO_WRITE8(pAd, 0x7021, 0x60);
-
- RadarDetectionStop(pAd);
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
-
- ========================================================================
-*/
-VOID RadarDetectionStart(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN CTSProtect,
- IN UINT8 CTSPeriod)
-{
- UINT8 DfsActiveTime = (pAd->CommonCfg.RadarDetect.DfsSessionTime & 0x1f);
- UINT8 CtsProtect = (CTSProtect == 1) ? 0x02 : 0x01; // CTS protect.
-
- if (CTSProtect != 0)
- {
- switch(pAd->CommonCfg.RadarDetect.RDDurRegion)
- {
- case FCC:
- case JAP_W56:
- CtsProtect = 0x03;
- break;
-
- case JAP:
- {
- UCHAR RDDurRegion;
- RDDurRegion = JapRadarType(pAd);
- if (RDDurRegion == JAP_W56)
- CtsProtect = 0x03;
- else
- CtsProtect = 0x02;
- break;
- }
-
- case CE:
- case JAP_W53:
- default:
- CtsProtect = 0x02;
- break;
- }
- }
- else
- CtsProtect = 0x01;
-
-
- // send start-RD with CTS protection command to MCU
- // highbyte [7] reserve
- // highbyte [6:5] 0x: stop Carrier/Radar detection
- // highbyte [10]: Start Carrier/Radar detection without CTS protection, 11: Start Carrier/Radar detection with CTS protection
- // highbyte [4:0] Radar/carrier detection duration. In 1ms.
-
- // lowbyte [7:0] Radar/carrier detection period, in 1ms.
- AsicSendCommandToMcu(pAd, 0x60, 0xff, CTSPeriod, DfsActiveTime | (CtsProtect << 5));
- //AsicSendCommandToMcu(pAd, 0x63, 0xff, 10, 0);
-
- return;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Radar detection routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- TRUE Found radar signal
- FALSE Not found radar signal
-
- ========================================================================
-*/
-VOID RadarDetectionStop(
- IN PRTMP_ADAPTER pAd)
-{
- DBGPRINT(RT_DEBUG_TRACE,("RadarDetectionStop.\n"));
- AsicSendCommandToMcu(pAd, 0x60, 0xff, 0x00, 0x00); // send start-RD with CTS protection command to MCU
-
- return;
-}
-#endif // DFS_SUPPORT //
-
-
-/*
- ========================================================================
-
- Routine Description:
- Radar channel check routine
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- TRUE need to do radar detect
- FALSE need not to do radar detect
-
- ========================================================================
-*/
-BOOLEAN RadarChannelCheck(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ch)
-{
- INT i;
- BOOLEAN result = FALSE;
-
- for (i=0; i<pAd->ChannelListNum; i++)
- {
- if (Ch == pAd->ChannelList[i].Channel)
- {
- result = pAd->ChannelList[i].DfsReq;
- break;
- }
- }
-
- return result;
-}
-
-#ifdef DFS_SUPPORT
-
-ULONG JapRadarType(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG i;
- const UCHAR Channel[15]={52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140};
-
- if (pAd->CommonCfg.RadarDetect.RDDurRegion != JAP)
- {
- return pAd->CommonCfg.RadarDetect.RDDurRegion;
- }
-
- for (i=0; i<15; i++)
- {
- if (pAd->CommonCfg.Channel == Channel[i])
- {
- break;
- }
- }
-
- if (i < 4)
- return JAP_W53;
- else if (i < 15)
- return JAP_W56;
- else
- return JAP; // W52
-
-}
-
-ULONG RTMPBbpReadRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- UINT8 byteValue = 0;
- ULONG result;
-
- BBP_IO_READ8_BY_REG_ID(pAd, BBP_R115, &byteValue);
-
- result = 0;
- switch (byteValue)
- {
- case 1: // radar signal detected by pulse mode.
- case 2: // radar signal detected by width mode.
- result = RTMPReadRadarDuration(pAd);
- break;
-
- case 0: // No radar signal.
- default:
-
- result = 0;
- break;
- }
-
- return result;
-}
-
-ULONG RTMPReadRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG result = 0;
-
-#ifdef DFS_SUPPORT
- UINT8 duration1 = 0, duration2 = 0, duration3 = 0;
-
-
- BBP_IO_READ8_BY_REG_ID(pAd, BBP_R116, &duration1);
- BBP_IO_READ8_BY_REG_ID(pAd, BBP_R117, &duration2);
- BBP_IO_READ8_BY_REG_ID(pAd, BBP_R118, &duration3);
- result = (duration1 << 16) + (duration2 << 8) + duration3;
-#endif // DFS_SUPPORT //
-
- return result;
-
-}
-
-VOID RTMPCleanRadarDuration(
- IN PRTMP_ADAPTER pAd)
-{
- return;
-}
-
-/*
- ========================================================================
- Routine Description:
- Radar wave detection. The API should be invoke each second.
-
- Arguments:
- pAd - Adapter pointer
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID ApRadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd)
-{
- INT i;
-
- pAd->CommonCfg.RadarDetect.InServiceMonitorCount++;
-
- for (i=0; i<pAd->ChannelListNum; i++)
- {
-
- if (pAd->ChannelList[i].RemainingTimeForUse > 0)
- {
- pAd->ChannelList[i].RemainingTimeForUse --;
- if ((pAd->Mlme.PeriodicRound%5) == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RadarDetectPeriodic - ch=%d, RemainingTimeForUse=%d\n", pAd->ChannelList[i].Channel, pAd->ChannelList[i].RemainingTimeForUse));
- }
- }
- }
-
- //radar detect
- if ((pAd->CommonCfg.Channel > 14)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && RadarChannelCheck(pAd, pAd->CommonCfg.Channel))
- {
- RadarDetectPeriodic(pAd);
- }
-
- return;
-}
-
-// Periodic Radar detection, switch channel will occur in RTMPHandleTBTTInterrupt()
-// Before switch channel, driver needs doing channel switch announcement.
-VOID RadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd)
-{
-
- // need to check channel availability, after switch channel
- if (pAd->CommonCfg.RadarDetect.RDMode != RD_SILENCE_MODE)
- return;
-
-
-
- // channel availability check time is 60sec, use 65 for assurance
- if (pAd->CommonCfg.RadarDetect.RDCount++ > pAd->CommonCfg.RadarDetect.ChMovingTime)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Not found radar signal, start send beacon and radar detection in service monitor\n\n"));
- BbpRadarDetectionStop(pAd);
-
-
- AsicEnableBssSync(pAd);
- pAd->CommonCfg.RadarDetect.RDMode = RD_NORMAL_MODE;
-
-
-
- return;
- }
-
- return;
-}
-#endif // DFS_SUPPORT //
-
-#ifdef DFS_SUPPORT
-/*
- ==========================================================================
- Description:
- change channel moving time for DFS testing.
-
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 set ChMovTime=[value]
- ==========================================================================
-*/
-INT Set_ChMovingTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT8 Value;
-
- Value = (UINT8) simple_strtol(arg, 0, 10);
-
- pAd->CommonCfg.RadarDetect.ChMovingTime = Value;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __FUNCTION__,
- pAd->CommonCfg.RadarDetect.ChMovingTime));
-
- return TRUE;
-}
-
-INT Set_LongPulseRadarTh_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT8 Value;
-
- Value = (UINT8) simple_strtol(arg, 0, 10) > 10 ? 10 : simple_strtol(arg, 0, 10);
-
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh = Value;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s:: %d\n", __FUNCTION__,
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh));
-
- return TRUE;
-}
-#endif // DFS_SUPPORT //
diff --git a/drivers/staging/rt3090/common/eeprom.c b/drivers/staging/rt3090/common/eeprom.c
deleted file mode 100644
index 2e837499e5e4..000000000000
--- a/drivers/staging/rt3090/common/eeprom.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- eeprom.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
-*/
-
-#include "../rt_config.h"
-
-
-INT RtmpChipOpsEepromHook(
- IN RTMP_ADAPTER *pAd,
- IN INT infType)
-{
- RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
-#ifdef RT30xx
-#ifdef RTMP_EFUSE_SUPPORT
- UINT32 eFuseCtrl, MacCsr0;
- int index;
-
- index = 0;
- do
- {
- RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
- pAd->MACVersion = MacCsr0;
-
- if ((pAd->MACVersion != 0x00) && (pAd->MACVersion != 0xFFFFFFFF))
- break;
-
- RTMPusecDelay(10);
- } while (index++ < 100);
-
- pAd->bUseEfuse=FALSE;
- RTMP_IO_READ32(pAd, EFUSE_CTRL, &eFuseCtrl);
- pAd->bUseEfuse = ( (eFuseCtrl & 0x80000000) == 0x80000000) ? 1 : 0;
- if(pAd->bUseEfuse)
- {
- pChipOps->eeinit = eFuse_init;
- pChipOps->eeread = rtmp_ee_efuse_read16;
- pChipOps->eewrite = rtmp_ee_efuse_write16;
- return 0 ;
- }
- else
- {
- pAd->bFroceEEPROMBuffer = FALSE;
- DBGPRINT(RT_DEBUG_TRACE, ("NVM is EEPROM\n"));
- }
-#endif // RTMP_EFUSE_SUPPORT //
-#endif // RT30xx //
-
- switch(infType)
- {
-#ifdef RTMP_PCI_SUPPORT
- case RTMP_DEV_INF_PCI:
- pChipOps->eeinit = NULL;
- pChipOps->eeread = rtmp_ee_prom_read16;
- pChipOps->eewrite = rtmp_ee_prom_write16;
- break;
-#endif // RTMP_PCI_SUPPORT //
-
-
- default:
- DBGPRINT(RT_DEBUG_ERROR, ("RtmpChipOpsEepromHook() failed!\n"));
- break;
- }
-
- return 0;
-}
diff --git a/drivers/staging/rt3090/common/igmp_snoop.c b/drivers/staging/rt3090/common/igmp_snoop.c
deleted file mode 100644
index 680658f97f0a..000000000000
--- a/drivers/staging/rt3090/common/igmp_snoop.c
+++ /dev/null
@@ -1,1365 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-
-#ifdef IGMP_SNOOP_SUPPORT
-
-#include "../rt_config.h"
-#include "../ipv6.h"
-#include "../igmp_snoop.h"
-
-
-static inline void initFreeEntryList(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList)
-{
- int i;
-
- for (i = 0; i < FREE_MEMBER_POOL_SIZE; i++)
- insertTailList(pList, (PLIST_ENTRY)&(pMulticastFilterTable->freeMemberPool[i]));
-
- return;
-}
-
-static inline PMEMBER_ENTRY AllocaGrpMemberEntry(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable)
-{
- PMEMBER_ENTRY pMemberEntry;
-
- RTMP_SEM_LOCK(&pMulticastFilterTable->FreeMemberPoolTabLock);
-
- pMemberEntry = (PMEMBER_ENTRY)removeHeadList(&pMulticastFilterTable->freeEntryList);
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->FreeMemberPoolTabLock);
-
- return (PMEMBER_ENTRY)pMemberEntry;
-}
-
-static inline VOID FreeGrpMemberEntry(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PMEMBER_ENTRY pEntry)
-{
- RTMP_SEM_LOCK(&pMulticastFilterTable->FreeMemberPoolTabLock);
-
- insertTailList(&pMulticastFilterTable->freeEntryList, (PLIST_ENTRY)pEntry);
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->FreeMemberPoolTabLock);
-}
-
-static VOID IGMPTableDisplay(
- IN PRTMP_ADAPTER pAd);
-
-static BOOLEAN isIgmpMacAddr(
- IN PUCHAR pMacAddr);
-
-static VOID InsertIgmpMember(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList,
- IN PUCHAR pMemberAddr);
-
-static VOID DeleteIgmpMember(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList,
- IN PUCHAR pMemberAddr);
-
-static VOID DeleteIgmpMemberList(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList);
-
-
-/*
- ==========================================================================
- Description:
- This routine init the entire IGMP table.
- ==========================================================================
- */
-VOID MulticastFilterTableInit(
- IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable)
-{
- // Initialize MAC table and allocate spin lock
- *ppMulticastFilterTable = kmalloc(sizeof(MULTICAST_FILTER_TABLE), MEM_ALLOC_FLAG);
- if (*ppMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for Multicase filter table, size=%d\n",
- __FUNCTION__, sizeof(MULTICAST_FILTER_TABLE)));
- return;
- }
-
- NdisZeroMemory(*ppMulticastFilterTable, sizeof(MULTICAST_FILTER_TABLE));
- NdisAllocateSpinLock(&((*ppMulticastFilterTable)->MulticastFilterTabLock));
-
- NdisAllocateSpinLock(&((*ppMulticastFilterTable)->FreeMemberPoolTabLock));
- initList(&((*ppMulticastFilterTable)->freeEntryList));
- initFreeEntryList(*ppMulticastFilterTable, &((*ppMulticastFilterTable)->freeEntryList));
- return;
-}
-
-/*
- ==========================================================================
- Description:
- This routine reset the entire IGMP table.
- ==========================================================================
- */
-VOID MultiCastFilterTableReset(
- IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable)
-{
- if(*ppMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
- return;
- }
-
- NdisFreeSpinLock(&((*ppMulticastFilterTable)->FreeMemberPoolTabLock));
- NdisFreeSpinLock(&((*ppMulticastFilterTable)->MulticastFilterTabLock));
- kfree(*ppMulticastFilterTable);
- *ppMulticastFilterTable = NULL;
-}
-
-/*
- ==========================================================================
- Description:
- Display all entrys in IGMP table
- ==========================================================================
- */
-static VOID IGMPTableDisplay(
- IN PRTMP_ADAPTER pAd)
-{
- int i;
- MULTICAST_FILTER_TABLE_ENTRY *pEntry = NULL;
- PMULTICAST_FILTER_TABLE pMulticastFilterTable = pAd->pMulticastFilterTable;
-
- if (pMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_OFF, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
- return;
- }
-
- // if FULL, return
- if (pMulticastFilterTable->Size == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Table empty.\n"));
- return;
- }
-
- // allocate one MAC entry
- RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- for (i = 0; i< MAX_LEN_OF_MULTICAST_FILTER_TABLE; i++)
- {
- // pick up the first available vacancy
- if (pMulticastFilterTable->Content[i].Valid == TRUE)
- {
- PMEMBER_ENTRY pMemberEntry = NULL;
- pEntry = &pMulticastFilterTable->Content[i];
-
- DBGPRINT(RT_DEBUG_OFF, ("IF(%s) entry #%d, type=%s, GrpId=(%02x:%02x:%02x:%02x:%02x:%02x) memberCnt=%d\n",
- RTMP_OS_NETDEV_GET_DEVNAME(pEntry->net_dev), i, (pEntry->type==0 ? "static":"dynamic"),
- PRINT_MAC(pEntry->Addr), IgmpMemberCnt(&pEntry->MemberList)));
-
- pMemberEntry = (PMEMBER_ENTRY)pEntry->MemberList.pHead;
- while (pMemberEntry)
- {
- DBGPRINT(RT_DEBUG_OFF, ("member mac=(%02x:%02x:%02x:%02x:%02x:%02x)\n",
- PRINT_MAC(pMemberEntry->Addr)));
-
- pMemberEntry = pMemberEntry->pNext;
- }
- }
- }
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Add and new entry into MAC table
- ==========================================================================
- */
-BOOLEAN MulticastFilterTableInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pGrpId,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV dev,
- IN MulticastFilterEntryType type)
-{
- UCHAR HashIdx;
- int i;
- MULTICAST_FILTER_TABLE_ENTRY *pEntry = NULL, *pCurrEntry, *pPrevEntry;
- PMEMBER_ENTRY pMemberEntry;
- PMULTICAST_FILTER_TABLE pMulticastFilterTable = pAd->pMulticastFilterTable;
-
- if (pMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
- return FALSE;
- }
-
- // if FULL, return
- if (pMulticastFilterTable->Size >= MAX_LEN_OF_MULTICAST_FILTER_TABLE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table full. max-entries = %d\n",
- __FUNCTION__, MAX_LEN_OF_MULTICAST_FILTER_TABLE));
- return FALSE;
- }
-
- // check the rule is in table already or not.
- if ((pEntry = MulticastFilterTableLookup(pMulticastFilterTable, pGrpId, dev)))
- {
- // doesn't indicate member mac address.
- if(pMemberAddr == NULL)
- {
- return FALSE;
- }
-
- pMemberEntry = (PMEMBER_ENTRY)pEntry->MemberList.pHead;
-
- while (pMemberEntry)
- {
- if (MAC_ADDR_EQUAL(pMemberAddr, pMemberEntry->Addr))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: already in Members list.\n", __FUNCTION__));
- return FALSE;
- }
-
- pMemberEntry = pMemberEntry->pNext;
- }
- }
-
- RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
- do
- {
- ULONG Now;
- // the multicast entry already exist but doesn't include the member yet.
- if (pEntry != NULL && pMemberAddr != NULL)
- {
- InsertIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);
- break;
- }
-
- // allocate one MAC entry
- for (i = 0; i < MAX_LEN_OF_MULTICAST_FILTER_TABLE; i++)
- {
- // pick up the first available vacancy
- pEntry = &pMulticastFilterTable->Content[i];
- NdisGetSystemUpTime(&Now);
- if ((pEntry->Valid == TRUE) && (pEntry->type == MCAT_FILTER_DYNAMIC)
- && ((Now - pEntry->lastTime) > IGMPMAC_TB_ENTRY_AGEOUT_TIME))
- {
- PMULTICAST_FILTER_TABLE_ENTRY pHashEntry;
-
- HashIdx = MULTICAST_ADDR_HASH_INDEX(pEntry->Addr);
- pHashEntry = pMulticastFilterTable->Hash[HashIdx];
-
- if ((pEntry->net_dev == pHashEntry->net_dev)
- && MAC_ADDR_EQUAL(pEntry->Addr, pHashEntry->Addr))
- {
- pMulticastFilterTable->Hash[HashIdx] = pHashEntry->pNext;
- pMulticastFilterTable->Size --;
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 1 - Total= %d\n", pMulticastFilterTable->Size));
- } else
- {
- while (pHashEntry->pNext)
- {
- pPrevEntry = pHashEntry;
- pHashEntry = pHashEntry->pNext;
- if ((pEntry->net_dev == pHashEntry->net_dev)
- && MAC_ADDR_EQUAL(pEntry->Addr, pHashEntry->Addr))
- {
- pPrevEntry->pNext = pHashEntry->pNext;
- pMulticastFilterTable->Size --;
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 2 - Total= %d\n", pMulticastFilterTable->Size));
- break;
- }
- }
- }
- pEntry->Valid = FALSE;
- DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
- }
-
- if (pEntry->Valid == FALSE)
- {
- NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
- pEntry->Valid = TRUE;
-
- COPY_MAC_ADDR(pEntry->Addr, pGrpId);
- pEntry->net_dev = dev;
- NdisGetSystemUpTime(&Now);
- pEntry->lastTime = Now;
- pEntry->type = type;
- initList(&pEntry->MemberList);
- if (pMemberAddr != NULL)
- InsertIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);
-
- pMulticastFilterTable->Size ++;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MulticastFilterTableInsertEntry -IF(%s) allocate entry #%d, Total= %d\n", RTMP_OS_NETDEV_GET_DEVNAME(dev), i, pMulticastFilterTable->Size));
- break;
- }
- }
-
- // add this MAC entry into HASH table
- if (pEntry)
- {
- HashIdx = MULTICAST_ADDR_HASH_INDEX(pGrpId);
- if (pMulticastFilterTable->Hash[HashIdx] == NULL)
- {
- pMulticastFilterTable->Hash[HashIdx] = pEntry;
- } else
- {
- pCurrEntry = pMulticastFilterTable->Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- pCurrEntry = pCurrEntry->pNext;
- pCurrEntry->pNext = pEntry;
- }
- }
- }while(FALSE);
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Delete a specified client from MAC table
- ==========================================================================
- */
-BOOLEAN MulticastFilterTableDeleteEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pGrpId,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV dev)
-{
- USHORT HashIdx;
- MULTICAST_FILTER_TABLE_ENTRY *pEntry, *pPrevEntry;
- PMULTICAST_FILTER_TABLE pMulticastFilterTable = pAd->pMulticastFilterTable;
- USHORT Aid = MCAST_WCID;
- SST Sst = SST_ASSOC;
- UCHAR PsMode = PWR_ACTIVE, Rate;
-
- if (pMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
- return FALSE;
- }
-
- RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- do
- {
- HashIdx = MULTICAST_ADDR_HASH_INDEX(pGrpId);
- pPrevEntry = pEntry = pMulticastFilterTable->Hash[HashIdx];
-
- while (pEntry && pEntry->Valid)
- {
- if ((pEntry->net_dev == dev)
- && MAC_ADDR_EQUAL(pEntry->Addr, pGrpId))
- break;
- else
- {
- pPrevEntry = pEntry;
- pEntry = pEntry->pNext;
- }
- }
-
- // check the rule is in table already or not.
- if (pEntry && (pMemberAddr != NULL))
- {
- if(APSsPsInquiry(pAd, pMemberAddr, &Sst, &Aid, &PsMode, &Rate))
- DeleteIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);
- if (IgmpMemberCnt(&pEntry->MemberList) > 0)
- break;
- }
-
- if (pEntry)
- {
- if (pEntry == pMulticastFilterTable->Hash[HashIdx])
- {
- pMulticastFilterTable->Hash[HashIdx] = pEntry->pNext;
- DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
- NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
- pMulticastFilterTable->Size --;
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 1 - Total= %d\n", pMulticastFilterTable->Size));
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
- NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
- pMulticastFilterTable->Size --;
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 2 - Total= %d\n", pMulticastFilterTable->Size));
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: the Group doesn't exist.\n", __FUNCTION__));
- }
- } while(FALSE);
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Look up the MAC address in the IGMP table. Return NULL if not found.
- Return:
- pEntry - pointer to the MAC entry; NULL is not found
- ==========================================================================
-*/
-PMULTICAST_FILTER_TABLE_ENTRY MulticastFilterTableLookup(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PUCHAR pAddr,
- IN PNET_DEV dev)
-{
- ULONG HashIdx, Now;
- PMULTICAST_FILTER_TABLE_ENTRY pEntry = NULL, pPrev = NULL;
-
- if (pMulticastFilterTable == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s Multicase filter table is not ready.\n", __FUNCTION__));
- return NULL;
- }
-
- RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- HashIdx = MULTICAST_ADDR_HASH_INDEX(pAddr);
- pEntry = pPrev = pMulticastFilterTable->Hash[HashIdx];
-
- while (pEntry && pEntry->Valid)
- {
- if ((pEntry->net_dev == dev)
- && MAC_ADDR_EQUAL(pEntry->Addr, pAddr))
- {
- NdisGetSystemUpTime(&Now);
- pEntry->lastTime = Now;
- break;
- }
- else
- {
- NdisGetSystemUpTime(&Now);
- if ((pEntry->Valid == TRUE) && (pEntry->type == MCAT_FILTER_DYNAMIC)
- && RTMP_TIME_AFTER(Now, pEntry->lastTime+IGMPMAC_TB_ENTRY_AGEOUT_TIME))
- {
- // Remove the aged entry
- if (pEntry == pMulticastFilterTable->Hash[HashIdx])
- {
- pMulticastFilterTable->Hash[HashIdx] = pEntry->pNext;
- pPrev = pMulticastFilterTable->Hash[HashIdx];
- DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
- NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
- pMulticastFilterTable->Size --;
- pEntry = pPrev;
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 2 - Total= %d\n", pMulticastFilterTable->Size));
- }
- else
- {
- pPrev->pNext = pEntry->pNext;
- DeleteIgmpMemberList(pMulticastFilterTable, &pEntry->MemberList);
- NdisZeroMemory(pEntry, sizeof(MULTICAST_FILTER_TABLE_ENTRY));
- pMulticastFilterTable->Size --;
- pEntry = (pPrev == NULL ? NULL: pPrev->pNext);
- DBGPRINT(RT_DEBUG_TRACE, ("MCastFilterTableDeleteEntry 2 - Total= %d\n", pMulticastFilterTable->Size));
- }
- }
- else
- {
- pPrev = pEntry;
- pEntry = pEntry->pNext;
- }
- }
- }
-
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);
-
- return pEntry;
-}
-
-VOID IGMPSnooping(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pSrcMacAddr,
- IN PUCHAR pIpHeader,
- IN PNET_DEV pDev)
-{
- INT i;
- INT IpHeaderLen;
- UCHAR GroupType;
- UINT16 numOfGroup;
- UCHAR IgmpVerType;
- PUCHAR pIgmpHeader;
- PUCHAR pGroup;
- UCHAR AuxDataLen;
- UINT16 numOfSources;
- PUCHAR pGroupIpAddr;
- UCHAR GroupMacAddr[6];
- PUCHAR pGroupMacAddr = (PUCHAR)&GroupMacAddr;
-
- if(isIgmpPkt(pDstMacAddr, pIpHeader))
- {
- IpHeaderLen = (*(pIpHeader + 2) & 0x0f) * 4;
- pIgmpHeader = pIpHeader + 2 + IpHeaderLen;
- IgmpVerType = (UCHAR)(*(pIgmpHeader));
-
- DBGPRINT(RT_DEBUG_TRACE, ("IGMP type=%0x\n", IgmpVerType));
-
- switch(IgmpVerType)
- {
- case IGMP_V1_MEMBERSHIP_REPORT: // IGMP version 1 membership report.
- case IGMP_V2_MEMBERSHIP_REPORT: // IGMP version 2 membership report.
- pGroupIpAddr = (PUCHAR)(pIgmpHeader + 4);
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
- DBGPRINT(RT_DEBUG_TRACE, ("IGMP Group=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
-
- case IGMP_LEAVE_GROUP: // IGMP version 1 and version 2 leave group.
- pGroupIpAddr = (PUCHAR)(pIgmpHeader + 4);
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
- DBGPRINT(RT_DEBUG_TRACE, ("IGMP Group=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- break;
-
- case IGMP_V3_MEMBERSHIP_REPORT: // IGMP version 3 membership report.
- numOfGroup = ntohs(*((UINT16 *)(pIgmpHeader + 6)));
- pGroup = (PUCHAR)(pIgmpHeader + 8);
- for (i=0; i < numOfGroup; i++)
- {
- GroupType = (UCHAR)(*pGroup);
- AuxDataLen = (UCHAR)(*(pGroup + 1));
- numOfSources = ntohs(*((UINT16 *)(pGroup + 2)));
- pGroupIpAddr = (PUCHAR)(pGroup + 4);
- DBGPRINT(RT_DEBUG_TRACE, ("IGMPv3 Type=%d, ADL=%d, numOfSource=%d\n", GroupType, AuxDataLen, numOfSources));
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
- DBGPRINT(RT_DEBUG_TRACE, ("IGMP Group=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
-
- do
- {
- if((GroupType == MODE_IS_EXCLUDE) || (GroupType == CHANGE_TO_EXCLUDE_MODE) || (GroupType == ALLOW_NEW_SOURCES))
- {
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
- }
-
- if((GroupType == MODE_IS_INCLUDE) || (GroupType == BLOCK_OLD_SOURCES))
- {
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- break;
- }
-
- if((GroupType == CHANGE_TO_INCLUDE_MODE))
- {
- if(numOfSources == 0)
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- else
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
- }
- } while(FALSE);
- pGroup += (8 + (numOfSources * 4) + AuxDataLen);
- }
- break;
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("unknow IGMP Type=%d\n", IgmpVerType));
- break;
- }
- }
-
- return;
-}
-
-
-static BOOLEAN isIgmpMacAddr(
- IN PUCHAR pMacAddr)
-{
- if((pMacAddr[0] == 0x01)
- && (pMacAddr[1] == 0x00)
- && (pMacAddr[2] == 0x5e))
- return TRUE;
- return FALSE;
-}
-
-BOOLEAN isIgmpPkt(
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pIpHeader)
-{
- UINT16 IpProtocol = ntohs(*((UINT16 *)(pIpHeader)));
- UCHAR IgmpProtocol;
-
- if(!isIgmpMacAddr(pDstMacAddr))
- return FALSE;
-
- if(IpProtocol == ETH_P_IP)
- {
- IgmpProtocol = (UCHAR)*(pIpHeader + 11);
- if(IgmpProtocol == IGMP_PROTOCOL_DESCRIPTOR)
- return TRUE;
- }
-
- return FALSE;
-}
-
-static VOID InsertIgmpMember(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList,
- IN PUCHAR pMemberAddr)
-{
- PMEMBER_ENTRY pMemberEntry;
-
- if(pList == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: membert list doesn't exist.\n", __FUNCTION__));
- return;
- }
-
- if (pMemberAddr == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: invalid member.\n", __FUNCTION__));
- return;
- }
-
- if((pMemberEntry = (PMEMBER_ENTRY)AllocaGrpMemberEntry(pMulticastFilterTable)) != NULL)
- {
- NdisZeroMemory(pMemberEntry, sizeof(MEMBER_ENTRY));
- COPY_MAC_ADDR(pMemberEntry->Addr, pMemberAddr);
- insertTailList(pList, (PLIST_ENTRY)pMemberEntry);
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s Member Mac=%02x:%02x:%02x:%02x:%02x:%02x\n", __FUNCTION__,
- pMemberEntry->Addr[0], pMemberEntry->Addr[1], pMemberEntry->Addr[2],
- pMemberEntry->Addr[3], pMemberEntry->Addr[4], pMemberEntry->Addr[5]));
- }
- return;
-}
-
-static VOID DeleteIgmpMember(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList,
- IN PUCHAR pMemberAddr)
-{
- PMEMBER_ENTRY pCurEntry;
-
- if((pList == NULL) || (pList->pHead == NULL))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: membert list doesn't exist.\n", __FUNCTION__));
- return;
- }
-
- if (pMemberAddr == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: invalid member.\n", __FUNCTION__));
- return;
- }
-
- pCurEntry = (PMEMBER_ENTRY)pList->pHead;
- while (pCurEntry)
- {
- if(MAC_ADDR_EQUAL(pMemberAddr, pCurEntry->Addr))
- {
- delEntryList(pList, (PLIST_ENTRY)pCurEntry);
- FreeGrpMemberEntry(pMulticastFilterTable, pCurEntry);
- break;
- }
- pCurEntry = pCurEntry->pNext;
- }
-
- return;
-}
-
-static VOID DeleteIgmpMemberList(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PLIST_HEADER pList)
-{
- PMEMBER_ENTRY pCurEntry, pPrvEntry;
-
- if((pList == NULL) || (pList->pHead == NULL))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: membert list doesn't exist.\n", __FUNCTION__));
- return;
- }
-
- pPrvEntry = pCurEntry = (PMEMBER_ENTRY)pList->pHead;
- while (pCurEntry)
- {
- delEntryList(pList, (PLIST_ENTRY)pCurEntry);
- pPrvEntry = pCurEntry;
- pCurEntry = pCurEntry->pNext;
- FreeGrpMemberEntry(pMulticastFilterTable, pPrvEntry);
- }
-
- initList(pList);
- return;
-}
-
-
-UCHAR IgmpMemberCnt(
- IN PLIST_HEADER pList)
-{
- if(pList == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: membert list doesn't exist.\n", __FUNCTION__));
- return 0;
- }
-
- return getListSize(pList);
-}
-
-VOID IgmpGroupDelMembers(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV pDev)
-{
- INT i;
- MULTICAST_FILTER_TABLE_ENTRY *pEntry = NULL;
- PMULTICAST_FILTER_TABLE pMulticastFilterTable = pAd->pMulticastFilterTable;
-
- for (i = 0; i < MAX_LEN_OF_MULTICAST_FILTER_TABLE; i++)
- {
- // pick up the first available vacancy
- pEntry = &pMulticastFilterTable->Content[i];
- if (pEntry->Valid == TRUE)
- {
- if(pMemberAddr != NULL)
- {
- RTMP_SEM_LOCK(&pMulticastFilterTable->MulticastFilterTabLock);
- DeleteIgmpMember(pMulticastFilterTable, &pEntry->MemberList, pMemberAddr);
- RTMP_SEM_UNLOCK(&pMulticastFilterTable->MulticastFilterTabLock);
- }
-
- if((pEntry->type == MCAT_FILTER_DYNAMIC)
- && (IgmpMemberCnt(&pEntry->MemberList) == 0))
- MulticastFilterTableDeleteEntry(pAd, pEntry->Addr, pMemberAddr, pDev);
- }
- }
-}
-
-INT Set_IgmpSn_Enable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT Enable;
- POS_COOKIE pObj;
- UCHAR ifIndex;
- PNET_DEV pDev;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
- ifIndex = pObj->ioctl_if;
-
- pDev = (ifIndex == MAIN_MBSSID) ? (pAd->net_dev) : (pAd->ApCfg.MBSSID[ifIndex].MSSIDDev);
- Enable = (UINT) simple_strtol(arg, 0, 10);
-
- pAd->ApCfg.MBSSID[ifIndex].IgmpSnoopEnable = (BOOLEAN)(Enable == 0 ? 0 : 1);
- DBGPRINT(RT_DEBUG_TRACE, ("%s::(%s) %s\n", __FUNCTION__, RTMP_OS_NETDEV_GET_DEVNAME(pDev), Enable == TRUE ? "Enable IGMP Snooping":"Disable IGMP Snooping"));
-
- return TRUE;
-}
-
-INT Set_IgmpSn_AddEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- INT i;
- BOOLEAN bGroupId = 1;
- PSTRING value;
- PSTRING thisChar;
- UCHAR IpAddr[4];
- UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
- UCHAR GroupId[ETH_LENGTH_OF_ADDRESS];
- PUCHAR *pAddr = (PUCHAR *)&Addr;
- PNET_DEV pDev;
- POS_COOKIE pObj;
- UCHAR ifIndex;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
- ifIndex = pObj->ioctl_if;
-
- pDev = (ifIndex == MAIN_MBSSID) ? (pAd->net_dev) : (pAd->ApCfg.MBSSID[ifIndex].MSSIDDev);
-
- while ((thisChar = strsep((char **)&arg, "-")) != NULL)
- {
- // refuse the Member if it's not a MAC address.
- if((bGroupId == 0) && (strlen(thisChar) != 17))
- continue;
-
- if(strlen(thisChar) == 17) //Mac address acceptable format 01:02:03:04:05:06 length 17
- {
- for (i=0, value = rstrtok(thisChar,":"); value; value = rstrtok(NULL,":"))
- {
- if((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))) )
- return FALSE; //Invalid
-
- AtoH(value, &Addr[i++], 1);
- }
-
- if(i != 6)
- return FALSE; //Invalid
- }
- else
- {
- for (i=0, value = rstrtok(thisChar,"."); value; value = rstrtok(NULL,"."))
- {
- if((strlen(value) > 0) && (strlen(value) <= 3))
- {
- int ii;
- for(ii=0; ii<strlen(value); ii++)
- if (!isxdigit(*(value + ii)))
- return FALSE;
- }
- else
- return FALSE; //Invalid
-
- IpAddr[i] = (UCHAR)simple_strtol(value, NULL, 10);
- i++;
- }
-
- if(i != 4)
- return FALSE; //Invalid
-
- ConvertMulticastIP2MAC(IpAddr, (PUCHAR *)&pAddr, ETH_P_IP);
- }
-
- if(bGroupId == 1)
- COPY_MAC_ADDR(GroupId, Addr);
-
- // Group-Id must be a MCAST address.
- if((bGroupId == 1) && IS_MULTICAST_MAC_ADDR(Addr))
- MulticastFilterTableInsertEntry(pAd, GroupId, NULL, pDev, MCAT_FILTER_STATIC);
- // Group-Member must be a UCAST address.
- else if ((bGroupId == 0) && !IS_MULTICAST_MAC_ADDR(Addr))
- MulticastFilterTableInsertEntry(pAd, GroupId, Addr, pDev, MCAT_FILTER_STATIC);
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s (%2X:%2X:%2X:%2X:%2X:%2X) is not a acceptable address.\n",
- __FUNCTION__, Addr[0], Addr[1], Addr[2], Addr[3], Addr[4], Addr[5]));
- return FALSE;
- }
-
- bGroupId = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("%s (%2X:%2X:%2X:%2X:%2X:%2X)\n",
- __FUNCTION__, Addr[0], Addr[1], Addr[2], Addr[3], Addr[4], Addr[5]));
-
- }
-
- return TRUE;
-}
-
-INT Set_IgmpSn_DelEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- INT i, memberCnt = 0;
- BOOLEAN bGroupId = 1;
- PSTRING value;
- PSTRING thisChar;
- UCHAR IpAddr[4];
- UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
- UCHAR GroupId[ETH_LENGTH_OF_ADDRESS];
- PUCHAR *pAddr = (PUCHAR *)&Addr;
- PNET_DEV pDev;
- POS_COOKIE pObj;
- UCHAR ifIndex;
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
- ifIndex = pObj->ioctl_if;
-
- pDev = (ifIndex == MAIN_MBSSID) ? (pAd->net_dev) : (pAd->ApCfg.MBSSID[ifIndex].MSSIDDev);
-
- while ((thisChar = strsep((char **)&arg, "-")) != NULL)
- {
- // refuse the Member if it's not a MAC address.
- if((bGroupId == 0) && (strlen(thisChar) != 17))
- continue;
-
- if(strlen(thisChar) == 17) //Mac address acceptable format 01:02:03:04:05:06 length 17
- {
- for (i=0, value = rstrtok(thisChar,":"); value; value = rstrtok(NULL,":"))
- {
- if((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))) )
- return FALSE; //Invalid
-
- AtoH(value, &Addr[i++], 1);
- }
-
- if(i != 6)
- return FALSE; //Invalid
- }
- else
- {
- for (i=0, value = rstrtok(thisChar,"."); value; value = rstrtok(NULL,"."))
- {
- if((strlen(value) > 0) && (strlen(value) <= 3))
- {
- int ii;
- for(ii=0; ii<strlen(value); ii++)
- if (!isxdigit(*(value + ii)))
- return FALSE;
- }
- else
- return FALSE; //Invalid
-
- IpAddr[i] = (UCHAR)simple_strtol(value, NULL, 10);
- i++;
- }
-
- if(i != 4)
- return FALSE; //Invalid
-
- ConvertMulticastIP2MAC(IpAddr, (PUCHAR *)&pAddr, ETH_P_IP);
- }
-
- if(bGroupId == 1)
- COPY_MAC_ADDR(GroupId, Addr);
- else
- memberCnt++;
-
- if (memberCnt > 0 )
- MulticastFilterTableDeleteEntry(pAd, (PUCHAR)GroupId, Addr, pDev);
-
- bGroupId = 0;
- }
-
- if(memberCnt == 0)
- MulticastFilterTableDeleteEntry(pAd, (PUCHAR)GroupId, NULL, pDev);
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s (%2X:%2X:%2X:%2X:%2X:%2X)\n",
- __FUNCTION__, Addr[0], Addr[1], Addr[2], Addr[3], Addr[4], Addr[5]));
-
- return TRUE;
-}
-
-INT Set_IgmpSn_TabDisplay_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- IGMPTableDisplay(pAd);
- return TRUE;
-}
-
-void rtmp_read_igmp_snoop_from_file(
- IN PRTMP_ADAPTER pAd,
- PSTRING tmpbuf,
- PSTRING buffer)
-{
- PSTRING macptr;
- INT i=0;
-
- //IgmpSnEnable
- if(RTMPGetKeyParameter("IgmpSnEnable", tmpbuf, 128, buffer, TRUE))
- {
- for (i = 0, macptr = rstrtok(tmpbuf,";"); (macptr && i < pAd->ApCfg.BssidNum); macptr = rstrtok(NULL,";"), i++)
- {
- if ((strncmp(macptr, "0", 1) == 0))
- pAd->ApCfg.MBSSID[i].IgmpSnoopEnable = FALSE;
- else if ((strncmp(macptr, "1", 1) == 0))
- pAd->ApCfg.MBSSID[i].IgmpSnoopEnable = TRUE;
- else
- pAd->ApCfg.MBSSID[i].IgmpSnoopEnable = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MBSSID[%d].Enable=%d\n", i, pAd->ApCfg.MBSSID[i].IgmpSnoopEnable));
- }
- }
-}
-
-NDIS_STATUS IgmpPktInfoQuery(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrcBufVA,
- IN PNDIS_PACKET pPacket,
- IN UCHAR apidx,
- OUT BOOLEAN *pInIgmpGroup,
- OUT PMULTICAST_FILTER_TABLE_ENTRY *ppGroupEntry)
-{
- if(IS_MULTICAST_MAC_ADDR(pSrcBufVA))
- {
- BOOLEAN IgmpMldPkt = FALSE;
- PUCHAR pIpHeader = pSrcBufVA + 12;
-
- if(ntohs(*((UINT16 *)(pIpHeader))) == ETH_P_IPV6)
- IgmpMldPkt = isMldPkt(pSrcBufVA, pIpHeader, NULL, NULL);
- else
- IgmpMldPkt = isIgmpPkt(pSrcBufVA, pIpHeader);
-
- if (IgmpMldPkt)
- {
- *ppGroupEntry = NULL;
- }
- else if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pSrcBufVA,
- pAd->ApCfg.MBSSID[apidx].MSSIDDev)) == NULL)
- {
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- return NDIS_STATUS_FAILURE;
- }
- *pInIgmpGroup = TRUE;
- }
- else if (IS_BROADCAST_MAC_ADDR(pSrcBufVA))
- {
- PUCHAR pDstIpAddr = pSrcBufVA + 30; // point to Destination of Ip address of IP header.
- UCHAR GroupMacAddr[6];
- PUCHAR pGroupMacAddr = (PUCHAR)&GroupMacAddr;
-
- ConvertMulticastIP2MAC(pDstIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IP);
- if ((*ppGroupEntry = MulticastFilterTableLookup(pAd->pMulticastFilterTable, pGroupMacAddr,
- pAd->ApCfg.MBSSID[apidx].MSSIDDev)) != NULL)
- {
- *pInIgmpGroup = TRUE;
- }
- }
- return NDIS_STATUS_SUCCESS;
-}
-
-NDIS_STATUS IgmpPktClone(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR QueIdx,
- IN PMULTICAST_FILTER_TABLE_ENTRY pGroupEntry)
-{
- PNDIS_PACKET pSkbClone = NULL;
- PMEMBER_ENTRY pMemberEntry = (PMEMBER_ENTRY)pGroupEntry->MemberList.pHead;
- MAC_TABLE_ENTRY *pMacEntry = NULL;
- USHORT Aid;
- SST Sst = SST_ASSOC;
- UCHAR PsMode = PWR_ACTIVE;
- UCHAR Rate;
- unsigned long IrqFlags;
-
- // check all members of the IGMP group.
- while(pMemberEntry != NULL)
- {
- pMacEntry = APSsPsInquiry(pAd, pMemberEntry->Addr, &Sst, &Aid, &PsMode, &Rate);
-
- if (pMacEntry && (Sst == SST_ASSOC) && (PsMode != PWR_SAVE))
- {
- pSkbClone = skb_clone(RTPKT_TO_OSPKT(pPacket), MEM_ALLOC_FLAG);
- if(pSkbClone)
- {
- RTMP_SET_PACKET_WCID(pSkbClone, (UCHAR)Aid);
- // Pkt type must set to PKTSRC_NDIS.
- // It cause of the deason that APHardTransmit()
- // doesn't handle PKTSRC_DRIVER pkt type in version 1.3.0.0.
- RTMP_SET_PACKET_SOURCE(pSkbClone, PKTSRC_NDIS);
- }
- else
- {
- pMemberEntry = pMemberEntry->pNext;
- continue;
- }
-
- // insert the pkt to TxSwQueue.
- if (pAd->TxSwQueue[QueIdx].Number >= MAX_PACKETS_IN_QUEUE)
- {
-#ifdef BLOCK_NET_IF
- StopNetIfQueue(pAd, QueIdx, pSkbClone);
-#endif // BLOCK_NET_IF //
- RELEASE_NDIS_PACKET(pAd, pSkbClone, NDIS_STATUS_FAILURE);
- return NDIS_STATUS_FAILURE;
- }
- else
- {
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
- InsertTailQueueAc(pAd, pMacEntry, &pAd->TxSwQueue[QueIdx], PACKET_TO_QUEUE_ENTRY(pSkbClone));
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
- }
- }
- pMemberEntry = pMemberEntry->pNext;
- }
- return NDIS_STATUS_SUCCESS;
-}
-
-static inline BOOLEAN isMldMacAddr(
- IN PUCHAR pMacAddr)
-{
- return ((pMacAddr[0] == 0x33) && (pMacAddr[1] == 0x33)) ? TRUE : FALSE;
-}
-
-static inline BOOLEAN IsSupportedMldMsg(
- IN UINT8 MsgType)
-{
- BOOLEAN result = FALSE;
- switch(MsgType)
- {
- case MLD_V1_LISTENER_REPORT:
- case MLD_V1_LISTENER_DONE:
- case MLD_V2_LISTERNER_REPORT:
- result = TRUE;
- break;
- default:
- result = FALSE;
- break;
- }
-
- return result;
-}
-
-BOOLEAN isMldPkt(
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pIpHeader,
- OUT UINT8 *pProtoType,
- OUT PUCHAR *pMldHeader)
-{
- BOOLEAN result = FALSE;
- UINT16 IpProtocol = ntohs(*((UINT16 *)(pIpHeader)));
-
- if(!isMldMacAddr(pDstMacAddr))
- return FALSE;
-
- if(IpProtocol != ETH_P_IPV6)
- return FALSE;
-
- // skip protocol (2 Bytes).
- pIpHeader += 2;
- do
- {
- PRT_IPV6_HDR pIpv6Hdr = (PRT_IPV6_HDR)(pIpHeader);
- UINT8 nextProtocol = pIpv6Hdr->nextHdr;
- UINT32 offset = IPV6_HDR_LEN;
-
- while(nextProtocol != IPV6_NEXT_HEADER_ICMPV6)
- {
- if(IPv6ExtHdrHandle((RT_IPV6_EXT_HDR *)(pIpHeader + offset), &nextProtocol, &offset) == FALSE)
- break;
- }
-
- if(nextProtocol == IPV6_NEXT_HEADER_ICMPV6)
- {
- PRT_ICMPV6_HDR pICMPv6Hdr = (PRT_ICMPV6_HDR)(pIpHeader + offset);
- if (IsSupportedMldMsg(pICMPv6Hdr->type) == TRUE)
- {
- if (pProtoType != NULL)
- *pProtoType = pICMPv6Hdr->type;
- if (pMldHeader != NULL)
- *pMldHeader = (PUCHAR)pICMPv6Hdr;
- result = TRUE;
- }
- }
- }while(FALSE);
-
- return result;
-}
-
-/* MLD v1 messages have the following format:
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Type | Code | Checksum |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Maximum Response Delay | Reserved |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- + +
- | |
- + Multicast Address +
- | |
- + +
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-*/
-
-/* Version 3 Membership Report Message
- 0 1 2 3
- 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Type = 143 | Reserved | Checksum |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Reserved | Number of Group Records (M) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- . .
- . Multicast Address Record [1] .
- . .
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- . .
- . Multicast Address Record [2] .
- . .
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | . |
- . . .
- | . |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- . .
- . Multicast Address Record [M] .
- . .
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-
-
- where each Group Record has the following internal format:
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | Record Type | Aux Data Len | Number of Sources (N) |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- * *
- | |
- * Multicast Address *
- | |
- * *
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- * *
- | |
- * Source Address [1] *
- | |
- * *
- | |
- +- -+
- | |
- * *
- | |
- * Source Address [2] *
- | |
- * *
- | |
- +- -+
- . . .
- . . .
- . . .
- +- -+
- | |
- * *
- | |
- * Source Address [N] *
- | |
- * *
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
- | |
- . .
- . Auxiliary Data .
- . .
- | |
- +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
-*/
-
-VOID MLDSnooping(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pSrcMacAddr,
- IN PUCHAR pIpHeader,
- IN PNET_DEV pDev)
-{
- INT i;
- UCHAR GroupType;
- UINT16 numOfGroup;
- PUCHAR pGroup;
- UCHAR AuxDataLen;
- UINT16 numOfSources;
- PUCHAR pGroupIpAddr;
- UCHAR GroupMacAddr[6];
- PUCHAR pGroupMacAddr = (PUCHAR)&GroupMacAddr;
-
- UINT8 MldType;
- PUCHAR pMldHeader;
-
- if(isMldPkt(pDstMacAddr, pIpHeader, &MldType, &pMldHeader) == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MLD type=%0x\n", MldType));
-
- switch(MldType)
- {
- case MLD_V1_LISTENER_REPORT:
- // skip Type(1 Byte), code(1 Byte), checksum(2 Bytes), Maximum Rsp Delay(2 Bytes), Reserve(2 Bytes).
- pGroupIpAddr = (PUCHAR)(pMldHeader + 8);
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IPV6);
- DBGPRINT(RT_DEBUG_TRACE, ("Group Id=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
-
- case MLD_V1_LISTENER_DONE:
- // skip Type(1 Byte), code(1 Byte), checksum(2 Bytes), Maximum Rsp Delay(2 Bytes), Reserve(2 Bytes).
- pGroupIpAddr = (PUCHAR)(pMldHeader + 8);
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IPV6);
- DBGPRINT(RT_DEBUG_TRACE, ("Group Id=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- break;
-
- case MLD_V2_LISTERNER_REPORT: // IGMP version 3 membership report.
- numOfGroup = ntohs(*((UINT16 *)(pMldHeader + 6)));
- pGroup = (PUCHAR)(pMldHeader + 8);
- for (i=0; i < numOfGroup; i++)
- {
- GroupType = (UCHAR)(*pGroup);
- AuxDataLen = (UCHAR)(*(pGroup + 1));
- numOfSources = ntohs(*((UINT16 *)(pGroup + 2)));
- pGroupIpAddr = (PUCHAR)(pGroup + 4);
- DBGPRINT(RT_DEBUG_TRACE, ("MLDv2 Type=%d, ADL=%d, numOfSource=%d\n", GroupType, AuxDataLen, numOfSources));
- ConvertMulticastIP2MAC(pGroupIpAddr, (PUCHAR *)&pGroupMacAddr, ETH_P_IPV6);
- DBGPRINT(RT_DEBUG_TRACE, ("MLD Group=%02x:%02x:%02x:%02x:%02x:%02x\n",
- GroupMacAddr[0], GroupMacAddr[1], GroupMacAddr[2], GroupMacAddr[3], GroupMacAddr[4], GroupMacAddr[5]));
-
- do
- {
- if((GroupType == MODE_IS_EXCLUDE) || (GroupType == CHANGE_TO_EXCLUDE_MODE) || (GroupType == ALLOW_NEW_SOURCES))
- {
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
- }
-
- if((GroupType == MODE_IS_INCLUDE) || (GroupType == BLOCK_OLD_SOURCES))
- {
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- break;
- }
-
- if((GroupType == CHANGE_TO_INCLUDE_MODE))
- {
- if(numOfSources == 0)
- MulticastFilterTableDeleteEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev);
- else
- MulticastFilterTableInsertEntry(pAd, GroupMacAddr, pSrcMacAddr, pDev, MCAT_FILTER_DYNAMIC);
- break;
- }
- } while(FALSE);
- // skip 4 Bytes (Record Type, Aux Data Len, Number of Sources) + a IPv6 address.
- pGroup += (4 + IPV6_ADDR_LEN + (numOfSources * 16) + AuxDataLen);
- }
- break;
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("unknow MLD Type=%d\n", MldType));
- break;
- }
- }
-
- return;
-}
-
-
-#endif // IGMP_SNOOP_SUPPORT //
diff --git a/drivers/staging/rt3090/common/mlme.c b/drivers/staging/rt3090/common/mlme.c
deleted file mode 100644
index 1613c04c5932..000000000000
--- a/drivers/staging/rt3090/common/mlme.c
+++ /dev/null
@@ -1,6550 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- mlme.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2004-08-25 Modify from RT2500 code base
- John Chang 2004-09-06 modified for RT2600
-*/
-
-#include "../rt_config.h"
-#include <stdarg.h>
-
-UCHAR CISCO_OUI[] = {0x00, 0x40, 0x96};
-
-UCHAR WPA_OUI[] = {0x00, 0x50, 0xf2, 0x01};
-UCHAR RSN_OUI[] = {0x00, 0x0f, 0xac};
-UCHAR WAPI_OUI[] = {0x00, 0x14, 0x72};
-UCHAR WME_INFO_ELEM[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01};
-UCHAR WME_PARM_ELEM[] = {0x00, 0x50, 0xf2, 0x02, 0x01, 0x01};
-UCHAR Ccx2QosInfo[] = {0x00, 0x40, 0x96, 0x04};
-UCHAR RALINK_OUI[] = {0x00, 0x0c, 0x43};
-UCHAR BROADCOM_OUI[] = {0x00, 0x90, 0x4c};
-UCHAR WPS_OUI[] = {0x00, 0x50, 0xf2, 0x04};
-#ifdef CONFIG_STA_SUPPORT
-#ifdef DOT11_N_SUPPORT
-UCHAR PRE_N_HT_OUI[] = {0x00, 0x90, 0x4c};
-#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-UCHAR RateSwitchTable[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x11, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 35, 45,
- 0x03, 0x00, 3, 20, 45,
- 0x04, 0x21, 0, 30, 50,
- 0x05, 0x21, 1, 20, 50,
- 0x06, 0x21, 2, 20, 50,
- 0x07, 0x21, 3, 15, 50,
- 0x08, 0x21, 4, 15, 30,
- 0x09, 0x21, 5, 10, 25,
- 0x0a, 0x21, 6, 8, 25,
- 0x0b, 0x21, 7, 8, 25,
- 0x0c, 0x20, 12, 15, 30,
- 0x0d, 0x20, 13, 8, 20,
- 0x0e, 0x20, 14, 8, 20,
- 0x0f, 0x20, 15, 8, 25,
- 0x10, 0x22, 15, 8, 25,
- 0x11, 0x00, 0, 0, 0,
- 0x12, 0x00, 0, 0, 0,
- 0x13, 0x00, 0, 0, 0,
- 0x14, 0x00, 0, 0, 0,
- 0x15, 0x00, 0, 0, 0,
- 0x16, 0x00, 0, 0, 0,
- 0x17, 0x00, 0, 0, 0,
- 0x18, 0x00, 0, 0, 0,
- 0x19, 0x00, 0, 0, 0,
- 0x1a, 0x00, 0, 0, 0,
- 0x1b, 0x00, 0, 0, 0,
- 0x1c, 0x00, 0, 0, 0,
- 0x1d, 0x00, 0, 0, 0,
- 0x1e, 0x00, 0, 0, 0,
- 0x1f, 0x00, 0, 0, 0,
-};
-
-UCHAR RateSwitchTable11B[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x04, 0x03, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 35, 45,
- 0x03, 0x00, 3, 20, 45,
-};
-
-UCHAR RateSwitchTable11BG[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0a, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 35, 45,
- 0x03, 0x00, 3, 20, 45,
- 0x04, 0x10, 2, 20, 35,
- 0x05, 0x10, 3, 16, 35,
- 0x06, 0x10, 4, 10, 25,
- 0x07, 0x10, 5, 16, 25,
- 0x08, 0x10, 6, 10, 25,
- 0x09, 0x10, 7, 10, 13,
-};
-
-UCHAR RateSwitchTable11G[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x08, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x10, 0, 20, 101,
- 0x01, 0x10, 1, 20, 35,
- 0x02, 0x10, 2, 20, 35,
- 0x03, 0x10, 3, 16, 35,
- 0x04, 0x10, 4, 10, 25,
- 0x05, 0x10, 5, 16, 25,
- 0x06, 0x10, 6, 10, 25,
- 0x07, 0x10, 7, 10, 13,
-};
-
-#ifdef DOT11_N_SUPPORT
-UCHAR RateSwitchTable11N1S[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0c, 0x0a, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 25, 45,
- 0x03, 0x21, 0, 20, 35,
- 0x04, 0x21, 1, 20, 35,
- 0x05, 0x21, 2, 20, 35,
- 0x06, 0x21, 3, 15, 35,
- 0x07, 0x21, 4, 15, 30,
- 0x08, 0x21, 5, 10, 25,
- 0x09, 0x21, 6, 8, 14,
- 0x0a, 0x21, 7, 8, 14,
- 0x0b, 0x23, 7, 8, 14,
-};
-
-UCHAR RateSwitchTable11N2S[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0e, 0x0c, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 25, 45,
- 0x03, 0x21, 0, 20, 35,
- 0x04, 0x21, 1, 20, 35,
- 0x05, 0x21, 2, 20, 35,
- 0x06, 0x21, 3, 15, 35,
- 0x07, 0x21, 4, 15, 30,
- 0x08, 0x20, 11, 15, 30,
- 0x09, 0x20, 12, 15, 30,
- 0x0a, 0x20, 13, 8, 20,
- 0x0b, 0x20, 14, 8, 20,
- 0x0c, 0x20, 15, 8, 25,
- 0x0d, 0x22, 15, 8, 15,
-};
-
-UCHAR RateSwitchTable11N3S[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0b, 0x00, 0, 0, 0, // 0x0a, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30, 101,
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x20, 11, 15, 30, // Required by System-Alan @ 20080812
- 0x06, 0x20, 12, 15, 30, // 0x05, 0x20, 12, 15, 30,
- 0x07, 0x20, 13, 8, 20, // 0x06, 0x20, 13, 8, 20,
- 0x08, 0x20, 14, 8, 20, // 0x07, 0x20, 14, 8, 20,
- 0x09, 0x20, 15, 8, 25, // 0x08, 0x20, 15, 8, 25,
- 0x0a, 0x22, 15, 8, 25, // 0x09, 0x22, 15, 8, 25,
-};
-
-UCHAR RateSwitchTable11N2SForABand[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0b, 0x09, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30, 101,
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x21, 5, 15, 30,
- 0x06, 0x20, 12, 15, 30,
- 0x07, 0x20, 13, 8, 20,
- 0x08, 0x20, 14, 8, 20,
- 0x09, 0x20, 15, 8, 25,
- 0x0a, 0x22, 15, 8, 25,
-};
-
-UCHAR RateSwitchTable11N3SForABand[] = { // 3*3
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0b, 0x09, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30, 101,
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x21, 5, 15, 30,
- 0x06, 0x20, 12, 15, 30,
- 0x07, 0x20, 13, 8, 20,
- 0x08, 0x20, 14, 8, 20,
- 0x09, 0x20, 15, 8, 25,
- 0x0a, 0x22, 15, 8, 25,
-};
-
-UCHAR RateSwitchTable11BGN1S[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0c, 0x0a, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 25, 45,
- 0x03, 0x21, 0, 20, 35,
- 0x04, 0x21, 1, 20, 35,
- 0x05, 0x21, 2, 20, 35,
- 0x06, 0x21, 3, 15, 35,
- 0x07, 0x21, 4, 15, 30,
- 0x08, 0x21, 5, 10, 25,
- 0x09, 0x21, 6, 8, 14,
- 0x0a, 0x21, 7, 8, 14,
- 0x0b, 0x23, 7, 8, 14,
-};
-
-UCHAR RateSwitchTable11BGN2S[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0e, 0x0c, 0, 0, 0, // Initial used item after association
- 0x00, 0x00, 0, 40, 101,
- 0x01, 0x00, 1, 40, 50,
- 0x02, 0x00, 2, 25, 45,
- 0x03, 0x21, 0, 20, 35,
- 0x04, 0x21, 1, 20, 35,
- 0x05, 0x21, 2, 20, 35,
- 0x06, 0x21, 3, 15, 35,
- 0x07, 0x21, 4, 15, 30,
- 0x08, 0x20, 11, 15, 30,
- 0x09, 0x20, 12, 15, 30,
- 0x0a, 0x20, 13, 8, 20,
- 0x0b, 0x20, 14, 8, 20,
- 0x0c, 0x20, 15, 8, 25,
- 0x0d, 0x22, 15, 8, 15,
-};
-
-UCHAR RateSwitchTable11BGN3S[] = { // 3*3
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0a, 0x00, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30,101, //50
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 20, 50,
- 0x04, 0x21, 4, 15, 50,
- 0x05, 0x20, 20, 15, 30,
- 0x06, 0x20, 21, 8, 20,
- 0x07, 0x20, 22, 8, 20,
- 0x08, 0x20, 23, 8, 25,
- 0x09, 0x22, 23, 8, 25,
-};
-
-UCHAR RateSwitchTable11BGN2SForABand[] = {
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0b, 0x09, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30,101, //50
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x21, 5, 15, 30,
- 0x06, 0x20, 12, 15, 30,
- 0x07, 0x20, 13, 8, 20,
- 0x08, 0x20, 14, 8, 20,
- 0x09, 0x20, 15, 8, 25,
- 0x0a, 0x22, 15, 8, 25,
-};
-
-UCHAR RateSwitchTable11BGN3SForABand[] = { // 3*3
-// Item No. Mode Curr-MCS TrainUp TrainDown // Mode- Bit0: STBC, Bit1: Short GI, Bit4,5: Mode(0:CCK, 1:OFDM, 2:HT Mix, 3:HT GF)
- 0x0c, 0x09, 0, 0, 0, // Initial used item after association
- 0x00, 0x21, 0, 30,101, //50
- 0x01, 0x21, 1, 20, 50,
- 0x02, 0x21, 2, 20, 50,
- 0x03, 0x21, 3, 15, 50,
- 0x04, 0x21, 4, 15, 30,
- 0x05, 0x21, 5, 15, 30,
- 0x06, 0x21, 12, 15, 30,
- 0x07, 0x20, 20, 15, 30,
- 0x08, 0x20, 21, 8, 20,
- 0x09, 0x20, 22, 8, 20,
- 0x0a, 0x20, 23, 8, 25,
- 0x0b, 0x22, 23, 8, 25,
-};
-#endif // DOT11_N_SUPPORT //
-
-
-extern UCHAR OfdmRateToRxwiMCS[];
-// since RT61 has better RX sensibility, we have to limit TX ACK rate not to exceed our normal data TX rate.
-// otherwise the WLAN peer may not be able to receive the ACK thus downgrade its data TX rate
-ULONG BasicRateMask[12] = {0xfffff001 /* 1-Mbps */, 0xfffff003 /* 2 Mbps */, 0xfffff007 /* 5.5 */, 0xfffff00f /* 11 */,
- 0xfffff01f /* 6 */ , 0xfffff03f /* 9 */ , 0xfffff07f /* 12 */ , 0xfffff0ff /* 18 */,
- 0xfffff1ff /* 24 */ , 0xfffff3ff /* 36 */ , 0xfffff7ff /* 48 */ , 0xffffffff /* 54 */};
-
-UCHAR BROADCAST_ADDR[MAC_ADDR_LEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-
-// e.g. RssiSafeLevelForTxRate[RATE_36]" means if the current RSSI is greater than
-// this value, then it's quaranteed capable of operating in 36 mbps TX rate in
-// clean environment.
-// TxRate: 1 2 5.5 11 6 9 12 18 24 36 48 54 72 100
-CHAR RssiSafeLevelForTxRate[] ={ -92, -91, -90, -87, -88, -86, -85, -83, -81, -78, -72, -71, -40, -40 };
-
-UCHAR RateIdToMbps[] = { 1, 2, 5, 11, 6, 9, 12, 18, 24, 36, 48, 54, 72, 100};
-USHORT RateIdTo500Kbps[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108, 144, 200};
-
-UCHAR SsidIe = IE_SSID;
-UCHAR SupRateIe = IE_SUPP_RATES;
-UCHAR ExtRateIe = IE_EXT_SUPP_RATES;
-#ifdef DOT11_N_SUPPORT
-UCHAR HtCapIe = IE_HT_CAP;
-UCHAR AddHtInfoIe = IE_ADD_HT;
-UCHAR NewExtChanIe = IE_SECONDARY_CH_OFFSET;
-#ifdef DOT11N_DRAFT3
-UCHAR ExtHtCapIe = IE_EXT_CAPABILITY;
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-UCHAR ErpIe = IE_ERP;
-UCHAR DsIe = IE_DS_PARM;
-UCHAR TimIe = IE_TIM;
-UCHAR WpaIe = IE_WPA;
-UCHAR Wpa2Ie = IE_WPA2;
-UCHAR IbssIe = IE_IBSS_PARM;
-UCHAR Ccx2Ie = IE_CCX_V2;
-UCHAR WapiIe = IE_WAPI;
-
-extern UCHAR WPA_OUI[];
-
-UCHAR SES_OUI[] = {0x00, 0x90, 0x4c};
-
-UCHAR ZeroSsid[32] = {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
- 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
-
-
-/*
- ==========================================================================
- Description:
- initialize the MLME task and its data structure (queue, spinlock,
- timer, state machines).
-
- IRQL = PASSIVE_LEVEL
-
- Return:
- always return NDIS_STATUS_SUCCESS
-
- ==========================================================================
-*/
-NDIS_STATUS MlmeInit(
- IN PRTMP_ADAPTER pAd)
-{
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> MLME Initialize\n"));
-
- do
- {
- Status = MlmeQueueInit(&pAd->Mlme.Queue);
- if(Status != NDIS_STATUS_SUCCESS)
- break;
-
- pAd->Mlme.bRunning = FALSE;
- NdisAllocateSpinLock(&pAd->Mlme.TaskLock);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- BssTableInit(&pAd->ScanTab);
-
- // init STA state machines
- AssocStateMachineInit(pAd, &pAd->Mlme.AssocMachine, pAd->Mlme.AssocFunc);
- AuthStateMachineInit(pAd, &pAd->Mlme.AuthMachine, pAd->Mlme.AuthFunc);
- AuthRspStateMachineInit(pAd, &pAd->Mlme.AuthRspMachine, pAd->Mlme.AuthRspFunc);
- SyncStateMachineInit(pAd, &pAd->Mlme.SyncMachine, pAd->Mlme.SyncFunc);
-
-#ifdef QOS_DLS_SUPPORT
- DlsStateMachineInit(pAd, &pAd->Mlme.DlsMachine, pAd->Mlme.DlsFunc);
-#endif // QOS_DLS_SUPPORT //
-
-
-
- // Since we are using switch/case to implement it, the init is different from the above
- // state machine init
- MlmeCntlInit(pAd, &pAd->Mlme.CntlMachine, NULL);
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
- WpaStateMachineInit(pAd, &pAd->Mlme.WpaMachine, pAd->Mlme.WpaFunc);
-
-
- ActionStateMachineInit(pAd, &pAd->Mlme.ActMachine, pAd->Mlme.ActFunc);
-
- // Init mlme periodic timer
- RTMPInitTimer(pAd, &pAd->Mlme.PeriodicTimer, GET_TIMER_FUNCTION(MlmePeriodicExec), pAd, TRUE);
-
- // Set mlme periodic timer
- RTMPSetTimer(&pAd->Mlme.PeriodicTimer, MLME_TASK_EXEC_INTV);
-
- // software-based RX Antenna diversity
- RTMPInitTimer(pAd, &pAd->Mlme.RxAntEvalTimer, GET_TIMER_FUNCTION(AsicRxAntEvalTimeout), pAd, FALSE);
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef RTMP_PCI_SUPPORT
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- // only PCIe cards need these two timers
- RTMPInitTimer(pAd, &pAd->Mlme.PsPollTimer, GET_TIMER_FUNCTION(PsPollWakeExec), pAd, FALSE);
- RTMPInitTimer(pAd, &pAd->Mlme.RadioOnOffTimer, GET_TIMER_FUNCTION(RadioOnExec), pAd, FALSE);
- }
-#endif // RTMP_PCI_SUPPORT //
-
- RTMPInitTimer(pAd, &pAd->Mlme.LinkDownTimer, GET_TIMER_FUNCTION(LinkDownExec), pAd, FALSE);
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- } while (FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- MLME Initialize\n"));
-
- return Status;
-}
-
-/*
- ==========================================================================
- Description:
- main loop of the MLME
- Pre:
- Mlme has to be initialized, and there are something inside the queue
- Note:
- This function is invoked from MPSetInformation and MPReceive;
- This task guarantee only one MlmeHandler will run.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeHandler(
- IN PRTMP_ADAPTER pAd)
-{
- MLME_QUEUE_ELEM *Elem = NULL;
-#ifdef APCLI_SUPPORT
- SHORT apcliIfIndex;
-#endif // APCLI_SUPPORT //
-
- // Only accept MLME and Frame from peer side, no other (control/data) frame should
- // get into this state machine
-
- NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
- if(pAd->Mlme.bRunning)
- {
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
- return;
- }
- else
- {
- pAd->Mlme.bRunning = TRUE;
- }
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
-
- while (!MlmeQueueEmpty(&pAd->Mlme.Queue))
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_MLME_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Device Halted or Removed or MlmeRest, exit MlmeHandler! (queue num = %ld)\n", pAd->Mlme.Queue.Num));
- break;
- }
-
-#ifdef RALINK_ATE
- if(ATE_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("The driver is in ATE mode now in MlmeHandler\n"));
- break;
- }
-#endif // RALINK_ATE //
-
- //From message type, determine which state machine I should drive
- if (MlmeDequeue(&pAd->Mlme.Queue, &Elem))
- {
-
- // if dequeue success
- switch (Elem->Machine)
- {
- // STA state machines
-#ifdef CONFIG_STA_SUPPORT
- case ASSOC_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.AssocMachine, Elem);
- break;
- case AUTH_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.AuthMachine, Elem);
- break;
- case AUTH_RSP_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.AuthRspMachine, Elem);
- break;
- case SYNC_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.SyncMachine, Elem);
- break;
- case MLME_CNTL_STATE_MACHINE:
- MlmeCntlMachinePerformAction(pAd, &pAd->Mlme.CntlMachine, Elem);
- break;
- case WPA_PSK_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.WpaPskMachine, Elem);
- break;
-
-#ifdef QOS_DLS_SUPPORT
- case DLS_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.DlsMachine, Elem);
- break;
-#endif // QOS_DLS_SUPPORT //
-
-#endif // CONFIG_STA_SUPPORT //
-
- case ACTION_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.ActMachine, Elem);
- break;
-
- case WPA_STATE_MACHINE:
- StateMachinePerformAction(pAd, &pAd->Mlme.WpaMachine, Elem);
- break;
-
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("ERROR: Illegal machine %ld in MlmeHandler()\n", Elem->Machine));
- break;
- } // end of switch
-
- // free MLME element
- Elem->Occupied = FALSE;
- Elem->MsgLen = 0;
-
- }
- else {
- DBGPRINT_ERR(("MlmeHandler: MlmeQueue empty\n"));
- }
- }
-
- NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
- pAd->Mlme.bRunning = FALSE;
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
-}
-
-/*
- ==========================================================================
- Description:
- Destructor of MLME (Destroy queue, state machine, spin lock and timer)
- Parameters:
- Adapter - NIC Adapter pointer
- Post:
- The MLME task will no longer work properly
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-VOID MlmeHalt(
- IN PRTMP_ADAPTER pAd)
-{
- BOOLEAN Cancelled;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> MlmeHalt\n"));
-
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
- {
- // disable BEACON generation and other BEACON related hardware timers
- AsicDisableSync(pAd);
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef QOS_DLS_SUPPORT
- UCHAR i;
-#endif // QOS_DLS_SUPPORT //
- // Cancel pending timers
- RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
-
-
-#ifdef RTMP_MAC_PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)
- &&(pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
- {
- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
- RTMPCancelTimer(&pAd->Mlme.RadioOnOffTimer, &Cancelled);
- }
-#endif // RTMP_MAC_PCI //
-
-#ifdef QOS_DLS_SUPPORT
- for (i=0; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &Cancelled);
- }
-#endif // QOS_DLS_SUPPORT //
- RTMPCancelTimer(&pAd->Mlme.LinkDownTimer, &Cancelled);
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- RTMPCancelTimer(&pAd->Mlme.PeriodicTimer, &Cancelled);
- RTMPCancelTimer(&pAd->Mlme.RxAntEvalTimer, &Cancelled);
-
-
-
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))
- {
- RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
-
- // Set LED
- RTMPSetLED(pAd, LED_HALT);
- RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, firmware is not done it.
-
- if (pChipOps->AsicHaltAction)
- pChipOps->AsicHaltAction(pAd);
- }
-
- RTMPusecDelay(5000); // 5 msec to gurantee Ant Diversity timer canceled
-
- MlmeQueueDestroy(&pAd->Mlme.Queue);
- NdisFreeSpinLock(&pAd->Mlme.TaskLock);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeHalt\n"));
-}
-
-VOID MlmeResetRalinkCounters(
- IN PRTMP_ADAPTER pAd)
-{
- pAd->RalinkCounters.LastOneSecRxOkDataCnt = pAd->RalinkCounters.OneSecRxOkDataCnt;
- // clear all OneSecxxx counters.
- pAd->RalinkCounters.OneSecBeaconSentCnt = 0;
- pAd->RalinkCounters.OneSecFalseCCACnt = 0;
- pAd->RalinkCounters.OneSecRxFcsErrCnt = 0;
- pAd->RalinkCounters.OneSecRxOkCnt = 0;
- pAd->RalinkCounters.OneSecTxFailCount = 0;
- pAd->RalinkCounters.OneSecTxNoRetryOkCount = 0;
- pAd->RalinkCounters.OneSecTxRetryOkCount = 0;
- pAd->RalinkCounters.OneSecRxOkDataCnt = 0;
- pAd->RalinkCounters.OneSecReceivedByteCount = 0;
- pAd->RalinkCounters.OneSecTransmittedByteCount = 0;
-
- // TODO: for debug only. to be removed
- pAd->RalinkCounters.OneSecOsTxCount[QID_AC_BE] = 0;
- pAd->RalinkCounters.OneSecOsTxCount[QID_AC_BK] = 0;
- pAd->RalinkCounters.OneSecOsTxCount[QID_AC_VI] = 0;
- pAd->RalinkCounters.OneSecOsTxCount[QID_AC_VO] = 0;
- pAd->RalinkCounters.OneSecDmaDoneCount[QID_AC_BE] = 0;
- pAd->RalinkCounters.OneSecDmaDoneCount[QID_AC_BK] = 0;
- pAd->RalinkCounters.OneSecDmaDoneCount[QID_AC_VI] = 0;
- pAd->RalinkCounters.OneSecDmaDoneCount[QID_AC_VO] = 0;
- pAd->RalinkCounters.OneSecTxDoneCount = 0;
- pAd->RalinkCounters.OneSecRxCount = 0;
- pAd->RalinkCounters.OneSecTxAggregationCount = 0;
- pAd->RalinkCounters.OneSecRxAggregationCount = 0;
-
- return;
-}
-
-
-/*
- ==========================================================================
- Description:
- This routine is executed periodically to -
- 1. Decide if it's a right time to turn on PwrMgmt bit of all
- outgoiing frames
- 2. Calculate ChannelQuality based on statistics of the last
- period, so that TX rate won't toggling very frequently between a
- successful TX and a failed TX.
- 3. If the calculated ChannelQuality indicated current connection not
- healthy, then a ROAMing attempt is tried here.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-#define ADHOC_BEACON_LOST_TIME (8*OS_HZ) // 8 sec
-VOID MlmePeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- ULONG TxTotalCnt;
- PRTMP_ADAPTER pAd = (RTMP_ADAPTER *)FunctionContext;
- SHORT realavgrssi;
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef RTMP_MAC_PCI
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // If Hardware controlled Radio enabled, we have to check GPIO pin2 every 2 second.
- // Move code to here, because following code will return when radio is off
- if ((pAd->Mlme.PeriodicRound % (MLME_TASK_EXEC_MULTIPLE * 2) == 0) && (pAd->StaCfg.bHardwareRadio == TRUE) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- /*&&(pAd->bPCIclkOff == FALSE)*/)
- {
- UINT32 data = 0;
-
- // Read GPIO pin2 as Hardware controlled radio state
-#ifndef RT3090
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &data);
-#endif // RT3090 //
-//KH(PCIE PS):Added based on Jane<--
-#ifdef RT3090
-// Read GPIO pin2 as Hardware controlled radio state
-// We need to Read GPIO if HW said so no mater what advance power saving
-if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd))
- && (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
- && (pAd->StaCfg.PSControl.field.EnablePSinIdle == TRUE))
- {
- // Want to make sure device goes to L0 state before reading register.
- RTMPPCIeLinkCtrlValueRestore(pAd, 0);
- RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data);
- RTMPPCIeLinkCtrlSetting(pAd, 3);
- }
-else
- RTMP_IO_FORCE_READ32(pAd, GPIO_CTRL_CFG, &data);
-#endif // RT3090 //
-//KH(PCIE PS):Added based on Jane-->
-
- if (data & 0x04)
- {
- pAd->StaCfg.bHwRadio = TRUE;
- }
- else
- {
- pAd->StaCfg.bHwRadio = FALSE;
- }
- if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
- {
- pAd->StaCfg.bRadio = (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio);
- if (pAd->StaCfg.bRadio == TRUE)
- {
- MlmeRadioOn(pAd);
- // Update extra information
- pAd->ExtraInfo = EXTRA_INFO_CLEAR;
- }
- else
- {
- MlmeRadioOff(pAd);
- // Update extra information
- pAd->ExtraInfo = HW_RADIO_OFF;
- }
- }
- }
- }
-#endif // RTMP_MAC_PCI //
-#endif // CONFIG_STA_SUPPORT //
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if ((RTMP_TEST_FLAG(pAd, (fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_RADIO_MEASUREMENT |
- fRTMP_ADAPTER_RESET_IN_PROGRESS))))
- return;
-
- RTMP_MLME_PRE_SANITY_CHECK(pAd);
-
-#ifdef RALINK_ATE
- /* Do not show RSSI until "Normal 1 second Mlme PeriodicExec". */
- if (ATE_ON(pAd))
- {
- if (pAd->Mlme.PeriodicRound % MLME_TASK_EXEC_MULTIPLE != (MLME_TASK_EXEC_MULTIPLE - 1))
- {
- pAd->Mlme.PeriodicRound ++;
- return;
- }
- }
-#endif // RALINK_ATE //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Do nothing if monitor mode is on
- if (MONITOR_ON(pAd))
- return;
-
- if (pAd->Mlme.PeriodicRound & 0x1)
- {
- // This is the fix for wifi 11n extension channel overlapping test case. for 2860D
- if (((pAd->MACVersion & 0xffff) == 0x0101) &&
- (STA_TGN_WIFI_ON(pAd)) &&
- (pAd->CommonCfg.IOTestParm.bToggle == FALSE))
-
- {
- RTMP_IO_WRITE32(pAd, TXOP_CTRL_CFG, 0x24Bf);
- pAd->CommonCfg.IOTestParm.bToggle = TRUE;
- }
- else if ((STA_TGN_WIFI_ON(pAd)) &&
- ((pAd->MACVersion & 0xffff) == 0x0101))
- {
- RTMP_IO_WRITE32(pAd, TXOP_CTRL_CFG, 0x243f);
- pAd->CommonCfg.IOTestParm.bToggle = FALSE;
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- pAd->bUpdateBcnCntDone = FALSE;
-
-// RECBATimerTimeout(SystemSpecific1,FunctionContext,SystemSpecific2,SystemSpecific3);
- pAd->Mlme.PeriodicRound ++;
-
-
- // execute every 500ms
- if ((pAd->Mlme.PeriodicRound % 5 == 0) && RTMPAutoRateSwitchCheck(pAd)/*(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED))*/)
- {
-#ifdef CONFIG_STA_SUPPORT
- // perform dynamic tx rate switching based on past TX history
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
- )
- && (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)))
- MlmeDynamicTxRateSwitching(pAd);
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-
- // Normal 1 second Mlme PeriodicExec.
- if (pAd->Mlme.PeriodicRound %MLME_TASK_EXEC_MULTIPLE == 0)
- {
- pAd->Mlme.OneSecPeriodicRound ++;
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- /* request from Baron : move this routine from later to here */
- /* for showing Rx error count in ATE RXFRAME */
- NICUpdateRawCounters(pAd);
- if (pAd->ate.bRxFER == 1)
- {
- pAd->ate.RxTotalCnt += pAd->ate.RxCntPerSec;
- ate_print(KERN_EMERG "MlmePeriodicExec: Rx packet cnt = %d/%d\n", pAd->ate.RxCntPerSec, pAd->ate.RxTotalCnt);
- pAd->ate.RxCntPerSec = 0;
-
- if (pAd->ate.RxAntennaSel == 0)
- ate_print(KERN_EMERG "MlmePeriodicExec: Rx AvgRssi0=%d, AvgRssi1=%d, AvgRssi2=%d\n\n",
- pAd->ate.AvgRssi0, pAd->ate.AvgRssi1, pAd->ate.AvgRssi2);
- else
- ate_print(KERN_EMERG "MlmePeriodicExec: Rx AvgRssi=%d\n\n", pAd->ate.AvgRssi0);
- }
- MlmeResetRalinkCounters(pAd);
-
-
-
- return;
- }
-#endif // RALINK_ATE //
-
-
-
- //ORIBATimerTimeout(pAd);
-
- // Media status changed, report to NDIS
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE))
- {
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE);
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- pAd->IndicateMediaState = NdisMediaStateConnected;
- RTMP_IndicateMediaState(pAd);
- }
- else
- {
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- }
- }
-
- NdisGetSystemUpTime(&pAd->Mlme.Now32);
-
- // add the most up-to-date h/w raw counters into software variable, so that
- // the dynamic tuning mechanism below are based on most up-to-date information
- NICUpdateRawCounters(pAd);
-
-
-#ifdef DOT11_N_SUPPORT
- // Need statistics after read counter. So put after NICUpdateRawCounters
- ORIBATimerTimeout(pAd);
-#endif // DOT11_N_SUPPORT //
-
- // if MGMT RING is full more than twice within 1 second, we consider there's
- // a hardware problem stucking the TX path. In this case, try a hardware reset
- // to recover the system
- // if (pAd->RalinkCounters.MgmtRingFullCount >= 2)
- // RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HARDWARE_ERROR);
- // else
- // pAd->RalinkCounters.MgmtRingFullCount = 0;
-
- // The time period for checking antenna is according to traffic
-#ifdef ANT_DIVERSITY_SUPPORT
- if ((pAd->NicConfig2.field.AntDiversity) &&
- (pAd->CommonCfg.bRxAntDiversity == ANT_DIVERSITY_ENABLE) &&
- (!pAd->EepromAccess))
- AsicAntennaSelect(pAd, pAd->MlmeAux.Channel);
- else if(pAd->CommonCfg.bRxAntDiversity == ANT_FIX_ANT1 || pAd->CommonCfg.bRxAntDiversity == ANT_FIX_ANT2)
- {
-#ifdef CONFIG_STA_SUPPORT
- realavgrssi = (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1PrimaryRxAnt] >> 3);
-#endif // CONFIG_STA_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE,("Ant-realrssi0(%d), Lastrssi0(%d), EvaluateStableCnt=%d\n", realavgrssi, pAd->RxAnt.Pair1LastAvgRssi, pAd->RxAnt.EvaluateStableCnt));
- }
- else
-#endif // ANT_DIVERSITY_SUPPORT //
- {
- if (pAd->Mlme.bEnableAutoAntennaCheck)
- {
- TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
- pAd->RalinkCounters.OneSecTxRetryOkCount +
- pAd->RalinkCounters.OneSecTxFailCount;
-
- // dynamic adjust antenna evaluation period according to the traffic
- if (TxTotalCnt > 50)
- {
- if (pAd->Mlme.OneSecPeriodicRound % 10 == 0)
- {
- AsicEvaluateRxAnt(pAd);
- }
- }
- else
- {
- if (pAd->Mlme.OneSecPeriodicRound % 3 == 0)
- {
- AsicEvaluateRxAnt(pAd);
- }
- }
- }
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- STAMlmePeriodicExec(pAd);
-#endif // CONFIG_STA_SUPPORT //
-
- MlmeResetRalinkCounters(pAd);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef RTMP_MAC_PCI
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST) && (pAd->bPCIclkOff == FALSE))
-#endif // RTMP_MAC_PCI //
- {
- // When Adhoc beacon is enabled and RTS/CTS is enabled, there is a chance that hardware MAC FSM will run into a deadlock
- // and sending CTS-to-self over and over.
- // Software Patch Solution:
- // 1. Polling debug state register 0x10F4 every one second.
- // 2. If in 0x10F4 the ((bit29==1) && (bit7==1)) OR ((bit29==1) && (bit5==1)), it means the deadlock has occurred.
- // 3. If the deadlock occurred, reset MAC/BBP by setting 0x1004 to 0x0001 for a while then setting it back to 0x000C again.
-
- UINT32 MacReg = 0;
-
- RTMP_IO_READ32(pAd, 0x10F4, &MacReg);
- if (((MacReg & 0x20000000) && (MacReg & 0x80)) || ((MacReg & 0x20000000) && (MacReg & 0x20)))
- {
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x1);
- RTMPusecDelay(1);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0xC);
-
- DBGPRINT(RT_DEBUG_WARN,("Warning, MAC specific condition occurs \n"));
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- RTMP_MLME_HANDLER(pAd);
- }
-
-
- pAd->bUpdateBcnCntDone = FALSE;
-}
-
-
-/*
- ==========================================================================
- Validate SSID for connection try and rescan purpose
- Valid SSID will have visible chars only.
- The valid length is from 0 to 32.
- IRQL = DISPATCH_LEVEL
- ==========================================================================
- */
-BOOLEAN MlmeValidateSSID(
- IN PUCHAR pSsid,
- IN UCHAR SsidLen)
-{
- int index;
-
- if (SsidLen > MAX_LEN_OF_SSID)
- return (FALSE);
-
- // Check each character value
- for (index = 0; index < SsidLen; index++)
- {
- if (pSsid[index] < 0x20)
- return (FALSE);
- }
-
- // All checked
- return (TRUE);
-}
-
-VOID MlmeSelectTxRateTable(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR *ppTable,
- IN PUCHAR pTableSize,
- IN PUCHAR pInitTxRateIdx)
-{
- do
- {
- // decide the rate table for tuning
- if (pAd->CommonCfg.TxRateTableSize > 0)
- {
- *ppTable = RateSwitchTable;
- *pTableSize = RateSwitchTable[0];
- *pInitTxRateIdx = RateSwitchTable[1];
-
- break;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- if ((pAd->OpMode == OPMODE_STA) && ADHOC_ON(pAd))
- {
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) &&
- (pEntry->HTCapability.MCSSet[0] == 0xff) &&
- ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
- {// 11N 1S Adhoc
- *ppTable = RateSwitchTable11N1S;
- *pTableSize = RateSwitchTable11N1S[0];
- *pInitTxRateIdx = RateSwitchTable11N1S[1];
-
- }
- else if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) &&
- (pEntry->HTCapability.MCSSet[0] == 0xff) &&
- (pEntry->HTCapability.MCSSet[1] == 0xff) &&
- (pAd->Antenna.field.TxPath == 2))
- {// 11N 2S Adhoc
- if (pAd->LatchRfRegs.Channel <= 14)
- {
- *ppTable = RateSwitchTable11N2S;
- *pTableSize = RateSwitchTable11N2S[0];
- *pInitTxRateIdx = RateSwitchTable11N2S[1];
- }
- else
- {
- *ppTable = RateSwitchTable11N2SForABand;
- *pTableSize = RateSwitchTable11N2SForABand[0];
- *pInitTxRateIdx = RateSwitchTable11N2SForABand[1];
- }
-
- }
- else
-#endif // DOT11_N_SUPPORT //
- if ((pEntry->RateLen == 4)
-#ifdef DOT11_N_SUPPORT
- && (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)
-#endif // DOT11_N_SUPPORT //
- )
- {
- *ppTable = RateSwitchTable11B;
- *pTableSize = RateSwitchTable11B[0];
- *pInitTxRateIdx = RateSwitchTable11B[1];
-
- }
- else if (pAd->LatchRfRegs.Channel <= 14)
- {
- *ppTable = RateSwitchTable11BG;
- *pTableSize = RateSwitchTable11BG[0];
- *pInitTxRateIdx = RateSwitchTable11BG[1];
-
- }
- else
- {
- *ppTable = RateSwitchTable11G;
- *pTableSize = RateSwitchTable11G[0];
- *pInitTxRateIdx = RateSwitchTable11G[1];
-
- }
- break;
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
- //if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
- // ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
- if (((pEntry->RateLen == 12) || (pAd->OpMode == OPMODE_STA)) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
- ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
- {// 11BGN 1S AP
- *ppTable = RateSwitchTable11BGN1S;
- *pTableSize = RateSwitchTable11BGN1S[0];
- *pInitTxRateIdx = RateSwitchTable11BGN1S[1];
-
- break;
- }
-
- //else if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 12) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) &&
- // (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
- if (((pEntry->RateLen == 12) || (pAd->OpMode == OPMODE_STA)) && (pEntry->HTCapability.MCSSet[0] == 0xff) &&
- (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
- {// 11BGN 2S AP
- if (pAd->LatchRfRegs.Channel <= 14)
- {
- *ppTable = RateSwitchTable11BGN2S;
- *pTableSize = RateSwitchTable11BGN2S[0];
- *pInitTxRateIdx = RateSwitchTable11BGN2S[1];
-
- }
- else
- {
- *ppTable = RateSwitchTable11BGN2SForABand;
- *pTableSize = RateSwitchTable11BGN2SForABand[0];
- *pInitTxRateIdx = RateSwitchTable11BGN2SForABand[1];
-
- }
- break;
- }
-
- //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && ((pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0x00) || (pAd->Antenna.field.TxPath == 1)))
- if ((pEntry->HTCapability.MCSSet[0] == 0xff) && ((pEntry->HTCapability.MCSSet[1] == 0x00) || (pAd->CommonCfg.TxStream == 1)))
- {// 11N 1S AP
- *ppTable = RateSwitchTable11N1S;
- *pTableSize = RateSwitchTable11N1S[0];
- *pInitTxRateIdx = RateSwitchTable11N1S[1];
-
- break;
- }
-
- //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0xff) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0xff) && (pAd->Antenna.field.TxPath == 2))
- if ((pEntry->HTCapability.MCSSet[0] == 0xff) && (pEntry->HTCapability.MCSSet[1] == 0xff) && (pAd->CommonCfg.TxStream == 2))
- {// 11N 2S AP
- if (pAd->LatchRfRegs.Channel <= 14)
- {
- *ppTable = RateSwitchTable11N2S;
- *pTableSize = RateSwitchTable11N2S[0];
- *pInitTxRateIdx = RateSwitchTable11N2S[1];
- }
- else
- {
- *ppTable = RateSwitchTable11N2SForABand;
- *pTableSize = RateSwitchTable11N2SForABand[0];
- *pInitTxRateIdx = RateSwitchTable11N2SForABand[1];
- }
-
- break;
- }
-#endif // DOT11_N_SUPPORT //
- //else if ((pAd->StaActive.SupRateLen == 4) && (pAd->StaActive.ExtRateLen == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0))
- if ((pEntry->RateLen == 4 || pAd->CommonCfg.PhyMode==PHY_11B)
-#ifdef DOT11_N_SUPPORT
- //Iverson mark for Adhoc b mode,sta will use rate 54 Mbps when connect with sta b/g/n mode
- /* && (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)*/
-#endif // DOT11_N_SUPPORT //
- )
- {// B only AP
- *ppTable = RateSwitchTable11B;
- *pTableSize = RateSwitchTable11B[0];
- *pInitTxRateIdx = RateSwitchTable11B[1];
-
- break;
- }
-
- //else if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen > 8) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0))
- if ((pEntry->RateLen > 8)
-#ifdef DOT11_N_SUPPORT
- && (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)
-#endif // DOT11_N_SUPPORT //
- )
- {// B/G mixed AP
- *ppTable = RateSwitchTable11BG;
- *pTableSize = RateSwitchTable11BG[0];
- *pInitTxRateIdx = RateSwitchTable11BG[1];
-
- break;
- }
-
- //else if ((pAd->StaActive.SupRateLen + pAd->StaActive.ExtRateLen == 8) && (pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0))
- if ((pEntry->RateLen == 8)
-#ifdef DOT11_N_SUPPORT
- && (pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0)
-#endif // DOT11_N_SUPPORT //
- )
- {// G only AP
- *ppTable = RateSwitchTable11G;
- *pTableSize = RateSwitchTable11G[0];
- *pInitTxRateIdx = RateSwitchTable11G[1];
-
- break;
- }
-#ifdef DOT11_N_SUPPORT
-#endif // DOT11_N_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef DOT11_N_SUPPORT
- //else if ((pAd->StaActive.SupportedPhyInfo.MCSSet[0] == 0) && (pAd->StaActive.SupportedPhyInfo.MCSSet[1] == 0))
- if ((pEntry->HTCapability.MCSSet[0] == 0) && (pEntry->HTCapability.MCSSet[1] == 0))
-#endif // DOT11_N_SUPPORT //
- { // Legacy mode
- if (pAd->CommonCfg.MaxTxRate <= RATE_11)
- {
- *ppTable = RateSwitchTable11B;
- *pTableSize = RateSwitchTable11B[0];
- *pInitTxRateIdx = RateSwitchTable11B[1];
- }
- else if ((pAd->CommonCfg.MaxTxRate > RATE_11) && (pAd->CommonCfg.MinTxRate > RATE_11))
- {
- *ppTable = RateSwitchTable11G;
- *pTableSize = RateSwitchTable11G[0];
- *pInitTxRateIdx = RateSwitchTable11G[1];
-
- }
- else
- {
- *ppTable = RateSwitchTable11BG;
- *pTableSize = RateSwitchTable11BG[0];
- *pInitTxRateIdx = RateSwitchTable11BG[1];
- }
- break;
- }
-#ifdef DOT11_N_SUPPORT
- if (pAd->LatchRfRegs.Channel <= 14)
- {
- if (pAd->CommonCfg.TxStream == 1)
- {
- *ppTable = RateSwitchTable11N1S;
- *pTableSize = RateSwitchTable11N1S[0];
- *pInitTxRateIdx = RateSwitchTable11N1S[1];
- DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode,default use 11N 1S AP \n"));
- }
- else
- {
- *ppTable = RateSwitchTable11N2S;
- *pTableSize = RateSwitchTable11N2S[0];
- *pInitTxRateIdx = RateSwitchTable11N2S[1];
- DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode,default use 11N 2S AP \n"));
- }
- }
- else
- {
- if (pAd->CommonCfg.TxStream == 1)
- {
- *ppTable = RateSwitchTable11N1S;
- *pTableSize = RateSwitchTable11N1S[0];
- *pInitTxRateIdx = RateSwitchTable11N1S[1];
- DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode,default use 11N 1S AP \n"));
- }
- else
- {
- *ppTable = RateSwitchTable11N2SForABand;
- *pTableSize = RateSwitchTable11N2SForABand[0];
- *pInitTxRateIdx = RateSwitchTable11N2SForABand[1];
- DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode,default use 11N 2S AP \n"));
- }
- }
-#endif // DOT11_N_SUPPORT //
- DBGPRINT_RAW(RT_DEBUG_ERROR,("DRS: unkown mode (SupRateLen=%d, ExtRateLen=%d, MCSSet[0]=0x%x, MCSSet[1]=0x%x)\n",
- pAd->StaActive.SupRateLen, pAd->StaActive.ExtRateLen, pAd->StaActive.SupportedPhyInfo.MCSSet[0], pAd->StaActive.SupportedPhyInfo.MCSSet[1]));
- }
-#endif // CONFIG_STA_SUPPORT //
- } while(FALSE);
-}
-
-
-#ifdef CONFIG_STA_SUPPORT
-VOID STAMlmePeriodicExec(
- PRTMP_ADAPTER pAd)
-{
- ULONG TxTotalCnt;
- int i;
-
-
-
-
- /*
- We return here in ATE mode, because the statistics
- that ATE need are not collected via this routine.
- */
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
-#ifdef RALINK_ATE
- // It is supposed that we will never reach here in ATE mode.
- ASSERT(!(ATE_ON(pAd)));
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
-#ifdef PCIE_PS_SUPPORT
-// don't perform idle-power-save mechanism within 3 min after driver initialization.
-// This can make rebooter test more robust
-if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- if ((pAd->OpMode == OPMODE_STA) && (IDLE_ON(pAd))
- && (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE)
- && (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
- {
- if (IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd))
- {
- if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
-
- RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x2);
- // Wait command success
- AsicCheckCommanOk(pAd, PowerSafeCID);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
- DBGPRINT(RT_DEBUG_TRACE, ("PSM - rt30xx Issue Sleep command)\n"));
- }
- }
- else if (pAd->Mlme.OneSecPeriodicRound > 180)
- {
- if (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
- RT28xxPciAsicRadioOff(pAd, GUI_IDLE_POWER_SAVE, 0);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s::%d\n",__FUNCTION__,__LINE__));
- AsicSendCommandToMcu(pAd, 0x30, PowerSafeCID, 0xff, 0x02);
- // Wait command success
- AsicCheckCommanOk(pAd, PowerSafeCID);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
- DBGPRINT(RT_DEBUG_TRACE, ("PSM - rt28xx Issue Sleep command)\n"));
- }
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("STAMlmePeriodicExec MMCHK - CommonCfg.Ssid[%d]=%c%c%c%c... MlmeAux.Ssid[%d]=%c%c%c%c...\n",
- pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid[0], pAd->CommonCfg.Ssid[1], pAd->CommonCfg.Ssid[2], pAd->CommonCfg.Ssid[3],
- pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid[0], pAd->MlmeAux.Ssid[1], pAd->MlmeAux.Ssid[2], pAd->MlmeAux.Ssid[3]));
- }
- }
-#endif // PCIE_PS_SUPPORT //
-
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- // WPA MIC error should block association attempt for 60 seconds
- if (pAd->StaCfg.bBlockAssoc &&
- RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastMicErrorTime + (60*OS_HZ)))
- pAd->StaCfg.bBlockAssoc = FALSE;
- }
-
- if ((pAd->PreMediaState != pAd->IndicateMediaState) && (pAd->CommonCfg.bWirelessEvent))
- {
- if (pAd->IndicateMediaState == NdisMediaStateConnected)
- {
- RTMPSendWirelessEvent(pAd, IW_STA_LINKUP_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
- pAd->PreMediaState = pAd->IndicateMediaState;
- }
-
-
-
-
- if (pAd->CommonCfg.PSPXlink && ADHOC_ON(pAd))
- {
- }
- else
- {
- AsicStaBbpTuning(pAd);
- }
-
- TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
- pAd->RalinkCounters.OneSecTxRetryOkCount +
- pAd->RalinkCounters.OneSecTxFailCount;
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- // update channel quality for Roaming and UI LinkQuality display
- MlmeCalculateChannelQuality(pAd, NULL, pAd->Mlme.Now32);
- }
-
- // must be AFTER MlmeDynamicTxRateSwitching() because it needs to know if
- // Radio is currently in noisy environment
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- AsicAdjustTxPower(pAd);
-
- if (INFRA_ON(pAd))
- {
-#ifdef QOS_DLS_SUPPORT
- // Check DLS time out, then tear down those session
- RTMPCheckDLSTimeOut(pAd);
-#endif // QOS_DLS_SUPPORT //
-
- // Is PSM bit consistent with user power management policy?
- // This is the only place that will set PSM bit ON.
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- MlmeCheckPsmChange(pAd, pAd->Mlme.Now32);
-
- pAd->RalinkCounters.LastOneSecTotalTxCount = TxTotalCnt;
-
- if ((RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastBeaconRxTime + (1*OS_HZ))) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS)) &&
- (((TxTotalCnt + pAd->RalinkCounters.OneSecRxOkCnt) < 600)))
- {
- RTMPSetAGCInitValue(pAd, BW_20);
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. restore R66 to the low bound(%d) \n", (0x2E + GET_LNA_GAIN(pAd))));
- }
-
- //if ((pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
- // (pAd->RalinkCounters.OneSecTxRetryOkCount == 0))
- {
- if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable)
- {
- // When APSD is enabled, the period changes as 20 sec
- if ((pAd->Mlme.OneSecPeriodicRound % 20) == 8)
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- }
- else
- {
- // Send out a NULL frame every 10 sec to inform AP that STA is still alive (Avoid being age out)
- if ((pAd->Mlme.OneSecPeriodicRound % 10) == 8)
- {
- if (pAd->CommonCfg.bWmmCapable)
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- else
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, FALSE);
- }
- }
- }
-
- if (CQI_IS_DEAD(pAd->Mlme.ChannelQuality))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - No BEACON. Dead CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
-
- // Lost AP, send disconnect & link down event
- LinkDown(pAd, FALSE);
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- //send disassociate event to wpa_supplicant
- if (pAd->StaCfg.WpaSupplicantUP) {
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_DISASSOC_EVENT_FLAG, NULL, NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
- // RTMPPatchMacBbpBug(pAd);
- MlmeAutoReconnectLastSSID(pAd);
- }
- else if (CQI_IS_BAD(pAd->Mlme.ChannelQuality))
- {
- pAd->RalinkCounters.BadCQIAutoRecoveryCount ++;
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Bad CQI. Auto Recovery attempt #%ld\n", pAd->RalinkCounters.BadCQIAutoRecoveryCount));
- MlmeAutoReconnectLastSSID(pAd);
- }
-
- if (pAd->StaCfg.bAutoRoaming)
- {
- BOOLEAN rv = FALSE;
- CHAR dBmToRoam = pAd->StaCfg.dBmToRoam;
- CHAR MaxRssi = RTMPMaxRssi(pAd,
- pAd->StaCfg.RssiSample.LastRssi0,
- pAd->StaCfg.RssiSample.LastRssi1,
- pAd->StaCfg.RssiSample.LastRssi2);
-
- // Scanning, ignore Roaming
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) &&
- (pAd->Mlme.SyncMachine.CurrState == SYNC_IDLE) &&
- (MaxRssi <= dBmToRoam))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Rssi=%d, dBmToRoam=%d\n", MaxRssi, (CHAR)dBmToRoam));
-
-
- // Add auto seamless roaming
- if (rv == FALSE)
- rv = MlmeCheckForFastRoaming(pAd);
-
- if (rv == FALSE)
- {
- if ((pAd->StaCfg.LastScanTime + 10 * OS_HZ) < pAd->Mlme.Now32)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming, No eligable entry, try new scan!\n"));
- pAd->StaCfg.ScanCnt = 2;
- pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
- MlmeAutoScan(pAd);
- }
- }
- }
- }
- }
- else if (ADHOC_ON(pAd))
- {
-
- // If all peers leave, and this STA becomes the last one in this IBSS, then change MediaState
- // to DISCONNECTED. But still holding this IBSS (i.e. sending BEACON) so that other STAs can
- // join later.
- if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastBeaconRxTime + ADHOC_BEACON_LOST_TIME) &&
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- MLME_START_REQ_STRUCT StartReq;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - excessive BEACON lost, last STA in this IBSS, MediaState=Disconnected\n"));
- LinkDown(pAd, FALSE);
-
- StartParmFill(pAd, &StartReq, (CHAR *)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
- }
-
- for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
- {
- MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[i];
-
- if (pEntry->ValidAsCLI == FALSE)
- continue;
-
- if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pEntry->LastBeaconRxTime + ADHOC_BEACON_LOST_TIME))
- MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
- }
- }
- else // no INFRA nor ADHOC connection
- {
-
- if (pAd->StaCfg.bScanReqIsFromWebUI &&
- RTMP_TIME_BEFORE(pAd->Mlme.Now32, pAd->StaCfg.LastScanTime + (30 * OS_HZ)))
- goto SKIP_AUTO_SCAN_CONN;
- else
- pAd->StaCfg.bScanReqIsFromWebUI = FALSE;
-
- if ((pAd->StaCfg.bAutoReconnect == TRUE)
- && RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP)
- && (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
- {
- if ((pAd->ScanTab.BssNr==0) && (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE))
- {
- MLME_SCAN_REQ_STRUCT ScanReq;
-
- if (RTMP_TIME_AFTER(pAd->Mlme.Now32, pAd->StaCfg.LastScanTime + (10 * OS_HZ)))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("STAMlmePeriodicExec():CNTL - ScanTab.BssNr==0, start a new ACTIVE scan SSID[%s]\n", pAd->MlmeAux.AutoReconnectSsid));
- ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen, BSS_ANY, SCAN_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
- // Reset Missed scan number
- pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
- }
- else if (pAd->StaCfg.BssType == BSS_ADHOC) // Quit the forever scan when in a very clean room
- MlmeAutoReconnectLastSSID(pAd);
- }
- else if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- if ((pAd->Mlme.OneSecPeriodicRound % 7) == 0)
- {
- MlmeAutoScan(pAd);
- pAd->StaCfg.LastScanTime = pAd->Mlme.Now32;
- }
- else
- {
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- if (pAd->CommonCfg.CarrierDetect.Enable == TRUE)
- {
- if ((pAd->Mlme.OneSecPeriodicRound % 5) == 1)
- MlmeAutoReconnectLastSSID(pAd);
- }
- else
-#endif // CARRIER_DETECTION_SUPPORT //
- MlmeAutoReconnectLastSSID(pAd);
- }
- }
- }
- }
-
-SKIP_AUTO_SCAN_CONN:
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap !=0) && (pAd->MacTab.fAnyBASession == FALSE))
- {
- pAd->MacTab.fAnyBASession = TRUE;
- AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, FALSE, FALSE);
- }
- else if ((pAd->MacTab.Content[BSSID_WCID].TXBAbitmap ==0) && (pAd->MacTab.fAnyBASession == TRUE))
- {
- pAd->MacTab.fAnyBASession = FALSE;
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE);
- }
-#endif // DOT11_N_SUPPORT //
-
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SCAN_2040))
- TriEventCounterMaintenance(pAd);
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
- return;
-}
-
-// Link down report
-VOID LinkDownExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- if (pAd != NULL)
- {
- MLME_DISASSOC_REQ_STRUCT DisassocReq;
-
- if ((pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED) &&
- (INFRA_ON(pAd)))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("LinkDownExec(): disassociate with current AP...\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
- sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
-
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- }
- }
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeAutoScan(
- IN PRTMP_ADAPTER pAd)
-{
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Driver auto scan\n"));
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID_LIST_SCAN,
- pAd->MlmeAux.AutoReconnectSsidLen,
- pAd->MlmeAux.AutoReconnectSsid);
- RTMP_MLME_HANDLER(pAd);
- }
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeAutoReconnectLastSSID(
- IN PRTMP_ADAPTER pAd)
-{
- if (pAd->StaCfg.bAutoConnectByBssid)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Driver auto reconnect to last OID_802_11_BSSID setting - %02X:%02X:%02X:%02X:%02X:%02X\n",
- pAd->MlmeAux.Bssid[0],
- pAd->MlmeAux.Bssid[1],
- pAd->MlmeAux.Bssid[2],
- pAd->MlmeAux.Bssid[3],
- pAd->MlmeAux.Bssid[4],
- pAd->MlmeAux.Bssid[5]));
-
- pAd->MlmeAux.Channel = pAd->CommonCfg.Channel;
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID,
- MAC_ADDR_LEN,
- pAd->MlmeAux.Bssid);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- RTMP_MLME_HANDLER(pAd);
- }
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- else if ((pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE) &&
- (MlmeValidateSSID(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen) == TRUE))
- {
- NDIS_802_11_SSID OidSsid;
- OidSsid.SsidLength = pAd->MlmeAux.AutoReconnectSsidLen;
- NdisMoveMemory(OidSsid.Ssid, pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Driver auto reconnect to last OID_802_11_SSID setting - %s, len - %d\n", pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen));
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_SSID,
- sizeof(NDIS_802_11_SSID),
- &OidSsid);
- RTMP_MLME_HANDLER(pAd);
- }
-}
-
-
-/*
- ==========================================================================
- Description:
- This routine checks if there're other APs out there capable for
- roaming. Caller should call this routine only when Link up in INFRA mode
- and channel quality is below CQI_GOOD_THRESHOLD.
-
- IRQL = DISPATCH_LEVEL
-
- Output:
- ==========================================================================
- */
-VOID MlmeCheckForRoaming(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now32)
-{
- USHORT i;
- BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab;
- BSS_ENTRY *pBss;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> MlmeCheckForRoaming\n"));
- // put all roaming candidates into RoamTab, and sort in RSSI order
- BssTableInit(pRoamTab);
- for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
- pBss = &pAd->ScanTab.BssEntry[i];
-
- if ((pBss->LastBeaconRxTime + pAd->StaCfg.BeaconLostTime) < Now32)
- continue; // AP disappear
- if (pBss->Rssi <= RSSI_THRESHOLD_FOR_ROAMING)
- continue; // RSSI too weak. forget it.
- if (MAC_ADDR_EQUAL(pBss->Bssid, pAd->CommonCfg.Bssid))
- continue; // skip current AP
- if (pBss->Rssi < (pAd->StaCfg.RssiSample.LastRssi0 + RSSI_DELTA))
- continue; // only AP with stronger RSSI is eligible for roaming
-
- // AP passing all above rules is put into roaming candidate table
- NdisMoveMemory(&pRoamTab->BssEntry[pRoamTab->BssNr], pBss, sizeof(BSS_ENTRY));
- pRoamTab->BssNr += 1;
- }
-
- if (pRoamTab->BssNr > 0)
- {
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- pAd->RalinkCounters.PoorCQIRoamingCount ++;
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming attempt #%ld\n", pAd->RalinkCounters.PoorCQIRoamingCount));
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_MLME_ROAMING_REQ, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
- }
- }
- DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeCheckForRoaming(# of candidate= %d)\n",pRoamTab->BssNr));
-}
-
-/*
- ==========================================================================
- Description:
- This routine checks if there're other APs out there capable for
- roaming. Caller should call this routine only when link up in INFRA mode
- and channel quality is below CQI_GOOD_THRESHOLD.
-
- IRQL = DISPATCH_LEVEL
-
- Output:
- ==========================================================================
- */
-BOOLEAN MlmeCheckForFastRoaming(
- IN PRTMP_ADAPTER pAd)
-{
- USHORT i;
- BSS_TABLE *pRoamTab = &pAd->MlmeAux.RoamTab;
- BSS_ENTRY *pBss;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> MlmeCheckForFastRoaming\n"));
- // put all roaming candidates into RoamTab, and sort in RSSI order
- BssTableInit(pRoamTab);
- for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
- pBss = &pAd->ScanTab.BssEntry[i];
-
- if ((pBss->Rssi <= -50) && (pBss->Channel == pAd->CommonCfg.Channel))
- continue; // RSSI too weak. forget it.
- if (MAC_ADDR_EQUAL(pBss->Bssid, pAd->CommonCfg.Bssid))
- continue; // skip current AP
- if (!SSID_EQUAL(pBss->Ssid, pBss->SsidLen, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen))
- continue; // skip different SSID
- if (pBss->Rssi < (RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2) + RSSI_DELTA))
- continue; // skip AP without better RSSI
-
- DBGPRINT(RT_DEBUG_TRACE, ("LastRssi0 = %d, pBss->Rssi = %d\n", RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0, pAd->StaCfg.RssiSample.LastRssi1, pAd->StaCfg.RssiSample.LastRssi2), pBss->Rssi));
- // AP passing all above rules is put into roaming candidate table
- NdisMoveMemory(&pRoamTab->BssEntry[pRoamTab->BssNr], pBss, sizeof(BSS_ENTRY));
- pRoamTab->BssNr += 1;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<== MlmeCheckForFastRoaming (BssNr=%d)\n", pRoamTab->BssNr));
- if (pRoamTab->BssNr > 0)
- {
- // check CntlMachine.CurrState to avoid collision with NDIS SetOID request
- if (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)
- {
- pAd->RalinkCounters.PoorCQIRoamingCount ++;
- DBGPRINT(RT_DEBUG_TRACE, ("MMCHK - Roaming attempt #%ld\n", pAd->RalinkCounters.PoorCQIRoamingCount));
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_MLME_ROAMING_REQ, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
-VOID MlmeSetTxRate(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PRTMP_TX_RATE_SWITCH pTxRate)
-{
- UCHAR MaxMode = MODE_OFDM;
-
-#ifdef DOT11_N_SUPPORT
- MaxMode = MODE_HTGREENFIELD;
-
- if (pTxRate->STBC && (pAd->StaCfg.MaxHTPhyMode.field.STBC) && (pAd->Antenna.field.TxPath == 2))
- pAd->StaCfg.HTPhyMode.field.STBC = STBC_USE;
- else
-#endif // DOT11_N_SUPPORT //
- pAd->StaCfg.HTPhyMode.field.STBC = STBC_NONE;
-
- if (pTxRate->CurrMCS < MCS_AUTO)
- pAd->StaCfg.HTPhyMode.field.MCS = pTxRate->CurrMCS;
-
- if (pAd->StaCfg.HTPhyMode.field.MCS > 7)
- pAd->StaCfg.HTPhyMode.field.STBC = STBC_NONE;
-
- if (ADHOC_ON(pAd))
- {
- // If peer adhoc is b-only mode, we can't send 11g rate.
- pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
- pEntry->HTPhyMode.field.STBC = STBC_NONE;
-
- //
- // For Adhoc MODE_CCK, driver will use AdhocBOnlyJoined flag to roll back to B only if necessary
- //
- pEntry->HTPhyMode.field.MODE = pTxRate->Mode;
- pEntry->HTPhyMode.field.ShortGI = pAd->StaCfg.HTPhyMode.field.ShortGI;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
-
- // Patch speed error in status page
- pAd->StaCfg.HTPhyMode.field.MODE = pEntry->HTPhyMode.field.MODE;
- }
- else
- {
- if (pTxRate->Mode <= MaxMode)
- pAd->StaCfg.HTPhyMode.field.MODE = pTxRate->Mode;
-
-#ifdef DOT11_N_SUPPORT
- if (pTxRate->ShortGI && (pAd->StaCfg.MaxHTPhyMode.field.ShortGI))
- pAd->StaCfg.HTPhyMode.field.ShortGI = GI_400;
- else
-#endif // DOT11_N_SUPPORT //
- pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
-
-#ifdef DOT11_N_SUPPORT
- // Reexam each bandwidth's SGI support.
- if (pAd->StaCfg.HTPhyMode.field.ShortGI == GI_400)
- {
- if ((pEntry->HTPhyMode.field.BW == BW_20) && (!CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_SGI20_CAPABLE)))
- pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
- if ((pEntry->HTPhyMode.field.BW == BW_40) && (!CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_SGI40_CAPABLE)))
- pAd->StaCfg.HTPhyMode.field.ShortGI = GI_800;
- }
-
- // Turn RTS/CTS rate to 6Mbps.
- if ((pEntry->HTPhyMode.field.MCS == 0) && (pAd->StaCfg.HTPhyMode.field.MCS != 0))
- {
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- if (pAd->MacTab.fAnyBASession)
- {
- AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
- else
- {
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
- }
- else if ((pEntry->HTPhyMode.field.MCS == 8) && (pAd->StaCfg.HTPhyMode.field.MCS != 8))
- {
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- if (pAd->MacTab.fAnyBASession)
- {
- AsicUpdateProtect(pAd, HT_FORCERTSCTS, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
- else
- {
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
- }
- else if ((pEntry->HTPhyMode.field.MCS != 0) && (pAd->StaCfg.HTPhyMode.field.MCS == 0))
- {
- AsicUpdateProtect(pAd, HT_RTSCTS_6M, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
-
- }
- else if ((pEntry->HTPhyMode.field.MCS != 8) && (pAd->StaCfg.HTPhyMode.field.MCS == 8))
- {
- AsicUpdateProtect(pAd, HT_RTSCTS_6M, ALLN_SETPROTECT, TRUE, (BOOLEAN)pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent);
- }
-#endif // DOT11_N_SUPPORT //
-
- pEntry->HTPhyMode.field.STBC = pAd->StaCfg.HTPhyMode.field.STBC;
- pEntry->HTPhyMode.field.ShortGI = pAd->StaCfg.HTPhyMode.field.ShortGI;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
-#ifdef DOT11_N_SUPPORT
- if ((pAd->StaCfg.MaxHTPhyMode.field.MODE == MODE_HTGREENFIELD) &&
- pAd->WIFItestbed.bGreenField)
- pEntry->HTPhyMode.field.MODE = MODE_HTGREENFIELD;
-#endif // DOT11_N_SUPPORT //
- }
-
- pAd->LastTxRate = (USHORT)(pEntry->HTPhyMode.word);
-}
-
-/*
- ==========================================================================
- Description:
- This routine calculates the acumulated TxPER of eaxh TxRate. And
- according to the calculation result, change CommonCfg.TxRate which
- is the stable TX Rate we expect the Radio situation could sustained.
-
- CommonCfg.TxRate will change dynamically within {RATE_1/RATE_6, MaxTxRate}
- Output:
- CommonCfg.TxRate -
-
- IRQL = DISPATCH_LEVEL
-
- NOTE:
- call this routine every second
- ==========================================================================
- */
-VOID MlmeDynamicTxRateSwitching(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx;
- ULONG i, AccuTxTotalCnt = 0, TxTotalCnt;
- ULONG TxErrorRatio = 0;
- BOOLEAN bTxRateChanged = FALSE, bUpgradeQuality = FALSE;
- PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL;
- PUCHAR pTable;
- UCHAR TableSize = 0;
- UCHAR InitTxRateIdx = 0, TrainUp, TrainDown;
- CHAR Rssi, RssiOffset = 0;
- TX_STA_CNT1_STRUC StaTx1;
- TX_STA_CNT0_STRUC TxStaCnt0;
- ULONG TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0;
- MAC_TABLE_ENTRY *pEntry;
- RSSI_SAMPLE *pRssi = &pAd->StaCfg.RssiSample;
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- return;
- }
-#endif // RALINK_ATE //
-
- //
- // walk through MAC table, see if need to change AP's TX rate toward each entry
- //
- for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
- {
- pEntry = &pAd->MacTab.Content[i];
-
- // check if this entry need to switch rate automatically
- if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pEntry) == FALSE)
- continue;
-
- if ((pAd->MacTab.Size == 1) || (pEntry->ValidAsDls))
- {
- Rssi = RTMPMaxRssi(pAd,
- pRssi->AvgRssi0,
- pRssi->AvgRssi1,
- pRssi->AvgRssi2);
-
- // Update statistic counter
- RTMP_IO_READ32(pAd, TX_STA_CNT0, &TxStaCnt0.word);
- RTMP_IO_READ32(pAd, TX_STA_CNT1, &StaTx1.word);
- pAd->bUpdateBcnCntDone = TRUE;
- TxRetransmit = StaTx1.field.TxRetransmit;
- TxSuccess = StaTx1.field.TxSuccess;
- TxFailCount = TxStaCnt0.field.TxFailCount;
- TxTotalCnt = TxRetransmit + TxSuccess + TxFailCount;
-
- pAd->RalinkCounters.OneSecTxRetryOkCount += StaTx1.field.TxRetransmit;
- pAd->RalinkCounters.OneSecTxNoRetryOkCount += StaTx1.field.TxSuccess;
- pAd->RalinkCounters.OneSecTxFailCount += TxStaCnt0.field.TxFailCount;
- pAd->WlanCounters.TransmittedFragmentCount.u.LowPart += StaTx1.field.TxSuccess;
- pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit;
- pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
-
- // if no traffic in the past 1-sec period, don't change TX rate,
- // but clear all bad history. because the bad history may affect the next
- // Chariot throughput test
- AccuTxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
- pAd->RalinkCounters.OneSecTxRetryOkCount +
- pAd->RalinkCounters.OneSecTxFailCount;
-
- if (TxTotalCnt)
- TxErrorRatio = ((TxRetransmit + TxFailCount) * 100) / TxTotalCnt;
- }
- else
- {
- if (INFRA_ON(pAd) && (i == 1))
- Rssi = RTMPMaxRssi(pAd,
- pRssi->AvgRssi0,
- pRssi->AvgRssi1,
- pRssi->AvgRssi2);
- else
- Rssi = RTMPMaxRssi(pAd,
- pEntry->RssiSample.AvgRssi0,
- pEntry->RssiSample.AvgRssi1,
- pEntry->RssiSample.AvgRssi2);
-
- TxTotalCnt = pEntry->OneSecTxNoRetryOkCount +
- pEntry->OneSecTxRetryOkCount +
- pEntry->OneSecTxFailCount;
-
- if (TxTotalCnt)
- TxErrorRatio = ((pEntry->OneSecTxRetryOkCount + pEntry->OneSecTxFailCount) * 100) / TxTotalCnt;
- }
-
- if (TxTotalCnt)
- {
- /*
- Three AdHoc connections can not work normally if one AdHoc connection is disappeared from a heavy traffic environment generated by ping tool
- We force to set LongRtyLimit and ShortRtyLimit to 0 to stop retransmitting packet, after a while, resoring original settings
- */
- if (TxErrorRatio == 100)
- {
- TX_RTY_CFG_STRUC TxRtyCfg,TxRtyCfgtmp;
- ULONG Index;
- ULONG MACValue;
-
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &TxRtyCfg.word);
- TxRtyCfgtmp.word = TxRtyCfg.word;
- TxRtyCfg.field.LongRtyLimit = 0x0;
- TxRtyCfg.field.ShortRtyLimit = 0x0;
- RTMP_IO_WRITE32(pAd, TX_RTY_CFG, TxRtyCfg.word);
-
- RTMPusecDelay(1);
-
- Index = 0;
- MACValue = 0;
- do
- {
- RTMP_IO_READ32(pAd, TXRXQ_PCNT, &MACValue);
- if ((MACValue & 0xffffff) == 0)
- break;
- Index++;
- RTMPusecDelay(1000);
- }while((Index < 330)&&(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS)));
-
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &TxRtyCfg.word);
- TxRtyCfg.field.LongRtyLimit = TxRtyCfgtmp.field.LongRtyLimit;
- TxRtyCfg.field.ShortRtyLimit = TxRtyCfgtmp.field.ShortRtyLimit;
- RTMP_IO_WRITE32(pAd, TX_RTY_CFG, TxRtyCfg.word);
- }
- }
-
- CurrRateIdx = pEntry->CurrTxRateIndex;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &InitTxRateIdx);
-
- if (CurrRateIdx >= TableSize)
- {
- CurrRateIdx = TableSize - 1;
- }
-
- // When switch from Fixed rate -> auto rate, the REAL TX rate might be different from pAd->CommonCfg.TxRateIndex.
- // So need to sync here.
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(CurrRateIdx+1)*5];
- if ((pEntry->HTPhyMode.field.MCS != pCurrTxRate->CurrMCS)
- //&& (pAd->StaCfg.bAutoTxRateSwitch == TRUE)
- )
- {
-
- // Need to sync Real Tx rate and our record.
- // Then return for next DRS.
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(InitTxRateIdx+1)*5];
- pEntry->CurrTxRateIndex = InitTxRateIdx;
- MlmeSetTxRate(pAd, pEntry, pCurrTxRate);
-
- // reset all OneSecTx counters
- RESET_ONE_SEC_TX_CNT(pEntry);
- continue;
- }
-
- // decide the next upgrade rate and downgrade rate, if any
- if ((CurrRateIdx > 0) && (CurrRateIdx < (TableSize - 1)))
- {
- UpRateIdx = CurrRateIdx + 1;
- DownRateIdx = CurrRateIdx -1;
- }
- else if (CurrRateIdx == 0)
- {
- UpRateIdx = CurrRateIdx + 1;
- DownRateIdx = CurrRateIdx;
- }
- else if (CurrRateIdx == (TableSize - 1))
- {
- UpRateIdx = CurrRateIdx;
- DownRateIdx = CurrRateIdx - 1;
- }
-
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(CurrRateIdx+1)*5];
-
-#ifdef DOT11_N_SUPPORT
- if ((Rssi > -65) && (pCurrTxRate->Mode >= MODE_HTMIX))
- {
- TrainUp = (pCurrTxRate->TrainUp + (pCurrTxRate->TrainUp >> 1));
- TrainDown = (pCurrTxRate->TrainDown + (pCurrTxRate->TrainDown >> 1));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- TrainUp = pCurrTxRate->TrainUp;
- TrainDown = pCurrTxRate->TrainDown;
- }
-
- //pAd->DrsCounters.LastTimeTxRateChangeAction = pAd->DrsCounters.LastSecTxRateChangeAction;
-
- //
- // Keep the last time TxRateChangeAction status.
- //
- pEntry->LastTimeTxRateChangeAction = pEntry->LastSecTxRateChangeAction;
-
-
-
- //
- // CASE 1. when TX samples are fewer than 15, then decide TX rate solely on RSSI
- // (criteria copied from RT2500 for Netopia case)
- //
- if (TxTotalCnt <= 15)
- {
- CHAR idx = 0;
- UCHAR TxRateIdx;
- UCHAR MCS0 = 0, MCS1 = 0, MCS2 = 0, MCS3 = 0, MCS4 = 0, MCS5 =0, MCS6 = 0, MCS7 = 0;
- UCHAR MCS12 = 0, MCS13 = 0, MCS14 = 0, MCS15 = 0;
- UCHAR MCS20 = 0, MCS21 = 0, MCS22 = 0, MCS23 = 0; // 3*3
-
- // check the existence and index of each needed MCS
- while (idx < pTable[0])
- {
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(idx+1)*5];
-
- if (pCurrTxRate->CurrMCS == MCS_0)
- {
- MCS0 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_1)
- {
- MCS1 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_2)
- {
- MCS2 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_3)
- {
- MCS3 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_4)
- {
- MCS4 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_5)
- {
- MCS5 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_6)
- {
- MCS6 = idx;
- }
- //else if (pCurrTxRate->CurrMCS == MCS_7)
- else if ((pCurrTxRate->CurrMCS == MCS_7) && (pCurrTxRate->ShortGI == GI_800)) // prevent the highest MCS using short GI when 1T and low throughput
- {
- MCS7 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_12)
- {
- MCS12 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_13)
- {
- MCS13 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_14)
- {
- MCS14 = idx;
- }
- //else if ((pCurrTxRate->CurrMCS == MCS_15)/* && (pCurrTxRate->ShortGI == GI_800)*/) //we hope to use ShortGI as initial rate
- else if ((pCurrTxRate->CurrMCS == MCS_15) && (pCurrTxRate->ShortGI == GI_800)) //we hope to use ShortGI as initial rate, however Atheros's chip has bugs when short GI
- {
- MCS15 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_20) // 3*3
- {
- MCS20 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_21)
- {
- MCS21 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_22)
- {
- MCS22 = idx;
- }
- else if (pCurrTxRate->CurrMCS == MCS_23)
- {
- MCS23 = idx;
- }
- idx ++;
- }
-
- if (pAd->LatchRfRegs.Channel <= 14)
- {
- if (pAd->NicConfig2.field.ExternalLNAForG)
- {
- RssiOffset = 2;
- }
- else
- {
- RssiOffset = 5;
- }
- }
- else
- {
- if (pAd->NicConfig2.field.ExternalLNAForA)
- {
- RssiOffset = 5;
- }
- else
- {
- RssiOffset = 8;
- }
- }
-#ifdef DOT11_N_SUPPORT
- /*if (MCS15)*/
- if ((pTable == RateSwitchTable11BGN3S) ||
- (pTable == RateSwitchTable11N3S) ||
- (pTable == RateSwitchTable))
- {// N mode with 3 stream // 3*3
- if (MCS23 && (Rssi >= -70))
- TxRateIdx = MCS23;
- else if (MCS22 && (Rssi >= -72))
- TxRateIdx = MCS22;
- else if (MCS21 && (Rssi >= -76))
- TxRateIdx = MCS21;
- else if (MCS20 && (Rssi >= -78))
- TxRateIdx = MCS20;
- else if (MCS4 && (Rssi >= -82))
- TxRateIdx = MCS4;
- else if (MCS3 && (Rssi >= -84))
- TxRateIdx = MCS3;
- else if (MCS2 && (Rssi >= -86))
- TxRateIdx = MCS2;
- else if (MCS1 && (Rssi >= -88))
- TxRateIdx = MCS1;
- else
- TxRateIdx = MCS0;
- }
-// else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand) || (pTable == RateSwitchTable))
- else if ((pTable == RateSwitchTable11BGN2S) || (pTable == RateSwitchTable11BGN2SForABand) ||(pTable == RateSwitchTable11N2S) ||(pTable == RateSwitchTable11N2SForABand)) // 3*3
- {// N mode with 2 stream
- if (MCS15 && (Rssi >= (-70+RssiOffset)))
- TxRateIdx = MCS15;
- else if (MCS14 && (Rssi >= (-72+RssiOffset)))
- TxRateIdx = MCS14;
- else if (MCS13 && (Rssi >= (-76+RssiOffset)))
- TxRateIdx = MCS13;
- else if (MCS12 && (Rssi >= (-78+RssiOffset)))
- TxRateIdx = MCS12;
- else if (MCS4 && (Rssi >= (-82+RssiOffset)))
- TxRateIdx = MCS4;
- else if (MCS3 && (Rssi >= (-84+RssiOffset)))
- TxRateIdx = MCS3;
- else if (MCS2 && (Rssi >= (-86+RssiOffset)))
- TxRateIdx = MCS2;
- else if (MCS1 && (Rssi >= (-88+RssiOffset)))
- TxRateIdx = MCS1;
- else
- TxRateIdx = MCS0;
- }
- else if ((pTable == RateSwitchTable11BGN1S) || (pTable == RateSwitchTable11N1S))
- {// N mode with 1 stream
- if (MCS7 && (Rssi > (-72+RssiOffset)))
- TxRateIdx = MCS7;
- else if (MCS6 && (Rssi > (-74+RssiOffset)))
- TxRateIdx = MCS6;
- else if (MCS5 && (Rssi > (-77+RssiOffset)))
- TxRateIdx = MCS5;
- else if (MCS4 && (Rssi > (-79+RssiOffset)))
- TxRateIdx = MCS4;
- else if (MCS3 && (Rssi > (-81+RssiOffset)))
- TxRateIdx = MCS3;
- else if (MCS2 && (Rssi > (-83+RssiOffset)))
- TxRateIdx = MCS2;
- else if (MCS1 && (Rssi > (-86+RssiOffset)))
- TxRateIdx = MCS1;
- else
- TxRateIdx = MCS0;
- }
- else
-#endif // DOT11_N_SUPPORT //
- {// Legacy mode
- if (MCS7 && (Rssi > -70))
- TxRateIdx = MCS7;
- else if (MCS6 && (Rssi > -74))
- TxRateIdx = MCS6;
- else if (MCS5 && (Rssi > -78))
- TxRateIdx = MCS5;
- else if (MCS4 && (Rssi > -82))
- TxRateIdx = MCS4;
- else if (MCS4 == 0) // for B-only mode
- TxRateIdx = MCS3;
- else if (MCS3 && (Rssi > -85))
- TxRateIdx = MCS3;
- else if (MCS2 && (Rssi > -87))
- TxRateIdx = MCS2;
- else if (MCS1 && (Rssi > -90))
- TxRateIdx = MCS1;
- else
- TxRateIdx = MCS0;
- }
-
- // if (TxRateIdx != pAd->CommonCfg.TxRateIndex)
- {
- pEntry->CurrTxRateIndex = TxRateIdx;
- pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pEntry->CurrTxRateIndex+1)*5];
- MlmeSetTxRate(pAd, pEntry, pNextTxRate);
- }
-
- NdisZeroMemory(pEntry->TxQuality, sizeof(USHORT) * MAX_STEP_OF_TX_RATE_SWITCH);
- NdisZeroMemory(pEntry->PER, sizeof(UCHAR) * MAX_STEP_OF_TX_RATE_SWITCH);
- pEntry->fLastSecAccordingRSSI = TRUE;
- // reset all OneSecTx counters
- RESET_ONE_SEC_TX_CNT(pEntry);
-
- continue;
- }
-
- if (pEntry->fLastSecAccordingRSSI == TRUE)
- {
- pEntry->fLastSecAccordingRSSI = FALSE;
- pEntry->LastSecTxRateChangeAction = 0;
- // reset all OneSecTx counters
- RESET_ONE_SEC_TX_CNT(pEntry);
-
- continue;
- }
-
- do
- {
- BOOLEAN bTrainUpDown = FALSE;
-
- pEntry->CurrTxRateStableTime ++;
-
- // downgrade TX quality if PER >= Rate-Down threshold
- if (TxErrorRatio >= TrainDown)
- {
- bTrainUpDown = TRUE;
- pEntry->TxQuality[CurrRateIdx] = DRS_TX_QUALITY_WORST_BOUND;
- }
- // upgrade TX quality if PER <= Rate-Up threshold
- else if (TxErrorRatio <= TrainUp)
- {
- bTrainUpDown = TRUE;
- bUpgradeQuality = TRUE;
- if (pEntry->TxQuality[CurrRateIdx])
- pEntry->TxQuality[CurrRateIdx] --; // quality very good in CurrRate
-
- if (pEntry->TxRateUpPenalty)
- pEntry->TxRateUpPenalty --;
- else if (pEntry->TxQuality[UpRateIdx])
- pEntry->TxQuality[UpRateIdx] --; // may improve next UP rate's quality
- }
-
- pEntry->PER[CurrRateIdx] = (UCHAR)TxErrorRatio;
-
- if (bTrainUpDown)
- {
- // perform DRS - consider TxRate Down first, then rate up.
- if ((CurrRateIdx != DownRateIdx) && (pEntry->TxQuality[CurrRateIdx] >= DRS_TX_QUALITY_WORST_BOUND))
- {
- pEntry->CurrTxRateIndex = DownRateIdx;
- }
- else if ((CurrRateIdx != UpRateIdx) && (pEntry->TxQuality[UpRateIdx] <= 0))
- {
- pEntry->CurrTxRateIndex = UpRateIdx;
- }
- }
- } while (FALSE);
-
- // if rate-up happen, clear all bad history of all TX rates
- if (pEntry->CurrTxRateIndex > CurrRateIdx)
- {
- pEntry->CurrTxRateStableTime = 0;
- pEntry->TxRateUpPenalty = 0;
- pEntry->LastSecTxRateChangeAction = 1; // rate UP
- NdisZeroMemory(pEntry->TxQuality, sizeof(USHORT) * MAX_STEP_OF_TX_RATE_SWITCH);
- NdisZeroMemory(pEntry->PER, sizeof(UCHAR) * MAX_STEP_OF_TX_RATE_SWITCH);
-
- //
- // For TxRate fast train up
- //
- if (!pAd->StaCfg.StaQuickResponeForRateUpTimerRunning)
- {
- RTMPSetTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, 100);
-
- pAd->StaCfg.StaQuickResponeForRateUpTimerRunning = TRUE;
- }
- bTxRateChanged = TRUE;
- }
- // if rate-down happen, only clear DownRate's bad history
- else if (pEntry->CurrTxRateIndex < CurrRateIdx)
- {
- pEntry->CurrTxRateStableTime = 0;
- pEntry->TxRateUpPenalty = 0; // no penalty
- pEntry->LastSecTxRateChangeAction = 2; // rate DOWN
- pEntry->TxQuality[pEntry->CurrTxRateIndex] = 0;
- pEntry->PER[pEntry->CurrTxRateIndex] = 0;
-
- //
- // For TxRate fast train down
- //
- if (!pAd->StaCfg.StaQuickResponeForRateUpTimerRunning)
- {
- RTMPSetTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, 100);
-
- pAd->StaCfg.StaQuickResponeForRateUpTimerRunning = TRUE;
- }
- bTxRateChanged = TRUE;
- }
- else
- {
- pEntry->LastSecTxRateChangeAction = 0; // rate no change
- bTxRateChanged = FALSE;
- }
-
- pEntry->LastTxOkCount = TxSuccess;
-
- {
- UCHAR tmpTxRate;
-
- // to fix tcp ack issue
- if (!bTxRateChanged && (pAd->RalinkCounters.OneSecReceivedByteCount > (pAd->RalinkCounters.OneSecTransmittedByteCount * 5)))
- {
- tmpTxRate = DownRateIdx;
- DBGPRINT_RAW(RT_DEBUG_TRACE,("DRS: Rx(%d) is 5 times larger than Tx(%d), use low rate (curr=%d, tmp=%d)\n",
- pAd->RalinkCounters.OneSecReceivedByteCount, pAd->RalinkCounters.OneSecTransmittedByteCount, pEntry->CurrTxRateIndex, tmpTxRate));
- }
- else
- {
- tmpTxRate = pEntry->CurrTxRateIndex;
- }
-
- pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(tmpTxRate+1)*5];
- if (bTxRateChanged && pNextTxRate)
- {
- MlmeSetTxRate(pAd, pEntry, pNextTxRate);
- }
- }
- // reset all OneSecTx counters
- RESET_ONE_SEC_TX_CNT(pEntry);
- }
-}
-
-/*
- ========================================================================
- Routine Description:
- Station side, Auto TxRate faster train up timer call back function.
-
- Arguments:
- SystemSpecific1 - Not used.
- FunctionContext - Pointer to our Adapter context.
- SystemSpecific2 - Not used.
- SystemSpecific3 - Not used.
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID StaQuickResponeForRateUpExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER)FunctionContext;
- UCHAR UpRateIdx = 0, DownRateIdx = 0, CurrRateIdx = 0;
- ULONG TxTotalCnt;
- ULONG TxErrorRatio = 0;
- BOOLEAN bTxRateChanged; //, bUpgradeQuality = FALSE;
- PRTMP_TX_RATE_SWITCH pCurrTxRate, pNextTxRate = NULL;
- PUCHAR pTable;
- UCHAR TableSize = 0;
- UCHAR InitTxRateIdx = 0, TrainUp, TrainDown;
- TX_STA_CNT1_STRUC StaTx1;
- TX_STA_CNT0_STRUC TxStaCnt0;
- CHAR Rssi, ratio;
- ULONG TxRetransmit = 0, TxSuccess = 0, TxFailCount = 0;
- MAC_TABLE_ENTRY *pEntry;
- ULONG i;
-
- pAd->StaCfg.StaQuickResponeForRateUpTimerRunning = FALSE;
-
- //
- // walk through MAC table, see if need to change AP's TX rate toward each entry
- //
- for (i = 1; i < MAX_LEN_OF_MAC_TABLE; i++)
- {
- pEntry = &pAd->MacTab.Content[i];
-
- // check if this entry need to switch rate automatically
- if (RTMPCheckEntryEnableAutoRateSwitch(pAd, pEntry) == FALSE)
- continue;
-
- if (INFRA_ON(pAd) && (i == 1))
- Rssi = RTMPMaxRssi(pAd,
- pAd->StaCfg.RssiSample.AvgRssi0,
- pAd->StaCfg.RssiSample.AvgRssi1,
- pAd->StaCfg.RssiSample.AvgRssi2);
- else
- Rssi = RTMPMaxRssi(pAd,
- pEntry->RssiSample.AvgRssi0,
- pEntry->RssiSample.AvgRssi1,
- pEntry->RssiSample.AvgRssi2);
-
- CurrRateIdx = pAd->CommonCfg.TxRateIndex;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &InitTxRateIdx);
-
- // decide the next upgrade rate and downgrade rate, if any
- if ((CurrRateIdx > 0) && (CurrRateIdx < (TableSize - 1)))
- {
- UpRateIdx = CurrRateIdx + 1;
- DownRateIdx = CurrRateIdx -1;
- }
- else if (CurrRateIdx == 0)
- {
- UpRateIdx = CurrRateIdx + 1;
- DownRateIdx = CurrRateIdx;
- }
- else if (CurrRateIdx == (TableSize - 1))
- {
- UpRateIdx = CurrRateIdx;
- DownRateIdx = CurrRateIdx - 1;
- }
-
- pCurrTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(CurrRateIdx+1)*5];
-
-#ifdef DOT11_N_SUPPORT
- if ((Rssi > -65) && (pCurrTxRate->Mode >= MODE_HTMIX))
- {
- TrainUp = (pCurrTxRate->TrainUp + (pCurrTxRate->TrainUp >> 1));
- TrainDown = (pCurrTxRate->TrainDown + (pCurrTxRate->TrainDown >> 1));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- TrainUp = pCurrTxRate->TrainUp;
- TrainDown = pCurrTxRate->TrainDown;
- }
-
- if (pAd->MacTab.Size == 1)
- {
- // Update statistic counter
- RTMP_IO_READ32(pAd, TX_STA_CNT0, &TxStaCnt0.word);
- RTMP_IO_READ32(pAd, TX_STA_CNT1, &StaTx1.word);
-
- TxRetransmit = StaTx1.field.TxRetransmit;
- TxSuccess = StaTx1.field.TxSuccess;
- TxFailCount = TxStaCnt0.field.TxFailCount;
- TxTotalCnt = TxRetransmit + TxSuccess + TxFailCount;
-
- pAd->RalinkCounters.OneSecTxRetryOkCount += StaTx1.field.TxRetransmit;
- pAd->RalinkCounters.OneSecTxNoRetryOkCount += StaTx1.field.TxSuccess;
- pAd->RalinkCounters.OneSecTxFailCount += TxStaCnt0.field.TxFailCount;
- pAd->WlanCounters.TransmittedFragmentCount.u.LowPart += StaTx1.field.TxSuccess;
- pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit;
- pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
-
- if (TxTotalCnt)
- TxErrorRatio = ((TxRetransmit + TxFailCount) * 100) / TxTotalCnt;
- }
- else
- {
- TxTotalCnt = pEntry->OneSecTxNoRetryOkCount +
- pEntry->OneSecTxRetryOkCount +
- pEntry->OneSecTxFailCount;
-
- if (TxTotalCnt)
- TxErrorRatio = ((pEntry->OneSecTxRetryOkCount + pEntry->OneSecTxFailCount) * 100) / TxTotalCnt;
- }
-
-
- //
- // CASE 1. when TX samples are fewer than 15, then decide TX rate solely on RSSI
- // (criteria copied from RT2500 for Netopia case)
- //
- if (TxTotalCnt <= 12)
- {
- NdisZeroMemory(pAd->DrsCounters.TxQuality, sizeof(USHORT) * MAX_STEP_OF_TX_RATE_SWITCH);
- NdisZeroMemory(pAd->DrsCounters.PER, sizeof(UCHAR) * MAX_STEP_OF_TX_RATE_SWITCH);
-
- if ((pAd->DrsCounters.LastSecTxRateChangeAction == 1) && (CurrRateIdx != DownRateIdx))
- {
- pAd->CommonCfg.TxRateIndex = DownRateIdx;
- pAd->DrsCounters.TxQuality[CurrRateIdx] = DRS_TX_QUALITY_WORST_BOUND;
- }
- else if ((pAd->DrsCounters.LastSecTxRateChangeAction == 2) && (CurrRateIdx != UpRateIdx))
- {
- pAd->CommonCfg.TxRateIndex = UpRateIdx;
- }
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,("QuickDRS: TxTotalCnt <= 15, train back to original rate \n"));
- return;
- }
-
- do
- {
- ULONG OneSecTxNoRetryOKRationCount;
-
- if (pAd->DrsCounters.LastTimeTxRateChangeAction == 0)
- ratio = 5;
- else
- ratio = 4;
-
- // downgrade TX quality if PER >= Rate-Down threshold
- if (TxErrorRatio >= TrainDown)
- {
- pAd->DrsCounters.TxQuality[CurrRateIdx] = DRS_TX_QUALITY_WORST_BOUND;
- }
-
- pAd->DrsCounters.PER[CurrRateIdx] = (UCHAR)TxErrorRatio;
-
- OneSecTxNoRetryOKRationCount = (TxSuccess * ratio);
-
- // perform DRS - consider TxRate Down first, then rate up.
- if ((pAd->DrsCounters.LastSecTxRateChangeAction == 1) && (CurrRateIdx != DownRateIdx))
- {
- if ((pAd->DrsCounters.LastTxOkCount + 2) >= OneSecTxNoRetryOKRationCount)
- {
- pAd->CommonCfg.TxRateIndex = DownRateIdx;
- pAd->DrsCounters.TxQuality[CurrRateIdx] = DRS_TX_QUALITY_WORST_BOUND;
-
- }
-
- }
- else if ((pAd->DrsCounters.LastSecTxRateChangeAction == 2) && (CurrRateIdx != UpRateIdx))
- {
- if ((TxErrorRatio >= 50) || (TxErrorRatio >= TrainDown))
- {
-
- }
- else if ((pAd->DrsCounters.LastTxOkCount + 2) >= OneSecTxNoRetryOKRationCount)
- {
- pAd->CommonCfg.TxRateIndex = UpRateIdx;
- }
- }
- }while (FALSE);
-
- // if rate-up happen, clear all bad history of all TX rates
- if (pAd->CommonCfg.TxRateIndex > CurrRateIdx)
- {
- pAd->DrsCounters.TxRateUpPenalty = 0;
- NdisZeroMemory(pAd->DrsCounters.TxQuality, sizeof(USHORT) * MAX_STEP_OF_TX_RATE_SWITCH);
- NdisZeroMemory(pAd->DrsCounters.PER, sizeof(UCHAR) * MAX_STEP_OF_TX_RATE_SWITCH);
- bTxRateChanged = TRUE;
- }
- // if rate-down happen, only clear DownRate's bad history
- else if (pAd->CommonCfg.TxRateIndex < CurrRateIdx)
- {
- DBGPRINT_RAW(RT_DEBUG_TRACE,("QuickDRS: --TX rate from %d to %d \n", CurrRateIdx, pAd->CommonCfg.TxRateIndex));
-
- pAd->DrsCounters.TxRateUpPenalty = 0; // no penalty
- pAd->DrsCounters.TxQuality[pAd->CommonCfg.TxRateIndex] = 0;
- pAd->DrsCounters.PER[pAd->CommonCfg.TxRateIndex] = 0;
- bTxRateChanged = TRUE;
- }
- else
- {
- bTxRateChanged = FALSE;
- }
-
- pNextTxRate = (PRTMP_TX_RATE_SWITCH) &pTable[(pAd->CommonCfg.TxRateIndex+1)*5];
- if (bTxRateChanged && pNextTxRate)
- {
- MlmeSetTxRate(pAd, pEntry, pNextTxRate);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
- This routine is executed periodically inside MlmePeriodicExec() after
- association with an AP.
- It checks if StaCfg.Psm is consistent with user policy (recorded in
- StaCfg.WindowsPowerMode). If not, enforce user policy. However,
- there're some conditions to consider:
- 1. we don't support power-saving in ADHOC mode, so Psm=PWR_ACTIVE all
- the time when Mibss==TRUE
- 2. When link up in INFRA mode, Psm should not be switch to PWR_SAVE
- if outgoing traffic available in TxRing or MgmtRing.
- Output:
- 1. change pAd->StaCfg.Psm to PWR_SAVE or leave it untouched
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeCheckPsmChange(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now32)
-{
- ULONG PowerMode;
-
- // condition -
- // 1. Psm maybe ON only happen in INFRASTRUCTURE mode
- // 2. user wants either MAX_PSP or FAST_PSP
- // 3. but current psm is not in PWR_SAVE
- // 4. CNTL state machine is not doing SCANning
- // 5. no TX SUCCESS event for the past 1-sec period
- PowerMode = pAd->StaCfg.WindowsPowerMode;
-
- if (INFRA_ON(pAd) &&
- (PowerMode != Ndis802_11PowerModeCAM) &&
- (pAd->StaCfg.Psm == PWR_ACTIVE) &&
-// (! RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- (pAd->Mlme.CntlMachine.CurrState == CNTL_IDLE)&&
- RTMP_TEST_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP)
- /*&&
- (pAd->RalinkCounters.OneSecTxNoRetryOkCount == 0) &&
- (pAd->RalinkCounters.OneSecTxRetryOkCount == 0)*/)
- {
- NdisGetSystemUpTime(&pAd->Mlme.LastSendNULLpsmTime);
- pAd->RalinkCounters.RxCountSinceLastNULL = 0;
- RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
- if (!(pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable))
- {
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, FALSE);
- }
- else
- {
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- }
- }
-}
-
-// IRQL = PASSIVE_LEVEL
-// IRQL = DISPATCH_LEVEL
-VOID MlmeSetPsmBit(
- IN PRTMP_ADAPTER pAd,
- IN USHORT psm)
-{
- AUTO_RSP_CFG_STRUC csr4;
-
- pAd->StaCfg.Psm = psm;
- RTMP_IO_READ32(pAd, AUTO_RSP_CFG, &csr4.word);
- csr4.field.AckCtsPsmBit = (psm == PWR_SAVE)? 1:0;
- RTMP_IO_WRITE32(pAd, AUTO_RSP_CFG, csr4.word);
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetPsmBit = %d\n", psm));
-}
-#endif // CONFIG_STA_SUPPORT //
-
-/*
- ==========================================================================
- Description:
- This routine calculates TxPER, RxPER of the past N-sec period. And
- according to the calculation result, ChannelQuality is calculated here
- to decide if current AP is still doing the job.
-
- If ChannelQuality is not good, a ROAMing attempt may be tried later.
- Output:
- StaCfg.ChannelQuality - 0..100
-
- IRQL = DISPATCH_LEVEL
-
- NOTE: This routine decide channle quality based on RX CRC error ratio.
- Caller should make sure a function call to NICUpdateRawCounters(pAd)
- is performed right before this routine, so that this routine can decide
- channel quality based on the most up-to-date information
- ==========================================================================
- */
-VOID MlmeCalculateChannelQuality(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pMacEntry,
- IN ULONG Now32)
-{
- ULONG TxOkCnt, TxCnt, TxPER, TxPRR;
- ULONG RxCnt, RxPER;
- UCHAR NorRssi;
- CHAR MaxRssi;
- RSSI_SAMPLE *pRssiSample = NULL;
- UINT32 OneSecTxNoRetryOkCount = 0;
- UINT32 OneSecTxRetryOkCount = 0;
- UINT32 OneSecTxFailCount = 0;
- UINT32 OneSecRxOkCnt = 0;
- UINT32 OneSecRxFcsErrCnt = 0;
- ULONG ChannelQuality = 0; // 0..100, Channel Quality Indication for Roaming
-#ifdef CONFIG_STA_SUPPORT
- ULONG BeaconLostTime = pAd->StaCfg.BeaconLostTime;
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- // longer beacon lost time when carrier detection enabled
- if (pAd->CommonCfg.CarrierDetect.Enable == TRUE)
- {
- BeaconLostTime = pAd->StaCfg.BeaconLostTime + (pAd->StaCfg.BeaconLostTime/2);
- }
-#endif // CARRIER_DETECTION_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- {
- pRssiSample = &pAd->StaCfg.RssiSample;
- OneSecTxNoRetryOkCount = pAd->RalinkCounters.OneSecTxNoRetryOkCount;
- OneSecTxRetryOkCount = pAd->RalinkCounters.OneSecTxRetryOkCount;
- OneSecTxFailCount = pAd->RalinkCounters.OneSecTxFailCount;
- OneSecRxOkCnt = pAd->RalinkCounters.OneSecRxOkCnt;
- OneSecRxFcsErrCnt = pAd->RalinkCounters.OneSecRxFcsErrCnt;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- MaxRssi = RTMPMaxRssi(pAd, pRssiSample->LastRssi0,
- pRssiSample->LastRssi1,
- pRssiSample->LastRssi2);
-
- //
- // calculate TX packet error ratio and TX retry ratio - if too few TX samples, skip TX related statistics
- //
- TxOkCnt = OneSecTxNoRetryOkCount + OneSecTxRetryOkCount;
- TxCnt = TxOkCnt + OneSecTxFailCount;
- if (TxCnt < 5)
- {
- TxPER = 0;
- TxPRR = 0;
- }
- else
- {
- TxPER = (OneSecTxFailCount * 100) / TxCnt;
- TxPRR = ((TxCnt - OneSecTxNoRetryOkCount) * 100) / TxCnt;
- }
-
- //
- // calculate RX PER - don't take RxPER into consideration if too few sample
- //
- RxCnt = OneSecRxOkCnt + OneSecRxFcsErrCnt;
- if (RxCnt < 5)
- RxPER = 0;
- else
- RxPER = (OneSecRxFcsErrCnt * 100) / RxCnt;
-
- //
- // decide ChannelQuality based on: 1)last BEACON received time, 2)last RSSI, 3)TxPER, and 4)RxPER
- //
-#ifdef CONFIG_STA_SUPPORT
- if ((pAd->OpMode == OPMODE_STA) &&
- INFRA_ON(pAd) &&
- (OneSecTxNoRetryOkCount < 2) && // no heavy traffic
- ((pAd->StaCfg.LastBeaconRxTime + BeaconLostTime) < Now32))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("BEACON lost > %ld msec with TxOkCnt=%ld -> CQI=0\n", BeaconLostTime, TxOkCnt));
- ChannelQuality = 0;
- }
- else
-#endif // CONFIG_STA_SUPPORT //
- {
- // Normalize Rssi
- if (MaxRssi > -40)
- NorRssi = 100;
- else if (MaxRssi < -90)
- NorRssi = 0;
- else
- NorRssi = (MaxRssi + 90) * 2;
-
- // ChannelQuality = W1*RSSI + W2*TxPRR + W3*RxPER (RSSI 0..100), (TxPER 100..0), (RxPER 100..0)
- ChannelQuality = (RSSI_WEIGHTING * NorRssi +
- TX_WEIGHTING * (100 - TxPRR) +
- RX_WEIGHTING* (100 - RxPER)) / 100;
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- pAd->Mlme.ChannelQuality = (ChannelQuality > 100) ? 100 : ChannelQuality;
-#endif // CONFIG_STA_SUPPORT //
-
-
-}
-
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeSetTxPreamble(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TxPreamble)
-{
- AUTO_RSP_CFG_STRUC csr4;
-
- //
- // Always use Long preamble before verifiation short preamble functionality works well.
- // Todo: remove the following line if short preamble functionality works
- //
- //TxPreamble = Rt802_11PreambleLong;
-
- RTMP_IO_READ32(pAd, AUTO_RSP_CFG, &csr4.word);
- if (TxPreamble == Rt802_11PreambleLong)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetTxPreamble (= LONG PREAMBLE)\n"));
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
- csr4.field.AutoResponderPreamble = 0;
- }
- else
- {
- // NOTE: 1Mbps should always use long preamble
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeSetTxPreamble (= SHORT PREAMBLE)\n"));
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
- csr4.field.AutoResponderPreamble = 1;
- }
-
- RTMP_IO_WRITE32(pAd, AUTO_RSP_CFG, csr4.word);
-}
-
-/*
- ==========================================================================
- Description:
- Update basic rate bitmap
- ==========================================================================
- */
-
-VOID UpdateBasicRateBitmap(
- IN PRTMP_ADAPTER pAdapter)
-{
- INT i, j;
- /* 1 2 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54 */
- UCHAR rate[] = { 2, 4, 11, 22, 12, 18, 24, 36, 48, 72, 96, 108 };
- UCHAR *sup_p = pAdapter->CommonCfg.SupRate;
- UCHAR *ext_p = pAdapter->CommonCfg.ExtRate;
- ULONG bitmap = pAdapter->CommonCfg.BasicRateBitmap;
-
-
- /* if A mode, always use fix BasicRateBitMap */
- //if (pAdapter->CommonCfg.Channel == PHY_11A)
- if (pAdapter->CommonCfg.Channel > 14)
- pAdapter->CommonCfg.BasicRateBitmap = 0x150; /* 6, 12, 24M */
- /* End of if */
-
- if (pAdapter->CommonCfg.BasicRateBitmap > 4095)
- {
- /* (2 ^ MAX_LEN_OF_SUPPORTED_RATES) -1 */
- return;
- } /* End of if */
-
- for(i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
- {
- sup_p[i] &= 0x7f;
- ext_p[i] &= 0x7f;
- } /* End of for */
-
- for(i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
- {
- if (bitmap & (1 << i))
- {
- for(j=0; j<MAX_LEN_OF_SUPPORTED_RATES; j++)
- {
- if (sup_p[j] == rate[i])
- sup_p[j] |= 0x80;
- /* End of if */
- } /* End of for */
-
- for(j=0; j<MAX_LEN_OF_SUPPORTED_RATES; j++)
- {
- if (ext_p[j] == rate[i])
- ext_p[j] |= 0x80;
- /* End of if */
- } /* End of for */
- } /* End of if */
- } /* End of for */
-} /* End of UpdateBasicRateBitmap */
-
-// IRQL = PASSIVE_LEVEL
-// IRQL = DISPATCH_LEVEL
-// bLinkUp is to identify the inital link speed.
-// TRUE indicates the rate update at linkup, we should not try to set the rate at 54Mbps.
-VOID MlmeUpdateTxRates(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bLinkUp,
- IN UCHAR apidx)
-{
- int i, num;
- UCHAR Rate = RATE_6, MaxDesire = RATE_1, MaxSupport = RATE_1;
- UCHAR MinSupport = RATE_54;
- ULONG BasicRateBitmap = 0;
- UCHAR CurrBasicRate = RATE_1;
- UCHAR *pSupRate, SupRateLen, *pExtRate, ExtRateLen;
- PHTTRANSMIT_SETTING pHtPhy = NULL;
- PHTTRANSMIT_SETTING pMaxHtPhy = NULL;
- PHTTRANSMIT_SETTING pMinHtPhy = NULL;
- BOOLEAN *auto_rate_cur_p;
- UCHAR HtMcs = MCS_AUTO;
-
- // find max desired rate
- UpdateBasicRateBitmap(pAd);
-
- num = 0;
- auto_rate_cur_p = NULL;
- for (i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
- {
- switch (pAd->CommonCfg.DesireRate[i] & 0x7f)
- {
- case 2: Rate = RATE_1; num++; break;
- case 4: Rate = RATE_2; num++; break;
- case 11: Rate = RATE_5_5; num++; break;
- case 22: Rate = RATE_11; num++; break;
- case 12: Rate = RATE_6; num++; break;
- case 18: Rate = RATE_9; num++; break;
- case 24: Rate = RATE_12; num++; break;
- case 36: Rate = RATE_18; num++; break;
- case 48: Rate = RATE_24; num++; break;
- case 72: Rate = RATE_36; num++; break;
- case 96: Rate = RATE_48; num++; break;
- case 108: Rate = RATE_54; num++; break;
- //default: Rate = RATE_1; break;
- }
- if (MaxDesire < Rate) MaxDesire = Rate;
- }
-
-//===========================================================================
-//===========================================================================
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pHtPhy = &pAd->StaCfg.HTPhyMode;
- pMaxHtPhy = &pAd->StaCfg.MaxHTPhyMode;
- pMinHtPhy = &pAd->StaCfg.MinHTPhyMode;
-
- auto_rate_cur_p = &pAd->StaCfg.bAutoTxRateSwitch;
- HtMcs = pAd->StaCfg.DesiredTransmitSetting.field.MCS;
-
- if ((pAd->StaCfg.BssType == BSS_ADHOC) &&
- (pAd->CommonCfg.PhyMode == PHY_11B) &&
- (MaxDesire > RATE_11))
- {
- MaxDesire = RATE_11;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- pAd->CommonCfg.MaxDesiredRate = MaxDesire;
- pMinHtPhy->word = 0;
- pMaxHtPhy->word = 0;
- pHtPhy->word = 0;
-
- // Auto rate switching is enabled only if more than one DESIRED RATES are
- // specified; otherwise disabled
- if (num <= 1)
- {
- //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
- //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
- *auto_rate_cur_p = FALSE;
- }
- else
- {
- //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
- //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
- *auto_rate_cur_p = TRUE;
- }
-
- if (HtMcs != MCS_AUTO)
- {
- //OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
- //pAd->CommonCfg.bAutoTxRateSwitch = FALSE;
- *auto_rate_cur_p = FALSE;
- }
- else
- {
- //OPSTATUS_SET_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED);
- //pAd->CommonCfg.bAutoTxRateSwitch = TRUE;
- *auto_rate_cur_p = TRUE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA))
- {
- pSupRate = &pAd->StaActive.SupRate[0];
- pExtRate = &pAd->StaActive.ExtRate[0];
- SupRateLen = pAd->StaActive.SupRateLen;
- ExtRateLen = pAd->StaActive.ExtRateLen;
- }
- else
-#endif // CONFIG_STA_SUPPORT //
- {
- pSupRate = &pAd->CommonCfg.SupRate[0];
- pExtRate = &pAd->CommonCfg.ExtRate[0];
- SupRateLen = pAd->CommonCfg.SupRateLen;
- ExtRateLen = pAd->CommonCfg.ExtRateLen;
- }
-
- // find max supported rate
- for (i=0; i<SupRateLen; i++)
- {
- switch (pSupRate[i] & 0x7f)
- {
- case 2: Rate = RATE_1; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0001; break;
- case 4: Rate = RATE_2; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0002; break;
- case 11: Rate = RATE_5_5; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0004; break;
- case 22: Rate = RATE_11; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0008; break;
- case 12: Rate = RATE_6; /*if (pSupRate[i] & 0x80)*/ BasicRateBitmap |= 0x0010; break;
- case 18: Rate = RATE_9; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0020; break;
- case 24: Rate = RATE_12; /*if (pSupRate[i] & 0x80)*/ BasicRateBitmap |= 0x0040; break;
- case 36: Rate = RATE_18; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0080; break;
- case 48: Rate = RATE_24; /*if (pSupRate[i] & 0x80)*/ BasicRateBitmap |= 0x0100; break;
- case 72: Rate = RATE_36; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0200; break;
- case 96: Rate = RATE_48; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0400; break;
- case 108: Rate = RATE_54; if (pSupRate[i] & 0x80) BasicRateBitmap |= 0x0800; break;
- default: Rate = RATE_1; break;
- }
- if (MaxSupport < Rate) MaxSupport = Rate;
-
- if (MinSupport > Rate) MinSupport = Rate;
- }
-
- for (i=0; i<ExtRateLen; i++)
- {
- switch (pExtRate[i] & 0x7f)
- {
- case 2: Rate = RATE_1; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0001; break;
- case 4: Rate = RATE_2; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0002; break;
- case 11: Rate = RATE_5_5; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0004; break;
- case 22: Rate = RATE_11; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0008; break;
- case 12: Rate = RATE_6; /*if (pExtRate[i] & 0x80)*/ BasicRateBitmap |= 0x0010; break;
- case 18: Rate = RATE_9; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0020; break;
- case 24: Rate = RATE_12; /*if (pExtRate[i] & 0x80)*/ BasicRateBitmap |= 0x0040; break;
- case 36: Rate = RATE_18; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0080; break;
- case 48: Rate = RATE_24; /*if (pExtRate[i] & 0x80)*/ BasicRateBitmap |= 0x0100; break;
- case 72: Rate = RATE_36; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0200; break;
- case 96: Rate = RATE_48; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0400; break;
- case 108: Rate = RATE_54; if (pExtRate[i] & 0x80) BasicRateBitmap |= 0x0800; break;
- default: Rate = RATE_1; break;
- }
- if (MaxSupport < Rate) MaxSupport = Rate;
-
- if (MinSupport > Rate) MinSupport = Rate;
- }
-
- RTMP_IO_WRITE32(pAd, LEGACY_BASIC_RATE, BasicRateBitmap);
-
- // bug fix
- // pAd->CommonCfg.BasicRateBitmap = BasicRateBitmap;
-
- // calculate the exptected ACK rate for each TX rate. This info is used to caculate
- // the DURATION field of outgoing uniicast DATA/MGMT frame
- for (i=0; i<MAX_LEN_OF_SUPPORTED_RATES; i++)
- {
- if (BasicRateBitmap & (0x01 << i))
- CurrBasicRate = (UCHAR)i;
- pAd->CommonCfg.ExpectedACKRate[i] = CurrBasicRate;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateTxRates[MaxSupport = %d] = MaxDesire %d Mbps\n", RateIdToMbps[MaxSupport], RateIdToMbps[MaxDesire]));
- // max tx rate = min {max desire rate, max supported rate}
- if (MaxSupport < MaxDesire)
- pAd->CommonCfg.MaxTxRate = MaxSupport;
- else
- pAd->CommonCfg.MaxTxRate = MaxDesire;
-
- pAd->CommonCfg.MinTxRate = MinSupport;
- // 2003-07-31 john - 2500 doesn't have good sensitivity at high OFDM rates. to increase the success
- // ratio of initial DHCP packet exchange, TX rate starts from a lower rate depending
- // on average RSSI
- // 1. RSSI >= -70db, start at 54 Mbps (short distance)
- // 2. -70 > RSSI >= -75, start at 24 Mbps (mid distance)
- // 3. -75 > RSSI, start at 11 Mbps (long distance)
- //if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED)/* &&
- // OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)*/)
- if (*auto_rate_cur_p)
- {
- short dbm = 0;
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- dbm = pAd->StaCfg.RssiSample.AvgRssi0 - pAd->BbpRssiToDbmDelta;
-#endif // CONFIG_STA_SUPPORT //
- if (bLinkUp == TRUE)
- pAd->CommonCfg.TxRate = RATE_24;
- else
- pAd->CommonCfg.TxRate = pAd->CommonCfg.MaxTxRate;
-
- if (dbm < -75)
- pAd->CommonCfg.TxRate = RATE_11;
- else if (dbm < -70)
- pAd->CommonCfg.TxRate = RATE_24;
-
- // should never exceed MaxTxRate (consider 11B-only mode)
- if (pAd->CommonCfg.TxRate > pAd->CommonCfg.MaxTxRate)
- pAd->CommonCfg.TxRate = pAd->CommonCfg.MaxTxRate;
-
- pAd->CommonCfg.TxRateIndex = 0;
- }
- else
- {
- pAd->CommonCfg.TxRate = pAd->CommonCfg.MaxTxRate;
- pHtPhy->field.MCS = (pAd->CommonCfg.MaxTxRate > 3) ? (pAd->CommonCfg.MaxTxRate - 4) : pAd->CommonCfg.MaxTxRate;
- pHtPhy->field.MODE = (pAd->CommonCfg.MaxTxRate > 3) ? MODE_OFDM : MODE_CCK;
-
- pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.STBC = pHtPhy->field.STBC;
- pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.ShortGI = pHtPhy->field.ShortGI;
- pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MCS = pHtPhy->field.MCS;
- pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE = pHtPhy->field.MODE;
- }
-
- if (pAd->CommonCfg.TxRate <= RATE_11)
- {
- pMaxHtPhy->field.MODE = MODE_CCK;
- pMaxHtPhy->field.MCS = pAd->CommonCfg.TxRate;
- pMinHtPhy->field.MCS = pAd->CommonCfg.MinTxRate;
- }
- else
- {
- pMaxHtPhy->field.MODE = MODE_OFDM;
- pMaxHtPhy->field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.TxRate];
- if (pAd->CommonCfg.MinTxRate >= RATE_6 && (pAd->CommonCfg.MinTxRate <= RATE_54))
- {pMinHtPhy->field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MinTxRate];}
- else
- {pMinHtPhy->field.MCS = pAd->CommonCfg.MinTxRate;}
- }
-
- pHtPhy->word = (pMaxHtPhy->word);
- if (bLinkUp && (pAd->OpMode == OPMODE_STA))
- {
- pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word = pHtPhy->word;
- pAd->MacTab.Content[BSSID_WCID].MaxHTPhyMode.word = pMaxHtPhy->word;
- pAd->MacTab.Content[BSSID_WCID].MinHTPhyMode.word = pMinHtPhy->word;
- }
- else
- {
- switch (pAd->CommonCfg.PhyMode)
- {
- case PHY_11BG_MIXED:
- case PHY_11B:
-#ifdef DOT11_N_SUPPORT
- case PHY_11BGN_MIXED:
-#endif // DOT11_N_SUPPORT //
- pAd->CommonCfg.MlmeRate = RATE_1;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
- pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1;
-
-//#ifdef WIFI_TEST
- pAd->CommonCfg.RtsRate = RATE_11;
-//#else
-// pAd->CommonCfg.RtsRate = RATE_1;
-//#endif
- break;
- case PHY_11G:
- case PHY_11A:
-#ifdef DOT11_N_SUPPORT
- case PHY_11AGN_MIXED:
- case PHY_11GN_MIXED:
- case PHY_11N_2_4G:
- case PHY_11AN_MIXED:
- case PHY_11N_5G:
-#endif // DOT11_N_SUPPORT //
- pAd->CommonCfg.MlmeRate = RATE_6;
- pAd->CommonCfg.RtsRate = RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
- pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- break;
- case PHY_11ABG_MIXED:
-#ifdef DOT11_N_SUPPORT
- case PHY_11ABGN_MIXED:
-#endif // DOT11_N_SUPPORT //
- if (pAd->CommonCfg.Channel <= 14)
- {
- pAd->CommonCfg.MlmeRate = RATE_1;
- pAd->CommonCfg.RtsRate = RATE_1;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
- pAd->CommonCfg.MlmeTransmit.field.MCS = RATE_1;
- }
- else
- {
- pAd->CommonCfg.MlmeRate = RATE_6;
- pAd->CommonCfg.RtsRate = RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
- pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- }
- break;
- default: // error
- pAd->CommonCfg.MlmeRate = RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
- pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- pAd->CommonCfg.RtsRate = RATE_1;
- break;
- }
- //
- // Keep Basic Mlme Rate.
- //
- pAd->MacTab.Content[MCAST_WCID].HTPhyMode.word = pAd->CommonCfg.MlmeTransmit.word;
- if (pAd->CommonCfg.MlmeTransmit.field.MODE == MODE_OFDM)
- pAd->MacTab.Content[MCAST_WCID].HTPhyMode.field.MCS = OfdmRateToRxwiMCS[RATE_24];
- else
- pAd->MacTab.Content[MCAST_WCID].HTPhyMode.field.MCS = RATE_1;
- pAd->CommonCfg.BasicMlmeRate = pAd->CommonCfg.MlmeRate;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, (" MlmeUpdateTxRates (MaxDesire=%d, MaxSupport=%d, MaxTxRate=%d, MinRate=%d, Rate Switching =%d)\n",
- RateIdToMbps[MaxDesire], RateIdToMbps[MaxSupport], RateIdToMbps[pAd->CommonCfg.MaxTxRate], RateIdToMbps[pAd->CommonCfg.MinTxRate],
- /*OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED)*/*auto_rate_cur_p));
- DBGPRINT(RT_DEBUG_TRACE, (" MlmeUpdateTxRates (TxRate=%d, RtsRate=%d, BasicRateBitmap=0x%04lx)\n",
- RateIdToMbps[pAd->CommonCfg.TxRate], RateIdToMbps[pAd->CommonCfg.RtsRate], BasicRateBitmap));
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeUpdateTxRates (MlmeTransmit=0x%x, MinHTPhyMode=%x, MaxHTPhyMode=0x%x, HTPhyMode=0x%x)\n",
- pAd->CommonCfg.MlmeTransmit.word, pAd->MacTab.Content[BSSID_WCID].MinHTPhyMode.word ,pAd->MacTab.Content[BSSID_WCID].MaxHTPhyMode.word ,pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word ));
-}
-
-#ifdef DOT11_N_SUPPORT
-/*
- ==========================================================================
- Description:
- This function update HT Rate setting.
- Input Wcid value is valid for 2 case :
- 1. it's used for Station in infra mode that copy AP rate to Mactable.
- 2. OR Station in adhoc mode to copy peer's HT rate to Mactable.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeUpdateHtTxRates(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR apidx)
-{
- UCHAR StbcMcs; //j, StbcMcs, bitmask;
- CHAR i; // 3*3
- RT_HT_CAPABILITY *pRtHtCap = NULL;
- RT_HT_PHY_INFO *pActiveHtPhy = NULL;
- ULONG BasicMCS;
- UCHAR j, bitmask;
- PRT_HT_PHY_INFO pDesireHtPhy = NULL;
- PHTTRANSMIT_SETTING pHtPhy = NULL;
- PHTTRANSMIT_SETTING pMaxHtPhy = NULL;
- PHTTRANSMIT_SETTING pMinHtPhy = NULL;
- BOOLEAN *auto_rate_cur_p;
-
- DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates===> \n"));
-
- auto_rate_cur_p = NULL;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- pDesireHtPhy = &pAd->StaCfg.DesiredHtPhyInfo;
- pActiveHtPhy = &pAd->StaCfg.DesiredHtPhyInfo;
- pHtPhy = &pAd->StaCfg.HTPhyMode;
- pMaxHtPhy = &pAd->StaCfg.MaxHTPhyMode;
- pMinHtPhy = &pAd->StaCfg.MinHTPhyMode;
-
- auto_rate_cur_p = &pAd->StaCfg.bAutoTxRateSwitch;
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- if ((ADHOC_ON(pAd) || INFRA_ON(pAd)) && (pAd->OpMode == OPMODE_STA))
- {
- if (pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE)
- return;
-
- pRtHtCap = &pAd->StaActive.SupportedHtPhy;
- pActiveHtPhy = &pAd->StaActive.SupportedPhyInfo;
- StbcMcs = (UCHAR)pAd->MlmeAux.AddHtInfo.AddHtInfo3.StbcMcs;
- BasicMCS =pAd->MlmeAux.AddHtInfo.MCSSet[0]+(pAd->MlmeAux.AddHtInfo.MCSSet[1]<<8)+(StbcMcs<<16);
- if ((pAd->CommonCfg.DesiredHtPhy.TxSTBC) && (pRtHtCap->RxSTBC) && (pAd->Antenna.field.TxPath == 2))
- pMaxHtPhy->field.STBC = STBC_USE;
- else
- pMaxHtPhy->field.STBC = STBC_NONE;
- }
- else
-#endif // CONFIG_STA_SUPPORT //
- {
- if (pDesireHtPhy->bHtEnable == FALSE)
- return;
-
- pRtHtCap = &pAd->CommonCfg.DesiredHtPhy;
- StbcMcs = (UCHAR)pAd->CommonCfg.AddHTInfo.AddHtInfo3.StbcMcs;
- BasicMCS = pAd->CommonCfg.AddHTInfo.MCSSet[0]+(pAd->CommonCfg.AddHTInfo.MCSSet[1]<<8)+(StbcMcs<<16);
- if ((pAd->CommonCfg.DesiredHtPhy.TxSTBC) && (pRtHtCap->RxSTBC) && (pAd->Antenna.field.TxPath == 2))
- pMaxHtPhy->field.STBC = STBC_USE;
- else
- pMaxHtPhy->field.STBC = STBC_NONE;
- }
-
- // Decide MAX ht rate.
- if ((pRtHtCap->GF) && (pAd->CommonCfg.DesiredHtPhy.GF))
- pMaxHtPhy->field.MODE = MODE_HTGREENFIELD;
- else
- pMaxHtPhy->field.MODE = MODE_HTMIX;
-
- if ((pAd->CommonCfg.DesiredHtPhy.ChannelWidth) && (pRtHtCap->ChannelWidth))
- pMaxHtPhy->field.BW = BW_40;
- else
- pMaxHtPhy->field.BW = BW_20;
-
- if (pMaxHtPhy->field.BW == BW_20)
- pMaxHtPhy->field.ShortGI = (pAd->CommonCfg.DesiredHtPhy.ShortGIfor20 & pRtHtCap->ShortGIfor20);
- else
- pMaxHtPhy->field.ShortGI = (pAd->CommonCfg.DesiredHtPhy.ShortGIfor40 & pRtHtCap->ShortGIfor40);
-
- if (pDesireHtPhy->MCSSet[4] != 0)
- {
- pMaxHtPhy->field.MCS = 32;
- }
-
- for (i=23; i>=0; i--) // 3*3
- {
- j = i/8;
- bitmask = (1<<(i-(j*8)));
-
- if ((pActiveHtPhy->MCSSet[j] & bitmask) && (pDesireHtPhy->MCSSet[j] & bitmask))
- {
- pMaxHtPhy->field.MCS = i;
- break;
- }
-
- if (i==0)
- break;
- }
-
- // Copy MIN ht rate. rt2860???
- pMinHtPhy->field.BW = BW_20;
- pMinHtPhy->field.MCS = 0;
- pMinHtPhy->field.STBC = 0;
- pMinHtPhy->field.ShortGI = 0;
- //If STA assigns fixed rate. update to fixed here.
-#ifdef CONFIG_STA_SUPPORT
- if ( (pAd->OpMode == OPMODE_STA) && (pDesireHtPhy->MCSSet[0] != 0xff))
- {
- if (pDesireHtPhy->MCSSet[4] != 0)
- {
- pMaxHtPhy->field.MCS = 32;
- pMinHtPhy->field.MCS = 32;
- DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates<=== Use Fixed MCS = %d\n",pMinHtPhy->field.MCS));
- }
-
- for (i=23; (CHAR)i >= 0; i--) // 3*3
- {
- j = i/8;
- bitmask = (1<<(i-(j*8)));
- if ( (pDesireHtPhy->MCSSet[j] & bitmask) && (pActiveHtPhy->MCSSet[j] & bitmask))
- {
- pMaxHtPhy->field.MCS = i;
- pMinHtPhy->field.MCS = i;
- break;
- }
- if (i==0)
- break;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
- // Decide ht rate
- pHtPhy->field.STBC = pMaxHtPhy->field.STBC;
- pHtPhy->field.BW = pMaxHtPhy->field.BW;
- pHtPhy->field.MODE = pMaxHtPhy->field.MODE;
- pHtPhy->field.MCS = pMaxHtPhy->field.MCS;
- pHtPhy->field.ShortGI = pMaxHtPhy->field.ShortGI;
-
- // use default now. rt2860
- if (pDesireHtPhy->MCSSet[0] != 0xff)
- *auto_rate_cur_p = FALSE;
- else
- *auto_rate_cur_p = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, (" MlmeUpdateHtTxRates<---.AMsduSize = %d \n", pAd->CommonCfg.DesiredHtPhy.AmsduSize ));
- DBGPRINT(RT_DEBUG_TRACE,("TX: MCS[0] = %x (choose %d), BW = %d, ShortGI = %d, MODE = %d, \n", pActiveHtPhy->MCSSet[0],pHtPhy->field.MCS,
- pHtPhy->field.BW, pHtPhy->field.ShortGI, pHtPhy->field.MODE));
- DBGPRINT(RT_DEBUG_TRACE,("MlmeUpdateHtTxRates<=== \n"));
-}
-
-
-VOID BATableInit(
- IN PRTMP_ADAPTER pAd,
- IN BA_TABLE *Tab)
-{
- int i;
-
- Tab->numAsOriginator = 0;
- Tab->numAsRecipient = 0;
- Tab->numDoneOriginator = 0;
- NdisAllocateSpinLock(&pAd->BATabLock);
- for (i = 0; i < MAX_LEN_OF_BA_REC_TABLE; i++)
- {
- Tab->BARecEntry[i].REC_BA_Status = Recipient_NONE;
- NdisAllocateSpinLock(&(Tab->BARecEntry[i].RxReRingLock));
- }
- for (i = 0; i < MAX_LEN_OF_BA_ORI_TABLE; i++)
- {
- Tab->BAOriEntry[i].ORI_BA_Status = Originator_NONE;
- }
-}
-#endif // DOT11_N_SUPPORT //
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeRadioOff(
- IN PRTMP_ADAPTER pAd)
-{
- RTMP_MLME_RADIO_OFF(pAd);
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeRadioOn(
- IN PRTMP_ADAPTER pAd)
-{
- RTMP_MLME_RADIO_ON(pAd);
-}
-
-// ===========================================================================================
-// bss_table.c
-// ===========================================================================================
-
-
-/*! \brief initialize BSS table
- * \param p_tab pointer to the table
- * \return none
- * \pre
- * \post
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- */
-VOID BssTableInit(
- IN BSS_TABLE *Tab)
-{
- int i;
-
- Tab->BssNr = 0;
- Tab->BssOverlapNr = 0;
- for (i = 0; i < MAX_LEN_OF_BSS_TABLE; i++)
- {
- NdisZeroMemory(&Tab->BssEntry[i], sizeof(BSS_ENTRY));
- Tab->BssEntry[i].Rssi = -127; // initial the rssi as a minimum value
- }
-}
-
-
-/*! \brief search the BSS table by SSID
- * \param p_tab pointer to the bss table
- * \param ssid SSID string
- * \return index of the table, BSS_NOT_FOUND if not in the table
- * \pre
- * \post
- * \note search by sequential search
-
- IRQL = DISPATCH_LEVEL
-
- */
-ULONG BssTableSearch(
- IN BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN UCHAR Channel)
-{
- UCHAR i;
-
- for (i = 0; i < Tab->BssNr; i++)
- {
- //
- // Some AP that support A/B/G mode that may used the same BSSID on 11A and 11B/G.
- // We should distinguish this case.
- //
- if ((((Tab->BssEntry[i].Channel <= 14) && (Channel <= 14)) ||
- ((Tab->BssEntry[i].Channel > 14) && (Channel > 14))) &&
- MAC_ADDR_EQUAL(Tab->BssEntry[i].Bssid, pBssid))
- {
- return i;
- }
- }
- return (ULONG)BSS_NOT_FOUND;
-}
-
-ULONG BssSsidTableSearch(
- IN BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen,
- IN UCHAR Channel)
-{
- UCHAR i;
-
- for (i = 0; i < Tab->BssNr; i++)
- {
- //
- // Some AP that support A/B/G mode that may used the same BSSID on 11A and 11B/G.
- // We should distinguish this case.
- //
- if ((((Tab->BssEntry[i].Channel <= 14) && (Channel <= 14)) ||
- ((Tab->BssEntry[i].Channel > 14) && (Channel > 14))) &&
- MAC_ADDR_EQUAL(Tab->BssEntry[i].Bssid, pBssid) &&
- SSID_EQUAL(pSsid, SsidLen, Tab->BssEntry[i].Ssid, Tab->BssEntry[i].SsidLen))
- {
- return i;
- }
- }
- return (ULONG)BSS_NOT_FOUND;
-}
-
-ULONG BssTableSearchWithSSID(
- IN BSS_TABLE *Tab,
- IN PUCHAR Bssid,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen,
- IN UCHAR Channel)
-{
- UCHAR i;
-
- for (i = 0; i < Tab->BssNr; i++)
- {
- if ((((Tab->BssEntry[i].Channel <= 14) && (Channel <= 14)) ||
- ((Tab->BssEntry[i].Channel > 14) && (Channel > 14))) &&
- MAC_ADDR_EQUAL(&(Tab->BssEntry[i].Bssid), Bssid) &&
- (SSID_EQUAL(pSsid, SsidLen, Tab->BssEntry[i].Ssid, Tab->BssEntry[i].SsidLen) ||
- (NdisEqualMemory(pSsid, ZeroSsid, SsidLen)) ||
- (NdisEqualMemory(Tab->BssEntry[i].Ssid, ZeroSsid, Tab->BssEntry[i].SsidLen))))
- {
- return i;
- }
- }
- return (ULONG)BSS_NOT_FOUND;
-}
-
-
-ULONG BssSsidTableSearchBySSID(
- IN BSS_TABLE *Tab,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen)
-{
- UCHAR i;
-
- for (i = 0; i < Tab->BssNr; i++)
- {
- if (SSID_EQUAL(pSsid, SsidLen, Tab->BssEntry[i].Ssid, Tab->BssEntry[i].SsidLen))
- {
- return i;
- }
- }
- return (ULONG)BSS_NOT_FOUND;
-}
-
-
-// IRQL = DISPATCH_LEVEL
-VOID BssTableDeleteEntry(
- IN OUT BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN UCHAR Channel)
-{
- UCHAR i, j;
-
- for (i = 0; i < Tab->BssNr; i++)
- {
- if ((Tab->BssEntry[i].Channel == Channel) &&
- (MAC_ADDR_EQUAL(Tab->BssEntry[i].Bssid, pBssid)))
- {
- for (j = i; j < Tab->BssNr - 1; j++)
- {
- NdisMoveMemory(&(Tab->BssEntry[j]), &(Tab->BssEntry[j + 1]), sizeof(BSS_ENTRY));
- }
- NdisZeroMemory(&(Tab->BssEntry[Tab->BssNr - 1]), sizeof(BSS_ENTRY));
- Tab->BssNr -= 1;
- return;
- }
- }
-}
-
-#ifdef DOT11_N_SUPPORT
-/*
- ========================================================================
- Routine Description:
- Delete the Originator Entry in BAtable. Or decrease numAs Originator by 1 if needed.
-
- Arguments:
- // IRQL = DISPATCH_LEVEL
- ========================================================================
-*/
-VOID BATableDeleteORIEntry(
- IN OUT PRTMP_ADAPTER pAd,
- IN BA_ORI_ENTRY *pBAORIEntry)
-{
-
- if (pBAORIEntry->ORI_BA_Status != Originator_NONE)
- {
- NdisAcquireSpinLock(&pAd->BATabLock);
- if (pBAORIEntry->ORI_BA_Status == Originator_Done)
- {
- pAd->BATable.numAsOriginator -= 1;
- DBGPRINT(RT_DEBUG_TRACE, ("BATableDeleteORIEntry numAsOriginator= %ld\n", pAd->BATable.numAsRecipient));
- // Erase Bitmap flag.
- }
- pAd->MacTab.Content[pBAORIEntry->Wcid].TXBAbitmap &= (~(1<<(pBAORIEntry->TID) )); // If STA mode, erase flag here
- pAd->MacTab.Content[pBAORIEntry->Wcid].BAOriWcidArray[pBAORIEntry->TID] = 0; // If STA mode, erase flag here
- pBAORIEntry->ORI_BA_Status = Originator_NONE;
- pBAORIEntry->Token = 1;
- // Not clear Sequence here.
- NdisReleaseSpinLock(&pAd->BATabLock);
- }
-}
-#endif // DOT11_N_SUPPORT //
-
-/*! \brief
- * \param
- * \return
- * \pre
- * \post
-
- IRQL = DISPATCH_LEVEL
-
- */
-VOID BssEntrySet(
- IN PRTMP_ADAPTER pAd,
- OUT BSS_ENTRY *pBss,
- IN PUCHAR pBssid,
- IN CHAR Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN USHORT BeaconPeriod,
- IN PCF_PARM pCfParm,
- IN USHORT AtimWin,
- IN USHORT CapabilityInfo,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- IN UCHAR HtCapabilityLen,
- IN UCHAR AddHtInfoLen,
- IN UCHAR NewExtChanOffset,
- IN UCHAR Channel,
- IN CHAR Rssi,
- IN LARGE_INTEGER TimeStamp,
- IN UCHAR CkipFlag,
- IN PEDCA_PARM pEdcaParm,
- IN PQOS_CAPABILITY_PARM pQosCapability,
- IN PQBSS_LOAD_PARM pQbssLoad,
- IN USHORT LengthVIE,
- IN PNDIS_802_11_VARIABLE_IEs pVIE)
-{
- COPY_MAC_ADDR(pBss->Bssid, pBssid);
- // Default Hidden SSID to be TRUE, it will be turned to FALSE after coping SSID
- pBss->Hidden = 1;
- if (SsidLen > 0)
- {
- // For hidden SSID AP, it might send beacon with SSID len equal to 0
- // Or send beacon /probe response with SSID len matching real SSID length,
- // but SSID is all zero. such as "00-00-00-00" with length 4.
- // We have to prevent this case overwrite correct table
- if (NdisEqualMemory(Ssid, ZeroSsid, SsidLen) == 0)
- {
- NdisZeroMemory(pBss->Ssid, MAX_LEN_OF_SSID);
- NdisMoveMemory(pBss->Ssid, Ssid, SsidLen);
- pBss->SsidLen = SsidLen;
- pBss->Hidden = 0;
- }
- }
- else
- pBss->SsidLen = 0;
- pBss->BssType = BssType;
- pBss->BeaconPeriod = BeaconPeriod;
- if (BssType == BSS_INFRA)
- {
- if (pCfParm->bValid)
- {
- pBss->CfpCount = pCfParm->CfpCount;
- pBss->CfpPeriod = pCfParm->CfpPeriod;
- pBss->CfpMaxDuration = pCfParm->CfpMaxDuration;
- pBss->CfpDurRemaining = pCfParm->CfpDurRemaining;
- }
- }
- else
- {
- pBss->AtimWin = AtimWin;
- }
-
- pBss->CapabilityInfo = CapabilityInfo;
- // The privacy bit indicate security is ON, it maight be WEP, TKIP or AES
- // Combine with AuthMode, they will decide the connection methods.
- pBss->Privacy = CAP_IS_PRIVACY_ON(pBss->CapabilityInfo);
- ASSERT(SupRateLen <= MAX_LEN_OF_SUPPORTED_RATES);
- if (SupRateLen <= MAX_LEN_OF_SUPPORTED_RATES)
- NdisMoveMemory(pBss->SupRate, SupRate, SupRateLen);
- else
- NdisMoveMemory(pBss->SupRate, SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- pBss->SupRateLen = SupRateLen;
- ASSERT(ExtRateLen <= MAX_LEN_OF_SUPPORTED_RATES);
- NdisMoveMemory(pBss->ExtRate, ExtRate, ExtRateLen);
- pBss->NewExtChanOffset = NewExtChanOffset;
- pBss->ExtRateLen = ExtRateLen;
- pBss->Channel = Channel;
- pBss->CentralChannel = Channel;
- pBss->Rssi = Rssi;
- // Update CkipFlag. if not exists, the value is 0x0
- pBss->CkipFlag = CkipFlag;
-
- // New for microsoft Fixed IEs
- NdisMoveMemory(pBss->FixIEs.Timestamp, &TimeStamp, 8);
- pBss->FixIEs.BeaconInterval = BeaconPeriod;
- pBss->FixIEs.Capabilities = CapabilityInfo;
-
- // New for microsoft Variable IEs
- if (LengthVIE != 0)
- {
- pBss->VarIELen = LengthVIE;
- NdisMoveMemory(pBss->VarIEs, pVIE, pBss->VarIELen);
- }
- else
- {
- pBss->VarIELen = 0;
- }
-
- pBss->AddHtInfoLen = 0;
- pBss->HtCapabilityLen = 0;
-#ifdef DOT11_N_SUPPORT
- if (HtCapabilityLen> 0)
- {
- pBss->HtCapabilityLen = HtCapabilityLen;
- NdisMoveMemory(&pBss->HtCapability, pHtCapability, HtCapabilityLen);
- if (AddHtInfoLen > 0)
- {
- pBss->AddHtInfoLen = AddHtInfoLen;
- NdisMoveMemory(&pBss->AddHtInfo, pAddHtInfo, AddHtInfoLen);
-
- if ((pAddHtInfo->ControlChan > 2)&& (pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_BELOW) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
- {
- pBss->CentralChannel = pAddHtInfo->ControlChan - 2;
- }
- else if ((pAddHtInfo->AddHtInfo.ExtChanOffset == EXTCHA_ABOVE) && (pHtCapability->HtCapInfo.ChannelWidth == BW_40))
- {
- pBss->CentralChannel = pAddHtInfo->ControlChan + 2;
- }
- }
- }
-#endif // DOT11_N_SUPPORT //
-
- BssCipherParse(pBss);
-
- // new for QOS
- if (pEdcaParm)
- NdisMoveMemory(&pBss->EdcaParm, pEdcaParm, sizeof(EDCA_PARM));
- else
- pBss->EdcaParm.bValid = FALSE;
- if (pQosCapability)
- NdisMoveMemory(&pBss->QosCapability, pQosCapability, sizeof(QOS_CAPABILITY_PARM));
- else
- pBss->QosCapability.bValid = FALSE;
- if (pQbssLoad)
- NdisMoveMemory(&pBss->QbssLoad, pQbssLoad, sizeof(QBSS_LOAD_PARM));
- else
- pBss->QbssLoad.bValid = FALSE;
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- PEID_STRUCT pEid;
- USHORT Length = 0;
-
-
- NdisZeroMemory(&pBss->WpaIE.IE[0], MAX_CUSTOM_LEN);
- NdisZeroMemory(&pBss->RsnIE.IE[0], MAX_CUSTOM_LEN);
-#ifdef EXT_BUILD_CHANNEL_LIST
- NdisZeroMemory(&pBss->CountryString[0], 3);
- pBss->bHasCountryIE = FALSE;
-#endif // EXT_BUILD_CHANNEL_LIST //
- pEid = (PEID_STRUCT) pVIE;
- while ((Length + 2 + (USHORT)pEid->Len) <= LengthVIE)
- {
- switch(pEid->Eid)
- {
- case IE_WPA:
- if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
- {
- if ((pEid->Len + 2) > MAX_CUSTOM_LEN)
- {
- pBss->WpaIE.IELen = 0;
- break;
- }
- pBss->WpaIE.IELen = pEid->Len + 2;
- NdisMoveMemory(pBss->WpaIE.IE, pEid, pBss->WpaIE.IELen);
- }
- break;
- case IE_RSN:
- if (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3))
- {
- if ((pEid->Len + 2) > MAX_CUSTOM_LEN)
- {
- pBss->RsnIE.IELen = 0;
- break;
- }
- pBss->RsnIE.IELen = pEid->Len + 2;
- NdisMoveMemory(pBss->RsnIE.IE, pEid, pBss->RsnIE.IELen);
- }
- break;
-#ifdef EXT_BUILD_CHANNEL_LIST
- case IE_COUNTRY:
- NdisMoveMemory(&pBss->CountryString[0], pEid->Octet, 3);
- pBss->bHasCountryIE = TRUE;
- break;
-#endif // EXT_BUILD_CHANNEL_LIST //
- }
- Length = Length + 2 + (USHORT)pEid->Len; // Eid[1] + Len[1]+ content[Len]
- pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-}
-
-/*!
- * \brief insert an entry into the bss table
- * \param p_tab The BSS table
- * \param Bssid BSSID
- * \param ssid SSID
- * \param ssid_len Length of SSID
- * \param bss_type
- * \param beacon_period
- * \param timestamp
- * \param p_cf
- * \param atim_win
- * \param cap
- * \param rates
- * \param rates_len
- * \param channel_idx
- * \return none
- * \pre
- * \post
- * \note If SSID is identical, the old entry will be replaced by the new one
-
- IRQL = DISPATCH_LEVEL
-
- */
-ULONG BssTableSetEntry(
- IN PRTMP_ADAPTER pAd,
- OUT BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN CHAR Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN USHORT BeaconPeriod,
- IN CF_PARM *CfParm,
- IN USHORT AtimWin,
- IN USHORT CapabilityInfo,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- IN UCHAR HtCapabilityLen,
- IN UCHAR AddHtInfoLen,
- IN UCHAR NewExtChanOffset,
- IN UCHAR ChannelNo,
- IN CHAR Rssi,
- IN LARGE_INTEGER TimeStamp,
- IN UCHAR CkipFlag,
- IN PEDCA_PARM pEdcaParm,
- IN PQOS_CAPABILITY_PARM pQosCapability,
- IN PQBSS_LOAD_PARM pQbssLoad,
- IN USHORT LengthVIE,
- IN PNDIS_802_11_VARIABLE_IEs pVIE)
-{
- ULONG Idx;
-
- Idx = BssTableSearchWithSSID(Tab, pBssid, (UCHAR *)Ssid, SsidLen, ChannelNo);
- if (Idx == BSS_NOT_FOUND)
- {
- if (Tab->BssNr >= MAX_LEN_OF_BSS_TABLE)
- {
- //
- // It may happen when BSS Table was full.
- // The desired AP will not be added into BSS Table
- // In this case, if we found the desired AP then overwrite BSS Table.
- //
- if(!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, pBssid) ||
- SSID_EQUAL(pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, Ssid, SsidLen))
- {
- Idx = Tab->BssOverlapNr;
- BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod, CfParm, AtimWin,
- CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
- NewExtChanOffset, ChannelNo, Rssi, TimeStamp, CkipFlag, pEdcaParm, pQosCapability, pQbssLoad, LengthVIE, pVIE);
- Tab->BssOverlapNr = (Tab->BssOverlapNr++) % MAX_LEN_OF_BSS_TABLE;
- }
- return Idx;
- }
- else
- {
- return BSS_NOT_FOUND;
- }
- }
- Idx = Tab->BssNr;
- BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod, CfParm, AtimWin,
- CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
- NewExtChanOffset, ChannelNo, Rssi, TimeStamp, CkipFlag, pEdcaParm, pQosCapability, pQbssLoad, LengthVIE, pVIE);
- Tab->BssNr++;
- }
- else
- {
- /* avoid Hidden SSID form beacon to overwirite correct SSID from probe response */
- if ((SSID_EQUAL(Ssid, SsidLen, Tab->BssEntry[Idx].Ssid, Tab->BssEntry[Idx].SsidLen)) ||
- (NdisEqualMemory(Tab->BssEntry[Idx].Ssid, ZeroSsid, Tab->BssEntry[Idx].SsidLen)))
- {
- BssEntrySet(pAd, &Tab->BssEntry[Idx], pBssid, Ssid, SsidLen, BssType, BeaconPeriod,CfParm, AtimWin,
- CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,pHtCapability, pAddHtInfo,HtCapabilityLen, AddHtInfoLen,
- NewExtChanOffset, ChannelNo, Rssi, TimeStamp, CkipFlag, pEdcaParm, pQosCapability, pQbssLoad, LengthVIE, pVIE);
- }
- }
-
- return Idx;
-}
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
-VOID TriEventInit(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR i;
-
- for (i = 0;i < MAX_TRIGGER_EVENT;i++)
- pAd->CommonCfg.TriggerEventTab.EventA[i].bValid = FALSE;
-
- pAd->CommonCfg.TriggerEventTab.EventANo = 0;
- pAd->CommonCfg.TriggerEventTab.EventBCountDown = 0;
-}
-
-ULONG TriEventTableSetEntry(
- IN PRTMP_ADAPTER pAd,
- OUT TRIGGER_EVENT_TAB *Tab,
- IN PUCHAR pBssid,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN UCHAR RegClass,
- IN UCHAR ChannelNo)
-{
- // Event A
- if (HtCapabilityLen == 0)
- {
- if (Tab->EventANo < MAX_TRIGGER_EVENT)
- {
- RTMPMoveMemory(Tab->EventA[Tab->EventANo].BSSID, pBssid, 6);
- Tab->EventA[Tab->EventANo].bValid = TRUE;
- Tab->EventA[Tab->EventANo].Channel = ChannelNo;
- Tab->EventA[Tab->EventANo].CDCounter = pAd->CommonCfg.Dot11BssWidthChanTranDelay;
- if (RegClass != 0)
- {
- // Beacon has Regulatory class IE. So use beacon's
- Tab->EventA[Tab->EventANo].RegClass = RegClass;
- }
- else
- {
- // Use Station's Regulatory class instead.
- if (pAd->StaActive.SupportedHtPhy.bHtEnable == TRUE)
- {
- if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
- {
- Tab->EventA[Tab->EventANo].RegClass = 32;
- }
- else if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
- Tab->EventA[Tab->EventANo].RegClass = 33;
- }
- else
- Tab->EventA[Tab->EventANo].RegClass = ??;
-
- }
-
- Tab->EventANo ++;
- }
- }
- else if (pHtCapability->HtCapInfo.Intolerant40)
- {
- Tab->EventBCountDown = pAd->CommonCfg.Dot11BssWidthChanTranDelay;
- }
-
-}
-
-/*
- ========================================================================
- Routine Description:
- Trigger Event table Maintainence called once every second.
-
- Arguments:
- // IRQL = DISPATCH_LEVEL
- ========================================================================
-*/
-VOID TriEventCounterMaintenance(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR i;
- BOOLEAN bNotify = FALSE;
- for (i = 0;i < MAX_TRIGGER_EVENT;i++)
- {
- if (pAd->CommonCfg.TriggerEventTab.EventA[i].bValid && (pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter > 0))
- {
- pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter--;
- if (pAd->CommonCfg.TriggerEventTab.EventA[i].CDCounter == 0)
- {
- pAd->CommonCfg.TriggerEventTab.EventA[i].bValid = FALSE;
- pAd->CommonCfg.TriggerEventTab.EventANo --;
- // Need to send 20/40 Coexistence Notify frame if has status change.
- bNotify = TRUE;
- }
- }
- }
- if (pAd->CommonCfg.TriggerEventTab.EventBCountDown > 0)
- {
- pAd->CommonCfg.TriggerEventTab.EventBCountDown--;
- if (pAd->CommonCfg.TriggerEventTab.EventBCountDown == 0)
- bNotify = TRUE;
- }
-
- if (bNotify == TRUE)
- Update2040CoexistFrameAndNotify(pAd, BSSID_WCID, TRUE);
-}
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-// IRQL = DISPATCH_LEVEL
-VOID BssTableSsidSort(
- IN PRTMP_ADAPTER pAd,
- OUT BSS_TABLE *OutTab,
- IN CHAR Ssid[],
- IN UCHAR SsidLen)
-{
- INT i;
- BssTableInit(OutTab);
-
- for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
- BSS_ENTRY *pInBss = &pAd->ScanTab.BssEntry[i];
- BOOLEAN bIsHiddenApIncluded = FALSE;
-
- if (((pAd->CommonCfg.bIEEE80211H == 1) &&
- (pAd->MlmeAux.Channel > 14) &&
- RadarChannelCheck(pAd, pInBss->Channel))
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- || (pAd->CommonCfg.CarrierDetect.Enable == TRUE)
-#endif // CARRIER_DETECTION_SUPPORT //
- )
-{
- if (pInBss->Hidden)
- bIsHiddenApIncluded = TRUE;
-}
-
- if ((pInBss->BssType == pAd->StaCfg.BssType) &&
- (SSID_EQUAL(Ssid, SsidLen, pInBss->Ssid, pInBss->SsidLen) || bIsHiddenApIncluded))
- {
- BSS_ENTRY *pOutBss = &OutTab->BssEntry[OutTab->BssNr];
-
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- // If no Country IE exists no Connection will be established when IEEE80211dClientMode is strict.
- if ((pAd->StaCfg.IEEE80211dClientMode == Rt802_11_D_Strict) &&
- (pInBss->bHasCountryIE == FALSE))
- {
- DBGPRINT(RT_DEBUG_TRACE,("StaCfg.IEEE80211dClientMode == Rt802_11_D_Strict, but this AP doesn't have country IE.\n"));
- continue;
- }
-#endif // EXT_BUILD_CHANNEL_LIST //
-
-#ifdef DOT11_N_SUPPORT
- // 2.4G/5G N only mode
- if ((pInBss->HtCapabilityLen == 0) &&
- ((pAd->CommonCfg.PhyMode == PHY_11N_2_4G) || (pAd->CommonCfg.PhyMode == PHY_11N_5G)))
- {
- DBGPRINT(RT_DEBUG_TRACE,("STA is in N-only Mode, this AP don't have Ht capability in Beacon.\n"));
- continue;
- }
-#endif // DOT11_N_SUPPORT //
-
- // New for WPA2
- // Check the Authmode first
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- // Check AuthMode and AuthModeAux for matching, in case AP support dual-mode
- if ((pAd->StaCfg.AuthMode != pInBss->AuthMode) && (pAd->StaCfg.AuthMode != pInBss->AuthModeAux))
- // None matched
- continue;
-
- // Check cipher suite, AP must have more secured cipher than station setting
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- // If it's not mixed mode, we should only let BSS pass with the same encryption
- if (pInBss->WPA.bMixMode == FALSE)
- if (pAd->StaCfg.WepStatus != pInBss->WPA.GroupCipher)
- continue;
-
- // check group cipher
- if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
- (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
- (pInBss->WPA.GroupCipher != Ndis802_11GroupWEP104Enabled))
- continue;
-
- // check pairwise cipher, skip if none matched
- // If profile set to AES, let it pass without question.
- // If profile set to TKIP, we must find one mateched
- if ((pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA.PairCipher) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA.PairCipherAux))
- continue;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- // If it's not mixed mode, we should only let BSS pass with the same encryption
- if (pInBss->WPA2.bMixMode == FALSE)
- if (pAd->StaCfg.WepStatus != pInBss->WPA2.GroupCipher)
- continue;
-
- // check group cipher
- if ((pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher) &&
- (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP40Enabled) &&
- (pInBss->WPA2.GroupCipher != Ndis802_11GroupWEP104Enabled))
- continue;
-
- // check pairwise cipher, skip if none matched
- // If profile set to AES, let it pass without question.
- // If profile set to TKIP, we must find one mateched
- if ((pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA2.PairCipher) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA2.PairCipherAux))
- continue;
- }
- }
- // Bss Type matched, SSID matched.
- // We will check wepstatus for qualification Bss
- else if (pAd->StaCfg.WepStatus != pInBss->WepStatus)
- {
- DBGPRINT(RT_DEBUG_TRACE,("StaCfg.WepStatus=%d, while pInBss->WepStatus=%d\n", pAd->StaCfg.WepStatus, pInBss->WepStatus));
- //
- // For the SESv2 case, we will not qualify WepStatus.
- //
- if (!pInBss->bSES)
- continue;
- }
-
- // Since the AP is using hidden SSID, and we are trying to connect to ANY
- // It definitely will fail. So, skip it.
- // CCX also require not even try to connect it!!
- if (SsidLen == 0)
- continue;
-
-#ifdef DOT11_N_SUPPORT
- // If both station and AP use 40MHz, still need to check if the 40MHZ band's legality in my country region
- // If this 40MHz wideband is not allowed in my country list, use bandwidth 20MHZ instead,
- if ((pInBss->CentralChannel != pInBss->Channel) &&
- (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40))
- {
- if (RTMPCheckChannel(pAd, pInBss->CentralChannel, pInBss->Channel) == FALSE)
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- SetCommonHT(pAd);
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
- }
- else
- {
- if (pAd->CommonCfg.DesiredHtPhy.ChannelWidth == BAND_WIDTH_20)
- {
- SetCommonHT(pAd);
- }
- }
- }
-#endif // DOT11_N_SUPPORT //
-
- // copy matching BSS from InTab to OutTab
- NdisMoveMemory(pOutBss, pInBss, sizeof(BSS_ENTRY));
-
- OutTab->BssNr++;
- }
- else if ((pInBss->BssType == pAd->StaCfg.BssType) && (SsidLen == 0))
- {
- BSS_ENTRY *pOutBss = &OutTab->BssEntry[OutTab->BssNr];
-
-
-#ifdef DOT11_N_SUPPORT
- // 2.4G/5G N only mode
- if ((pInBss->HtCapabilityLen == 0) &&
- ((pAd->CommonCfg.PhyMode == PHY_11N_2_4G) || (pAd->CommonCfg.PhyMode == PHY_11N_5G)))
- {
- DBGPRINT(RT_DEBUG_TRACE,("STA is in N-only Mode, this AP don't have Ht capability in Beacon.\n"));
- continue;
- }
-#endif // DOT11_N_SUPPORT //
-
- // New for WPA2
- // Check the Authmode first
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- // Check AuthMode and AuthModeAux for matching, in case AP support dual-mode
- if ((pAd->StaCfg.AuthMode != pInBss->AuthMode) && (pAd->StaCfg.AuthMode != pInBss->AuthModeAux))
- // None matched
- continue;
-
- // Check cipher suite, AP must have more secured cipher than station setting
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- // If it's not mixed mode, we should only let BSS pass with the same encryption
- if (pInBss->WPA.bMixMode == FALSE)
- if (pAd->StaCfg.WepStatus != pInBss->WPA.GroupCipher)
- continue;
-
- // check group cipher
- if (pAd->StaCfg.WepStatus < pInBss->WPA.GroupCipher)
- continue;
-
- // check pairwise cipher, skip if none matched
- // If profile set to AES, let it pass without question.
- // If profile set to TKIP, we must find one mateched
- if ((pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA.PairCipher) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA.PairCipherAux))
- continue;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- // If it's not mixed mode, we should only let BSS pass with the same encryption
- if (pInBss->WPA2.bMixMode == FALSE)
- if (pAd->StaCfg.WepStatus != pInBss->WPA2.GroupCipher)
- continue;
-
- // check group cipher
- if (pAd->StaCfg.WepStatus < pInBss->WPA2.GroupCipher)
- continue;
-
- // check pairwise cipher, skip if none matched
- // If profile set to AES, let it pass without question.
- // If profile set to TKIP, we must find one mateched
- if ((pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA2.PairCipher) &&
- (pAd->StaCfg.WepStatus != pInBss->WPA2.PairCipherAux))
- continue;
- }
- }
- // Bss Type matched, SSID matched.
- // We will check wepstatus for qualification Bss
- else if (pAd->StaCfg.WepStatus != pInBss->WepStatus)
- continue;
-
-#ifdef DOT11_N_SUPPORT
- // If both station and AP use 40MHz, still need to check if the 40MHZ band's legality in my country region
- // If this 40MHz wideband is not allowed in my country list, use bandwidth 20MHZ instead,
- if ((pInBss->CentralChannel != pInBss->Channel) &&
- (pAd->CommonCfg.RegTransmitSetting.field.BW == BW_40))
- {
- if (RTMPCheckChannel(pAd, pInBss->CentralChannel, pInBss->Channel) == FALSE)
- {
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_20;
- SetCommonHT(pAd);
- pAd->CommonCfg.RegTransmitSetting.field.BW = BW_40;
- }
- }
-#endif // DOT11_N_SUPPORT //
-
- // copy matching BSS from InTab to OutTab
- NdisMoveMemory(pOutBss, pInBss, sizeof(BSS_ENTRY));
-
- OutTab->BssNr++;
- }
-
- if (OutTab->BssNr >= MAX_LEN_OF_BSS_TABLE)
- break;
- }
-
- BssTableSortByRssi(OutTab);
-}
-
-
-// IRQL = DISPATCH_LEVEL
-VOID BssTableSortByRssi(
- IN OUT BSS_TABLE *OutTab)
-{
- INT i, j;
- BSS_ENTRY TmpBss;
-
- for (i = 0; i < OutTab->BssNr - 1; i++)
- {
- for (j = i+1; j < OutTab->BssNr; j++)
- {
- if (OutTab->BssEntry[j].Rssi > OutTab->BssEntry[i].Rssi)
- {
- NdisMoveMemory(&TmpBss, &OutTab->BssEntry[j], sizeof(BSS_ENTRY));
- NdisMoveMemory(&OutTab->BssEntry[j], &OutTab->BssEntry[i], sizeof(BSS_ENTRY));
- NdisMoveMemory(&OutTab->BssEntry[i], &TmpBss, sizeof(BSS_ENTRY));
- }
- }
- }
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-VOID BssCipherParse(
- IN OUT PBSS_ENTRY pBss)
-{
- PEID_STRUCT pEid;
- PUCHAR pTmp;
- PRSN_IE_HEADER_STRUCT pRsnHeader;
- PCIPHER_SUITE_STRUCT pCipher;
- PAKM_SUITE_STRUCT pAKM;
- USHORT Count;
- INT Length;
- NDIS_802_11_ENCRYPTION_STATUS TmpCipher;
-
- //
- // WepStatus will be reset later, if AP announce TKIP or AES on the beacon frame.
- //
- if (pBss->Privacy)
- {
- pBss->WepStatus = Ndis802_11WEPEnabled;
- }
- else
- {
- pBss->WepStatus = Ndis802_11WEPDisabled;
- }
- // Set default to disable & open authentication before parsing variable IE
- pBss->AuthMode = Ndis802_11AuthModeOpen;
- pBss->AuthModeAux = Ndis802_11AuthModeOpen;
-
- // Init WPA setting
- pBss->WPA.PairCipher = Ndis802_11WEPDisabled;
- pBss->WPA.PairCipherAux = Ndis802_11WEPDisabled;
- pBss->WPA.GroupCipher = Ndis802_11WEPDisabled;
- pBss->WPA.RsnCapability = 0;
- pBss->WPA.bMixMode = FALSE;
-
- // Init WPA2 setting
- pBss->WPA2.PairCipher = Ndis802_11WEPDisabled;
- pBss->WPA2.PairCipherAux = Ndis802_11WEPDisabled;
- pBss->WPA2.GroupCipher = Ndis802_11WEPDisabled;
- pBss->WPA2.RsnCapability = 0;
- pBss->WPA2.bMixMode = FALSE;
-
-
- Length = (INT) pBss->VarIELen;
-
- while (Length > 0)
- {
- // Parse cipher suite base on WPA1 & WPA2, they should be parsed differently
- pTmp = ((PUCHAR) pBss->VarIEs) + pBss->VarIELen - Length;
- pEid = (PEID_STRUCT) pTmp;
- switch (pEid->Eid)
- {
- case IE_WPA:
- if (NdisEqualMemory(pEid->Octet, SES_OUI, 3) && (pEid->Len == 7))
- {
- pBss->bSES = TRUE;
- break;
- }
- else if (NdisEqualMemory(pEid->Octet, WPA_OUI, 4) != 1)
- {
- // if unsupported vendor specific IE
- break;
- }
- // Skip OUI, version, and multicast suite
- // This part should be improved in the future when AP supported multiple cipher suite.
- // For now, it's OK since almost all APs have fixed cipher suite supported.
- // pTmp = (PUCHAR) pEid->Octet;
- pTmp += 11;
-
- // Cipher Suite Selectors from Spec P802.11i/D3.2 P26.
- // Value Meaning
- // 0 None
- // 1 WEP-40
- // 2 Tkip
- // 3 WRAP
- // 4 AES
- // 5 WEP-104
- // Parse group cipher
- switch (*pTmp)
- {
- case 1:
- pBss->WPA.GroupCipher = Ndis802_11GroupWEP40Enabled;
- break;
- case 5:
- pBss->WPA.GroupCipher = Ndis802_11GroupWEP104Enabled;
- break;
- case 2:
- pBss->WPA.GroupCipher = Ndis802_11Encryption2Enabled;
- break;
- case 4:
- pBss->WPA.GroupCipher = Ndis802_11Encryption3Enabled;
- break;
- default:
- break;
- }
- // number of unicast suite
- pTmp += 1;
-
- // skip all unicast cipher suites
- //Count = *(PUSHORT) pTmp;
- Count = (pTmp[1]<<8) + pTmp[0];
- pTmp += sizeof(USHORT);
-
- // Parsing all unicast cipher suite
- while (Count > 0)
- {
- // Skip OUI
- pTmp += 3;
- TmpCipher = Ndis802_11WEPDisabled;
- switch (*pTmp)
- {
- case 1:
- case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
- TmpCipher = Ndis802_11Encryption1Enabled;
- break;
- case 2:
- TmpCipher = Ndis802_11Encryption2Enabled;
- break;
- case 4:
- TmpCipher = Ndis802_11Encryption3Enabled;
- break;
- default:
- break;
- }
- if (TmpCipher > pBss->WPA.PairCipher)
- {
- // Move the lower cipher suite to PairCipherAux
- pBss->WPA.PairCipherAux = pBss->WPA.PairCipher;
- pBss->WPA.PairCipher = TmpCipher;
- }
- else
- {
- pBss->WPA.PairCipherAux = TmpCipher;
- }
- pTmp++;
- Count--;
- }
-
- // 4. get AKM suite counts
- //Count = *(PUSHORT) pTmp;
- Count = (pTmp[1]<<8) + pTmp[0];
- pTmp += sizeof(USHORT);
- pTmp += 3;
-
- switch (*pTmp)
- {
- case 1:
- // Set AP support WPA-enterprise mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPA;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPA;
- break;
- case 2:
- // Set AP support WPA-PSK mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPAPSK;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPAPSK;
- break;
- default:
- break;
- }
- pTmp += 1;
-
- // Fixed for WPA-None
- if (pBss->BssType == BSS_ADHOC)
- {
- pBss->AuthMode = Ndis802_11AuthModeWPANone;
- pBss->AuthModeAux = Ndis802_11AuthModeWPANone;
- pBss->WepStatus = pBss->WPA.GroupCipher;
- // Patched bugs for old driver
- if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
- pBss->WPA.PairCipherAux = pBss->WPA.GroupCipher;
- }
- else
- pBss->WepStatus = pBss->WPA.PairCipher;
-
- // Check the Pair & Group, if different, turn on mixed mode flag
- if (pBss->WPA.GroupCipher != pBss->WPA.PairCipher)
- pBss->WPA.bMixMode = TRUE;
-
- break;
-
- case IE_RSN:
- pRsnHeader = (PRSN_IE_HEADER_STRUCT) pTmp;
-
- // 0. Version must be 1
- if (le2cpu16(pRsnHeader->Version) != 1)
- break;
- pTmp += sizeof(RSN_IE_HEADER_STRUCT);
-
- // 1. Check group cipher
- pCipher = (PCIPHER_SUITE_STRUCT) pTmp;
- if (!RTMPEqualMemory(pTmp, RSN_OUI, 3))
- break;
-
- // Parse group cipher
- switch (pCipher->Type)
- {
- case 1:
- pBss->WPA2.GroupCipher = Ndis802_11GroupWEP40Enabled;
- break;
- case 5:
- pBss->WPA2.GroupCipher = Ndis802_11GroupWEP104Enabled;
- break;
- case 2:
- pBss->WPA2.GroupCipher = Ndis802_11Encryption2Enabled;
- break;
- case 4:
- pBss->WPA2.GroupCipher = Ndis802_11Encryption3Enabled;
- break;
- default:
- break;
- }
- // set to correct offset for next parsing
- pTmp += sizeof(CIPHER_SUITE_STRUCT);
-
- // 2. Get pairwise cipher counts
- //Count = *(PUSHORT) pTmp;
- Count = (pTmp[1]<<8) + pTmp[0];
- pTmp += sizeof(USHORT);
-
- // 3. Get pairwise cipher
- // Parsing all unicast cipher suite
- while (Count > 0)
- {
- // Skip OUI
- pCipher = (PCIPHER_SUITE_STRUCT) pTmp;
- TmpCipher = Ndis802_11WEPDisabled;
- switch (pCipher->Type)
- {
- case 1:
- case 5: // Although WEP is not allowed in WPA related auth mode, we parse it anyway
- TmpCipher = Ndis802_11Encryption1Enabled;
- break;
- case 2:
- TmpCipher = Ndis802_11Encryption2Enabled;
- break;
- case 4:
- TmpCipher = Ndis802_11Encryption3Enabled;
- break;
- default:
- break;
- }
- if (TmpCipher > pBss->WPA2.PairCipher)
- {
- // Move the lower cipher suite to PairCipherAux
- pBss->WPA2.PairCipherAux = pBss->WPA2.PairCipher;
- pBss->WPA2.PairCipher = TmpCipher;
- }
- else
- {
- pBss->WPA2.PairCipherAux = TmpCipher;
- }
- pTmp += sizeof(CIPHER_SUITE_STRUCT);
- Count--;
- }
-
- // 4. get AKM suite counts
- //Count = *(PUSHORT) pTmp;
- Count = (pTmp[1]<<8) + pTmp[0];
- pTmp += sizeof(USHORT);
-
- // 5. Get AKM ciphers
- // Parsing all AKM ciphers
- while (Count > 0)
- {
- pAKM = (PAKM_SUITE_STRUCT) pTmp;
- if (!RTMPEqualMemory(pTmp, RSN_OUI, 3))
- break;
-
- switch (pAKM->Type)
- {
- case 1:
- // Set AP support WPA-enterprise mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPA2;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPA2;
- break;
- case 2:
- // Set AP support WPA-PSK mode
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeWPA2PSK;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeWPA2PSK;
- break;
- default:
- if (pBss->AuthMode == Ndis802_11AuthModeOpen)
- pBss->AuthMode = Ndis802_11AuthModeMax;
- else
- pBss->AuthModeAux = Ndis802_11AuthModeMax;
- break;
- }
- pTmp += (Count * sizeof(AKM_SUITE_STRUCT));
- Count--;
- }
-
- // Fixed for WPA-None
- if (pBss->BssType == BSS_ADHOC)
- {
- pBss->AuthMode = Ndis802_11AuthModeWPANone;
- pBss->AuthModeAux = Ndis802_11AuthModeWPANone;
- pBss->WPA.PairCipherAux = pBss->WPA2.PairCipherAux;
- pBss->WPA.GroupCipher = pBss->WPA2.GroupCipher;
- pBss->WepStatus = pBss->WPA.GroupCipher;
- // Patched bugs for old driver
- if (pBss->WPA.PairCipherAux == Ndis802_11WEPDisabled)
- pBss->WPA.PairCipherAux = pBss->WPA.GroupCipher;
- }
- pBss->WepStatus = pBss->WPA2.PairCipher;
-
- // 6. Get RSN capability
- //pBss->WPA2.RsnCapability = *(PUSHORT) pTmp;
- pBss->WPA2.RsnCapability = (pTmp[1]<<8) + pTmp[0];
- pTmp += sizeof(USHORT);
-
- // Check the Pair & Group, if different, turn on mixed mode flag
- if (pBss->WPA2.GroupCipher != pBss->WPA2.PairCipher)
- pBss->WPA2.bMixMode = TRUE;
-
- break;
- default:
- break;
- }
- Length -= (pEid->Len + 2);
- }
-}
-
-// ===========================================================================================
-// mac_table.c
-// ===========================================================================================
-
-/*! \brief generates a random mac address value for IBSS BSSID
- * \param Addr the bssid location
- * \return none
- * \pre
- * \post
- */
-VOID MacAddrRandomBssid(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pAddr)
-{
- INT i;
-
- for (i = 0; i < MAC_ADDR_LEN; i++)
- {
- pAddr[i] = RandomByte(pAd);
- }
-
- pAddr[0] = (pAddr[0] & 0xfe) | 0x02; // the first 2 bits must be 01xxxxxxxx
-}
-
-/*! \brief init the management mac frame header
- * \param p_hdr mac header
- * \param subtype subtype of the frame
- * \param p_ds destination address, don't care if it is a broadcast address
- * \return none
- * \pre the station has the following information in the pAd->StaCfg
- * - bssid
- * - station address
- * \post
- * \note this function initializes the following field
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- */
-VOID MgtMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR SubType,
- IN UCHAR ToDs,
- IN PUCHAR pDA,
- IN PUCHAR pBssid)
-{
- NdisZeroMemory(pHdr80211, sizeof(HEADER_802_11));
-
- pHdr80211->FC.Type = BTYPE_MGMT;
- pHdr80211->FC.SubType = SubType;
-// if (SubType == SUBTYPE_ACK) // sample, no use, it will conflict with ACTION frame sub type
-// pHdr80211->FC.Type = BTYPE_CNTL;
- pHdr80211->FC.ToDs = ToDs;
- COPY_MAC_ADDR(pHdr80211->Addr1, pDA);
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- COPY_MAC_ADDR(pHdr80211->Addr2, pAd->CurrentAddress);
-#endif // CONFIG_STA_SUPPORT //
- COPY_MAC_ADDR(pHdr80211->Addr3, pBssid);
-}
-
-// ===========================================================================================
-// mem_mgmt.c
-// ===========================================================================================
-
-/*!***************************************************************************
- * This routine build an outgoing frame, and fill all information specified
- * in argument list to the frame body. The actual frame size is the summation
- * of all arguments.
- * input params:
- * Buffer - pointer to a pre-allocated memory segment
- * args - a list of <int arg_size, arg> pairs.
- * NOTE NOTE NOTE!!!! the last argument must be NULL, otherwise this
- * function will FAIL!!!
- * return:
- * Size of the buffer
- * usage:
- * MakeOutgoingFrame(Buffer, output_length, 2, &fc, 2, &dur, 6, p_addr1, 6,p_addr2, END_OF_ARGS);
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ****************************************************************************/
-ULONG MakeOutgoingFrame(
- OUT UCHAR *Buffer,
- OUT ULONG *FrameLen, ...)
-{
- UCHAR *p;
- int leng;
- ULONG TotLeng;
- va_list Args;
-
- // calculates the total length
- TotLeng = 0;
- va_start(Args, FrameLen);
- do
- {
- leng = va_arg(Args, int);
- if (leng == END_OF_ARGS)
- {
- break;
- }
- p = va_arg(Args, PVOID);
- NdisMoveMemory(&Buffer[TotLeng], p, leng);
- TotLeng = TotLeng + leng;
- } while(TRUE);
-
- va_end(Args); /* clean up */
- *FrameLen = TotLeng;
- return TotLeng;
-}
-
-// ===========================================================================================
-// mlme_queue.c
-// ===========================================================================================
-
-/*! \brief Initialize The MLME Queue, used by MLME Functions
- * \param *Queue The MLME Queue
- * \return Always Return NDIS_STATE_SUCCESS in this implementation
- * \pre
- * \post
- * \note Because this is done only once (at the init stage), no need to be locked
-
- IRQL = PASSIVE_LEVEL
-
- */
-NDIS_STATUS MlmeQueueInit(
- IN MLME_QUEUE *Queue)
-{
- INT i;
-
- NdisAllocateSpinLock(&Queue->Lock);
-
- Queue->Num = 0;
- Queue->Head = 0;
- Queue->Tail = 0;
-
- for (i = 0; i < MAX_LEN_OF_MLME_QUEUE; i++)
- {
- Queue->Entry[i].Occupied = FALSE;
- Queue->Entry[i].MsgLen = 0;
- NdisZeroMemory(Queue->Entry[i].Msg, MGMT_DMA_BUFFER_SIZE);
- }
-
- return NDIS_STATUS_SUCCESS;
-}
-
-/*! \brief Enqueue a message for other threads, if they want to send messages to MLME thread
- * \param *Queue The MLME Queue
- * \param Machine The State Machine Id
- * \param MsgType The Message Type
- * \param MsgLen The Message length
- * \param *Msg The message pointer
- * \return TRUE if enqueue is successful, FALSE if the queue is full
- * \pre
- * \post
- * \note The message has to be initialized
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- */
-BOOLEAN MlmeEnqueue(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Machine,
- IN ULONG MsgType,
- IN ULONG MsgLen,
- IN VOID *Msg)
-{
- INT Tail;
- MLME_QUEUE *Queue = (MLME_QUEUE *)&pAd->Mlme.Queue;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return FALSE;
-
- // First check the size, it MUST not exceed the mlme queue size
- if (MsgLen > MGMT_DMA_BUFFER_SIZE)
- {
- DBGPRINT_ERR(("MlmeEnqueue: msg too large, size = %ld \n", MsgLen));
- return FALSE;
- }
-
- if (MlmeQueueFull(Queue))
- {
- return FALSE;
- }
-
- NdisAcquireSpinLock(&(Queue->Lock));
- Tail = Queue->Tail;
- Queue->Tail++;
- Queue->Num++;
- if (Queue->Tail == MAX_LEN_OF_MLME_QUEUE)
- {
- Queue->Tail = 0;
- }
-
- Queue->Entry[Tail].Wcid = RESERVED_WCID;
- Queue->Entry[Tail].Occupied = TRUE;
- Queue->Entry[Tail].Machine = Machine;
- Queue->Entry[Tail].MsgType = MsgType;
- Queue->Entry[Tail].MsgLen = MsgLen;
-
- if (Msg != NULL)
- {
- NdisMoveMemory(Queue->Entry[Tail].Msg, Msg, MsgLen);
- }
-
- NdisReleaseSpinLock(&(Queue->Lock));
- return TRUE;
-}
-
-/*! \brief This function is used when Recv gets a MLME message
- * \param *Queue The MLME Queue
- * \param TimeStampHigh The upper 32 bit of timestamp
- * \param TimeStampLow The lower 32 bit of timestamp
- * \param Rssi The receiving RSSI strength
- * \param MsgLen The length of the message
- * \param *Msg The message pointer
- * \return TRUE if everything ok, FALSE otherwise (like Queue Full)
- * \pre
- * \post
-
- IRQL = DISPATCH_LEVEL
-
- */
-BOOLEAN MlmeEnqueueForRecv(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN ULONG TimeStampHigh,
- IN ULONG TimeStampLow,
- IN UCHAR Rssi0,
- IN UCHAR Rssi1,
- IN UCHAR Rssi2,
- IN ULONG MsgLen,
- IN VOID *Msg,
- IN UCHAR Signal)
-{
- INT Tail, Machine;
- PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
- INT MsgType;
- MLME_QUEUE *Queue = (MLME_QUEUE *)&pAd->Mlme.Queue;
-
-#ifdef RALINK_ATE
- /* Nothing to do in ATE mode */
- if(ATE_ON(pAd))
- return FALSE;
-#endif // RALINK_ATE //
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- {
- DBGPRINT_ERR(("MlmeEnqueueForRecv: fRTMP_ADAPTER_HALT_IN_PROGRESS\n"));
- return FALSE;
- }
-
- // First check the size, it MUST not exceed the mlme queue size
- if (MsgLen > MGMT_DMA_BUFFER_SIZE)
- {
- DBGPRINT_ERR(("MlmeEnqueueForRecv: frame too large, size = %ld \n", MsgLen));
- return FALSE;
- }
-
- if (MlmeQueueFull(Queue))
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (!MsgTypeSubst(pAd, pFrame, &Machine, &MsgType))
- {
- DBGPRINT_ERR(("MlmeEnqueueForRecv: un-recongnized mgmt->subtype=%d\n",pFrame->Hdr.FC.SubType));
- return FALSE;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // OK, we got all the informations, it is time to put things into queue
- NdisAcquireSpinLock(&(Queue->Lock));
- Tail = Queue->Tail;
- Queue->Tail++;
- Queue->Num++;
- if (Queue->Tail == MAX_LEN_OF_MLME_QUEUE)
- {
- Queue->Tail = 0;
- }
- Queue->Entry[Tail].Occupied = TRUE;
- Queue->Entry[Tail].Machine = Machine;
- Queue->Entry[Tail].MsgType = MsgType;
- Queue->Entry[Tail].MsgLen = MsgLen;
- Queue->Entry[Tail].TimeStamp.u.LowPart = TimeStampLow;
- Queue->Entry[Tail].TimeStamp.u.HighPart = TimeStampHigh;
- Queue->Entry[Tail].Rssi0 = Rssi0;
- Queue->Entry[Tail].Rssi1 = Rssi1;
- Queue->Entry[Tail].Rssi2 = Rssi2;
- Queue->Entry[Tail].Signal = Signal;
- Queue->Entry[Tail].Wcid = (UCHAR)Wcid;
-
- Queue->Entry[Tail].Channel = pAd->LatchRfRegs.Channel;
-
- if (Msg != NULL)
- {
- NdisMoveMemory(Queue->Entry[Tail].Msg, Msg, MsgLen);
- }
-
- NdisReleaseSpinLock(&(Queue->Lock));
-
- RTMP_MLME_HANDLER(pAd);
-
- return TRUE;
-}
-
-
-/*! \brief Dequeue a message from the MLME Queue
- * \param *Queue The MLME Queue
- * \param *Elem The message dequeued from MLME Queue
- * \return TRUE if the Elem contains something, FALSE otherwise
- * \pre
- * \post
-
- IRQL = DISPATCH_LEVEL
-
- */
-BOOLEAN MlmeDequeue(
- IN MLME_QUEUE *Queue,
- OUT MLME_QUEUE_ELEM **Elem)
-{
- NdisAcquireSpinLock(&(Queue->Lock));
- *Elem = &(Queue->Entry[Queue->Head]);
- Queue->Num--;
- Queue->Head++;
- if (Queue->Head == MAX_LEN_OF_MLME_QUEUE)
- {
- Queue->Head = 0;
- }
- NdisReleaseSpinLock(&(Queue->Lock));
- return TRUE;
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID MlmeRestartStateMachine(
- IN PRTMP_ADAPTER pAd)
-{
-#ifdef RTMP_MAC_PCI
- MLME_QUEUE_ELEM *Elem = NULL;
-#endif // RTMP_MAC_PCI //
-#ifdef CONFIG_STA_SUPPORT
- BOOLEAN Cancelled;
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeRestartStateMachine \n"));
-
-#ifdef RTMP_MAC_PCI
- NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
- if(pAd->Mlme.bRunning)
- {
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
- return;
- }
- else
- {
- pAd->Mlme.bRunning = TRUE;
- }
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
-
- // Remove all Mlme queues elements
- while (!MlmeQueueEmpty(&pAd->Mlme.Queue))
- {
- //From message type, determine which state machine I should drive
- if (MlmeDequeue(&pAd->Mlme.Queue, &Elem))
- {
- // free MLME element
- Elem->Occupied = FALSE;
- Elem->MsgLen = 0;
-
- }
- else {
- DBGPRINT_ERR(("MlmeRestartStateMachine: MlmeQueue empty\n"));
- }
- }
-#endif // RTMP_MAC_PCI //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef QOS_DLS_SUPPORT
- UCHAR i;
-#endif // QOS_DLS_SUPPORT //
- // Cancel all timer events
- // Be careful to cancel new added timer
- RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &Cancelled);
- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &Cancelled);
-
-#ifdef QOS_DLS_SUPPORT
- for (i=0; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &Cancelled);
- }
-#endif // QOS_DLS_SUPPORT //
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Change back to original channel in case of doing scan
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- // Resume MSDU which is turned off durning scan
- RTMPResumeMsduTransmission(pAd);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Set all state machines back IDLE
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- pAd->Mlme.AuthRspMachine.CurrState = AUTH_RSP_IDLE;
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- pAd->Mlme.ActMachine.CurrState = ACT_IDLE;
-#ifdef QOS_DLS_SUPPORT
- pAd->Mlme.DlsMachine.CurrState = DLS_IDLE;
-#endif // QOS_DLS_SUPPORT //
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RTMP_MAC_PCI
- // Remove running state
- NdisAcquireSpinLock(&pAd->Mlme.TaskLock);
- pAd->Mlme.bRunning = FALSE;
- NdisReleaseSpinLock(&pAd->Mlme.TaskLock);
-#endif // RTMP_MAC_PCI //
-}
-
-/*! \brief test if the MLME Queue is empty
- * \param *Queue The MLME Queue
- * \return TRUE if the Queue is empty, FALSE otherwise
- * \pre
- * \post
-
- IRQL = DISPATCH_LEVEL
-
- */
-BOOLEAN MlmeQueueEmpty(
- IN MLME_QUEUE *Queue)
-{
- BOOLEAN Ans;
-
- NdisAcquireSpinLock(&(Queue->Lock));
- Ans = (Queue->Num == 0);
- NdisReleaseSpinLock(&(Queue->Lock));
-
- return Ans;
-}
-
-/*! \brief test if the MLME Queue is full
- * \param *Queue The MLME Queue
- * \return TRUE if the Queue is empty, FALSE otherwise
- * \pre
- * \post
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- */
-BOOLEAN MlmeQueueFull(
- IN MLME_QUEUE *Queue)
-{
- BOOLEAN Ans;
-
- NdisAcquireSpinLock(&(Queue->Lock));
- Ans = (Queue->Num == MAX_LEN_OF_MLME_QUEUE || Queue->Entry[Queue->Tail].Occupied);
- NdisReleaseSpinLock(&(Queue->Lock));
-
- return Ans;
-}
-
-/*! \brief The destructor of MLME Queue
- * \param
- * \return
- * \pre
- * \post
- * \note Clear Mlme Queue, Set Queue->Num to Zero.
-
- IRQL = PASSIVE_LEVEL
-
- */
-VOID MlmeQueueDestroy(
- IN MLME_QUEUE *pQueue)
-{
- NdisAcquireSpinLock(&(pQueue->Lock));
- pQueue->Num = 0;
- pQueue->Head = 0;
- pQueue->Tail = 0;
- NdisReleaseSpinLock(&(pQueue->Lock));
- NdisFreeSpinLock(&(pQueue->Lock));
-}
-
-
-/*! \brief To substitute the message type if the message is coming from external
- * \param pFrame The frame received
- * \param *Machine The state machine
- * \param *MsgType the message type for the state machine
- * \return TRUE if the substitution is successful, FALSE otherwise
- * \pre
- * \post
-
- IRQL = DISPATCH_LEVEL
-
- */
-#ifdef CONFIG_STA_SUPPORT
-BOOLEAN MsgTypeSubst(
- IN PRTMP_ADAPTER pAd,
- IN PFRAME_802_11 pFrame,
- OUT INT *Machine,
- OUT INT *MsgType)
-{
- USHORT Seq, Alg;
- UCHAR EAPType;
- PUCHAR pData;
-
- // Pointer to start of data frames including SNAP header
- pData = (PUCHAR) pFrame + LENGTH_802_11;
-
- // The only data type will pass to this function is EAPOL frame
- if (pFrame->Hdr.FC.Type == BTYPE_DATA)
- {
- {
- *Machine = WPA_STATE_MACHINE;
- EAPType = *((UCHAR*)pFrame + LENGTH_802_11 + LENGTH_802_1_H + 1);
- return (WpaMsgTypeSubst(EAPType, (INT *) MsgType));
- }
- }
-
- switch (pFrame->Hdr.FC.SubType)
- {
- case SUBTYPE_ASSOC_REQ:
- *Machine = ASSOC_STATE_MACHINE;
- *MsgType = MT2_PEER_ASSOC_REQ;
- break;
- case SUBTYPE_ASSOC_RSP:
- *Machine = ASSOC_STATE_MACHINE;
- *MsgType = MT2_PEER_ASSOC_RSP;
- break;
- case SUBTYPE_REASSOC_REQ:
- *Machine = ASSOC_STATE_MACHINE;
- *MsgType = MT2_PEER_REASSOC_REQ;
- break;
- case SUBTYPE_REASSOC_RSP:
- *Machine = ASSOC_STATE_MACHINE;
- *MsgType = MT2_PEER_REASSOC_RSP;
- break;
- case SUBTYPE_PROBE_REQ:
- *Machine = SYNC_STATE_MACHINE;
- *MsgType = MT2_PEER_PROBE_REQ;
- break;
- case SUBTYPE_PROBE_RSP:
- *Machine = SYNC_STATE_MACHINE;
- *MsgType = MT2_PEER_PROBE_RSP;
- break;
- case SUBTYPE_BEACON:
- *Machine = SYNC_STATE_MACHINE;
- *MsgType = MT2_PEER_BEACON;
- break;
- case SUBTYPE_ATIM:
- *Machine = SYNC_STATE_MACHINE;
- *MsgType = MT2_PEER_ATIM;
- break;
- case SUBTYPE_DISASSOC:
- *Machine = ASSOC_STATE_MACHINE;
- *MsgType = MT2_PEER_DISASSOC_REQ;
- break;
- case SUBTYPE_AUTH:
- // get the sequence number from payload 24 Mac Header + 2 bytes algorithm
- NdisMoveMemory(&Seq, &pFrame->Octet[2], sizeof(USHORT));
- NdisMoveMemory(&Alg, &pFrame->Octet[0], sizeof(USHORT));
- if (Seq == 1 || Seq == 3)
- {
- *Machine = AUTH_RSP_STATE_MACHINE;
- *MsgType = MT2_PEER_AUTH_ODD;
- }
- else if (Seq == 2 || Seq == 4)
- {
- if (Alg == AUTH_MODE_OPEN || Alg == AUTH_MODE_KEY)
- {
- *Machine = AUTH_STATE_MACHINE;
- *MsgType = MT2_PEER_AUTH_EVEN;
- }
- }
- else
- {
- return FALSE;
- }
- break;
- case SUBTYPE_DEAUTH:
- *Machine = AUTH_RSP_STATE_MACHINE;
- *MsgType = MT2_PEER_DEAUTH;
- break;
- case SUBTYPE_ACTION:
- *Machine = ACTION_STATE_MACHINE;
- // Sometimes Sta will return with category bytes with MSB = 1, if they receive catogory out of their support
- if ((pFrame->Octet[0]&0x7F) > MAX_PEER_CATE_MSG)
- {
- *MsgType = MT2_ACT_INVALID;
- }
- else
- {
- *MsgType = (pFrame->Octet[0]&0x7F);
- }
- break;
- default:
- return FALSE;
- break;
- }
-
- return TRUE;
-}
-#endif // CONFIG_STA_SUPPORT //
-
-// ===========================================================================================
-// state_machine.c
-// ===========================================================================================
-
-/*! \brief Initialize the state machine.
- * \param *S pointer to the state machine
- * \param Trans State machine transition function
- * \param StNr number of states
- * \param MsgNr number of messages
- * \param DefFunc default function, when there is invalid state/message combination
- * \param InitState initial state of the state machine
- * \param Base StateMachine base, internal use only
- * \pre p_sm should be a legal pointer
- * \post
-
- IRQL = PASSIVE_LEVEL
-
- */
-VOID StateMachineInit(
- IN STATE_MACHINE *S,
- IN STATE_MACHINE_FUNC Trans[],
- IN ULONG StNr,
- IN ULONG MsgNr,
- IN STATE_MACHINE_FUNC DefFunc,
- IN ULONG InitState,
- IN ULONG Base)
-{
- ULONG i, j;
-
- // set number of states and messages
- S->NrState = StNr;
- S->NrMsg = MsgNr;
- S->Base = Base;
-
- S->TransFunc = Trans;
-
- // init all state transition to default function
- for (i = 0; i < StNr; i++)
- {
- for (j = 0; j < MsgNr; j++)
- {
- S->TransFunc[i * MsgNr + j] = DefFunc;
- }
- }
-
- // set the starting state
- S->CurrState = InitState;
-}
-
-/*! \brief This function fills in the function pointer into the cell in the state machine
- * \param *S pointer to the state machine
- * \param St state
- * \param Msg incoming message
- * \param f the function to be executed when (state, message) combination occurs at the state machine
- * \pre *S should be a legal pointer to the state machine, st, msg, should be all within the range, Base should be set in the initial state
- * \post
-
- IRQL = PASSIVE_LEVEL
-
- */
-VOID StateMachineSetAction(
- IN STATE_MACHINE *S,
- IN ULONG St,
- IN ULONG Msg,
- IN STATE_MACHINE_FUNC Func)
-{
- ULONG MsgIdx;
-
- MsgIdx = Msg - S->Base;
-
- if (St < S->NrState && MsgIdx < S->NrMsg)
- {
- // boundary checking before setting the action
- S->TransFunc[St * S->NrMsg + MsgIdx] = Func;
- }
-}
-
-/*! \brief This function does the state transition
- * \param *Adapter the NIC adapter pointer
- * \param *S the state machine
- * \param *Elem the message to be executed
- * \return None
-
- IRQL = DISPATCH_LEVEL
-
- */
-VOID StateMachinePerformAction(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- IN MLME_QUEUE_ELEM *Elem)
-{
- (*(S->TransFunc[S->CurrState * S->NrMsg + Elem->MsgType - S->Base]))(pAd, Elem);
-}
-
-/*
- ==========================================================================
- Description:
- The drop function, when machine executes this, the message is simply
- ignored. This function does nothing, the message is freed in
- StateMachinePerformAction()
- ==========================================================================
- */
-VOID Drop(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-}
-
-// ===========================================================================================
-// lfsr.c
-// ===========================================================================================
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-VOID LfsrInit(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Seed)
-{
- if (Seed == 0)
- pAd->Mlme.ShiftReg = 1;
- else
- pAd->Mlme.ShiftReg = Seed;
-}
-
-/*
- ==========================================================================
- Description:
- ==========================================================================
- */
-UCHAR RandomByte(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG i;
- UCHAR R, Result;
-
- R = 0;
-
- if (pAd->Mlme.ShiftReg == 0)
- NdisGetSystemUpTime((ULONG *)&pAd->Mlme.ShiftReg);
-
- for (i = 0; i < 8; i++)
- {
- if (pAd->Mlme.ShiftReg & 0x00000001)
- {
- pAd->Mlme.ShiftReg = ((pAd->Mlme.ShiftReg ^ LFSR_MASK) >> 1) | 0x80000000;
- Result = 1;
- }
- else
- {
- pAd->Mlme.ShiftReg = pAd->Mlme.ShiftReg >> 1;
- Result = 0;
- }
- R = (R << 1) | Result;
- }
-
- return R;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Verify the support rate for different PHY type
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID RTMPCheckRates(
- IN PRTMP_ADAPTER pAd,
- IN OUT UCHAR SupRate[],
- IN OUT UCHAR *SupRateLen)
-{
- UCHAR RateIdx, i, j;
- UCHAR NewRate[12], NewRateLen;
-
- NewRateLen = 0;
-
- if (pAd->CommonCfg.PhyMode == PHY_11B)
- RateIdx = 4;
- else
- RateIdx = 12;
-
- // Check for support rates exclude basic rate bit
- for (i = 0; i < *SupRateLen; i++)
- for (j = 0; j < RateIdx; j++)
- if ((SupRate[i] & 0x7f) == RateIdTo500Kbps[j])
- NewRate[NewRateLen++] = SupRate[i];
-
- *SupRateLen = NewRateLen;
- NdisMoveMemory(SupRate, NewRate, NewRateLen);
-}
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef DOT11_N_SUPPORT
-BOOLEAN RTMPCheckChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR CentralChannel,
- IN UCHAR Channel)
-{
- UCHAR k;
- UCHAR UpperChannel = 0, LowerChannel = 0;
- UCHAR NoEffectChannelinList = 0;
-
- // Find upper and lower channel according to 40MHz current operation.
- if (CentralChannel < Channel)
- {
- UpperChannel = Channel;
- if (CentralChannel > 2)
- LowerChannel = CentralChannel - 2;
- else
- return FALSE;
- }
- else if (CentralChannel > Channel)
- {
- UpperChannel = CentralChannel + 2;
- LowerChannel = Channel;
- }
-
- for (k = 0;k < pAd->ChannelListNum;k++)
- {
- if (pAd->ChannelList[k].Channel == UpperChannel)
- {
- NoEffectChannelinList ++;
- }
- if (pAd->ChannelList[k].Channel == LowerChannel)
- {
- NoEffectChannelinList ++;
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("Total Channel in Channel List = [%d]\n", NoEffectChannelinList));
- if (NoEffectChannelinList == 2)
- return TRUE;
- else
- return FALSE;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Verify the support rate for HT phy type
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- FALSE if pAd->CommonCfg.SupportedHtPhy doesn't accept the pHtCapability. (AP Mode)
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-BOOLEAN RTMPCheckHt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN ADD_HT_INFO_IE *pAddHtInfo)
-{
- if (Wcid >= MAX_LEN_OF_MAC_TABLE)
- return FALSE;
-
- // If use AMSDU, set flag.
- if (pAd->CommonCfg.DesiredHtPhy.AmsduEnable)
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_AMSDU_INUSED);
- // Save Peer Capability
- if (pHtCapability->HtCapInfo.ShortGIfor20)
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_SGI20_CAPABLE);
- if (pHtCapability->HtCapInfo.ShortGIfor40)
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_SGI40_CAPABLE);
- if (pHtCapability->HtCapInfo.TxSTBC)
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_TxSTBC_CAPABLE);
- if (pHtCapability->HtCapInfo.RxSTBC)
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_RxSTBC_CAPABLE);
- if (pAd->CommonCfg.bRdg && pHtCapability->ExtHtCapInfo.RDGSupport)
- {
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[Wcid], fCLIENT_STATUS_RDG_CAPABLE);
- }
-
- if (Wcid < MAX_LEN_OF_MAC_TABLE)
- {
- pAd->MacTab.Content[Wcid].MpduDensity = pHtCapability->HtCapParm.MpduDensity;
- }
-
- // Will check ChannelWidth for MCSSet[4] below
- pAd->MlmeAux.HtCapability.MCSSet[4] = 0x1;
- switch (pAd->CommonCfg.RxStream)
- {
- case 1:
- pAd->MlmeAux.HtCapability.MCSSet[0] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[1] = 0x00;
- pAd->MlmeAux.HtCapability.MCSSet[2] = 0x00;
- pAd->MlmeAux.HtCapability.MCSSet[3] = 0x00;
- break;
- case 2:
- pAd->MlmeAux.HtCapability.MCSSet[0] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[1] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[2] = 0x00;
- pAd->MlmeAux.HtCapability.MCSSet[3] = 0x00;
- break;
- case 3:
- pAd->MlmeAux.HtCapability.MCSSet[0] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[1] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[2] = 0xff;
- pAd->MlmeAux.HtCapability.MCSSet[3] = 0x00;
- break;
- }
-
- pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth = pAddHtInfo->AddHtInfo.RecomWidth & pAd->CommonCfg.DesiredHtPhy.ChannelWidth;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPCheckHt:: HtCapInfo.ChannelWidth=%d, RecomWidth=%d, DesiredHtPhy.ChannelWidth=%d, BW40MAvailForA/G=%d/%d, PhyMode=%d \n",
- pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth, pAddHtInfo->AddHtInfo.RecomWidth, pAd->CommonCfg.DesiredHtPhy.ChannelWidth,
- pAd->NicConfig2.field.BW40MAvailForA, pAd->NicConfig2.field.BW40MAvailForG, pAd->CommonCfg.PhyMode));
-
- pAd->MlmeAux.HtCapability.HtCapInfo.GF = pHtCapability->HtCapInfo.GF &pAd->CommonCfg.DesiredHtPhy.GF;
-
- // Send Assoc Req with my HT capability.
- pAd->MlmeAux.HtCapability.HtCapInfo.AMsduSize = pAd->CommonCfg.DesiredHtPhy.AmsduSize;
- pAd->MlmeAux.HtCapability.HtCapInfo.MimoPs = pAd->CommonCfg.DesiredHtPhy.MimoPs;
- pAd->MlmeAux.HtCapability.HtCapInfo.ShortGIfor20 = (pAd->CommonCfg.DesiredHtPhy.ShortGIfor20) & (pHtCapability->HtCapInfo.ShortGIfor20);
- pAd->MlmeAux.HtCapability.HtCapInfo.ShortGIfor40 = (pAd->CommonCfg.DesiredHtPhy.ShortGIfor40) & (pHtCapability->HtCapInfo.ShortGIfor40);
- pAd->MlmeAux.HtCapability.HtCapInfo.TxSTBC = (pAd->CommonCfg.DesiredHtPhy.TxSTBC)&(pHtCapability->HtCapInfo.RxSTBC);
- pAd->MlmeAux.HtCapability.HtCapInfo.RxSTBC = (pAd->CommonCfg.DesiredHtPhy.RxSTBC)&(pHtCapability->HtCapInfo.TxSTBC);
- pAd->MlmeAux.HtCapability.HtCapParm.MaxRAmpduFactor = pAd->CommonCfg.DesiredHtPhy.MaxRAmpduFactor;
- pAd->MlmeAux.HtCapability.HtCapParm.MpduDensity = pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity;
- pAd->MlmeAux.HtCapability.ExtHtCapInfo.PlusHTC = pHtCapability->ExtHtCapInfo.PlusHTC;
- pAd->MacTab.Content[Wcid].HTCapability.ExtHtCapInfo.PlusHTC = pHtCapability->ExtHtCapInfo.PlusHTC;
- if (pAd->CommonCfg.bRdg)
- {
- pAd->MlmeAux.HtCapability.ExtHtCapInfo.RDGSupport = pHtCapability->ExtHtCapInfo.RDGSupport;
- pAd->MlmeAux.HtCapability.ExtHtCapInfo.PlusHTC = 1;
- }
-
- if (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_20)
- pAd->MlmeAux.HtCapability.MCSSet[4] = 0x0; // BW20 can't transmit MCS32
-
- COPY_AP_HTSETTINGS_FROM_BEACON(pAd, pHtCapability);
- return TRUE;
-}
-#endif // DOT11_N_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-/*
- ========================================================================
-
- Routine Description:
- Verify the support rate for different PHY type
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID RTMPUpdateMlmeRate(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR MinimumRate;
- UCHAR ProperMlmeRate; //= RATE_54;
- UCHAR i, j, RateIdx = 12; //1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
- BOOLEAN bMatch = FALSE;
-
- switch (pAd->CommonCfg.PhyMode)
- {
- case PHY_11B:
- ProperMlmeRate = RATE_11;
- MinimumRate = RATE_1;
- break;
- case PHY_11BG_MIXED:
-#ifdef DOT11_N_SUPPORT
- case PHY_11ABGN_MIXED:
- case PHY_11BGN_MIXED:
-#endif // DOT11_N_SUPPORT //
- if ((pAd->MlmeAux.SupRateLen == 4) &&
- (pAd->MlmeAux.ExtRateLen == 0))
- // B only AP
- ProperMlmeRate = RATE_11;
- else
- ProperMlmeRate = RATE_24;
-
- if (pAd->MlmeAux.Channel <= 14)
- MinimumRate = RATE_1;
- else
- MinimumRate = RATE_6;
- break;
- case PHY_11A:
-#ifdef DOT11_N_SUPPORT
- case PHY_11N_2_4G: // rt2860 need to check mlmerate for 802.11n
- case PHY_11GN_MIXED:
- case PHY_11AGN_MIXED:
- case PHY_11AN_MIXED:
- case PHY_11N_5G:
-#endif // DOT11_N_SUPPORT //
- ProperMlmeRate = RATE_24;
- MinimumRate = RATE_6;
- break;
- case PHY_11ABG_MIXED:
- ProperMlmeRate = RATE_24;
- if (pAd->MlmeAux.Channel <= 14)
- MinimumRate = RATE_1;
- else
- MinimumRate = RATE_6;
- break;
- default: // error
- ProperMlmeRate = RATE_1;
- MinimumRate = RATE_1;
- break;
- }
-
- for (i = 0; i < pAd->MlmeAux.SupRateLen; i++)
- {
- for (j = 0; j < RateIdx; j++)
- {
- if ((pAd->MlmeAux.SupRate[i] & 0x7f) == RateIdTo500Kbps[j])
- {
- if (j == ProperMlmeRate)
- {
- bMatch = TRUE;
- break;
- }
- }
- }
-
- if (bMatch)
- break;
- }
-
- if (bMatch == FALSE)
- {
- for (i = 0; i < pAd->MlmeAux.ExtRateLen; i++)
- {
- for (j = 0; j < RateIdx; j++)
- {
- if ((pAd->MlmeAux.ExtRate[i] & 0x7f) == RateIdTo500Kbps[j])
- {
- if (j == ProperMlmeRate)
- {
- bMatch = TRUE;
- break;
- }
- }
- }
-
- if (bMatch)
- break;
- }
- }
-
- if (bMatch == FALSE)
- {
- ProperMlmeRate = MinimumRate;
- }
-
- pAd->CommonCfg.MlmeRate = MinimumRate;
- pAd->CommonCfg.RtsRate = ProperMlmeRate;
- if (pAd->CommonCfg.MlmeRate >= RATE_6)
- {
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
- pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MODE = MODE_OFDM;
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- }
- else
- {
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_CCK;
- pAd->CommonCfg.MlmeTransmit.field.MCS = pAd->CommonCfg.MlmeRate;
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MODE = MODE_CCK;
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MCS = pAd->CommonCfg.MlmeRate;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPUpdateMlmeRate ==> MlmeTransmit = 0x%x \n" , pAd->CommonCfg.MlmeTransmit.word));
-}
-
-CHAR RTMPMaxRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi0,
- IN CHAR Rssi1,
- IN CHAR Rssi2)
-{
- CHAR larger = -127;
-
- if ((pAd->Antenna.field.RxPath == 1) && (Rssi0 != 0))
- {
- larger = Rssi0;
- }
-
- if ((pAd->Antenna.field.RxPath >= 2) && (Rssi1 != 0))
- {
- larger = max(Rssi0, Rssi1);
- }
-
- if ((pAd->Antenna.field.RxPath == 3) && (Rssi2 != 0))
- {
- larger = max(larger, Rssi2);
- }
-
- if (larger == -127)
- larger = 0;
-
- return larger;
-}
-
-
-/*
- ========================================================================
- Routine Description:
- Periodic evaluate antenna link status
-
- Arguments:
- pAd - Adapter pointer
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID AsicEvaluateRxAnt(
- IN PRTMP_ADAPTER pAd)
-{
-#ifdef CONFIG_STA_SUPPORT
- UCHAR BBPR3 = 0;
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_NIC_NOT_EXIST |
- fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS) ||
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT3090
- || (pAd->bPCIclkOff == TRUE)
-#endif // RT3090 //
-#ifdef ANT_DIVERSITY_SUPPORT
- || (pAd->EepromAccess)
-#endif // ANT_DIVERSITY_SUPPORT //
- )
- return;
-
-#ifdef ANT_DIVERSITY_SUPPORT
- if ((pAd->NicConfig2.field.AntDiversity) && (pAd->CommonCfg.bRxAntDiversity == ANT_DIVERSITY_ENABLE))
- {
- // two antenna selection mechanism- one is antenna diversity, the other is failed antenna remove
- // one is antenna diversity:there is only one antenna can rx and tx
- // the other is failed antenna remove:two physical antenna can rx and tx
- DBGPRINT(RT_DEBUG_TRACE,("AntDiv - before evaluate Pair1-Ant (%d,%d)\n",
- pAd->RxAnt.Pair1PrimaryRxAnt, pAd->RxAnt.Pair1SecondaryRxAnt));
-
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1SecondaryRxAnt);
-
- pAd->RxAnt.EvaluatePeriod = 1; // 1:Means switch to SecondaryRxAnt, 0:Means switch to Pair1PrimaryRxAnt
- pAd->RxAnt.FirstPktArrivedWhenEvaluate = FALSE;
- pAd->RxAnt.RcvPktNumWhenEvaluate = 0;
-
- // a one-shot timer to end the evalution
- // dynamic adjust antenna evaluation period according to the traffic
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 100);
- else
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 300);
- }
- else
-#endif // ANT_DIVERSITY_SUPPORT //
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-
- if (pAd->StaCfg.Psm == PWR_SAVE)
- return;
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
- BBPR3 &= (~0x18);
- if(pAd->Antenna.field.RxPath == 3)
- {
- BBPR3 |= (0x10);
- }
- else if(pAd->Antenna.field.RxPath == 2)
- {
- BBPR3 |= (0x8);
- }
- else if(pAd->Antenna.field.RxPath == 1)
- {
- BBPR3 |= (0x0);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef RTMP_MAC_PCI
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- pAd->StaCfg.BBPR3 = BBPR3;
-#endif // RTMP_MAC_PCI //
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
- )
- {
- ULONG TxTotalCnt = pAd->RalinkCounters.OneSecTxNoRetryOkCount +
- pAd->RalinkCounters.OneSecTxRetryOkCount +
- pAd->RalinkCounters.OneSecTxFailCount;
-
- // dynamic adjust antenna evaluation period according to the traffic
- if (TxTotalCnt > 50)
- {
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 20);
- pAd->Mlme.bLowThroughput = FALSE;
- }
- else
- {
- RTMPSetTimer(&pAd->Mlme.RxAntEvalTimer, 300);
- pAd->Mlme.bLowThroughput = TRUE;
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-}
-
-/*
- ========================================================================
- Routine Description:
- After evaluation, check antenna link status
-
- Arguments:
- pAd - Adapter pointer
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID AsicRxAntEvalTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
- BOOLEAN bSwapAnt = FALSE;
-#ifdef CONFIG_STA_SUPPORT
- UCHAR BBPR3 = 0;
- CHAR larger = -127, rssi0, rssi1, rssi2;
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_NIC_NOT_EXIST) ||
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-#ifdef RT3090
- || (pAd->bPCIclkOff == TRUE)
-#endif // RT3090 //
-#ifdef ANT_DIVERSITY_SUPPORT
- || (pAd->EepromAccess)
-#endif // ANT_DIVERSITY_SUPPORT //
- )
- return;
-
-#ifdef ANT_DIVERSITY_SUPPORT
- if ((pAd->NicConfig2.field.AntDiversity) && (pAd->CommonCfg.bRxAntDiversity == ANT_DIVERSITY_ENABLE))
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- if ((pAd->RxAnt.RcvPktNumWhenEvaluate != 0) && (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1SecondaryRxAnt] >= pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1PrimaryRxAnt]))
- bSwapAnt = TRUE;
-#endif // CONFIG_STA_SUPPORT //
- if (bSwapAnt == TRUE)
- {
- UCHAR temp;
-
- //
- // select PrimaryRxAntPair
- // Role change, Used Pair1SecondaryRxAnt as PrimaryRxAntPair.
- // Since Pair1SecondaryRxAnt Quality good than Pair1PrimaryRxAnt
- //
- temp = pAd->RxAnt.Pair1PrimaryRxAnt;
- pAd->RxAnt.Pair1PrimaryRxAnt = pAd->RxAnt.Pair1SecondaryRxAnt;
- pAd->RxAnt.Pair1SecondaryRxAnt = temp;
-
-#ifdef CONFIG_STA_SUPPORT
- pAd->RxAnt.Pair1LastAvgRssi = (pAd->RxAnt.Pair1AvgRssi[pAd->RxAnt.Pair1SecondaryRxAnt] >> 3);
-#endif // CONFIG_STA_SUPPORT //
-// pAd->RxAnt.EvaluateStableCnt = 0;
- }
- else
- {
- // if the evaluated antenna is not better than original, switch back to original antenna
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
- pAd->RxAnt.EvaluateStableCnt ++;
- }
-
- pAd->RxAnt.EvaluatePeriod = 0; // 1:Means switch to SecondaryRxAnt, 0:Means switch to Pair1PrimaryRxAnt
-
-#ifdef CONFIG_STA_SUPPORT
- DBGPRINT(RT_DEBUG_TRACE,("AsicRxAntEvalAction::After Eval(fix in #%d), <%d, %d>, RcvPktNumWhenEvaluate=%ld\n",
- pAd->RxAnt.Pair1PrimaryRxAnt, (pAd->RxAnt.Pair1AvgRssi[0] >> 3), (pAd->RxAnt.Pair1AvgRssi[1] >> 3), pAd->RxAnt.RcvPktNumWhenEvaluate));
-#endif // CONFIG_STA_SUPPORT //
- }
- else
-#endif // ANT_DIVERSITY_SUPPORT //
- {
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pAd->StaCfg.Psm == PWR_SAVE)
- return;
-
-
- // if the traffic is low, use average rssi as the criteria
- if (pAd->Mlme.bLowThroughput == TRUE)
- {
- rssi0 = pAd->StaCfg.RssiSample.LastRssi0;
- rssi1 = pAd->StaCfg.RssiSample.LastRssi1;
- rssi2 = pAd->StaCfg.RssiSample.LastRssi2;
- }
- else
- {
- rssi0 = pAd->StaCfg.RssiSample.AvgRssi0;
- rssi1 = pAd->StaCfg.RssiSample.AvgRssi1;
- rssi2 = pAd->StaCfg.RssiSample.AvgRssi2;
- }
-
- if(pAd->Antenna.field.RxPath == 3)
- {
- larger = max(rssi0, rssi1);
-
- if (larger > (rssi2 + 20))
- pAd->Mlme.RealRxPath = 2;
- else
- pAd->Mlme.RealRxPath = 3;
- }
- else if(pAd->Antenna.field.RxPath == 2)
- {
- if (rssi0 > (rssi1 + 20))
- pAd->Mlme.RealRxPath = 1;
- else
- pAd->Mlme.RealRxPath = 2;
- }
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
- BBPR3 &= (~0x18);
- if(pAd->Mlme.RealRxPath == 3)
- {
- BBPR3 |= (0x10);
- }
- else if(pAd->Mlme.RealRxPath == 2)
- {
- BBPR3 |= (0x8);
- }
- else if(pAd->Mlme.RealRxPath == 1)
- {
- BBPR3 |= (0x0);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-#ifdef RTMP_MAC_PCI
- pAd->StaCfg.BBPR3 = BBPR3;
-#endif // RTMP_MAC_PCI //
- }
-#endif // CONFIG_STA_SUPPORT //
- }
-}
-
-
-VOID APSDPeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- return;
-
- pAd->CommonCfg.TriggerTimerCount++;
-
-// Driver should not send trigger frame, it should be send by application layer
-/*
- if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable
- && (pAd->CommonCfg.bNeedSendTriggerFrame ||
- (((pAd->CommonCfg.TriggerTimerCount%20) == 19) && (!pAd->CommonCfg.bAPSDAC_BE || !pAd->CommonCfg.bAPSDAC_BK || !pAd->CommonCfg.bAPSDAC_VI || !pAd->CommonCfg.bAPSDAC_VO))))
- {
- DBGPRINT(RT_DEBUG_TRACE,("Sending trigger frame and enter service period when support APSD\n"));
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- pAd->CommonCfg.bNeedSendTriggerFrame = FALSE;
- pAd->CommonCfg.TriggerTimerCount = 0;
- pAd->CommonCfg.bInServicePeriod = TRUE;
- }*/
-}
-
-/*
- ========================================================================
- Routine Description:
- Set/reset MAC registers according to bPiggyBack parameter
-
- Arguments:
- pAd - Adapter pointer
- bPiggyBack - Enable / Disable Piggy-Back
-
- Return Value:
- None
-
- ========================================================================
-*/
-VOID RTMPSetPiggyBack(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bPiggyBack)
-{
- TX_LINK_CFG_STRUC TxLinkCfg;
-
- RTMP_IO_READ32(pAd, TX_LINK_CFG, &TxLinkCfg.word);
-
- TxLinkCfg.field.TxCFAckEn = bPiggyBack;
- RTMP_IO_WRITE32(pAd, TX_LINK_CFG, TxLinkCfg.word);
-}
-
-/*
- ========================================================================
- Routine Description:
- check if this entry need to switch rate automatically
-
- Arguments:
- pAd
- pEntry
-
- Return Value:
- TURE
- FALSE
-
- ========================================================================
-*/
-BOOLEAN RTMPCheckEntryEnableAutoRateSwitch(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry)
-{
- BOOLEAN result = TRUE;
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // only associated STA counts
- if (pEntry && (pEntry->ValidAsCLI) && (pEntry->Sst == SST_ASSOC))
- {
- result = pAd->StaCfg.bAutoTxRateSwitch;
- }
- else
- result = FALSE;
-
-#ifdef QOS_DLS_SUPPORT
- if (pEntry && (pEntry->ValidAsDls))
- result = pAd->StaCfg.bAutoTxRateSwitch;
-#endif // QOS_DLS_SUPPORT //
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
-
- return result;
-}
-
-
-BOOLEAN RTMPAutoRateSwitchCheck(
- IN PRTMP_ADAPTER pAd)
-{
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pAd->StaCfg.bAutoTxRateSwitch)
- return TRUE;
- }
-#endif // CONFIG_STA_SUPPORT //
- return FALSE;
-}
-
-
-/*
- ========================================================================
- Routine Description:
- check if this entry need to fix tx legacy rate
-
- Arguments:
- pAd
- pEntry
-
- Return Value:
- TURE
- FALSE
-
- ========================================================================
-*/
-UCHAR RTMPStaFixedTxMode(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry)
-{
- UCHAR tx_mode = FIXED_TXMODE_HT;
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- tx_mode = (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- return tx_mode;
-}
-
-/*
- ========================================================================
- Routine Description:
- Overwrite HT Tx Mode by Fixed Legency Tx Mode, if specified.
-
- Arguments:
- pAd
- pEntry
-
- Return Value:
- TURE
- FALSE
-
- ========================================================================
-*/
-VOID RTMPUpdateLegacyTxSetting(
- UCHAR fixed_tx_mode,
- PMAC_TABLE_ENTRY pEntry)
-{
- HTTRANSMIT_SETTING TransmitSetting;
-
- if (fixed_tx_mode == FIXED_TXMODE_HT)
- return;
-
- TransmitSetting.word = 0;
-
- TransmitSetting.field.MODE = pEntry->HTPhyMode.field.MODE;
- TransmitSetting.field.MCS = pEntry->HTPhyMode.field.MCS;
-
- if (fixed_tx_mode == FIXED_TXMODE_CCK)
- {
- TransmitSetting.field.MODE = MODE_CCK;
- // CCK mode allow MCS 0~3
- if (TransmitSetting.field.MCS > MCS_3)
- TransmitSetting.field.MCS = MCS_3;
- }
- else
- {
- TransmitSetting.field.MODE = MODE_OFDM;
- // OFDM mode allow MCS 0~7
- if (TransmitSetting.field.MCS > MCS_7)
- TransmitSetting.field.MCS = MCS_7;
- }
-
- if (pEntry->HTPhyMode.field.MODE >= TransmitSetting.field.MODE)
- {
- pEntry->HTPhyMode.word = TransmitSetting.word;
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPUpdateLegacyTxSetting : wcid-%d, MODE=%s, MCS=%d \n",
- pEntry->Aid, GetPhyMode(pEntry->HTPhyMode.field.MODE), pEntry->HTPhyMode.field.MCS));
- }
-}
-
-#ifdef CONFIG_STA_SUPPORT
-/*
- ==========================================================================
- Description:
- dynamic tune BBP R66 to find a balance between sensibility and
- noise isolation
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AsicStaBbpTuning(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR OrigR66Value = 0, R66;//, R66UpperBound = 0x30, R66LowerBound = 0x30;
- CHAR Rssi;
-
- // 2860C did not support Fase CCA, therefore can't tune
- if (pAd->MACVersion == 0x28600100)
- return;
-
- //
- // work as a STA
- //
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE) // no R66 tuning when SCANNING
- return;
-
- if ((pAd->OpMode == OPMODE_STA)
- && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)
- )
- && !(OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
-#ifdef RTMP_MAC_PCI
- && (pAd->bPCIclkOff == FALSE)
-#endif // RTMP_MAC_PCI //
- )
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &OrigR66Value);
- R66 = OrigR66Value;
-
- if (pAd->Antenna.field.RxPath > 1)
- Rssi = (pAd->StaCfg.RssiSample.AvgRssi0 + pAd->StaCfg.RssiSample.AvgRssi1) >> 1;
- else
- Rssi = pAd->StaCfg.RssiSample.AvgRssi0;
-
- if (pAd->LatchRfRegs.Channel <= 14)
- { //BG band
-#ifdef RT30xx
- // RT3070 is a no LNA solution, it should have different control regarding to AGC gain control
- // Otherwise, it will have some throughput side effect when low RSSI
-
- if (IS_RT3070(pAd)||IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
- {
- if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
- {
- R66 = 0x1C + 2*GET_LNA_GAIN(pAd) + 0x20;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- else
- {
- R66 = 0x1C + 2*GET_LNA_GAIN(pAd);
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- }
- else
-#endif // RT30xx //
- {
- if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
- {
- R66 = (0x2E + GET_LNA_GAIN(pAd)) + 0x10;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- else
- {
- R66 = 0x2E + GET_LNA_GAIN(pAd);
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- }
- }
- else
- { //A band
- if (pAd->CommonCfg.BBPCurrentBW == BW_20)
- {
- if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
- {
- R66 = 0x32 + (GET_LNA_GAIN(pAd)*5)/3 + 0x10;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- else
- {
- R66 = 0x32 + (GET_LNA_GAIN(pAd)*5)/3;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- }
- else
- {
- if (Rssi > RSSI_FOR_MID_LOW_SENSIBILITY)
- {
- R66 = 0x3A + (GET_LNA_GAIN(pAd)*5)/3 + 0x10;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- else
- {
- R66 = 0x3A + (GET_LNA_GAIN(pAd)*5)/3;
- if (OrigR66Value != R66)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- }
- }
-
-
- }
-}
-#endif // CONFIG_STA_SUPPORT //
-
-VOID RTMPSetAGCInitValue(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BandWidth)
-{
- UCHAR R66 = 0x30;
-
- if (pAd->LatchRfRegs.Channel <= 14)
- { // BG band
-#ifdef RT30xx
- /* Gary was verified Amazon AP and find that RT307x has BBP_R66 invalid default value */
-
- if (IS_RT3070(pAd)||IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
- {
- R66 = 0x1C + 2*GET_LNA_GAIN(pAd);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- else
-#endif // RT30xx //
- {
- R66 = 0x2E + GET_LNA_GAIN(pAd);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
- else
- { //A band
- {
- if (BandWidth == BW_20)
- {
- R66 = (UCHAR)(0x32 + (GET_LNA_GAIN(pAd)*5)/3);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
-#ifdef DOT11_N_SUPPORT
- else
- {
- R66 = (UCHAR)(0x3A + (GET_LNA_GAIN(pAd)*5)/3);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
-#endif // DOT11_N_SUPPORT //
- }
- }
-
-}
diff --git a/drivers/staging/rt3090/common/mlme_ex.c b/drivers/staging/rt3090/common/mlme_ex.c
deleted file mode 100644
index d7fb7f58daee..000000000000
--- a/drivers/staging/rt3090/common/mlme_ex.c
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- mlme_ex.c
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi 2007-06-25 Extend original mlme APIs to support multi-entries
-*/
-
-#include "../rt_config.h"
-#include "../mlme_ex_def.h"
-//#include <stdarg.h>
-
-
-// ===========================================================================================
-// state_machine
-// ===========================================================================================
-
-/*! \brief Initialize the state machine.
- * \param *S pointer to the state machine
- * \param Trans State machine transition function
- * \param StNr number of states
- * \param MsgNr number of messages
- * \param DefFunc default function, when there is invalid state/message combination
- * \param InitState initial state of the state machine
- * \param Base StateMachine base, internal use only
- * \pre p_sm should be a legal pointer
- * \post
- */
-VOID StateMachineInitEx(
- IN STATE_MACHINE_EX *S,
- IN STATE_MACHINE_FUNC_EX Trans[],
- IN ULONG StNr,
- IN ULONG MsgNr,
- IN STATE_MACHINE_FUNC_EX DefFunc,
- IN ULONG InitState,
- IN ULONG Base)
-{
- ULONG i, j;
-
- // set number of states and messages
- S->NrState = StNr;
- S->NrMsg = MsgNr;
- S->Base = Base;
-
- S->TransFunc = Trans;
-
- // init all state transition to default function
- for (i = 0; i < StNr; i++)
- {
- for (j = 0; j < MsgNr; j++)
- {
- S->TransFunc[i * MsgNr + j] = DefFunc;
- }
- }
-
- // set the starting state
- S->CurrState = InitState;
-
- return;
-}
-
-/*! \brief This function fills in the function pointer into the cell in the state machine
- * \param *S pointer to the state machine
- * \param St state
- * \param Msg incoming message
- * \param f the function to be executed when (state, message) combination occurs at the state machine
- * \pre *S should be a legal pointer to the state machine, st, msg, should be all within the range, Base should be set in the initial state
- * \post
- */
-VOID StateMachineSetActionEx(
- IN STATE_MACHINE_EX *S,
- IN ULONG St,
- IN ULONG Msg,
- IN STATE_MACHINE_FUNC_EX Func)
-{
- ULONG MsgIdx;
-
- MsgIdx = Msg - S->Base;
-
- if (St < S->NrState && MsgIdx < S->NrMsg)
- {
- // boundary checking before setting the action
- S->TransFunc[St * S->NrMsg + MsgIdx] = Func;
- }
-
- return;
-}
-
-/*! \brief This function does the state transition
- * \param *Adapter the NIC adapter pointer
- * \param *S the state machine
- * \param *Elem the message to be executed
- * \return None
- */
-VOID StateMachinePerformActionEx(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *S,
- IN MLME_QUEUE_ELEM *Elem,
- USHORT Idx,
- PULONG pCurrState)
-{
- if (S->TransFunc[(*pCurrState) * S->NrMsg + Elem->MsgType - S->Base])
- (*(S->TransFunc[(*pCurrState) * S->NrMsg + Elem->MsgType - S->Base]))(pAd, Elem, pCurrState, Idx);
-
- return;
-}
-
-/*! \brief Enqueue a message for other threads, if they want to send messages to MLME thread
- * \param *Queue The MLME Queue
- * \param Machine The State Machine Id
- * \param MsgType The Message Type
- * \param MsgLen The Message length
- * \param *Msg The message pointer
- * \return TRUE if enqueue is successful, FALSE if the queue is full
- * \pre
- * \post
- * \note The message has to be initialized
- */
-BOOLEAN MlmeEnqueueEx(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Machine,
- IN ULONG MsgType,
- IN ULONG MsgLen,
- IN VOID *Msg,
- IN USHORT Idx)
-{
- INT Tail;
- MLME_QUEUE *Queue = (MLME_QUEUE *)&pAd->Mlme.Queue;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- return FALSE;
-
-
- // First check the size, it MUST not exceed the mlme queue size
- if (MsgLen > MAX_LEN_OF_MLME_BUFFER)
- {
- DBGPRINT_ERR(("MlmeEnqueueEx: msg too large, size = %ld \n", MsgLen));
- return FALSE;
- }
-
- if (MlmeQueueFull(Queue))
- {
-
- return FALSE;
- }
-
- RTMP_SEM_LOCK(&Queue->Lock);
- Tail = Queue->Tail;
- Queue->Tail++;
- Queue->Num++;
- if (Queue->Tail == MAX_LEN_OF_MLME_QUEUE)
- {
- Queue->Tail = 0;
- }
- Queue->Entry[Tail].Occupied = TRUE;
- Queue->Entry[Tail].Machine = Machine;
- Queue->Entry[Tail].MsgType = MsgType;
- Queue->Entry[Tail].MsgLen = MsgLen;
- Queue->Entry[Tail].Idx = Idx;
- if (Msg != NULL)
- NdisMoveMemory(Queue->Entry[Tail].Msg, Msg, MsgLen);
-
- RTMP_SEM_UNLOCK(&Queue->Lock);
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- The drop function, when machine executes this, the message is simply
- ignored. This function does nothing, the message is freed in
- StateMachinePerformAction()
- ==========================================================================
- */
-VOID DropEx(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem,
- PULONG pCurrState,
- USHORT Idx)
-{
- return;
-}
diff --git a/drivers/staging/rt3090/common/netif_block.c b/drivers/staging/rt3090/common/netif_block.c
deleted file mode 100644
index 2172957f4e41..000000000000
--- a/drivers/staging/rt3090/common/netif_block.c
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-#ifdef BLOCK_NET_IF
-
-#include "../rt_config.h"
-#include "../netif_block.h"
-
-
-static NETIF_ENTRY freeNetIfEntryPool[FREE_NETIF_POOL_SIZE];
-static LIST_HEADER freeNetIfEntryList;
-
-void initblockQueueTab(
- IN PRTMP_ADAPTER pAd)
-{
- int i;
-
- initList(&freeNetIfEntryList);
- for (i = 0; i < FREE_NETIF_POOL_SIZE; i++)
- insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)&freeNetIfEntryPool[i]);
-
- for (i=0; i < NUM_OF_TX_RING; i++)
- initList(&pAd->blockQueueTab[i].NetIfList);
-
- return;
-}
-
-BOOLEAN blockNetIf(
- IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry,
- IN PNET_DEV pNetDev)
-{
- PNETIF_ENTRY pNetIfEntry = NULL;
-
- if ((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(&freeNetIfEntryList)) != NULL)
- {
- RTMP_OS_NETDEV_STOP_QUEUE(pNetDev);
- pNetIfEntry->pNetDev = pNetDev;
- insertTailList(&pBlockQueueEntry->NetIfList, (PLIST_ENTRY)pNetIfEntry);
-
- pBlockQueueEntry->SwTxQueueBlockFlag = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_STOP_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev)));
- }
- else
- return FALSE;
-
- return TRUE;
-}
-
-VOID releaseNetIf(
- IN PBLOCK_QUEUE_ENTRY pBlockQueueEntry)
-{
- PNETIF_ENTRY pNetIfEntry = NULL;
- PLIST_HEADER pNetIfList = &pBlockQueueEntry->NetIfList;
-
- while((pNetIfEntry = (PNETIF_ENTRY)removeHeadList(pNetIfList)) != NULL)
- {
- PNET_DEV pNetDev = pNetIfEntry->pNetDev;
- RTMP_OS_NETDEV_WAKE_QUEUE(pNetDev);
- insertTailList(&freeNetIfEntryList, (PLIST_ENTRY)pNetIfEntry);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMP_OS_NETDEV_WAKE_QUEUE(%s)\n", RTMP_OS_NETDEV_GET_DEVNAME(pNetDev)));
- }
- pBlockQueueEntry->SwTxQueueBlockFlag = FALSE;
- return;
-}
-
-
-VOID StopNetIfQueue(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket)
-{
- PNET_DEV NetDev = NULL;
- UCHAR IfIdx = 0;
- BOOLEAN valid = FALSE;
-
-#ifdef APCLI_SUPPORT
- if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_APCLI)
- {
- IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_APCLI) % MAX_APCLI_NUM;
- NetDev = pAd->ApCfg.ApCliTab[IfIdx].dev;
- }
- else
-#endif // APCLI_SUPPORT //
-#ifdef WDS_SUPPORT
- if (RTMP_GET_PACKET_NET_DEVICE(pPacket) >= MIN_NET_DEVICE_FOR_WDS)
- {
- IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_WDS) % MAX_WDS_ENTRY;
- NetDev = pAd->WdsTab.WdsEntry[IfIdx].dev;
- }
- else
-#endif // WDS_SUPPORT //
- {
-#ifdef MBSS_SUPPORT
- if (pAd->OpMode == OPMODE_AP)
- {
- IfIdx = (RTMP_GET_PACKET_NET_DEVICE(pPacket) - MIN_NET_DEVICE_FOR_MBSSID) % MAX_MBSSID_NUM;
- NetDev = pAd->ApCfg.MBSSID[IfIdx].MSSIDDev;
- }
- else
- {
- IfIdx = MAIN_MBSSID;
- NetDev = pAd->net_dev;
- }
-#else
- IfIdx = MAIN_MBSSID;
- NetDev = pAd->net_dev;
-#endif
- }
-
- // WMM support 4 software queues.
- // One software queue full doesn't mean device have no capbility to transmit packet.
- // So disable block Net-If queue function while WMM enable.
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- valid = (pAd->CommonCfg.bWmmCapable == TRUE) ? FALSE : TRUE;
-#endif // CONFIG_STA_SUPPORT //
-
- if (valid)
- blockNetIf(&pAd->blockQueueTab[QueIdx], NetDev);
- return;
-}
-
-#endif // BLOCK_NET_IF //
diff --git a/drivers/staging/rt3090/common/rtmp_init.c b/drivers/staging/rt3090/common/rtmp_init.c
deleted file mode 100644
index 48b95b75b0d5..000000000000
--- a/drivers/staging/rt3090/common/rtmp_init.c
+++ /dev/null
@@ -1,3882 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_init.c
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "../rt_config.h"
-
-
-UCHAR BIT8[] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};
-char* CipherName[] = {"none","wep64","wep128","TKIP","AES","CKIP64","CKIP128"};
-
-//
-// BBP register initialization set
-//
-REG_PAIR BBPRegTable[] = {
- {BBP_R65, 0x2C}, // fix rssi issue
- {BBP_R66, 0x38}, // Also set this default value to pAd->BbpTuning.R66CurrentValue at initial
- {BBP_R69, 0x12},
- {BBP_R70, 0xa}, // BBP_R70 will change to 0x8 in ApStartUp and LinkUp for rt2860C, otherwise value is 0xa
- {BBP_R73, 0x10},
- {BBP_R81, 0x37},
- {BBP_R82, 0x62},
- {BBP_R83, 0x6A},
- {BBP_R84, 0x99}, // 0x19 is for rt2860E and after. This is for extension channel overlapping IOT. 0x99 is for rt2860D and before
- {BBP_R86, 0x00}, // middle range issue, Rory @2008-01-28
- {BBP_R91, 0x04}, // middle range issue, Rory @2008-01-28
- {BBP_R92, 0x00}, // middle range issue, Rory @2008-01-28
- {BBP_R103, 0x00}, // near range high-power issue, requested from Gary @2008-0528
- {BBP_R105, 0x05}, // 0x05 is for rt2860E to turn on FEQ control. It is safe for rt2860D and before, because Bit 7:2 are reserved in rt2860D and before.
- {BBP_R106, 0x35}, // for ShortGI throughput
-};
-#define NUM_BBP_REG_PARMS (sizeof(BBPRegTable) / sizeof(REG_PAIR))
-
-
-//
-// ASIC register initialization sets
-//
-
-RTMP_REG_PAIR MACRegTable[] = {
-#if defined(HW_BEACON_OFFSET) && (HW_BEACON_OFFSET == 0x200)
- {BCN_OFFSET0, 0xf8f0e8e0}, /* 0x3800(e0), 0x3A00(e8), 0x3C00(f0), 0x3E00(f8), 512B for each beacon */
- {BCN_OFFSET1, 0x6f77d0c8}, /* 0x3200(c8), 0x3400(d0), 0x1DC0(77), 0x1BC0(6f), 512B for each beacon */
-#elif defined(HW_BEACON_OFFSET) && (HW_BEACON_OFFSET == 0x100)
- {BCN_OFFSET0, 0xece8e4e0}, /* 0x3800, 0x3A00, 0x3C00, 0x3E00, 512B for each beacon */
- {BCN_OFFSET1, 0xfcf8f4f0}, /* 0x3800, 0x3A00, 0x3C00, 0x3E00, 512B for each beacon */
-#else
- #error You must re-calculate new value for BCN_OFFSET0 & BCN_OFFSET1 in MACRegTable[]!!!
-#endif // HW_BEACON_OFFSET //
-
- {LEGACY_BASIC_RATE, 0x0000013f}, // Basic rate set bitmap
- {HT_BASIC_RATE, 0x00008003}, // Basic HT rate set , 20M, MCS=3, MM. Format is the same as in TXWI.
- {MAC_SYS_CTRL, 0x00}, // 0x1004, , default Disable RX
- {RX_FILTR_CFG, 0x17f97}, //0x1400 , RX filter control,
- {BKOFF_SLOT_CFG, 0x209}, // default set short slot time, CC_DELAY_TIME should be 2
- //{TX_SW_CFG0, 0x40a06}, // Gary,2006-08-23
- {TX_SW_CFG0, 0x0}, // Gary,2008-05-21 for CWC test
- {TX_SW_CFG1, 0x80606}, // Gary,2006-08-23
- {TX_LINK_CFG, 0x1020}, // Gary,2006-08-23
- //{TX_TIMEOUT_CFG, 0x00182090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT
- {TX_TIMEOUT_CFG, 0x000a2090}, // CCK has some problem. So increase timieout value. 2006-10-09// MArvek RT , Modify for 2860E ,2007-08-01
- {MAX_LEN_CFG, MAX_AGGREGATION_SIZE | 0x00001000}, // 0x3018, MAX frame length. Max PSDU = 16kbytes.
- {LED_CFG, 0x7f031e46}, // Gary, 2006-08-23
-
-//#ifdef CONFIG_AP_SUPPORT
-// {WMM_AIFSN_CFG, 0x00001173},
-// {WMM_CWMIN_CFG, 0x00002344},
-// {WMM_CWMAX_CFG, 0x000034a6},
-// {WMM_TXOP0_CFG, 0x00100020},
-// {WMM_TXOP1_CFG, 0x002F0038},
-//#endif // CONFIG_AP_SUPPORT //
-
-//#ifdef CONFIG_STA_SUPPORT
-// {WMM_AIFSN_CFG, 0x00002273},
-// {WMM_CWMIN_CFG, 0x00002344},
-// {WMM_CWMAX_CFG, 0x000034aa},
-//#endif // CONFIG_STA_SUPPORT //
-#ifdef INF_AMAZON_SE
- {PBF_MAX_PCNT, 0x1F3F6F6F}, //iverson modify for usb issue, 2008/09/19
- // 6F + 6F < total page count FE
- // so that RX doesn't occupy TX's buffer space when WMM congestion.
-#else
- {PBF_MAX_PCNT, 0x1F3FBF9F}, //0x1F3f7f9f}, //Jan, 2006/04/20
-#endif // INF_AMAZON_SE //
- //{TX_RTY_CFG, 0x6bb80408}, // Jan, 2006/11/16
-// WMM_ACM_SUPPORT
-// {TX_RTY_CFG, 0x6bb80101}, // sample
- {TX_RTY_CFG, 0x47d01f0f}, // Jan, 2006/11/16, Set TxWI->ACK =0 in Probe Rsp Modify for 2860E ,2007-08-03
-
- {AUTO_RSP_CFG, 0x00000013}, // Initial Auto_Responder, because QA will turn off Auto-Responder
- {CCK_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled.
- {OFDM_PROT_CFG, 0x05740003 /*0x01740003*/}, // Initial Auto_Responder, because QA will turn off Auto-Responder. And RTS threshold is enabled.
- {GF20_PROT_CFG, 0x01744004}, // set 19:18 --> Short NAV for MIMO PS
- {GF40_PROT_CFG, 0x03F44084},
- {MM20_PROT_CFG, 0x01744004},
-#ifdef RTMP_MAC_PCI
- {MM40_PROT_CFG, 0x03F54084},
-#endif // RTMP_MAC_PCI //
- {TXOP_CTRL_CFG, 0x0000583f, /*0x0000243f*/ /*0x000024bf*/}, //Extension channel backoff.
- {TX_RTS_CFG, 0x00092b20},
-//#ifdef WIFI_TEST
- {EXP_ACK_TIME, 0x002400ca}, // default value
-//#else
-// {EXP_ACK_TIME, 0x005400ca}, // suggested by Gray @ 20070323 for 11n intel-sta throughput
-//#endif // end - WIFI_TEST //
-//#ifdef CONFIG_AP_SUPPORT
-// {TBTT_SYNC_CFG, 0x00422000}, // TBTT_ADJUST(7:0) == 0
-// {TBTT_SYNC_CFG, 0x00012000}, // TBTT_ADJUST(7:0) == 0
-//#endif // CONFIG_AP_SUPPORT //
- {TXOP_HLDR_ET, 0x00000002},
-
- /* Jerry comments 2008/01/16: we use SIFS = 10us in CCK defaultly, but it seems that 10us
- is too small for INTEL 2200bg card, so in MBSS mode, the delta time between beacon0
- and beacon1 is SIFS (10us), so if INTEL 2200bg card connects to BSS0, the ping
- will always lost. So we change the SIFS of CCK from 10us to 16us. */
- {XIFS_TIME_CFG, 0x33a41010},
- {PWR_PIN_CFG, 0x00000003}, // patch for 2880-E
-};
-
-
-#ifdef CONFIG_STA_SUPPORT
-RTMP_REG_PAIR STAMACRegTable[] = {
- {WMM_AIFSN_CFG, 0x00002273},
- {WMM_CWMIN_CFG, 0x00002344},
- {WMM_CWMAX_CFG, 0x000034aa},
-};
-#endif // CONFIG_STA_SUPPORT //
-
-#define NUM_MAC_REG_PARMS (sizeof(MACRegTable) / sizeof(RTMP_REG_PAIR))
-#ifdef CONFIG_STA_SUPPORT
-#define NUM_STA_MAC_REG_PARMS (sizeof(STAMACRegTable) / sizeof(RTMP_REG_PAIR))
-#endif // CONFIG_STA_SUPPORT //
-
-
-/*
- ========================================================================
-
- Routine Description:
- Allocate RTMP_ADAPTER data block and do some initialization
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS RTMPAllocAdapterBlock(
- IN PVOID handle,
- OUT PRTMP_ADAPTER *ppAdapter)
-{
- PRTMP_ADAPTER pAd;
- NDIS_STATUS Status;
- INT index;
- UCHAR *pBeaconBuf = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocAdapterBlock\n"));
-
- *ppAdapter = NULL;
-
- do
- {
- // Allocate RTMP_ADAPTER memory block
- pBeaconBuf = kmalloc(MAX_BEACON_SIZE, MEM_ALLOC_FLAG);
- if (pBeaconBuf == NULL)
- {
- Status = NDIS_STATUS_FAILURE;
- DBGPRINT_ERR(("Failed to allocate memory - BeaconBuf!\n"));
- break;
- }
- NdisZeroMemory(pBeaconBuf, MAX_BEACON_SIZE);
-
- Status = AdapterBlockAllocateMemory(handle, (PVOID *)&pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("Failed to allocate memory - ADAPTER\n"));
- break;
- }
- pAd->BeaconBuf = pBeaconBuf;
- DBGPRINT(RT_DEBUG_OFF, ("\n\n=== pAd = %p, size = %d ===\n\n", pAd, (UINT32)sizeof(RTMP_ADAPTER)));
-
-
- // Init spin locks
- NdisAllocateSpinLock(&pAd->MgmtRingLock);
-#ifdef RTMP_MAC_PCI
- NdisAllocateSpinLock(&pAd->RxRingLock);
-#ifdef RT3090
-#ifdef CONFIG_STA_SUPPORT
- NdisAllocateSpinLock(&pAd->McuCmdLock);
-#endif // CONFIG_STA_SUPPORT //
-#endif // RT3090 //
-#endif // RTMP_MAC_PCI //
-
- for (index =0 ; index < NUM_OF_TX_RING; index++)
- {
- NdisAllocateSpinLock(&pAd->TxSwQueueLock[index]);
- NdisAllocateSpinLock(&pAd->DeQueueLock[index]);
- pAd->DeQueueRunning[index] = FALSE;
- }
-
- NdisAllocateSpinLock(&pAd->irq_lock);
-
-
- } while (FALSE);
-
- if ((Status != NDIS_STATUS_SUCCESS) && (pBeaconBuf))
- kfree(pBeaconBuf);
-
- *ppAdapter = pAd;
-
- DBGPRINT_S(Status, ("<-- RTMPAllocAdapterBlock, Status=%x\n", Status));
- return Status;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Read initial Tx power per MCS and BW from EEPROM
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPReadTxPwrPerRate(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG data, Adata, Gdata;
- USHORT i, value, value2;
- INT Apwrdelta, Gpwrdelta;
- UCHAR t1,t2,t3,t4;
- BOOLEAN bApwrdeltaMinus = TRUE, bGpwrdeltaMinus = TRUE;
-
- //
- // Get power delta for 20MHz and 40MHz.
- //
- DBGPRINT(RT_DEBUG_TRACE, ("Txpower per Rate\n"));
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_DELTA, value2);
- Apwrdelta = 0;
- Gpwrdelta = 0;
-
- if ((value2 & 0xff) != 0xff)
- {
- if ((value2 & 0x80))
- Gpwrdelta = (value2&0xf);
-
- if ((value2 & 0x40))
- bGpwrdeltaMinus = FALSE;
- else
- bGpwrdeltaMinus = TRUE;
- }
- if ((value2 & 0xff00) != 0xff00)
- {
- if ((value2 & 0x8000))
- Apwrdelta = ((value2&0xf00)>>8);
-
- if ((value2 & 0x4000))
- bApwrdeltaMinus = FALSE;
- else
- bApwrdeltaMinus = TRUE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Gpwrdelta = %x, Apwrdelta = %x .\n", Gpwrdelta, Apwrdelta));
-
- //
- // Get Txpower per MCS for 20MHz in 2.4G.
- //
- for (i=0; i<5; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_20MHZ_2_4G + i*4, value);
- data = value;
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata = t1 + (t2<<4) + (t3<<8) + (t4<<12);
- if (bGpwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Gpwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Gpwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Gpwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Gpwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Gpwrdelta)
- t1 = (value&0xf)-(Gpwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Gpwrdelta)
- t2 = ((value&0xf0)>>4)-(Gpwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Gpwrdelta)
- t3 = ((value&0xf00)>>8)-(Gpwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Gpwrdelta)
- t4 = ((value&0xf000)>>12)-(Gpwrdelta);
- else
- t4 = 0;
- }
- Gdata = t1 + (t2<<4) + (t3<<8) + (t4<<12);
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXPOWER_BYRATE_20MHZ_2_4G + i*4 + 2, value);
- if (bApwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Apwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Apwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Apwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Apwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Apwrdelta)
- t1 = (value&0xf)-(Apwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Apwrdelta)
- t2 = ((value&0xf0)>>4)-(Apwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Apwrdelta)
- t3 = ((value&0xf00)>>8)-(Apwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Apwrdelta)
- t4 = ((value&0xf000)>>12)-(Apwrdelta);
- else
- t4 = 0;
- }
- Adata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
- if (bGpwrdeltaMinus == FALSE)
- {
- t1 = (value&0xf)+(Gpwrdelta);
- if (t1 > 0xf)
- t1 = 0xf;
- t2 = ((value&0xf0)>>4)+(Gpwrdelta);
- if (t2 > 0xf)
- t2 = 0xf;
- t3 = ((value&0xf00)>>8)+(Gpwrdelta);
- if (t3 > 0xf)
- t3 = 0xf;
- t4 = ((value&0xf000)>>12)+(Gpwrdelta);
- if (t4 > 0xf)
- t4 = 0xf;
- }
- else
- {
- if ((value&0xf) > Gpwrdelta)
- t1 = (value&0xf)-(Gpwrdelta);
- else
- t1 = 0;
- if (((value&0xf0)>>4) > Gpwrdelta)
- t2 = ((value&0xf0)>>4)-(Gpwrdelta);
- else
- t2 = 0;
- if (((value&0xf00)>>8) > Gpwrdelta)
- t3 = ((value&0xf00)>>8)-(Gpwrdelta);
- else
- t3 = 0;
- if (((value&0xf000)>>12) > Gpwrdelta)
- t4 = ((value&0xf000)>>12)-(Gpwrdelta);
- else
- t4 = 0;
- }
- Gdata |= ((t1<<16) + (t2<<20) + (t3<<24) + (t4<<28));
- data |= (value<<16);
-
- /* For 20M/40M Power Delta issue */
- pAd->Tx20MPwrCfgABand[i] = data;
- pAd->Tx20MPwrCfgGBand[i] = data;
- pAd->Tx40MPwrCfgABand[i] = Adata;
- pAd->Tx40MPwrCfgGBand[i] = Gdata;
-
- if (data != 0xffffffff)
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, data);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("20MHz BW, 2.4G band-%lx, Adata = %lx, Gdata = %lx \n", data, Adata, Gdata));
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Read initial channel power parameters from EEPROM
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPReadChannelPwr(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR i, choffset;
- EEPROM_TX_PWR_STRUC Power;
- EEPROM_TX_PWR_STRUC Power2;
-
- // Read Tx power value for all channels
- // Value from 1 - 0x7f. Default value is 24.
- // Power value : 2.4G 0x00 (0) ~ 0x1F (31)
- // : 5.5G 0xF9 (-7) ~ 0x0F (15)
-
- // 0. 11b/g, ch1 - ch 14
- for (i = 0; i < 7; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX_PWR_OFFSET + i * 2, Power.word);
- RT28xx_EEPROM_READ16(pAd, EEPROM_G_TX2_PWR_OFFSET + i * 2, Power2.word);
- pAd->TxPower[i * 2].Channel = i * 2 + 1;
- pAd->TxPower[i * 2 + 1].Channel = i * 2 + 2;
-
- if ((Power.field.Byte0 > 31) || (Power.field.Byte0 < 0))
- pAd->TxPower[i * 2].Power = DEFAULT_RF_TX_POWER;
- else
- pAd->TxPower[i * 2].Power = Power.field.Byte0;
-
- if ((Power.field.Byte1 > 31) || (Power.field.Byte1 < 0))
- pAd->TxPower[i * 2 + 1].Power = DEFAULT_RF_TX_POWER;
- else
- pAd->TxPower[i * 2 + 1].Power = Power.field.Byte1;
-
- if ((Power2.field.Byte0 > 31) || (Power2.field.Byte0 < 0))
- pAd->TxPower[i * 2].Power2 = DEFAULT_RF_TX_POWER;
- else
- pAd->TxPower[i * 2].Power2 = Power2.field.Byte0;
-
- if ((Power2.field.Byte1 > 31) || (Power2.field.Byte1 < 0))
- pAd->TxPower[i * 2 + 1].Power2 = DEFAULT_RF_TX_POWER;
- else
- pAd->TxPower[i * 2 + 1].Power2 = Power2.field.Byte1;
- }
-
- // 1. U-NII lower/middle band: 36, 38, 40; 44, 46, 48; 52, 54, 56; 60, 62, 64 (including central frequency in BW 40MHz)
- // 1.1 Fill up channel
- choffset = 14;
- for (i = 0; i < 4; i++)
- {
- pAd->TxPower[3 * i + choffset + 0].Channel = 36 + i * 8 + 0;
- pAd->TxPower[3 * i + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 1].Channel = 36 + i * 8 + 2;
- pAd->TxPower[3 * i + choffset + 1].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 1].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 2].Channel = 36 + i * 8 + 4;
- pAd->TxPower[3 * i + choffset + 2].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 2].Power2 = DEFAULT_RF_TX_POWER;
- }
-
- // 1.2 Fill up power
- for (i = 0; i < 6; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + i * 2, Power.word);
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + i * 2, Power2.word);
-
- if ((Power.field.Byte0 < 16) && (Power.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power = Power.field.Byte0;
-
- if ((Power.field.Byte1 < 16) && (Power.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power = Power.field.Byte1;
-
- if ((Power2.field.Byte0 < 16) && (Power2.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power2 = Power2.field.Byte0;
-
- if ((Power2.field.Byte1 < 16) && (Power2.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power2 = Power2.field.Byte1;
- }
-
- // 2. HipperLAN 2 100, 102 ,104; 108, 110, 112; 116, 118, 120; 124, 126, 128; 132, 134, 136; 140 (including central frequency in BW 40MHz)
- // 2.1 Fill up channel
- choffset = 14 + 12;
- for (i = 0; i < 5; i++)
- {
- pAd->TxPower[3 * i + choffset + 0].Channel = 100 + i * 8 + 0;
- pAd->TxPower[3 * i + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 1].Channel = 100 + i * 8 + 2;
- pAd->TxPower[3 * i + choffset + 1].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 1].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 2].Channel = 100 + i * 8 + 4;
- pAd->TxPower[3 * i + choffset + 2].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 2].Power2 = DEFAULT_RF_TX_POWER;
- }
- pAd->TxPower[3 * 5 + choffset + 0].Channel = 140;
- pAd->TxPower[3 * 5 + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * 5 + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
-
- // 2.2 Fill up power
- for (i = 0; i < 8; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word);
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word);
-
- if ((Power.field.Byte0 < 16) && (Power.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power = Power.field.Byte0;
-
- if ((Power.field.Byte1 < 16) && (Power.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power = Power.field.Byte1;
-
- if ((Power2.field.Byte0 < 16) && (Power2.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power2 = Power2.field.Byte0;
-
- if ((Power2.field.Byte1 < 16) && (Power2.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power2 = Power2.field.Byte1;
- }
-
- // 3. U-NII upper band: 149, 151, 153; 157, 159, 161; 165, 167, 169; 171, 173 (including central frequency in BW 40MHz)
- // 3.1 Fill up channel
- choffset = 14 + 12 + 16;
- /*for (i = 0; i < 2; i++)*/
- for (i = 0; i < 3; i++)
- {
- pAd->TxPower[3 * i + choffset + 0].Channel = 149 + i * 8 + 0;
- pAd->TxPower[3 * i + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 1].Channel = 149 + i * 8 + 2;
- pAd->TxPower[3 * i + choffset + 1].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 1].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * i + choffset + 2].Channel = 149 + i * 8 + 4;
- pAd->TxPower[3 * i + choffset + 2].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * i + choffset + 2].Power2 = DEFAULT_RF_TX_POWER;
- }
- pAd->TxPower[3 * 3 + choffset + 0].Channel = 171;
- pAd->TxPower[3 * 3 + choffset + 0].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * 3 + choffset + 0].Power2 = DEFAULT_RF_TX_POWER;
-
- pAd->TxPower[3 * 3 + choffset + 1].Channel = 173;
- pAd->TxPower[3 * 3 + choffset + 1].Power = DEFAULT_RF_TX_POWER;
- pAd->TxPower[3 * 3 + choffset + 1].Power2 = DEFAULT_RF_TX_POWER;
-
- // 3.2 Fill up power
- /*for (i = 0; i < 4; i++)*/
- for (i = 0; i < 6; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX_PWR_OFFSET + (choffset - 14) + i * 2, Power.word);
- RT28xx_EEPROM_READ16(pAd, EEPROM_A_TX2_PWR_OFFSET + (choffset - 14) + i * 2, Power2.word);
-
- if ((Power.field.Byte0 < 16) && (Power.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power = Power.field.Byte0;
-
- if ((Power.field.Byte1 < 16) && (Power.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power = Power.field.Byte1;
-
- if ((Power2.field.Byte0 < 16) && (Power2.field.Byte0 >= -7))
- pAd->TxPower[i * 2 + choffset + 0].Power2 = Power2.field.Byte0;
-
- if ((Power2.field.Byte1 < 16) && (Power2.field.Byte1 >= -7))
- pAd->TxPower[i * 2 + choffset + 1].Power2 = Power2.field.Byte1;
- }
-
- // 4. Print and Debug
- /*choffset = 14 + 12 + 16 + 7;*/
- choffset = 14 + 12 + 16 + 11;
-
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Read the following from the registry
- 1. All the parameters
- 2. NetworkAddres
-
- Arguments:
- Adapter Pointer to our adapter
- WrapperConfigurationContext For use by NdisOpenConfiguration
-
- Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
- NDIS_STATUS_RESOURCES
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS NICReadRegParameters(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_HANDLE WrapperConfigurationContext
- )
-{
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- DBGPRINT_S(Status, ("<-- NICReadRegParameters, Status=%x\n", Status));
- return Status;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Read initial parameters from EEPROM
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID NICReadEEPROMParameters(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR mac_addr)
-{
- UINT32 data = 0;
- USHORT i, value, value2;
- UCHAR TmpPhy;
- EEPROM_TX_PWR_STRUC Power;
- EEPROM_VERSION_STRUC Version;
- EEPROM_ANTENNA_STRUC Antenna;
- EEPROM_NIC_CONFIG2_STRUC NicConfig2;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICReadEEPROMParameters\n"));
-
- if (pAd->chipOps.eeinit)
- pAd->chipOps.eeinit(pAd);
-#ifdef RTMP_EFUSE_SUPPORT
-#ifdef RT30xx
- if(!pAd->bFroceEEPROMBuffer && pAd->bEEPROMFile)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICReadEEPROMParameters::(Efuse)Load to EEPROM Buffer Mode\n"));
- eFuseLoadEEPROM(pAd);
- }
-#endif // RT30xx //
-#endif // RTMP_EFUSE_SUPPORT //
-
- // Init EEPROM Address Number, before access EEPROM; if 93c46, EEPROMAddressNum=6, else if 93c66, EEPROMAddressNum=8
- RTMP_IO_READ32(pAd, E2PROM_CSR, &data);
- DBGPRINT(RT_DEBUG_TRACE, ("--> E2PROM_CSR = 0x%x\n", data));
-
- if((data & 0x30) == 0)
- pAd->EEPROMAddressNum = 6; // 93C46
- else if((data & 0x30) == 0x10)
- pAd->EEPROMAddressNum = 8; // 93C66
- else
- pAd->EEPROMAddressNum = 8; // 93C86
- DBGPRINT(RT_DEBUG_TRACE, ("--> EEPROMAddressNum = %d\n", pAd->EEPROMAddressNum ));
-
- // RT2860 MAC no longer auto load MAC address from E2PROM. Driver has to intialize
- // MAC address registers according to E2PROM setting
- if (mac_addr == NULL ||
- strlen((PSTRING) mac_addr) != 17 ||
- mac_addr[2] != ':' || mac_addr[5] != ':' || mac_addr[8] != ':' ||
- mac_addr[11] != ':' || mac_addr[14] != ':')
- {
- USHORT Addr01,Addr23,Addr45 ;
-
- RT28xx_EEPROM_READ16(pAd, 0x04, Addr01);
- RT28xx_EEPROM_READ16(pAd, 0x06, Addr23);
- RT28xx_EEPROM_READ16(pAd, 0x08, Addr45);
-
- pAd->PermanentAddress[0] = (UCHAR)(Addr01 & 0xff);
- pAd->PermanentAddress[1] = (UCHAR)(Addr01 >> 8);
- pAd->PermanentAddress[2] = (UCHAR)(Addr23 & 0xff);
- pAd->PermanentAddress[3] = (UCHAR)(Addr23 >> 8);
- pAd->PermanentAddress[4] = (UCHAR)(Addr45 & 0xff);
- pAd->PermanentAddress[5] = (UCHAR)(Addr45 >> 8);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Initialize MAC Address from E2PROM \n"));
- }
- else
- {
- INT j;
- PSTRING macptr;
-
- macptr = (PSTRING) mac_addr;
-
- for (j=0; j<MAC_ADDR_LEN; j++)
- {
- AtoH(macptr, &pAd->PermanentAddress[j], 1);
- macptr=macptr+3;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Initialize MAC Address from module parameter \n"));
- }
-
-
- {
- //more conveninet to test mbssid, so ap's bssid &0xf1
- if (pAd->PermanentAddress[0] == 0xff)
- pAd->PermanentAddress[0] = RandomByte(pAd)&0xf8;
-
- //if (pAd->PermanentAddress[5] == 0xff)
- // pAd->PermanentAddress[5] = RandomByte(pAd)&0xf8;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE,("E2PROM MAC: =%02x:%02x:%02x:%02x:%02x:%02x\n",
- pAd->PermanentAddress[0], pAd->PermanentAddress[1],
- pAd->PermanentAddress[2], pAd->PermanentAddress[3],
- pAd->PermanentAddress[4], pAd->PermanentAddress[5]));
- if (pAd->bLocalAdminMAC == FALSE)
- {
- MAC_DW0_STRUC csr2;
- MAC_DW1_STRUC csr3;
- COPY_MAC_ADDR(pAd->CurrentAddress, pAd->PermanentAddress);
- csr2.field.Byte0 = pAd->CurrentAddress[0];
- csr2.field.Byte1 = pAd->CurrentAddress[1];
- csr2.field.Byte2 = pAd->CurrentAddress[2];
- csr2.field.Byte3 = pAd->CurrentAddress[3];
- RTMP_IO_WRITE32(pAd, MAC_ADDR_DW0, csr2.word);
- csr3.word = 0;
- csr3.field.Byte4 = pAd->CurrentAddress[4];
- csr3.field.Byte5 = pAd->CurrentAddress[5];
- csr3.field.U2MeMask = 0xff;
- RTMP_IO_WRITE32(pAd, MAC_ADDR_DW1, csr3.word);
- DBGPRINT_RAW(RT_DEBUG_TRACE,("E2PROM MAC: =%02x:%02x:%02x:%02x:%02x:%02x\n",
- PRINT_MAC(pAd->PermanentAddress)));
- }
- }
-
- // if not return early. cause fail at emulation.
- // Init the channel number for TX channel power
- RTMPReadChannelPwr(pAd);
-
- // if E2PROM version mismatch with driver's expectation, then skip
- // all subsequent E2RPOM retieval and set a system error bit to notify GUI
- RT28xx_EEPROM_READ16(pAd, EEPROM_VERSION_OFFSET, Version.word);
- pAd->EepromVersion = Version.field.Version + Version.field.FaeReleaseNumber * 256;
- DBGPRINT(RT_DEBUG_TRACE, ("E2PROM: Version = %d, FAE release #%d\n", Version.field.Version, Version.field.FaeReleaseNumber));
-
- if (Version.field.Version > VALID_EEPROM_VERSION)
- {
- DBGPRINT_ERR(("E2PROM: WRONG VERSION 0x%x, should be %d\n",Version.field.Version, VALID_EEPROM_VERSION));
- /*pAd->SystemErrorBitmap |= 0x00000001;
-
- // hard-code default value when no proper E2PROM installed
- pAd->bAutoTxAgcA = FALSE;
- pAd->bAutoTxAgcG = FALSE;
-
- // Default the channel power
- for (i = 0; i < MAX_NUM_OF_CHANNELS; i++)
- pAd->TxPower[i].Power = DEFAULT_RF_TX_POWER;
-
- // Default the channel power
- for (i = 0; i < MAX_NUM_OF_11JCHANNELS; i++)
- pAd->TxPower11J[i].Power = DEFAULT_RF_TX_POWER;
-
- for(i = 0; i < NUM_EEPROM_BBP_PARMS; i++)
- pAd->EEPROMDefaultValue[i] = 0xffff;
- return; */
- }
-
- // Read BBP default value from EEPROM and store to array(EEPROMDefaultValue) in pAd
- RT28xx_EEPROM_READ16(pAd, EEPROM_NIC1_OFFSET, value);
- pAd->EEPROMDefaultValue[0] = value;
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_NIC2_OFFSET, value);
- pAd->EEPROMDefaultValue[1] = value;
-
- RT28xx_EEPROM_READ16(pAd, 0x38, value); // Country Region
- pAd->EEPROMDefaultValue[2] = value;
-
- for(i = 0; i < 8; i++)
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_BBP_BASE_OFFSET + i*2, value);
- pAd->EEPROMDefaultValue[i+3] = value;
- }
-
- // We have to parse NIC configuration 0 at here.
- // If TSSI did not have preloaded value, it should reset the TxAutoAgc to false
- // Therefore, we have to read TxAutoAgc control beforehand.
- // Read Tx AGC control bit
- Antenna.word = pAd->EEPROMDefaultValue[0];
- if (Antenna.word == 0xFFFF)
- {
-#ifdef RT30xx
- if(IS_RT3090(pAd)|| IS_RT3390(pAd))
- {
- Antenna.word = 0;
- Antenna.field.RfIcType = RFIC_3020;
- Antenna.field.TxPath = 1;
- Antenna.field.RxPath = 1;
- }
- else
-#endif // RT30xx //
- {
-
- Antenna.word = 0;
- Antenna.field.RfIcType = RFIC_2820;
- Antenna.field.TxPath = 1;
- Antenna.field.RxPath = 2;
- DBGPRINT(RT_DEBUG_WARN, ("E2PROM error, hard code as 0x%04x\n", Antenna.word));
- }
- }
-
- // Choose the desired Tx&Rx stream.
- if ((pAd->CommonCfg.TxStream == 0) || (pAd->CommonCfg.TxStream > Antenna.field.TxPath))
- pAd->CommonCfg.TxStream = Antenna.field.TxPath;
-
- if ((pAd->CommonCfg.RxStream == 0) || (pAd->CommonCfg.RxStream > Antenna.field.RxPath))
- {
- pAd->CommonCfg.RxStream = Antenna.field.RxPath;
-
- if ((pAd->MACVersion < RALINK_2883_VERSION) &&
- (pAd->CommonCfg.RxStream > 2))
- {
- // only 2 Rx streams for RT2860 series
- pAd->CommonCfg.RxStream = 2;
- }
- }
-
- // 3*3
- // read value from EEPROM and set them to CSR174 ~ 177 in chain0 ~ chain2
- // yet implement
- for(i=0; i<3; i++)
- {
- }
-
- NicConfig2.word = pAd->EEPROMDefaultValue[1];
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if ((NicConfig2.word & 0x00ff) == 0xff)
- {
- NicConfig2.word &= 0xff00;
- }
-
- if ((NicConfig2.word >> 8) == 0xff)
- {
- NicConfig2.word &= 0x00ff;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- if (NicConfig2.field.DynamicTxAgcControl == 1)
- pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = TRUE;
- else
- pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = FALSE;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("NICReadEEPROMParameters: RxPath = %d, TxPath = %d\n", Antenna.field.RxPath, Antenna.field.TxPath));
-
- // Save the antenna for future use
- pAd->Antenna.word = Antenna.word;
-
- // Set the RfICType here, then we can initialize RFIC related operation callbacks
- pAd->Mlme.RealRxPath = (UCHAR) Antenna.field.RxPath;
- pAd->RfIcType = (UCHAR) Antenna.field.RfIcType;
-
-#ifdef RTMP_RF_RW_SUPPORT
- RtmpChipOpsRFHook(pAd);
-#endif // RTMP_RF_RW_SUPPORT //
-
- //
- // Reset PhyMode if we don't support 802.11a
- // Only RFIC_2850 & RFIC_2750 support 802.11a
- //
- if ((Antenna.field.RfIcType != RFIC_2850)
- && (Antenna.field.RfIcType != RFIC_2750)
- && (Antenna.field.RfIcType != RFIC_3052))
- {
- if ((pAd->CommonCfg.PhyMode == PHY_11ABG_MIXED) ||
- (pAd->CommonCfg.PhyMode == PHY_11A))
- pAd->CommonCfg.PhyMode = PHY_11BG_MIXED;
-#ifdef DOT11_N_SUPPORT
- else if ((pAd->CommonCfg.PhyMode == PHY_11ABGN_MIXED) ||
- (pAd->CommonCfg.PhyMode == PHY_11AN_MIXED) ||
- (pAd->CommonCfg.PhyMode == PHY_11AGN_MIXED) ||
- (pAd->CommonCfg.PhyMode == PHY_11N_5G))
- pAd->CommonCfg.PhyMode = PHY_11BGN_MIXED;
-#endif // DOT11_N_SUPPORT //
- }
-
- // Read TSSI reference and TSSI boundary for temperature compensation. This is ugly
- // 0. 11b/g
- {
- /* these are tempature reference value (0x00 ~ 0xFE)
- ex: 0x00 0x15 0x25 0x45 0x88 0xA0 0xB5 0xD0 0xF0
- TssiPlusBoundaryG [4] [3] [2] [1] [0] (smaller) +
- TssiMinusBoundaryG[0] [1] [2] [3] [4] (larger) */
- RT28xx_EEPROM_READ16(pAd, 0x6E, Power.word);
- pAd->TssiMinusBoundaryG[4] = Power.field.Byte0;
- pAd->TssiMinusBoundaryG[3] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0x70, Power.word);
- pAd->TssiMinusBoundaryG[2] = Power.field.Byte0;
- pAd->TssiMinusBoundaryG[1] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0x72, Power.word);
- pAd->TssiRefG = Power.field.Byte0; /* reference value [0] */
- pAd->TssiPlusBoundaryG[1] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0x74, Power.word);
- pAd->TssiPlusBoundaryG[2] = Power.field.Byte0;
- pAd->TssiPlusBoundaryG[3] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0x76, Power.word);
- pAd->TssiPlusBoundaryG[4] = Power.field.Byte0;
- pAd->TxAgcStepG = Power.field.Byte1;
- pAd->TxAgcCompensateG = 0;
- pAd->TssiMinusBoundaryG[0] = pAd->TssiRefG;
- pAd->TssiPlusBoundaryG[0] = pAd->TssiRefG;
-
- // Disable TxAgc if the based value is not right
- if (pAd->TssiRefG == 0xff)
- pAd->bAutoTxAgcG = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE,("E2PROM: G Tssi[-4 .. +4] = %d %d %d %d - %d -%d %d %d %d, step=%d, tuning=%d\n",
- pAd->TssiMinusBoundaryG[4], pAd->TssiMinusBoundaryG[3], pAd->TssiMinusBoundaryG[2], pAd->TssiMinusBoundaryG[1],
- pAd->TssiRefG,
- pAd->TssiPlusBoundaryG[1], pAd->TssiPlusBoundaryG[2], pAd->TssiPlusBoundaryG[3], pAd->TssiPlusBoundaryG[4],
- pAd->TxAgcStepG, pAd->bAutoTxAgcG));
- }
- // 1. 11a
- {
- RT28xx_EEPROM_READ16(pAd, 0xD4, Power.word);
- pAd->TssiMinusBoundaryA[4] = Power.field.Byte0;
- pAd->TssiMinusBoundaryA[3] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0xD6, Power.word);
- pAd->TssiMinusBoundaryA[2] = Power.field.Byte0;
- pAd->TssiMinusBoundaryA[1] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0xD8, Power.word);
- pAd->TssiRefA = Power.field.Byte0;
- pAd->TssiPlusBoundaryA[1] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0xDA, Power.word);
- pAd->TssiPlusBoundaryA[2] = Power.field.Byte0;
- pAd->TssiPlusBoundaryA[3] = Power.field.Byte1;
- RT28xx_EEPROM_READ16(pAd, 0xDC, Power.word);
- pAd->TssiPlusBoundaryA[4] = Power.field.Byte0;
- pAd->TxAgcStepA = Power.field.Byte1;
- pAd->TxAgcCompensateA = 0;
- pAd->TssiMinusBoundaryA[0] = pAd->TssiRefA;
- pAd->TssiPlusBoundaryA[0] = pAd->TssiRefA;
-
- // Disable TxAgc if the based value is not right
- if (pAd->TssiRefA == 0xff)
- pAd->bAutoTxAgcA = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE,("E2PROM: A Tssi[-4 .. +4] = %d %d %d %d - %d -%d %d %d %d, step=%d, tuning=%d\n",
- pAd->TssiMinusBoundaryA[4], pAd->TssiMinusBoundaryA[3], pAd->TssiMinusBoundaryA[2], pAd->TssiMinusBoundaryA[1],
- pAd->TssiRefA,
- pAd->TssiPlusBoundaryA[1], pAd->TssiPlusBoundaryA[2], pAd->TssiPlusBoundaryA[3], pAd->TssiPlusBoundaryA[4],
- pAd->TxAgcStepA, pAd->bAutoTxAgcA));
- }
- pAd->BbpRssiToDbmDelta = 0x0;
-
- // Read frequency offset setting for RF
- RT28xx_EEPROM_READ16(pAd, EEPROM_FREQ_OFFSET, value);
- if ((value & 0x00FF) != 0x00FF)
- pAd->RfFreqOffset = (ULONG) (value & 0x00FF);
- else
- pAd->RfFreqOffset = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("E2PROM: RF FreqOffset=0x%lx \n", pAd->RfFreqOffset));
-
- //CountryRegion byte offset (38h)
- value = pAd->EEPROMDefaultValue[2] >> 8; // 2.4G band
- value2 = pAd->EEPROMDefaultValue[2] & 0x00FF; // 5G band
-
- if ((value <= REGION_MAXIMUM_BG_BAND) && (value2 <= REGION_MAXIMUM_A_BAND))
- {
- pAd->CommonCfg.CountryRegion = ((UCHAR) value) | 0x80;
- pAd->CommonCfg.CountryRegionForABand = ((UCHAR) value2) | 0x80;
- TmpPhy = pAd->CommonCfg.PhyMode;
- pAd->CommonCfg.PhyMode = 0xff;
- RTMPSetPhyMode(pAd, TmpPhy);
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- }
-
- //
- // Get RSSI Offset on EEPROM 0x9Ah & 0x9Ch.
- // The valid value are (-10 ~ 10)
- //
- RT28xx_EEPROM_READ16(pAd, EEPROM_RSSI_BG_OFFSET, value);
- pAd->BGRssiOffset0 = value & 0x00ff;
- pAd->BGRssiOffset1 = (value >> 8);
- RT28xx_EEPROM_READ16(pAd, EEPROM_RSSI_BG_OFFSET+2, value);
- pAd->BGRssiOffset2 = value & 0x00ff;
- pAd->ALNAGain1 = (value >> 8);
- RT28xx_EEPROM_READ16(pAd, EEPROM_LNA_OFFSET, value);
- pAd->BLNAGain = value & 0x00ff;
- pAd->ALNAGain0 = (value >> 8);
-
- // Validate 11b/g RSSI_0 offset.
- if ((pAd->BGRssiOffset0 < -10) || (pAd->BGRssiOffset0 > 10))
- pAd->BGRssiOffset0 = 0;
-
- // Validate 11b/g RSSI_1 offset.
- if ((pAd->BGRssiOffset1 < -10) || (pAd->BGRssiOffset1 > 10))
- pAd->BGRssiOffset1 = 0;
-
- // Validate 11b/g RSSI_2 offset.
- if ((pAd->BGRssiOffset2 < -10) || (pAd->BGRssiOffset2 > 10))
- pAd->BGRssiOffset2 = 0;
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_RSSI_A_OFFSET, value);
- pAd->ARssiOffset0 = value & 0x00ff;
- pAd->ARssiOffset1 = (value >> 8);
- RT28xx_EEPROM_READ16(pAd, (EEPROM_RSSI_A_OFFSET+2), value);
- pAd->ARssiOffset2 = value & 0x00ff;
- pAd->ALNAGain2 = (value >> 8);
-
- if (((UCHAR)pAd->ALNAGain1 == 0xFF) || (pAd->ALNAGain1 == 0x00))
- pAd->ALNAGain1 = pAd->ALNAGain0;
- if (((UCHAR)pAd->ALNAGain2 == 0xFF) || (pAd->ALNAGain2 == 0x00))
- pAd->ALNAGain2 = pAd->ALNAGain0;
-
- // Validate 11a RSSI_0 offset.
- if ((pAd->ARssiOffset0 < -10) || (pAd->ARssiOffset0 > 10))
- pAd->ARssiOffset0 = 0;
-
- // Validate 11a RSSI_1 offset.
- if ((pAd->ARssiOffset1 < -10) || (pAd->ARssiOffset1 > 10))
- pAd->ARssiOffset1 = 0;
-
- //Validate 11a RSSI_2 offset.
- if ((pAd->ARssiOffset2 < -10) || (pAd->ARssiOffset2 > 10))
- pAd->ARssiOffset2 = 0;
-
-#ifdef RT30xx
- //
- // Get TX mixer gain setting
- // 0xff are invalid value
- // Note: RT30xX default value is 0x00 and will program to RF_R17 only when this value is not zero.
- // RT359X default value is 0x02
- //
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- RT28xx_EEPROM_READ16(pAd, EEPROM_TXMIXER_GAIN_2_4G, value);
- pAd->TxMixerGain24G = 0;
- value &= 0x00ff;
- if (value != 0xff)
- {
- value &= 0x07;
- pAd->TxMixerGain24G = (UCHAR)value;
- }
- }
-#endif // RT30xx //
-
- //
- // Get LED Setting.
- //
- RT28xx_EEPROM_READ16(pAd, 0x3a, value);
- pAd->LedCntl.word = (value>>8);
- RT28xx_EEPROM_READ16(pAd, EEPROM_LED1_OFFSET, value);
- pAd->Led1 = value;
- RT28xx_EEPROM_READ16(pAd, EEPROM_LED2_OFFSET, value);
- pAd->Led2 = value;
- RT28xx_EEPROM_READ16(pAd, EEPROM_LED3_OFFSET, value);
- pAd->Led3 = value;
-
- RTMPReadTxPwrPerRate(pAd);
-
-#ifdef SINGLE_SKU
- RT28xx_EEPROM_READ16(pAd, EEPROM_DEFINE_MAX_TXPWR, pAd->CommonCfg.DefineMaxTxPwr);
-#endif // SINGLE_SKU //
-
-#ifdef RT30xx
-#ifdef RTMP_EFUSE_SUPPORT
- RtmpEfuseSupportCheck(pAd);
-#endif // RTMP_EFUSE_SUPPORT //
-#endif // RT30xx //
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICReadEEPROMParameters\n"));
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Set default value from EEPROM
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID NICInitAsicFromEEPROM(
- IN PRTMP_ADAPTER pAd)
-{
-#ifdef CONFIG_STA_SUPPORT
- UINT32 data = 0;
- UCHAR BBPR1 = 0;
-#endif // CONFIG_STA_SUPPORT //
- USHORT i;
-// EEPROM_ANTENNA_STRUC Antenna;
- EEPROM_NIC_CONFIG2_STRUC NicConfig2;
- UCHAR BBPR3 = 0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitAsicFromEEPROM\n"));
- for(i = 3; i < NUM_EEPROM_BBP_PARMS; i++)
- {
- UCHAR BbpRegIdx, BbpValue;
-
- if ((pAd->EEPROMDefaultValue[i] != 0xFFFF) && (pAd->EEPROMDefaultValue[i] != 0))
- {
- BbpRegIdx = (UCHAR)(pAd->EEPROMDefaultValue[i] >> 8);
- BbpValue = (UCHAR)(pAd->EEPROMDefaultValue[i] & 0xff);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BbpRegIdx, BbpValue);
- }
- }
-
-
- NicConfig2.word = pAd->EEPROMDefaultValue[1];
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if ((NicConfig2.word & 0x00ff) == 0xff)
- {
- NicConfig2.word &= 0xff00;
- }
-
- if ((NicConfig2.word >> 8) == 0xff)
- {
- NicConfig2.word &= 0x00ff;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Save the antenna for future use
- pAd->NicConfig2.word = NicConfig2.word;
-
-#ifdef RT30xx
- // set default antenna as main
- if (pAd->RfIcType == RFIC_3020)
- AsicSetRxAnt(pAd, pAd->RxAnt.Pair1PrimaryRxAnt);
-#endif // RT30xx //
-
- //
- // Send LED Setting to MCU.
- //
- if (pAd->LedCntl.word == 0xFF)
- {
- pAd->LedCntl.word = 0x01;
- pAd->Led1 = 0x5555;
- pAd->Led2 = 0x2221;
-
-#ifdef RTMP_MAC_PCI
- pAd->Led3 = 0xA9F8;
-#endif // RTMP_MAC_PCI //
- }
-
- AsicSendCommandToMcu(pAd, 0x52, 0xff, (UCHAR)pAd->Led1, (UCHAR)(pAd->Led1 >> 8));
- AsicSendCommandToMcu(pAd, 0x53, 0xff, (UCHAR)pAd->Led2, (UCHAR)(pAd->Led2 >> 8));
- AsicSendCommandToMcu(pAd, 0x54, 0xff, (UCHAR)pAd->Led3, (UCHAR)(pAd->Led3 >> 8));
- AsicSendCommandToMcu(pAd, 0x51, 0xff, 0, pAd->LedCntl.field.Polarity);
-
- pAd->LedIndicatorStrength = 0xFF;
- RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, before link up
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Read Hardware controlled Radio state enable bit
- if (NicConfig2.field.HardwareRadioControl == 1)
- {
- pAd->StaCfg.bHardwareRadio = TRUE;
-
- // Read GPIO pin2 as Hardware controlled radio state
- RTMP_IO_READ32(pAd, GPIO_CTRL_CFG, &data);
- if ((data & 0x04) == 0)
- {
- pAd->StaCfg.bHwRadio = FALSE;
- pAd->StaCfg.bRadio = FALSE;
-// RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x00001818);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
- }
- }
- else
- pAd->StaCfg.bHardwareRadio = FALSE;
-
- if (pAd->StaCfg.bRadio == FALSE)
- {
- RTMPSetLED(pAd, LED_RADIO_OFF);
- }
- else
- {
- RTMPSetLED(pAd, LED_RADIO_ON);
-#ifdef RTMP_MAC_PCI
-#ifdef RT3090
- AsicSendCommandToMcu(pAd, 0x30, PowerRadioOffCID, 0xff, 0x02);
- AsicCheckCommanOk(pAd, PowerRadioOffCID);
-#endif // RT3090 //
-#ifndef RT3090
- AsicSendCommandToMcu(pAd, 0x30, 0xff, 0xff, 0x02);
-#endif // RT3090 //
- AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x00);
- // 2-1. wait command ok.
- AsicCheckCommanOk(pAd, PowerWakeCID);
-#endif // RTMP_MAC_PCI //
- }
- }
-#ifdef RTMP_MAC_PCI
-#ifdef RT30xx
- if (IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd))
- {
- RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
- if (pChipOps->AsicReverseRfFromSleepMode)
- pChipOps->AsicReverseRfFromSleepMode(pAd);
- }
- // 3090 MCU Wakeup command needs more time to be stable.
- // Before stable, don't issue other MCU command to prevent from firmware error.
-
- if ((IS_RT3090(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)
- && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
- && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
- {
- DBGPRINT(RT_DEBUG_TRACE,("%s::%d,release Mcu Lock\n",__FUNCTION__,__LINE__));
- RTMP_SEM_LOCK(&pAd->McuCmdLock);
- pAd->brt30xxBanMcuCmd = FALSE;
- RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
- }
-#endif // RT30xx //
-#endif // RTMP_MAC_PCI //
-#endif // CONFIG_STA_SUPPORT //
-
- // Turn off patching for cardbus controller
- if (NicConfig2.field.CardbusAcceleration == 1)
- {
-// pAd->bTest1 = TRUE;
- }
-
- if (NicConfig2.field.DynamicTxAgcControl == 1)
- pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = TRUE;
- else
- pAd->bAutoTxAgcA = pAd->bAutoTxAgcG = FALSE;
- //
- // Since BBP has been progamed, to make sure BBP setting will be
- // upate inside of AsicAntennaSelect, so reset to UNKNOWN_BAND!!
- //
- pAd->CommonCfg.BandState = UNKNOWN_BAND;
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BBPR3);
- BBPR3 &= (~0x18);
- if(pAd->Antenna.field.RxPath == 3)
- {
- BBPR3 |= (0x10);
- }
- else if(pAd->Antenna.field.RxPath == 2)
- {
- BBPR3 |= (0x8);
- }
- else if(pAd->Antenna.field.RxPath == 1)
- {
- BBPR3 |= (0x0);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BBPR3);
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Handle the difference when 1T
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BBPR1);
- if(pAd->Antenna.field.TxPath == 1)
- {
- BBPR1 &= (~0x18);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BBPR1);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Use Hw Radio Control Pin=%d; if used Pin=%d;\n",
- pAd->CommonCfg.bHardwareRadio, pAd->CommonCfg.bHardwareRadio));
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("TxPath = %d, RxPath = %d, RFIC=%d, Polar+LED mode=%x\n",
- pAd->Antenna.field.TxPath, pAd->Antenna.field.RxPath,
- pAd->RfIcType, pAd->LedCntl.word));
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitAsicFromEEPROM\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Initialize NIC hardware
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS NICInitializeAdapter(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bHardReset)
-{
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- WPDMA_GLO_CFG_STRUC GloCfg;
-#ifdef RTMP_MAC_PCI
- UINT32 Value;
- DELAY_INT_CFG_STRUC IntCfg;
-#endif // RTMP_MAC_PCI //
-// INT_MASK_CSR_STRUC IntMask;
- ULONG i =0, j=0;
- AC_TXOP_CSR0_STRUC csr0;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAdapter\n"));
-
- // 3. Set DMA global configuration except TX_DMA_EN and RX_DMA_EN bits:
-retry:
- i = 0;
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- RTMPusecDelay(1000);
- i++;
- }while ( i<100);
- DBGPRINT(RT_DEBUG_TRACE, ("<== DMA offset 0x208 = 0x%x\n", GloCfg.word));
- GloCfg.word &= 0xff0;
- GloCfg.field.EnTXWriteBackDDONE =1;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-
- // Record HW Beacon offset
- pAd->BeaconOffset[0] = HW_BEACON_BASE0;
- pAd->BeaconOffset[1] = HW_BEACON_BASE1;
- pAd->BeaconOffset[2] = HW_BEACON_BASE2;
- pAd->BeaconOffset[3] = HW_BEACON_BASE3;
- pAd->BeaconOffset[4] = HW_BEACON_BASE4;
- pAd->BeaconOffset[5] = HW_BEACON_BASE5;
- pAd->BeaconOffset[6] = HW_BEACON_BASE6;
- pAd->BeaconOffset[7] = HW_BEACON_BASE7;
-
- //
- // write all shared Ring's base address into ASIC
- //
-
- // asic simulation sequence put this ahead before loading firmware.
- // pbf hardware reset
-#ifdef RTMP_MAC_PCI
- RTMP_IO_WRITE32(pAd, WPDMA_RST_IDX, 0x1003f); // 0x10000 for reset rx, 0x3f resets all 6 tx rings.
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe1f);
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0xe00);
-#endif // RTMP_MAC_PCI //
-
- // Initialze ASIC for TX & Rx operation
- if (NICInitializeAsic(pAd , bHardReset) != NDIS_STATUS_SUCCESS)
- {
- if (j++ == 0)
- {
- NICLoadFirmware(pAd);
- goto retry;
- }
- return NDIS_STATUS_FAILURE;
- }
-
-
-#ifdef RTMP_MAC_PCI
- // Write AC_BK base address register
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_BK].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR1, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR1 : 0x%x\n", Value));
-
- // Write AC_BE base address register
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_BE].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR0, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR0 : 0x%x\n", Value));
-
- // Write AC_VI base address register
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_VI].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR2, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR2 : 0x%x\n", Value));
-
- // Write AC_VO base address register
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_AC_VO].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR3, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR3 : 0x%x\n", Value));
-
- // Write HCCA base address register
- /*
- Value = RTMP_GetPhysicalAddressLow(pAd->TxRing[QID_HCCA].Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR4, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR4 : 0x%x\n", Value));
- */
-
- // Write MGMT_BASE_CSR register
- Value = RTMP_GetPhysicalAddressLow(pAd->MgmtRing.Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, TX_BASE_PTR5, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> TX_BASE_PTR5 : 0x%x\n", Value));
-
- // Write RX_BASE_CSR register
- Value = RTMP_GetPhysicalAddressLow(pAd->RxRing.Cell[0].AllocPa);
- RTMP_IO_WRITE32(pAd, RX_BASE_PTR, Value);
- DBGPRINT(RT_DEBUG_TRACE, ("--> RX_BASE_PTR : 0x%x\n", Value));
-
- // Init RX Ring index pointer
- pAd->RxRing.RxSwReadIdx = 0;
- pAd->RxRing.RxCpuIdx = RX_RING_SIZE-1;
- RTMP_IO_WRITE32(pAd, RX_CRX_IDX, pAd->RxRing.RxCpuIdx);
-
- // Init TX rings index pointer
- {
- for (i=0; i<NUM_OF_TX_RING; i++)
- {
- pAd->TxRing[i].TxSwFreeIdx = 0;
- pAd->TxRing[i].TxCpuIdx = 0;
- RTMP_IO_WRITE32(pAd, (TX_CTX_IDX0 + i * 0x10) , pAd->TxRing[i].TxCpuIdx);
- }
- }
-
- // init MGMT ring index pointer
- pAd->MgmtRing.TxSwFreeIdx = 0;
- pAd->MgmtRing.TxCpuIdx = 0;
- RTMP_IO_WRITE32(pAd, TX_MGMTCTX_IDX, pAd->MgmtRing.TxCpuIdx);
-
- //
- // set each Ring's SIZE into ASIC. Descriptor Size is fixed by design.
- //
-
- // Write TX_RING_CSR0 register
- Value = TX_RING_SIZE;
- RTMP_IO_WRITE32(pAd, TX_MAX_CNT0, Value);
- RTMP_IO_WRITE32(pAd, TX_MAX_CNT1, Value);
- RTMP_IO_WRITE32(pAd, TX_MAX_CNT2, Value);
- RTMP_IO_WRITE32(pAd, TX_MAX_CNT3, Value);
- RTMP_IO_WRITE32(pAd, TX_MAX_CNT4, Value);
- Value = MGMT_RING_SIZE;
- RTMP_IO_WRITE32(pAd, TX_MGMTMAX_CNT, Value);
-
- // Write RX_RING_CSR register
- Value = RX_RING_SIZE;
- RTMP_IO_WRITE32(pAd, RX_MAX_CNT, Value);
-#endif // RTMP_MAC_PCI //
-
-
- // WMM parameter
- csr0.word = 0;
- RTMP_IO_WRITE32(pAd, WMM_TXOP0_CFG, csr0.word);
- if (pAd->CommonCfg.PhyMode == PHY_11B)
- {
- csr0.field.Ac0Txop = 192; // AC_VI: 192*32us ~= 6ms
- csr0.field.Ac1Txop = 96; // AC_VO: 96*32us ~= 3ms
- }
- else
- {
- csr0.field.Ac0Txop = 96; // AC_VI: 96*32us ~= 3ms
- csr0.field.Ac1Txop = 48; // AC_VO: 48*32us ~= 1.5ms
- }
- RTMP_IO_WRITE32(pAd, WMM_TXOP1_CFG, csr0.word);
-
-
-#ifdef RTMP_MAC_PCI
- // 3. Set DMA global configuration except TX_DMA_EN and RX_DMA_EN bits:
- i = 0;
- do
- {
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word);
- if ((GloCfg.field.TxDMABusy == 0) && (GloCfg.field.RxDMABusy == 0))
- break;
-
- RTMPusecDelay(1000);
- i++;
- }while ( i < 100);
-
- GloCfg.word &= 0xff0;
- GloCfg.field.EnTXWriteBackDDONE =1;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word);
-
- IntCfg.word = 0;
- RTMP_IO_WRITE32(pAd, DELAY_INT_CFG, IntCfg.word);
-#endif // RTMP_MAC_PCI //
-
-
- // reset action
- // Load firmware
- // Status = NICLoadFirmware(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitializeAdapter\n"));
- return Status;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Initialize ASIC
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS NICInitializeAsic(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bHardReset)
-{
- ULONG Index = 0;
- UCHAR R0 = 0xff;
- UINT32 MacCsr12 = 0, Counter = 0;
-#ifdef RT30xx
- UCHAR bbpreg=0;
- UCHAR RFValue=0;
-#endif // RT30xx //
- USHORT KeyIdx;
- INT i,apidx;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitializeAsic\n"));
-
-#ifdef RTMP_MAC_PCI
- RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x3); // To fix driver disable/enable hang issue when radio off
- if (bHardReset == TRUE)
- {
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x3);
- }
- else
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x1);
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0);
- // Initialize MAC register to default value
- for (Index = 0; Index < NUM_MAC_REG_PARMS; Index++)
- {
-#ifdef RT30xx
- if ((MACRegTable[Index].Register == TX_SW_CFG0) && ( IS_RT3090(pAd) || IS_RT3390(pAd)))
- {
- MACRegTable[Index].Value = 0x00000400;
- }
-#endif // RT30xx //
- RTMP_IO_WRITE32(pAd, MACRegTable[Index].Register, MACRegTable[Index].Value);
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- for (Index = 0; Index < NUM_STA_MAC_REG_PARMS; Index++)
- {
- RTMP_IO_WRITE32(pAd, STAMACRegTable[Index].Register, STAMACRegTable[Index].Value);
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-#endif // RTMP_MAC_PCI //
-
-
-#ifdef RT30xx
- // Initialize RT3070 serial MAC registers which is different from RT2870 serial
- if (IS_RT3090(pAd) || IS_RT3572(pAd)||IS_RT3390(pAd))
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0);
-
- // RT3071 version E has fixed this issue
- if ((pAd->MACVersion & 0xffff) < 0x0211)
- {
- if (pAd->NicConfig2.field.DACTestBit == 1)
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x2C); // To fix throughput drop drastically
- }
- else
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0F); // To fix throughput drop drastically
- }
- }
- else
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x0);
- }
- }
- else if (IS_RT3070(pAd))
- {
- if (((pAd->MACVersion & 0xffff) < 0x0201))
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG1, 0);
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0x2C); // To fix throughput drop drastically
- }
- else
- {
- RTMP_IO_WRITE32(pAd, TX_SW_CFG2, 0);
- }
- }
-#endif // RT30xx //
-
- //
- // Before program BBP, we need to wait BBP/RF get wake up.
- //
- Index = 0;
- do
- {
- RTMP_IO_READ32(pAd, MAC_STATUS_CFG, &MacCsr12);
-
- if ((MacCsr12 & 0x03) == 0) // if BB.RF is stable
- break;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Check MAC_STATUS_CFG = Busy = %x\n", MacCsr12));
- RTMPusecDelay(1000);
- } while (Index++ < 100);
-
- // The commands to firmware should be after these commands, these commands will init firmware
- // PCI and USB are not the same because PCI driver needs to wait for PCI bus ready
- RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, 0); // initialize BBP R/W access agent
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, 0);
-#ifdef RT3090
- //2008/11/28:KH add to fix the dead rf frequency offset bug<--
- AsicSendCommandToMcu(pAd, 0x72, 0, 0, 0);
- //2008/11/28:KH add to fix the dead rf frequency offset bug-->
-#endif // RT3090 //
- RTMPusecDelay(1000);
-
- // Read BBP register, make sure BBP is up and running before write new data
- Index = 0;
- do
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R0, &R0);
- DBGPRINT(RT_DEBUG_TRACE, ("BBP version = %x\n", R0));
- } while ((++Index < 20) && ((R0 == 0xff) || (R0 == 0x00)));
- //ASSERT(Index < 20); //this will cause BSOD on Check-build driver
-
- if ((R0 == 0xff) || (R0 == 0x00))
- return NDIS_STATUS_FAILURE;
-
- // Initialize BBP register to default value
- for (Index = 0; Index < NUM_BBP_REG_PARMS; Index++)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBPRegTable[Index].Register, BBPRegTable[Index].Value);
- }
-
-#ifdef RTMP_MAC_PCI
- // TODO: shiang, check MACVersion, currently, rbus-based chip use this.
- if (pAd->MACVersion == 0x28720200)
- {
- //UCHAR value;
- ULONG value2;
-
- //disable MLD by Bruce 20080704
- //BBP_IO_READ8_BY_REG_ID(pAd, BBP_R105, &value);
- //BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R105, value | 4);
-
- //Maximum PSDU length from 16K to 32K bytes
- RTMP_IO_READ32(pAd, MAX_LEN_CFG, &value2);
- value2 &= ~(0x3<<12);
- value2 |= (0x2<<12);
- RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, value2);
- }
-#endif // RTMP_MAC_PCI //
-
- // for rt2860E and after, init BBP_R84 with 0x19. This is for extension channel overlapping IOT.
- // RT3090 should not program BBP R84 to 0x19, otherwise TX will block.
- //3070/71/72,3090,3090A( are included in RT30xx),3572,3390
- if (((pAd->MACVersion & 0xffff) != 0x0101) && !(IS_RT30xx(pAd)|| IS_RT3572(pAd) || IS_RT3390(pAd)))
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R84, 0x19);
-
-#ifdef RT30xx
-// add by johnli, RF power sequence setup
- if (IS_RT30xx(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))
- { //update for RT3070/71/72/90/91/92,3572,3390.
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R79, 0x13);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R80, 0x05);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R81, 0x33);
- }
-
- if (IS_RT3090(pAd)||IS_RT3390(pAd)) // RT309x, RT3071/72
- {
- // enable DC filter
- if ((pAd->MACVersion & 0xffff) >= 0x0211)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R103, 0xc0);
- }
-
- // improve power consumption
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R138, &bbpreg);
- if (pAd->Antenna.field.TxPath == 1)
- {
- // turn off tx DAC_1
- bbpreg = (bbpreg | 0x20);
- }
-
- if (pAd->Antenna.field.RxPath == 1)
- {
- // turn off tx ADC_1
- bbpreg &= (~0x2);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R138, bbpreg);
-
- // improve power consumption in RT3071 Ver.E
- if ((pAd->MACVersion & 0xffff) >= 0x0211)
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R31, &bbpreg);
- bbpreg &= (~0x3);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R31, bbpreg);
- }
- }
- else if (IS_RT3070(pAd))
- {
- if ((pAd->MACVersion & 0xffff) >= 0x0201)
- {
- // enable DC filter
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R103, 0xc0);
-
- // improve power consumption in RT3070 Ver.F
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R31, &bbpreg);
- bbpreg &= (~0x3);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R31, bbpreg);
- }
-
- // TX_LO1_en, RF R17 register Bit 3 to 0
- RT30xxReadRFRegister(pAd, RF_R17, &RFValue);
- RFValue &= (~0x08);
- // to fix rx long range issue
- if (pAd->NicConfig2.field.ExternalLNAForG == 0)
- {
- RFValue |= 0x20;
- }
- // set RF_R17_bit[2:0] equal to EEPROM setting at 0x48h
- if (pAd->TxMixerGain24G >= 1)
- {
- RFValue &= (~0x7); // clean bit [2:0]
- RFValue |= pAd->TxMixerGain24G;
- }
- RT30xxWriteRFRegister(pAd, RF_R17, RFValue);
- }
-// end johnli
-#endif // RT30xx //
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x12);
- }
-
- if (pAd->MACVersion >= RALINK_2880E_VERSION && pAd->MACVersion < RALINK_3070_VERSION) // 3*3
- {
- // enlarge MAX_LEN_CFG
- UINT32 csr;
- RTMP_IO_READ32(pAd, MAX_LEN_CFG, &csr);
- csr &= 0xFFF;
- csr |= 0x2000;
- RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, csr);
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- // Add radio off control
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- if (pAd->StaCfg.bRadio == FALSE)
- {
-// RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x00001818);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF);
- DBGPRINT(RT_DEBUG_TRACE, ("Set Radio Off\n"));
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Clear raw counters
- RTMP_IO_READ32(pAd, RX_STA_CNT0, &Counter);
- RTMP_IO_READ32(pAd, RX_STA_CNT1, &Counter);
- RTMP_IO_READ32(pAd, RX_STA_CNT2, &Counter);
- RTMP_IO_READ32(pAd, TX_STA_CNT0, &Counter);
- RTMP_IO_READ32(pAd, TX_STA_CNT1, &Counter);
- RTMP_IO_READ32(pAd, TX_STA_CNT2, &Counter);
-
- // ASIC will keep garbage value after boot
- // Clear all shared key table when initial
- // This routine can be ignored in radio-ON/OFF operation.
- if (bHardReset)
- {
- for (KeyIdx = 0; KeyIdx < 4; KeyIdx++)
- {
- RTMP_IO_WRITE32(pAd, SHARED_KEY_MODE_BASE + 4*KeyIdx, 0);
- }
-
- // Clear all pairwise key table when initial
- for (KeyIdx = 0; KeyIdx < 256; KeyIdx++)
- {
- RTMP_IO_WRITE32(pAd, MAC_WCID_ATTRIBUTE_BASE + (KeyIdx * HW_WCID_ATTRI_SIZE), 1);
- }
- }
-
- // assert HOST ready bit
-// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x0); // 2004-09-14 asked by Mark
-// RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x4);
-
- // It isn't necessary to clear this space when not hard reset.
- if (bHardReset == TRUE)
- {
- // clear all on-chip BEACON frame space
- for (apidx = 0; apidx < HW_BEACON_MAX_COUNT; apidx++)
- {
- for (i = 0; i < HW_BEACON_OFFSET>>2; i+=4)
- RTMP_IO_WRITE32(pAd, pAd->BeaconOffset[apidx] + i, 0x00);
- }
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // for rt2860E and after, init TXOP_CTRL_CFG with 0x583f. This is for extension channel overlapping IOT.
- if ((pAd->MACVersion&0xffff) != 0x0101)
- RTMP_IO_WRITE32(pAd, TXOP_CTRL_CFG, 0x583f);
- }
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef RT30xx
-#ifdef NEW_FW
- if (IS_RT3070(pAd) || IS_RT3572(pAd)||IS_RT3390(pAd)||IS_RT3090(pAd))
- {
- // send 0x36 mcu command after 0x72 for RT3xxx to fix Radio-Off current leakage issue
- RTMPusecDelay(200);
- if (pAd->buseEfuse)
- AsicSendCommandToMcu(pAd, 0x36, 0xff, 0xff, 0);
- else
- AsicSendCommandToMcu(pAd, 0x36, 0xff, 0xff, 0x04);
- RTMPusecDelay(10);
- }
-#endif // NEW_FW //
-#endif // RT30xx //
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICInitializeAsic\n"));
- return NDIS_STATUS_SUCCESS;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Reset NIC Asics
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
- Reset NIC to initial state AS IS system boot up time.
-
- ========================================================================
-*/
-VOID NICIssueReset(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 Value = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("--> NICIssueReset\n"));
-
- // Abort Tx, prevent ASIC from writing to Host memory
- //RTMP_IO_WRITE32(pAd, TX_CNTL_CSR, 0x001f0000);
-
- // Disable Rx, register value supposed will remain after reset
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= (0xfffffff3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // Issue reset and clear from reset state
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x03); // 2004-09-17 change from 0x01
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x00);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- NICIssueReset\n"));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Check ASIC registers and find any reason the system might hang
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-BOOLEAN NICCheckForHang(
- IN PRTMP_ADAPTER pAd)
-{
- return (FALSE);
-}
-
-VOID NICUpdateFifoStaCounters(
- IN PRTMP_ADAPTER pAd)
-{
- TX_STA_FIFO_STRUC StaFifo;
- MAC_TABLE_ENTRY *pEntry;
- UCHAR i = 0;
- UCHAR pid = 0, wcid = 0;
- CHAR reTry;
- UCHAR succMCS;
-
-#ifdef RALINK_ATE
- /* Nothing to do in ATE mode */
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- do
- {
- RTMP_IO_READ32(pAd, TX_STA_FIFO, &StaFifo.word);
-
- if (StaFifo.field.bValid == 0)
- break;
-
- wcid = (UCHAR)StaFifo.field.wcid;
-
-
- /* ignore NoACK and MGMT frame use 0xFF as WCID */
- if ((StaFifo.field.TxAckRequired == 0) || (wcid >= MAX_LEN_OF_MAC_TABLE))
- {
- i++;
- continue;
- }
-
- /* PID store Tx MCS Rate */
- pid = (UCHAR)StaFifo.field.PidType;
-
- pEntry = &pAd->MacTab.Content[wcid];
-
- pEntry->DebugFIFOCount++;
-
-#ifdef DOT11_N_SUPPORT
- if (StaFifo.field.TxBF) // 3*3
- pEntry->TxBFCount++;
-#endif // DOT11_N_SUPPORT //
-
-#ifdef UAPSD_AP_SUPPORT
- UAPSD_SP_AUE_Handle(pAd, pEntry, StaFifo.field.TxSuccess);
-#endif // UAPSD_AP_SUPPORT //
-
- if (!StaFifo.field.TxSuccess)
- {
- pEntry->FIFOCount++;
- pEntry->OneSecTxFailCount++;
-
- if (pEntry->FIFOCount >= 1)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("#"));
-#ifdef DOT11_N_SUPPORT
- pEntry->NoBADataCountDown = 64;
-#endif // DOT11_N_SUPPORT //
-
- if(pEntry->PsMode == PWR_ACTIVE)
- {
-#ifdef DOT11_N_SUPPORT
- int tid;
- for (tid=0; tid<NUM_OF_TID; tid++)
- {
- BAOriSessionTearDown(pAd, pEntry->Aid, tid, FALSE, FALSE);
- }
-#endif // DOT11_N_SUPPORT //
-
- // Update the continuous transmission counter except PS mode
- pEntry->ContinueTxFailCnt++;
-
-#ifdef WDS_SUPPORT
- // fix WDS Jam issue
- if((pEntry->ValidAsWDS == TRUE)
- && (pEntry->LockEntryTx == FALSE)
- && (pEntry->ContinueTxFailCnt >= pAd->ApCfg.EntryLifeCheck))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Entry %02x:%02x:%02x:%02x:%02x:%02x Blocked!! (Fail Cnt = %d)\n",
- pEntry->Addr[0],pEntry->Addr[1],pEntry->Addr[2],pEntry->Addr[3],
- pEntry->Addr[4],pEntry->Addr[5],pEntry->ContinueTxFailCnt ));
-
- pEntry->LockEntryTx = TRUE;
- }
-#endif // WDS_SUPPORT //
- }
- else
- {
- // Clear the FIFOCount when sta in Power Save mode. Basically we assume
- // this tx error happened due to sta just go to sleep.
- pEntry->FIFOCount = 0;
- pEntry->ContinueTxFailCnt = 0;
- }
- //pEntry->FIFOCount = 0;
- }
- //pEntry->bSendBAR = TRUE;
- }
- else
- {
-#ifdef DOT11_N_SUPPORT
- if ((pEntry->PsMode != PWR_SAVE) && (pEntry->NoBADataCountDown > 0))
- {
- pEntry->NoBADataCountDown--;
- if (pEntry->NoBADataCountDown==0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("@\n"));
- }
- }
-#endif // DOT11_N_SUPPORT //
- pEntry->FIFOCount = 0;
- pEntry->OneSecTxNoRetryOkCount++;
- // update NoDataIdleCount when sucessful send packet to STA.
- pEntry->NoDataIdleCount = 0;
- pEntry->ContinueTxFailCnt = 0;
-#ifdef WDS_SUPPORT
- pEntry->LockEntryTx = FALSE;
-#endif // WDS_SUPPORT //
- }
-
- succMCS = StaFifo.field.SuccessRate & 0x7F;
-
- reTry = pid - succMCS;
-
- if (StaFifo.field.TxSuccess)
- {
- pEntry->TXMCSExpected[pid]++;
- if (pid == succMCS)
- {
- pEntry->TXMCSSuccessful[pid]++;
- }
- else
- {
- pEntry->TXMCSAutoFallBack[pid][succMCS]++;
- }
- }
- else
- {
- pEntry->TXMCSFailed[pid]++;
- }
-
- if (reTry > 0)
- {
- if ((pid >= 12) && succMCS <=7)
- {
- reTry -= 4;
- }
- pEntry->OneSecTxRetryOkCount += reTry;
- }
-
- i++;
- // ASIC store 16 stack
- } while ( i < (TX_RING_SIZE<<1) );
-
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Read statistical counters from hardware registers and record them
- in software variables for later on query
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID NICUpdateRawCounters(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 OldValue;//, Value2;
- //ULONG PageSum, OneSecTransmitCount;
- //ULONG TxErrorRatio, Retry, Fail;
- RX_STA_CNT0_STRUC RxStaCnt0;
- RX_STA_CNT1_STRUC RxStaCnt1;
- RX_STA_CNT2_STRUC RxStaCnt2;
- TX_STA_CNT0_STRUC TxStaCnt0;
- TX_STA_CNT1_STRUC StaTx1;
- TX_STA_CNT2_STRUC StaTx2;
- TX_AGG_CNT_STRUC TxAggCnt;
- TX_AGG_CNT0_STRUC TxAggCnt0;
- TX_AGG_CNT1_STRUC TxAggCnt1;
- TX_AGG_CNT2_STRUC TxAggCnt2;
- TX_AGG_CNT3_STRUC TxAggCnt3;
- TX_AGG_CNT4_STRUC TxAggCnt4;
- TX_AGG_CNT5_STRUC TxAggCnt5;
- TX_AGG_CNT6_STRUC TxAggCnt6;
- TX_AGG_CNT7_STRUC TxAggCnt7;
- COUNTER_RALINK *pRalinkCounters;
-
-
- pRalinkCounters = &pAd->RalinkCounters;
-
- RTMP_IO_READ32(pAd, RX_STA_CNT0, &RxStaCnt0.word);
- RTMP_IO_READ32(pAd, RX_STA_CNT2, &RxStaCnt2.word);
-
- {
- RTMP_IO_READ32(pAd, RX_STA_CNT1, &RxStaCnt1.word);
- // Update RX PLCP error counter
- pAd->PrivateInfo.PhyRxErrCnt += RxStaCnt1.field.PlcpErr;
- // Update False CCA counter
- pAd->RalinkCounters.OneSecFalseCCACnt += RxStaCnt1.field.FalseCca;
- }
-
- // Update FCS counters
- OldValue= pAd->WlanCounters.FCSErrorCount.u.LowPart;
- pAd->WlanCounters.FCSErrorCount.u.LowPart += (RxStaCnt0.field.CrcErr); // >> 7);
- if (pAd->WlanCounters.FCSErrorCount.u.LowPart < OldValue)
- pAd->WlanCounters.FCSErrorCount.u.HighPart++;
-
- // Add FCS error count to private counters
- pRalinkCounters->OneSecRxFcsErrCnt += RxStaCnt0.field.CrcErr;
- OldValue = pRalinkCounters->RealFcsErrCount.u.LowPart;
- pRalinkCounters->RealFcsErrCount.u.LowPart += RxStaCnt0.field.CrcErr;
- if (pRalinkCounters->RealFcsErrCount.u.LowPart < OldValue)
- pRalinkCounters->RealFcsErrCount.u.HighPart++;
-
- // Update Duplicate Rcv check
- pRalinkCounters->DuplicateRcv += RxStaCnt2.field.RxDupliCount;
- pAd->WlanCounters.FrameDuplicateCount.u.LowPart += RxStaCnt2.field.RxDupliCount;
- // Update RX Overflow counter
- pAd->Counters8023.RxNoBuffer += (RxStaCnt2.field.RxFifoOverflowCount);
-
- //pAd->RalinkCounters.RxCount = 0;
-
-
- //if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) ||
- // (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_TX_RATE_SWITCH_ENABLED) && (pAd->MacTab.Size != 1)))
- if (!pAd->bUpdateBcnCntDone)
- {
- // Update BEACON sent count
- RTMP_IO_READ32(pAd, TX_STA_CNT0, &TxStaCnt0.word);
- RTMP_IO_READ32(pAd, TX_STA_CNT1, &StaTx1.word);
- RTMP_IO_READ32(pAd, TX_STA_CNT2, &StaTx2.word);
- pRalinkCounters->OneSecBeaconSentCnt += TxStaCnt0.field.TxBeaconCount;
- pRalinkCounters->OneSecTxRetryOkCount += StaTx1.field.TxRetransmit;
- pRalinkCounters->OneSecTxNoRetryOkCount += StaTx1.field.TxSuccess;
- pRalinkCounters->OneSecTxFailCount += TxStaCnt0.field.TxFailCount;
- pAd->WlanCounters.TransmittedFragmentCount.u.LowPart += StaTx1.field.TxSuccess;
- pAd->WlanCounters.RetryCount.u.LowPart += StaTx1.field.TxRetransmit;
- pAd->WlanCounters.FailedCount.u.LowPart += TxStaCnt0.field.TxFailCount;
- }
-
-
- //if (pAd->bStaFifoTest == TRUE)
- {
- RTMP_IO_READ32(pAd, TX_AGG_CNT, &TxAggCnt.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT0, &TxAggCnt0.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT1, &TxAggCnt1.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT2, &TxAggCnt2.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT3, &TxAggCnt3.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT4, &TxAggCnt4.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT5, &TxAggCnt5.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT6, &TxAggCnt6.word);
- RTMP_IO_READ32(pAd, TX_AGG_CNT7, &TxAggCnt7.word);
- pRalinkCounters->TxAggCount += TxAggCnt.field.AggTxCount;
- pRalinkCounters->TxNonAggCount += TxAggCnt.field.NonAggTxCount;
- pRalinkCounters->TxAgg1MPDUCount += TxAggCnt0.field.AggSize1Count;
- pRalinkCounters->TxAgg2MPDUCount += TxAggCnt0.field.AggSize2Count;
-
- pRalinkCounters->TxAgg3MPDUCount += TxAggCnt1.field.AggSize3Count;
- pRalinkCounters->TxAgg4MPDUCount += TxAggCnt1.field.AggSize4Count;
- pRalinkCounters->TxAgg5MPDUCount += TxAggCnt2.field.AggSize5Count;
- pRalinkCounters->TxAgg6MPDUCount += TxAggCnt2.field.AggSize6Count;
-
- pRalinkCounters->TxAgg7MPDUCount += TxAggCnt3.field.AggSize7Count;
- pRalinkCounters->TxAgg8MPDUCount += TxAggCnt3.field.AggSize8Count;
- pRalinkCounters->TxAgg9MPDUCount += TxAggCnt4.field.AggSize9Count;
- pRalinkCounters->TxAgg10MPDUCount += TxAggCnt4.field.AggSize10Count;
-
- pRalinkCounters->TxAgg11MPDUCount += TxAggCnt5.field.AggSize11Count;
- pRalinkCounters->TxAgg12MPDUCount += TxAggCnt5.field.AggSize12Count;
- pRalinkCounters->TxAgg13MPDUCount += TxAggCnt6.field.AggSize13Count;
- pRalinkCounters->TxAgg14MPDUCount += TxAggCnt6.field.AggSize14Count;
-
- pRalinkCounters->TxAgg15MPDUCount += TxAggCnt7.field.AggSize15Count;
- pRalinkCounters->TxAgg16MPDUCount += TxAggCnt7.field.AggSize16Count;
-
- // Calculate the transmitted A-MPDU count
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += TxAggCnt0.field.AggSize1Count;
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt0.field.AggSize2Count / 2);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize3Count / 3);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt1.field.AggSize4Count / 4);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize5Count / 5);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt2.field.AggSize6Count / 6);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize7Count / 7);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt3.field.AggSize8Count / 8);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize9Count / 9);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt4.field.AggSize10Count / 10);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize11Count / 11);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt5.field.AggSize12Count / 12);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize13Count / 13);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt6.field.AggSize14Count / 14);
-
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize15Count / 15);
- pRalinkCounters->TransmittedAMPDUCount.u.LowPart += (TxAggCnt7.field.AggSize16Count / 16);
- }
-
-#ifdef DBG_DIAGNOSE
- {
- RtmpDiagStruct *pDiag;
- UCHAR ArrayCurIdx, i;
-
- pDiag = &pAd->DiagStruct;
- ArrayCurIdx = pDiag->ArrayCurIdx;
-
- if (pDiag->inited == 0)
- {
- NdisZeroMemory(pDiag, sizeof(struct _RtmpDiagStrcut_));
- pDiag->ArrayStartIdx = pDiag->ArrayCurIdx = 0;
- pDiag->inited = 1;
- }
- else
- {
- // Tx
- pDiag->TxFailCnt[ArrayCurIdx] = TxStaCnt0.field.TxFailCount;
- pDiag->TxAggCnt[ArrayCurIdx] = TxAggCnt.field.AggTxCount;
- pDiag->TxNonAggCnt[ArrayCurIdx] = TxAggCnt.field.NonAggTxCount;
- pDiag->TxAMPDUCnt[ArrayCurIdx][0] = TxAggCnt0.field.AggSize1Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][1] = TxAggCnt0.field.AggSize2Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][2] = TxAggCnt1.field.AggSize3Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][3] = TxAggCnt1.field.AggSize4Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][4] = TxAggCnt2.field.AggSize5Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][5] = TxAggCnt2.field.AggSize6Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][6] = TxAggCnt3.field.AggSize7Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][7] = TxAggCnt3.field.AggSize8Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][8] = TxAggCnt4.field.AggSize9Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][9] = TxAggCnt4.field.AggSize10Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][10] = TxAggCnt5.field.AggSize11Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][11] = TxAggCnt5.field.AggSize12Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][12] = TxAggCnt6.field.AggSize13Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][13] = TxAggCnt6.field.AggSize14Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][14] = TxAggCnt7.field.AggSize15Count;
- pDiag->TxAMPDUCnt[ArrayCurIdx][15] = TxAggCnt7.field.AggSize16Count;
-
- pDiag->RxCrcErrCnt[ArrayCurIdx] = RxStaCnt0.field.CrcErr;
-
- INC_RING_INDEX(pDiag->ArrayCurIdx, DIAGNOSE_TIME);
- ArrayCurIdx = pDiag->ArrayCurIdx;
- for (i =0; i < 9; i++)
- {
- pDiag->TxDescCnt[ArrayCurIdx][i]= 0;
- pDiag->TxSWQueCnt[ArrayCurIdx][i] =0;
- pDiag->TxMcsCnt[ArrayCurIdx][i] = 0;
- pDiag->RxMcsCnt[ArrayCurIdx][i] = 0;
- }
- pDiag->TxDataCnt[ArrayCurIdx] = 0;
- pDiag->TxFailCnt[ArrayCurIdx] = 0;
- pDiag->RxDataCnt[ArrayCurIdx] = 0;
- pDiag->RxCrcErrCnt[ArrayCurIdx] = 0;
-// for (i = 9; i < 16; i++)
- for (i = 9; i < 24; i++) // 3*3
- {
- pDiag->TxDescCnt[ArrayCurIdx][i] = 0;
- pDiag->TxMcsCnt[ArrayCurIdx][i] = 0;
- pDiag->RxMcsCnt[ArrayCurIdx][i] = 0;
-}
-
- if (pDiag->ArrayCurIdx == pDiag->ArrayStartIdx)
- INC_RING_INDEX(pDiag->ArrayStartIdx, DIAGNOSE_TIME);
- }
-
- }
-#endif // DBG_DIAGNOSE //
-
-
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Reset NIC from error
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
- Reset NIC from error state
-
- ========================================================================
-*/
-VOID NICResetFromError(
- IN PRTMP_ADAPTER pAd)
-{
- // Reset BBP (according to alex, reset ASIC will force reset BBP
- // Therefore, skip the reset BBP
- // RTMP_IO_WRITE32(pAd, MAC_CSR1, 0x2);
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x1);
- // Remove ASIC from reset state
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0x0);
-
- NICInitializeAdapter(pAd, FALSE);
- NICInitAsicFromEEPROM(pAd);
-
- // Switch to current channel, since during reset process, the connection should remains on.
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
-}
-
-
-NDIS_STATUS NICLoadFirmware(
- IN PRTMP_ADAPTER pAd)
-{
- NDIS_STATUS status = NDIS_STATUS_SUCCESS;
- if (pAd->chipOps.loadFirmware)
- status = pAd->chipOps.loadFirmware(pAd);
-
- return status;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- erase 8051 firmware image in MAC ASIC
-
- Arguments:
- Adapter Pointer to our adapter
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-VOID NICEraseFirmware(
- IN PRTMP_ADAPTER pAd)
-{
- if (pAd->chipOps.eraseFirmware)
- pAd->chipOps.eraseFirmware(pAd);
-
-}/* End of NICEraseFirmware */
-
-
-/*
- ========================================================================
-
- Routine Description:
- Load Tx rate switching parameters
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- NDIS_STATUS_SUCCESS firmware image load ok
- NDIS_STATUS_FAILURE image not found
-
- IRQL = PASSIVE_LEVEL
-
- Rate Table Format:
- 1. (B0: Valid Item number) (B1:Initial item from zero)
- 2. Item Number(Dec) Mode(Hex) Current MCS(Dec) TrainUp(Dec) TrainDown(Dec)
-
- ========================================================================
-*/
-NDIS_STATUS NICLoadRateSwitchingParams(
- IN PRTMP_ADAPTER pAd)
-{
- return NDIS_STATUS_SUCCESS;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Compare two memory block
-
- Arguments:
- pSrc1 Pointer to first memory address
- pSrc2 Pointer to second memory address
-
- Return Value:
- 0: memory is equal
- 1: pSrc1 memory is larger
- 2: pSrc2 memory is larger
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-ULONG RTMPCompareMemory(
- IN PVOID pSrc1,
- IN PVOID pSrc2,
- IN ULONG Length)
-{
- PUCHAR pMem1;
- PUCHAR pMem2;
- ULONG Index = 0;
-
- pMem1 = (PUCHAR) pSrc1;
- pMem2 = (PUCHAR) pSrc2;
-
- for (Index = 0; Index < Length; Index++)
- {
- if (pMem1[Index] > pMem2[Index])
- return (1);
- else if (pMem1[Index] < pMem2[Index])
- return (2);
- }
-
- // Equal
- return (0);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Zero out memory block
-
- Arguments:
- pSrc1 Pointer to memory address
- Length Size
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPZeroMemory(
- IN PVOID pSrc,
- IN ULONG Length)
-{
- PUCHAR pMem;
- ULONG Index = 0;
-
- pMem = (PUCHAR) pSrc;
-
- for (Index = 0; Index < Length; Index++)
- {
- pMem[Index] = 0x00;
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Copy data from memory block 1 to memory block 2
-
- Arguments:
- pDest Pointer to destination memory address
- pSrc Pointer to source memory address
- Length Copy size
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPMoveMemory(
- OUT PVOID pDest,
- IN PVOID pSrc,
- IN ULONG Length)
-{
- PUCHAR pMem1;
- PUCHAR pMem2;
- UINT Index;
-
- ASSERT((Length==0) || (pDest && pSrc));
-
- pMem1 = (PUCHAR) pDest;
- pMem2 = (PUCHAR) pSrc;
-
- for (Index = 0; Index < Length; Index++)
- {
- pMem1[Index] = pMem2[Index];
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Initialize port configuration structure
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID UserCfgInit(
- IN PRTMP_ADAPTER pAd)
-{
-// EDCA_PARM DefaultEdcaParm;
- UINT key_index, bss_index;
-
- DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit\n"));
-
- //
- // part I. intialize common configuration
- //
-
- for(key_index=0; key_index<SHARE_KEY_NUM; key_index++)
- {
- for(bss_index = 0; bss_index < MAX_MBSSID_NUM; bss_index++)
- {
- pAd->SharedKey[bss_index][key_index].KeyLen = 0;
- pAd->SharedKey[bss_index][key_index].CipherAlg = CIPHER_NONE;
- }
- }
-
- pAd->EepromAccess = FALSE;
-
- pAd->Antenna.word = 0;
- pAd->CommonCfg.BBPCurrentBW = BW_20;
-
- pAd->LedCntl.word = 0;
-#ifdef RTMP_MAC_PCI
- pAd->LedIndicatorStrength = 0;
- pAd->RLnkCtrlOffset = 0;
- pAd->HostLnkCtrlOffset = 0;
-#ifdef CONFIG_STA_SUPPORT
- pAd->StaCfg.PSControl.field.EnableNewPS=TRUE;
- pAd->CheckDmaBusyCount = 0;
-#endif // CONFIG_STA_SUPPORT //
-#endif // RTMP_MAC_PCI //
-
- pAd->bAutoTxAgcA = FALSE; // Default is OFF
- pAd->bAutoTxAgcG = FALSE; // Default is OFF
- pAd->RfIcType = RFIC_2820;
-
- // Init timer for reset complete event
- pAd->CommonCfg.CentralChannel = 1;
- pAd->bForcePrintTX = FALSE;
- pAd->bForcePrintRX = FALSE;
- pAd->bStaFifoTest = FALSE;
- pAd->bProtectionTest = FALSE;
- /*
- pAd->bHCCATest = FALSE;
- pAd->bGenOneHCCA = FALSE;
- */
- pAd->CommonCfg.Dsifs = 10; // in units of usec
- pAd->CommonCfg.TxPower = 100; //mW
- pAd->CommonCfg.TxPowerPercentage = 0xffffffff; // AUTO
- pAd->CommonCfg.TxPowerDefault = 0xffffffff; // AUTO
- pAd->CommonCfg.TxPreamble = Rt802_11PreambleAuto; // use Long preamble on TX by defaut
- pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;
- pAd->CommonCfg.RtsThreshold = 2347;
- pAd->CommonCfg.FragmentThreshold = 2346;
- pAd->CommonCfg.UseBGProtection = 0; // 0: AUTO
- pAd->CommonCfg.bEnableTxBurst = TRUE; //0;
- pAd->CommonCfg.PhyMode = 0xff; // unknown
- pAd->CommonCfg.BandState = UNKNOWN_BAND;
- pAd->CommonCfg.RadarDetect.CSPeriod = 10;
- pAd->CommonCfg.RadarDetect.CSCount = 0;
- pAd->CommonCfg.RadarDetect.RDMode = RD_NORMAL_MODE;
-
-
-
-#ifdef TONE_RADAR_DETECT_SUPPORT
-#ifdef CARRIER_DETECTION_SUPPORT
- pAd->CommonCfg.CarrierDetect.delta = CARRIER_DETECT_DELTA;
- pAd->CommonCfg.CarrierDetect.div_flag = CARRIER_DETECT_DIV_FLAG;
- pAd->CommonCfg.CarrierDetect.criteria = CARRIER_DETECT_CRITIRIA;
-#ifdef RT3090
- if(IS_RT3090A(pAd))
- pAd->CommonCfg.CarrierDetect.threshold = CARRIER_DETECT_THRESHOLD_3090A;
- else
-#endif // RT3090 //
- pAd->CommonCfg.CarrierDetect.threshold = CARRIER_DETECT_THRESHOLD;
-#endif // CARRIER_DETECTION_SUPPORT //
-#endif // TONE_RADAR_DETECT_SUPPORT //
-
- pAd->CommonCfg.RadarDetect.ChMovingTime = 65;
-#ifdef MERGE_ARCH_TEAM
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh = 2;
- pAd->CommonCfg.RadarDetect.AvgRssiReq = -75;
-#else // original rt28xx source code
- pAd->CommonCfg.RadarDetect.LongPulseRadarTh = 3;
-#endif // MERGE_ARCH_TEAM //
- pAd->CommonCfg.bAPSDCapable = FALSE;
- pAd->CommonCfg.bNeedSendTriggerFrame = FALSE;
- pAd->CommonCfg.TriggerTimerCount = 0;
- pAd->CommonCfg.bAPSDForcePowerSave = FALSE;
- pAd->CommonCfg.bCountryFlag = FALSE;
- pAd->CommonCfg.TxStream = 0;
- pAd->CommonCfg.RxStream = 0;
-
- NdisZeroMemory(&pAd->BeaconTxWI, sizeof(pAd->BeaconTxWI));
-
-#ifdef DOT11_N_SUPPORT
- NdisZeroMemory(&pAd->CommonCfg.HtCapability, sizeof(pAd->CommonCfg.HtCapability));
- pAd->HTCEnable = FALSE;
- pAd->bBroadComHT = FALSE;
- pAd->CommonCfg.bRdg = FALSE;
-
-#ifdef DOT11N_DRAFT3
- pAd->CommonCfg.Dot11OBssScanPassiveDwell = dot11OBSSScanPassiveDwell; // Unit : TU. 5~1000
- pAd->CommonCfg.Dot11OBssScanActiveDwell = dot11OBSSScanActiveDwell; // Unit : TU. 10~1000
- pAd->CommonCfg.Dot11BssWidthTriggerScanInt = dot11BSSWidthTriggerScanInterval; // Unit : Second
- pAd->CommonCfg.Dot11OBssScanPassiveTotalPerChannel = dot11OBSSScanPassiveTotalPerChannel; // Unit : TU. 200~10000
- pAd->CommonCfg.Dot11OBssScanActiveTotalPerChannel = dot11OBSSScanActiveTotalPerChannel; // Unit : TU. 20~10000
- pAd->CommonCfg.Dot11BssWidthChanTranDelayFactor = dot11BSSWidthChannelTransactionDelayFactor;
- pAd->CommonCfg.Dot11OBssScanActivityThre = dot11BSSScanActivityThreshold; // Unit : percentage
- pAd->CommonCfg.Dot11BssWidthChanTranDelay = (pAd->CommonCfg.Dot11BssWidthTriggerScanInt * pAd->CommonCfg.Dot11BssWidthChanTranDelayFactor);
-#endif // DOT11N_DRAFT3 //
-
- NdisZeroMemory(&pAd->CommonCfg.AddHTInfo, sizeof(pAd->CommonCfg.AddHTInfo));
- pAd->CommonCfg.BACapability.field.MMPSmode = MMPS_ENABLE;
- pAd->CommonCfg.BACapability.field.MpduDensity = 0;
- pAd->CommonCfg.BACapability.field.Policy = IMMED_BA;
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = 64; //32;
- pAd->CommonCfg.BACapability.field.TxBAWinLimit = 64; //32;
- DBGPRINT(RT_DEBUG_TRACE, ("--> UserCfgInit. BACapability = 0x%x\n", pAd->CommonCfg.BACapability.word));
-
- pAd->CommonCfg.BACapability.field.AutoBA = FALSE;
- BATableInit(pAd, &pAd->BATable);
-
- pAd->CommonCfg.bExtChannelSwitchAnnouncement = 1;
- pAd->CommonCfg.bHTProtect = 1;
- pAd->CommonCfg.bMIMOPSEnable = TRUE;
- //2008/11/05:KH add to support Antenna power-saving of AP<--
- pAd->CommonCfg.bGreenAPEnable=FALSE;
- pAd->CommonCfg.bBlockAntDivforGreenAP=FALSE;
- //2008/11/05:KH add to support Antenna power-saving of AP-->
- pAd->CommonCfg.bBADecline = FALSE;
- pAd->CommonCfg.bDisableReordering = FALSE;
-
- if (pAd->MACVersion == 0x28720200)
- {
- pAd->CommonCfg.TxBASize = 13; //by Jerry recommend
- }else{
- pAd->CommonCfg.TxBASize = 7;
- }
-
- pAd->CommonCfg.REGBACapability.word = pAd->CommonCfg.BACapability.word;
-#endif // DOT11_N_SUPPORT //
-
- //pAd->CommonCfg.HTPhyMode.field.BW = BW_20;
- //pAd->CommonCfg.HTPhyMode.field.MCS = MCS_AUTO;
- //pAd->CommonCfg.HTPhyMode.field.ShortGI = GI_800;
- //pAd->CommonCfg.HTPhyMode.field.STBC = STBC_NONE;
- pAd->CommonCfg.TxRate = RATE_6;
-
- pAd->CommonCfg.MlmeTransmit.field.MCS = MCS_RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.BW = BW_20;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
-
- pAd->CommonCfg.BeaconPeriod = 100; // in mSec
-
-
- //
- // part II. intialize STA specific configuration
- //
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_DIRECT);
- RX_FILTER_CLEAR_FLAG(pAd, fRX_FILTER_ACCEPT_MULTICAST);
- RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_BROADCAST);
- RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_ALL_MULTICAST);
-
- pAd->StaCfg.Psm = PWR_ACTIVE;
-
- pAd->StaCfg.OrigWepStatus = Ndis802_11EncryptionDisabled;
- pAd->StaCfg.PairCipher = Ndis802_11EncryptionDisabled;
- pAd->StaCfg.GroupCipher = Ndis802_11EncryptionDisabled;
- pAd->StaCfg.bMixCipher = FALSE;
- pAd->StaCfg.DefaultKeyId = 0;
-
- // 802.1x port control
- pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- pAd->StaCfg.LastMicErrorTime = 0;
- pAd->StaCfg.MicErrCnt = 0;
- pAd->StaCfg.bBlockAssoc = FALSE;
- pAd->StaCfg.WpaState = SS_NOTUSE;
-
- pAd->CommonCfg.NdisRadioStateOff = FALSE; // New to support microsoft disable radio with OID command
-
- pAd->StaCfg.RssiTrigger = 0;
- NdisZeroMemory(&pAd->StaCfg.RssiSample, sizeof(RSSI_SAMPLE));
- pAd->StaCfg.RssiTriggerMode = RSSI_TRIGGERED_UPON_BELOW_THRESHOLD;
- pAd->StaCfg.AtimWin = 0;
- pAd->StaCfg.DefaultListenCount = 3;//default listen count;
- pAd->StaCfg.BssType = BSS_INFRA; // BSS_INFRA or BSS_ADHOC or BSS_MONITOR
- pAd->StaCfg.bScanReqIsFromWebUI = FALSE;
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_WAKEUP_NOW);
-
- pAd->StaCfg.bAutoTxRateSwitch = TRUE;
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- }
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- pAd->StaCfg.IEEE80211dClientMode = Rt802_11_D_None;
-#endif // EXT_BUILD_CHANNEL_LIST //
-#ifdef PCIE_PS_SUPPORT
-pAd->brt30xxBanMcuCmd = FALSE;
-pAd->b3090ESpecialChip = FALSE;
-//KH Debug:the following must be removed
-pAd->StaCfg.PSControl.field.rt30xxPowerMode=3;
-pAd->StaCfg.PSControl.field.rt30xxForceASPMTest=0;
-pAd->StaCfg.PSControl.field.rt30xxFollowHostASPM=1;
-#endif // PCIE_PS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
- // global variables mXXXX used in MAC protocol state machines
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
-
- // PHY specification
- pAd->CommonCfg.PhyMode = PHY_11BG_MIXED; // default PHY mode
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED); // CCK use LONG preamble
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // user desired power mode
- pAd->StaCfg.WindowsPowerMode = Ndis802_11PowerModeCAM;
- pAd->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeCAM;
- pAd->StaCfg.bWindowsACCAMEnable = FALSE;
-
- RTMPInitTimer(pAd, &pAd->StaCfg.StaQuickResponeForRateUpTimer, GET_TIMER_FUNCTION(StaQuickResponeForRateUpExec), pAd, FALSE);
- pAd->StaCfg.StaQuickResponeForRateUpTimerRunning = FALSE;
-
- // Patch for Ndtest
- pAd->StaCfg.ScanCnt = 0;
-
- pAd->StaCfg.bHwRadio = TRUE; // Default Hardware Radio status is On
- pAd->StaCfg.bSwRadio = TRUE; // Default Software Radio status is On
- pAd->StaCfg.bRadio = TRUE; // bHwRadio && bSwRadio
- pAd->StaCfg.bHardwareRadio = FALSE; // Default is OFF
- pAd->StaCfg.bShowHiddenSSID = FALSE; // Default no show
-
- // Nitro mode control
- pAd->StaCfg.bAutoReconnect = TRUE;
-
- // Save the init time as last scan time, the system should do scan after 2 seconds.
- // This patch is for driver wake up from standby mode, system will do scan right away.
- NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
- if (pAd->StaCfg.LastScanTime > 10 * OS_HZ)
- pAd->StaCfg.LastScanTime -= (10 * OS_HZ);
-
- NdisZeroMemory(pAd->nickname, IW_ESSID_MAX_SIZE+1);
-#ifdef RTMP_MAC_PCI
- sprintf((PSTRING) pAd->nickname, "RT2860STA");
-#endif // RTMP_MAC_PCI //
- RTMPInitTimer(pAd, &pAd->StaCfg.WpaDisassocAndBlockAssocTimer, GET_TIMER_FUNCTION(WpaDisassocApAndBlockAssoc), pAd, FALSE);
-#ifdef WPA_SUPPLICANT_SUPPORT
- pAd->StaCfg.IEEE8021X = FALSE;
- pAd->StaCfg.IEEE8021x_required_keys = FALSE;
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE;
- pAd->StaCfg.bRSN_IE_FromWpaSupplicant = FALSE;
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE;
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
-
-
- pAd->StaCfg.bAutoConnectByBssid = FALSE;
- pAd->StaCfg.BeaconLostTime = BEACON_LOST_TIME;
- NdisZeroMemory(pAd->StaCfg.WpaPassPhrase, 64);
- pAd->StaCfg.WpaPassPhraseLen = 0;
- pAd->StaCfg.bAutoRoaming = FALSE;
- pAd->StaCfg.bForceTxBurst = FALSE;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // Default for extra information is not valid
- pAd->ExtraInfo = EXTRA_INFO_CLEAR;
-
- // Default Config change flag
- pAd->bConfigChanged = FALSE;
-
- //
- // part III. AP configurations
- //
-
-
- //
- // part IV. others
- //
- // dynamic BBP R66:sensibity tuning to overcome background noise
- pAd->BbpTuning.bEnable = TRUE;
- pAd->BbpTuning.FalseCcaLowerThreshold = 100;
- pAd->BbpTuning.FalseCcaUpperThreshold = 512;
- pAd->BbpTuning.R66Delta = 4;
- pAd->Mlme.bEnableAutoAntennaCheck = TRUE;
-
- //
- // Also initial R66CurrentValue, RTUSBResumeMsduTransmission might use this value.
- // if not initial this value, the default value will be 0.
- //
- pAd->BbpTuning.R66CurrentValue = 0x38;
-
- pAd->Bbp94 = BBPR94_DEFAULT;
- pAd->BbpForCCK = FALSE;
-
- // Default is FALSE for test bit 1
- //pAd->bTest1 = FALSE;
-
- // initialize MAC table and allocate spin lock
- NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE));
- InitializeQueueHeader(&pAd->MacTab.McastPsQueue);
- NdisAllocateSpinLock(&pAd->MacTabLock);
-
- //RTMPInitTimer(pAd, &pAd->RECBATimer, RECBATimerTimeout, pAd, TRUE);
- //RTMPSetTimer(&pAd->RECBATimer, REORDER_EXEC_INTV);
-
-#ifdef RALINK_ATE
- NdisZeroMemory(&pAd->ate, sizeof(ATE_INFO));
- pAd->ate.Mode = ATE_STOP;
- pAd->ate.TxCount = 200;/* to exceed TX_RING_SIZE ... */
- pAd->ate.TxDoneCount = 0;
- pAd->ate.RFFreqOffset = 0;
- pAd->ate.TxLength = 1024;
- pAd->ate.TxWI.ShortGI = 0;// LONG GI : 800 ns
- pAd->ate.TxWI.PHYMODE = MODE_CCK;
- pAd->ate.TxWI.MCS = 3;
- pAd->ate.TxWI.BW = BW_20;
- pAd->ate.Channel = 1;
- pAd->ate.QID = QID_AC_BE;
- pAd->ate.Addr1[0] = 0x00;
- pAd->ate.Addr1[1] = 0x11;
- pAd->ate.Addr1[2] = 0x22;
- pAd->ate.Addr1[3] = 0xAA;
- pAd->ate.Addr1[4] = 0xBB;
- pAd->ate.Addr1[5] = 0xCC;
- NdisMoveMemory(pAd->ate.Addr2, pAd->ate.Addr1, ETH_LENGTH_OF_ADDRESS);
- NdisMoveMemory(pAd->ate.Addr3, pAd->ate.Addr1, ETH_LENGTH_OF_ADDRESS);
- pAd->ate.bRxFER = 0;
- pAd->ate.bQATxStart = FALSE;
- pAd->ate.bQARxStart = FALSE;
-
-#ifdef RTMP_MAC_PCI
- pAd->ate.bFWLoading = FALSE;
-#endif // RTMP_MAC_PCI //
-
-
-#ifdef RALINK_28xx_QA
- pAd->ate.TxStatus = 0;
- pAd->ate.AtePid = THREAD_PID_INIT_VALUE;
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
-
-
- pAd->CommonCfg.bWiFiTest = FALSE;
-#ifdef RTMP_MAC_PCI
- pAd->bPCIclkOff = FALSE;
-#endif // RTMP_MAC_PCI //
-
-#ifdef CONFIG_STA_SUPPORT
-RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#endif // CONFIG_STA_SUPPORT //
-#ifdef ANT_DIVERSITY_SUPPORT
- if ( pAd->CommonCfg.bRxAntDiversity == ANT_FIX_ANT2)
- {
- pAd->RxAnt.Pair1PrimaryRxAnt = 1;
- pAd->RxAnt.Pair1SecondaryRxAnt = 0;
- }
- else // Default
- {
- pAd->RxAnt.Pair1PrimaryRxAnt = 0;
- pAd->RxAnt.Pair1SecondaryRxAnt = 1;
- }
- pAd->RxAnt.EvaluatePeriod = 0;
- pAd->RxAnt.RcvPktNumWhenEvaluate = 0;
-#ifdef CONFIG_STA_SUPPORT
- pAd->RxAnt.Pair1AvgRssi[0] = pAd->RxAnt.Pair1AvgRssi[1] = 0;
-#endif // CONFIG_STA_SUPPORT //
-#endif // AP_ANTENNA_DIVERSITY_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("<-- UserCfgInit\n"));
-}
-
-// IRQL = PASSIVE_LEVEL
-UCHAR BtoH(STRING ch)
-{
- if (ch >= '0' && ch <= '9') return (ch - '0'); // Handle numerals
- if (ch >= 'A' && ch <= 'F') return (ch - 'A' + 0xA); // Handle capitol hex digits
- if (ch >= 'a' && ch <= 'f') return (ch - 'a' + 0xA); // Handle small hex digits
- return(255);
-}
-
-//
-// FUNCTION: AtoH(char *, UCHAR *, int)
-//
-// PURPOSE: Converts ascii string to network order hex
-//
-// PARAMETERS:
-// src - pointer to input ascii string
-// dest - pointer to output hex
-// destlen - size of dest
-//
-// COMMENTS:
-//
-// 2 ascii bytes make a hex byte so must put 1st ascii byte of pair
-// into upper nibble and 2nd ascii byte of pair into lower nibble.
-//
-// IRQL = PASSIVE_LEVEL
-
-void AtoH(PSTRING src, PUCHAR dest, int destlen)
-{
- PSTRING srcptr;
- PUCHAR destTemp;
-
- srcptr = src;
- destTemp = (PUCHAR) dest;
-
- while(destlen--)
- {
- *destTemp = BtoH(*srcptr++) << 4; // Put 1st ascii byte in upper nibble.
- *destTemp += BtoH(*srcptr++); // Add 2nd ascii byte to above.
- destTemp++;
- }
-}
-
-
-//+++Mark by shiang, not use now, need to remove after confirm
-//---Mark by shiang, not use now, need to remove after confirm
-
-
-/*
- ========================================================================
-
- Routine Description:
- Init timer objects
-
- Arguments:
- pAd Pointer to our adapter
- pTimer Timer structure
- pTimerFunc Function to execute when timer expired
- Repeat Ture for period timer
-
- Return Value:
- None
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPInitTimer(
- IN PRTMP_ADAPTER pAd,
- IN PRALINK_TIMER_STRUCT pTimer,
- IN PVOID pTimerFunc,
- IN PVOID pData,
- IN BOOLEAN Repeat)
-{
- //
- // Set Valid to TRUE for later used.
- // It will crash if we cancel a timer or set a timer
- // that we haven't initialize before.
- //
- pTimer->Valid = TRUE;
-
- pTimer->PeriodicType = Repeat;
- pTimer->State = FALSE;
- pTimer->cookie = (ULONG) pData;
-
-#ifdef RTMP_TIMER_TASK_SUPPORT
- pTimer->pAd = pAd;
-#endif // RTMP_TIMER_TASK_SUPPORT //
-
- RTMP_OS_Init_Timer(pAd, &pTimer->TimerObj, pTimerFunc, (PVOID) pTimer);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Init timer objects
-
- Arguments:
- pTimer Timer structure
- Value Timer value in milliseconds
-
- Return Value:
- None
-
- Note:
- To use this routine, must call RTMPInitTimer before.
-
- ========================================================================
-*/
-VOID RTMPSetTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- IN ULONG Value)
-{
- if (pTimer->Valid)
- {
- pTimer->TimerValue = Value;
- pTimer->State = FALSE;
- if (pTimer->PeriodicType == TRUE)
- {
- pTimer->Repeat = TRUE;
- RTMP_SetPeriodicTimer(&pTimer->TimerObj, Value);
- }
- else
- {
- pTimer->Repeat = FALSE;
- RTMP_OS_Add_Timer(&pTimer->TimerObj, Value);
- }
- }
- else
- {
- DBGPRINT_ERR(("RTMPSetTimer failed, Timer hasn't been initialize!\n"));
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Init timer objects
-
- Arguments:
- pTimer Timer structure
- Value Timer value in milliseconds
-
- Return Value:
- None
-
- Note:
- To use this routine, must call RTMPInitTimer before.
-
- ========================================================================
-*/
-VOID RTMPModTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- IN ULONG Value)
-{
- BOOLEAN Cancel;
-
- if (pTimer->Valid)
- {
- pTimer->TimerValue = Value;
- pTimer->State = FALSE;
- if (pTimer->PeriodicType == TRUE)
- {
- RTMPCancelTimer(pTimer, &Cancel);
- RTMPSetTimer(pTimer, Value);
- }
- else
- {
- RTMP_OS_Mod_Timer(&pTimer->TimerObj, Value);
- }
- }
- else
- {
- DBGPRINT_ERR(("RTMPModTimer failed, Timer hasn't been initialize!\n"));
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Cancel timer objects
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
- 1.) To use this routine, must call RTMPInitTimer before.
- 2.) Reset NIC to initial state AS IS system boot up time.
-
- ========================================================================
-*/
-VOID RTMPCancelTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- OUT BOOLEAN *pCancelled)
-{
- if (pTimer->Valid)
- {
- if (pTimer->State == FALSE)
- pTimer->Repeat = FALSE;
-
- RTMP_OS_Del_Timer(&pTimer->TimerObj, pCancelled);
-
- if (*pCancelled == TRUE)
- pTimer->State = TRUE;
-
-#ifdef RTMP_TIMER_TASK_SUPPORT
- // We need to go-through the TimerQ to findout this timer handler and remove it if
- // it's still waiting for execution.
- RtmpTimerQRemove(pTimer->pAd, pTimer);
-#endif // RTMP_TIMER_TASK_SUPPORT //
- }
- else
- {
- DBGPRINT_ERR(("RTMPCancelTimer failed, Timer hasn't been initialize!\n"));
- }
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Set LED Status
-
- Arguments:
- pAd Pointer to our adapter
- Status LED Status
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPSetLED(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Status)
-{
- //ULONG data;
- UCHAR HighByte = 0;
- UCHAR LowByte;
- BOOLEAN bIgnored = FALSE;
-
-#ifdef RALINK_ATE
- /*
- In ATE mode of RT2860 AP/STA, we have erased 8051 firmware.
- So LED mode is not supported when ATE is running.
- */
- if (!IS_RT3572(pAd))
- {
- if (ATE_ON(pAd))
- return;
- }
-#endif // RALINK_ATE //
-
- LowByte = pAd->LedCntl.field.LedMode&0x7f;
- switch (Status)
- {
- case LED_LINK_DOWN:
- HighByte = 0x20;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- pAd->LedIndicatorStrength = 0;
- break;
- case LED_LINK_UP:
- if (pAd->CommonCfg.Channel > 14)
- HighByte = 0xa0;
- else
- HighByte = 0x60;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
- case LED_RADIO_ON:
- HighByte = 0x20;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
- case LED_HALT:
- LowByte = 0; // Driver sets MAC register and MAC controls LED
- case LED_RADIO_OFF:
- HighByte = 0;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
- case LED_WPS:
- HighByte = 0x10;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
- case LED_ON_SITE_SURVEY:
- HighByte = 0x08;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
- case LED_POWER_UP:
- HighByte = 0x04;
- AsicSendCommandToMcu(pAd, 0x50, 0xff, LowByte, HighByte);
- break;
-#ifdef RALINK_ATE
-#endif // RALINK_ATE //
- default:
- DBGPRINT(RT_DEBUG_WARN, ("RTMPSetLED::Unknown Status %d\n", Status));
- break;
- }
-
- //
- // Keep LED status for LED SiteSurvey mode.
- // After SiteSurvey, we will set the LED mode to previous status.
- //
- if ((Status != LED_ON_SITE_SURVEY) && (Status != LED_POWER_UP) && (bIgnored == FALSE))
- pAd->LedStatus = Status;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSetLED::Mode=%d,HighByte=0x%02x,LowByte=0x%02x\n", pAd->LedCntl.field.LedMode, HighByte, LowByte));
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Set LED Signal Stregth
-
- Arguments:
- pAd Pointer to our adapter
- Dbm Signal Stregth
-
- Return Value:
- None
-
- IRQL = PASSIVE_LEVEL
-
- Note:
- Can be run on any IRQL level.
-
- According to Microsoft Zero Config Wireless Signal Stregth definition as belows.
- <= -90 No Signal
- <= -81 Very Low
- <= -71 Low
- <= -67 Good
- <= -57 Very Good
- > -57 Excellent
- ========================================================================
-*/
-VOID RTMPSetSignalLED(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_802_11_RSSI Dbm)
-{
- UCHAR nLed = 0;
-
- if (pAd->LedCntl.field.LedMode == LED_MODE_SIGNAL_STREGTH)
- {
- if (Dbm <= -90)
- nLed = 0;
- else if (Dbm <= -81)
- nLed = 1;
- else if (Dbm <= -71)
- nLed = 3;
- else if (Dbm <= -67)
- nLed = 7;
- else if (Dbm <= -57)
- nLed = 15;
- else
- nLed = 31;
-
- //
- // Update Signal Stregth to firmware if changed.
- //
- if (pAd->LedIndicatorStrength != nLed)
- {
- AsicSendCommandToMcu(pAd, 0x51, 0xff, nLed, pAd->LedCntl.field.Polarity);
- pAd->LedIndicatorStrength = nLed;
- }
- }
-}
-
-
-
-/*
- ========================================================================
-
- Routine Description:
- Enable RX
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL <= DISPATCH_LEVEL
-
- Note:
- Before Enable RX, make sure you have enabled Interrupt.
- ========================================================================
-*/
-VOID RTMPEnableRxTx(
- IN PRTMP_ADAPTER pAd)
-{
-// WPDMA_GLO_CFG_STRUC GloCfg;
-// ULONG i = 0;
- UINT32 rx_filter_flag;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==> RTMPEnableRxTx\n"));
-
- // Enable Rx DMA.
- RT28XXDMAEnable(pAd);
-
- // enable RX of MAC block
- if (pAd->OpMode == OPMODE_AP)
- {
- rx_filter_flag = APNORMAL;
-
-
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, rx_filter_flag); // enable RX of DMA block
- }
- else
- {
- if (pAd->CommonCfg.PSPXlink)
- rx_filter_flag = PSPXLINK;
- else
- rx_filter_flag = STANORMAL; // Staion not drop control frame will fail WiFi Certification.
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, rx_filter_flag);
- }
-
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, 0xc);
- DBGPRINT(RT_DEBUG_TRACE, ("<== RTMPEnableRxTx\n"));
-}
-
-
-//+++Add by shiang, move from os/linux/rt_main_dev.c
-void CfgInitHook(PRTMP_ADAPTER pAd)
-{
- pAd->bBroadComHT = TRUE;
-}
-
-
-int rt28xx_init(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING pDefaultMac,
- IN PSTRING pHostName)
-{
- UINT index;
- UCHAR TmpPhy;
- NDIS_STATUS Status;
- UINT32 MacCsr0 = 0;
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef RTMP_MAC_PCI
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // If dirver doesn't wake up firmware here,
- // NICLoadFirmware will hang forever when interface is up again.
- // RT2860 PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE) &&
- OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- AUTO_WAKEUP_STRUC AutoWakeupCfg;
- AsicForceWakeup(pAd, TRUE);
- AutoWakeupCfg.word = 0;
- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
- }
- }
-#endif // RTMP_MAC_PCI //
-#endif // CONFIG_STA_SUPPORT //
-
-
- // reset Adapter flags
- RTMP_CLEAR_FLAGS(pAd);
-
- // Init BssTab & ChannelInfo tabbles for auto channel select.
-
-#ifdef DOT11_N_SUPPORT
- // Allocate BA Reordering memory
- ba_reordering_resource_init(pAd, MAX_REORDERING_MPDU_NUM);
-#endif // DOT11_N_SUPPORT //
-
- // Make sure MAC gets ready.
- index = 0;
- do
- {
- RTMP_IO_READ32(pAd, MAC_CSR0, &MacCsr0);
- pAd->MACVersion = MacCsr0;
-
- if ((pAd->MACVersion != 0x00) && (pAd->MACVersion != 0xFFFFFFFF))
- break;
-
- RTMPusecDelay(10);
- } while (index++ < 100);
- DBGPRINT(RT_DEBUG_TRACE, ("MAC_CSR0 [ Ver:Rev=0x%08x]\n", pAd->MACVersion));
-
-#ifdef RTMP_MAC_PCI
-#ifdef PCIE_PS_SUPPORT
- /*Iverson patch PCIE L1 issue to make sure that driver can be read,write ,BBP and RF register at pcie L.1 level */
- if ((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd))&&OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- RTMP_IO_READ32(pAd, AUX_CTRL, &MacCsr0);
- MacCsr0 |= 0x402;
- RTMP_IO_WRITE32(pAd, AUX_CTRL, MacCsr0);
- DBGPRINT(RT_DEBUG_TRACE, ("AUX_CTRL = 0x%x\n", MacCsr0));
- }
-#endif // PCIE_PS_SUPPORT //
-
- // To fix driver disable/enable hang issue when radio off
- RTMP_IO_WRITE32(pAd, PWR_PIN_CFG, 0x2);
-#endif // RTMP_MAC_PCI //
-
- // Disable DMA
- RT28XXDMADisable(pAd);
-
-
- // Load 8051 firmware
- Status = NICLoadFirmware(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("NICLoadFirmware failed, Status[=0x%08x]\n", Status));
- goto err1;
- }
-
- NICLoadRateSwitchingParams(pAd);
-
- // Disable interrupts here which is as soon as possible
- // This statement should never be true. We might consider to remove it later
-#ifdef RTMP_MAC_PCI
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
- {
- RTMP_ASIC_INTERRUPT_DISABLE(pAd);
- }
-#endif // RTMP_MAC_PCI //
-
- Status = RTMPAllocTxRxRingMemory(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("RTMPAllocDMAMemory failed, Status[=0x%08x]\n", Status));
- goto err1;
- }
-
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
-
- // initialize MLME
- //
-
- Status = RtmpMgmtTaskInit(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- goto err2;
-
- Status = MlmeInit(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("MlmeInit failed, Status[=0x%08x]\n", Status));
- goto err2;
- }
-
- // Initialize pAd->StaCfg, pAd->ApCfg, pAd->CommonCfg to manufacture default
- //
- UserCfgInit(pAd);
- Status = RtmpNetTaskInit(pAd);
- if (Status != NDIS_STATUS_SUCCESS)
- goto err3;
-
-// COPY_MAC_ADDR(pAd->ApCfg.MBSSID[apidx].Bssid, netif->hwaddr);
-// pAd->bForcePrintTX = TRUE;
-
- CfgInitHook(pAd);
-
-
-#ifdef BLOCK_NET_IF
- initblockQueueTab(pAd);
-#endif // BLOCK_NET_IF //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- NdisAllocateSpinLock(&pAd->MacTabLock);
-#endif // CONFIG_STA_SUPPORT //
-
- MeasureReqTabInit(pAd);
- TpcReqTabInit(pAd);
-
- //
- // Init the hardware, we need to init asic before read registry, otherwise mac register will be reset
- //
- Status = NICInitializeAdapter(pAd, TRUE);
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("NICInitializeAdapter failed, Status[=0x%08x]\n", Status));
- if (Status != NDIS_STATUS_SUCCESS)
- goto err3;
- }
-
- // Read parameters from Config File
- Status = RTMPReadParametersHook(pAd);
-
- DBGPRINT(RT_DEBUG_OFF, ("1. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
- if (Status != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT_ERR(("NICReadRegParameters failed, Status[=0x%08x]\n",Status));
- goto err4;
- }
-
-
-
-#ifdef DOT11_N_SUPPORT
- //Init Ba Capability parameters.
-// RT28XX_BA_INIT(pAd);
- pAd->CommonCfg.DesiredHtPhy.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.AmsduEnable = (USHORT)pAd->CommonCfg.BACapability.field.AmsduEnable;
- pAd->CommonCfg.DesiredHtPhy.AmsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.DesiredHtPhy.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
- // UPdata to HT IE
- pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = (USHORT)pAd->CommonCfg.BACapability.field.MMPSmode;
- pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = (USHORT)pAd->CommonCfg.BACapability.field.AmsduSize;
- pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = (UCHAR)pAd->CommonCfg.BACapability.field.MpduDensity;
-#endif // DOT11_N_SUPPORT //
-
- // after reading Registry, we now know if in AP mode or STA mode
-
- // Load 8051 firmware; crash when FW image not existent
- // Status = NICLoadFirmware(pAd);
- // if (Status != NDIS_STATUS_SUCCESS)
- // break;
-
- DBGPRINT(RT_DEBUG_OFF, ("2. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
-
- // We should read EEPROM for all cases. rt2860b
- NICReadEEPROMParameters(pAd, (PUCHAR)pDefaultMac);
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_OFF, ("3. Phy Mode = %d\n", pAd->CommonCfg.PhyMode));
-
- NICInitAsicFromEEPROM(pAd); //rt2860b
-
- // Set PHY to appropriate mode
- TmpPhy = pAd->CommonCfg.PhyMode;
- pAd->CommonCfg.PhyMode = 0xff;
- RTMPSetPhyMode(pAd, TmpPhy);
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
-
- // No valid channels.
- if (pAd->ChannelListNum == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Wrong configuration. No valid channel found. Check \"ContryCode\" and \"ChannelGeography\" setting.\n"));
- goto err4;
- }
-
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_OFF, ("MCS Set = %02x %02x %02x %02x %02x\n", pAd->CommonCfg.HtCapability.MCSSet[0],
- pAd->CommonCfg.HtCapability.MCSSet[1], pAd->CommonCfg.HtCapability.MCSSet[2],
- pAd->CommonCfg.HtCapability.MCSSet[3], pAd->CommonCfg.HtCapability.MCSSet[4]));
-#endif // DOT11_N_SUPPORT //
-
-#ifdef RTMP_RF_RW_SUPPORT
- //Init RT30xx RFRegisters after read RFIC type from EEPROM
- NICInitRFRegisters(pAd);
-#endif // RTMP_RF_RW_SUPPORT //
-
-
-
-// APInitialize(pAd);
-
-#ifdef IKANOS_VX_1X0
- VR_IKANOS_FP_Init(pAd->ApCfg.BssidNum, pAd->PermanentAddress);
-#endif // IKANOS_VX_1X0 //
-
- //
- // Initialize RF register to default value
- //
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- // 8051 firmware require the signal during booting time.
- //2008/11/28:KH marked the following codes to patch Frequency offset bug
- //AsicSendCommandToMcu(pAd, 0x72, 0xFF, 0x00, 0x00);
-
- if (pAd && (Status != NDIS_STATUS_SUCCESS))
- {
- //
- // Undo everything if it failed
- //
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
-// NdisMDeregisterInterrupt(&pAd->Interrupt);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
- }
-// RTMPFreeAdapter(pAd); // we will free it in disconnect()
- }
- else if (pAd)
- {
- // Microsoft HCT require driver send a disconnect event after driver initialization.
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
-// pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_MEDIA_STATE_CHANGE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event B!\n"));
-
-
- }// end of else
-
-
- // Set up the Mac address
- RtmpOSNetDevAddrSet(pAd->net_dev, &pAd->CurrentAddress[0]);
-
- // Various AP function init
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- // send wireless event to wpa_supplicant for infroming interface up.
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_INTERFACE_UP, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
-
- DBGPRINT_S(Status, ("<==== rt28xx_init, Status=%x\n", Status));
-
- return TRUE;
-
-
-err4:
-err3:
- MlmeHalt(pAd);
-err2:
- RTMPFreeTxRxRingMemory(pAd);
-err1:
-
-#ifdef DOT11_N_SUPPORT
- os_free_mem(pAd, pAd->mpdu_blk_pool.mem); // free BA pool
-#endif // DOT11_N_SUPPORT //
-
- // shall not set priv to NULL here because the priv didn't been free yet.
- //net_dev->priv = 0;
-#ifdef INF_AMAZON_SE
-err0:
-#endif // INF_AMAZON_SE //
-#ifdef ST
-err0:
-#endif // ST //
-
- DBGPRINT(RT_DEBUG_ERROR, ("!!! rt28xx Initialized fail !!!\n"));
- return FALSE;
-}
-//---Add by shiang, move from os/linux/rt_main_dev.c
-
-
-static INT RtmpChipOpsRegister(
- IN RTMP_ADAPTER *pAd,
- IN INT infType)
-{
- RTMP_CHIP_OP *pChipOps = &pAd->chipOps;
- int status;
-
- memset(pChipOps, 0, sizeof(RTMP_CHIP_OP));
-
- /* set eeprom related hook functions */
- status = RtmpChipOpsEepromHook(pAd, infType);
-
- /* set mcu related hook functions */
- switch(infType)
- {
-#ifdef RTMP_PCI_SUPPORT
- case RTMP_DEV_INF_PCI:
- pChipOps->loadFirmware = RtmpAsicLoadFirmware;
- pChipOps->eraseFirmware = RtmpAsicEraseFirmware;
- pChipOps->sendCommandToMcu = RtmpAsicSendCommandToMcu;
- break;
-#endif // RTMP_PCI_SUPPORT //
-
-
- default:
- break;
- }
-
- return status;
-}
-
-
-INT RtmpRaDevCtrlInit(
- IN RTMP_ADAPTER *pAd,
- IN RTMP_INF_TYPE infType)
-{
- //VOID *handle;
-
- // Assign the interface type. We need use it when do register/EEPROM access.
- pAd->infType = infType;
-
-
-#ifdef CONFIG_STA_SUPPORT
- pAd->OpMode = OPMODE_STA;
- DBGPRINT(RT_DEBUG_TRACE, ("STA Driver version-%s\n", STA_DRIVER_VERSION));
-#endif // CONFIG_STA_SUPPORT //
-
-
-
- RtmpChipOpsRegister(pAd, infType);
-
-#ifdef MULTIPLE_CARD_SUPPORT
-{
- extern BOOLEAN RTMP_CardInfoRead(PRTMP_ADAPTER pAd);
-
- // find its profile path
- pAd->MC_RowID = -1; // use default profile path
- RTMP_CardInfoRead(pAd);
-
- if (pAd->MC_RowID == -1)
-#ifdef CONFIG_STA_SUPPORT
- strcpy(pAd->MC_FileName, STA_PROFILE_PATH);
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("MC> ROW = %d, PATH = %s\n", pAd->MC_RowID, pAd->MC_FileName));
-}
-#endif // MULTIPLE_CARD_SUPPORT //
-
- return 0;
-}
-
-
-BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER *pAd)
-{
-#ifdef MULTIPLE_CARD_SUPPORT
-extern UINT8 MC_CardUsed[MAX_NUM_OF_MULTIPLE_CARD];
-
- if ((pAd->MC_RowID >= 0) && (pAd->MC_RowID <= MAX_NUM_OF_MULTIPLE_CARD))
- MC_CardUsed[pAd->MC_RowID] = 0; // not clear MAC address
-#endif // MULTIPLE_CARD_SUPPORT //
-
-
- RTMPFreeAdapter(pAd);
-
- return TRUE;
-}
-
-
-// not yet support MBSS
-PNET_DEV get_netdev_from_bssid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR FromWhichBSSID)
-{
- PNET_DEV dev_p = NULL;
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- dev_p = pAd->net_dev;
- }
-#endif // CONFIG_STA_SUPPORT //
-
- ASSERT(dev_p);
- return dev_p; /* return one of MBSS */
-}
diff --git a/drivers/staging/rt3090/common/rtmp_mcu.c b/drivers/staging/rt3090/common/rtmp_mcu.c
deleted file mode 100644
index 23f785a90e06..000000000000
--- a/drivers/staging/rt3090/common/rtmp_mcu.c
+++ /dev/null
@@ -1,560 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_mcu.c
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "../rt_config.h"
-#include "../firmware.h"
-
-//#define BIN_IN_FILE /* use *.bin firmware */
-
-
-// New 8k byte firmware size for RT3071/RT3072
-#define FIRMWAREIMAGE_MAX_LENGTH 0x2000
-#define FIRMWAREIMAGE_LENGTH (sizeof (FirmwareImage) / sizeof(UCHAR))
-#define FIRMWARE_MAJOR_VERSION 0
-
-#define FIRMWAREIMAGEV1_LENGTH 0x1000
-#define FIRMWAREIMAGEV2_LENGTH 0x1000
-
-#ifdef RTMP_MAC_PCI
-#define FIRMWARE_MINOR_VERSION 2
-#endif // RTMP_MAC_PCI //
-
-const unsigned short ccitt_16Table[] = {
- 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7,
- 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF,
- 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6,
- 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE,
- 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485,
- 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D,
- 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4,
- 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC,
- 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823,
- 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B,
- 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12,
- 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A,
- 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41,
- 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49,
- 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70,
- 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78,
- 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F,
- 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067,
- 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E,
- 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256,
- 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D,
- 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405,
- 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C,
- 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634,
- 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB,
- 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3,
- 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A,
- 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92,
- 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9,
- 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1,
- 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8,
- 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0
-};
-#define ByteCRC16(v, crc) \
- (unsigned short)((crc << 8) ^ ccitt_16Table[((crc >> 8) ^ (v)) & 255])
-
-unsigned char BitReverse(unsigned char x)
-{
- int i;
- unsigned char Temp=0;
- for(i=0; ; i++)
- {
- if(x & 0x80) Temp |= 0x80;
- if(i==7) break;
- x <<= 1;
- Temp >>= 1;
- }
- return Temp;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- erase 8051 firmware image in MAC ASIC
-
- Arguments:
- Adapter Pointer to our adapter
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-INT RtmpAsicEraseFirmware(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG i;
-
- for(i=0; i<MAX_FIRMWARE_IMAGE_SIZE; i+=4)
- RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, 0);
-
- return 0;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Load 8051 firmware file into MAC ASIC
-
- Arguments:
- Adapter Pointer to our adapter
-
- Return Value:
- NDIS_STATUS_SUCCESS firmware image load ok
- NDIS_STATUS_FAILURE image not found
-
- IRQL = PASSIVE_LEVEL
-
- ========================================================================
-*/
-NDIS_STATUS RtmpAsicLoadFirmware(
- IN PRTMP_ADAPTER pAd)
-{
-#ifdef BIN_IN_FILE
-#define NICLF_DEFAULT_USE() \
- flg_default_firm_use = TRUE; \
- DBGPRINT(RT_DEBUG_OFF, ("%s - Use default firmware!\n", __FUNCTION__));
-
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- PUCHAR src;
- RTMP_OS_FD srcf;
- INT retval, i;
- PUCHAR pFirmwareImage;
- INT FileLength = 0;
- UINT32 MacReg;
- ULONG Index;
- ULONG firm;
- BOOLEAN flg_default_firm_use = FALSE;
- RTMP_OS_FS_INFO osFSInfo;
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> %s\n", __FUNCTION__));
-
- /* init */
- pFirmwareImage = NULL;
- src = RTMP_FIRMWARE_FILE_NAME;
-
- RtmpOSFSInfoChange(&osFSInfo, TRUE);
-
- pAd->FirmwareVersion = (FIRMWARE_MAJOR_VERSION << 8) + \
- FIRMWARE_MINOR_VERSION;
-
-
- /* allocate firmware buffer */
- pFirmwareImage = kmalloc(MAX_FIRMWARE_IMAGE_SIZE, MEM_ALLOC_FLAG);
- if (pFirmwareImage == NULL)
- {
- /* allocate fail, use default firmware array in firmware.h */
- DBGPRINT(RT_DEBUG_ERROR, ("%s - Allocate memory fail!\n", __FUNCTION__));
- NICLF_DEFAULT_USE();
- }
- else
- {
- /* allocate ok! zero the firmware buffer */
- memset(pFirmwareImage, 0x00, MAX_FIRMWARE_IMAGE_SIZE);
- } /* End of if */
-
-
- /* if ok, read firmware file from *.bin file */
- if (flg_default_firm_use == FALSE)
- {
- do
- {
- /* open the bin file */
- srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
-
- if (IS_FILE_OPEN_ERR(srcf))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s - Error opening file %s\n", __FUNCTION__, src));
- NICLF_DEFAULT_USE();
- break;
- }
-
-
- /* read the firmware from the file *.bin */
- FileLength = RtmpOSFileRead(srcf, pFirmwareImage, MAX_FIRMWARE_IMAGE_SIZE);
- if (FileLength != MAX_FIRMWARE_IMAGE_SIZE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: error file length (=%d) in RT2860AP.BIN\n",
- __FUNCTION__, FileLength));
- NICLF_DEFAULT_USE();
- break;
- }
- else
- {
- PUCHAR ptr = pFirmwareImage;
- USHORT crc = 0xffff;
-
-
- /* calculate firmware CRC */
- for(i=0; i<(MAX_FIRMWARE_IMAGE_SIZE-2); i++, ptr++)
- crc = ByteCRC16(BitReverse(*ptr), crc);
- /* End of for */
-
- if ((pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-2] != \
- (UCHAR)BitReverse((UCHAR)(crc>>8))) ||
- (pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-1] != \
- (UCHAR)BitReverse((UCHAR)crc)))
- {
- /* CRC fail */
- DBGPRINT(RT_DEBUG_ERROR, ("%s: CRC = 0x%02x 0x%02x "
- "error, should be 0x%02x 0x%02x\n",
- __FUNCTION__,
- pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-2],
- pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-1],
- (UCHAR)(crc>>8), (UCHAR)(crc)));
- NICLF_DEFAULT_USE();
- break;
- }
- else
- {
- /* firmware is ok */
- pAd->FirmwareVersion = \
- (pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-4] << 8) +
- pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-3];
-
- /* check if firmware version of the file is too old */
- if ((pAd->FirmwareVersion) < \
- ((FIRMWARE_MAJOR_VERSION << 8) +
- FIRMWARE_MINOR_VERSION))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: firmware version too old!\n", __FUNCTION__));
- NICLF_DEFAULT_USE();
- break;
- } /* End of if */
- } /* End of if */
-
- DBGPRINT(RT_DEBUG_TRACE,
- ("NICLoadFirmware: CRC ok, ver=%d.%d\n",
- pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-4],
- pFirmwareImage[MAX_FIRMWARE_IMAGE_SIZE-3]));
- } /* End of if (FileLength == MAX_FIRMWARE_IMAGE_SIZE) */
- break;
- } while(TRUE);
-
- /* close firmware file */
- if (IS_FILE_OPEN_ERR(srcf))
- ;
- else
- {
- retval = RtmpOSFileClose(srcf);
- if (retval)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("--> Error %d closing %s\n", -retval, src));
- }
- }
- }
-
-
- /* write firmware to ASIC */
- if (flg_default_firm_use == TRUE)
- {
- /* use default fimeware, free allocated buffer */
- if (pFirmwareImage != NULL)
- kfree(pFirmwareImage);
- /* End of if */
-
- /* use default *.bin array */
- pFirmwareImage = FirmwareImage;
- FileLength = sizeof(FirmwareImage);
- } /* End of if */
-
- /* enable Host program ram write selection */
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x10000);
-
- for(i=0; i<FileLength; i+=4)
- {
- firm = pFirmwareImage[i] +
- (pFirmwareImage[i+3] << 24) +
- (pFirmwareImage[i+2] << 16) +
- (pFirmwareImage[i+1] << 8);
-
- RTMP_IO_WRITE32(pAd, FIRMWARE_IMAGE_BASE + i, firm);
- } /* End of for */
-
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x00000);
- RTMP_IO_WRITE32(pAd, PBF_SYS_CTRL, 0x00001);
-
- /* initialize BBP R/W access agent */
- RTMP_IO_WRITE32(pAd, H2M_BBP_AGENT, 0);
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, 0);
-
- if (flg_default_firm_use == FALSE)
- {
- /* use file firmware, free allocated buffer */
- if (pFirmwareImage != NULL)
- kfree(pFirmwareImage);
- /* End of if */
- } /* End of if */
-
- RtmpOSFSInfoChange(&osFSInfo, FALSE);
-#else
-
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
- PUCHAR pFirmwareImage;
- ULONG FileLength, Index;
- //ULONG firm;
- UINT32 MacReg = 0;
- UINT32 Version = (pAd->MACVersion >> 16);
-
- pFirmwareImage = FirmwareImage;
- FileLength = sizeof(FirmwareImage);
-
- // New 8k byte firmware size for RT3071/RT3072
- //DBGPRINT(RT_DEBUG_TRACE, ("Usb Chip\n"));
- if (FIRMWAREIMAGE_LENGTH == FIRMWAREIMAGE_MAX_LENGTH)
- //The firmware image consists of two parts. One is the origianl and the other is the new.
- //Use Second Part
- {
-#ifdef RTMP_MAC_PCI
- if ((Version == 0x2860) || IS_RT3090(pAd)||IS_RT3390(pAd))
- {
- pFirmwareImage = FirmwareImage;
- FileLength = FIRMWAREIMAGE_LENGTH;
- }
-#endif // RTMP_MAC_PCI //
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("KH: bin file should be 8KB.\n"));
- Status = NDIS_STATUS_FAILURE;
- }
-
-
- RTMP_WRITE_FIRMWARE(pAd, pFirmwareImage, FileLength);
-
-#endif
-
- /* check if MCU is ready */
- Index = 0;
- do
- {
- RTMP_IO_READ32(pAd, PBF_SYS_CTRL, &MacReg);
-
- if (MacReg & 0x80)
- break;
-
- RTMPusecDelay(1000);
- } while (Index++ < 1000);
-
- if (Index >= 1000)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware: MCU is not ready\n\n\n"));
- Status = NDIS_STATUS_FAILURE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== %s (status=%d)\n", __FUNCTION__, Status));
-
- return Status;
-}
-
-
-INT RtmpAsicSendCommandToMcu(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Command,
- IN UCHAR Token,
- IN UCHAR Arg0,
- IN UCHAR Arg1)
-{
- HOST_CMD_CSR_STRUC H2MCmd;
- H2M_MAILBOX_STRUC H2MMailbox;
- ULONG i = 0;
-#ifdef RTMP_MAC_PCI
-#ifdef RALINK_ATE
- static UINT32 j = 0;
-#endif // RALINK_ATE //
-#endif // RTMP_MAC_PCI //
-#ifdef PCIE_PS_SUPPORT
-#ifdef CONFIG_STA_SUPPORT
- // 3090F power solution 3 has hw limitation that needs to ban all mcu command
- // when firmware is in radio state. For other chip doesn't have this limitation.
- if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
- && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
- && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE))
- {
- RTMP_SEM_LOCK(&pAd->McuCmdLock);
- if ((pAd->brt30xxBanMcuCmd == TRUE)
- && (Command != WAKE_MCU_CMD) && (Command != RFOFF_MCU_CMD))
- {
- RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
- DBGPRINT(RT_DEBUG_TRACE, (" Ban Mcu Cmd %x in sleep mode\n", Command));
- return FALSE;
- }
- else if ((Command == SLEEP_MCU_CMD)
- ||(Command == RFOFF_MCU_CMD))
- {
- pAd->brt30xxBanMcuCmd = TRUE;
- }
- else if (Command != WAKE_MCU_CMD)
- {
- pAd->brt30xxBanMcuCmd = FALSE;
- }
-
- RTMP_SEM_UNLOCK(&pAd->McuCmdLock);
-
- }
- if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
- && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
- && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
- && (Command == WAKE_MCU_CMD))
- {
-
- do
- {
- RTMP_IO_FORCE_READ32(pAd, H2M_MAILBOX_CSR, &H2MMailbox.word);
- if (H2MMailbox.field.Owner == 0)
- break;
-
- RTMPusecDelay(2);
- DBGPRINT(RT_DEBUG_INFO, ("AsicSendCommanToMcu::Mail box is busy\n"));
- } while(i++ < 100);
-
- if (i >= 100)
- {
- DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
- return FALSE;
- }
-
- H2MMailbox.field.Owner = 1; // pass ownership to MCU
- H2MMailbox.field.CmdToken = Token;
- H2MMailbox.field.HighByte = Arg1;
- H2MMailbox.field.LowByte = Arg0;
- RTMP_IO_FORCE_WRITE32(pAd, H2M_MAILBOX_CSR, H2MMailbox.word);
-
- H2MCmd.word = 0;
- H2MCmd.field.HostCommand = Command;
- RTMP_IO_FORCE_WRITE32(pAd, HOST_CMD_CSR, H2MCmd.word);
-
-
- }
- else
-#endif // CONFIG_STA_SUPPORT //
-#endif // PCIE_PS_SUPPORT //
- {
- do
- {
- RTMP_IO_READ32(pAd, H2M_MAILBOX_CSR, &H2MMailbox.word);
- if (H2MMailbox.field.Owner == 0)
- break;
-
- RTMPusecDelay(2);
- } while(i++ < 100);
-
- if (i >= 100)
- {
-#ifdef RTMP_MAC_PCI
-#ifdef RALINK_ATE
- if (pAd->ate.bFWLoading == TRUE)
- {
- /* reloading firmware when received iwpriv cmd "ATE=ATESTOP" */
- if (j > 0)
- {
- if (j % 64 != 0)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("#"));
- }
- else
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("\n"));
- }
- ++j;
- }
- else if (j == 0)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Loading firmware. Please wait for a moment...\n"));
- ++j;
- }
- }
- else
-#endif // RALINK_ATE //
-#endif // RTMP_MAC_PCI //
- {
- DBGPRINT_ERR(("H2M_MAILBOX still hold by MCU. command fail\n"));
- }
- return FALSE;
- }
-
-#ifdef RTMP_MAC_PCI
-#ifdef RALINK_ATE
- else if (pAd->ate.bFWLoading == TRUE)
- {
- /* reloading of firmware is completed */
- pAd->ate.bFWLoading = FALSE;
- ATEDBGPRINT(RT_DEBUG_ERROR, ("\n"));
- j = 0;
- }
-#endif // RALINK_ATE //
-#endif // RTMP_MAC_PCI //
-
- H2MMailbox.field.Owner = 1; // pass ownership to MCU
- H2MMailbox.field.CmdToken = Token;
- H2MMailbox.field.HighByte = Arg1;
- H2MMailbox.field.LowByte = Arg0;
- RTMP_IO_WRITE32(pAd, H2M_MAILBOX_CSR, H2MMailbox.word);
-
- H2MCmd.word = 0;
- H2MCmd.field.HostCommand = Command;
- RTMP_IO_WRITE32(pAd, HOST_CMD_CSR, H2MCmd.word);
-
- if (Command != 0x80)
- {
- }
-}
-#ifdef PCIE_PS_SUPPORT
-#ifdef CONFIG_STA_SUPPORT
- // 3090 MCU Wakeup command needs more time to be stable.
- // Before stable, don't issue other MCU command to prevent from firmware error.
- if (((IS_RT3090(pAd) || IS_RT3572(pAd) || IS_RT3390(pAd)) && IS_VERSION_AFTER_F(pAd)) && IS_VERSION_AFTER_F(pAd)
- && (pAd->StaCfg.PSControl.field.rt30xxPowerMode == 3)
- && (pAd->StaCfg.PSControl.field.EnableNewPS == TRUE)
- && (Command == WAKE_MCU_CMD))
- {
- RTMPusecDelay(2000);
- //Put this is after RF programming.
- //NdisAcquireSpinLock(&pAd->McuCmdLock);
- //pAd->brt30xxBanMcuCmd = FALSE;
- //NdisReleaseSpinLock(&pAd->McuCmdLock);
- }
-#endif // CONFIG_STA_SUPPORT //
-#endif // PCIE_PS_SUPPORT //
-
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/common/spectrum.c b/drivers/staging/rt3090/common/spectrum.c
deleted file mode 100644
index 12d2125148ba..000000000000
--- a/drivers/staging/rt3090/common/spectrum.c
+++ /dev/null
@@ -1,2221 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- action.c
-
- Abstract:
- Handle association related requests either from WSTA or from local MLME
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- Fonchi Wu 2008 created for 802.11h
- */
-
-#include "../rt_config.h"
-#include "../action.h"
-
-
-/* The regulatory information in the USA (US) */
-DOT11_REGULATORY_INFORMATION USARegulatoryInfo[] =
-{
-/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
- {0, {0, 0, {0}}}, // Invlid entry
- {1, {4, 16, {36, 40, 44, 48}}},
- {2, {4, 23, {52, 56, 60, 64}}},
- {3, {4, 29, {149, 153, 157, 161}}},
- {4, {11, 23, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}},
- {5, {5, 30, {149, 153, 157, 161, 165}}},
- {6, {10, 14, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}},
- {7, {10, 27, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}}},
- {8, {5, 17, {11, 13, 15, 17, 19}}},
- {9, {5, 30, {11, 13, 15, 17, 19}}},
- {10, {2, 20, {21, 25}}},
- {11, {2, 33, {21, 25}}},
- {12, {11, 30, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}}}
-};
-#define USA_REGULATORY_INFO_SIZE (sizeof(USARegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
-
-
-/* The regulatory information in Europe */
-DOT11_REGULATORY_INFORMATION EuropeRegulatoryInfo[] =
-{
-/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
- {0, {0, 0, {0}}}, // Invalid entry
- {1, {4, 20, {36, 40, 44, 48}}},
- {2, {4, 20, {52, 56, 60, 64}}},
- {3, {11, 30, {100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140}}},
- {4, {13, 20, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}}
-};
-#define EU_REGULATORY_INFO_SIZE (sizeof(EuropeRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
-
-
-/* The regulatory information in Japan */
-DOT11_REGULATORY_INFORMATION JapanRegulatoryInfo[] =
-{
-/* "regulatory class" "number of channels" "Max Tx Pwr" "channel list" */
- {0, {0, 0, {0}}}, // Invalid entry
- {1, {4, 22, {34, 38, 42, 46}}},
- {2, {3, 24, {8, 12, 16}}},
- {3, {3, 24, {8, 12, 16}}},
- {4, {3, 24, {8, 12, 16}}},
- {5, {3, 24, {8, 12, 16}}},
- {6, {3, 22, {8, 12, 16}}},
- {7, {4, 24, {184, 188, 192, 196}}},
- {8, {4, 24, {184, 188, 192, 196}}},
- {9, {4, 24, {184, 188, 192, 196}}},
- {10, {4, 24, {184, 188, 192, 196}}},
- {11, {4, 22, {184, 188, 192, 196}}},
- {12, {4, 24, {7, 8, 9, 11}}},
- {13, {4, 24, {7, 8, 9, 11}}},
- {14, {4, 24, {7, 8, 9, 11}}},
- {15, {4, 24, {7, 8, 9, 11}}},
- {16, {6, 24, {183, 184, 185, 187, 188, 189}}},
- {17, {6, 24, {183, 184, 185, 187, 188, 189}}},
- {18, {6, 24, {183, 184, 185, 187, 188, 189}}},
- {19, {6, 24, {183, 184, 185, 187, 188, 189}}},
- {20, {6, 17, {183, 184, 185, 187, 188, 189}}},
- {21, {6, 24, {6, 7, 8, 9, 10, 11}}},
- {22, {6, 24, {6, 7, 8, 9, 10, 11}}},
- {23, {6, 24, {6, 7, 8, 9, 10, 11}}},
- {24, {6, 24, {6, 7, 8, 9, 10, 11}}},
- {25, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
- {26, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
- {27, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
- {28, {8, 24, {182, 183, 184, 185, 186, 187, 188, 189}}},
- {29, {8, 17, {182, 183, 184, 185, 186, 187, 188, 189}}},
- {30, {13, 23, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}}},
- {31, {1, 23, {14}}},
- {32, {4, 22, {52, 56, 60, 64}}}
-};
-#define JP_REGULATORY_INFO_SIZE (sizeof(JapanRegulatoryInfo) / sizeof(DOT11_REGULATORY_INFORMATION))
-
-
-CHAR RTMP_GetTxPwr(
- IN PRTMP_ADAPTER pAd,
- IN HTTRANSMIT_SETTING HTTxMode)
-{
-typedef struct __TX_PWR_CFG
-{
- UINT8 Mode;
- UINT8 MCS;
- UINT16 req;
- UINT8 shift;
- UINT32 BitMask;
-} TX_PWR_CFG;
-
- UINT32 Value;
- INT Idx;
- UINT8 PhyMode;
- CHAR CurTxPwr;
- UINT8 TxPwrRef = 0;
- CHAR DaltaPwr;
- ULONG TxPwr[5];
-
-
- TX_PWR_CFG TxPwrCfg[] = {
- {MODE_CCK, 0, 0, 4, 0x000000f0},
- {MODE_CCK, 1, 0, 0, 0x0000000f},
- {MODE_CCK, 2, 0, 12, 0x0000f000},
- {MODE_CCK, 3, 0, 8, 0x00000f00},
-
- {MODE_OFDM, 0, 0, 20, 0x00f00000},
- {MODE_OFDM, 1, 0, 16, 0x000f0000},
- {MODE_OFDM, 2, 0, 28, 0xf0000000},
- {MODE_OFDM, 3, 0, 24, 0x0f000000},
- {MODE_OFDM, 4, 1, 4, 0x000000f0},
- {MODE_OFDM, 5, 1, 0, 0x0000000f},
- {MODE_OFDM, 6, 1, 12, 0x0000f000},
- {MODE_OFDM, 7, 1, 8, 0x00000f00}
-#ifdef DOT11_N_SUPPORT
- ,{MODE_HTMIX, 0, 1, 20, 0x00f00000},
- {MODE_HTMIX, 1, 1, 16, 0x000f0000},
- {MODE_HTMIX, 2, 1, 28, 0xf0000000},
- {MODE_HTMIX, 3, 1, 24, 0x0f000000},
- {MODE_HTMIX, 4, 2, 4, 0x000000f0},
- {MODE_HTMIX, 5, 2, 0, 0x0000000f},
- {MODE_HTMIX, 6, 2, 12, 0x0000f000},
- {MODE_HTMIX, 7, 2, 8, 0x00000f00},
- {MODE_HTMIX, 8, 2, 20, 0x00f00000},
- {MODE_HTMIX, 9, 2, 16, 0x000f0000},
- {MODE_HTMIX, 10, 2, 28, 0xf0000000},
- {MODE_HTMIX, 11, 2, 24, 0x0f000000},
- {MODE_HTMIX, 12, 3, 4, 0x000000f0},
- {MODE_HTMIX, 13, 3, 0, 0x0000000f},
- {MODE_HTMIX, 14, 3, 12, 0x0000f000},
- {MODE_HTMIX, 15, 3, 8, 0x00000f00}
-#endif // DOT11_N_SUPPORT //
- };
-#define MAX_TXPWR_TAB_SIZE (sizeof(TxPwrCfg) / sizeof(TX_PWR_CFG))
-
-#ifdef SINGLE_SKU
- CurTxPwr = pAd->CommonCfg.DefineMaxTxPwr;
-#else
- CurTxPwr = 19;
-#endif
-
- /* check Tx Power setting from UI. */
- if (pAd->CommonCfg.TxPowerPercentage > 90)
- ;
- else if (pAd->CommonCfg.TxPowerPercentage > 60) /* reduce Pwr for 1 dB. */
- CurTxPwr -= 1;
- else if (pAd->CommonCfg.TxPowerPercentage > 30) /* reduce Pwr for 3 dB. */
- CurTxPwr -= 3;
- else if (pAd->CommonCfg.TxPowerPercentage > 15) /* reduce Pwr for 6 dB. */
- CurTxPwr -= 6;
- else if (pAd->CommonCfg.TxPowerPercentage > 9) /* reduce Pwr for 9 dB. */
- CurTxPwr -= 9;
- else /* reduce Pwr for 12 dB. */
- CurTxPwr -= 12;
-
- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
- {
- if (pAd->CommonCfg.CentralChannel > 14)
- {
- TxPwr[0] = pAd->Tx40MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx40MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgGBand[4];
- }
- }
- else
- {
- if (pAd->CommonCfg.Channel > 14)
- {
- TxPwr[0] = pAd->Tx20MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx20MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgGBand[4];
- }
- }
-
-
- switch(HTTxMode.field.MODE)
- {
- case MODE_CCK:
- case MODE_OFDM:
- Value = TxPwr[1];
- TxPwrRef = (Value & 0x00000f00) >> 8;
-
- break;
-
-#ifdef DOT11_N_SUPPORT
- case MODE_HTMIX:
- case MODE_HTGREENFIELD:
- if (pAd->CommonCfg.TxStream == 1)
- {
- Value = TxPwr[2];
- TxPwrRef = (Value & 0x00000f00) >> 8;
- }
- else if (pAd->CommonCfg.TxStream == 2)
- {
- Value = TxPwr[3];
- TxPwrRef = (Value & 0x00000f00) >> 8;
- }
- break;
-#endif // DOT11_N_SUPPORT //
- }
-
- PhyMode =
-#ifdef DOT11_N_SUPPORT
- (HTTxMode.field.MODE == MODE_HTGREENFIELD)
- ? MODE_HTMIX :
-#endif // DOT11_N_SUPPORT //
- HTTxMode.field.MODE;
-
- for (Idx = 0; Idx < MAX_TXPWR_TAB_SIZE; Idx++)
- {
- if ((TxPwrCfg[Idx].Mode == PhyMode)
- && (TxPwrCfg[Idx].MCS == HTTxMode.field.MCS))
- {
- Value = TxPwr[TxPwrCfg[Idx].req];
- DaltaPwr = TxPwrRef - (CHAR)((Value & TxPwrCfg[Idx].BitMask)
- >> TxPwrCfg[Idx].shift);
- CurTxPwr -= DaltaPwr;
- break;
- }
- }
-
- return CurTxPwr;
-}
-
-
-VOID MeasureReqTabInit(
- IN PRTMP_ADAPTER pAd)
-{
- NdisAllocateSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
-
- pAd->CommonCfg.pMeasureReqTab = kmalloc(sizeof(MEASURE_REQ_TAB), GFP_ATOMIC);
- if (pAd->CommonCfg.pMeasureReqTab)
- NdisZeroMemory(pAd->CommonCfg.pMeasureReqTab, sizeof(MEASURE_REQ_TAB));
- else
- DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pMeasureReqTab.\n", __FUNCTION__));
-
- return;
-}
-
-VOID MeasureReqTabExit(
- IN PRTMP_ADAPTER pAd)
-{
- NdisFreeSpinLock(&pAd->CommonCfg.MeasureReqTabLock);
-
- if (pAd->CommonCfg.pMeasureReqTab)
- kfree(pAd->CommonCfg.pMeasureReqTab);
- pAd->CommonCfg.pMeasureReqTab = NULL;
-
- return;
-}
-
-PMEASURE_REQ_ENTRY MeasureReqLookUp(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- UINT HashIdx;
- PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
- PMEASURE_REQ_ENTRY pEntry = NULL;
- PMEASURE_REQ_ENTRY pPrevEntry = NULL;
-
- if (pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__));
- return NULL;
- }
-
- RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock);
-
- HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(DialogToken);
- pEntry = pTab->Hash[HashIdx];
-
- while (pEntry)
- {
- if (pEntry->DialogToken == DialogToken)
- break;
- else
- {
- pPrevEntry = pEntry;
- pEntry = pEntry->pNext;
- }
- }
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.MeasureReqTabLock);
-
- return pEntry;
-}
-
-PMEASURE_REQ_ENTRY MeasureReqInsert(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- INT i;
- ULONG HashIdx;
- PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
- PMEASURE_REQ_ENTRY pEntry = NULL, pCurrEntry;
- ULONG Now;
-
- if(pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__));
- return NULL;
- }
-
- pEntry = MeasureReqLookUp(pAd, DialogToken);
- if (pEntry == NULL)
- {
- RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock);
- for (i = 0; i < MAX_MEASURE_REQ_TAB_SIZE; i++)
- {
- NdisGetSystemUpTime(&Now);
- pEntry = &pTab->Content[i];
-
- if ((pEntry->Valid == TRUE)
- && RTMP_TIME_AFTER((unsigned long)Now, (unsigned long)(pEntry->lastTime + MQ_REQ_AGE_OUT)))
- {
- PMEASURE_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
- PMEASURE_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
-
- // update Hash list
- do
- {
- if (pProbeEntry == pEntry)
- {
- if (pPrevEntry == NULL)
- {
- pTab->Hash[HashIdx] = pEntry->pNext;
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- }
- break;
- }
-
- pPrevEntry = pProbeEntry;
- pProbeEntry = pProbeEntry->pNext;
- } while (pProbeEntry);
-
- NdisZeroMemory(pEntry, sizeof(MEASURE_REQ_ENTRY));
- pTab->Size--;
-
- break;
- }
-
- if (pEntry->Valid == FALSE)
- break;
- }
-
- if (i < MAX_MEASURE_REQ_TAB_SIZE)
- {
- NdisGetSystemUpTime(&Now);
- pEntry->lastTime = Now;
- pEntry->Valid = TRUE;
- pEntry->DialogToken = DialogToken;
- pTab->Size++;
- }
- else
- {
- pEntry = NULL;
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab tab full.\n", __FUNCTION__));
- }
-
- // add this Neighbor entry into HASH table
- if (pEntry)
- {
- HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(DialogToken);
- if (pTab->Hash[HashIdx] == NULL)
- {
- pTab->Hash[HashIdx] = pEntry;
- }
- else
- {
- pCurrEntry = pTab->Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- pCurrEntry = pCurrEntry->pNext;
- pCurrEntry->pNext = pEntry;
- }
- }
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.MeasureReqTabLock);
- }
-
- return pEntry;
-}
-
-VOID MeasureReqDelete(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- PMEASURE_REQ_TAB pTab = pAd->CommonCfg.pMeasureReqTab;
- PMEASURE_REQ_ENTRY pEntry = NULL;
-
- if(pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pMeasureReqTab doesn't exist.\n", __FUNCTION__));
- return;
- }
-
- // if empty, return
- if (pTab->Size == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("pMeasureReqTab empty.\n"));
- return;
- }
-
- pEntry = MeasureReqLookUp(pAd, DialogToken);
- if (pEntry != NULL)
- {
- PMEASURE_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx = MQ_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
- PMEASURE_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
-
- RTMP_SEM_LOCK(&pAd->CommonCfg.MeasureReqTabLock);
- // update Hash list
- do
- {
- if (pProbeEntry == pEntry)
- {
- if (pPrevEntry == NULL)
- {
- pTab->Hash[HashIdx] = pEntry->pNext;
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- }
- break;
- }
-
- pPrevEntry = pProbeEntry;
- pProbeEntry = pProbeEntry->pNext;
- } while (pProbeEntry);
-
- NdisZeroMemory(pEntry, sizeof(MEASURE_REQ_ENTRY));
- pTab->Size--;
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.MeasureReqTabLock);
- }
-
- return;
-}
-
-VOID TpcReqTabInit(
- IN PRTMP_ADAPTER pAd)
-{
- NdisAllocateSpinLock(&pAd->CommonCfg.TpcReqTabLock);
-
- pAd->CommonCfg.pTpcReqTab = kmalloc(sizeof(TPC_REQ_TAB), GFP_ATOMIC);
- if (pAd->CommonCfg.pTpcReqTab)
- NdisZeroMemory(pAd->CommonCfg.pTpcReqTab, sizeof(TPC_REQ_TAB));
- else
- DBGPRINT(RT_DEBUG_ERROR, ("%s Fail to alloc memory for pAd->CommonCfg.pTpcReqTab.\n", __FUNCTION__));
-
- return;
-}
-
-VOID TpcReqTabExit(
- IN PRTMP_ADAPTER pAd)
-{
- NdisFreeSpinLock(&pAd->CommonCfg.TpcReqTabLock);
-
- if (pAd->CommonCfg.pTpcReqTab)
- kfree(pAd->CommonCfg.pTpcReqTab);
- pAd->CommonCfg.pTpcReqTab = NULL;
-
- return;
-}
-
-static PTPC_REQ_ENTRY TpcReqLookUp(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- UINT HashIdx;
- PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
- PTPC_REQ_ENTRY pEntry = NULL;
- PTPC_REQ_ENTRY pPrevEntry = NULL;
-
- if (pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__));
- return NULL;
- }
-
- RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock);
-
- HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(DialogToken);
- pEntry = pTab->Hash[HashIdx];
-
- while (pEntry)
- {
- if (pEntry->DialogToken == DialogToken)
- break;
- else
- {
- pPrevEntry = pEntry;
- pEntry = pEntry->pNext;
- }
- }
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.TpcReqTabLock);
-
- return pEntry;
-}
-
-
-static PTPC_REQ_ENTRY TpcReqInsert(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- INT i;
- ULONG HashIdx;
- PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
- PTPC_REQ_ENTRY pEntry = NULL, pCurrEntry;
- ULONG Now;
-
- if(pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__));
- return NULL;
- }
-
- pEntry = TpcReqLookUp(pAd, DialogToken);
- if (pEntry == NULL)
- {
- RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock);
- for (i = 0; i < MAX_TPC_REQ_TAB_SIZE; i++)
- {
- NdisGetSystemUpTime(&Now);
- pEntry = &pTab->Content[i];
-
- if ((pEntry->Valid == TRUE)
- && RTMP_TIME_AFTER((unsigned long)Now, (unsigned long)(pEntry->lastTime + TPC_REQ_AGE_OUT)))
- {
- PTPC_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
- PTPC_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
-
- // update Hash list
- do
- {
- if (pProbeEntry == pEntry)
- {
- if (pPrevEntry == NULL)
- {
- pTab->Hash[HashIdx] = pEntry->pNext;
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- }
- break;
- }
-
- pPrevEntry = pProbeEntry;
- pProbeEntry = pProbeEntry->pNext;
- } while (pProbeEntry);
-
- NdisZeroMemory(pEntry, sizeof(TPC_REQ_ENTRY));
- pTab->Size--;
-
- break;
- }
-
- if (pEntry->Valid == FALSE)
- break;
- }
-
- if (i < MAX_TPC_REQ_TAB_SIZE)
- {
- NdisGetSystemUpTime(&Now);
- pEntry->lastTime = Now;
- pEntry->Valid = TRUE;
- pEntry->DialogToken = DialogToken;
- pTab->Size++;
- }
- else
- {
- pEntry = NULL;
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab tab full.\n", __FUNCTION__));
- }
-
- // add this Neighbor entry into HASH table
- if (pEntry)
- {
- HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(DialogToken);
- if (pTab->Hash[HashIdx] == NULL)
- {
- pTab->Hash[HashIdx] = pEntry;
- }
- else
- {
- pCurrEntry = pTab->Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- pCurrEntry = pCurrEntry->pNext;
- pCurrEntry->pNext = pEntry;
- }
- }
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.TpcReqTabLock);
- }
-
- return pEntry;
-}
-
-static VOID TpcReqDelete(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken)
-{
- PTPC_REQ_TAB pTab = pAd->CommonCfg.pTpcReqTab;
- PTPC_REQ_ENTRY pEntry = NULL;
-
- if(pTab == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: pTpcReqTab doesn't exist.\n", __FUNCTION__));
- return;
- }
-
- // if empty, return
- if (pTab->Size == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("pTpcReqTab empty.\n"));
- return;
- }
-
- pEntry = TpcReqLookUp(pAd, DialogToken);
- if (pEntry != NULL)
- {
- PTPC_REQ_ENTRY pPrevEntry = NULL;
- ULONG HashIdx = TPC_DIALOGTOKEN_HASH_INDEX(pEntry->DialogToken);
- PTPC_REQ_ENTRY pProbeEntry = pTab->Hash[HashIdx];
-
- RTMP_SEM_LOCK(&pAd->CommonCfg.TpcReqTabLock);
- // update Hash list
- do
- {
- if (pProbeEntry == pEntry)
- {
- if (pPrevEntry == NULL)
- {
- pTab->Hash[HashIdx] = pEntry->pNext;
- }
- else
- {
- pPrevEntry->pNext = pEntry->pNext;
- }
- break;
- }
-
- pPrevEntry = pProbeEntry;
- pProbeEntry = pProbeEntry->pNext;
- } while (pProbeEntry);
-
- NdisZeroMemory(pEntry, sizeof(TPC_REQ_ENTRY));
- pTab->Size--;
-
- RTMP_SEM_UNLOCK(&pAd->CommonCfg.TpcReqTabLock);
- }
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Get Current TimeS tamp.
-
- Parametrs:
-
- Return : Current Time Stamp.
- ==========================================================================
- */
-static UINT64 GetCurrentTimeStamp(
- IN PRTMP_ADAPTER pAd)
-{
- // get current time stamp.
- return 0;
-}
-
-/*
- ==========================================================================
- Description:
- Get Current Transmit Power.
-
- Parametrs:
-
- Return : Current Time Stamp.
- ==========================================================================
- */
-static UINT8 GetCurTxPwr(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 Wcid)
-{
- return 16; /* 16 dBm */
-}
-
-/*
- ==========================================================================
- Description:
- Get Current Transmit Power.
-
- Parametrs:
-
- Return : Current Time Stamp.
- ==========================================================================
- */
-VOID InsertChannelRepIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN PSTRING pCountry,
- IN UINT8 RegulatoryClass)
-{
- ULONG TempLen;
- UINT8 Len;
- UINT8 IEId = IE_AP_CHANNEL_REPORT;
- PUCHAR pChListPtr = NULL;
-
- Len = 1;
- if (strncmp(pCountry, "US", 2) == 0)
- {
- if (RegulatoryClass >= USA_REGULATORY_INFO_SIZE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: USA Unknow Requlatory class (%d)\n",
- __FUNCTION__, RegulatoryClass));
- return;
- }
-
- Len += USARegulatoryInfo[RegulatoryClass].ChannelSet.NumberOfChannels;
- pChListPtr = USARegulatoryInfo[RegulatoryClass].ChannelSet.ChannelList;
- }
- else if (strncmp(pCountry, "JP", 2) == 0)
- {
- if (RegulatoryClass >= JP_REGULATORY_INFO_SIZE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: JP Unknow Requlatory class (%d)\n",
- __FUNCTION__, RegulatoryClass));
- return;
- }
-
- Len += JapanRegulatoryInfo[RegulatoryClass].ChannelSet.NumberOfChannels;
- pChListPtr = JapanRegulatoryInfo[RegulatoryClass].ChannelSet.ChannelList;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: Unknow Country (%s)\n",
- __FUNCTION__, pCountry));
- return;
- }
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &IEId,
- 1, &Len,
- 1, &RegulatoryClass,
- Len -1, pChListPtr,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert Dialog Token into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. Dialog token.
-
- Return : None.
- ==========================================================================
- */
-VOID InsertDialogToken(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 DialogToken)
-{
- ULONG TempLen;
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &DialogToken,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert TPC Request IE into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
-
- Return : None.
- ==========================================================================
- */
- static VOID InsertTpcReqIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen)
-{
- ULONG TempLen;
- ULONG Len = 0;
- UINT8 ElementID = IE_TPC_REQUEST;
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &ElementID,
- 1, &Len,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert TPC Report IE into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. Transmit Power.
- 4. Link Margin.
-
- Return : None.
- ==========================================================================
- */
-VOID InsertTpcReportIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 TxPwr,
- IN UINT8 LinkMargin)
-{
- ULONG TempLen;
- ULONG Len = sizeof(TPC_REPORT_INFO);
- UINT8 ElementID = IE_TPC_REPORT;
- TPC_REPORT_INFO TpcReportIE;
-
- TpcReportIE.TxPwr = TxPwr;
- TpcReportIE.LinkMargin = LinkMargin;
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &ElementID,
- 1, &Len,
- Len, &TpcReportIE,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert Channel Switch Announcement IE into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. channel switch announcement mode.
- 4. new selected channel.
- 5. channel switch announcement count.
-
- Return : None.
- ==========================================================================
- */
-static VOID InsertChSwAnnIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 ChSwMode,
- IN UINT8 NewChannel,
- IN UINT8 ChSwCnt)
-{
- ULONG TempLen;
- ULONG Len = sizeof(CH_SW_ANN_INFO);
- UINT8 ElementID = IE_CHANNEL_SWITCH_ANNOUNCEMENT;
- CH_SW_ANN_INFO ChSwAnnIE;
-
- ChSwAnnIE.ChSwMode = ChSwMode;
- ChSwAnnIE.Channel = NewChannel;
- ChSwAnnIE.ChSwCnt = ChSwCnt;
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &ElementID,
- 1, &Len,
- Len, &ChSwAnnIE,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert Measure Request IE into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. Measure Token.
- 4. Measure Request Mode.
- 5. Measure Request Type.
- 6. Measure Channel.
- 7. Measure Start time.
- 8. Measure Duration.
-
-
- Return : None.
- ==========================================================================
- */
-static VOID InsertMeasureReqIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 Len,
- IN PMEASURE_REQ_INFO pMeasureReqIE)
-{
- ULONG TempLen;
- UINT8 ElementID = IE_MEASUREMENT_REQUEST;
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &ElementID,
- 1, &Len,
- sizeof(MEASURE_REQ_INFO), pMeasureReqIE,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Insert Measure Report IE into frame.
-
- Parametrs:
- 1. frame buffer pointer.
- 2. frame length.
- 3. Measure Token.
- 4. Measure Request Mode.
- 5. Measure Request Type.
- 6. Length of Report Infomation
- 7. Pointer of Report Infomation Buffer.
-
- Return : None.
- ==========================================================================
- */
-static VOID InsertMeasureReportIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN PMEASURE_REPORT_INFO pMeasureReportIE,
- IN UINT8 ReportLnfoLen,
- IN PUINT8 pReportInfo)
-{
- ULONG TempLen;
- ULONG Len;
- UINT8 ElementID = IE_MEASUREMENT_REPORT;
-
- Len = sizeof(MEASURE_REPORT_INFO) + ReportLnfoLen;
-
- MakeOutgoingFrame(pFrameBuf, &TempLen,
- 1, &ElementID,
- 1, &Len,
- Len, pMeasureReportIE,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
-
- if ((ReportLnfoLen > 0) && (pReportInfo != NULL))
- {
- MakeOutgoingFrame(pFrameBuf + *pFrameLen, &TempLen,
- ReportLnfoLen, pReportInfo,
- END_OF_ARGS);
-
- *pFrameLen = *pFrameLen + TempLen;
- }
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Prepare Measurement request action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID MakeMeasurementReqFrame(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pOutBuffer,
- OUT PULONG pFrameLen,
- IN UINT8 TotalLen,
- IN UINT8 Category,
- IN UINT8 Action,
- IN UINT8 MeasureToken,
- IN UINT8 MeasureReqMode,
- IN UINT8 MeasureReqType,
- IN UINT8 NumOfRepetitions)
-{
- ULONG TempLen;
- MEASURE_REQ_INFO MeasureReqIE;
-
- InsertActField(pAd, (pOutBuffer + *pFrameLen), pFrameLen, Category, Action);
-
- // fill Dialog Token
- InsertDialogToken(pAd, (pOutBuffer + *pFrameLen), pFrameLen, MeasureToken);
-
- /* fill Number of repetitions. */
- if (Category == CATEGORY_RM)
- {
- MakeOutgoingFrame((pOutBuffer+*pFrameLen), &TempLen,
- 2, &NumOfRepetitions,
- END_OF_ARGS);
-
- *pFrameLen += TempLen;
- }
-
- // prepare Measurement IE.
- NdisZeroMemory(&MeasureReqIE, sizeof(MEASURE_REQ_INFO));
- MeasureReqIE.Token = MeasureToken;
- MeasureReqIE.ReqMode.word = MeasureReqMode;
- MeasureReqIE.ReqType = MeasureReqType;
- InsertMeasureReqIE(pAd, (pOutBuffer+*pFrameLen), pFrameLen,
- TotalLen, &MeasureReqIE);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Prepare Measurement report action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueMeasurementRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 DialogToken,
- IN UINT8 MeasureToken,
- IN UINT8 MeasureReqMode,
- IN UINT8 MeasureReqType,
- IN UINT8 ReportInfoLen,
- IN PUINT8 pReportInfo)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
- HEADER_802_11 ActHdr;
- MEASURE_REPORT_INFO MeasureRepIE;
-
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
- pAd->CurrentAddress);
-
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__));
- return;
- }
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
-
- InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, CATEGORY_SPECTRUM, SPEC_MRP);
-
- // fill Dialog Token
- InsertDialogToken(pAd, (pOutBuffer + FrameLen), &FrameLen, DialogToken);
-
- // prepare Measurement IE.
- NdisZeroMemory(&MeasureRepIE, sizeof(MEASURE_REPORT_INFO));
- MeasureRepIE.Token = MeasureToken;
- MeasureRepIE.ReportMode = MeasureReqMode;
- MeasureRepIE.ReportType = MeasureReqType;
- InsertMeasureReportIE(pAd, (pOutBuffer + FrameLen), &FrameLen, &MeasureRepIE, ReportInfoLen, pReportInfo);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Prepare TPC Request action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueTPCReq(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UCHAR DialogToken)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
-
- HEADER_802_11 ActHdr;
-
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
- pAd->CurrentAddress);
-
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__));
- return;
- }
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
-
- InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, CATEGORY_SPECTRUM, SPEC_TPCRQ);
-
- // fill Dialog Token
- InsertDialogToken(pAd, (pOutBuffer + FrameLen), &FrameLen, DialogToken);
-
- // Insert TPC Request IE.
- InsertTpcReqIE(pAd, (pOutBuffer + FrameLen), &FrameLen);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Prepare TPC Report action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueTPCRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 DialogToken,
- IN UINT8 TxPwr,
- IN UINT8 LinkMargin)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
-
- HEADER_802_11 ActHdr;
-
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
- pAd->CurrentAddress);
-
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__));
- return;
- }
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
-
- InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, CATEGORY_SPECTRUM, SPEC_TPCRP);
-
- // fill Dialog Token
- InsertDialogToken(pAd, (pOutBuffer + FrameLen), &FrameLen, DialogToken);
-
- // Insert TPC Request IE.
- InsertTpcReportIE(pAd, (pOutBuffer + FrameLen), &FrameLen, TxPwr, LinkMargin);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Prepare Channel Switch Announcement action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
- 2. Channel switch announcement mode.
- 2. a New selected channel.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueChSwAnn(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 ChSwMode,
- IN UINT8 NewCh)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
-
- HEADER_802_11 ActHdr;
-
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pDA,
- pAd->CurrentAddress);
-
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__));
- return;
- }
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
-
- InsertActField(pAd, (pOutBuffer + FrameLen), &FrameLen, CATEGORY_SPECTRUM, SPEC_CHANNEL_SWITCH);
-
- InsertChSwAnnIE(pAd, (pOutBuffer + FrameLen), &FrameLen, ChSwMode, NewCh, 0);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- return;
-}
-
-static BOOLEAN DfsRequirementCheck(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 Channel)
-{
- BOOLEAN Result = FALSE;
- INT i;
-
- do
- {
- // check DFS procedure is running.
- // make sure DFS procedure won't start twice.
- if (pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
- {
- Result = FALSE;
- break;
- }
-
- // check the new channel carried from Channel Switch Announcemnet is valid.
- for (i=0; i<pAd->ChannelListNum; i++)
- {
- if ((Channel == pAd->ChannelList[i].Channel)
- &&(pAd->ChannelList[i].RemainingTimeForUse == 0))
- {
- // found radar signal in the channel. the channel can't use at least for 30 minutes.
- pAd->ChannelList[i].RemainingTimeForUse = 1800;//30 min = 1800 sec
- Result = TRUE;
- break;
- }
- }
- } while(FALSE);
-
- return Result;
-}
-
-VOID NotifyChSwAnnToPeerAPs(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pRA,
- IN PUCHAR pTA,
- IN UINT8 ChSwMode,
- IN UINT8 Channel)
-{
-#ifdef WDS_SUPPORT
- if (!((pRA[0] & 0xff) == 0xff)) // is pRA a broadcase address.
- {
- INT i;
- // info neighbor APs that Radar signal found throgh WDS link.
- for (i = 0; i < MAX_WDS_ENTRY; i++)
- {
- if (ValidWdsEntry(pAd, i))
- {
- PUCHAR pDA = pAd->WdsTab.WdsEntry[i].PeerWdsAddr;
-
- // DA equal to SA. have no necessary orignal AP which found Radar signal.
- if (MAC_ADDR_EQUAL(pTA, pDA))
- continue;
-
- // send Channel Switch Action frame to info Neighbro APs.
- EnqueueChSwAnn(pAd, pDA, ChSwMode, Channel);
- }
- }
- }
-#endif // WDS_SUPPORT //
-}
-
-static VOID StartDFSProcedure(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel,
- IN UINT8 ChSwMode)
-{
- // start DFS procedure
- pAd->CommonCfg.Channel = Channel;
-#ifdef DOT11_N_SUPPORT
- N_ChannelCheck(pAd);
-#endif // DOT11_N_SUPPORT //
- pAd->CommonCfg.RadarDetect.RDMode = RD_SWITCHING_MODE;
- pAd->CommonCfg.RadarDetect.CSCount = 0;
-}
-
-/*
- ==========================================================================
- Description:
- Channel Switch Announcement action frame sanity check.
-
- Parametrs:
- 1. MLME message containing the received frame
- 2. message length.
- 3. Channel switch announcement infomation buffer.
-
-
- Return : None.
- ==========================================================================
- */
-
-/*
- Channel Switch Announcement IE.
- +----+-----+-----------+------------+-----------+
- | ID | Len |Ch Sw Mode | New Ch Num | Ch Sw Cnt |
- +----+-----+-----------+------------+-----------+
- 1 1 1 1 1
-*/
-static BOOLEAN PeerChSwAnnSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PCH_SW_ANN_INFO pChSwAnnInfo)
-{
- PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
- PUCHAR pFramePtr = Fr->Octet;
- BOOLEAN result = FALSE;
- PEID_STRUCT eid_ptr;
-
- // skip 802.11 header.
- MsgLen -= sizeof(HEADER_802_11);
-
- // skip category and action code.
- pFramePtr += 2;
- MsgLen -= 2;
-
- if (pChSwAnnInfo == NULL)
- return result;
-
- eid_ptr = (PEID_STRUCT)pFramePtr;
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((PUCHAR)pFramePtr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_CHANNEL_SWITCH_ANNOUNCEMENT:
- NdisMoveMemory(&pChSwAnnInfo->ChSwMode, eid_ptr->Octet, 1);
- NdisMoveMemory(&pChSwAnnInfo->Channel, eid_ptr->Octet + 1, 1);
- NdisMoveMemory(&pChSwAnnInfo->ChSwCnt, eid_ptr->Octet + 2, 1);
-
- result = TRUE;
- break;
-
- default:
- break;
- }
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return result;
-}
-
-/*
- ==========================================================================
- Description:
- Measurement request action frame sanity check.
-
- Parametrs:
- 1. MLME message containing the received frame
- 2. message length.
- 3. Measurement request infomation buffer.
-
- Return : None.
- ==========================================================================
- */
-static BOOLEAN PeerMeasureReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUINT8 pDialogToken,
- OUT PMEASURE_REQ_INFO pMeasureReqInfo,
- OUT PMEASURE_REQ pMeasureReq)
-{
- PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
- PUCHAR pFramePtr = Fr->Octet;
- BOOLEAN result = FALSE;
- PEID_STRUCT eid_ptr;
- PUCHAR ptr;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
-
- // skip 802.11 header.
- MsgLen -= sizeof(HEADER_802_11);
-
- // skip category and action code.
- pFramePtr += 2;
- MsgLen -= 2;
-
- if (pMeasureReqInfo == NULL)
- return result;
-
- NdisMoveMemory(pDialogToken, pFramePtr, 1);
- pFramePtr += 1;
- MsgLen -= 1;
-
- eid_ptr = (PEID_STRUCT)pFramePtr;
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((PUCHAR)pFramePtr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_MEASUREMENT_REQUEST:
- NdisMoveMemory(&pMeasureReqInfo->Token, eid_ptr->Octet, 1);
- NdisMoveMemory(&pMeasureReqInfo->ReqMode.word, eid_ptr->Octet + 1, 1);
- NdisMoveMemory(&pMeasureReqInfo->ReqType, eid_ptr->Octet + 2, 1);
- ptr = (PUCHAR)(eid_ptr->Octet + 3);
- NdisMoveMemory(&pMeasureReq->ChNum, ptr, 1);
- NdisMoveMemory(&MeasureStartTime, ptr + 1, 8);
- pMeasureReq->MeasureStartTime = SWAP64(MeasureStartTime);
- NdisMoveMemory(&MeasureDuration, ptr + 9, 2);
- pMeasureReq->MeasureDuration = SWAP16(MeasureDuration);
-
- result = TRUE;
- break;
-
- default:
- break;
- }
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return result;
-}
-
-/*
- ==========================================================================
- Description:
- Measurement report action frame sanity check.
-
- Parametrs:
- 1. MLME message containing the received frame
- 2. message length.
- 3. Measurement report infomation buffer.
- 4. basic report infomation buffer.
-
- Return : None.
- ==========================================================================
- */
-
-/*
- Measurement Report IE.
- +----+-----+-------+-------------+--------------+----------------+
- | ID | Len | Token | Report Mode | Measure Type | Measure Report |
- +----+-----+-------+-------------+--------------+----------------+
- 1 1 1 1 1 variable
-
- Basic Report.
- +--------+------------+----------+-----+
- | Ch Num | Start Time | Duration | Map |
- +--------+------------+----------+-----+
- 1 8 2 1
-
- Map Field Bit Format.
- +-----+---------------+---------------------+-------+------------+----------+
- | Bss | OFDM Preamble | Unidentified signal | Radar | Unmeasured | Reserved |
- +-----+---------------+---------------------+-------+------------+----------+
- 0 1 2 3 4 5-7
-*/
-static BOOLEAN PeerMeasureReportSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUINT8 pDialogToken,
- OUT PMEASURE_REPORT_INFO pMeasureReportInfo,
- OUT PUINT8 pReportBuf)
-{
- PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
- PUCHAR pFramePtr = Fr->Octet;
- BOOLEAN result = FALSE;
- PEID_STRUCT eid_ptr;
- PUCHAR ptr;
-
- // skip 802.11 header.
- MsgLen -= sizeof(HEADER_802_11);
-
- // skip category and action code.
- pFramePtr += 2;
- MsgLen -= 2;
-
- if (pMeasureReportInfo == NULL)
- return result;
-
- NdisMoveMemory(pDialogToken, pFramePtr, 1);
- pFramePtr += 1;
- MsgLen -= 1;
-
- eid_ptr = (PEID_STRUCT)pFramePtr;
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((PUCHAR)pFramePtr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_MEASUREMENT_REPORT:
- NdisMoveMemory(&pMeasureReportInfo->Token, eid_ptr->Octet, 1);
- NdisMoveMemory(&pMeasureReportInfo->ReportMode, eid_ptr->Octet + 1, 1);
- NdisMoveMemory(&pMeasureReportInfo->ReportType, eid_ptr->Octet + 2, 1);
- if (pMeasureReportInfo->ReportType == RM_BASIC)
- {
- PMEASURE_BASIC_REPORT pReport = (PMEASURE_BASIC_REPORT)pReportBuf;
- ptr = (PUCHAR)(eid_ptr->Octet + 3);
- NdisMoveMemory(&pReport->ChNum, ptr, 1);
- NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
- NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
- NdisMoveMemory(&pReport->Map, ptr + 11, 1);
-
- }
- else if (pMeasureReportInfo->ReportType == RM_CCA)
- {
- PMEASURE_CCA_REPORT pReport = (PMEASURE_CCA_REPORT)pReportBuf;
- ptr = (PUCHAR)(eid_ptr->Octet + 3);
- NdisMoveMemory(&pReport->ChNum, ptr, 1);
- NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
- NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
- NdisMoveMemory(&pReport->CCA_Busy_Fraction, ptr + 11, 1);
-
- }
- else if (pMeasureReportInfo->ReportType == RM_RPI_HISTOGRAM)
- {
- PMEASURE_RPI_REPORT pReport = (PMEASURE_RPI_REPORT)pReportBuf;
- ptr = (PUCHAR)(eid_ptr->Octet + 3);
- NdisMoveMemory(&pReport->ChNum, ptr, 1);
- NdisMoveMemory(&pReport->MeasureStartTime, ptr + 1, 8);
- NdisMoveMemory(&pReport->MeasureDuration, ptr + 9, 2);
- NdisMoveMemory(&pReport->RPI_Density, ptr + 11, 8);
- }
- result = TRUE;
- break;
-
- default:
- break;
- }
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return result;
-}
-
-/*
- ==========================================================================
- Description:
- TPC Request action frame sanity check.
-
- Parametrs:
- 1. MLME message containing the received frame
- 2. message length.
- 3. Dialog Token.
-
- Return : None.
- ==========================================================================
- */
-static BOOLEAN PeerTpcReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUINT8 pDialogToken)
-{
- PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
- PUCHAR pFramePtr = Fr->Octet;
- BOOLEAN result = FALSE;
- PEID_STRUCT eid_ptr;
-
- MsgLen -= sizeof(HEADER_802_11);
-
- // skip category and action code.
- pFramePtr += 2;
- MsgLen -= 2;
-
- if (pDialogToken == NULL)
- return result;
-
- NdisMoveMemory(pDialogToken, pFramePtr, 1);
- pFramePtr += 1;
- MsgLen -= 1;
-
- eid_ptr = (PEID_STRUCT)pFramePtr;
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((PUCHAR)pFramePtr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_TPC_REQUEST:
- result = TRUE;
- break;
-
- default:
- break;
- }
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return result;
-}
-
-/*
- ==========================================================================
- Description:
- TPC Report action frame sanity check.
-
- Parametrs:
- 1. MLME message containing the received frame
- 2. message length.
- 3. Dialog Token.
- 4. TPC Report IE.
-
- Return : None.
- ==========================================================================
- */
-static BOOLEAN PeerTpcRepSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUINT8 pDialogToken,
- OUT PTPC_REPORT_INFO pTpcRepInfo)
-{
- PFRAME_802_11 Fr = (PFRAME_802_11)pMsg;
- PUCHAR pFramePtr = Fr->Octet;
- BOOLEAN result = FALSE;
- PEID_STRUCT eid_ptr;
-
- MsgLen -= sizeof(HEADER_802_11);
-
- // skip category and action code.
- pFramePtr += 2;
- MsgLen -= 2;
-
- if (pDialogToken == NULL)
- return result;
-
- NdisMoveMemory(pDialogToken, pFramePtr, 1);
- pFramePtr += 1;
- MsgLen -= 1;
-
- eid_ptr = (PEID_STRUCT)pFramePtr;
- while (((UCHAR*)eid_ptr + eid_ptr->Len + 1) < ((PUCHAR)pFramePtr + MsgLen))
- {
- switch(eid_ptr->Eid)
- {
- case IE_TPC_REPORT:
- NdisMoveMemory(&pTpcRepInfo->TxPwr, eid_ptr->Octet, 1);
- NdisMoveMemory(&pTpcRepInfo->LinkMargin, eid_ptr->Octet + 1, 1);
- result = TRUE;
- break;
-
- default:
- break;
- }
- eid_ptr = (PEID_STRUCT)((UCHAR*)eid_ptr + 2 + eid_ptr->Len);
- }
-
- return result;
-}
-
-/*
- ==========================================================================
- Description:
- Channel Switch Announcement action frame handler.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-static VOID PeerChSwAnnAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- CH_SW_ANN_INFO ChSwAnnInfo;
- PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
-#ifdef CONFIG_STA_SUPPORT
- UCHAR index = 0, Channel = 0, NewChannel = 0;
- ULONG Bssidx = 0;
-#endif // CONFIG_STA_SUPPORT //
-
- NdisZeroMemory(&ChSwAnnInfo, sizeof(CH_SW_ANN_INFO));
- if (! PeerChSwAnnSanity(pAd, Elem->Msg, Elem->MsgLen, &ChSwAnnInfo))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Invalid Channel Switch Action Frame.\n"));
- return;
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- {
- Bssidx = BssTableSearch(&pAd->ScanTab, pFr->Hdr.Addr3, pAd->CommonCfg.Channel);
- if (Bssidx == BSS_NOT_FOUND)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerChSwAnnAction - Bssidx is not found\n"));
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("\n****Bssidx is %d, Channel = %d\n", index, pAd->ScanTab.BssEntry[Bssidx].Channel));
- hex_dump("SSID",pAd->ScanTab.BssEntry[Bssidx].Bssid ,6);
-
- Channel = pAd->CommonCfg.Channel;
- NewChannel = ChSwAnnInfo.Channel;
-
- if ((pAd->CommonCfg.bIEEE80211H == 1) && (NewChannel != 0) && (Channel != NewChannel))
- {
- // Switching to channel 1 can prevent from rescanning the current channel immediately (by auto reconnection).
- // In addition, clear the MLME queue and the scan table to discard the RX packets and previous scanning results.
- AsicSwitchChannel(pAd, 1, FALSE);
- AsicLockChannel(pAd, 1);
- LinkDown(pAd, FALSE);
- MlmeQueueInit(&pAd->Mlme.Queue);
- BssTableInit(&pAd->ScanTab);
- RTMPusecDelay(1000000); // use delay to prevent STA do reassoc
-
- // channel sanity check
- for (index = 0 ; index < pAd->ChannelListNum; index++)
- {
- if (pAd->ChannelList[index].Channel == NewChannel)
- {
- pAd->ScanTab.BssEntry[Bssidx].Channel = NewChannel;
- pAd->CommonCfg.Channel = NewChannel;
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("&&&&&&&&&&&&&&&&PeerChSwAnnAction - STA receive channel switch announcement IE (New Channel =%d)\n", NewChannel));
- break;
- }
- }
-
- if (index >= pAd->ChannelListNum)
- {
- DBGPRINT_ERR(("&&&&&&&&&&&&&&&&&&&&&&&&&&PeerChSwAnnAction(can not find New Channel=%d in ChannelList[%d]\n", pAd->CommonCfg.Channel, pAd->ChannelListNum));
- }
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- return;
-}
-
-
-/*
- ==========================================================================
- Description:
- Measurement Request action frame handler.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-static VOID PeerMeasureReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
- UINT8 DialogToken;
- MEASURE_REQ_INFO MeasureReqInfo;
- MEASURE_REQ MeasureReq;
- MEASURE_REPORT_MODE ReportMode;
-
- if(PeerMeasureReqSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken, &MeasureReqInfo, &MeasureReq))
- {
- ReportMode.word = 0;
- ReportMode.field.Incapable = 1;
- EnqueueMeasurementRep(pAd, pFr->Hdr.Addr2, DialogToken, MeasureReqInfo.Token, ReportMode.word, MeasureReqInfo.ReqType, 0, NULL);
- }
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Measurement Report action frame handler.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-static VOID PeerMeasureReportAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MEASURE_REPORT_INFO MeasureReportInfo;
- PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
- UINT8 DialogToken;
- PUINT8 pMeasureReportInfo;
-
-// if (pAd->CommonCfg.bIEEE80211H != TRUE)
-// return;
-
- if ((pMeasureReportInfo = kmalloc(sizeof(MEASURE_RPI_REPORT), GFP_ATOMIC)) == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s unable to alloc memory for measure report buffer (size=%d).\n", __FUNCTION__, sizeof(MEASURE_RPI_REPORT)));
- return;
- }
-
- NdisZeroMemory(&MeasureReportInfo, sizeof(MEASURE_REPORT_INFO));
- NdisZeroMemory(pMeasureReportInfo, sizeof(MEASURE_RPI_REPORT));
- if (PeerMeasureReportSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken, &MeasureReportInfo, pMeasureReportInfo))
- {
- do {
- PMEASURE_REQ_ENTRY pEntry = NULL;
-
- // Not a autonomous measure report.
- // check the dialog token field. drop it if the dialog token doesn't match.
- if ((DialogToken != 0)
- && ((pEntry = MeasureReqLookUp(pAd, DialogToken)) == NULL))
- break;
-
- if (pEntry != NULL)
- MeasureReqDelete(pAd, pEntry->DialogToken);
-
- if (MeasureReportInfo.ReportType == RM_BASIC)
- {
- PMEASURE_BASIC_REPORT pBasicReport = (PMEASURE_BASIC_REPORT)pMeasureReportInfo;
- if ((pBasicReport->Map.field.Radar)
- && (DfsRequirementCheck(pAd, pBasicReport->ChNum) == TRUE))
- {
- NotifyChSwAnnToPeerAPs(pAd, pFr->Hdr.Addr1, pFr->Hdr.Addr2, 1, pBasicReport->ChNum);
- StartDFSProcedure(pAd, pBasicReport->ChNum, 1);
- }
- }
- } while (FALSE);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("Invalid Measurement Report Frame.\n"));
-
- kfree(pMeasureReportInfo);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- TPC Request action frame handler.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-static VOID PeerTpcReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PFRAME_802_11 pFr = (PFRAME_802_11)Elem->Msg;
- PUCHAR pFramePtr = pFr->Octet;
- UINT8 DialogToken;
- UINT8 TxPwr = GetCurTxPwr(pAd, Elem->Wcid);
- UINT8 LinkMargin = 0;
- CHAR RealRssi;
-
- // link margin: Ratio of the received signal power to the minimum desired by the station (STA). The
- // STA may incorporate rate information and channel conditions, including interference, into its computation
- // of link margin.
-
- RealRssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0),
- ConvertToRssi(pAd, Elem->Rssi1, RSSI_1),
- ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
-
- // skip Category and action code.
- pFramePtr += 2;
-
- // Dialog token.
- NdisMoveMemory(&DialogToken, pFramePtr, 1);
-
- LinkMargin = (RealRssi / MIN_RCV_PWR);
- if (PeerTpcReqSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken))
- EnqueueTPCRep(pAd, pFr->Hdr.Addr2, DialogToken, TxPwr, LinkMargin);
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- TPC Report action frame handler.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-static VOID PeerTpcRepAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UINT8 DialogToken;
- TPC_REPORT_INFO TpcRepInfo;
- PTPC_REQ_ENTRY pEntry = NULL;
-
- NdisZeroMemory(&TpcRepInfo, sizeof(TPC_REPORT_INFO));
- if (PeerTpcRepSanity(pAd, Elem->Msg, Elem->MsgLen, &DialogToken, &TpcRepInfo))
- {
- if ((pEntry = TpcReqLookUp(pAd, DialogToken)) != NULL)
- {
- TpcReqDelete(pAd, pEntry->DialogToken);
- DBGPRINT(RT_DEBUG_TRACE, ("%s: DialogToken=%x, TxPwr=%d, LinkMargin=%d\n",
- __FUNCTION__, DialogToken, TpcRepInfo.TxPwr, TpcRepInfo.LinkMargin));
- }
- }
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
- Spectrun action frames Handler such as channel switch annoucement,
- measurement report, measurement request actions frames.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-VOID PeerSpectrumAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
-
- UCHAR Action = Elem->Msg[LENGTH_802_11+1];
-
- if (pAd->CommonCfg.bIEEE80211H != TRUE)
- return;
-
- switch(Action)
- {
- case SPEC_MRQ:
- // current rt2860 unable do such measure specified in Measurement Request.
- // reject all measurement request.
- PeerMeasureReqAction(pAd, Elem);
- break;
-
- case SPEC_MRP:
- PeerMeasureReportAction(pAd, Elem);
- break;
-
- case SPEC_TPCRQ:
- PeerTpcReqAction(pAd, Elem);
- break;
-
- case SPEC_TPCRP:
- PeerTpcRepAction(pAd, Elem);
- break;
-
- case SPEC_CHANNEL_SWITCH:
-
-#ifdef DOT11N_DRAFT3
- {
- SEC_CHA_OFFSET_IE Secondary;
- CHA_SWITCH_ANNOUNCE_IE ChannelSwitch;
-
- // 802.11h only has Channel Switch Announcement IE.
- RTMPMoveMemory(&ChannelSwitch, &Elem->Msg[LENGTH_802_11+4], sizeof (CHA_SWITCH_ANNOUNCE_IE));
-
- // 802.11n D3.03 adds secondary channel offset element in the end.
- if (Elem->MsgLen == (LENGTH_802_11 + 2 + sizeof (CHA_SWITCH_ANNOUNCE_IE) + sizeof (SEC_CHA_OFFSET_IE)))
- {
- RTMPMoveMemory(&Secondary, &Elem->Msg[LENGTH_802_11+9], sizeof (SEC_CHA_OFFSET_IE));
- }
- else
- {
- Secondary.SecondaryChannelOffset = 0;
- }
-
- if ((Elem->Msg[LENGTH_802_11+2] == IE_CHANNEL_SWITCH_ANNOUNCEMENT) && (Elem->Msg[LENGTH_802_11+3] == 3))
- {
- ChannelSwitchAction(pAd, Elem->Wcid, ChannelSwitch.NewChannel, Secondary.SecondaryChannelOffset);
- }
- }
-#endif // DOT11N_DRAFT3 //
-
- PeerChSwAnnAction(pAd, Elem);
- break;
- }
-
- return;
-}
-
-/*
- ==========================================================================
- Description:
-
- Parametrs:
-
- Return : None.
- ==========================================================================
- */
-INT Set_MeasureReq_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT Aid = 1;
- UINT ArgIdx;
- PSTRING thisChar;
-
- MEASURE_REQ_MODE MeasureReqMode;
- UINT8 MeasureReqToken = RandomByte(pAd);
- UINT8 MeasureReqType = RM_BASIC;
- UINT8 MeasureCh = 1;
- UINT64 MeasureStartTime = GetCurrentTimeStamp(pAd);
- MEASURE_REQ MeasureReq;
- UINT8 TotalLen;
-
- HEADER_802_11 ActHdr;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen;
-
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s() allocate memory failed \n", __FUNCTION__));
- goto END_OF_MEASURE_REQ;
- }
-
- ArgIdx = 1;
- while ((thisChar = strsep((char **)&arg, "-")) != NULL)
- {
- switch(ArgIdx)
- {
- case 1: // Aid.
- Aid = (UINT8) simple_strtol(thisChar, 0, 16);
- break;
-
- case 2: // Measurement Request Type.
- MeasureReqType = simple_strtol(thisChar, 0, 16);
- if (MeasureReqType > 3)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow MeasureReqType(%d)\n", __FUNCTION__, MeasureReqType));
- goto END_OF_MEASURE_REQ;
- }
- break;
-
- case 3: // Measurement channel.
- MeasureCh = (UINT8) simple_strtol(thisChar, 0, 16);
- break;
- }
- ArgIdx++;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d, MeasureReqType=%d MeasureCh=%d\n", __FUNCTION__, Aid, MeasureReqType, MeasureCh));
- if (!VALID_WCID(Aid))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __FUNCTION__, Aid));
- goto END_OF_MEASURE_REQ;
- }
-
- MeasureReqMode.word = 0;
- MeasureReqMode.field.Enable = 1;
-
- MeasureReqInsert(pAd, MeasureReqToken);
-
- // build action frame header.
- MgtMacHeaderInit(pAd, &ActHdr, SUBTYPE_ACTION, 0, pAd->MacTab.Content[Aid].Addr,
- pAd->CurrentAddress);
-
- NdisMoveMemory(pOutBuffer, (PCHAR)&ActHdr, sizeof(HEADER_802_11));
- FrameLen = sizeof(HEADER_802_11);
-
- TotalLen = sizeof(MEASURE_REQ_INFO) + sizeof(MEASURE_REQ);
-
- MakeMeasurementReqFrame(pAd, pOutBuffer, &FrameLen,
- sizeof(MEASURE_REQ_INFO), CATEGORY_RM, RM_BASIC,
- MeasureReqToken, MeasureReqMode.word,
- MeasureReqType, 0);
-
- MeasureReq.ChNum = MeasureCh;
- MeasureReq.MeasureStartTime = cpu2le64(MeasureStartTime);
- MeasureReq.MeasureDuration = cpu2le16(2000);
-
- {
- ULONG TempLen;
- MakeOutgoingFrame( pOutBuffer+FrameLen, &TempLen,
- sizeof(MEASURE_REQ), &MeasureReq,
- END_OF_ARGS);
- FrameLen += TempLen;
- }
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, (UINT)FrameLen);
-
-END_OF_MEASURE_REQ:
- MlmeFreeMemory(pAd, pOutBuffer);
-
- return TRUE;
-}
-
-INT Set_TpcReq_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT Aid;
-
- UINT8 TpcReqToken = RandomByte(pAd);
-
- Aid = (UINT) simple_strtol(arg, 0, 16);
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::Aid = %d\n", __FUNCTION__, Aid));
- if (!VALID_WCID(Aid))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s: unknow sta of Aid(%d)\n", __FUNCTION__, Aid));
- return TRUE;
- }
-
- TpcReqInsert(pAd, TpcReqToken);
-
- EnqueueTPCReq(pAd, pAd->MacTab.Content[Aid].Addr, TpcReqToken);
-
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/config.mk b/drivers/staging/rt3090/config.mk
deleted file mode 100644
index 4c90c4060d10..000000000000
--- a/drivers/staging/rt3090/config.mk
+++ /dev/null
@@ -1,187 +0,0 @@
-# Support ATE function
-HAS_ATE=y
-
-# Support 28xx QA ATE function
-HAS_28xx_QA=n
-
-
-HAS_NINTENDO=n
-
-# Support LLTD function
-HAS_LLTD=n
-
-# Support WDS function
-HAS_WDS=n
-
-# Support AP-Client function
-HAS_APCLI=n
-
-# Support Wpa_Supplicant
-HAS_WPA_SUPPLICANT=y
-
-# Support Native WpaSupplicant for Network Maganger
-HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
-
-#Support Net interface block while Tx-Sw queue full
-HAS_BLOCK_NET_IF=n
-
-#Support IGMP-Snooping function.
-HAS_IGMP_SNOOP_SUPPORT=n
-
-#Support DFS function
-HAS_DFS_SUPPORT=n
-
-#Support Carrier-Sense function
-HAS_CS_SUPPORT=n
-
-# Support for STA Ethernet Converter
-HAS_ETH_CONVERT_SUPPORT=n
-
-# Support user specific transmit rate of Multicast packet.
-HAS_MCAST_RATE_SPECIFIC_SUPPORT=n
-
-# Support for Multiple Cards
-HAS_MC_SUPPORT=n
-
-#Support for PCI-MSI
-HAS_MSI_SUPPORT=n
-
-
-#Support for IEEE802.11e DLS
-HAS_QOS_DLS_SUPPORT=n
-
-#Support for EXT_CHANNEL
-HAS_EXT_BUILD_CHANNEL_LIST=n
-
-#Support for IDS
-HAS_IDS_SUPPORT=n
-
-
-#Support for Net-SNMP
-HAS_SNMP_SUPPORT=n
-
-#Support features of 802.11n Draft3
-HAS_DOT11N_DRAFT3_SUPPORT=n
-
-#Support features of Single SKU.
-HAS_SINGLE_SKU_SUPPORT=n
-
-#Support features of 802.11n
-HAS_DOT11_N_SUPPORT=y
-
-
-
-#Support for 2860/2880 co-exist
-HAS_RT2880_RT2860_COEXIST=n
-
-HAS_KTHREAD_SUPPORT=n
-
-
-#Support for Auto channel select enhance
-HAS_AUTO_CH_SELECT_ENHANCE=n
-
-#Support bypass bridge
-HAS_BG_FT_SUPPORT=n
-
-#Support Antenna Diversity
-HAS_ANTENNA_DIVERSITY_SUPPORT=y
-#################################################
-
-WFLAGS := -DAGGREGATION_SUPPORT -DPIGGYBACK_SUPPORT -DWMM_SUPPORT -DLINUX -Wall -Wstrict-prototypes -Wno-trigraphs -Wpointer-sign
-
-ifeq ($(HAS_KTHREAD_SUPPORT),y)
-WFLAGS += -DKTHREAD_SUPPORT
-endif
-
-
-#################################################
-
-# config for STA mode
-
-WFLAGS += -DCONFIG_STA_SUPPORT -DDBG
-
-ifeq ($(HAS_WPA_SUPPLICANT),y)
-WFLAGS += -DWPA_SUPPLICANT_SUPPORT
-ifeq ($(HAS_NATIVE_WPA_SUPPLICANT_SUPPORT),y)
-WFLAGS += -DNATIVE_WPA_SUPPLICANT_SUPPORT
-endif
-endif
-
-
-ifeq ($(HAS_ETH_CONVERT_SUPPORT), y)
-WFLAGS += -DETH_CONVERT_SUPPORT -DMAT_SUPPORT
-endif
-
-ifeq ($(HAS_ATE),y)
-WFLAGS += -DRALINK_ATE
-ifeq ($(HAS_28xx_QA),y)
-WFLAGS += -DRALINK_28xx_QA
-endif
-endif
-
-
-ifeq ($(HAS_SNMP_SUPPORT),y)
-WFLAGS += -DSNMP_SUPPORT
-endif
-
-ifeq ($(HAS_QOS_DLS_SUPPORT),y)
-WFLAGS += -DQOS_DLS_SUPPORT
-endif
-
-ifeq ($(HAS_DOT11_N_SUPPORT),y)
-WFLAGS += -DDOT11_N_SUPPORT
-endif
-
-ifeq ($(HAS_CS_SUPPORT),y)
-WFLAGS += -DCARRIER_DETECTION_SUPPORT
-endif
-
-ifeq ($(HAS_ANTENNA_DIVERSITY_SUPPORT),y)
-WFLAGS += -DANT_DIVERSITY_SUPPORT
-endif
-
-#################################################
-
-#################################################
-
-#
-# Common compiler flag
-#
-
-
-
-
-
-ifeq ($(HAS_EXT_BUILD_CHANNEL_LIST),y)
-WFLAGS += -DEXT_BUILD_CHANNEL_LIST
-endif
-
-ifeq ($(HAS_IDS_SUPPORT),y)
-WFLAGS += -DIDS_SUPPORT
-endif
-
-
-#################################################
-# ChipSet specific definitions.
-#
-WFLAGS +=-DRTMP_MAC_PCI -DRT30xx -DRT3090 -DRTMP_PCI_SUPPORT -DRTMP_RF_RW_SUPPORT -DRTMP_EFUSE_SUPPORT
-#################################################
-
-
-ifeq ($(HAS_BLOCK_NET_IF),y)
-WFLAGS += -DBLOCK_NET_IF
-endif
-
-ifeq ($(HAS_DFS_SUPPORT),y)
-WFLAGS += -DDFS_SUPPORT
-endif
-
-ifeq ($(HAS_MC_SUPPORT),y)
-WFLAGS += -DMULTIPLE_CARD_SUPPORT
-endif
-
-ifeq ($(HAS_LLTD),y)
-WFLAGS += -DLLTD_SUPPORT
-endif
-
-EXTRA_CFLAGS := $(WFLAGS)
diff --git a/drivers/staging/rt3090/dfs.h b/drivers/staging/rt3090/dfs.h
deleted file mode 100644
index 506468ea952f..000000000000
--- a/drivers/staging/rt3090/dfs.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- dfs.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi 03-12-2007 created
-*/
-
-#define RADAR_PULSE 1
-#define RADAR_WIDTH 2
-
-#define WIDTH_RD_IDLE 0
-#define WIDTH_RD_CHECK 1
-
-
-
-/*************************************************************************
- *
- * DFS Radar related definitions.
- *
- ************************************************************************/
-//#define CARRIER_DETECT_TASK_NUM 6
-//#define RADAR_DETECT_TASK_NUM 7
-
-// McuRadarState && McuCarrierState for 2880-SW-MCU
-#define FREE_FOR_TX 0
-#define WAIT_CTS_BEING_SENT 1
-#define DO_DETECTION 2
-
-// McuRadarEvent
-#define RADAR_EVENT_CTS_SENT 0x01 // Host signal MCU that CTS has been sent
-#define RADAR_EVENT_CTS_CARRIER_SENT 0x02 // Host signal MCU that CTS has been sent (Carrier)
-#define RADAR_EVENT_RADAR_DETECTING 0x04 // Radar detection is on going, carrier detection hold back
-#define RADAR_EVENT_CARRIER_DETECTING 0x08 // Carrier detection is on going, radar detection hold back
-#define RADAR_EVENT_WIDTH_RADAR 0x10 // BBP == 2 radar detected
-#define RADAR_EVENT_CTS_KICKED 0x20 // Radar detection need to sent double CTS, first CTS sent
-
-// McuRadarCmd
-#define DETECTION_STOP 0
-#define RADAR_DETECTION 1
-#define CARRIER_DETECTION 2
-
-
-
-#ifdef TONE_RADAR_DETECT_SUPPORT
-INT Set_CarrierCriteria_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
-int Set_CarrierReCheck_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
-INT Set_CarrierStopCheck_Proc(IN PRTMP_ADAPTER pAd, IN PSTRING arg);
-void NewCarrierDetectionStart(PRTMP_ADAPTER pAd);
-void RTMPHandleRadarInterrupt(PRTMP_ADAPTER pAd);
-VOID CSAsicDisableSync(IN PRTMP_ADAPTER pAd);
-#endif // TONE_RADAR_DETECT_SUPPORT //
-
-
-VOID BbpRadarDetectionStart(
- IN PRTMP_ADAPTER pAd);
-
-VOID BbpRadarDetectionStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID RadarDetectionStart(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN CTS_Protect,
- IN UINT8 CTSPeriod);
-
-VOID RadarDetectionStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID RadarDetectPeriodic(
- IN PRTMP_ADAPTER pAd);
-
-
-BOOLEAN RadarChannelCheck(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ch);
-
-ULONG JapRadarType(
- IN PRTMP_ADAPTER pAd);
-
-ULONG RTMPBbpReadRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-ULONG RTMPReadRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPCleanRadarDuration(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPPrepareRDCTSFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN ULONG Duration,
- IN UCHAR RTSRate,
- IN ULONG CTSBaseAddr,
- IN UCHAR FrameGap);
-
-VOID RTMPPrepareRadarDetectParams(
- IN PRTMP_ADAPTER pAd);
-
-
-INT Set_ChMovingTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_LongPulseRadarTh_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
diff --git a/drivers/staging/rt3090/firmware.h b/drivers/staging/rt3090/firmware.h
index f2836a22cb8e..ef2576251dfa 100644
--- a/drivers/staging/rt3090/firmware.h
+++ b/drivers/staging/rt3090/firmware.h
@@ -2,7 +2,7 @@
/* AUTO GEN PLEASE DO NOT MODIFY IT */
-UCHAR FirmwareImage [] = {
+UCHAR FirmwareImage_3090 [] = {
0x02, 0x02, 0xf3, 0x02, 0x02, 0xa1, 0x22, 0x22, 0xff, 0xff, 0xff, 0x02, 0x01, 0x27, 0xff, 0xff,
0xff, 0xff, 0xff, 0x02, 0x00, 0x1e, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, 0xd8, 0xc0, 0xe0,
0xc0, 0xf0, 0xc0, 0x83, 0xc0, 0x82, 0xc0, 0xd0, 0x75, 0xd0, 0x18, 0xc2, 0xaf, 0x30, 0x45, 0x03,
diff --git a/drivers/staging/rt3090/igmp_snoop.h b/drivers/staging/rt3090/igmp_snoop.h
deleted file mode 100644
index 63f9692e0b35..000000000000
--- a/drivers/staging/rt3090/igmp_snoop.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- igmp_snoop.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-
-#ifndef __RTMP_IGMP_SNOOP_H__
-#define __RTMP_IGMP_SNOOP_H__
-
-#include "link_list.h"
-
-#define IGMP_PROTOCOL_DESCRIPTOR 0x02
-#define IGMP_V1_MEMBERSHIP_REPORT 0x12
-#define IGMP_V2_MEMBERSHIP_REPORT 0x16
-#define IGMP_LEAVE_GROUP 0x17
-#define IGMP_V3_MEMBERSHIP_REPORT 0x22
-
-#define MLD_V1_LISTENER_REPORT 131
-#define MLD_V1_LISTENER_DONE 132
-#define MLD_V2_LISTERNER_REPORT 143
-
-#define IGMPMAC_TB_ENTRY_AGEOUT_TIME 120 * OS_HZ
-
-#define MULTICAST_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % (MAX_LEN_OF_MULTICAST_FILTER_HASH_TABLE))
-
-#define IS_MULTICAST_MAC_ADDR(Addr) ((((Addr[0]) & 0x01) == 0x01) && ((Addr[0]) != 0xff))
-#define IS_BROADCAST_MAC_ADDR(Addr) ((((Addr[0]) & 0xff) == 0xff))
-
-VOID MulticastFilterTableInit(
- IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable);
-
-VOID MultiCastFilterTableReset(
- IN PMULTICAST_FILTER_TABLE *ppMulticastFilterTable);
-
-BOOLEAN MulticastFilterTableInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pGrpId,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV dev,
- IN MulticastFilterEntryType type);
-
-BOOLEAN MulticastFilterTableDeleteEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pGrpId,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV dev);
-
-PMULTICAST_FILTER_TABLE_ENTRY MulticastFilterTableLookup(
- IN PMULTICAST_FILTER_TABLE pMulticastFilterTable,
- IN PUCHAR pAddr,
- IN PNET_DEV dev);
-
-BOOLEAN isIgmpPkt(
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pIpHeader);
-
-VOID IGMPSnooping(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pSrcMacAddr,
- IN PUCHAR pIpHeader,
- IN PNET_DEV pDev);
-
-BOOLEAN isMldPkt(
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pIpHeader,
- OUT UINT8 *pProtoType,
- OUT PUCHAR *pMldHeader);
-
-VOID MLDSnooping(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDstMacAddr,
- IN PUCHAR pSrcMacAddr,
- IN PUCHAR pIpHeader,
- IN PNET_DEV pDev);
-
-UCHAR IgmpMemberCnt(
- IN PLIST_HEADER pList);
-
-VOID IgmpGroupDelMembers(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pMemberAddr,
- IN PNET_DEV pDev);
-
-INT Set_IgmpSn_Enable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_IgmpSn_AddEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_IgmpSn_DelEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_IgmpSn_TabDisplay_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-void rtmp_read_igmp_snoop_from_file(
- IN PRTMP_ADAPTER pAd,
- PSTRING tmpbuf,
- PSTRING buffer);
-
-NDIS_STATUS IgmpPktInfoQuery(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrcBufVA,
- IN PNDIS_PACKET pPacket,
- IN UCHAR apidx,
- OUT BOOLEAN *pInIgmpGroup,
- OUT PMULTICAST_FILTER_TABLE_ENTRY *ppGroupEntry);
-
-NDIS_STATUS IgmpPktClone(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR QueIdx,
- IN PMULTICAST_FILTER_TABLE_ENTRY pGroupEntry);
-
-#endif /* __RTMP_IGMP_SNOOP_H__ */
diff --git a/drivers/staging/rt3090/ipv6.h b/drivers/staging/rt3090/ipv6.h
deleted file mode 100644
index c34a5f2569dd..000000000000
--- a/drivers/staging/rt3090/ipv6.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- ipv6.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#ifndef __IPV6_HDR_H_
-#define __IPV6_HDR_H_
-
-#define IPV6_ADDR_LEN 16
-#define IPV6_HDR_LEN 40
-
-// IPv6 address definition
-#define IPV6_LINK_LOCAL_ADDR_PREFIX 0xFE8
-#define IPV6_SITE_LOCAL_ADDR_PREFIX 0xFEC
-#define IPV6_LOCAL_ADDR_PREFIX 0xFE8
-#define IPV6_MULTICAST_ADDR_PREFIX 0xFF
-#define IPV6_LOOPBACK_ADDR 0x1
-#define IPV6_UNSPECIFIED_ADDR 0x0
-
-// defined as sequence in IPv6 header
-#define IPV6_NEXT_HEADER_HOP_BY_HOP 0x00 // 0
-#define IPV6_NEXT_HEADER_DESTINATION 0x3c // 60
-#define IPV6_NEXT_HEADER_ROUTING 0x2b // 43
-#define IPV6_NEXT_HEADER_FRAGMENT 0x2c // 44
-#define IPV6_NEXT_HEADER_AUTHENTICATION 0x33 // 51
-#define IPV6_NEXT_HEADER_ENCAPSULATION 0x32 // 50, RFC-2406
-#define IPV6_NEXT_HEADER_NONE 0x3b // 59
-
-#define IPV6_NEXT_HEADER_TCP 0x06
-#define IPV6_NEXT_HEADER_UDP 0x11
-#define IPV6_NEXT_HEADER_ICMPV6 0x3a
-
-// ICMPv6 msg type definition
-#define ICMPV6_MSG_TYPE_ROUTER_SOLICITATION 0x85 // 133
-#define ROUTER_SOLICITATION_FIXED_LEN 8
-
-#define ICMPV6_MSG_TYPE_ROUTER_ADVERTISEMENT 0x86 // 134
-#define ROUTER_ADVERTISEMENT_FIXED_LEN 16
-
-#define ICMPV6_MSG_TYPE_NEIGHBOR_SOLICITATION 0x87 // 135
-#define NEIGHBOR_SOLICITATION_FIXED_LEN 24
-
-#define ICMPV6_MSG_TYPE_NEIGHBOR_ADVERTISEMENT 0x88 // 136
-#define NEIGHBOR_ADVERTISEMENT_FIXED_LEN 24
-
-#define ICMPV6_MSG_TYPE_REDIRECT 0x89 // 137
-#define REDIRECT_FIXED_LEN 40
-
-/* IPv6 Address related structures */
-typedef struct rt_ipv6_addr_
-{
- union
- {
- UCHAR ipv6Addr8[16];
- USHORT ipv6Addr16[8];
- UINT32 ipv6Addr32[4];
- }addr;
-#define ipv6_addr addr.ipv6Addr8
-#define ipv6_addr16 addr.ipv6Addr16
-#define ipv6_addr32 addr.ipv6Addr32
-}RT_IPV6_ADDR, *PRT_IPV6_ADDR;
-
-
-#define PRINT_IPV6_ADDR(ipv6Addr) \
- OS_NTOHS((ipv6Addr).ipv6_addr16[0]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[1]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[2]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[3]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[4]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[5]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[6]), \
- OS_NTOHS((ipv6Addr).ipv6_addr16[7])
-
-
-/*IPv6 Header related structures */
-typedef struct PACKED _rt_ipv6_hdr_
-{
- UINT32 ver:4,
- trafficClass:8,
- flowLabel:20;
- USHORT payload_len;
- UCHAR nextHdr;
- UCHAR hopLimit;
- RT_IPV6_ADDR srcAddr;
- RT_IPV6_ADDR dstAddr;
-}RT_IPV6_HDR, *PRT_IPV6_HDR;
-
-
-typedef struct PACKED _rt_ipv6_ext_hdr_
-{
- UCHAR nextProto; // Indicate the protocol type of next extension header.
- UCHAR extHdrLen; // optional field for msg length of this extension header which didn't include the first "nextProto" field.
- UCHAR octets[1]; // hook to extend header message body.
-}RT_IPV6_EXT_HDR, *PRT_IPV6_EXT_HDR;
-
-
-/* ICMPv6 related structures */
-typedef struct PACKED _rt_ipv6_icmpv6_hdr_
-{
- UCHAR type;
- UCHAR code;
- USHORT chksum;
- UCHAR octets[1]; //hook to extend header message body.
-}RT_ICMPV6_HDR, *PRT_ICMPV6_HDR;
-
-
-typedef struct PACKED _rt_icmp6_option_hdr_
-{
- UCHAR type;
- UCHAR len;
- UCHAR octet[1];
-}RT_ICMPV6_OPTION_HDR, *PRT_ICMPV6_OPTION_HDR;
-
-typedef enum{
-// Defined ICMPv6 Option Types.
- TYPE_SRC_LL_ADDR = 1,
- TYPE_TGT_LL_ADDR = 2,
- TYPE_PREFIX_INFO = 3,
- TYPE_REDIRECTED_HDR = 4,
- TYPE_MTU = 5,
-}ICMPV6_OPTIONS_TYPE_DEF;
-
-
-static inline BOOLEAN IPv6ExtHdrHandle(
- RT_IPV6_EXT_HDR *pExtHdr,
- UCHAR *pProto,
- UINT32 *pOffset)
-{
- UCHAR nextProto = 0xff;
- UINT32 extLen = 0;
- BOOLEAN status = TRUE;
-
- //printk("%s(): parsing the Extension Header with Protocol(0x%x):\n", __FUNCTION__, *pProto);
- switch (*pProto)
- {
- case IPV6_NEXT_HEADER_HOP_BY_HOP:
- // IPv6ExtHopByHopHandle();
- nextProto = pExtHdr->nextProto;
- extLen = (pExtHdr->extHdrLen + 1) * 8;
- break;
-
- case IPV6_NEXT_HEADER_DESTINATION:
- // IPv6ExtDestHandle();
- nextProto = pExtHdr->nextProto;
- extLen = (pExtHdr->extHdrLen + 1) * 8;
- break;
-
- case IPV6_NEXT_HEADER_ROUTING:
- // IPv6ExtRoutingHandle();
- nextProto = pExtHdr->nextProto;
- extLen = (pExtHdr->extHdrLen + 1) * 8;
- break;
-
- case IPV6_NEXT_HEADER_FRAGMENT:
- // IPv6ExtFragmentHandle();
- nextProto = pExtHdr->nextProto;
- extLen = 8; // The Fragment header length is fixed to 8 bytes.
- break;
-
- case IPV6_NEXT_HEADER_AUTHENTICATION:
- // IPV6_NEXT_HEADER_ENCAPSULATION:
- /*
- TODO: Not support. For encryption issue.
- */
- nextProto = 0xFF;
- status = FALSE;
- break;
-
- default:
- nextProto = 0xFF;
- status = FALSE;
- break;
- }
-
- *pProto = nextProto;
- *pOffset += extLen;
- //printk("%s(): nextProto = 0x%x!, offset=0x%x!\n", __FUNCTION__, nextProto, offset);
-
- return status;
-
-}
-
-#endif // __IPV6_HDR_H_ //
diff --git a/drivers/staging/rt3090/link_list.h b/drivers/staging/rt3090/link_list.h
deleted file mode 100644
index 205b610bfb90..000000000000
--- a/drivers/staging/rt3090/link_list.h
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#ifndef __LINK_LIST_H__
-#define __LINK_LIST_H__
-
-typedef struct _LIST_ENTRY
-{
- struct _LIST_ENTRY *pNext;
-} LIST_ENTRY, *PLIST_ENTRY;
-
-typedef struct _LIST_HEADR
-{
- PLIST_ENTRY pHead;
- PLIST_ENTRY pTail;
- UCHAR size;
-} LIST_HEADER, *PLIST_HEADER;
-
-static inline VOID initList(
- IN PLIST_HEADER pList)
-{
- pList->pHead = pList->pTail = NULL;
- pList->size = 0;
- return;
-}
-
-static inline VOID insertTailList(
- IN PLIST_HEADER pList,
- IN PLIST_ENTRY pEntry)
-{
- pEntry->pNext = NULL;
- if (pList->pTail)
- pList->pTail->pNext = pEntry;
- else
- pList->pHead = pEntry;
- pList->pTail = pEntry;
- pList->size++;
-
- return;
-}
-
-static inline PLIST_ENTRY removeHeadList(
- IN PLIST_HEADER pList)
-{
- PLIST_ENTRY pNext;
- PLIST_ENTRY pEntry;
-
- pEntry = pList->pHead;
- if (pList->pHead != NULL)
- {
- pNext = pList->pHead->pNext;
- pList->pHead = pNext;
- if (pNext == NULL)
- pList->pTail = NULL;
- pList->size--;
- }
- return pEntry;
-}
-
-static inline int getListSize(
- IN PLIST_HEADER pList)
-{
- return pList->size;
-}
-
-static inline PLIST_ENTRY delEntryList(
- IN PLIST_HEADER pList,
- IN PLIST_ENTRY pEntry)
-{
- PLIST_ENTRY pCurEntry;
- PLIST_ENTRY pPrvEntry;
-
- if(pList->pHead == NULL)
- return NULL;
-
- if(pEntry == pList->pHead)
- {
- pCurEntry = pList->pHead;
- pList->pHead = pCurEntry->pNext;
-
- if(pList->pHead == NULL)
- pList->pTail = NULL;
-
- pList->size--;
- return pCurEntry;
- }
-
- pPrvEntry = pList->pHead;
- pCurEntry = pPrvEntry->pNext;
- while(pCurEntry != NULL)
- {
- if (pEntry == pCurEntry)
- {
- pPrvEntry->pNext = pCurEntry->pNext;
-
- if(pEntry == pList->pTail)
- pList->pTail = pPrvEntry;
-
- pList->size--;
- break;
- }
- pPrvEntry = pCurEntry;
- pCurEntry = pPrvEntry->pNext;
- }
-
- return pCurEntry;
-}
-
-#endif // ___LINK_LIST_H__ //
diff --git a/drivers/staging/rt3090/mlme.h b/drivers/staging/rt3090/mlme.h
deleted file mode 100644
index 233674397a73..000000000000
--- a/drivers/staging/rt3090/mlme.h
+++ /dev/null
@@ -1,1360 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- mlme.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2003-08-28 Created
- John Chang 2004-09-06 modified for RT2600
-*/
-#ifndef __MLME_H__
-#define __MLME_H__
-
-#include "rtmp_dot11.h"
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-
-// maximum supported capability information -
-// ESS, IBSS, Privacy, Short Preamble, Spectrum mgmt, Short Slot
-#define SUPPORTED_CAPABILITY_INFO 0x0533
-
-#define END_OF_ARGS -1
-#define LFSR_MASK 0x80000057
-#define MLME_TASK_EXEC_INTV 100/*200*/ //
-#define LEAD_TIME 5
-#define MLME_TASK_EXEC_MULTIPLE 10 /*5*/ // MLME_TASK_EXEC_MULTIPLE * MLME_TASK_EXEC_INTV = 1 sec
-#define REORDER_EXEC_INTV 100 // 0.1 sec
-//#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
-
-// The definition of Radar detection duration region
-#define CE 0
-#define FCC 1
-#define JAP 2
-#define JAP_W53 3
-#define JAP_W56 4
-#define MAX_RD_REGION 5
-
-#define BEACON_LOST_TIME 4 * OS_HZ // 2048 msec = 2 sec
-
-#define DLS_TIMEOUT 1200 // unit: msec
-#define AUTH_TIMEOUT 300 // unit: msec
-#define ASSOC_TIMEOUT 300 // unit: msec
-#define JOIN_TIMEOUT 2000 // unit: msec
-#define SHORT_CHANNEL_TIME 90 // unit: msec
-#define MIN_CHANNEL_TIME 110 // unit: msec, for dual band scan
-#define MAX_CHANNEL_TIME 140 // unit: msec, for single band scan
-#define FAST_ACTIVE_SCAN_TIME 30 // Active scan waiting for probe response time
-#define CW_MIN_IN_BITS 4 // actual CwMin = 2^CW_MIN_IN_BITS - 1
-#define LINK_DOWN_TIMEOUT 20000 // unit: msec
-#define AUTO_WAKEUP_TIMEOUT 70 //unit: msec
-
-
-#ifdef CONFIG_STA_SUPPORT
-#define CW_MAX_IN_BITS 10 // actual CwMax = 2^CW_MAX_IN_BITS - 1
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-extern UINT32 CW_MAX_IN_BITS;
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-// Note: RSSI_TO_DBM_OFFSET has been changed to variable for new RF (2004-0720).
-// SHould not refer to this constant anymore
-//#define RSSI_TO_DBM_OFFSET 120 // for RT2530 RSSI-115 = dBm
-#define RSSI_FOR_MID_TX_POWER -55 // -55 db is considered mid-distance
-#define RSSI_FOR_LOW_TX_POWER -45 // -45 db is considered very short distance and
- // eligible to use a lower TX power
-#define RSSI_FOR_LOWEST_TX_POWER -30
-//#define MID_TX_POWER_DELTA 0 // 0 db from full TX power upon mid-distance to AP
-#define LOW_TX_POWER_DELTA 6 // -3 db from full TX power upon very short distance. 1 grade is 0.5 db
-#define LOWEST_TX_POWER_DELTA 16 // -8 db from full TX power upon shortest distance. 1 grade is 0.5 db
-
-#define RSSI_TRIGGERED_UPON_BELOW_THRESHOLD 0
-#define RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD 1
-#define RSSI_THRESHOLD_FOR_ROAMING 25
-#define RSSI_DELTA 5
-
-// Channel Quality Indication
-#define CQI_IS_GOOD(cqi) ((cqi) >= 50)
-//#define CQI_IS_FAIR(cqi) (((cqi) >= 20) && ((cqi) < 50))
-#define CQI_IS_POOR(cqi) (cqi < 50) //(((cqi) >= 5) && ((cqi) < 20))
-#define CQI_IS_BAD(cqi) (cqi < 5)
-#define CQI_IS_DEAD(cqi) (cqi == 0)
-
-// weighting factor to calculate Channel quality, total should be 100%
-#define RSSI_WEIGHTING 50
-#define TX_WEIGHTING 30
-#define RX_WEIGHTING 20
-
-//#define PEER_KEY_NOT_USED 0
-//#define PEER_KEY_64_BIT 64
-//#define PEER_KEY_128_BIT 128
-
-//#define PEER_KEY_64BIT_LEN 8
-//#define PEER_KEY_128BIT_LEN 16
-
-#define BSS_NOT_FOUND 0xFFFFFFFF
-
-
-#ifdef CONFIG_STA_SUPPORT
-#define MAX_LEN_OF_MLME_QUEUE 40 //10
-#endif // CONFIG_STA_SUPPORT //
-
-#define SCAN_PASSIVE 18 // scan with no probe request, only wait beacon and probe response
-#define SCAN_ACTIVE 19 // scan with probe request, and wait beacon and probe response
-#define SCAN_CISCO_PASSIVE 20 // Single channel passive scan
-#define SCAN_CISCO_ACTIVE 21 // Single channel active scan
-#define SCAN_CISCO_NOISE 22 // Single channel passive scan for noise histogram collection
-#define SCAN_CISCO_CHANNEL_LOAD 23 // Single channel passive scan for channel load collection
-#define FAST_SCAN_ACTIVE 24 // scan with probe request, and wait beacon and probe response
-
-#ifdef DOT11N_DRAFT3
-#define SCAN_2040_BSS_COEXIST 26
-#endif // DOT11N_DRAFT3 //
-
-//#define BSS_TABLE_EMPTY(x) ((x).BssNr == 0)
-#define MAC_ADDR_IS_GROUP(Addr) (((Addr[0]) & 0x01))
-#define MAC_ADDR_HASH(Addr) (Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
-#define MAC_ADDR_HASH_INDEX(Addr) (MAC_ADDR_HASH(Addr) % HASH_TABLE_SIZE)
-#define TID_MAC_HASH(Addr,TID) (TID^Addr[0] ^ Addr[1] ^ Addr[2] ^ Addr[3] ^ Addr[4] ^ Addr[5])
-#define TID_MAC_HASH_INDEX(Addr,TID) (TID_MAC_HASH(Addr,TID) % HASH_TABLE_SIZE)
-
-// LED Control
-// assoiation ON. one LED ON. another blinking when TX, OFF when idle
-// no association, both LED off
-#define ASIC_LED_ACT_ON(pAd) RTMP_IO_WRITE32(pAd, MAC_CSR14, 0x00031e46)
-#define ASIC_LED_ACT_OFF(pAd) RTMP_IO_WRITE32(pAd, MAC_CSR14, 0x00001e46)
-
-// bit definition of the 2-byte pBEACON->Capability field
-#define CAP_IS_ESS_ON(x) (((x) & 0x0001) != 0)
-#define CAP_IS_IBSS_ON(x) (((x) & 0x0002) != 0)
-#define CAP_IS_CF_POLLABLE_ON(x) (((x) & 0x0004) != 0)
-#define CAP_IS_CF_POLL_REQ_ON(x) (((x) & 0x0008) != 0)
-#define CAP_IS_PRIVACY_ON(x) (((x) & 0x0010) != 0)
-#define CAP_IS_SHORT_PREAMBLE_ON(x) (((x) & 0x0020) != 0)
-#define CAP_IS_PBCC_ON(x) (((x) & 0x0040) != 0)
-#define CAP_IS_AGILITY_ON(x) (((x) & 0x0080) != 0)
-#define CAP_IS_SPECTRUM_MGMT(x) (((x) & 0x0100) != 0) // 802.11e d9
-#define CAP_IS_QOS(x) (((x) & 0x0200) != 0) // 802.11e d9
-#define CAP_IS_SHORT_SLOT(x) (((x) & 0x0400) != 0)
-#define CAP_IS_APSD(x) (((x) & 0x0800) != 0) // 802.11e d9
-#define CAP_IS_IMMED_BA(x) (((x) & 0x1000) != 0) // 802.11e d9
-#define CAP_IS_DSSS_OFDM(x) (((x) & 0x2000) != 0)
-#define CAP_IS_DELAY_BA(x) (((x) & 0x4000) != 0) // 802.11e d9
-
-#define CAP_GENERATE(ess,ibss,priv,s_pre,s_slot,spectrum) (((ess) ? 0x0001 : 0x0000) | ((ibss) ? 0x0002 : 0x0000) | ((priv) ? 0x0010 : 0x0000) | ((s_pre) ? 0x0020 : 0x0000) | ((s_slot) ? 0x0400 : 0x0000) | ((spectrum) ? 0x0100 : 0x0000))
-
-//#define STA_QOS_CAPABILITY 0 // 1-byte. see 802.11e d9.0 for bit definition
-
-#define ERP_IS_NON_ERP_PRESENT(x) (((x) & 0x01) != 0) // 802.11g
-#define ERP_IS_USE_PROTECTION(x) (((x) & 0x02) != 0) // 802.11g
-#define ERP_IS_USE_BARKER_PREAMBLE(x) (((x) & 0x04) != 0) // 802.11g
-
-#define DRS_TX_QUALITY_WORST_BOUND 8// 3 // just test by gary
-#define DRS_PENALTY 8
-
-#define BA_NOTUSE 2
-//BA Policy subfiled value in ADDBA frame
-#define IMMED_BA 1
-#define DELAY_BA 0
-
-// BA Initiator subfield in DELBA frame
-#define ORIGINATOR 1
-#define RECIPIENT 0
-
-// ADDBA Status Code
-#define ADDBA_RESULTCODE_SUCCESS 0
-#define ADDBA_RESULTCODE_REFUSED 37
-#define ADDBA_RESULTCODE_INVALID_PARAMETERS 38
-
-// DELBA Reason Code
-#define DELBA_REASONCODE_QSTA_LEAVING 36
-#define DELBA_REASONCODE_END_BA 37
-#define DELBA_REASONCODE_UNKNOWN_BA 38
-#define DELBA_REASONCODE_TIMEOUT 39
-
-// reset all OneSecTx counters
-#define RESET_ONE_SEC_TX_CNT(__pEntry) \
-if (((__pEntry)) != NULL) \
-{ \
- (__pEntry)->OneSecTxRetryOkCount = 0; \
- (__pEntry)->OneSecTxFailCount = 0; \
- (__pEntry)->OneSecTxNoRetryOkCount = 0; \
-}
-
-//
-// 802.11 frame formats
-//
-// HT Capability INFO field in HT Cap IE .
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT LSIGTxopProSup:1;
- USHORT Forty_Mhz_Intolerant:1;
- USHORT PSMP:1;
- USHORT CCKmodein40:1;
- USHORT AMsduSize:1;
- USHORT DelayedBA:1; //rt2860c not support
- USHORT RxSTBC:2;
- USHORT TxSTBC:1;
- USHORT ShortGIfor40:1; //for40MHz
- USHORT ShortGIfor20:1;
- USHORT GF:1; //green field
- USHORT MimoPs:2;//momi power safe
- USHORT ChannelWidth:1;
- USHORT AdvCoding:1;
-#else
- USHORT AdvCoding:1;
- USHORT ChannelWidth:1;
- USHORT MimoPs:2;//momi power safe
- USHORT GF:1; //green field
- USHORT ShortGIfor20:1;
- USHORT ShortGIfor40:1; //for40MHz
- USHORT TxSTBC:1;
- USHORT RxSTBC:2;
- USHORT DelayedBA:1; //rt2860c not support
- USHORT AMsduSize:1; // only support as zero
- USHORT CCKmodein40:1;
- USHORT PSMP:1;
- USHORT Forty_Mhz_Intolerant:1;
- USHORT LSIGTxopProSup:1;
-#endif /* !RT_BIG_ENDIAN */
-} HT_CAP_INFO, *PHT_CAP_INFO;
-
-// HT Capability INFO field in HT Cap IE .
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- UCHAR rsv:3;//momi power safe
- UCHAR MpduDensity:3;
- UCHAR MaxRAmpduFactor:2;
-#else
- UCHAR MaxRAmpduFactor:2;
- UCHAR MpduDensity:3;
- UCHAR rsv:3;//momi power safe
-#endif /* !RT_BIG_ENDIAN */
-} HT_CAP_PARM, *PHT_CAP_PARM;
-
-// HT Capability INFO field in HT Cap IE .
-typedef struct PACKED {
- UCHAR MCSSet[10];
- UCHAR SupRate[2]; // unit : 1Mbps
-#ifdef RT_BIG_ENDIAN
- UCHAR rsv:3;
- UCHAR MpduDensity:1;
- UCHAR TxStream:2;
- UCHAR TxRxNotEqual:1;
- UCHAR TxMCSSetDefined:1;
-#else
- UCHAR TxMCSSetDefined:1;
- UCHAR TxRxNotEqual:1;
- UCHAR TxStream:2;
- UCHAR MpduDensity:1;
- UCHAR rsv:3;
-#endif // RT_BIG_ENDIAN //
- UCHAR rsv3[3];
-} HT_MCS_SET, *PHT_MCS_SET;
-
-// HT Capability INFO field in HT Cap IE .
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT rsv2:4;
- USHORT RDGSupport:1; //reverse Direction Grant support
- USHORT PlusHTC:1; //+HTC control field support
- USHORT MCSFeedback:2; //0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv.
- USHORT rsv:5;//momi power safe
- USHORT TranTime:2;
- USHORT Pco:1;
-#else
- USHORT Pco:1;
- USHORT TranTime:2;
- USHORT rsv:5;//momi power safe
- USHORT MCSFeedback:2; //0:no MCS feedback, 2:unsolicited MCS feedback, 3:Full MCS feedback, 1:rsv.
- USHORT PlusHTC:1; //+HTC control field support
- USHORT RDGSupport:1; //reverse Direction Grant support
- USHORT rsv2:4;
-#endif /* RT_BIG_ENDIAN */
-} EXT_HT_CAP_INFO, *PEXT_HT_CAP_INFO;
-
-// HT Beamforming field in HT Cap IE .
-typedef struct PACKED _HT_BF_CAP{
-#ifdef RT_BIG_ENDIAN
- ULONG rsv:3;
- ULONG ChanEstimation:2;
- ULONG CSIRowBFSup:2;
- ULONG ComSteerBFAntSup:2;
- ULONG NoComSteerBFAntSup:2;
- ULONG CSIBFAntSup:2;
- ULONG MinGrouping:2;
- ULONG ExpComBF:2;
- ULONG ExpNoComBF:2;
- ULONG ExpCSIFbk:2;
- ULONG ExpComSteerCapable:1;
- ULONG ExpNoComSteerCapable:1;
- ULONG ExpCSICapable:1;
- ULONG Calibration:2;
- ULONG ImpTxBFCapable:1;
- ULONG TxNDPCapable:1;
- ULONG RxNDPCapable:1;
- ULONG TxSoundCapable:1;
- ULONG RxSoundCapable:1;
- ULONG TxBFRecCapable:1;
-#else
- ULONG TxBFRecCapable:1;
- ULONG RxSoundCapable:1;
- ULONG TxSoundCapable:1;
- ULONG RxNDPCapable:1;
- ULONG TxNDPCapable:1;
- ULONG ImpTxBFCapable:1;
- ULONG Calibration:2;
- ULONG ExpCSICapable:1;
- ULONG ExpNoComSteerCapable:1;
- ULONG ExpComSteerCapable:1;
- ULONG ExpCSIFbk:2;
- ULONG ExpNoComBF:2;
- ULONG ExpComBF:2;
- ULONG MinGrouping:2;
- ULONG CSIBFAntSup:2;
- ULONG NoComSteerBFAntSup:2;
- ULONG ComSteerBFAntSup:2;
- ULONG CSIRowBFSup:2;
- ULONG ChanEstimation:2;
- ULONG rsv:3;
-#endif // RT_BIG_ENDIAN //
-} HT_BF_CAP, *PHT_BF_CAP;
-
-// HT antenna selection field in HT Cap IE .
-typedef struct PACKED _HT_AS_CAP{
-#ifdef RT_BIG_ENDIAN
- UCHAR rsv:1;
- UCHAR TxSoundPPDU:1;
- UCHAR RxASel:1;
- UCHAR AntIndFbk:1;
- UCHAR ExpCSIFbk:1;
- UCHAR AntIndFbkTxASEL:1;
- UCHAR ExpCSIFbkTxASEL:1;
- UCHAR AntSelect:1;
-#else
- UCHAR AntSelect:1;
- UCHAR ExpCSIFbkTxASEL:1;
- UCHAR AntIndFbkTxASEL:1;
- UCHAR ExpCSIFbk:1;
- UCHAR AntIndFbk:1;
- UCHAR RxASel:1;
- UCHAR TxSoundPPDU:1;
- UCHAR rsv:1;
-#endif // RT_BIG_ENDIAN //
-} HT_AS_CAP, *PHT_AS_CAP;
-
-// Draft 1.0 set IE length 26, but is extensible..
-#define SIZE_HT_CAP_IE 26
-// The structure for HT Capability IE.
-typedef struct PACKED _HT_CAPABILITY_IE{
- HT_CAP_INFO HtCapInfo;
- HT_CAP_PARM HtCapParm;
-// HT_MCS_SET HtMCSSet;
- UCHAR MCSSet[16];
- EXT_HT_CAP_INFO ExtHtCapInfo;
- HT_BF_CAP TxBFCap; // beamforming cap. rt2860c not support beamforming.
- HT_AS_CAP ASCap; //antenna selection.
-} HT_CAPABILITY_IE, *PHT_CAPABILITY_IE;
-
-
-// 802.11n draft3 related structure definitions.
-// 7.3.2.60
-#define dot11OBSSScanPassiveDwell 20 // in TU. min amount of time that the STA continously scans each channel when performing an active OBSS scan.
-#define dot11OBSSScanActiveDwell 10 // in TU.min amount of time that the STA continously scans each channel when performing an passive OBSS scan.
-#define dot11BSSWidthTriggerScanInterval 300 // in sec. max interval between scan operations to be performed to detect BSS channel width trigger events.
-#define dot11OBSSScanPassiveTotalPerChannel 200 // in TU. min total amount of time that the STA scans each channel when performing a passive OBSS scan.
-#define dot11OBSSScanActiveTotalPerChannel 20 //in TU. min total amount of time that the STA scans each channel when performing a active OBSS scan
-#define dot11BSSWidthChannelTransactionDelayFactor 5 // min ratio between the delay time in performing a switch from 20MHz BSS to 20/40 BSS operation and the maximum
- // interval between overlapping BSS scan operations.
-#define dot11BSSScanActivityThreshold 25 // in %%, max total time that a STA may be active on the medium during a period of
- // (dot11BSSWidthChannelTransactionDelayFactor * dot11BSSWidthTriggerScanInterval) seconds without
- // being obligated to perform OBSS Scan operations. default is 25(== 0.25%)
-
-typedef struct PACKED _OVERLAP_BSS_SCAN_IE{
- USHORT ScanPassiveDwell;
- USHORT ScanActiveDwell;
- USHORT TriggerScanInt; // Trigger scan interval
- USHORT PassiveTalPerChannel; // passive total per channel
- USHORT ActiveTalPerChannel; // active total per channel
- USHORT DelayFactor; // BSS width channel transition delay factor
- USHORT ScanActThre; // Scan Activity threshold
-}OVERLAP_BSS_SCAN_IE, *POVERLAP_BSS_SCAN_IE;
-
-
-// 7.3.2.56. 20/40 Coexistence element used in Element ID = 72 = IE_2040_BSS_COEXIST
-typedef union PACKED _BSS_2040_COEXIST_IE{
- struct PACKED {
- #ifdef RT_BIG_ENDIAN
- UCHAR rsv:5;
- UCHAR BSS20WidthReq:1;
- UCHAR Intolerant40:1;
- UCHAR InfoReq:1;
- #else
- UCHAR InfoReq:1;
- UCHAR Intolerant40:1; // Inter-BSS. set 1 when prohibits a receiving BSS from operating as a 20/40 Mhz BSS.
- UCHAR BSS20WidthReq:1; // Intra-BSS set 1 when prohibits a receiving AP from operating its BSS as a 20/40MHz BSS.
- UCHAR rsv:5;
-#endif // RT_BIG_ENDIAN //
- } field;
- UCHAR word;
-} BSS_2040_COEXIST_IE, *PBSS_2040_COEXIST_IE;
-
-
-typedef struct _TRIGGER_EVENTA{
- BOOLEAN bValid;
- UCHAR BSSID[6];
- UCHAR RegClass; // Regulatory Class
- USHORT Channel;
- ULONG CDCounter; // Maintain a seperate count down counter for each Event A.
-} TRIGGER_EVENTA, *PTRIGGER_EVENTA;
-
-// 20/40 trigger event table
-// If one Event A delete or created, or if Event B is detected or not detected, STA should send 2040BSSCoexistence to AP.
-#define MAX_TRIGGER_EVENT 64
-typedef struct _TRIGGER_EVENT_TAB{
- UCHAR EventANo;
- TRIGGER_EVENTA EventA[MAX_TRIGGER_EVENT];
- ULONG EventBCountDown; // Count down counter for Event B.
-} TRIGGER_EVENT_TAB, *PTRIGGER_EVENT_TAB;
-
-// 7.3.27 20/40 Bss Coexistence Mgmt capability used in extended capabilities information IE( ID = 127 = IE_EXT_CAPABILITY).
-// This is the first octet and was defined in 802.11n D3.03 and 802.11yD9.0
-typedef struct PACKED _EXT_CAP_INFO_ELEMENT{
-#ifdef RT_BIG_ENDIAN
- UCHAR rsv2:5;
- UCHAR ExtendChannelSwitch:1;
- UCHAR rsv:1;
- UCHAR BssCoexistMgmtSupport:1;
-#else
- UCHAR BssCoexistMgmtSupport:1;
- UCHAR rsv:1;
- UCHAR ExtendChannelSwitch:1;
- UCHAR rsv2:5;
-#endif // RT_BIG_ENDIAN //
-}EXT_CAP_INFO_ELEMENT, *PEXT_CAP_INFO_ELEMENT;
-
-
-// 802.11n 7.3.2.61
-typedef struct PACKED _BSS_2040_COEXIST_ELEMENT{
- UCHAR ElementID; // ID = IE_2040_BSS_COEXIST = 72
- UCHAR Len;
- BSS_2040_COEXIST_IE BssCoexistIe;
-}BSS_2040_COEXIST_ELEMENT, *PBSS_2040_COEXIST_ELEMENT;
-
-
-//802.11n 7.3.2.59
-typedef struct PACKED _BSS_2040_INTOLERANT_CH_REPORT{
- UCHAR ElementID; // ID = IE_2040_BSS_INTOLERANT_REPORT = 73
- UCHAR Len;
- UCHAR RegulatoryClass;
- UCHAR ChList[0];
-}BSS_2040_INTOLERANT_CH_REPORT, *PBSS_2040_INTOLERANT_CH_REPORT;
-
-
-// The structure for channel switch annoucement IE. This is in 802.11n D3.03
-typedef struct PACKED _CHA_SWITCH_ANNOUNCE_IE{
- UCHAR SwitchMode; //channel switch mode
- UCHAR NewChannel; //
- UCHAR SwitchCount; //
-} CHA_SWITCH_ANNOUNCE_IE, *PCHA_SWITCH_ANNOUNCE_IE;
-
-
-// The structure for channel switch annoucement IE. This is in 802.11n D3.03
-typedef struct PACKED _SEC_CHA_OFFSET_IE{
- UCHAR SecondaryChannelOffset; // 1: Secondary above, 3: Secondary below, 0: no Secondary
-} SEC_CHA_OFFSET_IE, *PSEC_CHA_OFFSET_IE;
-
-
-// This structure is extracted from struct RT_HT_CAPABILITY
-typedef struct {
- BOOLEAN bHtEnable; // If we should use ht rate.
- BOOLEAN bPreNHt; // If we should use ht rate.
- //Substract from HT Capability IE
- UCHAR MCSSet[16];
-} RT_HT_PHY_INFO, *PRT_HT_PHY_INFO;
-
-//This structure substracts ralink supports from all 802.11n-related features.
-//Features not listed here but contained in 802.11n spec are not supported in rt2860.
-typedef struct {
-#ifdef RT_BIG_ENDIAN
- USHORT rsv:5;
- USHORT AmsduSize:1; // Max receiving A-MSDU size
- USHORT AmsduEnable:1; // Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n
- USHORT RxSTBC:2; // 2 bits
- USHORT TxSTBC:1;
- USHORT ShortGIfor40:1; //for40MHz
- USHORT ShortGIfor20:1;
- USHORT GF:1; //green field
- USHORT MimoPs:2;//mimo power safe MMPS_
- USHORT ChannelWidth:1;
-#else
- USHORT ChannelWidth:1;
- USHORT MimoPs:2;//mimo power safe MMPS_
- USHORT GF:1; //green field
- USHORT ShortGIfor20:1;
- USHORT ShortGIfor40:1; //for40MHz
- USHORT TxSTBC:1;
- USHORT RxSTBC:2; // 2 bits
- USHORT AmsduEnable:1; // Enable to transmit A-MSDU. Suggest disable. We should use A-MPDU to gain best benifit of 802.11n
- USHORT AmsduSize:1; // Max receiving A-MSDU size
- USHORT rsv:5;
-#endif
-
- //Substract from Addiont HT INFO IE
-#ifdef RT_BIG_ENDIAN
- UCHAR RecomWidth:1;
- UCHAR ExtChanOffset:2; // Please not the difference with following UCHAR NewExtChannelOffset; from 802.11n
- UCHAR MpduDensity:3;
- UCHAR MaxRAmpduFactor:2;
-#else
- UCHAR MaxRAmpduFactor:2;
- UCHAR MpduDensity:3;
- UCHAR ExtChanOffset:2; // Please not the difference with following UCHAR NewExtChannelOffset; from 802.11n
- UCHAR RecomWidth:1;
-#endif
-
-#ifdef RT_BIG_ENDIAN
- USHORT rsv2:11;
- USHORT OBSS_NonHTExist:1;
- USHORT rsv3:1;
- USHORT NonGfPresent:1;
- USHORT OperaionMode:2;
-#else
- USHORT OperaionMode:2;
- USHORT NonGfPresent:1;
- USHORT rsv3:1;
- USHORT OBSS_NonHTExist:1;
- USHORT rsv2:11;
-#endif
-
- // New Extension Channel Offset IE
- UCHAR NewExtChannelOffset;
- // Extension Capability IE = 127
- UCHAR BSSCoexist2040;
-} RT_HT_CAPABILITY, *PRT_HT_CAPABILITY;
-
-// field in Addtional HT Information IE .
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- UCHAR SerInterGranu:3;
- UCHAR S_PSMPSup:1;
- UCHAR RifsMode:1;
- UCHAR RecomWidth:1;
- UCHAR ExtChanOffset:2;
-#else
- UCHAR ExtChanOffset:2;
- UCHAR RecomWidth:1;
- UCHAR RifsMode:1;
- UCHAR S_PSMPSup:1; //Indicate support for scheduled PSMP
- UCHAR SerInterGranu:3; //service interval granularity
-#endif
-} ADD_HTINFO, *PADD_HTINFO;
-
-typedef struct PACKED{
-#ifdef RT_BIG_ENDIAN
- USHORT rsv2:11;
- USHORT OBSS_NonHTExist:1;
- USHORT rsv:1;
- USHORT NonGfPresent:1;
- USHORT OperaionMode:2;
-#else
- USHORT OperaionMode:2;
- USHORT NonGfPresent:1;
- USHORT rsv:1;
- USHORT OBSS_NonHTExist:1;
- USHORT rsv2:11;
-#endif
-} ADD_HTINFO2, *PADD_HTINFO2;
-
-
-// TODO: Need sync with spec about the definition of StbcMcs. In Draft 3.03, it's reserved.
-typedef struct PACKED{
-#ifdef RT_BIG_ENDIAN
- USHORT rsv:4;
- USHORT PcoPhase:1;
- USHORT PcoActive:1;
- USHORT LsigTxopProt:1;
- USHORT STBCBeacon:1;
- USHORT DualCTSProtect:1;
- USHORT DualBeacon:1;
- USHORT StbcMcs:6;
-#else
- USHORT StbcMcs:6;
- USHORT DualBeacon:1;
- USHORT DualCTSProtect:1;
- USHORT STBCBeacon:1;
- USHORT LsigTxopProt:1; // L-SIG TXOP protection full support
- USHORT PcoActive:1;
- USHORT PcoPhase:1;
- USHORT rsv:4;
-#endif // RT_BIG_ENDIAN //
-} ADD_HTINFO3, *PADD_HTINFO3;
-
-#define SIZE_ADD_HT_INFO_IE 22
-typedef struct PACKED{
- UCHAR ControlChan;
- ADD_HTINFO AddHtInfo;
- ADD_HTINFO2 AddHtInfo2;
- ADD_HTINFO3 AddHtInfo3;
- UCHAR MCSSet[16]; // Basic MCS set
-} ADD_HT_INFO_IE, *PADD_HT_INFO_IE;
-
-typedef struct PACKED{
- UCHAR NewExtChanOffset;
-} NEW_EXT_CHAN_IE, *PNEW_EXT_CHAN_IE;
-
-typedef struct PACKED _FRAME_802_11 {
- HEADER_802_11 Hdr;
- UCHAR Octet[1];
-} FRAME_802_11, *PFRAME_802_11;
-
-// QoSNull embedding of management action. When HT Control MA field set to 1.
-typedef struct PACKED _MA_BODY {
- UCHAR Category;
- UCHAR Action;
- UCHAR Octet[1];
-} MA_BODY, *PMA_BODY;
-
-typedef struct PACKED _HEADER_802_3 {
- UCHAR DAAddr1[MAC_ADDR_LEN];
- UCHAR SAAddr2[MAC_ADDR_LEN];
- UCHAR Octet[2];
-} HEADER_802_3, *PHEADER_802_3;
-////Block ACK related format
-// 2-byte BA Parameter field in DELBA frames to terminate an already set up bA
-typedef struct PACKED{
-#ifdef RT_BIG_ENDIAN
- USHORT TID:4; // value of TC os TS
- USHORT Initiator:1; // 1: originator 0:recipient
- USHORT Rsv:11; // always set to 0
-#else
- USHORT Rsv:11; // always set to 0
- USHORT Initiator:1; // 1: originator 0:recipient
- USHORT TID:4; // value of TC os TS
-#endif /* !RT_BIG_ENDIAN */
-} DELBA_PARM, *PDELBA_PARM;
-
-// 2-byte BA Parameter Set field in ADDBA frames to signal parm for setting up a BA
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT BufSize:10; // number of buffe of size 2304 octetsr
- USHORT TID:4; // value of TC os TS
- USHORT BAPolicy:1; // 1: immediately BA 0:delayed BA
- USHORT AMSDUSupported:1; // 0: not permitted 1: permitted
-#else
- USHORT AMSDUSupported:1; // 0: not permitted 1: permitted
- USHORT BAPolicy:1; // 1: immediately BA 0:delayed BA
- USHORT TID:4; // value of TC os TS
- USHORT BufSize:10; // number of buffe of size 2304 octetsr
-#endif /* !RT_BIG_ENDIAN */
-} BA_PARM, *PBA_PARM;
-
-// 2-byte BA Starting Seq CONTROL field
-typedef union PACKED {
- struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT StartSeq:12; // sequence number of the 1st MSDU for which this BAR is sent
- USHORT FragNum:4; // always set to 0
-#else
- USHORT FragNum:4; // always set to 0
- USHORT StartSeq:12; // sequence number of the 1st MSDU for which this BAR is sent
-#endif /* RT_BIG_ENDIAN */
- } field;
- USHORT word;
-} BASEQ_CONTROL, *PBASEQ_CONTROL;
-
-//BAControl and BARControl are the same
-// 2-byte BA CONTROL field in BA frame
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT TID:4;
- USHORT Rsv:9;
- USHORT Compressed:1;
- USHORT MTID:1; //EWC V1.24
- USHORT ACKPolicy:1; // only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK
-#else
- USHORT ACKPolicy:1; // only related to N-Delayed BA. But not support in RT2860b. 0:NormalACK 1:No ACK
- USHORT MTID:1; //EWC V1.24
- USHORT Compressed:1;
- USHORT Rsv:9;
- USHORT TID:4;
-#endif /* !RT_BIG_ENDIAN */
-} BA_CONTROL, *PBA_CONTROL;
-
-// 2-byte BAR CONTROL field in BAR frame
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT TID:4;
- USHORT Rsv1:9;
- USHORT Compressed:1;
- USHORT MTID:1; //if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ
- USHORT ACKPolicy:1;
-#else
- USHORT ACKPolicy:1; // 0:normal ack, 1:no ack.
- USHORT MTID:1; //if this bit1, use FRAME_MTBA_REQ, if 0, use FRAME_BA_REQ
- USHORT Compressed:1;
- USHORT Rsv1:9;
- USHORT TID:4;
-#endif /* !RT_BIG_ENDIAN */
-} BAR_CONTROL, *PBAR_CONTROL;
-
-// BARControl in MTBAR frame
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT NumTID:4;
- USHORT Rsv1:9;
- USHORT Compressed:1;
- USHORT MTID:1;
- USHORT ACKPolicy:1;
-#else
- USHORT ACKPolicy:1;
- USHORT MTID:1;
- USHORT Compressed:1;
- USHORT Rsv1:9;
- USHORT NumTID:4;
-#endif /* !RT_BIG_ENDIAN */
-} MTBAR_CONTROL, *PMTBAR_CONTROL;
-
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT TID:4;
- USHORT Rsv1:12;
-#else
- USHORT Rsv1:12;
- USHORT TID:4;
-#endif /* !RT_BIG_ENDIAN */
-} PER_TID_INFO, *PPER_TID_INFO;
-
-typedef struct {
- PER_TID_INFO PerTID;
- BASEQ_CONTROL BAStartingSeq;
-} EACH_TID, *PEACH_TID;
-
-
-// BAREQ AND MTBAREQ have the same subtype BAR, 802.11n BAR use compressed bitmap.
-typedef struct PACKED _FRAME_BA_REQ {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- BAR_CONTROL BARControl;
- BASEQ_CONTROL BAStartingSeq;
-} FRAME_BA_REQ, *PFRAME_BA_REQ;
-
-typedef struct PACKED _FRAME_MTBA_REQ {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- MTBAR_CONTROL MTBARControl;
- PER_TID_INFO PerTIDInfo;
- BASEQ_CONTROL BAStartingSeq;
-} FRAME_MTBA_REQ, *PFRAME_MTBA_REQ;
-
-// Compressed format is mandantory in HT STA
-typedef struct PACKED _FRAME_MTBA {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- BA_CONTROL BAControl;
- BASEQ_CONTROL BAStartingSeq;
- UCHAR BitMap[8];
-} FRAME_MTBA, *PFRAME_MTBA;
-
-typedef struct PACKED _FRAME_PSMP_ACTION {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- UCHAR Psmp; // 7.3.1.25
-} FRAME_PSMP_ACTION, *PFRAME_PSMP_ACTION;
-
-typedef struct PACKED _FRAME_ACTION_HDR {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
-} FRAME_ACTION_HDR, *PFRAME_ACTION_HDR;
-
-//Action Frame
-//Action Frame Category:Spectrum, Action:Channel Switch. 7.3.2.20
-typedef struct PACKED _CHAN_SWITCH_ANNOUNCE {
- UCHAR ElementID; // ID = IE_CHANNEL_SWITCH_ANNOUNCEMENT = 37
- UCHAR Len;
- CHA_SWITCH_ANNOUNCE_IE CSAnnounceIe;
-} CHAN_SWITCH_ANNOUNCE, *PCHAN_SWITCH_ANNOUNCE;
-
-
-//802.11n : 7.3.2.20a
-typedef struct PACKED _SECOND_CHAN_OFFSET {
- UCHAR ElementID; // ID = IE_SECONDARY_CH_OFFSET = 62
- UCHAR Len;
- SEC_CHA_OFFSET_IE SecChOffsetIe;
-} SECOND_CHAN_OFFSET, *PSECOND_CHAN_OFFSET;
-
-
-typedef struct PACKED _FRAME_SPETRUM_CS {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- CHAN_SWITCH_ANNOUNCE CSAnnounce;
- SECOND_CHAN_OFFSET SecondChannel;
-} FRAME_SPETRUM_CS, *PFRAME_SPETRUM_CS;
-
-
-typedef struct PACKED _FRAME_ADDBA_REQ {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- UCHAR Token; // 1
- BA_PARM BaParm; // 2 - 10
- USHORT TimeOutValue; // 0 - 0
- BASEQ_CONTROL BaStartSeq; // 0-0
-} FRAME_ADDBA_REQ, *PFRAME_ADDBA_REQ;
-
-typedef struct PACKED _FRAME_ADDBA_RSP {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- UCHAR Token;
- USHORT StatusCode;
- BA_PARM BaParm; //0 - 2
- USHORT TimeOutValue;
-} FRAME_ADDBA_RSP, *PFRAME_ADDBA_RSP;
-
-typedef struct PACKED _FRAME_DELBA_REQ {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- DELBA_PARM DelbaParm;
- USHORT ReasonCode;
-} FRAME_DELBA_REQ, *PFRAME_DELBA_REQ;
-
-
-//7.2.1.7
-typedef struct PACKED _FRAME_BAR {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- BAR_CONTROL BarControl;
- BASEQ_CONTROL StartingSeq;
-} FRAME_BAR, *PFRAME_BAR;
-
-//7.2.1.7
-typedef struct PACKED _FRAME_BA {
- FRAME_CONTROL FC;
- USHORT Duration;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- BAR_CONTROL BarControl;
- BASEQ_CONTROL StartingSeq;
- UCHAR bitmask[8];
-} FRAME_BA, *PFRAME_BA;
-
-
-// Radio Measuement Request Frame Format
-typedef struct PACKED _FRAME_RM_REQ_ACTION {
- HEADER_802_11 Hdr;
- UCHAR Category;
- UCHAR Action;
- UCHAR Token;
- USHORT Repetition;
- UCHAR data[0];
-} FRAME_RM_REQ_ACTION, *PFRAME_RM_REQ_ACTION;
-
-typedef struct PACKED {
- UCHAR ID;
- UCHAR Length;
- UCHAR ChannelSwitchMode;
- UCHAR NewRegClass;
- UCHAR NewChannelNum;
- UCHAR ChannelSwitchCount;
-} HT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE, *PHT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE;
-
-
-//
-// _Limit must be the 2**n - 1
-// _SEQ1 , _SEQ2 must be within 0 ~ _Limit
-//
-#define SEQ_STEPONE(_SEQ1, _SEQ2, _Limit) ((_SEQ1 == ((_SEQ2+1) & _Limit)))
-#define SEQ_SMALLER(_SEQ1, _SEQ2, _Limit) (((_SEQ1-_SEQ2) & ((_Limit+1)>>1)))
-#define SEQ_LARGER(_SEQ1, _SEQ2, _Limit) ((_SEQ1 != _SEQ2) && !(((_SEQ1-_SEQ2) & ((_Limit+1)>>1))))
-#define SEQ_WITHIN_WIN(_SEQ1, _SEQ2, _WIN, _Limit) (SEQ_LARGER(_SEQ1, _SEQ2, _Limit) && \
- SEQ_SMALLER(_SEQ1, ((_SEQ2+_WIN+1)&_Limit), _Limit))
-
-//
-// Contention-free parameter (without ID and Length)
-//
-typedef struct PACKED {
- BOOLEAN bValid; // 1: variable contains valid value
- UCHAR CfpCount;
- UCHAR CfpPeriod;
- USHORT CfpMaxDuration;
- USHORT CfpDurRemaining;
-} CF_PARM, *PCF_PARM;
-
-typedef struct _CIPHER_SUITE {
- NDIS_802_11_ENCRYPTION_STATUS PairCipher; // Unicast cipher 1, this one has more secured cipher suite
- NDIS_802_11_ENCRYPTION_STATUS PairCipherAux; // Unicast cipher 2 if AP announce two unicast cipher suite
- NDIS_802_11_ENCRYPTION_STATUS GroupCipher; // Group cipher
- USHORT RsnCapability; // RSN capability from beacon
- BOOLEAN bMixMode; // Indicate Pair & Group cipher might be different
-} CIPHER_SUITE, *PCIPHER_SUITE;
-
-// EDCA configuration from AP's BEACON/ProbeRsp
-typedef struct {
- BOOLEAN bValid; // 1: variable contains valid value
- BOOLEAN bAdd; // 1: variable contains valid value
- BOOLEAN bQAck;
- BOOLEAN bQueueRequest;
- BOOLEAN bTxopRequest;
- BOOLEAN bAPSDCapable;
-// BOOLEAN bMoreDataAck;
- UCHAR EdcaUpdateCount;
- UCHAR Aifsn[4]; // 0:AC_BK, 1:AC_BE, 2:AC_VI, 3:AC_VO
- UCHAR Cwmin[4];
- UCHAR Cwmax[4];
- USHORT Txop[4]; // in unit of 32-us
- BOOLEAN bACM[4]; // 1: Admission Control of AC_BK is mandattory
-} EDCA_PARM, *PEDCA_PARM;
-
-// QBSS LOAD information from QAP's BEACON/ProbeRsp
-typedef struct {
- BOOLEAN bValid; // 1: variable contains valid value
- USHORT StaNum;
- UCHAR ChannelUtilization;
- USHORT RemainingAdmissionControl; // in unit of 32-us
-} QBSS_LOAD_PARM, *PQBSS_LOAD_PARM;
-
-// QBSS Info field in QSTA's assoc req
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- UCHAR Rsv2:1;
- UCHAR MaxSPLength:2;
- UCHAR Rsv1:1;
- UCHAR UAPSD_AC_BE:1;
- UCHAR UAPSD_AC_BK:1;
- UCHAR UAPSD_AC_VI:1;
- UCHAR UAPSD_AC_VO:1;
-#else
- UCHAR UAPSD_AC_VO:1;
- UCHAR UAPSD_AC_VI:1;
- UCHAR UAPSD_AC_BK:1;
- UCHAR UAPSD_AC_BE:1;
- UCHAR Rsv1:1;
- UCHAR MaxSPLength:2;
- UCHAR Rsv2:1;
-#endif /* !RT_BIG_ENDIAN */
-} QBSS_STA_INFO_PARM, *PQBSS_STA_INFO_PARM;
-
-// QBSS Info field in QAP's Beacon/ProbeRsp
-typedef struct PACKED {
-#ifdef RT_BIG_ENDIAN
- UCHAR UAPSD:1;
- UCHAR Rsv:3;
- UCHAR ParamSetCount:4;
-#else
- UCHAR ParamSetCount:4;
- UCHAR Rsv:3;
- UCHAR UAPSD:1;
-#endif /* !RT_BIG_ENDIAN */
-} QBSS_AP_INFO_PARM, *PQBSS_AP_INFO_PARM;
-
-// QOS Capability reported in QAP's BEACON/ProbeRsp
-// QOS Capability sent out in QSTA's AssociateReq/ReAssociateReq
-typedef struct {
- BOOLEAN bValid; // 1: variable contains valid value
- BOOLEAN bQAck;
- BOOLEAN bQueueRequest;
- BOOLEAN bTxopRequest;
-// BOOLEAN bMoreDataAck;
- UCHAR EdcaUpdateCount;
-} QOS_CAPABILITY_PARM, *PQOS_CAPABILITY_PARM;
-
-#ifdef CONFIG_STA_SUPPORT
-typedef struct {
- UCHAR IELen;
- UCHAR IE[MAX_CUSTOM_LEN];
-} WPA_IE_;
-#endif // CONFIG_STA_SUPPORT //
-
-
-typedef struct {
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR Channel;
- UCHAR CentralChannel; //Store the wide-band central channel for 40MHz. .used in 40MHz AP. Or this is the same as Channel.
- UCHAR BssType;
- USHORT AtimWin;
- USHORT BeaconPeriod;
-
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen;
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR ExtRateLen;
- HT_CAPABILITY_IE HtCapability;
- UCHAR HtCapabilityLen;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR AddHtInfoLen;
- UCHAR NewExtChanOffset;
- CHAR Rssi;
- UCHAR Privacy; // Indicate security function ON/OFF. Don't mess up with auth mode.
- UCHAR Hidden;
-
- USHORT DtimPeriod;
- USHORT CapabilityInfo;
-
- USHORT CfpCount;
- USHORT CfpPeriod;
- USHORT CfpMaxDuration;
- USHORT CfpDurRemaining;
- UCHAR SsidLen;
- CHAR Ssid[MAX_LEN_OF_SSID];
-
- ULONG LastBeaconRxTime; // OS's timestamp
-
- BOOLEAN bSES;
-
- // New for WPA2
- CIPHER_SUITE WPA; // AP announced WPA cipher suite
- CIPHER_SUITE WPA2; // AP announced WPA2 cipher suite
-
- // New for microsoft WPA support
- NDIS_802_11_FIXED_IEs FixIEs;
- NDIS_802_11_AUTHENTICATION_MODE AuthModeAux; // Addition mode for WPA2 / WPA capable AP
- NDIS_802_11_AUTHENTICATION_MODE AuthMode;
- NDIS_802_11_WEP_STATUS WepStatus; // Unicast Encryption Algorithm extract from VAR_IE
- USHORT VarIELen; // Length of next VIE include EID & Length
- UCHAR VarIEs[MAX_VIE_LEN];
-
- // CCX Ckip information
- UCHAR CkipFlag;
-
- // CCX 2 TSF
- UCHAR PTSF[4]; // Parent TSF
- UCHAR TTSF[8]; // Target TSF
-
- // 802.11e d9, and WMM
- EDCA_PARM EdcaParm;
- QOS_CAPABILITY_PARM QosCapability;
- QBSS_LOAD_PARM QbssLoad;
-#ifdef CONFIG_STA_SUPPORT
- WPA_IE_ WpaIE;
- WPA_IE_ RsnIE;
-#ifdef EXT_BUILD_CHANNEL_LIST
- UCHAR CountryString[3];
- BOOLEAN bHasCountryIE;
-#endif // EXT_BUILD_CHANNEL_LIST //
-#endif // CONFIG_STA_SUPPORT //
-
-} BSS_ENTRY, *PBSS_ENTRY;
-
-typedef struct {
- UCHAR BssNr;
- UCHAR BssOverlapNr;
- BSS_ENTRY BssEntry[MAX_LEN_OF_BSS_TABLE];
-} BSS_TABLE, *PBSS_TABLE;
-
-
-typedef struct _MLME_QUEUE_ELEM {
- ULONG Machine;
- ULONG MsgType;
- ULONG MsgLen;
- UCHAR Msg[MGMT_DMA_BUFFER_SIZE];
- LARGE_INTEGER TimeStamp;
- UCHAR Rssi0;
- UCHAR Rssi1;
- UCHAR Rssi2;
- UCHAR Signal;
- UCHAR Channel;
- UCHAR Wcid;
- BOOLEAN Occupied;
-#ifdef MLME_EX
- USHORT Idx;
-#endif // MLME_EX //
-} MLME_QUEUE_ELEM, *PMLME_QUEUE_ELEM;
-
-typedef struct _MLME_QUEUE {
- ULONG Num;
- ULONG Head;
- ULONG Tail;
- NDIS_SPIN_LOCK Lock;
- MLME_QUEUE_ELEM Entry[MAX_LEN_OF_MLME_QUEUE];
-} MLME_QUEUE, *PMLME_QUEUE;
-
-typedef VOID (*STATE_MACHINE_FUNC)(VOID *Adaptor, MLME_QUEUE_ELEM *Elem);
-
-typedef struct _STATE_MACHINE {
- ULONG Base;
- ULONG NrState;
- ULONG NrMsg;
- ULONG CurrState;
- STATE_MACHINE_FUNC *TransFunc;
-} STATE_MACHINE, *PSTATE_MACHINE;
-
-
-// MLME AUX data structure that hold temporarliy settings during a connection attempt.
-// Once this attemp succeeds, all settings will be copy to pAd->StaActive.
-// A connection attempt (user set OID, roaming, CCX fast roaming,..) consists of
-// several steps (JOIN, AUTH, ASSOC or REASSOC) and may fail at any step. We purposely
-// separate this under-trial settings away from pAd->StaActive so that once
-// this new attempt failed, driver can auto-recover back to the active settings.
-typedef struct _MLME_AUX {
- UCHAR BssType;
- UCHAR Ssid[MAX_LEN_OF_SSID];
- UCHAR SsidLen;
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR AutoReconnectSsid[MAX_LEN_OF_SSID];
- UCHAR AutoReconnectSsidLen;
- USHORT Alg;
- UCHAR ScanType;
- UCHAR Channel;
- UCHAR CentralChannel;
- USHORT Aid;
- USHORT CapabilityInfo;
- USHORT BeaconPeriod;
- USHORT CfpMaxDuration;
- USHORT CfpPeriod;
- USHORT AtimWin;
-
- // Copy supported rate from desired AP's beacon. We are trying to match
- // AP's supported and extended rate settings.
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen;
- UCHAR ExtRateLen;
- HT_CAPABILITY_IE HtCapability;
- UCHAR HtCapabilityLen;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR NewExtChannelOffset;
- //RT_HT_CAPABILITY SupportedHtPhy;
-
- // new for QOS
- QOS_CAPABILITY_PARM APQosCapability; // QOS capability of the current associated AP
- EDCA_PARM APEdcaParm; // EDCA parameters of the current associated AP
- QBSS_LOAD_PARM APQbssLoad; // QBSS load of the current associated AP
-
- // new to keep Ralink specific feature
- ULONG APRalinkIe;
-
- BSS_TABLE SsidBssTab; // AP list for the same SSID
- BSS_TABLE RoamTab; // AP list eligible for roaming
- ULONG BssIdx;
- ULONG RoamIdx;
-
- BOOLEAN CurrReqIsFromNdis;
-
- RALINK_TIMER_STRUCT BeaconTimer, ScanTimer;
- RALINK_TIMER_STRUCT AuthTimer;
- RALINK_TIMER_STRUCT AssocTimer, ReassocTimer, DisassocTimer;
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-} MLME_AUX, *PMLME_AUX;
-
-typedef struct _MLME_ADDBA_REQ_STRUCT{
- UCHAR Wcid; //
- UCHAR pAddr[MAC_ADDR_LEN];
- UCHAR BaBufSize;
- USHORT TimeOutValue;
- UCHAR TID;
- UCHAR Token;
- USHORT BaStartSeq;
-} MLME_ADDBA_REQ_STRUCT, *PMLME_ADDBA_REQ_STRUCT;
-
-
-typedef struct _MLME_DELBA_REQ_STRUCT{
- UCHAR Wcid; //
- UCHAR Addr[MAC_ADDR_LEN];
- UCHAR TID;
- UCHAR Initiator;
-} MLME_DELBA_REQ_STRUCT, *PMLME_DELBA_REQ_STRUCT;
-
-// assoc struct is equal to reassoc
-typedef struct _MLME_ASSOC_REQ_STRUCT{
- UCHAR Addr[MAC_ADDR_LEN];
- USHORT CapabilityInfo;
- USHORT ListenIntv;
- ULONG Timeout;
-} MLME_ASSOC_REQ_STRUCT, *PMLME_ASSOC_REQ_STRUCT, MLME_REASSOC_REQ_STRUCT, *PMLME_REASSOC_REQ_STRUCT;
-
-typedef struct _MLME_DISASSOC_REQ_STRUCT{
- UCHAR Addr[MAC_ADDR_LEN];
- USHORT Reason;
-} MLME_DISASSOC_REQ_STRUCT, *PMLME_DISASSOC_REQ_STRUCT;
-
-typedef struct _MLME_AUTH_REQ_STRUCT {
- UCHAR Addr[MAC_ADDR_LEN];
- USHORT Alg;
- ULONG Timeout;
-} MLME_AUTH_REQ_STRUCT, *PMLME_AUTH_REQ_STRUCT;
-
-typedef struct _MLME_DEAUTH_REQ_STRUCT {
- UCHAR Addr[MAC_ADDR_LEN];
- USHORT Reason;
-} MLME_DEAUTH_REQ_STRUCT, *PMLME_DEAUTH_REQ_STRUCT;
-
-typedef struct {
- ULONG BssIdx;
-} MLME_JOIN_REQ_STRUCT;
-
-typedef struct _MLME_SCAN_REQ_STRUCT {
- UCHAR Bssid[MAC_ADDR_LEN];
- UCHAR BssType;
- UCHAR ScanType;
- UCHAR SsidLen;
- CHAR Ssid[MAX_LEN_OF_SSID];
-} MLME_SCAN_REQ_STRUCT, *PMLME_SCAN_REQ_STRUCT;
-
-typedef struct _MLME_START_REQ_STRUCT {
- CHAR Ssid[MAX_LEN_OF_SSID];
- UCHAR SsidLen;
-} MLME_START_REQ_STRUCT, *PMLME_START_REQ_STRUCT;
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
-// structure for DLS
-typedef struct _RT_802_11_DLS {
- USHORT TimeOut; // Use to time out while slience, unit: second , set by UI
- USHORT CountDownTimer; // Use to time out while slience,unit: second , used by driver only
- NDIS_802_11_MAC_ADDRESS MacAddr; // set by UI
- UCHAR Status; // 0: none , 1: wait STAkey, 2: finish DLS setup , set by driver only
- BOOLEAN Valid; // 1: valid , 0: invalid , set by UI, use to setup or tear down DLS link
- RALINK_TIMER_STRUCT Timer; // Use to time out while handshake
- USHORT Sequence;
- USHORT MacTabMatchWCID; // ASIC
- BOOLEAN bHTCap;
- PVOID pAd;
-} RT_802_11_DLS, *PRT_802_11_DLS;
-
-typedef struct _MLME_DLS_REQ_STRUCT {
- PRT_802_11_DLS pDLS;
- USHORT Reason;
-} MLME_DLS_REQ_STRUCT, *PMLME_DLS_REQ_STRUCT;
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-typedef struct PACKED {
- UCHAR Eid;
- UCHAR Len;
- UCHAR Octet[1];
-} EID_STRUCT,*PEID_STRUCT, BEACON_EID_STRUCT, *PBEACON_EID_STRUCT;
-
-typedef struct PACKED _RTMP_TX_RATE_SWITCH
-{
- UCHAR ItemNo;
-#ifdef RT_BIG_ENDIAN
- UCHAR Rsv2:2;
- UCHAR Mode:2;
- UCHAR Rsv1:1;
- UCHAR BW:1;
- UCHAR ShortGI:1;
- UCHAR STBC:1;
-#else
- UCHAR STBC:1;
- UCHAR ShortGI:1;
- UCHAR BW:1;
- UCHAR Rsv1:1;
- UCHAR Mode:2;
- UCHAR Rsv2:2;
-#endif
- UCHAR CurrMCS;
- UCHAR TrainUp;
- UCHAR TrainDown;
-} RRTMP_TX_RATE_SWITCH, *PRTMP_TX_RATE_SWITCH;
-
-// ========================== AP mlme.h ===============================
-#define TBTT_PRELOAD_TIME 384 // usec. LomgPreamble + 24-byte at 1Mbps
-#define DEFAULT_DTIM_PERIOD 1
-
-// weighting factor to calculate Channel quality, total should be 100%
-//#define RSSI_WEIGHTING 0
-//#define TX_WEIGHTING 40
-//#define RX_WEIGHTING 60
-
-#define MAC_TABLE_AGEOUT_TIME 300 // unit: sec
-#define MAC_TABLE_ASSOC_TIMEOUT 5 // unit: sec
-#define MAC_TABLE_FULL(Tab) ((Tab).size == MAX_LEN_OF_MAC_TABLE)
-
-// AP shall drop the sta if contine Tx fail count reach it.
-#define MAC_ENTRY_LIFE_CHECK_CNT 20 // packet cnt.
-
-// Value domain of pMacEntry->Sst
-typedef enum _Sst {
- SST_NOT_AUTH, // 0: equivalent to IEEE 802.11/1999 state 1
- SST_AUTH, // 1: equivalent to IEEE 802.11/1999 state 2
- SST_ASSOC // 2: equivalent to IEEE 802.11/1999 state 3
-} SST;
-
-// value domain of pMacEntry->AuthState
-typedef enum _AuthState {
- AS_NOT_AUTH,
- AS_AUTH_OPEN, // STA has been authenticated using OPEN SYSTEM
- AS_AUTH_KEY, // STA has been authenticated using SHARED KEY
- AS_AUTHENTICATING // STA is waiting for AUTH seq#3 using SHARED KEY
-} AUTH_STATE;
-
-//for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
-typedef enum _ApWpaState {
- AS_NOTUSE, // 0
- AS_DISCONNECT, // 1
- AS_DISCONNECTED, // 2
- AS_INITIALIZE, // 3
- AS_AUTHENTICATION, // 4
- AS_AUTHENTICATION2, // 5
- AS_INITPMK, // 6
- AS_INITPSK, // 7
- AS_PTKSTART, // 8
- AS_PTKINIT_NEGOTIATING, // 9
- AS_PTKINITDONE, // 10
- AS_UPDATEKEYS, // 11
- AS_INTEGRITY_FAILURE, // 12
- AS_KEYUPDATE, // 13
-} AP_WPA_STATE;
-
-// for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
-typedef enum _GTKState {
- REKEY_NEGOTIATING,
- REKEY_ESTABLISHED,
- KEYERROR,
-} GTK_STATE;
-
-// for-wpa value domain of pMacEntry->WpaState 802.1i D3 p.114
-typedef enum _WpaGTKState {
- SETKEYS,
- SETKEYS_DONE,
-} WPA_GTK_STATE;
-// ====================== end of AP mlme.h ============================
-
-
-#endif // MLME_H__
diff --git a/drivers/staging/rt3090/mlme_ex.h b/drivers/staging/rt3090/mlme_ex.h
deleted file mode 100644
index b3e94dc88375..000000000000
--- a/drivers/staging/rt3090/mlme_ex.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- mlme_ex.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi 2007-06-25 Extend original mlme APIs to support multi-entries
-*/
-#ifndef __MLME_EX_H__
-#define __MLME_EX_H__
-
-#include "mlme_ex_def.h"
-
-
-VOID StateMachineInitEx(
- IN STATE_MACHINE_EX *S,
- IN STATE_MACHINE_FUNC_EX Trans[],
- IN ULONG StNr,
- IN ULONG MsgNr,
- IN STATE_MACHINE_FUNC_EX DefFunc,
- IN ULONG InitState,
- IN ULONG Base);
-
-VOID StateMachineSetActionEx(
- IN STATE_MACHINE_EX *S,
- IN ULONG St,
- IN ULONG Msg,
- IN STATE_MACHINE_FUNC_EX Func);
-
-BOOLEAN isValidApCliIf(
- SHORT Idx);
-
-VOID StateMachinePerformActionEx(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE_EX *S,
- IN MLME_QUEUE_ELEM *Elem,
- USHORT Idx,
- PULONG pCurrState);
-
-BOOLEAN MlmeEnqueueEx(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Machine,
- IN ULONG MsgType,
- IN ULONG MsgLen,
- IN VOID *Msg,
- IN USHORT Idx);
-
-VOID DropEx(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem,
- PULONG pCurrState,
- USHORT Idx);
-
-#endif /* __MLME_EX_H__ */
diff --git a/drivers/staging/rt3090/mlme_ex_def.h b/drivers/staging/rt3090/mlme_ex_def.h
deleted file mode 100644
index ccd60b41614a..000000000000
--- a/drivers/staging/rt3090/mlme_ex_def.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- mlme_ex_def.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Fonchi 2007-06-25 Extend original mlme APIs to support multi-entries
-*/
-#ifndef __MLME_EX_DEF_H__
-#define __MLME_EX_DEF_H__
-
-
-typedef VOID (*STATE_MACHINE_FUNC_EX)(VOID *Adaptor, MLME_QUEUE_ELEM *Elem, PULONG pCurrState, USHORT Idx);
-
-typedef struct _STA_STATE_MACHINE_EX
-{
- ULONG Base;
- ULONG NrState;
- ULONG NrMsg;
- ULONG CurrState;
- STATE_MACHINE_FUNC_EX *TransFunc;
-} STATE_MACHINE_EX, *PSTA_STATE_MACHINE_EX;
-
-#endif // __MLME_EX_DEF_H__ //
diff --git a/drivers/staging/rt3090/oid.h b/drivers/staging/rt3090/oid.h
deleted file mode 100644
index 29a43401095e..000000000000
--- a/drivers/staging/rt3090/oid.h
+++ /dev/null
@@ -1,1144 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- oid.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
-*/
-#ifndef _OID_H_
-#define _OID_H_
-
-//#include <linux/wireless.h>
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-//
-// IEEE 802.11 Structures and definitions
-//
-#define MAX_TX_POWER_LEVEL 100 /* mW */
-#define MAX_RSSI_TRIGGER -10 /* dBm */
-#define MIN_RSSI_TRIGGER -200 /* dBm */
-#define MAX_FRAG_THRESHOLD 2346 /* byte count */
-#define MIN_FRAG_THRESHOLD 256 /* byte count */
-#define MAX_RTS_THRESHOLD 2347 /* byte count */
-
-// new types for Media Specific Indications
-// Extension channel offset
-#define EXTCHA_NONE 0
-#define EXTCHA_ABOVE 0x1
-#define EXTCHA_BELOW 0x3
-
-// BW
-#define BAND_WIDTH_20 0
-#define BAND_WIDTH_40 1
-#define BAND_WIDTH_BOTH 2
-#define BAND_WIDTH_10 3 // 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field.
-// SHORTGI
-#define GAP_INTERVAL_400 1 // only support in HT mode
-#define GAP_INTERVAL_800 0
-#define GAP_INTERVAL_BOTH 2
-
-#define NdisMediaStateConnected 1
-#define NdisMediaStateDisconnected 0
-
-#define NDIS_802_11_LENGTH_SSID 32
-#define NDIS_802_11_LENGTH_RATES 8
-#define NDIS_802_11_LENGTH_RATES_EX 16
-#define MAC_ADDR_LENGTH 6
-//#define MAX_NUM_OF_CHS 49 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL terminationc
-#define MAX_NUM_OF_CHS 54 // 14 channels @2.4G + 12@UNII(lower/middle) + 16@HiperLAN2 + 11@UNII(upper) + 0 @Japan + 1 as NULL termination
-#define MAX_NUMBER_OF_EVENT 10 // entry # in EVENT table
-#define MAX_NUMBER_OF_MAC 32 // if MAX_MBSSID_NUM is 8, this value can't be larger than 211
-#define MAX_NUMBER_OF_ACL 64
-#define MAX_LENGTH_OF_SUPPORT_RATES 12 // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
-#define MAX_NUMBER_OF_DLS_ENTRY 4
-
-
-#define RT_QUERY_SIGNAL_CONTEXT 0x0402
-#define RT_SET_IAPP_PID 0x0404
-#define RT_SET_APD_PID 0x0405
-#define RT_SET_DEL_MAC_ENTRY 0x0406
-#define RT_QUERY_EVENT_TABLE 0x0407
-//
-// IEEE 802.11 OIDs
-//
-#define OID_GET_SET_TOGGLE 0x8000
-#define OID_GET_SET_FROM_UI 0x4000
-
-#define OID_802_11_NETWORK_TYPES_SUPPORTED 0x0103
-#define OID_802_11_NETWORK_TYPE_IN_USE 0x0104
-#define OID_802_11_RSSI_TRIGGER 0x0107
-#define RT_OID_802_11_RSSI 0x0108 //rt2860 only , kathy
-#define RT_OID_802_11_RSSI_1 0x0109 //rt2860 only , kathy
-#define RT_OID_802_11_RSSI_2 0x010A //rt2860 only , kathy
-#define OID_802_11_NUMBER_OF_ANTENNAS 0x010B
-#define OID_802_11_RX_ANTENNA_SELECTED 0x010C
-#define OID_802_11_TX_ANTENNA_SELECTED 0x010D
-#define OID_802_11_SUPPORTED_RATES 0x010E
-#define OID_802_11_ADD_WEP 0x0112
-#define OID_802_11_REMOVE_WEP 0x0113
-#define OID_802_11_DISASSOCIATE 0x0114
-#define OID_802_11_PRIVACY_FILTER 0x0118
-#define OID_802_11_ASSOCIATION_INFORMATION 0x011E
-#define OID_802_11_TEST 0x011F
-
-
-#define RT_OID_802_11_COUNTRY_REGION 0x0507
-#define OID_802_11_BSSID_LIST_SCAN 0x0508
-#define OID_802_11_SSID 0x0509
-#define OID_802_11_BSSID 0x050A
-#define RT_OID_802_11_RADIO 0x050B
-#define RT_OID_802_11_PHY_MODE 0x050C
-#define RT_OID_802_11_STA_CONFIG 0x050D
-#define OID_802_11_DESIRED_RATES 0x050E
-#define RT_OID_802_11_PREAMBLE 0x050F
-#define OID_802_11_WEP_STATUS 0x0510
-#define OID_802_11_AUTHENTICATION_MODE 0x0511
-#define OID_802_11_INFRASTRUCTURE_MODE 0x0512
-#define RT_OID_802_11_RESET_COUNTERS 0x0513
-#define OID_802_11_RTS_THRESHOLD 0x0514
-#define OID_802_11_FRAGMENTATION_THRESHOLD 0x0515
-#define OID_802_11_POWER_MODE 0x0516
-#define OID_802_11_TX_POWER_LEVEL 0x0517
-#define RT_OID_802_11_ADD_WPA 0x0518
-#define OID_802_11_REMOVE_KEY 0x0519
-#define OID_802_11_ADD_KEY 0x0520
-#define OID_802_11_CONFIGURATION 0x0521
-#define OID_802_11_TX_PACKET_BURST 0x0522
-#define RT_OID_802_11_QUERY_NOISE_LEVEL 0x0523
-#define RT_OID_802_11_EXTRA_INFO 0x0524
-#ifdef DBG
-#define RT_OID_802_11_HARDWARE_REGISTER 0x0525
-#endif
-#define OID_802_11_ENCRYPTION_STATUS OID_802_11_WEP_STATUS
-#define OID_802_11_DEAUTHENTICATION 0x0526
-#define OID_802_11_DROP_UNENCRYPTED 0x0527
-#define OID_802_11_MIC_FAILURE_REPORT_FRAME 0x0528
-#define OID_802_11_EAP_METHOD 0x0529
-
-// For 802.1x daemin using to require current driver configuration
-#define OID_802_11_RADIUS_QUERY_SETTING 0x0540
-
-#define RT_OID_DEVICE_NAME 0x0607
-#define RT_OID_VERSION_INFO 0x0608
-#define OID_802_11_BSSID_LIST 0x0609
-#define OID_802_3_CURRENT_ADDRESS 0x060A
-#define OID_GEN_MEDIA_CONNECT_STATUS 0x060B
-#define RT_OID_802_11_QUERY_LINK_STATUS 0x060C
-#define OID_802_11_RSSI 0x060D
-#define OID_802_11_STATISTICS 0x060E
-#define OID_GEN_RCV_OK 0x060F
-#define OID_GEN_RCV_NO_BUFFER 0x0610
-#define RT_OID_802_11_QUERY_EEPROM_VERSION 0x0611
-#define RT_OID_802_11_QUERY_FIRMWARE_VERSION 0x0612
-#define RT_OID_802_11_QUERY_LAST_RX_RATE 0x0613
-#define RT_OID_802_11_TX_POWER_LEVEL_1 0x0614
-#define RT_OID_802_11_QUERY_PIDVID 0x0615
-//for WPA_SUPPLICANT_SUPPORT
-#define OID_SET_COUNTERMEASURES 0x0616
-#define OID_802_11_SET_IEEE8021X 0x0617
-#define OID_802_11_SET_IEEE8021X_REQUIRE_KEY 0x0618
-#define OID_802_11_PMKID 0x0620
-#define RT_OID_WPA_SUPPLICANT_SUPPORT 0x0621
-#define RT_OID_WE_VERSION_COMPILED 0x0622
-#define RT_OID_NEW_DRIVER 0x0623
-
-#define RT_OID_802_11_SNR_0 0x0630
-#define RT_OID_802_11_SNR_1 0x0631
-#define RT_OID_802_11_QUERY_LAST_TX_RATE 0x0632
-#define RT_OID_802_11_QUERY_HT_PHYMODE 0x0633
-#define RT_OID_802_11_SET_HT_PHYMODE 0x0634
-#define OID_802_11_RELOAD_DEFAULTS 0x0635
-#define RT_OID_802_11_QUERY_APSD_SETTING 0x0636
-#define RT_OID_802_11_SET_APSD_SETTING 0x0637
-#define RT_OID_802_11_QUERY_APSD_PSM 0x0638
-#define RT_OID_802_11_SET_APSD_PSM 0x0639
-#define RT_OID_802_11_QUERY_DLS 0x063A
-#define RT_OID_802_11_SET_DLS 0x063B
-#define RT_OID_802_11_QUERY_DLS_PARAM 0x063C
-#define RT_OID_802_11_SET_DLS_PARAM 0x063D
-#define RT_OID_802_11_QUERY_WMM 0x063E
-#define RT_OID_802_11_SET_WMM 0x063F
-#define RT_OID_802_11_QUERY_IMME_BA_CAP 0x0640
-#define RT_OID_802_11_SET_IMME_BA_CAP 0x0641
-#define RT_OID_802_11_QUERY_BATABLE 0x0642
-#define RT_OID_802_11_ADD_IMME_BA 0x0643
-#define RT_OID_802_11_TEAR_IMME_BA 0x0644
-#define RT_OID_DRIVER_DEVICE_NAME 0x0645
-#define RT_OID_802_11_QUERY_DAT_HT_PHYMODE 0x0646
-#define RT_OID_QUERY_MULTIPLE_CARD_SUPPORT 0x0647
-#define OID_802_11_SET_PSPXLINK_MODE 0x0648
-/*+++ add by woody +++*/
-#define OID_802_11_SET_PASSPHRASE 0x0649
-// Ralink defined OIDs
-// Dennis Lee move to platform specific
-
-#define RT_OID_802_11_BSSID (OID_GET_SET_TOGGLE | OID_802_11_BSSID)
-#define RT_OID_802_11_SSID (OID_GET_SET_TOGGLE | OID_802_11_SSID)
-#define RT_OID_802_11_INFRASTRUCTURE_MODE (OID_GET_SET_TOGGLE | OID_802_11_INFRASTRUCTURE_MODE)
-#define RT_OID_802_11_ADD_WEP (OID_GET_SET_TOGGLE | OID_802_11_ADD_WEP)
-#define RT_OID_802_11_ADD_KEY (OID_GET_SET_TOGGLE | OID_802_11_ADD_KEY)
-#define RT_OID_802_11_REMOVE_WEP (OID_GET_SET_TOGGLE | OID_802_11_REMOVE_WEP)
-#define RT_OID_802_11_REMOVE_KEY (OID_GET_SET_TOGGLE | OID_802_11_REMOVE_KEY)
-#define RT_OID_802_11_DISASSOCIATE (OID_GET_SET_TOGGLE | OID_802_11_DISASSOCIATE)
-#define RT_OID_802_11_AUTHENTICATION_MODE (OID_GET_SET_TOGGLE | OID_802_11_AUTHENTICATION_MODE)
-#define RT_OID_802_11_PRIVACY_FILTER (OID_GET_SET_TOGGLE | OID_802_11_PRIVACY_FILTER)
-#define RT_OID_802_11_BSSID_LIST_SCAN (OID_GET_SET_TOGGLE | OID_802_11_BSSID_LIST_SCAN)
-#define RT_OID_802_11_WEP_STATUS (OID_GET_SET_TOGGLE | OID_802_11_WEP_STATUS)
-#define RT_OID_802_11_RELOAD_DEFAULTS (OID_GET_SET_TOGGLE | OID_802_11_RELOAD_DEFAULTS)
-#define RT_OID_802_11_NETWORK_TYPE_IN_USE (OID_GET_SET_TOGGLE | OID_802_11_NETWORK_TYPE_IN_USE)
-#define RT_OID_802_11_TX_POWER_LEVEL (OID_GET_SET_TOGGLE | OID_802_11_TX_POWER_LEVEL)
-#define RT_OID_802_11_RSSI_TRIGGER (OID_GET_SET_TOGGLE | OID_802_11_RSSI_TRIGGER)
-#define RT_OID_802_11_FRAGMENTATION_THRESHOLD (OID_GET_SET_TOGGLE | OID_802_11_FRAGMENTATION_THRESHOLD)
-#define RT_OID_802_11_RTS_THRESHOLD (OID_GET_SET_TOGGLE | OID_802_11_RTS_THRESHOLD)
-#define RT_OID_802_11_RX_ANTENNA_SELECTED (OID_GET_SET_TOGGLE | OID_802_11_RX_ANTENNA_SELECTED)
-#define RT_OID_802_11_TX_ANTENNA_SELECTED (OID_GET_SET_TOGGLE | OID_802_11_TX_ANTENNA_SELECTED)
-#define RT_OID_802_11_SUPPORTED_RATES (OID_GET_SET_TOGGLE | OID_802_11_SUPPORTED_RATES)
-#define RT_OID_802_11_DESIRED_RATES (OID_GET_SET_TOGGLE | OID_802_11_DESIRED_RATES)
-#define RT_OID_802_11_CONFIGURATION (OID_GET_SET_TOGGLE | OID_802_11_CONFIGURATION)
-#define RT_OID_802_11_POWER_MODE (OID_GET_SET_TOGGLE | OID_802_11_POWER_MODE)
-#define RT_OID_802_11_SET_PSPXLINK_MODE (OID_GET_SET_TOGGLE | OID_802_11_SET_PSPXLINK_MODE)
-#define RT_OID_802_11_EAP_METHOD (OID_GET_SET_TOGGLE | OID_802_11_EAP_METHOD)
-#define RT_OID_802_11_SET_PASSPHRASE (OID_GET_SET_TOGGLE | OID_802_11_SET_PASSPHRASE)
-
-
-
-typedef enum _NDIS_802_11_STATUS_TYPE
-{
- Ndis802_11StatusType_Authentication,
- Ndis802_11StatusType_MediaStreamMode,
- Ndis802_11StatusType_PMKID_CandidateList,
- Ndis802_11StatusTypeMax // not a real type, defined as an upper bound
-} NDIS_802_11_STATUS_TYPE, *PNDIS_802_11_STATUS_TYPE;
-
-typedef UCHAR NDIS_802_11_MAC_ADDRESS[6];
-
-typedef struct _NDIS_802_11_STATUS_INDICATION
-{
- NDIS_802_11_STATUS_TYPE StatusType;
-} NDIS_802_11_STATUS_INDICATION, *PNDIS_802_11_STATUS_INDICATION;
-
-// mask for authentication/integrity fields
-#define NDIS_802_11_AUTH_REQUEST_AUTH_FIELDS 0x0f
-
-#define NDIS_802_11_AUTH_REQUEST_REAUTH 0x01
-#define NDIS_802_11_AUTH_REQUEST_KEYUPDATE 0x02
-#define NDIS_802_11_AUTH_REQUEST_PAIRWISE_ERROR 0x06
-#define NDIS_802_11_AUTH_REQUEST_GROUP_ERROR 0x0E
-
-typedef struct _NDIS_802_11_AUTHENTICATION_REQUEST
-{
- ULONG Length; // Length of structure
- NDIS_802_11_MAC_ADDRESS Bssid;
- ULONG Flags;
-} NDIS_802_11_AUTHENTICATION_REQUEST, *PNDIS_802_11_AUTHENTICATION_REQUEST;
-
-//Added new types for PMKID Candidate lists.
-typedef struct _PMKID_CANDIDATE {
- NDIS_802_11_MAC_ADDRESS BSSID;
- ULONG Flags;
-} PMKID_CANDIDATE, *PPMKID_CANDIDATE;
-
-typedef struct _NDIS_802_11_PMKID_CANDIDATE_LIST
-{
- ULONG Version; // Version of the structure
- ULONG NumCandidates; // No. of pmkid candidates
- PMKID_CANDIDATE CandidateList[1];
-} NDIS_802_11_PMKID_CANDIDATE_LIST, *PNDIS_802_11_PMKID_CANDIDATE_LIST;
-
-//Flags for PMKID Candidate list structure
-#define NDIS_802_11_PMKID_CANDIDATE_PREAUTH_ENABLED 0x01
-
-// Added new types for OFDM 5G and 2.4G
-typedef enum _NDIS_802_11_NETWORK_TYPE
-{
- Ndis802_11FH,
- Ndis802_11DS,
- Ndis802_11OFDM5,
- Ndis802_11OFDM24,
- Ndis802_11Automode,
- Ndis802_11OFDM5_N,
- Ndis802_11OFDM24_N,
- Ndis802_11NetworkTypeMax // not a real type, defined as an upper bound
-} NDIS_802_11_NETWORK_TYPE, *PNDIS_802_11_NETWORK_TYPE;
-
-typedef struct _NDIS_802_11_NETWORK_TYPE_LIST
-{
- UINT NumberOfItems; // in list below, at least 1
- NDIS_802_11_NETWORK_TYPE NetworkType [1];
-} NDIS_802_11_NETWORK_TYPE_LIST, *PNDIS_802_11_NETWORK_TYPE_LIST;
-
-typedef enum _NDIS_802_11_POWER_MODE
-{
- Ndis802_11PowerModeCAM,
- Ndis802_11PowerModeMAX_PSP,
- Ndis802_11PowerModeFast_PSP,
- Ndis802_11PowerModeLegacy_PSP,
- Ndis802_11PowerModeMax // not a real mode, defined as an upper bound
-} NDIS_802_11_POWER_MODE, *PNDIS_802_11_POWER_MODE;
-
-typedef ULONG NDIS_802_11_TX_POWER_LEVEL; // in milliwatts
-
-//
-// Received Signal Strength Indication
-//
-typedef LONG NDIS_802_11_RSSI; // in dBm
-
-typedef struct _NDIS_802_11_CONFIGURATION_FH
-{
- ULONG Length; // Length of structure
- ULONG HopPattern; // As defined by 802.11, MSB set
- ULONG HopSet; // to one if non-802.11
- ULONG DwellTime; // units are Kusec
-} NDIS_802_11_CONFIGURATION_FH, *PNDIS_802_11_CONFIGURATION_FH;
-
-typedef struct _NDIS_802_11_CONFIGURATION
-{
- ULONG Length; // Length of structure
- ULONG BeaconPeriod; // units are Kusec
- ULONG ATIMWindow; // units are Kusec
- ULONG DSConfig; // Frequency, units are kHz
- NDIS_802_11_CONFIGURATION_FH FHConfig;
-} NDIS_802_11_CONFIGURATION, *PNDIS_802_11_CONFIGURATION;
-
-typedef struct _NDIS_802_11_STATISTICS
-{
- ULONG Length; // Length of structure
- LARGE_INTEGER TransmittedFragmentCount;
- LARGE_INTEGER MulticastTransmittedFrameCount;
- LARGE_INTEGER FailedCount;
- LARGE_INTEGER RetryCount;
- LARGE_INTEGER MultipleRetryCount;
- LARGE_INTEGER RTSSuccessCount;
- LARGE_INTEGER RTSFailureCount;
- LARGE_INTEGER ACKFailureCount;
- LARGE_INTEGER FrameDuplicateCount;
- LARGE_INTEGER ReceivedFragmentCount;
- LARGE_INTEGER MulticastReceivedFrameCount;
- LARGE_INTEGER FCSErrorCount;
- LARGE_INTEGER TKIPLocalMICFailures;
- LARGE_INTEGER TKIPRemoteMICErrors;
- LARGE_INTEGER TKIPICVErrors;
- LARGE_INTEGER TKIPCounterMeasuresInvoked;
- LARGE_INTEGER TKIPReplays;
- LARGE_INTEGER CCMPFormatErrors;
- LARGE_INTEGER CCMPReplays;
- LARGE_INTEGER CCMPDecryptErrors;
- LARGE_INTEGER FourWayHandshakeFailures;
-} NDIS_802_11_STATISTICS, *PNDIS_802_11_STATISTICS;
-
-typedef ULONG NDIS_802_11_KEY_INDEX;
-typedef ULONGLONG NDIS_802_11_KEY_RSC;
-
-#define MAX_RADIUS_SRV_NUM 2 // 802.1x failover number
-
-typedef struct PACKED _RADIUS_SRV_INFO {
- UINT32 radius_ip;
- UINT32 radius_port;
- UCHAR radius_key[64];
- UCHAR radius_key_len;
-} RADIUS_SRV_INFO, *PRADIUS_SRV_INFO;
-
-typedef struct PACKED _RADIUS_KEY_INFO
-{
- UCHAR radius_srv_num;
- RADIUS_SRV_INFO radius_srv_info[MAX_RADIUS_SRV_NUM];
- UCHAR ieee8021xWEP; // dynamic WEP
- UCHAR key_index;
- UCHAR key_length; // length of key in bytes
- UCHAR key_material[13];
-} RADIUS_KEY_INFO, *PRADIUS_KEY_INFO;
-
-// It's used by 802.1x daemon to require relative configuration
-typedef struct PACKED _RADIUS_CONF
-{
- UINT32 Length; // Length of this structure
- UCHAR mbss_num; // indicate multiple BSS number
- UINT32 own_ip_addr;
- UINT32 retry_interval;
- UINT32 session_timeout_interval;
- UCHAR EAPifname[8][IFNAMSIZ];
- UCHAR EAPifname_len[8];
- UCHAR PreAuthifname[8][IFNAMSIZ];
- UCHAR PreAuthifname_len[8];
- RADIUS_KEY_INFO RadiusInfo[8];
-} RADIUS_CONF, *PRADIUS_CONF;
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-// Key mapping keys require a BSSID
-typedef struct _NDIS_802_11_KEY
-{
- UINT Length; // Length of this structure
- UINT KeyIndex;
- UINT KeyLength; // length of key in bytes
- NDIS_802_11_MAC_ADDRESS BSSID;
- NDIS_802_11_KEY_RSC KeyRSC;
- UCHAR KeyMaterial[1]; // variable length depending on above field
-} NDIS_802_11_KEY, *PNDIS_802_11_KEY;
-
-typedef struct _NDIS_802_11_PASSPHRASE
-{
- UINT KeyLength; // length of key in bytes
- NDIS_802_11_MAC_ADDRESS BSSID;
- UCHAR KeyMaterial[1]; // variable length depending on above field
-} NDIS_802_11_PASSPHRASE, *PNDIS_802_11_PASSPHRASE;
-#endif // CONFIG_STA_SUPPORT //
-
-typedef struct _NDIS_802_11_REMOVE_KEY
-{
- UINT Length; // Length of this structure
- UINT KeyIndex;
- NDIS_802_11_MAC_ADDRESS BSSID;
-} NDIS_802_11_REMOVE_KEY, *PNDIS_802_11_REMOVE_KEY;
-
-typedef struct _NDIS_802_11_WEP
-{
- UINT Length; // Length of this structure
- UINT KeyIndex; // 0 is the per-client key, 1-N are the
- // global keys
- UINT KeyLength; // length of key in bytes
- UCHAR KeyMaterial[1];// variable length depending on above field
-} NDIS_802_11_WEP, *PNDIS_802_11_WEP;
-
-
-typedef enum _NDIS_802_11_NETWORK_INFRASTRUCTURE
-{
- Ndis802_11IBSS,
- Ndis802_11Infrastructure,
- Ndis802_11AutoUnknown,
- Ndis802_11Monitor,
- Ndis802_11InfrastructureMax // Not a real value, defined as upper bound
-} NDIS_802_11_NETWORK_INFRASTRUCTURE, *PNDIS_802_11_NETWORK_INFRASTRUCTURE;
-
-// Add new authentication modes
-typedef enum _NDIS_802_11_AUTHENTICATION_MODE
-{
- Ndis802_11AuthModeOpen,
- Ndis802_11AuthModeShared,
- Ndis802_11AuthModeAutoSwitch,
- Ndis802_11AuthModeWPA,
- Ndis802_11AuthModeWPAPSK,
- Ndis802_11AuthModeWPANone,
- Ndis802_11AuthModeWPA2,
- Ndis802_11AuthModeWPA2PSK,
- Ndis802_11AuthModeWPA1WPA2,
- Ndis802_11AuthModeWPA1PSKWPA2PSK,
- Ndis802_11AuthModeMax // Not a real mode, defined as upper bound
-} NDIS_802_11_AUTHENTICATION_MODE, *PNDIS_802_11_AUTHENTICATION_MODE;
-
-typedef UCHAR NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; // Set of 8 data rates
-typedef UCHAR NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; // Set of 16 data rates
-
-typedef struct PACKED _NDIS_802_11_SSID
-{
- UINT SsidLength; // length of SSID field below, in bytes;
- // this can be zero.
- UCHAR Ssid[NDIS_802_11_LENGTH_SSID]; // SSID information field
-} NDIS_802_11_SSID, *PNDIS_802_11_SSID;
-
-
-typedef struct PACKED _NDIS_WLAN_BSSID
-{
- ULONG Length; // Length of this structure
- NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID
- UCHAR Reserved[2];
- NDIS_802_11_SSID Ssid; // SSID
- ULONG Privacy; // WEP encryption requirement
- NDIS_802_11_RSSI Rssi; // receive signal strength in dBm
- NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
- NDIS_802_11_CONFIGURATION Configuration;
- NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
- NDIS_802_11_RATES SupportedRates;
-} NDIS_WLAN_BSSID, *PNDIS_WLAN_BSSID;
-
-typedef struct PACKED _NDIS_802_11_BSSID_LIST
-{
- UINT NumberOfItems; // in list below, at least 1
- NDIS_WLAN_BSSID Bssid[1];
-} NDIS_802_11_BSSID_LIST, *PNDIS_802_11_BSSID_LIST;
-
-// Added Capabilities, IELength and IEs for each BSSID
-typedef struct PACKED _NDIS_WLAN_BSSID_EX
-{
- ULONG Length; // Length of this structure
- NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID
- UCHAR Reserved[2];
- NDIS_802_11_SSID Ssid; // SSID
- UINT Privacy; // WEP encryption requirement
- NDIS_802_11_RSSI Rssi; // receive signal
- // strength in dBm
- NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
- NDIS_802_11_CONFIGURATION Configuration;
- NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
- NDIS_802_11_RATES_EX SupportedRates;
- ULONG IELength;
- UCHAR IEs[1];
-} NDIS_WLAN_BSSID_EX, *PNDIS_WLAN_BSSID_EX;
-
-typedef struct PACKED _NDIS_802_11_BSSID_LIST_EX
-{
- UINT NumberOfItems; // in list below, at least 1
- NDIS_WLAN_BSSID_EX Bssid[1];
-} NDIS_802_11_BSSID_LIST_EX, *PNDIS_802_11_BSSID_LIST_EX;
-
-typedef struct PACKED _NDIS_802_11_FIXED_IEs
-{
- UCHAR Timestamp[8];
- USHORT BeaconInterval;
- USHORT Capabilities;
-} NDIS_802_11_FIXED_IEs, *PNDIS_802_11_FIXED_IEs;
-
-typedef struct _NDIS_802_11_VARIABLE_IEs
-{
- UCHAR ElementID;
- UCHAR Length; // Number of bytes in data field
- UCHAR data[1];
-} NDIS_802_11_VARIABLE_IEs, *PNDIS_802_11_VARIABLE_IEs;
-
-typedef ULONG NDIS_802_11_FRAGMENTATION_THRESHOLD;
-
-typedef ULONG NDIS_802_11_RTS_THRESHOLD;
-
-typedef ULONG NDIS_802_11_ANTENNA;
-
-typedef enum _NDIS_802_11_PRIVACY_FILTER
-{
- Ndis802_11PrivFilterAcceptAll,
- Ndis802_11PrivFilter8021xWEP
-} NDIS_802_11_PRIVACY_FILTER, *PNDIS_802_11_PRIVACY_FILTER;
-
-// Added new encryption types
-// Also aliased typedef to new name
-typedef enum _NDIS_802_11_WEP_STATUS
-{
- Ndis802_11WEPEnabled,
- Ndis802_11Encryption1Enabled = Ndis802_11WEPEnabled,
- Ndis802_11WEPDisabled,
- Ndis802_11EncryptionDisabled = Ndis802_11WEPDisabled,
- Ndis802_11WEPKeyAbsent,
- Ndis802_11Encryption1KeyAbsent = Ndis802_11WEPKeyAbsent,
- Ndis802_11WEPNotSupported,
- Ndis802_11EncryptionNotSupported = Ndis802_11WEPNotSupported,
- Ndis802_11Encryption2Enabled,
- Ndis802_11Encryption2KeyAbsent,
- Ndis802_11Encryption3Enabled,
- Ndis802_11Encryption3KeyAbsent,
- Ndis802_11Encryption4Enabled, // TKIP or AES mix
- Ndis802_11Encryption4KeyAbsent,
- Ndis802_11GroupWEP40Enabled,
- Ndis802_11GroupWEP104Enabled,
-} NDIS_802_11_WEP_STATUS, *PNDIS_802_11_WEP_STATUS,
- NDIS_802_11_ENCRYPTION_STATUS, *PNDIS_802_11_ENCRYPTION_STATUS;
-
-typedef enum _NDIS_802_11_RELOAD_DEFAULTS
-{
- Ndis802_11ReloadWEPKeys
-} NDIS_802_11_RELOAD_DEFAULTS, *PNDIS_802_11_RELOAD_DEFAULTS;
-
-#define NDIS_802_11_AI_REQFI_CAPABILITIES 1
-#define NDIS_802_11_AI_REQFI_LISTENINTERVAL 2
-#define NDIS_802_11_AI_REQFI_CURRENTAPADDRESS 4
-
-#define NDIS_802_11_AI_RESFI_CAPABILITIES 1
-#define NDIS_802_11_AI_RESFI_STATUSCODE 2
-#define NDIS_802_11_AI_RESFI_ASSOCIATIONID 4
-
-typedef struct _NDIS_802_11_AI_REQFI
-{
- USHORT Capabilities;
- USHORT ListenInterval;
- NDIS_802_11_MAC_ADDRESS CurrentAPAddress;
-} NDIS_802_11_AI_REQFI, *PNDIS_802_11_AI_REQFI;
-
-typedef struct _NDIS_802_11_AI_RESFI
-{
- USHORT Capabilities;
- USHORT StatusCode;
- USHORT AssociationId;
-} NDIS_802_11_AI_RESFI, *PNDIS_802_11_AI_RESFI;
-
-typedef struct _NDIS_802_11_ASSOCIATION_INFORMATION
-{
- ULONG Length;
- USHORT AvailableRequestFixedIEs;
- NDIS_802_11_AI_REQFI RequestFixedIEs;
- ULONG RequestIELength;
- ULONG OffsetRequestIEs;
- USHORT AvailableResponseFixedIEs;
- NDIS_802_11_AI_RESFI ResponseFixedIEs;
- ULONG ResponseIELength;
- ULONG OffsetResponseIEs;
-} NDIS_802_11_ASSOCIATION_INFORMATION, *PNDIS_802_11_ASSOCIATION_INFORMATION;
-
-typedef struct _NDIS_802_11_AUTHENTICATION_EVENT
-{
- NDIS_802_11_STATUS_INDICATION Status;
- NDIS_802_11_AUTHENTICATION_REQUEST Request[1];
-} NDIS_802_11_AUTHENTICATION_EVENT, *PNDIS_802_11_AUTHENTICATION_EVENT;
-
-/*
-typedef struct _NDIS_802_11_TEST
-{
- ULONG Length;
- ULONG Type;
- union
- {
- NDIS_802_11_AUTHENTICATION_EVENT AuthenticationEvent;
- NDIS_802_11_RSSI RssiTrigger;
- };
-} NDIS_802_11_TEST, *PNDIS_802_11_TEST;
- */
-
-// 802.11 Media stream constraints, associated with OID_802_11_MEDIA_STREAM_MODE
-typedef enum _NDIS_802_11_MEDIA_STREAM_MODE
-{
- Ndis802_11MediaStreamOff,
- Ndis802_11MediaStreamOn,
-} NDIS_802_11_MEDIA_STREAM_MODE, *PNDIS_802_11_MEDIA_STREAM_MODE;
-
-// PMKID Structures
-typedef UCHAR NDIS_802_11_PMKID_VALUE[16];
-
-#ifdef CONFIG_STA_SUPPORT
-typedef struct _BSSID_INFO
-{
- NDIS_802_11_MAC_ADDRESS BSSID;
- NDIS_802_11_PMKID_VALUE PMKID;
-} BSSID_INFO, *PBSSID_INFO;
-
-typedef struct _NDIS_802_11_PMKID
-{
- UINT Length;
- UINT BSSIDInfoCount;
- BSSID_INFO BSSIDInfo[1];
-} NDIS_802_11_PMKID, *PNDIS_802_11_PMKID;
-#endif // CONFIG_STA_SUPPORT //
-
-
-typedef struct _NDIS_802_11_AUTHENTICATION_ENCRYPTION
-{
- NDIS_802_11_AUTHENTICATION_MODE AuthModeSupported;
- NDIS_802_11_ENCRYPTION_STATUS EncryptStatusSupported;
-} NDIS_802_11_AUTHENTICATION_ENCRYPTION, *PNDIS_802_11_AUTHENTICATION_ENCRYPTION;
-
-typedef struct _NDIS_802_11_CAPABILITY
-{
- ULONG Length;
- ULONG Version;
- ULONG NoOfPMKIDs;
- ULONG NoOfAuthEncryptPairsSupported;
- NDIS_802_11_AUTHENTICATION_ENCRYPTION AuthenticationEncryptionSupported[1];
-} NDIS_802_11_CAPABILITY, *PNDIS_802_11_CAPABILITY;
-
-#ifdef LINUX
-#if WIRELESS_EXT <= 11
-#ifndef SIOCDEVPRIVATE
-#define SIOCDEVPRIVATE 0x8BE0
-#endif
-#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
-#endif
-#endif // LINUX //
-
-
-#ifdef CONFIG_STA_SUPPORT
-#define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x01) // Sync. with AP for wsc upnp daemon
-#define RTPRIV_IOCTL_SET (SIOCIWFIRSTPRIV + 0x02)
-
-#ifdef DBG
-#define RTPRIV_IOCTL_BBP (SIOCIWFIRSTPRIV + 0x03)
-#define RTPRIV_IOCTL_MAC (SIOCIWFIRSTPRIV + 0x05)
-
-#ifdef RTMP_RF_RW_SUPPORT
-// TODO: shiang, Need to reassign the oid number. ArchTeam use (SIOCIWFIRSTPRIV + 0x19) for this oid
-#define RTPRIV_IOCTL_RF (SIOCIWFIRSTPRIV + 0x13) // edit by johnli, fix read rf register problem
-#endif // RTMP_RF_RW_SUPPORT //
-
-#define RTPRIV_IOCTL_E2P (SIOCIWFIRSTPRIV + 0x07)
-#endif // DBG //
-
-#ifdef RALINK_ATE
-#ifdef RALINK_28xx_QA
-#define RTPRIV_IOCTL_ATE (SIOCIWFIRSTPRIV + 0x08)
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
-
-#define RTPRIV_IOCTL_STATISTICS (SIOCIWFIRSTPRIV + 0x09)
-#define RTPRIV_IOCTL_ADD_PMKID_CACHE (SIOCIWFIRSTPRIV + 0x0A)
-#define RTPRIV_IOCTL_RADIUS_DATA (SIOCIWFIRSTPRIV + 0x0C)
-#define RTPRIV_IOCTL_GSITESURVEY (SIOCIWFIRSTPRIV + 0x0D)
-#define RT_PRIV_IOCTL_EXT (SIOCIWFIRSTPRIV + 0x0E) // Sync. with RT61 (for wpa_supplicant)
-#define RTPRIV_IOCTL_GET_MAC_TABLE (SIOCIWFIRSTPRIV + 0x0F)
-
-#define RTPRIV_IOCTL_SHOW (SIOCIWFIRSTPRIV + 0x11)
-enum {
- SHOW_CONN_STATUS = 4,
- SHOW_DRVIER_VERION = 5,
- SHOW_BA_INFO = 6,
- SHOW_DESC_INFO = 7,
- RAIO_OFF = 10,
- RAIO_ON = 11,
-#ifdef QOS_DLS_SUPPORT
- SHOW_DLS_ENTRY_INFO = 19,
-#endif // QOS_DLS_SUPPORT //
- SHOW_CFG_VALUE = 20,
- SHOW_ADHOC_ENTRY_INFO = 21,
-};
-
-
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-#ifdef SNMP_SUPPORT
-//SNMP ieee 802dot11, kathy , 2008_0220
-// dot11res(3)
-#define RT_OID_802_11_MANUFACTUREROUI 0x0700
-#define RT_OID_802_11_MANUFACTURERNAME 0x0701
-#define RT_OID_802_11_RESOURCETYPEIDNAME 0x0702
-
-// dot11smt(1)
-#define RT_OID_802_11_PRIVACYOPTIONIMPLEMENTED 0x0703
-#define RT_OID_802_11_POWERMANAGEMENTMODE 0x0704
-#define OID_802_11_WEPDEFAULTKEYVALUE 0x0705 // read , write
-#define OID_802_11_WEPDEFAULTKEYID 0x0706
-#define RT_OID_802_11_WEPKEYMAPPINGLENGTH 0x0707
-#define OID_802_11_SHORTRETRYLIMIT 0x0708
-#define OID_802_11_LONGRETRYLIMIT 0x0709
-#define RT_OID_802_11_PRODUCTID 0x0710
-#define RT_OID_802_11_MANUFACTUREID 0x0711
-
-// //dot11Phy(4)
-#define OID_802_11_CURRENTCHANNEL 0x0712
-
-//dot11mac
-#define RT_OID_802_11_MAC_ADDRESS 0x0713
-#endif // SNMP_SUPPORT //
-
-#define OID_802_11_BUILD_CHANNEL_EX 0x0714
-#define OID_802_11_GET_CH_LIST 0x0715
-#define OID_802_11_GET_COUNTRY_CODE 0x0716
-#define OID_802_11_GET_CHANNEL_GEOGRAPHY 0x0717
-
-//#define RT_OID_802_11_STATISTICS (OID_GET_SET_TOGGLE | OID_802_11_STATISTICS)
-
-#ifdef CONFIG_STA_SUPPORT
-#define RT_OID_WSC_SET_PASSPHRASE 0x0740 // passphrase for wpa(2)-psk
-#define RT_OID_WSC_DRIVER_AUTO_CONNECT 0x0741
-#define RT_OID_WSC_QUERY_DEFAULT_PROFILE 0x0742
-#define RT_OID_WSC_SET_CONN_BY_PROFILE_INDEX 0x0743
-#define RT_OID_WSC_SET_ACTION 0x0744
-#define RT_OID_WSC_SET_SSID 0x0745
-#define RT_OID_WSC_SET_PIN_CODE 0x0746
-#define RT_OID_WSC_SET_MODE 0x0747 // PIN or PBC
-#define RT_OID_WSC_SET_CONF_MODE 0x0748 // Enrollee or Registrar
-#define RT_OID_WSC_SET_PROFILE 0x0749
-#endif // CONFIG_STA_SUPPORT //
-#define RT_OID_WSC_CONFIG_STATUS 0x074F
-#define RT_OID_802_11_WSC_QUERY_PROFILE 0x0750
-// for consistency with RT61
-#define RT_OID_WSC_QUERY_STATUS 0x0751
-#define RT_OID_WSC_PIN_CODE 0x0752
-#define RT_OID_WSC_UUID 0x0753
-#define RT_OID_WSC_SET_SELECTED_REGISTRAR 0x0754
-#define RT_OID_WSC_EAPMSG 0x0755
-#define RT_OID_WSC_MANUFACTURER 0x0756
-#define RT_OID_WSC_MODEL_NAME 0x0757
-#define RT_OID_WSC_MODEL_NO 0x0758
-#define RT_OID_WSC_SERIAL_NO 0x0759
-#define RT_OID_WSC_MAC_ADDRESS 0x0760
-
-#ifdef LLTD_SUPPORT
-// for consistency with RT61
-#define RT_OID_GET_PHY_MODE 0x761
-#endif // LLTD_SUPPORT //
-
-#ifdef NINTENDO_AP
-//#define RT_OID_NINTENDO 0x0D010770
-#define RT_OID_802_11_NINTENDO_GET_TABLE 0x0771 //((RT_OID_NINTENDO + 0x01) & 0xffff)
-#define RT_OID_802_11_NINTENDO_SET_TABLE 0x0772 //((RT_OID_NINTENDO + 0x02) & 0xffff)
-#define RT_OID_802_11_NINTENDO_CAPABLE 0x0773 //((RT_OID_NINTENDO + 0x03) & 0xffff)
-#endif // NINTENDO_AP //
-
-
-// New for MeetingHouse Api support
-#define OID_MH_802_1X_SUPPORTED 0xFFEDC100
-
-// MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!!
-typedef union _HTTRANSMIT_SETTING {
-#ifdef RT_BIG_ENDIAN
- struct {
- USHORT MODE:2; // Use definition MODE_xxx.
-// USHORT rsv:3;
- USHORT TxBF:1;
- USHORT rsv:2;
- USHORT STBC:2; //SPACE
- USHORT ShortGI:1;
- USHORT BW:1; //channel bandwidth 20MHz or 40 MHz
- USHORT MCS:7; // MCS
- } field;
-#else
- struct {
- USHORT MCS:7; // MCS
- USHORT BW:1; //channel bandwidth 20MHz or 40 MHz
- USHORT ShortGI:1;
- USHORT STBC:2; //SPACE
-// USHORT rsv:3;
- USHORT rsv:2;
- USHORT TxBF:1;
- USHORT MODE:2; // Use definition MODE_xxx.
- } field;
-#endif
- USHORT word;
- } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
-
-typedef enum _RT_802_11_PREAMBLE {
- Rt802_11PreambleLong,
- Rt802_11PreambleShort,
- Rt802_11PreambleAuto
-} RT_802_11_PREAMBLE, *PRT_802_11_PREAMBLE;
-
-typedef enum _RT_802_11_PHY_MODE {
- PHY_11BG_MIXED = 0,
- PHY_11B,
- PHY_11A,
- PHY_11ABG_MIXED,
- PHY_11G,
-#ifdef DOT11_N_SUPPORT
- PHY_11ABGN_MIXED, // both band 5
- PHY_11N_2_4G, // 11n-only with 2.4G band 6
- PHY_11GN_MIXED, // 2.4G band 7
- PHY_11AN_MIXED, // 5G band 8
- PHY_11BGN_MIXED, // if check 802.11b. 9
- PHY_11AGN_MIXED, // if check 802.11b. 10
- PHY_11N_5G, // 11n-only with 5G band 11
-#endif // DOT11_N_SUPPORT //
-} RT_802_11_PHY_MODE;
-
-
-// put all proprietery for-query objects here to reduce # of Query_OID
-typedef struct _RT_802_11_LINK_STATUS {
- ULONG CurrTxRate; // in units of 0.5Mbps
- ULONG ChannelQuality; // 0..100 %
- ULONG TxByteCount; // both ok and fail
- ULONG RxByteCount; // both ok and fail
- ULONG CentralChannel; // 40MHz central channel number
-} RT_802_11_LINK_STATUS, *PRT_802_11_LINK_STATUS;
-
-typedef struct _RT_802_11_EVENT_LOG {
- LARGE_INTEGER SystemTime; // timestammp via NdisGetCurrentSystemTime()
- UCHAR Addr[MAC_ADDR_LENGTH];
- USHORT Event; // EVENT_xxx
-} RT_802_11_EVENT_LOG, *PRT_802_11_EVENT_LOG;
-
-typedef struct _RT_802_11_EVENT_TABLE {
- ULONG Num;
- ULONG Rsv; // to align Log[] at LARGE_INEGER boundary
- RT_802_11_EVENT_LOG Log[MAX_NUMBER_OF_EVENT];
-} RT_802_11_EVENT_TABLE, PRT_802_11_EVENT_TABLE;
-
-// MIMO Tx parameter, ShortGI, MCS, STBC, etc. these are fields in TXWI. Don't change this definition!!!
-typedef union _MACHTTRANSMIT_SETTING {
- struct {
- USHORT MCS:7; // MCS
- USHORT BW:1; //channel bandwidth 20MHz or 40 MHz
- USHORT ShortGI:1;
- USHORT STBC:2; //SPACE
- USHORT rsv:3;
- USHORT MODE:2; // Use definition MODE_xxx.
- } field;
- USHORT word;
- } MACHTTRANSMIT_SETTING, *PMACHTTRANSMIT_SETTING;
-
-typedef struct _RT_802_11_MAC_ENTRY {
- UCHAR Addr[MAC_ADDR_LENGTH];
- UCHAR Aid;
- UCHAR Psm; // 0:PWR_ACTIVE, 1:PWR_SAVE
- UCHAR MimoPs; // 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled
- CHAR AvgRssi0;
- CHAR AvgRssi1;
- CHAR AvgRssi2;
- UINT32 ConnectedTime;
- MACHTTRANSMIT_SETTING TxRate;
-} RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
-
-typedef struct _RT_802_11_MAC_TABLE {
- ULONG Num;
- RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
-} RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
-
-// structure for query/set hardware register - MAC, BBP, RF register
-typedef struct _RT_802_11_HARDWARE_REGISTER {
- ULONG HardwareType; // 0:MAC, 1:BBP, 2:RF register, 3:EEPROM
- ULONG Offset; // Q/S register offset addr
- ULONG Data; // R/W data buffer
-} RT_802_11_HARDWARE_REGISTER, *PRT_802_11_HARDWARE_REGISTER;
-
-typedef struct _RT_802_11_AP_CONFIG {
- ULONG EnableTxBurst; // 0-disable, 1-enable
- ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate
- ULONG IsolateInterStaTraffic; // 0-disable, 1-enable isolation
- ULONG HideSsid; // 0-disable, 1-enable hiding
- ULONG UseBGProtection; // 0-AUTO, 1-always ON, 2-always OFF
- ULONG UseShortSlotTime; // 0-no use, 1-use 9-us short slot time
- ULONG Rsv1; // must be 0
- ULONG SystemErrorBitmap; // ignore upon SET, return system error upon QUERY
-} RT_802_11_AP_CONFIG, *PRT_802_11_AP_CONFIG;
-
-// structure to query/set STA_CONFIG
-typedef struct _RT_802_11_STA_CONFIG {
- ULONG EnableTxBurst; // 0-disable, 1-enable
- ULONG EnableTurboRate; // 0-disable, 1-enable 72/100mbps turbo rate
- ULONG UseBGProtection; // 0-AUTO, 1-always ON, 2-always OFF
- ULONG UseShortSlotTime; // 0-no use, 1-use 9-us short slot time when applicable
- ULONG AdhocMode; // 0-11b rates only (WIFI spec), 1 - b/g mixed, 2 - g only
- ULONG HwRadioStatus; // 0-OFF, 1-ON, default is 1, Read-Only
- ULONG Rsv1; // must be 0
- ULONG SystemErrorBitmap; // ignore upon SET, return system error upon QUERY
-} RT_802_11_STA_CONFIG, *PRT_802_11_STA_CONFIG;
-
-//
-// For OID Query or Set about BA structure
-//
-typedef struct _OID_BACAP_STRUC {
- UCHAR RxBAWinLimit;
- UCHAR TxBAWinLimit;
- UCHAR Policy; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid
- UCHAR MpduDensity; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use. other value invalid
- UCHAR AmsduEnable; //Enable AMSDU transmisstion
- UCHAR AmsduSize; // 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935};
- UCHAR MMPSmode; // MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable
- BOOLEAN AutoBA; // Auto BA will automatically
-} OID_BACAP_STRUC, *POID_BACAP_STRUC;
-
-typedef struct _RT_802_11_ACL_ENTRY {
- UCHAR Addr[MAC_ADDR_LENGTH];
- USHORT Rsv;
-} RT_802_11_ACL_ENTRY, *PRT_802_11_ACL_ENTRY;
-
-typedef struct PACKED _RT_802_11_ACL {
- ULONG Policy; // 0-disable, 1-positive list, 2-negative list
- ULONG Num;
- RT_802_11_ACL_ENTRY Entry[MAX_NUMBER_OF_ACL];
-} RT_802_11_ACL, *PRT_802_11_ACL;
-
-typedef struct _RT_802_11_WDS {
- ULONG Num;
- NDIS_802_11_MAC_ADDRESS Entry[24/*MAX_NUM_OF_WDS_LINK*/];
- ULONG KeyLength;
- UCHAR KeyMaterial[32];
-} RT_802_11_WDS, *PRT_802_11_WDS;
-
-typedef struct _RT_802_11_TX_RATES_ {
- UCHAR SupRateLen;
- UCHAR SupRate[MAX_LENGTH_OF_SUPPORT_RATES];
- UCHAR ExtRateLen;
- UCHAR ExtRate[MAX_LENGTH_OF_SUPPORT_RATES];
-} RT_802_11_TX_RATES, *PRT_802_11_TX_RATES;
-
-
-// Definition of extra information code
-#define GENERAL_LINK_UP 0x0 // Link is Up
-#define GENERAL_LINK_DOWN 0x1 // Link is Down
-#define HW_RADIO_OFF 0x2 // Hardware radio off
-#define SW_RADIO_OFF 0x3 // Software radio off
-#define AUTH_FAIL 0x4 // Open authentication fail
-#define AUTH_FAIL_KEYS 0x5 // Shared authentication fail
-#define ASSOC_FAIL 0x6 // Association failed
-#define EAP_MIC_FAILURE 0x7 // Deauthencation because MIC failure
-#define EAP_4WAY_TIMEOUT 0x8 // Deauthencation on 4-way handshake timeout
-#define EAP_GROUP_KEY_TIMEOUT 0x9 // Deauthencation on group key handshake timeout
-#define EAP_SUCCESS 0xa // EAP succeed
-#define DETECT_RADAR_SIGNAL 0xb // Radar signal occur in current channel
-#define EXTRA_INFO_MAX 0xb // Indicate Last OID
-
-#define EXTRA_INFO_CLEAR 0xffffffff
-
-// This is OID setting structure. So only GF or MM as Mode. This is valid when our wirelss mode has 802.11n in use.
-typedef struct {
- RT_802_11_PHY_MODE PhyMode; //
- UCHAR TransmitNo;
- UCHAR HtMode; //HTMODE_GF or HTMODE_MM
- UCHAR ExtOffset; //extension channel above or below
- UCHAR MCS;
- UCHAR BW;
- UCHAR STBC;
- UCHAR SHORTGI;
- UCHAR rsv;
-} OID_SET_HT_PHYMODE, *POID_SET_HT_PHYMODE;
-
-#ifdef NINTENDO_AP
-#define NINTENDO_MAX_ENTRY 16
-#define NINTENDO_SSID_NAME_LN 8
-#define NINTENDO_SSID_NAME "NWCUSBAP"
-#define NINTENDO_PROBE_REQ_FLAG_MASK 0x03
-#define NINTENDO_PROBE_REQ_ON 0x01
-#define NINTENDO_PROBE_REQ_SIGNAL 0x02
-#define NINTENDO_PROBE_RSP_ON 0x01
-#define NINTENDO_SSID_NICKNAME_LN 20
-
-#define NINTENDO_WEPKEY_LN 13
-
-typedef struct _NINTENDO_SSID
-{
- UCHAR NINTENDOFixChar[NINTENDO_SSID_NAME_LN];
- UCHAR zero1;
- UCHAR registe;
- UCHAR ID;
- UCHAR zero2;
- UCHAR NICKname[NINTENDO_SSID_NICKNAME_LN];
-} RT_NINTENDO_SSID, *PRT_NINTENDO_SSID;
-
-typedef struct _NINTENDO_ENTRY
-{
- UCHAR NICKname[NINTENDO_SSID_NICKNAME_LN];
- UCHAR DS_Addr[ETH_LENGTH_OF_ADDRESS];
- UCHAR registe;
- UCHAR UserSpaceAck;
-} RT_NINTENDO_ENTRY, *PRT_NINTENDO_ENTRY;
-
-//RTPRIV_IOCTL_NINTENDO_GET_TABLE
-//RTPRIV_IOCTL_NINTENDO_SET_TABLE
-typedef struct _NINTENDO_TABLE
-{
- UINT number;
- RT_NINTENDO_ENTRY entry[NINTENDO_MAX_ENTRY];
-} RT_NINTENDO_TABLE, *PRT_NINTENDO_TABLE;
-
-//RTPRIV_IOCTL_NINTENDO_SEED_WEPKEY
-typedef struct _NINTENDO_SEED_WEPKEY
-{
- UCHAR seed[NINTENDO_SSID_NICKNAME_LN];
- UCHAR wepkey[16];//use 13 for 104 bits wep key
-} RT_NINTENDO_SEED_WEPKEY, *PRT_NINTENDO_SEED_WEPKEY;
-#endif // NINTENDO_AP //
-
-#ifdef LLTD_SUPPORT
-typedef struct _RT_LLTD_ASSOICATION_ENTRY {
- UCHAR Addr[ETH_LENGTH_OF_ADDRESS];
- unsigned short MOR; // maximum operational rate
- UCHAR phyMode;
-} RT_LLTD_ASSOICATION_ENTRY, *PRT_LLTD_ASSOICATION_ENTRY;
-
-typedef struct _RT_LLTD_ASSOICATION_TABLE {
- unsigned int Num;
- RT_LLTD_ASSOICATION_ENTRY Entry[MAX_NUMBER_OF_MAC];
-} RT_LLTD_ASSOICATION_TABLE, *PRT_LLTD_ASSOICATION_TABLE;
-#endif // LLTD_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
-//rt2860, kathy 2007-0118
-// structure for DLS
-typedef struct _RT_802_11_DLS_UI {
- USHORT TimeOut; // unit: second , set by UI
- USHORT CountDownTimer; // unit: second , used by driver only
- NDIS_802_11_MAC_ADDRESS MacAddr; // set by UI
- UCHAR Status; // 0: none , 1: wait STAkey, 2: finish DLS setup , set by driver only
- BOOLEAN Valid; // 1: valid , 0: invalid , set by UI, use to setup or tear down DLS link
-} RT_802_11_DLS_UI, *PRT_802_11_DLS_UI;
-
-typedef struct _RT_802_11_DLS_INFO {
- RT_802_11_DLS_UI Entry[MAX_NUMBER_OF_DLS_ENTRY];
- UCHAR num;
-} RT_802_11_DLS_INFO, *PRT_802_11_DLS_INFO;
-
-typedef enum _RT_802_11_DLS_MODE {
- DLS_NONE,
- DLS_WAIT_KEY,
- DLS_FINISH
-} RT_802_11_DLS_MODE;
-#endif // QOS_DLS_SUPPORT //
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
-#define RT_ASSOC_EVENT_FLAG 0x0101
-#define RT_DISASSOC_EVENT_FLAG 0x0102
-#define RT_REQIE_EVENT_FLAG 0x0103
-#define RT_RESPIE_EVENT_FLAG 0x0104
-#define RT_ASSOCINFO_EVENT_FLAG 0x0105
-#define RT_PMKIDCAND_FLAG 0x0106
-#define RT_INTERFACE_DOWN 0x0107
-#define RT_INTERFACE_UP 0x0108
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-
-#define MAX_CUSTOM_LEN 128
-
-#ifdef CONFIG_STA_SUPPORT
-typedef enum _RT_802_11_D_CLIENT_MODE
-{
- Rt802_11_D_None,
- Rt802_11_D_Flexible,
- Rt802_11_D_Strict,
-} RT_802_11_D_CLIENT_MODE, *PRT_802_11_D_CLIENT_MODE;
-#endif // CONFIG_STA_SUPPORT //
-
-typedef struct _RT_CHANNEL_LIST_INFO
-{
- UCHAR ChannelList[MAX_NUM_OF_CHS]; // list all supported channels for site survey
- UCHAR ChannelListNum; // number of channel in ChannelList[]
-} RT_CHANNEL_LIST_INFO, *PRT_CHANNEL_LIST_INFO;
-
-// WSC configured credential
-typedef struct _WSC_CREDENTIAL
-{
- NDIS_802_11_SSID SSID; // mandatory
- USHORT AuthType; // mandatory, 1: open, 2: wpa-psk, 4: shared, 8:wpa, 0x10: wpa2, 0x20: wpa2-psk
- USHORT EncrType; // mandatory, 1: none, 2: wep, 4: tkip, 8: aes
- UCHAR Key[64]; // mandatory, Maximum 64 byte
- USHORT KeyLength;
- UCHAR MacAddr[6]; // mandatory, AP MAC address
- UCHAR KeyIndex; // optional, default is 1
- UCHAR Rsvd[3]; // Make alignment
-} WSC_CREDENTIAL, *PWSC_CREDENTIAL;
-
-// WSC configured profiles
-typedef struct _WSC_PROFILE
-{
- UINT ProfileCnt;
- UINT ApplyProfileIdx; // add by johnli, fix WPS test plan 5.1.1
- WSC_CREDENTIAL Profile[8]; // Support up to 8 profiles
-} WSC_PROFILE, *PWSC_PROFILE;
-
-
-
-#endif // _OID_H_
diff --git a/drivers/staging/rt3090/rt3390.h b/drivers/staging/rt3090/rt3390.h
deleted file mode 100644
index 412ab3d32ab5..000000000000
--- a/drivers/staging/rt3090/rt3390.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt3390.h
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
-
-#ifndef __RT3390_H__
-#define __RT3390_H__
-
-#ifdef RT3390
-
-#ifndef RTMP_PCI_SUPPORT
-#error "For RT3390, you should define the compile flag -DRTMP_PCI_SUPPORT"
-#endif
-
-#ifndef RTMP_MAC_PCI
-#error "For RT3390, you should define the compile flag -DRTMP_MAC_PCI"
-#endif
-
-#ifndef RTMP_RF_RW_SUPPORT
-#error "For RT3390, you should define the compile flag -DRTMP_RF_RW_SUPPORT"
-#endif
-
-#ifndef RT30xx
-#error "For RT3390, you should define the compile flag -DRT30xx"
-#endif
-
-#ifdef CARRIER_DETECTION_SUPPORT
-#define TONE_RADAR_DETECT_SUPPORT
-#define CARRIER_SENSE_NEW_ALGO
-#endif // CARRIER_DETECTION_SUPPORT //
-
-#define PCIE_PS_SUPPORT
-
-#include "mac_pci.h"
-#include "rt33xx.h"
-
-//
-// Device ID & Vendor ID, these values should match EEPROM value
-//
-#define NIC3390_PCIe_DEVICE_ID 0x3090 // 1T/1R miniCard
-#define NIC3391_PCIe_DEVICE_ID 0x3091 // 1T/2R miniCard
-#define NIC3392_PCIe_DEVICE_ID 0x3092 // 2T/2R miniCard
-
-#endif // RT3390 //
-
-#endif //__RT3390_H__ //
diff --git a/drivers/staging/rt3090/rt_ate.c b/drivers/staging/rt3090/rt_ate.c
deleted file mode 100644
index 259aae411628..000000000000
--- a/drivers/staging/rt3090/rt_ate.c
+++ /dev/null
@@ -1,6089 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#include "rt_config.h"
-
-#ifdef RALINK_ATE
-
-#ifdef RT30xx
-#define ATE_BBP_REG_NUM 168
-UCHAR restore_BBP[ATE_BBP_REG_NUM]={0};
-#endif // RT30xx //
-
-// 802.11 MAC Header, Type:Data, Length:24bytes
-UCHAR TemplateFrame[24] = {0x08,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
- 0x00,0xAA,0xBB,0x12,0x34,0x56,0x00,0x11,0x22,0xAA,0xBB,0xCC,0x00,0x00};
-
-extern RTMP_RF_REGS RF2850RegTable[];
-extern UCHAR NUM_OF_2850_CHNL;
-
-extern FREQUENCY_ITEM FreqItems3020[];
-extern UCHAR NUM_OF_3020_CHNL;
-
-
-
-
-static CHAR CCKRateTable[] = {0, 1, 2, 3, 8, 9, 10, 11, -1}; /* CCK Mode. */
-static CHAR OFDMRateTable[] = {0, 1, 2, 3, 4, 5, 6, 7, -1}; /* OFDM Mode. */
-static CHAR HTMIXRateTable[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}; /* HT Mix Mode. */
-
-static INT TxDmaBusy(
- IN PRTMP_ADAPTER pAd);
-
-static INT RxDmaBusy(
- IN PRTMP_ADAPTER pAd);
-
-static VOID RtmpDmaEnable(
- IN PRTMP_ADAPTER pAd,
- IN INT Enable);
-
-static VOID BbpSoftReset(
- IN PRTMP_ADAPTER pAd);
-
-static VOID RtmpRfIoWrite(
- IN PRTMP_ADAPTER pAd);
-
-static INT ATESetUpFrame(
- IN PRTMP_ADAPTER pAd,
- IN UINT32 TxIdx);
-
-static INT ATETxPwrHandler(
- IN PRTMP_ADAPTER pAd,
- IN char index);
-
-static INT ATECmdHandler(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifndef RT30xx
-static int CheckMCSValid(
- IN UCHAR Mode,
- IN UCHAR Mcs);
-#endif // RT30xx //
-
-#ifdef RT30xx
-static int CheckMCSValid(
- IN UCHAR Mode,
- IN UCHAR Mcs,
- IN BOOLEAN bRT2070);
-#endif // RT30xx //
-
-#ifdef RTMP_MAC_PCI
-static VOID ATEWriteTxWI(
- IN PRTMP_ADAPTER pAd,
- IN PTXWI_STRUC pOutTxWI,
- IN BOOLEAN FRAG,
- IN BOOLEAN CFACK,
- IN BOOLEAN InsTimestamp,
- IN BOOLEAN AMPDU,
- IN BOOLEAN Ack,
- IN BOOLEAN NSeq, // HW new a sequence.
- IN UCHAR BASize,
- IN UCHAR WCID,
- IN ULONG Length,
- IN UCHAR PID,
- IN UCHAR TID,
- IN UCHAR TxRate,
- IN UCHAR Txopmode,
- IN BOOLEAN CfAck,
- IN HTTRANSMIT_SETTING *pTransmit);
-#endif // RTMP_MAC_PCI //
-
-
-static VOID SetJapanFilter(
- IN PRTMP_ADAPTER pAd);
-
-
-#ifdef RALINK_28xx_QA
-static inline INT DO_RACFG_CMD_ATE_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_RF_WRITE_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_E2PROM_READ16(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_E2PROM_WRITE16(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_E2PROM_READ_ALL
-(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_E2PROM_WRITE_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_IO_READ(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_IO_WRITE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_IO_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_BBP_READ8(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_BBP_WRITE8(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_BBP_READ_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_GET_NOISE_LEVEL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_GET_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_CLEAR_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_TX_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_GET_TX_STATUS(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_TX_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_RX_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_RX_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_RX_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_CARRIER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_CONT(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_FRAME(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_BW(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_POWER0(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_POWER1(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_FREQ_OFFSET(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_GET_STATISTICS(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_RESET_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SEL_TX_ANTENNA(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SEL_RX_ANTENNA(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_PREAMBLE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_CHANNEL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR1(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR2(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR3(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_RATE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_FRAME_LEN(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_FRAME_COUNT(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_START_RX_FRAME(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_E2PROM_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_E2PROM_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_IO_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_BBP_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-static inline INT DO_RACFG_CMD_ATE_BBP_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg
-);
-
-#endif // RALINK_28xx_QA //
-
-
-#ifdef RTMP_MAC_PCI
-static INT TxDmaBusy(
- IN PRTMP_ADAPTER pAd)
-{
- INT result;
- WPDMA_GLO_CFG_STRUC GloCfg;
-
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
- if (GloCfg.field.TxDMABusy)
- result = 1;
- else
- result = 0;
-
- return result;
-}
-
-
-static INT RxDmaBusy(
- IN PRTMP_ADAPTER pAd)
-{
- INT result;
- WPDMA_GLO_CFG_STRUC GloCfg;
-
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
- if (GloCfg.field.RxDMABusy)
- result = 1;
- else
- result = 0;
-
- return result;
-}
-
-
-static VOID RtmpDmaEnable(
- IN PRTMP_ADAPTER pAd,
- IN INT Enable)
-{
- BOOLEAN value;
- ULONG WaitCnt;
- WPDMA_GLO_CFG_STRUC GloCfg;
-
- value = Enable > 0 ? 1 : 0;
-
- // check DMA is in busy mode.
- WaitCnt = 0;
-
- while (TxDmaBusy(pAd) || RxDmaBusy(pAd))
- {
- RTMPusecDelay(10);
- if (WaitCnt++ > 100)
- break;
- }
-
- RTMP_IO_READ32(pAd, WPDMA_GLO_CFG, &GloCfg.word); // disable DMA
- GloCfg.field.EnableTxDMA = value;
- GloCfg.field.EnableRxDMA = value;
- RTMP_IO_WRITE32(pAd, WPDMA_GLO_CFG, GloCfg.word); // abort all TX rings
- RTMPusecDelay(5000);
-
- return;
-}
-#endif // RTMP_MAC_PCI //
-
-
-
-
-static VOID BbpSoftReset(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR BbpData = 0;
-
- // Soft reset, set BBP R21 bit0=1->0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R21, &BbpData);
- BbpData |= 0x00000001; //set bit0=1
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R21, BbpData);
-
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R21, &BbpData);
- BbpData &= ~(0x00000001); //set bit0=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R21, BbpData);
-
- return;
-}
-
-
-static VOID RtmpRfIoWrite(
- IN PRTMP_ADAPTER pAd)
-{
- // Set RF value 1's set R3[bit2] = [0]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 & (~0x04)));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- RTMPusecDelay(200);
-
- // Set RF value 2's set R3[bit2] = [1]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 | 0x04));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- RTMPusecDelay(200);
-
- // Set RF value 3's set R3[bit2] = [0]
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAd, (pAd->LatchRfRegs.R3 & (~0x04)));
- RTMP_RF_IO_WRITE32(pAd, pAd->LatchRfRegs.R4);
-
- return;
-}
-
-
-#ifdef RT30xx
-static int CheckMCSValid(
- UCHAR Mode,
- UCHAR Mcs,
- BOOLEAN bRT2070)
-#endif // RT30xx //
-#ifndef RT30xx
-static int CheckMCSValid(
- IN UCHAR Mode,
- IN UCHAR Mcs)
-#endif // RT30xx //
-{
- INT i;
- PCHAR pRateTab;
-
- switch (Mode)
- {
- case 0:
- pRateTab = CCKRateTable;
- break;
- case 1:
- pRateTab = OFDMRateTable;
- break;
- case 2:
- case 3:
-#ifdef RT30xx
- if (bRT2070)
- pRateTab = OFDMRateTable;
- else
-#endif // RT30xx //
- pRateTab = HTMIXRateTable;
- break;
- default:
- ATEDBGPRINT(RT_DEBUG_ERROR, ("unrecognizable Tx Mode %d\n", Mode));
- return -1;
- break;
- }
-
- i = 0;
- while (pRateTab[i] != -1)
- {
- if (pRateTab[i] == Mcs)
- return 0;
- i++;
- }
-
- return -1;
-}
-
-
-static INT ATETxPwrHandler(
- IN PRTMP_ADAPTER pAd,
- IN char index)
-{
- ULONG R;
- CHAR TxPower;
- UCHAR Bbp94 = 0;
- BOOLEAN bPowerReduce = FALSE;
-#ifdef RTMP_RF_RW_SUPPORT
- UCHAR RFValue;
-#endif // RTMP_RF_RW_SUPPORT //
-#ifdef RALINK_28xx_QA
- if ((pAd->ate.bQATxStart == TRUE) || (pAd->ate.bQARxStart == TRUE))
- {
- /*
- When QA is used for Tx, pAd->ate.TxPower0/1 and real tx power
- are not synchronized.
- */
- return 0;
- }
- else
-#endif // RALINK_28xx_QA //
- {
- TxPower = index == 0 ? pAd->ate.TxPower0 : pAd->ate.TxPower1;
-
- if (pAd->ate.Channel <= 14)
- {
- if (TxPower > 31)
- {
-
- // R3, R4 can't large than 31 (0x24), 31 ~ 36 used by BBP 94
- R = 31;
- if (TxPower <= 36)
- Bbp94 = BBPR94_DEFAULT + (UCHAR)(TxPower - 31);
- }
- else if (TxPower < 0)
- {
-
- // R3, R4 can't less than 0, -1 ~ -6 used by BBP 94
- R = 0;
- if (TxPower >= -6)
- Bbp94 = BBPR94_DEFAULT + TxPower;
- }
- else
- {
- // 0 ~ 31
- R = (ULONG) TxPower;
- Bbp94 = BBPR94_DEFAULT;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%ld, BBP_R94=%d)\n", __FUNCTION__, TxPower, R, Bbp94));
- }
- else /* 5.5 GHz */
- {
- if (TxPower > 15)
- {
-
- // R3, R4 can't large than 15 (0x0F)
- R = 15;
- }
- else if (TxPower < 0)
- {
-
- // R3, R4 can't less than 0
- // -1 ~ -7
- ASSERT((TxPower >= -7));
- R = (ULONG)(TxPower + 7);
- bPowerReduce = TRUE;
- }
- else
- {
- // 0 ~ 15
- R = (ULONG) TxPower;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s (TxPower=%d, R=%lu)\n", __FUNCTION__, TxPower, R));
- }
-//2008/09/10:KH adds to support 3070 ATE TX Power tunning real time<--
-#ifdef RTMP_RF_RW_SUPPORT
- if (IS_RT30xx(pAd))
- {
- // Set Tx Power
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R12, (PUCHAR)&RFValue);
- RFValue = (RFValue & 0xE0) | TxPower;
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R12, (UCHAR)RFValue);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("3070 or 2070:%s (TxPower=%d, RFValue=%x)\n", __FUNCTION__, TxPower, RFValue));
- }
- else
-#endif // RTMP_RF_RW_SUPPORT //
- {
- if (pAd->ate.Channel <= 14)
- {
- if (index == 0)
- {
- // shift TX power control to correct RF(R3) register bit position
- R = R << 9;
- R |= (pAd->LatchRfRegs.R3 & 0xffffc1ff);
- pAd->LatchRfRegs.R3 = R;
- }
- else
- {
- // shift TX power control to correct RF(R4) register bit position
- R = R << 6;
- R |= (pAd->LatchRfRegs.R4 & 0xfffff83f);
- pAd->LatchRfRegs.R4 = R;
- }
- }
- else /* 5.5GHz */
- {
- if (bPowerReduce == FALSE)
- {
- if (index == 0)
- {
- // shift TX power control to correct RF(R3) register bit position
- R = (R << 10) | (1 << 9);
- R |= (pAd->LatchRfRegs.R3 & 0xffffc1ff);
- pAd->LatchRfRegs.R3 = R;
- }
- else
- {
- // shift TX power control to correct RF(R4) register bit position
- R = (R << 7) | (1 << 6);
- R |= (pAd->LatchRfRegs.R4 & 0xfffff83f);
- pAd->LatchRfRegs.R4 = R;
- }
- }
- else
- {
- if (index == 0)
- {
- // shift TX power control to correct RF(R3) register bit position
- R = (R << 10);
- R |= (pAd->LatchRfRegs.R3 & 0xffffc1ff);
-
- /* Clear bit 9 of R3 to reduce 7dB. */
- pAd->LatchRfRegs.R3 = (R & (~(1 << 9)));
- }
- else
- {
- // shift TX power control to correct RF(R4) register bit position
- R = (R << 7);
- R |= (pAd->LatchRfRegs.R4 & 0xfffff83f);
-
- /* Clear bit 6 of R4 to reduce 7dB. */
- pAd->LatchRfRegs.R4 = (R & (~(1 << 6)));
- }
- }
- }
- RtmpRfIoWrite(pAd);
- }
-//2008/09/10:KH adds to support 3070 ATE TX Power tunning real time-->
-
- return 0;
- }
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE operation mode to
- 0. ATESTART = Start ATE Mode
- 1. ATESTOP = Stop ATE Mode
- 2. TXCONT = Continuous Transmit
- 3. TXCARR = Transmit Carrier
- 4. TXFRAME = Transmit Frames
- 5. RXFRAME = Receive Frames
-#ifdef RALINK_28xx_QA
- 6. TXSTOP = Stop Any Type of Transmition
- 7. RXSTOP = Stop Receiving Frames
-#endif // RALINK_28xx_QA //
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-#ifdef RTMP_MAC_PCI
-static INT ATECmdHandler(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT32 Value = 0;
- UCHAR BbpData;
- UINT32 MacData = 0;
- PTXD_STRUC pTxD;
- INT index;
- UINT i = 0, atemode = 0;
- PRXD_STRUC pRxD;
- PRTMP_TX_RING pTxRing = &pAd->TxRing[QID_AC_BE];
- NDIS_STATUS Status = NDIS_STATUS_SUCCESS;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("===> ATECmdHandler()\n"));
-
- ATEAsicSwitchChannel(pAd);
-
- /* empty function */
- AsicLockChannel(pAd, pAd->ate.Channel);
-
- RTMPusecDelay(5000);
-
- // read MAC_SYS_CTRL and backup MAC_SYS_CTRL value.
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &MacData);
-
- // Default value in BBP R22 is 0x0.
- BbpData = 0;
-
- // clean bit4 to stop continuous Tx production test.
- MacData &= 0xFFFFFFEF;
-
- // Enter ATE mode and set Tx/Rx Idle
- if (!strcmp(arg, "ATESTART"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: ATESTART\n"));
-
-#if defined(LINUX) || defined(VXWORKS)
- // check if we have removed the firmware
- if (!(ATE_ON(pAd)))
- {
- NICEraseFirmware(pAd);
- }
-#endif // defined(LINUX) || defined(VXWORKS) //
-
- atemode = pAd->ate.Mode;
- pAd->ate.Mode = ATE_START;
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
-
- if (atemode == ATE_TXCARR)
- {
- // No Carrier Test set BBP R22 bit7=0, bit6=0, bit[5~0]=0x0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= 0xFFFFFF00; // clear bit7, bit6, bit[5~0]
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- }
- else if (atemode == ATE_TXCARRSUPP)
- {
- // No Cont. TX set BBP R22 bit7=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= ~(1 << 7); // set bit7=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- // No Carrier Suppression set BBP R24 bit0=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R24, &BbpData);
- BbpData &= 0xFFFFFFFE; // clear bit0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, BbpData);
- }
-
- /*
- We should free some resource which was allocated
- when ATE_TXFRAME , ATE_STOP, and ATE_TXCONT.
- */
- else if ((atemode & ATE_TXFRAME) || (atemode == ATE_STOP))
- {
- PRTMP_TX_RING pTxRing = &pAd->TxRing[QID_AC_BE];
-
- if (atemode == ATE_TXCONT)
- {
- // No Cont. TX set BBP R22 bit7=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= ~(1 << 7); // set bit7=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- }
-
- // Abort Tx, Rx DMA.
- RtmpDmaEnable(pAd, 0);
- for (i=0; i<TX_RING_SIZE; i++)
- {
- PNDIS_PACKET pPacket;
-
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- pTxD->DMADONE = 0;
- pPacket = pTxRing->Cell[i].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[i].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[i].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[i].pNextNdisPacket = NULL;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
- }
-
- // Start Tx, RX DMA
- RtmpDmaEnable(pAd, 1);
- }
-
- // reset Rx statistics.
- pAd->ate.LastSNR0 = 0;
- pAd->ate.LastSNR1 = 0;
- pAd->ate.LastRssi0 = 0;
- pAd->ate.LastRssi1 = 0;
- pAd->ate.LastRssi2 = 0;
- pAd->ate.AvgRssi0 = 0;
- pAd->ate.AvgRssi1 = 0;
- pAd->ate.AvgRssi2 = 0;
- pAd->ate.AvgRssi0X8 = 0;
- pAd->ate.AvgRssi1X8 = 0;
- pAd->ate.AvgRssi2X8 = 0;
- pAd->ate.NumOfAvgRssiSample = 0;
-
-#ifdef RALINK_28xx_QA
- // Tx frame
- pAd->ate.bQATxStart = FALSE;
- pAd->ate.bQARxStart = FALSE;
- pAd->ate.seq = 0;
-
- // counters
- pAd->ate.U2M = 0;
- pAd->ate.OtherData = 0;
- pAd->ate.Beacon = 0;
- pAd->ate.OtherCount = 0;
- pAd->ate.TxAc0 = 0;
- pAd->ate.TxAc1 = 0;
- pAd->ate.TxAc2 = 0;
- pAd->ate.TxAc3 = 0;
- /*pAd->ate.TxHCCA = 0;*/
- pAd->ate.TxMgmt = 0;
- pAd->ate.RSSI0 = 0;
- pAd->ate.RSSI1 = 0;
- pAd->ate.RSSI2 = 0;
- pAd->ate.SNR0 = 0;
- pAd->ate.SNR1 = 0;
-
- // control
- pAd->ate.TxDoneCount = 0;
- // TxStatus : 0 --> task is idle, 1 --> task is running
- pAd->ate.TxStatus = 0;
-#endif // RALINK_28xx_QA //
-
- // Soft reset BBP.
- BbpSoftReset(pAd);
-
-
-#ifdef CONFIG_STA_SUPPORT
- /* LinkDown() has "AsicDisableSync();" and "RTMP_BBP_IO_R/W8_BY_REG_ID();" inside. */
-// LinkDown(pAd, FALSE);
-// AsicEnableBssSync(pAd);
-
-#if defined(LINUX) || defined(VXWORKS)
- RTMP_OS_NETDEV_STOP_QUEUE(pAd->net_dev);
-#endif // defined(LINUX) || defined(VXWORKS) //
-
- /*
- If we skip "LinkDown()", we should disable protection
- to prevent from sending out RTS or CTS-to-self.
- */
- ATEDisableAsicProtect(pAd);
- RTMPStationStop(pAd);
-#endif // CONFIG_STA_SUPPORT //
-
- /* Disable Tx */
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- /* Disable Rx */
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
- else if (!strcmp(arg, "ATESTOP"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: ATESTOP\n"));
-
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- // recover the MAC_SYS_CTRL register back
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
-
- // disable Tx, Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= (0xfffffff3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // abort Tx, RX DMA
- RtmpDmaEnable(pAd, 0);
-
-#ifdef LINUX
- pAd->ate.bFWLoading = TRUE;
-
- Status = NICLoadFirmware(pAd);
-
- if (Status != NDIS_STATUS_SUCCESS)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("NICLoadFirmware failed, Status[=0x%08x]\n", Status));
- return FALSE;
- }
-#endif // LINUX //
- pAd->ate.Mode = ATE_STOP;
-
- /*
- Even the firmware has been loaded,
- we still could use ATE_BBP_IO_READ8_BY_REG_ID().
- But this is not suggested.
- */
- BbpSoftReset(pAd);
-
- RTMP_ASIC_INTERRUPT_DISABLE(pAd);
-
- NICInitializeAdapter(pAd, TRUE);
-
- /*
- Reinitialize Rx Ring before Rx DMA is enabled.
- >>>RxCoherent<<< was gone !
- */
- for (index = 0; index < RX_RING_SIZE; index++)
- {
- pRxD = (PRXD_STRUC) pAd->RxRing.Cell[index].AllocVa;
- pRxD->DDONE = 0;
- }
-
- // We should read EEPROM for all cases.
- NICReadEEPROMParameters(pAd, NULL);
- NICInitAsicFromEEPROM(pAd);
-
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
-
- /* empty function */
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- /* clear garbage interrupts */
- RTMP_IO_WRITE32(pAd, INT_SOURCE_CSR, 0xffffffff);
- /* Enable Interrupt */
- RTMP_ASIC_INTERRUPT_ENABLE(pAd);
-
- /* restore RX_FILTR_CFG */
-
-#ifdef CONFIG_STA_SUPPORT
- /* restore RX_FILTR_CFG due to that QA maybe set it to 0x3 */
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, STANORMAL);
-#endif // CONFIG_STA_SUPPORT //
-
- // Enable Tx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // Enable Tx, Rx DMA.
- RtmpDmaEnable(pAd, 1);
-
- // Enable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
-
-#ifdef CONFIG_STA_SUPPORT
- RTMPStationStart(pAd);
-#endif // CONFIG_STA_SUPPORT //
-
-#if defined(LINUX) || defined(VXWORKS)
- RTMP_OS_NETDEV_START_QUEUE(pAd->net_dev);
-#endif // defined(LINUX) || defined(VXWORKS) //
- }
- else if (!strcmp(arg, "TXCARR"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: TXCARR\n"));
- pAd->ate.Mode = ATE_TXCARR;
-
- // QA has done the following steps if it is used.
- if (pAd->ate.bQATxStart == FALSE)
- {
- // Soft reset BBP.
- BbpSoftReset(pAd);
-
- // Carrier Test set BBP R22 bit7=1, bit6=1, bit[5~0]=0x01
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= 0xFFFFFF00; //clear bit7, bit6, bit[5~0]
- BbpData |= 0x000000C1; //set bit7=1, bit6=1, bit[5~0]=0x01
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- // set MAC_SYS_CTRL(0x1004) Continuous Tx Production Test (bit4) = 1
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value = Value | 0x00000010;
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
- }
- else if (!strcmp(arg, "TXCONT"))
- {
- if (pAd->ate.bQATxStart == TRUE)
- {
- /*
- set MAC_SYS_CTRL(0x1004) bit4(Continuous Tx Production Test)
- and bit2(MAC TX enable) back to zero.
- */
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &MacData);
- MacData &= 0xFFFFFFEB;
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
-
- // set BBP R22 bit7=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= 0xFFFFFF7F; //set bit7=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- }
-
- /*
- for TxCont mode.
- Step 1: Send 50 packets first then wait for a moment.
- Step 2: Send more 50 packet then start continue mode.
- */
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: TXCONT\n"));
-
- // Step 1: send 50 packets first.
- pAd->ate.Mode = ATE_TXCONT;
- pAd->ate.TxCount = 50;
-
- /* Do it after Tx/Rx DMA is aborted. */
-// pAd->ate.TxDoneCount = 0;
-
- // Soft reset BBP.
- BbpSoftReset(pAd);
-
- // Abort Tx, RX DMA.
- RtmpDmaEnable(pAd, 0);
-
- // Fix can't smooth kick
- {
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QID_AC_BE * 0x10, &pTxRing->TxDmaIdx);
- pTxRing->TxSwFreeIdx = pTxRing->TxDmaIdx;
- pTxRing->TxCpuIdx = pTxRing->TxDmaIdx;
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * 0x10, pTxRing->TxCpuIdx);
- }
-
- pAd->ate.TxDoneCount = 0;
-
- /* Only needed if we have to send some normal frames. */
- SetJapanFilter(pAd);
-
- for (i = 0; (i < TX_RING_SIZE-1) && (i < pAd->ate.TxCount); i++)
- {
- PNDIS_PACKET pPacket;
- UINT32 TxIdx = pTxRing->TxCpuIdx;
-
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- // Clean current cell.
- pPacket = pTxRing->Cell[TxIdx].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[TxIdx].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
-
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
-
- if (ATESetUpFrame(pAd, TxIdx) != 0)
- break;
-
- INC_RING_INDEX(pTxRing->TxCpuIdx, TX_RING_SIZE);
- }
-
- // Setup frame format.
- ATESetUpFrame(pAd, pTxRing->TxCpuIdx);
-
- // Start Tx, RX DMA.
- RtmpDmaEnable(pAd, 1);
-
- // Enable Tx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // Disable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- pAd->ate.TxStatus = 1;
- }
-#endif // RALINK_28xx_QA //
-
- // kick Tx-Ring
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * RINGREG_DIFF, pAd->TxRing[QID_AC_BE].TxCpuIdx);
-
- RTMPusecDelay(5000);
-
-
- // Step 2: send more 50 packets then start continue mode.
- // Abort Tx, RX DMA.
- RtmpDmaEnable(pAd, 0);
-
- // Cont. TX set BBP R22 bit7=1
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData |= 0x00000080; //set bit7=1
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- pAd->ate.TxCount = 50;
-
- // Fix can't smooth kick
- {
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QID_AC_BE * 0x10, &pTxRing->TxDmaIdx);
- pTxRing->TxSwFreeIdx = pTxRing->TxDmaIdx;
- pTxRing->TxCpuIdx = pTxRing->TxDmaIdx;
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * 0x10, pTxRing->TxCpuIdx);
- }
-
- pAd->ate.TxDoneCount = 0;
-
- SetJapanFilter(pAd);
-
- for (i = 0; (i < TX_RING_SIZE-1) && (i < pAd->ate.TxCount); i++)
- {
- PNDIS_PACKET pPacket;
- UINT32 TxIdx = pTxRing->TxCpuIdx;
-
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- // clean current cell.
- pPacket = pTxRing->Cell[TxIdx].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[TxIdx].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
-
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
-
- if (ATESetUpFrame(pAd, TxIdx) != 0)
- break;
-
- INC_RING_INDEX(pTxRing->TxCpuIdx, TX_RING_SIZE);
- }
-
- ATESetUpFrame(pAd, pTxRing->TxCpuIdx);
-
- // Start Tx, RX DMA.
- RtmpDmaEnable(pAd, 1);
-
- // Enable Tx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // Disable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- pAd->ate.TxStatus = 1;
- }
-#endif // RALINK_28xx_QA //
-
- // kick Tx-Ring.
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * RINGREG_DIFF, pAd->TxRing[QID_AC_BE].TxCpuIdx);
-
- RTMPusecDelay(500);
-
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &MacData);
- MacData |= 0x00000010;
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
- }
- else if (!strcmp(arg, "TXFRAME"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: TXFRAME(Count=%d)\n", pAd->ate.TxCount));
- pAd->ate.Mode |= ATE_TXFRAME;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- // Soft reset BBP.
- BbpSoftReset(pAd);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
-
- // Abort Tx, RX DMA.
- RtmpDmaEnable(pAd, 0);
-
- // Fix can't smooth kick
- {
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QID_AC_BE * 0x10, &pTxRing->TxDmaIdx);
- pTxRing->TxSwFreeIdx = pTxRing->TxDmaIdx;
- pTxRing->TxCpuIdx = pTxRing->TxDmaIdx;
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * 0x10, pTxRing->TxCpuIdx);
- }
-
- pAd->ate.TxDoneCount = 0;
-
- SetJapanFilter(pAd);
-
- for (i = 0; (i < TX_RING_SIZE-1) && (i < pAd->ate.TxCount); i++)
- {
- PNDIS_PACKET pPacket;
- UINT32 TxIdx = pTxRing->TxCpuIdx;
-
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- // Clean current cell.
- pPacket = pTxRing->Cell[TxIdx].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[TxIdx].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[TxIdx].pNextNdisPacket = NULL;
-
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
-
- if (ATESetUpFrame(pAd, TxIdx) != 0)
- break;
-
- INC_RING_INDEX(pTxRing->TxCpuIdx, TX_RING_SIZE);
-
- }
-
- ATESetUpFrame(pAd, pTxRing->TxCpuIdx);
-
- // Start Tx, Rx DMA.
- RtmpDmaEnable(pAd, 1);
-
- // Enable Tx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
-#ifdef RALINK_28xx_QA
- // add this for LoopBack mode
- if (pAd->ate.bQARxStart == FALSE)
- {
- // Disable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
-
- if (pAd->ate.bQATxStart == TRUE)
- {
- pAd->ate.TxStatus = 1;
- }
-#else
- // Disable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-#endif // RALINK_28xx_QA //
-
- RTMP_IO_READ32(pAd, TX_DTX_IDX0 + QID_AC_BE * RINGREG_DIFF, &pAd->TxRing[QID_AC_BE].TxDmaIdx);
- // kick Tx-Ring.
- RTMP_IO_WRITE32(pAd, TX_CTX_IDX0 + QID_AC_BE * RINGREG_DIFF, pAd->TxRing[QID_AC_BE].TxCpuIdx);
-
- pAd->RalinkCounters.KickTxCount++;
- }
-#ifdef RALINK_28xx_QA
- else if (!strcmp(arg, "TXSTOP"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: TXSTOP\n"));
- atemode = pAd->ate.Mode;
- pAd->ate.Mode &= ATE_TXSTOP;
- pAd->ate.bQATxStart = FALSE;
-// pAd->ate.TxDoneCount = pAd->ate.TxCount;
-
- if (atemode == ATE_TXCARR)
- {
- // No Carrier Test set BBP R22 bit7=0, bit6=0, bit[5~0]=0x0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= 0xFFFFFF00; //clear bit7, bit6, bit[5~0]
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- }
- else if (atemode == ATE_TXCARRSUPP)
- {
- // No Cont. TX set BBP R22 bit7=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= ~(1 << 7); //set bit7=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
-
- // No Carrier Suppression set BBP R24 bit0=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R24, &BbpData);
- BbpData &= 0xFFFFFFFE; //clear bit0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R24, BbpData);
- }
-
- /*
- We should free some resource which was allocated
- when ATE_TXFRAME, ATE_STOP, and ATE_TXCONT.
- */
- else if ((atemode & ATE_TXFRAME) || (atemode == ATE_STOP))
- {
- PRTMP_TX_RING pTxRing = &pAd->TxRing[QID_AC_BE];
-
- if (atemode == ATE_TXCONT)
- {
- // No Cont. TX set BBP R22 bit7=0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R22, &BbpData);
- BbpData &= ~(1 << 7); //set bit7=0
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- }
-
- // Abort Tx, Rx DMA.
- RtmpDmaEnable(pAd, 0);
-
- for (i=0; i<TX_RING_SIZE; i++)
- {
- PNDIS_PACKET pPacket;
-
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pAd->TxRing[QID_AC_BE].Cell[i].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
-#endif
- pTxD->DMADONE = 0;
- pPacket = pTxRing->Cell[i].pNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNdisPacket as NULL after clear
- pTxRing->Cell[i].pNdisPacket = NULL;
-
- pPacket = pTxRing->Cell[i].pNextNdisPacket;
-
- if (pPacket)
- {
- PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, PCI_DMA_TODEVICE);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_SUCCESS);
- }
-
- // Always assign pNextNdisPacket as NULL after clear
- pTxRing->Cell[i].pNextNdisPacket = NULL;
-#ifdef RT_BIG_ENDIAN
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif
- }
- // Enable Tx, Rx DMA
- RtmpDmaEnable(pAd, 1);
-
- }
-
- // TxStatus : 0 --> task is idle, 1 --> task is running
- pAd->ate.TxStatus = 0;
-
- // Soft reset BBP.
- BbpSoftReset(pAd);
-
- // Disable Tx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
- else if (!strcmp(arg, "RXSTOP"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: RXSTOP\n"));
- atemode = pAd->ate.Mode;
- pAd->ate.Mode &= ATE_RXSTOP;
- pAd->ate.bQARxStart = FALSE;
-// pAd->ate.TxDoneCount = pAd->ate.TxCount;
-
- if (atemode == ATE_TXCARR)
- {
- ;
- }
- else if (atemode == ATE_TXCARRSUPP)
- {
- ;
- }
-
- /*
- We should free some resource which was allocated
- when ATE_TXFRAME, ATE_STOP, and ATE_TXCONT.
- */
- else if ((atemode & ATE_TXFRAME) || (atemode == ATE_STOP))
- {
- if (atemode == ATE_TXCONT)
- {
- ;
- }
- }
-
- // Soft reset BBP.
- BbpSoftReset(pAd);
-
- // Disable Rx
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
-#endif // RALINK_28xx_QA //
- else if (!strcmp(arg, "RXFRAME"))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: RXFRAME\n"));
-
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R22, BbpData);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, MacData);
-
- pAd->ate.Mode |= ATE_RXFRAME;
-
- // Disable Tx of MAC block.
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= ~(1 << 2);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
-
- // Enable Rx of MAC block.
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value |= (1 << 3);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
- else
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATE: Invalid arg!\n"));
- return FALSE;
- }
- RTMPusecDelay(5000);
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("<=== ATECmdHandler()\n"));
-
- return TRUE;
-}
-/*=======================End of RTMP_MAC_PCI =======================*/
-#endif // RTMP_MAC_PCI //
-
-
-
-
-INT Set_ATE_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- if (ATECmdHandler(pAd, arg))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_Proc Success\n"));
-
-
- return TRUE;
- }
- else
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_Proc Failed\n"));
- return FALSE;
- }
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE ADDR1=DA for TxFrame(AP : To DS = 0 ; From DS = 1)
- or
- Set ATE ADDR3=DA for TxFrame(STA : To DS = 1 ; From DS = 0)
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_DA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- PSTRING value;
- INT i;
-
- // Mac address acceptable format 01:02:03:04:05:06 length 17
- if (strlen(arg) != 17)
- return FALSE;
-
- for (i = 0, value = rstrtok(arg, ":"); value; value = rstrtok(NULL, ":"))
- {
- /* sanity check */
- if ((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))))
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- AtoH(value, &pAd->ate.Addr3[i++], 1);
-#endif // CONFIG_STA_SUPPORT //
- }
-
- /* sanity check */
- if (i != 6)
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_DA_Proc (DA = %2X:%2X:%2X:%2X:%2X:%2X)\n", pAd->ate.Addr3[0],
- pAd->ate.Addr3[1], pAd->ate.Addr3[2], pAd->ate.Addr3[3], pAd->ate.Addr3[4], pAd->ate.Addr3[5]));
-#endif // CONFIG_STA_SUPPORT //
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_DA_Proc Success\n"));
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE ADDR3=SA for TxFrame(AP : To DS = 0 ; From DS = 1)
- or
- Set ATE ADDR2=SA for TxFrame(STA : To DS = 1 ; From DS = 0)
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_SA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- PSTRING value;
- INT i;
-
- // Mac address acceptable format 01:02:03:04:05:06 length 17
- if (strlen(arg) != 17)
- return FALSE;
-
- for (i=0, value = rstrtok(arg, ":"); value; value = rstrtok(NULL, ":"))
- {
- /* sanity check */
- if ((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))))
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- AtoH(value, &pAd->ate.Addr2[i++], 1);
-#endif // CONFIG_STA_SUPPORT //
- }
-
- /* sanity check */
- if (i != 6)
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_SA_Proc (SA = %2X:%2X:%2X:%2X:%2X:%2X)\n", pAd->ate.Addr2[0],
- pAd->ate.Addr2[1], pAd->ate.Addr2[2], pAd->ate.Addr2[3], pAd->ate.Addr2[4], pAd->ate.Addr2[5]));
-#endif // CONFIG_STA_SUPPORT //
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_SA_Proc Success\n"));
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE ADDR2=BSSID for TxFrame(AP : To DS = 0 ; From DS = 1)
- or
- Set ATE ADDR1=BSSID for TxFrame(STA : To DS = 1 ; From DS = 0)
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_BSSID_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- PSTRING value;
- INT i;
-
- // Mac address acceptable format 01:02:03:04:05:06 length 17
- if (strlen(arg) != 17)
- return FALSE;
-
- for (i=0, value = rstrtok(arg, ":"); value; value = rstrtok(NULL, ":"))
- {
- /* sanity check */
- if ((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))))
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- AtoH(value, &pAd->ate.Addr1[i++], 1);
-#endif // CONFIG_STA_SUPPORT //
- }
-
- /* sanity check */
- if(i != 6)
- {
- return FALSE;
- }
-
-#ifdef CONFIG_STA_SUPPORT
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_BSSID_Proc (BSSID = %2X:%2X:%2X:%2X:%2X:%2X)\n", pAd->ate.Addr1[0],
- pAd->ate.Addr1[1], pAd->ate.Addr1[2], pAd->ate.Addr1[3], pAd->ate.Addr1[4], pAd->ate.Addr1[5]));
-#endif // CONFIG_STA_SUPPORT //
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_BSSID_Proc Success\n"));
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx Channel
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_CHANNEL_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR channel;
-
- channel = simple_strtol(arg, 0, 10);
-
- // to allow A band channel : ((channel < 1) || (channel > 14))
- if ((channel < 1) || (channel > 216))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_CHANNEL_Proc::Out of range, it should be in range of 1~14.\n"));
- return FALSE;
- }
- pAd->ate.Channel = channel;
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_CHANNEL_Proc (ATE Channel = %d)\n", pAd->ate.Channel));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_CHANNEL_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx Power0
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_POWER0_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- CHAR TxPower;
-
- TxPower = simple_strtol(arg, 0, 10);
-
- if (pAd->ate.Channel <= 14)
- {
- if ((TxPower > 31) || (TxPower < 0))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_POWER0_Proc::Out of range (Value=%d)\n", TxPower));
- return FALSE;
- }
- }
- else/* 5.5 GHz */
- {
- if ((TxPower > 15) || (TxPower < -7))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_POWER0_Proc::Out of range (Value=%d)\n", TxPower));
- return FALSE;
- }
- }
-
- pAd->ate.TxPower0 = TxPower;
- ATETxPwrHandler(pAd, 0);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_POWER0_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx Power1
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_POWER1_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- CHAR TxPower;
-
- TxPower = simple_strtol(arg, 0, 10);
-
- if (pAd->ate.Channel <= 14)
- {
- if ((TxPower > 31) || (TxPower < 0))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_POWER1_Proc::Out of range (Value=%d)\n", TxPower));
- return FALSE;
- }
- }
- else
- {
- if ((TxPower > 15) || (TxPower < -7))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_POWER1_Proc::Out of range (Value=%d)\n", TxPower));
- return FALSE;
- }
- }
-
- pAd->ate.TxPower1 = TxPower;
- ATETxPwrHandler(pAd, 1);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_POWER1_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx Antenna
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- CHAR value;
-
- value = simple_strtol(arg, 0, 10);
-
- if ((value > 2) || (value < 0))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_Antenna_Proc::Out of range (Value=%d)\n", value));
- return FALSE;
- }
-
- pAd->ate.TxAntennaSel = value;
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_Antenna_Proc (Antenna = %d)\n", pAd->ate.TxAntennaSel));
- ATEDBGPRINT(RT_DEBUG_TRACE,("Ralink: Set_ATE_TX_Antenna_Proc Success\n"));
-
- // calibration power unbalance issues, merged from Arch Team
- ATEAsicSwitchChannel(pAd);
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Rx Antenna
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_RX_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- CHAR value;
-
- value = simple_strtol(arg, 0, 10);
-
- if ((value > 3) || (value < 0))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_RX_Antenna_Proc::Out of range (Value=%d)\n", value));
- return FALSE;
- }
-
- pAd->ate.RxAntennaSel = value;
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_RX_Antenna_Proc (Antenna = %d)\n", pAd->ate.RxAntennaSel));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_RX_Antenna_Proc Success\n"));
-
- // calibration power unbalance issues, merged from Arch Team
- ATEAsicSwitchChannel(pAd);
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE RF frequence offset
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_FREQOFFSET_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR RFFreqOffset = 0;
- ULONG R4 = 0;
-
- RFFreqOffset = simple_strtol(arg, 0, 10);
-#ifndef RTMP_RF_RW_SUPPORT
- if (RFFreqOffset >= 64)
-#endif // RTMP_RF_RW_SUPPORT //
- /* RT35xx ATE will reuse this code segment. */
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/08/06: KH modified the limit of offset value from 65 to 95(0x5F)
- if (RFFreqOffset >= 95)
-#endif // RTMP_RF_RW_SUPPORT //
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_FREQOFFSET_Proc::Out of range, it should be in range of 0~63.\n"));
- return FALSE;
- }
-
- pAd->ate.RFFreqOffset = RFFreqOffset;
-#ifdef RTMP_RF_RW_SUPPORT
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- // Set RF offset
- UCHAR RFValue;
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R23, (PUCHAR)&RFValue);
-//2008/08/06: KH modified "pAd->RFFreqOffset" to "pAd->ate.RFFreqOffset"
- RFValue = ((RFValue & 0x80) | pAd->ate.RFFreqOffset);
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R23, (UCHAR)RFValue);
- }
- else
-#endif // RTMP_RF_RW_SUPPORT //
- {
- // RT28xx
- // shift TX power control to correct RF register bit position
- R4 = pAd->ate.RFFreqOffset << 15;
- R4 |= (pAd->LatchRfRegs.R4 & ((~0x001f8000)));
- pAd->LatchRfRegs.R4 = R4;
-
- RtmpRfIoWrite(pAd);
- }
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_FREQOFFSET_Proc (RFFreqOffset = %d)\n", pAd->ate.RFFreqOffset));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_FREQOFFSET_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE RF BW
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_BW_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- INT i;
- UCHAR value = 0;
- UCHAR BBPCurrentBW;
-
- BBPCurrentBW = simple_strtol(arg, 0, 10);
-
- if ((BBPCurrentBW == 0)
-#ifdef RT30xx
- || IS_RT2070(pAd)
-#endif // RT30xx //
- )
- {
- pAd->ate.TxWI.BW = BW_20;
- }
- else
- {
- pAd->ate.TxWI.BW = BW_40;
- }
-
- /* RT35xx ATE will reuse this code segment. */
- // Fix the error spectrum of CCK-40MHZ
- // Turn on BBP 20MHz mode by request here.
- if ((pAd->ate.TxWI.PHYMODE == MODE_CCK) && (pAd->ate.TxWI.BW == BW_40))
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_BW_Proc!! Warning!! CCK only supports 20MHZ!!\nBandwidth switch to 20\n"));
- pAd->ate.TxWI.BW = BW_20;
- }
-
- if (pAd->ate.TxWI.BW == BW_20)
- {
- if (pAd->ate.Channel <= 14)
- {
- for (i=0; i<5; i++)
- {
- if (pAd->Tx20MPwrCfgGBand[i] != 0xffffffff)
- {
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, pAd->Tx20MPwrCfgGBand[i]);
- RTMPusecDelay(5000);
- }
- }
- }
- else
- {
- for (i=0; i<5; i++)
- {
- if (pAd->Tx20MPwrCfgABand[i] != 0xffffffff)
- {
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, pAd->Tx20MPwrCfgABand[i]);
- RTMPusecDelay(5000);
- }
- }
- }
-
- // Set BBP R4 bit[4:3]=0:0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &value);
- value &= (~0x18);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, value);
-
-
- // Set BBP R66=0x3C
- value = 0x3C;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, value);
-
- // Set BBP R68=0x0B
- // to improve Rx sensitivity.
- value = 0x0B;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R68, value);
- // Set BBP R69=0x16
- value = 0x16;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, value);
- // Set BBP R70=0x08
- value = 0x08;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, value);
- // Set BBP R73=0x11
- value = 0x11;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, value);
-
- /*
- If Channel=14, Bandwidth=20M and Mode=CCK, Set BBP R4 bit5=1
- (to set Japan filter coefficients).
- This segment of code will only works when ATETXMODE and ATECHANNEL
- were set to MODE_CCK and 14 respectively before ATETXBW is set to 0.
- */
- if (pAd->ate.Channel == 14)
- {
- INT TxMode = pAd->ate.TxWI.PHYMODE;
-
- if (TxMode == MODE_CCK)
- {
- // when Channel==14 && Mode==CCK && BandWidth==20M, BBP R4 bit5=1
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &value);
- value |= 0x20; //set bit5=1
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, value);
- }
- }
-
-#ifdef RT30xx
- // set BW = 20 MHz
- if (IS_RT30xx(pAd))
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R24, (UCHAR) pAd->Mlme.CaliBW20RfR24);
- else
-#endif // RT30xx //
- // set BW = 20 MHz
- {
- pAd->LatchRfRegs.R4 &= ~0x00200000;
- RtmpRfIoWrite(pAd);
- }
-
- }
- // If bandwidth = 40M, set RF Reg4 bit 21 = 0.
- else if (pAd->ate.TxWI.BW == BW_40)
- {
- if (pAd->ate.Channel <= 14)
- {
- for (i=0; i<5; i++)
- {
- if (pAd->Tx40MPwrCfgGBand[i] != 0xffffffff)
- {
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, pAd->Tx40MPwrCfgGBand[i]);
- RTMPusecDelay(5000);
- }
- }
- }
- else
- {
- for (i=0; i<5; i++)
- {
- if (pAd->Tx40MPwrCfgABand[i] != 0xffffffff)
- {
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, pAd->Tx40MPwrCfgABand[i]);
- RTMPusecDelay(5000);
- }
- }
-#ifdef DOT11_N_SUPPORT
- if ((pAd->ate.TxWI.PHYMODE >= MODE_HTMIX) && (pAd->ate.TxWI.MCS == 7))
- {
- value = 0x28;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R67, value);
- }
-#endif // DOT11_N_SUPPORT //
- }
-
- // Set BBP R4 bit[4:3]=1:0
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &value);
- value &= (~0x18);
- value |= 0x10;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, value);
-
-
- // Set BBP R66=0x3C
- value = 0x3C;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, value);
-
- // Set BBP R68=0x0C
- // to improve Rx sensitivity
- value = 0x0C;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R68, value);
- // Set BBP R69=0x1A
- value = 0x1A;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, value);
- // Set BBP R70=0x0A
- value = 0x0A;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, value);
- // Set BBP R73=0x16
- value = 0x16;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, value);
-
- // If bandwidth = 40M, set RF Reg4 bit 21 = 1.
-#ifdef RT30xx
- // set BW = 40 MHz
- if(IS_RT30xx(pAd))
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R24, (UCHAR) pAd->Mlme.CaliBW40RfR24);
- else
-#endif // RT30xx //
- // set BW = 40 MHz
- {
- pAd->LatchRfRegs.R4 |= 0x00200000;
- RtmpRfIoWrite(pAd);
- }
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_BW_Proc (BBPCurrentBW = %d)\n", pAd->ate.TxWI.BW));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_BW_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx frame length
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_LENGTH_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- pAd->ate.TxLength = simple_strtol(arg, 0, 10);
-
- if ((pAd->ate.TxLength < 24) || (pAd->ate.TxLength > (MAX_FRAME_SIZE - 34/* == 2312 */)))
- {
- pAd->ate.TxLength = (MAX_FRAME_SIZE - 34/* == 2312 */);
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_LENGTH_Proc::Out of range, it should be in range of 24~%d.\n", (MAX_FRAME_SIZE - 34/* == 2312 */)));
- return FALSE;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_LENGTH_Proc (TxLength = %d)\n", pAd->ate.TxLength));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_LENGTH_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx frame count
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_COUNT_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- pAd->ate.TxCount = simple_strtol(arg, 0, 10);
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_COUNT_Proc (TxCount = %d)\n", pAd->ate.TxCount));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_COUNT_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx frame MCS
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_MCS_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR MCS;
- INT result;
-
- MCS = simple_strtol(arg, 0, 10);
-#ifndef RT30xx
- result = CheckMCSValid(pAd->ate.TxWI.PHYMODE, MCS);
-#endif // RT30xx //
-
- /* RT35xx ATE will reuse this code segment. */
-#ifdef RT30xx
- result = CheckMCSValid(pAd->ate.TxWI.PHYMODE, MCS, IS_RT2070(pAd));
-#endif // RT30xx //
-
-
- if (result != -1)
- {
- pAd->ate.TxWI.MCS = (UCHAR)MCS;
- }
- else
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_MCS_Proc::Out of range, refer to rate table.\n"));
- return FALSE;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_MCS_Proc (MCS = %d)\n", pAd->ate.TxWI.MCS));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_MCS_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx frame Mode
- 0: MODE_CCK
- 1: MODE_OFDM
- 2: MODE_HTMIX
- 3: MODE_HTGREENFIELD
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_MODE_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR BbpData = 0;
-
- pAd->ate.TxWI.PHYMODE = simple_strtol(arg, 0, 10);
-
- if (pAd->ate.TxWI.PHYMODE > 3)
- {
- pAd->ate.TxWI.PHYMODE = 0;
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_MODE_Proc::Out of range.\nIt should be in range of 0~3\n"));
- ATEDBGPRINT(RT_DEBUG_ERROR, ("0: CCK, 1: OFDM, 2: HT_MIX, 3: HT_GREEN_FIELD.\n"));
- return FALSE;
- }
-
- // Turn on BBP 20MHz mode by request here.
- if (pAd->ate.TxWI.PHYMODE == MODE_CCK)
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BbpData);
- BbpData &= (~0x18);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BbpData);
- pAd->ate.TxWI.BW = BW_20;
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_MODE_Proc::CCK Only support 20MHZ. Switch to 20MHZ.\n"));
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_MODE_Proc (TxMode = %d)\n", pAd->ate.TxWI.PHYMODE));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_MODE_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Set ATE Tx frame GI
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-INT Set_ATE_TX_GI_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- pAd->ate.TxWI.ShortGI = simple_strtol(arg, 0, 10);
-
- if (pAd->ate.TxWI.ShortGI > 1)
- {
- pAd->ate.TxWI.ShortGI = 0;
- ATEDBGPRINT(RT_DEBUG_ERROR, ("Set_ATE_TX_GI_Proc::Out of range\n"));
- return FALSE;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_GI_Proc (GI = %d)\n", pAd->ate.TxWI.ShortGI));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_GI_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-INT Set_ATE_RX_FER_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- pAd->ate.bRxFER = simple_strtol(arg, 0, 10);
-
- if (pAd->ate.bRxFER == 1)
- {
- pAd->ate.RxCntPerSec = 0;
- pAd->ate.RxTotalCnt = 0;
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_RX_FER_Proc (bRxFER = %d)\n", pAd->ate.bRxFER));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_RX_FER_Proc Success\n"));
-
-
- return TRUE;
-}
-
-
-INT Set_ATE_Read_RF_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/07/10:KH add to support RT30xx ATE<--
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- /* modify by WY for Read RF Reg. error */
- UCHAR RFValue;
- INT index=0;
-
- for (index = 0; index < 32; index++)
- {
- ATE_RF_IO_READ8_BY_REG_ID(pAd, index, (PUCHAR)&RFValue);
- ate_print("R%d=%d\n",index,RFValue);
- }
- }
- else
-//2008/07/10:KH add to support RT30xx ATE-->
-#endif // RTMP_RF_RW_SUPPORT //
- {
- ate_print(KERN_EMERG "R1 = %lx\n", pAd->LatchRfRegs.R1);
- ate_print(KERN_EMERG "R2 = %lx\n", pAd->LatchRfRegs.R2);
- ate_print(KERN_EMERG "R3 = %lx\n", pAd->LatchRfRegs.R3);
- ate_print(KERN_EMERG "R4 = %lx\n", pAd->LatchRfRegs.R4);
- }
- return TRUE;
-}
-
-
-INT Set_ATE_Write_RF1_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT32 value = (UINT32) simple_strtol(arg, 0, 16);
-
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/07/10:KH add to support 3070 ATE<--
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- ate_print("Warning!! RT3xxx Don't Support !\n");
- return FALSE;
-
- }
- else
-//2008/07/10:KH add to support 3070 ATE-->
-#endif // RTMP_RF_RW_SUPPORT //
- {
- pAd->LatchRfRegs.R1 = value;
- RtmpRfIoWrite(pAd);
- }
- return TRUE;
-}
-
-
-INT Set_ATE_Write_RF2_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT32 value = (UINT32) simple_strtol(arg, 0, 16);
-
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/07/10:KH add to support 3070 ATE<--
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- ate_print("Warning!! RT3xxx Don't Support !\n");
- return FALSE;
-
- }
- else
-//2008/07/10:KH add to support 3070 ATE-->
-#endif // RTMP_RF_RW_SUPPORT //
- {
- pAd->LatchRfRegs.R2 = value;
- RtmpRfIoWrite(pAd);
- }
- return TRUE;
-}
-
-
-INT Set_ATE_Write_RF3_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT32 value = simple_strtol(arg, 0, 16);
-
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/07/10:KH add to support 3070 ATE<--
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- ate_print("Warning!! RT3xxx Don't Support !\n");
- return FALSE;
-
- }
- else
-//2008/07/10:KH add to support 3070 ATE-->
-#endif // RTMP_RF_RW_SUPPORT //
- {
- pAd->LatchRfRegs.R3 = value;
- RtmpRfIoWrite(pAd);
- }
- return TRUE;
-}
-
-
-INT Set_ATE_Write_RF4_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UINT32 value = (UINT32) simple_strtol(arg, 0, 16);
-
-#ifdef RTMP_RF_RW_SUPPORT
-//2008/07/10:KH add to support 3070 ATE<--
- if (IS_RT30xx(pAd) || IS_RT3572(pAd))
- {
- ate_print("Warning!! RT3xxx Don't Support !\n");
- return FALSE;
-
- }
- else
-//2008/07/10:KH add to support 3070 ATE-->
-#endif // RTMP_RF_RW_SUPPORT //
- {
- pAd->LatchRfRegs.R4 = value;
- RtmpRfIoWrite(pAd);
- }
- return TRUE;
-}
-
-
-/*
-==========================================================================
- Description:
- Load and Write EEPROM from a binary file prepared in advance.
-
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-==========================================================================
-*/
-#if defined(LINUX) || defined(VXWORKS)
-INT Set_ATE_Load_E2P_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- BOOLEAN ret = FALSE;
- PSTRING src = EEPROM_BIN_FILE_NAME;
- RTMP_OS_FD srcf;
- INT32 retval;
- USHORT WriteEEPROM[(EEPROM_SIZE/2)];
- INT FileLength = 0;
- UINT32 value = (UINT32) simple_strtol(arg, 0, 10);
- RTMP_OS_FS_INFO osFSInfo;
-
- ATEDBGPRINT(RT_DEBUG_ERROR, ("===> %s (value=%d)\n\n", __FUNCTION__, value));
-
- if (value > 0)
- {
- /* zero the e2p buffer */
- NdisZeroMemory((PUCHAR)WriteEEPROM, EEPROM_SIZE);
-
- RtmpOSFSInfoChange(&osFSInfo, TRUE);
-
- do
- {
- /* open the bin file */
- srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
-
- if (IS_FILE_OPEN_ERR(srcf))
- {
- ate_print("%s - Error opening file %s\n", __FUNCTION__, src);
- break;
- }
-
- /* read the firmware from the file *.bin */
- FileLength = RtmpOSFileRead(srcf, (PSTRING)WriteEEPROM, EEPROM_SIZE);
-
- if (FileLength != EEPROM_SIZE)
- {
- ate_print("%s: error file length (=%d) in e2p.bin\n",
- __FUNCTION__, FileLength);
- break;
- }
- else
- {
- /* write the content of .bin file to EEPROM */
- rt_ee_write_all(pAd, WriteEEPROM);
- ret = TRUE;
- }
- break;
- } while(TRUE);
-
- /* close firmware file */
- if (IS_FILE_OPEN_ERR(srcf))
- {
- ;
- }
- else
- {
- retval = RtmpOSFileClose(srcf);
-
- if (retval)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("--> Error %d closing %s\n", -retval, src));
-
- }
- }
-
- /* restore */
- RtmpOSFSInfoChange(&osFSInfo, FALSE);
- }
-
- ATEDBGPRINT(RT_DEBUG_ERROR, ("<=== %s (ret=%d)\n", __FUNCTION__, ret));
-
- return ret;
-
-}
-#endif // defined(LINUX) || defined(VXWORKS) //
-
-
-
-
-INT Set_ATE_Read_E2P_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- USHORT buffer[EEPROM_SIZE/2];
- USHORT *p;
- int i;
-
- rt_ee_read_all(pAd, (USHORT *)buffer);
- p = buffer;
- for (i = 0; i < (EEPROM_SIZE/2); i++)
- {
- ate_print("%4.4x ", *p);
- if (((i+1) % 16) == 0)
- ate_print("\n");
- p++;
- }
- return TRUE;
-}
-
-
-
-
-INT Set_ATE_Show_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ate_print("Mode=%d\n", pAd->ate.Mode);
- ate_print("TxPower0=%d\n", pAd->ate.TxPower0);
- ate_print("TxPower1=%d\n", pAd->ate.TxPower1);
- ate_print("TxAntennaSel=%d\n", pAd->ate.TxAntennaSel);
- ate_print("RxAntennaSel=%d\n", pAd->ate.RxAntennaSel);
- ate_print("BBPCurrentBW=%d\n", pAd->ate.TxWI.BW);
- ate_print("GI=%d\n", pAd->ate.TxWI.ShortGI);
- ate_print("MCS=%d\n", pAd->ate.TxWI.MCS);
- ate_print("TxMode=%d\n", pAd->ate.TxWI.PHYMODE);
- ate_print("Addr1=%02x:%02x:%02x:%02x:%02x:%02x\n",
- pAd->ate.Addr1[0], pAd->ate.Addr1[1], pAd->ate.Addr1[2], pAd->ate.Addr1[3], pAd->ate.Addr1[4], pAd->ate.Addr1[5]);
- ate_print("Addr2=%02x:%02x:%02x:%02x:%02x:%02x\n",
- pAd->ate.Addr2[0], pAd->ate.Addr2[1], pAd->ate.Addr2[2], pAd->ate.Addr2[3], pAd->ate.Addr2[4], pAd->ate.Addr2[5]);
- ate_print("Addr3=%02x:%02x:%02x:%02x:%02x:%02x\n",
- pAd->ate.Addr3[0], pAd->ate.Addr3[1], pAd->ate.Addr3[2], pAd->ate.Addr3[3], pAd->ate.Addr3[4], pAd->ate.Addr3[5]);
- ate_print("Channel=%d\n", pAd->ate.Channel);
- ate_print("TxLength=%d\n", pAd->ate.TxLength);
- ate_print("TxCount=%u\n", pAd->ate.TxCount);
- ate_print("RFFreqOffset=%d\n", pAd->ate.RFFreqOffset);
- ate_print(KERN_EMERG "Set_ATE_Show_Proc Success\n");
- return TRUE;
-}
-
-
-INT Set_ATE_Help_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ate_print("ATE=ATESTART, ATESTOP, TXCONT, TXCARR, TXFRAME, RXFRAME\n");
- ate_print("ATEDA\n");
- ate_print("ATESA\n");
- ate_print("ATEBSSID\n");
- ate_print("ATECHANNEL, range:0~14(unless A band !)\n");
- ate_print("ATETXPOW0, set power level of antenna 1.\n");
- ate_print("ATETXPOW1, set power level of antenna 2.\n");
- ate_print("ATETXANT, set TX antenna. 0:all, 1:antenna one, 2:antenna two.\n");
- ate_print("ATERXANT, set RX antenna.0:all, 1:antenna one, 2:antenna two, 3:antenna three.\n");
- ate_print("ATETXFREQOFFSET, set frequency offset, range 0~63\n");
- ate_print("ATETXBW, set BandWidth, 0:20MHz, 1:40MHz.\n");
- ate_print("ATETXLEN, set Frame length, range 24~%d\n", (MAX_FRAME_SIZE - 34/* == 2312 */));
- ate_print("ATETXCNT, set how many frame going to transmit.\n");
- ate_print("ATETXMCS, set MCS, reference to rate table.\n");
- ate_print("ATETXMODE, set Mode 0:CCK, 1:OFDM, 2:HT-Mix, 3:GreenField, reference to rate table.\n");
- ate_print("ATETXGI, set GI interval, 0:Long, 1:Short\n");
- ate_print("ATERXFER, 0:disable Rx Frame error rate. 1:enable Rx Frame error rate.\n");
- ate_print("ATERRF, show all RF registers.\n");
- ate_print("ATEWRF1, set RF1 register.\n");
- ate_print("ATEWRF2, set RF2 register.\n");
- ate_print("ATEWRF3, set RF3 register.\n");
- ate_print("ATEWRF4, set RF4 register.\n");
- ate_print("ATELDE2P, load EEPROM from .bin file.\n");
- ate_print("ATERE2P, display all EEPROM content.\n");
- ate_print("ATESHOW, display all parameters of ATE.\n");
- ate_print("ATEHELP, online help.\n");
-
- return TRUE;
-}
-
-
-
-
-/*
-==========================================================================
- Description:
-
- AsicSwitchChannel() dedicated for ATE.
-
-==========================================================================
-*/
-VOID ATEAsicSwitchChannel(
- IN PRTMP_ADAPTER pAd)
-{
- UINT32 R2 = 0, R3 = DEFAULT_RF_TX_POWER, R4 = 0, Value = 0;
- CHAR TxPwer = 0, TxPwer2 = 0;
- UCHAR index = 0, BbpValue = 0, R66 = 0x30;
- RTMP_RF_REGS *RFRegTable;
- UCHAR Channel = 0;
-
- RFRegTable = NULL;
-
-#ifdef RALINK_28xx_QA
- // for QA mode, TX power values are passed from UI
- if ((pAd->ate.bQATxStart == TRUE) || (pAd->ate.bQARxStart == TRUE))
- {
- if (pAd->ate.Channel != pAd->LatchRfRegs.Channel)
- {
- pAd->ate.Channel = pAd->LatchRfRegs.Channel;
- }
- return;
- }
- else
-#endif // RALINK_28xx_QA //
- Channel = pAd->ate.Channel;
-
- // select antenna for RT3090
- AsicAntennaSelect(pAd, Channel);
-
- // fill Tx power value
- TxPwer = pAd->ate.TxPower0;
- TxPwer2 = pAd->ate.TxPower1;
-#ifdef RT30xx
-//2008/07/10:KH add to support 3070 ATE<--
-
- /*
- The RF programming sequence is difference between 3xxx and 2xxx.
- The 3070 is 1T1R. Therefore, we don't need to set the number of Tx/Rx path
- and the only job is to set the parameters of channels.
- */
- if (IS_RT30xx(pAd) && ((pAd->RfIcType == RFIC_3020) ||
- (pAd->RfIcType == RFIC_3021) || (pAd->RfIcType == RFIC_3022) ||
- (pAd->RfIcType == RFIC_2020)))
- {
- /* modify by WY for Read RF Reg. error */
- UCHAR RFValue = 0;
-
- for (index = 0; index < NUM_OF_3020_CHNL; index++)
- {
- if (Channel == FreqItems3020[index].Channel)
- {
- // Programming channel parameters.
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R02, FreqItems3020[index].N);
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R03, FreqItems3020[index].K);
-
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R06, (PUCHAR)&RFValue);
- RFValue = (RFValue & 0xFC) | FreqItems3020[index].R;
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R06, (UCHAR)RFValue);
-
- // Set Tx Power.
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R12, (PUCHAR)&RFValue);
- RFValue = (RFValue & 0xE0) | TxPwer;
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R12, (UCHAR)RFValue);
-
- // Set RF offset.
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R23, (PUCHAR)&RFValue);
- //2008/08/06: KH modified "pAd->RFFreqOffset" to "pAd->ate.RFFreqOffset"
- RFValue = (RFValue & 0x80) | pAd->ate.RFFreqOffset;
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R23, (UCHAR)RFValue);
-
- // Set BW.
- if (pAd->ate.TxWI.BW == BW_40)
- {
- RFValue = pAd->Mlme.CaliBW40RfR24;
-// DISABLE_11N_CHECK(pAd);
- }
- else
- {
- RFValue = pAd->Mlme.CaliBW20RfR24;
- }
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R24, (UCHAR)RFValue);
-
- // Enable RF tuning
- ATE_RF_IO_READ8_BY_REG_ID(pAd, RF_R07, (PUCHAR)&RFValue);
- RFValue = RFValue | 0x1;
- ATE_RF_IO_WRITE8_BY_REG_ID(pAd, RF_R07, (UCHAR)RFValue);
-
- // latch channel for future usage
- pAd->LatchRfRegs.Channel = Channel;
-
- break;
- }
- }
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n",
- Channel,
- pAd->RfIcType,
- TxPwer,
- TxPwer2,
- pAd->Antenna.field.TxPath,
- FreqItems3020[index].N,
- FreqItems3020[index].K,
- FreqItems3020[index].R));
- }
- else
-//2008/07/10:KH add to support 3070 ATE-->
-#endif // RT30xx //
- {
- /* RT28xx */
- RFRegTable = RF2850RegTable;
-
- switch (pAd->RfIcType)
- {
- /* But only 2850 and 2750 support 5.5GHz band... */
- case RFIC_2820:
- case RFIC_2850:
- case RFIC_2720:
- case RFIC_2750:
-
- for (index = 0; index < NUM_OF_2850_CHNL; index++)
- {
- if (Channel == RFRegTable[index].Channel)
- {
- R2 = RFRegTable[index].R2;
-
- // If TX path is 1, bit 14 = 1;
- if (pAd->Antenna.field.TxPath == 1)
- {
- R2 |= 0x4000;
- }
-
- if (pAd->Antenna.field.RxPath == 2)
- {
- switch (pAd->ate.RxAntennaSel)
- {
- case 1:
- R2 |= 0x20040;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x00;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- case 2:
- R2 |= 0x10040;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x01;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- default:
- R2 |= 0x40;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- /* Only enable two Antenna to receive. */
- BbpValue |= 0x08;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- }
- }
- else if (pAd->Antenna.field.RxPath == 1)
- {
- // write 1 to off RxPath
- R2 |= 0x20040;
- }
-
- if (pAd->Antenna.field.TxPath == 2)
- {
- if (pAd->ate.TxAntennaSel == 1)
- {
- // If TX Antenna select is 1 , bit 14 = 1; Disable Ant 2
- R2 |= 0x4000;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BbpValue);
- BbpValue &= 0xE7; // 11100111B
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BbpValue);
- }
- else if (pAd->ate.TxAntennaSel == 2)
- {
- // If TX Antenna select is 2 , bit 15 = 1; Disable Ant 1
- R2 |= 0x8000;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BbpValue);
- BbpValue &= 0xE7;
- BbpValue |= 0x08;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BbpValue);
- }
- else
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &BbpValue);
- BbpValue &= 0xE7;
- BbpValue |= 0x10;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, BbpValue);
- }
- }
- if (pAd->Antenna.field.RxPath == 3)
- {
- switch (pAd->ate.RxAntennaSel)
- {
- case 1:
- R2 |= 0x20040;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x00;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- case 2:
- R2 |= 0x10040;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x01;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- case 3:
- R2 |= 0x30000;
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x02;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- default:
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &BbpValue);
- BbpValue &= 0xE4;
- BbpValue |= 0x10;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, BbpValue);
- break;
- }
- }
-
- if (Channel > 14)
- {
- // initialize R3, R4
- R3 = (RFRegTable[index].R3 & 0xffffc1ff);
- R4 = (RFRegTable[index].R4 & (~0x001f87c0)) | (pAd->ate.RFFreqOffset << 15);
-
- /*
- According the Rory's suggestion to solve the middle range issue.
-
- 5.5G band power range : 0xF9~0X0F, TX0 Reg3 bit9/TX1 Reg4 bit6="0"
- means the TX power reduce 7dB.
- */
- // R3
- if ((TxPwer >= -7) && (TxPwer < 0))
- {
- TxPwer = (7+TxPwer);
- TxPwer = (TxPwer > 0xF) ? (0xF) : (TxPwer);
- R3 |= (TxPwer << 10);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATEAsicSwitchChannel: TxPwer=%d \n", TxPwer));
- }
- else
- {
- TxPwer = (TxPwer > 0xF) ? (0xF) : (TxPwer);
- R3 |= (TxPwer << 10) | (1 << 9);
- }
-
- // R4
- if ((TxPwer2 >= -7) && (TxPwer2 < 0))
- {
- TxPwer2 = (7+TxPwer2);
- TxPwer2 = (TxPwer2 > 0xF) ? (0xF) : (TxPwer2);
- R4 |= (TxPwer2 << 7);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ATEAsicSwitchChannel: TxPwer2=%d \n", TxPwer2));
- }
- else
- {
- TxPwer2 = (TxPwer2 > 0xF) ? (0xF) : (TxPwer2);
- R4 |= (TxPwer2 << 7) | (1 << 6);
- }
- }
- else
- {
- // Set TX power0.
- R3 = (RFRegTable[index].R3 & 0xffffc1ff) | (TxPwer << 9);
- // Set frequency offset and TX power1.
- R4 = (RFRegTable[index].R4 & (~0x001f87c0)) | (pAd->ate.RFFreqOffset << 15) | (TxPwer2 <<6);
- }
-
- // based on BBP current mode before changing RF channel
- if (pAd->ate.TxWI.BW == BW_40)
- {
- R4 |=0x200000;
- }
-
- // Update variables.
- pAd->LatchRfRegs.Channel = Channel;
- pAd->LatchRfRegs.R1 = RFRegTable[index].R1;
- pAd->LatchRfRegs.R2 = R2;
- pAd->LatchRfRegs.R3 = R3;
- pAd->LatchRfRegs.R4 = R4;
-
- RtmpRfIoWrite(pAd);
-
- break;
- }
- }
- break;
-
- default:
- break;
- }
- }
-
- // Change BBP setting during switch from a->g, g->a
- if (Channel <= 14)
- {
- UINT32 TxPinCfg = 0x00050F0A;// 2007.10.09 by Brian : 0x0005050A ==> 0x00050F0A
-
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd)));
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R63, (0x37 - GET_LNA_GAIN(pAd)));
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R64, (0x37 - GET_LNA_GAIN(pAd)));
-
- /* For 1T/2R chip only... */
- if (pAd->NicConfig2.field.ExternalLNAForG)
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x62);
- }
- else
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0x84);
- }
-
- // According the Rory's suggestion to solve the middle range issue.
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R86, &BbpValue);// may be removed for RT35xx ++
-
- ASSERT((BbpValue == 0x00));
- if ((BbpValue != 0x00))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R86, 0x00);
- }// may be removed for RT35xx --
-
- // 5.5 GHz band selection PIN, bit1 and bit2 are complement
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Value);
- Value &= (~0x6);
- Value |= (0x04);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
-
- // Turn off unused PA or LNA when only 1T or 1R.
- if (pAd->Antenna.field.TxPath == 1)
- {
- TxPinCfg &= 0xFFFFFFF3;
- }
- if (pAd->Antenna.field.RxPath == 1)
- {
- TxPinCfg &= 0xFFFFF3FF;
- }
-
- // calibration power unbalance issues
- if (pAd->Antenna.field.TxPath == 2)
- {
- if (pAd->ate.TxAntennaSel == 1)
- {
- TxPinCfg &= 0xFFFFFFF7;
- }
- else if (pAd->ate.TxAntennaSel == 2)
- {
- TxPinCfg &= 0xFFFFFFFD;
- }
- }
-
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
- }
- else
- {
- UINT32 TxPinCfg = 0x00050F05;// 2007.10.09 by Brian : 0x00050505 ==> 0x00050F05
-
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R62, (0x37 - GET_LNA_GAIN(pAd)));
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R63, (0x37 - GET_LNA_GAIN(pAd)));
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R64, (0x37 - GET_LNA_GAIN(pAd)));
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R82, 0xF2);
-
- // According the Rory's suggestion to solve the middle range issue.
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R86, &BbpValue);// may be removed for RT35xx ++
-
- ASSERT((BbpValue == 0x00));
- if ((BbpValue != 0x00))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R86, 0x00);
- }
-
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R91, &BbpValue);
- ASSERT((BbpValue == 0x04));
-
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R92, &BbpValue);
- ASSERT((BbpValue == 0x00));// may be removed for RT35xx --
-
- // 5.5 GHz band selection PIN, bit1 and bit2 are complement
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Value);
- Value &= (~0x6);
- Value |= (0x02);
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Value);
-
- // Turn off unused PA or LNA when only 1T or 1R.
- if (pAd->Antenna.field.TxPath == 1)
- {
- TxPinCfg &= 0xFFFFFFF3;
- }
- if (pAd->Antenna.field.RxPath == 1)
- {
- TxPinCfg &= 0xFFFFF3FF;
- }
-
- RTMP_IO_WRITE32(pAd, TX_PIN_CFG, TxPinCfg);
- }
-
-
- // R66 should be set according to Channel and use 20MHz when scanning
- if (Channel <= 14)
- {
- // BG band
- R66 = 0x2E + GET_LNA_GAIN(pAd);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- else
- {
- // 5.5 GHz band
- if (pAd->ate.TxWI.BW == BW_20)
- {
- R66 = (UCHAR)(0x32 + (GET_LNA_GAIN(pAd)*5)/3);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- else
- {
- R66 = (UCHAR)(0x3A + (GET_LNA_GAIN(pAd)*5)/3);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, R66);
- }
- }
-
- /*
- On 11A, We should delay and wait RF/BBP to be stable
- and the appropriate time should be 1000 micro seconds.
-
- 2005/06/05 - On 11G, We also need this delay time. Otherwise it's difficult to pass the WHQL.
- */
- RTMPusecDelay(1000);
-
-#ifndef RTMP_RF_RW_SUPPORT
- if (Channel > 14)
- {
- // When 5.5GHz band the LSB of TxPwr will be used to reduced 7dB or not.
- ATEDBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, %dT) to , R1=0x%08lx, R2=0x%08lx, R3=0x%08lx, R4=0x%08lx\n",
- Channel,
- pAd->RfIcType,
- pAd->Antenna.field.TxPath,
- pAd->LatchRfRegs.R1,
- pAd->LatchRfRegs.R2,
- pAd->LatchRfRegs.R3,
- pAd->LatchRfRegs.R4));
- }
- else
- {
- ATEDBGPRINT(RT_DEBUG_TRACE, ("SwitchChannel#%d(RF=%d, Pwr0=%u, Pwr1=%u, %dT) to , R1=0x%08lx, R2=0x%08lx, R3=0x%08lx, R4=0x%08lx\n",
- Channel,
- pAd->RfIcType,
- (R3 & 0x00003e00) >> 9,
- (R4 & 0x000007c0) >> 6,
- pAd->Antenna.field.TxPath,
- pAd->LatchRfRegs.R1,
- pAd->LatchRfRegs.R2,
- pAd->LatchRfRegs.R3,
- pAd->LatchRfRegs.R4));
- }
-#endif // RTMP_RF_RW_SUPPORT //
-}
-
-
-
-/* In fact, no one will call this routine so far ! */
-
-/*
-==========================================================================
- Description:
- Gives CCK TX rate 2 more dB TX power.
- This routine works only in ATE mode.
-
- calculate desired Tx power in RF R3.Tx0~5, should consider -
- 0. if current radio is a noisy environment (pAd->DrsCounters.fNoisyEnvironment)
- 1. TxPowerPercentage
- 2. auto calibration based on TSSI feedback
- 3. extra 2 db for CCK
- 4. -10 db upon very-short distance (AvgRSSI >= -40db) to AP
-
- NOTE: Since this routine requires the value of (pAd->DrsCounters.fNoisyEnvironment),
- it should be called AFTER MlmeDynamicTxRateSwitching()
-==========================================================================
-*/
-VOID ATEAsicAdjustTxPower(
- IN PRTMP_ADAPTER pAd)
-{
- INT i, j;
- CHAR DeltaPwr = 0;
- BOOLEAN bAutoTxAgc = FALSE;
- UCHAR TssiRef, *pTssiMinusBoundary, *pTssiPlusBoundary, TxAgcStep;
- UCHAR BbpR49 = 0, idx;
- PCHAR pTxAgcCompensate;
- ULONG TxPwr[5];
- CHAR Value;
-
- /* no one calls this procedure so far */
- if (pAd->ate.TxWI.BW == BW_40)
- {
- if (pAd->ate.Channel > 14)
- {
- TxPwr[0] = pAd->Tx40MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx40MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx40MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx40MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx40MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx40MPwrCfgGBand[4];
- }
- }
- else
- {
- if (pAd->ate.Channel > 14)
- {
- TxPwr[0] = pAd->Tx20MPwrCfgABand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgABand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgABand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgABand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgABand[4];
- }
- else
- {
- TxPwr[0] = pAd->Tx20MPwrCfgGBand[0];
- TxPwr[1] = pAd->Tx20MPwrCfgGBand[1];
- TxPwr[2] = pAd->Tx20MPwrCfgGBand[2];
- TxPwr[3] = pAd->Tx20MPwrCfgGBand[3];
- TxPwr[4] = pAd->Tx20MPwrCfgGBand[4];
- }
- }
-
- // TX power compensation for temperature variation based on TSSI.
- // Do it per 4 seconds.
- if (pAd->Mlme.OneSecPeriodicRound % 4 == 0)
- {
- if (pAd->ate.Channel <= 14)
- {
- /* bg channel */
- bAutoTxAgc = pAd->bAutoTxAgcG;
- TssiRef = pAd->TssiRefG;
- pTssiMinusBoundary = &pAd->TssiMinusBoundaryG[0];
- pTssiPlusBoundary = &pAd->TssiPlusBoundaryG[0];
- TxAgcStep = pAd->TxAgcStepG;
- pTxAgcCompensate = &pAd->TxAgcCompensateG;
- }
- else
- {
- /* a channel */
- bAutoTxAgc = pAd->bAutoTxAgcA;
- TssiRef = pAd->TssiRefA;
- pTssiMinusBoundary = &pAd->TssiMinusBoundaryA[0];
- pTssiPlusBoundary = &pAd->TssiPlusBoundaryA[0];
- TxAgcStep = pAd->TxAgcStepA;
- pTxAgcCompensate = &pAd->TxAgcCompensateA;
- }
-
- if (bAutoTxAgc)
- {
- /* BbpR49 is unsigned char. */
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R49, &BbpR49);
-
- /* (p) TssiPlusBoundaryG[0] = 0 = (m) TssiMinusBoundaryG[0] */
- /* compensate: +4 +3 +2 +1 0 -1 -2 -3 -4 * steps */
- /* step value is defined in pAd->TxAgcStepG for tx power value */
-
- /* [4]+1+[4] p4 p3 p2 p1 o1 m1 m2 m3 m4 */
- /* ex: 0x00 0x15 0x25 0x45 0x88 0xA0 0xB5 0xD0 0xF0
- above value are examined in mass factory production */
- /* [4] [3] [2] [1] [0] [1] [2] [3] [4] */
-
- /* plus is 0x10 ~ 0x40, minus is 0x60 ~ 0x90 */
- /* if value is between p1 ~ o1 or o1 ~ s1, no need to adjust tx power */
- /* if value is 0x65, tx power will be -= TxAgcStep*(2-1) */
-
- if (BbpR49 > pTssiMinusBoundary[1])
- {
- // Reading is larger than the reference value.
- // Check for how large we need to decrease the Tx power.
- for (idx = 1; idx < 5; idx++)
- {
- // Found the range.
- if (BbpR49 <= pTssiMinusBoundary[idx])
- break;
- }
-
- // The index is the step we should decrease, idx = 0 means there is nothing to compensate.
-// if (R3 > (ULONG) (TxAgcStep * (idx-1)))
- *pTxAgcCompensate = -(TxAgcStep * (idx-1));
-// else
-// *pTxAgcCompensate = -((UCHAR)R3);
-
- DeltaPwr += (*pTxAgcCompensate);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("-- Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = -%d\n",
- BbpR49, TssiRef, TxAgcStep, idx-1));
- }
- else if (BbpR49 < pTssiPlusBoundary[1])
- {
- // Reading is smaller than the reference value.
- // Check for how large we need to increase the Tx power.
- for (idx = 1; idx < 5; idx++)
- {
- // Found the range.
- if (BbpR49 >= pTssiPlusBoundary[idx])
- break;
- }
-
- // The index is the step we should increase, idx = 0 means there is nothing to compensate.
- *pTxAgcCompensate = TxAgcStep * (idx-1);
- DeltaPwr += (*pTxAgcCompensate);
- ATEDBGPRINT(RT_DEBUG_TRACE, ("++ Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = +%d\n",
- BbpR49, TssiRef, TxAgcStep, idx-1));
- }
- else
- {
- *pTxAgcCompensate = 0;
- ATEDBGPRINT(RT_DEBUG_TRACE, (" Tx Power, BBP R1=%x, TssiRef=%x, TxAgcStep=%x, step = +%d\n",
- BbpR49, TssiRef, TxAgcStep, 0));
- }
- }
- }
- else
- {
- if (pAd->ate.Channel <= 14)
- {
- bAutoTxAgc = pAd->bAutoTxAgcG;
- pTxAgcCompensate = &pAd->TxAgcCompensateG;
- }
- else
- {
- bAutoTxAgc = pAd->bAutoTxAgcA;
- pTxAgcCompensate = &pAd->TxAgcCompensateA;
- }
-
- if (bAutoTxAgc)
- DeltaPwr += (*pTxAgcCompensate);
- }
-
- /* Calculate delta power based on the percentage specified from UI. */
- // E2PROM setting is calibrated for maximum TX power (i.e. 100%)
- // We lower TX power here according to the percentage specified from UI.
- if (pAd->CommonCfg.TxPowerPercentage == 0xffffffff) // AUTO TX POWER control
- ;
- else if (pAd->CommonCfg.TxPowerPercentage > 90) // 91 ~ 100% & AUTO, treat as 100% in terms of mW
- ;
- else if (pAd->CommonCfg.TxPowerPercentage > 60) // 61 ~ 90%, treat as 75% in terms of mW
- {
- DeltaPwr -= 1;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 30) // 31 ~ 60%, treat as 50% in terms of mW
- {
- DeltaPwr -= 3;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 15) // 16 ~ 30%, treat as 25% in terms of mW
- {
- DeltaPwr -= 6;
- }
- else if (pAd->CommonCfg.TxPowerPercentage > 9) // 10 ~ 15%, treat as 12.5% in terms of mW
- {
- DeltaPwr -= 9;
- }
- else // 0 ~ 9 %, treat as MIN(~3%) in terms of mW
- {
- DeltaPwr -= 12;
- }
-
- /* Reset different new tx power for different TX rate. */
- for (i=0; i<5; i++)
- {
- if (TxPwr[i] != 0xffffffff)
- {
- for (j=0; j<8; j++)
- {
- Value = (CHAR)((TxPwr[i] >> j*4) & 0x0F); /* 0 ~ 15 */
-
- if ((Value + DeltaPwr) < 0)
- {
- Value = 0; /* min */
- }
- else if ((Value + DeltaPwr) > 0xF)
- {
- Value = 0xF; /* max */
- }
- else
- {
- Value += DeltaPwr; /* temperature compensation */
- }
-
- /* fill new value to CSR offset */
- TxPwr[i] = (TxPwr[i] & ~(0x0000000F << j*4)) | (Value << j*4);
- }
-
- /* write tx power value to CSR */
- /* TX_PWR_CFG_0 (8 tx rate) for TX power for OFDM 12M/18M
- TX power for OFDM 6M/9M
- TX power for CCK5.5M/11M
- TX power for CCK1M/2M */
- /* TX_PWR_CFG_1 ~ TX_PWR_CFG_4 */
- RTMP_IO_WRITE32(pAd, TX_PWR_CFG_0 + i*4, TxPwr[i]);
-
-
- }
- }
-
-}
-
-
-/*
-========================================================================
- Routine Description:
- Write TxWI for ATE mode.
-
- Return Value:
- None
-========================================================================
-*/
-#ifdef RTMP_MAC_PCI
-static VOID ATEWriteTxWI(
- IN PRTMP_ADAPTER pAd,
- IN PTXWI_STRUC pOutTxWI,
- IN BOOLEAN FRAG,
- IN BOOLEAN CFACK,
- IN BOOLEAN InsTimestamp,
- IN BOOLEAN AMPDU,
- IN BOOLEAN Ack,
- IN BOOLEAN NSeq, // HW new a sequence.
- IN UCHAR BASize,
- IN UCHAR WCID,
- IN ULONG Length,
- IN UCHAR PID,
- IN UCHAR TID,
- IN UCHAR TxRate,
- IN UCHAR Txopmode,
- IN BOOLEAN CfAck,
- IN HTTRANSMIT_SETTING *pTransmit)
-{
- TXWI_STRUC TxWI;
- PTXWI_STRUC pTxWI;
-
- //
- // Always use Long preamble before verifiation short preamble functionality works well.
- // Todo: remove the following line if short preamble functionality works
- //
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED);
- NdisZeroMemory(&TxWI, TXWI_SIZE);
- pTxWI = &TxWI;
-
- pTxWI->FRAG= FRAG;
-
- pTxWI->CFACK = CFACK;
- pTxWI->TS= InsTimestamp;
- pTxWI->AMPDU = AMPDU;
- pTxWI->ACK = Ack;
- pTxWI->txop= Txopmode;
-
- pTxWI->NSEQ = NSeq;
-
- // John tune the performace with Intel Client in 20 MHz performance
- if ( BASize >7 )
- BASize =7;
-
- pTxWI->BAWinSize = BASize;
- pTxWI->WirelessCliID = WCID;
- pTxWI->MPDUtotalByteCount = Length;
- pTxWI->PacketId = PID;
-
- // If CCK or OFDM, BW must be 20
- pTxWI->BW = (pTransmit->field.MODE <= MODE_OFDM) ? (BW_20) : (pTransmit->field.BW);
- pTxWI->ShortGI = pTransmit->field.ShortGI;
- pTxWI->STBC = pTransmit->field.STBC;
-
- pTxWI->MCS = pTransmit->field.MCS;
- pTxWI->PHYMODE = pTransmit->field.MODE;
- pTxWI->CFACK = CfAck;
- pTxWI->MIMOps = 0;
- pTxWI->MpduDensity = 0;
-
- pTxWI->PacketId = pTxWI->MCS;
- NdisMoveMemory(pOutTxWI, &TxWI, sizeof(TXWI_STRUC));
-
- return;
-}
-#endif // RTMP_MAC_PCI //
-
-
-
-
-/*
-========================================================================
-
- Routine Description:
- Disable protection for ATE.
-========================================================================
-*/
-VOID ATEDisableAsicProtect(
- IN PRTMP_ADAPTER pAd)
-{
- PROT_CFG_STRUC ProtCfg, ProtCfg4;
- UINT32 Protect[6];
- USHORT offset;
- UCHAR i;
- UINT32 MacReg = 0;
-
- // Config ASIC RTS threshold register
- RTMP_IO_READ32(pAd, TX_RTS_CFG, &MacReg);
- MacReg &= 0xFF0000FF;
- MacReg |= (pAd->CommonCfg.RtsThreshold << 8);
- RTMP_IO_WRITE32(pAd, TX_RTS_CFG, MacReg);
-
- // Initial common protection settings
- RTMPZeroMemory(Protect, sizeof(Protect));
- ProtCfg4.word = 0;
- ProtCfg.word = 0;
- ProtCfg.field.TxopAllowGF40 = 1;
- ProtCfg.field.TxopAllowGF20 = 1;
- ProtCfg.field.TxopAllowMM40 = 1;
- ProtCfg.field.TxopAllowMM20 = 1;
- ProtCfg.field.TxopAllowOfdm = 1;
- ProtCfg.field.TxopAllowCck = 1;
- ProtCfg.field.RTSThEn = 1;
- ProtCfg.field.ProtectNav = ASIC_SHORTNAV;
-
- // Handle legacy(B/G) protection
- ProtCfg.field.ProtectRate = pAd->CommonCfg.RtsRate;
- ProtCfg.field.ProtectCtrl = 0;
- Protect[0] = ProtCfg.word;
- Protect[1] = ProtCfg.word;
-
- // NO PROTECT
- // 1.All STAs in the BSS are 20/40 MHz HT
- // 2. in ai 20/40MHz BSS
- // 3. all STAs are 20MHz in a 20MHz BSS
- // Pure HT. no protection.
-
- // MM20_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 010111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4004 (OFDM 24M)
- Protect[2] = 0x01744004;
-
- // MM40_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 111111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4084 (duplicate OFDM 24M)
- Protect[3] = 0x03f44084;
-
- // CF20_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 010111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4004 (OFDM 24M)
- Protect[4] = 0x01744004;
-
- // CF40_PROT_CFG
- // Reserved (31:27)
- // PROT_TXOP(25:20) -- 111111
- // PROT_NAV(19:18) -- 01 (Short NAV protection)
- // PROT_CTRL(17:16) -- 00 (None)
- // PROT_RATE(15:0) -- 0x4084 (duplicate OFDM 24M)
- Protect[5] = 0x03f44084;
-
- pAd->CommonCfg.IOTestParm.bRTSLongProtOn = FALSE;
-
- offset = CCK_PROT_CFG;
- for (i = 0;i < 6;i++)
- RTMP_IO_WRITE32(pAd, offset + i*4, Protect[i]);
-
-}
-
-
-
-
-/* There are two ways to convert Rssi */
-/* the way used with GET_LNA_GAIN() */
-CHAR ATEConvertToRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi,
- IN UCHAR RssiNumber)
-{
- UCHAR RssiOffset, LNAGain;
-
- // Rssi equals to zero should be an invalid value
- if (Rssi == 0)
- return -99;
-
- LNAGain = GET_LNA_GAIN(pAd);
- if (pAd->LatchRfRegs.Channel > 14)
- {
- if (RssiNumber == 0)
- RssiOffset = pAd->ARssiOffset0;
- else if (RssiNumber == 1)
- RssiOffset = pAd->ARssiOffset1;
- else
- RssiOffset = pAd->ARssiOffset2;
- }
- else
- {
- if (RssiNumber == 0)
- RssiOffset = pAd->BGRssiOffset0;
- else if (RssiNumber == 1)
- RssiOffset = pAd->BGRssiOffset1;
- else
- RssiOffset = pAd->BGRssiOffset2;
- }
-
- return (-12 - RssiOffset - LNAGain - Rssi);
-}
-
-
-/*
-========================================================================
-
- Routine Description:
- Set Japan filter coefficients if needed.
- Note:
- This routine should only be called when
- entering TXFRAME mode or TXCONT mode.
-
-========================================================================
-*/
-static VOID SetJapanFilter(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR BbpData = 0;
-
- //
- // If Channel=14 and Bandwidth=20M and Mode=CCK, set BBP R4 bit5=1
- // (Japan Tx filter coefficients)when (TXFRAME or TXCONT).
- //
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BbpData);
-
- if ((pAd->ate.TxWI.PHYMODE == MODE_CCK) && (pAd->ate.Channel == 14) && (pAd->ate.TxWI.BW == BW_20))
- {
- BbpData |= 0x20; // turn on
- ATEDBGPRINT(RT_DEBUG_TRACE, ("SetJapanFilter!!!\n"));
- }
- else
- {
- BbpData &= 0xdf; // turn off
- ATEDBGPRINT(RT_DEBUG_TRACE, ("ClearJapanFilter!!!\n"));
- }
-
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BbpData);
-}
-
-
-VOID ATESampleRssi(
- IN PRTMP_ADAPTER pAd,
- IN PRXWI_STRUC pRxWI)
-{
- /* There are two ways to collect RSSI. */
-// pAd->LastRxRate = (USHORT)((pRxWI->MCS) + (pRxWI->BW <<7) + (pRxWI->ShortGI <<8)+ (pRxWI->PHYMODE <<14)) ;
- if (pRxWI->RSSI0 != 0)
- {
- pAd->ate.LastRssi0 = ATEConvertToRssi(pAd, (CHAR) pRxWI->RSSI0, RSSI_0);
- pAd->ate.AvgRssi0X8 = (pAd->ate.AvgRssi0X8 - pAd->ate.AvgRssi0) + pAd->ate.LastRssi0;
- pAd->ate.AvgRssi0 = pAd->ate.AvgRssi0X8 >> 3;
- }
- if (pRxWI->RSSI1 != 0)
- {
- pAd->ate.LastRssi1 = ATEConvertToRssi(pAd, (CHAR) pRxWI->RSSI1, RSSI_1);
- pAd->ate.AvgRssi1X8 = (pAd->ate.AvgRssi1X8 - pAd->ate.AvgRssi1) + pAd->ate.LastRssi1;
- pAd->ate.AvgRssi1 = pAd->ate.AvgRssi1X8 >> 3;
- }
- if (pRxWI->RSSI2 != 0)
- {
- pAd->ate.LastRssi2 = ATEConvertToRssi(pAd, (CHAR) pRxWI->RSSI2, RSSI_2);
- pAd->ate.AvgRssi2X8 = (pAd->ate.AvgRssi2X8 - pAd->ate.AvgRssi2) + pAd->ate.LastRssi2;
- pAd->ate.AvgRssi2 = pAd->ate.AvgRssi2X8 >> 3;
- }
-
- pAd->ate.LastSNR0 = (CHAR)(pRxWI->SNR0);// CHAR ==> UCHAR ?
- pAd->ate.LastSNR1 = (CHAR)(pRxWI->SNR1);// CHAR ==> UCHAR ?
-
- pAd->ate.NumOfAvgRssiSample ++;
-}
-
-
-#ifdef CONFIG_STA_SUPPORT
-VOID RTMPStationStop(
- IN PRTMP_ADAPTER pAd)
-{
-// BOOLEAN Cancelled;
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("==> RTMPStationStop\n"));
-
- // For rx statistics, we need to keep this timer running.
-// RTMPCancelTimer(&pAd->Mlme.PeriodicTimer, &Cancelled);
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("<== RTMPStationStop\n"));
-}
-
-
-VOID RTMPStationStart(
- IN PRTMP_ADAPTER pAd)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE, ("==> RTMPStationStart\n"));
-
-#ifdef RTMP_MAC_PCI
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- /* We did not cancel this timer when entering ATE mode. */
-// RTMPSetTimer(&pAd->Mlme.PeriodicTimer, MLME_TASK_EXEC_INTV);
-#endif // RTMP_MAC_PCI //
-
- ATEDBGPRINT(RT_DEBUG_TRACE, ("<== RTMPStationStart\n"));
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-/*
-==========================================================================
- Description:
- Setup Frame format.
- NOTE:
- This routine should only be used in ATE mode.
-==========================================================================
-*/
-#ifdef RTMP_MAC_PCI
-static INT ATESetUpFrame(
- IN PRTMP_ADAPTER pAd,
- IN UINT32 TxIdx)
-{
- UINT j;
- PTXD_STRUC pTxD;
-#ifdef RT_BIG_ENDIAN
- PTXD_STRUC pDestTxD;
- TXD_STRUC TxD;
-#endif
- PNDIS_PACKET pPacket;
- PUCHAR pDest;
- PVOID AllocVa;
- NDIS_PHYSICAL_ADDRESS AllocPa;
- HTTRANSMIT_SETTING TxHTPhyMode;
-
- PRTMP_TX_RING pTxRing = &pAd->TxRing[QID_AC_BE];
- PTXWI_STRUC pTxWI = (PTXWI_STRUC) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
- PUCHAR pDMAHeaderBufVA = (PUCHAR) pTxRing->Cell[TxIdx].DmaBuf.AllocVa;
-
-#ifdef RALINK_28xx_QA
- PHEADER_802_11 pHeader80211;
-#endif // RALINK_28xx_QA //
-
- if (pAd->ate.bQATxStart == TRUE)
- {
- // always use QID_AC_BE and FIFO_EDCA
-
- // fill TxWI
- TxHTPhyMode.field.BW = pAd->ate.TxWI.BW;
- TxHTPhyMode.field.ShortGI = pAd->ate.TxWI.ShortGI;
- TxHTPhyMode.field.STBC = 0;
- TxHTPhyMode.field.MCS = pAd->ate.TxWI.MCS;
- TxHTPhyMode.field.MODE = pAd->ate.TxWI.PHYMODE;
-
- ATEWriteTxWI(pAd, pTxWI, pAd->ate.TxWI.FRAG, pAd->ate.TxWI.CFACK,
- pAd->ate.TxWI.TS, pAd->ate.TxWI.AMPDU, pAd->ate.TxWI.ACK, pAd->ate.TxWI.NSEQ,
- pAd->ate.TxWI.BAWinSize, 0, pAd->ate.TxWI.MPDUtotalByteCount, pAd->ate.TxWI.PacketId, 0, 0,
- pAd->ate.TxWI.txop/*IFS_HTTXOP*/, pAd->ate.TxWI.CFACK/*FALSE*/, &TxHTPhyMode);
- }
- else
- {
- TxHTPhyMode.field.BW = pAd->ate.TxWI.BW;
- TxHTPhyMode.field.ShortGI = pAd->ate.TxWI.ShortGI;
- TxHTPhyMode.field.STBC = 0;
- TxHTPhyMode.field.MCS = pAd->ate.TxWI.MCS;
- TxHTPhyMode.field.MODE = pAd->ate.TxWI.PHYMODE;
- ATEWriteTxWI(pAd, pTxWI, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
- 4, 0, pAd->ate.TxLength, 0, 0, 0, IFS_HTTXOP, FALSE, &TxHTPhyMode);
- }
-
- // fill 802.11 header
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- NdisMoveMemory(pDMAHeaderBufVA+TXWI_SIZE, pAd->ate.Header, pAd->ate.HLen);
- }
- else
-#endif // RALINK_28xx_QA //
- {
- NdisMoveMemory(pDMAHeaderBufVA+TXWI_SIZE, TemplateFrame, LENGTH_802_11);
- NdisMoveMemory(pDMAHeaderBufVA+TXWI_SIZE+4, pAd->ate.Addr1, ETH_LENGTH_OF_ADDRESS);
- NdisMoveMemory(pDMAHeaderBufVA+TXWI_SIZE+10, pAd->ate.Addr2, ETH_LENGTH_OF_ADDRESS);
- NdisMoveMemory(pDMAHeaderBufVA+TXWI_SIZE+16, pAd->ate.Addr3, ETH_LENGTH_OF_ADDRESS);
- }
-
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (((PUCHAR)pDMAHeaderBufVA)+TXWI_SIZE), DIR_READ, FALSE);
-#endif // RT_BIG_ENDIAN //
-
- /* alloc buffer for payload */
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- pPacket = RTMP_AllocateRxPacketBuffer(pAd, pAd->ate.DLen + 0x100, FALSE, &AllocVa, &AllocPa);
- }
- else
-#endif // RALINK_28xx_QA //
- {
- pPacket = RTMP_AllocateRxPacketBuffer(pAd, pAd->ate.TxLength, FALSE, &AllocVa, &AllocPa);
- }
-
- if (pPacket == NULL)
- {
- pAd->ate.TxCount = 0;
- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s fail to alloc packet space.\n", __FUNCTION__));
- return -1;
- }
- pTxRing->Cell[TxIdx].pNextNdisPacket = pPacket;
-
- pDest = (PUCHAR) AllocVa;
-
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- RTPKT_TO_OSPKT(pPacket)->len = pAd->ate.DLen;
- }
- else
-#endif // RALINK_28xx_QA //
- {
- RTPKT_TO_OSPKT(pPacket)->len = pAd->ate.TxLength - LENGTH_802_11;
- }
-
- // prepare frame payload
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- // copy pattern
- if ((pAd->ate.PLen != 0))
- {
- int j;
-
- for (j = 0; j < pAd->ate.DLen; j+=pAd->ate.PLen)
- {
- memcpy(RTPKT_TO_OSPKT(pPacket)->data + j, pAd->ate.Pattern, pAd->ate.PLen);
- }
- }
- }
- else
-#endif // RALINK_28xx_QA //
- {
- for (j = 0; j < RTPKT_TO_OSPKT(pPacket)->len; j++)
- {
- pDest[j] = 0xA5;
- }
- }
-
- /* build Tx Descriptor */
-#ifndef RT_BIG_ENDIAN
- pTxD = (PTXD_STRUC) pTxRing->Cell[TxIdx].AllocVa;
-#else
- pDestTxD = (PTXD_STRUC)pTxRing->Cell[TxIdx].AllocVa;
- TxD = *pDestTxD;
- pTxD = &TxD;
-#endif // !RT_BIG_ENDIAN //
-
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQATxStart == TRUE)
- {
- // prepare TxD
- NdisZeroMemory(pTxD, TXD_SIZE);
- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
- // build TX DESC
- pTxD->SDPtr0 = RTMP_GetPhysicalAddressLow(pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
- pTxD->SDLen0 = TXWI_SIZE + pAd->ate.HLen;
- pTxD->LastSec0 = 0;
- pTxD->SDPtr1 = AllocPa;
- pTxD->SDLen1 = RTPKT_TO_OSPKT(pPacket)->len;
- pTxD->LastSec1 = 1;
-
- pDest = (PUCHAR)pTxWI;
- pDest += TXWI_SIZE;
- pHeader80211 = (PHEADER_802_11)pDest;
-
- // modify sequence number...
- if (pAd->ate.TxDoneCount == 0)
- {
- pAd->ate.seq = pHeader80211->Sequence;
- }
- else
- pHeader80211->Sequence = ++pAd->ate.seq;
- }
- else
-#endif // RALINK_28xx_QA //
- {
- NdisZeroMemory(pTxD, TXD_SIZE);
- RTMPWriteTxDescriptor(pAd, pTxD, FALSE, FIFO_EDCA);
- // build TX DESC
- pTxD->SDPtr0 = RTMP_GetPhysicalAddressLow (pTxRing->Cell[TxIdx].DmaBuf.AllocPa);
- pTxD->SDLen0 = TXWI_SIZE + LENGTH_802_11;
- pTxD->LastSec0 = 0;
- pTxD->SDPtr1 = AllocPa;
- pTxD->SDLen1 = RTPKT_TO_OSPKT(pPacket)->len;
- pTxD->LastSec1 = 1;
- }
-
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)pTxWI, TYPE_TXWI);
- RTMPFrameEndianChange(pAd, (((PUCHAR)pDMAHeaderBufVA)+TXWI_SIZE), DIR_WRITE, FALSE);
- RTMPDescriptorEndianChange((PUCHAR)pTxD, TYPE_TXD);
- WriteBackToDescriptor((PUCHAR)pDestTxD, (PUCHAR)pTxD, FALSE, TYPE_TXD);
-#endif // RT_BIG_ENDIAN //
-
- return 0;
-}
-/*=======================End of RTMP_MAC_PCI =======================*/
-#endif // RTMP_MAC_PCI //
-
-
-
-
-VOID rt_ee_read_all(PRTMP_ADAPTER pAd, USHORT *Data)
-{
- USHORT i;
- USHORT value;
-
-
- for (i = 0 ; i < EEPROM_SIZE/2 ; )
- {
- /* "value" is especially for some compilers... */
- RT28xx_EEPROM_READ16(pAd, i*2, value);
- Data[i] = value;
- i++;
- }
-}
-
-
-VOID rt_ee_write_all(PRTMP_ADAPTER pAd, USHORT *Data)
-{
- USHORT i;
- USHORT value;
-
-
- for (i = 0 ; i < EEPROM_SIZE/2 ; )
- {
- /* "value" is especially for some compilers... */
- value = Data[i];
- RT28xx_EEPROM_WRITE16(pAd, i*2, value);
- i++;
- }
-}
-
-
-#ifdef RALINK_28xx_QA
-VOID ATE_QA_Statistics(
- IN PRTMP_ADAPTER pAd,
- IN PRXWI_STRUC pRxWI,
- IN PRT28XX_RXD_STRUC pRxD,
- IN PHEADER_802_11 pHeader)
-{
- // update counter first
- if (pHeader != NULL)
- {
- if (pHeader->FC.Type == BTYPE_DATA)
- {
- if (pRxD->U2M)
- pAd->ate.U2M++;
- else
- pAd->ate.OtherData++;
- }
- else if (pHeader->FC.Type == BTYPE_MGMT)
- {
- if (pHeader->FC.SubType == SUBTYPE_BEACON)
- pAd->ate.Beacon++;
- else
- pAd->ate.OtherCount++;
- }
- else if (pHeader->FC.Type == BTYPE_CNTL)
- {
- pAd->ate.OtherCount++;
- }
- }
- pAd->ate.RSSI0 = pRxWI->RSSI0;
- pAd->ate.RSSI1 = pRxWI->RSSI1;
- pAd->ate.RSSI2 = pRxWI->RSSI2;
- pAd->ate.SNR0 = pRxWI->SNR0;
- pAd->ate.SNR1 = pRxWI->SNR1;
-}
-
-
-/* command id with Cmd Type == 0x0008(for 28xx)/0x0005(for iNIC) */
-#define RACFG_CMD_RF_WRITE_ALL 0x0000
-#define RACFG_CMD_E2PROM_READ16 0x0001
-#define RACFG_CMD_E2PROM_WRITE16 0x0002
-#define RACFG_CMD_E2PROM_READ_ALL 0x0003
-#define RACFG_CMD_E2PROM_WRITE_ALL 0x0004
-#define RACFG_CMD_IO_READ 0x0005
-#define RACFG_CMD_IO_WRITE 0x0006
-#define RACFG_CMD_IO_READ_BULK 0x0007
-#define RACFG_CMD_BBP_READ8 0x0008
-#define RACFG_CMD_BBP_WRITE8 0x0009
-#define RACFG_CMD_BBP_READ_ALL 0x000a
-#define RACFG_CMD_GET_COUNTER 0x000b
-#define RACFG_CMD_CLEAR_COUNTER 0x000c
-
-#define RACFG_CMD_RSV1 0x000d
-#define RACFG_CMD_RSV2 0x000e
-#define RACFG_CMD_RSV3 0x000f
-
-#define RACFG_CMD_TX_START 0x0010
-#define RACFG_CMD_GET_TX_STATUS 0x0011
-#define RACFG_CMD_TX_STOP 0x0012
-#define RACFG_CMD_RX_START 0x0013
-#define RACFG_CMD_RX_STOP 0x0014
-#define RACFG_CMD_GET_NOISE_LEVEL 0x0015
-
-#define RACFG_CMD_ATE_START 0x0080
-#define RACFG_CMD_ATE_STOP 0x0081
-
-#define RACFG_CMD_ATE_START_TX_CARRIER 0x0100
-#define RACFG_CMD_ATE_START_TX_CONT 0x0101
-#define RACFG_CMD_ATE_START_TX_FRAME 0x0102
-#define RACFG_CMD_ATE_SET_BW 0x0103
-#define RACFG_CMD_ATE_SET_TX_POWER0 0x0104
-#define RACFG_CMD_ATE_SET_TX_POWER1 0x0105
-#define RACFG_CMD_ATE_SET_FREQ_OFFSET 0x0106
-#define RACFG_CMD_ATE_GET_STATISTICS 0x0107
-#define RACFG_CMD_ATE_RESET_COUNTER 0x0108
-#define RACFG_CMD_ATE_SEL_TX_ANTENNA 0x0109
-#define RACFG_CMD_ATE_SEL_RX_ANTENNA 0x010a
-#define RACFG_CMD_ATE_SET_PREAMBLE 0x010b
-#define RACFG_CMD_ATE_SET_CHANNEL 0x010c
-#define RACFG_CMD_ATE_SET_ADDR1 0x010d
-#define RACFG_CMD_ATE_SET_ADDR2 0x010e
-#define RACFG_CMD_ATE_SET_ADDR3 0x010f
-#define RACFG_CMD_ATE_SET_RATE 0x0110
-#define RACFG_CMD_ATE_SET_TX_FRAME_LEN 0x0111
-#define RACFG_CMD_ATE_SET_TX_FRAME_COUNT 0x0112
-#define RACFG_CMD_ATE_START_RX_FRAME 0x0113
-#define RACFG_CMD_ATE_E2PROM_READ_BULK 0x0114
-#define RACFG_CMD_ATE_E2PROM_WRITE_BULK 0x0115
-#define RACFG_CMD_ATE_IO_WRITE_BULK 0x0116
-#define RACFG_CMD_ATE_BBP_READ_BULK 0x0117
-#define RACFG_CMD_ATE_BBP_WRITE_BULK 0x0118
-#define RACFG_CMD_ATE_RF_READ_BULK 0x0119
-#define RACFG_CMD_ATE_RF_WRITE_BULK 0x011a
-
-
-static VOID memcpy_exl(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, ULONG len);
-static VOID memcpy_exs(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, ULONG len);
-static VOID RTMP_IO_READ_BULK(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, UINT32 len);
-
-
-
-VOID RtmpDoAte(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
-{
- USHORT Command_Id;
- INT Status = NDIS_STATUS_SUCCESS;
- struct ate_racfghdr *pRaCfg;
-
-
- if ((pRaCfg = kmalloc(sizeof(struct ate_racfghdr), GFP_KERNEL)) == NULL)
- {
- Status = -EINVAL;
- return;
- }
-
- NdisZeroMemory(pRaCfg, sizeof(struct ate_racfghdr));
-
- if (copy_from_user((PUCHAR)pRaCfg, wrq->u.data.pointer, wrq->u.data.length))
- {
- Status = -EFAULT;
- kfree(pRaCfg);
- return;
- }
-
- Command_Id = ntohs(pRaCfg->command_id);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("\n%s: Command_Id = 0x%04x !\n", __FUNCTION__, Command_Id));
-
- switch (Command_Id)
- {
- /* We will get this command when QA starts. */
- case RACFG_CMD_ATE_START:
- Status=DO_RACFG_CMD_ATE_START(pAdapter,wrq,pRaCfg);
- break;
-
- /* We will get this command either QA is closed or ated is killed by user. */
- case RACFG_CMD_ATE_STOP:
- Status=DO_RACFG_CMD_ATE_STOP(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_RF_WRITE_ALL:
- Status=DO_RACFG_CMD_RF_WRITE_ALL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_E2PROM_READ16:
- Status=DO_RACFG_CMD_E2PROM_READ16(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_E2PROM_WRITE16:
- Status=DO_RACFG_CMD_E2PROM_WRITE16(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_E2PROM_READ_ALL:
- Status=DO_RACFG_CMD_E2PROM_READ_ALL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_E2PROM_WRITE_ALL:
- Status=DO_RACFG_CMD_E2PROM_WRITE_ALL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_IO_READ:
- Status=DO_RACFG_CMD_IO_READ(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_IO_WRITE:
- Status=DO_RACFG_CMD_IO_WRITE(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_IO_READ_BULK:
- Status=DO_RACFG_CMD_IO_READ_BULK(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_BBP_READ8:
- Status=DO_RACFG_CMD_BBP_READ8(pAdapter,wrq,pRaCfg);
- break;
- case RACFG_CMD_BBP_WRITE8:
- Status=DO_RACFG_CMD_BBP_WRITE8(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_BBP_READ_ALL:
- Status=DO_RACFG_CMD_BBP_READ_ALL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_E2PROM_READ_BULK:
- Status=DO_RACFG_CMD_ATE_E2PROM_READ_BULK(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_E2PROM_WRITE_BULK:
- Status=DO_RACFG_CMD_ATE_E2PROM_WRITE_BULK(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_IO_WRITE_BULK:
- Status=DO_RACFG_CMD_ATE_IO_WRITE_BULK(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_BBP_READ_BULK:
- Status=DO_RACFG_CMD_ATE_BBP_READ_BULK(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_BBP_WRITE_BULK:
- Status=DO_RACFG_CMD_ATE_BBP_WRITE_BULK(pAdapter,wrq,pRaCfg);
- break;
-
-
- case RACFG_CMD_GET_NOISE_LEVEL:
- Status=DO_RACFG_CMD_GET_NOISE_LEVEL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_GET_COUNTER:
- Status=DO_RACFG_CMD_GET_COUNTER(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_CLEAR_COUNTER:
- Status=DO_RACFG_CMD_CLEAR_COUNTER(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_TX_START:
- Status=DO_RACFG_CMD_TX_START(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_GET_TX_STATUS:
- Status=DO_RACFG_CMD_GET_TX_STATUS(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_TX_STOP:
- Status=DO_RACFG_CMD_TX_STOP(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_RX_START:
- Status=DO_RACFG_CMD_RX_START(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_RX_STOP:
- Status=DO_RACFG_CMD_RX_STOP(pAdapter,wrq,pRaCfg);
- break;
-
- /* The following cases are for new ATE GUI(not QA). */
- /*==================================================*/
- case RACFG_CMD_ATE_START_TX_CARRIER:
- Status=DO_RACFG_CMD_ATE_START_TX_CARRIER(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_START_TX_CONT:
- Status=DO_RACFG_CMD_ATE_START_TX_CONT(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_START_TX_FRAME:
- Status=DO_RACFG_CMD_ATE_START_TX_FRAME(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_BW:
- Status=DO_RACFG_CMD_ATE_SET_BW(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_TX_POWER0:
- Status=DO_RACFG_CMD_ATE_SET_TX_POWER0(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_TX_POWER1:
- Status=DO_RACFG_CMD_ATE_SET_TX_POWER1(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_FREQ_OFFSET:
- Status=DO_RACFG_CMD_ATE_SET_TX_POWER1(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_GET_STATISTICS:
- Status=DO_RACFG_CMD_ATE_GET_STATISTICS(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_RESET_COUNTER:
- Status=DO_RACFG_CMD_ATE_RESET_COUNTER(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SEL_TX_ANTENNA:
- Status=DO_RACFG_CMD_ATE_SEL_TX_ANTENNA(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SEL_RX_ANTENNA:
- Status=DO_RACFG_CMD_ATE_SEL_TX_ANTENNA(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_PREAMBLE:
- Status=DO_RACFG_CMD_ATE_SET_PREAMBLE(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_CHANNEL:
- Status=DO_RACFG_CMD_ATE_SET_CHANNEL(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_ADDR1:
- Status=DO_RACFG_CMD_ATE_SET_ADDR1(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_ADDR2:
- Status=DO_RACFG_CMD_ATE_SET_ADDR2(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_ADDR3:
- Status=DO_RACFG_CMD_ATE_SET_ADDR3(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_RATE:
- Status=DO_RACFG_CMD_ATE_SET_RATE(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_TX_FRAME_LEN:
- Status=DO_RACFG_CMD_ATE_SET_TX_FRAME_LEN(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_SET_TX_FRAME_COUNT:
- Status=DO_RACFG_CMD_ATE_SET_TX_FRAME_COUNT(pAdapter,wrq,pRaCfg);
- break;
-
- case RACFG_CMD_ATE_START_RX_FRAME:
- Status=DO_RACFG_CMD_ATE_START_RX_FRAME(pAdapter,wrq,pRaCfg);
- break;
- default:
- break;
- }
-
- ASSERT(pRaCfg != NULL);
-
- if (pRaCfg != NULL)
- kfree(pRaCfg);
-
- return;
-}
-
-
-VOID BubbleSort(INT32 n, INT32 a[])
-{
- INT32 k, j, temp;
-
- for (k = n-1; k>0; k--)
- {
- for (j = 0; j<k; j++)
- {
- if (a[j] > a[j+1])
- {
- temp = a[j];
- a[j]=a[j+1];
- a[j+1]=temp;
- }
- }
- }
-}
-
-
-VOID CalNoiseLevel(PRTMP_ADAPTER pAd, UCHAR channel, INT32 RSSI[3][10])
-{
- INT32 RSSI0, RSSI1, RSSI2;
- CHAR Rssi0Offset, Rssi1Offset, Rssi2Offset;
- UCHAR BbpR50Rssi0 = 0, BbpR51Rssi1 = 0, BbpR52Rssi2 = 0;
- UCHAR Org_BBP66value = 0, Org_BBP69value = 0, Org_BBP70value = 0, data = 0;
- USHORT LNA_Gain = 0;
- INT32 j = 0;
- UCHAR Org_Channel = pAd->ate.Channel;
- USHORT GainValue = 0, OffsetValue = 0;
-
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &Org_BBP66value);
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R69, &Org_BBP69value);
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R70, &Org_BBP70value);
-
- //**********************************************************************
- // Read the value of LNA gain and Rssi offset
- //**********************************************************************
- RT28xx_EEPROM_READ16(pAd, EEPROM_LNA_OFFSET, GainValue);
-
- // for Noise Level
- if (channel <= 14)
- {
- LNA_Gain = GainValue & 0x00FF;
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_RSSI_BG_OFFSET, OffsetValue);
- Rssi0Offset = OffsetValue & 0x00FF;
- Rssi1Offset = (OffsetValue & 0xFF00) >> 8;
- RT28xx_EEPROM_READ16(pAd, (EEPROM_RSSI_BG_OFFSET + 2)/* 0x48 */, OffsetValue);
- Rssi2Offset = OffsetValue & 0x00FF;
- }
- else
- {
- LNA_Gain = (GainValue & 0xFF00) >> 8;
-
- RT28xx_EEPROM_READ16(pAd, EEPROM_RSSI_A_OFFSET, OffsetValue);
- Rssi0Offset = OffsetValue & 0x00FF;
- Rssi1Offset = (OffsetValue & 0xFF00) >> 8;
- RT28xx_EEPROM_READ16(pAd, (EEPROM_RSSI_A_OFFSET + 2)/* 0x4C */, OffsetValue);
- Rssi2Offset = OffsetValue & 0x00FF;
- }
- //**********************************************************************
- {
- pAd->ate.Channel = channel;
- ATEAsicSwitchChannel(pAd);
- mdelay(5);
-
- data = 0x10;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, data);
- data = 0x40;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, data);
- data = 0x40;
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, data);
- mdelay(5);
-
- // start Rx
- pAd->ate.bQARxStart = TRUE;
- Set_ATE_Proc(pAd, "RXFRAME");
-
- mdelay(5);
-
- for (j = 0; j < 10; j++)
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R50, &BbpR50Rssi0);
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R51, &BbpR51Rssi1);
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R52, &BbpR52Rssi2);
-
- mdelay(10);
-
- // calculate RSSI 0
- if (BbpR50Rssi0 == 0)
- {
- RSSI0 = -100;
- }
- else
- {
- RSSI0 = (INT32)(-12 - BbpR50Rssi0 - LNA_Gain - Rssi0Offset);
- }
- RSSI[0][j] = RSSI0;
-
- if ( pAd->Antenna.field.RxPath >= 2 ) // 2R
- {
- // calculate RSSI 1
- if (BbpR51Rssi1 == 0)
- {
- RSSI1 = -100;
- }
- else
- {
- RSSI1 = (INT32)(-12 - BbpR51Rssi1 - LNA_Gain - Rssi1Offset);
- }
- RSSI[1][j] = RSSI1;
- }
-
- if ( pAd->Antenna.field.RxPath >= 3 ) // 3R
- {
- // calculate RSSI 2
- if (BbpR52Rssi2 == 0)
- RSSI2 = -100;
- else
- RSSI2 = (INT32)(-12 - BbpR52Rssi2 - LNA_Gain - Rssi2Offset);
-
- RSSI[2][j] = RSSI2;
- }
- }
-
- // stop Rx
- Set_ATE_Proc(pAd, "RXSTOP");
-
- mdelay(5);
-
- BubbleSort(10, RSSI[0]); // 1R
-
- if ( pAd->Antenna.field.RxPath >= 2 ) // 2R
- {
- BubbleSort(10, RSSI[1]);
- }
-
- if ( pAd->Antenna.field.RxPath >= 3 ) // 3R
- {
- BubbleSort(10, RSSI[2]);
- }
- }
-
- pAd->ate.Channel = Org_Channel;
- ATEAsicSwitchChannel(pAd);
-
- // restore original value
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R66, Org_BBP66value);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, Org_BBP69value);
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, Org_BBP70value);
-
- return;
-}
-
-
-BOOLEAN SyncTxRxConfig(PRTMP_ADAPTER pAd, USHORT offset, UCHAR value)
-{
- UCHAR tmp = 0, bbp_data = 0;
-
- if (ATE_ON(pAd))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, offset, &bbp_data);
- }
- else
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, offset, &bbp_data);
- }
-
- /* confirm again */
- ASSERT(bbp_data == value);
-
- switch (offset)
- {
- case BBP_R1:
- /* Need to synchronize tx configuration with legacy ATE. */
- tmp = (bbp_data & ((1 << 4) | (1 << 3))/* 0x18 */) >> 3;
- switch (tmp)
- {
- /* The BBP R1 bit[4:3] = 2 :: Both DACs will be used by QA. */
- case 2:
- /* All */
- pAd->ate.TxAntennaSel = 0;
- break;
- /* The BBP R1 bit[4:3] = 0 :: DAC 0 will be used by QA. */
- case 0:
- /* Antenna one */
- pAd->ate.TxAntennaSel = 1;
- break;
- /* The BBP R1 bit[4:3] = 1 :: DAC 1 will be used by QA. */
- case 1:
- /* Antenna two */
- pAd->ate.TxAntennaSel = 2;
- break;
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("%s -- Sth. wrong! : return FALSE; \n", __FUNCTION__));
- return FALSE;
- }
- break;/* case BBP_R1 */
-
- case BBP_R3:
- /* Need to synchronize rx configuration with legacy ATE. */
- tmp = (bbp_data & ((1 << 1) | (1 << 0))/* 0x03 */);
- switch(tmp)
- {
- /* The BBP R3 bit[1:0] = 3 :: All ADCs will be used by QA. */
- case 3:
- /* All */
- pAd->ate.RxAntennaSel = 0;
- break;
- /*
- The BBP R3 bit[1:0] = 0 :: ADC 0 will be used by QA,
- unless the BBP R3 bit[4:3] = 2
- */
- case 0:
- /* Antenna one */
- pAd->ate.RxAntennaSel = 1;
- tmp = ((bbp_data & ((1 << 4) | (1 << 3))/* 0x03 */) >> 3);
- if (tmp == 2)// 3R
- {
- /* Default : All ADCs will be used by QA */
- pAd->ate.RxAntennaSel = 0;
- }
- break;
- /* The BBP R3 bit[1:0] = 1 :: ADC 1 will be used by QA. */
- case 1:
- /* Antenna two */
- pAd->ate.RxAntennaSel = 2;
- break;
- /* The BBP R3 bit[1:0] = 2 :: ADC 2 will be used by QA. */
- case 2:
- /* Antenna three */
- pAd->ate.RxAntennaSel = 3;
- break;
- default:
- DBGPRINT(RT_DEBUG_ERROR, ("%s -- Impossible! : return FALSE; \n", __FUNCTION__));
- return FALSE;
- }
- break;/* case BBP_R3 */
-
- default:
- DBGPRINT(RT_DEBUG_ERROR, ("%s -- Sth. wrong! : return FALSE; \n", __FUNCTION__));
- return FALSE;
-
- }
- return TRUE;
-}
-
-
-static VOID memcpy_exl(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, ULONG len)
-{
- ULONG i, Value = 0;
- ULONG *pDst, *pSrc;
- UCHAR *p8;
-
- p8 = src;
- pDst = (ULONG *) dst;
- pSrc = (ULONG *) src;
-
- for (i = 0 ; i < (len/4); i++)
- {
- /* For alignment issue, we need a variable "Value". */
- memmove(&Value, pSrc, 4);
- Value = htonl(Value);
- memmove(pDst, &Value, 4);
- pDst++;
- pSrc++;
- }
- if ((len % 4) != 0)
- {
- /* wish that it will never reach here */
- memmove(&Value, pSrc, (len % 4));
- Value = htonl(Value);
- memmove(pDst, &Value, (len % 4));
- }
-}
-
-
-static VOID memcpy_exs(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, ULONG len)
-{
- ULONG i;
- UCHAR *pDst, *pSrc;
-
- pDst = dst;
- pSrc = src;
-
- for (i = 0; i < (len/2); i++)
- {
- memmove(pDst, pSrc, 2);
- *((USHORT *)pDst) = htons(*((USHORT *)pDst));
- pDst+=2;
- pSrc+=2;
- }
-
- if ((len % 2) != 0)
- {
- memmove(pDst, pSrc, 1);
- }
-}
-
-
-static VOID RTMP_IO_READ_BULK(PRTMP_ADAPTER pAd, UCHAR *dst, UCHAR *src, UINT32 len)
-{
- UINT32 i, Value;
- UINT32 *pDst, *pSrc;
-
- pDst = (UINT32 *) dst;
- pSrc = (UINT32 *) src;
-
- for (i = 0 ; i < (len/4); i++)
- {
- RTMP_IO_READ32(pAd, (ULONG)pSrc, &Value);
- Value = htonl(Value);
- memmove(pDst, &Value, 4);
- pDst++;
- pSrc++;
- }
- return;
-}
-
-
-INT Set_TxStop_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("Set_TxStop_Proc\n"));
-
- if (Set_ATE_Proc(pAd, "TXSTOP"))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-
-INT Set_RxStop_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("Set_RxStop_Proc\n"));
-
- if (Set_ATE_Proc(pAd, "RXSTOP"))
- {
- return TRUE;
- }
- else
- {
- return FALSE;
- }
-}
-
-
-#ifdef DBG
-INT Set_EERead_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- USHORT buffer[EEPROM_SIZE/2];
- USHORT *p;
- INT i;
-
- rt_ee_read_all(pAd, (USHORT *)buffer);
- p = buffer;
-
- for (i = 0; i < (EEPROM_SIZE/2); i++)
- {
- ate_print(KERN_EMERG "%4.4x ", *p);
- if (((i+1) % 16) == 0)
- ate_print(KERN_EMERG "\n");
- p++;
- }
-
- return TRUE;
-}
-
-
-INT Set_EEWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- USHORT offset = 0, value;
- PSTRING p2 = arg;
-
- while ((*p2 != ':') && (*p2 != '\0'))
- {
- p2++;
- }
-
- if (*p2 == ':')
- {
- A2Hex(offset, arg);
- A2Hex(value, p2 + 1);
- }
- else
- {
- A2Hex(value, arg);
- }
-
- if (offset >= EEPROM_SIZE)
- {
- ate_print(KERN_EMERG "Offset can not exceed EEPROM_SIZE( == 0x%04x)\n", EEPROM_SIZE);
- return FALSE;
- }
-
- RT28xx_EEPROM_WRITE16(pAd, offset, value);
-
- return TRUE;
-}
-
-
-INT Set_BBPRead_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR value = 0, offset;
-
- A2Hex(offset, arg);
-
- if (ATE_ON(pAd))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAd, offset, &value);
- }
- else
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, offset, &value);
- }
-
- ate_print(KERN_EMERG "%x\n", value);
-
- return TRUE;
-}
-
-
-INT Set_BBPWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- USHORT offset = 0;
- PSTRING p2 = arg;
- UCHAR value;
-
- while ((*p2 != ':') && (*p2 != '\0'))
- {
- p2++;
- }
-
- if (*p2 == ':')
- {
- A2Hex(offset, arg);
- A2Hex(value, p2 + 1);
- }
- else
- {
- A2Hex(value, arg);
- }
-
- if (ATE_ON(pAd))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAd, offset, value);
- }
- else
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, offset, value);
- }
-
- return TRUE;
-}
-
-
-INT Set_RFWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- PSTRING p2, p3, p4;
- UINT32 R1, R2, R3, R4;
-
- p2 = arg;
-
- while ((*p2 != ':') && (*p2 != '\0'))
- {
- p2++;
- }
-
- if (*p2 != ':')
- return FALSE;
-
- p3 = p2 + 1;
-
- while((*p3 != ':') && (*p3 != '\0'))
- {
- p3++;
- }
-
- if (*p3 != ':')
- return FALSE;
-
- p4 = p3 + 1;
-
- while ((*p4 != ':') && (*p4 != '\0'))
- {
- p4++;
- }
-
- if (*p4 != ':')
- return FALSE;
-
-
- A2Hex(R1, arg);
- A2Hex(R2, p2 + 1);
- A2Hex(R3, p3 + 1);
- A2Hex(R4, p4 + 1);
-
- RTMP_RF_IO_WRITE32(pAd, R1);
- RTMP_RF_IO_WRITE32(pAd, R2);
- RTMP_RF_IO_WRITE32(pAd, R3);
- RTMP_RF_IO_WRITE32(pAd, R4);
-
- return TRUE;
-}
-#endif // DBG //
-#endif // RALINK_28xx_QA //
-
-
-
-
-#ifdef RALINK_28xx_QA
-#define LEN_OF_ARG 16
-
-#define RESPONSE_TO_GUI(__pRaCfg, __pwrq, __Length, __Status) \
- (__pRaCfg)->length = htons((__Length)); \
- (__pRaCfg)->status = htons((__Status)); \
- (__pwrq)->u.data.length = sizeof((__pRaCfg)->magic_no) + sizeof((__pRaCfg)->command_type) \
- + sizeof((__pRaCfg)->command_id) + sizeof((__pRaCfg)->length) \
- + sizeof((__pRaCfg)->sequence) + ntohs((__pRaCfg)->length); \
- ATEDBGPRINT(RT_DEBUG_TRACE, ("wrq->u.data.length = %d\n", (__pwrq)->u.data.length)); \
- if (copy_to_user((__pwrq)->u.data.pointer, (UCHAR *)(__pRaCfg), (__pwrq)->u.data.length)) \
- { \
- ATEDBGPRINT(RT_DEBUG_ERROR, ("copy_to_user() fail in %s\n", __FUNCTION__)); \
- return (-EFAULT); \
- } \
- else \
- { \
- ATEDBGPRINT(RT_DEBUG_TRACE, ("%s is done !\n", __FUNCTION__)); \
- }
-
-static inline INT DO_RACFG_CMD_ATE_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_START\n"));
-
- /* Prepare feedback as soon as we can to avoid QA timeout. */
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
- Set_ATE_Proc(pAdapter, "ATESTART");
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- INT32 ret;
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_STOP\n"));
-
- /*
- Distinguish this command came from QA(via ate agent)
- or ate agent according to the existence of pid in payload.
-
- No need to prepare feedback if this cmd came directly from ate agent,
- not from QA.
- */
- pRaCfg->length = ntohs(pRaCfg->length);
-
- if (pRaCfg->length == sizeof(pAdapter->ate.AtePid))
- {
- /*
- This command came from QA.
- Get the pid of ATE agent.
- */
- memcpy((UCHAR *)&pAdapter->ate.AtePid,
- (&pRaCfg->data[0]) - 2/* == sizeof(pRaCfg->status) */,
- sizeof(pAdapter->ate.AtePid));
-
- /* Prepare feedback as soon as we can to avoid QA timeout. */
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- /*
- Kill ATE agent when leaving ATE mode.
-
- We must kill ATE agent first before setting ATESTOP,
- or Microsoft will report sth. wrong.
- */
- ret = KILL_THREAD_PID(pAdapter->ate.AtePid, SIGTERM, 1);
-
- if (ret)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR, ("%s: unable to kill ate thread\n", pAdapter->net_dev->name));
- }
- }
-
-
- /* AP/STA might have in ATE_STOP mode due to cmd from QA. */
- if (ATE_ON(pAdapter))
- {
- /* Someone has killed ate agent while QA GUI is still open. */
- Set_ATE_Proc(pAdapter, "ATESTOP");
- ATEDBGPRINT(RT_DEBUG_TRACE, ("RACFG_CMD_AP_START is done !\n"));
- }
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_RF_WRITE_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 R1, R2, R3, R4;
- USHORT channel;
-
- memcpy(&R1, pRaCfg->data-2, 4);
- memcpy(&R2, pRaCfg->data+2, 4);
- memcpy(&R3, pRaCfg->data+6, 4);
- memcpy(&R4, pRaCfg->data+10, 4);
- memcpy(&channel, pRaCfg->data+14, 2);
-
- pAdapter->LatchRfRegs.R1 = ntohl(R1);
- pAdapter->LatchRfRegs.R2 = ntohl(R2);
- pAdapter->LatchRfRegs.R3 = ntohl(R3);
- pAdapter->LatchRfRegs.R4 = ntohl(R4);
- pAdapter->LatchRfRegs.Channel = ntohs(channel);
-
- RTMP_RF_IO_WRITE32(pAdapter, pAdapter->LatchRfRegs.R1);
- RTMP_RF_IO_WRITE32(pAdapter, pAdapter->LatchRfRegs.R2);
- RTMP_RF_IO_WRITE32(pAdapter, pAdapter->LatchRfRegs.R3);
- RTMP_RF_IO_WRITE32(pAdapter, pAdapter->LatchRfRegs.R4);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_E2PROM_READ16(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT16 offset=0, value=0;
- USHORT tmp=0;
-
- offset = ntohs(pRaCfg->status);
-
- /* "tmp" is especially for some compilers... */
- RT28xx_EEPROM_READ16(pAdapter, offset, tmp);
- value = tmp;
- value = htons(value);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("EEPROM Read offset = 0x%04x, value = 0x%04x\n", offset, value));
- memcpy(pRaCfg->data, &value, 2);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+2, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_E2PROM_WRITE16(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset, value;
-
- offset = ntohs(pRaCfg->status);
- memcpy(&value, pRaCfg->data, 2);
- value = ntohs(value);
- RT28xx_EEPROM_WRITE16(pAdapter, offset, value);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_E2PROM_READ_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT buffer[EEPROM_SIZE/2];
-
- rt_ee_read_all(pAdapter,(USHORT *)buffer);
- memcpy_exs(pAdapter, pRaCfg->data, (UCHAR *)buffer, EEPROM_SIZE);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+EEPROM_SIZE, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_E2PROM_WRITE_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT buffer[EEPROM_SIZE/2];
-
- NdisZeroMemory((UCHAR *)buffer, EEPROM_SIZE);
- memcpy_exs(pAdapter, (UCHAR *)buffer, (UCHAR *)&pRaCfg->status, EEPROM_SIZE);
- rt_ee_write_all(pAdapter,(USHORT *)buffer);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_IO_READ(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 offset;
- UINT32 value;
-
- memcpy(&offset, &pRaCfg->status, 4);
- offset = ntohl(offset);
-
- /*
- We do not need the base address.
- So just extract the offset out.
- */
- offset &= 0x0000FFFF;
- RTMP_IO_READ32(pAdapter, offset, &value);
- value = htonl(value);
- memcpy(pRaCfg->data, &value, 4);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+4, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_IO_WRITE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 offset, value;
-
- memcpy(&offset, pRaCfg->data-2, 4);
- memcpy(&value, pRaCfg->data+2, 4);
-
- offset = ntohl(offset);
-
- /*
- We do not need the base address.
- So just extract the offset out.
- */
- offset &= 0x0000FFFF;
- value = ntohl(value);
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_IO_WRITE: offset = %x, value = %x\n", offset, value));
- RTMP_IO_WRITE32(pAdapter, offset, value);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_IO_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 offset;
- USHORT len;
-
- memcpy(&offset, &pRaCfg->status, 4);
- offset = ntohl(offset);
-
- /*
- We do not need the base address.
- So just extract the offset out.
- */
- offset &= 0x0000FFFF;
- memcpy(&len, pRaCfg->data+2, 2);
- len = ntohs(len);
-
- if (len > 371)
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("length requested is too large, make it smaller\n"));
- pRaCfg->length = htons(2);
- pRaCfg->status = htons(1);
- return -EFAULT;
- }
-
- RTMP_IO_READ_BULK(pAdapter, pRaCfg->data, (UCHAR *)offset, len*4);// unit in four bytes
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+(len*4), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_BBP_READ8(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- UCHAR value;
-
- value = 0;
- offset = ntohs(pRaCfg->status);
-
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, offset, &value);
- }
- else
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, offset, &value);
- }
-
- pRaCfg->data[0] = value;
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+1, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_BBP_WRITE8(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- UCHAR value;
-
- offset = ntohs(pRaCfg->status);
- memcpy(&value, pRaCfg->data, 1);
-
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAdapter, offset, value);
- }
- else
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, offset, value);
- }
-
- if ((offset == BBP_R1) || (offset == BBP_R3))
- {
- SyncTxRxConfig(pAdapter, offset, value);
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_BBP_READ_ALL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT bbp_reg_index;
-
- for (bbp_reg_index = 0; bbp_reg_index < MAX_BBP_ID+1; bbp_reg_index++)
- {
- pRaCfg->data[bbp_reg_index] = 0;
-
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, bbp_reg_index, &pRaCfg->data[bbp_reg_index]);
- }
- else
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, bbp_reg_index, &pRaCfg->data[bbp_reg_index]);
- }
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+MAX_BBP_ID+1, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_GET_NOISE_LEVEL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UCHAR channel;
- INT32 buffer[3][10];/* 3 : RxPath ; 10 : no. of per rssi samples */
-
- channel = (ntohs(pRaCfg->status) & 0x00FF);
- CalNoiseLevel(pAdapter, channel, buffer);
- memcpy_exl(pAdapter, (UCHAR *)pRaCfg->data, (UCHAR *)&(buffer[0][0]), (sizeof(INT32)*3*10));
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+(sizeof(INT32)*3*10), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_GET_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- memcpy_exl(pAdapter, &pRaCfg->data[0], (UCHAR *)&pAdapter->ate.U2M, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[4], (UCHAR *)&pAdapter->ate.OtherData, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[8], (UCHAR *)&pAdapter->ate.Beacon, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[12], (UCHAR *)&pAdapter->ate.OtherCount, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[16], (UCHAR *)&pAdapter->ate.TxAc0, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[20], (UCHAR *)&pAdapter->ate.TxAc1, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[24], (UCHAR *)&pAdapter->ate.TxAc2, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[28], (UCHAR *)&pAdapter->ate.TxAc3, 4);
- /*memcpy_exl(pAdapter, &pRaCfg->data[32], (UCHAR *)&pAdapter->ate.TxHCCA, 4);*/
- memcpy_exl(pAdapter, &pRaCfg->data[36], (UCHAR *)&pAdapter->ate.TxMgmt, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[40], (UCHAR *)&pAdapter->ate.RSSI0, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[44], (UCHAR *)&pAdapter->ate.RSSI1, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[48], (UCHAR *)&pAdapter->ate.RSSI2, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[52], (UCHAR *)&pAdapter->ate.SNR0, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[56], (UCHAR *)&pAdapter->ate.SNR1, 4);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+60, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_CLEAR_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- pAdapter->ate.U2M = 0;
- pAdapter->ate.OtherData = 0;
- pAdapter->ate.Beacon = 0;
- pAdapter->ate.OtherCount = 0;
- pAdapter->ate.TxAc0 = 0;
- pAdapter->ate.TxAc1 = 0;
- pAdapter->ate.TxAc2 = 0;
- pAdapter->ate.TxAc3 = 0;
- /*pAdapter->ate.TxHCCA = 0;*/
- pAdapter->ate.TxMgmt = 0;
- pAdapter->ate.TxDoneCount = 0;
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_TX_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT *p;
- USHORT err = 1;
- UCHAR Bbp22Value = 0, Bbp24Value = 0;
-
- if ((pAdapter->ate.TxStatus != 0) && (pAdapter->ate.Mode & ATE_TXFRAME))
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("Ate Tx is already running, to run next Tx, you must stop it first\n"));
- err = 2;
- goto TX_START_ERROR;
- }
- else if ((pAdapter->ate.TxStatus != 0) && !(pAdapter->ate.Mode & ATE_TXFRAME))
- {
- int i = 0;
-
- while ((i++ < 10) && (pAdapter->ate.TxStatus != 0))
- {
- RTMPusecDelay(5000);
- }
-
- /* force it to stop */
- pAdapter->ate.TxStatus = 0;
- pAdapter->ate.TxDoneCount = 0;
- pAdapter->ate.bQATxStart = FALSE;
- }
-
- /*
- If pRaCfg->length == 0, this "RACFG_CMD_TX_START"
- is for Carrier test or Carrier Suppression.
- */
- if (ntohs(pRaCfg->length) != 0)
- {
- /* get frame info */
-
- NdisMoveMemory(&pAdapter->ate.TxWI, pRaCfg->data + 2, 16);
-#ifdef RT_BIG_ENDIAN
- RTMPWIEndianChange((PUCHAR)&pAdapter->ate.TxWI, TYPE_TXWI);
-#endif // RT_BIG_ENDIAN //
-
- NdisMoveMemory(&pAdapter->ate.TxCount, pRaCfg->data + 18, 4);
- pAdapter->ate.TxCount = ntohl(pAdapter->ate.TxCount);
-
- p = (USHORT *)(&pRaCfg->data[22]);
-
- /* always use QID_AC_BE */
- pAdapter->ate.QID = 0;
-
- p = (USHORT *)(&pRaCfg->data[24]);
- pAdapter->ate.HLen = ntohs(*p);
-
- if (pAdapter->ate.HLen > 32)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR,("pAdapter->ate.HLen > 32\n"));
- err = 3;
- goto TX_START_ERROR;
- }
-
- NdisMoveMemory(&pAdapter->ate.Header, pRaCfg->data + 26, pAdapter->ate.HLen);
-
- pAdapter->ate.PLen = ntohs(pRaCfg->length) - (pAdapter->ate.HLen + 28);
-
- if (pAdapter->ate.PLen > 32)
- {
- ATEDBGPRINT(RT_DEBUG_ERROR,("pAdapter->ate.PLen > 32\n"));
- err = 4;
- goto TX_START_ERROR;
- }
-
- NdisMoveMemory(&pAdapter->ate.Pattern, pRaCfg->data + 26 + pAdapter->ate.HLen, pAdapter->ate.PLen);
- pAdapter->ate.DLen = pAdapter->ate.TxWI.MPDUtotalByteCount - pAdapter->ate.HLen;
- }
-
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R22, &Bbp22Value);
-
- switch (Bbp22Value)
- {
- case BBP22_TXFRAME:
- {
- if (pAdapter->ate.TxCount == 0)
- {
-#ifdef RTMP_MAC_PCI
- pAdapter->ate.TxCount = 0xFFFFFFFF;
-#endif // RTMP_MAC_PCI //
- }
- ATEDBGPRINT(RT_DEBUG_TRACE,("START TXFRAME\n"));
- pAdapter->ate.bQATxStart = TRUE;
- Set_ATE_Proc(pAdapter, "TXFRAME");
- }
- break;
-
- case BBP22_TXCONT_OR_CARRSUPP:
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("BBP22_TXCONT_OR_CARRSUPP\n"));
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R24, &Bbp24Value);
-
- switch (Bbp24Value)
- {
- case BBP24_TXCONT:
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("START TXCONT\n"));
- pAdapter->ate.bQATxStart = TRUE;
- Set_ATE_Proc(pAdapter, "TXCONT");
- }
- break;
-
- case BBP24_CARRSUPP:
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("START TXCARRSUPP\n"));
- pAdapter->ate.bQATxStart = TRUE;
- pAdapter->ate.Mode |= ATE_TXCARRSUPP;
- }
- break;
-
- default:
- {
- ATEDBGPRINT(RT_DEBUG_ERROR,("Unknown TX subtype !"));
- }
- break;
- }
- }
- break;
-
- case BBP22_TXCARR:
- {
- ATEDBGPRINT(RT_DEBUG_TRACE,("START TXCARR\n"));
- pAdapter->ate.bQATxStart = TRUE;
- Set_ATE_Proc(pAdapter, "TXCARR");
- }
- break;
-
- default:
- {
- ATEDBGPRINT(RT_DEBUG_ERROR,("Unknown Start TX subtype !"));
- }
- break;
- }
-
- if (pAdapter->ate.bQATxStart == TRUE)
- {
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
- return NDIS_STATUS_SUCCESS;
- }
-
-TX_START_ERROR:
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), err);
-
- return err;
-}
-
-
-static inline INT DO_RACFG_CMD_GET_TX_STATUS(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 count=0;
-
- count = htonl(pAdapter->ate.TxDoneCount);
- NdisMoveMemory(pRaCfg->data, &count, 4);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+4, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_TX_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_TX_STOP\n"));
-
- Set_ATE_Proc(pAdapter, "TXSTOP");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_RX_START(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_RX_START\n"));
-
- pAdapter->ate.bQARxStart = TRUE;
- Set_ATE_Proc(pAdapter, "RXFRAME");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_RX_STOP(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_RX_STOP\n"));
-
- Set_ATE_Proc(pAdapter, "RXSTOP");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_CARRIER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_START_TX_CARRIER\n"));
-
- Set_ATE_Proc(pAdapter, "TXCARR");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_CONT(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_START_TX_CONT\n"));
-
- Set_ATE_Proc(pAdapter, "TXCONT");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_START_TX_FRAME(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_START_TX_FRAME\n"));
-
- Set_ATE_Proc(pAdapter, "TXFRAME");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_BW(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_BW\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
-
- Set_ATE_TX_BW_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_POWER0(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_TX_POWER0\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_POWER0_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_POWER1(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_TX_POWER1\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_POWER1_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_FREQ_OFFSET(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_FREQ_OFFSET\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_FREQOFFSET_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_GET_STATISTICS(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_GET_STATISTICS\n"));
-
- memcpy_exl(pAdapter, &pRaCfg->data[0], (UCHAR *)&pAdapter->ate.TxDoneCount, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[4], (UCHAR *)&pAdapter->WlanCounters.RetryCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[8], (UCHAR *)&pAdapter->WlanCounters.FailedCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[12], (UCHAR *)&pAdapter->WlanCounters.RTSSuccessCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[16], (UCHAR *)&pAdapter->WlanCounters.RTSFailureCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[20], (UCHAR *)&pAdapter->WlanCounters.ReceivedFragmentCount.QuadPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[24], (UCHAR *)&pAdapter->WlanCounters.FCSErrorCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[28], (UCHAR *)&pAdapter->Counters8023.RxNoBuffer, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[32], (UCHAR *)&pAdapter->WlanCounters.FrameDuplicateCount.u.LowPart, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[36], (UCHAR *)&pAdapter->RalinkCounters.OneSecFalseCCACnt, 4);
-
- if (pAdapter->ate.RxAntennaSel == 0)
- {
- INT32 RSSI0 = 0;
- INT32 RSSI1 = 0;
- INT32 RSSI2 = 0;
-
- RSSI0 = (INT32)(pAdapter->ate.LastRssi0 - pAdapter->BbpRssiToDbmDelta);
- RSSI1 = (INT32)(pAdapter->ate.LastRssi1 - pAdapter->BbpRssiToDbmDelta);
- RSSI2 = (INT32)(pAdapter->ate.LastRssi2 - pAdapter->BbpRssiToDbmDelta);
- memcpy_exl(pAdapter, &pRaCfg->data[40], (UCHAR *)&RSSI0, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[44], (UCHAR *)&RSSI1, 4);
- memcpy_exl(pAdapter, &pRaCfg->data[48], (UCHAR *)&RSSI2, 4);
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+52, NDIS_STATUS_SUCCESS);
- }
- else
- {
- INT32 RSSI0 = 0;
-
- RSSI0 = (INT32)(pAdapter->ate.LastRssi0 - pAdapter->BbpRssiToDbmDelta);
- memcpy_exl(pAdapter, &pRaCfg->data[40], (UCHAR *)&RSSI0, 4);
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+44, NDIS_STATUS_SUCCESS);
- }
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_RESET_COUNTER(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 1;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_RESET_COUNTER\n"));
-
- sprintf((char *)str, "%d", value);
- Set_ResetStatCounter_Proc(pAdapter, str);
-
- pAdapter->ate.TxDoneCount = 0;
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SEL_TX_ANTENNA(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SEL_TX_ANTENNA\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_Antenna_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SEL_RX_ANTENNA(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SEL_RX_ANTENNA\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_RX_Antenna_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_PREAMBLE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_PREAMBLE\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_MODE_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_CHANNEL(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_CHANNEL\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_CHANNEL_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR1(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_ADDR1\n"));
-
- /*
- Addr is an array of UCHAR,
- so no need to perform endian swap.
- */
- memcpy(pAdapter->ate.Addr1, (PUCHAR)(pRaCfg->data - 2), MAC_ADDR_LEN);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR2(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_ADDR2\n"));
-
- /*
- Addr is an array of UCHAR,
- so no need to perform endian swap.
- */
- memcpy(pAdapter->ate.Addr2, (PUCHAR)(pRaCfg->data - 2), MAC_ADDR_LEN);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_ADDR3(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_ADDR3\n"));
-
- /*
- Addr is an array of UCHAR,
- so no need to perform endian swap.
- */
- memcpy(pAdapter->ate.Addr3, (PUCHAR)(pRaCfg->data - 2), MAC_ADDR_LEN);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_RATE(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_RATE\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_MCS_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_FRAME_LEN(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- SHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_TX_FRAME_LEN\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_LENGTH_Proc(pAdapter, str);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_SET_TX_FRAME_COUNT(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT value = 0;
- STRING str[LEN_OF_ARG];
-
- NdisZeroMemory(str, LEN_OF_ARG);
-
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_ATE_SET_TX_FRAME_COUNT\n"));
-
- memcpy((PUCHAR)&value, (PUCHAR)&(pRaCfg->status), 2);
- value = ntohs(value);
-
-#ifdef RTMP_MAC_PCI
- /* TX_FRAME_COUNT == 0 means tx infinitely */
- if (value == 0)
- {
- /* Use TxCount = 0xFFFFFFFF to approximate the infinity. */
- pAdapter->ate.TxCount = 0xFFFFFFFF;
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Set_ATE_TX_COUNT_Proc (TxCount = %d)\n", pAdapter->ate.TxCount));
- ATEDBGPRINT(RT_DEBUG_TRACE, ("Ralink: Set_ATE_TX_COUNT_Proc Success\n"));
-
-
- }
- else
-#endif // RTMP_MAC_PCI //
- {
- sprintf((char *)str, "%d", value);
- Set_ATE_TX_COUNT_Proc(pAdapter, str);
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_START_RX_FRAME(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- ATEDBGPRINT(RT_DEBUG_TRACE,("RACFG_CMD_RX_START\n"));
-
- Set_ATE_Proc(pAdapter, "RXFRAME");
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_E2PROM_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- USHORT len;
- USHORT buffer[EEPROM_SIZE/2];
-
- offset = ntohs(pRaCfg->status);
- memcpy(&len, pRaCfg->data, 2);
- len = ntohs(len);
-
- rt_ee_read_all(pAdapter, (USHORT *)buffer);
-
- if (offset + len <= EEPROM_SIZE)
- memcpy_exs(pAdapter, pRaCfg->data, (UCHAR *)buffer+offset, len);
- else
- ATEDBGPRINT(RT_DEBUG_ERROR, ("exceed EEPROM size\n"));
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+len, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_E2PROM_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- USHORT len;
- USHORT buffer[EEPROM_SIZE/2];
-
- offset = ntohs(pRaCfg->status);
- memcpy(&len, pRaCfg->data, 2);
- len = ntohs(len);
-
- rt_ee_read_all(pAdapter,(USHORT *)buffer);
- memcpy_exs(pAdapter, (UCHAR *)buffer + offset, (UCHAR *)pRaCfg->data + 2, len);
- rt_ee_write_all(pAdapter,(USHORT *)buffer);
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_IO_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- UINT32 offset, i, value;
- USHORT len;
-
- memcpy(&offset, &pRaCfg->status, 4);
- offset = ntohl(offset);
- memcpy(&len, pRaCfg->data+2, 2);
- len = ntohs(len);
-
- for (i = 0; i < len; i += 4)
- {
- memcpy_exl(pAdapter, (UCHAR *)&value, pRaCfg->data+4+i, 4);
- ATEDBGPRINT(RT_DEBUG_TRACE,("Write %x %x\n", offset + i, value));
- RTMP_IO_WRITE32(pAdapter, ((offset+i) & (0xffff)), value);
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_BBP_READ_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- USHORT len;
- USHORT j;
-
- offset = ntohs(pRaCfg->status);
- memcpy(&len, pRaCfg->data, 2);
- len = ntohs(len);
-
- for (j = offset; j < (offset+len); j++)
- {
- pRaCfg->data[j - offset] = 0;
-
- if (pAdapter->ate.Mode == ATE_STOP)
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, j, &pRaCfg->data[j - offset]);
- }
- else
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, j, &pRaCfg->data[j - offset]);
- }
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status)+len, NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-static inline INT DO_RACFG_CMD_ATE_BBP_WRITE_BULK(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq,
- IN struct ate_racfghdr *pRaCfg)
-{
- USHORT offset;
- USHORT len;
- USHORT j;
- UCHAR *value;
-
- offset = ntohs(pRaCfg->status);
- memcpy(&len, pRaCfg->data, 2);
- len = ntohs(len);
-
- for (j = offset; j < (offset+len); j++)
- {
- value = pRaCfg->data + 2 + (j - offset);
- if (pAdapter->ate.Mode == ATE_STOP)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, j, *value);
- }
- else
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAdapter, j, *value);
- }
- }
-
- RESPONSE_TO_GUI(pRaCfg, wrq, sizeof(pRaCfg->status), NDIS_STATUS_SUCCESS);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
diff --git a/drivers/staging/rt3090/rt_ate.h b/drivers/staging/rt3090/rt_ate.h
deleted file mode 100644
index 38d596162e74..000000000000
--- a/drivers/staging/rt3090/rt_ate.h
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#ifndef __ATE_H__
-#define __ATE_H__
-
-
-#ifdef LINUX
-#define ate_print printk
-#define ATEDBGPRINT DBGPRINT
-#ifdef RTMP_MAC_PCI
-#define EEPROM_SIZE 0x200
-#ifdef CONFIG_STA_SUPPORT
-#define EEPROM_BIN_FILE_NAME "/etc/Wireless/RT2860STA/e2p.bin"
-#endif // CONFIG_STA_SUPPORT //
-#endif // RTMP_MAC_PCI //
-#endif // LINUX //
-
-
-#define ATE_ON(_p) (((_p)->ate.Mode) != ATE_STOP)
-
-#ifdef RTMP_MAC_PCI
-#define ATE_BBP_IO_READ8_BY_REG_ID(_A, _I, _pV) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int j, k; \
- for (j=0; j<MAX_BUSY_COUNT; j++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- continue; \
- } \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 1; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
- for (k=0; k<MAX_BUSY_COUNT; k++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == IDLE) \
- break; \
- } \
- if ((BbpCsr.field.Busy == IDLE) && \
- (BbpCsr.field.RegNum == _I)) \
- { \
- *(_pV) = (UCHAR)BbpCsr.field.Value; \
- break; \
- } \
- } \
- if (BbpCsr.field.Busy == BUSY) \
- { \
- ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP read R%d fail\n", _I)); \
- *(_pV) = (_A)->BbpWriteLatch[_I]; \
- } \
-}
-
-#define ATE_BBP_IO_WRITE8_BY_REG_ID(_A, _I, _V) \
-{ \
- BBP_CSR_CFG_STRUC BbpCsr; \
- int BusyCnt; \
- for (BusyCnt=0; BusyCnt<MAX_BUSY_COUNT; BusyCnt++) \
- { \
- RTMP_IO_READ32(_A, BBP_CSR_CFG, &BbpCsr.word); \
- if (BbpCsr.field.Busy == BUSY) \
- continue; \
- BbpCsr.word = 0; \
- BbpCsr.field.fRead = 0; \
- BbpCsr.field.BBP_RW_MODE = 1; \
- BbpCsr.field.Busy = 1; \
- BbpCsr.field.Value = _V; \
- BbpCsr.field.RegNum = _I; \
- RTMP_IO_WRITE32(_A, BBP_CSR_CFG, BbpCsr.word); \
- (_A)->BbpWriteLatch[_I] = _V; \
- break; \
- } \
- if (BusyCnt == MAX_BUSY_COUNT) \
- { \
- ATEDBGPRINT(RT_DEBUG_ERROR, ("BBP write R%d fail\n", _I)); \
- } \
-}
-#endif // RTMP_MAC_PCI //
-
-
-#ifdef RT30xx
-#define ATE_RF_IO_READ8_BY_REG_ID(_A, _I, _pV) RTMP_RF_IO_READ8_BY_REG_ID(_A, _I, _pV)
-#define ATE_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V) RTMP_RF_IO_WRITE8_BY_REG_ID(_A, _I, _V)
-#endif // RT30xx //
-
-
-VOID rt_ee_read_all(
- IN PRTMP_ADAPTER pAd,
- OUT USHORT *Data);
-
-VOID rt_ee_write_all(
- IN PRTMP_ADAPTER pAd,
- IN USHORT *Data);
-
-INT Set_ATE_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_DA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_SA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_BSSID_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_CHANNEL_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_POWER0_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_POWER1_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_RX_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_FREQOFFSET_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_BW_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_LENGTH_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_COUNT_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_MCS_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_MODE_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_TX_GI_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-
-INT Set_ATE_RX_FER_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Read_RF_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Write_RF1_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Write_RF2_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Write_RF3_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Write_RF4_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Load_E2P_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Read_E2P_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-
-INT Set_ATE_Show_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ATE_Help_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef RALINK_28xx_QA
-VOID ATE_QA_Statistics(
- IN PRTMP_ADAPTER pAd,
- IN PRXWI_STRUC pRxWI,
- IN PRT28XX_RXD_STRUC p28xxRxD,
- IN PHEADER_802_11 pHeader);
-
-VOID RtmpDoAte(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-VOID BubbleSort(
- IN INT32 n,
- IN INT32 a[]);
-
-VOID CalNoiseLevel(
- IN PRTMP_ADAPTER pAdapter,
- IN UCHAR channel,
- OUT INT32 buffer[3][10]);
-
-BOOLEAN SyncTxRxConfig(
- IN PRTMP_ADAPTER pAdapter,
- IN USHORT offset,
- IN UCHAR value);
-
-INT Set_TxStop_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_RxStop_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef DBG
-INT Set_EERead_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_EEWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BBPRead_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BBPWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_RFWrite_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // DBG //
-#endif // RALINK_28xx_QA //
-
-
-VOID ATEAsicSwitchChannel(
- IN PRTMP_ADAPTER pAd);
-
-VOID ATEAsicAdjustTxPower(
- IN PRTMP_ADAPTER pAd);
-
-VOID ATEDisableAsicProtect(
- IN PRTMP_ADAPTER pAd);
-
-CHAR ATEConvertToRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi,
- IN UCHAR RssiNumber);
-
-VOID ATESampleRssi(
- IN PRTMP_ADAPTER pAd,
- IN PRXWI_STRUC pRxWI);
-
-
-#ifdef CONFIG_STA_SUPPORT
-VOID RTMPStationStop(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPStationStart(
- IN PRTMP_ADAPTER pAd);
-#endif // CONFIG_STA_SUPPORT //
-#endif // __ATE_H__ //
diff --git a/drivers/staging/rt3090/rt_config.h b/drivers/staging/rt3090/rt_config.h
deleted file mode 100644
index 005142dfa257..000000000000
--- a/drivers/staging/rt3090/rt_config.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt_config.h
-
- Abstract:
- Central header file to maintain all include files for all NDIS
- miniport driver routines.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 08-01-2002 created
-
-*/
-#ifndef __RT_CONFIG_H__
-#define __RT_CONFIG_H__
-
-#include "rtmp_type.h"
-#include "rtmp_os.h"
-
-#include "rtmp_def.h"
-#include "rtmp_chip.h"
-#include "rtmp_timer.h"
-
-#include "oid.h"
-#include "mlme.h"
-#include "wpa.h"
-#include "crypt_md5.h"
-#include "crypt_sha2.h"
-#include "crypt_hmac.h"
-#include "rtmp.h"
-#include "ap.h"
-#include "dfs.h"
-#include "chlist.h"
-#include "spectrum.h"
-
-#ifdef MLME_EX
-#include "mlme_ex_def.h"
-#include "mlme_ex.h"
-#endif // MLME_EX //
-
-#include "eeprom.h"
-#if defined(RTMP_PCI_SUPPORT) || defined(RTMP_USB_SUPPORT)
-#include "rtmp_mcu.h"
-#endif
-
-
-
-#undef AP_WSC_INCLUDED
-#undef STA_WSC_INCLUDED
-#undef WSC_INCLUDED
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef BLOCK_NET_IF
-#include "netif_block.h"
-#endif // BLOCK_NET_IF //
-
-#ifdef IGMP_SNOOP_SUPPORT
-#include "igmp_snoop.h"
-#endif // IGMP_SNOOP_SUPPORT //
-
-#ifdef RALINK_ATE
-#include "rt_ate.h"
-#endif // RALINK_ATE //
-
-#ifdef RALINK_28xx_QA
-#ifndef RALINK_ATE
-#error "For supporting QA GUI, please set HAS_ATE=y and HAS_28xx_QA=y."
-#endif // RALINK_ATE //
-#endif // RALINK_28xx_QA //
-
-
-
-
-#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
-#define WSC_INCLUDED
-#endif
-
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-#ifndef WPA_SUPPLICANT_SUPPORT
-#error "Build for being controlled by NetworkManager or wext, please set HAS_WPA_SUPPLICANT=y and HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y"
-#endif // WPA_SUPPLICANT_SUPPORT //
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-#ifdef IKANOS_VX_1X0
-#include "vr_ikans.h"
-#endif // IKANOS_VX_1X0 //
-
-
-
-#endif // __RT_CONFIG_H__
diff --git a/drivers/staging/rt3090/rt_linux.c b/drivers/staging/rt3090/rt_linux.c
deleted file mode 100644
index 9b94aa6eb904..000000000000
--- a/drivers/staging/rt3090/rt_linux.c
+++ /dev/null
@@ -1,1624 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#include <linux/sched.h>
-#include "rt_config.h"
-
-ULONG RTDebugLevel = RT_DEBUG_ERROR;
-
-
-// for wireless system event message
-char const *pWirelessSysEventText[IW_SYS_EVENT_TYPE_NUM] = {
- // system status event
- "had associated successfully", /* IW_ASSOC_EVENT_FLAG */
- "had disassociated", /* IW_DISASSOC_EVENT_FLAG */
- "had deauthenticated", /* IW_DEAUTH_EVENT_FLAG */
- "had been aged-out and disassociated", /* IW_AGEOUT_EVENT_FLAG */
- "occurred CounterMeasures attack", /* IW_COUNTER_MEASURES_EVENT_FLAG */
- "occurred replay counter different in Key Handshaking", /* IW_REPLAY_COUNTER_DIFF_EVENT_FLAG */
- "occurred RSNIE different in Key Handshaking", /* IW_RSNIE_DIFF_EVENT_FLAG */
- "occurred MIC different in Key Handshaking", /* IW_MIC_DIFF_EVENT_FLAG */
- "occurred ICV error in RX", /* IW_ICV_ERROR_EVENT_FLAG */
- "occurred MIC error in RX", /* IW_MIC_ERROR_EVENT_FLAG */
- "Group Key Handshaking timeout", /* IW_GROUP_HS_TIMEOUT_EVENT_FLAG */
- "Pairwise Key Handshaking timeout", /* IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG */
- "RSN IE sanity check failure", /* IW_RSNIE_SANITY_FAIL_EVENT_FLAG */
- "set key done in WPA/WPAPSK", /* IW_SET_KEY_DONE_WPA1_EVENT_FLAG */
- "set key done in WPA2/WPA2PSK", /* IW_SET_KEY_DONE_WPA2_EVENT_FLAG */
- "connects with our wireless client", /* IW_STA_LINKUP_EVENT_FLAG */
- "disconnects with our wireless client", /* IW_STA_LINKDOWN_EVENT_FLAG */
- "scan completed" /* IW_SCAN_COMPLETED_EVENT_FLAG */
- "scan terminate!! Busy!! Enqueue fail!!" /* IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG */
- };
-
-// for wireless IDS_spoof_attack event message
-char const *pWirelessSpoofEventText[IW_SPOOF_EVENT_TYPE_NUM] = {
- "detected conflict SSID", /* IW_CONFLICT_SSID_EVENT_FLAG */
- "detected spoofed association response", /* IW_SPOOF_ASSOC_RESP_EVENT_FLAG */
- "detected spoofed reassociation responses", /* IW_SPOOF_REASSOC_RESP_EVENT_FLAG */
- "detected spoofed probe response", /* IW_SPOOF_PROBE_RESP_EVENT_FLAG */
- "detected spoofed beacon", /* IW_SPOOF_BEACON_EVENT_FLAG */
- "detected spoofed disassociation", /* IW_SPOOF_DISASSOC_EVENT_FLAG */
- "detected spoofed authentication", /* IW_SPOOF_AUTH_EVENT_FLAG */
- "detected spoofed deauthentication", /* IW_SPOOF_DEAUTH_EVENT_FLAG */
- "detected spoofed unknown management frame", /* IW_SPOOF_UNKNOWN_MGMT_EVENT_FLAG */
- "detected replay attack" /* IW_REPLAY_ATTACK_EVENT_FLAG */
- };
-
-// for wireless IDS_flooding_attack event message
-char const *pWirelessFloodEventText[IW_FLOOD_EVENT_TYPE_NUM] = {
- "detected authentication flooding", /* IW_FLOOD_AUTH_EVENT_FLAG */
- "detected association request flooding", /* IW_FLOOD_ASSOC_REQ_EVENT_FLAG */
- "detected reassociation request flooding", /* IW_FLOOD_REASSOC_REQ_EVENT_FLAG */
- "detected probe request flooding", /* IW_FLOOD_PROBE_REQ_EVENT_FLAG */
- "detected disassociation flooding", /* IW_FLOOD_DISASSOC_EVENT_FLAG */
- "detected deauthentication flooding", /* IW_FLOOD_DEAUTH_EVENT_FLAG */
- "detected 802.1x eap-request flooding" /* IW_FLOOD_EAP_REQ_EVENT_FLAG */
- };
-
-
-/* timeout -- ms */
-VOID RTMP_SetPeriodicTimer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout)
-{
- timeout = ((timeout*OS_HZ) / 1000);
- pTimer->expires = jiffies + timeout;
- add_timer(pTimer);
-}
-
-/* convert NdisMInitializeTimer --> RTMP_OS_Init_Timer */
-VOID RTMP_OS_Init_Timer(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN TIMER_FUNCTION function,
- IN PVOID data)
-{
- init_timer(pTimer);
- pTimer->data = (unsigned long)data;
- pTimer->function = function;
-}
-
-
-VOID RTMP_OS_Add_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout)
-{
- if (timer_pending(pTimer))
- return;
-
- timeout = ((timeout*OS_HZ) / 1000);
- pTimer->expires = jiffies + timeout;
- add_timer(pTimer);
-}
-
-VOID RTMP_OS_Mod_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout)
-{
- timeout = ((timeout*OS_HZ) / 1000);
- mod_timer(pTimer, jiffies + timeout);
-}
-
-VOID RTMP_OS_Del_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- OUT BOOLEAN *pCancelled)
-{
- if (timer_pending(pTimer))
- {
- *pCancelled = del_timer_sync(pTimer);
- }
- else
- {
- *pCancelled = TRUE;
- }
-
-}
-
-VOID RTMP_OS_Release_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PQUEUE_ENTRY pEntry)
-{
- //RTMPFreeNdisPacket(pAd, (struct sk_buff *)pEntry);
-}
-
-// Unify all delay routine by using udelay
-VOID RTMPusecDelay(
- IN ULONG usec)
-{
- ULONG i;
-
- for (i = 0; i < (usec / 50); i++)
- udelay(50);
-
- if (usec % 50)
- udelay(usec % 50);
-}
-
-void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time)
-{
- time->u.LowPart = jiffies;
-}
-
-// pAd MUST allow to be NULL
-NDIS_STATUS os_alloc_mem(
- IN RTMP_ADAPTER *pAd,
- OUT UCHAR **mem,
- IN ULONG size)
-{
- *mem = (PUCHAR) kmalloc(size, GFP_ATOMIC);
- if (*mem)
- return (NDIS_STATUS_SUCCESS);
- else
- return (NDIS_STATUS_FAILURE);
-}
-
-// pAd MUST allow to be NULL
-NDIS_STATUS os_free_mem(
- IN PRTMP_ADAPTER pAd,
- IN PVOID mem)
-{
-
- ASSERT(mem);
- kfree(mem);
- return (NDIS_STATUS_SUCCESS);
-}
-
-
-
-
-PNDIS_PACKET RtmpOSNetPktAlloc(
- IN RTMP_ADAPTER *pAd,
- IN int size)
-{
- struct sk_buff *skb;
- /* Add 2 more bytes for ip header alignment*/
- skb = dev_alloc_skb(size+2);
-
- return ((PNDIS_PACKET)skb);
-}
-
-
-PNDIS_PACKET RTMP_AllocateFragPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length)
-{
- struct sk_buff *pkt;
-
- pkt = dev_alloc_skb(Length);
-
- if (pkt == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("can't allocate frag rx %ld size packet\n",Length));
- }
-
- if (pkt)
- {
- RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
- }
-
- return (PNDIS_PACKET) pkt;
-}
-
-
-PNDIS_PACKET RTMP_AllocateTxPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress)
-{
- struct sk_buff *pkt;
-
- pkt = dev_alloc_skb(Length);
-
- if (pkt == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("can't allocate tx %ld size packet\n",Length));
- }
-
- if (pkt)
- {
- RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
- *VirtualAddress = (PVOID) pkt->data;
- }
- else
- {
- *VirtualAddress = (PVOID) NULL;
- }
-
- return (PNDIS_PACKET) pkt;
-}
-
-
-VOID build_tx_packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pFrame,
- IN ULONG FrameLen)
-{
-
- struct sk_buff *pTxPkt;
-
- ASSERT(pPacket);
- pTxPkt = RTPKT_TO_OSPKT(pPacket);
-
- NdisMoveMemory(skb_put(pTxPkt, FrameLen), pFrame, FrameLen);
-}
-
-VOID RTMPFreeAdapter(
- IN PRTMP_ADAPTER pAd)
-{
- POS_COOKIE os_cookie;
- int index;
-
- os_cookie=(POS_COOKIE)pAd->OS_Cookie;
-
- if (pAd->BeaconBuf)
- kfree(pAd->BeaconBuf);
-
-
- NdisFreeSpinLock(&pAd->MgmtRingLock);
-
-#ifdef RTMP_MAC_PCI
- NdisFreeSpinLock(&pAd->RxRingLock);
-#ifdef RT3090
-NdisFreeSpinLock(&pAd->McuCmdLock);
-#endif // RT3090 //
-#endif // RTMP_MAC_PCI //
-
- for (index =0 ; index < NUM_OF_TX_RING; index++)
- {
- NdisFreeSpinLock(&pAd->TxSwQueueLock[index]);
- NdisFreeSpinLock(&pAd->DeQueueLock[index]);
- pAd->DeQueueRunning[index] = FALSE;
- }
-
- NdisFreeSpinLock(&pAd->irq_lock);
-
-
- vfree(pAd); // pci_free_consistent(os_cookie->pci_dev,sizeof(RTMP_ADAPTER),pAd,os_cookie->pAd_pa);
- if (os_cookie)
- kfree(os_cookie);
-}
-
-BOOLEAN OS_Need_Clone_Packet(void)
-{
- return (FALSE);
-}
-
-
-
-/*
- ========================================================================
-
- Routine Description:
- clone an input NDIS PACKET to another one. The new internally created NDIS PACKET
- must have only one NDIS BUFFER
- return - byte copied. 0 means can't create NDIS PACKET
- NOTE: internally created NDIS_PACKET should be destroyed by RTMPFreeNdisPacket
-
- Arguments:
- pAd Pointer to our adapter
- pInsAMSDUHdr EWC A-MSDU format has extra 14-bytes header. if TRUE, insert this 14-byte hdr in front of MSDU.
- *pSrcTotalLen return total packet length. This lenght is calculated with 802.3 format packet.
-
- Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS RTMPCloneNdisPacket(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN pInsAMSDUHdr,
- IN PNDIS_PACKET pInPacket,
- OUT PNDIS_PACKET *ppOutPacket)
-{
-
- struct sk_buff *pkt;
-
- ASSERT(pInPacket);
- ASSERT(ppOutPacket);
-
- // 1. Allocate a packet
- pkt = dev_alloc_skb(2048);
-
- if (pkt == NULL)
- {
- return NDIS_STATUS_FAILURE;
- }
-
- skb_put(pkt, GET_OS_PKT_LEN(pInPacket));
- NdisMoveMemory(pkt->data, GET_OS_PKT_DATAPTR(pInPacket), GET_OS_PKT_LEN(pInPacket));
- *ppOutPacket = OSPKT_TO_RTPKT(pkt);
-
-
- RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS);
-
- printk("###Clone###\n");
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-// the allocated NDIS PACKET must be freed via RTMPFreeNdisPacket()
-NDIS_STATUS RTMPAllocateNdisPacket(
- IN PRTMP_ADAPTER pAd,
- OUT PNDIS_PACKET *ppPacket,
- IN PUCHAR pHeader,
- IN UINT HeaderLen,
- IN PUCHAR pData,
- IN UINT DataLen)
-{
- PNDIS_PACKET pPacket;
- ASSERT(pData);
- ASSERT(DataLen);
-
- // 1. Allocate a packet
- pPacket = (PNDIS_PACKET *) dev_alloc_skb(HeaderLen + DataLen + RTMP_PKT_TAIL_PADDING);
- if (pPacket == NULL)
- {
- *ppPacket = NULL;
-#ifdef DEBUG
- printk("RTMPAllocateNdisPacket Fail\n\n");
-#endif
- return NDIS_STATUS_FAILURE;
- }
-
- // 2. clone the frame content
- if (HeaderLen > 0)
- NdisMoveMemory(GET_OS_PKT_DATAPTR(pPacket), pHeader, HeaderLen);
- if (DataLen > 0)
- NdisMoveMemory(GET_OS_PKT_DATAPTR(pPacket) + HeaderLen, pData, DataLen);
-
- // 3. update length of packet
- skb_put(GET_OS_PKT_TYPE(pPacket), HeaderLen+DataLen);
-
- RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS);
-// printk("%s : pPacket = %p, len = %d\n", __FUNCTION__, pPacket, GET_OS_PKT_LEN(pPacket));
- *ppPacket = pPacket;
- return NDIS_STATUS_SUCCESS;
-}
-
-/*
- ========================================================================
- Description:
- This routine frees a miniport internally allocated NDIS_PACKET and its
- corresponding NDIS_BUFFER and allocated memory.
- ========================================================================
-*/
-VOID RTMPFreeNdisPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- dev_kfree_skb_any(RTPKT_TO_OSPKT(pPacket));
-}
-
-
-// IRQL = DISPATCH_LEVEL
-// NOTE: we do have an assumption here, that Byte0 and Byte1 always reasid at the same
-// scatter gather buffer
-NDIS_STATUS Sniff2BytesFromNdisBuffer(
- IN PNDIS_BUFFER pFirstBuffer,
- IN UCHAR DesiredOffset,
- OUT PUCHAR pByte0,
- OUT PUCHAR pByte1)
-{
- *pByte0 = *(PUCHAR)(pFirstBuffer + DesiredOffset);
- *pByte1 = *(PUCHAR)(pFirstBuffer + DesiredOffset + 1);
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-void RTMP_QueryPacketInfo(
- IN PNDIS_PACKET pPacket,
- OUT PACKET_INFO *pPacketInfo,
- OUT PUCHAR *pSrcBufVA,
- OUT UINT *pSrcBufLen)
-{
- pPacketInfo->BufferCount = 1;
- pPacketInfo->pFirstBuffer = (PNDIS_BUFFER)GET_OS_PKT_DATAPTR(pPacket);
- pPacketInfo->PhysicalBufferCount = 1;
- pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket);
-
- *pSrcBufVA = GET_OS_PKT_DATAPTR(pPacket);
- *pSrcBufLen = GET_OS_PKT_LEN(pPacket);
-}
-
-void RTMP_QueryNextPacketInfo(
- IN PNDIS_PACKET *ppPacket,
- OUT PACKET_INFO *pPacketInfo,
- OUT PUCHAR *pSrcBufVA,
- OUT UINT *pSrcBufLen)
-{
- PNDIS_PACKET pPacket = NULL;
-
- if (*ppPacket)
- pPacket = GET_OS_PKT_NEXT(*ppPacket);
-
- if (pPacket)
- {
- pPacketInfo->BufferCount = 1;
- pPacketInfo->pFirstBuffer = (PNDIS_BUFFER)GET_OS_PKT_DATAPTR(pPacket);
- pPacketInfo->PhysicalBufferCount = 1;
- pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket);
-
- *pSrcBufVA = GET_OS_PKT_DATAPTR(pPacket);
- *pSrcBufLen = GET_OS_PKT_LEN(pPacket);
- *ppPacket = GET_OS_PKT_NEXT(pPacket);
- }
- else
- {
- pPacketInfo->BufferCount = 0;
- pPacketInfo->pFirstBuffer = NULL;
- pPacketInfo->PhysicalBufferCount = 0;
- pPacketInfo->TotalPacketLength = 0;
-
- *pSrcBufVA = NULL;
- *pSrcBufLen = 0;
- *ppPacket = NULL;
- }
-}
-
-
-PNDIS_PACKET DuplicatePacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR FromWhichBSSID)
-{
- struct sk_buff *skb;
- PNDIS_PACKET pRetPacket = NULL;
- USHORT DataSize;
- UCHAR *pData;
-
- DataSize = (USHORT) GET_OS_PKT_LEN(pPacket);
- pData = (PUCHAR) GET_OS_PKT_DATAPTR(pPacket);
-
-
- skb = skb_clone(RTPKT_TO_OSPKT(pPacket), MEM_ALLOC_FLAG);
- if (skb)
- {
- skb->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
- pRetPacket = OSPKT_TO_RTPKT(skb);
- }
-
-
- return pRetPacket;
-
-}
-
-PNDIS_PACKET duplicate_pkt(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN ULONG DataSize,
- IN UCHAR FromWhichBSSID)
-{
- struct sk_buff *skb;
- PNDIS_PACKET pPacket = NULL;
-
-
- if ((skb = __dev_alloc_skb(HdrLen + DataSize + 2, MEM_ALLOC_FLAG)) != NULL)
- {
- skb_reserve(skb, 2);
- NdisMoveMemory(skb_tail_pointer(skb), pHeader802_3, HdrLen);
- skb_put(skb, HdrLen);
- NdisMoveMemory(skb_tail_pointer(skb), pData, DataSize);
- skb_put(skb, DataSize);
- skb->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
- pPacket = OSPKT_TO_RTPKT(skb);
- }
-
- return pPacket;
-}
-
-
-#define TKIP_TX_MIC_SIZE 8
-PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- struct sk_buff *skb, *newskb;
-
-
- skb = RTPKT_TO_OSPKT(pPacket);
- if (skb_tailroom(skb) < TKIP_TX_MIC_SIZE)
- {
- // alloc a new skb and copy the packet
- newskb = skb_copy_expand(skb, skb_headroom(skb), TKIP_TX_MIC_SIZE, GFP_ATOMIC);
- dev_kfree_skb_any(skb);
- if (newskb == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Extend Tx.MIC for packet failed!, dropping packet!\n"));
- return NULL;
- }
- skb = newskb;
- }
-
- return OSPKT_TO_RTPKT(skb);
-
-
-}
-
-
-
-
-PNDIS_PACKET ClonePacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pData,
- IN ULONG DataSize)
-{
- struct sk_buff *pRxPkt;
- struct sk_buff *pClonedPkt;
-
- ASSERT(pPacket);
- pRxPkt = RTPKT_TO_OSPKT(pPacket);
-
- // clone the packet
- pClonedPkt = skb_clone(pRxPkt, MEM_ALLOC_FLAG);
-
- if (pClonedPkt)
- {
- // set the correct dataptr and data len
- pClonedPkt->dev = pRxPkt->dev;
- pClonedPkt->data = pData;
- pClonedPkt->len = DataSize;
- pClonedPkt->tail = pClonedPkt->data + pClonedPkt->len;
- ASSERT(DataSize < 1530);
- }
- return pClonedPkt;
-}
-
-//
-// change OS packet DataPtr and DataLen
-//
-void update_os_packet_info(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- struct sk_buff *pOSPkt;
-
- ASSERT(pRxBlk->pRxPacket);
- pOSPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
-
- pOSPkt->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
- pOSPkt->data = pRxBlk->pData;
- pOSPkt->len = pRxBlk->DataSize;
- pOSPkt->tail = pOSPkt->data + pOSPkt->len;
-}
-
-
-void wlan_802_11_to_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN PUCHAR pHeader802_3,
- IN UCHAR FromWhichBSSID)
-{
- struct sk_buff *pOSPkt;
-
- ASSERT(pRxBlk->pRxPacket);
- ASSERT(pHeader802_3);
-
- pOSPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
-
- pOSPkt->dev = get_netdev_from_bssid(pAd, FromWhichBSSID);
- pOSPkt->data = pRxBlk->pData;
- pOSPkt->len = pRxBlk->DataSize;
- pOSPkt->tail = pOSPkt->data + pOSPkt->len;
-
- //
- // copy 802.3 header
- //
- //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- NdisMoveMemory(skb_push(pOSPkt, LENGTH_802_3), pHeader802_3, LENGTH_802_3);
-#endif // CONFIG_STA_SUPPORT //
- }
-
-
-
-void announce_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
-
- struct sk_buff *pRxPkt;
-#ifdef INF_AMAZON_PPA
- int ret = 0;
- unsigned int ppa_flags = 0; /* reserved for now */
-#endif // INF_AMAZON_PPA //
-
- ASSERT(pPacket);
-
- pRxPkt = RTPKT_TO_OSPKT(pPacket);
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
- /* Push up the protocol stack */
-#ifdef IKANOS_VX_1X0
- IKANOS_DataFrameRx(pAd, pRxPkt->dev, pRxPkt, pRxPkt->len);
-#else
-#ifdef INF_AMAZON_SE
-#ifdef BG_FT_SUPPORT
- BG_FTPH_PacketFromApHandle(pRxPkt);
- return;
-#endif // BG_FT_SUPPORT //
-#endif // INF_AMAZON_SE //
- pRxPkt->protocol = eth_type_trans(pRxPkt, pRxPkt->dev);
-
-#ifdef INF_AMAZON_PPA
- if (ppa_hook_directpath_send_fn && pAd->PPAEnable==TRUE )
- {
- memset(pRxPkt->head,0,pRxPkt->data-pRxPkt->head-14);
- DBGPRINT(RT_DEBUG_TRACE, ("ppa_hook_directpath_send_fn rx :ret:%d headroom:%d dev:%s pktlen:%d<===\n",ret,skb_headroom(pRxPkt)
- ,pRxPkt->dev->name,pRxPkt->len));
- hex_dump("rx packet", pRxPkt->data, 32);
- ret = ppa_hook_directpath_send_fn(pAd->g_if_id, pRxPkt, pRxPkt->len, ppa_flags);
- pRxPkt=NULL;
- return;
-
- }
-#endif // INF_AMAZON_PPA //
-
-//#ifdef CONFIG_5VT_ENHANCE
-// *(int*)(pRxPkt->cb) = BRIDGE_TAG;
-//#endif
-
- {
- netif_rx(pRxPkt);
- }
-
-#endif // IKANOS_VX_1X0 //
-}
-
-
-PRTMP_SCATTER_GATHER_LIST
-rt_get_sg_list_from_packet(PNDIS_PACKET pPacket, RTMP_SCATTER_GATHER_LIST *sg)
-{
- sg->NumberOfElements = 1;
- sg->Elements[0].Address = GET_OS_PKT_DATAPTR(pPacket);
- sg->Elements[0].Length = GET_OS_PKT_LEN(pPacket);
- return (sg);
-}
-
-void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen)
-{
- unsigned char *pt;
- int x;
-
- if (RTDebugLevel < RT_DEBUG_TRACE)
- return;
-
- pt = pSrcBufVA;
- printk("%s: %p, len = %d\n",str, pSrcBufVA, SrcBufLen);
- for (x=0; x<SrcBufLen; x++)
- {
- if (x % 16 == 0)
- printk("0x%04x : ", x);
- printk("%02x ", ((unsigned char)pt[x]));
- if (x%16 == 15) printk("\n");
- }
- printk("\n");
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Send log message through wireless event
-
- Support standard iw_event with IWEVCUSTOM. It is used below.
-
- iwreq_data.data.flags is used to store event_flag that is defined by user.
- iwreq_data.data.length is the length of the event log.
-
- The format of the event log is composed of the entry's MAC address and
- the desired log message (refer to pWirelessEventText).
-
- ex: 11:22:33:44:55:66 has associated successfully
-
- p.s. The requirement of Wireless Extension is v15 or newer.
-
- ========================================================================
-*/
-VOID RTMPSendWirelessEvent(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Event_flag,
- IN PUCHAR pAddr,
- IN UCHAR BssIdx,
- IN CHAR Rssi)
-{
-#if WIRELESS_EXT >= 15
-
- //union iwreq_data wrqu;
- PSTRING pBuf = NULL, pBufPtr = NULL;
- USHORT event, type, BufLen;
- UCHAR event_table_len = 0;
-
- type = Event_flag & 0xFF00;
- event = Event_flag & 0x00FF;
-
- switch (type)
- {
- case IW_SYS_EVENT_FLAG_START:
- event_table_len = IW_SYS_EVENT_TYPE_NUM;
- break;
-
- case IW_SPOOF_EVENT_FLAG_START:
- event_table_len = IW_SPOOF_EVENT_TYPE_NUM;
- break;
-
- case IW_FLOOD_EVENT_FLAG_START:
- event_table_len = IW_FLOOD_EVENT_TYPE_NUM;
- break;
- }
-
- if (event_table_len == 0)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s : The type(%0x02x) is not valid.\n", __FUNCTION__, type));
- return;
- }
-
- if (event >= event_table_len)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s : The event(%0x02x) is not valid.\n", __FUNCTION__, event));
- return;
- }
-
- //Allocate memory and copy the msg.
- if((pBuf = kmalloc(IW_CUSTOM_MAX_LEN, GFP_ATOMIC)) != NULL)
- {
- //Prepare the payload
- memset(pBuf, 0, IW_CUSTOM_MAX_LEN);
-
- pBufPtr = pBuf;
-
- if (pAddr)
- pBufPtr += sprintf(pBufPtr, "(RT2860) STA(%02x:%02x:%02x:%02x:%02x:%02x) ", PRINT_MAC(pAddr));
- else if (BssIdx < MAX_MBSSID_NUM)
- pBufPtr += sprintf(pBufPtr, "(RT2860) BSS(ra%d) ", BssIdx);
- else
- pBufPtr += sprintf(pBufPtr, "(RT2860) ");
-
- if (type == IW_SYS_EVENT_FLAG_START)
- pBufPtr += sprintf(pBufPtr, "%s", pWirelessSysEventText[event]);
- else if (type == IW_SPOOF_EVENT_FLAG_START)
- pBufPtr += sprintf(pBufPtr, "%s (RSSI=%d)", pWirelessSpoofEventText[event], Rssi);
- else if (type == IW_FLOOD_EVENT_FLAG_START)
- pBufPtr += sprintf(pBufPtr, "%s", pWirelessFloodEventText[event]);
- else
- pBufPtr += sprintf(pBufPtr, "%s", "unknown event");
-
- pBufPtr[pBufPtr - pBuf] = '\0';
- BufLen = pBufPtr - pBuf;
-
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, Event_flag, NULL, (PUCHAR)pBuf, BufLen);
- //DBGPRINT(RT_DEBUG_TRACE, ("%s : %s\n", __FUNCTION__, pBuf));
-
- kfree(pBuf);
- }
- else
- DBGPRINT(RT_DEBUG_ERROR, ("%s : Can't allocate memory for wireless event.\n", __FUNCTION__));
-#else
- DBGPRINT(RT_DEBUG_ERROR, ("%s : The Wireless Extension MUST be v15 or newer.\n", __FUNCTION__));
-#endif /* WIRELESS_EXT >= 15 */
-}
-
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-void send_monitor_packets(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk)
-{
- struct sk_buff *pOSPkt;
- wlan_ng_prism2_header *ph;
- int rate_index = 0;
- USHORT header_len = 0;
- UCHAR temp_header[40] = {0};
-
- u_int32_t ralinkrate[256] = {2,4,11,22, 12,18,24,36,48,72,96, 108, 109, 110, 111, 112, 13, 26, 39, 52,78,104, 117, 130, 26, 52, 78,104, 156, 208, 234, 260, 27, 54,81,108,162, 216, 243, 270, // Last 38
- 54, 108, 162, 216, 324, 432, 486, 540, 14, 29, 43, 57, 87, 115, 130, 144, 29, 59,87,115, 173, 230,260, 288, 30, 60,90,120,180,240,270,300,60,120,180,240,360,480,540,600, 0,1,2,3,4,5,6,7,8,9,10,
- 11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80};
-
-
- ASSERT(pRxBlk->pRxPacket);
- if (pRxBlk->DataSize < 10)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too small! (%d)\n", __FUNCTION__, pRxBlk->DataSize));
- goto err_free_sk_buff;
- }
-
- if (pRxBlk->DataSize + sizeof(wlan_ng_prism2_header) > RX_BUFFER_AGGRESIZE)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s : Size is too large! (%d)\n", __FUNCTION__, pRxBlk->DataSize + sizeof(wlan_ng_prism2_header)));
- goto err_free_sk_buff;
- }
-
- pOSPkt = RTPKT_TO_OSPKT(pRxBlk->pRxPacket);
- pOSPkt->dev = get_netdev_from_bssid(pAd, BSS0);
- if (pRxBlk->pHeader->FC.Type == BTYPE_DATA)
- {
- pRxBlk->DataSize -= LENGTH_802_11;
- if ((pRxBlk->pHeader->FC.ToDs == 1) &&
- (pRxBlk->pHeader->FC.FrDs == 1))
- header_len = LENGTH_802_11_WITH_ADDR4;
- else
- header_len = LENGTH_802_11;
-
- // QOS
- if (pRxBlk->pHeader->FC.SubType & 0x08)
- {
- header_len += 2;
- // Data skip QOS contorl field
- pRxBlk->DataSize -=2;
- }
-
- // Order bit: A-Ralink or HTC+
- if (pRxBlk->pHeader->FC.Order)
- {
- header_len += 4;
- // Data skip HTC contorl field
- pRxBlk->DataSize -= 4;
- }
-
- // Copy Header
- if (header_len <= 40)
- NdisMoveMemory(temp_header, pRxBlk->pData, header_len);
-
- // skip HW padding
- if (pRxBlk->RxD.L2PAD)
- pRxBlk->pData += (header_len + 2);
- else
- pRxBlk->pData += header_len;
- } //end if
-
-
- if (pRxBlk->DataSize < pOSPkt->len) {
- skb_trim(pOSPkt,pRxBlk->DataSize);
- } else {
- skb_put(pOSPkt,(pRxBlk->DataSize - pOSPkt->len));
- } //end if
-
- if ((pRxBlk->pData - pOSPkt->data) > 0) {
- skb_put(pOSPkt,(pRxBlk->pData - pOSPkt->data));
- skb_pull(pOSPkt,(pRxBlk->pData - pOSPkt->data));
- } //end if
-
- if (skb_headroom(pOSPkt) < (sizeof(wlan_ng_prism2_header)+ header_len)) {
- if (pskb_expand_head(pOSPkt, (sizeof(wlan_ng_prism2_header) + header_len), 0, GFP_ATOMIC)) {
- DBGPRINT(RT_DEBUG_ERROR, ("%s : Reallocate header size of sk_buff fail!\n", __FUNCTION__));
- goto err_free_sk_buff;
- } //end if
- } //end if
-
- if (header_len > 0)
- NdisMoveMemory(skb_push(pOSPkt, header_len), temp_header, header_len);
-
- ph = (wlan_ng_prism2_header *) skb_push(pOSPkt, sizeof(wlan_ng_prism2_header));
- NdisZeroMemory(ph, sizeof(wlan_ng_prism2_header));
-
- ph->msgcode = DIDmsg_lnxind_wlansniffrm;
- ph->msglen = sizeof(wlan_ng_prism2_header);
- strcpy((PSTRING) ph->devname, (PSTRING) pAd->net_dev->name);
-
- ph->hosttime.did = DIDmsg_lnxind_wlansniffrm_hosttime;
- ph->hosttime.status = 0;
- ph->hosttime.len = 4;
- ph->hosttime.data = jiffies;
-
- ph->mactime.did = DIDmsg_lnxind_wlansniffrm_mactime;
- ph->mactime.status = 0;
- ph->mactime.len = 0;
- ph->mactime.data = 0;
-
- ph->istx.did = DIDmsg_lnxind_wlansniffrm_istx;
- ph->istx.status = 0;
- ph->istx.len = 0;
- ph->istx.data = 0;
-
- ph->channel.did = DIDmsg_lnxind_wlansniffrm_channel;
- ph->channel.status = 0;
- ph->channel.len = 4;
-
- ph->channel.data = (u_int32_t)pAd->CommonCfg.Channel;
-
- ph->rssi.did = DIDmsg_lnxind_wlansniffrm_rssi;
- ph->rssi.status = 0;
- ph->rssi.len = 4;
- ph->rssi.data = (u_int32_t)RTMPMaxRssi(pAd, ConvertToRssi(pAd, pRxBlk->pRxWI->RSSI0, RSSI_0), ConvertToRssi(pAd, pRxBlk->pRxWI->RSSI1, RSSI_1), ConvertToRssi(pAd, pRxBlk->pRxWI->RSSI2, RSSI_2));;
-
- ph->signal.did = DIDmsg_lnxind_wlansniffrm_signal;
- ph->signal.status = 0;
- ph->signal.len = 4;
- ph->signal.data = 0; //rssi + noise;
-
- ph->noise.did = DIDmsg_lnxind_wlansniffrm_noise;
- ph->noise.status = 0;
- ph->noise.len = 4;
- ph->noise.data = 0;
-
-#ifdef DOT11_N_SUPPORT
- if (pRxBlk->pRxWI->PHYMODE >= MODE_HTMIX)
- {
- rate_index = 16 + ((UCHAR)pRxBlk->pRxWI->BW *16) + ((UCHAR)pRxBlk->pRxWI->ShortGI *32) + ((UCHAR)pRxBlk->pRxWI->MCS);
- }
- else
-#endif // DOT11_N_SUPPORT //
- if (pRxBlk->pRxWI->PHYMODE == MODE_OFDM)
- rate_index = (UCHAR)(pRxBlk->pRxWI->MCS) + 4;
- else
- rate_index = (UCHAR)(pRxBlk->pRxWI->MCS);
- if (rate_index < 0)
- rate_index = 0;
- if (rate_index > 255)
- rate_index = 255;
-
- ph->rate.did = DIDmsg_lnxind_wlansniffrm_rate;
- ph->rate.status = 0;
- ph->rate.len = 4;
- ph->rate.data = ralinkrate[rate_index];
-
- ph->frmlen.did = DIDmsg_lnxind_wlansniffrm_frmlen;
- ph->frmlen.status = 0;
- ph->frmlen.len = 4;
- ph->frmlen.data = (u_int32_t)pRxBlk->DataSize;
-
-
- pOSPkt->pkt_type = PACKET_OTHERHOST;
- pOSPkt->protocol = eth_type_trans(pOSPkt, pOSPkt->dev);
- pOSPkt->ip_summed = CHECKSUM_NONE;
- netif_rx(pOSPkt);
-
- return;
-
-err_free_sk_buff:
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
-
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-/*******************************************************************************
-
- File open/close related functions.
-
- *******************************************************************************/
-RTMP_OS_FD RtmpOSFileOpen(char *pPath, int flag, int mode)
-{
- struct file *filePtr;
-
- filePtr = filp_open(pPath, flag, 0);
- if (IS_ERR(filePtr))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s(): Error %ld opening %s\n", __FUNCTION__, -PTR_ERR(filePtr), pPath));
- }
-
- return (RTMP_OS_FD)filePtr;
-}
-
-int RtmpOSFileClose(RTMP_OS_FD osfd)
-{
- filp_close(osfd, NULL);
- return 0;
-}
-
-
-void RtmpOSFileSeek(RTMP_OS_FD osfd, int offset)
-{
- osfd->f_pos = offset;
-}
-
-
-int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen)
-{
- // The object must have a read method
- if (osfd->f_op && osfd->f_op->read)
- {
- return osfd->f_op->read(osfd, pDataPtr, readLen, &osfd->f_pos);
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR, ("no file read method\n"));
- return -1;
- }
-}
-
-
-int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen)
-{
- return osfd->f_op->write(osfd, pDataPtr, (size_t)writeLen, &osfd->f_pos);
-}
-
-
-void RtmpOSFSInfoChange(RTMP_OS_FS_INFO *pOSFSInfo, BOOLEAN bSet)
-{
- if (bSet)
- {
- // Save uid and gid used for filesystem access.
- // Set user and group to 0 (root)
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
- pOSFSInfo->fsuid= current->fsuid;
- pOSFSInfo->fsgid = current->fsgid;
- current->fsuid = current->fsgid = 0;
-#else
- pOSFSInfo->fsuid = current_fsuid();
- pOSFSInfo->fsgid = current_fsgid();
-#endif
- pOSFSInfo->fs = get_fs();
- set_fs(KERNEL_DS);
- }
- else
- {
- set_fs(pOSFSInfo->fs);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
- current->fsuid = pOSFSInfo->fsuid;
- current->fsgid = pOSFSInfo->fsgid;
-#endif
- }
-}
-
-
-
-/*******************************************************************************
-
- Task create/management/kill related functions.
-
- *******************************************************************************/
-NDIS_STATUS RtmpOSTaskKill(
- IN RTMP_OS_TASK *pTask)
-{
- RTMP_ADAPTER *pAd;
- int ret = NDIS_STATUS_FAILURE;
-
- pAd = (RTMP_ADAPTER *)pTask->priv;
-
-#ifdef KTHREAD_SUPPORT
- if (pTask->kthread_task)
- {
- kthread_stop(pTask->kthread_task);
- ret = NDIS_STATUS_SUCCESS;
- }
-#else
- CHECK_PID_LEGALITY(pTask->taskPID)
- {
- printk("Terminate the task(%s) with pid(%d)!\n", pTask->taskName, GET_PID_NUMBER(pTask->taskPID));
- mb();
- pTask->task_killed = 1;
- mb();
- ret = KILL_THREAD_PID(pTask->taskPID, SIGTERM, 1);
- if (ret)
- {
- printk(KERN_WARNING "kill task(%s) with pid(%d) failed(retVal=%d)!\n",
- pTask->taskName, GET_PID_NUMBER(pTask->taskPID), ret);
- }
- else
- {
- wait_for_completion(&pTask->taskComplete);
- pTask->taskPID = THREAD_PID_INIT_VALUE;
- pTask->task_killed = 0;
- ret = NDIS_STATUS_SUCCESS;
- }
- }
-#endif
-
- return ret;
-
-}
-
-
-INT RtmpOSTaskNotifyToExit(
- IN RTMP_OS_TASK *pTask)
-{
-
-#ifndef KTHREAD_SUPPORT
- complete_and_exit(&pTask->taskComplete, 0);
-#endif
-
- return 0;
-}
-
-
-void RtmpOSTaskCustomize(
- IN RTMP_OS_TASK *pTask)
-{
-
-#ifndef KTHREAD_SUPPORT
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- daemonize((PSTRING)&pTask->taskName[0]/*"%s",pAd->net_dev->name*/);
-
- allow_signal(SIGTERM);
- allow_signal(SIGKILL);
- current->flags |= PF_NOFREEZE;
-#else
- unsigned long flags;
-
- daemonize();
- reparent_to_init();
- strcpy(current->comm, &pTask->taskName[0]);
-
- siginitsetinv(&current->blocked, sigmask(SIGTERM) | sigmask(SIGKILL));
-
- /* Allow interception of SIGKILL only
- * Don't allow other signals to interrupt the transmission */
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,22)
- spin_lock_irqsave(&current->sigmask_lock, flags);
- flush_signals(current);
- recalc_sigpending(current);
- spin_unlock_irqrestore(&current->sigmask_lock, flags);
-#endif
-#endif
-
- /* signal that we've started the thread */
- complete(&pTask->taskComplete);
-
-#endif
-}
-
-
-NDIS_STATUS RtmpOSTaskAttach(
- IN RTMP_OS_TASK *pTask,
- IN int (*fn)(void *),
- IN void *arg)
-{
- NDIS_STATUS status = NDIS_STATUS_SUCCESS;
- pid_t pid_number = -1;
-
-#ifdef KTHREAD_SUPPORT
- pTask->task_killed = 0;
- pTask->kthread_task = NULL;
- pTask->kthread_task = kthread_run(fn, arg, pTask->taskName);
- if (IS_ERR(pTask->kthread_task))
- status = NDIS_STATUS_FAILURE;
-#else
- pid_number = kernel_thread(fn, arg, RTMP_OS_MGMT_TASK_FLAGS);
- if (pid_number < 0)
- {
- DBGPRINT (RT_DEBUG_ERROR, ("Attach task(%s) failed!\n", pTask->taskName));
- status = NDIS_STATUS_FAILURE;
- }
- else
- {
- pTask->taskPID = GET_PID(pid_number);
-
- // Wait for the thread to start
- wait_for_completion(&pTask->taskComplete);
- status = NDIS_STATUS_SUCCESS;
- }
-#endif
- return status;
-}
-
-
-NDIS_STATUS RtmpOSTaskInit(
- IN RTMP_OS_TASK *pTask,
- IN PSTRING pTaskName,
- IN VOID *pPriv)
-{
- int len;
-
- ASSERT(pTask);
-
-#ifndef KTHREAD_SUPPORT
- NdisZeroMemory((PUCHAR)(pTask), sizeof(RTMP_OS_TASK));
-#endif
-
- len = strlen(pTaskName);
- len = len > (RTMP_OS_TASK_NAME_LEN -1) ? (RTMP_OS_TASK_NAME_LEN-1) : len;
- NdisMoveMemory(&pTask->taskName[0], pTaskName, len);
- pTask->priv = pPriv;
-
-#ifndef KTHREAD_SUPPORT
- RTMP_SEM_EVENT_INIT_LOCKED(&(pTask->taskSema));
- pTask->taskPID = THREAD_PID_INIT_VALUE;
-
- init_completion (&pTask->taskComplete);
-#endif
-
- return NDIS_STATUS_SUCCESS;
-}
-
-
-void RTMP_IndicateMediaState(
- IN PRTMP_ADAPTER pAd)
-{
- if (pAd->CommonCfg.bWirelessEvent)
- {
- if (pAd->IndicateMediaState == NdisMediaStateConnected)
- {
- RTMPSendWirelessEvent(pAd, IW_STA_LINKUP_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
- else
- {
- RTMPSendWirelessEvent(pAd, IW_STA_LINKDOWN_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
- }
-}
-
-
-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1
-//static struct net_device *alloc_netdev(int sizeof_priv, const char *mask, void (*setup)(struct net_device *)) //sample
-struct net_device *alloc_netdev(
- int sizeof_priv,
- const char *mask,
- void (*setup)(struct net_device *))
-{
- struct net_device *dev;
- INT alloc_size;
-
-
- /* ensure 32-byte alignment of the private area */
- alloc_size = sizeof (*dev) + sizeof_priv + 31;
-
- dev = (struct net_device *) kmalloc(alloc_size, GFP_KERNEL);
- if (dev == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR,
- ("alloc_netdev: Unable to allocate device memory.\n"));
- return NULL;
- }
-
- memset(dev, 0, alloc_size);
-
- if (sizeof_priv)
- dev->priv = (void *) (((long)(dev + 1) + 31) & ~31);
-
- setup(dev);
- strcpy(dev->name, mask);
-
- return dev;
-}
-#endif // LINUX_VERSION_CODE //
-
-
-int RtmpOSWrielessEventSend(
- IN RTMP_ADAPTER *pAd,
- IN UINT32 eventType,
- IN INT flags,
- IN PUCHAR pSrcMac,
- IN PUCHAR pData,
- IN UINT32 dataLen)
-{
- union iwreq_data wrqu;
-
- memset(&wrqu, 0, sizeof(wrqu));
-
- if (flags>-1)
- wrqu.data.flags = flags;
-
- if (pSrcMac)
- memcpy(wrqu.ap_addr.sa_data, pSrcMac, MAC_ADDR_LEN);
-
- if ((pData!= NULL) && (dataLen > 0))
- wrqu.data.length = dataLen;
-
- wireless_send_event(pAd->net_dev, eventType, &wrqu, (char *)pData);
- return 0;
-}
-
-
-int RtmpOSNetDevAddrSet(
- IN PNET_DEV pNetDev,
- IN PUCHAR pMacAddr)
-{
- struct net_device *net_dev;
- RTMP_ADAPTER *pAd;
-
- net_dev = pNetDev;
- //pAd = (RTMP_ADAPTER *)net_dev->priv;
- pAd=RTMP_OS_NETDEV_GET_PRIV(pNetDev);
-
-#ifdef CONFIG_STA_SUPPORT
- // work-around for the SuSE due to it has it's own interface name management system.
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- NdisZeroMemory(pAd->StaCfg.dev_name, 16);
- NdisMoveMemory(pAd->StaCfg.dev_name, net_dev->name, strlen(net_dev->name));
- }
-#endif // CONFIG_STA_SUPPORT //
-
- NdisMoveMemory(net_dev->dev_addr, pMacAddr, 6);
-
- return 0;
-}
-
-
-
-/*
- * Assign the network dev name for created Ralink WiFi interface.
- */
-static int RtmpOSNetDevRequestName(
- IN RTMP_ADAPTER *pAd,
- IN PNET_DEV dev,
- IN PSTRING pPrefixStr,
- IN INT devIdx)
-{
- PNET_DEV existNetDev;
- STRING suffixName[IFNAMSIZ];
- STRING desiredName[IFNAMSIZ];
- int ifNameIdx, prefixLen, slotNameLen;
- int Status;
-
-
- prefixLen = strlen(pPrefixStr);
- ASSERT((prefixLen < IFNAMSIZ));
-
- for (ifNameIdx = devIdx; ifNameIdx < 32; ifNameIdx++)
- {
- memset(suffixName, 0, IFNAMSIZ);
- memset(desiredName, 0, IFNAMSIZ);
- strncpy(&desiredName[0], pPrefixStr, prefixLen);
-
-#ifdef MULTIPLE_CARD_SUPPORT
- if (pAd->MC_RowID >= 0)
- sprintf(suffixName, "%02d_%d", pAd->MC_RowID, ifNameIdx);
- else
-#endif // MULTIPLE_CARD_SUPPORT //
- sprintf(suffixName, "%d", ifNameIdx);
-
- slotNameLen = strlen(suffixName);
- ASSERT(((slotNameLen + prefixLen) < IFNAMSIZ));
- strcat(desiredName, suffixName);
-
- existNetDev = RtmpOSNetDevGetByName(dev, &desiredName[0]);
- if (existNetDev == NULL)
- break;
- else
- RtmpOSNetDeviceRefPut(existNetDev);
- }
-
- if(ifNameIdx < 32)
- {
- strcpy(&dev->name[0], &desiredName[0]);
- Status = NDIS_STATUS_SUCCESS;
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR,
- ("Cannot request DevName with preifx(%s) and in range(0~32) as suffix from OS!\n", pPrefixStr));
- Status = NDIS_STATUS_FAILURE;
- }
-
- return Status;
-}
-
-
-void RtmpOSNetDevClose(
- IN PNET_DEV pNetDev)
-{
- dev_close(pNetDev);
-}
-
-
-void RtmpOSNetDevFree(PNET_DEV pNetDev)
-{
- ASSERT(pNetDev);
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- free_netdev(pNetDev);
-#else
- kfree(pNetDev);
-#endif
-}
-
-
-INT RtmpOSNetDevAlloc(
- IN PNET_DEV *new_dev_p,
- IN UINT32 privDataSize)
-{
- // assign it as null first.
- *new_dev_p = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Allocate a net device with private data size=%d!\n", privDataSize));
-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1
- *new_dev_p = alloc_netdev(privDataSize, "eth%d", ether_setup);
-#else
- *new_dev_p = alloc_etherdev(privDataSize);
-#endif // LINUX_VERSION_CODE //
-
- if (*new_dev_p)
- return NDIS_STATUS_SUCCESS;
- else
- return NDIS_STATUS_FAILURE;
-}
-
-
-PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, PSTRING pDevName)
-{
- PNET_DEV pTargetNetDev = NULL;
-
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
- pTargetNetDev = dev_get_by_name(dev_net(pNetDev), pDevName);
-#else
- ASSERT(pNetDev);
- pTargetNetDev = dev_get_by_name(pNetDev->nd_net, pDevName);
-#endif
-#else
- pTargetNetDev = dev_get_by_name(pDevName);
-#endif // KERNEL_VERSION(2,6,24) //
-
-#else
- int devNameLen;
-
- devNameLen = strlen(pDevName);
- ASSERT((devNameLen <= IFNAMSIZ));
-
- for(pTargetNetDev=dev_base; pTargetNetDev!=NULL; pTargetNetDev=pTargetNetDev->next)
- {
- if (strncmp(pTargetNetDev->name, pDevName, devNameLen) == 0)
- break;
- }
-#endif // KERNEL_VERSION(2,5,0) //
-
- return pTargetNetDev;
-}
-
-
-void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev)
-{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
- /*
- every time dev_get_by_name is called, and it has returned a valid struct
- net_device*, dev_put should be called afterwards, because otherwise the
- machine hangs when the device is unregistered (since dev->refcnt > 1).
- */
- if(pNetDev)
- dev_put(pNetDev);
-#endif // LINUX_VERSION_CODE //
-}
-
-
-INT RtmpOSNetDevDestory(
- IN RTMP_ADAPTER *pAd,
- IN PNET_DEV pNetDev)
-{
-
- // TODO: Need to fix this
- printk("WARNING: This function(%s) not implement yet!!!\n", __FUNCTION__);
- return 0;
-}
-
-
-void RtmpOSNetDevDetach(PNET_DEV pNetDev)
-{
- unregister_netdev(pNetDev);
-}
-
-
-int RtmpOSNetDevAttach(
- IN PNET_DEV pNetDev,
- IN RTMP_OS_NETDEV_OP_HOOK *pDevOpHook)
-{
- int ret, rtnl_locked = FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RtmpOSNetDevAttach()--->\n"));
- // If we need hook some callback function to the net device structrue, now do it.
- if (pDevOpHook)
- {
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(pNetDev);
-
- pNetDev->netdev_ops = pDevOpHook->netdev_ops;
-
- /* OS specific flags, here we used to indicate if we are virtual interface */
- pNetDev->priv_flags = pDevOpHook->priv_flags;
-
-#if (WIRELESS_EXT < 21) && (WIRELESS_EXT >= 12)
- pNetDev->get_wireless_stats = rt28xx_get_wireless_stats;
-#endif
-
-#ifdef CONFIG_STA_SUPPORT
-#if WIRELESS_EXT >= 12
- if (pAd->OpMode == OPMODE_STA)
- {
- pNetDev->wireless_handlers = &rt28xx_iw_handler_def;
- }
-#endif //WIRELESS_EXT >= 12
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-#if WIRELESS_EXT >= 12
- if (pAd->OpMode == OPMODE_AP)
- {
- pNetDev->wireless_handlers = &rt28xx_ap_iw_handler_def;
- }
-#endif //WIRELESS_EXT >= 12
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
- // copy the net device mac address to the net_device structure.
- NdisMoveMemory(pNetDev->dev_addr, &pDevOpHook->devAddr[0], MAC_ADDR_LEN);
-
- rtnl_locked = pDevOpHook->needProtcted;
- }
-
- if (rtnl_locked)
- ret = register_netdevice(pNetDev);
- else
- ret = register_netdev(pNetDev);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<---RtmpOSNetDevAttach(), ret=%d\n", ret));
- if (ret == 0)
- return NDIS_STATUS_SUCCESS;
- else
- return NDIS_STATUS_FAILURE;
-}
-
-
-PNET_DEV RtmpOSNetDevCreate(
- IN RTMP_ADAPTER *pAd,
- IN INT devType,
- IN INT devNum,
- IN INT privMemSize,
- IN PSTRING pNamePrefix)
-{
- struct net_device *pNetDev = NULL;
- int status;
-
-
- /* allocate a new network device */
- status = RtmpOSNetDevAlloc(&pNetDev, 0 /*privMemSize*/);
- if (status != NDIS_STATUS_SUCCESS)
- {
- /* allocation fail, exit */
- DBGPRINT(RT_DEBUG_ERROR, ("Allocate network device fail (%s)...\n", pNamePrefix));
- return NULL;
- }
-
-
- /* find a available interface name, max 32 interfaces */
- status = RtmpOSNetDevRequestName(pAd, pNetDev, pNamePrefix, devNum);
- if (status != NDIS_STATUS_SUCCESS)
- {
- /* error! no any available ra name can be used! */
- DBGPRINT(RT_DEBUG_ERROR, ("Assign interface name (%s with suffix 0~32) failed...\n", pNamePrefix));
- RtmpOSNetDevFree(pNetDev);
-
- return NULL;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("The name of the new %s interface is %s...\n", pNamePrefix, pNetDev->name));
- }
-
- return pNetDev;
-}
diff --git a/drivers/staging/rt3090/rt_linux.h b/drivers/staging/rt3090/rt_linux.h
deleted file mode 100644
index a970e780ef27..000000000000
--- a/drivers/staging/rt3090/rt_linux.h
+++ /dev/null
@@ -1,1034 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt_linux.h
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
-*/
-
-#ifndef __RT_LINUX_H__
-#define __RT_LINUX_H__
-
-#include <linux/module.h>
-#include <linux/version.h>
-#include <linux/kernel.h>
-#include <linux/spinlock.h>
-#include <linux/init.h>
-#include <linux/string.h>
-#include <linux/timer.h>
-#include <linux/errno.h>
-#include <linux/slab.h>
-#include <linux/interrupt.h>
-#include <linux/pci.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/skbuff.h>
-#include <linux/ethtool.h>
-#include <linux/wireless.h>
-#include <linux/proc_fs.h>
-#include <linux/delay.h>
-#include <linux/if_arp.h>
-#include <linux/ctype.h>
-#include <linux/vmalloc.h>
-#include <linux/wireless.h>
-#include <net/iw_handler.h>
-
-#ifdef INF_AMAZON_PPA
-#include <asm/amazon_se/ifx_ppa_interface.h>
-#include <asm/amazon_se/ifx_ppa_hook.h>
-#endif // INF_AMAZON_PPA //
-
-// load firmware
-#define __KERNEL_SYSCALLS__
-#include <linux/unistd.h>
-#include <asm/uaccess.h>
-#include <asm/types.h>
-#include <asm/unaligned.h> // for get_unaligned()
-
-#ifdef KTHREAD_SUPPORT
-#include <linux/err.h>
-#include <linux/kthread.h>
-#endif // KTHREAD_SUPPORT //
-
-#undef AP_WSC_INCLUDED
-#undef STA_WSC_INCLUDED
-#undef WSC_INCLUDED
-
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-
-#ifdef KTHREAD_SUPPORT
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4)
-#error "This kerne version doesn't support kthread!!"
-#endif
-#endif // KTHREAD_SUPPORT //
-
-/***********************************************************************************
- * Profile related sections
- ***********************************************************************************/
-
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef RTMP_MAC_PCI
-#define STA_PROFILE_PATH "/etc/Wireless/RT2860STA/RT2860STA.dat"
-#define STA_DRIVER_VERSION "2.1.0.0"
-#ifdef MULTIPLE_CARD_SUPPORT
-#define CARD_INFO_PATH "/etc/Wireless/RT2860STA/RT2860STACard.dat"
-#endif // MULTIPLE_CARD_SUPPORT //
-#endif // RTMP_MAC_PCI //
-
-
-
-extern const struct iw_handler_def rt28xx_iw_handler_def;
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-extern const struct iw_handler_def rt28xx_ap_iw_handler_def;
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-/***********************************************************************************
- * Compiler related definitions
- ***********************************************************************************/
-#undef __inline
-#define __inline static inline
-#define IN
-#define OUT
-#define INOUT
-#define NDIS_STATUS INT
-
-
-/***********************************************************************************
- * OS Specific definitions and data structures
- ***********************************************************************************/
-typedef struct pci_dev * PPCI_DEV;
-typedef struct net_device * PNET_DEV;
-typedef void * PNDIS_PACKET;
-typedef char NDIS_PACKET;
-typedef PNDIS_PACKET * PPNDIS_PACKET;
-typedef dma_addr_t NDIS_PHYSICAL_ADDRESS;
-typedef dma_addr_t * PNDIS_PHYSICAL_ADDRESS;
-typedef void * NDIS_HANDLE;
-typedef char * PNDIS_BUFFER;
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-typedef struct pid * RTMP_OS_PID;
-#else
-typedef pid_t RTMP_OS_PID;
-#endif
-
-typedef struct semaphore RTMP_OS_SEM;
-
-#ifdef RTMP_MAC_PCI
-#ifndef PCI_DEVICE
-#define PCI_DEVICE(vend,dev) \
- .vendor = (vend), .device = (dev), \
- .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID
-#endif // PCI_DEVICE //
-#endif // RTMP_MAC_PCI //
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#define RT_MOD_INC_USE_COUNT() \
- if (!try_module_get(THIS_MODULE)) \
- { \
- DBGPRINT(RT_DEBUG_ERROR, ("%s: cannot reserve module\n", __FUNCTION__)); \
- return -1; \
- }
-
-#define RT_MOD_DEC_USE_COUNT() module_put(THIS_MODULE);
-#else
-#define RT_MOD_INC_USE_COUNT() MOD_INC_USE_COUNT;
-#define RT_MOD_DEC_USE_COUNT() MOD_DEC_USE_COUNT;
-#endif
-
-#define RTMP_INC_REF(_A) 0
-#define RTMP_DEC_REF(_A) 0
-#define RTMP_GET_REF(_A) 0
-
-
-#if WIRELESS_EXT >= 12
-// This function will be called when query /proc
-struct iw_statistics *rt28xx_get_wireless_stats(
- IN struct net_device *net_dev);
-#endif
-
-
-/***********************************************************************************
- * Network related constant definitions
- ***********************************************************************************/
-#ifndef IFNAMSIZ
-#define IFNAMSIZ 16
-#endif
-
-#define ETH_LENGTH_OF_ADDRESS 6
-
-#define NDIS_STATUS_SUCCESS 0x00
-#define NDIS_STATUS_FAILURE 0x01
-#define NDIS_STATUS_INVALID_DATA 0x02
-#define NDIS_STATUS_RESOURCES 0x03
-
-#define NDIS_SET_PACKET_STATUS(_p, _status) do{} while(0)
-#define NdisWriteErrorLogEntry(_a, _b, _c, _d) do{} while(0)
-
-/* statistics counter */
-#define STATS_INC_RX_PACKETS(_pAd, _dev)
-#define STATS_INC_TX_PACKETS(_pAd, _dev)
-
-#define STATS_INC_RX_BYTESS(_pAd, _dev, len)
-#define STATS_INC_TX_BYTESS(_pAd, _dev, len)
-
-#define STATS_INC_RX_ERRORS(_pAd, _dev)
-#define STATS_INC_TX_ERRORS(_pAd, _dev)
-
-#define STATS_INC_RX_DROPPED(_pAd, _dev)
-#define STATS_INC_TX_DROPPED(_pAd, _dev)
-
-
-/***********************************************************************************
- * Ralink Specific network related constant definitions
- ***********************************************************************************/
-#define MIN_NET_DEVICE_FOR_AID 0x00 //0x00~0x3f
-#define MIN_NET_DEVICE_FOR_MBSSID 0x00 //0x00,0x10,0x20,0x30
-#define MIN_NET_DEVICE_FOR_WDS 0x10 //0x40,0x50,0x60,0x70
-#define MIN_NET_DEVICE_FOR_APCLI 0x20
-#define MIN_NET_DEVICE_FOR_MESH 0x30
-#ifdef CONFIG_STA_SUPPORT
-#define MIN_NET_DEVICE_FOR_DLS 0x40
-#endif // CONFIG_STA_SUPPORT //
-#define NET_DEVICE_REAL_IDX_MASK 0x0f // for each operation mode, we maximum support 15 entities.
-
-
-#ifdef CONFIG_STA_SUPPORT
-#define NDIS_PACKET_TYPE_DIRECTED 0
-#define NDIS_PACKET_TYPE_MULTICAST 1
-#define NDIS_PACKET_TYPE_BROADCAST 2
-#define NDIS_PACKET_TYPE_ALL_MULTICAST 3
-#define NDIS_PACKET_TYPE_PROMISCUOUS 4
-#endif // CONFIG_STA_SUPPORT //
-
-
-/***********************************************************************************
- * OS signaling related constant definitions
- ***********************************************************************************/
-
-
-/***********************************************************************************
- * OS file operation related data structure definitions
- ***********************************************************************************/
-typedef struct file* RTMP_OS_FD;
-
-typedef struct _RTMP_OS_FS_INFO_
-{
- int fsuid;
- int fsgid;
- mm_segment_t fs;
-}RTMP_OS_FS_INFO;
-
-#define IS_FILE_OPEN_ERR(_fd) IS_ERR((_fd))
-
-
-/***********************************************************************************
- * OS semaphore related data structure and definitions
- ***********************************************************************************/
-struct os_lock {
- spinlock_t lock;
- unsigned long flags;
-};
-
-typedef spinlock_t NDIS_SPIN_LOCK;
-
-//
-// spin_lock enhanced for Nested spin lock
-//
-#define NdisAllocateSpinLock(__lock) \
-{ \
- spin_lock_init((spinlock_t *)(__lock)); \
-}
-
-#define NdisFreeSpinLock(lock) \
- do{}while(0)
-
-
-#define RTMP_SEM_LOCK(__lock) \
-{ \
- spin_lock_bh((spinlock_t *)(__lock)); \
-}
-
-#define RTMP_SEM_UNLOCK(__lock) \
-{ \
- spin_unlock_bh((spinlock_t *)(__lock)); \
-}
-
-
-// sample, use semaphore lock to replace IRQ lock, 2007/11/15
-#define RTMP_IRQ_LOCK(__lock, __irqflags) \
-{ \
- __irqflags = 0; \
- spin_lock_bh((spinlock_t *)(__lock)); \
- pAd->irq_disabled |= 1; \
-}
-
-#define RTMP_IRQ_UNLOCK(__lock, __irqflag) \
-{ \
- pAd->irq_disabled &= 0; \
- spin_unlock_bh((spinlock_t *)(__lock)); \
-}
-
-#define RTMP_INT_LOCK(__lock, __irqflags) \
-{ \
- spin_lock_irqsave((spinlock_t *)__lock, __irqflags); \
-}
-
-#define RTMP_INT_UNLOCK(__lock, __irqflag) \
-{ \
- spin_unlock_irqrestore((spinlock_t *)(__lock), ((unsigned long)__irqflag)); \
-}
-
-#define NdisAcquireSpinLock RTMP_SEM_LOCK
-#define NdisReleaseSpinLock RTMP_SEM_UNLOCK
-
-#ifndef wait_event_interruptible_timeout
-#define __wait_event_interruptible_timeout(wq, condition, ret) \
-do { \
- wait_queue_t __wait; \
- init_waitqueue_entry(&__wait, current); \
- add_wait_queue(&wq, &__wait); \
- for (;;) { \
- set_current_state(TASK_INTERRUPTIBLE); \
- if (condition) \
- break; \
- if (!signal_pending(current)) { \
- ret = schedule_timeout(ret); \
- if (!ret) \
- break; \
- continue; \
- } \
- ret = -ERESTARTSYS; \
- break; \
- } \
- current->state = TASK_RUNNING; \
- remove_wait_queue(&wq, &__wait); \
-} while (0)
-
-#define wait_event_interruptible_timeout(wq, condition, timeout) \
-({ \
- long __ret = timeout; \
- if (!(condition)) \
- __wait_event_interruptible_timeout(wq, condition, __ret); \
- __ret; \
-})
-#endif
-
-#define RTMP_SEM_EVENT_INIT_LOCKED(_pSema) sema_init((_pSema), 0)
-#define RTMP_SEM_EVENT_INIT(_pSema) sema_init((_pSema), 1)
-#define RTMP_SEM_EVENT_WAIT(_pSema, _status) ((_status) = down_interruptible((_pSema)))
-#define RTMP_SEM_EVENT_UP(_pSema) up(_pSema)
-
-#ifdef KTHREAD_SUPPORT
-#define RTMP_WAIT_EVENT_INTERRUPTIBLE(_pAd, _pTask) \
-{ \
- wait_event_interruptible(_pTask->kthread_q, \
- _pTask->kthread_running || kthread_should_stop()); \
- _pTask->kthread_running = FALSE; \
- if (kthread_should_stop()) \
- { \
- RTMP_SET_FLAG(_pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS); \
- break; \
- } \
-}
-#endif
-
-#ifdef KTHREAD_SUPPORT
-#define WAKE_UP(_pTask) \
- do{ \
- if ((_pTask)->kthread_task) \
- { \
- (_pTask)->kthread_running = TRUE; \
- wake_up(&(_pTask)->kthread_q); \
- } \
- }while(0)
-#endif
-
-/***********************************************************************************
- * OS Memory Access related data structure and definitions
- ***********************************************************************************/
-#define MEM_ALLOC_FLAG (GFP_ATOMIC) //(GFP_DMA | GFP_ATOMIC)
-
-#define NdisMoveMemory(Destination, Source, Length) memmove(Destination, Source, Length)
-#define NdisCopyMemory(Destination, Source, Length) memcpy(Destination, Source, Length)
-#define NdisZeroMemory(Destination, Length) memset(Destination, 0, Length)
-#define NdisFillMemory(Destination, Length, Fill) memset(Destination, Fill, Length)
-#define NdisCmpMemory(Destination, Source, Length) memcmp(Destination, Source, Length)
-#define NdisEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
-#define RTMPEqualMemory(Source1, Source2, Length) (!memcmp(Source1, Source2, Length))
-
-#define MlmeAllocateMemory(_pAd, _ppVA) os_alloc_mem(_pAd, _ppVA, MGMT_DMA_BUFFER_SIZE)
-#define MlmeFreeMemory(_pAd, _pVA) os_free_mem(_pAd, _pVA)
-
-#define COPY_MAC_ADDR(Addr1, Addr2) memcpy((Addr1), (Addr2), MAC_ADDR_LEN)
-
-
-/***********************************************************************************
- * OS task related data structure and definitions
- ***********************************************************************************/
-#define RTMP_OS_MGMT_TASK_FLAGS CLONE_VM
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-typedef struct pid * THREAD_PID;
-#define THREAD_PID_INIT_VALUE NULL
-#define GET_PID(_v) find_get_pid((_v))
-#define GET_PID_NUMBER(_v) pid_nr((_v))
-#define CHECK_PID_LEGALITY(_pid) if (pid_nr((_pid)) >= 0)
-#define KILL_THREAD_PID(_A, _B, _C) kill_pid((_A), (_B), (_C))
-#else
-typedef pid_t THREAD_PID;
-#define THREAD_PID_INIT_VALUE -1
-#define GET_PID(_v) (_v)
-#define GET_PID_NUMBER(_v) (_v)
-#define CHECK_PID_LEGALITY(_pid) if ((_pid) >= 0)
-#define KILL_THREAD_PID(_A, _B, _C) kill_proc((_A), (_B), (_C))
-#endif
-
-typedef struct tasklet_struct RTMP_NET_TASK_STRUCT;
-typedef struct tasklet_struct *PRTMP_NET_TASK_STRUCT;
-
-
-/***********************************************************************************
- * Timer related definitions and data structures.
- **********************************************************************************/
-#define OS_HZ HZ
-
-typedef struct timer_list NDIS_MINIPORT_TIMER;
-typedef struct timer_list RTMP_OS_TIMER;
-typedef void (*TIMER_FUNCTION)(unsigned long);
-
-
-#define OS_WAIT(_time) \
-{ int _i; \
- long _loop = ((_time)/(1000/OS_HZ)) > 0 ? ((_time)/(1000/OS_HZ)) : 1;\
- wait_queue_head_t _wait; \
- init_waitqueue_head(&_wait); \
- for (_i=0; _i<(_loop); _i++) \
- wait_event_interruptible_timeout(_wait, 0, ONE_TICK); }
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#define RTMP_TIME_AFTER(a,b) \
- (typecheck(unsigned long, (unsigned long)a) && \
- typecheck(unsigned long, (unsigned long)b) && \
- ((long)(b) - (long)(a) < 0))
-
-#define RTMP_TIME_AFTER_EQ(a,b) \
- (typecheck(unsigned long, (unsigned long)a) && \
- typecheck(unsigned long, (unsigned long)b) && \
- ((long)(a) - (long)(b) >= 0))
-#define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a)
-#else
-#define typecheck(type,x) \
-({ type __dummy; \
- typeof(x) __dummy2; \
- (void)(&__dummy == &__dummy2); \
- 1; \
-})
-#define RTMP_TIME_AFTER_EQ(a,b) \
- (typecheck(unsigned long, (unsigned long)a) && \
- typecheck(unsigned long, (unsigned long)b) && \
- ((long)(a) - (long)(b) >= 0))
-#define RTMP_TIME_BEFORE(a,b) RTMP_TIME_AFTER_EQ(b,a)
-#define RTMP_TIME_AFTER(a,b) time_after(a, b)
-#endif
-
-#define ONE_TICK 1
-
-static inline void NdisGetSystemUpTime(ULONG *time)
-{
- *time = jiffies;
-}
-
-
-/***********************************************************************************
- * OS specific cookie data structure binding to RTMP_ADAPTER
- ***********************************************************************************/
-
-struct os_cookie {
-#ifdef RTMP_MAC_PCI
- struct pci_dev *pci_dev;
- struct pci_dev *parent_pci_dev;
- USHORT DeviceID;
- dma_addr_t pAd_pa;
-#endif // RTMP_MAC_PCI //
-
-
- RTMP_NET_TASK_STRUCT rx_done_task;
- RTMP_NET_TASK_STRUCT mgmt_dma_done_task;
- RTMP_NET_TASK_STRUCT ac0_dma_done_task;
- RTMP_NET_TASK_STRUCT ac1_dma_done_task;
- RTMP_NET_TASK_STRUCT ac2_dma_done_task;
- RTMP_NET_TASK_STRUCT ac3_dma_done_task;
- /*RTMP_NET_TASK_STRUCT hcca_dma_done_task;*/
- RTMP_NET_TASK_STRUCT tbtt_task;
-#ifdef RTMP_MAC_PCI
- RTMP_NET_TASK_STRUCT fifo_statistic_full_task;
-#endif // RTMP_MAC_PCI //
-
-
-
- unsigned long apd_pid; //802.1x daemon pid
- INT ioctl_if_type;
- INT ioctl_if;
-};
-
-typedef struct os_cookie * POS_COOKIE;
-
-
-
-/***********************************************************************************
- * OS debugging and printing related definitions and data structure
- ***********************************************************************************/
-#define PRINT_MAC(addr) \
- addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]
-
-#ifdef DBG
-extern ULONG RTDebugLevel;
-
-#define DBGPRINT_RAW(Level, Fmt) \
-do{ \
- if (Level <= RTDebugLevel) \
- { \
- printk Fmt; \
- } \
-}while(0)
-
-#define DBGPRINT(Level, Fmt) DBGPRINT_RAW(Level, Fmt)
-
-
-#define DBGPRINT_ERR(Fmt) \
-{ \
- printk("ERROR!!! "); \
- printk Fmt; \
-}
-
-#define DBGPRINT_S(Status, Fmt) \
-{ \
- printk Fmt; \
-}
-#else
-#define DBGPRINT(Level, Fmt)
-#define DBGPRINT_RAW(Level, Fmt)
-#define DBGPRINT_S(Status, Fmt)
-#define DBGPRINT_ERR(Fmt)
-#endif
-
-#undef ASSERT
-#define ASSERT(x) \
-{ \
- if (!(x)) \
- { \
- printk(KERN_WARNING __FILE__ ":%d assert " #x "failed\n", __LINE__); \
- } \
-}
-
-void hex_dump(char *str, unsigned char *pSrcBufVA, unsigned int SrcBufLen);
-
-
-/*********************************************************************************************************
- The following code are not revised, temporary put it here.
- *********************************************************************************************************/
-
-
-/***********************************************************************************
- * Device DMA Access related definitions and data structures.
- **********************************************************************************/
-#ifdef RTMP_MAC_PCI
-dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, int sd_idx, int direction);
-void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, int direction);
-
-#define PCI_MAP_SINGLE(_handle, _ptr, _size, _sd_idx, _dir) \
- linux_pci_map_single(_handle, _ptr, _size, _sd_idx, _dir)
-
-#define PCI_UNMAP_SINGLE(_handle, _ptr, _size, _dir) \
- linux_pci_unmap_single(_handle, _ptr, _size, _dir)
-
-#define PCI_ALLOC_CONSISTENT(_pci_dev, _size, _ptr) \
- pci_alloc_consistent(_pci_dev, _size, _ptr)
-
-#define PCI_FREE_CONSISTENT(_pci_dev, _size, _virtual_addr, _physical_addr) \
- pci_free_consistent(_pci_dev, _size, _virtual_addr, _physical_addr)
-
-#define DEV_ALLOC_SKB(_length) \
- dev_alloc_skb(_length)
-#endif // RTMP_MAC_PCI //
-
-
-
-/*
- * ULONG
- * RTMP_GetPhysicalAddressLow(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
- */
-#define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress)
-
-/*
- * ULONG
- * RTMP_GetPhysicalAddressHigh(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
- */
-#define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0)
-
-/*
- * VOID
- * RTMP_SetPhysicalAddressLow(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
- * IN ULONG Value);
- */
-#define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \
- PhysicalAddress = Value;
-
-/*
- * VOID
- * RTMP_SetPhysicalAddressHigh(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
- * IN ULONG Value);
- */
-#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
-
-#define NdisMIndicateStatus(_w, _x, _y, _z)
-
-
-
-/***********************************************************************************
- * Device Register I/O Access related definitions and data structures.
- **********************************************************************************/
-#ifdef RTMP_MAC_PCI
-#if defined(INF_TWINPASS) || defined(INF_DANUBE) || defined(IKANOS_VX_1X0)
-//Patch for ASIC turst read/write bug, needs to remove after metel fix
-#define RTMP_IO_READ32(_A, _R, _pV) \
-{ \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \
- (*_pV = SWAP32(*((UINT32 *)(_pV)))); \
- } \
-}
-
-#define RTMP_IO_READ8(_A, _R, _pV) \
-{ \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
- (*_pV = readb((void *)((_A)->CSRBaseAddress + (_R)))); \
-}
-
-#define RTMP_IO_WRITE32(_A, _R, _V) \
-{ \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- UINT32 _Val; \
- _Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- _Val = SWAP32(_V); \
- writel(_Val, (void *)((_A)->CSRBaseAddress + (_R))); \
- } \
-}
-
-#define RTMP_IO_WRITE8(_A, _R, _V) \
-{ \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writeb((_V), (PUCHAR)((_A)->CSRBaseAddress + (_R))); \
-}
-
-#define RTMP_IO_WRITE16(_A, _R, _V) \
-{ \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writew(SWAP16((_V)), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \
-}
-#else
-//Patch for ASIC turst read/write bug, needs to remove after metel fix
-#define RTMP_IO_READ32(_A, _R, _pV) \
-{ \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \
- } \
- else \
- *_pV = 0; \
-}
-
-#define RTMP_IO_FORCE_READ32(_A, _R, _pV) \
-{ \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + (_R)))); \
-}
-
-#define RTMP_IO_READ8(_A, _R, _pV) \
-{ \
- (*_pV = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0))); \
- (*_pV = readb((void *)((_A)->CSRBaseAddress + (_R)))); \
-}
-
-#define RTMP_IO_WRITE32(_A, _R, _V) \
-{ \
- if ((_A)->bPCIclkOff == FALSE) \
- { \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writel((_V), (void *)((_A)->CSRBaseAddress + (_R))); \
- } \
-}
-
-#define RTMP_IO_FORCE_WRITE32(_A, _R, _V) \
-{ \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writel(_V, (void *)((_A)->CSRBaseAddress + (_R))); \
-}
-
-
-
-#if defined(BRCM_6358) || defined(RALINK_2880) || defined(RALINK_3052)
-#define RTMP_IO_WRITE8(_A, _R, _V) \
-{ \
- ULONG Val; \
- UCHAR _i; \
- _i = ((_R) & 0x3); \
- Val = readl((void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
- Val = Val & (~(0x000000ff << ((_i)*8))); \
- Val = Val | ((ULONG)(_V) << ((_i)*8)); \
- writel((Val), (void *)((_A)->CSRBaseAddress + ((_R) - _i))); \
-}
-#else
-#define RTMP_IO_WRITE8(_A, _R, _V) \
-{ \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writeb((_V), (PUCHAR)((_A)->CSRBaseAddress + (_R))); \
-}
-#endif // #if defined(BRCM_6358) || defined(RALINK_2880) //
-
-#define RTMP_IO_WRITE16(_A, _R, _V) \
-{ \
- UINT Val; \
- Val = readl((void *)((_A)->CSRBaseAddress + MAC_CSR0)); \
- writew((_V), (PUSHORT)((_A)->CSRBaseAddress + (_R))); \
-}
-#endif // #if defined(INF_TWINPASS) || defined(INF_DANUBE) || defined(IKANOS_VX_1X0) //
-#endif // RTMP_MAC_PCI //
-
-
-
-/***********************************************************************************
- * Network Related data structure and marco definitions
- ***********************************************************************************/
-#define PKTSRC_NDIS 0x7f
-#define PKTSRC_DRIVER 0x0f
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
-#define RTMP_OS_NETDEV_SET_PRIV(_pNetDev, _pPriv) ((_pNetDev)->priv = (_pPriv))
-#define RTMP_OS_NETDEV_GET_PRIV(_pNetDev) ((_pNetDev)->priv)
-#else
-#define RTMP_OS_NETDEV_SET_PRIV(_pNetDev, _pPriv) ((_pNetDev)->ml_priv = (_pPriv))
-#define RTMP_OS_NETDEV_GET_PRIV(_pNetDev) ((_pNetDev)->ml_priv)
-#endif
-#define RTMP_OS_NETDEV_GET_DEVNAME(_pNetDev) ((_pNetDev)->name)
-#define RTMP_OS_NETDEV_GET_PHYADDR(_PNETDEV) ((_PNETDEV)->dev_addr)
-
-#define RTMP_OS_NETDEV_START_QUEUE(_pNetDev) netif_start_queue((_pNetDev))
-#define RTMP_OS_NETDEV_STOP_QUEUE(_pNetDev) netif_stop_queue((_pNetDev))
-#define RTMP_OS_NETDEV_WAKE_QUEUE(_pNetDev) netif_wake_queue((_pNetDev))
-#define RTMP_OS_NETDEV_CARRIER_OFF(_pNetDev) netif_carrier_off((_pNetDev))
-
-#define QUEUE_ENTRY_TO_PACKET(pEntry) \
- (PNDIS_PACKET)(pEntry)
-
-#define PACKET_TO_QUEUE_ENTRY(pPacket) \
- (PQUEUE_ENTRY)(pPacket)
-
-#ifdef CONFIG_5VT_ENHANCE
-#define BRIDGE_TAG 0x35564252 // depends on 5VT define in br_input.c
-#endif
-
-#define GET_SG_LIST_FROM_PACKET(_p, _sc) \
- rt_get_sg_list_from_packet(_p, _sc)
-
-#define RELEASE_NDIS_PACKET(_pAd, _pPacket, _Status) \
-{ \
- RTMPFreeNdisPacket(_pAd, _pPacket); \
-}
-
-/*
- * packet helper
- * - convert internal rt packet to os packet or
- * os packet to rt packet
- */
-#define RTPKT_TO_OSPKT(_p) ((struct sk_buff *)(_p))
-#define OSPKT_TO_RTPKT(_p) ((PNDIS_PACKET)(_p))
-
-#define GET_OS_PKT_DATAPTR(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->data)
-#define SET_OS_PKT_DATAPTR(_pkt, _dataPtr) \
- (RTPKT_TO_OSPKT(_pkt)->data) = (_dataPtr)
-
-#define GET_OS_PKT_LEN(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->len)
-#define SET_OS_PKT_LEN(_pkt, _len) \
- (RTPKT_TO_OSPKT(_pkt)->len) = (_len)
-
-#define GET_OS_PKT_DATATAIL(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->tail)
-#define SET_OS_PKT_DATATAIL(_pkt, _start, _len) \
- ((RTPKT_TO_OSPKT(_pkt))->tail) = (PUCHAR)((_start) + (_len))
-
-#define GET_OS_PKT_HEAD(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->head)
-
-#define GET_OS_PKT_END(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->end)
-
-#define GET_OS_PKT_NETDEV(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->dev)
-#define SET_OS_PKT_NETDEV(_pkt, _pNetDev) \
- (RTPKT_TO_OSPKT(_pkt)->dev) = (_pNetDev)
-
-#define GET_OS_PKT_TYPE(_pkt) \
- (RTPKT_TO_OSPKT(_pkt))
-
-#define GET_OS_PKT_NEXT(_pkt) \
- (RTPKT_TO_OSPKT(_pkt)->next)
-
-
-#define OS_PKT_CLONED(_pkt) skb_cloned(RTPKT_TO_OSPKT(_pkt))
-
-#define OS_NTOHS(_Val) \
- (ntohs(_Val))
-#define OS_HTONS(_Val) \
- (htons(_Val))
-#define OS_NTOHL(_Val) \
- (ntohl(_Val))
-#define OS_HTONL(_Val) \
- (htonl(_Val))
-
-#define CB_OFF 10
-
-// User Priority
-#define RTMP_SET_PACKET_UP(_p, _prio) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0] = _prio)
-#define RTMP_GET_PACKET_UP(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+0])
-
-// Fragment #
-#define RTMP_SET_PACKET_FRAGMENTS(_p, _num) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+1] = _num)
-#define RTMP_GET_PACKET_FRAGMENTS(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+1])
-
-// 0x0 ~0x7f: TX to AP's own BSS which has the specified AID. if AID>127, set bit 7 in RTMP_SET_PACKET_EMACTAB too.
-//(this value also as MAC(on-chip WCID) table index)
-// 0x80~0xff: TX to a WDS link. b0~6: WDS index
-#define RTMP_SET_PACKET_WCID(_p, _wdsidx) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2] = _wdsidx)
-#define RTMP_GET_PACKET_WCID(_p) ((UCHAR)(RTPKT_TO_OSPKT(_p)->cb[CB_OFF+2]))
-
-// 0xff: PKTSRC_NDIS, others: local TX buffer index. This value affects how to a packet
-#define RTMP_SET_PACKET_SOURCE(_p, _pktsrc) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+3] = _pktsrc)
-#define RTMP_GET_PACKET_SOURCE(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+3])
-
-// RTS/CTS-to-self protection method
-#define RTMP_SET_PACKET_RTS(_p, _num) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+4] = _num)
-#define RTMP_GET_PACKET_RTS(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+4])
-// see RTMP_S(G)ET_PACKET_EMACTAB
-
-// TX rate index
-#define RTMP_SET_PACKET_TXRATE(_p, _rate) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+5] = _rate)
-#define RTMP_GET_PACKET_TXRATE(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+5])
-
-// From which Interface
-#define RTMP_SET_PACKET_IF(_p, _ifdx) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+6] = _ifdx)
-#define RTMP_GET_PACKET_IF(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+6])
-#define RTMP_SET_PACKET_NET_DEVICE_MBSSID(_p, _bss) RTMP_SET_PACKET_IF((_p), (_bss))
-#define RTMP_SET_PACKET_NET_DEVICE_WDS(_p, _bss) RTMP_SET_PACKET_IF((_p), ((_bss) + MIN_NET_DEVICE_FOR_WDS))
-#define RTMP_SET_PACKET_NET_DEVICE_APCLI(_p, _idx) RTMP_SET_PACKET_IF((_p), ((_idx) + MIN_NET_DEVICE_FOR_APCLI))
-#define RTMP_SET_PACKET_NET_DEVICE_MESH(_p, _idx) RTMP_SET_PACKET_IF((_p), ((_idx) + MIN_NET_DEVICE_FOR_MESH))
-#define RTMP_GET_PACKET_NET_DEVICE_MBSSID(_p) RTMP_GET_PACKET_IF((_p))
-#define RTMP_GET_PACKET_NET_DEVICE(_p) RTMP_GET_PACKET_IF((_p))
-
-#define RTMP_SET_PACKET_MOREDATA(_p, _morebit) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7] = _morebit)
-#define RTMP_GET_PACKET_MOREDATA(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+7])
-
-
-
-
-
-//
-// Sepcific Pakcet Type definition
-//
-#define RTMP_PACKET_SPECIFIC_CB_OFFSET 11
-
-#define RTMP_PACKET_SPECIFIC_DHCP 0x01
-#define RTMP_PACKET_SPECIFIC_EAPOL 0x02
-#define RTMP_PACKET_SPECIFIC_IPV4 0x04
-#define RTMP_PACKET_SPECIFIC_WAI 0x08
-#define RTMP_PACKET_SPECIFIC_VLAN 0x10
-#define RTMP_PACKET_SPECIFIC_LLCSNAP 0x20
-
-//Specific
-#define RTMP_SET_PACKET_SPECIFIC(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] = _flg)
-
-//DHCP
-#define RTMP_SET_PACKET_DHCP(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_DHCP); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_DHCP); \
- }while(0)
-#define RTMP_GET_PACKET_DHCP(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_DHCP)
-
-//EAPOL
-#define RTMP_SET_PACKET_EAPOL(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_EAPOL); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_EAPOL); \
- }while(0)
-#define RTMP_GET_PACKET_EAPOL(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_EAPOL)
-
-//WAI
-#define RTMP_SET_PACKET_WAI(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_WAI); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_WAI); \
- }while(0)
-#define RTMP_GET_PACKET_WAI(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_WAI)
-
-#define RTMP_GET_PACKET_LOWRATE(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & (RTMP_PACKET_SPECIFIC_EAPOL | RTMP_PACKET_SPECIFIC_DHCP | RTMP_PACKET_SPECIFIC_WAI))
-
-//VLAN
-#define RTMP_SET_PACKET_VLAN(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_VLAN); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_VLAN); \
- }while(0)
-#define RTMP_GET_PACKET_VLAN(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_VLAN)
-
-//LLC/SNAP
-#define RTMP_SET_PACKET_LLCSNAP(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_LLCSNAP); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_LLCSNAP); \
- }while(0)
-
-#define RTMP_GET_PACKET_LLCSNAP(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_LLCSNAP)
-
-// IP
-#define RTMP_SET_PACKET_IPV4(_p, _flg) \
- do{ \
- if (_flg) \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) |= (RTMP_PACKET_SPECIFIC_IPV4); \
- else \
- (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11]) &= (!RTMP_PACKET_SPECIFIC_IPV4); \
- }while(0)
-
-#define RTMP_GET_PACKET_IPV4(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+11] & RTMP_PACKET_SPECIFIC_IPV4)
-
-
-// If this flag is set, it indicates that this EAPoL frame MUST be clear.
-#define RTMP_SET_PACKET_CLEAR_EAP_FRAME(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12] = _flg)
-#define RTMP_GET_PACKET_CLEAR_EAP_FRAME(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+12])
-
-
-
-/* use bit3 of cb[CB_OFF+16] */
-
-#define RTMP_SET_PACKET_5VT(_p, _flg) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22] = _flg)
-#define RTMP_GET_PACKET_5VT(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+22])
-
-#ifdef INF_AMAZON_SE
-/* [CB_OFF+28], 1B, Iverson patch for WMM A5-T07 ,WirelessStaToWirelessSta do not bulk out aggregate */
-#define RTMP_SET_PACKET_NOBULKOUT(_p, _morebit) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+28] = _morebit)
-#define RTMP_GET_PACKET_NOBULKOUT(_p) (RTPKT_TO_OSPKT(_p)->cb[CB_OFF+28])
-#endif // INF_AMAZON_SE //
-/* Max skb->cb = 48B = [CB_OFF+38] */
-
-
-
-/***********************************************************************************
- * Other function prototypes definitions
- ***********************************************************************************/
-void RTMP_GetCurrentSystemTime(LARGE_INTEGER *time);
-int rt28xx_packet_xmit(struct sk_buff *skb);
-
-
-void FlashWrite(UCHAR * p, ULONG a, ULONG b);
-void FlashRead(UCHAR * p, ULONG a, ULONG b);
-
-#if LINUX_VERSION_CODE <= 0x20402 // Red Hat 7.1
-struct net_device *alloc_netdev(int sizeof_priv, const char *mask, void (*setup)(struct net_device *));
-#endif // LINUX_VERSION_CODE //
-
-
-#ifdef RTMP_MAC_PCI
-/* function declarations */
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
-#define IRQ_HANDLE_TYPE irqreturn_t
-#else
-#define IRQ_HANDLE_TYPE void
-#endif
-
-IRQ_HANDLE_TYPE
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19))
-rt2860_interrupt(int irq, void *dev_instance);
-#else
-rt2860_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
-#endif
-
-#endif // RTMP_MAC_PCI //
-
-INT rt28xx_ioctl(
- IN PNET_DEV net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd);
-
-
-#ifdef CONFIG_STA_SUPPORT
-INT rt28xx_sta_ioctl(
- IN PNET_DEV net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd);
-#endif // CONFIG_STA_SUPPORT //
-
-extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char *buf);
-extern int ra_mtd_read(int num, loff_t from, size_t len, u_char *buf);
-
-#endif // __RT_LINUX_H__ //
diff --git a/drivers/staging/rt3090/rt_main_dev.c b/drivers/staging/rt3090/rt_main_dev.c
deleted file mode 100644
index 3307a5f36847..000000000000
--- a/drivers/staging/rt3090/rt_main_dev.c
+++ /dev/null
@@ -1,897 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt_main_dev.c
-
- Abstract:
- Create and register network interface.
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "rt_config.h"
-
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-UINT32 CW_MAX_IN_BITS;
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-/*---------------------------------------------------------------------*/
-/* Private Variables Used */
-/*---------------------------------------------------------------------*/
-
-PSTRING mac = ""; // default 00:00:00:00:00:00
-PSTRING hostname = ""; // default CMPC
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,12)
-MODULE_PARM (mac, "s");
-#else
-module_param (mac, charp, 0);
-#endif
-MODULE_PARM_DESC (mac, "rt28xx: wireless mac addr");
-
-
-/*---------------------------------------------------------------------*/
-/* Prototypes of Functions Used */
-/*---------------------------------------------------------------------*/
-
-// public function prototype
-int rt28xx_close(IN struct net_device *net_dev);
-int rt28xx_open(struct net_device *net_dev);
-
-// private function prototype
-static INT rt28xx_send_packets(IN struct sk_buff *skb_p, IN struct net_device *net_dev);
-
-
-static struct net_device_stats *RT28xx_get_ether_stats(
- IN struct net_device *net_dev);
-
-/*
-========================================================================
-Routine Description:
- Close raxx interface.
-
-Arguments:
- *net_dev the raxx interface pointer
-
-Return Value:
- 0 Open OK
- otherwise Open Fail
-
-Note:
- 1. if open fail, kernel will not call the close function.
- 2. Free memory for
- (1) Mlme Memory Handler: MlmeHalt()
- (2) TX & RX: RTMPFreeTxRxRingMemory()
- (3) BA Reordering: ba_reordering_resource_release()
-========================================================================
-*/
-int MainVirtualIF_close(IN struct net_device *net_dev)
-{
- RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
-
- // Sanity check for pAd
- if (pAd == NULL)
- return 0; // close ok
-
- netif_carrier_off(pAd->net_dev);
- netif_stop_queue(pAd->net_dev);
-
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- BOOLEAN Cancelled;
-#ifdef QOS_DLS_SUPPORT
- // send DLS-TEAR_DOWN message,
- if (pAd->CommonCfg.bDLSCapable)
- {
- UCHAR i;
-
- // tear down local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- }
- }
-
- // tear down peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- }
- }
- RTMP_MLME_HANDLER(pAd);
- }
-#endif // QOS_DLS_SUPPORT //
-
- if (INFRA_ON(pAd) &&
- (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)))
- {
- MLME_DISASSOC_REQ_STRUCT DisReq;
- MLME_QUEUE_ELEM *MsgElem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
-
- if (MsgElem)
- {
- COPY_MAC_ADDR(DisReq.Addr, pAd->CommonCfg.Bssid);
- DisReq.Reason = REASON_DEAUTH_STA_LEAVING;
-
- MsgElem->Machine = ASSOC_STATE_MACHINE;
- MsgElem->MsgType = MT2_MLME_DISASSOC_REQ;
- MsgElem->MsgLen = sizeof(MLME_DISASSOC_REQ_STRUCT);
- NdisMoveMemory(MsgElem->Msg, &DisReq, sizeof(MLME_DISASSOC_REQ_STRUCT));
-
- // Prevent to connect AP again in STAMlmePeriodicExec
- pAd->MlmeAux.AutoReconnectSsidLen= 32;
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
- MlmeDisassocReqAction(pAd, MsgElem);
- kfree(MsgElem);
- }
-
- RTMPusecDelay(1000);
- }
-
- RTMPCancelTimer(&pAd->StaCfg.StaQuickResponeForRateUpTimer, &Cancelled);
- RTMPCancelTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, &Cancelled);
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- // send wireless event to wpa_supplicant for infroming interface down.
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_INTERFACE_DOWN, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-
- }
-#endif // CONFIG_STA_SUPPORT //
-
- VIRTUAL_IF_DOWN(pAd);
-
- RT_MOD_DEC_USE_COUNT();
-
- return 0; // close ok
-}
-
-/*
-========================================================================
-Routine Description:
- Open raxx interface.
-
-Arguments:
- *net_dev the raxx interface pointer
-
-Return Value:
- 0 Open OK
- otherwise Open Fail
-
-Note:
- 1. if open fail, kernel will not call the close function.
- 2. Free memory for
- (1) Mlme Memory Handler: MlmeHalt()
- (2) TX & RX: RTMPFreeTxRxRingMemory()
- (3) BA Reordering: ba_reordering_resource_release()
-========================================================================
-*/
-int MainVirtualIF_open(IN struct net_device *net_dev)
-{
- RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
-
- // Sanity check for pAd
- if (pAd == NULL)
- return 0; // close ok
-
- if (VIRTUAL_IF_UP(pAd) != 0)
- return -1;
-
- // increase MODULE use count
- RT_MOD_INC_USE_COUNT();
-
- netif_start_queue(net_dev);
- netif_carrier_on(net_dev);
- netif_wake_queue(net_dev);
-
- return 0;
-}
-
-/*
-========================================================================
-Routine Description:
- Close raxx interface.
-
-Arguments:
- *net_dev the raxx interface pointer
-
-Return Value:
- 0 Open OK
- otherwise Open Fail
-
-Note:
- 1. if open fail, kernel will not call the close function.
- 2. Free memory for
- (1) Mlme Memory Handler: MlmeHalt()
- (2) TX & RX: RTMPFreeTxRxRingMemory()
- (3) BA Reordering: ba_reordering_resource_release()
-========================================================================
-*/
-int rt28xx_close(IN PNET_DEV dev)
-{
- struct net_device * net_dev = (struct net_device *)dev;
- RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
- BOOLEAN Cancelled;
- UINT32 i = 0;
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("===> rt28xx_close\n"));
-
- Cancelled = FALSE;
- // Sanity check for pAd
- if (pAd == NULL)
- return 0; // close ok
-
-
-
-#ifdef WDS_SUPPORT
- WdsDown(pAd);
-#endif // WDS_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-#ifdef RTMP_MAC_PCI
- RTMPPCIeLinkCtrlValueRestore(pAd, RESTORE_CLOSE);
-#endif // RTMP_MAC_PCI //
-
- // If dirver doesn't wake up firmware here,
- // NICLoadFirmware will hang forever when interface is up again.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- AsicForceWakeup(pAd, TRUE);
- }
-
-
- MlmeRadioOff(pAd);
-#ifdef RTMP_MAC_PCI
- pAd->bPCIclkOff = FALSE;
-#endif // RTMP_MAC_PCI //
- }
-#endif // CONFIG_STA_SUPPORT //
-
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
-
- for (i = 0 ; i < NUM_OF_TX_RING; i++)
- {
- while (pAd->DeQueueRunning[i] == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Waiting for TxQueue[%d] done..........\n", i));
- RTMPusecDelay(1000);
- }
- }
-
-
-
- // Stop Mlme state machine
- MlmeHalt(pAd);
-
- // Close net tasklets
- RtmpNetTaskExit(pAd);
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- MacTableReset(pAd);
- }
-#endif // CONFIG_STA_SUPPORT //
-
-
- MeasureReqTabExit(pAd);
- TpcReqTabExit(pAd);
-
-
- // Close kernel threads
- RtmpMgmtTaskExit(pAd);
-
-#ifdef RTMP_MAC_PCI
- {
- BOOLEAN brc;
- // ULONG Value;
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
- {
- RTMP_ASIC_INTERRUPT_DISABLE(pAd);
- }
-
- // Receive packets to clear DMA index after disable interrupt.
- //RTMPHandleRxDoneInterrupt(pAd);
- // put to radio off to save power when driver unload. After radiooff, can't write /read register. So need to finish all
- // register access before Radio off.
-
-
- brc=RT28xxPciAsicRadioOff(pAd, RTMP_HALT, 0);
-
-//In solution 3 of 3090F, the bPCIclkOff will be set to TRUE after calling RT28xxPciAsicRadioOff
- pAd->bPCIclkOff = FALSE;
-
- if (brc==FALSE)
- {
- DBGPRINT(RT_DEBUG_ERROR,("%s call RT28xxPciAsicRadioOff fail !!\n", __FUNCTION__));
- }
- }
-
-
-/*
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_ACTIVE))
- {
- RTMP_ASIC_INTERRUPT_DISABLE(pAd);
- }
-
- // Disable Rx, register value supposed will remain after reset
- NICIssueReset(pAd);
-*/
-#endif // RTMP_MAC_PCI //
-
- // Free IRQ
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
-#ifdef RTMP_MAC_PCI
- // Deregister interrupt function
- RTMP_IRQ_RELEASE(net_dev)
-#endif // RTMP_MAC_PCI //
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE);
- }
-
- // Free Ring or USB buffers
- RTMPFreeTxRxRingMemory(pAd);
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS);
-
-#ifdef DOT11_N_SUPPORT
- // Free BA reorder resource
- ba_reordering_resource_release(pAd);
-#endif // DOT11_N_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_START_UP);
-
-/*+++Modify by woody to solve the bulk fail+++*/
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- }
-#endif // CONFIG_STA_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("<=== rt28xx_close\n"));
- return 0; // close ok
-} /* End of rt28xx_close */
-
-
-/*
-========================================================================
-Routine Description:
- Open raxx interface.
-
-Arguments:
- *net_dev the raxx interface pointer
-
-Return Value:
- 0 Open OK
- otherwise Open Fail
-
-Note:
-========================================================================
-*/
-int rt28xx_open(IN PNET_DEV dev)
-{
- struct net_device * net_dev = (struct net_device *)dev;
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
- int retval = 0;
- //POS_COOKIE pObj;
-
-
- // Sanity check for pAd
- if (pAd == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -1;
- }
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
- if (pAd->OpMode == OPMODE_AP)
- {
- CW_MAX_IN_BITS = 6;
- }
- else if (pAd->OpMode == OPMODE_STA)
- {
- CW_MAX_IN_BITS = 10;
- }
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-#if WIRELESS_EXT >= 12
- if (net_dev->priv_flags == INT_MAIN)
- {
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
- if (pAd->OpMode == OPMODE_AP)
- net_dev->wireless_handlers = (struct iw_handler_def *) &rt28xx_ap_iw_handler_def;
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- net_dev->wireless_handlers = (struct iw_handler_def *) &rt28xx_iw_handler_def;
-#endif // CONFIG_STA_SUPPORT //
- }
-#endif // WIRELESS_EXT >= 12 //
-
- // Request interrupt service routine for PCI device
- // register the interrupt routine with the os
- RTMP_IRQ_REQUEST(net_dev);
-
- // Init IRQ parameters stored in pAd
- RTMP_IRQ_INIT(pAd);
-
- // Chip & other init
- if (rt28xx_init(pAd, mac, hostname) == FALSE)
- goto err;
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
- // Enable Interrupt
- RTMP_IRQ_ENABLE(pAd);
-
- // Now Enable RxTx
- RTMPEnableRxTx(pAd);
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_START_UP);
-
- {
- UINT32 reg = 0;
- RTMP_IO_READ32(pAd, 0x1300, &reg); // clear garbage interrupts
- printk("0x1300 = %08x\n", reg);
- }
-
- {
-// u32 reg;
-// UINT8 byte;
-// u16 tmp;
-
-// RTMP_IO_READ32(pAd, XIFS_TIME_CFG, &reg);
-
-// tmp = 0x0805;
-// reg = (reg & 0xffff0000) | tmp;
-// RTMP_IO_WRITE32(pAd, XIFS_TIME_CFG, reg);
-
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef RTMP_MAC_PCI
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- RTMPInitPCIeLinkCtrlValue(pAd);
-#endif // RTMP_MAC_PCI //
-#endif // CONFIG_STA_SUPPORT //
-
- return (retval);
-
-err:
-//+++Add by shiang, move from rt28xx_init() to here.
- RTMP_IRQ_RELEASE(net_dev);
-//---Add by shiang, move from rt28xx_init() to here.
- return (-1);
-} /* End of rt28xx_open */
-
-static const struct net_device_ops rt3090_netdev_ops = {
- .ndo_open = MainVirtualIF_open,
- .ndo_stop = MainVirtualIF_close,
- .ndo_do_ioctl = rt28xx_ioctl,
- .ndo_get_stats = RT28xx_get_ether_stats,
- .ndo_set_mac_address = eth_mac_addr,
- .ndo_change_mtu = eth_change_mtu,
-#ifdef IKANOS_VX_1X0
- .ndo_start_xmit = IKANOS_DataFramesTx,
-#else
- .ndo_start_xmit = rt28xx_send_packets,
-#endif
-};
-
-PNET_DEV RtmpPhyNetDevInit(
- IN RTMP_ADAPTER *pAd,
- IN RTMP_OS_NETDEV_OP_HOOK *pNetDevHook)
-{
- struct net_device *net_dev = NULL;
-// NDIS_STATUS Status;
-
- net_dev = RtmpOSNetDevCreate(pAd, INT_MAIN, 0, sizeof(PRTMP_ADAPTER), INF_MAIN_DEV_NAME);
- if (net_dev == NULL)
- {
- printk("RtmpPhyNetDevInit(): creation failed for main physical net device!\n");
- return NULL;
- }
-
- NdisZeroMemory((unsigned char *)pNetDevHook, sizeof(RTMP_OS_NETDEV_OP_HOOK));
- pNetDevHook->netdev_ops = &rt3090_netdev_ops;
- pNetDevHook->priv_flags = INT_MAIN;
- pNetDevHook->needProtcted = FALSE;
-
- RTMP_OS_NETDEV_SET_PRIV(net_dev, pAd);
- //net_dev->priv = (PVOID)pAd;
- pAd->net_dev = net_dev;
-
-
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
- SET_MODULE_OWNER(net_dev);
-#endif
-
- netif_stop_queue(net_dev);
-
- return net_dev;
-
-}
-
-
-/*
-========================================================================
-Routine Description:
- The entry point for Linux kernel sent packet to our driver.
-
-Arguments:
- sk_buff *skb the pointer refer to a sk_buffer.
-
-Return Value:
- 0
-
-Note:
- This function is the entry point of Tx Path for Os delivery packet to
- our driver. You only can put OS-depened & STA/AP common handle procedures
- in here.
-========================================================================
-*/
-int rt28xx_packet_xmit(struct sk_buff *skb)
-{
- struct net_device *net_dev = skb->dev;
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
- int status = 0;
- PNDIS_PACKET pPacket = (PNDIS_PACKET) skb;
-
- /* RT2870STA does this in RTMPSendPackets() */
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_RESOURCES);
- return 0;
- }
-#endif // RALINK_ATE //
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- // Drop send request since we are in monitor mode
- if (MONITOR_ON(pAd))
- {
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- goto done;
- }
- }
-#endif // CONFIG_STA_SUPPORT //
-
- // EapolStart size is 18
- if (skb->len < 14)
- {
- //printk("bad packet size: %d\n", pkt->len);
- hex_dump("bad packet", skb->data, skb->len);
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- goto done;
- }
-
-
-
- RTMP_SET_PACKET_5VT(pPacket, 0);
-// MiniportMMRequest(pAd, pkt->data, pkt->len);
-#ifdef CONFIG_5VT_ENHANCE
- if (*(int*)(skb->cb) == BRIDGE_TAG) {
- RTMP_SET_PACKET_5VT(pPacket, 1);
- }
-#endif
-
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
-
- STASendPackets((NDIS_HANDLE)pAd, (PPNDIS_PACKET) &pPacket, 1);
- }
-
-#endif // CONFIG_STA_SUPPORT //
-
- status = 0;
-done:
-
- return status;
-}
-
-
-/*
-========================================================================
-Routine Description:
- Send a packet to WLAN.
-
-Arguments:
- skb_p points to our adapter
- dev_p which WLAN network interface
-
-Return Value:
- 0: transmit successfully
- otherwise: transmit fail
-
-Note:
-========================================================================
-*/
-static int rt28xx_send_packets(
- IN struct sk_buff *skb_p,
- IN struct net_device *net_dev)
-{
- RTMP_ADAPTER *pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
-
- if (!(net_dev->flags & IFF_UP))
- {
- RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET)skb_p, NDIS_STATUS_FAILURE);
- return 0;
- }
-
- NdisZeroMemory((PUCHAR)&skb_p->cb[CB_OFF], 15);
- RTMP_SET_PACKET_NET_DEVICE_MBSSID(skb_p, MAIN_MBSSID);
-
- return rt28xx_packet_xmit(skb_p);
-}
-
-
-#if WIRELESS_EXT >= 12
-// This function will be called when query /proc
-struct iw_statistics *rt28xx_get_wireless_stats(
- IN struct net_device *net_dev)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
-
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_get_wireless_stats --->\n"));
-
- pAd->iw_stats.status = 0; // Status - device dependent for now
-
- // link quality
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- pAd->iw_stats.qual.qual = ((pAd->Mlme.ChannelQuality * 12)/10 + 10);
-#endif // CONFIG_STA_SUPPORT //
-
- if(pAd->iw_stats.qual.qual > 100)
- pAd->iw_stats.qual.qual = 100;
-
-#ifdef CONFIG_STA_SUPPORT
- if (pAd->OpMode == OPMODE_STA)
- {
- pAd->iw_stats.qual.level =
- RTMPMaxRssi(pAd, pAd->StaCfg.RssiSample.LastRssi0,
- pAd->StaCfg.RssiSample.LastRssi1,
- pAd->StaCfg.RssiSample.LastRssi2);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- pAd->iw_stats.qual.noise = pAd->BbpWriteLatch[66]; // noise level (dBm)
-
- pAd->iw_stats.qual.noise += 256 - 143;
- pAd->iw_stats.qual.updated = 1; // Flags to know if updated
-#ifdef IW_QUAL_DBM
- pAd->iw_stats.qual.updated |= IW_QUAL_DBM; // Level + Noise are dBm
-#endif // IW_QUAL_DBM //
-
- pAd->iw_stats.discard.nwid = 0; // Rx : Wrong nwid/essid
- pAd->iw_stats.miss.beacon = 0; // Missed beacons/superframe
-
- DBGPRINT(RT_DEBUG_TRACE, ("<--- rt28xx_get_wireless_stats\n"));
- return &pAd->iw_stats;
-}
-#endif // WIRELESS_EXT //
-
-
-void tbtt_tasklet(unsigned long data)
-{
-//#define MAX_TX_IN_TBTT (16)
-
-}
-
-INT rt28xx_ioctl(
- IN PNET_DEV net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd)
-{
- RTMP_ADAPTER *pAd = NULL;
- INT ret = 0;
-
- pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
- if (pAd == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- ret = rt28xx_sta_ioctl(net_dev, rq, cmd);
- }
-#endif // CONFIG_STA_SUPPORT //
-
- return ret;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- return ethernet statistics counter
-
- Arguments:
- net_dev Pointer to net_device
-
- Return Value:
- net_device_stats*
-
- Note:
-
- ========================================================================
-*/
-static struct net_device_stats *RT28xx_get_ether_stats(
- IN struct net_device *net_dev)
-{
- RTMP_ADAPTER *pAd = NULL;
-
- if (net_dev)
- pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
-
- if (pAd)
- {
-
- pAd->stats.rx_packets = pAd->WlanCounters.ReceivedFragmentCount.QuadPart;
- pAd->stats.tx_packets = pAd->WlanCounters.TransmittedFragmentCount.QuadPart;
-
- pAd->stats.rx_bytes = pAd->RalinkCounters.ReceivedByteCount;
- pAd->stats.tx_bytes = pAd->RalinkCounters.TransmittedByteCount;
-
- pAd->stats.rx_errors = pAd->Counters8023.RxErrors;
- pAd->stats.tx_errors = pAd->Counters8023.TxErrors;
-
- pAd->stats.rx_dropped = 0;
- pAd->stats.tx_dropped = 0;
-
- pAd->stats.multicast = pAd->WlanCounters.MulticastReceivedFrameCount.QuadPart; // multicast packets received
- pAd->stats.collisions = pAd->Counters8023.OneCollision + pAd->Counters8023.MoreCollisions; // Collision packets
-
- pAd->stats.rx_length_errors = 0;
- pAd->stats.rx_over_errors = pAd->Counters8023.RxNoBuffer; // receiver ring buff overflow
- pAd->stats.rx_crc_errors = 0;//pAd->WlanCounters.FCSErrorCount; // recved pkt with crc error
- pAd->stats.rx_frame_errors = pAd->Counters8023.RcvAlignmentErrors; // recv'd frame alignment error
- pAd->stats.rx_fifo_errors = pAd->Counters8023.RxNoBuffer; // recv'r fifo overrun
- pAd->stats.rx_missed_errors = 0; // receiver missed packet
-
- // detailed tx_errors
- pAd->stats.tx_aborted_errors = 0;
- pAd->stats.tx_carrier_errors = 0;
- pAd->stats.tx_fifo_errors = 0;
- pAd->stats.tx_heartbeat_errors = 0;
- pAd->stats.tx_window_errors = 0;
-
- // for cslip etc
- pAd->stats.rx_compressed = 0;
- pAd->stats.tx_compressed = 0;
-
- return &pAd->stats;
- }
- else
- return NULL;
-}
-
-
-BOOLEAN RtmpPhyNetDevExit(
- IN RTMP_ADAPTER *pAd,
- IN PNET_DEV net_dev)
-{
-
-
-
-#ifdef INF_AMAZON_PPA
- if (ppa_hook_directpath_register_dev_fn && pAd->PPAEnable==TRUE)
- {
- UINT status;
- status=ppa_hook_directpath_register_dev_fn(&pAd->g_if_id, pAd->net_dev, NULL, PPA_F_DIRECTPATH_DEREGISTER);
- printk("unregister PPA:g_if_id=%d status=%d\n",pAd->g_if_id,status);
- }
- kfree(pAd->pDirectpathCb);
-#endif // INF_AMAZON_PPA //
-
- // Unregister network device
- if (net_dev != NULL)
- {
- printk("RtmpOSNetDevDetach(): RtmpOSNetDeviceDetach(), dev->name=%s!\n", net_dev->name);
- RtmpOSNetDevDetach(net_dev);
- }
-
- return TRUE;
-
-}
-
-
-/*
-========================================================================
-Routine Description:
- Allocate memory for adapter control block.
-
-Arguments:
- pAd Pointer to our adapter
-
-Return Value:
- NDIS_STATUS_SUCCESS
- NDIS_STATUS_FAILURE
- NDIS_STATUS_RESOURCES
-
-Note:
-========================================================================
-*/
-NDIS_STATUS AdapterBlockAllocateMemory(
- IN PVOID handle,
- OUT PVOID *ppAd)
-{
-
- *ppAd = (PVOID)vmalloc(sizeof(RTMP_ADAPTER)); //pci_alloc_consistent(pci_dev, sizeof(RTMP_ADAPTER), phy_addr);
-
- if (*ppAd)
- {
- NdisZeroMemory(*ppAd, sizeof(RTMP_ADAPTER));
- ((PRTMP_ADAPTER)*ppAd)->OS_Cookie = handle;
- return (NDIS_STATUS_SUCCESS);
- } else {
- return (NDIS_STATUS_FAILURE);
- }
-}
diff --git a/drivers/staging/rt3090/rt_profile.c b/drivers/staging/rt3090/rt_profile.c
deleted file mode 100644
index 49a05901bad4..000000000000
--- a/drivers/staging/rt3090/rt_profile.c
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rt_profile.c
-
- Abstract:
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- */
-
-#include "rt_config.h"
-
-
-NDIS_STATUS RTMPReadParametersHook(
- IN PRTMP_ADAPTER pAd)
-{
- PSTRING src = NULL;
- RTMP_OS_FD srcf;
- RTMP_OS_FS_INFO osFSInfo;
- INT retval = NDIS_STATUS_FAILURE;
- PSTRING buffer;
-
- buffer = kmalloc(MAX_INI_BUFFER_SIZE, MEM_ALLOC_FLAG);
- if(buffer == NULL)
- return NDIS_STATUS_FAILURE;
- memset(buffer, 0x00, MAX_INI_BUFFER_SIZE);
-
- {
-
-#ifdef CONFIG_STA_SUPPORT
- IF_DEV_CONFIG_OPMODE_ON_STA(pAd)
- {
- src = STA_PROFILE_PATH;
- }
-#endif // CONFIG_STA_SUPPORT //
-#ifdef MULTIPLE_CARD_SUPPORT
- src = (PSTRING)pAd->MC_FileName;
-#endif // MULTIPLE_CARD_SUPPORT //
- }
-
- if (src && *src)
- {
- RtmpOSFSInfoChange(&osFSInfo, TRUE);
- srcf = RtmpOSFileOpen(src, O_RDONLY, 0);
- if (IS_FILE_OPEN_ERR(srcf))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("Open file \"%s\" failed!\n", src));
- }
- else
- {
- retval =RtmpOSFileRead(srcf, buffer, MAX_INI_BUFFER_SIZE);
- if (retval > 0)
- {
- RTMPSetProfileParameters(pAd, buffer);
- retval = NDIS_STATUS_SUCCESS;
- }
- else
- DBGPRINT(RT_DEBUG_ERROR, ("Read file \"%s\" failed(errCode=%d)!\n", src, retval));
-
- retval = RtmpOSFileClose(srcf);
- if ( retval != 0)
- {
- retval = NDIS_STATUS_FAILURE;
- DBGPRINT(RT_DEBUG_ERROR, ("Close file \"%s\" failed(errCode=%d)!\n", src, retval));
- }
- }
-
- RtmpOSFSInfoChange(&osFSInfo, FALSE);
- }
-
- kfree(buffer);
-
- return (retval);
-
-}
diff --git a/drivers/staging/rt3090/rtmp.h b/drivers/staging/rt3090/rtmp.h
deleted file mode 100644
index 8ef6d0bfdee6..000000000000
--- a/drivers/staging/rt3090/rtmp.h
+++ /dev/null
@@ -1,6873 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp.h
-
- Abstract:
- Miniport generic portion header file
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 2002-08-01 created
- James Tan 2002-09-06 modified (Revise NTCRegTable)
- John Chang 2004-09-06 modified for RT2600
-*/
-#ifndef __RTMP_H__
-#define __RTMP_H__
-
-#include "link_list.h"
-#include "spectrum_def.h"
-
-#include "rtmp_dot11.h"
-
-#ifdef MLME_EX
-#include "mlme_ex_def.h"
-#endif // MLME_EX //
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-#undef AP_WSC_INCLUDED
-#undef STA_WSC_INCLUDED
-#undef WSC_INCLUDED
-
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
-#define WSC_INCLUDED
-#endif
-
-
-
-
-
-#include "rtmp_chip.h"
-
-
-
-typedef struct _RTMP_ADAPTER RTMP_ADAPTER;
-typedef struct _RTMP_ADAPTER *PRTMP_ADAPTER;
-
-typedef struct _RTMP_CHIP_OP_ RTMP_CHIP_OP;
-
-
-//#define DBG 1
-
-//#define DBG_DIAGNOSE 1
-
-
-//+++Add by shiang for merge MiniportMMRequest() and MiniportDataMMRequest() into one function
-#define MAX_DATAMM_RETRY 3
-#define MGMT_USE_QUEUE_FLAG 0x80
-//---Add by shiang for merge MiniportMMRequest() and MiniportDataMMRequest() into one function
-
-#define MAXSEQ (0xFFF)
-
-
-#if defined(CONFIG_AP_SUPPORT) && defined(CONFIG_STA_SUPPORT)
-#define IF_DEV_CONFIG_OPMODE_ON_AP(_pAd) if(_pAd->OpMode == OPMODE_AP)
-#define IF_DEV_CONFIG_OPMODE_ON_STA(_pAd) if(_pAd->OpMode == OPMODE_STA)
-#else
-#define IF_DEV_CONFIG_OPMODE_ON_AP(_pAd)
-#define IF_DEV_CONFIG_OPMODE_ON_STA(_pAd)
-#endif
-
-extern unsigned char SNAP_AIRONET[];
-extern unsigned char CISCO_OUI[];
-extern UCHAR BaSizeArray[4];
-
-extern UCHAR BROADCAST_ADDR[MAC_ADDR_LEN];
-extern UCHAR ZERO_MAC_ADDR[MAC_ADDR_LEN];
-extern ULONG BIT32[32];
-extern UCHAR BIT8[8];
-extern char* CipherName[];
-extern char* MCSToMbps[];
-extern UCHAR RxwiMCSToOfdmRate[12];
-extern UCHAR SNAP_802_1H[6];
-extern UCHAR SNAP_BRIDGE_TUNNEL[6];
-extern UCHAR SNAP_AIRONET[8];
-extern UCHAR CKIP_LLC_SNAP[8];
-extern UCHAR EAPOL_LLC_SNAP[8];
-extern UCHAR EAPOL[2];
-extern UCHAR IPX[2];
-extern UCHAR APPLE_TALK[2];
-extern UCHAR RateIdToPlcpSignal[12]; // see IEEE802.11a-1999 p.14
-extern UCHAR OfdmRateToRxwiMCS[];
-extern UCHAR OfdmSignalToRateId[16] ;
-extern UCHAR default_cwmin[4];
-extern UCHAR default_cwmax[4];
-extern UCHAR default_sta_aifsn[4];
-extern UCHAR MapUserPriorityToAccessCategory[8];
-
-extern USHORT RateUpPER[];
-extern USHORT RateDownPER[];
-extern UCHAR Phy11BNextRateDownward[];
-extern UCHAR Phy11BNextRateUpward[];
-extern UCHAR Phy11BGNextRateDownward[];
-extern UCHAR Phy11BGNextRateUpward[];
-extern UCHAR Phy11ANextRateDownward[];
-extern UCHAR Phy11ANextRateUpward[];
-extern CHAR RssiSafeLevelForTxRate[];
-extern UCHAR RateIdToMbps[];
-extern USHORT RateIdTo500Kbps[];
-
-extern UCHAR CipherSuiteWpaNoneTkip[];
-extern UCHAR CipherSuiteWpaNoneTkipLen;
-
-extern UCHAR CipherSuiteWpaNoneAes[];
-extern UCHAR CipherSuiteWpaNoneAesLen;
-
-extern UCHAR SsidIe;
-extern UCHAR SupRateIe;
-extern UCHAR ExtRateIe;
-
-#ifdef DOT11_N_SUPPORT
-extern UCHAR HtCapIe;
-extern UCHAR AddHtInfoIe;
-extern UCHAR NewExtChanIe;
-#ifdef DOT11N_DRAFT3
-extern UCHAR ExtHtCapIe;
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-extern UCHAR ErpIe;
-extern UCHAR DsIe;
-extern UCHAR TimIe;
-extern UCHAR WpaIe;
-extern UCHAR Wpa2Ie;
-extern UCHAR IbssIe;
-extern UCHAR Ccx2Ie;
-extern UCHAR WapiIe;
-
-extern UCHAR WPA_OUI[];
-extern UCHAR RSN_OUI[];
-extern UCHAR WAPI_OUI[];
-extern UCHAR WME_INFO_ELEM[];
-extern UCHAR WME_PARM_ELEM[];
-extern UCHAR Ccx2QosInfo[];
-extern UCHAR Ccx2IeInfo[];
-extern UCHAR RALINK_OUI[];
-extern UCHAR PowerConstraintIE[];
-
-
-extern UCHAR RateSwitchTable[];
-extern UCHAR RateSwitchTable11B[];
-extern UCHAR RateSwitchTable11G[];
-extern UCHAR RateSwitchTable11BG[];
-
-#ifdef DOT11_N_SUPPORT
-extern UCHAR RateSwitchTable11BGN1S[];
-extern UCHAR RateSwitchTable11BGN2S[];
-extern UCHAR RateSwitchTable11BGN2SForABand[];
-extern UCHAR RateSwitchTable11N1S[];
-extern UCHAR RateSwitchTable11N2S[];
-extern UCHAR RateSwitchTable11N2SForABand[];
-
-#ifdef CONFIG_STA_SUPPORT
-extern UCHAR PRE_N_HT_OUI[];
-#endif // CONFIG_STA_SUPPORT //
-#endif // DOT11_N_SUPPORT //
-
-
-#ifdef RALINK_ATE
-typedef struct _ATE_INFO {
- UCHAR Mode;
- CHAR TxPower0;
- CHAR TxPower1;
- CHAR TxAntennaSel;
- CHAR RxAntennaSel;
- TXWI_STRUC TxWI; // TXWI
- USHORT QID;
- UCHAR Addr1[MAC_ADDR_LEN];
- UCHAR Addr2[MAC_ADDR_LEN];
- UCHAR Addr3[MAC_ADDR_LEN];
- UCHAR Channel;
- UINT32 TxLength;
- UINT32 TxCount;
- UINT32 TxDoneCount; // Tx DMA Done
- UINT32 RFFreqOffset;
- BOOLEAN bRxFER; // Show Rx Frame Error Rate
- BOOLEAN bQATxStart; // Have compiled QA in and use it to ATE tx.
- BOOLEAN bQARxStart; // Have compiled QA in and use it to ATE rx.
-#ifdef RTMP_MAC_PCI
- BOOLEAN bFWLoading; // Reload firmware when ATE is done.
-#endif // RTMP_MAC_PCI //
- UINT32 RxTotalCnt;
- UINT32 RxCntPerSec;
-
- CHAR LastSNR0; // last received SNR
- CHAR LastSNR1; // last received SNR for 2nd antenna
- CHAR LastRssi0; // last received RSSI
- CHAR LastRssi1; // last received RSSI for 2nd antenna
- CHAR LastRssi2; // last received RSSI for 3rd antenna
- CHAR AvgRssi0; // last 8 frames' average RSSI
- CHAR AvgRssi1; // last 8 frames' average RSSI
- CHAR AvgRssi2; // last 8 frames' average RSSI
- SHORT AvgRssi0X8; // sum of last 8 frames' RSSI
- SHORT AvgRssi1X8; // sum of last 8 frames' RSSI
- SHORT AvgRssi2X8; // sum of last 8 frames' RSSI
-
- UINT32 NumOfAvgRssiSample;
-
-
-#ifdef RALINK_28xx_QA
- // Tx frame
- USHORT HLen; // Header Length
- USHORT PLen; // Pattern Length
- UCHAR Header[32]; // Header buffer
- UCHAR Pattern[32]; // Pattern buffer
- USHORT DLen; // Data Length
- USHORT seq;
- UINT32 CID;
- RTMP_OS_PID AtePid;
- // counters
- UINT32 U2M;
- UINT32 OtherData;
- UINT32 Beacon;
- UINT32 OtherCount;
- UINT32 TxAc0;
- UINT32 TxAc1;
- UINT32 TxAc2;
- UINT32 TxAc3;
- /*UINT32 TxHCCA;*/
- UINT32 TxMgmt;
- UINT32 RSSI0;
- UINT32 RSSI1;
- UINT32 RSSI2;
- UINT32 SNR0;
- UINT32 SNR1;
- // TxStatus : 0 --> task is idle, 1 --> task is running
- UCHAR TxStatus;
-#endif // RALINK_28xx_QA //
-} ATE_INFO, *PATE_INFO;
-
-#ifdef RALINK_28xx_QA
-struct ate_racfghdr {
- UINT32 magic_no;
- USHORT command_type;
- USHORT command_id;
- USHORT length;
- USHORT sequence;
- USHORT status;
- UCHAR data[2046];
-} __attribute__((packed));
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
-
-
-typedef struct _RSSI_SAMPLE {
- CHAR LastRssi0; // last received RSSI
- CHAR LastRssi1; // last received RSSI
- CHAR LastRssi2; // last received RSSI
- CHAR AvgRssi0;
- CHAR AvgRssi1;
- CHAR AvgRssi2;
- SHORT AvgRssi0X8;
- SHORT AvgRssi1X8;
- SHORT AvgRssi2X8;
-} RSSI_SAMPLE;
-
-//
-// Queue structure and macros
-//
-typedef struct _QUEUE_ENTRY {
- struct _QUEUE_ENTRY *Next;
-} QUEUE_ENTRY, *PQUEUE_ENTRY;
-
-// Queue structure
-typedef struct _QUEUE_HEADER {
- PQUEUE_ENTRY Head;
- PQUEUE_ENTRY Tail;
- ULONG Number;
-} QUEUE_HEADER, *PQUEUE_HEADER;
-
-#define InitializeQueueHeader(QueueHeader) \
-{ \
- (QueueHeader)->Head = (QueueHeader)->Tail = NULL; \
- (QueueHeader)->Number = 0; \
-}
-
-#define RemoveHeadQueue(QueueHeader) \
-(QueueHeader)->Head; \
-{ \
- PQUEUE_ENTRY pNext; \
- if ((QueueHeader)->Head != NULL) \
- { \
- pNext = (QueueHeader)->Head->Next; \
- (QueueHeader)->Head->Next = NULL; \
- (QueueHeader)->Head = pNext; \
- if (pNext == NULL) \
- (QueueHeader)->Tail = NULL; \
- (QueueHeader)->Number--; \
- } \
-}
-
-#define InsertHeadQueue(QueueHeader, QueueEntry) \
-{ \
- ((PQUEUE_ENTRY)QueueEntry)->Next = (QueueHeader)->Head; \
- (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
- if ((QueueHeader)->Tail == NULL) \
- (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
- (QueueHeader)->Number++; \
-}
-
-#define InsertTailQueue(QueueHeader, QueueEntry) \
-{ \
- ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
- if ((QueueHeader)->Tail) \
- (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
- else \
- (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
- (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
- (QueueHeader)->Number++; \
-}
-
-#define InsertTailQueueAc(pAd, pEntry, QueueHeader, QueueEntry) \
-{ \
- ((PQUEUE_ENTRY)QueueEntry)->Next = NULL; \
- if ((QueueHeader)->Tail) \
- (QueueHeader)->Tail->Next = (PQUEUE_ENTRY)(QueueEntry); \
- else \
- (QueueHeader)->Head = (PQUEUE_ENTRY)(QueueEntry); \
- (QueueHeader)->Tail = (PQUEUE_ENTRY)(QueueEntry); \
- (QueueHeader)->Number++; \
-}
-
-
-
-//
-// Macros for flag and ref count operations
-//
-#define RTMP_SET_FLAG(_M, _F) ((_M)->Flags |= (_F))
-#define RTMP_CLEAR_FLAG(_M, _F) ((_M)->Flags &= ~(_F))
-#define RTMP_CLEAR_FLAGS(_M) ((_M)->Flags = 0)
-#define RTMP_TEST_FLAG(_M, _F) (((_M)->Flags & (_F)) != 0)
-#define RTMP_TEST_FLAGS(_M, _F) (((_M)->Flags & (_F)) == (_F))
-// Macro for power save flag.
-#define RTMP_SET_PSFLAG(_M, _F) ((_M)->PSFlags |= (_F))
-#define RTMP_CLEAR_PSFLAG(_M, _F) ((_M)->PSFlags &= ~(_F))
-#define RTMP_CLEAR_PSFLAGS(_M) ((_M)->PSFlags = 0)
-#define RTMP_TEST_PSFLAG(_M, _F) (((_M)->PSFlags & (_F)) != 0)
-#define RTMP_TEST_PSFLAGS(_M, _F) (((_M)->PSFlags & (_F)) == (_F))
-
-#define OPSTATUS_SET_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags |= (_F))
-#define OPSTATUS_CLEAR_FLAG(_pAd, _F) ((_pAd)->CommonCfg.OpStatusFlags &= ~(_F))
-#define OPSTATUS_TEST_FLAG(_pAd, _F) (((_pAd)->CommonCfg.OpStatusFlags & (_F)) != 0)
-
-#define CLIENT_STATUS_SET_FLAG(_pEntry,_F) ((_pEntry)->ClientStatusFlags |= (_F))
-#define CLIENT_STATUS_CLEAR_FLAG(_pEntry,_F) ((_pEntry)->ClientStatusFlags &= ~(_F))
-#define CLIENT_STATUS_TEST_FLAG(_pEntry,_F) (((_pEntry)->ClientStatusFlags & (_F)) != 0)
-
-#define RX_FILTER_SET_FLAG(_pAd, _F) ((_pAd)->CommonCfg.PacketFilter |= (_F))
-#define RX_FILTER_CLEAR_FLAG(_pAd, _F) ((_pAd)->CommonCfg.PacketFilter &= ~(_F))
-#define RX_FILTER_TEST_FLAG(_pAd, _F) (((_pAd)->CommonCfg.PacketFilter & (_F)) != 0)
-
-#ifdef CONFIG_STA_SUPPORT
-#define STA_NO_SECURITY_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11EncryptionDisabled)
-#define STA_WEP_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption1Enabled)
-#define STA_TKIP_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption2Enabled)
-#define STA_AES_ON(_p) (_p->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
-
-#define STA_TGN_WIFI_ON(_p) (_p->StaCfg.bTGnWifiTest == TRUE)
-#endif // CONFIG_STA_SUPPORT //
-
-#define CKIP_KP_ON(_p) ((((_p)->StaCfg.CkipFlag) & 0x10) && ((_p)->StaCfg.bCkipCmicOn == TRUE))
-#define CKIP_CMIC_ON(_p) ((((_p)->StaCfg.CkipFlag) & 0x08) && ((_p)->StaCfg.bCkipCmicOn == TRUE))
-
-
-#define INC_RING_INDEX(_idx, _RingSize) \
-{ \
- (_idx) = (_idx+1) % (_RingSize); \
-}
-
-
-#ifdef DOT11_N_SUPPORT
-// StaActive.SupportedHtPhy.MCSSet is copied from AP beacon. Don't need to update here.
-#define COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(_pAd) \
-{ \
- _pAd->StaActive.SupportedHtPhy.ChannelWidth = _pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth; \
- _pAd->StaActive.SupportedHtPhy.MimoPs = _pAd->MlmeAux.HtCapability.HtCapInfo.MimoPs; \
- _pAd->StaActive.SupportedHtPhy.GF = _pAd->MlmeAux.HtCapability.HtCapInfo.GF; \
- _pAd->StaActive.SupportedHtPhy.ShortGIfor20 = _pAd->MlmeAux.HtCapability.HtCapInfo.ShortGIfor20; \
- _pAd->StaActive.SupportedHtPhy.ShortGIfor40 = _pAd->MlmeAux.HtCapability.HtCapInfo.ShortGIfor40; \
- _pAd->StaActive.SupportedHtPhy.TxSTBC = _pAd->MlmeAux.HtCapability.HtCapInfo.TxSTBC; \
- _pAd->StaActive.SupportedHtPhy.RxSTBC = _pAd->MlmeAux.HtCapability.HtCapInfo.RxSTBC; \
- _pAd->StaActive.SupportedHtPhy.ExtChanOffset = _pAd->MlmeAux.AddHtInfo.AddHtInfo.ExtChanOffset; \
- _pAd->StaActive.SupportedHtPhy.RecomWidth = _pAd->MlmeAux.AddHtInfo.AddHtInfo.RecomWidth; \
- _pAd->StaActive.SupportedHtPhy.OperaionMode = _pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode; \
- _pAd->StaActive.SupportedHtPhy.NonGfPresent = _pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent; \
- NdisMoveMemory((_pAd)->MacTab.Content[BSSID_WCID].HTCapability.MCSSet, (_pAd)->StaActive.SupportedPhyInfo.MCSSet, sizeof(UCHAR) * 16);\
-}
-
-#define COPY_AP_HTSETTINGS_FROM_BEACON(_pAd, _pHtCapability) \
-{ \
- _pAd->MacTab.Content[BSSID_WCID].AMsduSize = (UCHAR)(_pHtCapability->HtCapInfo.AMsduSize); \
- _pAd->MacTab.Content[BSSID_WCID].MmpsMode= (UCHAR)(_pHtCapability->HtCapInfo.MimoPs); \
- _pAd->MacTab.Content[BSSID_WCID].MaxRAmpduFactor = (UCHAR)(_pHtCapability->HtCapParm.MaxRAmpduFactor); \
-}
-#endif // DOT11_N_SUPPORT //
-
-//
-// MACRO for 32-bit PCI register read / write
-//
-// Usage : RTMP_IO_READ32(
-// PRTMP_ADAPTER pAd,
-// ULONG Register_Offset,
-// PULONG pValue)
-//
-// RTMP_IO_WRITE32(
-// PRTMP_ADAPTER pAd,
-// ULONG Register_Offset,
-// ULONG Value)
-//
-
-
-//
-// Common fragment list structure - Identical to the scatter gather frag list structure
-//
-//#define RTMP_SCATTER_GATHER_ELEMENT SCATTER_GATHER_ELEMENT
-//#define PRTMP_SCATTER_GATHER_ELEMENT PSCATTER_GATHER_ELEMENT
-#define NIC_MAX_PHYS_BUF_COUNT 8
-
-typedef struct _RTMP_SCATTER_GATHER_ELEMENT {
- PVOID Address;
- ULONG Length;
- PULONG Reserved;
-} RTMP_SCATTER_GATHER_ELEMENT, *PRTMP_SCATTER_GATHER_ELEMENT;
-
-
-typedef struct _RTMP_SCATTER_GATHER_LIST {
- ULONG NumberOfElements;
- PULONG Reserved;
- RTMP_SCATTER_GATHER_ELEMENT Elements[NIC_MAX_PHYS_BUF_COUNT];
-} RTMP_SCATTER_GATHER_LIST, *PRTMP_SCATTER_GATHER_LIST;
-
-
-//
-// Some utility macros
-//
-#ifndef min
-#define min(_a, _b) (((_a) < (_b)) ? (_a) : (_b))
-#endif
-
-#ifndef max
-#define max(_a, _b) (((_a) > (_b)) ? (_a) : (_b))
-#endif
-
-#define GET_LNA_GAIN(_pAd) ((_pAd->LatchRfRegs.Channel <= 14) ? (_pAd->BLNAGain) : ((_pAd->LatchRfRegs.Channel <= 64) ? (_pAd->ALNAGain0) : ((_pAd->LatchRfRegs.Channel <= 128) ? (_pAd->ALNAGain1) : (_pAd->ALNAGain2))))
-
-#define INC_COUNTER64(Val) (Val.QuadPart++)
-
-#define INFRA_ON(_p) (OPSTATUS_TEST_FLAG(_p, fOP_STATUS_INFRA_ON))
-#define ADHOC_ON(_p) (OPSTATUS_TEST_FLAG(_p, fOP_STATUS_ADHOC_ON))
-#define MONITOR_ON(_p) (((_p)->StaCfg.BssType) == BSS_MONITOR)
-#define IDLE_ON(_p) (!INFRA_ON(_p) && !ADHOC_ON(_p))
-
-// Check LEAP & CCKM flags
-#define LEAP_ON(_p) (((_p)->StaCfg.LeapAuthMode) == CISCO_AuthModeLEAP)
-#define LEAP_CCKM_ON(_p) ((((_p)->StaCfg.LeapAuthMode) == CISCO_AuthModeLEAP) && ((_p)->StaCfg.LeapAuthInfo.CCKM == TRUE))
-
-// if orginal Ethernet frame contains no LLC/SNAP, then an extra LLC/SNAP encap is required
-#define EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(_pBufVA, _pExtraLlcSnapEncap) \
-{ \
- if (((*(_pBufVA + 12) << 8) + *(_pBufVA + 13)) > 1500) \
- { \
- _pExtraLlcSnapEncap = SNAP_802_1H; \
- if (NdisEqualMemory(IPX, _pBufVA + 12, 2) || \
- NdisEqualMemory(APPLE_TALK, _pBufVA + 12, 2)) \
- { \
- _pExtraLlcSnapEncap = SNAP_BRIDGE_TUNNEL; \
- } \
- } \
- else \
- { \
- _pExtraLlcSnapEncap = NULL; \
- } \
-}
-
-// New Define for new Tx Path.
-#define EXTRA_LLCSNAP_ENCAP_FROM_PKT_OFFSET(_pBufVA, _pExtraLlcSnapEncap) \
-{ \
- if (((*(_pBufVA) << 8) + *(_pBufVA + 1)) > 1500) \
- { \
- _pExtraLlcSnapEncap = SNAP_802_1H; \
- if (NdisEqualMemory(IPX, _pBufVA, 2) || \
- NdisEqualMemory(APPLE_TALK, _pBufVA, 2)) \
- { \
- _pExtraLlcSnapEncap = SNAP_BRIDGE_TUNNEL; \
- } \
- } \
- else \
- { \
- _pExtraLlcSnapEncap = NULL; \
- } \
-}
-
-
-#define MAKE_802_3_HEADER(_p, _pMac1, _pMac2, _pType) \
-{ \
- NdisMoveMemory(_p, _pMac1, MAC_ADDR_LEN); \
- NdisMoveMemory((_p + MAC_ADDR_LEN), _pMac2, MAC_ADDR_LEN); \
- NdisMoveMemory((_p + MAC_ADDR_LEN * 2), _pType, LENGTH_802_3_TYPE); \
-}
-
-// if pData has no LLC/SNAP (neither RFC1042 nor Bridge tunnel), keep it that way.
-// else if the received frame is LLC/SNAP-encaped IPX or APPLETALK, preserve the LLC/SNAP field
-// else remove the LLC/SNAP field from the result Ethernet frame
-// Patch for WHQL only, which did not turn on Netbios but use IPX within its payload
-// Note:
-// _pData & _DataSize may be altered (remove 8-byte LLC/SNAP) by this MACRO
-// _pRemovedLLCSNAP: pointer to removed LLC/SNAP; NULL is not removed
-#define CONVERT_TO_802_3(_p8023hdr, _pDA, _pSA, _pData, _DataSize, _pRemovedLLCSNAP) \
-{ \
- char LLC_Len[2]; \
- \
- _pRemovedLLCSNAP = NULL; \
- if (NdisEqualMemory(SNAP_802_1H, _pData, 6) || \
- NdisEqualMemory(SNAP_BRIDGE_TUNNEL, _pData, 6)) \
- { \
- PUCHAR pProto = _pData + 6; \
- \
- if ((NdisEqualMemory(IPX, pProto, 2) || NdisEqualMemory(APPLE_TALK, pProto, 2)) && \
- NdisEqualMemory(SNAP_802_1H, _pData, 6)) \
- { \
- LLC_Len[0] = (UCHAR)(_DataSize / 256); \
- LLC_Len[1] = (UCHAR)(_DataSize % 256); \
- MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
- } \
- else \
- { \
- MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, pProto); \
- _pRemovedLLCSNAP = _pData; \
- _DataSize -= LENGTH_802_1_H; \
- _pData += LENGTH_802_1_H; \
- } \
- } \
- else \
- { \
- LLC_Len[0] = (UCHAR)(_DataSize / 256); \
- LLC_Len[1] = (UCHAR)(_DataSize % 256); \
- MAKE_802_3_HEADER(_p8023hdr, _pDA, _pSA, LLC_Len); \
- } \
-}
-
-
-// Enqueue this frame to MLME engine
-// We need to enqueue the whole frame because MLME need to pass data type
-// information from 802.11 header
-#ifdef RTMP_MAC_PCI
-#define REPORT_MGMT_FRAME_TO_MLME(_pAd, Wcid, _pFrame, _FrameSize, _Rssi0, _Rssi1, _Rssi2, _PlcpSignal) \
-{ \
- UINT32 High32TSF, Low32TSF; \
- RTMP_IO_READ32(_pAd, TSF_TIMER_DW1, &High32TSF); \
- RTMP_IO_READ32(_pAd, TSF_TIMER_DW0, &Low32TSF); \
- MlmeEnqueueForRecv(_pAd, Wcid, High32TSF, Low32TSF, (UCHAR)_Rssi0, (UCHAR)_Rssi1,(UCHAR)_Rssi2,_FrameSize, _pFrame, (UCHAR)_PlcpSignal); \
-}
-#endif // RTMP_MAC_PCI //
-
-#define MAC_ADDR_EQUAL(pAddr1,pAddr2) RTMPEqualMemory((PVOID)(pAddr1), (PVOID)(pAddr2), MAC_ADDR_LEN)
-#define SSID_EQUAL(ssid1, len1, ssid2, len2) ((len1==len2) && (RTMPEqualMemory(ssid1, ssid2, len1)))
-
-//
-// Check if it is Japan W53(ch52,56,60,64) channel.
-//
-#define JapanChannelCheck(channel) ((channel == 52) || (channel == 56) || (channel == 60) || (channel == 64))
-
-#ifdef CONFIG_STA_SUPPORT
-#define STA_EXTRA_SETTING(_pAd)
-
-#define STA_PORT_SECURED(_pAd) \
-{ \
- BOOLEAN Cancelled; \
- (_pAd)->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED; \
- NdisAcquireSpinLock(&((_pAd)->MacTabLock)); \
- (_pAd)->MacTab.Content[BSSID_WCID].PortSecured = (_pAd)->StaCfg.PortSecured; \
- (_pAd)->MacTab.Content[BSSID_WCID].PrivacyFilter = Ndis802_11PrivFilterAcceptAll;\
- NdisReleaseSpinLock(&(_pAd)->MacTabLock); \
- RTMPCancelTimer(&((_pAd)->Mlme.LinkDownTimer), &Cancelled);\
- STA_EXTRA_SETTING(_pAd); \
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-//
-// Data buffer for DMA operation, the buffer must be contiguous physical memory
-// Both DMA to / from CPU use the same structure.
-//
-typedef struct _RTMP_DMABUF
-{
- ULONG AllocSize;
- PVOID AllocVa; // TxBuf virtual address
- NDIS_PHYSICAL_ADDRESS AllocPa; // TxBuf physical address
-} RTMP_DMABUF, *PRTMP_DMABUF;
-
-
-//
-// Control block (Descriptor) for all ring descriptor DMA operation, buffer must be
-// contiguous physical memory. NDIS_PACKET stored the binding Rx packet descriptor
-// which won't be released, driver has to wait until upper layer return the packet
-// before giveing up this rx ring descriptor to ASIC. NDIS_BUFFER is assocaited pair
-// to describe the packet buffer. For Tx, NDIS_PACKET stored the tx packet descriptor
-// which driver should ACK upper layer when the tx is physically done or failed.
-//
-typedef struct _RTMP_DMACB
-{
- ULONG AllocSize; // Control block size
- PVOID AllocVa; // Control block virtual address
- NDIS_PHYSICAL_ADDRESS AllocPa; // Control block physical address
- PNDIS_PACKET pNdisPacket;
- PNDIS_PACKET pNextNdisPacket;
-
- RTMP_DMABUF DmaBuf; // Associated DMA buffer structure
-} RTMP_DMACB, *PRTMP_DMACB;
-
-
-typedef struct _RTMP_TX_RING
-{
- RTMP_DMACB Cell[TX_RING_SIZE];
- UINT32 TxCpuIdx;
- UINT32 TxDmaIdx;
- UINT32 TxSwFreeIdx; // software next free tx index
-} RTMP_TX_RING, *PRTMP_TX_RING;
-
-typedef struct _RTMP_RX_RING
-{
- RTMP_DMACB Cell[RX_RING_SIZE];
- UINT32 RxCpuIdx;
- UINT32 RxDmaIdx;
- INT32 RxSwReadIdx; // software next read index
-} RTMP_RX_RING, *PRTMP_RX_RING;
-
-typedef struct _RTMP_MGMT_RING
-{
- RTMP_DMACB Cell[MGMT_RING_SIZE];
- UINT32 TxCpuIdx;
- UINT32 TxDmaIdx;
- UINT32 TxSwFreeIdx; // software next free tx index
-} RTMP_MGMT_RING, *PRTMP_MGMT_RING;
-
-
-//
-// Statistic counter structure
-//
-typedef struct _COUNTER_802_3
-{
- // General Stats
- ULONG GoodTransmits;
- ULONG GoodReceives;
- ULONG TxErrors;
- ULONG RxErrors;
- ULONG RxNoBuffer;
-
- // Ethernet Stats
- ULONG RcvAlignmentErrors;
- ULONG OneCollision;
- ULONG MoreCollisions;
-
-} COUNTER_802_3, *PCOUNTER_802_3;
-
-typedef struct _COUNTER_802_11 {
- ULONG Length;
- LARGE_INTEGER LastTransmittedFragmentCount;
- LARGE_INTEGER TransmittedFragmentCount;
- LARGE_INTEGER MulticastTransmittedFrameCount;
- LARGE_INTEGER FailedCount;
- LARGE_INTEGER RetryCount;
- LARGE_INTEGER MultipleRetryCount;
- LARGE_INTEGER RTSSuccessCount;
- LARGE_INTEGER RTSFailureCount;
- LARGE_INTEGER ACKFailureCount;
- LARGE_INTEGER FrameDuplicateCount;
- LARGE_INTEGER ReceivedFragmentCount;
- LARGE_INTEGER MulticastReceivedFrameCount;
- LARGE_INTEGER FCSErrorCount;
-} COUNTER_802_11, *PCOUNTER_802_11;
-
-typedef struct _COUNTER_RALINK {
- ULONG TransmittedByteCount; // both successful and failure, used to calculate TX throughput
- ULONG ReceivedByteCount; // both CRC okay and CRC error, used to calculate RX throughput
- ULONG BeenDisassociatedCount;
- ULONG BadCQIAutoRecoveryCount;
- ULONG PoorCQIRoamingCount;
- ULONG MgmtRingFullCount;
- ULONG RxCountSinceLastNULL;
- ULONG RxCount;
- ULONG RxRingErrCount;
- ULONG KickTxCount;
- ULONG TxRingErrCount;
- LARGE_INTEGER RealFcsErrCount;
- ULONG PendingNdisPacketCount;
-
- ULONG OneSecOsTxCount[NUM_OF_TX_RING];
- ULONG OneSecDmaDoneCount[NUM_OF_TX_RING];
- UINT32 OneSecTxDoneCount;
- ULONG OneSecRxCount;
- UINT32 OneSecTxAggregationCount;
- UINT32 OneSecRxAggregationCount;
- UINT32 OneSecReceivedByteCount;
- UINT32 OneSecFrameDuplicateCount;
-
- UINT32 OneSecTransmittedByteCount; // both successful and failure, used to calculate TX throughput
- UINT32 OneSecTxNoRetryOkCount;
- UINT32 OneSecTxRetryOkCount;
- UINT32 OneSecTxFailCount;
- UINT32 OneSecFalseCCACnt; // CCA error count, for debug purpose, might move to global counter
- UINT32 OneSecRxOkCnt; // RX without error
- UINT32 OneSecRxOkDataCnt; // unicast-to-me DATA frame count
- UINT32 OneSecRxFcsErrCnt; // CRC error
- UINT32 OneSecBeaconSentCnt;
- UINT32 LastOneSecTotalTxCount; // OneSecTxNoRetryOkCount + OneSecTxRetryOkCount + OneSecTxFailCount
- UINT32 LastOneSecRxOkDataCnt; // OneSecRxOkDataCnt
- ULONG DuplicateRcv;
- ULONG TxAggCount;
- ULONG TxNonAggCount;
- ULONG TxAgg1MPDUCount;
- ULONG TxAgg2MPDUCount;
- ULONG TxAgg3MPDUCount;
- ULONG TxAgg4MPDUCount;
- ULONG TxAgg5MPDUCount;
- ULONG TxAgg6MPDUCount;
- ULONG TxAgg7MPDUCount;
- ULONG TxAgg8MPDUCount;
- ULONG TxAgg9MPDUCount;
- ULONG TxAgg10MPDUCount;
- ULONG TxAgg11MPDUCount;
- ULONG TxAgg12MPDUCount;
- ULONG TxAgg13MPDUCount;
- ULONG TxAgg14MPDUCount;
- ULONG TxAgg15MPDUCount;
- ULONG TxAgg16MPDUCount;
-
- LARGE_INTEGER TransmittedOctetsInAMSDU;
- LARGE_INTEGER TransmittedAMSDUCount;
- LARGE_INTEGER ReceivedOctesInAMSDUCount;
- LARGE_INTEGER ReceivedAMSDUCount;
- LARGE_INTEGER TransmittedAMPDUCount;
- LARGE_INTEGER TransmittedMPDUsInAMPDUCount;
- LARGE_INTEGER TransmittedOctetsInAMPDUCount;
- LARGE_INTEGER MPDUInReceivedAMPDUCount;
-} COUNTER_RALINK, *PCOUNTER_RALINK;
-
-
-typedef struct _COUNTER_DRS {
- // to record the each TX rate's quality. 0 is best, the bigger the worse.
- USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH];
- UCHAR PER[MAX_STEP_OF_TX_RATE_SWITCH];
- UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
- ULONG CurrTxRateStableTime; // # of second in current TX rate
- BOOLEAN fNoisyEnvironment;
- BOOLEAN fLastSecAccordingRSSI;
- UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
- UCHAR LastTimeTxRateChangeAction; //Keep last time value of LastSecTxRateChangeAction
- ULONG LastTxOkCount;
-} COUNTER_DRS, *PCOUNTER_DRS;
-
-
-
-
-/***************************************************************************
- * security key related data structure
- **************************************************************************/
-typedef struct _CIPHER_KEY {
- UCHAR Key[16]; // right now we implement 4 keys, 128 bits max
- UCHAR RxMic[8]; // make alignment
- UCHAR TxMic[8];
- UCHAR TxTsc[6]; // 48bit TSC value
- UCHAR RxTsc[6]; // 48bit TSC value
- UCHAR CipherAlg; // 0-none, 1:WEP64, 2:WEP128, 3:TKIP, 4:AES, 5:CKIP64, 6:CKIP128
- UCHAR KeyLen;
-#ifdef CONFIG_STA_SUPPORT
- UCHAR BssId[6];
-#endif // CONFIG_STA_SUPPORT //
- // Key length for each key, 0: entry is invalid
- UCHAR Type; // Indicate Pairwise/Group when reporting MIC error
-} CIPHER_KEY, *PCIPHER_KEY;
-
-
-// structure to define WPA Group Key Rekey Interval
-typedef struct PACKED _RT_802_11_WPA_REKEY {
- ULONG ReKeyMethod; // mechanism for rekeying: 0:disable, 1: time-based, 2: packet-based
- ULONG ReKeyInterval; // time-based: seconds, packet-based: kilo-packets
-} RT_WPA_REKEY,*PRT_WPA_REKEY, RT_802_11_WPA_REKEY, *PRT_802_11_WPA_REKEY;
-
-
-
-typedef struct {
- UCHAR Addr[MAC_ADDR_LEN];
- UCHAR ErrorCode[2]; //00 01-Invalid authentication type
- //00 02-Authentication timeout
- //00 03-Challenge from AP failed
- //00 04-Challenge to AP failed
- BOOLEAN Reported;
-} ROGUEAP_ENTRY, *PROGUEAP_ENTRY;
-
-typedef struct {
- UCHAR RogueApNr;
- ROGUEAP_ENTRY RogueApEntry[MAX_LEN_OF_BSS_TABLE];
-} ROGUEAP_TABLE, *PROGUEAP_TABLE;
-
-//
-// Cisco IAPP format
-//
-typedef struct _CISCO_IAPP_CONTENT_
-{
- USHORT Length; //IAPP Length
- UCHAR MessageType; //IAPP type
- UCHAR FunctionCode; //IAPP function type
- UCHAR DestinaionMAC[MAC_ADDR_LEN];
- UCHAR SourceMAC[MAC_ADDR_LEN];
- USHORT Tag; //Tag(element IE) - Adjacent AP report
- USHORT TagLength; //Length of element not including 4 byte header
- UCHAR OUI[4]; //0x00, 0x40, 0x96, 0x00
- UCHAR PreviousAP[MAC_ADDR_LEN]; //MAC Address of access point
- USHORT Channel;
- USHORT SsidLen;
- UCHAR Ssid[MAX_LEN_OF_SSID];
- USHORT Seconds; //Seconds that the client has been disassociated.
-} CISCO_IAPP_CONTENT, *PCISCO_IAPP_CONTENT;
-
-
-/*
- * Fragment Frame structure
- */
-typedef struct _FRAGMENT_FRAME {
- PNDIS_PACKET pFragPacket;
- ULONG RxSize;
- USHORT Sequence;
- USHORT LastFrag;
- ULONG Flags; // Some extra frame information. bit 0: LLC presented
-} FRAGMENT_FRAME, *PFRAGMENT_FRAME;
-
-
-//
-// Packet information for NdisQueryPacket
-//
-typedef struct _PACKET_INFO {
- UINT PhysicalBufferCount; // Physical breaks of buffer descripor chained
- UINT BufferCount ; // Number of Buffer descriptor chained
- UINT TotalPacketLength ; // Self explained
- PNDIS_BUFFER pFirstBuffer; // Pointer to first buffer descriptor
-} PACKET_INFO, *PPACKET_INFO;
-
-
-//
-// Arcfour Structure Added by PaulWu
-//
-typedef struct _ARCFOUR
-{
- UINT X;
- UINT Y;
- UCHAR STATE[256];
-} ARCFOURCONTEXT, *PARCFOURCONTEXT;
-
-
-//
-// Tkip Key structure which RC4 key & MIC calculation
-//
-typedef struct _TKIP_KEY_INFO {
- UINT nBytesInM; // # bytes in M for MICKEY
- ULONG IV16;
- ULONG IV32;
- ULONG K0; // for MICKEY Low
- ULONG K1; // for MICKEY Hig
- ULONG L; // Current state for MICKEY
- ULONG R; // Current state for MICKEY
- ULONG M; // Message accumulator for MICKEY
- UCHAR RC4KEY[16];
- UCHAR MIC[8];
-} TKIP_KEY_INFO, *PTKIP_KEY_INFO;
-
-
-//
-// Private / Misc data, counters for driver internal use
-//
-typedef struct __PRIVATE_STRUC {
- UINT SystemResetCnt; // System reset counter
- UINT TxRingFullCnt; // Tx ring full occurrance number
- UINT PhyRxErrCnt; // PHY Rx error count, for debug purpose, might move to global counter
- // Variables for WEP encryption / decryption in rtmp_wep.c
- UINT FCSCRC32;
- ARCFOURCONTEXT WEPCONTEXT;
- // Tkip stuff
- TKIP_KEY_INFO Tx;
- TKIP_KEY_INFO Rx;
-} PRIVATE_STRUC, *PPRIVATE_STRUC;
-
-
-/***************************************************************************
- * Channel and BBP related data structures
- **************************************************************************/
-// structure to tune BBP R66 (BBP TUNING)
-typedef struct _BBP_R66_TUNING {
- BOOLEAN bEnable;
- USHORT FalseCcaLowerThreshold; // default 100
- USHORT FalseCcaUpperThreshold; // default 512
- UCHAR R66Delta;
- UCHAR R66CurrentValue;
- BOOLEAN R66LowerUpperSelect; //Before LinkUp, Used LowerBound or UpperBound as R66 value.
-} BBP_R66_TUNING, *PBBP_R66_TUNING;
-
-// structure to store channel TX power
-typedef struct _CHANNEL_TX_POWER {
- USHORT RemainingTimeForUse; //unit: sec
- UCHAR Channel;
-#ifdef DOT11N_DRAFT3
- BOOLEAN bEffectedChannel; // For BW 40 operating in 2.4GHz , the "effected channel" is the channel that is covered in 40Mhz.
-#endif // DOT11N_DRAFT3 //
- CHAR Power;
- CHAR Power2;
- UCHAR MaxTxPwr;
- UCHAR DfsReq;
-} CHANNEL_TX_POWER, *PCHANNEL_TX_POWER;
-
-// structure to store 802.11j channel TX power
-typedef struct _CHANNEL_11J_TX_POWER {
- UCHAR Channel;
- UCHAR BW; // BW_10 or BW_20
- CHAR Power;
- CHAR Power2;
- USHORT RemainingTimeForUse; //unit: sec
-} CHANNEL_11J_TX_POWER, *PCHANNEL_11J_TX_POWER;
-
-typedef struct _SOFT_RX_ANT_DIVERSITY_STRUCT {
- UCHAR EvaluatePeriod; // 0:not evalute status, 1: evaluate status, 2: switching status
- UCHAR EvaluateStableCnt;
- UCHAR Pair1PrimaryRxAnt; // 0:Ant-E1, 1:Ant-E2
- UCHAR Pair1SecondaryRxAnt; // 0:Ant-E1, 1:Ant-E2
- UCHAR Pair2PrimaryRxAnt; // 0:Ant-E3, 1:Ant-E4
- UCHAR Pair2SecondaryRxAnt; // 0:Ant-E3, 1:Ant-E4
-#ifdef CONFIG_STA_SUPPORT
- SHORT Pair1AvgRssi[2]; // AvgRssi[0]:E1, AvgRssi[1]:E2
- SHORT Pair2AvgRssi[2]; // AvgRssi[0]:E3, AvgRssi[1]:E4
-#endif // CONFIG_STA_SUPPORT //
- SHORT Pair1LastAvgRssi; //
- SHORT Pair2LastAvgRssi; //
- ULONG RcvPktNumWhenEvaluate;
- BOOLEAN FirstPktArrivedWhenEvaluate;
- RALINK_TIMER_STRUCT RxAntDiversityTimer;
-} SOFT_RX_ANT_DIVERSITY, *PSOFT_RX_ANT_DIVERSITY;
-
-
-/***************************************************************************
- * structure for radar detection and channel switch
- **************************************************************************/
-typedef struct _RADAR_DETECT_STRUCT {
- //BOOLEAN IEEE80211H; // 0: disable, 1: enable IEEE802.11h
- UCHAR CSCount; //Channel switch counter
- UCHAR CSPeriod; //Channel switch period (beacon count)
- UCHAR RDCount; //Radar detection counter
- UCHAR RDMode; //Radar Detection mode
- UCHAR RDDurRegion; //Radar detection duration region
- UCHAR BBPR16;
- UCHAR BBPR17;
- UCHAR BBPR18;
- UCHAR BBPR21;
- UCHAR BBPR22;
- UCHAR BBPR64;
- ULONG InServiceMonitorCount; // unit: sec
- UINT8 DfsSessionTime;
-#ifdef DFS_FCC_BW40_FIX
- CHAR DfsSessionFccOff;
-#endif
- BOOLEAN bFastDfs;
- UINT8 ChMovingTime;
- UINT8 LongPulseRadarTh;
-#ifdef MERGE_ARCH_TEAM
- CHAR AvgRssiReq;
- ULONG DfsLowerLimit;
- ULONG DfsUpperLimit;
- UINT8 FixDfsLimit;
- ULONG upperlimit;
- ULONG lowerlimit;
-#endif // MERGE_ARCH_TEAM //
-} RADAR_DETECT_STRUCT, *PRADAR_DETECT_STRUCT;
-
-#ifdef CARRIER_DETECTION_SUPPORT
-typedef enum CD_STATE_n
-{
- CD_NORMAL,
- CD_SILENCE,
- CD_MAX_STATE
-} CD_STATE;
-
-#ifdef TONE_RADAR_DETECT_SUPPORT
-#define CARRIER_DETECT_RECHECK_TIME 3
-
-
-#ifdef CARRIER_SENSE_NEW_ALGO
-#define CARRIER_DETECT_CRITIRIA 400
-#define CARRIER_DETECT_STOP_RATIO 0x11
-#define CARRIER_DETECT_STOP_RATIO_OLD_3090 2
-#endif // CARRIER_SENSE_NEW_ALGO //
-
-
-#define CARRIER_DETECT_STOP_RECHECK_TIME 4
-#define CARRIER_DETECT_CRITIRIA_A 230
-#define CARRIER_DETECT_DELTA 7
-#define CARRIER_DETECT_DIV_FLAG 0
-#ifdef RT3090
-#define CARRIER_DETECT_THRESHOLD_3090A 0x1fffffff
-#endif // RT3090 //
-#ifdef RT3390
-#define CARRIER_DETECT_THRESHOLD 0x0fffffff
-#endif // RT3390 //
-#ifndef RT3390
-#define CARRIER_DETECT_THRESHOLD 0x0fffffff
-#endif // RT3390 //
-#endif // TONE_RADAR_DETECT_SUPPORT //
-
-typedef struct CARRIER_DETECTION_s
-{
- BOOLEAN Enable;
- UINT8 CDSessionTime;
- UINT8 CDPeriod;
- CD_STATE CD_State;
-#ifdef TONE_RADAR_DETECT_SUPPORT
- UINT8 delta;
- UINT8 div_flag;
- UINT32 threshold;
- UINT8 recheck;
- UINT8 recheck1;
- UINT8 recheck2;
- UINT32 TimeStamp;
- UINT32 criteria;
- UINT32 CarrierDebug;
- ULONG idle_time;
- ULONG busy_time;
- ULONG Debug;
-#endif // TONE_RADAR_DETECT_SUPPORT //
-}CARRIER_DETECTION_STRUCT, *PCARRIER_DETECTION_STRUCT;
-#endif // CARRIER_DETECTION_SUPPORT //
-
-
-#ifdef NEW_DFS
-typedef struct _NewDFSDebug
-{
- UCHAR channel;
- ULONG wait_time;
- UCHAR delta_delay_range;
- UCHAR delta_delay_step;
- UCHAR EL_range;
- UCHAR EL_step;
- UCHAR EH_range;
- UCHAR EH_step;
- UCHAR WL_range;
- UCHAR WL_step;
- UCHAR WH_range;
- UCHAR WH_step;
- ULONG T_expected;
- ULONG T_margin;
- UCHAR start;
- ULONG count;
- ULONG idx;
-
-}NewDFSDebug, *pNewDFSDebug;
-
-#define NEW_DFS_FCC_5_ENT_NUM 5
-#define NEW_DFS_DBG_PORT_ENT_NUM_POWER 8
-#define NEW_DFS_DBG_PORT_ENT_NUM (1 << NEW_DFS_DBG_PORT_ENT_NUM_POWER) // CE Debug Port entry number, 256
-#define NEW_DFS_DBG_PORT_MASK 0xff
-
-// Matched Period definition
-#define NEW_DFS_MPERIOD_ENT_NUM_POWER 8
-#define NEW_DFS_MPERIOD_ENT_NUM (1 << NEW_DFS_MPERIOD_ENT_NUM_POWER) // CE Period Table entry number, 512
-#define NEW_DFS_MAX_CHANNEL 4
-
-typedef struct _NewDFSDebugPort{
- ULONG counter;
- ULONG timestamp;
- USHORT width;
- USHORT start_idx; // start index to period table
- USHORT end_idx; // end index to period table
-}NewDFSDebugPort, *pNewDFSDebugPort;
-
-// Matched Period Table
-typedef struct _NewDFSMPeriod{
- USHORT idx;
- USHORT width;
- USHORT idx2;
- USHORT width2;
- ULONG period;
-}NewDFSMPeriod, *pNewDFSMPeriod;
-
-#endif // NEW_DFS //
-
-
-typedef enum _ABGBAND_STATE_ {
- UNKNOWN_BAND,
- BG_BAND,
- A_BAND,
-} ABGBAND_STATE;
-
-#ifdef RTMP_MAC_PCI
-#ifdef CONFIG_STA_SUPPORT
-// Power save method control
-typedef union _PS_CONTROL {
- struct {
- ULONG EnablePSinIdle:1; // Enable radio off when not connect to AP. radio on only when sitesurvey,
- ULONG EnableNewPS:1; // Enable new Chip power save fucntion . New method can only be applied in chip version after 2872. and PCIe.
- ULONG rt30xxPowerMode:2; // Power Level Mode for rt30xx chip
- ULONG rt30xxFollowHostASPM:1; // Card Follows Host's setting for rt30xx chip.
- ULONG rt30xxForceASPMTest:1; // Force enable L1 for rt30xx chip. This has higher priority than rt30xxFollowHostASPM Mode.
- ULONG rsv:26; // Radio Measurement Enable
- } field;
- ULONG word;
-} PS_CONTROL, *PPS_CONTROL;
-#endif // CONFIG_STA_SUPPORT //
-#endif // RTMP_MAC_PCI //
-/***************************************************************************
- * structure for MLME state machine
- **************************************************************************/
-typedef struct _MLME_STRUCT {
-#ifdef CONFIG_STA_SUPPORT
- // STA state machines
- STATE_MACHINE CntlMachine;
- STATE_MACHINE AssocMachine;
- STATE_MACHINE AuthMachine;
- STATE_MACHINE AuthRspMachine;
- STATE_MACHINE SyncMachine;
- STATE_MACHINE WpaPskMachine;
- STATE_MACHINE LeapMachine;
- STATE_MACHINE_FUNC AssocFunc[ASSOC_FUNC_SIZE];
- STATE_MACHINE_FUNC AuthFunc[AUTH_FUNC_SIZE];
- STATE_MACHINE_FUNC AuthRspFunc[AUTH_RSP_FUNC_SIZE];
- STATE_MACHINE_FUNC SyncFunc[SYNC_FUNC_SIZE];
-#endif // CONFIG_STA_SUPPORT //
- STATE_MACHINE_FUNC ActFunc[ACT_FUNC_SIZE];
- // Action
- STATE_MACHINE ActMachine;
-
-
-#ifdef QOS_DLS_SUPPORT
- STATE_MACHINE DlsMachine;
- STATE_MACHINE_FUNC DlsFunc[DLS_FUNC_SIZE];
-#endif // QOS_DLS_SUPPORT //
-
-
- // common WPA state machine
- STATE_MACHINE WpaMachine;
- STATE_MACHINE_FUNC WpaFunc[WPA_FUNC_SIZE];
-
-
-
- ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
- ULONG Now32; // latch the value of NdisGetSystemUpTime()
- ULONG LastSendNULLpsmTime;
-
- BOOLEAN bRunning;
- NDIS_SPIN_LOCK TaskLock;
- MLME_QUEUE Queue;
-
- UINT ShiftReg;
-
- RALINK_TIMER_STRUCT PeriodicTimer;
- RALINK_TIMER_STRUCT APSDPeriodicTimer;
- RALINK_TIMER_STRUCT LinkDownTimer;
- RALINK_TIMER_STRUCT LinkUpTimer;
-#ifdef RTMP_MAC_PCI
- UCHAR bPsPollTimerRunning;
- RALINK_TIMER_STRUCT PsPollTimer;
- RALINK_TIMER_STRUCT RadioOnOffTimer;
-#endif // RTMP_MAC_PCI //
- ULONG PeriodicRound;
- ULONG OneSecPeriodicRound;
-
- UCHAR RealRxPath;
- BOOLEAN bLowThroughput;
- BOOLEAN bEnableAutoAntennaCheck;
- RALINK_TIMER_STRUCT RxAntEvalTimer;
-
-#ifdef RT30xx
- UCHAR CaliBW40RfR24;
- UCHAR CaliBW20RfR24;
-#endif // RT30xx //
-
-} MLME_STRUCT, *PMLME_STRUCT;
-
-
-#ifdef DOT11_N_SUPPORT
-/***************************************************************************
- * 802.11 N related data structures
- **************************************************************************/
-struct reordering_mpdu
-{
- struct reordering_mpdu *next;
- PNDIS_PACKET pPacket; /* coverted to 802.3 frame */
- int Sequence; /* sequence number of MPDU */
- BOOLEAN bAMSDU;
-};
-
-struct reordering_list
-{
- struct reordering_mpdu *next;
- int qlen;
-};
-
-struct reordering_mpdu_pool
-{
- PVOID mem;
- NDIS_SPIN_LOCK lock;
- struct reordering_list freelist;
-};
-
-typedef enum _REC_BLOCKACK_STATUS
-{
- Recipient_NONE=0,
- Recipient_USED,
- Recipient_HandleRes,
- Recipient_Accept
-} REC_BLOCKACK_STATUS, *PREC_BLOCKACK_STATUS;
-
-typedef enum _ORI_BLOCKACK_STATUS
-{
- Originator_NONE=0,
- Originator_USED,
- Originator_WaitRes,
- Originator_Done
-} ORI_BLOCKACK_STATUS, *PORI_BLOCKACK_STATUS;
-
-typedef struct _BA_ORI_ENTRY{
- UCHAR Wcid;
- UCHAR TID;
- UCHAR BAWinSize;
- UCHAR Token;
-// Sequence is to fill every outgoing QoS DATA frame's sequence field in 802.11 header.
- USHORT Sequence;
- USHORT TimeOutValue;
- ORI_BLOCKACK_STATUS ORI_BA_Status;
- RALINK_TIMER_STRUCT ORIBATimer;
- PVOID pAdapter;
-} BA_ORI_ENTRY, *PBA_ORI_ENTRY;
-
-typedef struct _BA_REC_ENTRY {
- UCHAR Wcid;
- UCHAR TID;
- UCHAR BAWinSize; // 7.3.1.14. each buffer is capable of holding a max AMSDU or MSDU.
- //UCHAR NumOfRxPkt;
- //UCHAR Curindidx; // the head in the RX reordering buffer
- USHORT LastIndSeq;
-// USHORT LastIndSeqAtTimer;
- USHORT TimeOutValue;
- RALINK_TIMER_STRUCT RECBATimer;
- ULONG LastIndSeqAtTimer;
- ULONG nDropPacket;
- ULONG rcvSeq;
- REC_BLOCKACK_STATUS REC_BA_Status;
-// UCHAR RxBufIdxUsed;
- // corresponding virtual address for RX reordering packet storage.
- //RTMP_REORDERDMABUF MAP_RXBuf[MAX_RX_REORDERBUF];
- NDIS_SPIN_LOCK RxReRingLock; // Rx Ring spinlock
-// struct _BA_REC_ENTRY *pNext;
- PVOID pAdapter;
- struct reordering_list list;
-} BA_REC_ENTRY, *PBA_REC_ENTRY;
-
-
-typedef struct {
- ULONG numAsRecipient; // I am recipient of numAsRecipient clients. These client are in the BARecEntry[]
- ULONG numAsOriginator; // I am originator of numAsOriginator clients. These clients are in the BAOriEntry[]
- ULONG numDoneOriginator; // count Done Originator sessions
- BA_ORI_ENTRY BAOriEntry[MAX_LEN_OF_BA_ORI_TABLE];
- BA_REC_ENTRY BARecEntry[MAX_LEN_OF_BA_REC_TABLE];
-} BA_TABLE, *PBA_TABLE;
-
-//For QureyBATableOID use;
-typedef struct PACKED _OID_BA_REC_ENTRY{
- UCHAR MACAddr[MAC_ADDR_LEN];
- UCHAR BaBitmap; // if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize
- UCHAR rsv;
- UCHAR BufSize[8];
- REC_BLOCKACK_STATUS REC_BA_Status[8];
-} OID_BA_REC_ENTRY, *POID_BA_REC_ENTRY;
-
-//For QureyBATableOID use;
-typedef struct PACKED _OID_BA_ORI_ENTRY{
- UCHAR MACAddr[MAC_ADDR_LEN];
- UCHAR BaBitmap; // if (BaBitmap&(1<<TID)), this session with{MACAddr, TID}exists, so read BufSize[TID] for BufferSize, read ORI_BA_Status[TID] for status
- UCHAR rsv;
- UCHAR BufSize[8];
- ORI_BLOCKACK_STATUS ORI_BA_Status[8];
-} OID_BA_ORI_ENTRY, *POID_BA_ORI_ENTRY;
-
-typedef struct _QUERYBA_TABLE{
- OID_BA_ORI_ENTRY BAOriEntry[32];
- OID_BA_REC_ENTRY BARecEntry[32];
- UCHAR OriNum;// Number of below BAOriEntry
- UCHAR RecNum;// Number of below BARecEntry
-} QUERYBA_TABLE, *PQUERYBA_TABLE;
-
-typedef union _BACAP_STRUC {
-#ifdef RT_BIG_ENDIAN
- struct {
- UINT32 :4;
- UINT32 b2040CoexistScanSup:1; //As Sta, support do 2040 coexistence scan for AP. As Ap, support monitor trigger event to check if can use BW 40MHz.
- UINT32 bHtAdhoc:1; // adhoc can use ht rate.
- UINT32 MMPSmode:2; // MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable
- UINT32 AmsduSize:1; // 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935};
- UINT32 AmsduEnable:1; //Enable AMSDU transmisstion
- UINT32 MpduDensity:3;
- UINT32 Policy:2; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use
- UINT32 AutoBA:1; // automatically BA
- UINT32 TxBAWinLimit:8;
- UINT32 RxBAWinLimit:8;
- } field;
-#else
- struct {
- UINT32 RxBAWinLimit:8;
- UINT32 TxBAWinLimit:8;
- UINT32 AutoBA:1; // automatically BA
- UINT32 Policy:2; // 0: DELAY_BA 1:IMMED_BA (//BA Policy subfiled value in ADDBA frame) 2:BA-not use
- UINT32 MpduDensity:3;
- UINT32 AmsduEnable:1; //Enable AMSDU transmisstion
- UINT32 AmsduSize:1; // 0:3839, 1:7935 bytes. UINT MSDUSizeToBytes[] = { 3839, 7935};
- UINT32 MMPSmode:2; // MIMO power save more, 0:static, 1:dynamic, 2:rsv, 3:mimo enable
- UINT32 bHtAdhoc:1; // adhoc can use ht rate.
- UINT32 b2040CoexistScanSup:1; //As Sta, support do 2040 coexistence scan for AP. As Ap, support monitor trigger event to check if can use BW 40MHz.
- UINT32 :4;
- } field;
-#endif
- UINT32 word;
-} BACAP_STRUC, *PBACAP_STRUC;
-
-
-typedef struct {
- BOOLEAN IsRecipient;
- UCHAR MACAddr[MAC_ADDR_LEN];
- UCHAR TID;
- UCHAR nMSDU;
- USHORT TimeOut;
- BOOLEAN bAllTid; // If True, delete all TID for BA sessions with this MACaddr.
-} OID_ADD_BA_ENTRY, *POID_ADD_BA_ENTRY;
-
-
-#ifdef DOT11N_DRAFT3
-typedef enum _BSS2040COEXIST_FLAG{
- BSS_2040_COEXIST_DISABLE = 0,
- BSS_2040_COEXIST_TIMER_FIRED = 1,
- BSS_2040_COEXIST_INFO_SYNC = 2,
- BSS_2040_COEXIST_INFO_NOTIFY = 4,
-}BSS2040COEXIST_FLAG;
-#endif // DOT11N_DRAFT3 //
-
-#define IS_HT_STA(_pMacEntry) \
- (_pMacEntry->MaxHTPhyMode.field.MODE >= MODE_HTMIX)
-
-#define IS_HT_RATE(_pMacEntry) \
- (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
-
-#define PEER_IS_HT_RATE(_pMacEntry) \
- (_pMacEntry->HTPhyMode.field.MODE >= MODE_HTMIX)
-
-#endif // DOT11_N_SUPPORT //
-
-
-//This structure is for all 802.11n card InterOptibilityTest action. Reset all Num every n second. (Details see MLMEPeriodic)
-typedef struct _IOT_STRUC {
- UCHAR Threshold[2];
- UCHAR ReorderTimeOutNum[MAX_LEN_OF_BA_REC_TABLE]; // compare with threshold[0]
- UCHAR RefreshNum[MAX_LEN_OF_BA_REC_TABLE]; // compare with threshold[1]
- ULONG OneSecInWindowCount;
- ULONG OneSecFrameDuplicateCount;
- ULONG OneSecOutWindowCount;
- UCHAR DelOriAct;
- UCHAR DelRecAct;
- UCHAR RTSShortProt;
- UCHAR RTSLongProt;
- BOOLEAN bRTSLongProtOn;
-#ifdef CONFIG_STA_SUPPORT
- BOOLEAN bLastAtheros;
- BOOLEAN bCurrentAtheros;
- BOOLEAN bNowAtherosBurstOn;
- BOOLEAN bNextDisableRxBA;
- BOOLEAN bToggle;
-#endif // CONFIG_STA_SUPPORT //
-} IOT_STRUC, *PIOT_STRUC;
-
-
-// This is the registry setting for 802.11n transmit setting. Used in advanced page.
-typedef union _REG_TRANSMIT_SETTING {
-#ifdef RT_BIG_ENDIAN
- struct {
- UINT32 rsv:13;
- UINT32 EXTCHA:2;
- UINT32 HTMODE:1;
- UINT32 TRANSNO:2;
- UINT32 STBC:1; //SPACE
- UINT32 ShortGI:1;
- UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
- UINT32 TxBF:1; // 3*3
- UINT32 rsv0:10;
- //UINT32 MCS:7; // MCS
- //UINT32 PhyMode:4;
- } field;
-#else
- struct {
- //UINT32 PhyMode:4;
- //UINT32 MCS:7; // MCS
- UINT32 rsv0:10;
- UINT32 TxBF:1;
- UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
- UINT32 ShortGI:1;
- UINT32 STBC:1; //SPACE
- UINT32 TRANSNO:2;
- UINT32 HTMODE:1;
- UINT32 EXTCHA:2;
- UINT32 rsv:13;
- } field;
-#endif
- UINT32 word;
-} REG_TRANSMIT_SETTING, *PREG_TRANSMIT_SETTING;
-
-
-typedef union _DESIRED_TRANSMIT_SETTING {
-#ifdef RT_BIG_ENDIAN
- struct {
- USHORT rsv:3;
- USHORT FixedTxMode:2; // If MCS isn't AUTO, fix rate in CCK, OFDM or HT mode.
- USHORT PhyMode:4;
- USHORT MCS:7; // MCS
- } field;
-#else
- struct {
- USHORT MCS:7; // MCS
- USHORT PhyMode:4;
- USHORT FixedTxMode:2; // If MCS isn't AUTO, fix rate in CCK, OFDM or HT mode.
- USHORT rsv:3;
- } field;
-#endif
- USHORT word;
- } DESIRED_TRANSMIT_SETTING, *PDESIRED_TRANSMIT_SETTING;
-
-
-
-
-/***************************************************************************
- * Multiple SSID related data structures
- **************************************************************************/
-#define WLAN_MAX_NUM_OF_TIM ((MAX_LEN_OF_MAC_TABLE >> 3) + 1) /* /8 + 1 */
-#define WLAN_CT_TIM_BCMC_OFFSET 0 /* unit: 32B */
-
-/* clear bcmc TIM bit */
-#define WLAN_MR_TIM_BCMC_CLEAR(apidx) \
- pAd->ApCfg.MBSSID[apidx].TimBitmaps[WLAN_CT_TIM_BCMC_OFFSET] &= ~BIT8[0];
-
-/* set bcmc TIM bit */
-#define WLAN_MR_TIM_BCMC_SET(apidx) \
- pAd->ApCfg.MBSSID[apidx].TimBitmaps[WLAN_CT_TIM_BCMC_OFFSET] |= BIT8[0];
-
-/* clear a station PS TIM bit */
-#define WLAN_MR_TIM_BIT_CLEAR(ad_p, apidx, wcid) \
- { UCHAR tim_offset = wcid >> 3; \
- UCHAR bit_offset = wcid & 0x7; \
- ad_p->ApCfg.MBSSID[apidx].TimBitmaps[tim_offset] &= (~BIT8[bit_offset]); }
-
-/* set a station PS TIM bit */
-#define WLAN_MR_TIM_BIT_SET(ad_p, apidx, wcid) \
- { UCHAR tim_offset = wcid >> 3; \
- UCHAR bit_offset = wcid & 0x7; \
- ad_p->ApCfg.MBSSID[apidx].TimBitmaps[tim_offset] |= BIT8[bit_offset]; }
-
-
-// configuration common to OPMODE_AP as well as OPMODE_STA
-typedef struct _COMMON_CONFIG {
-
- BOOLEAN bCountryFlag;
- UCHAR CountryCode[3];
- UCHAR Geography;
- UCHAR CountryRegion; // Enum of country region, 0:FCC, 1:IC, 2:ETSI, 3:SPAIN, 4:France, 5:MKK, 6:MKK1, 7:Israel
- UCHAR CountryRegionForABand; // Enum of country region for A band
- UCHAR PhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
- UCHAR DesiredPhyMode; // PHY_11A, PHY_11B, PHY_11BG_MIXED, PHY_ABG_MIXED
- USHORT Dsifs; // in units of usec
- ULONG PacketFilter; // Packet filter for receiving
- UINT8 RegulatoryClass[MAX_NUM_OF_REGULATORY_CLASS];
-
- CHAR Ssid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
- UCHAR SsidLen; // the actual ssid length in used
- UCHAR LastSsidLen; // the actual ssid length in used
- CHAR LastSsid[MAX_LEN_OF_SSID]; // NOT NULL-terminated
- UCHAR LastBssid[MAC_ADDR_LEN];
-
- UCHAR Bssid[MAC_ADDR_LEN];
- USHORT BeaconPeriod;
- UCHAR Channel;
- UCHAR CentralChannel; // Central Channel when using 40MHz is indicating. not real channel.
-
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen;
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR ExtRateLen;
- UCHAR DesireRate[MAX_LEN_OF_SUPPORTED_RATES]; // OID_802_11_DESIRED_RATES
- UCHAR MaxDesiredRate;
- UCHAR ExpectedACKRate[MAX_LEN_OF_SUPPORTED_RATES];
-
- ULONG BasicRateBitmap; // backup basic ratebitmap
-
- BOOLEAN bAPSDCapable;
- BOOLEAN bInServicePeriod;
- BOOLEAN bAPSDAC_BE;
- BOOLEAN bAPSDAC_BK;
- BOOLEAN bAPSDAC_VI;
- BOOLEAN bAPSDAC_VO;
-
- /* because TSPEC can modify the APSD flag, we need to keep the APSD flag
- requested in association stage from the station;
- we need to recover the APSD flag after the TSPEC is deleted. */
- BOOLEAN bACMAPSDBackup[4]; /* for delivery-enabled & trigger-enabled both */
- BOOLEAN bACMAPSDTr[4]; /* no use */
-
- BOOLEAN bNeedSendTriggerFrame;
- BOOLEAN bAPSDForcePowerSave; // Force power save mode, should only use in APSD-STAUT
- ULONG TriggerTimerCount;
- UCHAR MaxSPLength;
- UCHAR BBPCurrentBW; // BW_10, BW_20, BW_40
- // move to MULTISSID_STRUCT for MBSS
- //HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
- REG_TRANSMIT_SETTING RegTransmitSetting; //registry transmit setting. this is for reading registry setting only. not useful.
- //UCHAR FixedTxMode; // Fixed Tx Mode (CCK, OFDM), for HT fixed tx mode (GF, MIX) , refer to RegTransmitSetting.field.HTMode
- UCHAR TxRate; // Same value to fill in TXD. TxRate is 6-bit
- UCHAR MaxTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
- UCHAR TxRateIndex; // Tx rate index in RateSwitchTable
- UCHAR TxRateTableSize; // Valid Tx rate table size in RateSwitchTable
- //BOOLEAN bAutoTxRateSwitch;
- UCHAR MinTxRate; // RATE_1, RATE_2, RATE_5_5, RATE_11
- UCHAR RtsRate; // RATE_xxx
- HTTRANSMIT_SETTING MlmeTransmit; // MGMT frame PHY rate setting when operatin at Ht rate.
- UCHAR MlmeRate; // RATE_xxx, used to send MLME frames
- UCHAR BasicMlmeRate; // Default Rate for sending MLME frames
-
- USHORT RtsThreshold; // in unit of BYTE
- USHORT FragmentThreshold; // in unit of BYTE
-
- UCHAR TxPower; // in unit of mW
- ULONG TxPowerPercentage; // 0~100 %
- ULONG TxPowerDefault; // keep for TxPowerPercentage
- UINT8 PwrConstraint;
-
-#ifdef DOT11_N_SUPPORT
- BACAP_STRUC BACapability; // NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0
- BACAP_STRUC REGBACapability; // NO USE = 0XFF ; IMMED_BA =1 ; DELAY_BA=0
-#endif // DOT11_N_SUPPORT //
- IOT_STRUC IOTestParm; // 802.11n InterOpbility Test Parameter;
- ULONG TxPreamble; // Rt802_11PreambleLong, Rt802_11PreambleShort, Rt802_11PreambleAuto
- BOOLEAN bUseZeroToDisableFragment; // Microsoft use 0 as disable
- ULONG UseBGProtection; // 0: auto, 1: always use, 2: always not use
- BOOLEAN bUseShortSlotTime; // 0: disable, 1 - use short slot (9us)
- BOOLEAN bEnableTxBurst; // 1: enble TX PACKET BURST (when BA is established or AP is not a legacy WMM AP), 0: disable TX PACKET BURST
- BOOLEAN bAggregationCapable; // 1: enable TX aggregation when the peer supports it
- BOOLEAN bPiggyBackCapable; // 1: enable TX piggy-back according MAC's version
- BOOLEAN bIEEE80211H; // 1: enable IEEE802.11h spec.
- ULONG DisableOLBCDetect; // 0: enable OLBC detect; 1 disable OLBC detect
-
-#ifdef DOT11_N_SUPPORT
- BOOLEAN bRdg;
-#endif // DOT11_N_SUPPORT //
- BOOLEAN bWmmCapable; // 0:disable WMM, 1:enable WMM
- QOS_CAPABILITY_PARM APQosCapability; // QOS capability of the current associated AP
- EDCA_PARM APEdcaParm; // EDCA parameters of the current associated AP
- QBSS_LOAD_PARM APQbssLoad; // QBSS load of the current associated AP
- UCHAR AckPolicy[4]; // ACK policy of the specified AC. see ACK_xxx
-#ifdef CONFIG_STA_SUPPORT
- BOOLEAN bDLSCapable; // 0:disable DLS, 1:enable DLS
-#endif // CONFIG_STA_SUPPORT //
- // a bitmap of BOOLEAN flags. each bit represent an operation status of a particular
- // BOOLEAN control, either ON or OFF. These flags should always be accessed via
- // OPSTATUS_TEST_FLAG(), OPSTATUS_SET_FLAG(), OP_STATUS_CLEAR_FLAG() macros.
- // see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition
- ULONG OpStatusFlags;
-
- BOOLEAN NdisRadioStateOff; //For HCT 12.0, set this flag to TRUE instead of called MlmeRadioOff.
- ABGBAND_STATE BandState; // For setting BBP used on B/G or A mode.
-#ifdef ANT_DIVERSITY_SUPPORT
- UCHAR bRxAntDiversity; // 0:disable, 1:enable Software Rx Antenna Diversity.
-#endif // ANT_DIVERSITY_SUPPORT //
-
- // IEEE802.11H--DFS.
- RADAR_DETECT_STRUCT RadarDetect;
-
-#ifdef CARRIER_DETECTION_SUPPORT
- CARRIER_DETECTION_STRUCT CarrierDetect;
-#endif // CARRIER_DETECTION_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
- // HT
- UCHAR BASize; // USer desired BAWindowSize. Should not exceed our max capability
- //RT_HT_CAPABILITY SupportedHtPhy;
- RT_HT_CAPABILITY DesiredHtPhy;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHTInfo; // Useful as AP.
- //This IE is used with channel switch announcement element when changing to a new 40MHz.
- //This IE is included in channel switch ammouncement frames 7.4.1.5, beacons, probe Rsp.
- NEW_EXT_CHAN_IE NewExtChanOffset; //7.3.2.20A, 1 if extension channel is above the control channel, 3 if below, 0 if not present
-
-#ifdef DOT11N_DRAFT3
- UCHAR Bss2040CoexistFlag; // bit 0: bBssCoexistTimerRunning, bit 1: NeedSyncAddHtInfo.
- RALINK_TIMER_STRUCT Bss2040CoexistTimer;
-
- //This IE is used for 20/40 BSS Coexistence.
- BSS_2040_COEXIST_IE BSS2040CoexistInfo;
- // ====== 11n D3.0 =======================>
- USHORT Dot11OBssScanPassiveDwell; // Unit : TU. 5~1000
- USHORT Dot11OBssScanActiveDwell; // Unit : TU. 10~1000
- USHORT Dot11BssWidthTriggerScanInt; // Unit : Second
- USHORT Dot11OBssScanPassiveTotalPerChannel; // Unit : TU. 200~10000
- USHORT Dot11OBssScanActiveTotalPerChannel; // Unit : TU. 20~10000
- USHORT Dot11BssWidthChanTranDelayFactor;
- USHORT Dot11OBssScanActivityThre; // Unit : percentage
-
- ULONG Dot11BssWidthChanTranDelay; // multiple of (Dot11BssWidthTriggerScanInt * Dot11BssWidthChanTranDelayFactor)
- ULONG CountDownCtr; // CountDown Counter from (Dot11BssWidthTriggerScanInt * Dot11BssWidthChanTranDelayFactor)
-
- NDIS_SPIN_LOCK TriggerEventTabLock;
- BSS_2040_COEXIST_IE LastBSSCoexist2040;
- BSS_2040_COEXIST_IE BSSCoexist2040;
- TRIGGER_EVENT_TAB TriggerEventTab;
- UCHAR ChannelListIdx;
- // <====== 11n D3.0 =======================
- BOOLEAN bOverlapScanning;
-#endif // DOT11N_DRAFT3 //
-
- BOOLEAN bHTProtect;
- BOOLEAN bMIMOPSEnable;
- BOOLEAN bBADecline;
-//2008/11/05: KH add to support Antenna power-saving of AP<--
- BOOLEAN bGreenAPEnable;
- BOOLEAN bBlockAntDivforGreenAP;
-//2008/11/05: KH add to support Antenna power-saving of AP-->
- BOOLEAN bDisableReordering;
- BOOLEAN bForty_Mhz_Intolerant;
- BOOLEAN bExtChannelSwitchAnnouncement;
- BOOLEAN bRcvBSSWidthTriggerEvents;
- ULONG LastRcvBSSWidthTriggerEventsTime;
-
- UCHAR TxBASize;
-#endif // DOT11_N_SUPPORT //
-
- // Enable wireless event
- BOOLEAN bWirelessEvent;
- BOOLEAN bWiFiTest; // Enable this parameter for WiFi test
-
- // Tx & Rx Stream number selection
- UCHAR TxStream;
- UCHAR RxStream;
-
- // transmit phy mode, trasmit rate for Multicast.
-#ifdef MCAST_RATE_SPECIFIC
- UCHAR McastTransmitMcs;
- UCHAR McastTransmitPhyMode;
-#endif // MCAST_RATE_SPECIFIC //
-
- BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
-
-
-
- NDIS_SPIN_LOCK MeasureReqTabLock;
- PMEASURE_REQ_TAB pMeasureReqTab;
-
- NDIS_SPIN_LOCK TpcReqTabLock;
- PTPC_REQ_TAB pTpcReqTab;
-
- // transmit phy mode, trasmit rate for Multicast.
-#ifdef MCAST_RATE_SPECIFIC
- HTTRANSMIT_SETTING MCastPhyMode;
-#endif // MCAST_RATE_SPECIFIC //
-
-#ifdef SINGLE_SKU
- UINT16 DefineMaxTxPwr;
-#endif // SINGLE_SKU //
-
-
- BOOLEAN PSPXlink; // 0: Disable. 1: Enable
-
-
-#if defined(RT305x)||defined(RT30xx)
- // request by Gary, for High Power issue
- UCHAR HighPowerPatchDisabled;
-#endif
-
- BOOLEAN HT_DisallowTKIP; /* Restrict the encryption type in 11n HT mode */
-} COMMON_CONFIG, *PCOMMON_CONFIG;
-
-
-#ifdef CONFIG_STA_SUPPORT
-/* Modified by Wu Xi-Kun 4/21/2006 */
-// STA configuration and status
-typedef struct _STA_ADMIN_CONFIG {
- // GROUP 1 -
- // User configuration loaded from Registry, E2PROM or OID_xxx. These settings describe
- // the user intended configuration, but not necessary fully equal to the final
- // settings in ACTIVE BSS after negotiation/compromize with the BSS holder (either
- // AP or IBSS holder).
- // Once initialized, user configuration can only be changed via OID_xxx
- UCHAR BssType; // BSS_INFRA or BSS_ADHOC
- USHORT AtimWin; // used when starting a new IBSS
-
- // GROUP 2 -
- // User configuration loaded from Registry, E2PROM or OID_xxx. These settings describe
- // the user intended configuration, and should be always applied to the final
- // settings in ACTIVE BSS without compromising with the BSS holder.
- // Once initialized, user configuration can only be changed via OID_xxx
- UCHAR RssiTrigger;
- UCHAR RssiTriggerMode; // RSSI_TRIGGERED_UPON_BELOW_THRESHOLD or RSSI_TRIGGERED_UPON_EXCCEED_THRESHOLD
- USHORT DefaultListenCount; // default listen count;
- ULONG WindowsPowerMode; // Power mode for AC power
- ULONG WindowsBatteryPowerMode; // Power mode for battery if exists
- BOOLEAN bWindowsACCAMEnable; // Enable CAM power mode when AC on
- BOOLEAN bAutoReconnect; // Set to TRUE when setting OID_802_11_SSID with no matching BSSID
- ULONG WindowsPowerProfile; // Windows power profile, for NDIS5.1 PnP
-
- // MIB:ieee802dot11.dot11smt(1).dot11StationConfigTable(1)
- USHORT Psm; // power management mode (PWR_ACTIVE|PWR_SAVE)
- USHORT DisassocReason;
- UCHAR DisassocSta[MAC_ADDR_LEN];
- USHORT DeauthReason;
- UCHAR DeauthSta[MAC_ADDR_LEN];
- USHORT AuthFailReason;
- UCHAR AuthFailSta[MAC_ADDR_LEN];
-
- NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
- NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
- NDIS_802_11_WEP_STATUS WepStatus;
- NDIS_802_11_WEP_STATUS OrigWepStatus; // Original wep status set from OID
-
- // Add to support different cipher suite for WPA2/WPA mode
- NDIS_802_11_ENCRYPTION_STATUS GroupCipher; // Multicast cipher suite
- NDIS_802_11_ENCRYPTION_STATUS PairCipher; // Unicast cipher suite
- BOOLEAN bMixCipher; // Indicate current Pair & Group use different cipher suites
- USHORT RsnCapability;
-
- NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
-
- UCHAR WpaPassPhrase[64]; // WPA PSK pass phrase
- UINT WpaPassPhraseLen; // the length of WPA PSK pass phrase
- UCHAR PMK[32]; // WPA PSK mode PMK
- UCHAR PTK[64]; // WPA PSK mode PTK
- UCHAR GTK[32]; // GTK from authenticator
- BSSID_INFO SavedPMK[PMKID_NO];
- UINT SavedPMKNum; // Saved PMKID number
-
- UCHAR DefaultKeyId;
-
-
- // WPA 802.1x port control, WPA_802_1X_PORT_SECURED, WPA_802_1X_PORT_NOT_SECURED
- UCHAR PortSecured;
-
- // For WPA countermeasures
- ULONG LastMicErrorTime; // record last MIC error time
- ULONG MicErrCnt; // Should be 0, 1, 2, then reset to zero (after disassoiciation).
- BOOLEAN bBlockAssoc; // Block associate attempt for 60 seconds after counter measure occurred.
- // For WPA-PSK supplicant state
- WPA_STATE WpaState; // Default is SS_NOTUSE and handled by microsoft 802.1x
- UCHAR ReplayCounter[8];
- UCHAR ANonce[32]; // ANonce for WPA-PSK from aurhenticator
- UCHAR SNonce[32]; // SNonce for WPA-PSK
-
- UCHAR LastSNR0; // last received BEACON's SNR
- UCHAR LastSNR1; // last received BEACON's SNR for 2nd antenna
- RSSI_SAMPLE RssiSample;
- ULONG NumOfAvgRssiSample;
-
- ULONG LastBeaconRxTime; // OS's timestamp of the last BEACON RX time
- ULONG Last11bBeaconRxTime; // OS's timestamp of the last 11B BEACON RX time
- ULONG Last11gBeaconRxTime; // OS's timestamp of the last 11G BEACON RX time
- ULONG Last20NBeaconRxTime; // OS's timestamp of the last 20MHz N BEACON RX time
-
- ULONG LastScanTime; // Record last scan time for issue BSSID_SCAN_LIST
- ULONG ScanCnt; // Scan counts since most recent SSID, BSSID, SCAN OID request
- BOOLEAN bSwRadio; // Software controlled Radio On/Off, TRUE: On
- BOOLEAN bHwRadio; // Hardware controlled Radio On/Off, TRUE: On
- BOOLEAN bRadio; // Radio state, And of Sw & Hw radio state
- BOOLEAN bHardwareRadio; // Hardware controlled Radio enabled
- BOOLEAN bShowHiddenSSID; // Show all known SSID in SSID list get operation
-
- // New for WPA, windows want us to to keep association information and
- // Fixed IEs from last association response
- NDIS_802_11_ASSOCIATION_INFORMATION AssocInfo;
- USHORT ReqVarIELen; // Length of next VIE include EID & Length
- UCHAR ReqVarIEs[MAX_VIE_LEN]; // The content saved here should be little-endian format.
- USHORT ResVarIELen; // Length of next VIE include EID & Length
- UCHAR ResVarIEs[MAX_VIE_LEN];
-
- UCHAR RSNIE_Len;
- UCHAR RSN_IE[MAX_LEN_OF_RSNIE]; // The content saved here should be little-endian format.
-
- ULONG CLBusyBytes; // Save the total bytes received durning channel load scan time
- USHORT RPIDensity[8]; // Array for RPI density collection
-
- UCHAR RMReqCnt; // Number of measurement request saved.
- UCHAR CurrentRMReqIdx; // Number of measurement request saved.
- BOOLEAN ParallelReq; // Parallel measurement, only one request performed,
- // It must be the same channel with maximum duration
- USHORT ParallelDuration; // Maximum duration for parallel measurement
- UCHAR ParallelChannel; // Only one channel with parallel measurement
- USHORT IAPPToken; // IAPP dialog token
- // Hack for channel load and noise histogram parameters
- UCHAR NHFactor; // Parameter for Noise histogram
- UCHAR CLFactor; // Parameter for channel load
-
- RALINK_TIMER_STRUCT StaQuickResponeForRateUpTimer;
- BOOLEAN StaQuickResponeForRateUpTimerRunning;
-
- UCHAR DtimCount; // 0.. DtimPeriod-1
- UCHAR DtimPeriod; // default = 3
-
-#ifdef QOS_DLS_SUPPORT
- RT_802_11_DLS DLSEntry[MAX_NUM_OF_DLS_ENTRY];
- UCHAR DlsReplayCounter[8];
-#endif // QOS_DLS_SUPPORT //
- ////////////////////////////////////////////////////////////////////////////////////////
- // This is only for WHQL test.
- BOOLEAN WhqlTest;
- ////////////////////////////////////////////////////////////////////////////////////////
-
- RALINK_TIMER_STRUCT WpaDisassocAndBlockAssocTimer;
- // Fast Roaming
- BOOLEAN bAutoRoaming; // 0:disable auto roaming by RSSI, 1:enable auto roaming by RSSI
- CHAR dBmToRoam; // the condition to roam when receiving Rssi less than this value. It's negative value.
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- BOOLEAN IEEE8021X;
- BOOLEAN IEEE8021x_required_keys;
- CIPHER_KEY DesireSharedKey[4]; // Record user desired WEP keys
- UCHAR DesireSharedKeyId;
-
- // 0: driver ignores wpa_supplicant
- // 1: wpa_supplicant initiates scanning and AP selection
- // 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters
- UCHAR WpaSupplicantUP;
- UCHAR WpaSupplicantScanCount;
- BOOLEAN bRSN_IE_FromWpaSupplicant;
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- CHAR dev_name[16];
- USHORT OriDevType;
-
- BOOLEAN bTGnWifiTest;
- BOOLEAN bScanReqIsFromWebUI;
-
- HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
- DESIRED_TRANSMIT_SETTING DesiredTransmitSetting;
- RT_HT_PHY_INFO DesiredHtPhyInfo;
- BOOLEAN bAutoTxRateSwitch;
-
-#ifdef RTMP_MAC_PCI
- UCHAR BBPR3;
- // PS Control has 2 meanings for advanced power save function.
- // 1. EnablePSinIdle : When no connection, always radio off except need to do site survey.
- // 2. EnableNewPS : will save more current in sleep or radio off mode.
- PS_CONTROL PSControl;
-#endif // RTMP_MAC_PCI //
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- UCHAR IEEE80211dClientMode;
- UCHAR StaOriCountryCode[3];
- UCHAR StaOriGeography;
-#endif // EXT_BUILD_CHANNEL_LIST //
-
-
-
- BOOLEAN bAutoConnectByBssid;
- ULONG BeaconLostTime; // seconds
- BOOLEAN bForceTxBurst; // 1: force enble TX PACKET BURST, 0: disable
-} STA_ADMIN_CONFIG, *PSTA_ADMIN_CONFIG;
-
-// This data structure keep the current active BSS/IBSS's configuration that this STA
-// had agreed upon joining the network. Which means these parameters are usually decided
-// by the BSS/IBSS creator instead of user configuration. Data in this data structurre
-// is valid only when either ADHOC_ON(pAd) or INFRA_ON(pAd) is TRUE.
-// Normally, after SCAN or failed roaming attempts, we need to recover back to
-// the current active settings.
-typedef struct _STA_ACTIVE_CONFIG {
- USHORT Aid;
- USHORT AtimWin; // in kusec; IBSS parameter set element
- USHORT CapabilityInfo;
- USHORT CfpMaxDuration;
- USHORT CfpPeriod;
-
- // Copy supported rate from desired AP's beacon. We are trying to match
- // AP's supported and extended rate settings.
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen;
- UCHAR ExtRateLen;
- // Copy supported ht from desired AP's beacon. We are trying to match
- RT_HT_PHY_INFO SupportedPhyInfo;
- RT_HT_CAPABILITY SupportedHtPhy;
-} STA_ACTIVE_CONFIG, *PSTA_ACTIVE_CONFIG;
-
-
-
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-typedef struct _MAC_TABLE_ENTRY {
- //Choose 1 from ValidAsWDS and ValidAsCLI to validize.
- BOOLEAN ValidAsCLI; // Sta mode, set this TRUE after Linkup,too.
- BOOLEAN ValidAsWDS; // This is WDS Entry. only for AP mode.
- BOOLEAN ValidAsApCli; //This is a AP-Client entry, only for AP mode which enable AP-Client functions.
- BOOLEAN ValidAsMesh;
- BOOLEAN ValidAsDls; // This is DLS Entry. only for STA mode.
- BOOLEAN isCached;
- BOOLEAN bIAmBadAtheros; // Flag if this is Atheros chip that has IOT problem. We need to turn on RTS/CTS protection.
-
- UCHAR EnqueueEapolStartTimerRunning; // Enqueue EAPoL-Start for triggering EAP SM
- //jan for wpa
- // record which entry revoke MIC Failure , if it leaves the BSS itself, AP won't update aMICFailTime MIB
- UCHAR CMTimerRunning;
- UCHAR apidx; // MBSS number
- UCHAR RSNIE_Len;
- UCHAR RSN_IE[MAX_LEN_OF_RSNIE];
- UCHAR ANonce[LEN_KEY_DESC_NONCE];
- UCHAR SNonce[LEN_KEY_DESC_NONCE];
- UCHAR R_Counter[LEN_KEY_DESC_REPLAY];
- UCHAR PTK[64];
- UCHAR ReTryCounter;
- RALINK_TIMER_STRUCT RetryTimer;
- RALINK_TIMER_STRUCT EnqueueStartForPSKTimer; // A timer which enqueue EAPoL-Start for triggering PSK SM
- NDIS_802_11_AUTHENTICATION_MODE AuthMode; // This should match to whatever microsoft defined
- NDIS_802_11_WEP_STATUS WepStatus;
- NDIS_802_11_WEP_STATUS GroupKeyWepStatus;
- AP_WPA_STATE WpaState;
- GTK_STATE GTKState;
- USHORT PortSecured;
- NDIS_802_11_PRIVACY_FILTER PrivacyFilter; // PrivacyFilter enum for 802.1X
- CIPHER_KEY PairwiseKey;
- PVOID pAd;
- INT PMKID_CacheIdx;
- UCHAR PMKID[LEN_PMKID];
-
-
- UCHAR Addr[MAC_ADDR_LEN];
- UCHAR PsMode;
- SST Sst;
- AUTH_STATE AuthState; // for SHARED KEY authentication state machine used only
- BOOLEAN IsReassocSta; // Indicate whether this is a reassociation procedure
- USHORT Aid;
- USHORT CapabilityInfo;
- UCHAR LastRssi;
- ULONG NoDataIdleCount;
- UINT16 StationKeepAliveCount; // unit: second
- ULONG PsQIdleCount;
- QUEUE_HEADER PsQueue;
-
- UINT32 StaConnectTime; // the live time of this station since associated with AP
-
-
-#ifdef DOT11_N_SUPPORT
- BOOLEAN bSendBAR;
- USHORT NoBADataCountDown;
-
- UINT32 CachedBuf[16]; // UINT (4 bytes) for alignment
- UINT TxBFCount; // 3*3
-#endif // DOT11_N_SUPPORT //
- UINT FIFOCount;
- UINT DebugFIFOCount;
- UINT DebugTxCount;
- BOOLEAN bDlsInit;
-
-
-//====================================================
-//WDS entry needs these
-// if ValidAsWDS==TRUE, MatchWDSTabIdx is the index in WdsTab.MacTab
- UINT MatchWDSTabIdx;
- UCHAR MaxSupportedRate;
- UCHAR CurrTxRate;
- UCHAR CurrTxRateIndex;
- // to record the each TX rate's quality. 0 is best, the bigger the worse.
- USHORT TxQuality[MAX_STEP_OF_TX_RATE_SWITCH];
-// USHORT OneSecTxOkCount;
- UINT32 OneSecTxNoRetryOkCount;
- UINT32 OneSecTxRetryOkCount;
- UINT32 OneSecTxFailCount;
- UINT32 ContinueTxFailCnt;
- UINT32 CurrTxRateStableTime; // # of second in current TX rate
- UCHAR TxRateUpPenalty; // extra # of second penalty due to last unstable condition
-#ifdef WDS_SUPPORT
- BOOLEAN LockEntryTx; // TRUE = block to WDS Entry traffic, FALSE = not.
- UINT32 TimeStamp_toTxRing;
-#endif // WDS_SUPPORT //
-
-//====================================================
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
- UINT MatchDlsEntryIdx; // indicate the index in pAd->StaCfg.DLSEntry
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
- BOOLEAN fNoisyEnvironment;
- BOOLEAN fLastSecAccordingRSSI;
- UCHAR LastSecTxRateChangeAction; // 0: no change, 1:rate UP, 2:rate down
- CHAR LastTimeTxRateChangeAction; //Keep last time value of LastSecTxRateChangeAction
- ULONG LastTxOkCount;
- UCHAR PER[MAX_STEP_OF_TX_RATE_SWITCH];
-
- // a bitmap of BOOLEAN flags. each bit represent an operation status of a particular
- // BOOLEAN control, either ON or OFF. These flags should always be accessed via
- // CLIENT_STATUS_TEST_FLAG(), CLIENT_STATUS_SET_FLAG(), CLIENT_STATUS_CLEAR_FLAG() macros.
- // see fOP_STATUS_xxx in RTMP_DEF.C for detail bit definition. fCLIENT_STATUS_AMSDU_INUSED
- ULONG ClientStatusFlags;
-
- HTTRANSMIT_SETTING HTPhyMode, MaxHTPhyMode, MinHTPhyMode;// For transmit phy setting in TXWI.
-
-#ifdef DOT11_N_SUPPORT
- // HT EWC MIMO-N used parameters
- USHORT RXBAbitmap; // fill to on-chip RXWI_BA_BITMASK in 8.1.3RX attribute entry format
- USHORT TXBAbitmap; // This bitmap as originator, only keep in software used to mark AMPDU bit in TXWI
- USHORT TXAutoBAbitmap;
- USHORT BADeclineBitmap;
- USHORT BARecWcidArray[NUM_OF_TID]; // The mapping wcid of recipient session. if RXBAbitmap bit is masked
- USHORT BAOriWcidArray[NUM_OF_TID]; // The mapping wcid of originator session. if TXBAbitmap bit is masked
- USHORT BAOriSequence[NUM_OF_TID]; // The mapping wcid of originator session. if TXBAbitmap bit is masked
-
- // 802.11n features.
- UCHAR MpduDensity;
- UCHAR MaxRAmpduFactor;
- UCHAR AMsduSize;
- UCHAR MmpsMode; // MIMO power save more.
-
- HT_CAPABILITY_IE HTCapability;
-
-#ifdef DOT11N_DRAFT3
- UCHAR BSS2040CoexistenceMgmtSupport;
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
- BOOLEAN bAutoTxRateSwitch;
-
- UCHAR RateLen;
- struct _MAC_TABLE_ENTRY *pNext;
- USHORT TxSeq[NUM_OF_TID];
- USHORT NonQosDataSeq;
-
- RSSI_SAMPLE RssiSample;
-
- UINT32 TXMCSExpected[16];
- UINT32 TXMCSSuccessful[16];
- UINT32 TXMCSFailed[16];
- UINT32 TXMCSAutoFallBack[16][16];
-
-#ifdef CONFIG_STA_SUPPORT
- ULONG LastBeaconRxTime;
-#endif // CONFIG_STA_SUPPORT //
-
-
-
- ULONG AssocDeadLine;
-
-
-
- ULONG ChannelQuality; // 0..100, Channel Quality Indication for Roaming
-
-} MAC_TABLE_ENTRY, *PMAC_TABLE_ENTRY;
-
-typedef struct _MAC_TABLE {
- USHORT Size;
- MAC_TABLE_ENTRY *Hash[HASH_TABLE_SIZE];
- MAC_TABLE_ENTRY Content[MAX_LEN_OF_MAC_TABLE];
- QUEUE_HEADER McastPsQueue;
- ULONG PsQIdleCount;
- BOOLEAN fAnyStationInPsm;
- BOOLEAN fAnyStationBadAtheros; // Check if any Station is atheros 802.11n Chip. We need to use RTS/CTS with Atheros 802,.11n chip.
- BOOLEAN fAnyTxOPForceDisable; // Check if it is necessary to disable BE TxOP
- BOOLEAN fAllStationAsRalink; // Check if all stations are ralink-chipset
-#ifdef DOT11_N_SUPPORT
- BOOLEAN fAnyStationIsLegacy; // Check if I use legacy rate to transmit to my BSS Station/
- BOOLEAN fAnyStationNonGF; // Check if any Station can't support GF.
- BOOLEAN fAnyStation20Only; // Check if any Station can't support GF.
- BOOLEAN fAnyStationMIMOPSDynamic; // Check if any Station is MIMO Dynamic
- BOOLEAN fAnyBASession; // Check if there is BA session. Force turn on RTS/CTS
-//2008/10/28: KH add to support Antenna power-saving of AP<--
-//2008/10/28: KH add to support Antenna power-saving of AP-->
-#endif // DOT11_N_SUPPORT //
-} MAC_TABLE, *PMAC_TABLE;
-
-
-
-
-#ifdef BLOCK_NET_IF
-typedef struct _BLOCK_QUEUE_ENTRY
-{
- BOOLEAN SwTxQueueBlockFlag;
- LIST_HEADER NetIfList;
-} BLOCK_QUEUE_ENTRY, *PBLOCK_QUEUE_ENTRY;
-#endif // BLOCK_NET_IF //
-
-
-struct wificonf
-{
- BOOLEAN bShortGI;
- BOOLEAN bGreenField;
-};
-
-
-typedef struct _RTMP_DEV_INFO_
-{
- UCHAR chipName[16];
- RTMP_INF_TYPE infType;
-}RTMP_DEV_INFO;
-
-
-#ifdef DBG_DIAGNOSE
-#define DIAGNOSE_TIME 10 // 10 sec
-typedef struct _RtmpDiagStrcut_
-{ // Diagnosis Related element
- unsigned char inited;
- unsigned char qIdx;
- unsigned char ArrayStartIdx;
- unsigned char ArrayCurIdx;
- // Tx Related Count
- USHORT TxDataCnt[DIAGNOSE_TIME];
- USHORT TxFailCnt[DIAGNOSE_TIME];
-// USHORT TxDescCnt[DIAGNOSE_TIME][16]; // TxDesc queue length in scale of 0~14, >=15
- USHORT TxDescCnt[DIAGNOSE_TIME][24]; // 3*3 // TxDesc queue length in scale of 0~14, >=15
-// USHORT TxMcsCnt[DIAGNOSE_TIME][16]; // TxDate MCS Count in range from 0 to 15, step in 1.
- USHORT TxMcsCnt[DIAGNOSE_TIME][24]; // 3*3
- USHORT TxSWQueCnt[DIAGNOSE_TIME][9]; // TxSwQueue length in scale of 0, 1, 2, 3, 4, 5, 6, 7, >=8
-
- USHORT TxAggCnt[DIAGNOSE_TIME];
- USHORT TxNonAggCnt[DIAGNOSE_TIME];
-// USHORT TxAMPDUCnt[DIAGNOSE_TIME][16]; // 10 sec, TxDMA APMDU Aggregation count in range from 0 to 15, in setp of 1.
- USHORT TxAMPDUCnt[DIAGNOSE_TIME][24]; // 3*3 // 10 sec, TxDMA APMDU Aggregation count in range from 0 to 15, in setp of 1.
- USHORT TxRalinkCnt[DIAGNOSE_TIME]; // TxRalink Aggregation Count in 1 sec scale.
- USHORT TxAMSDUCnt[DIAGNOSE_TIME]; // TxAMSUD Aggregation Count in 1 sec scale.
-
- // Rx Related Count
- USHORT RxDataCnt[DIAGNOSE_TIME]; // Rx Total Data count.
- USHORT RxCrcErrCnt[DIAGNOSE_TIME];
-// USHORT RxMcsCnt[DIAGNOSE_TIME][16]; // Rx MCS Count in range from 0 to 15, step in 1.
- USHORT RxMcsCnt[DIAGNOSE_TIME][24]; // 3*3
-}RtmpDiagStruct;
-#endif // DBG_DIAGNOSE //
-
-
-struct _RTMP_CHIP_OP_
-{
- /* Calibration access related callback functions */
- int (*eeinit)(RTMP_ADAPTER *pAd); /* int (*eeinit)(RTMP_ADAPTER *pAd); */
- int (*eeread)(RTMP_ADAPTER *pAd, USHORT offset, PUSHORT pValue); /* int (*eeread)(RTMP_ADAPTER *pAd, int offset, PUSHORT pValue); */
- int (*eewrite)(RTMP_ADAPTER *pAd, USHORT offset, USHORT value);; /* int (*eewrite)(RTMP_ADAPTER *pAd, int offset, USHORT value); */
-
- /* MCU related callback functions */
- int (*loadFirmware)(RTMP_ADAPTER *pAd); /* int (*loadFirmware)(RTMP_ADAPTER *pAd); */
- int (*eraseFirmware)(RTMP_ADAPTER *pAd); /* int (*eraseFirmware)(RTMP_ADAPTER *pAd); */
- int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1);; /* int (*sendCommandToMcu)(RTMP_ADAPTER *pAd, UCHAR cmd, UCHAR token, UCHAR arg0, UCHAR arg1); */
-
- /* RF access related callback functions */
- REG_PAIR *pRFRegTable;
- void (*AsicRfInit)(RTMP_ADAPTER *pAd);
- void (*AsicRfTurnOn)(RTMP_ADAPTER *pAd);
- void (*AsicRfTurnOff)(RTMP_ADAPTER *pAd);
- void (*AsicReverseRfFromSleepMode)(RTMP_ADAPTER *pAd);
- void (*AsicHaltAction)(RTMP_ADAPTER *pAd);
-};
-
-
-//
-// The miniport adapter structure
-//
-struct _RTMP_ADAPTER
-{
- PVOID OS_Cookie; // save specific structure relative to OS
- PNET_DEV net_dev;
- ULONG VirtualIfCnt;
-
- RTMP_CHIP_OP chipOps;
- USHORT ThisTbttNumToNextWakeUp;
-
-#ifdef INF_AMAZON_PPA
- UINT32 g_if_id;
- BOOLEAN PPAEnable;
- PPA_DIRECTPATH_CB *pDirectpathCb;
-#endif // INF_AMAZON_PPA //
-
-#ifdef RTMP_MAC_PCI
-/*****************************************************************************************/
-/* PCI related parameters */
-/*****************************************************************************************/
- PUCHAR CSRBaseAddress; // PCI MMIO Base Address, all access will use
- unsigned int irq_num;
-
- USHORT LnkCtrlBitMask;
- USHORT RLnkCtrlConfiguration;
- USHORT RLnkCtrlOffset;
- USHORT HostLnkCtrlConfiguration;
- USHORT HostLnkCtrlOffset;
- USHORT PCIePowerSaveLevel;
- ULONG Rt3xxHostLinkCtrl; // USed for 3090F chip
- ULONG Rt3xxRalinkLinkCtrl; // USed for 3090F chip
- USHORT DeviceID; // Read from PCI config
- ULONG AccessBBPFailCount;
- BOOLEAN bPCIclkOff; // flag that indicate if the PICE power status in Configuration SPace..
- BOOLEAN bPCIclkOffDisableTx; //
-
- BOOLEAN brt30xxBanMcuCmd; //when = 0xff means all commands are ok to set .
- BOOLEAN b3090ESpecialChip; //3090E special chip that write EEPROM 0x24=0x9280.
- ULONG CheckDmaBusyCount; // Check Interrupt Status Register Count.
-
- UINT int_enable_reg;
- UINT int_disable_mask;
- UINT int_pending;
-
-
- RTMP_DMABUF TxBufSpace[NUM_OF_TX_RING]; // Shared memory of all 1st pre-allocated TxBuf associated with each TXD
- RTMP_DMABUF RxDescRing; // Shared memory for RX descriptors
- RTMP_DMABUF TxDescRing[NUM_OF_TX_RING]; // Shared memory for Tx descriptors
- RTMP_TX_RING TxRing[NUM_OF_TX_RING]; // AC0~4 + HCCA
-#endif // RTMP_MAC_PCI //
-
-
- NDIS_SPIN_LOCK irq_lock;
- UCHAR irq_disabled;
-
-
-/*****************************************************************************************/
-/* RBUS related parameters */
-/*****************************************************************************************/
-
-
-/*****************************************************************************************/
-/* Both PCI/USB related parameters */
-/*****************************************************************************************/
- //RTMP_DEV_INFO chipInfo;
- RTMP_INF_TYPE infType;
-
-/*****************************************************************************************/
-/* Driver Mgmt related parameters */
-/*****************************************************************************************/
- RTMP_OS_TASK mlmeTask;
-#ifdef RTMP_TIMER_TASK_SUPPORT
- // If you want use timer task to handle the timer related jobs, enable this.
- RTMP_TIMER_TASK_QUEUE TimerQ;
- NDIS_SPIN_LOCK TimerQLock;
- RTMP_OS_TASK timerTask;
-#endif // RTMP_TIMER_TASK_SUPPORT //
-
-
-/*****************************************************************************************/
-/* Tx related parameters */
-/*****************************************************************************************/
- BOOLEAN DeQueueRunning[NUM_OF_TX_RING]; // for ensuring RTUSBDeQueuePacket get call once
- NDIS_SPIN_LOCK DeQueueLock[NUM_OF_TX_RING];
-
-
- // resource for software backlog queues
- QUEUE_HEADER TxSwQueue[NUM_OF_TX_RING]; // 4 AC + 1 HCCA
- NDIS_SPIN_LOCK TxSwQueueLock[NUM_OF_TX_RING]; // TxSwQueue spinlock
-
- RTMP_DMABUF MgmtDescRing; // Shared memory for MGMT descriptors
- RTMP_MGMT_RING MgmtRing;
- NDIS_SPIN_LOCK MgmtRingLock; // Prio Ring spinlock
-
-
-/*****************************************************************************************/
-/* Rx related parameters */
-/*****************************************************************************************/
-
-#ifdef RTMP_MAC_PCI
- RTMP_RX_RING RxRing;
- NDIS_SPIN_LOCK RxRingLock; // Rx Ring spinlock
-#ifdef RT3090
- NDIS_SPIN_LOCK McuCmdLock; //MCU Command Queue spinlock
-#endif // RT3090 //
-#endif // RTMP_MAC_PCI //
-
-
-
-/*****************************************************************************************/
-/* ASIC related parameters */
-/*****************************************************************************************/
- UINT32 MACVersion; // MAC version. Record rt2860C(0x28600100) or rt2860D (0x28600101)..
-
- // ---------------------------
- // E2PROM
- // ---------------------------
- ULONG EepromVersion; // byte 0: version, byte 1: revision, byte 2~3: unused
- ULONG FirmwareVersion; // byte 0: Minor version, byte 1: Major version, otherwise unused.
- USHORT EEPROMDefaultValue[NUM_EEPROM_BBP_PARMS];
- UCHAR EEPROMAddressNum; // 93c46=6 93c66=8
- BOOLEAN EepromAccess;
- UCHAR EFuseTag;
-
-
- // ---------------------------
- // BBP Control
- // ---------------------------
-#ifdef MERGE_ARCH_TEAM
- UCHAR BbpWriteLatch[256]; // record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID
-#else
- UCHAR BbpWriteLatch[140]; // record last BBP register value written via BBP_IO_WRITE/BBP_IO_WRITE_VY_REG_ID
-#endif // MERGE_ARCH_TEAM //
- CHAR BbpRssiToDbmDelta; // change from UCHAR to CHAR for high power
- BBP_R66_TUNING BbpTuning;
-
- // ----------------------------
- // RFIC control
- // ----------------------------
- UCHAR RfIcType; // RFIC_xxx
- ULONG RfFreqOffset; // Frequency offset for channel switching
- RTMP_RF_REGS LatchRfRegs; // latch th latest RF programming value since RF IC doesn't support READ
-
- EEPROM_ANTENNA_STRUC Antenna; // Since ANtenna definition is different for a & g. We need to save it for future reference.
- EEPROM_NIC_CONFIG2_STRUC NicConfig2;
-
- // This soft Rx Antenna Diversity mechanism is used only when user set
- // RX Antenna = DIVERSITY ON
- SOFT_RX_ANT_DIVERSITY RxAnt;
-
- UCHAR RFProgSeq;
- CHANNEL_TX_POWER TxPower[MAX_NUM_OF_CHANNELS]; // Store Tx power value for all channels.
- CHANNEL_TX_POWER ChannelList[MAX_NUM_OF_CHANNELS]; // list all supported channels for site survey
- CHANNEL_11J_TX_POWER TxPower11J[MAX_NUM_OF_11JCHANNELS]; // 802.11j channel and bw
- CHANNEL_11J_TX_POWER ChannelList11J[MAX_NUM_OF_11JCHANNELS]; // list all supported channels for site survey
-
- UCHAR ChannelListNum; // number of channel in ChannelList[]
- UCHAR Bbp94;
- BOOLEAN BbpForCCK;
- ULONG Tx20MPwrCfgABand[5];
- ULONG Tx20MPwrCfgGBand[5];
- ULONG Tx40MPwrCfgABand[5];
- ULONG Tx40MPwrCfgGBand[5];
-
- BOOLEAN bAutoTxAgcA; // Enable driver auto Tx Agc control
- UCHAR TssiRefA; // Store Tssi reference value as 25 temperature.
- UCHAR TssiPlusBoundaryA[5]; // Tssi boundary for increase Tx power to compensate.
- UCHAR TssiMinusBoundaryA[5]; // Tssi boundary for decrease Tx power to compensate.
- UCHAR TxAgcStepA; // Store Tx TSSI delta increment / decrement value
- CHAR TxAgcCompensateA; // Store the compensation (TxAgcStep * (idx-1))
-
- BOOLEAN bAutoTxAgcG; // Enable driver auto Tx Agc control
- UCHAR TssiRefG; // Store Tssi reference value as 25 temperature.
- UCHAR TssiPlusBoundaryG[5]; // Tssi boundary for increase Tx power to compensate.
- UCHAR TssiMinusBoundaryG[5]; // Tssi boundary for decrease Tx power to compensate.
- UCHAR TxAgcStepG; // Store Tx TSSI delta increment / decrement value
- CHAR TxAgcCompensateG; // Store the compensation (TxAgcStep * (idx-1))
-
- CHAR BGRssiOffset0; // Store B/G RSSI#0 Offset value on EEPROM 0x46h
- CHAR BGRssiOffset1; // Store B/G RSSI#1 Offset value
- CHAR BGRssiOffset2; // Store B/G RSSI#2 Offset value
-
- CHAR ARssiOffset0; // Store A RSSI#0 Offset value on EEPROM 0x4Ah
- CHAR ARssiOffset1; // Store A RSSI#1 Offset value
- CHAR ARssiOffset2; // Store A RSSI#2 Offset value
-
- CHAR BLNAGain; // Store B/G external LNA#0 value on EEPROM 0x44h
- CHAR ALNAGain0; // Store A external LNA#0 value for ch36~64
- CHAR ALNAGain1; // Store A external LNA#1 value for ch100~128
- CHAR ALNAGain2; // Store A external LNA#2 value for ch132~165
-#ifdef RT30xx
- // for 3572
- UCHAR Bbp25;
- UCHAR Bbp26;
-
- UCHAR TxMixerGain24G; // Tx mixer gain value from EEPROM to improve Tx EVM / Tx DAC, 2.4G
- UCHAR TxMixerGain5G;
-#endif // RT30xx //
- // ----------------------------
- // LED control
- // ----------------------------
- MCU_LEDCS_STRUC LedCntl;
- USHORT Led1; // read from EEPROM 0x3c
- USHORT Led2; // EEPROM 0x3e
- USHORT Led3; // EEPROM 0x40
- UCHAR LedIndicatorStrength;
- UCHAR RssiSingalstrengthOffet;
- BOOLEAN bLedOnScanning;
- UCHAR LedStatus;
-
-/*****************************************************************************************/
-/* 802.11 related parameters */
-/*****************************************************************************************/
- // outgoing BEACON frame buffer and corresponding TXD
- TXWI_STRUC BeaconTxWI;
- PUCHAR BeaconBuf;
- USHORT BeaconOffset[HW_BEACON_MAX_COUNT];
-
- // pre-build PS-POLL and NULL frame upon link up. for efficiency purpose.
- PSPOLL_FRAME PsPollFrame;
- HEADER_802_11 NullFrame;
-
-
-
-
-//=========AP===========
-
-
-//=======STA===========
-#ifdef CONFIG_STA_SUPPORT
- // -----------------------------------------------
- // STA specific configuration & operation status
- // used only when pAd->OpMode == OPMODE_STA
- // -----------------------------------------------
- STA_ADMIN_CONFIG StaCfg; // user desired settings
- STA_ACTIVE_CONFIG StaActive; // valid only when ADHOC_ON(pAd) || INFRA_ON(pAd)
- CHAR nickname[IW_ESSID_MAX_SIZE+1]; // nickname, only used in the iwconfig i/f
- NDIS_MEDIA_STATE PreMediaState;
-#endif // CONFIG_STA_SUPPORT //
-
-//=======Common===========
- // OP mode: either AP or STA
- UCHAR OpMode; // OPMODE_STA, OPMODE_AP
-
- NDIS_MEDIA_STATE IndicateMediaState; // Base on Indication state, default is NdisMediaStateDisConnected
-
-
- /* MAT related parameters */
-
- // configuration: read from Registry & E2PROM
- BOOLEAN bLocalAdminMAC; // Use user changed MAC
- UCHAR PermanentAddress[MAC_ADDR_LEN]; // Factory default MAC address
- UCHAR CurrentAddress[MAC_ADDR_LEN]; // User changed MAC address
-
- // ------------------------------------------------------
- // common configuration to both OPMODE_STA and OPMODE_AP
- // ------------------------------------------------------
- COMMON_CONFIG CommonCfg;
- MLME_STRUCT Mlme;
-
- // AP needs those vaiables for site survey feature.
- MLME_AUX MlmeAux; // temporary settings used during MLME state machine
- BSS_TABLE ScanTab; // store the latest SCAN result
-
- //About MacTab, the sta driver will use #0 and #1 for multicast and AP.
- MAC_TABLE MacTab; // ASIC on-chip WCID entry table. At TX, ASIC always use key according to this on-chip table.
- NDIS_SPIN_LOCK MacTabLock;
-
-#ifdef DOT11_N_SUPPORT
- BA_TABLE BATable;
- NDIS_SPIN_LOCK BATabLock;
- RALINK_TIMER_STRUCT RECBATimer;
-#endif // DOT11_N_SUPPORT //
-
- // encryption/decryption KEY tables
- CIPHER_KEY SharedKey[MAX_MBSSID_NUM][4]; // STA always use SharedKey[BSS0][0..3]
-
- // RX re-assembly buffer for fragmentation
- FRAGMENT_FRAME FragFrame; // Frame storage for fragment frame
-
- // various Counters
- COUNTER_802_3 Counters8023; // 802.3 counters
- COUNTER_802_11 WlanCounters; // 802.11 MIB counters
- COUNTER_RALINK RalinkCounters; // Ralink propriety counters
- COUNTER_DRS DrsCounters; // counters for Dynamic TX Rate Switching
- PRIVATE_STRUC PrivateInfo; // Private information & counters
-
- // flags, see fRTMP_ADAPTER_xxx flags
- ULONG Flags; // Represent current device status
- ULONG PSFlags; // Power Save operation flag.
-
- // current TX sequence #
- USHORT Sequence;
-
- // Control disconnect / connect event generation
- //+++Didn't used anymore
- ULONG LinkDownTime;
- //---
- ULONG LastRxRate;
- ULONG LastTxRate;
- //+++Used only for Station
- BOOLEAN bConfigChanged; // Config Change flag for the same SSID setting
- //---
-
- ULONG ExtraInfo; // Extra information for displaying status
- ULONG SystemErrorBitmap; // b0: E2PROM version error
-
- //+++Didn't used anymore
- ULONG MacIcVersion; // MAC/BBP serial interface issue solved after ver.D
- //---
-
- // ---------------------------
- // System event log
- // ---------------------------
- RT_802_11_EVENT_TABLE EventTab;
-
-
- BOOLEAN HTCEnable;
-
- /*****************************************************************************************/
- /* Statistic related parameters */
- /*****************************************************************************************/
-
- BOOLEAN bUpdateBcnCntDone;
- ULONG watchDogMacDeadlock; // prevent MAC/BBP into deadlock condition
- // ----------------------------
- // DEBUG paramerts
- // ----------------------------
- //ULONG DebugSetting[4];
- BOOLEAN bBanAllBaSetup;
- BOOLEAN bPromiscuous;
-
- // ----------------------------
- // rt2860c emulation-use Parameters
- // ----------------------------
- //ULONG rtsaccu[30];
- //ULONG ctsaccu[30];
- //ULONG cfendaccu[30];
- //ULONG bacontent[16];
- //ULONG rxint[RX_RING_SIZE+1];
- //UCHAR rcvba[60];
- BOOLEAN bLinkAdapt;
- BOOLEAN bForcePrintTX;
- BOOLEAN bForcePrintRX;
- //BOOLEAN bDisablescanning; //defined in RT2870 USB
- BOOLEAN bStaFifoTest;
- BOOLEAN bProtectionTest;
- /*
- BOOLEAN bHCCATest;
- BOOLEAN bGenOneHCCA;
- */
- BOOLEAN bBroadComHT;
- //+++Following add from RT2870 USB.
- ULONG BulkOutReq;
- ULONG BulkOutComplete;
- ULONG BulkOutCompleteOther;
- ULONG BulkOutCompleteCancel; // seems not use now?
- ULONG BulkInReq;
- ULONG BulkInComplete;
- ULONG BulkInCompleteFail;
- //---
-
- struct wificonf WIFItestbed;
-
-#ifdef RALINK_ATE
- ATE_INFO ate;
-#endif // RALINK_ATE //
-
-#ifdef DOT11_N_SUPPORT
- struct reordering_mpdu_pool mpdu_blk_pool;
-#endif // DOT11_N_SUPPORT //
-
- ULONG OneSecondnonBEpackets; // record non BE packets per second
-
-#ifdef LINUX
-#if WIRELESS_EXT >= 12
- struct iw_statistics iw_stats;
-#endif
-
- struct net_device_stats stats;
-#endif // LINUX //
-
-#ifdef BLOCK_NET_IF
- BLOCK_QUEUE_ENTRY blockQueueTab[NUM_OF_TX_RING];
-#endif // BLOCK_NET_IF //
-
-
-
-#ifdef MULTIPLE_CARD_SUPPORT
- INT32 MC_RowID;
- STRING MC_FileName[256];
-#endif // MULTIPLE_CARD_SUPPORT //
-
- ULONG TbttTickCount;
-#ifdef PCI_MSI_SUPPORT
- BOOLEAN HaveMsi;
-#endif // PCI_MSI_SUPPORT //
-
-
- UCHAR is_on;
-
-#define TIME_BASE (1000000/OS_HZ)
-#define TIME_ONE_SECOND (1000000/TIME_BASE)
- UCHAR flg_be_adjust;
- ULONG be_adjust_last_time;
-
-#ifdef NINTENDO_AP
- NINDO_CTRL_BLOCK nindo_ctrl_block;
-#endif // NINTENDO_AP //
-
-
-#ifdef IKANOS_VX_1X0
- struct IKANOS_TX_INFO IkanosTxInfo;
- struct IKANOS_TX_INFO IkanosRxInfo[MAX_MBSSID_NUM + MAX_WDS_ENTRY + MAX_APCLI_NUM + MAX_MESH_NUM];
-#endif // IKANOS_VX_1X0 //
-
-
-#ifdef DBG_DIAGNOSE
- RtmpDiagStruct DiagStruct;
-#endif // DBG_DIAGNOSE //
-
-
- UINT8 FlgCtsEnabled;
- UINT8 PM_FlgSuspend;
-
-#ifdef RT30xx
-#ifdef RTMP_EFUSE_SUPPORT
- BOOLEAN bUseEfuse;
- BOOLEAN bEEPROMFile;
- BOOLEAN bFroceEEPROMBuffer;
- UCHAR EEPROMImage[1024];
-#endif // RTMP_EFUSE_SUPPORT //
-#endif // RT30xx //
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-};
-
-
-
-#ifdef TONE_RADAR_DETECT_SUPPORT
-#define DELAYINTMASK 0x0013fffb
-#define INTMASK 0x0013fffb
-#define IndMask 0x0013fffc
-#define RadarInt 0x00100000
-#else
-#define DELAYINTMASK 0x0003fffb
-#define INTMASK 0x0003fffb
-#define IndMask 0x0003fffc
-#endif // TONE_RADAR_DETECT_SUPPORT //
-
-#define RxINT 0x00000005 // Delayed Rx or indivi rx
-#define TxDataInt 0x000000fa // Delayed Tx or indivi tx
-#define TxMgmtInt 0x00000102 // Delayed Tx or indivi tx
-#define TxCoherent 0x00020000 // tx coherent
-#define RxCoherent 0x00010000 // rx coherent
-#define McuCommand 0x00000200 // mcu
-#define PreTBTTInt 0x00001000 // Pre-TBTT interrupt
-#define TBTTInt 0x00000800 // TBTT interrupt
-#define GPTimeOutInt 0x00008000 // GPtimeout interrupt
-#define AutoWakeupInt 0x00004000 // AutoWakeupInt interrupt
-#define FifoStaFullInt 0x00002000 // fifo statistics full interrupt
-
-
-/***************************************************************************
- * Rx Path software control block related data structures
- **************************************************************************/
-typedef struct _RX_BLK_
-{
-// RXD_STRUC RxD; // sample
- RT28XX_RXD_STRUC RxD;
- PRXWI_STRUC pRxWI;
- PHEADER_802_11 pHeader;
- PNDIS_PACKET pRxPacket;
- UCHAR *pData;
- USHORT DataSize;
- USHORT Flags;
- UCHAR UserPriority; // for calculate TKIP MIC using
-} RX_BLK;
-
-
-#define RX_BLK_SET_FLAG(_pRxBlk, _flag) (_pRxBlk->Flags |= _flag)
-#define RX_BLK_TEST_FLAG(_pRxBlk, _flag) (_pRxBlk->Flags & _flag)
-#define RX_BLK_CLEAR_FLAG(_pRxBlk, _flag) (_pRxBlk->Flags &= ~(_flag))
-
-
-#define fRX_WDS 0x0001
-#define fRX_AMSDU 0x0002
-#define fRX_ARALINK 0x0004
-#define fRX_HTC 0x0008
-#define fRX_PAD 0x0010
-#define fRX_AMPDU 0x0020
-#define fRX_QOS 0x0040
-#define fRX_INFRA 0x0080
-#define fRX_EAP 0x0100
-#define fRX_MESH 0x0200
-#define fRX_APCLI 0x0400
-#define fRX_DLS 0x0800
-#define fRX_WPI 0x1000
-
-#define LENGTH_AMSDU_SUBFRAMEHEAD 14
-#define LENGTH_ARALINK_SUBFRAMEHEAD 14
-#define LENGTH_ARALINK_HEADER_FIELD 2
-
-
-/***************************************************************************
- * Tx Path software control block related data structures
- **************************************************************************/
-#define TX_UNKOWN_FRAME 0x00
-#define TX_MCAST_FRAME 0x01
-#define TX_LEGACY_FRAME 0x02
-#define TX_AMPDU_FRAME 0x04
-#define TX_AMSDU_FRAME 0x08
-#define TX_RALINK_FRAME 0x10
-#define TX_FRAG_FRAME 0x20
-
-
-// Currently the sizeof(TX_BLK) is 148 bytes.
-typedef struct _TX_BLK_
-{
- UCHAR QueIdx;
- UCHAR TxFrameType; // Indicate the Transmission type of the all frames in one batch
- UCHAR TotalFrameNum; // Total frame number want to send-out in one batch
- USHORT TotalFragNum; // Total frame fragments required in one batch
- USHORT TotalFrameLen; // Total length of all frames want to send-out in one batch
-
- QUEUE_HEADER TxPacketList;
- MAC_TABLE_ENTRY *pMacEntry; // NULL: packet with 802.11 RA field is multicast/broadcast address
- HTTRANSMIT_SETTING *pTransmit;
-
- // Following structure used for the characteristics of a specific packet.
- PNDIS_PACKET pPacket;
- PUCHAR pSrcBufHeader; // Reference to the head of sk_buff->data
- PUCHAR pSrcBufData; // Reference to the sk_buff->data, will changed depends on hanlding progresss
- UINT SrcBufLen; // Length of packet payload which not including Layer 2 header
- PUCHAR pExtraLlcSnapEncap; // NULL means no extra LLC/SNAP is required
- UCHAR HeaderBuf[96]; // TempBuffer for TX_INFO + TX_WI + 802.11 Header + padding + AMSDU SubHeader + LLC/SNAP
- UCHAR MpduHeaderLen; // 802.11 header length NOT including the padding
- UCHAR HdrPadLen; // recording Header Padding Length;
- UCHAR apidx; // The interface associated to this packet
- UCHAR Wcid; // The MAC entry associated to this packet
- UCHAR UserPriority; // priority class of packet
- UCHAR FrameGap; // what kind of IFS this packet use
- UCHAR MpduReqNum; // number of fragments of this frame
- UCHAR TxRate; // TODO: Obsoleted? Should change to MCS?
- UCHAR CipherAlg; // cipher alogrithm
- PCIPHER_KEY pKey;
-
-
-
- USHORT Flags; //See following definitions for detail.
-
- //YOU SHOULD NOT TOUCH IT! Following parameters are used for hardware-depended layer.
- ULONG Priv; // Hardware specific value saved in here.
-
-} TX_BLK, *PTX_BLK;
-
-
-#define fTX_bRtsRequired 0x0001 // Indicate if need send RTS frame for protection. Not used in RT2860/RT2870.
-#define fTX_bAckRequired 0x0002 // the packet need ack response
-#define fTX_bPiggyBack 0x0004 // Legacy device use Piggback or not
-#define fTX_bHTRate 0x0008 // allow to use HT rate
-#define fTX_bForceNonQoS 0x0010 // force to transmit frame without WMM-QoS in HT mode
-#define fTX_bAllowFrag 0x0020 // allow to fragment the packet, A-MPDU, A-MSDU, A-Ralink is not allowed to fragment
-#define fTX_bMoreData 0x0040 // there are more data packets in PowerSave Queue
-#define fTX_bWMM 0x0080 // QOS Data
-#define fTX_bClearEAPFrame 0x0100
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-
-#define TX_BLK_SET_FLAG(_pTxBlk, _flag) (_pTxBlk->Flags |= _flag)
-#define TX_BLK_TEST_FLAG(_pTxBlk, _flag) (((_pTxBlk->Flags & _flag) == _flag) ? 1 : 0)
-#define TX_BLK_CLEAR_FLAG(_pTxBlk, _flag) (_pTxBlk->Flags &= ~(_flag))
-
-
-
-
-#ifdef RT_BIG_ENDIAN
-/***************************************************************************
- * Endian conversion related functions
- **************************************************************************/
-/*
- ========================================================================
-
- Routine Description:
- Endian conversion of Tx/Rx descriptor .
-
- Arguments:
- pAd Pointer to our adapter
- pData Pointer to Tx/Rx descriptor
- DescriptorType Direction of the frame
-
- Return Value:
- None
-
- Note:
- Call this function when read or update descriptor
- ========================================================================
-*/
-static inline VOID RTMPWIEndianChange(
- IN PUCHAR pData,
- IN ULONG DescriptorType)
-{
- int size;
- int i;
-
- size = ((DescriptorType == TYPE_TXWI) ? TXWI_SIZE : RXWI_SIZE);
-
- if(DescriptorType == TYPE_TXWI)
- {
- *((UINT32 *)(pData)) = SWAP32(*((UINT32 *)(pData))); // Byte 0~3
- *((UINT32 *)(pData + 4)) = SWAP32(*((UINT32 *)(pData+4))); // Byte 4~7
- }
- else
- {
- for(i=0; i < size/4 ; i++)
- *(((UINT32 *)pData) +i) = SWAP32(*(((UINT32 *)pData)+i));
- }
-}
-
-
-#ifdef RTMP_MAC_PCI
-static inline VOID WriteBackToDescriptor(
- IN PUCHAR Dest,
- IN PUCHAR Src,
- IN BOOLEAN DoEncrypt,
- IN ULONG DescriptorType)
-{
- UINT32 *p1, *p2;
-
- p1 = ((UINT32 *)Dest);
- p2 = ((UINT32 *)Src);
-
- *p1 = *p2;
- *(p1+2) = *(p2+2);
- *(p1+3) = *(p2+3);
- *(p1+1) = *(p2+1); // Word 1; this must be written back last
-}
-#endif // RTMP_MAC_PCI //
-
-
-/*
- ========================================================================
-
- Routine Description:
- Endian conversion of Tx/Rx descriptor .
-
- Arguments:
- pAd Pointer to our adapter
- pData Pointer to Tx/Rx descriptor
- DescriptorType Direction of the frame
-
- Return Value:
- None
-
- Note:
- Call this function when read or update descriptor
- ========================================================================
-*/
-#ifdef RTMP_MAC_PCI
-static inline VOID RTMPDescriptorEndianChange(
- IN PUCHAR pData,
- IN ULONG DescriptorType)
-{
- *((UINT32 *)(pData)) = SWAP32(*((UINT32 *)(pData))); // Byte 0~3
- *((UINT32 *)(pData + 8)) = SWAP32(*((UINT32 *)(pData+8))); // Byte 8~11
- *((UINT32 *)(pData +12)) = SWAP32(*((UINT32 *)(pData + 12))); // Byte 12~15
- *((UINT32 *)(pData + 4)) = SWAP32(*((UINT32 *)(pData + 4))); // Byte 4~7, this must be swapped last
-}
-#endif // RTMP_MAC_PCI //
-
-/*
- ========================================================================
-
- Routine Description:
- Endian conversion of all kinds of 802.11 frames .
-
- Arguments:
- pAd Pointer to our adapter
- pData Pointer to the 802.11 frame structure
- Dir Direction of the frame
- FromRxDoneInt Caller is from RxDone interrupt
-
- Return Value:
- None
-
- Note:
- Call this function when read or update buffer data
- ========================================================================
-*/
-static inline VOID RTMPFrameEndianChange(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG Dir,
- IN BOOLEAN FromRxDoneInt)
-{
- PHEADER_802_11 pFrame;
- PUCHAR pMacHdr;
-
- // swab 16 bit fields - Frame Control field
- if(Dir == DIR_READ)
- {
- *(USHORT *)pData = SWAP16(*(USHORT *)pData);
- }
-
- pFrame = (PHEADER_802_11) pData;
- pMacHdr = (PUCHAR) pFrame;
-
- // swab 16 bit fields - Duration/ID field
- *(USHORT *)(pMacHdr + 2) = SWAP16(*(USHORT *)(pMacHdr + 2));
-
- // swab 16 bit fields - Sequence Control field
- *(USHORT *)(pMacHdr + 22) = SWAP16(*(USHORT *)(pMacHdr + 22));
-
- if(pFrame->FC.Type == BTYPE_MGMT)
- {
- switch(pFrame->FC.SubType)
- {
- case SUBTYPE_ASSOC_REQ:
- case SUBTYPE_REASSOC_REQ:
- // swab 16 bit fields - CapabilityInfo field
- pMacHdr += sizeof(HEADER_802_11);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - Listen Interval field
- pMacHdr += 2;
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
- break;
-
- case SUBTYPE_ASSOC_RSP:
- case SUBTYPE_REASSOC_RSP:
- // swab 16 bit fields - CapabilityInfo field
- pMacHdr += sizeof(HEADER_802_11);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - Status Code field
- pMacHdr += 2;
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - AID field
- pMacHdr += 2;
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
- break;
-
- case SUBTYPE_AUTH:
- // If from APHandleRxDoneInterrupt routine, it is still a encrypt format.
- // The convertion is delayed to RTMPHandleDecryptionDoneInterrupt.
- if(!FromRxDoneInt && pFrame->FC.Wep == 1)
- break;
- else
- {
- // swab 16 bit fields - Auth Alg No. field
- pMacHdr += sizeof(HEADER_802_11);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - Auth Seq No. field
- pMacHdr += 2;
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - Status Code field
- pMacHdr += 2;
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
- }
- break;
-
- case SUBTYPE_BEACON:
- case SUBTYPE_PROBE_RSP:
- // swab 16 bit fields - BeaconInterval field
- pMacHdr += (sizeof(HEADER_802_11) + TIMESTAMP_LEN);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
-
- // swab 16 bit fields - CapabilityInfo field
- pMacHdr += sizeof(USHORT);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
- break;
-
- case SUBTYPE_DEAUTH:
- case SUBTYPE_DISASSOC:
- // swab 16 bit fields - Reason code field
- pMacHdr += sizeof(HEADER_802_11);
- *(USHORT *)pMacHdr = SWAP16(*(USHORT *)pMacHdr);
- break;
- }
- }
- else if( pFrame->FC.Type == BTYPE_DATA )
- {
- }
- else if(pFrame->FC.Type == BTYPE_CNTL)
- {
- switch(pFrame->FC.SubType)
- {
- case SUBTYPE_BLOCK_ACK_REQ:
- {
- PFRAME_BA_REQ pBAReq = (PFRAME_BA_REQ)pFrame;
- *(USHORT *)(&pBAReq->BARControl) = SWAP16(*(USHORT *)(&pBAReq->BARControl));
- pBAReq->BAStartingSeq.word = SWAP16(pBAReq->BAStartingSeq.word);
- }
- break;
- case SUBTYPE_BLOCK_ACK:
- // For Block Ack packet, the HT_CONTROL field is in the same offset with Addr3
- *(UINT32 *)(&pFrame->Addr3[0]) = SWAP32(*(UINT32 *)(&pFrame->Addr3[0]));
- break;
-
- case SUBTYPE_ACK:
- //For ACK packet, the HT_CONTROL field is in the same offset with Addr2
- *(UINT32 *)(&pFrame->Addr2[0])= SWAP32(*(UINT32 *)(&pFrame->Addr2[0]));
- break;
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_ERROR,("Invalid Frame Type!!!\n"));
- }
-
- // swab 16 bit fields - Frame Control
- if(Dir == DIR_WRITE)
- {
- *(USHORT *)pData = SWAP16(*(USHORT *)pData);
- }
-}
-#endif // RT_BIG_ENDIAN //
-
-
-/***************************************************************************
- * Other static inline function definitions
- **************************************************************************/
-static inline VOID ConvertMulticastIP2MAC(
- IN PUCHAR pIpAddr,
- IN PUCHAR *ppMacAddr,
- IN UINT16 ProtoType)
-{
- if (pIpAddr == NULL)
- return;
-
- if (ppMacAddr == NULL || *ppMacAddr == NULL)
- return;
-
- switch (ProtoType)
- {
- case ETH_P_IPV6:
-// memset(*ppMacAddr, 0, ETH_LENGTH_OF_ADDRESS);
- *(*ppMacAddr) = 0x33;
- *(*ppMacAddr + 1) = 0x33;
- *(*ppMacAddr + 2) = pIpAddr[12];
- *(*ppMacAddr + 3) = pIpAddr[13];
- *(*ppMacAddr + 4) = pIpAddr[14];
- *(*ppMacAddr + 5) = pIpAddr[15];
- break;
-
- case ETH_P_IP:
- default:
-// memset(*ppMacAddr, 0, ETH_LENGTH_OF_ADDRESS);
- *(*ppMacAddr) = 0x01;
- *(*ppMacAddr + 1) = 0x00;
- *(*ppMacAddr + 2) = 0x5e;
- *(*ppMacAddr + 3) = pIpAddr[1] & 0x7f;
- *(*ppMacAddr + 4) = pIpAddr[2];
- *(*ppMacAddr + 5) = pIpAddr[3];
- break;
- }
-
- return;
-}
-
-
-char *GetPhyMode(int Mode);
-char* GetBW(int BW);
-
-
-
-BOOLEAN RTMPCheckForHang(
- IN NDIS_HANDLE MiniportAdapterContext);
-
-VOID RTMPHalt(
- IN NDIS_HANDLE MiniportAdapterContext);
-
-//
-// Private routines in rtmp_init.c
-//
-NDIS_STATUS RTMPAllocAdapterBlock(
- IN PVOID handle,
- OUT PRTMP_ADAPTER *ppAdapter);
-
-NDIS_STATUS RTMPAllocTxRxRingMemory(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS RTMPFindAdapter(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_HANDLE WrapperConfigurationContext);
-
-NDIS_STATUS RTMPReadParametersHook(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS RTMPSetProfileParameters(
- IN RTMP_ADAPTER *pAd,
- IN PSTRING pBuffer);
-
-INT RTMPGetKeyParameter(
- IN PSTRING key,
- OUT PSTRING dest,
- IN INT destsize,
- IN PSTRING buffer,
- IN BOOLEAN bTrimSpace);
-
-VOID RTMPFreeAdapter(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS NICReadRegParameters(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_HANDLE WrapperConfigurationContext);
-
-#ifdef RTMP_RF_RW_SUPPORT
-VOID NICInitRFRegisters(
- IN PRTMP_ADAPTER pAd);
-
-VOID RtmpChipOpsRFHook(
- IN RTMP_ADAPTER *pAd);
-
-NDIS_STATUS RT30xxWriteRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR regID,
- IN UCHAR value);
-
-NDIS_STATUS RT30xxReadRFRegister(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR regID,
- IN PUCHAR pValue);
-#endif // RTMP_RF_RW_SUPPORT //
-
-VOID NICReadEEPROMParameters(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR mac_addr);
-
-VOID NICInitAsicFromEEPROM(
- IN PRTMP_ADAPTER pAd);
-
-
-NDIS_STATUS NICInitializeAdapter(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bHardReset);
-
-NDIS_STATUS NICInitializeAsic(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bHardReset);
-
-VOID NICIssueReset(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPRingCleanUp(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RingType);
-
-VOID RxTest(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS DbgSendPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-VOID UserCfgInit(
- IN PRTMP_ADAPTER pAd);
-
-VOID NICResetFromError(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS NICLoadFirmware(
- IN PRTMP_ADAPTER pAd);
-
-VOID NICEraseFirmware(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS NICLoadRateSwitchingParams(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN NICCheckForHang(
- IN PRTMP_ADAPTER pAd);
-
-VOID NICUpdateFifoStaCounters(
- IN PRTMP_ADAPTER pAd);
-
-VOID NICUpdateRawCounters(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPZeroMemory(
- IN PVOID pSrc,
- IN ULONG Length);
-
-ULONG RTMPCompareMemory(
- IN PVOID pSrc1,
- IN PVOID pSrc2,
- IN ULONG Length);
-
-VOID RTMPMoveMemory(
- OUT PVOID pDest,
- IN PVOID pSrc,
- IN ULONG Length);
-
-VOID AtoH(
- PSTRING src,
- PUCHAR dest,
- int destlen);
-
-UCHAR BtoH(
- char ch);
-
-VOID RTMPPatchMacBbpBug(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPPatchCardBus(
- IN PRTMP_ADAPTER pAdapter);
-
-VOID RTMPPatchRalinkCardBus(
- IN PRTMP_ADAPTER pAdapter,
- IN ULONG Bus);
-
-ULONG RTMPReadCBConfig(
- IN ULONG Bus,
- IN ULONG Slot,
- IN ULONG Func,
- IN ULONG Offset);
-
-VOID RTMPWriteCBConfig(
- IN ULONG Bus,
- IN ULONG Slot,
- IN ULONG Func,
- IN ULONG Offset,
- IN ULONG Value);
-
-VOID RTMPInitTimer(
- IN PRTMP_ADAPTER pAd,
- IN PRALINK_TIMER_STRUCT pTimer,
- IN PVOID pTimerFunc,
- IN PVOID pData,
- IN BOOLEAN Repeat);
-
-VOID RTMPSetTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- IN ULONG Value);
-
-
-VOID RTMPModTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- IN ULONG Value);
-
-VOID RTMPCancelTimer(
- IN PRALINK_TIMER_STRUCT pTimer,
- OUT BOOLEAN *pCancelled);
-
-VOID RTMPSetLED(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Status);
-
-VOID RTMPSetSignalLED(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_802_11_RSSI Dbm);
-
-
-VOID RTMPEnableRxTx(
- IN PRTMP_ADAPTER pAd);
-
-//
-// prototype in action.c
-//
-VOID ActionStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID MlmeADDBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeDELBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeDLSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeInvalidAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeQOSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-#ifdef DOT11_N_SUPPORT
-VOID PeerAddBAReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerAddBARspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerDelBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerBAAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-#endif // DOT11_N_SUPPORT //
-
-VOID SendPSMPAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR Psmp);
-
-
-VOID PeerRMAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerPublicAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-#ifdef CONFIG_STA_SUPPORT
-VOID StaPublicAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Bss2040Coexist);
-#endif // CONFIG_STA_SUPPORT //
-
-
-VOID PeerBSSTranAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-#ifdef DOT11_N_SUPPORT
-VOID PeerHTAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-#endif // DOT11_N_SUPPORT //
-
-VOID PeerQOSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-#ifdef QOS_DLS_SUPPORT
-VOID PeerDLSAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-#endif // QOS_DLS_SUPPORT //
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
-VOID DlsParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_DLS_REQ_STRUCT *pDlsReq,
- IN PRT_802_11_DLS pDls,
- IN USHORT reason);
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
-VOID RECBATimerTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID ORIBATimerTimeout(
- IN PRTMP_ADAPTER pAd);
-
-VOID SendRefreshBAR(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-#ifdef DOT11N_DRAFT3
-VOID SendBSS2040CoexistMgmtAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR apidx,
- IN UCHAR InfoReq);
-
-VOID SendNotifyBWActionFrame(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR apidx);
-
-BOOLEAN ChannelSwitchSanityCheck(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR NewChannel,
- IN UCHAR Secondary);
-
-VOID ChannelSwitchAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR Channel,
- IN UCHAR Secondary);
-
-ULONG BuildIntolerantChannelRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDest);
-
-VOID Update2040CoexistFrameAndNotify(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN BOOLEAN bAddIntolerantCha);
-
-VOID Send2040CoexistAction(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN BOOLEAN bAddIntolerantCha);
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-VOID ActHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN PUCHAR Addr1,
- IN PUCHAR Addr2,
- IN PUCHAR Addr3);
-
-VOID BarHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PFRAME_BAR pCntlBar,
- IN PUCHAR pDA,
- IN PUCHAR pSA);
-
-VOID InsertActField(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 Category,
- IN UINT8 ActCode);
-
-BOOLEAN QosBADataParse(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bAMSDU,
- IN PUCHAR p8023Header,
- IN UCHAR WCID,
- IN UCHAR TID,
- IN USHORT Sequence,
- IN UCHAR DataOffset,
- IN USHORT Datasize,
- IN UINT CurRxIndex);
-
-#ifdef DOT11_N_SUPPORT
-BOOLEAN CntlEnqueueForRecv(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN ULONG MsgLen,
- IN PFRAME_BA_REQ pMsg);
-
-VOID BaAutoManSwitch(
- IN PRTMP_ADAPTER pAd);
-#endif // DOT11_N_SUPPORT //
-
-VOID HTIOTCheck(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BatRecIdx);
-
-//
-// Private routines in rtmp_data.c
-//
-BOOLEAN RTMPHandleRxDoneInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPHandleTxDoneInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(
- IN PRTMP_ADAPTER pAd,
- IN INT_SOURCE_CSR_STRUC TxRingBitmap);
-
-VOID RTMPHandleMgmtRingDmaDoneInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPHandleTBTTInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPHandlePreTBTTInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-void RTMPHandleTwakeupInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPHandleRxCoherentInterrupt(
- IN PRTMP_ADAPTER pAd);
-
-
-BOOLEAN TxFrameIsAggregatible(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pPrevAddr1,
- IN PUCHAR p8023hdr);
-
-BOOLEAN PeerIsAggreOn(
- IN PRTMP_ADAPTER pAd,
- IN ULONG TxRate,
- IN PMAC_TABLE_ENTRY pMacEntry);
-
-
-NDIS_STATUS Sniff2BytesFromNdisBuffer(
- IN PNDIS_BUFFER pFirstBuffer,
- IN UCHAR DesiredOffset,
- OUT PUCHAR pByte0,
- OUT PUCHAR pByte1);
-
-NDIS_STATUS STASendPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-VOID STASendPackets(
- IN NDIS_HANDLE MiniportAdapterContext,
- IN PPNDIS_PACKET ppPacketArray,
- IN UINT NumberOfPackets);
-
-VOID RTMPDeQueuePacket(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bIntContext,
- IN UCHAR QueIdx,
- IN UCHAR Max_Tx_Packets);
-
-NDIS_STATUS RTMPHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR QueIdx,
- OUT PULONG pFreeTXDLeft);
-
-NDIS_STATUS STAHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR QueIdx);
-
-VOID STARxEAPOLFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-NDIS_STATUS RTMPFreeTXDRequest(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR RingType,
- IN UCHAR NumberRequired,
- IN PUCHAR FreeNumberIs);
-
-NDIS_STATUS MlmeHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket);
-
-NDIS_STATUS MlmeHardTransmitMgmtRing(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket);
-
-#ifdef RTMP_MAC_PCI
-NDIS_STATUS MlmeHardTransmitTxRing(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket);
-
-NDIS_STATUS MlmeDataHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket);
-
-VOID RTMPWriteTxDescriptor(
- IN PRTMP_ADAPTER pAd,
- IN PTXD_STRUC pTxD,
- IN BOOLEAN bWIV,
- IN UCHAR QSEL);
-#endif // RTMP_MAC_PCI //
-
-USHORT RTMPCalcDuration(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Rate,
- IN ULONG Size);
-
-VOID RTMPWriteTxWI(
- IN PRTMP_ADAPTER pAd,
- IN PTXWI_STRUC pTxWI,
- IN BOOLEAN FRAG,
- IN BOOLEAN CFACK,
- IN BOOLEAN InsTimestamp,
- IN BOOLEAN AMPDU,
- IN BOOLEAN Ack,
- IN BOOLEAN NSeq, // HW new a sequence.
- IN UCHAR BASize,
- IN UCHAR WCID,
- IN ULONG Length,
- IN UCHAR PID,
- IN UCHAR TID,
- IN UCHAR TxRate,
- IN UCHAR Txopmode,
- IN BOOLEAN CfAck,
- IN HTTRANSMIT_SETTING *pTransmit);
-
-
-VOID RTMPWriteTxWI_Data(
- IN PRTMP_ADAPTER pAd,
- IN OUT PTXWI_STRUC pTxWI,
- IN TX_BLK *pTxBlk);
-
-
-VOID RTMPWriteTxWI_Cache(
- IN PRTMP_ADAPTER pAd,
- IN OUT PTXWI_STRUC pTxWI,
- IN TX_BLK *pTxBlk);
-
-VOID RTMPSuspendMsduTransmission(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPResumeMsduTransmission(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS MiniportMMRequest(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN PUCHAR pData,
- IN UINT Length);
-
-//+++mark by shiang, now this function merge to MiniportMMRequest()
-//---mark by shiang, now this function merge to MiniportMMRequest()
-
-VOID RTMPSendNullFrame(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR TxRate,
- IN BOOLEAN bQosNull);
-
-VOID RTMPSendDisassociationFrame(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPSendRTSFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN unsigned int NextMpduSize,
- IN UCHAR TxRate,
- IN UCHAR RTSRate,
- IN USHORT AckDuration,
- IN UCHAR QueIdx,
- IN UCHAR FrameGap);
-
-
-NDIS_STATUS RTMPApplyPacketFilter(
- IN PRTMP_ADAPTER pAd,
- IN PRT28XX_RXD_STRUC pRxD,
- IN PHEADER_802_11 pHeader);
-
-PQUEUE_HEADER RTMPCheckTxSwQueue(
- IN PRTMP_ADAPTER pAd,
- OUT UCHAR *QueIdx);
-
-#ifdef CONFIG_STA_SUPPORT
-VOID RTMPReportMicError(
- IN PRTMP_ADAPTER pAd,
- IN PCIPHER_KEY pWpaKey);
-
-VOID WpaMicFailureReportFrame(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID WpaDisassocApAndBlockAssoc(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID WpaStaPairwiseKeySetting(
- IN PRTMP_ADAPTER pAd);
-
-VOID WpaStaGroupKeySetting(
- IN PRTMP_ADAPTER pAd);
-
-#endif // CONFIG_STA_SUPPORT //
-
-NDIS_STATUS RTMPCloneNdisPacket(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN pInsAMSDUHdr,
- IN PNDIS_PACKET pInPacket,
- OUT PNDIS_PACKET *ppOutPacket);
-
-NDIS_STATUS RTMPAllocateNdisPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET *pPacket,
- IN PUCHAR pHeader,
- IN UINT HeaderLen,
- IN PUCHAR pData,
- IN UINT DataLen);
-
-VOID RTMPFreeNdisPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-BOOLEAN RTMPFreeTXDUponTxDmaDone(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx);
-
-BOOLEAN RTMPCheckDHCPFrame(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-
-BOOLEAN RTMPCheckEtherType(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-
-VOID RTMPCckBbpTuning(
- IN PRTMP_ADAPTER pAd,
- IN UINT TxRate);
-
-//
-// Private routines in rtmp_wep.c
-//
-VOID RTMPInitWepEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN UCHAR KeyId,
- IN UCHAR KeyLen,
- IN PUCHAR pDest);
-
-VOID RTMPEncryptData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrc,
- IN PUCHAR pDest,
- IN UINT Len);
-
-BOOLEAN RTMPDecryptData(
- IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR pSrc,
- IN UINT Len,
- IN UINT idx);
-
-BOOLEAN RTMPSoftDecryptWEP(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN PCIPHER_KEY pGroupKey);
-
-VOID RTMPSetICV(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDest);
-
-VOID ARCFOUR_INIT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pKey,
- IN UINT KeyLen);
-
-UCHAR ARCFOUR_BYTE(
- IN PARCFOURCONTEXT Ctx);
-
-VOID ARCFOUR_DECRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len);
-
-VOID ARCFOUR_ENCRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len);
-
-VOID WPAARCFOUR_ENCRYPT(
- IN PARCFOURCONTEXT Ctx,
- IN PUCHAR pDest,
- IN PUCHAR pSrc,
- IN UINT Len);
-
-UINT RTMP_CALC_FCS32(
- IN UINT Fcs,
- IN PUCHAR Cp,
- IN INT Len);
-
-//
-// MLME routines
-//
-
-// Asic/RF/BBP related functions
-
-VOID AsicAdjustTxPower(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicUpdateProtect(
- IN PRTMP_ADAPTER pAd,
- IN USHORT OperaionMode,
- IN UCHAR SetMask,
- IN BOOLEAN bDisableBGProtect,
- IN BOOLEAN bNonGFExist);
-
-VOID AsicSwitchChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel,
- IN BOOLEAN bScan);
-
-VOID AsicLockChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel) ;
-
-VOID AsicAntennaSelect(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel);
-
-VOID AsicAntennaSetting(
- IN PRTMP_ADAPTER pAd,
- IN ABGBAND_STATE BandState);
-
-VOID AsicRfTuningExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-#ifdef CONFIG_STA_SUPPORT
-
-VOID AsicResetBBPAgent(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicSleepThenAutoWakeup(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TbttNumToNextWakeUp);
-
-VOID AsicForceSleep(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicForceWakeup(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bFromTx);
-#endif // CONFIG_STA_SUPPORT //
-
-VOID AsicSetBssid(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pBssid);
-
-VOID AsicSetMcastWC(
- IN PRTMP_ADAPTER pAd);
-
-
-VOID AsicDelWcidTab(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid);
-
-VOID AsicEnableRDG(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicDisableRDG(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicDisableSync(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicEnableBssSync(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicEnableIbssSync(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicSetEdcaParm(
- IN PRTMP_ADAPTER pAd,
- IN PEDCA_PARM pEdcaParm);
-
-VOID AsicSetSlotTime(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bUseShortSlotTime);
-
-
-VOID AsicAddSharedKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx,
- IN UCHAR CipherAlg,
- IN PUCHAR pKey,
- IN PUCHAR pTxMic,
- IN PUCHAR pRxMic);
-
-VOID AsicRemoveSharedKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx);
-
-VOID AsicUpdateWCIDAttribute(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN UCHAR BssIndex,
- IN UCHAR CipherAlg,
- IN BOOLEAN bUsePairewiseKeyTable);
-
-VOID AsicUpdateWCIDIVEIV(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN ULONG uIV,
- IN ULONG uEIV);
-
-VOID AsicUpdateRxWCIDTable(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN PUCHAR pAddr);
-
-VOID AsicAddKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT WCID,
- IN UCHAR BssIndex,
- IN UCHAR KeyIdx,
- IN PCIPHER_KEY pCipherKey,
- IN BOOLEAN bUsePairewiseKeyTable,
- IN BOOLEAN bTxKey);
-
-VOID AsicAddPairwiseKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UCHAR WCID,
- IN CIPHER_KEY *pCipherKey);
-
-VOID AsicRemovePairwiseKeyEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIdx,
- IN UCHAR Wcid);
-
-BOOLEAN AsicSendCommandToMcu(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Command,
- IN UCHAR Token,
- IN UCHAR Arg0,
- IN UCHAR Arg1);
-
-
-#ifdef RTMP_MAC_PCI
-BOOLEAN AsicCheckCommanOk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Command);
-#endif // RTMP_MAC_PCI //
-
-VOID MacAddrRandomBssid(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pAddr);
-
-VOID MgtMacHeaderInit(
- IN PRTMP_ADAPTER pAd,
- IN OUT PHEADER_802_11 pHdr80211,
- IN UCHAR SubType,
- IN UCHAR ToDs,
- IN PUCHAR pDA,
- IN PUCHAR pBssid);
-
-VOID MlmeRadioOff(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeRadioOn(
- IN PRTMP_ADAPTER pAd);
-
-
-VOID BssTableInit(
- IN BSS_TABLE *Tab);
-
-#ifdef DOT11_N_SUPPORT
-VOID BATableInit(
- IN PRTMP_ADAPTER pAd,
- IN BA_TABLE *Tab);
-#endif // DOT11_N_SUPPORT //
-
-ULONG BssTableSearch(
- IN BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN UCHAR Channel);
-
-ULONG BssSsidTableSearch(
- IN BSS_TABLE *Tab,
- IN PUCHAR pBssid,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen,
- IN UCHAR Channel);
-
-ULONG BssTableSearchWithSSID(
- IN BSS_TABLE *Tab,
- IN PUCHAR Bssid,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen,
- IN UCHAR Channel);
-
-ULONG BssSsidTableSearchBySSID(
- IN BSS_TABLE *Tab,
- IN PUCHAR pSsid,
- IN UCHAR SsidLen);
-
-VOID BssTableDeleteEntry(
- IN OUT PBSS_TABLE pTab,
- IN PUCHAR pBssid,
- IN UCHAR Channel);
-
-#ifdef DOT11_N_SUPPORT
-VOID BATableDeleteORIEntry(
- IN OUT PRTMP_ADAPTER pAd,
- IN BA_ORI_ENTRY *pBAORIEntry);
-
-VOID BATableDeleteRECEntry(
- IN OUT PRTMP_ADAPTER pAd,
- IN BA_REC_ENTRY *pBARECEntry);
-
-VOID BATableTearORIEntry(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR TID,
- IN UCHAR Wcid,
- IN BOOLEAN bForceDelete,
- IN BOOLEAN ALL);
-
-VOID BATableTearRECEntry(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR TID,
- IN UCHAR WCID,
- IN BOOLEAN ALL);
-#endif // DOT11_N_SUPPORT //
-
-VOID BssEntrySet(
- IN PRTMP_ADAPTER pAd,
- OUT PBSS_ENTRY pBss,
- IN PUCHAR pBssid,
- IN CHAR Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN USHORT BeaconPeriod,
- IN PCF_PARM CfParm,
- IN USHORT AtimWin,
- IN USHORT CapabilityInfo,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- IN UCHAR HtCapabilityLen,
- IN UCHAR AddHtInfoLen,
- IN UCHAR NewExtChanOffset,
- IN UCHAR Channel,
- IN CHAR Rssi,
- IN LARGE_INTEGER TimeStamp,
- IN UCHAR CkipFlag,
- IN PEDCA_PARM pEdcaParm,
- IN PQOS_CAPABILITY_PARM pQosCapability,
- IN PQBSS_LOAD_PARM pQbssLoad,
- IN USHORT LengthVIE,
- IN PNDIS_802_11_VARIABLE_IEs pVIE);
-
-ULONG BssTableSetEntry(
- IN PRTMP_ADAPTER pAd,
- OUT PBSS_TABLE pTab,
- IN PUCHAR pBssid,
- IN CHAR Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN USHORT BeaconPeriod,
- IN CF_PARM *CfParm,
- IN USHORT AtimWin,
- IN USHORT CapabilityInfo,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- IN UCHAR HtCapabilityLen,
- IN UCHAR AddHtInfoLen,
- IN UCHAR NewExtChanOffset,
- IN UCHAR Channel,
- IN CHAR Rssi,
- IN LARGE_INTEGER TimeStamp,
- IN UCHAR CkipFlag,
- IN PEDCA_PARM pEdcaParm,
- IN PQOS_CAPABILITY_PARM pQosCapability,
- IN PQBSS_LOAD_PARM pQbssLoad,
- IN USHORT LengthVIE,
- IN PNDIS_802_11_VARIABLE_IEs pVIE);
-
-#ifdef DOT11_N_SUPPORT
-VOID BATableInsertEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Aid,
- IN USHORT TimeOutValue,
- IN USHORT StartingSeq,
- IN UCHAR TID,
- IN UCHAR BAWinSize,
- IN UCHAR OriginatorStatus,
- IN BOOLEAN IsRecipient);
-
-#ifdef DOT11N_DRAFT3
-VOID Bss2040CoexistTimeOut(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-
-VOID TriEventInit(
- IN PRTMP_ADAPTER pAd);
-
-ULONG TriEventTableSetEntry(
- IN PRTMP_ADAPTER pAd,
- OUT TRIGGER_EVENT_TAB *Tab,
- IN PUCHAR pBssid,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN UCHAR RegClass,
- IN UCHAR ChannelNo);
-
-VOID TriEventCounterMaintenance(
- IN PRTMP_ADAPTER pAd);
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-VOID BssTableSsidSort(
- IN PRTMP_ADAPTER pAd,
- OUT BSS_TABLE *OutTab,
- IN CHAR Ssid[],
- IN UCHAR SsidLen);
-
-VOID BssTableSortByRssi(
- IN OUT BSS_TABLE *OutTab);
-
-VOID BssCipherParse(
- IN OUT PBSS_ENTRY pBss);
-
-NDIS_STATUS MlmeQueueInit(
- IN MLME_QUEUE *Queue);
-
-VOID MlmeQueueDestroy(
- IN MLME_QUEUE *Queue);
-
-BOOLEAN MlmeEnqueue(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Machine,
- IN ULONG MsgType,
- IN ULONG MsgLen,
- IN VOID *Msg);
-
-BOOLEAN MlmeEnqueueForRecv(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid,
- IN ULONG TimeStampHigh,
- IN ULONG TimeStampLow,
- IN UCHAR Rssi0,
- IN UCHAR Rssi1,
- IN UCHAR Rssi2,
- IN ULONG MsgLen,
- IN PVOID Msg,
- IN UCHAR Signal);
-
-
-BOOLEAN MlmeDequeue(
- IN MLME_QUEUE *Queue,
- OUT MLME_QUEUE_ELEM **Elem);
-
-VOID MlmeRestartStateMachine(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN MlmeQueueEmpty(
- IN MLME_QUEUE *Queue);
-
-BOOLEAN MlmeQueueFull(
- IN MLME_QUEUE *Queue);
-
-BOOLEAN MsgTypeSubst(
- IN PRTMP_ADAPTER pAd,
- IN PFRAME_802_11 pFrame,
- OUT INT *Machine,
- OUT INT *MsgType);
-
-VOID StateMachineInit(
- IN STATE_MACHINE *Sm,
- IN STATE_MACHINE_FUNC Trans[],
- IN ULONG StNr,
- IN ULONG MsgNr,
- IN STATE_MACHINE_FUNC DefFunc,
- IN ULONG InitState,
- IN ULONG Base);
-
-VOID StateMachineSetAction(
- IN STATE_MACHINE *S,
- IN ULONG St,
- ULONG Msg,
- IN STATE_MACHINE_FUNC F);
-
-VOID StateMachinePerformAction(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID Drop(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID AssocStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID ReassocTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID AssocTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID DisassocTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-//----------------------------------------------
-VOID MlmeDisassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeAssocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeReassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeDisassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerAssocRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerReassocRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerDisassocAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID DisassocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID AssocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ReassocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID Cls3errAction(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-VOID InvalidStateWhenAssoc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenReassoc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenDisassociate(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-
-VOID ComposePsPoll(
- IN PRTMP_ADAPTER pAd);
-
-VOID ComposeNullFrame(
- IN PRTMP_ADAPTER pAd);
-
-VOID AssocPostProc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr2,
- IN USHORT CapabilityInfo,
- IN USHORT Aid,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN PEDCA_PARM pEdcaParm,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN ADD_HT_INFO_IE *pAddHtInfo);
-
-VOID AuthStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN PSTATE_MACHINE sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID AuthTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID MlmeAuthReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerAuthRspAtSeq2Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerAuthRspAtSeq4Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID AuthTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID Cls2errAction(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr);
-
-VOID MlmeDeauthReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenAuth(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-//=============================================
-
-VOID AuthRspStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN PSTATE_MACHINE Sm,
- IN STATE_MACHINE_FUNC Trans[]);
-
-VOID PeerDeauthAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerAuthSimpleRspGenAndSend(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHdr80211,
- IN USHORT Alg,
- IN USHORT Seq,
- IN USHORT Reason,
- IN USHORT Status);
-
-//
-// Private routines in dls.c
-//
-
-#ifdef CONFIG_STA_SUPPORT
-#ifdef QOS_DLS_SUPPORT
-void DlsStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID MlmeDlsReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerDlsReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerDlsRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeDlsTearDownAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerDlsTearDownAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID RTMPCheckDLSTimeOut(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN RTMPRcvFrameDLSCheck(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHeader,
- IN ULONG Len,
- IN PRT28XX_RXD_STRUC pRxD);
-
-INT RTMPCheckDLSFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA);
-
-VOID RTMPSendDLSTearDownFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA);
-
-NDIS_STATUS RTMPSendSTAKeyRequest(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA);
-
-NDIS_STATUS RTMPSendSTAKeyHandShake(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA);
-
-VOID DlsTimeoutAction(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-BOOLEAN MlmeDlsReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PRT_802_11_DLS *pDLS,
- OUT PUSHORT pReason);
-
-INT Set_DlsEntryInfo_Display_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-MAC_TABLE_ENTRY *MacTableInsertDlsEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UINT DlsEntryIdx);
-
-BOOLEAN MacTableDeleteDlsEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT wcid,
- IN PUCHAR pAddr);
-
-MAC_TABLE_ENTRY *DlsEntryTableLookup(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount);
-
-MAC_TABLE_ENTRY *DlsEntryTableLookupByWcid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR wcid,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount);
-
-INT Set_DlsAddEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_DlsTearDownEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // QOS_DLS_SUPPORT //
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef QOS_DLS_SUPPORT
-BOOLEAN PeerDlsReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pDlsTimeout,
- OUT UCHAR *pRatesLen,
- OUT UCHAR Rates[],
- OUT UCHAR *pHtCapabilityLen,
- OUT HT_CAPABILITY_IE *pHtCapability);
-
-BOOLEAN PeerDlsRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pStatus,
- OUT UCHAR *pRatesLen,
- OUT UCHAR Rates[],
- OUT UCHAR *pHtCapabilityLen,
- OUT HT_CAPABILITY_IE *pHtCapability);
-
-BOOLEAN PeerDlsTearDownSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pDA,
- OUT PUCHAR pSA,
- OUT USHORT *pReason);
-#endif // QOS_DLS_SUPPORT //
-
-//========================================
-
-VOID SyncStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID BeaconTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID ScanTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID MlmeScanReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenScan(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenJoin(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID InvalidStateWhenStart(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerBeacon(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID EnqueueProbeRequest(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN ScanRunning(
- IN PRTMP_ADAPTER pAd);
-//=========================================
-
-VOID MlmeCntlInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[]);
-
-VOID MlmeCntlMachinePerformAction(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlIdleProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlOidScanProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlOidSsidProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM * Elem);
-
-VOID CntlOidRTBssidProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM * Elem);
-
-VOID CntlMlmeRoamingProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM * Elem);
-
-VOID CntlWaitDisassocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitJoinProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitReassocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitStartProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitAuthProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitAuthProc2(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID CntlWaitAssocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-#ifdef QOS_DLS_SUPPORT
-VOID CntlOidDLSSetupProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-#endif // QOS_DLS_SUPPORT //
-
-VOID LinkUp(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssType);
-
-VOID LinkDown(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN IsReqFromAP);
-
-VOID IterateOnBssTab(
- IN PRTMP_ADAPTER pAd);
-
-VOID IterateOnBssTab2(
- IN PRTMP_ADAPTER pAd);;
-
-VOID JoinParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_JOIN_REQ_STRUCT *JoinReq,
- IN ULONG BssIdx);
-
-VOID AssocParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_ASSOC_REQ_STRUCT *AssocReq,
- IN PUCHAR pAddr,
- IN USHORT CapabilityInfo,
- IN ULONG Timeout,
- IN USHORT ListenIntv);
-
-VOID ScanParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
- IN STRING Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN UCHAR ScanType);
-
-VOID DisassocParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_DISASSOC_REQ_STRUCT *DisassocReq,
- IN PUCHAR pAddr,
- IN USHORT Reason);
-
-VOID StartParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_START_REQ_STRUCT *StartReq,
- IN CHAR Ssid[],
- IN UCHAR SsidLen);
-
-VOID AuthParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_AUTH_REQ_STRUCT *AuthReq,
- IN PUCHAR pAddr,
- IN USHORT Alg);
-
-VOID EnqueuePsPoll(
- IN PRTMP_ADAPTER pAd);
-
-VOID EnqueueBeaconFrame(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeJoinReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeScanReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID MlmeStartReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ScanTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID BeaconTimeoutAtJoinAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerBeaconAtScanAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerBeaconAtJoinAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerBeacon(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerProbeReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID ScanNextChannel(
- IN PRTMP_ADAPTER pAd);
-
-ULONG MakeIbssBeacon(
- IN PRTMP_ADAPTER pAd);
-
-VOID CCXAdjacentAPReport(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN MlmeScanReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT UCHAR *BssType,
- OUT CHAR ssid[],
- OUT UCHAR *SsidLen,
- OUT UCHAR *ScanType);
-
-BOOLEAN PeerBeaconAndProbeRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- IN UCHAR MsgChannel,
- OUT PUCHAR pAddr2,
- OUT PUCHAR pBssid,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen,
- OUT UCHAR *pBssType,
- OUT USHORT *pBeaconPeriod,
- OUT UCHAR *pChannel,
- OUT UCHAR *pNewChannel,
- OUT LARGE_INTEGER *pTimestamp,
- OUT CF_PARM *pCfParm,
- OUT USHORT *pAtimWin,
- OUT USHORT *pCapabilityInfo,
- OUT UCHAR *pErp,
- OUT UCHAR *pDtimCount,
- OUT UCHAR *pDtimPeriod,
- OUT UCHAR *pBcastFlag,
- OUT UCHAR *pMessageToMe,
- OUT UCHAR SupRate[],
- OUT UCHAR *pSupRateLen,
- OUT UCHAR ExtRate[],
- OUT UCHAR *pExtRateLen,
- OUT UCHAR *pCkipFlag,
- OUT UCHAR *pAironetCellPowerLimit,
- OUT PEDCA_PARM pEdcaParm,
- OUT PQBSS_LOAD_PARM pQbssLoad,
- OUT PQOS_CAPABILITY_PARM pQosCapability,
- OUT ULONG *pRalinkIe,
- OUT UCHAR *pHtCapabilityLen,
-#ifdef CONFIG_STA_SUPPORT
- OUT UCHAR *pPreNHtCapabilityLen,
-#endif // CONFIG_STA_SUPPORT //
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT UCHAR *AddHtInfoLen,
- OUT ADD_HT_INFO_IE *AddHtInfo,
- OUT UCHAR *NewExtChannel,
- OUT USHORT *LengthVIE,
- OUT PNDIS_802_11_VARIABLE_IEs pVIE);
-
-BOOLEAN PeerAddBAReqActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2);
-
-BOOLEAN PeerAddBARspActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen);
-
-BOOLEAN PeerDelBAActionSanity(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN VOID *pMsg,
- IN ULONG MsgLen);
-
-BOOLEAN MlmeAssocReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pApAddr,
- OUT USHORT *CapabilityInfo,
- OUT ULONG *Timeout,
- OUT USHORT *ListenIntv);
-
-BOOLEAN MlmeAuthReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr,
- OUT ULONG *Timeout,
- OUT USHORT *Alg);
-
-BOOLEAN MlmeStartReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT CHAR Ssid[],
- OUT UCHAR *Ssidlen);
-
-BOOLEAN PeerAuthSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr,
- OUT USHORT *Alg,
- OUT USHORT *Seq,
- OUT USHORT *Status,
- OUT CHAR ChlgText[]);
-
-BOOLEAN PeerAssocRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pStatus,
- OUT USHORT *pAid,
- OUT UCHAR SupRate[],
- OUT UCHAR *pSupRateLen,
- OUT UCHAR ExtRate[],
- OUT UCHAR *pExtRateLen,
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- OUT UCHAR *pHtCapabilityLen,
- OUT UCHAR *pAddHtInfoLen,
- OUT UCHAR *pNewExtChannelOffset,
- OUT PEDCA_PARM pEdcaParm,
- OUT UCHAR *pCkipFlag);
-
-BOOLEAN PeerDisassocSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *Reason);
-
-BOOLEAN PeerWpaMessageSanity(
- IN PRTMP_ADAPTER pAd,
- IN PEAPOL_PACKET pMsg,
- IN ULONG MsgLen,
- IN UCHAR MsgType,
- IN MAC_TABLE_ENTRY *pEntry);
-
-BOOLEAN PeerDeauthSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *Reason);
-
-BOOLEAN PeerProbeReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen);
-
-BOOLEAN GetTimBit(
- IN CHAR *Ptr,
- IN USHORT Aid,
- OUT UCHAR *TimLen,
- OUT UCHAR *BcastFlag,
- OUT UCHAR *DtimCount,
- OUT UCHAR *DtimPeriod,
- OUT UCHAR *MessageToMe);
-
-UCHAR ChannelSanity(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR channel);
-
-NDIS_802_11_NETWORK_TYPE NetworkTypeInUseSanity(
- IN PBSS_ENTRY pBss);
-
-
-BOOLEAN MlmeDelBAReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen);
-
-BOOLEAN MlmeAddBAReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2);
-
-ULONG MakeOutgoingFrame(
- OUT UCHAR *Buffer,
- OUT ULONG *Length, ...);
-
-VOID LfsrInit(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Seed);
-
-UCHAR RandomByte(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicUpdateAutoFallBackTable(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pTxRate);
-
-VOID MlmePeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID LinkDownExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID LinkUpExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID STAMlmePeriodicExec(
- PRTMP_ADAPTER pAd);
-
-VOID MlmeAutoScan(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeAutoReconnectLastSSID(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN MlmeValidateSSID(
- IN PUCHAR pSsid,
- IN UCHAR SsidLen);
-
-VOID MlmeCheckForRoaming(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now32);
-
-BOOLEAN MlmeCheckForFastRoaming(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeDynamicTxRateSwitching(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeSetTxRate(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PRTMP_TX_RATE_SWITCH pTxRate);
-
-VOID MlmeSelectTxRateTable(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR *ppTable,
- IN PUCHAR pTableSize,
- IN PUCHAR pInitTxRateIdx);
-
-VOID MlmeCalculateChannelQuality(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pMacEntry,
- IN ULONG Now);
-
-VOID MlmeCheckPsmChange(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Now32);
-
-VOID MlmeSetPsmBit(
- IN PRTMP_ADAPTER pAd,
- IN USHORT psm);
-
-VOID MlmeSetTxPreamble(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TxPreamble);
-
-VOID UpdateBasicRateBitmap(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeUpdateTxRates(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bLinkUp,
- IN UCHAR apidx);
-
-#ifdef DOT11_N_SUPPORT
-VOID MlmeUpdateHtTxRates(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR apidx);
-#endif // DOT11_N_SUPPORT //
-
-VOID RTMPCheckRates(
- IN PRTMP_ADAPTER pAd,
- IN OUT UCHAR SupRate[],
- IN OUT UCHAR *SupRateLen);
-
-#ifdef CONFIG_STA_SUPPORT
-BOOLEAN RTMPCheckChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR CentralChannel,
- IN UCHAR Channel);
-#endif // CONFIG_STA_SUPPORT //
-
-BOOLEAN RTMPCheckHt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN OUT HT_CAPABILITY_IE *pHtCapability,
- IN OUT ADD_HT_INFO_IE *pAddHtInfo);
-
-VOID StaQuickResponeForRateUpExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID AsicBbpTuning1(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicBbpTuning2(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPUpdateMlmeRate(
- IN PRTMP_ADAPTER pAd);
-
-CHAR RTMPMaxRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi0,
- IN CHAR Rssi1,
- IN CHAR Rssi2);
-
-#ifdef RT30xx
-VOID AsicSetRxAnt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ant);
-
-VOID RTMPFilterCalibration(
- IN PRTMP_ADAPTER pAd);
-
-#ifdef RTMP_EFUSE_SUPPORT
-//2008/09/11:KH add to support efuse<--
-INT set_eFuseGetFreeBlockCount_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT set_eFusedump_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT set_eFuseLoadFromBin_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-VOID eFusePhysicalReadRegisters(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN USHORT Length,
- OUT USHORT* pData);
-
-int RtmpEfuseSupportCheck(
- IN RTMP_ADAPTER *pAd);
-
-INT set_eFuseBufferModeWriteBack_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT eFuseLoadEEPROM(
- IN PRTMP_ADAPTER pAd);
-
-INT eFuseWriteEeeppromBuf(
- IN PRTMP_ADAPTER pAd);
-
-VOID eFuseGetFreeBlockCount(IN PRTMP_ADAPTER pAd,
- PUINT EfuseFreeBlock);
-
-INT eFuse_init(
- IN PRTMP_ADAPTER pAd);
-
-NTSTATUS eFuseRead(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- OUT PUCHAR pData,
- IN USHORT Length);
-
-NTSTATUS eFuseWrite(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Offset,
- IN PUCHAR pData,
- IN USHORT length);
-//2008/09/11:KH add to support efuse-->
-#endif // RTMP_EFUSE_SUPPORT //
-
-// add by johnli, RF power sequence setup
-VOID RT30xxLoadRFNormalModeSetup(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT30xxLoadRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT30xxReverseRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd);
-// end johnli
-
-
-#ifdef RT3090
-VOID NICInitRT3090RFRegisters(
- IN RTMP_ADAPTER *pAd);
-#endif // RT3090 //
-
-VOID RT30xxHaltAction(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT30xxSetRxAnt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ant);
-#endif // RT30xx //
-#ifdef RT33xx
-VOID RT33xxLoadRFNormalModeSetup(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT33xxLoadRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT33xxReverseRFSleepModeSetup(
- IN PRTMP_ADAPTER pAd);
-
-#ifdef RT3370
-VOID NICInitRT3370RFRegisters(
- IN RTMP_ADAPTER *pAd);
-#endif // RT3070 //
-
-#ifdef RT3390
-VOID NICInitRT3390RFRegisters(
- IN RTMP_ADAPTER *pAd);
-#endif // RT3090 //
-
-VOID RT33xxHaltAction(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT33xxSetRxAnt(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Ant);
-
-#endif // RT33xx //
-
-
-
-VOID AsicEvaluateRxAnt(
- IN PRTMP_ADAPTER pAd);
-
-VOID AsicRxAntEvalTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID APSDPeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-BOOLEAN RTMPCheckEntryEnableAutoRateSwitch(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry);
-
-UCHAR RTMPStaFixedTxMode(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry);
-
-VOID RTMPUpdateLegacyTxSetting(
- UCHAR fixed_tx_mode,
- PMAC_TABLE_ENTRY pEntry);
-
-BOOLEAN RTMPAutoRateSwitchCheck(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS MlmeInit(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeHandler(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeHalt(
- IN PRTMP_ADAPTER pAd);
-
-VOID MlmeResetRalinkCounters(
- IN PRTMP_ADAPTER pAd);
-
-VOID BuildChannelList(
- IN PRTMP_ADAPTER pAd);
-
-UCHAR FirstChannel(
- IN PRTMP_ADAPTER pAd);
-
-UCHAR NextChannel(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR channel);
-
-VOID ChangeToCellPowerLimit(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR AironetCellPowerLimit);
-
-//
-// Prototypes of function definition in rtmp_tkip.c
-//
-VOID RTMPInitTkipEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pTKey,
- IN UCHAR KeyId,
- IN PUCHAR pTA,
- IN PUCHAR pMICKey,
- IN PUCHAR pTSC,
- OUT PULONG pIV16,
- OUT PULONG pIV32);
-
-VOID RTMPInitMICEngine(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKey,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN UCHAR UserPriority,
- IN PUCHAR pMICKey);
-
-BOOLEAN RTMPTkipCompareMICValue(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UCHAR UserPriority,
- IN UINT Len);
-
-VOID RTMPCalculateMICValue(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pEncap,
- IN PCIPHER_KEY pKey,
- IN UCHAR apidx);
-
-BOOLEAN RTMPTkipCompareMICValueWithLLC(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pLLC,
- IN PUCHAR pSrc,
- IN PUCHAR pDA,
- IN PUCHAR pSA,
- IN PUCHAR pMICKey,
- IN UINT Len);
-
-VOID RTMPTkipAppendByte(
- IN PTKIP_KEY_INFO pTkip,
- IN UCHAR uChar);
-
-VOID RTMPTkipAppend(
- IN PTKIP_KEY_INFO pTkip,
- IN PUCHAR pSrc,
- IN UINT nBytes);
-
-VOID RTMPTkipGetMIC(
- IN PTKIP_KEY_INFO pTkip);
-
-BOOLEAN RTMPSoftDecryptTKIP(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN UCHAR UserPriority,
- IN PCIPHER_KEY pWpaKey);
-
-BOOLEAN RTMPSoftDecryptAES(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataByteCnt,
- IN PCIPHER_KEY pWpaKey);
-
-
-
-//
-// Prototypes of function definition in cmm_info.c
-//
-INT RT_CfgSetCountryRegion(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg,
- IN INT band);
-
-INT RT_CfgSetWirelessMode(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT RT_CfgSetShortSlot(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT RT_CfgSetWepKey(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING keyString,
- IN CIPHER_KEY *pSharedKey,
- IN INT keyIdx);
-
-INT RT_CfgSetWPAPSKKey(
- IN RTMP_ADAPTER *pAd,
- IN PSTRING keyString,
- IN UCHAR *pHashStr,
- IN INT hashStrLen,
- OUT PUCHAR pPMKBuf);
-
-
-
-//
-// Prototypes of function definition in cmm_info.c
-//
-NDIS_STATUS RTMPWPARemoveKeyProc(
- IN PRTMP_ADAPTER pAd,
- IN PVOID pBuf);
-
-VOID RTMPWPARemoveAllKeys(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN RTMPCheckStrPrintAble(
- IN CHAR *pInPutStr,
- IN UCHAR strLen);
-
-VOID RTMPSetPhyMode(
- IN PRTMP_ADAPTER pAd,
- IN ULONG phymode);
-
-VOID RTMPUpdateHTIE(
- IN RT_HT_CAPABILITY *pRtHt,
- IN UCHAR *pMcsSet,
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT ADD_HT_INFO_IE *pAddHtInfo);
-
-VOID RTMPAddWcidAttributeEntry(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssIdx,
- IN UCHAR KeyIdx,
- IN UCHAR CipherAlg,
- IN MAC_TABLE_ENTRY *pEntry);
-
-PSTRING GetEncryptType(
- CHAR enc);
-
-PSTRING GetAuthMode(
- CHAR auth);
-
-
-VOID RTMPIndicateWPA2Status(
- IN PRTMP_ADAPTER pAdapter);
-
-VOID RTMPOPModeSwitching(
- IN PRTMP_ADAPTER pAd);
-
-
-#ifdef DOT11_N_SUPPORT
-VOID RTMPSetHT(
- IN PRTMP_ADAPTER pAd,
- IN OID_SET_HT_PHYMODE *pHTPhyMode);
-
-VOID RTMPSetIndividualHT(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR apidx);
-#endif // DOT11_N_SUPPORT //
-
-VOID RTMPSendWirelessEvent(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Event_flag,
- IN PUCHAR pAddr,
- IN UCHAR BssIdx,
- IN CHAR Rssi);
-
-VOID NICUpdateCntlCounters(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHeader,
- IN UCHAR SubType,
- IN PRXWI_STRUC pRxWI);
-
-VOID DBGPRINT_TX_RING(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx);
-
-VOID DBGPRINT_RX_RING(
- IN PRTMP_ADAPTER pAd);
-
-CHAR ConvertToRssi(
- IN PRTMP_ADAPTER pAd,
- IN CHAR Rssi,
- IN UCHAR RssiNumber);
-
-
-#ifdef DOT11N_DRAFT3
-VOID BuildEffectedChannelList(
- IN PRTMP_ADAPTER pAd);
-#endif // DOT11N_DRAFT3 //
-
-
-VOID APAsicEvaluateRxAnt(
- IN PRTMP_ADAPTER pAd);
-
-#ifdef ANT_DIVERSITY_SUPPORT
-VOID APAsicAntennaAvg(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR AntSelect,
- IN SHORT *RssiAvg);
-#endif // ANT_DIVERSITY_SUPPORT //
-
-VOID APAsicRxAntEvalTimeout(
- IN PRTMP_ADAPTER pAd);
-
-/*===================================
- Function prototype in cmm_wpa.c
- =================================== */
-VOID RTMPToWirelessSta(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN UINT DataLen,
- IN BOOLEAN bClearFrame);
-
-VOID WpaDerivePTK(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR *PMK,
- IN UCHAR *ANonce,
- IN UCHAR *AA,
- IN UCHAR *SNonce,
- IN UCHAR *SA,
- OUT UCHAR *output,
- IN UINT len);
-
-VOID GenRandom(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR *macAddr,
- OUT UCHAR *random);
-
-BOOLEAN RTMPCheckWPAframe(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pData,
- IN ULONG DataByteCount,
- IN UCHAR FromWhichBSSID);
-
-VOID AES_GTK_KEY_UNWRAP(
- IN UCHAR *key,
- OUT UCHAR *plaintext,
- IN UINT32 c_len,
- IN UCHAR *ciphertext);
-
-BOOLEAN RTMPParseEapolKeyData(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pKeyData,
- IN UCHAR KeyDataLen,
- IN UCHAR GroupKeyIndex,
- IN UCHAR MsgType,
- IN BOOLEAN bWPA2,
- IN MAC_TABLE_ENTRY *pEntry);
-
-VOID ConstructEapolMsg(
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR GroupKeyWepStatus,
- IN UCHAR MsgType,
- IN UCHAR DefaultKeyIdx,
- IN UCHAR *KeyNonce,
- IN UCHAR *TxRSC,
- IN UCHAR *GTK,
- IN UCHAR *RSNIE,
- IN UCHAR RSNIE_Len,
- OUT PEAPOL_PACKET pMsg);
-
-NDIS_STATUS RTMPSoftDecryptBroadCastData(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN NDIS_802_11_ENCRYPTION_STATUS GroupCipher,
- IN PCIPHER_KEY pShard_key);
-
-VOID RTMPMakeRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN UINT AuthMode,
- IN UINT WepStatus,
- IN UCHAR apidx);
-
-//
-// function prototype in ap_wpa.c
-//
-VOID RTMPGetTxTscFromAsic(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR apidx,
- OUT PUCHAR pTxTsc);
-
-VOID APInstallPairwiseKey(
- PRTMP_ADAPTER pAd,
- PMAC_TABLE_ENTRY pEntry);
-
-MAC_TABLE_ENTRY *PACInquiry(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Wcid);
-
-UINT APValidateRSNIE(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN PUCHAR pRsnIe,
- IN UCHAR rsnie_len);
-
-VOID HandleCounterMeasure(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-VOID WPAStart4WayHS(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN ULONG TimeInterval);
-
-VOID WPAStart2WayGroupHS(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry);
-
-VOID PeerPairMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerPairMsg2Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerPairMsg3Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerPairMsg4Action(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerGroupMsg1Action(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PeerGroupMsg2Action(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN VOID *Msg,
- IN UINT MsgLen);
-
-VOID CMTimerExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID WPARetryExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID EnqueueStartForPSKExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID RTMPHandleSTAKey(
- IN PRTMP_ADAPTER pAdapter,
- IN MAC_TABLE_ENTRY *pEntry,
- IN MLME_QUEUE_ELEM *Elem);
-
-VOID PairDisAssocAction(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN USHORT Reason);
-
-VOID MlmeDeAuthAction(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN USHORT Reason);
-
-VOID GREKEYPeriodicExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID WpaDeriveGTK(
- IN UCHAR *PMK,
- IN UCHAR *GNonce,
- IN UCHAR *AA,
- OUT UCHAR *output,
- IN UINT len);
-
-VOID AES_GTK_KEY_WRAP(
- IN UCHAR *key,
- IN UCHAR *plaintext,
- IN UINT32 p_len,
- OUT UCHAR *ciphertext);
-
-VOID AES_128_CMAC(
- IN PUCHAR key,
- IN PUCHAR input,
- IN INT len,
- OUT PUCHAR mac);
-
-VOID WpaSend(
- IN PRTMP_ADAPTER pAdapter,
- IN PUCHAR pPacket,
- IN ULONG Len);
-
-VOID RTMPAddPMKIDCache(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx,
- IN PUCHAR pAddr,
- IN UCHAR *PMKID,
- IN UCHAR *PMK);
-
-INT RTMPSearchPMKIDCache(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx,
- IN PUCHAR pAddr);
-
-VOID RTMPDeletePMKIDCache(
- IN PRTMP_ADAPTER pAd,
- IN INT apidx,
- IN INT idx);
-
-VOID RTMPMaintainPMKIDCache(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPSendTriggerFrame(
- IN PRTMP_ADAPTER pAd,
- IN PVOID pBuffer,
- IN ULONG Length,
- IN UCHAR TxRate,
- IN BOOLEAN bQosNull);
-
-//typedef void (*TIMER_FUNCTION)(unsigned long);
-
-
-/* timeout -- ms */
-VOID RTMP_SetPeriodicTimer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout);
-
-VOID RTMP_OS_Init_Timer(
- IN PRTMP_ADAPTER pAd,
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN TIMER_FUNCTION function,
- IN PVOID data);
-
-VOID RTMP_OS_Add_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout);
-
-VOID RTMP_OS_Mod_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- IN unsigned long timeout);
-
-
-VOID RTMP_OS_Del_Timer(
- IN NDIS_MINIPORT_TIMER *pTimer,
- OUT BOOLEAN *pCancelled);
-
-
-VOID RTMP_OS_Release_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PQUEUE_ENTRY pEntry);
-
-VOID RTMPusecDelay(
- IN ULONG usec);
-
-NDIS_STATUS os_alloc_mem(
- IN RTMP_ADAPTER *pAd,
- OUT UCHAR **mem,
- IN ULONG size);
-
-NDIS_STATUS os_free_mem(
- IN PRTMP_ADAPTER pAd,
- IN PVOID mem);
-
-
-void RTMP_AllocateSharedMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-VOID RTMPFreeTxRxRingMemory(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS AdapterBlockAllocateMemory(
- IN PVOID handle,
- OUT PVOID *ppAd);
-
-void RTMP_AllocateTxDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN UINT Index,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-void RTMP_AllocateFirstTxBuffer(
- IN PRTMP_ADAPTER pAd,
- IN UINT Index,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-void RTMP_FreeFirstTxBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- IN PVOID VirtualAddress,
- IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-void RTMP_AllocateMgmtDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-void RTMP_AllocateRxDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-void RTMP_FreeDescMemory(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN PVOID VirtualAddress,
- IN NDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-PNDIS_PACKET RtmpOSNetPktAlloc(
- IN RTMP_ADAPTER *pAd,
- IN int size);
-
-PNDIS_PACKET RTMP_AllocateRxPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
-
-PNDIS_PACKET RTMP_AllocateTxPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length,
- IN BOOLEAN Cached,
- OUT PVOID *VirtualAddress);
-
-PNDIS_PACKET RTMP_AllocateFragPacketBuffer(
- IN PRTMP_ADAPTER pAd,
- IN ULONG Length);
-
-void RTMP_QueryPacketInfo(
- IN PNDIS_PACKET pPacket,
- OUT PACKET_INFO *pPacketInfo,
- OUT PUCHAR *pSrcBufVA,
- OUT UINT *pSrcBufLen);
-
-void RTMP_QueryNextPacketInfo(
- IN PNDIS_PACKET *ppPacket,
- OUT PACKET_INFO *pPacketInfo,
- OUT PUCHAR *pSrcBufVA,
- OUT UINT *pSrcBufLen);
-
-
-BOOLEAN RTMP_FillTxBlkInfo(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk);
-
-
-PRTMP_SCATTER_GATHER_LIST
-rt_get_sg_list_from_packet(PNDIS_PACKET pPacket, RTMP_SCATTER_GATHER_LIST *sg);
-
-
- void announce_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-
-UINT BA_Reorder_AMSDU_Annnounce(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket);
-
-
-UINT Handle_AMSDU_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pData,
- IN ULONG DataSize,
- IN UCHAR FromWhichBSSID);
-
-
-void convert_802_11_to_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR p8023hdr,
- IN PUCHAR pData,
- IN ULONG DataSize,
- IN UCHAR FromWhichBSSID);
-
-
-PNET_DEV get_netdev_from_bssid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR FromWhichBSSID);
-
-
-PNDIS_PACKET duplicate_pkt(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN ULONG DataSize,
- IN UCHAR FromWhichBSSID);
-
-
-PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pOldPkt);
-
-PNDIS_PACKET duplicate_pkt_with_VLAN(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- IN PUCHAR pData,
- IN ULONG DataSize,
- IN UCHAR FromWhichBSSID);
-
-
-UCHAR VLAN_8023_Header_Copy(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pHeader802_3,
- IN UINT HdrLen,
- OUT PUCHAR pData,
- IN UCHAR FromWhichBSSID);
-
-#ifdef DOT11_N_SUPPORT
-void ba_flush_reordering_timeout_mpdus(
- IN PRTMP_ADAPTER pAd,
- IN PBA_REC_ENTRY pBAEntry,
- IN ULONG Now32);
-
-
-VOID BAOriSessionSetUp(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN UCHAR TID,
- IN USHORT TimeOut,
- IN ULONG DelayTime,
- IN BOOLEAN isForced);
-
-VOID BASessionTearDownALL(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid);
-#endif // DOT11_N_SUPPORT //
-
-BOOLEAN OS_Need_Clone_Packet(void);
-
-
-VOID build_tx_packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pFrame,
- IN ULONG FrameLen);
-
-
-VOID BAOriSessionTearDown(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR TID,
- IN BOOLEAN bPassive,
- IN BOOLEAN bForceSend);
-
-VOID BARecSessionTearDown(
- IN OUT PRTMP_ADAPTER pAd,
- IN UCHAR Wcid,
- IN UCHAR TID,
- IN BOOLEAN bPassive);
-
-BOOLEAN ba_reordering_resource_init(PRTMP_ADAPTER pAd, int num);
-void ba_reordering_resource_release(PRTMP_ADAPTER pAd);
-
-
-
-#ifdef NINTENDO_AP
-VOID InitNINTENDO_TABLE(
- IN PRTMP_ADAPTER pAd);
-
-UCHAR CheckNINTENDO_TABLE(
- IN PRTMP_ADAPTER pAd,
- PCHAR pDS_Ssid,
- UCHAR DS_SsidLen,
- PUCHAR pDS_Addr);
-
-UCHAR DelNINTENDO_ENTRY(
- IN PRTMP_ADAPTER pAd,
- UCHAR * pDS_Addr);
-
-VOID RTMPIoctlNintendoCapable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlNintendoGetTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlNintendoSetTable(
- IN PRTMP_ADAPTER pAd,
- IN struct iwreq *wrq);
-
-#endif // NINTENDO_AP //
-
-BOOLEAN rtstrmactohex(
- IN PSTRING s1,
- IN PSTRING s2);
-
-BOOLEAN rtstrcasecmp(
- IN PSTRING s1,
- IN PSTRING s2);
-
-PSTRING rtstrstruncasecmp(
- IN PSTRING s1,
- IN PSTRING s2);
-
-PSTRING rtstrstr(
- IN const PSTRING s1,
- IN const PSTRING s2);
-
-PSTRING rstrtok(
- IN PSTRING s,
- IN const PSTRING ct);
-
-int rtinet_aton(
- const PSTRING cp,
- unsigned int *addr);
-
-////////// common ioctl functions //////////
-INT Set_DriverVersion_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_CountryRegion_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_CountryRegionABand_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_WirelessMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_Channel_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ShortSlot_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_TxPower_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BGProtection_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_TxPreamble_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_RTSThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_FragThreshold_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_TxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef AGGREGATION_SUPPORT
-INT Set_PktAggregate_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // AGGREGATION_SUPPORT //
-
-#ifdef INF_AMAZON_PPA
-INT Set_INF_AMAZON_SE_PPA_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-
-#endif // INF_AMAZON_PPA //
-
-INT Set_IEEE80211H_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef DBG
-INT Set_Debug_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif
-
-INT Show_DescInfo_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ResetStatCounter_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef DOT11_N_SUPPORT
-INT Set_BASetup_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BADecline_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BAOriTearDown_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_BARecTearDown_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtBw_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtMcs_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtGi_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtOpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtStbc_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtHtc_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtExtcha_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtMpduDensity_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtBaWinSize_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtRdg_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtLinkAdapt_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtAmsdu_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtAutoBa_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtProtect_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtMimoPs_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-
-INT Set_ForceShortGI_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ForceGF_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT SetCommonHT(
- IN PRTMP_ADAPTER pAd);
-
-INT Set_SendPSMPAction_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtMIMOPSmode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-
-INT Set_HtTxBASize_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_HtDisallowTKIP_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#endif // DOT11_N_SUPPORT //
-
-
-
-#ifdef CONFIG_STA_SUPPORT
-//Dls , kathy
-VOID RTMPSendDLSTearDownFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA);
-
-#ifdef DOT11_N_SUPPORT
-//Block ACK
-VOID QueryBATABLE(
- IN PRTMP_ADAPTER pAd,
- OUT PQUERYBA_TABLE pBAT);
-#endif // DOT11_N_SUPPORT //
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-INT WpaCheckEapCode(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pFrame,
- IN USHORT FrameLen,
- IN USHORT OffSet);
-
-VOID WpaSendMicFailureToWpaSupplicant(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bUnicast);
-
-VOID SendAssocIEsToWpaSupplicant(
- IN PRTMP_ADAPTER pAd);
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-int wext_notify_event_assoc(
- IN RTMP_ADAPTER *pAd);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-#endif // CONFIG_STA_SUPPORT //
-
-
-
-#ifdef DOT11_N_SUPPORT
-VOID Handle_BSS_Width_Trigger_Events(
- IN PRTMP_ADAPTER pAd);
-
-void build_ext_channel_switch_ie(
- IN PRTMP_ADAPTER pAd,
- IN HT_EXT_CHANNEL_SWITCH_ANNOUNCEMENT_IE *pIE);
-#endif // DOT11_N_SUPPORT //
-
-
-BOOLEAN APRxDoneInterruptHandle(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN STARxDoneInterruptHandle(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN argc);
-
-#ifdef DOT11_N_SUPPORT
-// AMPDU packet indication
-VOID Indicate_AMPDU_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-// AMSDU packet indication
-VOID Indicate_AMSDU_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-#endif // DOT11_N_SUPPORT //
-
-// Normal legacy Rx packet indication
-VOID Indicate_Legacy_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-VOID Indicate_EAPOL_Packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-void update_os_packet_info(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-void wlan_802_11_to_802_3_packet(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN PUCHAR pHeader802_3,
- IN UCHAR FromWhichBSSID);
-
-UINT deaggregate_AMSDU_announce(
- IN PRTMP_ADAPTER pAd,
- PNDIS_PACKET pPacket,
- IN PUCHAR pData,
- IN ULONG DataSize);
-
-
-#ifdef CONFIG_STA_SUPPORT
-// remove LLC and get 802_3 Header
-#define RTMP_802_11_REMOVE_LLC_AND_CONVERT_TO_802_3(_pRxBlk, _pHeader802_3) \
-{ \
- PUCHAR _pRemovedLLCSNAP = NULL, _pDA, _pSA; \
- \
- if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_MESH)) \
- { \
- _pDA = _pRxBlk->pHeader->Addr3; \
- _pSA = (PUCHAR)_pRxBlk->pHeader + sizeof(HEADER_802_11); \
- } \
- else \
- { \
- if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_INFRA)) \
- { \
- _pDA = _pRxBlk->pHeader->Addr1; \
- if (RX_BLK_TEST_FLAG(_pRxBlk, fRX_DLS)) \
- _pSA = _pRxBlk->pHeader->Addr2; \
- else \
- _pSA = _pRxBlk->pHeader->Addr3; \
- } \
- else \
- { \
- _pDA = _pRxBlk->pHeader->Addr1; \
- _pSA = _pRxBlk->pHeader->Addr2; \
- } \
- } \
- \
- CONVERT_TO_802_3(_pHeader802_3, _pDA, _pSA, _pRxBlk->pData, \
- _pRxBlk->DataSize, _pRemovedLLCSNAP); \
-}
-#endif // CONFIG_STA_SUPPORT //
-
-
-BOOLEAN APFowardWirelessStaToWirelessSta(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN ULONG FromWhichBSSID);
-
-VOID Announce_or_Forward_802_3_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR FromWhichBSSID);
-
-VOID Sta_Announce_or_Forward_802_3_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR FromWhichBSSID);
-
-
-#ifdef CONFIG_STA_SUPPORT
-#define ANNOUNCE_OR_FORWARD_802_3_PACKET(_pAd, _pPacket, _FromWhichBSS)\
- Sta_Announce_or_Forward_802_3_Packet(_pAd, _pPacket, _FromWhichBSS);
- //announce_802_3_packet(_pAd, _pPacket);
-#endif // CONFIG_STA_SUPPORT //
-
-
-PNDIS_PACKET DuplicatePacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR FromWhichBSSID);
-
-
-PNDIS_PACKET ClonePacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pData,
- IN ULONG DataSize);
-
-
-// Normal, AMPDU or AMSDU
-VOID CmmRxnonRalinkFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-VOID CmmRxRalinkFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID);
-
-VOID Update_Rssi_Sample(
- IN PRTMP_ADAPTER pAd,
- IN RSSI_SAMPLE *pRssi,
- IN PRXWI_STRUC pRxWI);
-
-PNDIS_PACKET GetPacketFromRxRing(
- IN PRTMP_ADAPTER pAd,
- OUT PRT28XX_RXD_STRUC pSaveRxD,
- OUT BOOLEAN *pbReschedule,
- IN OUT UINT32 *pRxPending);
-
-PNDIS_PACKET RTMPDeFragmentDataFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk);
-
-////////////////////////////////////////
-
-VOID RTMPIoctlGetSiteSurvey(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-
-
-
-
-#ifdef SNMP_SUPPORT
-//for snmp , kathy
-typedef struct _DefaultKeyIdxValue
-{
- UCHAR KeyIdx;
- UCHAR Value[16];
-} DefaultKeyIdxValue, *PDefaultKeyIdxValue;
-#endif
-
-
-#ifdef CONFIG_STA_SUPPORT
-enum {
- DIDmsg_lnxind_wlansniffrm = 0x00000044,
- DIDmsg_lnxind_wlansniffrm_hosttime = 0x00010044,
- DIDmsg_lnxind_wlansniffrm_mactime = 0x00020044,
- DIDmsg_lnxind_wlansniffrm_channel = 0x00030044,
- DIDmsg_lnxind_wlansniffrm_rssi = 0x00040044,
- DIDmsg_lnxind_wlansniffrm_sq = 0x00050044,
- DIDmsg_lnxind_wlansniffrm_signal = 0x00060044,
- DIDmsg_lnxind_wlansniffrm_noise = 0x00070044,
- DIDmsg_lnxind_wlansniffrm_rate = 0x00080044,
- DIDmsg_lnxind_wlansniffrm_istx = 0x00090044,
- DIDmsg_lnxind_wlansniffrm_frmlen = 0x000A0044
-};
-enum {
- P80211ENUM_msgitem_status_no_value = 0x00
-};
-enum {
- P80211ENUM_truth_false = 0x00,
- P80211ENUM_truth_true = 0x01
-};
-
-/* Definition from madwifi */
-typedef struct {
- UINT32 did;
- UINT16 status;
- UINT16 len;
- UINT32 data;
-} p80211item_uint32_t;
-
-typedef struct {
- UINT32 msgcode;
- UINT32 msglen;
-#define WLAN_DEVNAMELEN_MAX 16
- UINT8 devname[WLAN_DEVNAMELEN_MAX];
- p80211item_uint32_t hosttime;
- p80211item_uint32_t mactime;
- p80211item_uint32_t channel;
- p80211item_uint32_t rssi;
- p80211item_uint32_t sq;
- p80211item_uint32_t signal;
- p80211item_uint32_t noise;
- p80211item_uint32_t rate;
- p80211item_uint32_t istx;
- p80211item_uint32_t frmlen;
-} wlan_ng_prism2_header;
-
-/* The radio capture header precedes the 802.11 header. */
-typedef struct PACKED _ieee80211_radiotap_header {
- UINT8 it_version; /* Version 0. Only increases
- * for drastic changes,
- * introduction of compatible
- * new fields does not count.
- */
- UINT8 it_pad;
- UINT16 it_len; /* length of the whole
- * header in bytes, including
- * it_version, it_pad,
- * it_len, and data fields.
- */
- UINT32 it_present; /* A bitmap telling which
- * fields are present. Set bit 31
- * (0x80000000) to extend the
- * bitmap by another 32 bits.
- * Additional extensions are made
- * by setting bit 31.
- */
-}ieee80211_radiotap_header ;
-
-enum ieee80211_radiotap_type {
- IEEE80211_RADIOTAP_TSFT = 0,
- IEEE80211_RADIOTAP_FLAGS = 1,
- IEEE80211_RADIOTAP_RATE = 2,
- IEEE80211_RADIOTAP_CHANNEL = 3,
- IEEE80211_RADIOTAP_FHSS = 4,
- IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5,
- IEEE80211_RADIOTAP_DBM_ANTNOISE = 6,
- IEEE80211_RADIOTAP_LOCK_QUALITY = 7,
- IEEE80211_RADIOTAP_TX_ATTENUATION = 8,
- IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9,
- IEEE80211_RADIOTAP_DBM_TX_POWER = 10,
- IEEE80211_RADIOTAP_ANTENNA = 11,
- IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12,
- IEEE80211_RADIOTAP_DB_ANTNOISE = 13
-};
-
-#define WLAN_RADIOTAP_PRESENT ( \
- (1 << IEEE80211_RADIOTAP_TSFT) | \
- (1 << IEEE80211_RADIOTAP_FLAGS) | \
- (1 << IEEE80211_RADIOTAP_RATE) | \
- 0)
-
-typedef struct _wlan_radiotap_header {
- ieee80211_radiotap_header wt_ihdr;
- INT64 wt_tsft;
- UINT8 wt_flags;
- UINT8 wt_rate;
-} wlan_radiotap_header;
-/* Definition from madwifi */
-
-void send_monitor_packets(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk);
-
-
-VOID RTMPSetDesiredRates(
- IN PRTMP_ADAPTER pAdapter,
- IN LONG Rates);
-#endif // CONFIG_STA_SUPPORT //
-
-INT Set_FixedTxMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
-INT Set_OpMode_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-
-INT Set_LongRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_ShortRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-BOOLEAN RT28XXChipsetCheck(
- IN void *_dev_p);
-
-
-VOID RT28XXDMADisable(
- IN RTMP_ADAPTER *pAd);
-
-VOID RT28XXDMAEnable(
- IN RTMP_ADAPTER *pAd);
-
-VOID RT28xx_UpdateBeaconToAsic(
- IN RTMP_ADAPTER * pAd,
- IN INT apidx,
- IN ULONG BeaconLen,
- IN ULONG UpdatePos);
-
-int rt28xx_init(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING pDefaultMac,
- IN PSTRING pHostName);
-
-BOOLEAN RT28XXSecurityKeyAdd(
- IN PRTMP_ADAPTER pAd,
- IN ULONG apidx,
- IN ULONG KeyIdx,
- IN MAC_TABLE_ENTRY *pEntry);
-
-NDIS_STATUS RtmpNetTaskInit(
- IN RTMP_ADAPTER *pAd);
-
-VOID RtmpNetTaskExit(
- IN PRTMP_ADAPTER pAd);
-
-NDIS_STATUS RtmpMgmtTaskInit(
- IN RTMP_ADAPTER *pAd);
-
-VOID RtmpMgmtTaskExit(
- IN RTMP_ADAPTER *pAd);
-
-void tbtt_tasklet(unsigned long data);
-
-
-PNET_DEV RtmpPhyNetDevInit(
- IN RTMP_ADAPTER *pAd,
- IN RTMP_OS_NETDEV_OP_HOOK *pNetHook);
-
-BOOLEAN RtmpPhyNetDevExit(
- IN RTMP_ADAPTER *pAd,
- IN PNET_DEV net_dev);
-
-INT RtmpRaDevCtrlInit(
- IN RTMP_ADAPTER *pAd,
- IN RTMP_INF_TYPE infType);
-
-BOOLEAN RtmpRaDevCtrlExit(
- IN RTMP_ADAPTER *pAd);
-
-
-#ifdef RTMP_MAC_PCI
-//
-// Function Prototype in cmm_data_pci.c
-//
-USHORT RtmpPCI_WriteTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN BOOLEAN bIsLast,
- OUT USHORT *FreeNumber);
-
-USHORT RtmpPCI_WriteSingleTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN BOOLEAN bIsLast,
- OUT USHORT *FreeNumber);
-
-USHORT RtmpPCI_WriteMultiTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR frameNum,
- OUT USHORT *FreeNumber);
-
-USHORT RtmpPCI_WriteFragTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR fragNum,
- OUT USHORT *FreeNumber);
-
-USHORT RtmpPCI_WriteSubTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN BOOLEAN bIsLast,
- OUT USHORT *FreeNumber);
-
-VOID RtmpPCI_FinalWriteTxResource(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN USHORT totalMPDUSize,
- IN USHORT FirstTxIdx);
-
-VOID RtmpPCIDataLastTxIdx(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN USHORT LastTxIdx);
-
-VOID RtmpPCIDataKickOut(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR QueIdx);
-
-
-int RtmpPCIMgmtKickOut(
- IN RTMP_ADAPTER *pAd,
- IN UCHAR QueIdx,
- IN PNDIS_PACKET pPacket,
- IN PUCHAR pSrcBufVA,
- IN UINT SrcBufLen);
-
-
-NDIS_STATUS RTMPCheckRxError(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHeader,
- IN PRXWI_STRUC pRxWI,
- IN PRT28XX_RXD_STRUC pRxD);
-
-BOOLEAN RT28xxPciAsicRadioOff(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level,
- IN USHORT TbttNumToNextWakeUp);
-
-BOOLEAN RT28xxPciAsicRadioOn(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level);
-
-#ifdef CONFIG_STA_SUPPORT
-VOID RTMPInitPCIeLinkCtrlValue(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPFindHostPCIDev(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPPCIeLinkCtrlValueRestore(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Level);
-
-VOID RTMPPCIeLinkCtrlSetting(
- IN PRTMP_ADAPTER pAd,
- IN USHORT Max);
-
-VOID RTMPrt3xSetPCIePowerLinkCtrl(
- IN PRTMP_ADAPTER pAd);
-
-
-VOID RT28xxPciStaAsicForceWakeup(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bFromTx);
-
-VOID RT28xxPciStaAsicSleepThenAutoWakeup(
- IN PRTMP_ADAPTER pAd,
- IN USHORT TbttNumToNextWakeUp);
-
-VOID PsPollWakeExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-
-VOID RadioOnExec(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3);
-#endif // CONFIG_STA_SUPPORT //
-
-VOID RT28xxPciMlmeRadioOn(
- IN PRTMP_ADAPTER pAd);
-
-VOID RT28xxPciMlmeRadioOFF(
- IN PRTMP_ADAPTER pAd);
-#endif // RTMP_MAC_PCI //
-
-VOID AsicTurnOffRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel);
-
-VOID AsicTurnOnRFClk(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR Channel);
-
-
-
-#ifdef RTMP_TIMER_TASK_SUPPORT
-INT RtmpTimerQThread(
- IN OUT PVOID Context);
-
-RTMP_TIMER_TASK_ENTRY *RtmpTimerQInsert(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer);
-
-BOOLEAN RtmpTimerQRemove(
- IN RTMP_ADAPTER *pAd,
- IN RALINK_TIMER_STRUCT *pTimer);
-
-void RtmpTimerQExit(
- IN RTMP_ADAPTER *pAd);
-
-void RtmpTimerQInit(
- IN RTMP_ADAPTER *pAd);
-#endif // RTMP_TIMER_TASK_SUPPORT //
-
-
-
-////////////////////////////////////////
-
-VOID QBSS_LoadInit(
- IN RTMP_ADAPTER *pAd);
-
-UINT32 QBSS_LoadElementAppend(
- IN RTMP_ADAPTER *pAd,
- OUT UINT8 *buf_p);
-
-VOID QBSS_LoadUpdate(
- IN RTMP_ADAPTER *pAd);
-
-///////////////////////////////////////
-INT RTMPShowCfgValue(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING pName,
- IN PSTRING pBuf);
-
-PSTRING RTMPGetRalinkAuthModeStr(
- IN NDIS_802_11_AUTHENTICATION_MODE authMode);
-
-PSTRING RTMPGetRalinkEncryModeStr(
- IN USHORT encryMode);
-//////////////////////////////////////
-
-#ifdef CONFIG_STA_SUPPORT
-VOID AsicStaBbpTuning(
- IN PRTMP_ADAPTER pAd);
-
-BOOLEAN StaAddMacTableEntry(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR MaxSupportedRateIn500Kbps,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN ADD_HT_INFO_IE *pAddHtInfo,
- IN UCHAR AddHtInfoLen,
- IN USHORT CapabilityInfo);
-
-
-BOOLEAN AUTH_ReqSend(
- IN PRTMP_ADAPTER pAd,
- IN PMLME_QUEUE_ELEM pElem,
- IN PRALINK_TIMER_STRUCT pAuthTimer,
- IN PSTRING pSMName,
- IN USHORT SeqNo,
- IN PUCHAR pNewElement,
- IN ULONG ElementLen);
-#endif // CONFIG_STA_SUPPORT //
-
-void RTMP_IndicateMediaState(
- IN PRTMP_ADAPTER pAd);
-
-VOID ReSyncBeaconTime(
- IN PRTMP_ADAPTER pAd);
-
-VOID RTMPSetAGCInitValue(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BandWidth);
-
-int rt28xx_close(IN PNET_DEV dev);
-int rt28xx_open(IN PNET_DEV dev);
-
-
-#define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++)
-#define VIRTUAL_IF_DEC(__pAd) ((__pAd)->VirtualIfCnt--)
-#define VIRTUAL_IF_NUM(__pAd) ((__pAd)->VirtualIfCnt)
-
-
-#ifdef LINUX
-__inline INT VIRTUAL_IF_UP(PRTMP_ADAPTER pAd)
-{
- if (VIRTUAL_IF_NUM(pAd) == 0)
- {
- if (rt28xx_open(pAd->net_dev) != 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("rt28xx_open return fail!\n"));
- return -1;
- }
- }
- else
- {
- }
- VIRTUAL_IF_INC(pAd);
- return 0;
-}
-
-__inline VOID VIRTUAL_IF_DOWN(PRTMP_ADAPTER pAd)
-{
- VIRTUAL_IF_DEC(pAd);
- if (VIRTUAL_IF_NUM(pAd) == 0)
- rt28xx_close(pAd->net_dev);
- return;
-}
-#endif // LINUX //
-
-
-
-
-/*
- OS Related funciton prototype definitions.
- TODO: Maybe we need to move these function prototypes to other proper place.
-*/
-int RtmpOSWrielessEventSend(
- IN RTMP_ADAPTER *pAd,
- IN UINT32 eventType,
- IN INT flags,
- IN PUCHAR pSrcMac,
- IN PUCHAR pData,
- IN UINT32 dataLen);
-
-int RtmpOSNetDevAddrSet(
- IN PNET_DEV pNetDev,
- IN PUCHAR pMacAddr);
-
-int RtmpOSNetDevAttach(
- IN PNET_DEV pNetDev,
- IN RTMP_OS_NETDEV_OP_HOOK *pDevOpHook);
-
-void RtmpOSNetDevClose(
- IN PNET_DEV pNetDev);
-
-void RtmpOSNetDevDetach(
- IN PNET_DEV pNetDev);
-
-INT RtmpOSNetDevAlloc(
- IN PNET_DEV *pNewNetDev,
- IN UINT32 privDataSize);
-
-void RtmpOSNetDevFree(
- IN PNET_DEV pNetDev);
-
-PNET_DEV RtmpOSNetDevGetByName(
- IN PNET_DEV pNetDev,
- IN PSTRING pDevName);
-
-void RtmpOSNetDeviceRefPut(
- IN PNET_DEV pNetDev);
-
-PNET_DEV RtmpOSNetDevCreate(
- IN RTMP_ADAPTER *pAd,
- IN INT devType,
- IN INT devNum,
- IN INT privMemSize,
- IN PSTRING pNamePrefix);
-
-/*
- Task operation related function prototypes
-*/
-void RtmpOSTaskCustomize(
- IN RTMP_OS_TASK *pTask);
-
-INT RtmpOSTaskNotifyToExit(
- IN RTMP_OS_TASK *pTask);
-
-NDIS_STATUS RtmpOSTaskKill(
- IN RTMP_OS_TASK *pTask);
-
-NDIS_STATUS RtmpOSTaskInit(
- IN RTMP_OS_TASK *pTask,
- PSTRING pTaskName,
- VOID *pPriv);
-
-NDIS_STATUS RtmpOSTaskAttach(
- IN RTMP_OS_TASK *pTask,
- IN int (*fn)(void *),
- IN void *arg);
-
-
-/*
- File operation related function prototypes
-*/
-RTMP_OS_FD RtmpOSFileOpen(
- IN char *pPath,
- IN int flag,
- IN int mode);
-
-int RtmpOSFileClose(
- IN RTMP_OS_FD osfd);
-
-void RtmpOSFileSeek(
- IN RTMP_OS_FD osfd,
- IN int offset);
-
-int RtmpOSFileRead(
- IN RTMP_OS_FD osfd,
- IN char *pDataPtr,
- IN int readLen);
-
-int RtmpOSFileWrite(
- IN RTMP_OS_FD osfd,
- IN char *pDataPtr,
- IN int writeLen);
-
-void RtmpOSFSInfoChange(
- IN RTMP_OS_FS_INFO *pOSFSInfo,
- IN BOOLEAN bSet);
-
-
-#endif // __RTMP_H__
diff --git a/drivers/staging/rt3090/rtmp_def.h b/drivers/staging/rt3090/rtmp_def.h
deleted file mode 100644
index aeb739d0935c..000000000000
--- a/drivers/staging/rt3090/rtmp_def.h
+++ /dev/null
@@ -1,1650 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_def.h
-
- Abstract:
- Miniport related definition header
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Paul Lin 08-01-2002 created
- John Chang 08-05-2003 add definition for 11g & other drafts
-*/
-#ifndef __RTMP_DEF_H__
-#define __RTMP_DEF_H__
-
-#include "oid.h"
-
-#undef AP_WSC_INCLUDED
-#undef STA_WSC_INCLUDED
-#undef WSC_INCLUDED
-
-
-#ifdef CONFIG_STA_SUPPORT
-#endif // CONFIG_STA_SUPPORT //
-
-#if defined(AP_WSC_INCLUDED) || defined(STA_WSC_INCLUDED)
-#define WSC_INCLUDED
-#endif
-//
-// Debug information verbosity: lower values indicate higher urgency
-//
-#define RT_DEBUG_OFF 0
-#define RT_DEBUG_ERROR 1
-#define RT_DEBUG_WARN 2
-#define RT_DEBUG_TRACE 3
-#define RT_DEBUG_INFO 4
-#define RT_DEBUG_LOUD 5
-
-#define NIC_TAG ((ULONG)'0682')
-#define NIC_DBG_STRING ("**RT28xx**")
-
-#ifdef SNMP_SUPPORT
-// for snmp
-// to get manufacturer OUI, kathy, 2008_0220
-#define ManufacturerOUI_LEN 3
-#define ManufacturerNAME ("Ralink Technology Company.")
-#define ResourceTypeIdName ("Ralink_ID")
-#endif
-
-
-//#define PACKED
-
-#define RALINK_2883_VERSION ((UINT32)0x28830300)
-#define RALINK_2880E_VERSION ((UINT32)0x28720200)
-#define RALINK_3070_VERSION ((UINT32)0x30700200)
-
-#define MAX_RX_PKT_LEN 1520
-
-//
-// Entry number for each DMA descriptor ring
-//
-
-#ifdef RTMP_MAC_PCI
-#define TX_RING_SIZE 64 //64
-#define MGMT_RING_SIZE 128
-#define RX_RING_SIZE 128 //64
-#define MAX_TX_PROCESS TX_RING_SIZE //8
-#define MAX_DMA_DONE_PROCESS TX_RING_SIZE
-#define MAX_TX_DONE_PROCESS TX_RING_SIZE //8
-#define LOCAL_TXBUF_SIZE 2
-#endif // RTMP_MAC_PCI //
-
-#define PCI_VIRT_TO_PHYS(__Addr) (((UINT32)(__Addr)) & 0x0FFFFFFF)
-
-
-#ifdef MULTIPLE_CARD_SUPPORT
-// MC: Multple Cards
-#define MAX_NUM_OF_MULTIPLE_CARD 32
-#endif // MULTIPLE_CARD_SUPPORT //
-
-#define MAX_RX_PROCESS 128 //64 //32
-#define NUM_OF_LOCAL_TXBUF 2
-#define TXD_SIZE 16
-#define TXWI_SIZE 16
-#define RXD_SIZE 16
-#define RXWI_SIZE 16
-// TXINFO_SIZE + TXWI_SIZE + 802.11 Header Size + AMSDU sub frame header
-#define TX_DMA_1ST_BUFFER_SIZE 96 // only the 1st physical buffer is pre-allocated
-#define MGMT_DMA_BUFFER_SIZE 1536 //2048
-#define RX_BUFFER_AGGRESIZE 3840 //3904 //3968 //4096 //2048 //4096
-#define RX_BUFFER_NORMSIZE 3840 //3904 //3968 //4096 //2048 //4096
-#define TX_BUFFER_NORMSIZE RX_BUFFER_NORMSIZE
-#define MAX_FRAME_SIZE 2346 // Maximum 802.11 frame size
-#define MAX_AGGREGATION_SIZE 3840 //3904 //3968 //4096
-#define MAX_NUM_OF_TUPLE_CACHE 2
-#define MAX_MCAST_LIST_SIZE 32
-#define MAX_LEN_OF_VENDOR_DESC 64
-//#define MAX_SIZE_OF_MCAST_PSQ (NUM_OF_LOCAL_TXBUF >> 2) // AP won't spend more than 1/4 of total buffers on M/BCAST PSQ
-#define MAX_SIZE_OF_MCAST_PSQ 32
-
-#define MAX_RX_PROCESS_CNT (RX_RING_SIZE)
-
-
-/*
- WMM Note: If memory of your system is not much, please reduce the definition;
- or when you do WMM test, the queue for low priority AC will be full, i.e.
- TX_RING_SIZE + MAX_PACKETS_IN_QUEUE packets for the AC will be buffered in
- WLAN, maybe no any packet buffer can be got in Ethernet driver.
-
- Sometimes no packet buffer can be got in Ethernet driver, the system will
- send flow control packet to the sender to slow down its sending rate.
- So no WMM can be saw in the air.
-*/
-
-/*
- Need to use 64 in vxworks for test case WMM A5-T07
- Two dnlink (10Mbps) from a WMM station to a non-WMM station.
- If use 256, queue is not enough.
- And in rt_main_end.c, clConfig.clNum = RX_RING_SIZE * 3; is changed to
- clConfig.clNum = RX_RING_SIZE * 4;
-*/
-// TODO: For VxWorks the size is 256. Shall we cahnge the value as 256 for all OS?????
-#define MAX_PACKETS_IN_QUEUE (512) //(512) // to pass WMM A5-WPAPSK
-
-#define MAX_PACKETS_IN_MCAST_PS_QUEUE 32
-#define MAX_PACKETS_IN_PS_QUEUE 128 //32
-#define WMM_NUM_OF_AC 4 /* AC0, AC1, AC2, and AC3 */
-
-
-#ifdef RTMP_EFUSE_SUPPORT
-//2008/09/11:KH add to support efuse<--
-#define MAX_EEPROM_BIN_FILE_SIZE 1024
-#define EFUSE_BUFFER_PATH "/tmp/RT30xxEEPROM.bin"
-//2008/09/11:KH add to support efuse-->
-#endif // RTMP_EFUSE_SUPPORT //
-
-// RxFilter
-#define STANORMAL 0x17f97
-#define APNORMAL 0x15f97
-#define PSPXLINK 0x17f93
-//
-// RTMP_ADAPTER flags
-//
-#define fRTMP_ADAPTER_MAP_REGISTER 0x00000001
-#define fRTMP_ADAPTER_INTERRUPT_IN_USE 0x00000002
-#define fRTMP_ADAPTER_HARDWARE_ERROR 0x00000004
-#define fRTMP_ADAPTER_SCATTER_GATHER 0x00000008
-#define fRTMP_ADAPTER_SEND_PACKET_ERROR 0x00000010
-#define fRTMP_ADAPTER_MLME_RESET_IN_PROGRESS 0x00000020
-#define fRTMP_ADAPTER_HALT_IN_PROGRESS 0x00000040
-#define fRTMP_ADAPTER_RESET_IN_PROGRESS 0x00000080
-#define fRTMP_ADAPTER_NIC_NOT_EXIST 0x00000100
-#define fRTMP_ADAPTER_TX_RING_ALLOCATED 0x00000200
-#define fRTMP_ADAPTER_REMOVE_IN_PROGRESS 0x00000400
-#define fRTMP_ADAPTER_MIMORATE_INUSED 0x00000800
-#define fRTMP_ADAPTER_RX_RING_ALLOCATED 0x00001000
-#define fRTMP_ADAPTER_INTERRUPT_ACTIVE 0x00002000
-#define fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS 0x00004000
-#define fRTMP_ADAPTER_REASSOC_IN_PROGRESS 0x00008000
-#define fRTMP_ADAPTER_MEDIA_STATE_PENDING 0x00010000
-#define fRTMP_ADAPTER_RADIO_OFF 0x00020000
-#define fRTMP_ADAPTER_BULKOUT_RESET 0x00040000
-#define fRTMP_ADAPTER_BULKIN_RESET 0x00080000
-#define fRTMP_ADAPTER_RDG_ACTIVE 0x00100000
-#define fRTMP_ADAPTER_DYNAMIC_BE_TXOP_ACTIVE 0x00200000
-#define fRTMP_ADAPTER_SCAN_2040 0x04000000
-#define fRTMP_ADAPTER_RADIO_MEASUREMENT 0x08000000
-
-#define fRTMP_ADAPTER_START_UP 0x10000000 //Devive already initialized and enabled Tx/Rx.
-#define fRTMP_ADAPTER_MEDIA_STATE_CHANGE 0x20000000
-#define fRTMP_ADAPTER_IDLE_RADIO_OFF 0x40000000
-
-// Lock bit for accessing different ring buffers
-//#define fRTMP_ADAPTER_TX_RING_BUSY 0x80000000
-//#define fRTMP_ADAPTER_MGMT_RING_BUSY 0x40000000
-//#define fRTMP_ADAPTER_ATIM_RING_BUSY 0x20000000
-//#define fRTMP_ADAPTER_RX_RING_BUSY 0x10000000
-
-// Lock bit for accessing different queue
-//#define fRTMP_ADAPTER_TX_QUEUE_BUSY 0x08000000
-//#define fRTMP_ADAPTER_MGMT_QUEUE_BUSY 0x04000000
-
-//
-// STA operation status flags
-//
-#define fOP_STATUS_INFRA_ON 0x00000001
-#define fOP_STATUS_ADHOC_ON 0x00000002
-#define fOP_STATUS_BG_PROTECTION_INUSED 0x00000004
-#define fOP_STATUS_SHORT_SLOT_INUSED 0x00000008
-#define fOP_STATUS_SHORT_PREAMBLE_INUSED 0x00000010
-#define fOP_STATUS_RECEIVE_DTIM 0x00000020
-//#define fOP_STATUS_TX_RATE_SWITCH_ENABLED 0x00000040
-#define fOP_STATUS_MEDIA_STATE_CONNECTED 0x00000080
-#define fOP_STATUS_WMM_INUSED 0x00000100
-#define fOP_STATUS_AGGREGATION_INUSED 0x00000200
-#define fOP_STATUS_DOZE 0x00000400 // debug purpose
-#define fOP_STATUS_PIGGYBACK_INUSED 0x00000800 // piggy-back, and aggregation
-#define fOP_STATUS_APSD_INUSED 0x00001000
-#define fOP_STATUS_TX_AMSDU_INUSED 0x00002000
-#define fOP_STATUS_MAX_RETRY_ENABLED 0x00004000
-#define fOP_STATUS_WAKEUP_NOW 0x00008000
-#define fOP_STATUS_PCIE_DEVICE 0x00020000
-
-//
-// RTMP_ADAPTER PSFlags : related to advanced power save.
-//
-// Indicate whether driver can go to sleep mode from now. This flag is useful AFTER link up
-#define fRTMP_PS_CAN_GO_SLEEP 0x00000001
-// Indicate whether driver has issue a LinkControl command to PCIe L1
-#define fRTMP_PS_SET_PCI_CLK_OFF_COMMAND 0x00000002
-// Indicate driver should disable kick off hardware to send packets from now.
-#define fRTMP_PS_DISABLE_TX 0x00000004
-// Indicate driver should IMMEDIATELY fo to sleep after receiving AP's beacon in which doesn't indicate unicate nor multicast packets for me
-//. This flag is used ONLY in RTMPHandleRxDoneInterrupt routine.
-#define fRTMP_PS_GO_TO_SLEEP_NOW 0x00000008
-#define fRTMP_PS_TOGGLE_L1 0x00000010 // Use Toggle L1 mechanism for rt28xx PCIe
-#ifdef RT3090
-#define WAKE_MCU_CMD 0x31
-#define SLEEP_MCU_CMD 0x30
-#define RFOFF_MCU_CMD 0x35
-#endif // RT3090 //
-#ifdef DOT11N_DRAFT3
-#define fOP_STATUS_SCAN_2040 0x00040000
-#endif // DOT11N_DRAFT3 //
-
-#define CCKSETPROTECT 0x1
-#define OFDMSETPROTECT 0x2
-#define MM20SETPROTECT 0x4
-#define MM40SETPROTECT 0x8
-#define GF20SETPROTECT 0x10
-#define GR40SETPROTECT 0x20
-#define ALLN_SETPROTECT (GR40SETPROTECT | GF20SETPROTECT | MM40SETPROTECT | MM20SETPROTECT)
-
-//
-// AP's client table operation status flags
-//
-#define fCLIENT_STATUS_WMM_CAPABLE 0x00000001 // CLIENT can parse QOS DATA frame
-#define fCLIENT_STATUS_AGGREGATION_CAPABLE 0x00000002 // CLIENT can receive Ralink's proprietary TX aggregation frame
-#define fCLIENT_STATUS_PIGGYBACK_CAPABLE 0x00000004 // CLIENT support piggy-back
-#define fCLIENT_STATUS_AMSDU_INUSED 0x00000008
-#define fCLIENT_STATUS_SGI20_CAPABLE 0x00000010
-#define fCLIENT_STATUS_SGI40_CAPABLE 0x00000020
-#define fCLIENT_STATUS_TxSTBC_CAPABLE 0x00000040
-#define fCLIENT_STATUS_RxSTBC_CAPABLE 0x00000080
-#define fCLIENT_STATUS_HTC_CAPABLE 0x00000100
-#define fCLIENT_STATUS_RDG_CAPABLE 0x00000200
-#define fCLIENT_STATUS_MCSFEEDBACK_CAPABLE 0x00000400
-#define fCLIENT_STATUS_APSD_CAPABLE 0x00000800 /* UAPSD STATION */
-
-#ifdef DOT11N_DRAFT3
-#define fCLIENT_STATUS_BSSCOEXIST_CAPABLE 0x00001000
-#endif // DOT11N_DRAFT3 //
-
-#define fCLIENT_STATUS_RALINK_CHIPSET 0x00100000
-//
-// STA configuration flags
-//
-//#define fSTA_CFG_ENABLE_TX_BURST 0x00000001
-
-// 802.11n Operating Mode Definition. 0-3 also used in ASICUPdateProtect switch case
-#define HT_NO_PROTECT 0
-#define HT_LEGACY_PROTECT 1
-#define HT_40_PROTECT 2
-#define HT_2040_PROTECT 3
-#define HT_RTSCTS_6M 7
-//following is our own definition in order to turn on our ASIC protection register in INFRASTRUCTURE.
-#define HT_ATHEROS 8 // rt2860c has problem with atheros chip. we need to turn on RTS/CTS .
-#define HT_FORCERTSCTS 9 // Force turn on RTS/CTS first. then go to evaluate if this force RTS is necessary.
-
-//
-// RX Packet Filter control flags. Apply on pAd->PacketFilter
-//
-#define fRX_FILTER_ACCEPT_DIRECT NDIS_PACKET_TYPE_DIRECTED
-#define fRX_FILTER_ACCEPT_MULTICAST NDIS_PACKET_TYPE_MULTICAST
-#define fRX_FILTER_ACCEPT_BROADCAST NDIS_PACKET_TYPE_BROADCAST
-#define fRX_FILTER_ACCEPT_ALL_MULTICAST NDIS_PACKET_TYPE_ALL_MULTICAST
-#define fRX_FILTER_ACCEPT_PROMISCUOUS NDIS_PACKET_TYPE_PROMISCUOUS
-
-//
-// Error code section
-//
-// NDIS_ERROR_CODE_ADAPTER_NOT_FOUND
-#define ERRLOG_READ_PCI_SLOT_FAILED 0x00000101L
-#define ERRLOG_WRITE_PCI_SLOT_FAILED 0x00000102L
-#define ERRLOG_VENDOR_DEVICE_NOMATCH 0x00000103L
-
-// NDIS_ERROR_CODE_ADAPTER_DISABLED
-#define ERRLOG_BUS_MASTER_DISABLED 0x00000201L
-
-// NDIS_ERROR_CODE_UNSUPPORTED_CONFIGURATION
-#define ERRLOG_INVALID_SPEED_DUPLEX 0x00000301L
-#define ERRLOG_SET_SECONDARY_FAILED 0x00000302L
-
-// NDIS_ERROR_CODE_OUT_OF_RESOURCES
-#define ERRLOG_OUT_OF_MEMORY 0x00000401L
-#define ERRLOG_OUT_OF_SHARED_MEMORY 0x00000402L
-#define ERRLOG_OUT_OF_MAP_REGISTERS 0x00000403L
-#define ERRLOG_OUT_OF_BUFFER_POOL 0x00000404L
-#define ERRLOG_OUT_OF_NDIS_BUFFER 0x00000405L
-#define ERRLOG_OUT_OF_PACKET_POOL 0x00000406L
-#define ERRLOG_OUT_OF_NDIS_PACKET 0x00000407L
-#define ERRLOG_OUT_OF_LOOKASIDE_MEMORY 0x00000408L
-
-// NDIS_ERROR_CODE_HARDWARE_FAILURE
-#define ERRLOG_SELFTEST_FAILED 0x00000501L
-#define ERRLOG_INITIALIZE_ADAPTER 0x00000502L
-#define ERRLOG_REMOVE_MINIPORT 0x00000503L
-
-// NDIS_ERROR_CODE_RESOURCE_CONFLICT
-#define ERRLOG_MAP_IO_SPACE 0x00000601L
-#define ERRLOG_QUERY_ADAPTER_RESOURCES 0x00000602L
-#define ERRLOG_NO_IO_RESOURCE 0x00000603L
-#define ERRLOG_NO_INTERRUPT_RESOURCE 0x00000604L
-#define ERRLOG_NO_MEMORY_RESOURCE 0x00000605L
-
-
-// WDS definition
-#define MAX_WDS_ENTRY 4
-#define WDS_PAIRWISE_KEY_OFFSET 60 // WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table
-
-#define WDS_DISABLE_MODE 0
-#define WDS_RESTRICT_MODE 1
-#define WDS_BRIDGE_MODE 2
-#define WDS_REPEATER_MODE 3
-#define WDS_LAZY_MODE 4
-
-
-#define MAX_MESH_NUM 0
-
-#define MAX_APCLI_NUM 0
-#ifdef APCLI_SUPPORT
-#undef MAX_APCLI_NUM
-#define MAX_APCLI_NUM 1
-#endif // APCLI_SUPPORT //
-
-#define MAX_MBSSID_NUM 1
-#ifdef MBSS_SUPPORT
-#undef MAX_MBSSID_NUM
-#define MAX_MBSSID_NUM (8 - MAX_MESH_NUM - MAX_APCLI_NUM)
-#endif // MBSS_SUPPORT //
-
-/* sanity check for apidx */
-#define MBSS_MR_APIDX_SANITY_CHECK(apidx) \
- { if (apidx > MAX_MBSSID_NUM) { \
- DBGPRINT(RT_DEBUG_ERROR, ("%s> Error! apidx = %d > MAX_MBSSID_NUM!\n", __FUNCTION__, apidx)); \
- apidx = MAIN_MBSSID; } }
-
-#define VALID_WCID(_wcid) ((_wcid) > 0 && (_wcid) < MAX_LEN_OF_MAC_TABLE )
-
-#define MAIN_MBSSID 0
-#define FIRST_MBSSID 1
-
-
-#define MAX_BEACON_SIZE 512
-// If the MAX_MBSSID_NUM is larger than 6,
-// it shall reserve some WCID space(wcid 222~253) for beacon frames.
-// - these wcid 238~253 are reserved for beacon#6(ra6).
-// - these wcid 222~237 are reserved for beacon#7(ra7).
-#if defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 8)
-#define HW_RESERVED_WCID 222
-#elif defined(MAX_MBSSID_NUM) && (MAX_MBSSID_NUM == 7)
-#define HW_RESERVED_WCID 238
-#else
-#define HW_RESERVED_WCID 255
-#endif
-
-// Then dedicate wcid of DFS and Carrier-Sense.
-#define DFS_CTS_WCID (HW_RESERVED_WCID - 1)
-#define CS_CTS_WCID (HW_RESERVED_WCID - 2)
-#define LAST_SPECIFIC_WCID (HW_RESERVED_WCID - 2)
-
-// If MAX_MBSSID_NUM is 8, the maximum available wcid for the associated STA is 211.
-// If MAX_MBSSID_NUM is 7, the maximum available wcid for the associated STA is 228.
-#define MAX_AVAILABLE_CLIENT_WCID (LAST_SPECIFIC_WCID - MAX_MBSSID_NUM - 1)
-
-// TX need WCID to find Cipher Key
-// these wcid 212 ~ 219 are reserved for bc/mc packets if MAX_MBSSID_NUM is 8.
-#define GET_GroupKey_WCID(__wcid, __bssidx) \
- { \
- __wcid = LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM) + __bssidx; \
- }
-
-#define IsGroupKeyWCID(__wcid) (((__wcid) < LAST_SPECIFIC_WCID) && ((__wcid) >= (LAST_SPECIFIC_WCID - (MAX_MBSSID_NUM))))
-
-
-// definition to support multiple BSSID
-#define BSS0 0
-#define BSS1 1
-#define BSS2 2
-#define BSS3 3
-#define BSS4 4
-#define BSS5 5
-#define BSS6 6
-#define BSS7 7
-
-
-//============================================================
-// Length definitions
-#define PEER_KEY_NO 2
-#define MAC_ADDR_LEN 6
-#define TIMESTAMP_LEN 8
-#define MAX_LEN_OF_SUPPORTED_RATES MAX_LENGTH_OF_SUPPORT_RATES // 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54
-#define MAX_NUM_OF_REGULATORY_CLASS 16
-#define MAX_LEN_OF_KEY 32 // 32 octets == 256 bits, Redefine for WPA
-#define MAX_NUM_OF_CHANNELS MAX_NUM_OF_CHS // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination
-#define MAX_NUM_OF_11JCHANNELS 20 // 14 channels @2.4G + 12@UNII + 4 @MMAC + 11 @HiperLAN2 + 7 @Japan + 1 as NULL termination
-#define MAX_LEN_OF_SSID 32
-#define CIPHER_TEXT_LEN 128
-#define HASH_TABLE_SIZE 256
-#define MAX_VIE_LEN 1024 // New for WPA cipher suite variable IE sizes.
-#define MAX_SUPPORT_MCS 32
-#define MAX_NUM_OF_BBP_LATCH 140
-//============================================================
-// ASIC WCID Table definition.
-//============================================================
-#define BSSID_WCID 1 // in infra mode, always put bssid with this WCID
-#define MCAST_WCID 0x0
-#define BSS0Mcast_WCID 0x0
-#define BSS1Mcast_WCID 0xf8
-#define BSS2Mcast_WCID 0xf9
-#define BSS3Mcast_WCID 0xfa
-#define BSS4Mcast_WCID 0xfb
-#define BSS5Mcast_WCID 0xfc
-#define BSS6Mcast_WCID 0xfd
-#define BSS7Mcast_WCID 0xfe
-#define RESERVED_WCID 0xff
-
-#define MAX_NUM_OF_ACL_LIST MAX_NUMBER_OF_ACL
-
-#define MAX_LEN_OF_MAC_TABLE MAX_NUMBER_OF_MAC // if MAX_MBSSID_NUM is 8, this value can't be larger than 211
-
-#if MAX_LEN_OF_MAC_TABLE>MAX_AVAILABLE_CLIENT_WCID
-#error MAX_LEN_OF_MAC_TABLE can not be larger than MAX_AVAILABLE_CLIENT_WCID!!!!
-#endif
-
-#define MAX_NUM_OF_WDS_LINK_PERBSSID 3
-#define MAX_NUM_OF_WDS_LINK (MAX_NUM_OF_WDS_LINK_PERBSSID*MAX_MBSSID_NUM)
-#define MAX_NUM_OF_EVENT MAX_NUMBER_OF_EVENT
-#define WDS_LINK_START_WCID (MAX_LEN_OF_MAC_TABLE-1)
-
-#define NUM_OF_TID 8
-#define MAX_AID_BA 4
-#define MAX_LEN_OF_BA_REC_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2)// (NUM_OF_TID*MAX_AID_BA + 32) //Block ACK recipient
-#define MAX_LEN_OF_BA_ORI_TABLE ((NUM_OF_TID * MAX_LEN_OF_MAC_TABLE)/2)// (NUM_OF_TID*MAX_AID_BA + 32) // Block ACK originator
-#define MAX_LEN_OF_BSS_TABLE 64
-#define MAX_REORDERING_MPDU_NUM 512
-
-// key related definitions
-#define SHARE_KEY_NUM 4
-#define MAX_LEN_OF_SHARE_KEY 16 // byte count
-#define MAX_LEN_OF_PEER_KEY 16 // byte count
-#define PAIRWISE_KEY_NUM 64 // in MAC ASIC pairwise key table
-#define GROUP_KEY_NUM 4
-#define PMK_LEN 32
-#define WDS_PAIRWISE_KEY_OFFSET 60 // WDS links uses pairwise key#60 ~ 63 in ASIC pairwise key table
-#define PMKID_NO 4 // Number of PMKID saved supported
-#define MAX_LEN_OF_MLME_BUFFER 2048
-
-// power status related definitions
-#define PWR_ACTIVE 0
-#define PWR_SAVE 1
-#define PWR_MMPS 2 //MIMO power save
-//#define PWR_UNKNOWN 2
-
-// Auth and Assoc mode related definitions
-#define AUTH_MODE_OPEN 0x00
-#define AUTH_MODE_KEY 0x01
-//#define AUTH_MODE_AUTO_SWITCH 0x03
-//#define AUTH_MODE_DEAUTH 0x04
-//#define AUTH_MODE_UPLAYER 0x05 // reserved for 802.11i use
-
-// BSS Type definitions
-#define BSS_ADHOC 0 // = Ndis802_11IBSS
-#define BSS_INFRA 1 // = Ndis802_11Infrastructure
-#define BSS_ANY 2 // = Ndis802_11AutoUnknown
-#define BSS_MONITOR 3 // = Ndis802_11Monitor
-
-
-// Reason code definitions
-#define REASON_RESERVED 0
-#define REASON_UNSPECIFY 1
-#define REASON_NO_LONGER_VALID 2
-#define REASON_DEAUTH_STA_LEAVING 3
-#define REASON_DISASSOC_INACTIVE 4
-#define REASON_DISASSPC_AP_UNABLE 5
-#define REASON_CLS2ERR 6
-#define REASON_CLS3ERR 7
-#define REASON_DISASSOC_STA_LEAVING 8
-#define REASON_STA_REQ_ASSOC_NOT_AUTH 9
-#define REASON_INVALID_IE 13
-#define REASON_MIC_FAILURE 14
-#define REASON_4_WAY_TIMEOUT 15
-#define REASON_GROUP_KEY_HS_TIMEOUT 16
-#define REASON_IE_DIFFERENT 17
-#define REASON_MCIPHER_NOT_VALID 18
-#define REASON_UCIPHER_NOT_VALID 19
-#define REASON_AKMP_NOT_VALID 20
-#define REASON_UNSUPPORT_RSNE_VER 21
-#define REASON_INVALID_RSNE_CAP 22
-#define REASON_8021X_AUTH_FAIL 23
-#define REASON_CIPHER_SUITE_REJECTED 24
-#define REASON_DECLINED 37
-
-#define REASON_QOS_UNSPECIFY 32
-#define REASON_QOS_LACK_BANDWIDTH 33
-#define REASON_POOR_CHANNEL_CONDITION 34
-#define REASON_QOS_OUTSIDE_TXOP_LIMITION 35
-#define REASON_QOS_QSTA_LEAVING_QBSS 36
-#define REASON_QOS_UNWANTED_MECHANISM 37
-#define REASON_QOS_MECH_SETUP_REQUIRED 38
-#define REASON_QOS_REQUEST_TIMEOUT 39
-#define REASON_QOS_CIPHER_NOT_SUPPORT 45
-
-// Status code definitions
-#define MLME_SUCCESS 0
-#define MLME_UNSPECIFY_FAIL 1
-#define MLME_CANNOT_SUPPORT_CAP 10
-#define MLME_REASSOC_DENY_ASSOC_EXIST 11
-#define MLME_ASSOC_DENY_OUT_SCOPE 12
-#define MLME_ALG_NOT_SUPPORT 13
-#define MLME_SEQ_NR_OUT_OF_SEQUENCE 14
-#define MLME_REJ_CHALLENGE_FAILURE 15
-#define MLME_REJ_TIMEOUT 16
-#define MLME_ASSOC_REJ_UNABLE_HANDLE_STA 17
-#define MLME_ASSOC_REJ_DATA_RATE 18
-
-#define MLME_ASSOC_REJ_NO_EXT_RATE 22
-#define MLME_ASSOC_REJ_NO_EXT_RATE_PBCC 23
-#define MLME_ASSOC_REJ_NO_CCK_OFDM 24
-
-#define MLME_QOS_UNSPECIFY 32
-#define MLME_REQUEST_DECLINED 37
-#define MLME_REQUEST_WITH_INVALID_PARAM 38
-#define MLME_INVALID_GROUP_CIPHER 41
-#define MLME_INVALID_PAIRWISE_CIPHER 42
-#define MLME_INVALID_AKMP 43
-#define MLME_DLS_NOT_ALLOW_IN_QBSS 48
-#define MLME_DEST_STA_NOT_IN_QBSS 49
-#define MLME_DEST_STA_IS_NOT_A_QSTA 50
-
-#define MLME_INVALID_FORMAT 0x51
-#define MLME_FAIL_NO_RESOURCE 0x52
-#define MLME_STATE_MACHINE_REJECT 0x53
-#define MLME_MAC_TABLE_FAIL 0x54
-
-// IE code
-#define IE_SSID 0
-#define IE_SUPP_RATES 1
-#define IE_FH_PARM 2
-#define IE_DS_PARM 3
-#define IE_CF_PARM 4
-#define IE_TIM 5
-#define IE_IBSS_PARM 6
-#define IE_COUNTRY 7 // 802.11d
-#define IE_802_11D_REQUEST 10 // 802.11d
-#define IE_QBSS_LOAD 11 // 802.11e d9
-#define IE_EDCA_PARAMETER 12 // 802.11e d9
-#define IE_TSPEC 13 // 802.11e d9
-#define IE_TCLAS 14 // 802.11e d9
-#define IE_SCHEDULE 15 // 802.11e d9
-#define IE_CHALLENGE_TEXT 16
-#define IE_POWER_CONSTRAINT 32 // 802.11h d3.3
-#define IE_POWER_CAPABILITY 33 // 802.11h d3.3
-#define IE_TPC_REQUEST 34 // 802.11h d3.3
-#define IE_TPC_REPORT 35 // 802.11h d3.3
-#define IE_SUPP_CHANNELS 36 // 802.11h d3.3
-#define IE_CHANNEL_SWITCH_ANNOUNCEMENT 37 // 802.11h d3.3
-#define IE_MEASUREMENT_REQUEST 38 // 802.11h d3.3
-#define IE_MEASUREMENT_REPORT 39 // 802.11h d3.3
-#define IE_QUIET 40 // 802.11h d3.3
-#define IE_IBSS_DFS 41 // 802.11h d3.3
-#define IE_ERP 42 // 802.11g
-#define IE_TS_DELAY 43 // 802.11e d9
-#define IE_TCLAS_PROCESSING 44 // 802.11e d9
-#define IE_QOS_CAPABILITY 46 // 802.11e d6
-#define IE_HT_CAP 45 // 802.11n d1. HT CAPABILITY. ELEMENT ID TBD
-#define IE_AP_CHANNEL_REPORT 51 // 802.11k d6
-#define IE_HT_CAP2 52 // 802.11n d1. HT CAPABILITY. ELEMENT ID TBD
-#define IE_RSN 48 // 802.11i d3.0
-#define IE_WPA2 48 // WPA2
-#define IE_EXT_SUPP_RATES 50 // 802.11g
-#define IE_SUPP_REG_CLASS 59 // 802.11y. Supported regulatory classes.
-#define IE_EXT_CHANNEL_SWITCH_ANNOUNCEMENT 60 // 802.11n
-#define IE_ADD_HT 61 // 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD
-#define IE_ADD_HT2 53 // 802.11n d1. ADDITIONAL HT CAPABILITY. ELEMENT ID TBD
-
-
-// For 802.11n D3.03
-//#define IE_NEW_EXT_CHA_OFFSET 62 // 802.11n d1. New extension channel offset elemet
-#define IE_SECONDARY_CH_OFFSET 62 // 802.11n D3.03 Secondary Channel Offset element
-#define IE_WAPI 68 // WAPI information element
-#define IE_2040_BSS_COEXIST 72 // 802.11n D3.0.3
-#define IE_2040_BSS_INTOLERANT_REPORT 73 // 802.11n D3.03
-#define IE_OVERLAPBSS_SCAN_PARM 74 // 802.11n D3.03
-#define IE_EXT_CAPABILITY 127 // 802.11n D3.03
-
-
-#define IE_WPA 221 // WPA
-#define IE_VENDOR_SPECIFIC 221 // Wifi WMM (WME)
-
-#define OUI_BROADCOM_HT 51 //
-#define OUI_BROADCOM_HTADD 52 //
-#define OUI_PREN_HT_CAP 51 //
-#define OUI_PREN_ADD_HT 52 //
-
-// CCX information
-#define IE_AIRONET_CKIP 133 // CCX1.0 ID 85H for CKIP
-#define IE_AP_TX_POWER 150 // CCX 2.0 for AP transmit power
-#define IE_MEASUREMENT_CAPABILITY 221 // CCX 2.0
-#define IE_CCX_V2 221
-#define IE_AIRONET_IPADDRESS 149 // CCX ID 95H for IP Address
-#define IE_AIRONET_CCKMREASSOC 156 // CCX ID 9CH for CCKM Reassociation Request element
-#define CKIP_NEGOTIATION_LENGTH 30
-#define AIRONET_IPADDRESS_LENGTH 10
-#define AIRONET_CCKMREASSOC_LENGTH 24
-
-// ========================================================
-// MLME state machine definition
-// ========================================================
-
-// STA MLME state mahcines
-#define ASSOC_STATE_MACHINE 1
-#define AUTH_STATE_MACHINE 2
-#define AUTH_RSP_STATE_MACHINE 3
-#define SYNC_STATE_MACHINE 4
-#define MLME_CNTL_STATE_MACHINE 5
-#define WPA_PSK_STATE_MACHINE 6
-//#define LEAP_STATE_MACHINE 7
-#define AIRONET_STATE_MACHINE 8
-#define ACTION_STATE_MACHINE 9
-
-// AP MLME state machines
-#define AP_ASSOC_STATE_MACHINE 11
-#define AP_AUTH_STATE_MACHINE 12
-#define AP_SYNC_STATE_MACHINE 14
-#define AP_CNTL_STATE_MACHINE 15
-#define WSC_STATE_MACHINE 17
-#define WSC_UPNP_STATE_MACHINE 18
-
-
-#define WPA_STATE_MACHINE 23
-
-
-#ifdef QOS_DLS_SUPPORT
-#define DLS_STATE_MACHINE 26
-#endif // QOS_DLS_SUPPORT //
-
-//
-// STA's CONTROL/CONNECT state machine: states, events, total function #
-//
-#define CNTL_IDLE 0
-#define CNTL_WAIT_DISASSOC 1
-#define CNTL_WAIT_JOIN 2
-#define CNTL_WAIT_REASSOC 3
-#define CNTL_WAIT_START 4
-#define CNTL_WAIT_AUTH 5
-#define CNTL_WAIT_ASSOC 6
-#define CNTL_WAIT_AUTH2 7
-#define CNTL_WAIT_OID_LIST_SCAN 8
-#define CNTL_WAIT_OID_DISASSOC 9
-
-#define MT2_ASSOC_CONF 34
-#define MT2_AUTH_CONF 35
-#define MT2_DEAUTH_CONF 36
-#define MT2_DISASSOC_CONF 37
-#define MT2_REASSOC_CONF 38
-#define MT2_PWR_MGMT_CONF 39
-#define MT2_JOIN_CONF 40
-#define MT2_SCAN_CONF 41
-#define MT2_START_CONF 42
-#define MT2_GET_CONF 43
-#define MT2_SET_CONF 44
-#define MT2_RESET_CONF 45
-#define MT2_FT_OTD_CONF 46
-#define MT2_MLME_ROAMING_REQ 52
-
-#define CNTL_FUNC_SIZE 1
-
-//
-// STA's ASSOC state machine: states, events, total function #
-//
-#define ASSOC_IDLE 0
-#define ASSOC_WAIT_RSP 1
-#define REASSOC_WAIT_RSP 2
-#define DISASSOC_WAIT_RSP 3
-#define MAX_ASSOC_STATE 4
-
-#define ASSOC_MACHINE_BASE 0
-#define MT2_MLME_ASSOC_REQ 0
-#define MT2_MLME_REASSOC_REQ 1
-#define MT2_MLME_DISASSOC_REQ 2
-#define MT2_PEER_DISASSOC_REQ 3
-#define MT2_PEER_ASSOC_REQ 4
-#define MT2_PEER_ASSOC_RSP 5
-#define MT2_PEER_REASSOC_REQ 6
-#define MT2_PEER_REASSOC_RSP 7
-#define MT2_DISASSOC_TIMEOUT 8
-#define MT2_ASSOC_TIMEOUT 9
-#define MT2_REASSOC_TIMEOUT 10
-#define MAX_ASSOC_MSG 11
-
-#define ASSOC_FUNC_SIZE (MAX_ASSOC_STATE * MAX_ASSOC_MSG)
-
-//
-// ACT state machine: states, events, total function #
-//
-#define ACT_IDLE 0
-#define MAX_ACT_STATE 1
-
-#define ACT_MACHINE_BASE 0
-
-//Those PEER_xx_CATE number is based on real Categary value in IEEE spec. Please don'es modify it by your self.
-//Category
-#define MT2_PEER_SPECTRUM_CATE 0
-#define MT2_PEER_QOS_CATE 1
-#define MT2_PEER_DLS_CATE 2
-#define MT2_PEER_BA_CATE 3
-#define MT2_PEER_PUBLIC_CATE 4
-#define MT2_PEER_RM_CATE 5
-/* "FT_CATEGORY_BSS_TRANSITION equal to 6" is defined file of "dot11r_ft.h" */
-#define MT2_PEER_HT_CATE 7 // 7.4.7
-#define MAX_PEER_CATE_MSG 7
-
-
-#define MT2_MLME_ADD_BA_CATE 8
-#define MT2_MLME_ORI_DELBA_CATE 9
-#define MT2_MLME_REC_DELBA_CATE 10
-#define MT2_MLME_QOS_CATE 11
-#define MT2_MLME_DLS_CATE 12
-#define MT2_ACT_INVALID 13
-
-#define MAX_ACT_MSG 14
-
-
-//Category field
-#define CATEGORY_SPECTRUM 0
-#define CATEGORY_QOS 1
-#define CATEGORY_DLS 2
-#define CATEGORY_BA 3
-#define CATEGORY_PUBLIC 4
-#define CATEGORY_RM 5
-#define CATEGORY_HT 7
-
-
-// DLS Action frame definition
-#define ACTION_DLS_REQUEST 0
-#define ACTION_DLS_RESPONSE 1
-#define ACTION_DLS_TEARDOWN 2
-
-//Spectrum Action field value 802.11h 7.4.1
-#define SPEC_MRQ 0 // Request
-#define SPEC_MRP 1 //Report
-#define SPEC_TPCRQ 2
-#define SPEC_TPCRP 3
-#define SPEC_CHANNEL_SWITCH 4
-
-
-//BA Action field value
-#define ADDBA_REQ 0
-#define ADDBA_RESP 1
-#define DELBA 2
-
-//Public's Action field value in Public Category. Some in 802.11y and some in 11n
-#define ACTION_BSS_2040_COEXIST 0 // 11n
-#define ACTION_DSE_ENABLEMENT 1 // 11y D9.0
-#define ACTION_DSE_DEENABLEMENT 2 // 11y D9.0
-#define ACTION_DSE_REG_LOCATION_ANNOUNCE 3 // 11y D9.0
-#define ACTION_EXT_CH_SWITCH_ANNOUNCE 4 // 11y D9.0
-#define ACTION_DSE_MEASUREMENT_REQ 5 // 11y D9.0
-#define ACTION_DSE_MEASUREMENT_REPORT 6 // 11y D9.0
-#define ACTION_MEASUREMENT_PILOT_ACTION 7 // 11y D9.0
-#define ACTION_DSE_POWER_CONSTRAINT 8 // 11y D9.0
-
-
-//HT Action field value
-#define NOTIFY_BW_ACTION 0
-#define SMPS_ACTION 1
-#define PSMP_ACTION 2
-#define SETPCO_ACTION 3
-#define MIMO_CHA_MEASURE_ACTION 4
-#define MIMO_N_BEACONFORM 5
-#define MIMO_BEACONFORM 6
-#define ANTENNA_SELECT 7
-#define HT_INFO_EXCHANGE 8
-
-#define ACT_FUNC_SIZE (MAX_ACT_STATE * MAX_ACT_MSG)
-//
-// STA's AUTHENTICATION state machine: states, evvents, total function #
-//
-#define AUTH_REQ_IDLE 0
-#define AUTH_WAIT_SEQ2 1
-#define AUTH_WAIT_SEQ4 2
-#define MAX_AUTH_STATE 3
-
-#define AUTH_MACHINE_BASE 0
-#define MT2_MLME_AUTH_REQ 0
-#define MT2_PEER_AUTH_EVEN 1
-#define MT2_AUTH_TIMEOUT 2
-#define MAX_AUTH_MSG 3
-
-#define AUTH_FUNC_SIZE (MAX_AUTH_STATE * MAX_AUTH_MSG)
-
-//
-// STA's AUTH_RSP state machine: states, events, total function #
-//
-#define AUTH_RSP_IDLE 0
-#define AUTH_RSP_WAIT_CHAL 1
-#define MAX_AUTH_RSP_STATE 2
-
-#define AUTH_RSP_MACHINE_BASE 0
-#define MT2_AUTH_CHALLENGE_TIMEOUT 0
-#define MT2_PEER_AUTH_ODD 1
-#define MT2_PEER_DEAUTH 2
-#define MAX_AUTH_RSP_MSG 3
-
-#define AUTH_RSP_FUNC_SIZE (MAX_AUTH_RSP_STATE * MAX_AUTH_RSP_MSG)
-
-//
-// STA's SYNC state machine: states, events, total function #
-//
-#define SYNC_IDLE 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state
-#define JOIN_WAIT_BEACON 1
-#define SCAN_LISTEN 2
-#define MAX_SYNC_STATE 3
-
-#define SYNC_MACHINE_BASE 0
-#define MT2_MLME_SCAN_REQ 0
-#define MT2_MLME_JOIN_REQ 1
-#define MT2_MLME_START_REQ 2
-#define MT2_PEER_BEACON 3
-#define MT2_PEER_PROBE_RSP 4
-#define MT2_PEER_ATIM 5
-#define MT2_SCAN_TIMEOUT 6
-#define MT2_BEACON_TIMEOUT 7
-#define MT2_ATIM_TIMEOUT 8
-#define MT2_PEER_PROBE_REQ 9
-#define MAX_SYNC_MSG 10
-
-#define SYNC_FUNC_SIZE (MAX_SYNC_STATE * MAX_SYNC_MSG)
-
-//Messages for the DLS state machine
-#define DLS_IDLE 0
-#define MAX_DLS_STATE 1
-
-#define DLS_MACHINE_BASE 0
-#define MT2_MLME_DLS_REQ 0
-#define MT2_PEER_DLS_REQ 1
-#define MT2_PEER_DLS_RSP 2
-#define MT2_MLME_DLS_TEAR_DOWN 3
-#define MT2_PEER_DLS_TEAR_DOWN 4
-#define MAX_DLS_MSG 5
-
-#define DLS_FUNC_SIZE (MAX_DLS_STATE * MAX_DLS_MSG)
-
-//
-// WSC State machine: states, events, total function #
-//
-
-//
-// AP's CONTROL/CONNECT state machine: states, events, total function #
-//
-#define AP_CNTL_FUNC_SIZE 1
-
-//
-// AP's ASSOC state machine: states, events, total function #
-//
-#define AP_ASSOC_IDLE 0
-#define AP_MAX_ASSOC_STATE 1
-
-#define AP_ASSOC_MACHINE_BASE 0
-#define APMT2_MLME_DISASSOC_REQ 0
-#define APMT2_PEER_DISASSOC_REQ 1
-#define APMT2_PEER_ASSOC_REQ 2
-#define APMT2_PEER_REASSOC_REQ 3
-#define APMT2_CLS3ERR 4
-#define AP_MAX_ASSOC_MSG 5
-
-#define AP_ASSOC_FUNC_SIZE (AP_MAX_ASSOC_STATE * AP_MAX_ASSOC_MSG)
-
-//
-// AP's AUTHENTICATION state machine: states, events, total function #
-//
-#define AP_AUTH_REQ_IDLE 0
-#define AP_MAX_AUTH_STATE 1
-
-#define AP_AUTH_MACHINE_BASE 0
-#define APMT2_MLME_DEAUTH_REQ 0
-#define APMT2_CLS2ERR 1
-#define APMT2_PEER_DEAUTH 2
-#define APMT2_PEER_AUTH_REQ 3
-#define APMT2_PEER_AUTH_CONFIRM 4
-#define AP_MAX_AUTH_MSG 5
-
-#define AP_AUTH_FUNC_SIZE (AP_MAX_AUTH_STATE * AP_MAX_AUTH_MSG)
-
-//
-// AP's SYNC state machine: states, events, total function #
-//
-#define AP_SYNC_IDLE 0
-#define AP_SCAN_LISTEN 1
-#define AP_MAX_SYNC_STATE 2
-
-#define AP_SYNC_MACHINE_BASE 0
-#define APMT2_PEER_PROBE_REQ 0
-#define APMT2_PEER_BEACON 1
-#define APMT2_MLME_SCAN_REQ 2
-#define APMT2_PEER_PROBE_RSP 3
-#define APMT2_SCAN_TIMEOUT 4
-#define APMT2_MLME_SCAN_CNCL 5
-#define AP_MAX_SYNC_MSG 6
-
-#define AP_SYNC_FUNC_SIZE (AP_MAX_SYNC_STATE * AP_MAX_SYNC_MSG)
-
-//
-// Common WPA state machine: states, events, total function #
-//
-#define WPA_PTK 0
-#define MAX_WPA_PTK_STATE 1
-
-#define WPA_MACHINE_BASE 0
-#define MT2_EAPPacket 0
-#define MT2_EAPOLStart 1
-#define MT2_EAPOLLogoff 2
-#define MT2_EAPOLKey 3
-#define MT2_EAPOLASFAlert 4
-#define MAX_WPA_MSG 5
-
-#define WPA_FUNC_SIZE (MAX_WPA_PTK_STATE * MAX_WPA_MSG)
-
-#ifdef APCLI_SUPPORT
-//ApCli authentication state machine
-#define APCLI_AUTH_REQ_IDLE 0
-#define APCLI_AUTH_WAIT_SEQ2 1
-#define APCLI_AUTH_WAIT_SEQ4 2
-#define APCLI_MAX_AUTH_STATE 3
-
-#define APCLI_AUTH_MACHINE_BASE 0
-#define APCLI_MT2_MLME_AUTH_REQ 0
-#define APCLI_MT2_MLME_DEAUTH_REQ 1
-#define APCLI_MT2_PEER_AUTH_EVEN 2
-#define APCLI_MT2_PEER_DEAUTH 3
-#define APCLI_MT2_AUTH_TIMEOUT 4
-#define APCLI_MAX_AUTH_MSG 5
-
-#define APCLI_AUTH_FUNC_SIZE (APCLI_MAX_AUTH_STATE * APCLI_MAX_AUTH_MSG)
-
-//ApCli association state machine
-#define APCLI_ASSOC_IDLE 0
-#define APCLI_ASSOC_WAIT_RSP 1
-#define APCLI_MAX_ASSOC_STATE 2
-
-#define APCLI_ASSOC_MACHINE_BASE 0
-#define APCLI_MT2_MLME_ASSOC_REQ 0
-#define APCLI_MT2_MLME_DISASSOC_REQ 1
-#define APCLI_MT2_PEER_DISASSOC_REQ 2
-#define APCLI_MT2_PEER_ASSOC_RSP 3
-#define APCLI_MT2_ASSOC_TIMEOUT 4
-#define APCLI_MAX_ASSOC_MSG 5
-
-#define APCLI_ASSOC_FUNC_SIZE (APCLI_MAX_ASSOC_STATE * APCLI_MAX_ASSOC_MSG)
-
-//ApCli sync state machine
-#define APCLI_SYNC_IDLE 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state
-#define APCLI_JOIN_WAIT_PROBE_RSP 1
-#define APCLI_MAX_SYNC_STATE 2
-
-#define APCLI_SYNC_MACHINE_BASE 0
-#define APCLI_MT2_MLME_PROBE_REQ 0
-#define APCLI_MT2_PEER_PROBE_RSP 1
-#define APCLI_MT2_PROBE_TIMEOUT 2
-#define APCLI_MAX_SYNC_MSG 3
-
-#define APCLI_SYNC_FUNC_SIZE (APCLI_MAX_SYNC_STATE * APCLI_MAX_SYNC_MSG)
-
-//ApCli ctrl state machine
-#define APCLI_CTRL_DISCONNECTED 0 // merge NO_BSS,IBSS_IDLE,IBSS_ACTIVE and BSS in to 1 state
-#define APCLI_CTRL_PROBE 1
-#define APCLI_CTRL_AUTH 2
-#define APCLI_CTRL_AUTH_2 3
-#define APCLI_CTRL_ASSOC 4
-#define APCLI_CTRL_DEASSOC 5
-#define APCLI_CTRL_CONNECTED 6
-#define APCLI_MAX_CTRL_STATE 7
-
-#define APCLI_CTRL_MACHINE_BASE 0
-#define APCLI_CTRL_JOIN_REQ 0
-#define APCLI_CTRL_PROBE_RSP 1
-#define APCLI_CTRL_AUTH_RSP 2
-#define APCLI_CTRL_DISCONNECT_REQ 3
-#define APCLI_CTRL_PEER_DISCONNECT_REQ 4
-#define APCLI_CTRL_ASSOC_RSP 5
-#define APCLI_CTRL_DEASSOC_RSP 6
-#define APCLI_CTRL_JOIN_REQ_TIMEOUT 7
-#define APCLI_CTRL_AUTH_REQ_TIMEOUT 8
-#define APCLI_CTRL_ASSOC_REQ_TIMEOUT 9
-#define APCLI_MAX_CTRL_MSG 10
-
-#define APCLI_CTRL_FUNC_SIZE (APCLI_MAX_CTRL_STATE * APCLI_MAX_CTRL_MSG)
-
-
-#endif // APCLI_SUPPORT //
-
-
-// =============================================================================
-
-// value domain of 802.11 header FC.Tyte, which is b3..b2 of the 1st-byte of MAC header
-#define BTYPE_MGMT 0
-#define BTYPE_CNTL 1
-#define BTYPE_DATA 2
-
-// value domain of 802.11 MGMT frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header
-#define SUBTYPE_ASSOC_REQ 0
-#define SUBTYPE_ASSOC_RSP 1
-#define SUBTYPE_REASSOC_REQ 2
-#define SUBTYPE_REASSOC_RSP 3
-#define SUBTYPE_PROBE_REQ 4
-#define SUBTYPE_PROBE_RSP 5
-#define SUBTYPE_BEACON 8
-#define SUBTYPE_ATIM 9
-#define SUBTYPE_DISASSOC 10
-#define SUBTYPE_AUTH 11
-#define SUBTYPE_DEAUTH 12
-#define SUBTYPE_ACTION 13
-#define SUBTYPE_ACTION_NO_ACK 14
-
-// value domain of 802.11 CNTL frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header
-#define SUBTYPE_WRAPPER 7
-#define SUBTYPE_BLOCK_ACK_REQ 8
-#define SUBTYPE_BLOCK_ACK 9
-#define SUBTYPE_PS_POLL 10
-#define SUBTYPE_RTS 11
-#define SUBTYPE_CTS 12
-#define SUBTYPE_ACK 13
-#define SUBTYPE_CFEND 14
-#define SUBTYPE_CFEND_CFACK 15
-
-// value domain of 802.11 DATA frame's FC.subtype, which is b7..4 of the 1st-byte of MAC header
-#define SUBTYPE_DATA 0
-#define SUBTYPE_DATA_CFACK 1
-#define SUBTYPE_DATA_CFPOLL 2
-#define SUBTYPE_DATA_CFACK_CFPOLL 3
-#define SUBTYPE_NULL_FUNC 4
-#define SUBTYPE_CFACK 5
-#define SUBTYPE_CFPOLL 6
-#define SUBTYPE_CFACK_CFPOLL 7
-#define SUBTYPE_QDATA 8
-#define SUBTYPE_QDATA_CFACK 9
-#define SUBTYPE_QDATA_CFPOLL 10
-#define SUBTYPE_QDATA_CFACK_CFPOLL 11
-#define SUBTYPE_QOS_NULL 12
-#define SUBTYPE_QOS_CFACK 13
-#define SUBTYPE_QOS_CFPOLL 14
-#define SUBTYPE_QOS_CFACK_CFPOLL 15
-
-// ACK policy of QOS Control field bit 6:5
-#define NORMAL_ACK 0x00 // b6:5 = 00
-#define NO_ACK 0x20 // b6:5 = 01
-#define NO_EXPLICIT_ACK 0x40 // b6:5 = 10
-#define BLOCK_ACK 0x60 // b6:5 = 11
-
-//
-// rtmp_data.c use these definition
-//
-#define LENGTH_802_11 24
-#define LENGTH_802_11_AND_H 30
-#define LENGTH_802_11_CRC_H 34
-#define LENGTH_802_11_CRC 28
-#define LENGTH_802_11_WITH_ADDR4 30
-#define LENGTH_802_3 14
-#define LENGTH_802_3_TYPE 2
-#define LENGTH_802_1_H 8
-#define LENGTH_EAPOL_H 4
-#define LENGTH_WMMQOS_H 2
-#define LENGTH_CRC 4
-#define MAX_SEQ_NUMBER 0x0fff
-#define LENGTH_802_3_NO_TYPE 12
-#define LENGTH_802_1Q 4 /* VLAN related */
-
-// STA_CSR4.field.TxResult
-#define TX_RESULT_SUCCESS 0
-#define TX_RESULT_ZERO_LENGTH 1
-#define TX_RESULT_UNDER_RUN 2
-#define TX_RESULT_OHY_ERROR 4
-#define TX_RESULT_RETRY_FAIL 6
-
-// All PHY rate summary in TXD
-// Preamble MODE in TxD
-#define MODE_CCK 0
-#define MODE_OFDM 1
-#ifdef DOT11_N_SUPPORT
-#define MODE_HTMIX 2
-#define MODE_HTGREENFIELD 3
-#endif // DOT11_N_SUPPORT //
-// MCS for CCK. BW.SGI.STBC are reserved
-#define MCS_LONGP_RATE_1 0 // long preamble CCK 1Mbps
-#define MCS_LONGP_RATE_2 1 // long preamble CCK 1Mbps
-#define MCS_LONGP_RATE_5_5 2
-#define MCS_LONGP_RATE_11 3
-#define MCS_SHORTP_RATE_1 4 // long preamble CCK 1Mbps. short is forbidden in 1Mbps
-#define MCS_SHORTP_RATE_2 5 // short preamble CCK 2Mbps
-#define MCS_SHORTP_RATE_5_5 6
-#define MCS_SHORTP_RATE_11 7
-// To send duplicate legacy OFDM. set BW=BW_40. SGI.STBC are reserved
-#define MCS_RATE_6 0 // legacy OFDM
-#define MCS_RATE_9 1 // OFDM
-#define MCS_RATE_12 2 // OFDM
-#define MCS_RATE_18 3 // OFDM
-#define MCS_RATE_24 4 // OFDM
-#define MCS_RATE_36 5 // OFDM
-#define MCS_RATE_48 6 // OFDM
-#define MCS_RATE_54 7 // OFDM
-// HT
-#define MCS_0 0 // 1S
-#define MCS_1 1
-#define MCS_2 2
-#define MCS_3 3
-#define MCS_4 4
-#define MCS_5 5
-#define MCS_6 6
-#define MCS_7 7
-#define MCS_8 8 // 2S
-#define MCS_9 9
-#define MCS_10 10
-#define MCS_11 11
-#define MCS_12 12
-#define MCS_13 13
-#define MCS_14 14
-#define MCS_15 15
-#define MCS_16 16 // 3*3
-#define MCS_17 17
-#define MCS_18 18
-#define MCS_19 19
-#define MCS_20 20
-#define MCS_21 21
-#define MCS_22 22
-#define MCS_23 23
-#define MCS_32 32
-#define MCS_AUTO 33
-
-#ifdef DOT11_N_SUPPORT
-// OID_HTPHYMODE
-// MODE
-#define HTMODE_MM 0
-#define HTMODE_GF 1
-#endif // DOT11_N_SUPPORT //
-
-// Fixed Tx MODE - HT, CCK or OFDM
-#define FIXED_TXMODE_HT 0
-#define FIXED_TXMODE_CCK 1
-#define FIXED_TXMODE_OFDM 2
-// BW
-#define BW_20 BAND_WIDTH_20
-#define BW_40 BAND_WIDTH_40
-#define BW_BOTH BAND_WIDTH_BOTH
-#define BW_10 BAND_WIDTH_10 // 802.11j has 10MHz. This definition is for internal usage. doesn't fill in the IE or other field.
-
-#ifdef DOT11_N_SUPPORT
-// SHORTGI
-#define GI_400 GAP_INTERVAL_400 // only support in HT mode
-#define GI_BOTH GAP_INTERVAL_BOTH
-#endif // DOT11_N_SUPPORT //
-#define GI_800 GAP_INTERVAL_800
-// STBC
-#define STBC_NONE 0
-#ifdef DOT11_N_SUPPORT
-#define STBC_USE 1 // limited use in rt2860b phy
-#define RXSTBC_ONE 1 // rx support of one spatial stream
-#define RXSTBC_TWO 2 // rx support of 1 and 2 spatial stream
-#define RXSTBC_THR 3 // rx support of 1~3 spatial stream
-// MCS FEEDBACK
-#define MCSFBK_NONE 0 // not support mcs feedback /
-#define MCSFBK_RSV 1 // reserved
-#define MCSFBK_UNSOLICIT 2 // only support unsolict mcs feedback
-#define MCSFBK_MRQ 3 // response to both MRQ and unsolict mcs feedback
-
-// MIMO power safe
-#define MMPS_STATIC 0
-#define MMPS_DYNAMIC 1
-#define MMPS_RSV 2
-#define MMPS_ENABLE 3
-
-
-// A-MSDU size
-#define AMSDU_0 0
-#define AMSDU_1 1
-
-#endif // DOT11_N_SUPPORT //
-
-// MCS use 7 bits
-#define TXRATEMIMO 0x80
-#define TXRATEMCS 0x7F
-#define TXRATEOFDM 0x7F
-#define RATE_1 0
-#define RATE_2 1
-#define RATE_5_5 2
-#define RATE_11 3
-#define RATE_6 4 // OFDM
-#define RATE_9 5 // OFDM
-#define RATE_12 6 // OFDM
-#define RATE_18 7 // OFDM
-#define RATE_24 8 // OFDM
-#define RATE_36 9 // OFDM
-#define RATE_48 10 // OFDM
-#define RATE_54 11 // OFDM
-#define RATE_FIRST_OFDM_RATE RATE_6
-#define RATE_LAST_OFDM_RATE RATE_54
-#define RATE_6_5 12 // HT mix
-#define RATE_13 13 // HT mix
-#define RATE_19_5 14 // HT mix
-#define RATE_26 15 // HT mix
-#define RATE_39 16 // HT mix
-#define RATE_52 17 // HT mix
-#define RATE_58_5 18 // HT mix
-#define RATE_65 19 // HT mix
-#define RATE_78 20 // HT mix
-#define RATE_104 21 // HT mix
-#define RATE_117 22 // HT mix
-#define RATE_130 23 // HT mix
-//#define RATE_AUTO_SWITCH 255 // for StaCfg.FixedTxRate only
-#define HTRATE_0 12
-#define RATE_FIRST_MM_RATE HTRATE_0
-#define RATE_FIRST_HT_RATE HTRATE_0
-#define RATE_LAST_HT_RATE HTRATE_0
-
-// pTxWI->txop
-#define IFS_HTTXOP 0 // The txop will be handles by ASIC.
-#define IFS_PIFS 1
-#define IFS_SIFS 2
-#define IFS_BACKOFF 3
-
-// pTxD->RetryMode
-#define LONG_RETRY 1
-#define SHORT_RETRY 0
-
-// Country Region definition
-#define REGION_MINIMUM_BG_BAND 0
-#define REGION_0_BG_BAND 0 // 1-11
-#define REGION_1_BG_BAND 1 // 1-13
-#define REGION_2_BG_BAND 2 // 10-11
-#define REGION_3_BG_BAND 3 // 10-13
-#define REGION_4_BG_BAND 4 // 14
-#define REGION_5_BG_BAND 5 // 1-14
-#define REGION_6_BG_BAND 6 // 3-9
-#define REGION_7_BG_BAND 7 // 5-13
-#define REGION_31_BG_BAND 31 // 5-13
-#define REGION_MAXIMUM_BG_BAND 7
-
-#define REGION_MINIMUM_A_BAND 0
-#define REGION_0_A_BAND 0 // 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161, 165
-#define REGION_1_A_BAND 1 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
-#define REGION_2_A_BAND 2 // 36, 40, 44, 48, 52, 56, 60, 64
-#define REGION_3_A_BAND 3 // 52, 56, 60, 64, 149, 153, 157, 161
-#define REGION_4_A_BAND 4 // 149, 153, 157, 161, 165
-#define REGION_5_A_BAND 5 // 149, 153, 157, 161
-#define REGION_6_A_BAND 6 // 36, 40, 44, 48
-#define REGION_7_A_BAND 7 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161, 165, 169, 173
-#define REGION_8_A_BAND 8 // 52, 56, 60, 64
-#define REGION_9_A_BAND 9 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 132, 136, 140, 149, 153, 157, 161, 165
-#define REGION_10_A_BAND 10 // 36, 40, 44, 48, 149, 153, 157, 161, 165
-#define REGION_11_A_BAND 11 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 149, 153, 157, 161
-#define REGION_12_A_BAND 12 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140
-#define REGION_13_A_BAND 13 // 52, 56, 60, 64, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 140, 149, 153, 157, 161
-#define REGION_14_A_BAND 14 // 36, 40, 44, 48, 52, 56, 60, 64, 100, 104, 108, 112, 116, 136, 140, 149, 153, 157, 161, 165
-#define REGION_15_A_BAND 15 // 149, 153, 157, 161, 165, 169, 173
-#define REGION_MAXIMUM_A_BAND 15
-
-// pTxD->CipherAlg
-#define CIPHER_NONE 0
-#define CIPHER_WEP64 1
-#define CIPHER_WEP128 2
-#define CIPHER_TKIP 3
-#define CIPHER_AES 4
-#define CIPHER_CKIP64 5
-#define CIPHER_CKIP128 6
-#define CIPHER_TKIP_NO_MIC 7 // MIC appended by driver: not a valid value in hardware key table
-#define CIPHER_SMS4 8
-
-
-// LED Status.
-#define LED_LINK_DOWN 0
-#define LED_LINK_UP 1
-#define LED_RADIO_OFF 2
-#define LED_RADIO_ON 3
-#define LED_HALT 4
-#define LED_WPS 5
-#define LED_ON_SITE_SURVEY 6
-#define LED_POWER_UP 7
-
-
-// value domain of pAd->LedCntl.LedMode and E2PROM
-#define LED_MODE_DEFAULT 0
-#define LED_MODE_TWO_LED 1
-//#define LED_MODE_SIGNAL_STREGTH 8 // EEPROM define =8
-#define LED_MODE_SIGNAL_STREGTH 0x40 // EEPROM define = 64
-
-// RC4 init value, used fro WEP & TKIP
-#define PPPINITFCS32 0xffffffff /* Initial FCS value */
-
-// value domain of pAd->StaCfg.PortSecured. 802.1X controlled port definition
-#define WPA_802_1X_PORT_SECURED 1
-#define WPA_802_1X_PORT_NOT_SECURED 2
-
-#define PAIRWISE_KEY 1
-#define GROUP_KEY 2
-
-//definition of DRS
-#define MAX_STEP_OF_TX_RATE_SWITCH 32
-
-
-// pre-allocated free NDIS PACKET/BUFFER poll for internal usage
-#define MAX_NUM_OF_FREE_NDIS_PACKET 128
-
-//Block ACK
-#define MAX_TX_REORDERBUF 64
-#define MAX_RX_REORDERBUF 64
-#define DEFAULT_TX_TIMEOUT 30
-#define DEFAULT_RX_TIMEOUT 30
-
-// definition of Recipient or Originator
-#define I_RECIPIENT TRUE
-#define I_ORIGINATOR FALSE
-
-#define DEFAULT_BBP_TX_POWER 0
-#define DEFAULT_RF_TX_POWER 5
-
-#define MAX_INI_BUFFER_SIZE 4096
-#define MAX_PARAM_BUFFER_SIZE (2048) // enough for ACL (18*64)
- //18 : the length of Mac address acceptable format "01:02:03:04:05:06;")
- //64 : MAX_NUM_OF_ACL_LIST
-// definition of pAd->OpMode
-#define OPMODE_STA 0
-#define OPMODE_AP 1
-//#define OPMODE_L3_BRG 2 // as AP and STA at the same time
-
-#ifdef RT_BIG_ENDIAN
-#define DIR_READ 0
-#define DIR_WRITE 1
-#define TYPE_TXD 0
-#define TYPE_RXD 1
-#define TYPE_TXINFO 0
-#define TYPE_RXINFO 1
-#define TYPE_TXWI 0
-#define TYPE_RXWI 1
-#endif
-
-// ========================= AP rtmp_def.h ===========================
-// value domain for pAd->EventTab.Log[].Event
-#define EVENT_RESET_ACCESS_POINT 0 // Log = "hh:mm:ss Restart Access Point"
-#define EVENT_ASSOCIATED 1 // Log = "hh:mm:ss STA 00:01:02:03:04:05 associated"
-#define EVENT_DISASSOCIATED 2 // Log = "hh:mm:ss STA 00:01:02:03:04:05 left this BSS"
-#define EVENT_AGED_OUT 3 // Log = "hh:mm:ss STA 00:01:02:03:04:05 was aged-out and removed from this BSS"
-#define EVENT_COUNTER_M 4
-#define EVENT_INVALID_PSK 5
-#define EVENT_MAX_EVENT_TYPE 6
-// ==== end of AP rtmp_def.h ============
-
-// definition RSSI Number
-#define RSSI_0 0
-#define RSSI_1 1
-#define RSSI_2 2
-
-// definition of radar detection
-#define RD_NORMAL_MODE 0 // Not found radar signal
-#define RD_SWITCHING_MODE 1 // Found radar signal, and doing channel switch
-#define RD_SILENCE_MODE 2 // After channel switch, need to be silence a while to ensure radar not found
-
-//Driver defined cid for mapping status and command.
-#define SLEEPCID 0x11
-#define WAKECID 0x22
-#define QUERYPOWERCID 0x33
-#define OWNERMCU 0x1
-#define OWNERCPU 0x0
-
-// MBSSID definition
-#define ENTRY_NOT_FOUND 0xFF
-
-
-/* After Linux 2.6.9,
- * VLAN module use Private (from user) interface flags (netdevice->priv_flags).
- * #define IFF_802_1Q_VLAN 0x1 -- 802.1Q VLAN device. in if.h
- * ref to ip_sabotage_out() [ out->priv_flags & IFF_802_1Q_VLAN ] in br_netfilter.c
- *
- * For this reason, we MUST use EVEN value in priv_flags
- */
-#define INT_MAIN 0x0100
-#define INT_MBSSID 0x0200
-#define INT_WDS 0x0300
-#define INT_APCLI 0x0400
-#define INT_MESH 0x0500
-
-#define INF_MAIN_DEV_NAME "wlan"
-#define INF_MBSSID_DEV_NAME "wlan"
-#define INF_WDS_DEV_NAME "wds"
-#define INF_APCLI_DEV_NAME "apcli"
-#define INF_MESH_DEV_NAME "mesh"
-
-// Use bitmap to allow coexist of ATE_TXFRAME and ATE_RXFRAME(i.e.,to support LoopBack mode).
-#ifdef RALINK_ATE
-#define ATE_START 0x00 // Start ATE
-#define ATE_STOP 0x80 // Stop ATE
-#define ATE_TXCONT 0x05 // Continuous Transmit
-#define ATE_TXCARR 0x09 // Transmit Carrier
-#define ATE_TXCARRSUPP 0x11 // Transmit Carrier Suppression
-#define ATE_TXFRAME 0x01 // Transmit Frames
-#define ATE_RXFRAME 0x02 // Receive Frames
-#ifdef RALINK_28xx_QA
-#define ATE_TXSTOP 0xe2 // Stop Transmition(i.e., TXCONT, TXCARR, TXCARRSUPP, and TXFRAME)
-#define ATE_RXSTOP 0xfd // Stop receiving Frames
-#define BBP22_TXFRAME 0x00 // Transmit Frames
-#define BBP22_TXCONT_OR_CARRSUPP 0x80 // Continuous Transmit or Carrier Suppression
-#define BBP22_TXCARR 0xc1 // Transmit Carrier
-#define BBP24_TXCONT 0x00 // Continuous Transmit
-#define BBP24_CARRSUPP 0x01 // Carrier Suppression
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
-
-// WEP Key TYPE
-#define WEP_HEXADECIMAL_TYPE 0
-#define WEP_ASCII_TYPE 1
-
-
-
-// WIRELESS EVENTS definition
-/* Max number of char in custom event, refer to wireless_tools.28/wireless.20.h */
-#define IW_CUSTOM_MAX_LEN 255 /* In bytes */
-
-// For system event - start
-#define IW_SYS_EVENT_FLAG_START 0x0200
-#define IW_ASSOC_EVENT_FLAG 0x0200
-#define IW_DISASSOC_EVENT_FLAG 0x0201
-#define IW_DEAUTH_EVENT_FLAG 0x0202
-#define IW_AGEOUT_EVENT_FLAG 0x0203
-#define IW_COUNTER_MEASURES_EVENT_FLAG 0x0204
-#define IW_REPLAY_COUNTER_DIFF_EVENT_FLAG 0x0205
-#define IW_RSNIE_DIFF_EVENT_FLAG 0x0206
-#define IW_MIC_DIFF_EVENT_FLAG 0x0207
-#define IW_ICV_ERROR_EVENT_FLAG 0x0208
-#define IW_MIC_ERROR_EVENT_FLAG 0x0209
-#define IW_GROUP_HS_TIMEOUT_EVENT_FLAG 0x020A
-#define IW_PAIRWISE_HS_TIMEOUT_EVENT_FLAG 0x020B
-#define IW_RSNIE_SANITY_FAIL_EVENT_FLAG 0x020C
-#define IW_SET_KEY_DONE_WPA1_EVENT_FLAG 0x020D
-#define IW_SET_KEY_DONE_WPA2_EVENT_FLAG 0x020E
-#define IW_STA_LINKUP_EVENT_FLAG 0x020F
-#define IW_STA_LINKDOWN_EVENT_FLAG 0x0210
-#define IW_SCAN_COMPLETED_EVENT_FLAG 0x0211
-#define IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG 0x0212
-// if add new system event flag, please upadte the IW_SYS_EVENT_FLAG_END
-#define IW_SYS_EVENT_FLAG_END 0x0212
-#define IW_SYS_EVENT_TYPE_NUM (IW_SYS_EVENT_FLAG_END - IW_SYS_EVENT_FLAG_START + 1)
-// For system event - end
-
-// For spoof attack event - start
-#define IW_SPOOF_EVENT_FLAG_START 0x0300
-#define IW_CONFLICT_SSID_EVENT_FLAG 0x0300
-#define IW_SPOOF_ASSOC_RESP_EVENT_FLAG 0x0301
-#define IW_SPOOF_REASSOC_RESP_EVENT_FLAG 0x0302
-#define IW_SPOOF_PROBE_RESP_EVENT_FLAG 0x0303
-#define IW_SPOOF_BEACON_EVENT_FLAG 0x0304
-#define IW_SPOOF_DISASSOC_EVENT_FLAG 0x0305
-#define IW_SPOOF_AUTH_EVENT_FLAG 0x0306
-#define IW_SPOOF_DEAUTH_EVENT_FLAG 0x0307
-#define IW_SPOOF_UNKNOWN_MGMT_EVENT_FLAG 0x0308
-#define IW_REPLAY_ATTACK_EVENT_FLAG 0x0309
-// if add new spoof attack event flag, please upadte the IW_SPOOF_EVENT_FLAG_END
-#define IW_SPOOF_EVENT_FLAG_END 0x0309
-#define IW_SPOOF_EVENT_TYPE_NUM (IW_SPOOF_EVENT_FLAG_END - IW_SPOOF_EVENT_FLAG_START + 1)
-// For spoof attack event - end
-
-// For flooding attack event - start
-#define IW_FLOOD_EVENT_FLAG_START 0x0400
-#define IW_FLOOD_AUTH_EVENT_FLAG 0x0400
-#define IW_FLOOD_ASSOC_REQ_EVENT_FLAG 0x0401
-#define IW_FLOOD_REASSOC_REQ_EVENT_FLAG 0x0402
-#define IW_FLOOD_PROBE_REQ_EVENT_FLAG 0x0403
-#define IW_FLOOD_DISASSOC_EVENT_FLAG 0x0404
-#define IW_FLOOD_DEAUTH_EVENT_FLAG 0x0405
-#define IW_FLOOD_EAP_REQ_EVENT_FLAG 0x0406
-// if add new flooding attack event flag, please upadte the IW_FLOOD_EVENT_FLAG_END
-#define IW_FLOOD_EVENT_FLAG_END 0x0406
-#define IW_FLOOD_EVENT_TYPE_NUM (IW_FLOOD_EVENT_FLAG_END - IW_FLOOD_EVENT_FLAG_START + 1)
-// For flooding attack - end
-
-// End - WIRELESS EVENTS definition
-
-#ifdef CONFIG_STA_SUPPORT
-// definition for DLS, kathy
-#define MAX_NUM_OF_INIT_DLS_ENTRY 1
-#define MAX_NUM_OF_DLS_ENTRY MAX_NUMBER_OF_DLS_ENTRY
-
-//Block ACK, kathy
-#define MAX_TX_REORDERBUF 64
-#define MAX_RX_REORDERBUF 64
-#define DEFAULT_TX_TIMEOUT 30
-#define DEFAULT_RX_TIMEOUT 30
-#define MAX_BARECI_SESSION 8
-
-#ifndef IW_ESSID_MAX_SIZE
-/* Maximum size of the ESSID and pAd->nickname strings */
-#define IW_ESSID_MAX_SIZE 32
-#endif
-#endif // CONFIG_STA_SUPPORT //
-
-#ifdef MCAST_RATE_SPECIFIC
-#define MCAST_DISABLE 0
-#define MCAST_CCK 1
-#define MCAST_OFDM 2
-#define MCAST_HTMIX 3
-#endif // MCAST_RATE_SPECIFIC //
-
-// For AsicRadioOff/AsicRadioOn function
-#define DOT11POWERSAVE 0
-#define GUIRADIO_OFF 1
-#define RTMP_HALT 2
-#define GUI_IDLE_POWER_SAVE 3
-// --
-
-
-// definition for WpaSupport flag
-#define WPA_SUPPLICANT_DISABLE 0
-#define WPA_SUPPLICANT_ENABLE 1
-#define WPA_SUPPLICANT_ENABLE_WITH_WEB_UI 2
-
-// definition for Antenna Diversity flag
-#ifdef ANT_DIVERSITY_SUPPORT
-enum ANT_DIVERSITY_TYPE {
- ANT_DIVERSITY_DISABLE = 0,
- ANT_DIVERSITY_ENABLE = 1,
- ANT_FIX_ANT1 = 2,
- ANT_FIX_ANT2 = 3
-};
-#endif // ANT_DIVERSITY_SUPPORT //
-
-// Endian byte swapping codes
-#define SWAP16(x) \
- ((UINT16)( \
- (((UINT16)(x) & (UINT16) 0x00ffU) << 8) | \
- (((UINT16)(x) & (UINT16) 0xff00U) >> 8) ))
-
-#define SWAP32(x) \
- ((UINT32)( \
- (((UINT32)(x) & (UINT32) 0x000000ffUL) << 24) | \
- (((UINT32)(x) & (UINT32) 0x0000ff00UL) << 8) | \
- (((UINT32)(x) & (UINT32) 0x00ff0000UL) >> 8) | \
- (((UINT32)(x) & (UINT32) 0xff000000UL) >> 24) ))
-
-#define SWAP64(x) \
- ((UINT64)( \
- (UINT64)(((UINT64)(x) & (UINT64) 0x00000000000000ffULL) << 56) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x000000000000ff00ULL) << 40) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x0000000000ff0000ULL) << 24) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x00000000ff000000ULL) << 8) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x000000ff00000000ULL) >> 8) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x0000ff0000000000ULL) >> 24) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0x00ff000000000000ULL) >> 40) | \
- (UINT64)(((UINT64)(x) & (UINT64) 0xff00000000000000ULL) >> 56) ))
-
-#ifdef RT_BIG_ENDIAN
-
-#define cpu2le64(x) SWAP64((x))
-#define le2cpu64(x) SWAP64((x))
-#define cpu2le32(x) SWAP32((x))
-#define le2cpu32(x) SWAP32((x))
-#define cpu2le16(x) SWAP16((x))
-#define le2cpu16(x) SWAP16((x))
-#define cpu2be64(x) ((UINT64)(x))
-#define be2cpu64(x) ((UINT64)(x))
-#define cpu2be32(x) ((UINT32)(x))
-#define be2cpu32(x) ((UINT32)(x))
-#define cpu2be16(x) ((UINT16)(x))
-#define be2cpu16(x) ((UINT16)(x))
-
-#else // Little_Endian
-
-#define cpu2le64(x) ((UINT64)(x))
-#define le2cpu64(x) ((UINT64)(x))
-#define cpu2le32(x) ((UINT32)(x))
-#define le2cpu32(x) ((UINT32)(x))
-#define cpu2le16(x) ((UINT16)(x))
-#define le2cpu16(x) ((UINT16)(x))
-#define cpu2be64(x) SWAP64((x))
-#define be2cpu64(x) SWAP64((x))
-#define cpu2be32(x) SWAP32((x))
-#define be2cpu32(x) SWAP32((x))
-#define cpu2be16(x) SWAP16((x))
-#define be2cpu16(x) SWAP16((x))
-
-#endif // RT_BIG_ENDIAN
-
-#define ABS(_x, _y) ((_x) > (_y)) ? ((_x) -(_y)) : ((_y) -(_x))
-
-
-#define A2Dec(_X, _p) \
-{ \
- UCHAR *p; \
- _X = 0; \
- p = _p; \
- while (((*p >= '0') && (*p <= '9'))) \
- { \
- if ((*p >= '0') && (*p <= '9')) \
- _X = _X * 10 + *p - 48; \
- p++; \
- } \
-}
-
-
-#define A2Hex(_X, _p) \
-do{ \
- char *__p; \
- (_X) = 0; \
- __p = (char *)(_p); \
- while (((*__p >= 'a') && (*__p <= 'f')) || ((*__p >= 'A') && (*__p <= 'F')) || ((*__p >= '0') && (*__p <= '9'))) \
- { \
- if ((*__p >= 'a') && (*__p <= 'f')) \
- (_X) = (_X) * 16 + *__p - 87; \
- else if ((*__p >= 'A') && (*__p <= 'F')) \
- (_X) = (_X) * 16 + *__p - 55; \
- else if ((*__p >= '0') && (*__p <= '9')) \
- (_X) = (_X) * 16 + *__p - 48; \
- __p++; \
- } \
-}while(0)
-
-#endif // __RTMP_DEF_H__
diff --git a/drivers/staging/rt3090/rtmp_mac.h b/drivers/staging/rt3090/rtmp_mac.h
deleted file mode 100644
index c57b2959777e..000000000000
--- a/drivers/staging/rt3090/rtmp_mac.h
+++ /dev/null
@@ -1,2304 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_mac.h
-
- Abstract:
- Ralink Wireless Chip MAC related definition & structures
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#ifndef __RTMP_MAC_H__
-#define __RTMP_MAC_H__
-
-
-
-// =================================================================================
-// TX / RX ring descriptor format
-// =================================================================================
-
-// the first 24-byte in TXD is called TXINFO and will be DMAed to MAC block through TXFIFO.
-// MAC block use this TXINFO to control the transmission behavior of this frame.
-#define FIFO_MGMT 0
-#define FIFO_HCCA 1
-#define FIFO_EDCA 2
-
-
-//
-// TXD Wireless Information format for Tx ring and Mgmt Ring
-//
-//txop : for txop mode
-// 0:txop for the MPDU frame will be handles by ASIC by register
-// 1/2/3:the MPDU frame is send after PIFS/backoff/SIFS
-#ifdef RT_BIG_ENDIAN
-typedef struct PACKED _TXWI_STRUC {
- // Word 0
- UINT32 PHYMODE:2;
- UINT32 TxBF:1; // 3*3
- UINT32 rsv2:1;
-// UINT32 rsv2:2;
- UINT32 Ifs:1; //
- UINT32 STBC:2; //channel bandwidth 20MHz or 40 MHz
- UINT32 ShortGI:1;
- UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
- UINT32 MCS:7;
-
- UINT32 rsv:6;
- UINT32 txop:2; //tx back off mode 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
- UINT32 MpduDensity:3;
- UINT32 AMPDU:1;
-
- UINT32 TS:1;
- UINT32 CFACK:1;
- UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
- UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
- // Word 1
- UINT32 PacketId:4;
- UINT32 MPDUtotalByteCount:12;
- UINT32 WirelessCliID:8;
- UINT32 BAWinSize:6;
- UINT32 NSEQ:1;
- UINT32 ACK:1;
- // Word 2
- UINT32 IV;
- // Word 3
- UINT32 EIV;
-} TXWI_STRUC, *PTXWI_STRUC;
-#else
-typedef struct PACKED _TXWI_STRUC {
- // Word 0
- // ex: 00 03 00 40 means txop = 3, PHYMODE = 1
- UINT32 FRAG:1; // 1 to inform TKIP engine this is a fragment.
- UINT32 MIMOps:1; // the remote peer is in dynamic MIMO-PS mode
- UINT32 CFACK:1;
- UINT32 TS:1;
-
- UINT32 AMPDU:1;
- UINT32 MpduDensity:3;
- UINT32 txop:2; //FOR "THIS" frame. 0:HT TXOP rule , 1:PIFS TX ,2:Backoff, 3:sifs only when previous frame exchange is successful.
- UINT32 rsv:6;
-
- UINT32 MCS:7;
- UINT32 BW:1; //channel bandwidth 20MHz or 40 MHz
- UINT32 ShortGI:1;
- UINT32 STBC:2; // 1: STBC support MCS =0-7, 2,3 : RESERVE
- UINT32 Ifs:1; //
-// UINT32 rsv2:2; //channel bandwidth 20MHz or 40 MHz
- UINT32 rsv2:1;
- UINT32 TxBF:1; // 3*3
- UINT32 PHYMODE:2;
- // Word1
- // ex: 1c ff 38 00 means ACK=0, BAWinSize=7, MPDUtotalByteCount = 0x38
- UINT32 ACK:1;
- UINT32 NSEQ:1;
- UINT32 BAWinSize:6;
- UINT32 WirelessCliID:8;
- UINT32 MPDUtotalByteCount:12;
- UINT32 PacketId:4;
- //Word2
- UINT32 IV;
- //Word3
- UINT32 EIV;
-} TXWI_STRUC, *PTXWI_STRUC;
-#endif
-
-
-//
-// RXWI wireless information format, in PBF. invisible in driver.
-//
-#ifdef RT_BIG_ENDIAN
-typedef struct PACKED _RXWI_STRUC {
- // Word 0
- UINT32 TID:4;
- UINT32 MPDUtotalByteCount:12;
- UINT32 UDF:3;
- UINT32 BSSID:3;
- UINT32 KeyIndex:2;
- UINT32 WirelessCliID:8;
- // Word 1
- UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
- UINT32 rsv:3;
- UINT32 STBC:2;
- UINT32 ShortGI:1;
- UINT32 BW:1;
- UINT32 MCS:7;
- UINT32 SEQUENCE:12;
- UINT32 FRAG:4;
- // Word 2
- UINT32 rsv1:8;
- UINT32 RSSI2:8;
- UINT32 RSSI1:8;
- UINT32 RSSI0:8;
- // Word 3
- /*UINT32 rsv2:16;*/
- UINT32 rsv2:8;
- UINT32 FOFFSET:8; // RT35xx
- UINT32 SNR1:8;
- UINT32 SNR0:8;
-} RXWI_STRUC, *PRXWI_STRUC;
-#else
-typedef struct PACKED _RXWI_STRUC {
- // Word 0
- UINT32 WirelessCliID:8;
- UINT32 KeyIndex:2;
- UINT32 BSSID:3;
- UINT32 UDF:3;
- UINT32 MPDUtotalByteCount:12;
- UINT32 TID:4;
- // Word 1
- UINT32 FRAG:4;
- UINT32 SEQUENCE:12;
- UINT32 MCS:7;
- UINT32 BW:1;
- UINT32 ShortGI:1;
- UINT32 STBC:2;
- UINT32 rsv:3;
- UINT32 PHYMODE:2; // 1: this RX frame is unicast to me
- //Word2
- UINT32 RSSI0:8;
- UINT32 RSSI1:8;
- UINT32 RSSI2:8;
- UINT32 rsv1:8;
- //Word3
- UINT32 SNR0:8;
- UINT32 SNR1:8;
- UINT32 FOFFSET:8; // RT35xx
- UINT32 rsv2:8;
- /*UINT32 rsv2:16;*/
-} RXWI_STRUC, *PRXWI_STRUC;
-#endif
-
-
-// =================================================================================
-// Register format
-// =================================================================================
-
-
-//
-// SCH/DMA registers - base address 0x0200
-//
-// INT_SOURCE_CSR: Interrupt source register. Write one to clear corresponding bit
-//
-#define DMA_CSR0 0x200
-#define INT_SOURCE_CSR 0x200
-#ifdef RT_BIG_ENDIAN
-typedef union _INT_SOURCE_CSR_STRUC {
- struct {
-#ifdef TONE_RADAR_DETECT_SUPPORT
- UINT32 :11;
- UINT32 RadarINT:1;
- UINT32 rsv:2;
-#else // original source code
- UINT32 :14;
-#endif // TONE_RADAR_DETECT_SUPPORT //
- UINT32 TxCoherent:1;
- UINT32 RxCoherent:1;
- UINT32 GPTimer:1;
- UINT32 AutoWakeup:1;//bit14
- UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
- UINT32 PreTBTT:1;
- UINT32 TBTTInt:1;
- UINT32 RxTxCoherent:1;
- UINT32 MCUCommandINT:1;
- UINT32 MgmtDmaDone:1;
- UINT32 HccaDmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac1DmaDone:1;
- UINT32 Ac0DmaDone:1;
- UINT32 RxDone:1;
- UINT32 TxDelayINT:1; //delayed interrupt, not interrupt until several int or time limit hit
- UINT32 RxDelayINT:1; //dealyed interrupt
- } field;
- UINT32 word;
-} INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
-#else
-typedef union _INT_SOURCE_CSR_STRUC {
- struct {
- UINT32 RxDelayINT:1;
- UINT32 TxDelayINT:1;
- UINT32 RxDone:1;
- UINT32 Ac0DmaDone:1;//4
- UINT32 Ac1DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 HccaDmaDone:1; // bit7
- UINT32 MgmtDmaDone:1;
- UINT32 MCUCommandINT:1;//bit 9
- UINT32 RxTxCoherent:1;
- UINT32 TBTTInt:1;
- UINT32 PreTBTT:1;
- UINT32 TXFifoStatusInt:1;//FIFO Statistics is full, sw should read 0x171c
- UINT32 AutoWakeup:1;//bit14
- UINT32 GPTimer:1;
- UINT32 RxCoherent:1;//bit16
- UINT32 TxCoherent:1;
-#ifdef TONE_RADAR_DETECT_SUPPORT
- UINT32 rsv:2;
- UINT32 RadarINT:1;
- UINT32 :11;
-#else
- UINT32 :14;
-#endif // TONE_RADAR_DETECT_SUPPORT //
- } field;
- UINT32 word;
-} INT_SOURCE_CSR_STRUC, *PINT_SOURCE_CSR_STRUC;
-#endif
-
-//
-// INT_MASK_CSR: Interrupt MASK register. 1: the interrupt is mask OFF
-//
-#define INT_MASK_CSR 0x204
-#ifdef RT_BIG_ENDIAN
-typedef union _INT_MASK_CSR_STRUC {
- struct {
- UINT32 TxCoherent:1;
- UINT32 RxCoherent:1;
-#ifdef TONE_RADAR_DETECT_SUPPORT
- UINT32 :9;
- UINT32 RadarINT:1;
- UINT32 rsv:10;
-#else
- UINT32 :20;
-#endif // TONE_RADAR_DETECT_SUPPORT //
- UINT32 MCUCommandINT:1;
- UINT32 MgmtDmaDone:1;
- UINT32 HccaDmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac1DmaDone:1;
- UINT32 Ac0DmaDone:1;
- UINT32 RxDone:1;
- UINT32 TxDelay:1;
- UINT32 RXDelay_INT_MSK:1;
- } field;
- UINT32 word;
-}INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
-#else
-typedef union _INT_MASK_CSR_STRUC {
- struct {
- UINT32 RXDelay_INT_MSK:1;
- UINT32 TxDelay:1;
- UINT32 RxDone:1;
- UINT32 Ac0DmaDone:1;
- UINT32 Ac1DmaDone:1;
- UINT32 Ac2DmaDone:1;
- UINT32 Ac3DmaDone:1;
- UINT32 HccaDmaDone:1;
- UINT32 MgmtDmaDone:1;
- UINT32 MCUCommandINT:1;
-#ifdef TONE_RADAR_DETECT_SUPPORT
- UINT32 rsv:10;
- UINT32 RadarINT:1;
- UINT32 :9;
-#else
- UINT32 :20;
-#endif // TONE_RADAR_DETECT_SUPPORT //
- UINT32 RxCoherent:1;
- UINT32 TxCoherent:1;
- } field;
- UINT32 word;
-} INT_MASK_CSR_STRUC, *PINT_MASK_CSR_STRUC;
-#endif
-
-#define WPDMA_GLO_CFG 0x208
-#ifdef RT_BIG_ENDIAN
-typedef union _WPDMA_GLO_CFG_STRUC {
- struct {
- UINT32 HDR_SEG_LEN:16;
- UINT32 RXHdrScater:8;
- UINT32 BigEndian:1;
- UINT32 EnTXWriteBackDDONE:1;
- UINT32 WPDMABurstSIZE:2;
- UINT32 RxDMABusy:1;
- UINT32 EnableRxDMA:1;
- UINT32 TxDMABusy:1;
- UINT32 EnableTxDMA:1;
- } field;
- UINT32 word;
-}WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
-#else
-typedef union _WPDMA_GLO_CFG_STRUC {
- struct {
- UINT32 EnableTxDMA:1;
- UINT32 TxDMABusy:1;
- UINT32 EnableRxDMA:1;
- UINT32 RxDMABusy:1;
- UINT32 WPDMABurstSIZE:2;
- UINT32 EnTXWriteBackDDONE:1;
- UINT32 BigEndian:1;
- UINT32 RXHdrScater:8;
- UINT32 HDR_SEG_LEN:16;
- } field;
- UINT32 word;
-} WPDMA_GLO_CFG_STRUC, *PWPDMA_GLO_CFG_STRUC;
-#endif
-
-#define WPDMA_RST_IDX 0x20c
-#ifdef RT_BIG_ENDIAN
-typedef union _WPDMA_RST_IDX_STRUC {
- struct {
- UINT32 :15;
- UINT32 RST_DRX_IDX0:1;
- UINT32 rsv:10;
- UINT32 RST_DTX_IDX5:1;
- UINT32 RST_DTX_IDX4:1;
- UINT32 RST_DTX_IDX3:1;
- UINT32 RST_DTX_IDX2:1;
- UINT32 RST_DTX_IDX1:1;
- UINT32 RST_DTX_IDX0:1;
- } field;
- UINT32 word;
-}WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
-#else
-typedef union _WPDMA_RST_IDX_STRUC {
- struct {
- UINT32 RST_DTX_IDX0:1;
- UINT32 RST_DTX_IDX1:1;
- UINT32 RST_DTX_IDX2:1;
- UINT32 RST_DTX_IDX3:1;
- UINT32 RST_DTX_IDX4:1;
- UINT32 RST_DTX_IDX5:1;
- UINT32 rsv:10;
- UINT32 RST_DRX_IDX0:1;
- UINT32 :15;
- } field;
- UINT32 word;
-} WPDMA_RST_IDX_STRUC, *PWPDMA_RST_IDX_STRUC;
-#endif
-#define DELAY_INT_CFG 0x0210
-#ifdef RT_BIG_ENDIAN
-typedef union _DELAY_INT_CFG_STRUC {
- struct {
- UINT32 TXDLY_INT_EN:1;
- UINT32 TXMAX_PINT:7;
- UINT32 TXMAX_PTIME:8;
- UINT32 RXDLY_INT_EN:1;
- UINT32 RXMAX_PINT:7;
- UINT32 RXMAX_PTIME:8;
- } field;
- UINT32 word;
-}DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
-#else
-typedef union _DELAY_INT_CFG_STRUC {
- struct {
- UINT32 RXMAX_PTIME:8;
- UINT32 RXMAX_PINT:7;
- UINT32 RXDLY_INT_EN:1;
- UINT32 TXMAX_PTIME:8;
- UINT32 TXMAX_PINT:7;
- UINT32 TXDLY_INT_EN:1;
- } field;
- UINT32 word;
-} DELAY_INT_CFG_STRUC, *PDELAY_INT_CFG_STRUC;
-#endif
-#define WMM_AIFSN_CFG 0x0214
-#ifdef RT_BIG_ENDIAN
-typedef union _AIFSN_CSR_STRUC {
- struct {
- UINT32 Rsv:16;
- UINT32 Aifsn3:4; // for AC_VO
- UINT32 Aifsn2:4; // for AC_VI
- UINT32 Aifsn1:4; // for AC_BK
- UINT32 Aifsn0:4; // for AC_BE
- } field;
- UINT32 word;
-} AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
-#else
-typedef union _AIFSN_CSR_STRUC {
- struct {
- UINT32 Aifsn0:4; // for AC_BE
- UINT32 Aifsn1:4; // for AC_BK
- UINT32 Aifsn2:4; // for AC_VI
- UINT32 Aifsn3:4; // for AC_VO
- UINT32 Rsv:16;
- } field;
- UINT32 word;
-} AIFSN_CSR_STRUC, *PAIFSN_CSR_STRUC;
-#endif
-//
-// CWMIN_CSR: CWmin for each EDCA AC
-//
-#define WMM_CWMIN_CFG 0x0218
-#ifdef RT_BIG_ENDIAN
-typedef union _CWMIN_CSR_STRUC {
- struct {
- UINT32 Rsv:16;
- UINT32 Cwmin3:4; // for AC_VO
- UINT32 Cwmin2:4; // for AC_VI
- UINT32 Cwmin1:4; // for AC_BK
- UINT32 Cwmin0:4; // for AC_BE
- } field;
- UINT32 word;
-} CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
-#else
-typedef union _CWMIN_CSR_STRUC {
- struct {
- UINT32 Cwmin0:4; // for AC_BE
- UINT32 Cwmin1:4; // for AC_BK
- UINT32 Cwmin2:4; // for AC_VI
- UINT32 Cwmin3:4; // for AC_VO
- UINT32 Rsv:16;
- } field;
- UINT32 word;
-} CWMIN_CSR_STRUC, *PCWMIN_CSR_STRUC;
-#endif
-
-//
-// CWMAX_CSR: CWmin for each EDCA AC
-//
-#define WMM_CWMAX_CFG 0x021c
-#ifdef RT_BIG_ENDIAN
-typedef union _CWMAX_CSR_STRUC {
- struct {
- UINT32 Rsv:16;
- UINT32 Cwmax3:4; // for AC_VO
- UINT32 Cwmax2:4; // for AC_VI
- UINT32 Cwmax1:4; // for AC_BK
- UINT32 Cwmax0:4; // for AC_BE
- } field;
- UINT32 word;
-} CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
-#else
-typedef union _CWMAX_CSR_STRUC {
- struct {
- UINT32 Cwmax0:4; // for AC_BE
- UINT32 Cwmax1:4; // for AC_BK
- UINT32 Cwmax2:4; // for AC_VI
- UINT32 Cwmax3:4; // for AC_VO
- UINT32 Rsv:16;
- } field;
- UINT32 word;
-} CWMAX_CSR_STRUC, *PCWMAX_CSR_STRUC;
-#endif
-
-
-//
-// AC_TXOP_CSR0: AC_BK/AC_BE TXOP register
-//
-#define WMM_TXOP0_CFG 0x0220
-#ifdef RT_BIG_ENDIAN
-typedef union _AC_TXOP_CSR0_STRUC {
- struct {
- USHORT Ac1Txop; // for AC_BE, in unit of 32us
- USHORT Ac0Txop; // for AC_BK, in unit of 32us
- } field;
- UINT32 word;
-} AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
-#else
-typedef union _AC_TXOP_CSR0_STRUC {
- struct {
- USHORT Ac0Txop; // for AC_BK, in unit of 32us
- USHORT Ac1Txop; // for AC_BE, in unit of 32us
- } field;
- UINT32 word;
-} AC_TXOP_CSR0_STRUC, *PAC_TXOP_CSR0_STRUC;
-#endif
-
-//
-// AC_TXOP_CSR1: AC_VO/AC_VI TXOP register
-//
-#define WMM_TXOP1_CFG 0x0224
-#ifdef RT_BIG_ENDIAN
-typedef union _AC_TXOP_CSR1_STRUC {
- struct {
- USHORT Ac3Txop; // for AC_VO, in unit of 32us
- USHORT Ac2Txop; // for AC_VI, in unit of 32us
- } field;
- UINT32 word;
-} AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
-#else
-typedef union _AC_TXOP_CSR1_STRUC {
- struct {
- USHORT Ac2Txop; // for AC_VI, in unit of 32us
- USHORT Ac3Txop; // for AC_VO, in unit of 32us
- } field;
- UINT32 word;
-} AC_TXOP_CSR1_STRUC, *PAC_TXOP_CSR1_STRUC;
-#endif
-
-
-#define RINGREG_DIFF 0x10
-#define GPIO_CTRL_CFG 0x0228 //MAC_CSR13
-#define MCU_CMD_CFG 0x022c
-#define TX_BASE_PTR0 0x0230 //AC_BK base address
-#define TX_MAX_CNT0 0x0234
-#define TX_CTX_IDX0 0x0238
-#define TX_DTX_IDX0 0x023c
-#define TX_BASE_PTR1 0x0240 //AC_BE base address
-#define TX_MAX_CNT1 0x0244
-#define TX_CTX_IDX1 0x0248
-#define TX_DTX_IDX1 0x024c
-#define TX_BASE_PTR2 0x0250 //AC_VI base address
-#define TX_MAX_CNT2 0x0254
-#define TX_CTX_IDX2 0x0258
-#define TX_DTX_IDX2 0x025c
-#define TX_BASE_PTR3 0x0260 //AC_VO base address
-#define TX_MAX_CNT3 0x0264
-#define TX_CTX_IDX3 0x0268
-#define TX_DTX_IDX3 0x026c
-#define TX_BASE_PTR4 0x0270 //HCCA base address
-#define TX_MAX_CNT4 0x0274
-#define TX_CTX_IDX4 0x0278
-#define TX_DTX_IDX4 0x027c
-#define TX_BASE_PTR5 0x0280 //MGMT base address
-#define TX_MAX_CNT5 0x0284
-#define TX_CTX_IDX5 0x0288
-#define TX_DTX_IDX5 0x028c
-#define TX_MGMTMAX_CNT TX_MAX_CNT5
-#define TX_MGMTCTX_IDX TX_CTX_IDX5
-#define TX_MGMTDTX_IDX TX_DTX_IDX5
-#define RX_BASE_PTR 0x0290 //RX base address
-#define RX_MAX_CNT 0x0294
-#define RX_CRX_IDX 0x0298
-#define RX_DRX_IDX 0x029c
-
-
-#define USB_DMA_CFG 0x02a0
-#ifdef RT_BIG_ENDIAN
-typedef union _USB_DMA_CFG_STRUC {
- struct {
- UINT32 TxBusy:1; //USB DMA TX FSM busy . debug only
- UINT32 RxBusy:1; //USB DMA RX FSM busy . debug only
- UINT32 EpoutValid:6; //OUT endpoint data valid. debug only
- UINT32 TxBulkEn:1; //Enable USB DMA Tx
- UINT32 RxBulkEn:1; //Enable USB DMA Rx
- UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
- UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
- UINT32 TxClear:1; //Clear USB DMA TX path
- UINT32 rsv:2;
- UINT32 phyclear:1; //phy watch dog enable. write 1
- UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 1024 bytes
- UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
- } field;
- UINT32 word;
-} USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
-#else
-typedef union _USB_DMA_CFG_STRUC {
- struct {
- UINT32 RxBulkAggTOut:8; //Rx Bulk Aggregation TimeOut in unit of 33ns
- UINT32 RxBulkAggLmt:8; //Rx Bulk Aggregation Limit in unit of 256 bytes
- UINT32 phyclear:1; //phy watch dog enable. write 1
- UINT32 rsv:2;
- UINT32 TxClear:1; //Clear USB DMA TX path
- UINT32 TxopHalt:1; //Halt TXOP count down when TX buffer is full.
- UINT32 RxBulkAggEn:1; //Enable Rx Bulk Aggregation
- UINT32 RxBulkEn:1; //Enable USB DMA Rx
- UINT32 TxBulkEn:1; //Enable USB DMA Tx
- UINT32 EpoutValid:6; //OUT endpoint data valid
- UINT32 RxBusy:1; //USB DMA RX FSM busy
- UINT32 TxBusy:1; //USB DMA TX FSM busy
- } field;
- UINT32 word;
-} USB_DMA_CFG_STRUC, *PUSB_DMA_CFG_STRUC;
-#endif
-
-
-//
-// 3 PBF registers
-//
-//
-// Most are for debug. Driver doesn't touch PBF register.
-#define PBF_SYS_CTRL 0x0400
-#define PBF_CFG 0x0408
-#define PBF_MAX_PCNT 0x040C
-#define PBF_CTRL 0x0410
-#define PBF_INT_STA 0x0414
-#define PBF_INT_ENA 0x0418
-#define TXRXQ_PCNT 0x0438
-#define PBF_DBG 0x043c
-#define PBF_CAP_CTRL 0x0440
-
-#ifdef RT30xx
-#ifdef RTMP_EFUSE_SUPPORT
-// eFuse registers
-#define EFUSE_CTRL 0x0580
-#define EFUSE_DATA0 0x0590
-#define EFUSE_DATA1 0x0594
-#define EFUSE_DATA2 0x0598
-#define EFUSE_DATA3 0x059c
-#endif // RTMP_EFUSE_SUPPORT //
-#endif // RT30xx //
-
-#define OSC_CTRL 0x5a4
-#define PCIE_PHY_TX_ATTENUATION_CTRL 0x05C8
-#define LDO_CFG0 0x05d4
-#define GPIO_SWITCH 0x05dc
-
-
-//
-// 4 MAC registers
-//
-//
-// 4.1 MAC SYSTEM configuration registers (offset:0x1000)
-//
-#define MAC_CSR0 0x1000
-#ifdef RT_BIG_ENDIAN
-typedef union _ASIC_VER_ID_STRUC {
- struct {
- USHORT ASICVer; // version : 2860
- USHORT ASICRev; // reversion : 0
- } field;
- UINT32 word;
-} ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
-#else
-typedef union _ASIC_VER_ID_STRUC {
- struct {
- USHORT ASICRev; // reversion : 0
- USHORT ASICVer; // version : 2860
- } field;
- UINT32 word;
-} ASIC_VER_ID_STRUC, *PASIC_VER_ID_STRUC;
-#endif
-#define MAC_SYS_CTRL 0x1004 //MAC_CSR1
-#define MAC_ADDR_DW0 0x1008 // MAC ADDR DW0
-#define MAC_ADDR_DW1 0x100c // MAC ADDR DW1
-//
-// MAC_CSR2: STA MAC register 0
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _MAC_DW0_STRUC {
- struct {
- UCHAR Byte3; // MAC address byte 3
- UCHAR Byte2; // MAC address byte 2
- UCHAR Byte1; // MAC address byte 1
- UCHAR Byte0; // MAC address byte 0
- } field;
- UINT32 word;
-} MAC_DW0_STRUC, *PMAC_DW0_STRUC;
-#else
-typedef union _MAC_DW0_STRUC {
- struct {
- UCHAR Byte0; // MAC address byte 0
- UCHAR Byte1; // MAC address byte 1
- UCHAR Byte2; // MAC address byte 2
- UCHAR Byte3; // MAC address byte 3
- } field;
- UINT32 word;
-} MAC_DW0_STRUC, *PMAC_DW0_STRUC;
-#endif
-
-//
-// MAC_CSR3: STA MAC register 1
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _MAC_DW1_STRUC {
- struct {
- UCHAR Rsvd1;
- UCHAR U2MeMask;
- UCHAR Byte5; // MAC address byte 5
- UCHAR Byte4; // MAC address byte 4
- } field;
- UINT32 word;
-} MAC_DW1_STRUC, *PMAC_DW1_STRUC;
-#else
-typedef union _MAC_DW1_STRUC {
- struct {
- UCHAR Byte4; // MAC address byte 4
- UCHAR Byte5; // MAC address byte 5
- UCHAR U2MeMask;
- UCHAR Rsvd1;
- } field;
- UINT32 word;
-} MAC_DW1_STRUC, *PMAC_DW1_STRUC;
-#endif
-
-#define MAC_BSSID_DW0 0x1010 // MAC BSSID DW0
-#define MAC_BSSID_DW1 0x1014 // MAC BSSID DW1
-
-//
-// MAC_CSR5: BSSID register 1
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _MAC_CSR5_STRUC {
- struct {
- USHORT Rsvd:11;
- USHORT MBssBcnNum:3;
- USHORT BssIdMode:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
- UCHAR Byte5; // BSSID byte 5
- UCHAR Byte4; // BSSID byte 4
- } field;
- UINT32 word;
-} MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
-#else
-typedef union _MAC_CSR5_STRUC {
- struct {
- UCHAR Byte4; // BSSID byte 4
- UCHAR Byte5; // BSSID byte 5
- USHORT BssIdMask:2; // 0: one BSSID, 10: 4 BSSID, 01: 2 BSSID , 11: 8BSSID
- USHORT MBssBcnNum:3;
- USHORT Rsvd:11;
- } field;
- UINT32 word;
-} MAC_CSR5_STRUC, *PMAC_CSR5_STRUC;
-#endif
-
-#define MAX_LEN_CFG 0x1018 // rt2860b max 16k bytes. bit12:13 Maximum PSDU length (power factor) 0:2^13, 1:2^14, 2:2^15, 3:2^16
-#define BBP_CSR_CFG 0x101c //
-//
-// BBP_CSR_CFG: BBP serial control register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _BBP_CSR_CFG_STRUC {
- struct {
- UINT32 :12;
- UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
- UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
- UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
- UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
- UINT32 RegNum:8; // Selected BBP register
- UINT32 Value:8; // Register value to program into BBP
- } field;
- UINT32 word;
-} BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
-#else
-typedef union _BBP_CSR_CFG_STRUC {
- struct {
- UINT32 Value:8; // Register value to program into BBP
- UINT32 RegNum:8; // Selected BBP register
- UINT32 fRead:1; // 0: Write BBP, 1: Read BBP
- UINT32 Busy:1; // 1: ASIC is busy execute BBP programming.
- UINT32 BBP_PAR_DUR:1; // 0: 4 MAC clock cycles 1: 8 MAC clock cycles
- UINT32 BBP_RW_MODE:1; // 0: use serial mode 1:parallel
- UINT32 :12;
- } field;
- UINT32 word;
-} BBP_CSR_CFG_STRUC, *PBBP_CSR_CFG_STRUC;
-#endif
-#define RF_CSR_CFG0 0x1020
-//
-// RF_CSR_CFG: RF control register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _RF_CSR_CFG0_STRUC {
- struct {
- UINT32 Busy:1; // 0: idle 1: 8busy
- UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
- UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
- UINT32 bitwidth:5; // Selected BBP register
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- } field;
- UINT32 word;
-} RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
-#else
-typedef union _RF_CSR_CFG0_STRUC {
- struct {
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- UINT32 bitwidth:5; // Selected BBP register
- UINT32 StandbyMode:1; // 0: high when stand by 1: low when standby
- UINT32 Sel:1; // 0:RF_LE0 activate 1:RF_LE1 activate
- UINT32 Busy:1; // 0: idle 1: 8busy
- } field;
- UINT32 word;
-} RF_CSR_CFG0_STRUC, *PRF_CSR_CFG0_STRUC;
-#endif
-#define RF_CSR_CFG1 0x1024
-#ifdef RT_BIG_ENDIAN
-typedef union _RF_CSR_CFG1_STRUC {
- struct {
- UINT32 rsv:7; // 0: idle 1: 8busy
- UINT32 RFGap:5; // Gap between BB_CONTROL_RF and RF_LE. 0: 3 system clock cycle (37.5usec) 1: 5 system clock cycle (62.5usec)
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- } field;
- UINT32 word;
-} RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
-#else
-typedef union _RF_CSR_CFG1_STRUC {
- struct {
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- UINT32 RFGap:5; // Gap between BB_CONTROL_RF and RF_LE. 0: 3 system clock cycle (37.5usec) 1: 5 system clock cycle (62.5usec)
- UINT32 rsv:7; // 0: idle 1: 8busy
- } field;
- UINT32 word;
-} RF_CSR_CFG1_STRUC, *PRF_CSR_CFG1_STRUC;
-#endif
-#define RF_CSR_CFG2 0x1028 //
-#ifdef RT_BIG_ENDIAN
-typedef union _RF_CSR_CFG2_STRUC {
- struct {
- UINT32 rsv:8; // 0: idle 1: 8busy
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- } field;
- UINT32 word;
-} RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
-#else
-typedef union _RF_CSR_CFG2_STRUC {
- struct {
- UINT32 RegIdAndContent:24; // Register value to program into BBP
- UINT32 rsv:8; // 0: idle 1: 8busy
- } field;
- UINT32 word;
-} RF_CSR_CFG2_STRUC, *PRF_CSR_CFG2_STRUC;
-#endif
-#define LED_CFG 0x102c // MAC_CSR14
-#ifdef RT_BIG_ENDIAN
-typedef union _LED_CFG_STRUC {
- struct {
- UINT32 :1;
- UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
- UINT32 YLedMode:2; // yellow Led Mode
- UINT32 GLedMode:2; // green Led Mode
- UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
- UINT32 rsv:2;
- UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
- UINT32 OffPeriod:8; // blinking off period unit 1ms
- UINT32 OnPeriod:8; // blinking on period unit 1ms
- } field;
- UINT32 word;
-} LED_CFG_STRUC, *PLED_CFG_STRUC;
-#else
-typedef union _LED_CFG_STRUC {
- struct {
- UINT32 OnPeriod:8; // blinking on period unit 1ms
- UINT32 OffPeriod:8; // blinking off period unit 1ms
- UINT32 SlowBlinkPeriod:6; // slow blinking period. unit:1ms
- UINT32 rsv:2;
- UINT32 RLedMode:2; // red Led Mode 0: off1: blinking upon TX2: periodic slow blinking3: always on
- UINT32 GLedMode:2; // green Led Mode
- UINT32 YLedMode:2; // yellow Led Mode
- UINT32 LedPolar:1; // Led Polarity. 0: active low1: active high
- UINT32 :1;
- } field;
- UINT32 word;
-} LED_CFG_STRUC, *PLED_CFG_STRUC;
-#endif
-//
-// 4.2 MAC TIMING configuration registers (offset:0x1100)
-//
-#define XIFS_TIME_CFG 0x1100 // MAC_CSR8 MAC_CSR9
-#ifdef RT_BIG_ENDIAN
-typedef union _IFS_SLOT_CFG_STRUC {
- struct {
- UINT32 rsv:2;
- UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
- UINT32 EIFS:9; // unit 1us
- UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
- UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
- UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
- } field;
- UINT32 word;
-} IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
-#else
-typedef union _IFS_SLOT_CFG_STRUC {
- struct {
- UINT32 CckmSifsTime:8; // unit 1us. Applied after CCK RX/TX
- UINT32 OfdmSifsTime:8; // unit 1us. Applied after OFDM RX/TX
- UINT32 OfdmXifsTime:4; //OFDM SIFS. unit 1us. Applied after OFDM RX when MAC doesn't reference BBP signal BBRXEND
- UINT32 EIFS:9; // unit 1us
- UINT32 BBRxendEnable:1; // reference RXEND signal to begin XIFS defer
- UINT32 rsv:2;
- } field;
- UINT32 word;
-} IFS_SLOT_CFG_STRUC, *PIFS_SLOT_CFG_STRUC;
-#endif
-
-#define BKOFF_SLOT_CFG 0x1104 // mac_csr9 last 8 bits
-#define NAV_TIME_CFG 0x1108 // NAV (MAC_CSR15)
-#define CH_TIME_CFG 0x110C // Count as channel busy
-#define PBF_LIFE_TIMER 0x1110 //TX/RX MPDU timestamp timer (free run)Unit: 1us
-#define BCN_TIME_CFG 0x1114 // TXRX_CSR9
-
-#define BCN_OFFSET0 0x042C
-#define BCN_OFFSET1 0x0430
-
-//
-// BCN_TIME_CFG : Synchronization control register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _BCN_TIME_CFG_STRUC {
- struct {
- UINT32 TxTimestampCompensate:8;
- UINT32 :3;
- UINT32 bBeaconGen:1; // Enable beacon generator
- UINT32 bTBTTEnable:1;
- UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
- UINT32 bTsfTicking:1; // Enable TSF auto counting
- UINT32 BeaconInterval:16; // in unit of 1/16 TU
- } field;
- UINT32 word;
-} BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
-#else
-typedef union _BCN_TIME_CFG_STRUC {
- struct {
- UINT32 BeaconInterval:16; // in unit of 1/16 TU
- UINT32 bTsfTicking:1; // Enable TSF auto counting
- UINT32 TsfSyncMode:2; // Enable TSF sync, 00: disable, 01: infra mode, 10: ad-hoc mode
- UINT32 bTBTTEnable:1;
- UINT32 bBeaconGen:1; // Enable beacon generator
- UINT32 :3;
- UINT32 TxTimestampCompensate:8;
- } field;
- UINT32 word;
-} BCN_TIME_CFG_STRUC, *PBCN_TIME_CFG_STRUC;
-#endif
-#define TBTT_SYNC_CFG 0x1118 // txrx_csr10
-#define TSF_TIMER_DW0 0x111C // Local TSF timer lsb 32 bits. Read-only
-#define TSF_TIMER_DW1 0x1120 // msb 32 bits. Read-only.
-#define TBTT_TIMER 0x1124 // TImer remains till next TBTT. Read-only. TXRX_CSR14
-#define INT_TIMER_CFG 0x1128 //
-#define INT_TIMER_EN 0x112c // GP-timer and pre-tbtt Int enable
-#define CH_IDLE_STA 0x1130 // channel idle time
-#define CH_BUSY_STA 0x1134 // channle busy time
-//
-// 4.2 MAC POWER configuration registers (offset:0x1200)
-//
-#define MAC_STATUS_CFG 0x1200 // old MAC_CSR12
-#define PWR_PIN_CFG 0x1204 // old MAC_CSR12
-#define AUTO_WAKEUP_CFG 0x1208 // old MAC_CSR10
-//
-// AUTO_WAKEUP_CFG: Manual power control / status register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _AUTO_WAKEUP_STRUC {
- struct {
- UINT32 :16;
- UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
- UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
- UINT32 AutoLeadTime:8;
- } field;
- UINT32 word;
-} AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
-#else
-typedef union _AUTO_WAKEUP_STRUC {
- struct {
- UINT32 AutoLeadTime:8;
- UINT32 NumofSleepingTbtt:7; // ForceWake has high privilege than PutToSleep when both set
- UINT32 EnableAutoWakeup:1; // 0:sleep, 1:awake
- UINT32 :16;
- } field;
- UINT32 word;
-} AUTO_WAKEUP_STRUC, *PAUTO_WAKEUP_STRUC;
-#endif
-//
-// 4.3 MAC TX configuration registers (offset:0x1300)
-//
-
-#define EDCA_AC0_CFG 0x1300 //AC_TXOP_CSR0 0x3474
-#define EDCA_AC1_CFG 0x1304
-#define EDCA_AC2_CFG 0x1308
-#define EDCA_AC3_CFG 0x130c
-#ifdef RT_BIG_ENDIAN
-typedef union _EDCA_AC_CFG_STRUC {
- struct {
- UINT32 :12; //
- UINT32 Cwmax:4; //unit power of 2
- UINT32 Cwmin:4; //
- UINT32 Aifsn:4; // # of slot time
- UINT32 AcTxop:8; // in unit of 32us
- } field;
- UINT32 word;
-} EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
-#else
-typedef union _EDCA_AC_CFG_STRUC {
- struct {
- UINT32 AcTxop:8; // in unit of 32us
- UINT32 Aifsn:4; // # of slot time
- UINT32 Cwmin:4; //
- UINT32 Cwmax:4; //unit power of 2
- UINT32 :12; //
- } field;
- UINT32 word;
-} EDCA_AC_CFG_STRUC, *PEDCA_AC_CFG_STRUC;
-#endif
-
-#define EDCA_TID_AC_MAP 0x1310
-#define TX_PWR_CFG_0 0x1314
-#define TX_PWR_CFG_1 0x1318
-#define TX_PWR_CFG_2 0x131C
-#define TX_PWR_CFG_3 0x1320
-#define TX_PWR_CFG_4 0x1324
-#define TX_PIN_CFG 0x1328
-#define TX_BAND_CFG 0x132c // 0x1 use upper 20MHz. 0 juse lower 20MHz
-#define TX_SW_CFG0 0x1330
-#define TX_SW_CFG1 0x1334
-#define TX_SW_CFG2 0x1338
-#define TXOP_THRES_CFG 0x133c
-#define TXOP_CTRL_CFG 0x1340
-#define TX_RTS_CFG 0x1344
-
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_RTS_CFG_STRUC {
- struct {
- UINT32 rsv:7;
- UINT32 RtsFbkEn:1; // enable rts rate fallback
- UINT32 RtsThres:16; // unit:byte
- UINT32 AutoRtsRetryLimit:8;
- } field;
- UINT32 word;
-} TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
-#else
-typedef union _TX_RTS_CFG_STRUC {
- struct {
- UINT32 AutoRtsRetryLimit:8;
- UINT32 RtsThres:16; // unit:byte
- UINT32 RtsFbkEn:1; // enable rts rate fallback
- UINT32 rsv:7; // 1: HT non-STBC control frame enable
- } field;
- UINT32 word;
-} TX_RTS_CFG_STRUC, *PTX_RTS_CFG_STRUC;
-#endif
-#define TX_TIMEOUT_CFG 0x1348
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_TIMEOUT_CFG_STRUC {
- struct {
- UINT32 rsv2:8;
- UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
- UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
- UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
- UINT32 rsv:4;
- } field;
- UINT32 word;
-} TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
-#else
-typedef union _TX_TIMEOUT_CFG_STRUC {
- struct {
- UINT32 rsv:4;
- UINT32 MpduLifeTime:4; // expiration time = 2^(9+MPDU LIFE TIME) us
- UINT32 RxAckTimeout:8; // unit:slot. Used for TX precedure
- UINT32 TxopTimeout:8; //TXOP timeout value for TXOP truncation. It is recommended that (SLOT_TIME) > (TX_OP_TIMEOUT) > (RX_ACK_TIMEOUT)
- UINT32 rsv2:8; // 1: HT non-STBC control frame enable
- } field;
- UINT32 word;
-} TX_TIMEOUT_CFG_STRUC, *PTX_TIMEOUT_CFG_STRUC;
-#endif
-#define TX_RTY_CFG 0x134c
-#ifdef RT_BIG_ENDIAN
-typedef union PACKED _TX_RTY_CFG_STRUC {
- struct {
- UINT32 rsv:1;
- UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
- UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
- UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
- UINT32 LongRtyThre:12; // Long retry threshoold
- UINT32 LongRtyLimit:8; //long retry limit
- UINT32 ShortRtyLimit:8; // short retry limit
-
- } field;
- UINT32 word;
-} TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
-#else
-typedef union PACKED _TX_RTY_CFG_STRUC {
- struct {
- UINT32 ShortRtyLimit:8; // short retry limit
- UINT32 LongRtyLimit:8; //long retry limit
- UINT32 LongRtyThre:12; // Long retry threshoold
- UINT32 NonAggRtyMode:1; // Non-Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
- UINT32 AggRtyMode:1; // Aggregate MPDU retry mode. 0:expired by retry limit, 1: expired by mpdu life timer
- UINT32 TxautoFBEnable:1; // Tx retry PHY rate auto fallback enable
- UINT32 rsv:1; // 1: HT non-STBC control frame enable
- } field;
- UINT32 word;
-} TX_RTY_CFG_STRUC, *PTX_RTY_CFG_STRUC;
-#endif
-#define TX_LINK_CFG 0x1350
-#ifdef RT_BIG_ENDIAN
-typedef union PACKED _TX_LINK_CFG_STRUC {
- struct PACKED {
- UINT32 RemotMFS:8; //remote MCS feedback sequence number
- UINT32 RemotMFB:8; // remote MCS feedback
- UINT32 rsv:3; //
- UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
- UINT32 TxRDGEn:1; // RDG TX enable
- UINT32 TxMRQEn:1; // MCS request TX enable
- UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
- UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
- UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
- } field;
- UINT32 word;
-} TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
-#else
-typedef union PACKED _TX_LINK_CFG_STRUC {
- struct PACKED {
- UINT32 RemoteMFBLifeTime:8; //remote MFB life time. unit : 32us
- UINT32 MFBEnable:1; // TX apply remote MFB 1:enable
- UINT32 RemoteUMFSEnable:1; // remote unsolicit MFB enable. 0: not apply remote remote unsolicit (MFS=7)
- UINT32 TxMRQEn:1; // MCS request TX enable
- UINT32 TxRDGEn:1; // RDG TX enable
- UINT32 TxCFAckEn:1; // Piggyback CF-ACK enable
- UINT32 rsv:3; //
- UINT32 RemotMFB:8; // remote MCS feedback
- UINT32 RemotMFS:8; //remote MCS feedback sequence number
- } field;
- UINT32 word;
-} TX_LINK_CFG_STRUC, *PTX_LINK_CFG_STRUC;
-#endif
-#define HT_FBK_CFG0 0x1354
-#ifdef RT_BIG_ENDIAN
-typedef union PACKED _HT_FBK_CFG0_STRUC {
- struct {
- UINT32 HTMCS7FBK:4;
- UINT32 HTMCS6FBK:4;
- UINT32 HTMCS5FBK:4;
- UINT32 HTMCS4FBK:4;
- UINT32 HTMCS3FBK:4;
- UINT32 HTMCS2FBK:4;
- UINT32 HTMCS1FBK:4;
- UINT32 HTMCS0FBK:4;
- } field;
- UINT32 word;
-} HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
-#else
-typedef union PACKED _HT_FBK_CFG0_STRUC {
- struct {
- UINT32 HTMCS0FBK:4;
- UINT32 HTMCS1FBK:4;
- UINT32 HTMCS2FBK:4;
- UINT32 HTMCS3FBK:4;
- UINT32 HTMCS4FBK:4;
- UINT32 HTMCS5FBK:4;
- UINT32 HTMCS6FBK:4;
- UINT32 HTMCS7FBK:4;
- } field;
- UINT32 word;
-} HT_FBK_CFG0_STRUC, *PHT_FBK_CFG0_STRUC;
-#endif
-#define HT_FBK_CFG1 0x1358
-#ifdef RT_BIG_ENDIAN
-typedef union _HT_FBK_CFG1_STRUC {
- struct {
- UINT32 HTMCS15FBK:4;
- UINT32 HTMCS14FBK:4;
- UINT32 HTMCS13FBK:4;
- UINT32 HTMCS12FBK:4;
- UINT32 HTMCS11FBK:4;
- UINT32 HTMCS10FBK:4;
- UINT32 HTMCS9FBK:4;
- UINT32 HTMCS8FBK:4;
- } field;
- UINT32 word;
-} HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
-#else
-typedef union _HT_FBK_CFG1_STRUC {
- struct {
- UINT32 HTMCS8FBK:4;
- UINT32 HTMCS9FBK:4;
- UINT32 HTMCS10FBK:4;
- UINT32 HTMCS11FBK:4;
- UINT32 HTMCS12FBK:4;
- UINT32 HTMCS13FBK:4;
- UINT32 HTMCS14FBK:4;
- UINT32 HTMCS15FBK:4;
- } field;
- UINT32 word;
-} HT_FBK_CFG1_STRUC, *PHT_FBK_CFG1_STRUC;
-#endif
-#define LG_FBK_CFG0 0x135c
-#ifdef RT_BIG_ENDIAN
-typedef union _LG_FBK_CFG0_STRUC {
- struct {
- UINT32 OFDMMCS7FBK:4; //initial value is 6
- UINT32 OFDMMCS6FBK:4; //initial value is 5
- UINT32 OFDMMCS5FBK:4; //initial value is 4
- UINT32 OFDMMCS4FBK:4; //initial value is 3
- UINT32 OFDMMCS3FBK:4; //initial value is 2
- UINT32 OFDMMCS2FBK:4; //initial value is 1
- UINT32 OFDMMCS1FBK:4; //initial value is 0
- UINT32 OFDMMCS0FBK:4; //initial value is 0
- } field;
- UINT32 word;
-} LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
-#else
-typedef union _LG_FBK_CFG0_STRUC {
- struct {
- UINT32 OFDMMCS0FBK:4; //initial value is 0
- UINT32 OFDMMCS1FBK:4; //initial value is 0
- UINT32 OFDMMCS2FBK:4; //initial value is 1
- UINT32 OFDMMCS3FBK:4; //initial value is 2
- UINT32 OFDMMCS4FBK:4; //initial value is 3
- UINT32 OFDMMCS5FBK:4; //initial value is 4
- UINT32 OFDMMCS6FBK:4; //initial value is 5
- UINT32 OFDMMCS7FBK:4; //initial value is 6
- } field;
- UINT32 word;
-} LG_FBK_CFG0_STRUC, *PLG_FBK_CFG0_STRUC;
-#endif
-#define LG_FBK_CFG1 0x1360
-#ifdef RT_BIG_ENDIAN
-typedef union _LG_FBK_CFG1_STRUC {
- struct {
- UINT32 rsv:16;
- UINT32 CCKMCS3FBK:4; //initial value is 2
- UINT32 CCKMCS2FBK:4; //initial value is 1
- UINT32 CCKMCS1FBK:4; //initial value is 0
- UINT32 CCKMCS0FBK:4; //initial value is 0
- } field;
- UINT32 word;
-} LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
-#else
-typedef union _LG_FBK_CFG1_STRUC {
- struct {
- UINT32 CCKMCS0FBK:4; //initial value is 0
- UINT32 CCKMCS1FBK:4; //initial value is 0
- UINT32 CCKMCS2FBK:4; //initial value is 1
- UINT32 CCKMCS3FBK:4; //initial value is 2
- UINT32 rsv:16;
- } field;
- UINT32 word;
-} LG_FBK_CFG1_STRUC, *PLG_FBK_CFG1_STRUC;
-#endif
-
-
-//=======================================================
-//================ Protection Paramater================================
-//=======================================================
-#define CCK_PROT_CFG 0x1364 //CCK Protection
-#define ASIC_SHORTNAV 1
-#define ASIC_LONGNAV 2
-#define ASIC_RTS 1
-#define ASIC_CTS 2
-#ifdef RT_BIG_ENDIAN
-typedef union _PROT_CFG_STRUC {
- struct {
- UINT32 rsv:5;
- UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
- UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
- UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
- UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
- UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
- UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
- } field;
- UINT32 word;
-} PROT_CFG_STRUC, *PPROT_CFG_STRUC;
-#else
-typedef union _PROT_CFG_STRUC {
- struct {
- UINT32 ProtectRate:16; //Protection control frame rate for CCK TX(RTS/CTS/CFEnd).
- UINT32 ProtectCtrl:2; //Protection control frame type for CCK TX. 1:RTS/CTS, 2:CTS-to-self, 0:None, 3:rsv
- UINT32 ProtectNav:2; //TXOP protection type for CCK TX. 0:None, 1:ShortNAVprotect, 2:LongNAVProtect, 3:rsv
- UINT32 TxopAllowCck:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowOfdm:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowMM20:1; //CCK TXOP allowance. 0:disallow.
- UINT32 TxopAllowMM40:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowGF20:1; //CCK TXOP allowance.0:disallow.
- UINT32 TxopAllowGF40:1; //CCK TXOP allowance.0:disallow.
- UINT32 RTSThEn:1; //RTS threshold enable on CCK TX
- UINT32 rsv:5;
- } field;
- UINT32 word;
-} PROT_CFG_STRUC, *PPROT_CFG_STRUC;
-#endif
-
-#define OFDM_PROT_CFG 0x1368 //OFDM Protection
-#define MM20_PROT_CFG 0x136C //MM20 Protection
-#define MM40_PROT_CFG 0x1370 //MM40 Protection
-#define GF20_PROT_CFG 0x1374 //GF20 Protection
-#define GF40_PROT_CFG 0x1378 //GR40 Protection
-#define EXP_CTS_TIME 0x137C //
-#define EXP_ACK_TIME 0x1380 //
-
-//
-// 4.4 MAC RX configuration registers (offset:0x1400)
-//
-#define RX_FILTR_CFG 0x1400 //TXRX_CSR0
-#define AUTO_RSP_CFG 0x1404 //TXRX_CSR4
-//
-// TXRX_CSR4: Auto-Responder/
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _AUTO_RSP_CFG_STRUC {
- struct {
- UINT32 :24;
- UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
- UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
- UINT32 rsv:1; // Power bit value in conrtrol frame
- UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
- UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
- UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
- UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
- UINT32 AutoResponderEnable:1;
- } field;
- UINT32 word;
-} AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
-#else
-typedef union _AUTO_RSP_CFG_STRUC {
- struct {
- UINT32 AutoResponderEnable:1;
- UINT32 BACAckPolicyEnable:1; // 0:long, 1:short preamble
- UINT32 CTS40MMode:1; // Response CTS 40MHz duplicate mode
- UINT32 CTS40MRef:1; // Response CTS 40MHz duplicate mode
- UINT32 AutoResponderPreamble:1; // 0:long, 1:short preamble
- UINT32 rsv:1; // Power bit value in conrtrol frame
- UINT32 DualCTSEn:1; // Power bit value in conrtrol frame
- UINT32 AckCtsPsmBit:1; // Power bit value in conrtrol frame
- UINT32 :24;
- } field;
- UINT32 word;
-} AUTO_RSP_CFG_STRUC, *PAUTO_RSP_CFG_STRUC;
-#endif
-
-#define LEGACY_BASIC_RATE 0x1408 // TXRX_CSR5 0x3054
-#define HT_BASIC_RATE 0x140c
-#define HT_CTRL_CFG 0x1410
-#define SIFS_COST_CFG 0x1414
-#define RX_PARSER_CFG 0x1418 //Set NAV for all received frames
-
-//
-// 4.5 MAC Security configuration (offset:0x1500)
-//
-#define TX_SEC_CNT0 0x1500 //
-#define RX_SEC_CNT0 0x1504 //
-#define CCMP_FC_MUTE 0x1508 //
-//
-// 4.6 HCCA/PSMP (offset:0x1600)
-//
-#define TXOP_HLDR_ADDR0 0x1600
-#define TXOP_HLDR_ADDR1 0x1604
-#define TXOP_HLDR_ET 0x1608
-#define QOS_CFPOLL_RA_DW0 0x160c
-#define QOS_CFPOLL_A1_DW1 0x1610
-#define QOS_CFPOLL_QC 0x1614
-//
-// 4.7 MAC Statistis registers (offset:0x1700)
-//
-#define RX_STA_CNT0 0x1700 //
-#define RX_STA_CNT1 0x1704 //
-#define RX_STA_CNT2 0x1708 //
-
-//
-// RX_STA_CNT0_STRUC: RX PLCP error count & RX CRC error count
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _RX_STA_CNT0_STRUC {
- struct {
- USHORT PhyErr;
- USHORT CrcErr;
- } field;
- UINT32 word;
-} RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
-#else
-typedef union _RX_STA_CNT0_STRUC {
- struct {
- USHORT CrcErr;
- USHORT PhyErr;
- } field;
- UINT32 word;
-} RX_STA_CNT0_STRUC, *PRX_STA_CNT0_STRUC;
-#endif
-
-//
-// RX_STA_CNT1_STRUC: RX False CCA count & RX LONG frame count
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _RX_STA_CNT1_STRUC {
- struct {
- USHORT PlcpErr;
- USHORT FalseCca;
- } field;
- UINT32 word;
-} RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
-#else
-typedef union _RX_STA_CNT1_STRUC {
- struct {
- USHORT FalseCca;
- USHORT PlcpErr;
- } field;
- UINT32 word;
-} RX_STA_CNT1_STRUC, *PRX_STA_CNT1_STRUC;
-#endif
-
-//
-// RX_STA_CNT2_STRUC:
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _RX_STA_CNT2_STRUC {
- struct {
- USHORT RxFifoOverflowCount;
- USHORT RxDupliCount;
- } field;
- UINT32 word;
-} RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
-#else
-typedef union _RX_STA_CNT2_STRUC {
- struct {
- USHORT RxDupliCount;
- USHORT RxFifoOverflowCount;
- } field;
- UINT32 word;
-} RX_STA_CNT2_STRUC, *PRX_STA_CNT2_STRUC;
-#endif
-#define TX_STA_CNT0 0x170C //
-//
-// STA_CSR3: TX Beacon count
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_STA_CNT0_STRUC {
- struct {
- USHORT TxBeaconCount;
- USHORT TxFailCount;
- } field;
- UINT32 word;
-} TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
-#else
-typedef union _TX_STA_CNT0_STRUC {
- struct {
- USHORT TxFailCount;
- USHORT TxBeaconCount;
- } field;
- UINT32 word;
-} TX_STA_CNT0_STRUC, *PTX_STA_CNT0_STRUC;
-#endif
-#define TX_STA_CNT1 0x1710 //
-//
-// TX_STA_CNT1: TX tx count
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_STA_CNT1_STRUC {
- struct {
- USHORT TxRetransmit;
- USHORT TxSuccess;
- } field;
- UINT32 word;
-} TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
-#else
-typedef union _TX_STA_CNT1_STRUC {
- struct {
- USHORT TxSuccess;
- USHORT TxRetransmit;
- } field;
- UINT32 word;
-} TX_STA_CNT1_STRUC, *PTX_STA_CNT1_STRUC;
-#endif
-#define TX_STA_CNT2 0x1714 //
-//
-// TX_STA_CNT2: TX tx count
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_STA_CNT2_STRUC {
- struct {
- USHORT TxUnderFlowCount;
- USHORT TxZeroLenCount;
- } field;
- UINT32 word;
-} TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
-#else
-typedef union _TX_STA_CNT2_STRUC {
- struct {
- USHORT TxZeroLenCount;
- USHORT TxUnderFlowCount;
- } field;
- UINT32 word;
-} TX_STA_CNT2_STRUC, *PTX_STA_CNT2_STRUC;
-#endif
-#define TX_STA_FIFO 0x1718 //
-//
-// TX_STA_FIFO_STRUC: TX Result for specific PID status fifo register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union PACKED _TX_STA_FIFO_STRUC {
- struct {
- UINT32 Reserve:2;
- UINT32 TxBF:1; // 3*3
- UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
-// UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
- UINT32 wcid:8; //wireless client index
- UINT32 TxAckRequired:1; // ack required
- UINT32 TxAggre:1; // Tx is aggregated
- UINT32 TxSuccess:1; // Tx success. whether success or not
- UINT32 PidType:4;
- UINT32 bValid:1; // 1:This register contains a valid TX result
- } field;
- UINT32 word;
-} TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
-#else
-typedef union PACKED _TX_STA_FIFO_STRUC {
- struct {
- UINT32 bValid:1; // 1:This register contains a valid TX result
- UINT32 PidType:4;
- UINT32 TxSuccess:1; // Tx No retry success
- UINT32 TxAggre:1; // Tx Retry Success
- UINT32 TxAckRequired:1; // Tx fail
- UINT32 wcid:8; //wireless client index
-// UINT32 SuccessRate:16; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
- UINT32 SuccessRate:13; //include MCS, mode ,shortGI, BW settingSame format as TXWI Word 0 Bit 31-16.
- UINT32 TxBF:1;
- UINT32 Reserve:2;
- } field;
- UINT32 word;
-} TX_STA_FIFO_STRUC, *PTX_STA_FIFO_STRUC;
-#endif
-// Debug counter
-#define TX_AGG_CNT 0x171c
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT_STRUC {
- struct {
- USHORT AggTxCount;
- USHORT NonAggTxCount;
- } field;
- UINT32 word;
-} TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
-#else
-typedef union _TX_AGG_CNT_STRUC {
- struct {
- USHORT NonAggTxCount;
- USHORT AggTxCount;
- } field;
- UINT32 word;
-} TX_AGG_CNT_STRUC, *PTX_AGG_CNT_STRUC;
-#endif
-// Debug counter
-#define TX_AGG_CNT0 0x1720
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT0_STRUC {
- struct {
- USHORT AggSize2Count;
- USHORT AggSize1Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
-#else
-typedef union _TX_AGG_CNT0_STRUC {
- struct {
- USHORT AggSize1Count;
- USHORT AggSize2Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT0_STRUC, *PTX_AGG_CNT0_STRUC;
-#endif
-// Debug counter
-#define TX_AGG_CNT1 0x1724
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT1_STRUC {
- struct {
- USHORT AggSize4Count;
- USHORT AggSize3Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
-#else
-typedef union _TX_AGG_CNT1_STRUC {
- struct {
- USHORT AggSize3Count;
- USHORT AggSize4Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT1_STRUC, *PTX_AGG_CNT1_STRUC;
-#endif
-#define TX_AGG_CNT2 0x1728
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT2_STRUC {
- struct {
- USHORT AggSize6Count;
- USHORT AggSize5Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
-#else
-typedef union _TX_AGG_CNT2_STRUC {
- struct {
- USHORT AggSize5Count;
- USHORT AggSize6Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT2_STRUC, *PTX_AGG_CNT2_STRUC;
-#endif
-// Debug counter
-#define TX_AGG_CNT3 0x172c
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT3_STRUC {
- struct {
- USHORT AggSize8Count;
- USHORT AggSize7Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
-#else
-typedef union _TX_AGG_CNT3_STRUC {
- struct {
- USHORT AggSize7Count;
- USHORT AggSize8Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT3_STRUC, *PTX_AGG_CNT3_STRUC;
-#endif
-// Debug counter
-#define TX_AGG_CNT4 0x1730
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT4_STRUC {
- struct {
- USHORT AggSize10Count;
- USHORT AggSize9Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
-#else
-typedef union _TX_AGG_CNT4_STRUC {
- struct {
- USHORT AggSize9Count;
- USHORT AggSize10Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT4_STRUC, *PTX_AGG_CNT4_STRUC;
-#endif
-#define TX_AGG_CNT5 0x1734
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT5_STRUC {
- struct {
- USHORT AggSize12Count;
- USHORT AggSize11Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
-#else
-typedef union _TX_AGG_CNT5_STRUC {
- struct {
- USHORT AggSize11Count;
- USHORT AggSize12Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT5_STRUC, *PTX_AGG_CNT5_STRUC;
-#endif
-#define TX_AGG_CNT6 0x1738
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT6_STRUC {
- struct {
- USHORT AggSize14Count;
- USHORT AggSize13Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
-#else
-typedef union _TX_AGG_CNT6_STRUC {
- struct {
- USHORT AggSize13Count;
- USHORT AggSize14Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT6_STRUC, *PTX_AGG_CNT6_STRUC;
-#endif
-#define TX_AGG_CNT7 0x173c
-#ifdef RT_BIG_ENDIAN
-typedef union _TX_AGG_CNT7_STRUC {
- struct {
- USHORT AggSize16Count;
- USHORT AggSize15Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
-#else
-typedef union _TX_AGG_CNT7_STRUC {
- struct {
- USHORT AggSize15Count;
- USHORT AggSize16Count;
- } field;
- UINT32 word;
-} TX_AGG_CNT7_STRUC, *PTX_AGG_CNT7_STRUC;
-#endif
-#define MPDU_DENSITY_CNT 0x1740
-#ifdef RT_BIG_ENDIAN
-typedef union _MPDU_DEN_CNT_STRUC {
- struct {
- USHORT RXZeroDelCount; //RX zero length delimiter count
- USHORT TXZeroDelCount; //TX zero length delimiter count
- } field;
- UINT32 word;
-} MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
-#else
-typedef union _MPDU_DEN_CNT_STRUC {
- struct {
- USHORT TXZeroDelCount; //TX zero length delimiter count
- USHORT RXZeroDelCount; //RX zero length delimiter count
- } field;
- UINT32 word;
-} MPDU_DEN_CNT_STRUC, *PMPDU_DEN_CNT_STRUC;
-#endif
-//
-// TXRX control registers - base address 0x3000
-//
-// rt2860b UNKNOWN reg use R/O Reg Addr 0x77d0 first..
-#define TXRX_CSR1 0x77d0
-
-//
-// Security key table memory, base address = 0x1000
-//
-#define MAC_WCID_BASE 0x1800 //8-bytes(use only 6-bytes) * 256 entry =
-#define HW_WCID_ENTRY_SIZE 8
-#define PAIRWISE_KEY_TABLE_BASE 0x4000 // 32-byte * 256-entry = -byte
-#define HW_KEY_ENTRY_SIZE 0x20
-#define PAIRWISE_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
-#define MAC_IVEIV_TABLE_BASE 0x6000 // 8-byte * 256-entry = -byte
-#define HW_IVEIV_ENTRY_SIZE 8
-#define MAC_WCID_ATTRIBUTE_BASE 0x6800 // 4-byte * 256-entry = -byte
-#define HW_WCID_ATTRI_SIZE 4
-#define WCID_RESERVED 0x6bfc
-#define SHARED_KEY_TABLE_BASE 0x6c00 // 32-byte * 16-entry = 512-byte
-#define SHARED_KEY_MODE_BASE 0x7000 // 32-byte * 16-entry = 512-byte
-#define HW_SHARED_KEY_MODE_SIZE 4
-#define SHAREDKEYTABLE 0
-#define PAIRWISEKEYTABLE 1
-
-
-#ifdef RT_BIG_ENDIAN
-typedef union _SHAREDKEY_MODE_STRUC {
- struct {
- UINT32 :1;
- UINT32 Bss1Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key0CipherAlg:3;
- } field;
- UINT32 word;
-} SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
-#else
-typedef union _SHAREDKEY_MODE_STRUC {
- struct {
- UINT32 Bss0Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss0Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss1Key3CipherAlg:3;
- UINT32 :1;
- } field;
- UINT32 word;
-} SHAREDKEY_MODE_STRUC, *PSHAREDKEY_MODE_STRUC;
-#endif
-// 64-entry for pairwise key table
-typedef struct _HW_WCID_ENTRY { // 8-byte per entry
- UCHAR Address[6];
- UCHAR Rsv[2];
-} HW_WCID_ENTRY, PHW_WCID_ENTRY;
-
-
-// =================================================================================
-// WCID format
-// =================================================================================
-//7.1 WCID ENTRY format : 8bytes
-typedef struct _WCID_ENTRY_STRUC {
- UCHAR RXBABitmap7; // bit0 for TID8, bit7 for TID 15
- UCHAR RXBABitmap0; // bit0 for TID0, bit7 for TID 7
- UCHAR MAC[6]; // 0 for shared key table. 1 for pairwise key table
-} WCID_ENTRY_STRUC, *PWCID_ENTRY_STRUC;
-
-//8.1.1 SECURITY KEY format : 8DW
-// 32-byte per entry, total 16-entry for shared key table, 64-entry for pairwise key table
-typedef struct _HW_KEY_ENTRY { // 32-byte per entry
- UCHAR Key[16];
- UCHAR TxMic[8];
- UCHAR RxMic[8];
-} HW_KEY_ENTRY, *PHW_KEY_ENTRY;
-
-//8.1.2 IV/EIV format : 2DW
-
-//8.1.3 RX attribute entry format : 1DW
-#ifdef RT_BIG_ENDIAN
-typedef struct _MAC_ATTRIBUTE_STRUC {
- UINT32 rsv:22;
- UINT32 RXWIUDF:3;
- UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
- UINT32 PairKeyMode:3;
- UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
-} MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
-#else
-typedef struct _MAC_ATTRIBUTE_STRUC {
- UINT32 KeyTab:1; // 0 for shared key table. 1 for pairwise key table
- UINT32 PairKeyMode:3;
- UINT32 BSSIDIdx:3; //multipleBSS index for the WCID
- UINT32 RXWIUDF:3;
- UINT32 rsv:22;
-} MAC_ATTRIBUTE_STRUC, *PMAC_ATTRIBUTE_STRUC;
-#endif
-
-
-// =================================================================================
-// HOST-MCU communication data structure
-// =================================================================================
-
-//
-// H2M_MAILBOX_CSR: Host-to-MCU Mailbox
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _H2M_MAILBOX_STRUC {
- struct {
- UINT32 Owner:8;
- UINT32 CmdToken:8; // 0xff tells MCU not to report CmdDoneInt after excuting the command
- UINT32 HighByte:8;
- UINT32 LowByte:8;
- } field;
- UINT32 word;
-} H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
-#else
-typedef union _H2M_MAILBOX_STRUC {
- struct {
- UINT32 LowByte:8;
- UINT32 HighByte:8;
- UINT32 CmdToken:8;
- UINT32 Owner:8;
- } field;
- UINT32 word;
-} H2M_MAILBOX_STRUC, *PH2M_MAILBOX_STRUC;
-#endif
-
-//
-// M2H_CMD_DONE_CSR: MCU-to-Host command complete indication
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _M2H_CMD_DONE_STRUC {
- struct {
- UINT32 CmdToken3;
- UINT32 CmdToken2;
- UINT32 CmdToken1;
- UINT32 CmdToken0;
- } field;
- UINT32 word;
-} M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
-#else
-typedef union _M2H_CMD_DONE_STRUC {
- struct {
- UINT32 CmdToken0;
- UINT32 CmdToken1;
- UINT32 CmdToken2;
- UINT32 CmdToken3;
- } field;
- UINT32 word;
-} M2H_CMD_DONE_STRUC, *PM2H_CMD_DONE_STRUC;
-#endif
-
-
-//NAV_TIME_CFG :NAV
-#ifdef RT_BIG_ENDIAN
-typedef union _NAV_TIME_CFG_STRUC {
- struct {
- USHORT rsv:6;
- USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
- USHORT Eifs:9; // in unit of 1-us
- UCHAR SlotTime; // in unit of 1-us
- UCHAR Sifs; // in unit of 1-us
- } field;
- UINT32 word;
-} NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
-#else
-typedef union _NAV_TIME_CFG_STRUC {
- struct {
- UCHAR Sifs; // in unit of 1-us
- UCHAR SlotTime; // in unit of 1-us
- USHORT Eifs:9; // in unit of 1-us
- USHORT ZeroSifs:1; // Applied zero SIFS timer after OFDM RX 0: disable
- USHORT rsv:6;
- } field;
- UINT32 word;
-} NAV_TIME_CFG_STRUC, *PNAV_TIME_CFG_STRUC;
-#endif
-
-
-//
-// RX_FILTR_CFG: /RX configuration register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union RX_FILTR_CFG_STRUC {
- struct {
- UINT32 :15;
- UINT32 DropRsvCntlType:1;
-
- UINT32 DropBAR:1; //
- UINT32 DropBA:1; //
- UINT32 DropPsPoll:1; // Drop Ps-Poll
- UINT32 DropRts:1; // Drop Ps-Poll
-
- UINT32 DropCts:1; // Drop Ps-Poll
- UINT32 DropAck:1; // Drop Ps-Poll
- UINT32 DropCFEnd:1; // Drop Ps-Poll
- UINT32 DropCFEndAck:1; // Drop Ps-Poll
-
- UINT32 DropDuplicate:1; // Drop duplicate frame
- UINT32 DropBcast:1; // Drop broadcast frames
- UINT32 DropMcast:1; // Drop multicast frames
- UINT32 DropVerErr:1; // Drop version error frame
-
- UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
- UINT32 DropNotToMe:1; // Drop not to me unicast frame
- UINT32 DropPhyErr:1; // Drop physical error
- UINT32 DropCRCErr:1; // Drop CRC error
- } field;
- UINT32 word;
-} RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
-#else
-typedef union _RX_FILTR_CFG_STRUC {
- struct {
- UINT32 DropCRCErr:1; // Drop CRC error
- UINT32 DropPhyErr:1; // Drop physical error
- UINT32 DropNotToMe:1; // Drop not to me unicast frame
- UINT32 DropNotMyBSSID:1; // Drop fram ToDs bit is true
-
- UINT32 DropVerErr:1; // Drop version error frame
- UINT32 DropMcast:1; // Drop multicast frames
- UINT32 DropBcast:1; // Drop broadcast frames
- UINT32 DropDuplicate:1; // Drop duplicate frame
-
- UINT32 DropCFEndAck:1; // Drop Ps-Poll
- UINT32 DropCFEnd:1; // Drop Ps-Poll
- UINT32 DropAck:1; // Drop Ps-Poll
- UINT32 DropCts:1; // Drop Ps-Poll
-
- UINT32 DropRts:1; // Drop Ps-Poll
- UINT32 DropPsPoll:1; // Drop Ps-Poll
- UINT32 DropBA:1; //
- UINT32 DropBAR:1; //
-
- UINT32 DropRsvCntlType:1;
- UINT32 :15;
- } field;
- UINT32 word;
-} RX_FILTR_CFG_STRUC, *PRX_FILTR_CFG_STRUC;
-#endif
-
-
-
-
-//
-// PHY_CSR4: RF serial control register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _PHY_CSR4_STRUC {
- struct {
- UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
- UINT32 PLL_LD:1; // RF PLL_LD status
- UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
- UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
- UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
- } field;
- UINT32 word;
-} PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
-#else
-typedef union _PHY_CSR4_STRUC {
- struct {
- UINT32 RFRegValue:24; // Register value (include register id) serial out to RF/IF chip.
- UINT32 NumberOfBits:5; // Number of bits used in RFRegValue (I:20, RFMD:22)
- UINT32 IFSelect:1; // 1: select IF to program, 0: select RF to program
- UINT32 PLL_LD:1; // RF PLL_LD status
- UINT32 Busy:1; // 1: ASIC is busy execute RF programming.
- } field;
- UINT32 word;
-} PHY_CSR4_STRUC, *PPHY_CSR4_STRUC;
-#endif
-
-
-//
-// SEC_CSR5: shared key table security mode register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _SEC_CSR5_STRUC {
- struct {
- UINT32 :1;
- UINT32 Bss3Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key0CipherAlg:3;
- } field;
- UINT32 word;
-} SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
-#else
-typedef union _SEC_CSR5_STRUC {
- struct {
- UINT32 Bss2Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss2Key3CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key0CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key1CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key2CipherAlg:3;
- UINT32 :1;
- UINT32 Bss3Key3CipherAlg:3;
- UINT32 :1;
- } field;
- UINT32 word;
-} SEC_CSR5_STRUC, *PSEC_CSR5_STRUC;
-#endif
-
-
-//
-// HOST_CMD_CSR: For HOST to interrupt embedded processor
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _HOST_CMD_CSR_STRUC {
- struct {
- UINT32 Rsv:24;
- UINT32 HostCommand:8;
- } field;
- UINT32 word;
-} HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
-#else
-typedef union _HOST_CMD_CSR_STRUC {
- struct {
- UINT32 HostCommand:8;
- UINT32 Rsv:24;
- } field;
- UINT32 word;
-} HOST_CMD_CSR_STRUC, *PHOST_CMD_CSR_STRUC;
-#endif
-
-
-//
-// AIFSN_CSR: AIFSN for each EDCA AC
-//
-
-
-
-//
-// E2PROM_CSR: EEPROM control register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _E2PROM_CSR_STRUC {
- struct {
- UINT32 Rsvd:25;
- UINT32 LoadStatus:1; // 1:loading, 0:done
- UINT32 Type:1; // 1: 93C46, 0:93C66
- UINT32 EepromDO:1;
- UINT32 EepromDI:1;
- UINT32 EepromCS:1;
- UINT32 EepromSK:1;
- UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
- } field;
- UINT32 word;
-} E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
-#else
-typedef union _E2PROM_CSR_STRUC {
- struct {
- UINT32 Reload:1; // Reload EEPROM content, write one to reload, self-cleared.
- UINT32 EepromSK:1;
- UINT32 EepromCS:1;
- UINT32 EepromDI:1;
- UINT32 EepromDO:1;
- UINT32 Type:1; // 1: 93C46, 0:93C66
- UINT32 LoadStatus:1; // 1:loading, 0:done
- UINT32 Rsvd:25;
- } field;
- UINT32 word;
-} E2PROM_CSR_STRUC, *PE2PROM_CSR_STRUC;
-#endif
-
-//
-// QOS_CSR0: TXOP holder address0 register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _QOS_CSR0_STRUC {
- struct {
- UCHAR Byte3; // MAC address byte 3
- UCHAR Byte2; // MAC address byte 2
- UCHAR Byte1; // MAC address byte 1
- UCHAR Byte0; // MAC address byte 0
- } field;
- UINT32 word;
-} QOS_CSR0_STRUC, *PQOS_CSR0_STRUC;
-#else
-typedef union _QOS_CSR0_STRUC {
- struct {
- UCHAR Byte0; // MAC address byte 0
- UCHAR Byte1; // MAC address byte 1
- UCHAR Byte2; // MAC address byte 2
- UCHAR Byte3; // MAC address byte 3
- } field;
- UINT32 word;
-} QOS_CSR0_STRUC, *PQOS_CSR0_STRUC;
-#endif
-
-//
-// QOS_CSR1: TXOP holder address1 register
-//
-#ifdef RT_BIG_ENDIAN
-typedef union _QOS_CSR1_STRUC {
- struct {
- UCHAR Rsvd1;
- UCHAR Rsvd0;
- UCHAR Byte5; // MAC address byte 5
- UCHAR Byte4; // MAC address byte 4
- } field;
- UINT32 word;
-} QOS_CSR1_STRUC, *PQOS_CSR1_STRUC;
-#else
-typedef union _QOS_CSR1_STRUC {
- struct {
- UCHAR Byte4; // MAC address byte 4
- UCHAR Byte5; // MAC address byte 5
- UCHAR Rsvd0;
- UCHAR Rsvd1;
- } field;
- UINT32 word;
-} QOS_CSR1_STRUC, *PQOS_CSR1_STRUC;
-#endif
-
-#define RF_CSR_CFG 0x500
-#ifdef RT_BIG_ENDIAN
-typedef union _RF_CSR_CFG_STRUC {
- struct {
- UINT Rsvd1:14; // Reserved
- UINT RF_CSR_KICK:1; // kick RF register read/write
- UINT RF_CSR_WR:1; // 0: read 1: write
- UINT Rsvd2:3; // Reserved
- UINT TESTCSR_RFACC_REGNUM:5; // RF register ID
- UINT RF_CSR_DATA:8; // DATA
- } field;
- UINT word;
-} RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
-#else
-typedef union _RF_CSR_CFG_STRUC {
- struct {
- UINT RF_CSR_DATA:8; // DATA
- UINT TESTCSR_RFACC_REGNUM:5; // RF register ID
- UINT Rsvd2:3; // Reserved
- UINT RF_CSR_WR:1; // 0: read 1: write
- UINT RF_CSR_KICK:1; // kick RF register read/write
- UINT Rsvd1:14; // Reserved
- } field;
- UINT word;
-} RF_CSR_CFG_STRUC, *PRF_CSR_CFG_STRUC;
-#endif
-
-
-//
-// Other on-chip shared memory space, base = 0x2000
-//
-
-// CIS space - base address = 0x2000
-#define HW_CIS_BASE 0x2000
-
-// Carrier-sense CTS frame base address. It's where mac stores carrier-sense frame for carrier-sense function.
-#define HW_CS_CTS_BASE 0x7700
-// DFS CTS frame base address. It's where mac stores CTS frame for DFS.
-#define HW_DFS_CTS_BASE 0x7780
-#define HW_CTS_FRAME_SIZE 0x80
-
-// 2004-11-08 john - since NULL frame won't be that long (256 byte). We steal 16 tail bytes
-// to save debugging settings
-#define HW_DEBUG_SETTING_BASE 0x77f0 // 0x77f0~0x77ff total 16 bytes
-#define HW_DEBUG_SETTING_BASE2 0x7770 // 0x77f0~0x77ff total 16 bytes
-
-// In order to support maximum 8 MBSS and its maximum length is 512 for each beacon
-// Three section discontinue memory segments will be used.
-// 1. The original region for BCN 0~3
-// 2. Extract memory from FCE table for BCN 4~5
-// 3. Extract memory from Pair-wise key table for BCN 6~7
-// It occupied those memory of wcid 238~253 for BCN 6
-// and wcid 222~237 for BCN 7
-#define HW_BEACON_MAX_SIZE 0x1000 /* unit: byte */
-#define HW_BEACON_BASE0 0x7800
-#define HW_BEACON_BASE1 0x7A00
-#define HW_BEACON_BASE2 0x7C00
-#define HW_BEACON_BASE3 0x7E00
-#define HW_BEACON_BASE4 0x7200
-#define HW_BEACON_BASE5 0x7400
-#define HW_BEACON_BASE6 0x5DC0
-#define HW_BEACON_BASE7 0x5BC0
-
-#define HW_BEACON_MAX_COUNT 8
-#define HW_BEACON_OFFSET 0x0200
-#define HW_BEACON_CONTENT_LEN (HW_BEACON_OFFSET - TXWI_SIZE)
-
-// HOST-MCU shared memory - base address = 0x2100
-#define HOST_CMD_CSR 0x404
-#define H2M_MAILBOX_CSR 0x7010
-#define H2M_MAILBOX_CID 0x7014
-#define H2M_MAILBOX_STATUS 0x701c
-#define H2M_INT_SRC 0x7024
-#define H2M_BBP_AGENT 0x7028
-#define M2H_CMD_DONE_CSR 0x000c
-#define MCU_TXOP_ARRAY_BASE 0x000c // TODO: to be provided by Albert
-#define MCU_TXOP_ENTRY_SIZE 32 // TODO: to be provided by Albert
-#define MAX_NUM_OF_TXOP_ENTRY 16 // TODO: must be same with 8051 firmware
-#define MCU_MBOX_VERSION 0x01 // TODO: to be confirmed by Albert
-#define MCU_MBOX_VERSION_OFFSET 5 // TODO: to be provided by Albert
-
-//
-// Host DMA registers - base address 0x200 . TX0-3=EDCAQid0-3, TX4=HCCA, TX5=MGMT,
-//
-//
-// DMA RING DESCRIPTOR
-//
-#define E2PROM_CSR 0x0004
-#define IO_CNTL_CSR 0x77d0
-
-
-
-// ================================================================
-// Tx / Rx / Mgmt ring descriptor definition
-// ================================================================
-
-// the following PID values are used to mark outgoing frame type in TXD->PID so that
-// proper TX statistics can be collected based on these categories
-// b3-2 of PID field -
-#define PID_MGMT 0x05
-#define PID_BEACON 0x0c
-#define PID_DATA_NORMALUCAST 0x02
-#define PID_DATA_AMPDU 0x04
-#define PID_DATA_NO_ACK 0x08
-#define PID_DATA_NOT_NORM_ACK 0x03
-// value domain of pTxD->HostQId (4-bit: 0~15)
-#define QID_AC_BK 1 // meet ACI definition in 802.11e
-#define QID_AC_BE 0 // meet ACI definition in 802.11e
-#define QID_AC_VI 2
-#define QID_AC_VO 3
-#define QID_HCCA 4
-//#define NUM_OF_TX_RING 5
-#define NUM_OF_TX_RING 4
-#define QID_MGMT 13
-#define QID_RX 14
-#define QID_OTHER 15
-
-#endif // __RTMP_MAC_H__ //
diff --git a/drivers/staging/rt3090/rtmp_type.h b/drivers/staging/rt3090/rtmp_type.h
deleted file mode 100644
index d8b571e6f801..000000000000
--- a/drivers/staging/rt3090/rtmp_type.h
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_type.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
- Paul Lin 1-2-2004
-*/
-
-#ifndef __RTMP_TYPE_H__
-#define __RTMP_TYPE_H__
-
-
-#define PACKED __attribute__ ((packed))
-
-#ifdef LINUX
-// Put platform dependent declaration here
-// For example, linux type definition
-typedef unsigned char UINT8;
-typedef unsigned short UINT16;
-typedef unsigned int UINT32;
-typedef unsigned long long UINT64;
-typedef int INT32;
-typedef long long INT64;
-#endif // LINUX //
-
-typedef unsigned char * PUINT8;
-typedef unsigned short * PUINT16;
-typedef unsigned int * PUINT32;
-typedef unsigned long long * PUINT64;
-typedef int * PINT32;
-typedef long long * PINT64;
-
-// modified for fixing compile warning on Sigma 8634 platform
-typedef char STRING;
-typedef signed char CHAR;
-
-typedef signed short SHORT;
-typedef signed int INT;
-typedef signed long LONG;
-typedef signed long long LONGLONG;
-
-
-#ifdef LINUX
-typedef unsigned char UCHAR;
-typedef unsigned short USHORT;
-typedef unsigned int UINT;
-typedef unsigned long ULONG;
-#endif // LINUX //
-typedef unsigned long long ULONGLONG;
-
-typedef unsigned char BOOLEAN;
-#ifdef LINUX
-typedef void VOID;
-#endif // LINUX //
-
-typedef char * PSTRING;
-typedef VOID * PVOID;
-typedef CHAR * PCHAR;
-typedef UCHAR * PUCHAR;
-typedef USHORT * PUSHORT;
-typedef LONG * PLONG;
-typedef ULONG * PULONG;
-typedef UINT * PUINT;
-
-typedef unsigned int NDIS_MEDIA_STATE;
-
-typedef union _LARGE_INTEGER {
- struct {
- UINT LowPart;
- INT32 HighPart;
- } u;
- INT64 QuadPart;
-} LARGE_INTEGER;
-
-
-//
-// Register set pair for initialzation register set definition
-//
-typedef struct _RTMP_REG_PAIR
-{
- ULONG Register;
- ULONG Value;
-} RTMP_REG_PAIR, *PRTMP_REG_PAIR;
-
-typedef struct _REG_PAIR
-{
- UCHAR Register;
- UCHAR Value;
-} REG_PAIR, *PREG_PAIR;
-
-//
-// Register set pair for initialzation register set definition
-//
-typedef struct _RTMP_RF_REGS
-{
- UCHAR Channel;
- ULONG R1;
- ULONG R2;
- ULONG R3;
- ULONG R4;
-} RTMP_RF_REGS, *PRTMP_RF_REGS;
-
-typedef struct _FREQUENCY_ITEM {
- UCHAR Channel;
- UCHAR N;
- UCHAR R;
- UCHAR K;
-} FREQUENCY_ITEM, *PFREQUENCY_ITEM;
-
-
-typedef int NTSTATUS;
-
-
-#define STATUS_SUCCESS 0x00
-#define STATUS_UNSUCCESSFUL 0x01
-
-#endif // __RTMP_TYPE_H__ //
diff --git a/drivers/staging/rt3090/spectrum.h b/drivers/staging/rt3090/spectrum.h
deleted file mode 100644
index be9bae5b88c2..000000000000
--- a/drivers/staging/rt3090/spectrum.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
- */
-
-#ifndef __SPECTRUM_H__
-#define __SPECTRUM_H__
-
-#include "rtmp_type.h"
-#include "spectrum_def.h"
-
-
-CHAR RTMP_GetTxPwr(
- IN PRTMP_ADAPTER pAd,
- IN HTTRANSMIT_SETTING HTTxMode);
-
-/*
- ==========================================================================
- Description:
- Prepare Measurement request action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID MakeMeasurementReqFrame(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pOutBuffer,
- OUT PULONG pFrameLen,
- IN UINT8 TotalLen,
- IN UINT8 Category,
- IN UINT8 Action,
- IN UINT8 MeasureToken,
- IN UINT8 MeasureReqMode,
- IN UINT8 MeasureReqType,
- IN UINT8 NumOfRepetitions);
-
-/*
- ==========================================================================
- Description:
- Prepare Measurement report action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueMeasurementRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 DialogToken,
- IN UINT8 MeasureToken,
- IN UINT8 MeasureReqMode,
- IN UINT8 MeasureReqType,
- IN UINT8 ReportInfoLen,
- IN PUINT8 pReportInfo);
-
-/*
- ==========================================================================
- Description:
- Prepare TPC Request action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueTPCReq(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UCHAR DialogToken);
-
-/*
- ==========================================================================
- Description:
- Prepare TPC Report action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueTPCRep(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 DialogToken,
- IN UINT8 TxPwr,
- IN UINT8 LinkMargin);
-
-/*
- ==========================================================================
- Description:
- Prepare Channel Switch Announcement action frame and enqueue it into
- management queue waiting for transmition.
-
- Parametrs:
- 1. the destination mac address of the frame.
- 2. Channel switch announcement mode.
- 2. a New selected channel.
-
- Return : None.
- ==========================================================================
- */
-VOID EnqueueChSwAnn(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN UINT8 ChSwMode,
- IN UINT8 NewCh);
-
-/*
- ==========================================================================
- Description:
- Spectrun action frames Handler such as channel switch annoucement,
- measurement report, measurement request actions frames.
-
- Parametrs:
- Elme - MLME message containing the received frame
-
- Return : None.
- ==========================================================================
- */
-VOID PeerSpectrumAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem);
-
-/*
- ==========================================================================
- Description:
-
- Parametrs:
-
- Return : None.
- ==========================================================================
- */
-INT Set_MeasureReq_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_TpcReq_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_PwrConstraint(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-
-VOID MeasureReqTabInit(
- IN PRTMP_ADAPTER pAd);
-
-VOID MeasureReqTabExit(
- IN PRTMP_ADAPTER pAd);
-
-PMEASURE_REQ_ENTRY MeasureReqLookUp(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken);
-
-PMEASURE_REQ_ENTRY MeasureReqInsert(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken);
-
-VOID MeasureReqDelete(
- IN PRTMP_ADAPTER pAd,
- IN UINT8 DialogToken);
-
-VOID InsertChannelRepIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN PSTRING pCountry,
- IN UINT8 RegulatoryClass);
-
-VOID InsertTpcReportIE(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 TxPwr,
- IN UINT8 LinkMargin);
-
-VOID InsertDialogToken(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN UINT8 DialogToken);
-
-VOID TpcReqTabInit(
- IN PRTMP_ADAPTER pAd);
-
-VOID TpcReqTabExit(
- IN PRTMP_ADAPTER pAd);
-
-VOID NotifyChSwAnnToPeerAPs(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pRA,
- IN PUCHAR pTA,
- IN UINT8 ChSwMode,
- IN UINT8 Channel);
-
-VOID RguClass_BuildBcnChList(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pBuf,
- OUT PULONG pBufLen);
-#endif // __SPECTRUM_H__ //
diff --git a/drivers/staging/rt3090/spectrum_def.h b/drivers/staging/rt3090/spectrum_def.h
deleted file mode 100644
index 0389b0921486..000000000000
--- a/drivers/staging/rt3090/spectrum_def.h
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- spectrum_def.h
-
- Abstract:
- Handle association related requests either from WSTA or from local MLME
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- Fonchi Wu 2008 created for 802.11h
- */
-
-#ifndef __SPECTRUM_DEF_H__
-#define __SPECTRUM_DEF_H__
-
-
-#define MAX_MEASURE_REQ_TAB_SIZE 32
-#define MAX_HASH_MEASURE_REQ_TAB_SIZE MAX_MEASURE_REQ_TAB_SIZE
-
-#define MAX_TPC_REQ_TAB_SIZE 32
-#define MAX_HASH_TPC_REQ_TAB_SIZE MAX_TPC_REQ_TAB_SIZE
-
-#define MIN_RCV_PWR 100 /* Negative value ((dBm) */
-
-#define TPC_REQ_AGE_OUT 500 /* ms */
-#define MQ_REQ_AGE_OUT 500 /* ms */
-
-#define TPC_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_HASH_TPC_REQ_TAB_SIZE)
-#define MQ_DIALOGTOKEN_HASH_INDEX(_DialogToken) ((_DialogToken) % MAX_MEASURE_REQ_TAB_SIZE)
-
-typedef struct _MEASURE_REQ_ENTRY
-{
- struct _MEASURE_REQ_ENTRY *pNext;
- ULONG lastTime;
- BOOLEAN Valid;
- UINT8 DialogToken;
- UINT8 MeasureDialogToken[3]; // 0:basic measure, 1: CCA measure, 2: RPI_Histogram measure.
-} MEASURE_REQ_ENTRY, *PMEASURE_REQ_ENTRY;
-
-typedef struct _MEASURE_REQ_TAB
-{
- UCHAR Size;
- PMEASURE_REQ_ENTRY Hash[MAX_HASH_MEASURE_REQ_TAB_SIZE];
- MEASURE_REQ_ENTRY Content[MAX_MEASURE_REQ_TAB_SIZE];
-} MEASURE_REQ_TAB, *PMEASURE_REQ_TAB;
-
-typedef struct _TPC_REQ_ENTRY
-{
- struct _TPC_REQ_ENTRY *pNext;
- ULONG lastTime;
- BOOLEAN Valid;
- UINT8 DialogToken;
-} TPC_REQ_ENTRY, *PTPC_REQ_ENTRY;
-
-typedef struct _TPC_REQ_TAB
-{
- UCHAR Size;
- PTPC_REQ_ENTRY Hash[MAX_HASH_TPC_REQ_TAB_SIZE];
- TPC_REQ_ENTRY Content[MAX_TPC_REQ_TAB_SIZE];
-} TPC_REQ_TAB, *PTPC_REQ_TAB;
-
-
-/* The regulatory information */
-typedef struct _DOT11_CHANNEL_SET
-{
- UCHAR NumberOfChannels;
- UINT8 MaxTxPwr;
- UCHAR ChannelList[16];
-} DOT11_CHANNEL_SET, *PDOT11_CHANNEL_SET;
-
-typedef struct _DOT11_REGULATORY_INFORMATION
-{
- UCHAR RegulatoryClass;
- DOT11_CHANNEL_SET ChannelSet;
-} DOT11_REGULATORY_INFORMATION, *PDOT11_REGULATORY_INFORMATION;
-
-
-
-#define RM_TPC_REQ 0
-#define RM_MEASURE_REQ 1
-
-#define RM_BASIC 0
-#define RM_CCA 1
-#define RM_RPI_HISTOGRAM 2
-#define RM_CH_LOAD 3
-#define RM_NOISE_HISTOGRAM 4
-
-
-typedef struct PACKED _TPC_REPORT_INFO
-{
- UINT8 TxPwr;
- UINT8 LinkMargin;
-} TPC_REPORT_INFO, *PTPC_REPORT_INFO;
-
-typedef struct PACKED _CH_SW_ANN_INFO
-{
- UINT8 ChSwMode;
- UINT8 Channel;
- UINT8 ChSwCnt;
-} CH_SW_ANN_INFO, *PCH_SW_ANN_INFO;
-
-typedef union PACKED _MEASURE_REQ_MODE
-{
-#ifdef RT_BIG_ENDIAN
- struct PACKED
- {
-
- UINT8 :3;
- UINT8 DurationMandatory:1;
- UINT8 Report:1;
- UINT8 Request:1;
- UINT8 Enable:1;
- UINT8 Parallel:1;
- } field;
-#else
- struct PACKED
- {
- UINT8 Parallel:1;
- UINT8 Enable:1;
- UINT8 Request:1;
- UINT8 Report:1;
- UINT8 DurationMandatory:1;
- UINT8 :3;
- } field;
-#endif // RT_BIG_ENDIAN //
- UINT8 word;
-} MEASURE_REQ_MODE, *PMEASURE_REQ_MODE;
-
-typedef struct PACKED _MEASURE_REQ
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
-} MEASURE_REQ, *PMEASURE_REQ;
-
-typedef struct PACKED _MEASURE_REQ_INFO
-{
- UINT8 Token;
- MEASURE_REQ_MODE ReqMode;
- UINT8 ReqType;
- UINT8 Oct[0];
-} MEASURE_REQ_INFO, *PMEASURE_REQ_INFO;
-
-typedef union PACKED _MEASURE_BASIC_REPORT_MAP
-{
-#ifdef RT_BIG_ENDIAN
- struct PACKED
- {
- UINT8 Rev:3;
-
- UINT8 Unmeasure:1;
- UINT8 Radar:1;
- UINT8 UnidentifiedSignal:1;
- UINT8 OfdmPreamble:1;
- UINT8 BSS:1;
- } field;
-#else
- struct PACKED
- {
- UINT8 BSS:1;
-
- UINT8 OfdmPreamble:1;
- UINT8 UnidentifiedSignal:1;
- UINT8 Radar:1;
- UINT8 Unmeasure:1;
- UINT8 Rev:3;
- } field;
-#endif // RT_BIG_ENDIAN //
- UINT8 word;
-} MEASURE_BASIC_REPORT_MAP, *PMEASURE_BASIC_REPORT_MAP;
-
-typedef struct PACKED _MEASURE_BASIC_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- MEASURE_BASIC_REPORT_MAP Map;
-} MEASURE_BASIC_REPORT, *PMEASURE_BASIC_REPORT;
-
-typedef struct PACKED _MEASURE_CCA_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- UINT8 CCA_Busy_Fraction;
-} MEASURE_CCA_REPORT, *PMEASURE_CCA_REPORT;
-
-typedef struct PACKED _MEASURE_RPI_REPORT
-{
- UINT8 ChNum;
- UINT64 MeasureStartTime;
- UINT16 MeasureDuration;
- UINT8 RPI_Density[8];
-} MEASURE_RPI_REPORT, *PMEASURE_RPI_REPORT;
-
-typedef union PACKED _MEASURE_REPORT_MODE
-{
- struct PACKED
- {
-#ifdef RT_BIG_ENDIAN
- UINT8 Rev:5;
- UINT8 Refused:1;
- UINT8 Incapable:1;
- UINT8 Late:1;
-#else
- UINT8 Late:1;
- UINT8 Incapable:1;
- UINT8 Refused:1;
- UINT8 Rev:5;
-#endif // RT_BIG_ENDIAN //
- } field;
- UINT8 word;
-} MEASURE_REPORT_MODE, *PMEASURE_REPORT_MODE;
-
-typedef struct PACKED _MEASURE_REPORT_INFO
-{
- UINT8 Token;
- UINT8 ReportMode;
- UINT8 ReportType;
- UINT8 Octect[0];
-} MEASURE_REPORT_INFO, *PMEASURE_REPORT_INFO;
-
-typedef struct PACKED _QUIET_INFO
-{
- UINT8 QuietCnt;
- UINT8 QuietPeriod;
- UINT16 QuietDuration;
- UINT16 QuietOffset;
-} QUIET_INFO, *PQUIET_INFO;
-
-#endif // __SPECTRUM_DEF_H__ //
diff --git a/drivers/staging/rt3090/sta/assoc.c b/drivers/staging/rt3090/sta/assoc.c
deleted file mode 100644
index 012ed2b06083..000000000000
--- a/drivers/staging/rt3090/sta/assoc.c
+++ /dev/null
@@ -1,1673 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- assoc.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John 2004-9-3 porting from RT2500
-*/
-
-#include "../rt_config.h"
-
-
-UCHAR CipherWpaTemplate[] = {
- 0xdd, // WPA IE
- 0x16, // Length
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x02, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x02, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x01 // authentication
- };
-
-UCHAR CipherWpa2Template[] = {
- 0x30, // RSN IE
- 0x14, // Length
- 0x01, 0x00, // Version
- 0x00, 0x0f, 0xac, 0x02, // group cipher, TKIP
- 0x01, 0x00, // number of pairwise
- 0x00, 0x0f, 0xac, 0x02, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x0f, 0xac, 0x02, // authentication
- 0x00, 0x00, // RSN capability
- };
-
-UCHAR Ccx2IeInfo[] = { 0x00, 0x40, 0x96, 0x03, 0x02};
-
-/*
- ==========================================================================
- Description:
- association state machine init, including state transition and timer init
- Parameters:
- S - pointer to the association state machine
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-VOID AssocStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(S, Trans, MAX_ASSOC_STATE, MAX_ASSOC_MSG, (STATE_MACHINE_FUNC)Drop, ASSOC_IDLE, ASSOC_MACHINE_BASE);
-
- // first column
- StateMachineSetAction(S, ASSOC_IDLE, MT2_MLME_ASSOC_REQ, (STATE_MACHINE_FUNC)MlmeAssocReqAction);
- StateMachineSetAction(S, ASSOC_IDLE, MT2_MLME_REASSOC_REQ, (STATE_MACHINE_FUNC)MlmeReassocReqAction);
- StateMachineSetAction(S, ASSOC_IDLE, MT2_MLME_DISASSOC_REQ, (STATE_MACHINE_FUNC)MlmeDisassocReqAction);
- StateMachineSetAction(S, ASSOC_IDLE, MT2_PEER_DISASSOC_REQ, (STATE_MACHINE_FUNC)PeerDisassocAction);
-
- // second column
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenAssoc);
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenReassoc);
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_MLME_DISASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenDisassociate);
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_PEER_DISASSOC_REQ, (STATE_MACHINE_FUNC)PeerDisassocAction);
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_PEER_ASSOC_RSP, (STATE_MACHINE_FUNC)PeerAssocRspAction);
- //
- // Patch 3Com AP MOde:3CRWE454G72
- // We send Assoc request frame to this AP, it always send Reassoc Rsp not Associate Rsp.
- //
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_PEER_REASSOC_RSP, (STATE_MACHINE_FUNC)PeerAssocRspAction);
- StateMachineSetAction(S, ASSOC_WAIT_RSP, MT2_ASSOC_TIMEOUT, (STATE_MACHINE_FUNC)AssocTimeoutAction);
-
- // third column
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenAssoc);
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenReassoc);
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_MLME_DISASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenDisassociate);
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_PEER_DISASSOC_REQ, (STATE_MACHINE_FUNC)PeerDisassocAction);
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_PEER_REASSOC_RSP, (STATE_MACHINE_FUNC)PeerReassocRspAction);
- //
- // Patch, AP doesn't send Reassociate Rsp frame to Station.
- //
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_PEER_ASSOC_RSP, (STATE_MACHINE_FUNC)PeerReassocRspAction);
- StateMachineSetAction(S, REASSOC_WAIT_RSP, MT2_REASSOC_TIMEOUT, (STATE_MACHINE_FUNC)ReassocTimeoutAction);
-
- // fourth column
- StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_MLME_ASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenAssoc);
- StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_MLME_REASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenReassoc);
- StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_MLME_DISASSOC_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenDisassociate);
- StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_PEER_DISASSOC_REQ, (STATE_MACHINE_FUNC)PeerDisassocAction);
- StateMachineSetAction(S, DISASSOC_WAIT_RSP, MT2_DISASSOC_TIMEOUT, (STATE_MACHINE_FUNC)DisassocTimeoutAction);
-
- // initialize the timer
- RTMPInitTimer(pAd, &pAd->MlmeAux.AssocTimer, GET_TIMER_FUNCTION(AssocTimeout), pAd, FALSE);
- RTMPInitTimer(pAd, &pAd->MlmeAux.ReassocTimer, GET_TIMER_FUNCTION(ReassocTimeout), pAd, FALSE);
- RTMPInitTimer(pAd, &pAd->MlmeAux.DisassocTimer, GET_TIMER_FUNCTION(DisassocTimeout), pAd, FALSE);
-}
-
-/*
- ==========================================================================
- Description:
- Association timeout procedure. After association timeout, this function
- will be called and it will put a message into the MLME queue
- Parameters:
- Standard timer parameters
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AssocTimeout(IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_ASSOC_TIMEOUT, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
-}
-
-/*
- ==========================================================================
- Description:
- Reassociation timeout procedure. After reassociation timeout, this
- function will be called and put a message into the MLME queue
- Parameters:
- Standard timer parameters
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID ReassocTimeout(IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_REASSOC_TIMEOUT, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
-}
-
-/*
- ==========================================================================
- Description:
- Disassociation timeout procedure. After disassociation timeout, this
- function will be called and put a message into the MLME queue
- Parameters:
- Standard timer parameters
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID DisassocTimeout(IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_DISASSOC_TIMEOUT, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
-}
-
-/*
- ==========================================================================
- Description:
- mlme assoc req handling procedure
- Parameters:
- Adapter - Adapter pointer
- Elem - MLME Queue Element
- Pre:
- the station has been authenticated and the following information is stored in the config
- -# SSID
- -# supported rates and their length
- -# listen interval (Adapter->StaCfg.default_listen_count)
- -# Transmit power (Adapter->StaCfg.tx_power)
- Post :
- -# An association request frame is generated and sent to the air
- -# Association timer starts
- -# Association state -> ASSOC_WAIT_RSP
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeAssocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR ApAddr[6];
- HEADER_802_11 AssocHdr;
- UCHAR WmeIe[9] = {IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
- USHORT ListenIntv;
- ULONG Timeout;
- USHORT CapabilityInfo;
- BOOLEAN TimerCancelled;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- ULONG tmp;
- USHORT VarIesOffset;
- USHORT Status;
-
- // Block all authentication request durning WPA block period
- if (pAd->StaCfg.bBlockAssoc == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Block Assoc request durning WPA block period!\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
- }
- // check sanity first
- else if (MlmeAssocReqSanity(pAd, Elem->Msg, Elem->MsgLen, ApAddr, &CapabilityInfo, &Timeout, &ListenIntv))
- {
- RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &TimerCancelled);
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, ApAddr);
-
- // Get an unused nonpaged memory
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("ASSOC - MlmeAssocReqAction() allocate memory failed \n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
- return;
- }
-
- // Add by James 03/06/27
- pAd->StaCfg.AssocInfo.Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
- // Association don't need to report MAC address
- pAd->StaCfg.AssocInfo.AvailableRequestFixedIEs =
- NDIS_802_11_AI_REQFI_CAPABILITIES | NDIS_802_11_AI_REQFI_LISTENINTERVAL;
- pAd->StaCfg.AssocInfo.RequestFixedIEs.Capabilities = CapabilityInfo;
- pAd->StaCfg.AssocInfo.RequestFixedIEs.ListenInterval = ListenIntv;
- // Only reassociate need this
- //COPY_MAC_ADDR(pAd->StaCfg.AssocInfo.RequestFixedIEs.CurrentAPAddress, ApAddr);
- pAd->StaCfg.AssocInfo.OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
-
- NdisZeroMemory(pAd->StaCfg.ReqVarIEs, MAX_VIE_LEN);
- // First add SSID
- VarIesOffset = 0;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &SsidIe, 1);
- VarIesOffset += 1;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &pAd->MlmeAux.SsidLen, 1);
- VarIesOffset += 1;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- VarIesOffset += pAd->MlmeAux.SsidLen;
-
- // Second add Supported rates
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &SupRateIe, 1);
- VarIesOffset += 1;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &pAd->MlmeAux.SupRateLen, 1);
- VarIesOffset += 1;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, pAd->MlmeAux.SupRate, pAd->MlmeAux.SupRateLen);
- VarIesOffset += pAd->MlmeAux.SupRateLen;
- // End Add by James
-
- if ((pAd->CommonCfg.Channel > 14) &&
- (pAd->CommonCfg.bIEEE80211H == TRUE))
- CapabilityInfo |= 0x0100;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Send ASSOC request...\n"));
- MgtMacHeaderInit(pAd, &AssocHdr, SUBTYPE_ASSOC_REQ, 0, ApAddr, ApAddr);
-
- // Build basic frame first
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &AssocHdr,
- 2, &CapabilityInfo,
- 2, &ListenIntv,
- 1, &SsidIe,
- 1, &pAd->MlmeAux.SsidLen,
- pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid,
- 1, &SupRateIe,
- 1, &pAd->MlmeAux.SupRateLen,
- pAd->MlmeAux.SupRateLen, pAd->MlmeAux.SupRate,
- END_OF_ARGS);
-
- if (pAd->MlmeAux.ExtRateLen != 0)
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &ExtRateIe,
- 1, &pAd->MlmeAux.ExtRateLen,
- pAd->MlmeAux.ExtRateLen, pAd->MlmeAux.ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-
-#ifdef DOT11_N_SUPPORT
- // HT
- if ((pAd->MlmeAux.HtCapabilityLen > 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- ULONG TmpLen;
- UCHAR HtLen;
- UCHAR BROADCOM[4] = {0x0, 0x90, 0x4c, 0x33};
- if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE)
- {
- HtLen = SIZE_HT_CAP_IE + 4;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &WpaIe,
- 1, &HtLen,
- 4, &BROADCOM[0],
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
- }
- else
- {
-#ifdef RT_BIG_ENDIAN
- HT_CAPABILITY_IE HtCapabilityTmp;
-#endif
-
-#ifndef RT_BIG_ENDIAN
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &pAd->MlmeAux.HtCapabilityLen,
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
-#else
- NdisZeroMemory(&HtCapabilityTmp, sizeof(HT_CAPABILITY_IE));
- NdisMoveMemory(&HtCapabilityTmp, &pAd->MlmeAux.HtCapability, pAd->MlmeAux.HtCapabilityLen);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &pAd->MlmeAux.HtCapabilityLen,
- pAd->MlmeAux.HtCapabilityLen,&HtCapabilityTmp,
- END_OF_ARGS);
-#endif
- }
- FrameLen += TmpLen;
- }
-#endif // DOT11_N_SUPPORT //
-
- // add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION
- // Case I: (Aggregation + Piggy-Back)
- // 1. user enable aggregation, AND
- // 2. Mac support piggy-back
- // 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON
- // Case II: (Aggregation)
- // 1. user enable aggregation, AND
- // 2. AP annouces it's AGGREGATION-capable in BEACON
- if (pAd->CommonCfg.bAggregationCapable)
- {
- if ((pAd->CommonCfg.bPiggyBackCapable) && ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3))
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x03, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
- else if (pAd->MlmeAux.APRalinkIe & 0x00000001)
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x01, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
- }
- else
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x06, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
-
- if (pAd->MlmeAux.APEdcaParm.bValid)
- {
- if (pAd->CommonCfg.bAPSDCapable && pAd->MlmeAux.APEdcaParm.bAPSDCapable)
- {
- QBSS_STA_INFO_PARM QosInfo;
-
- NdisZeroMemory(&QosInfo, sizeof(QBSS_STA_INFO_PARM));
- QosInfo.UAPSD_AC_BE = pAd->CommonCfg.bAPSDAC_BE;
- QosInfo.UAPSD_AC_BK = pAd->CommonCfg.bAPSDAC_BK;
- QosInfo.UAPSD_AC_VI = pAd->CommonCfg.bAPSDAC_VI;
- QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
- QosInfo.MaxSPLength = pAd->CommonCfg.MaxSPLength;
- WmeIe[8] |= *(PUCHAR)&QosInfo;
- }
- else
- {
- // The Parameter Set Count is set to ��0�� in the association request frames
- // WmeIe[8] |= (pAd->MlmeAux.APEdcaParm.EdcaUpdateCount & 0x0f);
- }
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 9, &WmeIe[0],
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
- //
- // Let WPA(#221) Element ID on the end of this association frame.
- // Otherwise some AP will fail on parsing Element ID and set status fail on Assoc Rsp.
- // For example: Put Vendor Specific IE on the front of WPA IE.
- // This happens on AP (Model No:Linksys WRK54G)
- //
- if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
- )
- )
- {
- UCHAR RSNIe = IE_WPA;
-
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2))
- {
- RSNIe = IE_WPA2;
- }
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-#ifdef SIOCSIWGENIE
- if ((pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE) &&
- (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == FALSE))
-#endif // SIOCSIWGENIE //
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0);
-
- // Check for WPA PMK cache list
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2)
- {
- INT idx;
- BOOLEAN FoundPMK = FALSE;
- // Search chched PMKID, append it if existed
- for (idx = 0; idx < PMKID_NO; idx++)
- {
- if (NdisEqualMemory(ApAddr, &pAd->StaCfg.SavedPMK[idx].BSSID, 6))
- {
- FoundPMK = TRUE;
- break;
- }
- }
-
- if (FoundPMK)
- {
- // Set PMK number
- *(PUSHORT) &pAd->StaCfg.RSN_IE[pAd->StaCfg.RSNIE_Len] = 1;
- NdisMoveMemory(&pAd->StaCfg.RSN_IE[pAd->StaCfg.RSNIE_Len + 2], &pAd->StaCfg.SavedPMK[idx].PMKID, 16);
- pAd->StaCfg.RSNIE_Len += 18;
- }
- }
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-#ifdef SIOCSIWGENIE
- if ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) &&
- (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == TRUE))
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
- END_OF_ARGS);
- }
- else
-#endif
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &RSNIe,
- 1, &pAd->StaCfg.RSNIE_Len,
- pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
- END_OF_ARGS);
- }
-
- FrameLen += tmp;
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-#ifdef SIOCSIWGENIE
- if ((pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE) ||
- (pAd->StaCfg.bRSN_IE_FromWpaSupplicant == FALSE))
-#endif
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- {
- // Append Variable IE
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &RSNIe, 1);
- VarIesOffset += 1;
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, &pAd->StaCfg.RSNIE_Len, 1);
- VarIesOffset += 1;
- }
- NdisMoveMemory(pAd->StaCfg.ReqVarIEs + VarIesOffset, pAd->StaCfg.RSN_IE, pAd->StaCfg.RSNIE_Len);
- VarIesOffset += pAd->StaCfg.RSNIE_Len;
-
- // Set Variable IEs Length
- pAd->StaCfg.ReqVarIELen = VarIesOffset;
- }
-
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- RTMPSetTimer(&pAd->MlmeAux.AssocTimer, Timeout);
- pAd->Mlme.AssocMachine.CurrState = ASSOC_WAIT_RSP;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("ASSOC - MlmeAssocReqAction() sanity check failed. BUG!!!!!! \n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_INVALID_FORMAT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
- }
-
-}
-
-/*
- ==========================================================================
- Description:
- mlme reassoc req handling procedure
- Parameters:
- Elem -
- Pre:
- -# SSID (Adapter->StaCfg.ssid[])
- -# BSSID (AP address, Adapter->StaCfg.bssid)
- -# Supported rates (Adapter->StaCfg.supported_rates[])
- -# Supported rates length (Adapter->StaCfg.supported_rates_len)
- -# Tx power (Adapter->StaCfg.tx_power)
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeReassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR ApAddr[6];
- HEADER_802_11 ReassocHdr;
- UCHAR WmeIe[9] = {IE_VENDOR_SPECIFIC, 0x07, 0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
- USHORT CapabilityInfo, ListenIntv;
- ULONG Timeout;
- ULONG FrameLen = 0;
- BOOLEAN TimerCancelled;
- NDIS_STATUS NStatus;
- ULONG tmp;
- PUCHAR pOutBuffer = NULL;
- USHORT Status;
-
- // Block all authentication request durning WPA block period
- if (pAd->StaCfg.bBlockAssoc == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Block ReAssoc request durning WPA block period!\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
- }
- // the parameters are the same as the association
- else if(MlmeAssocReqSanity(pAd, Elem->Msg, Elem->MsgLen, ApAddr, &CapabilityInfo, &Timeout, &ListenIntv))
- {
- RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer, &TimerCancelled);
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE,("ASSOC - MlmeReassocReqAction() allocate memory failed \n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
- return;
- }
-
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, ApAddr);
-
- // make frame, use bssid as the AP address??
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Send RE-ASSOC request...\n"));
- MgtMacHeaderInit(pAd, &ReassocHdr, SUBTYPE_REASSOC_REQ, 0, ApAddr, ApAddr);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &ReassocHdr,
- 2, &CapabilityInfo,
- 2, &ListenIntv,
- MAC_ADDR_LEN, ApAddr,
- 1, &SsidIe,
- 1, &pAd->MlmeAux.SsidLen,
- pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid,
- 1, &SupRateIe,
- 1, &pAd->MlmeAux.SupRateLen,
- pAd->MlmeAux.SupRateLen, pAd->MlmeAux.SupRate,
- END_OF_ARGS);
-
- if (pAd->MlmeAux.ExtRateLen != 0)
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &ExtRateIe,
- 1, &pAd->MlmeAux.ExtRateLen,
- pAd->MlmeAux.ExtRateLen, pAd->MlmeAux.ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-
- if (pAd->MlmeAux.APEdcaParm.bValid)
- {
- if (pAd->CommonCfg.bAPSDCapable && pAd->MlmeAux.APEdcaParm.bAPSDCapable)
- {
- QBSS_STA_INFO_PARM QosInfo;
-
- NdisZeroMemory(&QosInfo, sizeof(QBSS_STA_INFO_PARM));
- QosInfo.UAPSD_AC_BE = pAd->CommonCfg.bAPSDAC_BE;
- QosInfo.UAPSD_AC_BK = pAd->CommonCfg.bAPSDAC_BK;
- QosInfo.UAPSD_AC_VI = pAd->CommonCfg.bAPSDAC_VI;
- QosInfo.UAPSD_AC_VO = pAd->CommonCfg.bAPSDAC_VO;
- QosInfo.MaxSPLength = pAd->CommonCfg.MaxSPLength;
- WmeIe[8] |= *(PUCHAR)&QosInfo;
- }
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 9, &WmeIe[0],
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-#ifdef DOT11_N_SUPPORT
- // HT
- if ((pAd->MlmeAux.HtCapabilityLen > 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- ULONG TmpLen;
- UCHAR HtLen;
- UCHAR BROADCOM[4] = {0x0, 0x90, 0x4c, 0x33};
- if (pAd->StaActive.SupportedPhyInfo.bPreNHt == TRUE)
- {
- HtLen = SIZE_HT_CAP_IE + 4;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &WpaIe,
- 1, &HtLen,
- 4, &BROADCOM[0],
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
- }
- else
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &pAd->MlmeAux.HtCapabilityLen,
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
- }
- FrameLen += TmpLen;
- }
-#endif // DOT11_N_SUPPORT //
-
- // add Ralink proprietary IE to inform AP this STA is going to use AGGREGATION or PIGGY-BACK+AGGREGATION
- // Case I: (Aggregation + Piggy-Back)
- // 1. user enable aggregation, AND
- // 2. Mac support piggy-back
- // 3. AP annouces it's PIGGY-BACK+AGGREGATION-capable in BEACON
- // Case II: (Aggregation)
- // 1. user enable aggregation, AND
- // 2. AP annouces it's AGGREGATION-capable in BEACON
- if (pAd->CommonCfg.bAggregationCapable)
- {
- if ((pAd->CommonCfg.bPiggyBackCapable) && ((pAd->MlmeAux.APRalinkIe & 0x00000003) == 3))
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x03, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
- else if (pAd->MlmeAux.APRalinkIe & 0x00000001)
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x01, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
- }
- else
- {
- ULONG TmpLen;
- UCHAR RalinkIe[9] = {IE_VENDOR_SPECIFIC, 7, 0x00, 0x0c, 0x43, 0x04, 0x00, 0x00, 0x00};
- MakeOutgoingFrame(pOutBuffer+FrameLen, &TmpLen,
- 9, RalinkIe,
- END_OF_ARGS);
- FrameLen += TmpLen;
- }
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- RTMPSetTimer(&pAd->MlmeAux.ReassocTimer, Timeout); /* in mSec */
- pAd->Mlme.AssocMachine.CurrState = REASSOC_WAIT_RSP;
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("ASSOC - MlmeReassocReqAction() sanity check failed. BUG!!!! \n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_INVALID_FORMAT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
- }
-}
-
-/*
- ==========================================================================
- Description:
- Upper layer issues disassoc request
- Parameters:
- Elem -
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-VOID MlmeDisassocReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PMLME_DISASSOC_REQ_STRUCT pDisassocReq;
- HEADER_802_11 DisassocHdr;
- PHEADER_802_11 pDisassocHdr;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0;
- NDIS_STATUS NStatus;
- BOOLEAN TimerCancelled;
- ULONG Timeout = 500;
- USHORT Status;
-
-#ifdef QOS_DLS_SUPPORT
- // send DLS-TEAR_DOWN message,
- if (pAd->CommonCfg.bDLSCapable)
- {
- UCHAR i;
-
- // tear down local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- }
- }
-
- // tear down peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- }
- }
- }
-#endif // QOS_DLS_SUPPORT //
-
- // skip sanity check
- pDisassocReq = (PMLME_DISASSOC_REQ_STRUCT)(Elem->Msg);
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - MlmeDisassocReqAction() allocate memory failed\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DISASSOC_CONF, 2, &Status);
- return;
- }
-
-
-
-
- RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &TimerCancelled);
-
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Send DISASSOC request[BSSID::%02x:%02x:%02x:%02x:%02x:%02x (Reason=%d)\n",
- pDisassocReq->Addr[0], pDisassocReq->Addr[1], pDisassocReq->Addr[2],
- pDisassocReq->Addr[3], pDisassocReq->Addr[4], pDisassocReq->Addr[5], pDisassocReq->Reason));
- MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pDisassocReq->Addr, pDisassocReq->Addr); // patch peap ttls switching issue
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&DisassocHdr,
- 2, &pDisassocReq->Reason,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
-
- // To patch Instance and Buffalo(N) AP
- // Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine
- // Therefore, we send both of them.
- pDisassocHdr = (PHEADER_802_11)pOutBuffer;
- pDisassocHdr->FC.SubType = SUBTYPE_DEAUTH;
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
-
- MlmeFreeMemory(pAd, pOutBuffer);
-
- pAd->StaCfg.DisassocReason = REASON_DISASSOC_STA_LEAVING;
- COPY_MAC_ADDR(pAd->StaCfg.DisassocSta, pDisassocReq->Addr);
-
- RTMPSetTimer(&pAd->MlmeAux.DisassocTimer, Timeout); /* in mSec */
- pAd->Mlme.AssocMachine.CurrState = DISASSOC_WAIT_RSP;
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
- {
- //send disassociate event to wpa_supplicant
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_DISASSOC_EVENT_FLAG, NULL, NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-}
-
-/*
- ==========================================================================
- Description:
- peer sends assoc rsp back
- Parameters:
- Elme - MLME message containing the received frame
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerAssocRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT CapabilityInfo, Status, Aid;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
- UCHAR Addr2[MAC_ADDR_LEN];
- BOOLEAN TimerCancelled;
- UCHAR CkipFlag;
- EDCA_PARM EdcaParm;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen;
- UCHAR AddHtInfoLen;
- UCHAR NewExtChannelOffset = 0xff;
-
- if (PeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen,
- &HtCapability,&AddHtInfo, &HtCapabilityLen,&AddHtInfoLen,&NewExtChannelOffset, &EdcaParm, &CkipFlag))
- {
- // The frame is for me ?
- if(MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspAction():ASSOC - receive ASSOC_RSP to me (status=%d)\n", Status));
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspAction():MacTable [%d].AMsduSize = %d. ClientStatusFlags = 0x%lx \n",Elem->Wcid, pAd->MacTab.Content[BSSID_WCID].AMsduSize, pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
-#endif // DOT11_N_SUPPORT //
- RTMPCancelTimer(&pAd->MlmeAux.AssocTimer, &TimerCancelled);
-
-
- if(Status == MLME_SUCCESS)
- {
- UCHAR MaxSupportedRateIn500Kbps = 0;
- UCHAR idx;
-
- // supported rates array may not be sorted. sort it and find the maximum rate
- for (idx=0; idx<SupRateLen; idx++)
- {
- if (MaxSupportedRateIn500Kbps < (SupRate[idx] & 0x7f))
- MaxSupportedRateIn500Kbps = SupRate[idx] & 0x7f;
- }
-
- for (idx=0; idx<ExtRateLen; idx++)
- {
- if (MaxSupportedRateIn500Kbps < (ExtRate[idx] & 0x7f))
- MaxSupportedRateIn500Kbps = ExtRate[idx] & 0x7f;
- }
- // go to procedure listed on page 376
- AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen,
- &EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
-
- StaAddMacTableEntry(pAd,
- &pAd->MacTab.Content[BSSID_WCID],
- MaxSupportedRateIn500Kbps,
- &HtCapability,
- HtCapabilityLen,
- &AddHtInfo,
- AddHtInfoLen,
- CapabilityInfo);
- }
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerAssocRspAction() sanity check fail\n"));
- }
-}
-
-/*
- ==========================================================================
- Description:
- peer sends reassoc rsp
- Parametrs:
- Elem - MLME message cntaining the received frame
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerReassocRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT CapabilityInfo;
- USHORT Status;
- USHORT Aid;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], SupRateLen;
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRateLen;
- UCHAR Addr2[MAC_ADDR_LEN];
- UCHAR CkipFlag;
- BOOLEAN TimerCancelled;
- EDCA_PARM EdcaParm;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen;
- UCHAR AddHtInfoLen;
- UCHAR NewExtChannelOffset = 0xff;
-
- if(PeerAssocRspSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &CapabilityInfo, &Status, &Aid, SupRate, &SupRateLen, ExtRate, &ExtRateLen,
- &HtCapability, &AddHtInfo, &HtCapabilityLen, &AddHtInfoLen,&NewExtChannelOffset, &EdcaParm, &CkipFlag))
- {
- if(MAC_ADDR_EQUAL(Addr2, pAd->MlmeAux.Bssid)) // The frame is for me ?
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - receive REASSOC_RSP to me (status=%d)\n", Status));
- RTMPCancelTimer(&pAd->MlmeAux.ReassocTimer, &TimerCancelled);
-
- if(Status == MLME_SUCCESS)
- {
- // go to procedure listed on page 376
- AssocPostProc(pAd, Addr2, CapabilityInfo, Aid, SupRate, SupRateLen, ExtRate, ExtRateLen,
- &EdcaParm, &HtCapability, HtCapabilityLen, &AddHtInfo);
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
- {
- SendAssocIEsToWpaSupplicant(pAd);
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_ASSOC_EVENT_FLAG, NULL, NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- {
- wext_notify_event_assoc(pAd);
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, &pAd->MlmeAux.Bssid[0], NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
- }
-
- // CkipFlag is no use for reassociate
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerReassocRspAction() sanity check fail\n"));
- }
-
-}
-
-/*
- ==========================================================================
- Description:
- procedures on IEEE 802.11/1999 p.376
- Parametrs:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AssocPostProc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr2,
- IN USHORT CapabilityInfo,
- IN USHORT Aid,
- IN UCHAR SupRate[],
- IN UCHAR SupRateLen,
- IN UCHAR ExtRate[],
- IN UCHAR ExtRateLen,
- IN PEDCA_PARM pEdcaParm,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN ADD_HT_INFO_IE *pAddHtInfo) // AP might use this additional ht info IE
-{
- ULONG Idx;
-
- pAd->MlmeAux.BssType = BSS_INFRA;
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pAddr2);
- pAd->MlmeAux.Aid = Aid;
- pAd->MlmeAux.CapabilityInfo = CapabilityInfo & SUPPORTED_CAPABILITY_INFO;
-
-#ifdef DOT11_N_SUPPORT
- // Some HT AP might lost WMM IE. We add WMM ourselves. beacuase HT requires QoS on.
- if ((HtCapabilityLen > 0) && (pEdcaParm->bValid == FALSE))
- {
- pEdcaParm->bValid = TRUE;
- pEdcaParm->Aifsn[0] = 3;
- pEdcaParm->Aifsn[1] = 7;
- pEdcaParm->Aifsn[2] = 2;
- pEdcaParm->Aifsn[3] = 2;
-
- pEdcaParm->Cwmin[0] = 4;
- pEdcaParm->Cwmin[1] = 4;
- pEdcaParm->Cwmin[2] = 3;
- pEdcaParm->Cwmin[3] = 2;
-
- pEdcaParm->Cwmax[0] = 10;
- pEdcaParm->Cwmax[1] = 10;
- pEdcaParm->Cwmax[2] = 4;
- pEdcaParm->Cwmax[3] = 3;
-
- pEdcaParm->Txop[0] = 0;
- pEdcaParm->Txop[1] = 0;
- pEdcaParm->Txop[2] = 96;
- pEdcaParm->Txop[3] = 48;
-
- }
-#endif // DOT11_N_SUPPORT //
-
- NdisMoveMemory(&pAd->MlmeAux.APEdcaParm, pEdcaParm, sizeof(EDCA_PARM));
-
- // filter out un-supported rates
- pAd->MlmeAux.SupRateLen = SupRateLen;
- NdisMoveMemory(pAd->MlmeAux.SupRate, SupRate, SupRateLen);
- RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen);
-
- // filter out un-supported rates
- pAd->MlmeAux.ExtRateLen = ExtRateLen;
- NdisMoveMemory(pAd->MlmeAux.ExtRate, ExtRate, ExtRateLen);
- RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen);
-
-#ifdef DOT11_N_SUPPORT
- if (HtCapabilityLen > 0)
- {
- RTMPCheckHt(pAd, BSSID_WCID, pHtCapability, pAddHtInfo);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("AssocPostProc===> AP.AMsduSize = %d. ClientStatusFlags = 0x%lx \n", pAd->MacTab.Content[BSSID_WCID].AMsduSize, pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
-
- DBGPRINT(RT_DEBUG_TRACE, ("AssocPostProc===> (Mmps=%d, AmsduSize=%d, )\n",
- pAd->MacTab.Content[BSSID_WCID].MmpsMode, pAd->MacTab.Content[BSSID_WCID].AMsduSize));
-#endif // DOT11_N_SUPPORT //
-
- // Set New WPA information
- Idx = BssTableSearch(&pAd->ScanTab, pAddr2, pAd->MlmeAux.Channel);
- if (Idx == BSS_NOT_FOUND)
- {
- DBGPRINT_ERR(("ASSOC - Can't find BSS after receiving Assoc response\n"));
- }
- else
- {
- // Init variable
- pAd->MacTab.Content[BSSID_WCID].RSNIE_Len = 0;
- NdisZeroMemory(pAd->MacTab.Content[BSSID_WCID].RSN_IE, MAX_LEN_OF_RSNIE);
-
- // Store appropriate RSN_IE for WPA SM negotiation later
- if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) && (pAd->ScanTab.BssEntry[Idx].VarIELen != 0))
- {
- PUCHAR pVIE;
- USHORT len;
- PEID_STRUCT pEid;
-
- pVIE = pAd->ScanTab.BssEntry[Idx].VarIEs;
- len = pAd->ScanTab.BssEntry[Idx].VarIELen;
- //KH need to check again
- // Don't allow to go to sleep mode if authmode is WPA-related.
- //This can make Authentication process more smoothly.
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-
- while (len > 0)
- {
- pEid = (PEID_STRUCT) pVIE;
- // For WPA/WPAPSK
- if ((pEid->Eid == IE_WPA) && (NdisEqualMemory(pEid->Octet, WPA_OUI, 4))
- && (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA || pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].RSN_IE, pVIE, (pEid->Len + 2));
- pAd->MacTab.Content[BSSID_WCID].RSNIE_Len = (pEid->Len + 2);
- DBGPRINT(RT_DEBUG_TRACE, ("AssocPostProc===> Store RSN_IE for WPA SM negotiation \n"));
- }
- // For WPA2/WPA2PSK
- else if ((pEid->Eid == IE_RSN) && (NdisEqualMemory(pEid->Octet + 2, RSN_OUI, 3))
- && (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2 || pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- NdisMoveMemory(pAd->MacTab.Content[BSSID_WCID].RSN_IE, pVIE, (pEid->Len + 2));
- pAd->MacTab.Content[BSSID_WCID].RSNIE_Len = (pEid->Len + 2);
- DBGPRINT(RT_DEBUG_TRACE, ("AssocPostProc===> Store RSN_IE for WPA2 SM negotiation \n"));
- }
-
- pVIE += (pEid->Len + 2);
- len -= (pEid->Len + 2);
- }
-
-
- }
-
- if (pAd->MacTab.Content[BSSID_WCID].RSNIE_Len == 0)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AssocPostProc===> no RSN_IE \n"));
- }
- else
- {
- hex_dump("RSN_IE", pAd->MacTab.Content[BSSID_WCID].RSN_IE, pAd->MacTab.Content[BSSID_WCID].RSNIE_Len);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
- left part of IEEE 802.11/1999 p.374
- Parameters:
- Elem - MLME message containing the received frame
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerDisassocAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Addr2[MAC_ADDR_LEN];
- USHORT Reason;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction()\n"));
- if(PeerDisassocSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction() Reason = %d\n", Reason));
- if (INFRA_ON(pAd) && MAC_ADDR_EQUAL(pAd->CommonCfg.Bssid, Addr2))
- {
-
- if (pAd->CommonCfg.bWirelessEvent)
- {
- RTMPSendWirelessEvent(pAd, IW_DISASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
-
-
- LinkDown(pAd, TRUE);
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
- {
- //send disassociate event to wpa_supplicant
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_DISASSOC_EVENT_FLAG, NULL, NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - PeerDisassocAction() sanity check fail\n"));
- }
-
-}
-
-/*
- ==========================================================================
- Description:
- what the state machine will do after assoc timeout
- Parameters:
- Elme -
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AssocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - AssocTimeoutAction\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_REJ_TIMEOUT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- what the state machine will do after reassoc timeout
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID ReassocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - ReassocTimeoutAction\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_REJ_TIMEOUT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- what the state machine will do after disassoc timeout
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID DisassocTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - DisassocTimeoutAction\n"));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_SUCCESS;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DISASSOC_CONF, 2, &Status);
-}
-
-VOID InvalidStateWhenAssoc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenAssoc(state=%ld), reset ASSOC state machine\n",
- pAd->Mlme.AssocMachine.CurrState));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_ASSOC_CONF, 2, &Status);
-}
-
-VOID InvalidStateWhenReassoc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenReassoc(state=%ld), reset ASSOC state machine\n",
- pAd->Mlme.AssocMachine.CurrState));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_REASSOC_CONF, 2, &Status);
-}
-
-VOID InvalidStateWhenDisassociate(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - InvalidStateWhenDisassoc(state=%ld), reset ASSOC state machine\n",
- pAd->Mlme.AssocMachine.CurrState));
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DISASSOC_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- right part of IEEE 802.11/1999 page 374
- Note:
- This event should never cause ASSOC state machine perform state
- transition, and has no relationship with CNTL machine. So we separate
- this routine as a service outside of ASSOC state transition table.
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID Cls3errAction(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr)
-{
- HEADER_802_11 DisassocHdr;
- PHEADER_802_11 pDisassocHdr;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0;
- NDIS_STATUS NStatus;
- USHORT Reason = REASON_CLS3ERR;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- DBGPRINT(RT_DEBUG_TRACE, ("ASSOC - Class 3 Error, Send DISASSOC frame\n"));
- MgtMacHeaderInit(pAd, &DisassocHdr, SUBTYPE_DISASSOC, 0, pAddr, pAd->CommonCfg.Bssid); // patch peap ttls switching issue
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&DisassocHdr,
- 2, &Reason,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
-
- // To patch Instance and Buffalo(N) AP
- // Driver has to send deauth to Instance AP, but Buffalo(N) needs to send disassoc to reset Authenticator's state machine
- // Therefore, we send both of them.
- pDisassocHdr = (PHEADER_802_11)pOutBuffer;
- pDisassocHdr->FC.SubType = SUBTYPE_DEAUTH;
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
-
- MlmeFreeMemory(pAd, pOutBuffer);
-
- pAd->StaCfg.DisassocReason = REASON_CLS3ERR;
- COPY_MAC_ADDR(pAd->StaCfg.DisassocSta, pAddr);
-}
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
-VOID SendAssocIEsToWpaSupplicant(
- IN PRTMP_ADAPTER pAd)
-{
- STRING custom[IW_CUSTOM_MAX] = {0};
-
- if ((pAd->StaCfg.ReqVarIELen + 17) <= IW_CUSTOM_MAX)
- {
- sprintf(custom, "ASSOCINFO_ReqIEs=");
- NdisMoveMemory(custom+17, pAd->StaCfg.ReqVarIEs, pAd->StaCfg.ReqVarIELen);
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_REQIE_EVENT_FLAG, NULL, (PUCHAR)custom, pAd->StaCfg.ReqVarIELen + 17);
-
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_ASSOCINFO_EVENT_FLAG, NULL, NULL, 0);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("pAd->StaCfg.ReqVarIELen + 17 > MAX_CUSTOM_LEN\n"));
-
- return;
-}
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-int wext_notify_event_assoc(
- IN RTMP_ADAPTER *pAd)
-{
- char custom[IW_CUSTOM_MAX] = {0};
-
-#if WIRELESS_EXT > 17
- if (pAd->StaCfg.ReqVarIELen <= IW_CUSTOM_MAX)
- {
- NdisMoveMemory(custom, pAd->StaCfg.ReqVarIEs, pAd->StaCfg.ReqVarIELen);
- RtmpOSWrielessEventSend(pAd, IWEVASSOCREQIE, -1, NULL, custom, pAd->StaCfg.ReqVarIELen);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("pAd->StaCfg.ReqVarIELen > MAX_CUSTOM_LEN\n"));
-#else
- int len;
-
- len = (pAd->StaCfg.ReqVarIELen*2) + 17;
- if (len <= IW_CUSTOM_MAX)
- {
- UCHAR idx;
- sprintf(custom, "ASSOCINFO(ReqIEs=");
- for (idx=0; idx<pAd->StaCfg.ReqVarIELen; idx++)
- sprintf(custom, "%s%02x", custom, pAd->StaCfg.ReqVarIEs[idx]);
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, custom, len);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("len(%d) > MAX_CUSTOM_LEN\n", len));
-#endif
-
- return 0;
-
-}
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-
-BOOLEAN StaAddMacTableEntry(
- IN PRTMP_ADAPTER pAd,
- IN PMAC_TABLE_ENTRY pEntry,
- IN UCHAR MaxSupportedRateIn500Kbps,
- IN HT_CAPABILITY_IE *pHtCapability,
- IN UCHAR HtCapabilityLen,
- IN ADD_HT_INFO_IE *pAddHtInfo,
- IN UCHAR AddHtInfoLen,
- IN USHORT CapabilityInfo)
-{
- UCHAR MaxSupportedRate = RATE_11;
-
- if (ADHOC_ON(pAd))
- CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
-
- switch (MaxSupportedRateIn500Kbps)
- {
- case 108: MaxSupportedRate = RATE_54; break;
- case 96: MaxSupportedRate = RATE_48; break;
- case 72: MaxSupportedRate = RATE_36; break;
- case 48: MaxSupportedRate = RATE_24; break;
- case 36: MaxSupportedRate = RATE_18; break;
- case 24: MaxSupportedRate = RATE_12; break;
- case 18: MaxSupportedRate = RATE_9; break;
- case 12: MaxSupportedRate = RATE_6; break;
- case 22: MaxSupportedRate = RATE_11; break;
- case 11: MaxSupportedRate = RATE_5_5; break;
- case 4: MaxSupportedRate = RATE_2; break;
- case 2: MaxSupportedRate = RATE_1; break;
- default: MaxSupportedRate = RATE_11; break;
- }
-
- if ((pAd->CommonCfg.PhyMode == PHY_11G) && (MaxSupportedRate < RATE_FIRST_OFDM_RATE))
- return FALSE;
-
-#ifdef DOT11_N_SUPPORT
- // 11n only
- if (((pAd->CommonCfg.PhyMode == PHY_11N_2_4G) || (pAd->CommonCfg.PhyMode == PHY_11N_5G))&& (HtCapabilityLen == 0))
- return FALSE;
-#endif // DOT11_N_SUPPORT //
-
- if (!pEntry)
- return FALSE;
-
- NdisAcquireSpinLock(&pAd->MacTabLock);
- if (pEntry)
- {
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- if ((MaxSupportedRate < RATE_FIRST_OFDM_RATE) ||
- (pAd->CommonCfg.PhyMode == PHY_11B))
- {
- pEntry->RateLen = 4;
- if (MaxSupportedRate >= RATE_FIRST_OFDM_RATE)
- MaxSupportedRate = RATE_11;
- }
- else
- pEntry->RateLen = 12;
-
- pEntry->MaxHTPhyMode.word = 0;
- pEntry->MinHTPhyMode.word = 0;
- pEntry->HTPhyMode.word = 0;
- pEntry->MaxSupportedRate = MaxSupportedRate;
- if (pEntry->MaxSupportedRate < RATE_FIRST_OFDM_RATE)
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MaxHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->MinHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MinHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->HTPhyMode.field.MODE = MODE_CCK;
- pEntry->HTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MaxHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->MinHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MinHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->HTPhyMode.field.MODE = MODE_OFDM;
- pEntry->HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- }
- pEntry->CapabilityInfo = CapabilityInfo;
- CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE);
- CLIENT_STATUS_CLEAR_FLAG(pEntry, fCLIENT_STATUS_PIGGYBACK_CAPABLE);
- }
-
-#ifdef DOT11_N_SUPPORT
- NdisZeroMemory(&pEntry->HTCapability, sizeof(pEntry->HTCapability));
- // If this Entry supports 802.11n, upgrade to HT rate.
- if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR j, bitmask; //k,bitmask;
- CHAR i;
-
- if (ADHOC_ON(pAd))
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
- if ((pHtCapability->HtCapInfo.GF) && (pAd->CommonCfg.DesiredHtPhy.GF))
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTGREENFIELD;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pAd->MacTab.fAnyStationNonGF = TRUE;
- pAd->CommonCfg.AddHTInfo.AddHtInfo2.NonGfPresent = 1;
- }
-
- if ((pHtCapability->HtCapInfo.ChannelWidth) &&
- (pAd->CommonCfg.DesiredHtPhy.ChannelWidth) &&
- ((pAd->StaCfg.BssType == BSS_INFRA) || ((pAd->StaCfg.BssType == BSS_ADHOC) && (pAddHtInfo->AddHtInfo.ExtChanOffset == pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset))))
- {
- pEntry->MaxHTPhyMode.field.BW= BW_40;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor40)&(pHtCapability->HtCapInfo.ShortGIfor40));
- }
- else
- {
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor20)&(pHtCapability->HtCapInfo.ShortGIfor20));
- pAd->MacTab.fAnyStation20Only = TRUE;
- }
-
- // 3*3
- if (pAd->MACVersion >= RALINK_2883_VERSION && pAd->MACVersion < RALINK_3070_VERSION)
- pEntry->MaxHTPhyMode.field.TxBF = pAd->CommonCfg.RegTransmitSetting.field.TxBF;
-
- // find max fixed rate
- for (i=23; i>=0; i--) // 3*3
- {
- j = i/8;
- bitmask = (1<<(i-(j*8)));
- if ((pAd->StaCfg.DesiredHtPhyInfo.MCSSet[j] & bitmask) && (pHtCapability->MCSSet[j] & bitmask))
- {
- pEntry->MaxHTPhyMode.field.MCS = i;
- break;
- }
- if (i==0)
- break;
- }
-
-
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO)
- {
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS == 32)
- {
- // Fix MCS as HT Duplicated Mode
- pEntry->MaxHTPhyMode.field.BW = 1;
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pEntry->MaxHTPhyMode.field.STBC = 0;
- pEntry->MaxHTPhyMode.field.ShortGI = 0;
- pEntry->MaxHTPhyMode.field.MCS = 32;
- }
- else if (pEntry->MaxHTPhyMode.field.MCS > pAd->StaCfg.HTPhyMode.field.MCS)
- {
- // STA supports fixed MCS
- pEntry->MaxHTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- }
- }
-
- pEntry->MaxHTPhyMode.field.STBC = (pHtCapability->HtCapInfo.RxSTBC & (pAd->CommonCfg.DesiredHtPhy.TxSTBC));
- pEntry->MpduDensity = pHtCapability->HtCapParm.MpduDensity;
- pEntry->MaxRAmpduFactor = pHtCapability->HtCapParm.MaxRAmpduFactor;
- pEntry->MmpsMode = (UCHAR)pHtCapability->HtCapInfo.MimoPs;
- pEntry->AMsduSize = (UCHAR)pHtCapability->HtCapInfo.AMsduSize;
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
-
- if (pAd->CommonCfg.DesiredHtPhy.AmsduEnable && (pAd->CommonCfg.REGBACapability.field.AutoBA == FALSE))
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_AMSDU_INUSED);
- if (pHtCapability->HtCapInfo.ShortGIfor20)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI20_CAPABLE);
- if (pHtCapability->HtCapInfo.ShortGIfor40)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI40_CAPABLE);
- if (pHtCapability->HtCapInfo.TxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_TxSTBC_CAPABLE);
- if (pHtCapability->HtCapInfo.RxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RxSTBC_CAPABLE);
- if (pHtCapability->ExtHtCapInfo.PlusHTC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_HTC_CAPABLE);
- if (pAd->CommonCfg.bRdg && pHtCapability->ExtHtCapInfo.RDGSupport)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE);
- if (pHtCapability->ExtHtCapInfo.MCSFeedback == 0x03)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_MCSFEEDBACK_CAPABLE);
- NdisMoveMemory(&pEntry->HTCapability, pHtCapability, HtCapabilityLen);
- }
- else
- {
- pAd->MacTab.fAnyStationIsLegacy = TRUE;
- }
-#endif // DOT11_N_SUPPORT //
-
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
- pEntry->CurrTxRate = pEntry->MaxSupportedRate;
-
- // Set asic auto fall back
- if (pAd->StaCfg.bAutoTxRateSwitch == TRUE)
- {
- PUCHAR pTable;
- UCHAR TableSize = 0;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &pEntry->CurrTxRateIndex);
- pEntry->bAutoTxRateSwitch = TRUE;
- }
- else
- {
- pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- pEntry->bAutoTxRateSwitch = FALSE;
-
- // If the legacy mode is set, overwrite the transmit setting of this entry.
- RTMPUpdateLegacyTxSetting((UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode, pEntry);
- }
-
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
- pEntry->Sst = SST_ASSOC;
- pEntry->AuthState = AS_AUTH_OPEN;
- pEntry->AuthMode = pAd->StaCfg.AuthMode;
- pEntry->WepStatus = pAd->StaCfg.WepStatus;
-
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP)
- {
- union iwreq_data wrqu;
-
- SendAssocIEsToWpaSupplicant(pAd);
- memset(&wrqu, 0, sizeof(wrqu));
- wrqu.data.flags = RT_ASSOC_EVENT_FLAG;
- wireless_send_event(pAd->net_dev, IWEVCUSTOM, &wrqu, NULL);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- {
- union iwreq_data wrqu;
- wext_notify_event_assoc(pAd);
-
- memset(wrqu.ap_addr.sa_data, 0, MAC_ADDR_LEN);
- memcpy(wrqu.ap_addr.sa_data, pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- wireless_send_event(pAd->net_dev, SIOCGIWAP, &wrqu, NULL);
-
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/sta/auth.c b/drivers/staging/rt3090/sta/auth.c
deleted file mode 100644
index 157e2999fa19..000000000000
--- a/drivers/staging/rt3090/sta/auth.c
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- auth.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John 2004-9-3 porting from RT2500
-*/
-
-#include "../rt_config.h"
-
-
-/*
- ==========================================================================
- Description:
- authenticate state machine init, including state transition and timer init
- Parameters:
- Sm - pointer to the auth state machine
- Note:
- The state machine looks like this
-
- AUTH_REQ_IDLE AUTH_WAIT_SEQ2 AUTH_WAIT_SEQ4
- MT2_MLME_AUTH_REQ mlme_auth_req_action invalid_state_when_auth invalid_state_when_auth
- MT2_PEER_AUTH_EVEN drop peer_auth_even_at_seq2_action peer_auth_even_at_seq4_action
- MT2_AUTH_TIMEOUT Drop auth_timeout_action auth_timeout_action
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-
-void AuthStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(Sm, Trans, MAX_AUTH_STATE, MAX_AUTH_MSG, (STATE_MACHINE_FUNC)Drop, AUTH_REQ_IDLE, AUTH_MACHINE_BASE);
-
- // the first column
- StateMachineSetAction(Sm, AUTH_REQ_IDLE, MT2_MLME_AUTH_REQ, (STATE_MACHINE_FUNC)MlmeAuthReqAction);
-
- // the second column
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_MLME_AUTH_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenAuth);
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_PEER_AUTH_EVEN, (STATE_MACHINE_FUNC)PeerAuthRspAtSeq2Action);
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ2, MT2_AUTH_TIMEOUT, (STATE_MACHINE_FUNC)AuthTimeoutAction);
-
- // the third column
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ4, MT2_MLME_AUTH_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenAuth);
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ4, MT2_PEER_AUTH_EVEN, (STATE_MACHINE_FUNC)PeerAuthRspAtSeq4Action);
- StateMachineSetAction(Sm, AUTH_WAIT_SEQ4, MT2_AUTH_TIMEOUT, (STATE_MACHINE_FUNC)AuthTimeoutAction);
-
- RTMPInitTimer(pAd, &pAd->MlmeAux.AuthTimer, GET_TIMER_FUNCTION(AuthTimeout), pAd, FALSE);
-}
-
-/*
- ==========================================================================
- Description:
- function to be executed at timer thread when auth timer expires
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AuthTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- DBGPRINT(RT_DEBUG_TRACE,("AUTH - AuthTimeout\n"));
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST))
- return;
-
- // send a de-auth to reset AP's state machine (Patch AP-Dir635)
- if (pAd->Mlme.AuthMachine.CurrState == AUTH_WAIT_SEQ2)
- Cls2errAction(pAd, pAd->MlmeAux.Bssid);
-
-
- MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_AUTH_TIMEOUT, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
-}
-
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeAuthReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- if (AUTH_ReqSend(pAd, Elem, &pAd->MlmeAux.AuthTimer, "AUTH", 1, NULL, 0))
- pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ2;
- else
- {
- USHORT Status;
-
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_INVALID_FORMAT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerAuthRspAtSeq2Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Addr2[MAC_ADDR_LEN];
- USHORT Seq, Status, RemoteStatus, Alg;
- UCHAR ChlgText[CIPHER_TEXT_LEN];
- UCHAR CyperChlgText[CIPHER_TEXT_LEN + 8 + 8];
- UCHAR Element[2];
- HEADER_802_11 AuthHdr;
- BOOLEAN TimerCancelled;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- USHORT Status2;
-
- if (PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, (PCHAR)ChlgText))
- {
- if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 2)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Receive AUTH_RSP seq#2 to me (Alg=%d, Status=%d)\n", Alg, Status));
- RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &TimerCancelled);
-
- if (Status == MLME_SUCCESS)
- {
- // Authentication Mode "LEAP" has allow for CCX 1.X
- if (pAd->MlmeAux.Alg == Ndis802_11AuthModeOpen)
- {
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
- else
- {
- // 2. shared key, need to be challenged
- Seq++;
- RemoteStatus = MLME_SUCCESS;
-
- // Get an unused nonpaged memory
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - PeerAuthRspAtSeq2Action() allocate memory fail\n"));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status2 = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status2);
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Send AUTH request seq#3...\n"));
- MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, Addr2, pAd->MlmeAux.Bssid);
- AuthHdr.FC.Wep = 1;
- // Encrypt challenge text & auth information
- RTMPInitWepEngine(
- pAd,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen,
- CyperChlgText);
-
- Alg = cpu2le16(*(USHORT *)&Alg);
- Seq = cpu2le16(*(USHORT *)&Seq);
- RemoteStatus= cpu2le16(*(USHORT *)&RemoteStatus);
-
- RTMPEncryptData(pAd, (PUCHAR) &Alg, CyperChlgText + 4, 2);
- RTMPEncryptData(pAd, (PUCHAR) &Seq, CyperChlgText + 6, 2);
- RTMPEncryptData(pAd, (PUCHAR) &RemoteStatus, CyperChlgText + 8, 2);
- Element[0] = 16;
- Element[1] = 128;
- RTMPEncryptData(pAd, Element, CyperChlgText + 10, 2);
- RTMPEncryptData(pAd, ChlgText, CyperChlgText + 12, 128);
- RTMPSetICV(pAd, CyperChlgText + 140);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &AuthHdr,
- CIPHER_TEXT_LEN + 16, CyperChlgText,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- RTMPSetTimer(&pAd->MlmeAux.AuthTimer, AUTH_TIMEOUT);
- pAd->Mlme.AuthMachine.CurrState = AUTH_WAIT_SEQ4;
- }
- }
- else
- {
- pAd->StaCfg.AuthFailReason = Status;
- COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - PeerAuthSanity() sanity check fail\n"));
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerAuthRspAtSeq4Action(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Addr2[MAC_ADDR_LEN];
- USHORT Alg, Seq, Status;
- CHAR ChlgText[CIPHER_TEXT_LEN];
- BOOLEAN TimerCancelled;
-
- if(PeerAuthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Alg, &Seq, &Status, ChlgText))
- {
- if(MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Addr2) && Seq == 4)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Receive AUTH_RSP seq#4 to me\n"));
- RTMPCancelTimer(&pAd->MlmeAux.AuthTimer, &TimerCancelled);
-
- if (Status != MLME_SUCCESS)
- {
- pAd->StaCfg.AuthFailReason = Status;
- COPY_MAC_ADDR(pAd->StaCfg.AuthFailSta, Addr2);
- }
-
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - PeerAuthRspAtSeq4Action() sanity check fail\n"));
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeDeauthReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MLME_DEAUTH_REQ_STRUCT *pInfo;
- HEADER_802_11 DeauthHdr;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- USHORT Status;
-
- pInfo = (MLME_DEAUTH_REQ_STRUCT *)Elem->Msg;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - MlmeDeauthReqAction() allocate memory fail\n"));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DEAUTH_CONF, 2, &Status);
- return;
- }
-
-
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Send DE-AUTH request (Reason=%d)...\n", pInfo->Reason));
- MgtMacHeaderInit(pAd, &DeauthHdr, SUBTYPE_DEAUTH, 0, pInfo->Addr, pAd->MlmeAux.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&DeauthHdr,
- 2, &pInfo->Reason,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- pAd->StaCfg.DeauthReason = pInfo->Reason;
- COPY_MAC_ADDR(pAd->StaCfg.DeauthSta, pInfo->Addr);
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_SUCCESS;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_DEAUTH_CONF, 2, &Status);
-
- // send wireless event - for deauthentication
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID AuthTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - AuthTimeoutAction\n"));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_REJ_TIMEOUT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID InvalidStateWhenAuth(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - InvalidStateWhenAuth (state=%ld), reset AUTH state machine\n", pAd->Mlme.AuthMachine.CurrState));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- Some STA/AP
- Note:
- This action should never trigger AUTH state transition, therefore we
- separate it from AUTH state machine, and make it as a standalone service
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID Cls2errAction(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr)
-{
- HEADER_802_11 DeauthHdr;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- USHORT Reason = REASON_CLS2ERR;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- DBGPRINT(RT_DEBUG_TRACE, ("AUTH - Class 2 error, Send DEAUTH frame...\n"));
- MgtMacHeaderInit(pAd, &DeauthHdr, SUBTYPE_DEAUTH, 0, pAddr, pAd->MlmeAux.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&DeauthHdr,
- 2, &Reason,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- pAd->StaCfg.DeauthReason = Reason;
- COPY_MAC_ADDR(pAd->StaCfg.DeauthSta, pAddr);
-}
-
-BOOLEAN AUTH_ReqSend(
- IN PRTMP_ADAPTER pAd,
- IN PMLME_QUEUE_ELEM pElem,
- IN PRALINK_TIMER_STRUCT pAuthTimer,
- IN PSTRING pSMName,
- IN USHORT SeqNo,
- IN PUCHAR pNewElement,
- IN ULONG ElementLen)
-{
- USHORT Alg, Seq, Status;
- UCHAR Addr[6];
- ULONG Timeout;
- HEADER_802_11 AuthHdr;
- BOOLEAN TimerCancelled;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0, tmp = 0;
-
- // Block all authentication request durning WPA block period
- if (pAd->StaCfg.bBlockAssoc == TRUE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s - Block Auth request durning WPA block period!\n", pSMName));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- }
- else if(MlmeAuthReqSanity(pAd, pElem->Msg, pElem->MsgLen, Addr, &Timeout, &Alg))
- {
- /* reset timer */
- RTMPCancelTimer(pAuthTimer, &TimerCancelled);
-
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, Addr);
- pAd->MlmeAux.Alg = Alg;
- Seq = SeqNo;
- Status = MLME_SUCCESS;
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if(NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s - MlmeAuthReqAction(Alg:%d) allocate memory failed\n", pSMName, Alg));
- pAd->Mlme.AuthMachine.CurrState = AUTH_REQ_IDLE;
- Status = MLME_FAIL_NO_RESOURCE;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_AUTH_CONF, 2, &Status);
- return FALSE;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s - Send AUTH request seq#1 (Alg=%d)...\n", pSMName, Alg));
- MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, Addr, pAd->MlmeAux.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11),&AuthHdr,
- 2, &Alg,
- 2, &Seq,
- 2, &Status,
- END_OF_ARGS);
-
- if (pNewElement && ElementLen)
- {
- MakeOutgoingFrame(pOutBuffer+FrameLen, &tmp,
- ElementLen, pNewElement,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- RTMPSetTimer(pAuthTimer, Timeout);
- return TRUE;
- }
- else
- {
- DBGPRINT_ERR(("%s - MlmeAuthReqAction() sanity check failed\n", pSMName));
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/sta/auth_rsp.c b/drivers/staging/rt3090/sta/auth_rsp.c
deleted file mode 100644
index 207bfeada1e4..000000000000
--- a/drivers/staging/rt3090/sta/auth_rsp.c
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- auth_rsp.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John 2004-10-1 copy from RT2560
-*/
-
-#include "../rt_config.h"
-
-
-/*
- ==========================================================================
- Description:
- authentication state machine init procedure
- Parameters:
- Sm - the state machine
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-VOID AuthRspStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN PSTATE_MACHINE Sm,
- IN STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(Sm, Trans, MAX_AUTH_RSP_STATE, MAX_AUTH_RSP_MSG, (STATE_MACHINE_FUNC)Drop, AUTH_RSP_IDLE, AUTH_RSP_MACHINE_BASE);
-
- // column 1
- StateMachineSetAction(Sm, AUTH_RSP_IDLE, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
-
- // column 2
- StateMachineSetAction(Sm, AUTH_RSP_WAIT_CHAL, MT2_PEER_DEAUTH, (STATE_MACHINE_FUNC)PeerDeauthAction);
-
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID PeerAuthSimpleRspGenAndSend(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHdr80211,
- IN USHORT Alg,
- IN USHORT Seq,
- IN USHORT Reason,
- IN USHORT Status)
-{
- HEADER_802_11 AuthHdr;
- ULONG FrameLen = 0;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
-
- if (Reason != MLME_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Peer AUTH fail...\n"));
- return;
- }
-
- //Get an unused nonpaged memory
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Send AUTH response (seq#2)...\n"));
- MgtMacHeaderInit(pAd, &AuthHdr, SUBTYPE_AUTH, 0, pHdr80211->Addr2, pAd->MlmeAux.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &AuthHdr,
- 2, &Alg,
- 2, &Seq,
- 2, &Reason,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID PeerDeauthAction(
- IN PRTMP_ADAPTER pAd,
- IN PMLME_QUEUE_ELEM Elem)
-{
- UCHAR Addr2[MAC_ADDR_LEN];
- USHORT Reason;
-
- if (PeerDeauthSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, &Reason))
- {
- if (INFRA_ON(pAd)
- && MAC_ADDR_EQUAL(Addr2, pAd->CommonCfg.Bssid)
- )
- {
- DBGPRINT(RT_DEBUG_TRACE,("AUTH_RSP - receive DE-AUTH from our AP (Reason=%d)\n", Reason));
-
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-
- // send wireless event - for deauthentication
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_DEAUTH_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-
- LinkDown(pAd, TRUE);
- }
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("AUTH_RSP - PeerDeauthAction() sanity check fail\n"));
- }
-}
diff --git a/drivers/staging/rt3090/sta/connect.c b/drivers/staging/rt3090/sta/connect.c
deleted file mode 100644
index 4aa35ee3ade1..000000000000
--- a/drivers/staging/rt3090/sta/connect.c
+++ /dev/null
@@ -1,2759 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- connect.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John 2004-08-08 Major modification from RT2560
-*/
-
-#include "../rt_config.h"
-
-
-UCHAR CipherSuiteWpaNoneTkip[] = {
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x02, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x02, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x00 // authentication
- };
-UCHAR CipherSuiteWpaNoneTkipLen = (sizeof(CipherSuiteWpaNoneTkip) / sizeof(UCHAR));
-
-UCHAR CipherSuiteWpaNoneAes[] = {
- 0x00, 0x50, 0xf2, 0x01, // oui
- 0x01, 0x00, // Version
- 0x00, 0x50, 0xf2, 0x04, // Multicast
- 0x01, 0x00, // Number of unicast
- 0x00, 0x50, 0xf2, 0x04, // unicast
- 0x01, 0x00, // number of authentication method
- 0x00, 0x50, 0xf2, 0x00 // authentication
- };
-UCHAR CipherSuiteWpaNoneAesLen = (sizeof(CipherSuiteWpaNoneAes) / sizeof(UCHAR));
-
-// The following MACRO is called after 1. starting an new IBSS, 2. succesfully JOIN an IBSS,
-// or 3. succesfully ASSOCIATE to a BSS, 4. successfully RE_ASSOCIATE to a BSS
-// All settings successfuly negotiated furing MLME state machines become final settings
-// and are copied to pAd->StaActive
-#define COPY_SETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(_pAd) \
-{ \
- NdisZeroMemory((_pAd)->CommonCfg.Ssid, MAX_LEN_OF_SSID); \
- (_pAd)->CommonCfg.SsidLen = (_pAd)->MlmeAux.SsidLen; \
- NdisMoveMemory((_pAd)->CommonCfg.Ssid, (_pAd)->MlmeAux.Ssid, (_pAd)->MlmeAux.SsidLen); \
- COPY_MAC_ADDR((_pAd)->CommonCfg.Bssid, (_pAd)->MlmeAux.Bssid); \
- (_pAd)->CommonCfg.Channel = (_pAd)->MlmeAux.Channel; \
- (_pAd)->CommonCfg.CentralChannel = (_pAd)->MlmeAux.CentralChannel; \
- (_pAd)->StaActive.Aid = (_pAd)->MlmeAux.Aid; \
- (_pAd)->StaActive.AtimWin = (_pAd)->MlmeAux.AtimWin; \
- (_pAd)->StaActive.CapabilityInfo = (_pAd)->MlmeAux.CapabilityInfo; \
- (_pAd)->CommonCfg.BeaconPeriod = (_pAd)->MlmeAux.BeaconPeriod; \
- (_pAd)->StaActive.CfpMaxDuration = (_pAd)->MlmeAux.CfpMaxDuration; \
- (_pAd)->StaActive.CfpPeriod = (_pAd)->MlmeAux.CfpPeriod; \
- (_pAd)->StaActive.SupRateLen = (_pAd)->MlmeAux.SupRateLen; \
- NdisMoveMemory((_pAd)->StaActive.SupRate, (_pAd)->MlmeAux.SupRate, (_pAd)->MlmeAux.SupRateLen);\
- (_pAd)->StaActive.ExtRateLen = (_pAd)->MlmeAux.ExtRateLen; \
- NdisMoveMemory((_pAd)->StaActive.ExtRate, (_pAd)->MlmeAux.ExtRate, (_pAd)->MlmeAux.ExtRateLen);\
- NdisMoveMemory(&(_pAd)->CommonCfg.APEdcaParm, &(_pAd)->MlmeAux.APEdcaParm, sizeof(EDCA_PARM));\
- NdisMoveMemory(&(_pAd)->CommonCfg.APQosCapability, &(_pAd)->MlmeAux.APQosCapability, sizeof(QOS_CAPABILITY_PARM));\
- NdisMoveMemory(&(_pAd)->CommonCfg.APQbssLoad, &(_pAd)->MlmeAux.APQbssLoad, sizeof(QBSS_LOAD_PARM));\
- COPY_MAC_ADDR((_pAd)->MacTab.Content[BSSID_WCID].Addr, (_pAd)->MlmeAux.Bssid); \
- (_pAd)->MacTab.Content[BSSID_WCID].Aid = (_pAd)->MlmeAux.Aid; \
- (_pAd)->MacTab.Content[BSSID_WCID].PairwiseKey.CipherAlg = (_pAd)->StaCfg.PairCipher;\
- COPY_MAC_ADDR((_pAd)->MacTab.Content[BSSID_WCID].PairwiseKey.BssId, (_pAd)->MlmeAux.Bssid);\
- (_pAd)->MacTab.Content[BSSID_WCID].RateLen = (_pAd)->StaActive.SupRateLen + (_pAd)->StaActive.ExtRateLen;\
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
-*/
-VOID MlmeCntlInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- // Control state machine differs from other state machines, the interface
- // follows the standard interface
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID MlmeCntlMachinePerformAction(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *S,
- IN MLME_QUEUE_ELEM *Elem)
-{
- switch(pAd->Mlme.CntlMachine.CurrState)
- {
- case CNTL_IDLE:
- CntlIdleProc(pAd, Elem);
- break;
- case CNTL_WAIT_DISASSOC:
- CntlWaitDisassocProc(pAd, Elem);
- break;
- case CNTL_WAIT_JOIN:
- CntlWaitJoinProc(pAd, Elem);
- break;
-
- // CNTL_WAIT_REASSOC is the only state in CNTL machine that does
- // not triggered directly or indirectly by "RTMPSetInformation(OID_xxx)".
- // Therefore not protected by NDIS's "only one outstanding OID request"
- // rule. Which means NDIS may SET OID in the middle of ROAMing attempts.
- // Current approach is to block new SET request at RTMPSetInformation()
- // when CntlMachine.CurrState is not CNTL_IDLE
- case CNTL_WAIT_REASSOC:
- CntlWaitReassocProc(pAd, Elem);
- break;
-
- case CNTL_WAIT_START:
- CntlWaitStartProc(pAd, Elem);
- break;
- case CNTL_WAIT_AUTH:
- CntlWaitAuthProc(pAd, Elem);
- break;
- case CNTL_WAIT_AUTH2:
- CntlWaitAuthProc2(pAd, Elem);
- break;
- case CNTL_WAIT_ASSOC:
- CntlWaitAssocProc(pAd, Elem);
- break;
-
- case CNTL_WAIT_OID_LIST_SCAN:
- if(Elem->MsgType == MT2_SCAN_CONF)
- {
- // Resume TxRing after SCANING complete. We hope the out-of-service time
- // won't be too long to let upper layer time-out the waiting frames
- RTMPResumeMsduTransmission(pAd);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- //
- // Set LED status to previous status.
- //
- if (pAd->bLedOnScanning)
- {
- pAd->bLedOnScanning = FALSE;
- RTMPSetLED(pAd, pAd->LedStatus);
- }
-#ifdef DOT11N_DRAFT3
- // AP sent a 2040Coexistence mgmt frame, then station perform a scan, and then send back the respone.
- if (pAd->CommonCfg.BSSCoexist2040.field.InfoReq == 1)
- {
- Update2040CoexistFrameAndNotify(pAd, BSSID_WCID, TRUE);
- }
-#endif // DOT11N_DRAFT3 //
- }
- break;
-
- case CNTL_WAIT_OID_DISASSOC:
- if (Elem->MsgType == MT2_DISASSOC_CONF)
- {
- LinkDown(pAd, FALSE);
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- }
- break;
- default:
- DBGPRINT_ERR(("!ERROR! CNTL - Illegal message type(=%ld)", Elem->MsgType));
- break;
- }
-}
-
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlIdleProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MLME_DISASSOC_REQ_STRUCT DisassocReq;
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
- return;
-
- switch(Elem->MsgType)
- {
- case OID_802_11_SSID:
- CntlOidSsidProc(pAd, Elem);
- break;
-
- case OID_802_11_BSSID:
- CntlOidRTBssidProc(pAd,Elem);
- break;
-
- case OID_802_11_BSSID_LIST_SCAN:
- CntlOidScanProc(pAd,Elem);
- break;
-
- case OID_802_11_DISASSOCIATE:
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ, sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_ENABLE_WITH_WEB_UI)
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- // Set the AutoReconnectSsid to prevent it reconnect to old SSID
- // Since calling this indicate user don't want to connect to that SSID anymore.
- pAd->MlmeAux.AutoReconnectSsidLen= 32;
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.AutoReconnectSsidLen);
- }
- break;
-
- case MT2_MLME_ROAMING_REQ:
- CntlMlmeRoamingProc(pAd, Elem);
- break;
-
- case OID_802_11_MIC_FAILURE_REPORT_FRAME:
- WpaMicFailureReportFrame(pAd, Elem);
- break;
-
-#ifdef QOS_DLS_SUPPORT
- case RT_OID_802_11_SET_DLS_PARAM:
- CntlOidDLSSetupProc(pAd, Elem);
- break;
-#endif // QOS_DLS_SUPPORT //
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Illegal message in CntlIdleProc(MsgType=%ld)\n",Elem->MsgType));
- break;
- }
-}
-
-VOID CntlOidScanProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MLME_SCAN_REQ_STRUCT ScanReq;
- ULONG BssIdx = BSS_NOT_FOUND;
- BSS_ENTRY CurrBss;
-
-#ifdef RALINK_ATE
-/* Disable scanning when ATE is running. */
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
-
- // record current BSS if network is connected.
- // 2003-2-13 do not include current IBSS if this is the only STA in this IBSS.
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- BssIdx = BssSsidTableSearch(&pAd->ScanTab, pAd->CommonCfg.Bssid, (PUCHAR)pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, pAd->CommonCfg.Channel);
- if (BssIdx != BSS_NOT_FOUND)
- {
- NdisMoveMemory(&CurrBss, &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
- }
- }
-
- // clean up previous SCAN result, add current BSS back to table if any
- BssTableInit(&pAd->ScanTab);
- if (BssIdx != BSS_NOT_FOUND)
- {
- // DDK Note: If the NIC is associated with a particular BSSID and SSID
- // that are not contained in the list of BSSIDs generated by this scan, the
- // BSSID description of the currently associated BSSID and SSID should be
- // appended to the list of BSSIDs in the NIC's database.
- // To ensure this, we append this BSS as the first entry in SCAN result
- NdisMoveMemory(&pAd->ScanTab.BssEntry[0], &CurrBss, sizeof(BSS_ENTRY));
- pAd->ScanTab.BssNr = 1;
- }
-
- ScanParmFill(pAd, &ScanReq, (PSTRING) Elem->Msg, Elem->MsgLen, BSS_ANY, SCAN_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ,
- sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
-}
-
-/*
- ==========================================================================
- Description:
- Before calling this routine, user desired SSID should already been
- recorded in CommonCfg.Ssid[]
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlOidSsidProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM * Elem)
-{
- PNDIS_802_11_SSID pOidSsid = (NDIS_802_11_SSID *)Elem->Msg;
- MLME_DISASSOC_REQ_STRUCT DisassocReq;
- ULONG Now;
-
-
- // Step 1. record the desired user settings to MlmeAux
- NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
- NdisMoveMemory(pAd->MlmeAux.Ssid, pOidSsid->Ssid, pOidSsid->SsidLength);
- pAd->MlmeAux.SsidLen = (UCHAR)pOidSsid->SsidLength;
- NdisZeroMemory(pAd->MlmeAux.Bssid, MAC_ADDR_LEN);
- pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
-
- pAd->StaCfg.bAutoConnectByBssid = FALSE;
-
- //
- // Update Reconnect Ssid, that user desired to connect.
- //
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
- NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- pAd->MlmeAux.AutoReconnectSsidLen = pAd->MlmeAux.SsidLen;
-
- // step 2. find all matching BSS in the lastest SCAN result (inBssTab)
- // & log them into MlmeAux.SsidBssTab for later-on iteration. Sort by RSSI order
- BssTableSsidSort(pAd, &pAd->MlmeAux.SsidBssTab, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
-
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - %d BSS of %d BSS match the desire (%d)SSID - %s\n",
- pAd->MlmeAux.SsidBssTab.BssNr, pAd->ScanTab.BssNr, pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid));
- NdisGetSystemUpTime(&Now);
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) &&
- (pAd->CommonCfg.SsidLen == pAd->MlmeAux.SsidBssTab.BssEntry[0].SsidLen) &&
- NdisEqualMemory(pAd->CommonCfg.Ssid, pAd->MlmeAux.SsidBssTab.BssEntry[0].Ssid, pAd->CommonCfg.SsidLen) &&
- MAC_ADDR_EQUAL(pAd->CommonCfg.Bssid, pAd->MlmeAux.SsidBssTab.BssEntry[0].Bssid))
- {
- // Case 1. already connected with an AP who has the desired SSID
- // with highest RSSI
-
- // Add checking Mode "LEAP" for CCX 1.0
- if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
- ) &&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- {
- // case 1.1 For WPA, WPA-PSK, if the 1x port is not secured, we have to redo
- // connection process
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - disassociate with current AP...\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
- sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
- }
- else if (pAd->bConfigChanged == TRUE)
- {
- // case 1.2 Important Config has changed, we have to reconnect to the same AP
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - disassociate with current AP Because config changed...\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
- sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
- }
- else
- {
- // case 1.3. already connected to the SSID with highest RSSI.
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - already with this BSSID. ignore this SET_SSID request\n"));
- //
- // (HCT 12.1) 1c_wlan_mediaevents required
- // media connect events are indicated when associating with the same AP
- //
- if (INFRA_ON(pAd))
- {
- //
- // Since MediaState already is NdisMediaStateConnected
- // We just indicate the connect event again to meet the WHQL required.
- //
- pAd->IndicateMediaState = NdisMediaStateConnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_UP; // Update extra information to link is up
- }
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, &pAd->MlmeAux.Bssid[0], NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- }
- }
- else if (INFRA_ON(pAd))
- {
- //
- // For RT61
- // [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: )
- // RT61 may lost SSID, and not connect to NDTEST_WEP_AP2 and will connect to NDTEST_WEP_AP2 by Autoreconnect
- // But media status is connected, so the SSID not report correctly.
- //
- if (!SSID_EQUAL(pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen))
- {
- //
- // Different SSID means not Roaming case, so we let LinkDown() to Indicate a disconnect event.
- //
- pAd->MlmeAux.CurrReqIsFromNdis = TRUE;
- }
- // case 2. active INFRA association existent
- // roaming is done within miniport driver, nothing to do with configuration
- // utility. so upon a new SET(OID_802_11_SSID) is received, we just
- // disassociate with the current associated AP,
- // then perform a new association with this new SSID, no matter the
- // new/old SSID are the same or not.
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - disassociate with current AP...\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
- sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
- }
- else
- {
- if (ADHOC_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - drop current ADHOC\n"));
- LinkDown(pAd, FALSE);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():NDIS_STATUS_MEDIA_DISCONNECT Event C!\n"));
- }
-
- if ((pAd->MlmeAux.SsidBssTab.BssNr == 0) &&
- (pAd->StaCfg.bAutoReconnect == TRUE) &&
- (pAd->MlmeAux.BssType == BSS_INFRA) &&
- (MlmeValidateSSID(pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen) == TRUE)
- )
- {
- MLME_SCAN_REQ_STRUCT ScanReq;
-
- DBGPRINT(RT_DEBUG_TRACE, ("CntlOidSsidProc():CNTL - No matching BSS, start a new scan\n"));
- ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
- // Reset Missed scan number
- pAd->StaCfg.LastScanTime = Now;
- }
- else
- {
-
- pAd->MlmeAux.BssIdx = 0;
- IterateOnBssTab(pAd);
- }
- }
-}
-
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlOidRTBssidProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM * Elem)
-{
- ULONG BssIdx;
- PUCHAR pOidBssid = (PUCHAR)Elem->Msg;
- MLME_DISASSOC_REQ_STRUCT DisassocReq;
- MLME_JOIN_REQ_STRUCT JoinReq;
-
-#ifdef RALINK_ATE
-/* No need to perform this routine when ATE is running. */
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
-
- // record user desired settings
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pOidBssid);
- pAd->MlmeAux.BssType = pAd->StaCfg.BssType;
-
- // find the desired BSS in the latest SCAN result table
- BssIdx = BssTableSearch(&pAd->ScanTab, pOidBssid, pAd->MlmeAux.Channel);
- if (BssIdx == BSS_NOT_FOUND)
- {
- MLME_SCAN_REQ_STRUCT ScanReq;
-
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - BSSID not found. reply NDIS_STATUS_NOT_ACCEPTED\n"));
- //pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - BSSID not found. start a new scan\n"));
- ScanParmFill(pAd, &ScanReq, (PSTRING) pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, BSS_ANY, SCAN_ACTIVE);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_SCAN_REQ, sizeof(MLME_SCAN_REQ_STRUCT), &ScanReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_LIST_SCAN;
- // Reset Missed scan number
- NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
- return;
- }
-
- //
- // Update Reconnect Ssid, that user desired to connect.
- //
- NdisZeroMemory(pAd->MlmeAux.AutoReconnectSsid, MAX_LEN_OF_SSID);
- pAd->MlmeAux.AutoReconnectSsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
- NdisMoveMemory(pAd->MlmeAux.AutoReconnectSsid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->ScanTab.BssEntry[BssIdx].SsidLen);
-
- // copy the matched BSS entry from ScanTab to MlmeAux.SsidBssTab. Why?
- // Because we need this entry to become the JOIN target in later on SYNC state machine
- pAd->MlmeAux.BssIdx = 0;
- pAd->MlmeAux.SsidBssTab.BssNr = 1;
- NdisMoveMemory(&pAd->MlmeAux.SsidBssTab.BssEntry[0], &pAd->ScanTab.BssEntry[BssIdx], sizeof(BSS_ENTRY));
-
- // Add SSID into MlmeAux for site surey joining hidden SSID
- pAd->MlmeAux.SsidLen = pAd->ScanTab.BssEntry[BssIdx].SsidLen;
- NdisMoveMemory(pAd->MlmeAux.Ssid, pAd->ScanTab.BssEntry[BssIdx].Ssid, pAd->MlmeAux.SsidLen);
-
- {
- if (INFRA_ON(pAd))
- {
- // disassoc from current AP first
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - disassociate with current AP ...\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_DISASSOC_STA_LEAVING);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ,
- sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
- }
- else
- {
- if (ADHOC_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - drop current ADHOC\n"));
- LinkDown(pAd, FALSE);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event C!\n"));
- }
-
- // Change the wepstatus to original wepstatus
- pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
- pAd->StaCfg.PairCipher = pAd->StaCfg.OrigWepStatus;
- pAd->StaCfg.GroupCipher = pAd->StaCfg.OrigWepStatus;
-
- // Check cipher suite, AP must have more secured cipher than station setting
- // Set the Pairwise and Group cipher to match the intended AP setting
- // We can only connect to AP with less secured cipher setting
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- pAd->StaCfg.GroupCipher = pAd->ScanTab.BssEntry[BssIdx].WPA.GroupCipher;
-
- if (pAd->StaCfg.WepStatus == pAd->ScanTab.BssEntry[BssIdx].WPA.PairCipher)
- pAd->StaCfg.PairCipher = pAd->ScanTab.BssEntry[BssIdx].WPA.PairCipher;
- else if (pAd->ScanTab.BssEntry[BssIdx].WPA.PairCipherAux != Ndis802_11WEPDisabled)
- pAd->StaCfg.PairCipher = pAd->ScanTab.BssEntry[BssIdx].WPA.PairCipherAux;
- else // There is no PairCipher Aux, downgrade our capability to TKIP
- pAd->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- pAd->StaCfg.GroupCipher = pAd->ScanTab.BssEntry[BssIdx].WPA2.GroupCipher;
-
- if (pAd->StaCfg.WepStatus == pAd->ScanTab.BssEntry[BssIdx].WPA2.PairCipher)
- pAd->StaCfg.PairCipher = pAd->ScanTab.BssEntry[BssIdx].WPA2.PairCipher;
- else if (pAd->ScanTab.BssEntry[BssIdx].WPA2.PairCipherAux != Ndis802_11WEPDisabled)
- pAd->StaCfg.PairCipher = pAd->ScanTab.BssEntry[BssIdx].WPA2.PairCipherAux;
- else // There is no PairCipher Aux, downgrade our capability to TKIP
- pAd->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
-
- // RSN capability
- pAd->StaCfg.RsnCapability = pAd->ScanTab.BssEntry[BssIdx].WPA2.RsnCapability;
- }
-
- // Set Mix cipher flag
- pAd->StaCfg.bMixCipher = (pAd->StaCfg.PairCipher == pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
- /*if (pAd->StaCfg.bMixCipher == TRUE)
- {
- // If mix cipher, re-build RSNIE
- RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
- }*/
- // No active association, join the BSS immediately
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - joining %02x:%02x:%02x:%02x:%02x:%02x ...\n",
- pOidBssid[0],pOidBssid[1],pOidBssid[2],pOidBssid[3],pOidBssid[4],pOidBssid[5]));
-
- JoinParmFill(pAd, &JoinReq, pAd->MlmeAux.BssIdx);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_JOIN_REQ, sizeof(MLME_JOIN_REQ_STRUCT), &JoinReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_JOIN;
- }
- }
-}
-
-// Roaming is the only external request triggering CNTL state machine
-// despite of other "SET OID" operation. All "SET OID" related oerations
-// happen in sequence, because no other SET OID will be sent to this device
-// until the the previous SET operation is complete (successful o failed).
-// So, how do we quarantee this ROAMING request won't corrupt other "SET OID"?
-// or been corrupted by other "SET OID"?
-//
-// IRQL = DISPATCH_LEVEL
-VOID CntlMlmeRoamingProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR BBPValue = 0;
-
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - Roaming in MlmeAux.RoamTab...\n"));
-
- {
- //Let BBP register at 20MHz to do (fast) roaming.
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
-
- NdisMoveMemory(&pAd->MlmeAux.SsidBssTab, &pAd->MlmeAux.RoamTab, sizeof(pAd->MlmeAux.RoamTab));
- pAd->MlmeAux.SsidBssTab.BssNr = pAd->MlmeAux.RoamTab.BssNr;
-
- BssTableSortByRssi(&pAd->MlmeAux.SsidBssTab);
- pAd->MlmeAux.BssIdx = 0;
- IterateOnBssTab(pAd);
- }
-}
-
-#ifdef QOS_DLS_SUPPORT
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlOidDLSSetupProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PRT_802_11_DLS pDLS = (PRT_802_11_DLS)Elem->Msg;
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- INT i;
- USHORT reason = REASON_UNSPECIFY;
-
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - (OID set %02x:%02x:%02x:%02x:%02x:%02x with Valid=%d, Status=%d, TimeOut=%d, CountDownTimer=%d)\n",
- pDLS->MacAddr[0], pDLS->MacAddr[1], pDLS->MacAddr[2], pDLS->MacAddr[3], pDLS->MacAddr[4], pDLS->MacAddr[5],
- pDLS->Valid, pDLS->Status, pDLS->TimeOut, pDLS->CountDownTimer));
-
- if (!pAd->CommonCfg.bDLSCapable)
- return;
-
- // DLS will not be supported when Adhoc mode
- if (INFRA_ON(pAd))
- {
- for (i = 0; i < MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pDLS->Valid && pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH) &&
- (pDLS->TimeOut == pAd->StaCfg.DLSEntry[i].TimeOut) && MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- // 1. Same setting, just drop it
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - setting unchanged\n"));
- break;
- }
- else if (!pDLS->Valid && pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH) &&
- MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- // 2. Disable DLS link case, just tear down DLS link
- reason = REASON_QOS_UNWANTED_MECHANISM;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - start tear down procedure\n"));
- break;
- }
- else if ((i < MAX_NUM_OF_DLS_ENTRY) && pDLS->Valid && !pAd->StaCfg.DLSEntry[i].Valid)
- {
- // 3. Enable case, start DLS setup procedure
- NdisMoveMemory(&pAd->StaCfg.DLSEntry[i], pDLS, sizeof(RT_802_11_DLS_UI));
-
- //Update countdown timer
- pAd->StaCfg.DLSEntry[i].CountDownTimer = pAd->StaCfg.DLSEntry[i].TimeOut;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_REQ, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - DLS setup case\n"));
- break;
- }
- else if ((i < MAX_NUM_OF_DLS_ENTRY) && pDLS->Valid && pAd->StaCfg.DLSEntry[i].Valid &&
- (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH) && !MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- // 4. update mac case, tear down old DLS and setup new DLS
- reason = REASON_QOS_UNWANTED_MECHANISM;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- NdisMoveMemory(&pAd->StaCfg.DLSEntry[i], pDLS, sizeof(RT_802_11_DLS_UI));
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_REQ, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - DLS tear down and restart case\n"));
- break;
- }
- else if (pDLS->Valid && pAd->StaCfg.DLSEntry[i].Valid &&
- MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr) && (pAd->StaCfg.DLSEntry[i].TimeOut != pDLS->TimeOut))
- {
- // 5. update timeout case, start DLS setup procedure (no tear down)
- pAd->StaCfg.DLSEntry[i].TimeOut = pDLS->TimeOut;
- //Update countdown timer
- pAd->StaCfg.DLSEntry[i].CountDownTimer = pAd->StaCfg.DLSEntry[i].TimeOut;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_REQ, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - DLS update timeout case\n"));
- break;
- }
- else if (pDLS->Valid && pAd->StaCfg.DLSEntry[i].Valid &&
- (pAd->StaCfg.DLSEntry[i].Status != DLS_FINISH) && MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- // 6. re-setup case, start DLS setup procedure (no tear down)
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_REQ, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- DBGPRINT(RT_DEBUG_TRACE,("CNTL - DLS retry setup procedure\n"));
- break;
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN,("CNTL - DLS not changed in entry - %d - Valid=%d, Status=%d, TimeOut=%d\n",
- i, pAd->StaCfg.DLSEntry[i].Valid, pAd->StaCfg.DLSEntry[i].Status, pAd->StaCfg.DLSEntry[i].TimeOut));
- }
- }
- }
-}
-#endif // QOS_DLS_SUPPORT //
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitDisassocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- MLME_START_REQ_STRUCT StartReq;
-
- if (Elem->MsgType == MT2_DISASSOC_CONF)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Dis-associate successful\n"));
-
- if (pAd->CommonCfg.bWirelessEvent)
- {
- RTMPSendWirelessEvent(pAd, IW_DISASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
-
- LinkDown(pAd, FALSE);
-
- // case 1. no matching BSS, and user wants ADHOC, so we just start a new one
- if ((pAd->MlmeAux.SsidBssTab.BssNr==0) && (pAd->StaCfg.BssType == BSS_ADHOC))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - No matching BSS, start a new ADHOC (Ssid=%s)...\n",pAd->MlmeAux.Ssid));
- StartParmFill(pAd, &StartReq, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
- }
- // case 2. try each matched BSS
- else
- {
- pAd->MlmeAux.BssIdx = 0;
-
- IterateOnBssTab(pAd);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitJoinProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Reason;
- MLME_AUTH_REQ_STRUCT AuthReq;
-
- if (Elem->MsgType == MT2_JOIN_CONF)
- {
- NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
- if (Reason == MLME_SUCCESS)
- {
- // 1. joined an IBSS, we are pretty much done here
- if (pAd->MlmeAux.BssType == BSS_ADHOC)
- {
- //
- // 5G bands rules of Japan:
- // Ad hoc must be disabled in W53(ch52,56,60,64) channels.
- //
- if ( (pAd->CommonCfg.bIEEE80211H == 1) &&
- RadarChannelCheck(pAd, pAd->CommonCfg.Channel)
- )
- {
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Channel=%d, Join adhoc on W53(52,56,60,64) Channels are not accepted\n", pAd->CommonCfg.Channel));
- return;
- }
-
- LinkUp(pAd, BSS_ADHOC);
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - join the IBSS = %02x:%02x:%02x:%02x:%02x:%02x ...\n",
- pAd->CommonCfg.Bssid[0],pAd->CommonCfg.Bssid[1],pAd->CommonCfg.Bssid[2],
- pAd->CommonCfg.Bssid[3],pAd->CommonCfg.Bssid[4],pAd->CommonCfg.Bssid[5]));
-
- pAd->IndicateMediaState = NdisMediaStateConnected;
- pAd->ExtraInfo = GENERAL_LINK_UP;
- }
- // 2. joined a new INFRA network, start from authentication
- else
- {
- {
- // either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeShared) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch))
- {
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_KEY);
- }
- else
- {
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_OPEN);
- }
- MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_MLME_AUTH_REQ,
- sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq);
- }
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_AUTH;
- }
- }
- else
- {
- // 3. failed, try next BSS
- pAd->MlmeAux.BssIdx++;
- IterateOnBssTab(pAd);
- }
- }
-}
-
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitStartProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Result;
-
- if (Elem->MsgType == MT2_START_CONF)
- {
- NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
- if (Result == MLME_SUCCESS)
- {
- //
- // 5G bands rules of Japan:
- // Ad hoc must be disabled in W53(ch52,56,60,64) channels.
- //
- if ( (pAd->CommonCfg.bIEEE80211H == 1) &&
- RadarChannelCheck(pAd, pAd->CommonCfg.Channel)
- )
- {
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Channel=%d, Start adhoc on W53(52,56,60,64) Channels are not accepted\n", pAd->CommonCfg.Channel));
- return;
- }
-#ifdef DOT11_N_SUPPORT
- NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16);
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- {
- N_ChannelCheck(pAd);
- SetCommonHT(pAd);
- NdisMoveMemory(&pAd->MlmeAux.AddHtInfo, &pAd->CommonCfg.AddHTInfo, sizeof(ADD_HT_INFO_IE));
- RTMPCheckHt(pAd, BSSID_WCID, &pAd->CommonCfg.HtCapability, &pAd->CommonCfg.AddHTInfo);
- pAd->StaActive.SupportedPhyInfo.bHtEnable = TRUE;
- NdisMoveMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], &pAd->CommonCfg.HtCapability.MCSSet[0], 16);
- COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
-
- if ((pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
- (pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE))
- {
- pAd->MlmeAux.CentralChannel = pAd->CommonCfg.Channel + 2;
- }
- else if ((pAd->CommonCfg.HtCapability.HtCapInfo.ChannelWidth == BW_40) &&
- (pAd->CommonCfg.AddHTInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW))
- {
- pAd->MlmeAux.CentralChannel = pAd->CommonCfg.Channel - 2;
- }
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- }
- LinkUp(pAd, BSS_ADHOC);
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- // Before send beacon, driver need do radar detection
- if ((pAd->CommonCfg.Channel > 14 )
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && RadarChannelCheck(pAd, pAd->CommonCfg.Channel))
- {
- pAd->CommonCfg.RadarDetect.RDMode = RD_SILENCE_MODE;
- pAd->CommonCfg.RadarDetect.RDCount = 0;
-#ifdef DFS_SUPPORT
- BbpRadarDetectionStart(pAd);
-#endif // DFS_SUPPORT //
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - start a new IBSS = %02x:%02x:%02x:%02x:%02x:%02x ...\n",
- pAd->CommonCfg.Bssid[0],pAd->CommonCfg.Bssid[1],pAd->CommonCfg.Bssid[2],
- pAd->CommonCfg.Bssid[3],pAd->CommonCfg.Bssid[4],pAd->CommonCfg.Bssid[5]));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Start IBSS fail. BUG!!!!!\n"));
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitAuthProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Reason;
- MLME_ASSOC_REQ_STRUCT AssocReq;
- MLME_AUTH_REQ_STRUCT AuthReq;
-
- if (Elem->MsgType == MT2_AUTH_CONF)
- {
- NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
- if (Reason == MLME_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
- AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid, pAd->MlmeAux.CapabilityInfo,
- ASSOC_TIMEOUT, pAd->StaCfg.DefaultListenCount);
-
- {
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_ASSOC_REQ,
- sizeof(MLME_ASSOC_REQ_STRUCT), &AssocReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_ASSOC;
- }
- }
- else
- {
- // This fail may because of the AP already keep us in its MAC table without
- // ageing-out. The previous authentication attempt must have let it remove us.
- // so try Authentication again may help. For D-Link DWL-900AP+ compatibility.
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH FAIL, try again...\n"));
- {
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeShared) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch))
- {
- // either Ndis802_11AuthModeShared or Ndis802_11AuthModeAutoSwitch, try shared key first
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_KEY);
- }
- else
- {
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, AUTH_MODE_OPEN);
- }
- MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_MLME_AUTH_REQ,
- sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq);
-
- }
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_AUTH2;
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitAuthProc2(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Reason;
- MLME_ASSOC_REQ_STRUCT AssocReq;
- MLME_AUTH_REQ_STRUCT AuthReq;
-
- if (Elem->MsgType == MT2_AUTH_CONF)
- {
- NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
- if (Reason == MLME_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH OK\n"));
- AssocParmFill(pAd, &AssocReq, pAd->MlmeAux.Bssid, pAd->MlmeAux.CapabilityInfo,
- ASSOC_TIMEOUT, pAd->StaCfg.DefaultListenCount);
- {
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_ASSOC_REQ,
- sizeof(MLME_ASSOC_REQ_STRUCT), &AssocReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_ASSOC;
- }
- }
- else
- {
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeAutoSwitch) &&
- (pAd->MlmeAux.Alg == Ndis802_11AuthModeShared))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH FAIL, try OPEN system...\n"));
- AuthParmFill(pAd, &AuthReq, pAd->MlmeAux.Bssid, Ndis802_11AuthModeOpen);
- MlmeEnqueue(pAd, AUTH_STATE_MACHINE, MT2_MLME_AUTH_REQ,
- sizeof(MLME_AUTH_REQ_STRUCT), &AuthReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_AUTH2;
- }
- else
- {
- // not success, try next BSS
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - AUTH FAIL, give up; try next BSS\n"));
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE; //???????
- pAd->MlmeAux.BssIdx++;
- IterateOnBssTab(pAd);
- }
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitAssocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Reason;
-
- if (Elem->MsgType == MT2_ASSOC_CONF)
- {
- NdisMoveMemory(&Reason, Elem->Msg, sizeof(USHORT));
- if (Reason == MLME_SUCCESS)
- {
- if (pAd->CommonCfg.bWirelessEvent)
- {
- RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
-
- LinkUp(pAd, BSS_INFRA);
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Association successful on BSS #%ld\n",pAd->MlmeAux.BssIdx));
- }
- else
- {
- // not success, try next BSS
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Association fails on BSS #%ld\n",pAd->MlmeAux.BssIdx));
- pAd->MlmeAux.BssIdx++;
- IterateOnBssTab(pAd);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID CntlWaitReassocProc(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Result;
-
- if (Elem->MsgType == MT2_REASSOC_CONF)
- {
- NdisMoveMemory(&Result, Elem->Msg, sizeof(USHORT));
- if (Result == MLME_SUCCESS)
- {
- // send wireless event - for association
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_ASSOC_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-
- //
- // NDIS requires a new Link UP indication but no Link Down for RE-ASSOC
- //
- LinkUp(pAd, BSS_INFRA);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Re-assocition successful on BSS #%ld\n", pAd->MlmeAux.RoamIdx));
- }
- else
- {
- // reassoc failed, try to pick next BSS in the BSS Table
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - Re-assocition fails on BSS #%ld\n", pAd->MlmeAux.RoamIdx));
- {
- pAd->MlmeAux.RoamIdx++;
- IterateOnBssTab2(pAd);
- }
- }
- }
-}
-
-
-VOID AdhocTurnOnQos(
- IN PRTMP_ADAPTER pAd)
-{
-#define AC0_DEF_TXOP 0
-#define AC1_DEF_TXOP 0
-#define AC2_DEF_TXOP 94
-#define AC3_DEF_TXOP 47
-
- // Turn on QOs if use HT rate.
- if (pAd->CommonCfg.APEdcaParm.bValid == FALSE)
- {
- pAd->CommonCfg.APEdcaParm.bValid = TRUE;
- pAd->CommonCfg.APEdcaParm.Aifsn[0] = 3;
- pAd->CommonCfg.APEdcaParm.Aifsn[1] = 7;
- pAd->CommonCfg.APEdcaParm.Aifsn[2] = 1;
- pAd->CommonCfg.APEdcaParm.Aifsn[3] = 1;
-
- pAd->CommonCfg.APEdcaParm.Cwmin[0] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[1] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmin[2] = 3;
- pAd->CommonCfg.APEdcaParm.Cwmin[3] = 2;
-
- pAd->CommonCfg.APEdcaParm.Cwmax[0] = 10;
- pAd->CommonCfg.APEdcaParm.Cwmax[1] = 6;
- pAd->CommonCfg.APEdcaParm.Cwmax[2] = 4;
- pAd->CommonCfg.APEdcaParm.Cwmax[3] = 3;
-
- pAd->CommonCfg.APEdcaParm.Txop[0] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[1] = 0;
- pAd->CommonCfg.APEdcaParm.Txop[2] = AC2_DEF_TXOP;
- pAd->CommonCfg.APEdcaParm.Txop[3] = AC3_DEF_TXOP;
- }
- AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID LinkUp(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR BssType)
-{
- ULONG Now;
- UINT32 Data;
- BOOLEAN Cancelled;
- UCHAR Value = 0, idx = 0, HashIdx = 0;
- MAC_TABLE_ENTRY *pEntry = NULL, *pCurrEntry = NULL;
-
- // Init ChannelQuality to prevent DEAD_CQI at initial LinkUp
- pAd->Mlme.ChannelQuality = 50;
-
- pEntry = MacTableLookup(pAd, pAd->CommonCfg.Bssid);
- if (pEntry)
- {
- MacTableDeleteEntry(pAd, pEntry->Aid, pEntry->Addr);
- pEntry = NULL;
- }
-
-
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
-
- //
- // ASSOC - DisassocTimeoutAction
- // CNTL - Dis-associate successful
- // !!! LINK DOWN !!!
- // [88888] OID_802_11_SSID should have returned NDTEST_WEP_AP2(Returned: )
- //
- // To prevent DisassocTimeoutAction to call Link down after we link up,
- // cancel the DisassocTimer no matter what it start or not.
- //
- RTMPCancelTimer(&pAd->MlmeAux.DisassocTimer, &Cancelled);
-
- COPY_SETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
-
-#ifdef DOT11_N_SUPPORT
- COPY_HTSETTINGS_FROM_MLME_AUX_TO_ACTIVE_CFG(pAd);
-#endif // DOT11_N_SUPPORT //
-
-#ifdef RTMP_MAC_PCI
- // Before power save before link up function, We will force use 1R.
- // So after link up, check Rx antenna # again.
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- if(pAd->Antenna.field.RxPath == 3)
- {
- Value |= (0x10);
- }
- else if(pAd->Antenna.field.RxPath == 2)
- {
- Value |= (0x8);
- }
- else if(pAd->Antenna.field.RxPath == 1)
- {
- Value |= (0x0);
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
- pAd->StaCfg.BBPR3 = Value;
-#endif // RTMP_MAC_PCI //
-
- if (BssType == BSS_ADHOC)
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_ADHOC_ON);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
-
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- // No carrier detection when adhoc
- // CarrierDetectionStop(pAd);
- pAd->CommonCfg.CarrierDetect.CD_State = CD_NORMAL;
-#endif // CARRIER_DETECTION_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- AdhocTurnOnQos(pAd);
-#endif // DOT11_N_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!Adhoc LINK UP !!! \n" ));
- }
- else
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_INFRA_ON);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!Infra LINK UP !!! \n" ));
- }
-
- // 3*3
- // reset Tx beamforming bit
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x01);
- Value |= pAd->CommonCfg.RegTransmitSetting.field.TxBF;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
-#ifdef DOT11_N_SUPPORT
- // Change to AP channel
- if ((pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- // Must using 40MHz.
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- Value |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- // RX : control channel at lower
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value &= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RTMP_MAC_PCI
- pAd->StaCfg.BBPR3 = Value;
-#endif // RTMP_MAC_PCI //
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data &= 0xfffffffe;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!!40MHz Lower LINK UP !!! Control Channel at Below. Central = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- else if ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel) && (pAd->MlmeAux.HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- // Must using 40MHz.
- pAd->CommonCfg.BBPCurrentBW = BW_40;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- Value |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data |= 0x1;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value |= (0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RTMP_MAC_PCI
- pAd->StaCfg.BBPR3 = Value;
-#endif // RTMP_MAC_PCI //
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x1A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x0A);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x16);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!! 40MHz Upper LINK UP !!! Control Channel at UpperCentral = %d \n", pAd->CommonCfg.CentralChannel ));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- pAd->CommonCfg.BBPCurrentBW = BW_20;
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &Value);
- Value &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, Value);
-
- RTMP_IO_READ32(pAd, TX_BAND_CFG, &Data);
- Data &= 0xfffffffe;
- RTMP_IO_WRITE32(pAd, TX_BAND_CFG, Data);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R3, &Value);
- Value &= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, Value);
-#ifdef RTMP_MAC_PCI
- pAd->StaCfg.BBPR3 = Value;
-#endif // RTMP_MAC_PCI //
-
- if (pAd->MACVersion == 0x28600100)
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R69, 0x16);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R70, 0x08);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R73, 0x11);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!rt2860C !!! \n" ));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!! 20MHz LINK UP !!! \n" ));
- }
-
- RTMPSetAGCInitValue(pAd, pAd->CommonCfg.BBPCurrentBW);
- //
- // Save BBP_R66 value, it will be used in RTUSBResumeMsduTransmission
- //
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R66, &pAd->BbpTuning.R66CurrentValue);
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK UP !!! (BssType=%d, AID=%d, ssid=%s, Channel=%d, CentralChannel = %d)\n",
- BssType, pAd->StaActive.Aid, pAd->CommonCfg.Ssid, pAd->CommonCfg.Channel, pAd->CommonCfg.CentralChannel));
-
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK UP !!! (Density =%d, )\n", pAd->MacTab.Content[BSSID_WCID].MpduDensity));
-#endif // DOT11_N_SUPPORT //
-
- AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
-
- AsicSetSlotTime(pAd, TRUE);
- AsicSetEdcaParm(pAd, &pAd->CommonCfg.APEdcaParm);
-
-
- // Call this for RTS protectionfor legacy rate, we will always enable RTS threshold, but normally it will not hit
- AsicUpdateProtect(pAd, 0, (OFDMSETPROTECT | CCKSETPROTECT), TRUE, FALSE);
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE))
- {
- // Update HT protectionfor based on AP's operating mode.
- if (pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1)
- {
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, TRUE);
- }
- else
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE);
- }
-#endif // DOT11_N_SUPPORT //
-
- NdisZeroMemory(&pAd->DrsCounters, sizeof(COUNTER_DRS));
-
- NdisGetSystemUpTime(&Now);
- pAd->StaCfg.LastBeaconRxTime = Now; // last RX timestamp
-
- if ((pAd->CommonCfg.TxPreamble != Rt802_11PreambleLong) &&
- CAP_IS_SHORT_PREAMBLE_ON(pAd->StaActive.CapabilityInfo))
- {
- MlmeSetTxPreamble(pAd, Rt802_11PreambleShort);
- }
-
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
-
- if (pAd->CommonCfg.RadarDetect.RDMode == RD_SILENCE_MODE)
- {
-#ifdef DFS_SUPPORT
- RadarDetectionStop(pAd);
-#endif // DFS_SUPPORT //
- }
- pAd->CommonCfg.RadarDetect.RDMode = RD_NORMAL_MODE;
-
- if (BssType == BSS_ADHOC)
- {
- MakeIbssBeacon(pAd);
- if ((pAd->CommonCfg.Channel > 14)
- && (pAd->CommonCfg.bIEEE80211H == 1)
- && RadarChannelCheck(pAd, pAd->CommonCfg.Channel))
- {
- ; //Do nothing
- }
- else
- {
- AsicEnableIbssSync(pAd);
- }
-
- // In ad hoc mode, use MAC table from index 1.
- // p.s ASIC use all 0xff as termination of WCID table search.To prevent it's 0xff-ff-ff-ff-ff-ff, Write 0 here.
- RTMP_IO_WRITE32(pAd, MAC_WCID_BASE, 0x00);
- RTMP_IO_WRITE32(pAd, 0x1808, 0x00);
-
- // If WEP is enabled, add key material and cipherAlg into Asic
- // Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000)
-
- if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)
- {
- PUCHAR Key;
- UCHAR CipherAlg;
-
- for (idx=0; idx < SHARE_KEY_NUM; idx++)
- {
- CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
- Key = pAd->SharedKey[BSS0][idx].Key;
-
- if (pAd->SharedKey[BSS0][idx].KeyLen > 0)
- {
- // Set key material and cipherAlg to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, idx, CipherAlg, Key, NULL, NULL);
-
- if (idx == pAd->StaCfg.DefaultKeyId)
- {
- // Update WCID attribute table and IVEIV table for this group key table
- RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, NULL);
- }
- }
-
-
- }
- }
- // If WPANone is enabled, add key material and cipherAlg into Asic
- // Fill in Shared Key Table(offset: 0x6c00) and Shared Key Mode(offset: 0x7000)
- else if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- pAd->StaCfg.DefaultKeyId = 0; // always be zero
-
- NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, pAd->StaCfg.PMK, LEN_TKIP_EK);
-
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- {
- NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, &pAd->StaCfg.PMK[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, &pAd->StaCfg.PMK[16], LEN_TKIP_TXMICK);
- }
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Unknow Cipher (=%d), set Cipher to AES\n", pAd->StaCfg.PairCipher));
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
- }
-
- // Set key material and cipherAlg to Asic
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pAd->SharedKey[BSS0][0].Key,
- pAd->SharedKey[BSS0][0].TxMic,
- pAd->SharedKey[BSS0][0].RxMic);
-
- // Update WCID attribute table and IVEIV table for this group key table
- RTMPAddWcidAttributeEntry(pAd, BSS0, 0, pAd->SharedKey[BSS0][0].CipherAlg, NULL);
-
- }
-
- }
- else // BSS_INFRA
- {
- // Check the new SSID with last SSID
- while (Cancelled == TRUE)
- {
- if (pAd->CommonCfg.LastSsidLen == pAd->CommonCfg.SsidLen)
- {
- if (RTMPCompareMemory(pAd->CommonCfg.LastSsid, pAd->CommonCfg.Ssid, pAd->CommonCfg.LastSsidLen) == 0)
- {
- // Link to the old one no linkdown is required.
- break;
- }
- }
- // Send link down event before set to link up
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event AA!\n"));
- break;
- }
-
- //
- // On WPA mode, Remove All Keys if not connect to the last BSSID
- // Key will be set after 4-way handshake.
- //
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- ULONG IV;
-
- // Remove all WPA keys
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- RTMPWPARemoveAllKeys(pAd);
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
-
- // Fixed connection failed with Range Maximizer - 515 AP (Marvell Chip) when security is WPAPSK/TKIP
- // If IV related values are too large in GroupMsg2, AP would ignore this message.
- IV = 1;
- IV |= (pAd->StaCfg.DefaultKeyId << 30);
- AsicUpdateWCIDIVEIV(pAd, BSSID_WCID, IV, 0);
- //RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
- }
-
- // NOTE:
- // the decision of using "short slot time" or not may change dynamically due to
- // new STA association to the AP. so we have to decide that upon parsing BEACON, not here
-
- // NOTE:
- // the decision to use "RTC/CTS" or "CTS-to-self" protection or not may change dynamically
- // due to new STA association to the AP. so we have to decide that upon parsing BEACON, not here
-
- ComposePsPoll(pAd);
- ComposeNullFrame(pAd);
-
- AsicEnableBssSync(pAd);
-
- // Add BSSID to WCID search table
- AsicUpdateRxWCIDTable(pAd, BSSID_WCID, pAd->CommonCfg.Bssid);
-
- // If WEP is enabled, add paiewise and shared key
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (((pAd->StaCfg.WpaSupplicantUP)&&
- (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)&&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)) ||
- ((pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)&&
- (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)))
-#else
- if (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled)
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- PUCHAR Key;
- UCHAR CipherAlg;
-
- for (idx=0; idx < SHARE_KEY_NUM; idx++)
- {
- CipherAlg = pAd->SharedKey[BSS0][idx].CipherAlg;
- Key = pAd->SharedKey[BSS0][idx].Key;
-
- if (pAd->SharedKey[BSS0][idx].KeyLen > 0)
- {
- // Set key material and cipherAlg to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, idx, CipherAlg, Key, NULL, NULL);
-
- if (idx == pAd->StaCfg.DefaultKeyId)
- {
- // Assign group key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, NULL);
-
- pEntry->Aid = BSSID_WCID;
- // Assign pairwise key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, pEntry);
- }
- }
- }
- }
-
- // only INFRASTRUCTURE mode need to indicate connectivity immediately; ADHOC mode
- // should wait until at least 2 active nodes in this BSSID.
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
-
- // For GUI ++
- if (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA)
- {
- pAd->IndicateMediaState = NdisMediaStateConnected;
- pAd->ExtraInfo = GENERAL_LINK_UP;
- RTMP_IndicateMediaState(pAd);
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_DISABLE)
-#endif // WPA_SUPPLICANT_SUPPORT //
- RTMPSetTimer(&pAd->Mlme.LinkDownTimer, LINK_DOWN_TIMEOUT);
- }
- // --
-
- // Add BSSID in my MAC Table.
- NdisAcquireSpinLock(&pAd->MacTabLock);
- // add this MAC entry into HASH table
- if (pEntry)
- {
- HashIdx = MAC_ADDR_HASH_INDEX(pAd->CommonCfg.Bssid);
- if (pAd->MacTab.Hash[HashIdx] == NULL)
- {
- pAd->MacTab.Hash[HashIdx] = pEntry;
- }
- else
- {
- pCurrEntry = pAd->MacTab.Hash[HashIdx];
- while (pCurrEntry->pNext != NULL)
- {
- pCurrEntry = pCurrEntry->pNext;
- }
- pCurrEntry->pNext = pEntry;
- }
- }
- RTMPMoveMemory(pEntry->Addr, pAd->CommonCfg.Bssid, MAC_ADDR_LEN);
- pEntry->Aid = BSSID_WCID;
- pEntry->pAd = pAd;
- pEntry->ValidAsCLI = TRUE; //Although this is bssid..still set ValidAsCl
- pAd->MacTab.Size = 1; // infra mode always set MACtab size =1.
- pEntry->Sst = SST_ASSOC;
- pEntry->AuthState = SST_ASSOC;
- pEntry->AuthMode = pAd->StaCfg.AuthMode;
- pEntry->WepStatus = pAd->StaCfg.WepStatus;
- if (pEntry->AuthMode < Ndis802_11AuthModeWPA)
- {
- pEntry->WpaState = AS_NOTUSE;
- pEntry->PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
- }
- else
- {
- pEntry->WpaState = AS_PTKSTART;
- pEntry->PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
- }
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK UP !!! ClientStatusFlags=%lx)\n",
- pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
-
-
- MlmeUpdateTxRates(pAd, TRUE, BSS0);
-#ifdef DOT11_N_SUPPORT
- MlmeUpdateHtTxRates(pAd, BSS0);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK UP !! (StaActive.bHtEnable =%d, )\n", pAd->StaActive.SupportedPhyInfo.bHtEnable));
-#endif // DOT11_N_SUPPORT //
-
-
- if (pAd->CommonCfg.bAggregationCapable)
- {
- if ((pAd->CommonCfg.bPiggyBackCapable) && (pAd->MlmeAux.APRalinkIe & 0x00000003) == 3)
- {
-
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_PIGGYBACK_INUSED);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE);
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_PIGGYBACK_CAPABLE);
- RTMPSetPiggyBack(pAd, TRUE);
- DBGPRINT(RT_DEBUG_TRACE, ("Turn on Piggy-Back\n"));
- }
- else if (pAd->MlmeAux.APRalinkIe & 0x00000001)
- {
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_AGGREGATION_CAPABLE);
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
- }
- }
-
- if (pAd->MlmeAux.APRalinkIe != 0x0)
- {
-#ifdef DOT11_N_SUPPORT
- if (CLIENT_STATUS_TEST_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RDG_CAPABLE))
- {
- AsicEnableRDG(pAd);
- }
-#endif // DOT11_N_SUPPORT //
- OPSTATUS_SET_FLAG(pAd, fCLIENT_STATUS_RALINK_CHIPSET);
- CLIENT_STATUS_SET_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RALINK_CHIPSET);
- }
- else
- {
- OPSTATUS_CLEAR_FLAG(pAd, fCLIENT_STATUS_RALINK_CHIPSET);
- CLIENT_STATUS_CLEAR_FLAG(&pAd->MacTab.Content[BSSID_WCID], fCLIENT_STATUS_RALINK_CHIPSET);
- }
- }
-
-
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_CONNECT Event B!.BACapability = %x. ClientStatusFlags = %lx\n", pAd->CommonCfg.BACapability.word, pAd->MacTab.Content[BSSID_WCID].ClientStatusFlags));
-#endif // DOT11_N_SUPPORT //
-
- // Set LED
- RTMPSetLED(pAd, LED_LINK_UP);
-
- pAd->Mlme.PeriodicRound = 0;
- pAd->Mlme.OneSecPeriodicRound = 0;
- pAd->bConfigChanged = FALSE; // Reset config flag
- pAd->ExtraInfo = GENERAL_LINK_UP; // Update extra information to link is up
-
- // Set asic auto fall back
- {
- PUCHAR pTable;
- UCHAR TableSize = 0;
-
- MlmeSelectTxRateTable(pAd, &pAd->MacTab.Content[BSSID_WCID], &pTable, &TableSize, &pAd->CommonCfg.TxRateIndex);
- AsicUpdateAutoFallBackTable(pAd, pTable);
- }
-
- NdisAcquireSpinLock(&pAd->MacTabLock);
- pEntry->HTPhyMode.word = pAd->StaCfg.HTPhyMode.word;
- pEntry->MaxHTPhyMode.word = pAd->StaCfg.HTPhyMode.word;
- if (pAd->StaCfg.bAutoTxRateSwitch == FALSE)
- {
- pEntry->bAutoTxRateSwitch = FALSE;
-#ifdef DOT11_N_SUPPORT
- if (pEntry->HTPhyMode.field.MCS == 32)
- pEntry->HTPhyMode.field.ShortGI = GI_800;
-
- if ((pEntry->HTPhyMode.field.MCS > MCS_7) || (pEntry->HTPhyMode.field.MCS == 32))
- pEntry->HTPhyMode.field.STBC = STBC_NONE;
-#endif // DOT11_N_SUPPORT //
- // If the legacy mode is set, overwrite the transmit setting of this entry.
- if (pEntry->HTPhyMode.field.MODE <= MODE_OFDM)
- RTMPUpdateLegacyTxSetting((UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode, pEntry);
- }
- else
- pEntry->bAutoTxRateSwitch = TRUE;
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
- // Let Link Status Page display first initial rate.
- pAd->LastTxRate = (USHORT)(pEntry->HTPhyMode.word);
- // Select DAC according to HT or Legacy
- if (pAd->StaActive.SupportedPhyInfo.MCSSet[0] != 0x00)
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value);
- Value &= (~0x18);
- if (pAd->Antenna.field.TxPath == 2)
- {
- Value |= 0x10;
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, Value);
- }
- else
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &Value);
- Value &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, Value);
- }
-
-#ifdef DOT11_N_SUPPORT
- if (pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE)
- {
- }
- else if (pEntry->MaxRAmpduFactor == 0)
- {
- // If HT AP doesn't support MaxRAmpduFactor = 1, we need to set max PSDU to 0.
- // Because our Init value is 1 at MACRegTable.
- RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x0fff);
- }
-#endif // DOT11_N_SUPPORT //
-
- // Patch for Marvel AP to gain high throughput
- // Need to set as following,
- // 1. Set txop in register-EDCA_AC0_CFG as 0x60
- // 2. Set EnTXWriteBackDDONE in register-WPDMA_GLO_CFG as zero
- // 3. PBF_MAX_PCNT as 0x1F3FBF9F
- // 4. kick per two packets when dequeue
- //
- // Txop can only be modified when RDG is off, WMM is disable and TxBurst is enable
- //
- // if 1. Legacy AP WMM on, or 2. 11n AP, AMPDU disable. Force turn off burst no matter what bEnableTxBurst is.
-#ifdef DOT11_N_SUPPORT
- if (!((pAd->CommonCfg.RxStream == 1)&&(pAd->CommonCfg.TxStream == 1)) &&
- (pAd->StaCfg.bForceTxBurst == FALSE) &&
- (((pAd->StaActive.SupportedPhyInfo.bHtEnable == FALSE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED))
- || ((pAd->StaActive.SupportedPhyInfo.bHtEnable == TRUE) && (pAd->CommonCfg.BACapability.field.Policy == BA_NOTUSE))))
- {
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
- Data &= 0xFFFFFF00;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Data);
-
- RTMP_IO_WRITE32(pAd, PBF_MAX_PCNT, 0x1F3F7F9F);
- DBGPRINT(RT_DEBUG_TRACE, ("Txburst 1\n"));
- }
- else
-#endif // DOT11_N_SUPPORT //
- if (pAd->CommonCfg.bEnableTxBurst)
- {
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
- Data &= 0xFFFFFF00;
- Data |= 0x60;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Data);
- pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = TRUE;
-
- RTMP_IO_WRITE32(pAd, PBF_MAX_PCNT, 0x1F3FBF9F);
- DBGPRINT(RT_DEBUG_TRACE, ("Txburst 2\n"));
- }
- else
- {
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &Data);
- Data &= 0xFFFFFF00;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, Data);
-
- RTMP_IO_WRITE32(pAd, PBF_MAX_PCNT, 0x1F3F7F9F);
- DBGPRINT(RT_DEBUG_TRACE, ("Txburst 3\n"));
- }
-
-#ifdef DOT11_N_SUPPORT
- // Re-check to turn on TX burst or not.
- if ((pAd->CommonCfg.IOTestParm.bLastAtheros == TRUE) && ((STA_WEP_ON(pAd))||(STA_TKIP_ON(pAd))))
- {
- pAd->CommonCfg.IOTestParm.bNextDisableRxBA = TRUE;
- if (pAd->CommonCfg.bEnableTxBurst)
- {
- UINT32 MACValue = 0;
- // Force disable TXOP value in this case. The same action in MLMEUpdateProtect too.
- // I didn't change PBF_MAX_PCNT setting.
- RTMP_IO_READ32(pAd, EDCA_AC0_CFG, &MACValue);
- MACValue &= 0xFFFFFF00;
- RTMP_IO_WRITE32(pAd, EDCA_AC0_CFG, MACValue);
- pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = FALSE;
- }
- }
- else
- {
- pAd->CommonCfg.IOTestParm.bNextDisableRxBA = FALSE;
- }
-#endif // DOT11_N_SUPPORT //
-
- pAd->CommonCfg.IOTestParm.bLastAtheros = FALSE;
- COPY_MAC_ADDR(pAd->CommonCfg.LastBssid, pAd->CommonCfg.Bssid);
- DBGPRINT(RT_DEBUG_TRACE, ("!!!pAd->bNextDisableRxBA= %d \n", pAd->CommonCfg.IOTestParm.bNextDisableRxBA));
- // BSSID add in one MAC entry too. Because in Tx, ASIC need to check Cipher and IV/EIV, BAbitmap
- // Pther information in MACTab.Content[BSSID_WCID] is not necessary for driver.
- // Note: As STA, The MACTab.Content[BSSID_WCID]. PairwiseKey and Shared Key for BSS0 are the same.
-
- if (pAd->StaCfg.WepStatus <= Ndis802_11WEPDisabled)
- {
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP &&
- (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) &&
- (pAd->StaCfg.IEEE8021X == TRUE))
- ;
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilterAcceptAll;
- }
- }
-
- NdisAcquireSpinLock(&pAd->MacTabLock);
- pEntry->PortSecured = pAd->StaCfg.PortSecured;
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
- //
- // Patch Atheros AP TX will breakdown issue.
- // AP Model: DLink DWL-8200AP
- //
- if (INFRA_ON(pAd) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) && STA_TKIP_ON(pAd))
- {
- RTMP_IO_WRITE32(pAd, RX_PARSER_CFG, 0x01);
- }
- else
- {
- RTMP_IO_WRITE32(pAd, RX_PARSER_CFG, 0x00);
- }
-
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- if ((pAd->CommonCfg.BACapability.field.b2040CoexistScanSup) && (pAd->CommonCfg.Channel <= 11))
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_SCAN_2040);
- BuildEffectedChannelList(pAd);
- }
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-}
-
-/*
- ==========================================================================
-
- Routine Description:
- Disconnect current BSSID
-
- Arguments:
- pAd - Pointer to our adapter
- IsReqFromAP - Request from AP
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
- We need more information to know it's this requst from AP.
- If yes! we need to do extra handling, for example, remove the WPA key.
- Otherwise on 4-way handshaking will faied, since the WPA key didn't be
- remove while auto reconnect.
- Disconnect request from AP, it means we will start afresh 4-way handshaking
- on WPA mode.
-
- ==========================================================================
-*/
-VOID LinkDown(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN IsReqFromAP)
-{
- UCHAR i, ByteValue = 0;
-
- BOOLEAN Cancelled;
-
- // Do nothing if monitor mode is on
- if (MONITOR_ON(pAd))
- return;
-
-#ifdef RALINK_ATE
- // Nothing to do in ATE mode.
- if (ATE_ON(pAd))
- return;
-#endif // RALINK_ATE //
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_GO_TO_SLEEP_NOW);
- //Comment the codes, beasue the line 2291 call the same function.
- //RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
- // Not allow go to sleep within linkdown function.
- RTMP_CLEAR_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-
- if (pAd->CommonCfg.bWirelessEvent)
- {
- RTMPSendWirelessEvent(pAd, IW_STA_LINKDOWN_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN !!!\n"));
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED);
-
-#ifdef RTMP_MAC_PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- BOOLEAN Cancelled;
- pAd->Mlme.bPsPollTimerRunning = FALSE;
- RTMPCancelTimer(&pAd->Mlme.PsPollTimer, &Cancelled);
- }
-
- pAd->bPCIclkOff = FALSE;
-#endif // RTMP_MAC_PCI //
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE)
-|| RTMP_TEST_PSFLAG(pAd, fRTMP_PS_SET_PCI_CLK_OFF_COMMAND)
- || RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF))
- {
- AUTO_WAKEUP_STRUC AutoWakeupCfg;
- AsicForceWakeup(pAd, TRUE);
- AutoWakeupCfg.word = 0;
- RTMP_IO_WRITE32(pAd, AUTO_WAKEUP_CFG, AutoWakeupCfg.word);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_DOZE);
- }
-#ifdef RTMP_MAC_PCI
- pAd->bPCIclkOff = FALSE;
-#endif // RTMP_MAC_PCI //
- if (ADHOC_ON(pAd)) // Adhoc mode link down
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 1!!!\n"));
-
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_ADHOC_ON);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- BssTableDeleteEntry(&pAd->ScanTab, pAd->CommonCfg.Bssid, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MacTab.Size=%d !!!\n", pAd->MacTab.Size));
- }
- else // Infra structure mode
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! LINK DOWN 2!!!\n"));
-
-#ifdef QOS_DLS_SUPPORT
- // DLS tear down frame must be sent before link down
- // send DLS-TEAR_DOWN message
- if (pAd->CommonCfg.bDLSCapable)
- {
- // tear down local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- // tear down peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
- }
-#endif // QOS_DLS_SUPPORT //
-
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_INFRA_ON);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
-
- // Saved last SSID for linkup comparison
- pAd->CommonCfg.LastSsidLen = pAd->CommonCfg.SsidLen;
- NdisMoveMemory(pAd->CommonCfg.LastSsid, pAd->CommonCfg.Ssid, pAd->CommonCfg.LastSsidLen);
- COPY_MAC_ADDR(pAd->CommonCfg.LastBssid, pAd->CommonCfg.Bssid);
- if (pAd->MlmeAux.CurrReqIsFromNdis == TRUE)
- {
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event A!\n"));
- pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
- }
- else
- {
- //
- // If disassociation request is from NDIS, then we don't need to delete BSSID from entry.
- // Otherwise lost beacon or receive De-Authentication from AP,
- // then we should delete BSSID from BssTable.
- // If we don't delete from entry, roaming will fail.
- //
- BssTableDeleteEntry(&pAd->ScanTab, pAd->CommonCfg.Bssid, pAd->CommonCfg.Channel);
- }
-
- // restore back to -
- // 1. long slot (20 us) or short slot (9 us) time
- // 2. turn on/off RTS/CTS and/or CTS-to-self protection
- // 3. short preamble
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED);
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- // Country IE of the AP will be evaluated and will be used.
- if (pAd->StaCfg.IEEE80211dClientMode != Rt802_11_D_None)
- {
- NdisMoveMemory(&pAd->CommonCfg.CountryCode[0], &pAd->StaCfg.StaOriCountryCode[0], 2);
- pAd->CommonCfg.Geography = pAd->StaCfg.StaOriGeography;
- BuildChannelListEx(pAd);
- }
-#endif // EXT_BUILD_CHANNEL_LIST //
-
- }
-
-
- for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- if (pAd->MacTab.Content[i].ValidAsCLI == TRUE)
- MacTableDeleteEntry(pAd, pAd->MacTab.Content[i].Aid, pAd->MacTab.Content[i].Addr);
- }
-
- AsicSetSlotTime(pAd, TRUE); //FALSE);
- AsicSetEdcaParm(pAd, NULL);
-
- // Set LED
- RTMPSetLED(pAd, LED_LINK_DOWN);
- pAd->LedIndicatorStrength = 0xF0;
- RTMPSetSignalLED(pAd, -100); // Force signal strength Led to be turned off, firmware is not done it.
-
- AsicDisableSync(pAd);
-
- pAd->Mlme.PeriodicRound = 0;
- pAd->Mlme.OneSecPeriodicRound = 0;
-
- if (pAd->StaCfg.BssType == BSS_INFRA)
- {
- // Remove StaCfg Information after link down
- NdisZeroMemory(pAd->CommonCfg.Bssid, MAC_ADDR_LEN);
- NdisZeroMemory(pAd->CommonCfg.Ssid, MAX_LEN_OF_SSID);
- pAd->CommonCfg.SsidLen = 0;
- }
-#ifdef DOT11_N_SUPPORT
- NdisZeroMemory(&pAd->MlmeAux.HtCapability, sizeof(HT_CAPABILITY_IE));
- NdisZeroMemory(&pAd->MlmeAux.AddHtInfo, sizeof(ADD_HT_INFO_IE));
- pAd->MlmeAux.HtCapabilityLen = 0;
- pAd->MlmeAux.NewExtChannelOffset = 0xff;
-#endif // DOT11_N_SUPPORT //
-
- // Reset WPA-PSK state. Only reset when supplicant enabled
- if (pAd->StaCfg.WpaState != SS_NOTUSE)
- {
- pAd->StaCfg.WpaState = SS_START;
- // Clear Replay counter
- NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
-
-#ifdef QOS_DLS_SUPPORT
- if (pAd->CommonCfg.bDLSCapable)
- NdisZeroMemory(pAd->StaCfg.DlsReplayCounter, 8);
-#endif // QOS_DLS_SUPPORT //
- }
-
- //
- // if link down come from AP, we need to remove all WPA keys on WPA mode.
- // otherwise will cause 4-way handshaking failed, since the WPA key not empty.
- //
- if ((IsReqFromAP) && (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
- {
- // Remove all WPA keys
- RTMPWPARemoveAllKeys(pAd);
- }
-
- // 802.1x port control
-#ifdef WPA_SUPPLICANT_SUPPORT
- // Prevent clear PortSecured here with static WEP
- // NetworkManger set security policy first then set SSID to connect AP.
- if (pAd->StaCfg.WpaSupplicantUP &&
- (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled) &&
- (pAd->StaCfg.IEEE8021X == FALSE))
- {
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- pAd->StaCfg.PrivacyFilter = Ndis802_11PrivFilter8021xWEP;
- }
-
- NdisAcquireSpinLock(&pAd->MacTabLock);
- NdisZeroMemory(&pAd->MacTab, sizeof(MAC_TABLE));
- pAd->MacTab.Content[BSSID_WCID].PortSecured = pAd->StaCfg.PortSecured;
- NdisReleaseSpinLock(&pAd->MacTabLock);
-
- pAd->StaCfg.MicErrCnt = 0;
-
- pAd->IndicateMediaState = NdisMediaStateDisconnected;
- // Update extra information to link is up
- pAd->ExtraInfo = GENERAL_LINK_DOWN;
-
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
-
-
- // Clean association information
- NdisZeroMemory(&pAd->StaCfg.AssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
- pAd->StaCfg.AssocInfo.Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
- pAd->StaCfg.ReqVarIELen = 0;
- pAd->StaCfg.ResVarIELen = 0;
-
- //
- // Reset RSSI value after link down
- //
- pAd->StaCfg.RssiSample.AvgRssi0 = 0;
- pAd->StaCfg.RssiSample.AvgRssi0X8 = 0;
- pAd->StaCfg.RssiSample.AvgRssi1 = 0;
- pAd->StaCfg.RssiSample.AvgRssi1X8 = 0;
- pAd->StaCfg.RssiSample.AvgRssi2 = 0;
- pAd->StaCfg.RssiSample.AvgRssi2X8 = 0;
-
- // Restore MlmeRate
- pAd->CommonCfg.MlmeRate = pAd->CommonCfg.BasicMlmeRate;
- pAd->CommonCfg.RtsRate = pAd->CommonCfg.BasicMlmeRate;
-
-#ifdef DOT11_N_SUPPORT
- //
- // After Link down, reset piggy-back setting in ASIC. Disable RDG.
- //
- if (pAd->CommonCfg.BBPCurrentBW == BW_40)
- {
- pAd->CommonCfg.BBPCurrentBW = BW_20;
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &ByteValue);
- ByteValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, ByteValue);
- }
-#endif // DOT11_N_SUPPORT //
- // Reset DAC
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R1, &ByteValue);
- ByteValue &= (~0x18);
- if (pAd->Antenna.field.TxPath == 2)
- {
- ByteValue |= 0x10;
- }
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R1, ByteValue);
-
- RTMPSetPiggyBack(pAd,FALSE);
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_PIGGYBACK_INUSED);
-
-#ifdef DOT11_N_SUPPORT
- pAd->CommonCfg.BACapability.word = pAd->CommonCfg.REGBACapability.word;
-#endif // DOT11_N_SUPPORT //
-
- // Restore all settings in the following.
- AsicUpdateProtect(pAd, 0, (ALLN_SETPROTECT|CCKSETPROTECT|OFDMSETPROTECT), TRUE, FALSE);
- AsicDisableRDG(pAd);
- pAd->CommonCfg.IOTestParm.bCurrentAtheros = FALSE;
- pAd->CommonCfg.IOTestParm.bNowAtherosBurstOn = FALSE;
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_SCAN_2040);
- pAd->CommonCfg.BSSCoexist2040.word = 0;
- TriEventInit(pAd);
- for (i = 0; i < (pAd->ChannelListNum - 1); i++)
- {
- pAd->ChannelList[i].bEffectedChannel = FALSE;
- }
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
- RTMP_IO_WRITE32(pAd, MAX_LEN_CFG, 0x1fff);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
-// Allow go to sleep after linkdown steps.
- RTMP_SET_PSFLAG(pAd, fRTMP_PS_CAN_GO_SLEEP);
-#ifdef WPA_SUPPLICANT_SUPPORT
-#ifndef NATIVE_WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP) {
- //send disassociate event to wpa_supplicant
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, RT_DISASSOC_EVENT_FLAG, NULL, NULL, 0);
- }
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- RtmpOSWrielessEventSend(pAd, SIOCGIWAP, -1, NULL, NULL, 0);
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
-
-#ifdef RT30xx
- if ((IS_RT30xx(pAd) || IS_RT3090(pAd)||IS_RT3390(pAd))
- &&(pAd->Antenna.field.RxPath>1||pAd->Antenna.field.TxPath>1))
- {
- RTMP_ASIC_MMPS_DISABLE(pAd);
- }
-#endif // RT30xx //
-
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID IterateOnBssTab(
- IN PRTMP_ADAPTER pAd)
-{
- MLME_START_REQ_STRUCT StartReq;
- MLME_JOIN_REQ_STRUCT JoinReq;
- ULONG BssIdx;
-
- // Change the wepstatus to original wepstatus
- pAd->StaCfg.WepStatus = pAd->StaCfg.OrigWepStatus;
- pAd->StaCfg.PairCipher = pAd->StaCfg.OrigWepStatus;
- pAd->StaCfg.GroupCipher = pAd->StaCfg.OrigWepStatus;
-
- BssIdx = pAd->MlmeAux.BssIdx;
- if (BssIdx < pAd->MlmeAux.SsidBssTab.BssNr)
- {
- // Check cipher suite, AP must have more secured cipher than station setting
- // Set the Pairwise and Group cipher to match the intended AP setting
- // We can only connect to AP with less secured cipher setting
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- pAd->StaCfg.GroupCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA.GroupCipher;
-
- if (pAd->StaCfg.WepStatus == pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA.PairCipher)
- pAd->StaCfg.PairCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA.PairCipher;
- else if (pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA.PairCipherAux != Ndis802_11WEPDisabled)
- pAd->StaCfg.PairCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA.PairCipherAux;
- else // There is no PairCipher Aux, downgrade our capability to TKIP
- pAd->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- pAd->StaCfg.GroupCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.GroupCipher;
-
- if (pAd->StaCfg.WepStatus == pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.PairCipher)
- pAd->StaCfg.PairCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.PairCipher;
- else if (pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.PairCipherAux != Ndis802_11WEPDisabled)
- pAd->StaCfg.PairCipher = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.PairCipherAux;
- else // There is no PairCipher Aux, downgrade our capability to TKIP
- pAd->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
-
- // RSN capability
- pAd->StaCfg.RsnCapability = pAd->MlmeAux.SsidBssTab.BssEntry[BssIdx].WPA2.RsnCapability;
- }
-
- // Set Mix cipher flag
- pAd->StaCfg.bMixCipher = (pAd->StaCfg.PairCipher == pAd->StaCfg.GroupCipher) ? FALSE : TRUE;
- /*if (pAd->StaCfg.bMixCipher == TRUE)
- {
- // If mix cipher, re-build RSNIE
- RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, 0);
- }*/
-
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - iterate BSS %ld of %d\n", BssIdx, pAd->MlmeAux.SsidBssTab.BssNr));
- JoinParmFill(pAd, &JoinReq, BssIdx);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_JOIN_REQ, sizeof(MLME_JOIN_REQ_STRUCT),
- &JoinReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_JOIN;
- }
- else if (pAd->StaCfg.BssType == BSS_ADHOC)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All BSS fail; start a new ADHOC (Ssid=%s)...\n",pAd->MlmeAux.Ssid));
- StartParmFill(pAd, &StartReq, (PCHAR)pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen);
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_MLME_START_REQ, sizeof(MLME_START_REQ_STRUCT), &StartReq);
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_START;
- }
- else // no more BSS
- {
-
-#ifdef DOT11_N_SUPPORT
-#endif // DOT11_N_SUPPORT //
- {
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All roaming failed, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
- }
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- }
-}
-
-// for re-association only
-// IRQL = DISPATCH_LEVEL
-VOID IterateOnBssTab2(
- IN PRTMP_ADAPTER pAd)
-{
- MLME_REASSOC_REQ_STRUCT ReassocReq;
- ULONG BssIdx;
- BSS_ENTRY *pBss;
-
- BssIdx = pAd->MlmeAux.RoamIdx;
- pBss = &pAd->MlmeAux.RoamTab.BssEntry[BssIdx];
-
- if (BssIdx < pAd->MlmeAux.RoamTab.BssNr)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - iterate BSS %ld of %d\n", BssIdx, pAd->MlmeAux.RoamTab.BssNr));
-
- AsicSwitchChannel(pAd, pBss->Channel, FALSE);
- AsicLockChannel(pAd, pBss->Channel);
-
- // reassociate message has the same structure as associate message
- AssocParmFill(pAd, &ReassocReq, pBss->Bssid, pBss->CapabilityInfo,
- ASSOC_TIMEOUT, pAd->StaCfg.DefaultListenCount);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_REASSOC_REQ,
- sizeof(MLME_REASSOC_REQ_STRUCT), &ReassocReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_REASSOC;
- }
- else // no more BSS
- {
-
-#ifdef DOT11_N_SUPPORT
-#endif // DOT11_N_SUPPORT //
- {
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("CNTL - All roaming failed, restore to channel %d, Total BSS[%02d]\n",pAd->CommonCfg.Channel, pAd->ScanTab.BssNr));
- }
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_IDLE;
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID JoinParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_JOIN_REQ_STRUCT *JoinReq,
- IN ULONG BssIdx)
-{
- JoinReq->BssIdx = BssIdx;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID ScanParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_SCAN_REQ_STRUCT *ScanReq,
- IN STRING Ssid[],
- IN UCHAR SsidLen,
- IN UCHAR BssType,
- IN UCHAR ScanType)
-{
- NdisZeroMemory(ScanReq->Ssid, MAX_LEN_OF_SSID);
- ScanReq->SsidLen = SsidLen;
- NdisMoveMemory(ScanReq->Ssid, Ssid, SsidLen);
- ScanReq->BssType = BssType;
- ScanReq->ScanType = ScanType;
-}
-
-#ifdef QOS_DLS_SUPPORT
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID DlsParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_DLS_REQ_STRUCT *pDlsReq,
- IN PRT_802_11_DLS pDls,
- IN USHORT reason)
-{
- pDlsReq->pDLS = pDls;
- pDlsReq->Reason = reason;
-}
-#endif // QOS_DLS_SUPPORT //
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID StartParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_START_REQ_STRUCT *StartReq,
- IN CHAR Ssid[],
- IN UCHAR SsidLen)
-{
- ASSERT(SsidLen <= MAX_LEN_OF_SSID);
- NdisMoveMemory(StartReq->Ssid, Ssid, SsidLen);
- StartReq->SsidLen = SsidLen;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-VOID AuthParmFill(
- IN PRTMP_ADAPTER pAd,
- IN OUT MLME_AUTH_REQ_STRUCT *AuthReq,
- IN PUCHAR pAddr,
- IN USHORT Alg)
-{
- COPY_MAC_ADDR(AuthReq->Addr, pAddr);
- AuthReq->Alg = Alg;
- AuthReq->Timeout = AUTH_TIMEOUT;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-#ifdef RTMP_MAC_PCI
-VOID ComposePsPoll(
- IN PRTMP_ADAPTER pAd)
-{
- NdisZeroMemory(&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
- pAd->PsPollFrame.FC.Type = BTYPE_CNTL;
- pAd->PsPollFrame.FC.SubType = SUBTYPE_PS_POLL;
- pAd->PsPollFrame.Aid = pAd->StaActive.Aid | 0xC000;
- COPY_MAC_ADDR(pAd->PsPollFrame.Bssid, pAd->CommonCfg.Bssid);
- COPY_MAC_ADDR(pAd->PsPollFrame.Ta, pAd->CurrentAddress);
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID ComposeNullFrame(
- IN PRTMP_ADAPTER pAd)
-{
- NdisZeroMemory(&pAd->NullFrame, sizeof(HEADER_802_11));
- pAd->NullFrame.FC.Type = BTYPE_DATA;
- pAd->NullFrame.FC.SubType = SUBTYPE_NULL_FUNC;
- pAd->NullFrame.FC.ToDs = 1;
- COPY_MAC_ADDR(pAd->NullFrame.Addr1, pAd->CommonCfg.Bssid);
- COPY_MAC_ADDR(pAd->NullFrame.Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pAd->NullFrame.Addr3, pAd->CommonCfg.Bssid);
-}
-#endif // RTMP_MAC_PCI //
-
-
-
-
-/*
- ==========================================================================
- Description:
- Pre-build a BEACON frame in the shared memory
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
-*/
-ULONG MakeIbssBeacon(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR DsLen = 1, IbssLen = 2;
- UCHAR LocalErpIe[3] = {IE_ERP, 1, 0x04};
- HEADER_802_11 BcnHdr;
- USHORT CapabilityInfo;
- LARGE_INTEGER FakeTimestamp;
- ULONG FrameLen = 0;
- PTXWI_STRUC pTxWI = &pAd->BeaconTxWI;
- UCHAR *pBeaconFrame = pAd->BeaconBuf;
- BOOLEAN Privacy;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen = 0;
- UCHAR ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR ExtRateLen = 0;
- UCHAR RSNIe = IE_WPA;
-
- if ((pAd->CommonCfg.PhyMode == PHY_11B) && (pAd->CommonCfg.Channel <= 14))
- {
- SupRate[0] = 0x82; // 1 mbps
- SupRate[1] = 0x84; // 2 mbps
- SupRate[2] = 0x8b; // 5.5 mbps
- SupRate[3] = 0x96; // 11 mbps
- SupRateLen = 4;
- ExtRateLen = 0;
- }
- else if (pAd->CommonCfg.Channel > 14)
- {
- SupRate[0] = 0x8C; // 6 mbps, in units of 0.5 Mbps, basic rate
- SupRate[1] = 0x12; // 9 mbps, in units of 0.5 Mbps
- SupRate[2] = 0x98; // 12 mbps, in units of 0.5 Mbps, basic rate
- SupRate[3] = 0x24; // 18 mbps, in units of 0.5 Mbps
- SupRate[4] = 0xb0; // 24 mbps, in units of 0.5 Mbps, basic rate
- SupRate[5] = 0x48; // 36 mbps, in units of 0.5 Mbps
- SupRate[6] = 0x60; // 48 mbps, in units of 0.5 Mbps
- SupRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
- SupRateLen = 8;
- ExtRateLen = 0;
-
- //
- // Also Update MlmeRate & RtsRate for G only & A only
- //
- pAd->CommonCfg.MlmeRate = RATE_6;
- pAd->CommonCfg.RtsRate = RATE_6;
- pAd->CommonCfg.MlmeTransmit.field.MODE = MODE_OFDM;
- pAd->CommonCfg.MlmeTransmit.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MODE = MODE_OFDM;
- pAd->MacTab.Content[BSS0Mcast_WCID].HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pAd->CommonCfg.MlmeRate];
- }
- else
- {
- SupRate[0] = 0x82; // 1 mbps
- SupRate[1] = 0x84; // 2 mbps
- SupRate[2] = 0x8b; // 5.5 mbps
- SupRate[3] = 0x96; // 11 mbps
- SupRateLen = 4;
-
- ExtRate[0] = 0x0C; // 6 mbps, in units of 0.5 Mbps,
- ExtRate[1] = 0x12; // 9 mbps, in units of 0.5 Mbps
- ExtRate[2] = 0x18; // 12 mbps, in units of 0.5 Mbps,
- ExtRate[3] = 0x24; // 18 mbps, in units of 0.5 Mbps
- ExtRate[4] = 0x30; // 24 mbps, in units of 0.5 Mbps,
- ExtRate[5] = 0x48; // 36 mbps, in units of 0.5 Mbps
- ExtRate[6] = 0x60; // 48 mbps, in units of 0.5 Mbps
- ExtRate[7] = 0x6c; // 54 mbps, in units of 0.5 Mbps
- ExtRateLen = 8;
- }
-
- pAd->StaActive.SupRateLen = SupRateLen;
- NdisMoveMemory(pAd->StaActive.SupRate, SupRate, SupRateLen);
- pAd->StaActive.ExtRateLen = ExtRateLen;
- NdisMoveMemory(pAd->StaActive.ExtRate, ExtRate, ExtRateLen);
-
- // compose IBSS beacon frame
- MgtMacHeaderInit(pAd, &BcnHdr, SUBTYPE_BEACON, 0, BROADCAST_ADDR, pAd->CommonCfg.Bssid);
- Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled);
- CapabilityInfo = CAP_GENERATE(0, 1, Privacy, (pAd->CommonCfg.TxPreamble == Rt802_11PreambleShort), 0, 0);
-
- MakeOutgoingFrame(pBeaconFrame, &FrameLen,
- sizeof(HEADER_802_11), &BcnHdr,
- TIMESTAMP_LEN, &FakeTimestamp,
- 2, &pAd->CommonCfg.BeaconPeriod,
- 2, &CapabilityInfo,
- 1, &SsidIe,
- 1, &pAd->CommonCfg.SsidLen,
- pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid,
- 1, &SupRateIe,
- 1, &SupRateLen,
- SupRateLen, SupRate,
- 1, &DsIe,
- 1, &DsLen,
- 1, &pAd->CommonCfg.Channel,
- 1, &IbssIe,
- 1, &IbssLen,
- 2, &pAd->StaActive.AtimWin,
- END_OF_ARGS);
-
- // add ERP_IE and EXT_RAE IE of in 802.11g
- if (ExtRateLen)
- {
- ULONG tmp;
-
- MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp,
- 3, LocalErpIe,
- 1, &ExtRateIe,
- 1, &ExtRateLen,
- ExtRateLen, ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
- // If adhoc secruity is set for WPA-None, append the cipher suite IE
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- ULONG tmp;
- RTMPMakeRSNIE(pAd, pAd->StaCfg.AuthMode, pAd->StaCfg.WepStatus, BSS0);
-
- MakeOutgoingFrame(pBeaconFrame + FrameLen, &tmp,
- 1, &RSNIe,
- 1, &pAd->StaCfg.RSNIE_Len,
- pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- ULONG TmpLen;
- UCHAR HtLen, HtLen1;
-
-#ifdef RT_BIG_ENDIAN
- HT_CAPABILITY_IE HtCapabilityTmp;
- ADD_HT_INFO_IE addHTInfoTmp;
- USHORT b2lTmp, b2lTmp2;
-#endif
-
- // add HT Capability IE
- HtLen = sizeof(pAd->CommonCfg.HtCapability);
- HtLen1 = sizeof(pAd->CommonCfg.AddHTInfo);
-#ifndef RT_BIG_ENDIAN
- MakeOutgoingFrame(pBeaconFrame+FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &pAd->CommonCfg.HtCapability,
- 1, &AddHtInfoIe,
- 1, &HtLen1,
- HtLen1, &pAd->CommonCfg.AddHTInfo,
- END_OF_ARGS);
-#else
- NdisMoveMemory(&HtCapabilityTmp, &pAd->CommonCfg.HtCapability, HtLen);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-
- NdisMoveMemory(&addHTInfoTmp, &pAd->CommonCfg.AddHTInfo, HtLen1);
- *(USHORT *)(&addHTInfoTmp.AddHtInfo2) = SWAP16(*(USHORT *)(&addHTInfoTmp.AddHtInfo2));
- *(USHORT *)(&addHTInfoTmp.AddHtInfo3) = SWAP16(*(USHORT *)(&addHTInfoTmp.AddHtInfo3));
-
- MakeOutgoingFrame(pBeaconFrame+FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &HtCapabilityTmp,
- 1, &AddHtInfoIe,
- 1, &HtLen1,
- HtLen1, &addHTInfoTmp,
- END_OF_ARGS);
-#endif
- FrameLen += TmpLen;
- }
-#endif // DOT11_N_SUPPORT //
-
- //beacon use reserved WCID 0xff
- if (pAd->CommonCfg.Channel > 14)
- {
- RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, 0, 0xff, FrameLen,
- PID_MGMT, PID_BEACON, RATE_1, IFS_HTTXOP, FALSE, &pAd->CommonCfg.MlmeTransmit);
- }
- else
- {
- // Set to use 1Mbps for Adhoc beacon.
- HTTRANSMIT_SETTING Transmit;
- Transmit.word = 0;
- RTMPWriteTxWI(pAd, pTxWI, FALSE, FALSE, TRUE, FALSE, FALSE, TRUE, 0, 0xff, FrameLen,
- PID_MGMT, PID_BEACON, RATE_1, IFS_HTTXOP, FALSE, &Transmit);
- }
-
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, pBeaconFrame, DIR_WRITE, FALSE);
- RTMPWIEndianChange((PUCHAR)pTxWI, TYPE_TXWI);
-#endif
-
- DBGPRINT(RT_DEBUG_TRACE, ("MakeIbssBeacon (len=%ld), SupRateLen=%d, ExtRateLen=%d, Channel=%d, PhyMode=%d\n",
- FrameLen, SupRateLen, ExtRateLen, pAd->CommonCfg.Channel, pAd->CommonCfg.PhyMode));
- return FrameLen;
-}
diff --git a/drivers/staging/rt3090/sta/dls.c b/drivers/staging/rt3090/sta/dls.c
deleted file mode 100644
index 306e16fdeeae..000000000000
--- a/drivers/staging/rt3090/sta/dls.c
+++ /dev/null
@@ -1,2207 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- dls.c
-
- Abstract:
- Handle WMM-DLS state machine
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Rory Chen 02-14-2006
- Arvin Tai 06-03-2008 Modified for RT28xx
- */
-
-#include "../rt_config.h"
-
-
-/*
- ==========================================================================
- Description:
- dls state machine init, including state transition and timer init
- Parameters:
- Sm - pointer to the dls state machine
- Note:
- The state machine looks like this
-
- DLS_IDLE
- MT2_MLME_DLS_REQUEST MlmeDlsReqAction
- MT2_PEER_DLS_REQUEST PeerDlsReqAction
- MT2_PEER_DLS_RESPONSE PeerDlsRspAction
- MT2_MLME_DLS_TEARDOWN MlmeTearDownAction
- MT2_PEER_DLS_TEARDOWN PeerTearDownAction
-
- IRQL = PASSIVE_LEVEL
-
- ==========================================================================
- */
-void DlsStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- UCHAR i;
-
- StateMachineInit(Sm, (STATE_MACHINE_FUNC*)Trans, MAX_DLS_STATE, MAX_DLS_MSG, (STATE_MACHINE_FUNC)Drop, DLS_IDLE, DLS_MACHINE_BASE);
-
- // the first column
- StateMachineSetAction(Sm, DLS_IDLE, MT2_MLME_DLS_REQ, (STATE_MACHINE_FUNC)MlmeDlsReqAction);
- StateMachineSetAction(Sm, DLS_IDLE, MT2_PEER_DLS_REQ, (STATE_MACHINE_FUNC)PeerDlsReqAction);
- StateMachineSetAction(Sm, DLS_IDLE, MT2_PEER_DLS_RSP, (STATE_MACHINE_FUNC)PeerDlsRspAction);
- StateMachineSetAction(Sm, DLS_IDLE, MT2_MLME_DLS_TEAR_DOWN, (STATE_MACHINE_FUNC)MlmeDlsTearDownAction);
- StateMachineSetAction(Sm, DLS_IDLE, MT2_PEER_DLS_TEAR_DOWN, (STATE_MACHINE_FUNC)PeerDlsTearDownAction);
-
- for (i=0; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- pAd->StaCfg.DLSEntry[i].pAd = pAd;
- RTMPInitTimer(pAd, &pAd->StaCfg.DLSEntry[i].Timer, GET_TIMER_FUNCTION(DlsTimeoutAction), pAd, FALSE);
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeDlsReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- HEADER_802_11 DlsReqHdr;
- PRT_802_11_DLS pDLS = NULL;
- UCHAR Category = CATEGORY_DLS;
- UCHAR Action = ACTION_DLS_REQUEST;
- ULONG tmp;
- USHORT reason;
- ULONG Timeout;
- BOOLEAN TimerCancelled;
-
- if(!MlmeDlsReqSanity(pAd, Elem->Msg, Elem->MsgLen, &pDLS, &reason))
- return;
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - MlmeDlsReqAction() \n"));
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("DLS - MlmeDlsReqAction() allocate memory failed \n"));
- return;
- }
-
- ActHeaderInit(pAd, &DlsReqHdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
-
- // Build basic frame first
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &DlsReqHdr,
- 1, &Category,
- 1, &Action,
- 6, &pDLS->MacAddr,
- 6, pAd->CurrentAddress,
- 2, &pAd->StaActive.CapabilityInfo,
- 2, &pDLS->TimeOut,
- 1, &SupRateIe,
- 1, &pAd->MlmeAux.SupRateLen,
- pAd->MlmeAux.SupRateLen, pAd->MlmeAux.SupRate,
- END_OF_ARGS);
-
- if (pAd->MlmeAux.ExtRateLen != 0)
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &ExtRateIe,
- 1, &pAd->MlmeAux.ExtRateLen,
- pAd->MlmeAux.ExtRateLen, pAd->MlmeAux.ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR HtLen;
-
-#ifdef RT_BIG_ENDIAN
- HT_CAPABILITY_IE HtCapabilityTmp;
-#endif
-
- // add HT Capability IE
- HtLen = sizeof(HT_CAPABILITY_IE);
-#ifndef RT_BIG_ENDIAN
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &pAd->CommonCfg.HtCapability,
- END_OF_ARGS);
-#else
- NdisMoveMemory(&HtCapabilityTmp, &pAd->CommonCfg.HtCapability, HtLen);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &HtCapabilityTmp,
- END_OF_ARGS);
-#endif
- FrameLen = FrameLen + tmp;
- }
-#endif // DOT11_N_SUPPORT //
-
- RTMPCancelTimer(&pDLS->Timer, &TimerCancelled);
- Timeout = DLS_TIMEOUT;
- RTMPSetTimer(&pDLS->Timer, Timeout);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerDlsReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- USHORT StatusCode = MLME_SUCCESS;
- HEADER_802_11 DlsRspHdr;
- UCHAR Category = CATEGORY_DLS;
- UCHAR Action = ACTION_DLS_RESPONSE;
- ULONG tmp;
- USHORT CapabilityInfo;
- UCHAR DA[MAC_ADDR_LEN], SA[MAC_ADDR_LEN];
- USHORT DLSTimeOut;
- SHORT i;
- ULONG Timeout;
- BOOLEAN TimerCancelled;
- PRT_802_11_DLS pDLS = NULL;
- UCHAR MaxSupportedRateIn500Kbps = 0;
- UCHAR SupportedRatesLen;
- UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR HtCapabilityLen;
- HT_CAPABILITY_IE HtCapability;
-
- if (!PeerDlsReqSanity(pAd, Elem->Msg, Elem->MsgLen, DA, SA, &CapabilityInfo, &DLSTimeOut,
- &SupportedRatesLen, &SupportedRates[0], &HtCapabilityLen, &HtCapability))
- return;
-
- // supported rates array may not be sorted. sort it and find the maximum rate
- for (i = 0; i < SupportedRatesLen; i++)
- {
- if (MaxSupportedRateIn500Kbps < (SupportedRates[i] & 0x7f))
- MaxSupportedRateIn500Kbps = SupportedRates[i] & 0x7f;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsReqAction() from %02x:%02x:%02x:%02x:%02x:%02x\n", SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsReqAction() allocate memory failed \n"));
- return;
- }
-
- if (!INFRA_ON(pAd))
- {
- StatusCode = MLME_REQUEST_DECLINED;
- }
- else if (!pAd->CommonCfg.bWmmCapable)
- {
- StatusCode = MLME_DEST_STA_IS_NOT_A_QSTA;
- }
- else if (!pAd->CommonCfg.bDLSCapable)
- {
- StatusCode = MLME_REQUEST_DECLINED;
- }
- else
- {
- // find table to update parameters
- for (i = (MAX_NUM_OF_DLS_ENTRY-1); i >= 0; i--)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(SA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- pAd->StaCfg.DLSEntry[i].Status = DLS_WAIT_KEY;
- else
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- }
-
- pAd->StaCfg.DLSEntry[i].Sequence = 0;
- pAd->StaCfg.DLSEntry[i].TimeOut = DLSTimeOut;
- pAd->StaCfg.DLSEntry[i].CountDownTimer = DLSTimeOut;
- if (HtCapabilityLen != 0)
- pAd->StaCfg.DLSEntry[i].bHTCap = TRUE;
- else
- pAd->StaCfg.DLSEntry[i].bHTCap = FALSE;
- pDLS = &pAd->StaCfg.DLSEntry[i];
- break;
- }
- }
-
- // can not find in table, create a new one
- if (i < 0)
- {
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsReqAction() can not find same entry \n"));
- for (i=(MAX_NUM_OF_DLS_ENTRY - 1); i >= MAX_NUM_OF_INIT_DLS_ENTRY; i--)
- {
- if (!pAd->StaCfg.DLSEntry[i].Valid)
- {
- MAC_TABLE_ENTRY *pEntry;
- UCHAR MaxSupportedRate = RATE_11;
-
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_WAIT_KEY;
- }
- else
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- }
-
- pAd->StaCfg.DLSEntry[i].Sequence = 0;
- pAd->StaCfg.DLSEntry[i].Valid = TRUE;
- pAd->StaCfg.DLSEntry[i].TimeOut = DLSTimeOut;
- pAd->StaCfg.DLSEntry[i].CountDownTimer = DLSTimeOut;
- NdisMoveMemory(pAd->StaCfg.DLSEntry[i].MacAddr, SA, MAC_ADDR_LEN);
- if (HtCapabilityLen != 0)
- pAd->StaCfg.DLSEntry[i].bHTCap = TRUE;
- else
- pAd->StaCfg.DLSEntry[i].bHTCap = FALSE;
- pDLS = &pAd->StaCfg.DLSEntry[i];
- pEntry = MacTableInsertDlsEntry(pAd, SA, i);
-
- switch (MaxSupportedRateIn500Kbps)
- {
- case 108: MaxSupportedRate = RATE_54; break;
- case 96: MaxSupportedRate = RATE_48; break;
- case 72: MaxSupportedRate = RATE_36; break;
- case 48: MaxSupportedRate = RATE_24; break;
- case 36: MaxSupportedRate = RATE_18; break;
- case 24: MaxSupportedRate = RATE_12; break;
- case 18: MaxSupportedRate = RATE_9; break;
- case 12: MaxSupportedRate = RATE_6; break;
- case 22: MaxSupportedRate = RATE_11; break;
- case 11: MaxSupportedRate = RATE_5_5; break;
- case 4: MaxSupportedRate = RATE_2; break;
- case 2: MaxSupportedRate = RATE_1; break;
- default: MaxSupportedRate = RATE_11; break;
- }
-
- pEntry->MaxSupportedRate = min(pAd->CommonCfg.MaxTxRate, MaxSupportedRate);
-
- if (pEntry->MaxSupportedRate < RATE_FIRST_OFDM_RATE)
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MaxHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->MinHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MinHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->HTPhyMode.field.MODE = MODE_CCK;
- pEntry->HTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MaxHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->MinHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MinHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->HTPhyMode.field.MODE = MODE_OFDM;
- pEntry->HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- }
-
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MinHTPhyMode.field.BW = BW_20;
-
-#ifdef DOT11_N_SUPPORT
- pEntry->HTCapability.MCSSet[0] = 0;
- pEntry->HTCapability.MCSSet[1] = 0;
-
- // If this Entry supports 802.11n, upgrade to HT rate.
- if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR j, bitmask; //k,bitmask;
- CHAR ii;
-
- DBGPRINT(RT_DEBUG_TRACE, ("DLS - PeerDlsReqAction() Receive Peer HT Capable STA from %02x:%02x:%02x:%02x:%02x:%02x\n",
- SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
-
- if ((HtCapability.HtCapInfo.GF) && (pAd->CommonCfg.DesiredHtPhy.GF))
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTGREENFIELD;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pAd->MacTab.fAnyStationNonGF = TRUE;
- pAd->CommonCfg.AddHTInfo.AddHtInfo2.NonGfPresent = 1;
- }
-
- if ((HtCapability.HtCapInfo.ChannelWidth) && (pAd->CommonCfg.DesiredHtPhy.ChannelWidth))
- {
- pEntry->MaxHTPhyMode.field.BW= BW_40;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor40)&(HtCapability.HtCapInfo.ShortGIfor40));
- }
- else
- {
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor20)&(HtCapability.HtCapInfo.ShortGIfor20));
- pAd->MacTab.fAnyStation20Only = TRUE;
- }
-
- // find max fixed rate
- for (ii=15; ii>=0; ii--)
- {
- j = ii/8;
- bitmask = (1<<(ii-(j*8)));
- if ( (pAd->StaCfg.DesiredHtPhyInfo.MCSSet[j]&bitmask) && (HtCapability.MCSSet[j]&bitmask))
- {
- pEntry->MaxHTPhyMode.field.MCS = ii;
- break;
- }
- if (ii==0)
- break;
- }
-
-
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO)
- {
-
- DBGPRINT(RT_DEBUG_OFF, ("@@@ pAd->CommonCfg.RegTransmitSetting.field.MCS = %d\n",
- pAd->StaCfg.DesiredTransmitSetting.field.MCS));
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS == 32)
- {
- // Fix MCS as HT Duplicated Mode
- pEntry->MaxHTPhyMode.field.BW = 1;
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pEntry->MaxHTPhyMode.field.STBC = 0;
- pEntry->MaxHTPhyMode.field.ShortGI = 0;
- pEntry->MaxHTPhyMode.field.MCS = 32;
- }
- else if (pEntry->MaxHTPhyMode.field.MCS > pAd->StaCfg.HTPhyMode.field.MCS)
- {
- // STA supports fixed MCS
- pEntry->MaxHTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- }
- }
-
- pEntry->MaxHTPhyMode.field.STBC = (HtCapability.HtCapInfo.RxSTBC & (pAd->CommonCfg.DesiredHtPhy.TxSTBC));
- pEntry->MpduDensity = HtCapability.HtCapParm.MpduDensity;
- pEntry->MaxRAmpduFactor = HtCapability.HtCapParm.MaxRAmpduFactor;
- pEntry->MmpsMode = (UCHAR)HtCapability.HtCapInfo.MimoPs;
- pEntry->AMsduSize = (UCHAR)HtCapability.HtCapInfo.AMsduSize;
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
-
- if (HtCapability.HtCapInfo.ShortGIfor20)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI20_CAPABLE);
- if (HtCapability.HtCapInfo.ShortGIfor40)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI40_CAPABLE);
- if (HtCapability.HtCapInfo.TxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_TxSTBC_CAPABLE);
- if (HtCapability.HtCapInfo.RxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RxSTBC_CAPABLE);
- if (HtCapability.ExtHtCapInfo.PlusHTC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_HTC_CAPABLE);
- if (pAd->CommonCfg.bRdg && HtCapability.ExtHtCapInfo.RDGSupport)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE);
- if (HtCapability.ExtHtCapInfo.MCSFeedback == 0x03)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_MCSFEEDBACK_CAPABLE);
-
- NdisMoveMemory(&pEntry->HTCapability, &HtCapability, sizeof(HT_CAPABILITY_IE));
- }
-#endif // DOT11_N_SUPPORT //
-
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
- pEntry->CurrTxRate = pEntry->MaxSupportedRate;
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
-
- if (pAd->StaCfg.bAutoTxRateSwitch == TRUE)
- {
- PUCHAR pTable;
- UCHAR TableSize = 0;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &pEntry->CurrTxRateIndex);
- pEntry->bAutoTxRateSwitch = TRUE;
- }
- else
- {
- pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- pEntry->bAutoTxRateSwitch = FALSE;
-
- RTMPUpdateLegacyTxSetting((UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode, pEntry);
- }
- pEntry->RateLen = SupportedRatesLen;
-
- break;
- }
- }
- }
- StatusCode = MLME_SUCCESS;
-
- // can not find in table, create a new one
- if (i < 0)
- {
- StatusCode = MLME_QOS_UNSPECIFY;
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsReqAction() DLSEntry table full(only can support %d DLS session) \n", MAX_NUM_OF_DLS_ENTRY - MAX_NUM_OF_INIT_DLS_ENTRY));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsReqAction() use entry(%d) %02x:%02x:%02x:%02x:%02x:%02x\n",
- i, SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
- }
- }
-
- ActHeaderInit(pAd, &DlsRspHdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
-
- // Build basic frame first
- if (StatusCode == MLME_SUCCESS)
- {
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &DlsRspHdr,
- 1, &Category,
- 1, &Action,
- 2, &StatusCode,
- 6, SA,
- 6, pAd->CurrentAddress,
- 2, &pAd->StaActive.CapabilityInfo,
- 1, &SupRateIe,
- 1, &pAd->MlmeAux.SupRateLen,
- pAd->MlmeAux.SupRateLen, pAd->MlmeAux.SupRate,
- END_OF_ARGS);
-
- if (pAd->MlmeAux.ExtRateLen != 0)
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &ExtRateIe,
- 1, &pAd->MlmeAux.ExtRateLen,
- pAd->MlmeAux.ExtRateLen, pAd->MlmeAux.ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR HtLen;
-
-#ifdef RT_BIG_ENDIAN
- HT_CAPABILITY_IE HtCapabilityTmp;
-#endif
-
- // add HT Capability IE
- HtLen = sizeof(HT_CAPABILITY_IE);
-#ifndef RT_BIG_ENDIAN
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &pAd->CommonCfg.HtCapability,
- END_OF_ARGS);
-#else
- NdisMoveMemory(&HtCapabilityTmp, &pAd->CommonCfg.HtCapability, HtLen);
- *(USHORT *)(&HtCapabilityTmp.HtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.HtCapInfo));
- *(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo) = SWAP16(*(USHORT *)(&HtCapabilityTmp.ExtHtCapInfo));
-
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &HtCapIe,
- 1, &HtLen,
- HtLen, &HtCapabilityTmp,
- END_OF_ARGS);
-#endif
- FrameLen = FrameLen + tmp;
- }
-#endif // DOT11_N_SUPPORT //
-
- if (pDLS && (pDLS->Status != DLS_FINISH))
- {
- RTMPCancelTimer(&pDLS->Timer, &TimerCancelled);
- Timeout = DLS_TIMEOUT;
- RTMPSetTimer(&pDLS->Timer, Timeout);
- }
- }
- else
- {
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &DlsRspHdr,
- 1, &Category,
- 1, &Action,
- 2, &StatusCode,
- 6, SA,
- 6, pAd->CurrentAddress,
- END_OF_ARGS);
- }
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerDlsRspAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT CapabilityInfo;
- UCHAR DA[MAC_ADDR_LEN], SA[MAC_ADDR_LEN];
- USHORT StatusCode;
- SHORT i;
- BOOLEAN TimerCancelled;
- UCHAR MaxSupportedRateIn500Kbps = 0;
- UCHAR SupportedRatesLen;
- UCHAR SupportedRates[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR HtCapabilityLen;
- HT_CAPABILITY_IE HtCapability;
-
- if (!pAd->CommonCfg.bDLSCapable)
- return;
-
- if (!INFRA_ON(pAd))
- return;
-
- if (!PeerDlsRspSanity(pAd, Elem->Msg, Elem->MsgLen, DA, SA, &CapabilityInfo, &StatusCode,
- &SupportedRatesLen, &SupportedRates[0], &HtCapabilityLen, &HtCapability))
- return;
-
- // supported rates array may not be sorted. sort it and find the maximum rate
- for (i=0; i<SupportedRatesLen; i++)
- {
- if (MaxSupportedRateIn500Kbps < (SupportedRates[i] & 0x7f))
- MaxSupportedRateIn500Kbps = SupportedRates[i] & 0x7f;
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsRspAction() from %02x:%02x:%02x:%02x:%02x:%02x with StatusCode=%d, CapabilityInfo=0x%x\n",
- SA[0], SA[1], SA[2], SA[3], SA[4], SA[5], StatusCode, CapabilityInfo));
-
- for (i = 0; i < MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(SA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- if (StatusCode == MLME_SUCCESS)
- {
- MAC_TABLE_ENTRY *pEntry;
- UCHAR MaxSupportedRate = RATE_11;
-
- pEntry = MacTableInsertDlsEntry(pAd, SA, i);
-
- switch (MaxSupportedRateIn500Kbps)
- {
- case 108: MaxSupportedRate = RATE_54; break;
- case 96: MaxSupportedRate = RATE_48; break;
- case 72: MaxSupportedRate = RATE_36; break;
- case 48: MaxSupportedRate = RATE_24; break;
- case 36: MaxSupportedRate = RATE_18; break;
- case 24: MaxSupportedRate = RATE_12; break;
- case 18: MaxSupportedRate = RATE_9; break;
- case 12: MaxSupportedRate = RATE_6; break;
- case 22: MaxSupportedRate = RATE_11; break;
- case 11: MaxSupportedRate = RATE_5_5; break;
- case 4: MaxSupportedRate = RATE_2; break;
- case 2: MaxSupportedRate = RATE_1; break;
- default: MaxSupportedRate = RATE_11; break;
- }
-
- pEntry->MaxSupportedRate = min(pAd->CommonCfg.MaxTxRate, MaxSupportedRate);
-
- if (pEntry->MaxSupportedRate < RATE_FIRST_OFDM_RATE)
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MaxHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->MinHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MinHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->HTPhyMode.field.MODE = MODE_CCK;
- pEntry->HTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MaxHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->MinHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MinHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->HTPhyMode.field.MODE = MODE_OFDM;
- pEntry->HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- }
-
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MinHTPhyMode.field.BW = BW_20;
-
-#ifdef DOT11_N_SUPPORT
- pEntry->HTCapability.MCSSet[0] = 0;
- pEntry->HTCapability.MCSSet[1] = 0;
-
- // If this Entry supports 802.11n, upgrade to HT rate.
- if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR j, bitmask; //k,bitmask;
- CHAR ii;
-
- DBGPRINT(RT_DEBUG_OFF, ("DLS - PeerDlsRspAction Receive Peer HT Capable STA from %02x:%02x:%02x:%02x:%02x:%02x\n",
- SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
-
- if ((HtCapability.HtCapInfo.GF) && (pAd->CommonCfg.DesiredHtPhy.GF))
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTGREENFIELD;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pAd->MacTab.fAnyStationNonGF = TRUE;
- pAd->CommonCfg.AddHTInfo.AddHtInfo2.NonGfPresent = 1;
- }
-
- if ((HtCapability.HtCapInfo.ChannelWidth) && (pAd->CommonCfg.DesiredHtPhy.ChannelWidth))
- {
- pEntry->MaxHTPhyMode.field.BW= BW_40;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor40)&(HtCapability.HtCapInfo.ShortGIfor40));
- }
- else
- {
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor20)&(HtCapability.HtCapInfo.ShortGIfor20));
- pAd->MacTab.fAnyStation20Only = TRUE;
- }
-
- // find max fixed rate
- for (ii=15; ii>=0; ii--)
- {
- j = ii/8;
- bitmask = (1<<(ii-(j*8)));
- if ( (pAd->StaCfg.DesiredHtPhyInfo.MCSSet[j]&bitmask) && (HtCapability.MCSSet[j]&bitmask))
- {
- pEntry->MaxHTPhyMode.field.MCS = ii;
- break;
- }
- if (ii==0)
- break;
- }
-
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO)
- {
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS == 32)
- {
- // Fix MCS as HT Duplicated Mode
- pEntry->MaxHTPhyMode.field.BW = 1;
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pEntry->MaxHTPhyMode.field.STBC = 0;
- pEntry->MaxHTPhyMode.field.ShortGI = 0;
- pEntry->MaxHTPhyMode.field.MCS = 32;
- }
- else if (pEntry->MaxHTPhyMode.field.MCS > pAd->StaCfg.HTPhyMode.field.MCS)
- {
- // STA supports fixed MCS
- pEntry->MaxHTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- }
- }
-
- pEntry->MaxHTPhyMode.field.STBC = (HtCapability.HtCapInfo.RxSTBC & (pAd->CommonCfg.DesiredHtPhy.TxSTBC));
- pEntry->MpduDensity = HtCapability.HtCapParm.MpduDensity;
- pEntry->MaxRAmpduFactor = HtCapability.HtCapParm.MaxRAmpduFactor;
- pEntry->MmpsMode = (UCHAR)HtCapability.HtCapInfo.MimoPs;
- pEntry->AMsduSize = (UCHAR)HtCapability.HtCapInfo.AMsduSize;
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
-
- if (HtCapability.HtCapInfo.ShortGIfor20)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI20_CAPABLE);
- if (HtCapability.HtCapInfo.ShortGIfor40)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI40_CAPABLE);
- if (HtCapability.HtCapInfo.TxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_TxSTBC_CAPABLE);
- if (HtCapability.HtCapInfo.RxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RxSTBC_CAPABLE);
- if (HtCapability.ExtHtCapInfo.PlusHTC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_HTC_CAPABLE);
- if (pAd->CommonCfg.bRdg && HtCapability.ExtHtCapInfo.RDGSupport)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE);
- if (HtCapability.ExtHtCapInfo.MCSFeedback == 0x03)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_MCSFEEDBACK_CAPABLE);
-
- NdisMoveMemory(&pEntry->HTCapability, &HtCapability, sizeof(HT_CAPABILITY_IE));
- }
-#endif // DOT11_N_SUPPORT //
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
- pEntry->CurrTxRate = pEntry->MaxSupportedRate;
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
-
- if (pAd->StaCfg.bAutoTxRateSwitch == TRUE)
- {
- PUCHAR pTable;
- UCHAR TableSize = 0;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &pEntry->CurrTxRateIndex);
- pEntry->bAutoTxRateSwitch = TRUE;
- }
- else
- {
- pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- pEntry->bAutoTxRateSwitch = FALSE;
-
- RTMPUpdateLegacyTxSetting((UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode, pEntry);
- }
- pEntry->RateLen = SupportedRatesLen;
-
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- // If support WPA or WPA2, start STAKey hand shake,
- // If failed hand shake, just tear down peer DLS
- if (RTMPSendSTAKeyRequest(pAd, pAd->StaCfg.DLSEntry[i].MacAddr) != NDIS_STATUS_SUCCESS)
- {
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- USHORT reason = REASON_QOS_CIPHER_NOT_SUPPORT;
-
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsRspAction failed when call RTMPSendSTAKeyRequest \n"));
- }
- else
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_WAIT_KEY;
- DBGPRINT(RT_DEBUG_TRACE,("DLS - waiting for STAKey handshake procedure\n"));
- }
- }
- else
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsRspAction() from %02x:%02x:%02x:%02x:%02x:%02x Succeed with WEP or no security\n", SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
- }
-
- //initialize seq no for DLS frames.
- pAd->StaCfg.DLSEntry[i].Sequence = 0;
- if (HtCapabilityLen != 0)
- pAd->StaCfg.DLSEntry[i].bHTCap = TRUE;
- else
- pAd->StaCfg.DLSEntry[i].bHTCap = FALSE;
- }
- else
- {
- // DLS setup procedure failed.
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsRspAction failed with StatusCode=%d \n", StatusCode));
- }
- }
- }
-
- if (i >= MAX_NUM_OF_INIT_DLS_ENTRY)
- {
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsRspAction() update timeout value \n"));
- for (i=(MAX_NUM_OF_DLS_ENTRY-1); i>=MAX_NUM_OF_INIT_DLS_ENTRY; i--)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(SA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- if (StatusCode == MLME_SUCCESS)
- {
- MAC_TABLE_ENTRY *pEntry;
- UCHAR MaxSupportedRate = RATE_11;
-
- pEntry = MacTableInsertDlsEntry(pAd, SA, i);
-
- switch (MaxSupportedRateIn500Kbps)
- {
- case 108: MaxSupportedRate = RATE_54; break;
- case 96: MaxSupportedRate = RATE_48; break;
- case 72: MaxSupportedRate = RATE_36; break;
- case 48: MaxSupportedRate = RATE_24; break;
- case 36: MaxSupportedRate = RATE_18; break;
- case 24: MaxSupportedRate = RATE_12; break;
- case 18: MaxSupportedRate = RATE_9; break;
- case 12: MaxSupportedRate = RATE_6; break;
- case 22: MaxSupportedRate = RATE_11; break;
- case 11: MaxSupportedRate = RATE_5_5; break;
- case 4: MaxSupportedRate = RATE_2; break;
- case 2: MaxSupportedRate = RATE_1; break;
- default: MaxSupportedRate = RATE_11; break;
- }
-
- pEntry->MaxSupportedRate = min(pAd->CommonCfg.MaxTxRate, MaxSupportedRate);
-
- if (pEntry->MaxSupportedRate < RATE_FIRST_OFDM_RATE)
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MaxHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->MinHTPhyMode.field.MODE = MODE_CCK;
- pEntry->MinHTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- pEntry->HTPhyMode.field.MODE = MODE_CCK;
- pEntry->HTPhyMode.field.MCS = pEntry->MaxSupportedRate;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MaxHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->MinHTPhyMode.field.MODE = MODE_OFDM;
- pEntry->MinHTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- pEntry->HTPhyMode.field.MODE = MODE_OFDM;
- pEntry->HTPhyMode.field.MCS = OfdmRateToRxwiMCS[pEntry->MaxSupportedRate];
- }
-
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MinHTPhyMode.field.BW = BW_20;
-
-#ifdef DOT11_N_SUPPORT
- pEntry->HTCapability.MCSSet[0] = 0;
- pEntry->HTCapability.MCSSet[1] = 0;
-
- // If this Entry supports 802.11n, upgrade to HT rate.
- if ((HtCapabilityLen != 0) && (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED))
- {
- UCHAR j, bitmask; //k,bitmask;
- CHAR ii;
-
- DBGPRINT(RT_DEBUG_TRACE, ("DLS - PeerDlsRspAction Receive Peer HT Capable STA from %02x:%02x:%02x:%02x:%02x:%02x\n",
- SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
-
- if ((HtCapability.HtCapInfo.GF) && (pAd->CommonCfg.DesiredHtPhy.GF))
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTGREENFIELD;
- }
- else
- {
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pAd->MacTab.fAnyStationNonGF = TRUE;
- pAd->CommonCfg.AddHTInfo.AddHtInfo2.NonGfPresent = 1;
- }
-
- if ((HtCapability.HtCapInfo.ChannelWidth) && (pAd->CommonCfg.DesiredHtPhy.ChannelWidth))
- {
- pEntry->MaxHTPhyMode.field.BW= BW_40;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor40)&(HtCapability.HtCapInfo.ShortGIfor40));
- }
- else
- {
- pEntry->MaxHTPhyMode.field.BW = BW_20;
- pEntry->MaxHTPhyMode.field.ShortGI = ((pAd->CommonCfg.DesiredHtPhy.ShortGIfor20)&(HtCapability.HtCapInfo.ShortGIfor20));
- pAd->MacTab.fAnyStation20Only = TRUE;
- }
-
- // find max fixed rate
- for (ii=15; ii>=0; ii--)
- {
- j = ii/8;
- bitmask = (1<<(ii-(j*8)));
- if ( (pAd->StaCfg.DesiredHtPhyInfo.MCSSet[j]&bitmask) && (HtCapability.MCSSet[j]&bitmask))
- {
- pEntry->MaxHTPhyMode.field.MCS = ii;
- break;
- }
- if (ii==0)
- break;
- }
-
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS != MCS_AUTO)
- {
- DBGPRINT(RT_DEBUG_OFF, ("@@@ pAd->CommonCfg.RegTransmitSetting.field.MCS = %d\n",
- pAd->StaCfg.DesiredTransmitSetting.field.MCS));
- if (pAd->StaCfg.DesiredTransmitSetting.field.MCS == 32)
- {
- // Fix MCS as HT Duplicated Mode
- pEntry->MaxHTPhyMode.field.BW = 1;
- pEntry->MaxHTPhyMode.field.MODE = MODE_HTMIX;
- pEntry->MaxHTPhyMode.field.STBC = 0;
- pEntry->MaxHTPhyMode.field.ShortGI = 0;
- pEntry->MaxHTPhyMode.field.MCS = 32;
- }
- else if (pEntry->MaxHTPhyMode.field.MCS > pAd->StaCfg.HTPhyMode.field.MCS)
- {
- // STA supports fixed MCS
- pEntry->MaxHTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- }
- }
-
- pEntry->MaxHTPhyMode.field.STBC = (HtCapability.HtCapInfo.RxSTBC & (pAd->CommonCfg.DesiredHtPhy.TxSTBC));
- pEntry->MpduDensity = HtCapability.HtCapParm.MpduDensity;
- pEntry->MaxRAmpduFactor = HtCapability.HtCapParm.MaxRAmpduFactor;
- pEntry->MmpsMode = (UCHAR)HtCapability.HtCapInfo.MimoPs;
- pEntry->AMsduSize = (UCHAR)HtCapability.HtCapInfo.AMsduSize;
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
-
- if (HtCapability.HtCapInfo.ShortGIfor20)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI20_CAPABLE);
- if (HtCapability.HtCapInfo.ShortGIfor40)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_SGI40_CAPABLE);
- if (HtCapability.HtCapInfo.TxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_TxSTBC_CAPABLE);
- if (HtCapability.HtCapInfo.RxSTBC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RxSTBC_CAPABLE);
- if (HtCapability.ExtHtCapInfo.PlusHTC)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_HTC_CAPABLE);
- if (pAd->CommonCfg.bRdg && HtCapability.ExtHtCapInfo.RDGSupport)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_RDG_CAPABLE);
- if (HtCapability.ExtHtCapInfo.MCSFeedback == 0x03)
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_MCSFEEDBACK_CAPABLE);
-
- NdisMoveMemory(&pEntry->HTCapability, &HtCapability, sizeof(HT_CAPABILITY_IE));
- }
-#endif // DOT11_N_SUPPORT //
-
- pEntry->HTPhyMode.word = pEntry->MaxHTPhyMode.word;
- pEntry->CurrTxRate = pEntry->MaxSupportedRate;
- CLIENT_STATUS_SET_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE);
-
- if (pAd->StaCfg.bAutoTxRateSwitch == TRUE)
- {
- PUCHAR pTable;
- UCHAR TableSize = 0;
-
- MlmeSelectTxRateTable(pAd, pEntry, &pTable, &TableSize, &pEntry->CurrTxRateIndex);
- pEntry->bAutoTxRateSwitch = TRUE;
- }
- else
- {
- pEntry->HTPhyMode.field.MODE = pAd->StaCfg.HTPhyMode.field.MODE;
- pEntry->HTPhyMode.field.MCS = pAd->StaCfg.HTPhyMode.field.MCS;
- pEntry->bAutoTxRateSwitch = FALSE;
-
- RTMPUpdateLegacyTxSetting((UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.FixedTxMode, pEntry);
- }
- pEntry->RateLen = SupportedRatesLen;
-
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- // If support WPA or WPA2, start STAKey hand shake,
- // If failed hand shake, just tear down peer DLS
- if (RTMPSendSTAKeyRequest(pAd, pAd->StaCfg.DLSEntry[i].MacAddr) != NDIS_STATUS_SUCCESS)
- {
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- USHORT reason = REASON_QOS_CIPHER_NOT_SUPPORT;
-
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsRspAction failed when call RTMPSendSTAKeyRequest \n"));
- }
- else
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_WAIT_KEY;
- DBGPRINT(RT_DEBUG_TRACE,("DLS - waiting for STAKey handshake procedure\n"));
- }
- }
- else
- {
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsRspAction() from %02x:%02x:%02x:%02x:%02x:%02x Succeed with WEP or no security\n", SA[0], SA[1], SA[2], SA[3], SA[4], SA[5]));
- }
- pAd->StaCfg.DLSEntry[i].Sequence = 0;
- if (HtCapabilityLen != 0)
- pAd->StaCfg.DLSEntry[i].bHTCap = TRUE;
- else
- pAd->StaCfg.DLSEntry[i].bHTCap = FALSE;
- }
- else
- {
- // DLS setup procedure failed.
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- DBGPRINT(RT_DEBUG_ERROR,("DLS - PeerDlsRspAction failed with StatusCode=%d \n", StatusCode));
- }
- }
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID MlmeDlsTearDownAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- UCHAR Category = CATEGORY_DLS;
- UCHAR Action = ACTION_DLS_TEARDOWN;
- USHORT ReasonCode = REASON_QOS_UNSPECIFY;
- HEADER_802_11 DlsTearDownHdr;
- PRT_802_11_DLS pDLS;
- BOOLEAN TimerCancelled;
- UCHAR i;
-
- if(!MlmeDlsReqSanity(pAd, Elem->Msg, Elem->MsgLen, &pDLS, &ReasonCode))
- return;
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - MlmeDlsTearDownAction() with ReasonCode=%d \n", ReasonCode));
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("DLS - MlmeDlsTearDownAction() allocate memory failed \n"));
- return;
- }
-
- ActHeaderInit(pAd, &DlsTearDownHdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
-
- // Build basic frame first
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &DlsTearDownHdr,
- 1, &Category,
- 1, &Action,
- 6, &pDLS->MacAddr,
- 6, pAd->CurrentAddress,
- 2, &ReasonCode,
- END_OF_ARGS);
-
- MiniportMMRequest(pAd, QID_AC_BE, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- RTMPCancelTimer(&pDLS->Timer, &TimerCancelled);
-
- // Remove key in local dls table entry
- for (i = 0; i < MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- // clear peer dls table entry
- for (i = MAX_NUM_OF_INIT_DLS_ENTRY; i < MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (MAC_ADDR_EQUAL(pDLS->MacAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerDlsTearDownAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR DA[MAC_ADDR_LEN], SA[MAC_ADDR_LEN];
- USHORT ReasonCode;
- UINT i;
- BOOLEAN TimerCancelled;
-
- if (!pAd->CommonCfg.bDLSCapable)
- return;
-
- if (!INFRA_ON(pAd))
- return;
-
- if (!PeerDlsTearDownSanity(pAd, Elem->Msg, Elem->MsgLen, DA, SA, &ReasonCode))
- return;
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - PeerDlsTearDownAction() from %02x:%02x:%02x:%02x:%02x:%02x with ReasonCode=%d\n", SA[0], SA[1], SA[2], SA[3], SA[4], SA[5], ReasonCode));
-
- // clear local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(SA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- //AsicDelWcidTab(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID);
- //AsicRemovePairwiseKeyEntry(pAd, BSS0, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID);
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- // clear peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(SA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
- //AsicDelWcidTab(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID);
- //AsicRemovePairwiseKeyEntry(pAd, BSS0, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID);
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID RTMPCheckDLSTimeOut(
- IN PRTMP_ADAPTER pAd)
-{
- ULONG i;
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- USHORT reason = REASON_QOS_UNSPECIFY;
-
- if (! pAd->CommonCfg.bDLSCapable)
- return;
-
- if (! INFRA_ON(pAd))
- return;
-
- // If timeout value is equaled to zero, it means always not be timeout.
-
- // update local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if ((pAd->StaCfg.DLSEntry[i].Valid) && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- && (pAd->StaCfg.DLSEntry[i].TimeOut != 0))
- {
- pAd->StaCfg.DLSEntry[i].CountDownTimer --;
-
- if (pAd->StaCfg.DLSEntry[i].CountDownTimer == 0)
- {
- reason = REASON_QOS_REQUEST_TIMEOUT;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- }
- }
- }
-
- // update peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if ((pAd->StaCfg.DLSEntry[i].Valid) && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- && (pAd->StaCfg.DLSEntry[i].TimeOut != 0))
- {
- pAd->StaCfg.DLSEntry[i].CountDownTimer --;
-
- if (pAd->StaCfg.DLSEntry[i].CountDownTimer == 0)
- {
- reason = REASON_QOS_REQUEST_TIMEOUT;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- }
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN RTMPRcvFrameDLSCheck(
- IN PRTMP_ADAPTER pAd,
- IN PHEADER_802_11 pHeader,
- IN ULONG Len,
- IN PRT28XX_RXD_STRUC pRxD)
-{
- ULONG i;
- BOOLEAN bFindEntry = FALSE;
- BOOLEAN bSTAKeyFrame = FALSE;
- PEAPOL_PACKET pEap;
- PUCHAR pProto, pAddr = NULL;
- PUCHAR pSTAKey = NULL;
- UCHAR ZeroReplay[LEN_KEY_DESC_REPLAY];
- UCHAR Mic[16], OldMic[16];
- UCHAR digest[80];
- UCHAR DlsPTK[80];
- UCHAR temp[64];
- BOOLEAN TimerCancelled;
- CIPHER_KEY PairwiseKey;
-
-
- if (! pAd->CommonCfg.bDLSCapable)
- return bSTAKeyFrame;
-
- if (! INFRA_ON(pAd))
- return bSTAKeyFrame;
-
- if (Len < LENGTH_802_11 + 6 + 2) /* LENGTH_802_11 + LLC + EAPOL protocol type */
- return bSTAKeyFrame;
-
- pProto = (PUCHAR)pHeader + LENGTH_802_11;
-
- if ((pHeader->FC.SubType & 0x08))
- pProto += 2; /* QOS Control field */
-
- /* Skip 4-bytes for HTC */
- if (pHeader->FC.Order && (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)))
- {
- pProto += 4;
- }
-
- /* L2PAD bit on will pad 2 bytes at LLC */
- if (pRxD->L2PAD)
- {
- pProto += 2;
- }
-
- pProto += 6; /* 0xAA 0xAA 0xAA 0x00 0x00 0x00 */
-
- if ((!(pHeader->FC.SubType & 0x08)) && (!RTMPEqualMemory(EAPOL, pProto, 2)))
- return bSTAKeyFrame;
-
- pAddr = pHeader->Addr2;
-
- if (RTMPEqualMemory(EAPOL, pProto, 2) && (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
- {
- pEap = (PEAPOL_PACKET) (pProto + 2);
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Sniff Len=%ld, DataLen=%d, KeyMic=%d, Install=%d, KeyAck=%d, Secure=%d, EKD_DL=%d, Error=%d, Request=%d\n", Len,
- (LENGTH_802_11 + 6 + 2 + 2 + sizeof(EAPOL_PACKET) - MAX_LEN_OF_RSNIE + 16),
- pEap->KeyDesc.KeyInfo.KeyMic,
- pEap->KeyDesc.KeyInfo.Install,
- pEap->KeyDesc.KeyInfo.KeyAck,
- pEap->KeyDesc.KeyInfo.Secure,
- pEap->KeyDesc.KeyInfo.EKD_DL,
- pEap->KeyDesc.KeyInfo.Error,
- pEap->KeyDesc.KeyInfo.Request));
-
- if ((Len >= (LENGTH_802_11 + 6 + 2 + 2 + sizeof(EAPOL_PACKET) - MAX_LEN_OF_RSNIE + 16)) && pEap->KeyDesc.KeyInfo.KeyMic
- && pEap->KeyDesc.KeyInfo.Install && pEap->KeyDesc.KeyInfo.KeyAck && pEap->KeyDesc.KeyInfo.Secure
- && pEap->KeyDesc.KeyInfo.EKD_DL && !pEap->KeyDesc.KeyInfo.Error && !pEap->KeyDesc.KeyInfo.Request)
- {
- // First validate replay counter, only accept message with larger replay counter
- // Let equal pass, some AP start with all zero replay counter
- NdisZeroMemory(ZeroReplay, LEN_KEY_DESC_REPLAY);
- if ((RTMPCompareMemory(pEap->KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY) != 1) &&
- (RTMPCompareMemory(pEap->KeyDesc.ReplayCounter, ZeroReplay, LEN_KEY_DESC_REPLAY) != 0))
- return bSTAKeyFrame;
-
- //RTMPMoveMemory(pAd->StaCfg.ReplayCounter, pEap->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
- RTMPMoveMemory(pAd->StaCfg.DlsReplayCounter, pEap->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Sniff replay counter (%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x) Len=%ld, KeyDataLen=%d\n",
- pAd->StaCfg.ReplayCounter[0], pAd->StaCfg.ReplayCounter[1], pAd->StaCfg.ReplayCounter[2],
- pAd->StaCfg.ReplayCounter[3], pAd->StaCfg.ReplayCounter[4], pAd->StaCfg.ReplayCounter[5],
- pAd->StaCfg.ReplayCounter[6], pAd->StaCfg.ReplayCounter[7], Len, pEap->KeyDesc.KeyData[1]));
-
- // put these code segment to get the replay counter
- if (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED)
- return bSTAKeyFrame;
-
- // Check MIC value
- // Save the MIC and replace with zero
- // use proprietary PTK
- NdisZeroMemory(temp, 64);
- NdisMoveMemory(temp, "IEEE802.11 WIRELESS ACCESS POINT", 32);
- WpaDerivePTK(pAd, temp, temp, pAd->CommonCfg.Bssid, temp, pAd->CurrentAddress, DlsPTK, LEN_PTK);
-
- NdisMoveMemory(OldMic, pEap->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- NdisZeroMemory(pEap->KeyDesc.KeyMic, LEN_KEY_DESC_MIC);
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- HMAC_SHA1(DlsPTK, LEN_EAP_MICK, (PUCHAR) pEap, pEap->Body_Len[1] + 4, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- HMAC_MD5(DlsPTK, LEN_EAP_MICK, (PUCHAR) pEap, pEap->Body_Len[1] + 4, Mic, MD5_DIGEST_SIZE);
- }
-
- if (!NdisEqualMemory(OldMic, Mic, LEN_KEY_DESC_MIC))
- {
- DBGPRINT(RT_DEBUG_ERROR, ("MIC Different in Msg1 of STAKey handshake! \n"));
- return bSTAKeyFrame;
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("MIC VALID in Msg1 of STAKey handshake! \n"));
- if ((pEap->KeyDesc.KeyData[0] == 0xDD) && (pEap->KeyDesc.KeyData[2] == 0x00) && (pEap->KeyDesc.KeyData[3] == 0x0C)
- && (pEap->KeyDesc.KeyData[4] == 0x43) && (pEap->KeyDesc.KeyData[5] == 0x02))
- {
- pAddr = pEap->KeyDesc.KeyData + 8; // Tpe(1), Len(1), OUI(3), DataType(1), Reserved(2)
- pSTAKey = pEap->KeyDesc.KeyData + 14; // Tpe(1), Len(1), OUI(3), DataType(1), Reserved(2), STAKey_Mac_Addr(6)
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Receive STAKey Message-1 from %02x:%02x:%02x:%02x:%02x:%02x Len=%ld, KeyDataLen=%d\n",
- pAddr[0], pAddr[1], pAddr[2], pAddr[3], pAddr[4], pAddr[5], Len, pEap->KeyDesc.KeyData[1]));
-
- bSTAKeyFrame = TRUE;
- }
-
- }
- else if (Len >= (LENGTH_802_11 + 6 + 2 + 2 + sizeof(EAPOL_PACKET) - MAX_LEN_OF_RSNIE))
- {
- RTMPMoveMemory(pAd->StaCfg.DlsReplayCounter, pEap->KeyDesc.ReplayCounter, LEN_KEY_DESC_REPLAY);
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Sniff replay counter 2(%02x-%02x-%02x-%02x-%02x-%02x-%02x-%02x) Len=%ld, KeyDataLen=%d\n",
- pAd->StaCfg.ReplayCounter[0], pAd->StaCfg.ReplayCounter[1], pAd->StaCfg.ReplayCounter[2],
- pAd->StaCfg.ReplayCounter[3], pAd->StaCfg.ReplayCounter[4], pAd->StaCfg.ReplayCounter[5],
- pAd->StaCfg.ReplayCounter[6], pAd->StaCfg.ReplayCounter[7], Len, pEap->KeyDesc.KeyData[1]));
- }
- }
-
- // If timeout value is equaled to zero, it means always not be timeout.
- // update local dls table entry
- for (i= 0; i < MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(pAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- if (bSTAKeyFrame)
- {
- PMAC_TABLE_ENTRY pEntry;
-
- // STAKey frame, add pairwise key table
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
-
- PairwiseKey.KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(PairwiseKey.Key, &pSTAKey[0], LEN_TKIP_EK);
- NdisMoveMemory(PairwiseKey.TxMic, &pSTAKey[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(PairwiseKey.RxMic, &pSTAKey[24], LEN_TKIP_TXMICK);
-
- //PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg;
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- PairwiseKey.CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- PairwiseKey.CipherAlg = CIPHER_AES;
-
- pEntry = DlsEntryTableLookup(pAd, pAd->StaCfg.DLSEntry[i].MacAddr, TRUE);
- //AsicAddKeyEntry(pAd, (USHORT)(i + 2), BSS0, 0, &PairwiseKey, TRUE, TRUE); // reserve 0 for multicast, 1 for unicast
- //AsicUpdateRxWCIDTable(pAd, (USHORT)(i + 2), pAddr);
- // Add Pair-wise key to Asic
-#ifdef RTMP_MAC_PCI
- AsicAddPairwiseKeyEntry(pAd,
- pAd->StaCfg.DLSEntry[i].MacAddr,
- (UCHAR)pAd->StaCfg.DLSEntry[i].MacTabMatchWCID,
- &PairwiseKey);
-
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- PairwiseKey.CipherAlg,
- pEntry);
-
-#endif // RTMP_MAC_PCI //
- NdisMoveMemory(&pEntry->PairwiseKey, &PairwiseKey, sizeof(CIPHER_KEY));
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Receive STAKey Message-1 (Peer STA MAC Address STAKey) \n"));
-
- RTMPSendSTAKeyHandShake(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Finish STAKey handshake procedure (Initiator side)\n"));
- }
- else
- {
- // Data frame, update timeout value
- if (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- {
- pAd->StaCfg.DLSEntry[i].CountDownTimer = pAd->StaCfg.DLSEntry[i].TimeOut;
- //AsicUpdateRxWCIDTable(pAd, (USHORT)(i + 2), pAddr);
- }
- }
-
- bFindEntry = TRUE;
- }
- }
-
- // update peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && MAC_ADDR_EQUAL(pAddr, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- if (bSTAKeyFrame)
- {
- PMAC_TABLE_ENTRY pEntry = NULL;
-
- // STAKey frame, add pairwise key table, and send STAkey Msg-2
- pAd->StaCfg.DLSEntry[i].Status = DLS_FINISH;
- RTMPCancelTimer(&pAd->StaCfg.DLSEntry[i].Timer, &TimerCancelled);
-
- PairwiseKey.KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(PairwiseKey.Key, &pSTAKey[0], LEN_TKIP_EK);
- NdisMoveMemory(PairwiseKey.TxMic, &pSTAKey[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(PairwiseKey.RxMic, &pSTAKey[24], LEN_TKIP_TXMICK);
-
- //PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg;
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- PairwiseKey.CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- PairwiseKey.CipherAlg = CIPHER_AES;
-
- pEntry = DlsEntryTableLookup(pAd, pAd->StaCfg.DLSEntry[i].MacAddr, TRUE);
- //AsicAddKeyEntry(pAd, (USHORT)(i + 2), BSS0, 0, &PairwiseKey, TRUE, TRUE); // reserve 0 for multicast, 1 for unicast
- //AsicUpdateRxWCIDTable(pAd, (USHORT)(i + 2), pAddr);
- // Add Pair-wise key to Asic
-#ifdef RTMP_MAC_PCI
- AsicAddPairwiseKeyEntry(pAd,
- pAd->StaCfg.DLSEntry[i].MacAddr,
- (UCHAR)pAd->StaCfg.DLSEntry[i].MacTabMatchWCID,
- &PairwiseKey);
-
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- PairwiseKey.CipherAlg,
- pEntry);
-#endif // RTMP_MAC_PCI //
- NdisMoveMemory(&pEntry->PairwiseKey, &PairwiseKey, sizeof(CIPHER_KEY));
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Receive STAKey Message-1 (Initiator STA MAC Address STAKey)\n"));
-
- // If support WPA or WPA2, start STAKey hand shake,
- // If failed hand shake, just tear down peer DLS
- if (RTMPSendSTAKeyHandShake(pAd, pAddr) != NDIS_STATUS_SUCCESS)
- {
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- USHORT reason = REASON_QOS_CIPHER_NOT_SUPPORT;
-
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, &pAd->StaCfg.DLSEntry[i], reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE,("DLS - Finish STAKey handshake procedure (Peer side)\n"));
- }
- }
- else
- {
- // Data frame, update timeout value
- if (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- {
- pAd->StaCfg.DLSEntry[i].CountDownTimer = pAd->StaCfg.DLSEntry[i].TimeOut;
- }
- }
-
- bFindEntry = TRUE;
- }
- }
-
-
- return bSTAKeyFrame;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Check if the frame can be sent through DLS direct link interface
-
- Arguments:
- pAd Pointer to adapter
-
- Return Value:
- DLS entry index
-
- Note:
-
- ========================================================================
-*/
-INT RTMPCheckDLSFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA)
-{
- INT rval = -1;
- INT i;
-
- if (!pAd->CommonCfg.bDLSCapable)
- return rval;
-
- if (!INFRA_ON(pAd))
- return rval;
-
- do{
- // check local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH) &&
- MAC_ADDR_EQUAL(pDA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- rval = i;
- break;
- }
- }
-
- // check peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH) &&
- MAC_ADDR_EQUAL(pDA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- rval = i;
- break;
- }
- }
- } while (FALSE);
-
- return rval;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID RTMPSendDLSTearDownFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA)
-{
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
- HEADER_802_11 DlsTearDownHdr;
- ULONG FrameLen = 0;
- USHORT Reason = REASON_QOS_QSTA_LEAVING_QBSS;
- UCHAR Category = CATEGORY_DLS;
- UCHAR Action = ACTION_DLS_TEARDOWN;
- UCHAR i = 0;
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- return;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Send DLS TearDown Frame \n"));
-
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- {
- DBGPRINT(RT_DEBUG_ERROR,("ASSOC - RTMPSendDLSTearDownFrame() allocate memory failed \n"));
- return;
- }
-
- ActHeaderInit(pAd, &DlsTearDownHdr, pAd->CommonCfg.Bssid, pAd->CurrentAddress, pAd->CommonCfg.Bssid);
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &DlsTearDownHdr,
- 1, &Category,
- 1, &Action,
- 6, pDA,
- 6, pAd->CurrentAddress,
- 2, &Reason,
- END_OF_ARGS);
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
-
- // Remove key in local dls table entry
- for (i = 0; i < MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- && MAC_ADDR_EQUAL(pDA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- // Remove key in peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH)
- && MAC_ADDR_EQUAL(pDA, pAd->StaCfg.DLSEntry[i].MacAddr))
- {
- MacTableDeleteDlsEntry(pAd, pAd->StaCfg.DLSEntry[i].MacTabMatchWCID, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Send DLS TearDown Frame and remove key in (i=%d) \n", i));
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-NDIS_STATUS RTMPSendSTAKeyRequest(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA)
-{
- UCHAR Header802_3[14];
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- UCHAR Mic[16];
- UCHAR digest[80];
- PUCHAR pOutBuffer = NULL;
- PNDIS_PACKET pNdisPacket;
- UCHAR temp[64];
- UCHAR DlsPTK[80];
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - RTMPSendSTAKeyRequest() to %02x:%02x:%02x:%02x:%02x:%02x\n", pDA[0], pDA[1], pDA[2], pDA[3], pDA[4], pDA[5]));
-
- pAd->Sequence ++;
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero message body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE + 6 + MAC_ADDR_LEN; // data field contain KDE andPeer MAC address
-
- // STAKey Message is as EAPOL-Key(1,1,0,0,G/0,0,0, MIC, 0,Peer MAC KDE)
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- Packet.KeyDesc.Type = WPA2_KEY_DESC;
- }
-
- // Key descriptor version
- Packet.KeyDesc.KeyInfo.KeyDescVer =
- (((pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled) || (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)) ? (DESC_TYPE_AES) : (DESC_TYPE_TKIP));
-
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
- Packet.KeyDesc.KeyInfo.Secure = 1;
- Packet.KeyDesc.KeyInfo.Request = 1;
-
- Packet.KeyDesc.KeyDataLen[1] = 12;
-
- // use our own OUI to distinguish proprietary with standard.
- Packet.KeyDesc.KeyData[0] = 0xDD;
- Packet.KeyDesc.KeyData[1] = 0x0A;
- Packet.KeyDesc.KeyData[2] = 0x00;
- Packet.KeyDesc.KeyData[3] = 0x0C;
- Packet.KeyDesc.KeyData[4] = 0x43;
- Packet.KeyDesc.KeyData[5] = 0x03;
- NdisMoveMemory(&Packet.KeyDesc.KeyData[6], pDA, MAC_ADDR_LEN);
-
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.DlsReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Allocate buffer for transmitting message
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if (NStatus != NDIS_STATUS_SUCCESS)
- return NStatus;
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // use proprietary PTK
- NdisZeroMemory(temp, 64);
- NdisMoveMemory(temp, "IEEE802.11 WIRELESS ACCESS POINT", 32);
- WpaDerivePTK(pAd, temp, temp, pAd->CommonCfg.Bssid, temp, pAd->CurrentAddress, DlsPTK, LEN_PTK);
-
- // calculate MIC
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- NdisZeroMemory(digest, sizeof(digest));
- HMAC_SHA1(DlsPTK, LEN_EAP_MICK, pOutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(Packet.KeyDesc.KeyMic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- NdisZeroMemory(Mic, sizeof(Mic));
- HMAC_MD5(DlsPTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic, MD5_DIGEST_SIZE);
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
- }
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(Header802_3), Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- NStatus = RTMPAllocateNdisPacket(pAd, &pNdisPacket, NULL, 0, pOutBuffer, FrameLen);
- if (NStatus == NDIS_STATUS_SUCCESS)
- {
- RTMP_SET_PACKET_WCID(pNdisPacket, BSSID_WCID);
- STASendPacket(pAd, pNdisPacket);
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
- }
-
- MlmeFreeMemory(pAd, pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSendSTAKeyRequest- Send STAKey request (NStatus=%x, FrameLen=%ld)\n", NStatus, FrameLen));
-
- return NStatus;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-NDIS_STATUS RTMPSendSTAKeyHandShake(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA)
-{
- UCHAR Header802_3[14];
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- UCHAR Mic[16];
- UCHAR digest[80];
- PUCHAR pOutBuffer = NULL;
- PNDIS_PACKET pNdisPacket;
- UCHAR temp[64];
- UCHAR DlsPTK[80]; // Due to dirver can not get PTK, use proprietary PTK
-
- DBGPRINT(RT_DEBUG_TRACE,("DLS - RTMPSendSTAKeyHandShake() to %02x:%02x:%02x:%02x:%02x:%02x\n", pDA[0], pDA[1], pDA[2], pDA[3], pDA[4], pDA[5]));
-
- pAd->Sequence ++;
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- // Zero message body
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
- Packet.Body_Len[1] = sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE + 6 + MAC_ADDR_LEN; // data field contain KDE and Peer MAC address
-
- // STAKey Message is as EAPOL-Key(1,1,0,0,G/0,0,0, MIC, 0,Peer MAC KDE)
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK))
- {
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) || (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK))
- {
- Packet.KeyDesc.Type = WPA2_KEY_DESC;
- }
-
- // Key descriptor version
- Packet.KeyDesc.KeyInfo.KeyDescVer =
- (((pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled) || (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)) ? (DESC_TYPE_AES) : (DESC_TYPE_TKIP));
-
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
- Packet.KeyDesc.KeyInfo.Secure = 1;
-
- Packet.KeyDesc.KeyDataLen[1] = 12;
-
- // use our own OUI to distinguish proprietary with standard.
- Packet.KeyDesc.KeyData[0] = 0xDD;
- Packet.KeyDesc.KeyData[1] = 0x0A;
- Packet.KeyDesc.KeyData[2] = 0x00;
- Packet.KeyDesc.KeyData[3] = 0x0C;
- Packet.KeyDesc.KeyData[4] = 0x43;
- Packet.KeyDesc.KeyData[5] = 0x03;
- NdisMoveMemory(&Packet.KeyDesc.KeyData[6], pDA, MAC_ADDR_LEN);
-
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.DlsReplayCounter, LEN_KEY_DESC_REPLAY);
-
- // Allocate buffer for transmitting message
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if (NStatus != NDIS_STATUS_SUCCESS)
- return NStatus;
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- // use proprietary PTK
- NdisZeroMemory(temp, 64);
- NdisMoveMemory(temp, "IEEE802.11 WIRELESS ACCESS POINT", 32);
- WpaDerivePTK(pAd, temp, temp, pAd->CommonCfg.Bssid, temp, pAd->CurrentAddress, DlsPTK, LEN_PTK);
-
- // calculate MIC
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- // AES
- NdisZeroMemory(digest, sizeof(digest));
- HMAC_SHA1(DlsPTK, LEN_EAP_MICK, pOutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(Packet.KeyDesc.KeyMic, digest, LEN_KEY_DESC_MIC);
- }
- else
- {
- NdisZeroMemory(Mic, sizeof(Mic));
- HMAC_MD5(DlsPTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic, MD5_DIGEST_SIZE);
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
- }
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(Header802_3), Header802_3,
- Packet.Body_Len[1] + 4, &Packet,
- END_OF_ARGS);
-
- NStatus = RTMPAllocateNdisPacket(pAd, &pNdisPacket, NULL, 0, pOutBuffer, FrameLen);
- if (NStatus == NDIS_STATUS_SUCCESS)
- {
- RTMP_SET_PACKET_WCID(pNdisPacket, BSSID_WCID);
- STASendPacket(pAd, pNdisPacket);
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
- }
-
- MlmeFreeMemory(pAd, pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPSendSTAKeyHandShake- Send STAKey Message-2 (NStatus=%x, FrameLen=%ld)\n", NStatus, FrameLen));
-
- return NStatus;
-}
-
-VOID DlsTimeoutAction(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- MLME_DLS_REQ_STRUCT MlmeDlsReq;
- USHORT reason;
- PRT_802_11_DLS pDLS = (PRT_802_11_DLS)FunctionContext;
- PRTMP_ADAPTER pAd = pDLS->pAd;
-
- DBGPRINT(RT_DEBUG_TRACE, ("DlsTimeout - Tear down DLS links (%02x:%02x:%02x:%02x:%02x:%02x)\n",
- pDLS->MacAddr[0], pDLS->MacAddr[1], pDLS->MacAddr[2], pDLS->MacAddr[3], pDLS->MacAddr[4], pDLS->MacAddr[5]));
-
- if ((pDLS) && (pDLS->Valid))
- {
- reason = REASON_QOS_REQUEST_TIMEOUT;
- pDLS->Valid = FALSE;
- pDLS->Status = DLS_NONE;
- DlsParmFill(pAd, &MlmeDlsReq, pDLS, reason);
- MlmeEnqueue(pAd, DLS_STATE_MACHINE, MT2_MLME_DLS_TEAR_DOWN, sizeof(MLME_DLS_REQ_STRUCT), &MlmeDlsReq);
- RTMP_MLME_HANDLER(pAd);
- }
-}
-
-/*
-================================================================
-Description : because DLS and CLI share the same WCID table in ASIC.
-Mesh entry also insert to pAd->MacTab.content[]. Such is marked as ValidAsDls = TRUE.
-Also fills the pairwise key.
-Because front MAX_AID_BA entries have direct mapping to BAEntry, which is only used as CLI. So we insert Dls
-from index MAX_AID_BA.
-================================================================
-*/
-MAC_TABLE_ENTRY *MacTableInsertDlsEntry(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN UINT DlsEntryIdx)
-{
- PMAC_TABLE_ENTRY pEntry = NULL;
-
- DBGPRINT(RT_DEBUG_TRACE, ("====> MacTableInsertDlsEntry\n"));
- // if FULL, return
- if (pAd->MacTab.Size >= MAX_LEN_OF_MAC_TABLE)
- return NULL;
-
- do
- {
- if((pEntry = DlsEntryTableLookup(pAd, pAddr, TRUE)) != NULL)
- break;
-
- // allocate one MAC entry
- pEntry = MacTableInsertEntry(pAd, pAddr, DlsEntryIdx + MIN_NET_DEVICE_FOR_DLS, TRUE);
- if (pEntry)
- {
- pAd->StaCfg.DLSEntry[DlsEntryIdx].MacTabMatchWCID = pEntry->Aid;
- pEntry->MatchDlsEntryIdx = DlsEntryIdx;
- pEntry->AuthMode = pAd->StaCfg.AuthMode;
- pEntry->WepStatus = pAd->StaCfg.WepStatus;
- pEntry->PortSecured = WPA_802_1X_PORT_SECURED;
-
- DBGPRINT(RT_DEBUG_TRACE, ("MacTableInsertDlsEntry - allocate entry #%d, Total= %d\n",pEntry->Aid, pAd->MacTab.Size));
-
- // If legacy WEP is used, set pair-wise cipherAlg into WCID attribute table for this entry
- if ((pEntry->ValidAsDls) && (pAd->StaCfg.WepStatus == Ndis802_11WEPEnabled))
- {
- UCHAR KeyIdx = 0;
- UCHAR CipherAlg = 0;
-
- KeyIdx = pAd->StaCfg.DefaultKeyId;
-
- CipherAlg = pAd->SharedKey[BSS0][KeyIdx].CipherAlg;
-
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- pEntry);
- }
-
- break;
- }
- } while(FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==== MacTableInsertDlsEntry\n"));
-
- return pEntry;
-}
-
-
-/*
- ==========================================================================
- Description:
- Delete all Mesh Entry in pAd->MacTab
- ==========================================================================
- */
-BOOLEAN MacTableDeleteDlsEntry(
- IN PRTMP_ADAPTER pAd,
- IN USHORT wcid,
- IN PUCHAR pAddr)
-{
- DBGPRINT(RT_DEBUG_TRACE, ("====> MacTableDeleteDlsEntry\n"));
-
- if (!VALID_WCID(wcid))
- return FALSE;
-
- MacTableDeleteEntry(pAd, wcid, pAddr);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==== MacTableDeleteDlsEntry\n"));
-
- return TRUE;
-}
-
-MAC_TABLE_ENTRY *DlsEntryTableLookup(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount)
-{
- ULONG HashIdx;
- MAC_TABLE_ENTRY *pEntry = NULL;
-
- RTMP_SEM_LOCK(&pAd->MacTabLock);
- HashIdx = MAC_ADDR_HASH_INDEX(pAddr);
- pEntry = pAd->MacTab.Hash[HashIdx];
-
- while (pEntry)
- {
- if ((pEntry->ValidAsDls == TRUE)
- && MAC_ADDR_EQUAL(pEntry->Addr, pAddr))
- {
- if(bResetIdelCount)
- pEntry->NoDataIdleCount = 0;
- break;
- }
- else
- pEntry = pEntry->pNext;
- }
-
- RTMP_SEM_UNLOCK(&pAd->MacTabLock);
- return pEntry;
-}
-
-MAC_TABLE_ENTRY *DlsEntryTableLookupByWcid(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR wcid,
- IN PUCHAR pAddr,
- IN BOOLEAN bResetIdelCount)
-{
- ULONG DLsIndex;
- PMAC_TABLE_ENTRY pCurEntry = NULL;
- PMAC_TABLE_ENTRY pEntry = NULL;
-
- if (!VALID_WCID(wcid))
- return NULL;
-
- RTMP_SEM_LOCK(&pAd->MacTabLock);
-
- do
- {
- pCurEntry = &pAd->MacTab.Content[wcid];
-
- DLsIndex = 0xff;
- if ((pCurEntry) && (pCurEntry->ValidAsDls== TRUE))
- {
- DLsIndex = pCurEntry->MatchDlsEntryIdx;
- }
-
- if (DLsIndex == 0xff)
- break;
-
- if (MAC_ADDR_EQUAL(pCurEntry->Addr, pAddr))
- {
- if(bResetIdelCount)
- pCurEntry->NoDataIdleCount = 0;
- pEntry = pCurEntry;
- break;
- }
- } while(FALSE);
-
- RTMP_SEM_UNLOCK(&pAd->MacTabLock);
-
- return pEntry;
-}
-
-INT Set_DlsEntryInfo_Display_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- INT i;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%-19s%-8s\n", "MAC", "TIMEOUT\n"));
- for (i=0; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if ((pAd->StaCfg.DLSEntry[i].Valid) && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[pAd->StaCfg.DLSEntry[i].MacTabMatchWCID];
-
- DBGPRINT(RT_DEBUG_OFF, ("%02x:%02x:%02x:%02x:%02x:%02x ",
- pAd->StaCfg.DLSEntry[i].MacAddr[0], pAd->StaCfg.DLSEntry[i].MacAddr[1], pAd->StaCfg.DLSEntry[i].MacAddr[2],
- pAd->StaCfg.DLSEntry[i].MacAddr[3], pAd->StaCfg.DLSEntry[i].MacAddr[4], pAd->StaCfg.DLSEntry[i].MacAddr[5]));
- DBGPRINT(RT_DEBUG_OFF, ("%-8d\n", pAd->StaCfg.DLSEntry[i].TimeOut));
-
- DBGPRINT(RT_DEBUG_OFF, ("\n"));
- DBGPRINT(RT_DEBUG_OFF, ("\n%-19s%-4s%-4s%-4s%-4s%-7s%-7s%-7s","MAC", "AID", "BSS", "PSM", "WMM", "RSSI0", "RSSI1", "RSSI2"));
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_OFF, ("%-8s%-10s%-6s%-6s%-6s%-6s", "MIMOPS", "PhMd", "BW", "MCS", "SGI", "STBC"));
-#endif // DOT11_N_SUPPORT //
- DBGPRINT(RT_DEBUG_OFF, ("\n%02X:%02X:%02X:%02X:%02X:%02X ",
- pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2],
- pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]));
- DBGPRINT(RT_DEBUG_OFF, ("%-4d", (int)pEntry->Aid));
- DBGPRINT(RT_DEBUG_OFF, ("%-4d", (int)pEntry->apidx));
- DBGPRINT(RT_DEBUG_OFF, ("%-4d", (int)pEntry->PsMode));
- DBGPRINT(RT_DEBUG_OFF, ("%-4d", (int)CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE)));
- DBGPRINT(RT_DEBUG_OFF, ("%-7d", pEntry->RssiSample.AvgRssi0));
- DBGPRINT(RT_DEBUG_OFF, ("%-7d", pEntry->RssiSample.AvgRssi1));
- DBGPRINT(RT_DEBUG_OFF, ("%-7d", pEntry->RssiSample.AvgRssi2));
-#ifdef DOT11_N_SUPPORT
- DBGPRINT(RT_DEBUG_OFF, ("%-8d", (int)pEntry->MmpsMode));
- DBGPRINT(RT_DEBUG_OFF, ("%-10s", GetPhyMode(pEntry->HTPhyMode.field.MODE)));
- DBGPRINT(RT_DEBUG_OFF, ("%-6s", GetBW(pEntry->HTPhyMode.field.BW)));
- DBGPRINT(RT_DEBUG_OFF, ("%-6d", pEntry->HTPhyMode.field.MCS));
- DBGPRINT(RT_DEBUG_OFF, ("%-6d", pEntry->HTPhyMode.field.ShortGI));
- DBGPRINT(RT_DEBUG_OFF, ("%-6d", pEntry->HTPhyMode.field.STBC));
-#endif // DOT11_N_SUPPORT //
- DBGPRINT(RT_DEBUG_OFF, ("%-10d, %d, %d%%\n", pEntry->DebugFIFOCount, pEntry->DebugTxCount,
- (pEntry->DebugTxCount) ? ((pEntry->DebugTxCount-pEntry->DebugFIFOCount)*100/pEntry->DebugTxCount) : 0));
- DBGPRINT(RT_DEBUG_OFF, ("\n"));
-
- }
- }
-
- return TRUE;
-}
-
-INT Set_DlsAddEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR mac[MAC_ADDR_LEN];
- USHORT Timeout;
- PSTRING token;
- STRING sepValue[] = ":", DASH = '-';
- INT i;
- RT_802_11_DLS Dls;
-
- if(strlen(arg) < 19) //Mac address acceptable format 01:02:03:04:05:06 length 17 plus the "-" and timeout value in decimal format.
- return FALSE;
-
- token = strchr(arg, DASH);
- if ((token != NULL) && (strlen(token)>1))
- {
- Timeout = (USHORT) simple_strtol((token+1), 0, 10);
-
- *token = '\0';
- for (i = 0, token = rstrtok(arg, &sepValue[0]); token; token = rstrtok(NULL, &sepValue[0]), i++)
- {
- if((strlen(token) != 2) || (!isxdigit(*token)) || (!isxdigit(*(token+1))))
- return FALSE;
- AtoH(token, (&mac[i]), 1);
- }
- if(i != 6)
- return FALSE;
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x-%d", mac[0], mac[1],
- mac[2], mac[3], mac[4], mac[5], (int)Timeout));
-
- NdisZeroMemory(&Dls, sizeof(RT_802_11_DLS));
- Dls.TimeOut = Timeout;
- COPY_MAC_ADDR(Dls.MacAddr, mac);
- Dls.Valid = 1;
-
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- RT_OID_802_11_SET_DLS_PARAM,
- sizeof(RT_802_11_DLS),
- &Dls);
-
- return TRUE;
- }
-
- return FALSE;
-
-}
-
-INT Set_DlsTearDownEntry_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- UCHAR macAddr[MAC_ADDR_LEN];
- PSTRING value;
- INT i;
- RT_802_11_DLS Dls;
-
- if(strlen(arg) != 17) //Mac address acceptable format 01:02:03:04:05:06 length 17
- return FALSE;
-
- for (i=0, value = rstrtok(arg,":"); value; value = rstrtok(NULL,":"))
- {
- if((strlen(value) != 2) || (!isxdigit(*value)) || (!isxdigit(*(value+1))) )
- return FALSE; //Invalid
-
- AtoH(value, &macAddr[i++], 2);
- }
-
- DBGPRINT(RT_DEBUG_OFF, ("\n%02x:%02x:%02x:%02x:%02x:%02x", macAddr[0], macAddr[1],
- macAddr[2], macAddr[3], macAddr[4], macAddr[5]));
-
- NdisZeroMemory(&Dls, sizeof(RT_802_11_DLS));
- COPY_MAC_ADDR(Dls.MacAddr, macAddr);
- Dls.Valid = 0;
-
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- RT_OID_802_11_SET_DLS_PARAM,
- sizeof(RT_802_11_DLS),
- &Dls);
-
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/sta/rtmp_ckipmic.c b/drivers/staging/rt3090/sta/rtmp_ckipmic.c
deleted file mode 100644
index 5f6dbd7cf057..000000000000
--- a/drivers/staging/rt3090/sta/rtmp_ckipmic.c
+++ /dev/null
@@ -1,579 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_ckipmic.c
-
- Abstract:
- Data path subroutines
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "../rt_config.h"
-#include "../rtmp_ckipmic.h"
-
-
-#define MIC_ACCUM(v) pContext->accum += (ULONGLONG)v * RTMPMicGetCoefficient(pContext)
-#define GB(p,i,s) ( ((ULONG) *((UCHAR*)(p)+i) ) << (s) )
-#define GETBIG32(p) GB(p,0,24)|GB(p,1,16)|GB(p,2,8)|GB(p,3,0)
-
-/*****************************/
-/******** SBOX Table *********/
-/*****************************/
-
-UCHAR SboxTable[256] =
-{
- 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5,
- 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7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, 0x08,
- 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6,
- 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
- 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e,
- 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
- 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94,
- 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
- 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68,
- 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16
-};
-
-/*===========================================================================*/
-/*=================== CKIP KEY PERMUTATION ==================================*/
-/*===========================================================================*/
-
-/* 2-byte by 2-byte subset of the full AES table */
-static const USHORT Sbox[256] =
-{
- 0xC6A5,0xF884,0xEE99,0xF68D,0xFF0D,0xD6BD,0xDEB1,0x9154,
- 0x6050,0x0203,0xCEA9,0x567D,0xE719,0xB562,0x4DE6,0xEC9A,
- 0x8F45,0x1F9D,0x8940,0xFA87,0xEF15,0xB2EB,0x8EC9,0xFB0B,
- 0x41EC,0xB367,0x5FFD,0x45EA,0x23BF,0x53F7,0xE496,0x9B5B,
- 0x75C2,0xE11C,0x3DAE,0x4C6A,0x6C5A,0x7E41,0xF502,0x834F,
- 0x685C,0x51F4,0xD134,0xF908,0xE293,0xAB73,0x6253,0x2A3F,
- 0x080C,0x9552,0x4665,0x9D5E,0x3028,0x37A1,0x0A0F,0x2FB5,
- 0x0E09,0x2436,0x1B9B,0xDF3D,0xCD26,0x4E69,0x7FCD,0xEA9F,
- 0x121B,0x1D9E,0x5874,0x342E,0x362D,0xDCB2,0xB4EE,0x5BFB,
- 0xA4F6,0x764D,0xB761,0x7DCE,0x527B,0xDD3E,0x5E71,0x1397,
- 0xA6F5,0xB968,0x0000,0xC12C,0x4060,0xE31F,0x79C8,0xB6ED,
- 0xD4BE,0x8D46,0x67D9,0x724B,0x94DE,0x98D4,0xB0E8,0x854A,
- 0xBB6B,0xC52A,0x4FE5,0xED16,0x86C5,0x9AD7,0x6655,0x1194,
- 0x8ACF,0xE910,0x0406,0xFE81,0xA0F0,0x7844,0x25BA,0x4BE3,
- 0xA2F3,0x5DFE,0x80C0,0x058A,0x3FAD,0x21BC,0x7048,0xF104,
- 0x63DF,0x77C1,0xAF75,0x4263,0x2030,0xE51A,0xFD0E,0xBF6D,
- 0x814C,0x1814,0x2635,0xC32F,0xBEE1,0x35A2,0x88CC,0x2E39,
- 0x9357,0x55F2,0xFC82,0x7A47,0xC8AC,0xBAE7,0x322B,0xE695,
- 0xC0A0,0x1998,0x9ED1,0xA37F,0x4466,0x547E,0x3BAB,0x0B83,
- 0x8CCA,0xC729,0x6BD3,0x283C,0xA779,0xBCE2,0x161D,0xAD76,
- 0xDB3B,0x6456,0x744E,0x141E,0x92DB,0x0C0A,0x486C,0xB8E4,
- 0x9F5D,0xBD6E,0x43EF,0xC4A6,0x39A8,0x31A4,0xD337,0xF28B,
- 0xD532,0x8B43,0x6E59,0xDAB7,0x018C,0xB164,0x9CD2,0x49E0,
- 0xD8B4,0xACFA,0xF307,0xCF25,0xCAAF,0xF48E,0x47E9,0x1018,
- 0x6FD5,0xF088,0x4A6F,0x5C72,0x3824,0x57F1,0x73C7,0x9751,
- 0xCB23,0xA17C,0xE89C,0x3E21,0x96DD,0x61DC,0x0D86,0x0F85,
- 0xE090,0x7C42,0x71C4,0xCCAA,0x90D8,0x0605,0xF701,0x1C12,
- 0xC2A3,0x6A5F,0xAEF9,0x69D0,0x1791,0x9958,0x3A27,0x27B9,
- 0xD938,0xEB13,0x2BB3,0x2233,0xD2BB,0xA970,0x0789,0x33A7,
- 0x2DB6,0x3C22,0x1592,0xC920,0x8749,0xAAFF,0x5078,0xA57A,
- 0x038F,0x59F8,0x0980,0x1A17,0x65DA,0xD731,0x84C6,0xD0B8,
- 0x82C3,0x29B0,0x5A77,0x1E11,0x7BCB,0xA8FC,0x6DD6,0x2C3A
- };
-
-#define Lo8(v16) ((v16) & 0xFF)
-#define Hi8(v16) (((v16) >> 8) & 0xFF)
-#define u16Swap(i) ( (((i) >> 8) & 0xFF) | (((i) << 8) & 0xFF00) )
-#define _S_(i) (Sbox[Lo8(i)] ^ u16Swap(Sbox[Hi8(i)]))
-
-#define rotLeft_1(x) ((((x) << 1) | ((x) >> 15)) & 0xFFFF)
-VOID CKIP_key_permute
- (
- OUT UCHAR *PK, /* output permuted key */
- IN UCHAR *CK, /* input CKIP key */
- IN UCHAR toDsFromDs, /* input toDs/FromDs bits */
- IN UCHAR *piv /* input pointer to IV */
- )
-{
- int i;
- USHORT H[2], tmp; /* H=32-bits of per-packet hash value */
- USHORT L[8], R[8]; /* L=u16 array of CK, R=u16 array of PK */
-
- /* build L from input key */
- memset(L, 0, sizeof(L));
- for (i=0; i<16; i++) {
- L[i>>1] |= ( ((USHORT)(CK[i])) << ( i & 1 ? 8 : 0) );
- }
-
- H[0] = (((USHORT)piv[0]) << 8) + piv[1];
- H[1] = ( ((USHORT)toDsFromDs) << 8) | piv[2];
-
- for (i=0; i<8; i++) {
- H[0] ^= L[i]; /* 16-bits of key material */
- tmp = _S_(H[0]); /* 16x16 permutation */
- H[0] = tmp ^ H[1]; /* set up for next round */
- H[1] = tmp;
- R[i] = H[0]; /* store into key array */
- }
-
- /* sweep in the other direction */
- tmp=L[0];
- for (i=7; i>0; i--) {
- R[i] = tmp = rotLeft_1(tmp) + R[i];
- }
-
- /* IV of the permuted key is unchanged */
- PK[0] = piv[0];
- PK[1] = piv[1];
- PK[2] = piv[2];
-
- /* key portion of the permuted key is changed */
- for (i=3; i<16; i++) {
- PK[i] = (UCHAR) (R[i>>1] >> (i & 1 ? 8 : 0));
- }
-}
-
-/* prepare for calculation of a new mic */
-VOID RTMPCkipMicInit(
- IN PMIC_CONTEXT pContext,
- IN PUCHAR CK)
-{
- /* prepare for new mic calculation */
- NdisMoveMemory(pContext->CK, CK, sizeof(pContext->CK));
- pContext->accum = 0;
- pContext->position = 0;
-}
-
-/* add some bytes to the mic calculation */
-VOID RTMPMicUpdate(
- IN PMIC_CONTEXT pContext,
- IN PUCHAR pOctets,
- IN INT len)
-{
- INT byte_position;
- ULONG val;
-
- byte_position = (pContext->position & 3);
- while (len > 0) {
- /* build a 32-bit word for MIC multiply accumulate */
- do {
- if (len == 0) return;
- pContext->part[byte_position++] = *pOctets++;
- pContext->position++;
- len--;
- } while (byte_position < 4);
- /* have a full 32-bit word to process */
- val = GETBIG32(&pContext->part[0]);
- MIC_ACCUM(val);
- byte_position = 0;
- }
-}
-
-ULONG RTMPMicGetCoefficient(
- IN PMIC_CONTEXT pContext)
-{
- UCHAR aes_counter[16];
- INT coeff_position;
- UCHAR *p;
-
- coeff_position = (pContext->position - 1) >> 2;
- if ( (coeff_position & 3) == 0) {
- /* fetching the first coefficient -- get new 16-byte aes counter output */
- u32 counter = (coeff_position >> 2);
-
- /* new counter value */
- memset(&aes_counter[0], 0, sizeof(aes_counter));
- aes_counter[15] = (UINT8)(counter >> 0);
- aes_counter[14] = (UINT8)(counter >> 8);
- aes_counter[13] = (UINT8)(counter >> 16);
- aes_counter[12] = (UINT8)(counter >> 24);
-
- RTMPAesEncrypt(&pContext->CK[0], &aes_counter[0], pContext->coefficient);
- }
- p = &(pContext->coefficient[ (coeff_position & 3) << 2 ]);
- return GETBIG32(p);
-}
-
-/****************************************/
-/* aes128k128d() */
-/* Performs a 128 bit AES encrypt with */
-/* 128 bit data. */
-/****************************************/
-VOID xor_128(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0;i<16; i++)
- {
- out[i] = a[i] ^ b[i];
- }
-}
-
-UCHAR RTMPCkipSbox(
- IN UCHAR a)
-{
- return SboxTable[(int)a];
-}
-
-VOID xor_32(
- IN PUCHAR a,
- IN PUCHAR b,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0;i<4; i++)
- {
- out[i] = a[i] ^ b[i];
- }
-}
-
-VOID next_key(
- IN PUCHAR key,
- IN INT round)
-{
- UCHAR rcon;
- UCHAR sbox_key[4];
- UCHAR rcon_table[12] =
- {
- 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
- 0x1b, 0x36, 0x36, 0x36
- };
-
- sbox_key[0] = RTMPCkipSbox(key[13]);
- sbox_key[1] = RTMPCkipSbox(key[14]);
- sbox_key[2] = RTMPCkipSbox(key[15]);
- sbox_key[3] = RTMPCkipSbox(key[12]);
-
- rcon = rcon_table[round];
-
- xor_32(&key[0], sbox_key, &key[0]);
- key[0] = key[0] ^ rcon;
-
- xor_32(&key[4], &key[0], &key[4]);
- xor_32(&key[8], &key[4], &key[8]);
- xor_32(&key[12], &key[8], &key[12]);
-}
-
-VOID byte_sub(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- INT i;
-
- for (i=0; i< 16; i++)
- {
- out[i] = RTMPCkipSbox(in[i]);
- }
-}
-
-VOID shift_row(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- out[0] = in[0];
- out[1] = in[5];
- out[2] = in[10];
- out[3] = in[15];
- out[4] = in[4];
- out[5] = in[9];
- out[6] = in[14];
- out[7] = in[3];
- out[8] = in[8];
- out[9] = in[13];
- out[10] = in[2];
- out[11] = in[7];
- out[12] = in[12];
- out[13] = in[1];
- out[14] = in[6];
- out[15] = in[11];
-}
-
-VOID mix_column(
- IN PUCHAR in,
- OUT PUCHAR out)
-{
- INT i;
- UCHAR add1b[4];
- UCHAR add1bf7[4];
- UCHAR rotl[4];
- UCHAR swap_halfs[4];
- UCHAR andf7[4];
- UCHAR rotr[4];
- UCHAR temp[4];
- UCHAR tempb[4];
-
- for (i=0 ; i<4; i++)
- {
- if ((in[i] & 0x80)== 0x80)
- add1b[i] = 0x1b;
- else
- add1b[i] = 0x00;
- }
-
- swap_halfs[0] = in[2]; /* Swap halfs */
- swap_halfs[1] = in[3];
- swap_halfs[2] = in[0];
- swap_halfs[3] = in[1];
-
- rotl[0] = in[3]; /* Rotate left 8 bits */
- rotl[1] = in[0];
- rotl[2] = in[1];
- rotl[3] = in[2];
-
- andf7[0] = in[0] & 0x7f;
- andf7[1] = in[1] & 0x7f;
- andf7[2] = in[2] & 0x7f;
- andf7[3] = in[3] & 0x7f;
-
- for (i = 3; i>0; i--) /* logical shift left 1 bit */
- {
- andf7[i] = andf7[i] << 1;
- if ((andf7[i-1] & 0x80) == 0x80)
- {
- andf7[i] = (andf7[i] | 0x01);
- }
- }
- andf7[0] = andf7[0] << 1;
- andf7[0] = andf7[0] & 0xfe;
-
- xor_32(add1b, andf7, add1bf7);
-
- xor_32(in, add1bf7, rotr);
-
- temp[0] = rotr[0]; /* Rotate right 8 bits */
- rotr[0] = rotr[1];
- rotr[1] = rotr[2];
- rotr[2] = rotr[3];
- rotr[3] = temp[0];
-
- xor_32(add1bf7, rotr, temp);
- xor_32(swap_halfs, rotl,tempb);
- xor_32(temp, tempb, out);
-}
-
-VOID RTMPAesEncrypt(
- IN PUCHAR key,
- IN PUCHAR data,
- IN PUCHAR ciphertext)
-{
- INT round;
- INT i;
- UCHAR intermediatea[16];
- UCHAR intermediateb[16];
- UCHAR round_key[16];
-
- for(i=0; i<16; i++) round_key[i] = key[i];
-
- for (round = 0; round < 11; round++)
- {
- if (round == 0)
- {
- xor_128(round_key, data, ciphertext);
- next_key(round_key, round);
- }
- else if (round == 10)
- {
- byte_sub(ciphertext, intermediatea);
- shift_row(intermediatea, intermediateb);
- xor_128(intermediateb, round_key, ciphertext);
- }
- else /* 1 - 9 */
- {
- byte_sub(ciphertext, intermediatea);
- shift_row(intermediatea, intermediateb);
- mix_column(&intermediateb[0], &intermediatea[0]);
- mix_column(&intermediateb[4], &intermediatea[4]);
- mix_column(&intermediateb[8], &intermediatea[8]);
- mix_column(&intermediateb[12], &intermediatea[12]);
- xor_128(intermediatea, round_key, ciphertext);
- next_key(round_key, round);
- }
- }
-
-}
-
-/* calculate the mic */
-VOID RTMPMicFinal(
- IN PMIC_CONTEXT pContext,
- OUT UCHAR digest[4])
-{
- INT byte_position;
- ULONG val;
- ULONGLONG sum, utmp;
- LONGLONG stmp;
-
- /* deal with partial 32-bit word left over from last update */
- if ( (byte_position = (pContext->position & 3)) != 0) {
- /* have a partial word in part to deal with -- zero unused bytes */
- do {
- pContext->part[byte_position++] = 0;
- pContext->position++;
- } while (byte_position < 4);
- val = GETBIG32(&pContext->part[0]);
- MIC_ACCUM(val);
- }
-
- /* reduce the accumulated u64 to a 32-bit MIC */
- sum = pContext->accum;
- stmp = (sum & 0xffffffffL) - ((sum >> 32) * 15);
- utmp = (stmp & 0xffffffffL) - ((stmp >> 32) * 15);
- sum = utmp & 0xffffffffL;
- if (utmp > 0x10000000fL)
- sum -= 15;
-
- val = (ULONG)sum;
- digest[0] = (UCHAR)((val>>24) & 0xFF);
- digest[1] = (UCHAR) ((val>>16) & 0xFF);
- digest[2] = (UCHAR) ((val>>8) & 0xFF);
- digest[3] = (UCHAR)((val>>0) & 0xFF);
-}
-
-VOID RTMPCkipInsertCMIC(
- IN PRTMP_ADAPTER pAd,
- OUT PUCHAR pMIC,
- IN PUCHAR p80211hdr,
- IN PNDIS_PACKET pPacket,
- IN PCIPHER_KEY pKey,
- IN PUCHAR mic_snap)
-{
- PACKET_INFO PacketInfo;
- PUCHAR pSrcBufVA;
- ULONG SrcBufLen;
- PUCHAR pDA, pSA, pProto;
- UCHAR bigethlen[2];
- UCHAR ckip_ck[16];
- MIC_CONTEXT mic_ctx;
- USHORT payloadlen;
- UCHAR i;
-
- if (pKey == NULL)
- {
- DBGPRINT_ERR(("RTMPCkipInsertCMIC, Before to form the CKIP key (CK), pKey can't be NULL\n"));
- return;
- }
-
- switch (*(p80211hdr+1) & 3)
- {
- case 0: /* FromDs=0, ToDs=0 */
- pDA = p80211hdr+4;
- pSA = p80211hdr+10;
- break;
- case 1: /* FromDs=0, ToDs=1 */
- pDA = p80211hdr+16;
- pSA = p80211hdr+10;
- break;
- case 2: /* FromDs=1, ToDs=0 */
- pDA = p80211hdr+4;
- pSA = p80211hdr+16;
- break;
- case 3: /* FromDs=1, ToDs=1 */
- pDA = p80211hdr+16;
- pSA = p80211hdr+24;
- break;
- }
-
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
-
- if (SrcBufLen < LENGTH_802_3)
- return;
-
- pProto = pSrcBufVA + 12;
- payloadlen = PacketInfo.TotalPacketLength - LENGTH_802_3 + 18; // CKIP_LLC(8)+CMIC(4)+TxSEQ(4)+PROTO(2)=18
-
- bigethlen[0] = (unsigned char)(payloadlen >> 8);
- bigethlen[1] = (unsigned char)payloadlen;
-
- //
- // Encryption Key expansion to form the CKIP Key (CKIP_CK).
- //
- if (pKey->KeyLen < 16)
- {
- for(i = 0; i < (16 / pKey->KeyLen); i++)
- {
- NdisMoveMemory(ckip_ck + i * pKey->KeyLen,
- pKey->Key,
- pKey->KeyLen);
- }
- NdisMoveMemory(ckip_ck + i * pKey->KeyLen,
- pKey->Key,
- 16 - (i * pKey->KeyLen));
- }
- else
- {
- NdisMoveMemory(ckip_ck, pKey->Key, pKey->KeyLen);
- }
- RTMPCkipMicInit(&mic_ctx, ckip_ck);
- RTMPMicUpdate(&mic_ctx, pDA, MAC_ADDR_LEN); // MIC <-- DA
- RTMPMicUpdate(&mic_ctx, pSA, MAC_ADDR_LEN); // MIC <-- SA
- RTMPMicUpdate(&mic_ctx, bigethlen, 2); // MIC <-- payload length starting from CKIP SNAP
- RTMPMicUpdate(&mic_ctx, mic_snap, 8); // MIC <-- snap header
- RTMPMicUpdate(&mic_ctx, pAd->StaCfg.TxSEQ, 4); // MIC <-- TxSEQ
- RTMPMicUpdate(&mic_ctx, pProto, 2); // MIC <-- Protocol
-
- pSrcBufVA += LENGTH_802_3;
- SrcBufLen -= LENGTH_802_3;
-
- // Mic <-- original payload. loop until all payload processed
- do
- {
- if (SrcBufLen > 0)
- RTMPMicUpdate(&mic_ctx, pSrcBufVA, SrcBufLen);
-
- NdisGetNextBuffer(PacketInfo.pFirstBuffer, &PacketInfo.pFirstBuffer);
- if (PacketInfo.pFirstBuffer)
- {
- NDIS_QUERY_BUFFER(PacketInfo.pFirstBuffer, &pSrcBufVA, &SrcBufLen);
- }
- else
- break;
- } while (TRUE);
-
- RTMPMicFinal(&mic_ctx, pMIC); // update MIC
-}
diff --git a/drivers/staging/rt3090/sta/rtmp_data.c b/drivers/staging/rt3090/sta/rtmp_data.c
deleted file mode 100644
index 559136409ff2..000000000000
--- a/drivers/staging/rt3090/sta/rtmp_data.c
+++ /dev/null
@@ -1,2661 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- rtmp_data.c
-
- Abstract:
- Data path subroutines
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
-*/
-
-#include "../rt_config.h"
-
-
-VOID STARxEAPOLFrameIndicate(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
- PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
- PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
- UCHAR *pTmpBuf;
-
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP)
- {
- // All EAPoL frames have to pass to upper layer (ex. WPA_SUPPLICANT daemon)
- // TBD : process fragmented EAPol frames
- {
- // In 802.1x mode, if the received frame is EAP-SUCCESS packet, turn on the PortSecured variable
- if ( pAd->StaCfg.IEEE8021X == TRUE &&
- (EAP_CODE_SUCCESS == WpaCheckEapCode(pAd, pRxBlk->pData, pRxBlk->DataSize, LENGTH_802_1_H)))
- {
- PUCHAR Key;
- UCHAR CipherAlg;
- int idx = 0;
-
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("Receive EAP-SUCCESS Packet\n"));
- //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAd);
-
- if (pAd->StaCfg.IEEE8021x_required_keys == FALSE)
- {
- idx = pAd->StaCfg.DesireSharedKeyId;
- CipherAlg = pAd->StaCfg.DesireSharedKey[idx].CipherAlg;
- Key = pAd->StaCfg.DesireSharedKey[idx].Key;
-
- if (pAd->StaCfg.DesireSharedKey[idx].KeyLen > 0)
- {
-#ifdef RTMP_MAC_PCI
- MAC_TABLE_ENTRY *pEntry = &pAd->MacTab.Content[BSSID_WCID];
-
- // Set key material and cipherAlg to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, idx, CipherAlg, Key, NULL, NULL);
-
- // Assign group key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, NULL);
-
- // Assign pairwise key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, idx, CipherAlg, pEntry);
-
- pAd->IndicateMediaState = NdisMediaStateConnected;
- pAd->ExtraInfo = GENERAL_LINK_UP;
-#endif // RTMP_MAC_PCI //
- // For Preventing ShardKey Table is cleared by remove key procedure.
- pAd->SharedKey[BSS0][idx].CipherAlg = CipherAlg;
- pAd->SharedKey[BSS0][idx].KeyLen = pAd->StaCfg.DesireSharedKey[idx].KeyLen;
- NdisMoveMemory(pAd->SharedKey[BSS0][idx].Key,
- pAd->StaCfg.DesireSharedKey[idx].Key,
- pAd->StaCfg.DesireSharedKey[idx].KeyLen);
- }
- }
- }
-
- Indicate_Legacy_Packet(pAd, pRxBlk, FromWhichBSSID);
- return;
- }
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- // Special DATA frame that has to pass to MLME
- // 1. Cisco Aironet frames for CCX2. We need pass it to MLME for special process
- // 2. EAPOL handshaking frames when driver supplicant enabled, pass to MLME for special process
- {
- pTmpBuf = pRxBlk->pData - LENGTH_802_11;
- NdisMoveMemory(pTmpBuf, pRxBlk->pHeader, LENGTH_802_11);
- REPORT_MGMT_FRAME_TO_MLME(pAd, pRxWI->WirelessCliID, pTmpBuf, pRxBlk->DataSize + LENGTH_802_11, pRxWI->RSSI0, pRxWI->RSSI1, pRxWI->RSSI2, pRxD->PlcpSignal);
- DBGPRINT_RAW(RT_DEBUG_TRACE, ("!!! report EAPOL/AIRONET DATA to MLME (len=%d) !!!\n", pRxBlk->DataSize));
- }
- }
-
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
-
-}
-
-VOID STARxDataFrameAnnounce(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk,
- IN UCHAR FromWhichBSSID)
-{
-
- // non-EAP frame
- if (!RTMPCheckWPAframe(pAd, pEntry, pRxBlk->pData, pRxBlk->DataSize, FromWhichBSSID))
- {
-
- {
- // drop all non-EAP DATA frame before
- // this client's Port-Access-Control is secured
- if (pRxBlk->pHeader->FC.Wep)
- {
- // unsupported cipher suite
- if (pAd->StaCfg.WepStatus == Ndis802_11EncryptionDisabled)
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
- }
- else
- {
- // encryption in-use but receive a non-EAPOL clear text frame, drop it
- if ((pAd->StaCfg.WepStatus != Ndis802_11EncryptionDisabled) &&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
- }
- }
- RX_BLK_CLEAR_FLAG(pRxBlk, fRX_EAP);
-
-
- if (!RX_BLK_TEST_FLAG(pRxBlk, fRX_ARALINK))
- {
- // Normal legacy, AMPDU or AMSDU
- CmmRxnonRalinkFrameIndicate(pAd, pRxBlk, FromWhichBSSID);
-
- }
- else
- {
- // ARALINK
- CmmRxRalinkFrameIndicate(pAd, pEntry, pRxBlk, FromWhichBSSID);
- }
-#ifdef QOS_DLS_SUPPORT
- RX_BLK_CLEAR_FLAG(pRxBlk, fRX_DLS);
-#endif // QOS_DLS_SUPPORT //
- }
- else
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_EAP);
-#ifdef DOT11_N_SUPPORT
- if (RX_BLK_TEST_FLAG(pRxBlk, fRX_AMPDU) && (pAd->CommonCfg.bDisableReordering == 0))
- {
- Indicate_AMPDU_Packet(pAd, pRxBlk, FromWhichBSSID);
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- // Determin the destination of the EAP frame
- // to WPA state machine or upper layer
- STARxEAPOLFrameIndicate(pAd, pEntry, pRxBlk, FromWhichBSSID);
- }
- }
-}
-
-
-// For TKIP frame, calculate the MIC value
-BOOLEAN STACheckTkipMICValue(
- IN PRTMP_ADAPTER pAd,
- IN MAC_TABLE_ENTRY *pEntry,
- IN RX_BLK *pRxBlk)
-{
- PHEADER_802_11 pHeader = pRxBlk->pHeader;
- UCHAR *pData = pRxBlk->pData;
- USHORT DataSize = pRxBlk->DataSize;
- UCHAR UserPriority = pRxBlk->UserPriority;
- PCIPHER_KEY pWpaKey;
- UCHAR *pDA, *pSA;
-
- pWpaKey = &pAd->SharedKey[BSS0][pRxBlk->pRxWI->KeyIndex];
-
- pDA = pHeader->Addr1;
- if (RX_BLK_TEST_FLAG(pRxBlk, fRX_INFRA))
- {
- pSA = pHeader->Addr3;
- }
- else
- {
- pSA = pHeader->Addr2;
- }
-
- if (RTMPTkipCompareMICValue(pAd,
- pData,
- pDA,
- pSA,
- pWpaKey->RxMic,
- UserPriority,
- DataSize) == FALSE)
- {
- DBGPRINT_RAW(RT_DEBUG_ERROR,("Rx MIC Value error 2\n"));
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.WpaSupplicantUP)
- {
- WpaSendMicFailureToWpaSupplicant(pAd, (pWpaKey->Type == PAIRWISEKEY) ? TRUE : FALSE);
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- RTMPReportMicError(pAd, pWpaKey);
- }
-
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxBlk->pRxPacket, NDIS_STATUS_FAILURE);
- return FALSE;
- }
-
- return TRUE;
-}
-
-
-//
-// All Rx routines use RX_BLK structure to hande rx events
-// It is very important to build pRxBlk attributes
-// 1. pHeader pointer to 802.11 Header
-// 2. pData pointer to payload including LLC (just skip Header)
-// 3. set payload size including LLC to DataSize
-// 4. set some flags with RX_BLK_SET_FLAG()
-//
-VOID STAHandleRxDataFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk)
-{
- PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
- PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
- PHEADER_802_11 pHeader = pRxBlk->pHeader;
- PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
- BOOLEAN bFragment = FALSE;
- MAC_TABLE_ENTRY *pEntry = NULL;
- UCHAR FromWhichBSSID = BSS0;
- UCHAR UserPriority = 0;
-
- {
- // before LINK UP, all DATA frames are rejected
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
-#ifdef QOS_DLS_SUPPORT
- //if ((pHeader->FC.FrDs == 0) && (pHeader->FC.ToDs == 0))
- if (RTMPRcvFrameDLSCheck(pAd, pHeader, pRxWI->MPDUtotalByteCount, pRxD))
- {
- return;
- }
-#endif // QOS_DLS_SUPPORT //
-
- // Drop not my BSS frames
- if (pRxD->MyBss == 0)
- {
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
- }
-
- pAd->RalinkCounters.RxCountSinceLastNULL++;
- if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable && (pHeader->FC.SubType & 0x08))
- {
- UCHAR *pData;
- DBGPRINT(RT_DEBUG_INFO,("bAPSDCapable\n"));
-
- // Qos bit 4
- pData = (PUCHAR)pHeader + LENGTH_802_11;
- if ((*pData >> 4) & 0x01)
- {
- DBGPRINT(RT_DEBUG_INFO,("RxDone- Rcv EOSP frame, driver may fall into sleep\n"));
- pAd->CommonCfg.bInServicePeriod = FALSE;
-
- // Force driver to fall into sleep mode when rcv EOSP frame
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- USHORT TbttNumToNextWakeUp;
- USHORT NextDtim = pAd->StaCfg.DtimPeriod;
- ULONG Now;
-
- NdisGetSystemUpTime(&Now);
- NextDtim -= (USHORT)(Now - pAd->StaCfg.LastBeaconRxTime)/pAd->CommonCfg.BeaconPeriod;
-
- TbttNumToNextWakeUp = pAd->StaCfg.DefaultListenCount;
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM) && (TbttNumToNextWakeUp > NextDtim))
- TbttNumToNextWakeUp = NextDtim;
-
- RTMP_SET_PSM_BIT(pAd, PWR_SAVE);
- // if WMM-APSD is failed, try to disable following line
- AsicSleepThenAutoWakeup(pAd, TbttNumToNextWakeUp);
- }
- }
-
- if ((pHeader->FC.MoreData) && (pAd->CommonCfg.bInServicePeriod))
- {
- DBGPRINT(RT_DEBUG_TRACE,("Sending another trigger frame when More Data bit is set to 1\n"));
- }
- }
-
- // Drop NULL, CF-ACK(no data), CF-POLL(no data), and CF-ACK+CF-POLL(no data) data frame
- if ((pHeader->FC.SubType & 0x04)) // bit 2 : no DATA
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- // Drop not my BSS frame (we can not only check the MyBss bit in RxD)
-#ifdef QOS_DLS_SUPPORT
- if (!pAd->CommonCfg.bDLSCapable)
- {
-#endif // QOS_DLS_SUPPORT //
- if (INFRA_ON(pAd))
- {
- // Infrastructure mode, check address 2 for BSSID
- if (!RTMPEqualMemory(&pHeader->Addr2, &pAd->CommonCfg.Bssid, 6))
- {
- // Receive frame not my BSSID
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
- }
- else // Ad-Hoc mode or Not associated
- {
- // Ad-Hoc mode, check address 3 for BSSID
- if (!RTMPEqualMemory(&pHeader->Addr3, &pAd->CommonCfg.Bssid, 6))
- {
- // Receive frame not my BSSID
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
- }
-#ifdef QOS_DLS_SUPPORT
- }
-#endif // QOS_DLS_SUPPORT //
-
- //
- // find pEntry
- //
- if (pRxWI->WirelessCliID < MAX_LEN_OF_MAC_TABLE)
- {
- pEntry = &pAd->MacTab.Content[pRxWI->WirelessCliID];
-
- }
- else
- {
- // 1. release packet if infra mode
- // 2. new a pEntry if ad-hoc mode
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- // infra or ad-hoc
- if (INFRA_ON(pAd))
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_INFRA);
-#ifdef QOS_DLS_SUPPORT
- if ((pHeader->FC.FrDs == 0) && (pHeader->FC.ToDs == 0))
- RX_BLK_SET_FLAG(pRxBlk, fRX_DLS);
- else
-#endif // QOS_DLS_SUPPORT //
- ASSERT(pRxWI->WirelessCliID == BSSID_WCID);
- }
-
- // check Atheros Client
- if ((pEntry->bIAmBadAtheros == FALSE) && (pRxD->AMPDU == 1) && (pHeader->FC.Retry ))
- {
- pEntry->bIAmBadAtheros = TRUE;
- pAd->CommonCfg.IOTestParm.bCurrentAtheros = TRUE;
- pAd->CommonCfg.IOTestParm.bLastAtheros = TRUE;
- if (!STA_AES_ON(pAd))
- {
- AsicUpdateProtect(pAd, 8, ALLN_SETPROTECT, TRUE, FALSE);
- }
- }
- }
-
- pRxBlk->pData = (UCHAR *)pHeader;
-
- //
- // update RxBlk->pData, DataSize
- // 802.11 Header, QOS, HTC, Hw Padding
- //
-
- // 1. skip 802.11 HEADER
- {
- pRxBlk->pData += LENGTH_802_11;
- pRxBlk->DataSize -= LENGTH_802_11;
- }
-
- // 2. QOS
- if (pHeader->FC.SubType & 0x08)
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_QOS);
- UserPriority = *(pRxBlk->pData) & 0x0f;
- // bit 7 in QoS Control field signals the HT A-MSDU format
- if ((*pRxBlk->pData) & 0x80)
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_AMSDU);
- }
-
- // skip QOS contorl field
- pRxBlk->pData += 2;
- pRxBlk->DataSize -=2;
- }
- pRxBlk->UserPriority = UserPriority;
-
- /* check if need to resend PS Poll when received packet with MoreData = 1 */
- if ((pAd->StaCfg.Psm == PWR_SAVE) && (pHeader->FC.MoreData == 1))
- {
- if ((((UserPriority == 0) || (UserPriority == 3)) &&
- pAd->CommonCfg.bAPSDAC_BE == 0) ||
- (((UserPriority == 1) || (UserPriority == 2)) &&
- pAd->CommonCfg.bAPSDAC_BK == 0) ||
- (((UserPriority == 4) || (UserPriority == 5)) &&
- pAd->CommonCfg.bAPSDAC_VI == 0) ||
- (((UserPriority == 6) || (UserPriority == 7)) &&
- pAd->CommonCfg.bAPSDAC_VO == 0))
- {
- /* non-UAPSD delivery-enabled AC */
- RTMP_PS_POLL_ENQUEUE(pAd);
- }
- }
-
- // 3. Order bit: A-Ralink or HTC+
- if (pHeader->FC.Order)
- {
-#ifdef AGGREGATION_SUPPORT
- if ((pRxWI->PHYMODE <= MODE_OFDM) && (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED)))
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_ARALINK);
- }
- else
-#endif // AGGREGATION_SUPPORT //
- {
-#ifdef DOT11_N_SUPPORT
- RX_BLK_SET_FLAG(pRxBlk, fRX_HTC);
- // skip HTC contorl field
- pRxBlk->pData += 4;
- pRxBlk->DataSize -= 4;
-#endif // DOT11_N_SUPPORT //
- }
- }
-
- // 4. skip HW padding
- if (pRxD->L2PAD)
- {
- // just move pData pointer
- // because DataSize excluding HW padding
- RX_BLK_SET_FLAG(pRxBlk, fRX_PAD);
- pRxBlk->pData += 2;
- }
-
-#ifdef DOT11_N_SUPPORT
- if (pRxD->BA)
- {
- RX_BLK_SET_FLAG(pRxBlk, fRX_AMPDU);
- }
-#endif // DOT11_N_SUPPORT //
-
-
- //
- // Case I Process Broadcast & Multicast data frame
- //
- if (pRxD->Bcast || pRxD->Mcast)
- {
- INC_COUNTER64(pAd->WlanCounters.MulticastReceivedFrameCount);
-
- // Drop Mcast/Bcast frame with fragment bit on
- if (pHeader->FC.MoreFrag)
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- // Filter out Bcast frame which AP relayed for us
- if (pHeader->FC.FrDs && MAC_ADDR_EQUAL(pHeader->Addr3, pAd->CurrentAddress))
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- Indicate_Legacy_Packet(pAd, pRxBlk, FromWhichBSSID);
- return;
- }
- else if (pRxD->U2M)
- {
- pAd->LastRxRate = (USHORT)((pRxWI->MCS) + (pRxWI->BW <<7) + (pRxWI->ShortGI <<8)+ (pRxWI->PHYMODE <<14)) ;
-
-
-#ifdef QOS_DLS_SUPPORT
- if (RX_BLK_TEST_FLAG(pRxBlk, fRX_DLS))
- {
- MAC_TABLE_ENTRY *pDlsEntry = NULL;
-
- pDlsEntry = DlsEntryTableLookupByWcid(pAd, pRxWI->WirelessCliID, pHeader->Addr2, TRUE);
- if(pDlsEntry)
- Update_Rssi_Sample(pAd, &pDlsEntry->RssiSample, pRxWI);
- }
- else
-#endif // QOS_DLS_SUPPORT //
- if (ADHOC_ON(pAd))
- {
- pEntry = MacTableLookup(pAd, pHeader->Addr2);
- if (pEntry)
- Update_Rssi_Sample(pAd, &pEntry->RssiSample, pRxWI);
- }
-
-
- Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
-
- pAd->StaCfg.LastSNR0 = (UCHAR)(pRxWI->SNR0);
- pAd->StaCfg.LastSNR1 = (UCHAR)(pRxWI->SNR1);
-
- pAd->RalinkCounters.OneSecRxOkDataCnt++;
-
-
- if (!((pHeader->Frag == 0) && (pHeader->FC.MoreFrag == 0)))
- {
- // re-assemble the fragmented packets
- // return complete frame (pRxPacket) or NULL
- bFragment = TRUE;
- pRxPacket = RTMPDeFragmentDataFrame(pAd, pRxBlk);
- }
-
- if (pRxPacket)
- {
- pEntry = &pAd->MacTab.Content[pRxWI->WirelessCliID];
-
- // process complete frame
- if (bFragment && (pRxD->Decrypted) && (pEntry->WepStatus == Ndis802_11Encryption2Enabled))
- {
- // Minus MIC length
- pRxBlk->DataSize -= 8;
-
- // For TKIP frame, calculate the MIC value
- if (STACheckTkipMICValue(pAd, pEntry, pRxBlk) == FALSE)
- {
- return;
- }
- }
-
- STARxDataFrameAnnounce(pAd, pEntry, pRxBlk, FromWhichBSSID);
- return;
- }
- else
- {
- // just return
- // because RTMPDeFragmentDataFrame() will release rx packet,
- // if packet is fragmented
- return;
- }
- }
-
- ASSERT(0);
- // release packet
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
-}
-
-VOID STAHandleRxMgmtFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk)
-{
- PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD);
- PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
- PHEADER_802_11 pHeader = pRxBlk->pHeader;
- PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
-
- do
- {
-
-
- /* check if need to resend PS Poll when received packet with MoreData = 1 */
- if ((pAd->StaCfg.Psm == PWR_SAVE) && (pHeader->FC.MoreData == 1))
- {
- /* for UAPSD, all management frames will be VO priority */
- if (pAd->CommonCfg.bAPSDAC_VO == 0)
- {
- /* non-UAPSD delivery-enabled AC */
- RTMP_PS_POLL_ENQUEUE(pAd);
- }
- }
-
- /* TODO: if MoreData == 0, station can go to sleep */
-
-
- // We should collect RSSI not only U2M data but also my beacon
- if ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))
- && (pAd->RxAnt.EvaluatePeriod == 0))
- {
- Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, pRxWI);
-
- pAd->StaCfg.LastSNR0 = (UCHAR)(pRxWI->SNR0);
- pAd->StaCfg.LastSNR1 = (UCHAR)(pRxWI->SNR1);
- }
-
-#ifdef RT30xx
-#ifdef ANT_DIVERSITY_SUPPORT
- // collect rssi information for antenna diversity
- if ((pAd->NicConfig2.field.AntDiversity) &&
- (pAd->CommonCfg.bRxAntDiversity != ANT_DIVERSITY_DISABLE))
- {
- if ((pRxD->U2M) || ((pHeader->FC.SubType == SUBTYPE_BEACON) && (MAC_ADDR_EQUAL(&pAd->CommonCfg.Bssid, &pHeader->Addr2))))
- {
- COLLECT_RX_ANTENNA_AVERAGE_RSSI(pAd, ConvertToRssi(pAd, (UCHAR)pRxWI->RSSI0, RSSI_0), 0); //Note: RSSI2 not used on RT73
- pAd->StaCfg.NumOfAvgRssiSample ++;
- }
- }
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
-
- // First check the size, it MUST not exceed the mlme queue size
- if (pRxWI->MPDUtotalByteCount > MGMT_DMA_BUFFER_SIZE)
- {
- DBGPRINT_ERR(("STAHandleRxMgmtFrame: frame too large, size = %d \n", pRxWI->MPDUtotalByteCount));
- break;
- }
-
- REPORT_MGMT_FRAME_TO_MLME(pAd, pRxWI->WirelessCliID, pHeader, pRxWI->MPDUtotalByteCount,
- pRxWI->RSSI0, pRxWI->RSSI1, pRxWI->RSSI2, pRxD->PlcpSignal);
- } while (FALSE);
-
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_SUCCESS);
-}
-
-VOID STAHandleRxControlFrame(
- IN PRTMP_ADAPTER pAd,
- IN RX_BLK *pRxBlk)
-{
-#ifdef DOT11_N_SUPPORT
- PRXWI_STRUC pRxWI = pRxBlk->pRxWI;
-#endif // DOT11_N_SUPPORT //
- PHEADER_802_11 pHeader = pRxBlk->pHeader;
- PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket;
-
- switch (pHeader->FC.SubType)
- {
- case SUBTYPE_BLOCK_ACK_REQ:
-#ifdef DOT11_N_SUPPORT
- {
- CntlEnqueueForRecv(pAd, pRxWI->WirelessCliID, (pRxWI->MPDUtotalByteCount), (PFRAME_BA_REQ)pHeader);
- }
- break;
-#endif // DOT11_N_SUPPORT //
- case SUBTYPE_BLOCK_ACK:
- case SUBTYPE_ACK:
- default:
- break;
- }
-
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- Process RxDone interrupt, running in DPC level
-
- Arguments:
- pAd Pointer to our adapter
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
- This routine has to maintain Rx ring read pointer.
- Need to consider QOS DATA format when converting to 802.3
- ========================================================================
-*/
-BOOLEAN STARxDoneInterruptHandle(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN argc)
-{
- NDIS_STATUS Status;
- UINT32 RxProcessed, RxPending;
- BOOLEAN bReschedule = FALSE;
- RT28XX_RXD_STRUC *pRxD;
- UCHAR *pData;
- PRXWI_STRUC pRxWI;
- PNDIS_PACKET pRxPacket;
- PHEADER_802_11 pHeader;
- RX_BLK RxCell;
-
- RxProcessed = RxPending = 0;
-
- // process whole rx ring
- while (1)
- {
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF |
- fRTMP_ADAPTER_RESET_IN_PROGRESS |
- fRTMP_ADAPTER_HALT_IN_PROGRESS |
- fRTMP_ADAPTER_NIC_NOT_EXIST) ||
- !RTMP_TEST_FLAG(pAd,fRTMP_ADAPTER_START_UP))
- {
- break;
- }
-
-#ifdef RTMP_MAC_PCI
- if (RxProcessed++ > MAX_RX_PROCESS_CNT)
- {
- // need to reschedule rx handle
- bReschedule = TRUE;
- break;
- }
-#endif // RTMP_MAC_PCI //
-
- RxProcessed ++; // test
-
- // 1. allocate a new data packet into rx ring to replace received packet
- // then processing the received packet
- // 2. the callee must take charge of release of packet
- // 3. As far as driver is concerned ,
- // the rx packet must
- // a. be indicated to upper layer or
- // b. be released if it is discarded
- pRxPacket = GetPacketFromRxRing(pAd, &(RxCell.RxD), &bReschedule, &RxPending);
- if (pRxPacket == NULL)
- {
- // no more packet to process
- break;
- }
-
- // get rx ring descriptor
- pRxD = &(RxCell.RxD);
- // get rx data buffer
- pData = GET_OS_PKT_DATAPTR(pRxPacket);
- pRxWI = (PRXWI_STRUC) pData;
- pHeader = (PHEADER_802_11) (pData+RXWI_SIZE) ;
-
-#ifdef RT_BIG_ENDIAN
- RTMPFrameEndianChange(pAd, (PUCHAR)pHeader, DIR_READ, TRUE);
- RTMPWIEndianChange((PUCHAR)pRxWI, TYPE_RXWI);
-#endif
-
- // build RxCell
- RxCell.pRxWI = pRxWI;
- RxCell.pHeader = pHeader;
- RxCell.pRxPacket = pRxPacket;
- RxCell.pData = (UCHAR *) pHeader;
- RxCell.DataSize = pRxWI->MPDUtotalByteCount;
- RxCell.Flags = 0;
-
- // Increase Total receive byte counter after real data received no mater any error or not
- pAd->RalinkCounters.ReceivedByteCount += pRxWI->MPDUtotalByteCount;
- pAd->RalinkCounters.OneSecReceivedByteCount += pRxWI->MPDUtotalByteCount;
- pAd->RalinkCounters.RxCount ++;
-
- INC_COUNTER64(pAd->WlanCounters.ReceivedFragmentCount);
-
- if (pRxWI->MPDUtotalByteCount < 14)
- Status = NDIS_STATUS_FAILURE;
-
- if (MONITOR_ON(pAd))
- {
- send_monitor_packets(pAd, &RxCell);
- break;
- }
-
- /* STARxDoneInterruptHandle() is called in rtusb_bulk.c */
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- pAd->ate.RxCntPerSec++;
- ATESampleRssi(pAd, pRxWI);
-#ifdef RALINK_28xx_QA
- if (pAd->ate.bQARxStart == TRUE)
- {
- /* (*pRxD) has been swapped in GetPacketFromRxRing() */
- ATE_QA_Statistics(pAd, pRxWI, pRxD, pHeader);
- }
-#endif // RALINK_28xx_QA //
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_SUCCESS);
- continue;
- }
-#endif // RALINK_ATE //
-
- // Check for all RxD errors
- Status = RTMPCheckRxError(pAd, pHeader, pRxWI, pRxD);
-
- // Handle the received frame
- if (Status == NDIS_STATUS_SUCCESS)
- {
- switch (pHeader->FC.Type)
- {
- // CASE I, receive a DATA frame
- case BTYPE_DATA:
- {
- // process DATA frame
- STAHandleRxDataFrame(pAd, &RxCell);
- }
- break;
- // CASE II, receive a MGMT frame
- case BTYPE_MGMT:
- {
- STAHandleRxMgmtFrame(pAd, &RxCell);
- }
- break;
- // CASE III. receive a CNTL frame
- case BTYPE_CNTL:
- {
- STAHandleRxControlFrame(pAd, &RxCell);
- }
- break;
- // discard other type
- default:
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- break;
- }
- }
- else
- {
- pAd->Counters8023.RxErrors++;
- // discard this frame
- RELEASE_NDIS_PACKET(pAd, pRxPacket, NDIS_STATUS_FAILURE);
- }
- }
-
- return bReschedule;
-}
-
-/*
- ========================================================================
-
- Routine Description:
- Arguments:
- pAd Pointer to our adapter
-
- IRQL = DISPATCH_LEVEL
-
- ========================================================================
-*/
-VOID RTMPHandleTwakeupInterrupt(
- IN PRTMP_ADAPTER pAd)
-{
- AsicForceWakeup(pAd, FALSE);
-}
-
-/*
-========================================================================
-Routine Description:
- Early checking and OS-depened parsing for Tx packet send to our STA driver.
-
-Arguments:
- NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd.
- PPNDIS_PACKET ppPacketArray The packet array need to do transmission.
- UINT NumberOfPackets Number of packet in packet array.
-
-Return Value:
- NONE
-
-Note:
- This function do early checking and classification for send-out packet.
- You only can put OS-depened & STA related code in here.
-========================================================================
-*/
-VOID STASendPackets(
- IN NDIS_HANDLE MiniportAdapterContext,
- IN PPNDIS_PACKET ppPacketArray,
- IN UINT NumberOfPackets)
-{
- UINT Index;
- PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) MiniportAdapterContext;
- PNDIS_PACKET pPacket;
- BOOLEAN allowToSend = FALSE;
-
-
- for (Index = 0; Index < NumberOfPackets; Index++)
- {
- pPacket = ppPacketArray[Index];
-
- do
- {
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS) ||
- RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
- {
- // Drop send request since hardware is in reset state
- break;
- }
- else if (!INFRA_ON(pAd) && !ADHOC_ON(pAd))
- {
- // Drop send request since there are no physical connection yet
- break;
- }
- else
- {
- // Record that orignal packet source is from NDIS layer,so that
- // later on driver knows how to release this NDIS PACKET
-#ifdef QOS_DLS_SUPPORT
- MAC_TABLE_ENTRY *pEntry;
- PUCHAR pSrcBufVA = GET_OS_PKT_DATAPTR(pPacket);
-
- pEntry = MacTableLookup(pAd, pSrcBufVA);
- if (pEntry && (pEntry->ValidAsDls == TRUE))
- {
- RTMP_SET_PACKET_WCID(pPacket, pEntry->Aid);
- }
- else
-#endif // QOS_DLS_SUPPORT //
- RTMP_SET_PACKET_WCID(pPacket, 0); // this field is useless when in STA mode
- RTMP_SET_PACKET_SOURCE(pPacket, PKTSRC_NDIS);
- NDIS_SET_PACKET_STATUS(pPacket, NDIS_STATUS_PENDING);
- pAd->RalinkCounters.PendingNdisPacketCount++;
-
- allowToSend = TRUE;
- }
- } while(FALSE);
-
- if (allowToSend == TRUE)
- STASendPacket(pAd, pPacket);
- else
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
-
- // Dequeue outgoing frames from TxSwQueue[] and process it
- RTMPDeQueuePacket(pAd, FALSE, NUM_OF_TX_RING, MAX_TX_PROCESS);
-
-}
-
-
-/*
-========================================================================
-Routine Description:
- This routine is used to do packet parsing and classification for Tx packet
- to STA device, and it will en-queue packets to our TxSwQueue depends on AC
- class.
-
-Arguments:
- pAd Pointer to our adapter
- pPacket Pointer to send packet
-
-Return Value:
- NDIS_STATUS_SUCCESS If succes to queue the packet into TxSwQueue.
- NDIS_STATUS_FAILURE If failed to do en-queue.
-
-Note:
- You only can put OS-indepened & STA related code in here.
-========================================================================
-*/
-NDIS_STATUS STASendPacket(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket)
-{
- PACKET_INFO PacketInfo;
- PUCHAR pSrcBufVA;
- UINT SrcBufLen;
- UINT AllowFragSize;
- UCHAR NumberOfFrag;
- UCHAR RTSRequired;
- UCHAR QueIdx, UserPriority;
- MAC_TABLE_ENTRY *pEntry = NULL;
- unsigned int IrqFlags;
- UCHAR FlgIsIP = 0;
- UCHAR Rate;
-
- // Prepare packet information structure for buffer descriptor
- // chained within a single NDIS packet.
- RTMP_QueryPacketInfo(pPacket, &PacketInfo, &pSrcBufVA, &SrcBufLen);
-
- if (pSrcBufVA == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR,("STASendPacket --> pSrcBufVA == NULL !!!SrcBufLen=%x\n",SrcBufLen));
- // Resourece is low, system did not allocate virtual address
- // return NDIS_STATUS_FAILURE directly to upper layer
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- return NDIS_STATUS_FAILURE;
- }
-
-
- if (SrcBufLen < 14)
- {
- DBGPRINT(RT_DEBUG_ERROR,("STASendPacket --> Ndis Packet buffer error !!!\n"));
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- return (NDIS_STATUS_FAILURE);
- }
-
- // In HT rate adhoc mode, A-MPDU is often used. So need to lookup BA Table and MAC Entry.
- // Note multicast packets in adhoc also use BSSID_WCID index.
- {
- if(INFRA_ON(pAd))
- {
-#ifdef QOS_DLS_SUPPORT
- USHORT tmpWcid;
-
- tmpWcid = RTMP_GET_PACKET_WCID(pPacket);
- if (VALID_WCID(tmpWcid) &&
- (pAd->MacTab.Content[tmpWcid].ValidAsDls== TRUE))
- {
- pEntry = &pAd->MacTab.Content[tmpWcid];
- Rate = pAd->MacTab.Content[tmpWcid].CurrTxRate;
- }
- else
-#endif // QOS_DLS_SUPPORT //
- {
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- RTMP_SET_PACKET_WCID(pPacket, BSSID_WCID);
- Rate = pAd->CommonCfg.TxRate;
- }
- }
- else if (ADHOC_ON(pAd))
- {
- if (*pSrcBufVA & 0x01)
- {
- RTMP_SET_PACKET_WCID(pPacket, MCAST_WCID);
- pEntry = &pAd->MacTab.Content[MCAST_WCID];
- }
- else
- {
- pEntry = MacTableLookup(pAd, pSrcBufVA);
- }
- Rate = pAd->CommonCfg.TxRate;
- }
- }
-
- if (!pEntry)
- {
- DBGPRINT(RT_DEBUG_ERROR,("STASendPacket->Cannot find pEntry(%2x:%2x:%2x:%2x:%2x:%2x) in MacTab!\n", PRINT_MAC(pSrcBufVA)));
- // Resourece is low, system did not allocate virtual address
- // return NDIS_STATUS_FAILURE directly to upper layer
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- return NDIS_STATUS_FAILURE;
- }
-
- if (ADHOC_ON(pAd)
- )
- {
- RTMP_SET_PACKET_WCID(pPacket, (UCHAR)pEntry->Aid);
- }
-
- //
- // Check the Ethernet Frame type of this packet, and set the RTMP_SET_PACKET_SPECIFIC flags.
- // Here we set the PACKET_SPECIFIC flags(LLC, VLAN, DHCP/ARP, EAPOL).
- RTMPCheckEtherType(pAd, pPacket);
-
-
-
- //
- // WPA 802.1x secured port control - drop all non-802.1x frame before port secured
- //
- if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
-#ifdef WPA_SUPPLICANT_SUPPORT
- || (pAd->StaCfg.IEEE8021X == TRUE)
-#endif // WPA_SUPPLICANT_SUPPORT //
- )
- && ((pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED) || (pAd->StaCfg.MicErrCnt >= 2))
- && (RTMP_GET_PACKET_EAPOL(pPacket)== FALSE)
- )
- {
- DBGPRINT(RT_DEBUG_TRACE,("STASendPacket --> Drop packet before port secured !!!\n"));
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
-
- return (NDIS_STATUS_FAILURE);
- }
-
-
- // STEP 1. Decide number of fragments required to deliver this MSDU.
- // The estimation here is not very accurate because difficult to
- // take encryption overhead into consideration here. The result
- // "NumberOfFrag" is then just used to pre-check if enough free
- // TXD are available to hold this MSDU.
-
-
- if (*pSrcBufVA & 0x01) // fragmentation not allowed on multicast & broadcast
- NumberOfFrag = 1;
- else if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_AGGREGATION_INUSED))
- NumberOfFrag = 1; // Aggregation overwhelms fragmentation
- else if (CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_AMSDU_INUSED))
- NumberOfFrag = 1; // Aggregation overwhelms fragmentation
-#ifdef DOT11_N_SUPPORT
- else if ((pAd->StaCfg.HTPhyMode.field.MODE == MODE_HTMIX) || (pAd->StaCfg.HTPhyMode.field.MODE == MODE_HTGREENFIELD))
- NumberOfFrag = 1; // MIMO RATE overwhelms fragmentation
-#endif // DOT11_N_SUPPORT //
- else
- {
- // The calculated "NumberOfFrag" is a rough estimation because of various
- // encryption/encapsulation overhead not taken into consideration. This number is just
- // used to make sure enough free TXD are available before fragmentation takes place.
- // In case the actual required number of fragments of an NDIS packet
- // excceeds "NumberOfFrag"caculated here and not enough free TXD available, the
- // last fragment (i.e. last MPDU) will be dropped in RTMPHardTransmit() due to out of
- // resource, and the NDIS packet will be indicated NDIS_STATUS_FAILURE. This should
- // rarely happen and the penalty is just like a TX RETRY fail. Affordable.
-
- AllowFragSize = (pAd->CommonCfg.FragmentThreshold) - LENGTH_802_11 - LENGTH_CRC;
- NumberOfFrag = ((PacketInfo.TotalPacketLength - LENGTH_802_3 + LENGTH_802_1_H) / AllowFragSize) + 1;
- // To get accurate number of fragmentation, Minus 1 if the size just match to allowable fragment size
- if (((PacketInfo.TotalPacketLength - LENGTH_802_3 + LENGTH_802_1_H) % AllowFragSize) == 0)
- {
- NumberOfFrag--;
- }
- }
-
- // Save fragment number to Ndis packet reserved field
- RTMP_SET_PACKET_FRAGMENTS(pPacket, NumberOfFrag);
-
-
- // STEP 2. Check the requirement of RTS:
- // If multiple fragment required, RTS is required only for the first fragment
- // if the fragment size large than RTS threshold
- // For RT28xx, Let ASIC send RTS/CTS
-// RTMP_SET_PACKET_RTS(pPacket, 0);
- if (NumberOfFrag > 1)
- RTSRequired = (pAd->CommonCfg.FragmentThreshold > pAd->CommonCfg.RtsThreshold) ? 1 : 0;
- else
- RTSRequired = (PacketInfo.TotalPacketLength > pAd->CommonCfg.RtsThreshold) ? 1 : 0;
-
- // Save RTS requirement to Ndis packet reserved field
- RTMP_SET_PACKET_RTS(pPacket, RTSRequired);
- RTMP_SET_PACKET_TXRATE(pPacket, pAd->CommonCfg.TxRate);
-
- //
- // STEP 3. Traffic classification. outcome = <UserPriority, QueIdx>
- //
- UserPriority = 0;
- QueIdx = QID_AC_BE;
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
- CLIENT_STATUS_TEST_FLAG(pEntry, fCLIENT_STATUS_WMM_CAPABLE))
- {
- USHORT Protocol;
- UCHAR LlcSnapLen = 0, Byte0, Byte1;
- do
- {
- // get Ethernet protocol field
- Protocol = (USHORT)((pSrcBufVA[12] << 8) + pSrcBufVA[13]);
- if (Protocol <= 1500)
- {
- // get Ethernet protocol field from LLC/SNAP
- if (Sniff2BytesFromNdisBuffer(PacketInfo.pFirstBuffer, LENGTH_802_3 + 6, &Byte0, &Byte1) != NDIS_STATUS_SUCCESS)
- break;
-
- Protocol = (USHORT)((Byte0 << 8) + Byte1);
- LlcSnapLen = 8;
- }
-
- // always AC_BE for non-IP packet
- if (Protocol != 0x0800)
- break;
-
- // get IP header
- if (Sniff2BytesFromNdisBuffer(PacketInfo.pFirstBuffer, LENGTH_802_3 + LlcSnapLen, &Byte0, &Byte1) != NDIS_STATUS_SUCCESS)
- break;
-
- // return AC_BE if packet is not IPv4
- if ((Byte0 & 0xf0) != 0x40)
- break;
-
- FlgIsIP = 1;
- UserPriority = (Byte1 & 0xe0) >> 5;
- QueIdx = MapUserPriorityToAccessCategory[UserPriority];
-
- // TODO: have to check ACM bit. apply TSPEC if ACM is ON
- // TODO: downgrade UP & QueIdx before passing ACM
- /*
- Under WMM ACM control, we dont need to check the bit;
- Or when a TSPEC is built for VO but we will change to issue
- BA session for BE here, so we will not use BA to send VO packets.
- */
- if (pAd->CommonCfg.APEdcaParm.bACM[QueIdx])
- {
- UserPriority = 0;
- QueIdx = QID_AC_BE;
- }
- } while (FALSE);
- }
-
- RTMP_SET_PACKET_UP(pPacket, UserPriority);
-
-
-
- // Make sure SendTxWait queue resource won't be used by other threads
- RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags);
- if (pAd->TxSwQueue[QueIdx].Number >= MAX_PACKETS_IN_QUEUE)
- {
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
-#ifdef BLOCK_NET_IF
- StopNetIfQueue(pAd, QueIdx, pPacket);
-#endif // BLOCK_NET_IF //
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
-
- return NDIS_STATUS_FAILURE;
- }
- else
- {
- InsertTailQueueAc(pAd, pEntry, &pAd->TxSwQueue[QueIdx], PACKET_TO_QUEUE_ENTRY(pPacket));
- }
- RTMP_IRQ_UNLOCK(&pAd->irq_lock, IrqFlags);
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.BACapability.field.AutoBA == TRUE)&&
- IS_HT_STA(pEntry))
- {
- //PMAC_TABLE_ENTRY pMacEntry = &pAd->MacTab.Content[BSSID_WCID];
- if (((pEntry->TXBAbitmap & (1<<UserPriority)) == 0) &&
- ((pEntry->BADeclineBitmap & (1<<UserPriority)) == 0) &&
- (pEntry->PortSecured == WPA_802_1X_PORT_SECURED)
- // For IOT compatibility, if
- // 1. It is Ralink chip or
- // 2. It is OPEN or AES mode,
- // then BA session can be bulit.
- && ((pEntry->ValidAsCLI && pAd->MlmeAux.APRalinkIe != 0x0) ||
- (pEntry->WepStatus != Ndis802_11WEPEnabled && pEntry->WepStatus != Ndis802_11Encryption2Enabled))
- )
- {
- BAOriSessionSetUp(pAd, pEntry, UserPriority, 0, 10, FALSE);
- }
- }
-#endif // DOT11_N_SUPPORT //
-
- pAd->RalinkCounters.OneSecOsTxCount[QueIdx]++; // TODO: for debug only. to be removed
- return NDIS_STATUS_SUCCESS;
-}
-
-
-/*
- ========================================================================
-
- Routine Description:
- This subroutine will scan through releative ring descriptor to find
- out avaliable free ring descriptor and compare with request size.
-
- Arguments:
- pAd Pointer to our adapter
- QueIdx Selected TX Ring
-
- Return Value:
- NDIS_STATUS_FAILURE Not enough free descriptor
- NDIS_STATUS_SUCCESS Enough free descriptor
-
- IRQL = PASSIVE_LEVEL
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-#ifdef RTMP_MAC_PCI
-NDIS_STATUS RTMPFreeTXDRequest(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR QueIdx,
- IN UCHAR NumberRequired,
- IN PUCHAR FreeNumberIs)
-{
- ULONG FreeNumber = 0;
- NDIS_STATUS Status = NDIS_STATUS_FAILURE;
-
- switch (QueIdx)
- {
- case QID_AC_BK:
- case QID_AC_BE:
- case QID_AC_VI:
- case QID_AC_VO:
- /*case QID_HCCA:*/
- if (pAd->TxRing[QueIdx].TxSwFreeIdx > pAd->TxRing[QueIdx].TxCpuIdx)
- FreeNumber = pAd->TxRing[QueIdx].TxSwFreeIdx - pAd->TxRing[QueIdx].TxCpuIdx - 1;
- else
- FreeNumber = pAd->TxRing[QueIdx].TxSwFreeIdx + TX_RING_SIZE - pAd->TxRing[QueIdx].TxCpuIdx - 1;
-
- if (FreeNumber >= NumberRequired)
- Status = NDIS_STATUS_SUCCESS;
- break;
-
- case QID_MGMT:
- if (pAd->MgmtRing.TxSwFreeIdx > pAd->MgmtRing.TxCpuIdx)
- FreeNumber = pAd->MgmtRing.TxSwFreeIdx - pAd->MgmtRing.TxCpuIdx - 1;
- else
- FreeNumber = pAd->MgmtRing.TxSwFreeIdx + MGMT_RING_SIZE - pAd->MgmtRing.TxCpuIdx - 1;
-
- if (FreeNumber >= NumberRequired)
- Status = NDIS_STATUS_SUCCESS;
- break;
-
- default:
- DBGPRINT(RT_DEBUG_ERROR,("RTMPFreeTXDRequest::Invalid QueIdx(=%d)\n", QueIdx));
- break;
- }
- *FreeNumberIs = (UCHAR)FreeNumber;
-
- return (Status);
-}
-#endif // RTMP_MAC_PCI //
-
-
-
-VOID RTMPSendDisassociationFrame(
- IN PRTMP_ADAPTER pAd)
-{
-}
-
-VOID RTMPSendNullFrame(
- IN PRTMP_ADAPTER pAd,
- IN UCHAR TxRate,
- IN BOOLEAN bQosNull)
-{
- UCHAR NullFrame[48];
- ULONG Length;
- PHEADER_802_11 pHeader_802_11;
-
-
-#ifdef RALINK_ATE
- if(ATE_ON(pAd))
- {
- return;
- }
-#endif // RALINK_ATE //
-
- // WPA 802.1x secured port control
- if (((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
-#ifdef WPA_SUPPLICANT_SUPPORT
- || (pAd->StaCfg.IEEE8021X == TRUE)
-#endif
- ) &&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- {
- return;
- }
-
- NdisZeroMemory(NullFrame, 48);
- Length = sizeof(HEADER_802_11);
-
- pHeader_802_11 = (PHEADER_802_11) NullFrame;
-
- pHeader_802_11->FC.Type = BTYPE_DATA;
- pHeader_802_11->FC.SubType = SUBTYPE_NULL_FUNC;
- pHeader_802_11->FC.ToDs = 1;
- COPY_MAC_ADDR(pHeader_802_11->Addr1, pAd->CommonCfg.Bssid);
- COPY_MAC_ADDR(pHeader_802_11->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHeader_802_11->Addr3, pAd->CommonCfg.Bssid);
-
- if (pAd->CommonCfg.bAPSDForcePowerSave)
- {
- pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
- }
- else
- {
- pHeader_802_11->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE) ? 1: 0;
- }
- pHeader_802_11->Duration = pAd->CommonCfg.Dsifs + RTMPCalcDuration(pAd, TxRate, 14);
-
- pAd->Sequence++;
- pHeader_802_11->Sequence = pAd->Sequence;
-
- // Prepare QosNull function frame
- if (bQosNull)
- {
- pHeader_802_11->FC.SubType = SUBTYPE_QOS_NULL;
-
- // copy QOS control bytes
- NullFrame[Length] = 0;
- NullFrame[Length+1] = 0;
- Length += 2;// if pad with 2 bytes for alignment, APSD will fail
- }
-
- HAL_KickOutNullFrameTx(pAd, 0, NullFrame, Length);
-
-}
-
-// IRQL = DISPATCH_LEVEL
-VOID RTMPSendRTSFrame(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pDA,
- IN unsigned int NextMpduSize,
- IN UCHAR TxRate,
- IN UCHAR RTSRate,
- IN USHORT AckDuration,
- IN UCHAR QueIdx,
- IN UCHAR FrameGap)
-{
-}
-
-
-
-// --------------------------------------------------------
-// FIND ENCRYPT KEY AND DECIDE CIPHER ALGORITHM
-// Find the WPA key, either Group or Pairwise Key
-// LEAP + TKIP also use WPA key.
-// --------------------------------------------------------
-// Decide WEP bit and cipher suite to be used. Same cipher suite should be used for whole fragment burst
-// In Cisco CCX 2.0 Leap Authentication
-// WepStatus is Ndis802_11Encryption1Enabled but the key will use PairwiseKey
-// Instead of the SharedKey, SharedKey Length may be Zero.
-VOID STAFindCipherAlgorithm(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
- NDIS_802_11_ENCRYPTION_STATUS Cipher; // To indicate cipher used for this packet
- UCHAR CipherAlg = CIPHER_NONE; // cipher alogrithm
- UCHAR KeyIdx = 0xff;
- PUCHAR pSrcBufVA;
- PCIPHER_KEY pKey = NULL;
-
- pSrcBufVA = GET_OS_PKT_DATAPTR(pTxBlk->pPacket);
-
- {
- // Select Cipher
- if ((*pSrcBufVA & 0x01) && (ADHOC_ON(pAd)))
- Cipher = pAd->StaCfg.GroupCipher; // Cipher for Multicast or Broadcast
- else
- Cipher = pAd->StaCfg.PairCipher; // Cipher for Unicast
-
- if (RTMP_GET_PACKET_EAPOL(pTxBlk->pPacket))
- {
- ASSERT(pAd->SharedKey[BSS0][0].CipherAlg <= CIPHER_CKIP128);
-
- // 4-way handshaking frame must be clear
- if (!(TX_BLK_TEST_FLAG(pTxBlk, fTX_bClearEAPFrame)) && (pAd->SharedKey[BSS0][0].CipherAlg) &&
- (pAd->SharedKey[BSS0][0].KeyLen))
- {
- CipherAlg = pAd->SharedKey[BSS0][0].CipherAlg;
- KeyIdx = 0;
- }
- }
- else if (Cipher == Ndis802_11Encryption1Enabled)
- {
- KeyIdx = pAd->StaCfg.DefaultKeyId;
- }
- else if ((Cipher == Ndis802_11Encryption2Enabled) ||
- (Cipher == Ndis802_11Encryption3Enabled))
- {
- if ((*pSrcBufVA & 0x01) && (ADHOC_ON(pAd))) // multicast
- KeyIdx = pAd->StaCfg.DefaultKeyId;
- else if (pAd->SharedKey[BSS0][0].KeyLen)
- KeyIdx = 0;
- else
- KeyIdx = pAd->StaCfg.DefaultKeyId;
- }
-
- if (KeyIdx == 0xff)
- CipherAlg = CIPHER_NONE;
- else if ((Cipher == Ndis802_11EncryptionDisabled) || (pAd->SharedKey[BSS0][KeyIdx].KeyLen == 0))
- CipherAlg = CIPHER_NONE;
-#ifdef WPA_SUPPLICANT_SUPPORT
- else if ( pAd->StaCfg.WpaSupplicantUP &&
- (Cipher == Ndis802_11Encryption1Enabled) &&
- (pAd->StaCfg.IEEE8021X == TRUE) &&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- CipherAlg = CIPHER_NONE;
-#endif // WPA_SUPPLICANT_SUPPORT //
- else
- {
- //Header_802_11.FC.Wep = 1;
- CipherAlg = pAd->SharedKey[BSS0][KeyIdx].CipherAlg;
- pKey = &pAd->SharedKey[BSS0][KeyIdx];
- }
- }
-
- pTxBlk->CipherAlg = CipherAlg;
- pTxBlk->pKey = pKey;
-}
-
-
-VOID STABuildCommon802_11Header(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
-
- HEADER_802_11 *pHeader_802_11;
-#ifdef QOS_DLS_SUPPORT
- BOOLEAN bDLSFrame = FALSE;
- INT DlsEntryIndex = 0;
-#endif // QOS_DLS_SUPPORT //
-
- //
- // MAKE A COMMON 802.11 HEADER
- //
-
- // normal wlan header size : 24 octets
- pTxBlk->MpduHeaderLen = sizeof(HEADER_802_11);
-
- pHeader_802_11 = (HEADER_802_11 *) &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
-
- NdisZeroMemory(pHeader_802_11, sizeof(HEADER_802_11));
-
- pHeader_802_11->FC.FrDs = 0;
- pHeader_802_11->FC.Type = BTYPE_DATA;
- pHeader_802_11->FC.SubType = ((TX_BLK_TEST_FLAG(pTxBlk, fTX_bWMM)) ? SUBTYPE_QDATA : SUBTYPE_DATA);
-
-#ifdef QOS_DLS_SUPPORT
- if (INFRA_ON(pAd))
- {
- // Check if the frame can be sent through DLS direct link interface
- // If packet can be sent through DLS, then force aggregation disable. (Hard to determine peer STA's capability)
- DlsEntryIndex = RTMPCheckDLSFrame(pAd, pTxBlk->pSrcBufHeader);
- if (DlsEntryIndex >= 0)
- bDLSFrame = TRUE;
- else
- bDLSFrame = FALSE;
- }
-#endif // QOS_DLS_SUPPORT //
-
- if (pTxBlk->pMacEntry)
- {
- if (TX_BLK_TEST_FLAG(pTxBlk, fTX_bForceNonQoS))
- {
- pHeader_802_11->Sequence = pTxBlk->pMacEntry->NonQosDataSeq;
- pTxBlk->pMacEntry->NonQosDataSeq = (pTxBlk->pMacEntry->NonQosDataSeq+1) & MAXSEQ;
- }
- else
- {
- {
- pHeader_802_11->Sequence = pTxBlk->pMacEntry->TxSeq[pTxBlk->UserPriority];
- pTxBlk->pMacEntry->TxSeq[pTxBlk->UserPriority] = (pTxBlk->pMacEntry->TxSeq[pTxBlk->UserPriority]+1) & MAXSEQ;
- }
- }
- }
- else
- {
- pHeader_802_11->Sequence = pAd->Sequence;
- pAd->Sequence = (pAd->Sequence+1) & MAXSEQ; // next sequence
- }
-
- pHeader_802_11->Frag = 0;
-
- pHeader_802_11->FC.MoreData = TX_BLK_TEST_FLAG(pTxBlk, fTX_bMoreData);
-
- {
- if (INFRA_ON(pAd))
- {
-#ifdef QOS_DLS_SUPPORT
- if (bDLSFrame)
- {
- COPY_MAC_ADDR(pHeader_802_11->Addr1, pTxBlk->pSrcBufHeader);
- COPY_MAC_ADDR(pHeader_802_11->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHeader_802_11->Addr3, pAd->CommonCfg.Bssid);
- pHeader_802_11->FC.ToDs = 0;
- }
- else
-#endif // QOS_DLS_SUPPORT //
- {
- COPY_MAC_ADDR(pHeader_802_11->Addr1, pAd->CommonCfg.Bssid);
- COPY_MAC_ADDR(pHeader_802_11->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHeader_802_11->Addr3, pTxBlk->pSrcBufHeader);
- pHeader_802_11->FC.ToDs = 1;
- }
- }
- else if (ADHOC_ON(pAd))
- {
- COPY_MAC_ADDR(pHeader_802_11->Addr1, pTxBlk->pSrcBufHeader);
- COPY_MAC_ADDR(pHeader_802_11->Addr2, pAd->CurrentAddress);
- COPY_MAC_ADDR(pHeader_802_11->Addr3, pAd->CommonCfg.Bssid);
- pHeader_802_11->FC.ToDs = 0;
- }
- }
-
- if (pTxBlk->CipherAlg != CIPHER_NONE)
- pHeader_802_11->FC.Wep = 1;
-
- // -----------------------------------------------------------------
- // STEP 2. MAKE A COMMON 802.11 HEADER SHARED BY ENTIRE FRAGMENT BURST. Fill sequence later.
- // -----------------------------------------------------------------
- if (pAd->CommonCfg.bAPSDForcePowerSave)
- pHeader_802_11->FC.PwrMgmt = PWR_SAVE;
- else
- pHeader_802_11->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
-}
-
-#ifdef DOT11_N_SUPPORT
-VOID STABuildCache802_11Header(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR *pHeader)
-{
- MAC_TABLE_ENTRY *pMacEntry;
- PHEADER_802_11 pHeader80211;
-
- pHeader80211 = (PHEADER_802_11)pHeader;
- pMacEntry = pTxBlk->pMacEntry;
-
- //
- // Update the cached 802.11 HEADER
- //
-
- // normal wlan header size : 24 octets
- pTxBlk->MpduHeaderLen = sizeof(HEADER_802_11);
-
- // More Bit
- pHeader80211->FC.MoreData = TX_BLK_TEST_FLAG(pTxBlk, fTX_bMoreData);
-
- // Sequence
- pHeader80211->Sequence = pMacEntry->TxSeq[pTxBlk->UserPriority];
- pMacEntry->TxSeq[pTxBlk->UserPriority] = (pMacEntry->TxSeq[pTxBlk->UserPriority]+1) & MAXSEQ;
-
- {
- // Check if the frame can be sent through DLS direct link interface
- // If packet can be sent through DLS, then force aggregation disable. (Hard to determine peer STA's capability)
-#ifdef QOS_DLS_SUPPORT
- BOOLEAN bDLSFrame = FALSE;
- INT DlsEntryIndex = 0;
-
- DlsEntryIndex = RTMPCheckDLSFrame(pAd, pTxBlk->pSrcBufHeader);
- if (DlsEntryIndex >= 0)
- bDLSFrame = TRUE;
- else
- bDLSFrame = FALSE;
-#endif // QOS_DLS_SUPPORT //
-
- // The addr3 of normal packet send from DS is Dest Mac address.
-#ifdef QOS_DLS_SUPPORT
- if (bDLSFrame)
- {
- COPY_MAC_ADDR(pHeader80211->Addr1, pTxBlk->pSrcBufHeader);
- COPY_MAC_ADDR(pHeader80211->Addr3, pAd->CommonCfg.Bssid);
- pHeader80211->FC.ToDs = 0;
- }
- else
-#endif // QOS_DLS_SUPPORT //
- if (ADHOC_ON(pAd))
- COPY_MAC_ADDR(pHeader80211->Addr3, pAd->CommonCfg.Bssid);
- else
- COPY_MAC_ADDR(pHeader80211->Addr3, pTxBlk->pSrcBufHeader);
- }
-
- // -----------------------------------------------------------------
- // STEP 2. MAKE A COMMON 802.11 HEADER SHARED BY ENTIRE FRAGMENT BURST. Fill sequence later.
- // -----------------------------------------------------------------
- if (pAd->CommonCfg.bAPSDForcePowerSave)
- pHeader80211->FC.PwrMgmt = PWR_SAVE;
- else
- pHeader80211->FC.PwrMgmt = (pAd->StaCfg.Psm == PWR_SAVE);
-}
-#endif // DOT11_N_SUPPORT //
-
-static inline PUCHAR STA_Build_ARalink_Frame_Header(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk)
-{
- PUCHAR pHeaderBufPtr;
- HEADER_802_11 *pHeader_802_11;
- PNDIS_PACKET pNextPacket;
- UINT32 nextBufLen;
- PQUEUE_ENTRY pQEntry;
-
- STAFindCipherAlgorithm(pAd, pTxBlk);
- STABuildCommon802_11Header(pAd, pTxBlk);
-
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
- pHeader_802_11 = (HEADER_802_11 *) pHeaderBufPtr;
-
- // steal "order" bit to mark "aggregation"
- pHeader_802_11->FC.Order = 1;
-
- // skip common header
- pHeaderBufPtr += pTxBlk->MpduHeaderLen;
-
- if (TX_BLK_TEST_FLAG(pTxBlk, fTX_bWMM))
- {
- //
- // build QOS Control bytes
- //
- *pHeaderBufPtr = (pTxBlk->UserPriority & 0x0F);
-
- *(pHeaderBufPtr+1) = 0;
- pHeaderBufPtr +=2;
- pTxBlk->MpduHeaderLen += 2;
- }
-
- // padding at front of LLC header. LLC header should at 4-bytes aligment.
- pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PUCHAR)ROUND_UP(pHeaderBufPtr, 4);
- pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
-
- // For RA Aggregation,
- // put the 2nd MSDU length(extra 2-byte field) after QOS_CONTROL in little endian format
- pQEntry = pTxBlk->TxPacketList.Head;
- pNextPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- nextBufLen = GET_OS_PKT_LEN(pNextPacket);
- if (RTMP_GET_PACKET_VLAN(pNextPacket))
- nextBufLen -= LENGTH_802_1Q;
-
- *pHeaderBufPtr = (UCHAR)nextBufLen & 0xff;
- *(pHeaderBufPtr+1) = (UCHAR)(nextBufLen >> 8);
-
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += 2;
-
- return pHeaderBufPtr;
-
-}
-
-#ifdef DOT11_N_SUPPORT
-static inline PUCHAR STA_Build_AMSDU_Frame_Header(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk)
-{
- PUCHAR pHeaderBufPtr;//, pSaveBufPtr;
- HEADER_802_11 *pHeader_802_11;
-
-
- STAFindCipherAlgorithm(pAd, pTxBlk);
- STABuildCommon802_11Header(pAd, pTxBlk);
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
- pHeader_802_11 = (HEADER_802_11 *) pHeaderBufPtr;
-
- // skip common header
- pHeaderBufPtr += pTxBlk->MpduHeaderLen;
-
- //
- // build QOS Control bytes
- //
- *pHeaderBufPtr = (pTxBlk->UserPriority & 0x0F);
-
- //
- // A-MSDU packet
- //
- *pHeaderBufPtr |= 0x80;
-
- *(pHeaderBufPtr+1) = 0;
- pHeaderBufPtr +=2;
- pTxBlk->MpduHeaderLen += 2;
-
- //pSaveBufPtr = pHeaderBufPtr;
-
- //
- // padding at front of LLC header
- // LLC header should locate at 4-octets aligment
- //
- // @@@ MpduHeaderLen excluding padding @@@
- //
- pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
- pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
-
- return pHeaderBufPtr;
-
-}
-
-
-VOID STA_AMPDU_Frame_Tx(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
- HEADER_802_11 *pHeader_802_11;
- PUCHAR pHeaderBufPtr;
- USHORT FreeNumber;
- MAC_TABLE_ENTRY *pMacEntry;
- BOOLEAN bVLANPkt;
- PQUEUE_ENTRY pQEntry;
-
- ASSERT(pTxBlk);
-
- while(pTxBlk->TxPacketList.Head)
- {
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pTxBlk->pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- if ( RTMP_FillTxBlkInfo(pAd, pTxBlk) != TRUE)
- {
- RELEASE_NDIS_PACKET(pAd, pTxBlk->pPacket, NDIS_STATUS_FAILURE);
- continue;
- }
-
- bVLANPkt = (RTMP_GET_PACKET_VLAN(pTxBlk->pPacket) ? TRUE : FALSE);
-
- pMacEntry = pTxBlk->pMacEntry;
- if (pMacEntry->isCached)
- {
- // NOTE: Please make sure the size of pMacEntry->CachedBuf[] is smaller than pTxBlk->HeaderBuf[]!!!!
- NdisMoveMemory((PUCHAR)&pTxBlk->HeaderBuf[TXINFO_SIZE], (PUCHAR)&pMacEntry->CachedBuf[0], TXWI_SIZE + sizeof(HEADER_802_11));
- pHeaderBufPtr = (PUCHAR)(&pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE]);
- STABuildCache802_11Header(pAd, pTxBlk, pHeaderBufPtr);
- }
- else
- {
- STAFindCipherAlgorithm(pAd, pTxBlk);
- STABuildCommon802_11Header(pAd, pTxBlk);
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
- }
-
-
- pHeader_802_11 = (HEADER_802_11 *) pHeaderBufPtr;
-
- // skip common header
- pHeaderBufPtr += pTxBlk->MpduHeaderLen;
-
- //
- // build QOS Control bytes
- //
- *pHeaderBufPtr = (pTxBlk->UserPriority & 0x0F);
- *(pHeaderBufPtr+1) = 0;
- pHeaderBufPtr +=2;
- pTxBlk->MpduHeaderLen += 2;
-
- //
- // build HTC+
- // HTC control filed following QoS field
- //
- if ((pAd->CommonCfg.bRdg == TRUE) && CLIENT_STATUS_TEST_FLAG(pTxBlk->pMacEntry, fCLIENT_STATUS_RDG_CAPABLE))
- {
- if (pMacEntry->isCached == FALSE)
- {
- // mark HTC bit
- pHeader_802_11->FC.Order = 1;
-
- NdisZeroMemory(pHeaderBufPtr, 4);
- *(pHeaderBufPtr+3) |= 0x80;
- }
- pHeaderBufPtr += 4;
- pTxBlk->MpduHeaderLen += 4;
- }
-
- //pTxBlk->MpduHeaderLen = pHeaderBufPtr - pTxBlk->HeaderBuf - TXWI_SIZE - TXINFO_SIZE;
- ASSERT(pTxBlk->MpduHeaderLen >= 24);
-
- // skip 802.3 header
- pTxBlk->pSrcBufData = pTxBlk->pSrcBufHeader + LENGTH_802_3;
- pTxBlk->SrcBufLen -= LENGTH_802_3;
-
- // skip vlan tag
- if (bVLANPkt)
- {
- pTxBlk->pSrcBufData += LENGTH_802_1Q;
- pTxBlk->SrcBufLen -= LENGTH_802_1Q;
- }
-
- //
- // padding at front of LLC header
- // LLC header should locate at 4-octets aligment
- //
- // @@@ MpduHeaderLen excluding padding @@@
- //
- pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
- pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
-
- {
-
- //
- // Insert LLC-SNAP encapsulation - 8 octets
- //
- EXTRA_LLCSNAP_ENCAP_FROM_PKT_OFFSET(pTxBlk->pSrcBufData-2, pTxBlk->pExtraLlcSnapEncap);
- if (pTxBlk->pExtraLlcSnapEncap)
- {
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
- pHeaderBufPtr += 6;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufData-2, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += LENGTH_802_1_H;
- }
-
- }
-
- if (pMacEntry->isCached)
- {
- RTMPWriteTxWI_Cache(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
- }
- else
- {
- RTMPWriteTxWI_Data(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
-
- NdisZeroMemory((PUCHAR)(&pMacEntry->CachedBuf[0]), sizeof(pMacEntry->CachedBuf));
- NdisMoveMemory((PUCHAR)(&pMacEntry->CachedBuf[0]), (PUCHAR)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), (pHeaderBufPtr - (PUCHAR)(&pTxBlk->HeaderBuf[TXINFO_SIZE])));
- pMacEntry->isCached = TRUE;
- }
-
- // calculate Transmitted AMPDU count and ByteCount
- {
- pAd->RalinkCounters.TransmittedMPDUsInAMPDUCount.u.LowPart ++;
- pAd->RalinkCounters.TransmittedOctetsInAMPDUCount.QuadPart += pTxBlk->SrcBufLen;
- }
-
- //FreeNumber = GET_TXRING_FREENO(pAd, QueIdx);
-
- HAL_WriteTxResource(pAd, pTxBlk, TRUE, &FreeNumber);
-
- //
- // Kick out Tx
- //
- if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
-
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
- }
-
-}
-
-
-VOID STA_AMSDU_Frame_Tx(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
- PUCHAR pHeaderBufPtr;
- USHORT FreeNumber;
- USHORT subFramePayloadLen = 0; // AMSDU Subframe length without AMSDU-Header / Padding.
- USHORT totalMPDUSize=0;
- UCHAR *subFrameHeader;
- UCHAR padding = 0;
- USHORT FirstTx = 0, LastTxIdx = 0;
- BOOLEAN bVLANPkt;
- int frameNum = 0;
- PQUEUE_ENTRY pQEntry;
-
-
- ASSERT(pTxBlk);
-
- ASSERT((pTxBlk->TxPacketList.Number > 1));
-
- while(pTxBlk->TxPacketList.Head)
- {
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pTxBlk->pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- if (RTMP_FillTxBlkInfo(pAd, pTxBlk) != TRUE)
- {
- RELEASE_NDIS_PACKET(pAd, pTxBlk->pPacket, NDIS_STATUS_FAILURE);
- continue;
- }
-
- bVLANPkt = (RTMP_GET_PACKET_VLAN(pTxBlk->pPacket) ? TRUE : FALSE);
-
- // skip 802.3 header
- pTxBlk->pSrcBufData = pTxBlk->pSrcBufHeader + LENGTH_802_3;
- pTxBlk->SrcBufLen -= LENGTH_802_3;
-
- // skip vlan tag
- if (bVLANPkt)
- {
- pTxBlk->pSrcBufData += LENGTH_802_1Q;
- pTxBlk->SrcBufLen -= LENGTH_802_1Q;
- }
-
- if (frameNum == 0)
- {
- pHeaderBufPtr = STA_Build_AMSDU_Frame_Header(pAd, pTxBlk);
-
- // NOTE: TxWI->MPDUtotalByteCount will be updated after final frame was handled.
- RTMPWriteTxWI_Data(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
- }
- else
- {
- pHeaderBufPtr = &pTxBlk->HeaderBuf[0];
- padding = ROUND_UP(LENGTH_AMSDU_SUBFRAMEHEAD + subFramePayloadLen, 4) - (LENGTH_AMSDU_SUBFRAMEHEAD + subFramePayloadLen);
- NdisZeroMemory(pHeaderBufPtr, padding + LENGTH_AMSDU_SUBFRAMEHEAD);
- pHeaderBufPtr += padding;
- pTxBlk->MpduHeaderLen = padding;
- }
-
- //
- // A-MSDU subframe
- // DA(6)+SA(6)+Length(2) + LLC/SNAP Encap
- //
- subFrameHeader = pHeaderBufPtr;
- subFramePayloadLen = pTxBlk->SrcBufLen;
-
- NdisMoveMemory(subFrameHeader, pTxBlk->pSrcBufHeader, 12);
-
-
- pHeaderBufPtr += LENGTH_AMSDU_SUBFRAMEHEAD;
- pTxBlk->MpduHeaderLen += LENGTH_AMSDU_SUBFRAMEHEAD;
-
-
- //
- // Insert LLC-SNAP encapsulation - 8 octets
- //
- EXTRA_LLCSNAP_ENCAP_FROM_PKT_OFFSET(pTxBlk->pSrcBufData-2, pTxBlk->pExtraLlcSnapEncap);
-
- subFramePayloadLen = pTxBlk->SrcBufLen;
-
- if (pTxBlk->pExtraLlcSnapEncap)
- {
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
- pHeaderBufPtr += 6;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufData-2, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += LENGTH_802_1_H;
- subFramePayloadLen += LENGTH_802_1_H;
- }
-
- // update subFrame Length field
- subFrameHeader[12] = (subFramePayloadLen & 0xFF00) >> 8;
- subFrameHeader[13] = subFramePayloadLen & 0xFF;
-
- totalMPDUSize += pTxBlk->MpduHeaderLen + pTxBlk->SrcBufLen;
-
- if (frameNum ==0)
- FirstTx = HAL_WriteMultiTxResource(pAd, pTxBlk, frameNum, &FreeNumber);
- else
- LastTxIdx = HAL_WriteMultiTxResource(pAd, pTxBlk, frameNum, &FreeNumber);
-
- frameNum++;
-
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
-
- // calculate Transmitted AMSDU Count and ByteCount
- {
- pAd->RalinkCounters.TransmittedAMSDUCount.u.LowPart ++;
- pAd->RalinkCounters.TransmittedOctetsInAMSDU.QuadPart += totalMPDUSize;
- }
-
- }
-
- HAL_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, FirstTx);
- HAL_LastTxIdx(pAd, pTxBlk->QueIdx, LastTxIdx);
-
- //
- // Kick out Tx
- //
- if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
-}
-#endif // DOT11_N_SUPPORT //
-
-VOID STA_Legacy_Frame_Tx(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
- HEADER_802_11 *pHeader_802_11;
- PUCHAR pHeaderBufPtr;
- USHORT FreeNumber;
- BOOLEAN bVLANPkt;
- PQUEUE_ENTRY pQEntry;
-
- ASSERT(pTxBlk);
-
-
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pTxBlk->pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- if (RTMP_FillTxBlkInfo(pAd, pTxBlk) != TRUE)
- {
- RELEASE_NDIS_PACKET(pAd, pTxBlk->pPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- if (pTxBlk->TxFrameType == TX_MCAST_FRAME)
- {
- INC_COUNTER64(pAd->WlanCounters.MulticastTransmittedFrameCount);
- }
-
- if (RTMP_GET_PACKET_RTS(pTxBlk->pPacket))
- TX_BLK_SET_FLAG(pTxBlk, fTX_bRtsRequired);
- else
- TX_BLK_CLEAR_FLAG(pTxBlk, fTX_bRtsRequired);
-
- bVLANPkt = (RTMP_GET_PACKET_VLAN(pTxBlk->pPacket) ? TRUE : FALSE);
-
- if (pTxBlk->TxRate < pAd->CommonCfg.MinTxRate)
- pTxBlk->TxRate = pAd->CommonCfg.MinTxRate;
-
- STAFindCipherAlgorithm(pAd, pTxBlk);
- STABuildCommon802_11Header(pAd, pTxBlk);
-
-
- // skip 802.3 header
- pTxBlk->pSrcBufData = pTxBlk->pSrcBufHeader + LENGTH_802_3;
- pTxBlk->SrcBufLen -= LENGTH_802_3;
-
- // skip vlan tag
- if (bVLANPkt)
- {
- pTxBlk->pSrcBufData += LENGTH_802_1Q;
- pTxBlk->SrcBufLen -= LENGTH_802_1Q;
- }
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
- pHeader_802_11 = (HEADER_802_11 *) pHeaderBufPtr;
-
- // skip common header
- pHeaderBufPtr += pTxBlk->MpduHeaderLen;
-
- if (TX_BLK_TEST_FLAG(pTxBlk, fTX_bWMM))
- {
- //
- // build QOS Control bytes
- //
- *(pHeaderBufPtr) = ((pTxBlk->UserPriority & 0x0F) | (pAd->CommonCfg.AckPolicy[pTxBlk->QueIdx]<<5));
- *(pHeaderBufPtr+1) = 0;
- pHeaderBufPtr +=2;
- pTxBlk->MpduHeaderLen += 2;
- }
-
- // The remaining content of MPDU header should locate at 4-octets aligment
- pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
- pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
-
- {
-
- //
- // Insert LLC-SNAP encapsulation - 8 octets
- //
- //
- // if original Ethernet frame contains no LLC/SNAP,
- // then an extra LLC/SNAP encap is required
- //
- EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader, pTxBlk->pExtraLlcSnapEncap);
- if (pTxBlk->pExtraLlcSnapEncap)
- {
- UCHAR vlan_size;
-
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
- pHeaderBufPtr += 6;
- // skip vlan tag
- vlan_size = (bVLANPkt) ? LENGTH_802_1Q : 0;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufHeader+12+vlan_size, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += LENGTH_802_1_H;
- }
-
- }
-
- //
- // prepare for TXWI
- // use Wcid as Key Index
- //
-
- RTMPWriteTxWI_Data(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
-
- //FreeNumber = GET_TXRING_FREENO(pAd, QueIdx);
-
- HAL_WriteTxResource(pAd, pTxBlk, TRUE, &FreeNumber);
-
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
-
- //
- // Kick out Tx
- //
- if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
-}
-
-
-VOID STA_ARalink_Frame_Tx(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk)
-{
- PUCHAR pHeaderBufPtr;
- USHORT FreeNumber;
- USHORT totalMPDUSize=0;
- USHORT FirstTx, LastTxIdx;
- int frameNum = 0;
- BOOLEAN bVLANPkt;
- PQUEUE_ENTRY pQEntry;
-
-
- ASSERT(pTxBlk);
-
- ASSERT((pTxBlk->TxPacketList.Number== 2));
-
-
- FirstTx = LastTxIdx = 0; // Is it ok init they as 0?
- while(pTxBlk->TxPacketList.Head)
- {
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pTxBlk->pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
-
- if (RTMP_FillTxBlkInfo(pAd, pTxBlk) != TRUE)
- {
- RELEASE_NDIS_PACKET(pAd, pTxBlk->pPacket, NDIS_STATUS_FAILURE);
- continue;
- }
-
- bVLANPkt = (RTMP_GET_PACKET_VLAN(pTxBlk->pPacket) ? TRUE : FALSE);
-
- // skip 802.3 header
- pTxBlk->pSrcBufData = pTxBlk->pSrcBufHeader + LENGTH_802_3;
- pTxBlk->SrcBufLen -= LENGTH_802_3;
-
- // skip vlan tag
- if (bVLANPkt)
- {
- pTxBlk->pSrcBufData += LENGTH_802_1Q;
- pTxBlk->SrcBufLen -= LENGTH_802_1Q;
- }
-
- if (frameNum == 0)
- { // For first frame, we need to create the 802.11 header + padding(optional) + RA-AGG-LEN + SNAP Header
-
- pHeaderBufPtr = STA_Build_ARalink_Frame_Header(pAd, pTxBlk);
-
- // It's ok write the TxWI here, because the TxWI->MPDUtotalByteCount
- // will be updated after final frame was handled.
- RTMPWriteTxWI_Data(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
-
-
- //
- // Insert LLC-SNAP encapsulation - 8 octets
- //
- EXTRA_LLCSNAP_ENCAP_FROM_PKT_OFFSET(pTxBlk->pSrcBufData-2, pTxBlk->pExtraLlcSnapEncap);
-
- if (pTxBlk->pExtraLlcSnapEncap)
- {
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
- pHeaderBufPtr += 6;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufData-2, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += LENGTH_802_1_H;
- }
- }
- else
- { // For second aggregated frame, we need create the 802.3 header to headerBuf, because PCI will copy it to SDPtr0.
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[0];
- pTxBlk->MpduHeaderLen = 0;
-
- // A-Ralink sub-sequent frame header is the same as 802.3 header.
- // DA(6)+SA(6)+FrameType(2)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufHeader, 12);
- pHeaderBufPtr += 12;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufData-2, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen = LENGTH_ARALINK_SUBFRAMEHEAD;
- }
-
- totalMPDUSize += pTxBlk->MpduHeaderLen + pTxBlk->SrcBufLen;
-
- //FreeNumber = GET_TXRING_FREENO(pAd, QueIdx);
- if (frameNum ==0)
- FirstTx = HAL_WriteMultiTxResource(pAd, pTxBlk, frameNum, &FreeNumber);
- else
- LastTxIdx = HAL_WriteMultiTxResource(pAd, pTxBlk, frameNum, &FreeNumber);
-
- frameNum++;
-
- pAd->RalinkCounters.OneSecTxAggregationCount++;
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
-
- }
-
- HAL_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, FirstTx);
- HAL_LastTxIdx(pAd, pTxBlk->QueIdx, LastTxIdx);
-
- //
- // Kick out Tx
- //
- if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
-
-}
-
-
-VOID STA_Fragment_Frame_Tx(
- IN RTMP_ADAPTER *pAd,
- IN TX_BLK *pTxBlk)
-{
- HEADER_802_11 *pHeader_802_11;
- PUCHAR pHeaderBufPtr;
- USHORT FreeNumber;
- UCHAR fragNum = 0;
- PACKET_INFO PacketInfo;
- USHORT EncryptionOverhead = 0;
- UINT32 FreeMpduSize, SrcRemainingBytes;
- USHORT AckDuration;
- UINT NextMpduSize;
- BOOLEAN bVLANPkt;
- PQUEUE_ENTRY pQEntry;
- HTTRANSMIT_SETTING *pTransmit;
-
-
- ASSERT(pTxBlk);
-
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pTxBlk->pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- if (RTMP_FillTxBlkInfo(pAd, pTxBlk) != TRUE)
- {
- RELEASE_NDIS_PACKET(pAd, pTxBlk->pPacket, NDIS_STATUS_FAILURE);
- return;
- }
-
- ASSERT(TX_BLK_TEST_FLAG(pTxBlk, fTX_bAllowFrag));
- bVLANPkt = (RTMP_GET_PACKET_VLAN(pTxBlk->pPacket) ? TRUE : FALSE);
-
- STAFindCipherAlgorithm(pAd, pTxBlk);
- STABuildCommon802_11Header(pAd, pTxBlk);
-
- if (pTxBlk->CipherAlg == CIPHER_TKIP)
- {
- pTxBlk->pPacket = duplicate_pkt_with_TKIP_MIC(pAd, pTxBlk->pPacket);
- if (pTxBlk->pPacket == NULL)
- return;
- RTMP_QueryPacketInfo(pTxBlk->pPacket, &PacketInfo, &pTxBlk->pSrcBufHeader, &pTxBlk->SrcBufLen);
- }
-
- // skip 802.3 header
- pTxBlk->pSrcBufData = pTxBlk->pSrcBufHeader + LENGTH_802_3;
- pTxBlk->SrcBufLen -= LENGTH_802_3;
-
-
- // skip vlan tag
- if (bVLANPkt)
- {
- pTxBlk->pSrcBufData += LENGTH_802_1Q;
- pTxBlk->SrcBufLen -= LENGTH_802_1Q;
- }
-
- pHeaderBufPtr = &pTxBlk->HeaderBuf[TXINFO_SIZE + TXWI_SIZE];
- pHeader_802_11 = (HEADER_802_11 *)pHeaderBufPtr;
-
-
- // skip common header
- pHeaderBufPtr += pTxBlk->MpduHeaderLen;
-
- if (TX_BLK_TEST_FLAG(pTxBlk, fTX_bWMM))
- {
- //
- // build QOS Control bytes
- //
- *pHeaderBufPtr = (pTxBlk->UserPriority & 0x0F);
-
- *(pHeaderBufPtr+1) = 0;
- pHeaderBufPtr +=2;
- pTxBlk->MpduHeaderLen += 2;
- }
-
- //
- // padding at front of LLC header
- // LLC header should locate at 4-octets aligment
- //
- pTxBlk->HdrPadLen = (ULONG)pHeaderBufPtr;
- pHeaderBufPtr = (PUCHAR) ROUND_UP(pHeaderBufPtr, 4);
- pTxBlk->HdrPadLen = (ULONG)(pHeaderBufPtr - pTxBlk->HdrPadLen);
-
-
-
- //
- // Insert LLC-SNAP encapsulation - 8 octets
- //
- //
- // if original Ethernet frame contains no LLC/SNAP,
- // then an extra LLC/SNAP encap is required
- //
- EXTRA_LLCSNAP_ENCAP_FROM_PKT_START(pTxBlk->pSrcBufHeader, pTxBlk->pExtraLlcSnapEncap);
- if (pTxBlk->pExtraLlcSnapEncap)
- {
- UCHAR vlan_size;
-
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pExtraLlcSnapEncap, 6);
- pHeaderBufPtr += 6;
- // skip vlan tag
- vlan_size = (bVLANPkt) ? LENGTH_802_1Q : 0;
- // get 2 octets (TypeofLen)
- NdisMoveMemory(pHeaderBufPtr, pTxBlk->pSrcBufHeader+12+vlan_size, 2);
- pHeaderBufPtr += 2;
- pTxBlk->MpduHeaderLen += LENGTH_802_1_H;
- }
-
-
- // If TKIP is used and fragmentation is required. Driver has to
- // append TKIP MIC at tail of the scatter buffer
- // MAC ASIC will only perform IV/EIV/ICV insertion but no TKIP MIC
- if (pTxBlk->CipherAlg == CIPHER_TKIP)
- {
- RTMPCalculateMICValue(pAd, pTxBlk->pPacket, pTxBlk->pExtraLlcSnapEncap, pTxBlk->pKey, 0);
-
- // NOTE: DON'T refer the skb->len directly after following copy. Becasue the length is not adjust
- // to correct lenght, refer to pTxBlk->SrcBufLen for the packet length in following progress.
- NdisMoveMemory(pTxBlk->pSrcBufData + pTxBlk->SrcBufLen, &pAd->PrivateInfo.Tx.MIC[0], 8);
- //skb_put((RTPKT_TO_OSPKT(pTxBlk->pPacket))->tail, 8);
- pTxBlk->SrcBufLen += 8;
- pTxBlk->TotalFrameLen += 8;
- pTxBlk->CipherAlg = CIPHER_TKIP_NO_MIC;
- }
-
- //
- // calcuate the overhead bytes that encryption algorithm may add. This
- // affects the calculate of "duration" field
- //
- if ((pTxBlk->CipherAlg == CIPHER_WEP64) || (pTxBlk->CipherAlg == CIPHER_WEP128))
- EncryptionOverhead = 8; //WEP: IV[4] + ICV[4];
- else if (pTxBlk->CipherAlg == CIPHER_TKIP_NO_MIC)
- EncryptionOverhead = 12;//TKIP: IV[4] + EIV[4] + ICV[4], MIC will be added to TotalPacketLength
- else if (pTxBlk->CipherAlg == CIPHER_TKIP)
- EncryptionOverhead = 20;//TKIP: IV[4] + EIV[4] + ICV[4] + MIC[8]
- else if (pTxBlk->CipherAlg == CIPHER_AES)
- EncryptionOverhead = 16; // AES: IV[4] + EIV[4] + MIC[8]
- else
- EncryptionOverhead = 0;
-
- pTransmit = pTxBlk->pTransmit;
- // Decide the TX rate
- if (pTransmit->field.MODE == MODE_CCK)
- pTxBlk->TxRate = pTransmit->field.MCS;
- else if (pTransmit->field.MODE == MODE_OFDM)
- pTxBlk->TxRate = pTransmit->field.MCS + RATE_FIRST_OFDM_RATE;
- else
- pTxBlk->TxRate = RATE_6_5;
-
- // decide how much time an ACK/CTS frame will consume in the air
- if (pTxBlk->TxRate <= RATE_LAST_OFDM_RATE)
- AckDuration = RTMPCalcDuration(pAd, pAd->CommonCfg.ExpectedACKRate[pTxBlk->TxRate], 14);
- else
- AckDuration = RTMPCalcDuration(pAd, RATE_6_5, 14);
-
- // Init the total payload length of this frame.
- SrcRemainingBytes = pTxBlk->SrcBufLen;
-
- pTxBlk->TotalFragNum = 0xff;
-
- do {
-
- FreeMpduSize = pAd->CommonCfg.FragmentThreshold - LENGTH_CRC;
-
- FreeMpduSize -= pTxBlk->MpduHeaderLen;
-
- if (SrcRemainingBytes <= FreeMpduSize)
- { // this is the last or only fragment
-
- pTxBlk->SrcBufLen = SrcRemainingBytes;
-
- pHeader_802_11->FC.MoreFrag = 0;
- pHeader_802_11->Duration = pAd->CommonCfg.Dsifs + AckDuration;
-
- // Indicate the lower layer that this's the last fragment.
- pTxBlk->TotalFragNum = fragNum;
- }
- else
- { // more fragment is required
-
- pTxBlk->SrcBufLen = FreeMpduSize;
-
- NextMpduSize = min(((UINT)SrcRemainingBytes - pTxBlk->SrcBufLen), ((UINT)pAd->CommonCfg.FragmentThreshold));
- pHeader_802_11->FC.MoreFrag = 1;
- pHeader_802_11->Duration = (3 * pAd->CommonCfg.Dsifs) + (2 * AckDuration) + RTMPCalcDuration(pAd, pTxBlk->TxRate, NextMpduSize + EncryptionOverhead);
- }
-
- if (fragNum == 0)
- pTxBlk->FrameGap = IFS_HTTXOP;
- else
- pTxBlk->FrameGap = IFS_SIFS;
-
- RTMPWriteTxWI_Data(pAd, (PTXWI_STRUC)(&pTxBlk->HeaderBuf[TXINFO_SIZE]), pTxBlk);
-
- HAL_WriteFragTxResource(pAd, pTxBlk, fragNum, &FreeNumber);
-
- pAd->RalinkCounters.KickTxCount++;
- pAd->RalinkCounters.OneSecTxDoneCount++;
-
- // Update the frame number, remaining size of the NDIS packet payload.
-
- // space for 802.11 header.
- if (fragNum == 0 && pTxBlk->pExtraLlcSnapEncap)
- pTxBlk->MpduHeaderLen -= LENGTH_802_1_H;
-
- fragNum++;
- SrcRemainingBytes -= pTxBlk->SrcBufLen;
- pTxBlk->pSrcBufData += pTxBlk->SrcBufLen;
-
- pHeader_802_11->Frag++; // increase Frag #
-
- }while(SrcRemainingBytes > 0);
-
- //
- // Kick out Tx
- //
- if (!RTMP_TEST_PSFLAG(pAd, fRTMP_PS_DISABLE_TX))
- HAL_KickOutTx(pAd, pTxBlk, pTxBlk->QueIdx);
-}
-
-
-#define RELEASE_FRAMES_OF_TXBLK(_pAd, _pTxBlk, _pQEntry, _Status) \
- while(_pTxBlk->TxPacketList.Head) \
- { \
- _pQEntry = RemoveHeadQueue(&_pTxBlk->TxPacketList); \
- RELEASE_NDIS_PACKET(_pAd, QUEUE_ENTRY_TO_PACKET(_pQEntry), _Status); \
- }
-
-
-/*
- ========================================================================
-
- Routine Description:
- Copy frame from waiting queue into relative ring buffer and set
- appropriate ASIC register to kick hardware encryption before really
- sent out to air.
-
- Arguments:
- pAd Pointer to our adapter
- PNDIS_PACKET Pointer to outgoing Ndis frame
- NumberOfFrag Number of fragment required
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-NDIS_STATUS STAHardTransmit(
- IN PRTMP_ADAPTER pAd,
- IN TX_BLK *pTxBlk,
- IN UCHAR QueIdx)
-{
- NDIS_PACKET *pPacket;
- PQUEUE_ENTRY pQEntry;
-
- // ---------------------------------------------
- // STEP 0. DO SANITY CHECK AND SOME EARLY PREPARATION.
- // ---------------------------------------------
- //
- ASSERT(pTxBlk->TxPacketList.Number);
- if (pTxBlk->TxPacketList.Head == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("pTxBlk->TotalFrameNum == %ld!\n", pTxBlk->TxPacketList.Number));
- return NDIS_STATUS_FAILURE;
- }
-
- pPacket = QUEUE_ENTRY_TO_PACKET(pTxBlk->TxPacketList.Head);
-
-
- // ------------------------------------------------------------------
- // STEP 1. WAKE UP PHY
- // outgoing frame always wakeup PHY to prevent frame lost and
- // turn off PSM bit to improve performance
- // ------------------------------------------------------------------
- // not to change PSM bit, just send this frame out?
- if ((pAd->StaCfg.Psm == PWR_SAVE) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- DBGPRINT_RAW(RT_DEBUG_INFO, ("AsicForceWakeup At HardTx\n"));
-#ifdef RTMP_MAC_PCI
- AsicForceWakeup(pAd, TRUE);
-#endif // RTMP_MAC_PCI //
- }
-
- // It should not change PSM bit, when APSD turn on.
- if ((!(pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable) && (pAd->CommonCfg.bAPSDForcePowerSave == FALSE))
- || (RTMP_GET_PACKET_EAPOL(pTxBlk->pPacket))
- || (RTMP_GET_PACKET_WAI(pTxBlk->pPacket)))
- {
- if ((pAd->StaCfg.Psm == PWR_SAVE) &&
- (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeFast_PSP))
- RTMP_SET_PSM_BIT(pAd, PWR_ACTIVE);
- }
-
- switch (pTxBlk->TxFrameType)
- {
-#ifdef DOT11_N_SUPPORT
- case TX_AMPDU_FRAME:
- STA_AMPDU_Frame_Tx(pAd, pTxBlk);
- break;
- case TX_AMSDU_FRAME:
- STA_AMSDU_Frame_Tx(pAd, pTxBlk);
- break;
-#endif // DOT11_N_SUPPORT //
- case TX_LEGACY_FRAME:
- STA_Legacy_Frame_Tx(pAd, pTxBlk);
- break;
- case TX_MCAST_FRAME:
- STA_Legacy_Frame_Tx(pAd, pTxBlk);
- break;
- case TX_RALINK_FRAME:
- STA_ARalink_Frame_Tx(pAd, pTxBlk);
- break;
- case TX_FRAG_FRAME:
- STA_Fragment_Frame_Tx(pAd, pTxBlk);
- break;
- default:
- {
- // It should not happened!
- DBGPRINT(RT_DEBUG_ERROR, ("Send a pacekt was not classified!! It should not happen!\n"));
- while(pTxBlk->TxPacketList.Number)
- {
- pQEntry = RemoveHeadQueue(&pTxBlk->TxPacketList);
- pPacket = QUEUE_ENTRY_TO_PACKET(pQEntry);
- if (pPacket)
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
- }
- break;
- }
-
- return (NDIS_STATUS_SUCCESS);
-
-}
-
-ULONG HashBytesPolynomial(UCHAR *value, unsigned int len)
-{
- unsigned char *word = value;
- unsigned int ret = 0;
- unsigned int i;
-
- for(i=0; i < len; i++)
- {
- int mod = i % 32;
- ret ^=(unsigned int) (word[i]) << mod;
- ret ^=(unsigned int) (word[i]) >> (32 - mod);
- }
- return ret;
-}
-
-VOID Sta_Announce_or_Forward_802_3_Packet(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
- IN UCHAR FromWhichBSSID)
-{
- if (TRUE
- )
- {
- announce_802_3_packet(pAd, pPacket);
- }
- else
- {
- // release packet
- RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE);
- }
-}
diff --git a/drivers/staging/rt3090/sta/sanity.c b/drivers/staging/rt3090/sta/sanity.c
deleted file mode 100644
index aeda15bd5bca..000000000000
--- a/drivers/staging/rt3090/sta/sanity.c
+++ /dev/null
@@ -1,382 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- sanity.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2004-09-01 add WMM support
-*/
-
-#include "../rt_config.h"
-
-
-extern UCHAR CISCO_OUI[];
-
-extern UCHAR WPA_OUI[];
-extern UCHAR RSN_OUI[];
-extern UCHAR WME_INFO_ELEM[];
-extern UCHAR WME_PARM_ELEM[];
-extern UCHAR Ccx2QosInfo[];
-extern UCHAR RALINK_OUI[];
-extern UCHAR BROADCOM_OUI[];
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
- */
-BOOLEAN MlmeStartReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen)
-{
- MLME_START_REQ_STRUCT *Info;
-
- Info = (MLME_START_REQ_STRUCT *)(Msg);
-
- if (Info->SsidLen > MAX_LEN_OF_SSID)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeStartReqSanity fail - wrong SSID length\n"));
- return FALSE;
- }
-
- *pSsidLen = Info->SsidLen;
- NdisMoveMemory(Ssid, Info->Ssid, *pSsidLen);
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerAssocRspSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *pMsg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT USHORT *pCapabilityInfo,
- OUT USHORT *pStatus,
- OUT USHORT *pAid,
- OUT UCHAR SupRate[],
- OUT UCHAR *pSupRateLen,
- OUT UCHAR ExtRate[],
- OUT UCHAR *pExtRateLen,
- OUT HT_CAPABILITY_IE *pHtCapability,
- OUT ADD_HT_INFO_IE *pAddHtInfo, // AP might use this additional ht info IE
- OUT UCHAR *pHtCapabilityLen,
- OUT UCHAR *pAddHtInfoLen,
- OUT UCHAR *pNewExtChannelOffset,
- OUT PEDCA_PARM pEdcaParm,
- OUT UCHAR *pCkipFlag)
-{
- CHAR IeType, *Ptr;
- PFRAME_802_11 pFrame = (PFRAME_802_11)pMsg;
- PEID_STRUCT pEid;
- ULONG Length = 0;
-
- *pNewExtChannelOffset = 0xff;
- *pHtCapabilityLen = 0;
- *pAddHtInfoLen = 0;
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
- Ptr = (PCHAR)pFrame->Octet;
- Length += LENGTH_802_11;
-
- NdisMoveMemory(pCapabilityInfo, &pFrame->Octet[0], 2);
- Length += 2;
- NdisMoveMemory(pStatus, &pFrame->Octet[2], 2);
- Length += 2;
- *pCkipFlag = 0;
- *pExtRateLen = 0;
- pEdcaParm->bValid = FALSE;
-
- if (*pStatus != MLME_SUCCESS)
- return TRUE;
-
- NdisMoveMemory(pAid, &pFrame->Octet[4], 2);
- Length += 2;
-
- // Aid already swaped byte order in RTMPFrameEndianChange() for big endian platform
- *pAid = (*pAid) & 0x3fff; // AID is low 14-bit
-
- // -- get supported rates from payload and advance the pointer
- IeType = pFrame->Octet[6];
- *pSupRateLen = pFrame->Octet[7];
- if ((IeType != IE_SUPP_RATES) || (*pSupRateLen > MAX_LEN_OF_SUPPORTED_RATES))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspSanity fail - wrong SupportedRates IE\n"));
- return FALSE;
- }
- else
- NdisMoveMemory(SupRate, &pFrame->Octet[8], *pSupRateLen);
-
-
- Length = Length + 2 + *pSupRateLen;
-
- // many AP implement proprietary IEs in non-standard order, we'd better
- // tolerate mis-ordered IEs to get best compatibility
- pEid = (PEID_STRUCT) &pFrame->Octet[8 + (*pSupRateLen)];
-
- // get variable fields from payload and advance the pointer
- while ((Length + 2 + pEid->Len) <= MsgLen)
- {
- switch (pEid->Eid)
- {
- case IE_EXT_SUPP_RATES:
- if (pEid->Len <= MAX_LEN_OF_SUPPORTED_RATES)
- {
- NdisMoveMemory(ExtRate, pEid->Octet, pEid->Len);
- *pExtRateLen = pEid->Len;
- }
- break;
-
- case IE_HT_CAP:
- case IE_HT_CAP2:
- if (pEid->Len >= SIZE_HT_CAP_IE) //Note: allow extension.!!
- {
- NdisMoveMemory(pHtCapability, pEid->Octet, SIZE_HT_CAP_IE);
-
- *(USHORT *)(&pHtCapability->HtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->HtCapInfo));
- *(USHORT *)(&pHtCapability->ExtHtCapInfo) = cpu2le16(*(USHORT *)(&pHtCapability->ExtHtCapInfo));
-
- *pHtCapabilityLen = SIZE_HT_CAP_IE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerAssocRspSanity - wrong IE_HT_CAP. \n"));
- }
-
- break;
-#ifdef DOT11_N_SUPPORT
- case IE_ADD_HT:
- case IE_ADD_HT2:
- if (pEid->Len >= sizeof(ADD_HT_INFO_IE))
- {
- // This IE allows extension, but we can ignore extra bytes beyond our knowledge , so only
- // copy first sizeof(ADD_HT_INFO_IE)
- NdisMoveMemory(pAddHtInfo, pEid->Octet, sizeof(ADD_HT_INFO_IE));
-
- *(USHORT *)(&pAddHtInfo->AddHtInfo2) = cpu2le16(*(USHORT *)(&pAddHtInfo->AddHtInfo2));
- *(USHORT *)(&pAddHtInfo->AddHtInfo3) = cpu2le16(*(USHORT *)(&pAddHtInfo->AddHtInfo3));
-
- *pAddHtInfoLen = SIZE_ADD_HT_INFO_IE;
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerAssocRspSanity - wrong IE_ADD_HT. \n"));
- }
-
- break;
- case IE_SECONDARY_CH_OFFSET:
- if (pEid->Len == 1)
- {
- *pNewExtChannelOffset = pEid->Octet[0];
- }
- else
- {
- DBGPRINT(RT_DEBUG_WARN, ("PeerAssocRspSanity - wrong IE_SECONDARY_CH_OFFSET. \n"));
- }
-#endif // DOT11_N_SUPPORT //
- break;
-
- case IE_VENDOR_SPECIFIC:
- // handle WME PARAMTER ELEMENT
- if (NdisEqualMemory(pEid->Octet, WME_PARM_ELEM, 6) && (pEid->Len == 24))
- {
- PUCHAR ptr;
- int i;
-
- // parsing EDCA parameters
- pEdcaParm->bValid = TRUE;
- pEdcaParm->bQAck = FALSE; // pEid->Octet[0] & 0x10;
- pEdcaParm->bQueueRequest = FALSE; // pEid->Octet[0] & 0x20;
- pEdcaParm->bTxopRequest = FALSE; // pEid->Octet[0] & 0x40;
- //pEdcaParm->bMoreDataAck = FALSE; // pEid->Octet[0] & 0x80;
- pEdcaParm->EdcaUpdateCount = pEid->Octet[6] & 0x0f;
- pEdcaParm->bAPSDCapable = (pEid->Octet[6] & 0x80) ? 1 : 0;
- ptr = (PUCHAR)&pEid->Octet[8];
- for (i=0; i<4; i++)
- {
- UCHAR aci = (*ptr & 0x60) >> 5; // b5~6 is AC INDEX
- pEdcaParm->bACM[aci] = (((*ptr) & 0x10) == 0x10); // b5 is ACM
- pEdcaParm->Aifsn[aci] = (*ptr) & 0x0f; // b0~3 is AIFSN
- pEdcaParm->Cwmin[aci] = *(ptr+1) & 0x0f; // b0~4 is Cwmin
- pEdcaParm->Cwmax[aci] = *(ptr+1) >> 4; // b5~8 is Cwmax
- pEdcaParm->Txop[aci] = *(ptr+2) + 256 * (*(ptr+3)); // in unit of 32-us
- ptr += 4; // point to next AC
- }
- }
- break;
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("PeerAssocRspSanity - ignore unrecognized EID = %d\n", pEid->Eid));
- break;
- }
-
- Length = Length + 2 + pEid->Len;
- pEid = (PEID_STRUCT)((UCHAR*)pEid + 2 + pEid->Len);
- }
-
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- MLME message sanity check
- Return:
- TRUE if all parameters are OK, FALSE otherwise
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN PeerProbeReqSanity(
- IN PRTMP_ADAPTER pAd,
- IN VOID *Msg,
- IN ULONG MsgLen,
- OUT PUCHAR pAddr2,
- OUT CHAR Ssid[],
- OUT UCHAR *pSsidLen)
-{
- UCHAR Idx;
- UCHAR RateLen;
- CHAR IeType;
- PFRAME_802_11 pFrame = (PFRAME_802_11)Msg;
-
- COPY_MAC_ADDR(pAddr2, pFrame->Hdr.Addr2);
-
- if ((pFrame->Octet[0] != IE_SSID) || (pFrame->Octet[1] > MAX_LEN_OF_SSID))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerProbeReqSanity fail - wrong SSID IE(Type=%d,Len=%d)\n",pFrame->Octet[0],pFrame->Octet[1]));
- return FALSE;
- }
-
- *pSsidLen = pFrame->Octet[1];
- NdisMoveMemory(Ssid, &pFrame->Octet[2], *pSsidLen);
-
- Idx = *pSsidLen + 2;
-
- // -- get supported rates from payload and advance the pointer
- IeType = pFrame->Octet[Idx];
- RateLen = pFrame->Octet[Idx + 1];
- if (IeType != IE_SUPP_RATES)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("PeerProbeReqSanity fail - wrong SupportRates IE(Type=%d,Len=%d)\n",pFrame->Octet[Idx],pFrame->Octet[Idx+1]));
- return FALSE;
- }
- else
- {
- if ((pAd->CommonCfg.PhyMode == PHY_11G) && (RateLen < 8))
- return (FALSE);
- }
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-BOOLEAN GetTimBit(
- IN CHAR *Ptr,
- IN USHORT Aid,
- OUT UCHAR *TimLen,
- OUT UCHAR *BcastFlag,
- OUT UCHAR *DtimCount,
- OUT UCHAR *DtimPeriod,
- OUT UCHAR *MessageToMe)
-{
- UCHAR BitCntl, N1, N2, MyByte, MyBit;
- CHAR *IdxPtr;
-
- IdxPtr = Ptr;
-
- IdxPtr ++;
- *TimLen = *IdxPtr;
-
- // get DTIM Count from TIM element
- IdxPtr ++;
- *DtimCount = *IdxPtr;
-
- // get DTIM Period from TIM element
- IdxPtr++;
- *DtimPeriod = *IdxPtr;
-
- // get Bitmap Control from TIM element
- IdxPtr++;
- BitCntl = *IdxPtr;
-
- if ((*DtimCount == 0) && (BitCntl & 0x01))
- *BcastFlag = TRUE;
- else
- *BcastFlag = FALSE;
-
- // Parse Partial Virtual Bitmap from TIM element
- N1 = BitCntl & 0xfe; // N1 is the first bitmap byte#
- N2 = *TimLen - 4 + N1; // N2 is the last bitmap byte#
-
- if ((Aid < (N1 << 3)) || (Aid >= ((N2 + 1) << 3)))
- *MessageToMe = FALSE;
- else
- {
- MyByte = (Aid >> 3) - N1; // my byte position in the bitmap byte-stream
- MyBit = Aid % 16 - ((MyByte & 0x01)? 8:0);
-
- IdxPtr += (MyByte + 1);
-
- //if (*IdxPtr)
- // DBGPRINT(RT_DEBUG_WARN, ("TIM bitmap = 0x%02x\n", *IdxPtr));
-
- if (*IdxPtr & (0x01 << MyBit))
- *MessageToMe = TRUE;
- else
- *MessageToMe = FALSE;
- }
-
- return TRUE;
-}
diff --git a/drivers/staging/rt3090/sta/sync.c b/drivers/staging/rt3090/sta/sync.c
deleted file mode 100644
index 2520e038cb82..000000000000
--- a/drivers/staging/rt3090/sta/sync.c
+++ /dev/null
@@ -1,1840 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- sync.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- John Chang 2004-09-01 modified for rt2561/2661
- Jan Lee 2006-08-01 modified for rt2860 for 802.11n
-*/
-
-#include "../rt_config.h"
-
-
-#define ADHOC_ENTRY_BEACON_LOST_TIME (2*OS_HZ) // 2 sec
-
-/*
- ==========================================================================
- Description:
- The sync state machine,
- Parameters:
- Sm - pointer to the state machine
- Note:
- the state machine looks like the following
-
- ==========================================================================
- */
-VOID SyncStateMachineInit(
- IN PRTMP_ADAPTER pAd,
- IN STATE_MACHINE *Sm,
- OUT STATE_MACHINE_FUNC Trans[])
-{
- StateMachineInit(Sm, Trans, MAX_SYNC_STATE, MAX_SYNC_MSG, (STATE_MACHINE_FUNC)Drop, SYNC_IDLE, SYNC_MACHINE_BASE);
-
- // column 1
- StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)MlmeScanReqAction);
- StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)MlmeJoinReqAction);
- StateMachineSetAction(Sm, SYNC_IDLE, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)MlmeStartReqAction);
- StateMachineSetAction(Sm, SYNC_IDLE, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeacon);
- StateMachineSetAction(Sm, SYNC_IDLE, MT2_PEER_PROBE_REQ, (STATE_MACHINE_FUNC)PeerProbeReqAction);
-
- //column 2
- StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenScan);
- StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenJoin);
- StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenStart);
- StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeaconAtJoinAction);
- StateMachineSetAction(Sm, JOIN_WAIT_BEACON, MT2_BEACON_TIMEOUT, (STATE_MACHINE_FUNC)BeaconTimeoutAtJoinAction);
-
- // column 3
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_SCAN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenScan);
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_JOIN_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenJoin);
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_MLME_START_REQ, (STATE_MACHINE_FUNC)InvalidStateWhenStart);
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_PEER_BEACON, (STATE_MACHINE_FUNC)PeerBeaconAtScanAction);
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_PEER_PROBE_RSP, (STATE_MACHINE_FUNC)PeerBeaconAtScanAction);
- StateMachineSetAction(Sm, SCAN_LISTEN, MT2_SCAN_TIMEOUT, (STATE_MACHINE_FUNC)ScanTimeoutAction);
-
- // timer init
- RTMPInitTimer(pAd, &pAd->MlmeAux.BeaconTimer, GET_TIMER_FUNCTION(BeaconTimeout), pAd, FALSE);
- RTMPInitTimer(pAd, &pAd->MlmeAux.ScanTimer, GET_TIMER_FUNCTION(ScanTimeout), pAd, FALSE);
-}
-
-/*
- ==========================================================================
- Description:
- Beacon timeout handler, executed in timer thread
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID BeaconTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
- DBGPRINT(RT_DEBUG_TRACE,("SYNC - BeaconTimeout\n"));
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- return;
-
-#ifdef DOT11_N_SUPPORT
- if ((pAd->CommonCfg.BBPCurrentBW == BW_40)
- )
- {
- UCHAR BBPValue = 0;
- AsicSwitchChannel(pAd, pAd->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.CentralChannel);
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- BBPValue |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - End of SCAN, restore to 40MHz channel %d, Total BSS[%02d]\n",pAd->CommonCfg.CentralChannel, pAd->ScanTab.BssNr));
- }
-#endif // DOT11_N_SUPPORT //
-
- MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_BEACON_TIMEOUT, 0, NULL);
- RTMP_MLME_HANDLER(pAd);
-}
-
-/*
- ==========================================================================
- Description:
- Scan timeout handler, executed in timer thread
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID ScanTimeout(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (RTMP_ADAPTER *)FunctionContext;
-
-
- // Do nothing if the driver is starting halt state.
- // This might happen when timer already been fired before cancel timer with mlmehalt
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))
- return;
-
- if (MlmeEnqueue(pAd, SYNC_STATE_MACHINE, MT2_SCAN_TIMEOUT, 0, NULL))
- {
- RTMP_MLME_HANDLER(pAd);
-}
- else
- {
- // To prevent SyncMachine.CurrState is SCAN_LISTEN forever.
- pAd->MlmeAux.Channel = 0;
- ScanNextChannel(pAd);
- if (pAd->CommonCfg.bWirelessEvent)
- {
- RTMPSendWirelessEvent(pAd, IW_SCAN_ENQUEUE_FAIL_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
- }
- }
-}
-
-/*
- ==========================================================================
- Description:
- MLME SCAN req state machine procedure
- ==========================================================================
- */
-VOID MlmeScanReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, ScanType, BssType, BBPValue = 0;
- BOOLEAN TimerCancelled;
- ULONG Now;
- USHORT Status;
- PHEADER_802_11 pHdr80211;
- PUCHAR pOutBuffer = NULL;
- NDIS_STATUS NStatus;
-
- // Check the total scan tries for one single OID command
- // If this is the CCX 2.0 Case, skip that!
- if ( !RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_START_UP))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeScanReqAction before Startup\n"));
- return;
- }
-
- // Increase the scan retry counters.
- pAd->StaCfg.ScanCnt++;
-
-#ifdef RTMP_MAC_PCI
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) &&
- (IDLE_ON(pAd)) &&
- (pAd->StaCfg.bRadio == TRUE) &&
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
- {
- if (pAd->StaCfg.PSControl.field.EnableNewPS == FALSE)
- {
- AsicSendCommandToMcu(pAd, 0x31, PowerWakeCID, 0x00, 0x02);
- AsicCheckCommanOk(pAd, PowerWakeCID);
- RTMP_CLEAR_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF);
- DBGPRINT(RT_DEBUG_TRACE, ("PSM - Issue Wake up command \n"));
- }
- else
- {
- RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
- }
- }
-#endif // RTMP_MAC_PCI //
-
- // first check the parameter sanity
- if (MlmeScanReqSanity(pAd,
- Elem->Msg,
- Elem->MsgLen,
- &BssType,
- (PCHAR)Ssid,
- &SsidLen,
- &ScanType))
- {
-
- // Check for channel load and noise hist request
- // Suspend MSDU only at scan request, not the last two mentioned
- // Suspend MSDU transmission here
- RTMPSuspendMsduTransmission(pAd);
-
- //
- // To prevent data lost.
- // Send an NULL data with turned PSM bit on to current associated AP before SCAN progress.
- // And should send an NULL data with turned PSM bit off to AP, when scan progress done
- //
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED) && (INFRA_ON(pAd)))
- {
- NStatus = MlmeAllocateMemory(pAd, (PVOID)&pOutBuffer);
- if (NStatus == NDIS_STATUS_SUCCESS)
- {
- pHdr80211 = (PHEADER_802_11) pOutBuffer;
- MgtMacHeaderInit(pAd, pHdr80211, SUBTYPE_NULL_FUNC, 1, pAd->CommonCfg.Bssid, pAd->CommonCfg.Bssid);
- pHdr80211->Duration = 0;
- pHdr80211->FC.Type = BTYPE_DATA;
- pHdr80211->FC.PwrMgmt = PWR_SAVE;
-
- // Send using priority queue
- MiniportMMRequest(pAd, 0, pOutBuffer, sizeof(HEADER_802_11));
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeScanReqAction -- Send PSM Data frame for off channel RM\n"));
- MlmeFreeMemory(pAd, pOutBuffer);
- RTMPusecDelay(5000);
- }
- }
-
- NdisGetSystemUpTime(&Now);
- pAd->StaCfg.LastScanTime = Now;
- // reset all the timers
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
-
- // record desired BSS parameters
- pAd->MlmeAux.BssType = BssType;
- pAd->MlmeAux.ScanType = ScanType;
- pAd->MlmeAux.SsidLen = SsidLen;
- NdisZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
- NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);
-
- // start from the first channel
- pAd->MlmeAux.Channel = FirstChannel(pAd);
-
- // Let BBP register at 20MHz to do scan
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n"));
- ScanNextChannel(pAd);
- }
- else
- {
- DBGPRINT_ERR(("SYNC - MlmeScanReqAction() sanity check fail\n"));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_INVALID_FORMAT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
- }
-}
-
-/*
- ==========================================================================
- Description:
- MLME JOIN req state machine procedure
- ==========================================================================
- */
-VOID MlmeJoinReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR BBPValue = 0;
- BSS_ENTRY *pBss;
- BOOLEAN TimerCancelled;
- HEADER_802_11 Hdr80211;
- NDIS_STATUS NStatus;
- ULONG FrameLen = 0;
- PUCHAR pOutBuffer = NULL;
- PUCHAR pSupRate = NULL;
- UCHAR SupRateLen;
- PUCHAR pExtRate = NULL;
- UCHAR ExtRateLen;
- UCHAR ASupRate[] = {0x8C, 0x12, 0x98, 0x24, 0xb0, 0x48, 0x60, 0x6C};
- UCHAR ASupRateLen = sizeof(ASupRate)/sizeof(UCHAR);
- MLME_JOIN_REQ_STRUCT *pInfo = (MLME_JOIN_REQ_STRUCT *)(Elem->Msg);
-
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeJoinReqAction(BSS #%ld)\n", pInfo->BssIdx));
-
-#ifdef RTMP_MAC_PCI
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) &&
- (IDLE_ON(pAd)) &&
- (pAd->StaCfg.bRadio == TRUE) &&
- (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_IDLE_RADIO_OFF)))
- {
- RT28xxPciAsicRadioOn(pAd, GUI_IDLE_POWER_SAVE);
- }
-#endif // RTMP_MAC_PCI //
-
- // reset all the timers
- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
-
- pBss = &pAd->MlmeAux.SsidBssTab.BssEntry[pInfo->BssIdx];
-
- // record the desired SSID & BSSID we're waiting for
- COPY_MAC_ADDR(pAd->MlmeAux.Bssid, pBss->Bssid);
-
- // If AP's SSID is not hidden, it is OK for updating ssid to MlmeAux again.
- if (pBss->Hidden == 0)
- {
- RTMPZeroMemory(pAd->MlmeAux.Ssid, MAX_LEN_OF_SSID);
- NdisMoveMemory(pAd->MlmeAux.Ssid, pBss->Ssid, pBss->SsidLen);
- pAd->MlmeAux.SsidLen = pBss->SsidLen;
- }
-
- pAd->MlmeAux.BssType = pBss->BssType;
- pAd->MlmeAux.Channel = pBss->Channel;
- pAd->MlmeAux.CentralChannel = pBss->CentralChannel;
-
-#ifdef EXT_BUILD_CHANNEL_LIST
- // Country IE of the AP will be evaluated and will be used.
- if ((pAd->StaCfg.IEEE80211dClientMode != Rt802_11_D_None) &&
- (pBss->bHasCountryIE == TRUE))
- {
- NdisMoveMemory(&pAd->CommonCfg.CountryCode[0], &pBss->CountryString[0], 2);
- if (pBss->CountryString[2] == 'I')
- pAd->CommonCfg.Geography = IDOR;
- else if (pBss->CountryString[2] == 'O')
- pAd->CommonCfg.Geography = ODOR;
- else
- pAd->CommonCfg.Geography = BOTH;
- BuildChannelListEx(pAd);
- }
-#endif // EXT_BUILD_CHANNEL_LIST //
-
- // Let BBP register at 20MHz to do scan
- RTMP_BBP_IO_READ8_BY_REG_ID(pAd, BBP_R4, &BBPValue);
- BBPValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R4, BBPValue);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BBP R4 to 20MHz.l\n"));
-
- // switch channel and waiting for beacon timer
- AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, FALSE);
- AsicLockChannel(pAd, pAd->MlmeAux.Channel);
-
-
- RTMPSetTimer(&pAd->MlmeAux.BeaconTimer, JOIN_TIMEOUT);
-
- do
- {
- if (((pAd->CommonCfg.bIEEE80211H == 1) &&
- (pAd->MlmeAux.Channel > 14) &&
- RadarChannelCheck(pAd, pAd->MlmeAux.Channel))
-#ifdef CARRIER_DETECTION_SUPPORT // Roger sync Carrier
- || (pAd->CommonCfg.CarrierDetect.Enable == TRUE)
-#endif // CARRIER_DETECTION_SUPPORT //
- )
- {
- //
- // We can't send any Probe request frame to meet 802.11h.
- //
- if (pBss->Hidden == 0)
- break;
- }
-
- //
- // send probe request
- //
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer);
- if (NStatus == NDIS_STATUS_SUCCESS)
- {
- if (pAd->MlmeAux.Channel <= 14)
- {
- pSupRate = pAd->CommonCfg.SupRate;
- SupRateLen = pAd->CommonCfg.SupRateLen;
- pExtRate = pAd->CommonCfg.ExtRate;
- ExtRateLen = pAd->CommonCfg.ExtRateLen;
- }
- else
- {
- //
- // Overwrite Support Rate, CCK rate are not allowed
- //
- pSupRate = ASupRate;
- SupRateLen = ASupRateLen;
- ExtRateLen = 0;
- }
-
- if (pAd->MlmeAux.BssType == BSS_INFRA)
- MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, pAd->MlmeAux.Bssid, pAd->MlmeAux.Bssid);
- else
- MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, BROADCAST_ADDR, BROADCAST_ADDR);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &Hdr80211,
- 1, &SsidIe,
- 1, &pAd->MlmeAux.SsidLen,
- pAd->MlmeAux.SsidLen, pAd->MlmeAux.Ssid,
- 1, &SupRateIe,
- 1, &SupRateLen,
- SupRateLen, pSupRate,
- END_OF_ARGS);
-
- if (ExtRateLen)
- {
- ULONG Tmp;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &Tmp,
- 1, &ExtRateIe,
- 1, &ExtRateLen,
- ExtRateLen, pExtRate,
- END_OF_ARGS);
- FrameLen += Tmp;
- }
-
-
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- }
- } while (FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - Switch to ch %d, Wait BEACON from %02x:%02x:%02x:%02x:%02x:%02x\n",
- pBss->Channel, pBss->Bssid[0], pBss->Bssid[1], pBss->Bssid[2], pBss->Bssid[3], pBss->Bssid[4], pBss->Bssid[5]));
-
- pAd->Mlme.SyncMachine.CurrState = JOIN_WAIT_BEACON;
-}
-
-/*
- ==========================================================================
- Description:
- MLME START Request state machine procedure, starting an IBSS
- ==========================================================================
- */
-VOID MlmeStartReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen;
- BOOLEAN TimerCancelled;
-
- // New for WPA security suites
- UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
- NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
- LARGE_INTEGER TimeStamp;
- BOOLEAN Privacy;
- USHORT Status;
-
- // Init Variable IE structure
- pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
- pVIE->Length = 0;
- TimeStamp.u.LowPart = 0;
- TimeStamp.u.HighPart = 0;
-
- if (MlmeStartReqSanity(pAd, Elem->Msg, Elem->MsgLen, (PCHAR)Ssid, &SsidLen))
- {
- // reset all the timers
- RTMPCancelTimer(&pAd->MlmeAux.ScanTimer, &TimerCancelled);
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
-
- //
- // Start a new IBSS. All IBSS parameters are decided now....
- //
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeStartReqAction - Start a new IBSS. All IBSS parameters are decided now.... \n"));
- pAd->MlmeAux.BssType = BSS_ADHOC;
- NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);
- pAd->MlmeAux.SsidLen = SsidLen;
-
- // generate a radom number as BSSID
- MacAddrRandomBssid(pAd, pAd->MlmeAux.Bssid);
- DBGPRINT(RT_DEBUG_TRACE, ("MlmeStartReqAction - generate a radom number as BSSID \n"));
-
- Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled);
- pAd->MlmeAux.CapabilityInfo = CAP_GENERATE(0,1,Privacy, (pAd->CommonCfg.TxPreamble == Rt802_11PreambleShort), 1, 0);
- pAd->MlmeAux.BeaconPeriod = pAd->CommonCfg.BeaconPeriod;
- pAd->MlmeAux.AtimWin = pAd->StaCfg.AtimWin;
- pAd->MlmeAux.Channel = pAd->CommonCfg.Channel;
-
- pAd->CommonCfg.CentralChannel = pAd->CommonCfg.Channel;
- pAd->MlmeAux.CentralChannel = pAd->CommonCfg.CentralChannel;
-
- pAd->MlmeAux.SupRateLen= pAd->CommonCfg.SupRateLen;
- NdisMoveMemory(pAd->MlmeAux.SupRate, pAd->CommonCfg.SupRate, MAX_LEN_OF_SUPPORTED_RATES);
- RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen);
- pAd->MlmeAux.ExtRateLen = pAd->CommonCfg.ExtRateLen;
- NdisMoveMemory(pAd->MlmeAux.ExtRate, pAd->CommonCfg.ExtRate, MAX_LEN_OF_SUPPORTED_RATES);
- RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen);
-#ifdef DOT11_N_SUPPORT
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- {
- RTMPUpdateHTIE(&pAd->CommonCfg.DesiredHtPhy, &pAd->StaCfg.DesiredHtPhyInfo.MCSSet[0], &pAd->MlmeAux.HtCapability, &pAd->MlmeAux.AddHtInfo);
- pAd->MlmeAux.HtCapabilityLen = sizeof(HT_CAPABILITY_IE);
- // Not turn pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE here.
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC -pAd->StaActive.SupportedHtPhy.bHtEnable = TRUE\n"));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- pAd->MlmeAux.HtCapabilityLen = 0;
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- NdisZeroMemory(&pAd->StaActive.SupportedPhyInfo.MCSSet[0], 16);
- }
- // temporarily not support QOS in IBSS
- NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM));
- NdisZeroMemory(&pAd->MlmeAux.APQbssLoad, sizeof(QBSS_LOAD_PARM));
- NdisZeroMemory(&pAd->MlmeAux.APQosCapability, sizeof(QOS_CAPABILITY_PARM));
-
- AsicSwitchChannel(pAd, pAd->MlmeAux.Channel, FALSE);
- AsicLockChannel(pAd, pAd->MlmeAux.Channel);
-
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - MlmeStartReqAction(ch= %d,sup rates= %d, ext rates=%d)\n",
- pAd->MlmeAux.Channel, pAd->MlmeAux.SupRateLen, pAd->MlmeAux.ExtRateLen));
-
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_SUCCESS;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status);
- }
- else
- {
- DBGPRINT_ERR(("SYNC - MlmeStartReqAction() sanity check fail.\n"));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_INVALID_FORMAT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status);
- }
-}
-
-/*
- ==========================================================================
- Description:
- peer sends beacon back when scanning
- ==========================================================================
- */
-VOID PeerBeaconAtScanAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
- UCHAR Ssid[MAX_LEN_OF_SSID], BssType, Channel, NewChannel,
- SsidLen, DtimCount, DtimPeriod, BcastFlag, MessageToMe;
- CF_PARM CfParm;
- USHORT BeaconPeriod, AtimWin, CapabilityInfo;
- PFRAME_802_11 pFrame;
- LARGE_INTEGER TimeStamp;
- UCHAR Erp;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen, ExtRateLen;
- USHORT LenVIE;
- UCHAR CkipFlag;
- UCHAR AironetCellPowerLimit;
- EDCA_PARM EdcaParm;
- QBSS_LOAD_PARM QbssLoad;
- QOS_CAPABILITY_PARM QosCapability;
- ULONG RalinkIe;
- UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
- NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
- UCHAR AddHtInfoLen;
- UCHAR NewExtChannelOffset = 0xff;
-
-
- // NdisFillMemory(Ssid, MAX_LEN_OF_SSID, 0x00);
- pFrame = (PFRAME_802_11) Elem->Msg;
- // Init Variable IE structure
- pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
- pVIE->Length = 0;
-#ifdef DOT11_N_SUPPORT
- RTMPZeroMemory(&HtCapability, sizeof(HtCapability));
- RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE));
-#endif // DOT11_N_SUPPORT //
-
- if (PeerBeaconAndProbeRspSanity(pAd,
- Elem->Msg,
- Elem->MsgLen,
- Elem->Channel,
- Addr2,
- Bssid,
- (PCHAR)Ssid,
- &SsidLen,
- &BssType,
- &BeaconPeriod,
- &Channel,
- &NewChannel,
- &TimeStamp,
- &CfParm,
- &AtimWin,
- &CapabilityInfo,
- &Erp,
- &DtimCount,
- &DtimPeriod,
- &BcastFlag,
- &MessageToMe,
- SupRate,
- &SupRateLen,
- ExtRate,
- &ExtRateLen,
- &CkipFlag,
- &AironetCellPowerLimit,
- &EdcaParm,
- &QbssLoad,
- &QosCapability,
- &RalinkIe,
- &HtCapabilityLen,
- &PreNHtCapabilityLen,
- &HtCapability,
- &AddHtInfoLen,
- &AddHtInfo,
- &NewExtChannelOffset,
- &LenVIE,
- pVIE))
- {
- ULONG Idx;
- CHAR Rssi = 0;
-
- Idx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
- if (Idx != BSS_NOT_FOUND)
- Rssi = pAd->ScanTab.BssEntry[Idx].Rssi;
-
- Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
-
-
-#ifdef DOT11_N_SUPPORT
- if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0))
- HtCapabilityLen = SIZE_HT_CAP_IE;
-#endif // DOT11_N_SUPPORT //
-
- Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (PCHAR)Ssid, SsidLen, BssType, BeaconPeriod,
- &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
- &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
- &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
- if (pAd->ChannelList[pAd->CommonCfg.ChannelListIdx].bEffectedChannel == TRUE)
- {
- UCHAR RegClass;
- PeerBeaconAndProbeRspSanity2(pAd, Elem->Msg, Elem->MsgLen, &RegClass);
- TriEventTableSetEntry(pAd, &pAd->CommonCfg.TriggerEventTab, Bssid, &HtCapability, HtCapabilityLen, RegClass, Channel);
- }
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
- if (Idx != BSS_NOT_FOUND)
- {
- NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
- }
-
- }
- // sanity check fail, ignored
-}
-
-/*
- ==========================================================================
- Description:
- When waiting joining the (I)BSS, beacon received from external
- ==========================================================================
- */
-VOID PeerBeaconAtJoinAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
- UCHAR Ssid[MAX_LEN_OF_SSID], SsidLen, BssType, Channel, MessageToMe,
- DtimCount, DtimPeriod, BcastFlag, NewChannel;
- LARGE_INTEGER TimeStamp;
- USHORT BeaconPeriod, AtimWin, CapabilityInfo;
- CF_PARM Cf;
- BOOLEAN TimerCancelled;
- UCHAR Erp;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen, ExtRateLen;
- UCHAR CkipFlag;
- USHORT LenVIE;
- UCHAR AironetCellPowerLimit;
- EDCA_PARM EdcaParm;
- QBSS_LOAD_PARM QbssLoad;
- QOS_CAPABILITY_PARM QosCapability;
- USHORT Status;
- UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
- NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
- ULONG RalinkIe;
- ULONG Idx;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen = 0, PreNHtCapabilityLen = 0;
- UCHAR AddHtInfoLen;
- UCHAR NewExtChannelOffset = 0xff;
-#ifdef DOT11_N_SUPPORT
- UCHAR CentralChannel;
- BOOLEAN bAllowNrate = FALSE;
-#endif // DOT11_N_SUPPORT //
-
- // Init Variable IE structure
- pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
- pVIE->Length = 0;
- RTMPZeroMemory(&HtCapability, sizeof(HtCapability));
- RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE));
-
-
- if (PeerBeaconAndProbeRspSanity(pAd,
- Elem->Msg,
- Elem->MsgLen,
- Elem->Channel,
- Addr2,
- Bssid,
- (PCHAR)Ssid,
- &SsidLen,
- &BssType,
- &BeaconPeriod,
- &Channel,
- &NewChannel,
- &TimeStamp,
- &Cf,
- &AtimWin,
- &CapabilityInfo,
- &Erp,
- &DtimCount,
- &DtimPeriod,
- &BcastFlag,
- &MessageToMe,
- SupRate,
- &SupRateLen,
- ExtRate,
- &ExtRateLen,
- &CkipFlag,
- &AironetCellPowerLimit,
- &EdcaParm,
- &QbssLoad,
- &QosCapability,
- &RalinkIe,
- &HtCapabilityLen,
- &PreNHtCapabilityLen,
- &HtCapability,
- &AddHtInfoLen,
- &AddHtInfo,
- &NewExtChannelOffset,
- &LenVIE,
- pVIE))
- {
- // Disqualify 11b only adhoc when we are in 11g only adhoc mode
- if ((BssType == BSS_ADHOC) && (pAd->CommonCfg.PhyMode == PHY_11G) && ((SupRateLen+ExtRateLen)< 12))
- return;
-
- // BEACON from desired BSS/IBSS found. We should be able to decide most
- // BSS parameters here.
- // Q. But what happen if this JOIN doesn't conclude a successful ASSOCIATEION?
- // Do we need to receover back all parameters belonging to previous BSS?
- // A. Should be not. There's no back-door recover to previous AP. It still need
- // a new JOIN-AUTH-ASSOC sequence.
- if (MAC_ADDR_EQUAL(pAd->MlmeAux.Bssid, Bssid))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - receive desired BEACON at JoinWaitBeacon... Channel = %d\n", Channel));
- RTMPCancelTimer(&pAd->MlmeAux.BeaconTimer, &TimerCancelled);
-
- // Update RSSI to prevent No signal display when cards first initialized
- pAd->StaCfg.RssiSample.LastRssi0 = ConvertToRssi(pAd, Elem->Rssi0, RSSI_0);
- pAd->StaCfg.RssiSample.LastRssi1 = ConvertToRssi(pAd, Elem->Rssi1, RSSI_1);
- pAd->StaCfg.RssiSample.LastRssi2 = ConvertToRssi(pAd, Elem->Rssi2, RSSI_2);
- pAd->StaCfg.RssiSample.AvgRssi0 = pAd->StaCfg.RssiSample.LastRssi0;
- pAd->StaCfg.RssiSample.AvgRssi0X8 = pAd->StaCfg.RssiSample.AvgRssi0 << 3;
- pAd->StaCfg.RssiSample.AvgRssi1 = pAd->StaCfg.RssiSample.LastRssi1;
- pAd->StaCfg.RssiSample.AvgRssi1X8 = pAd->StaCfg.RssiSample.AvgRssi1 << 3;
- pAd->StaCfg.RssiSample.AvgRssi2 = pAd->StaCfg.RssiSample.LastRssi2;
- pAd->StaCfg.RssiSample.AvgRssi2X8 = pAd->StaCfg.RssiSample.AvgRssi2 << 3;
-
- //
- // We need to check if SSID only set to any, then we can record the current SSID.
- // Otherwise will cause hidden SSID association failed.
- //
- if (pAd->MlmeAux.SsidLen == 0)
- {
- NdisMoveMemory(pAd->MlmeAux.Ssid, Ssid, SsidLen);
- pAd->MlmeAux.SsidLen = SsidLen;
- }
- else
- {
- Idx = BssSsidTableSearch(&pAd->ScanTab, Bssid, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, Channel);
-
- if (Idx == BSS_NOT_FOUND)
- {
- CHAR Rssi = 0;
- Rssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
- Idx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, (CHAR *) Ssid, SsidLen, BssType, BeaconPeriod,
- &Cf, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
- &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, Rssi, TimeStamp, CkipFlag,
- &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
- if (Idx != BSS_NOT_FOUND)
- {
- NdisMoveMemory(pAd->ScanTab.BssEntry[Idx].PTSF, &Elem->Msg[24], 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Idx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
- CapabilityInfo = pAd->ScanTab.BssEntry[Idx].CapabilityInfo;
- }
- }
- else
- {
- //
- // Multiple SSID case, used correct CapabilityInfo
- //
- CapabilityInfo = pAd->ScanTab.BssEntry[Idx].CapabilityInfo;
- }
- }
- NdisMoveMemory(pAd->MlmeAux.Bssid, Bssid, MAC_ADDR_LEN);
- pAd->MlmeAux.CapabilityInfo = CapabilityInfo & SUPPORTED_CAPABILITY_INFO;
- pAd->MlmeAux.BssType = BssType;
- pAd->MlmeAux.BeaconPeriod = BeaconPeriod;
- pAd->MlmeAux.Channel = Channel;
- pAd->MlmeAux.AtimWin = AtimWin;
- pAd->MlmeAux.CfpPeriod = Cf.CfpPeriod;
- pAd->MlmeAux.CfpMaxDuration = Cf.CfpMaxDuration;
- pAd->MlmeAux.APRalinkIe = RalinkIe;
-
- // Copy AP's supported rate to MlmeAux for creating assoication request
- // Also filter out not supported rate
- pAd->MlmeAux.SupRateLen = SupRateLen;
- NdisMoveMemory(pAd->MlmeAux.SupRate, SupRate, SupRateLen);
- RTMPCheckRates(pAd, pAd->MlmeAux.SupRate, &pAd->MlmeAux.SupRateLen);
- pAd->MlmeAux.ExtRateLen = ExtRateLen;
- NdisMoveMemory(pAd->MlmeAux.ExtRate, ExtRate, ExtRateLen);
- RTMPCheckRates(pAd, pAd->MlmeAux.ExtRate, &pAd->MlmeAux.ExtRateLen);
-
- NdisZeroMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, 16);
-
-
-#ifdef DOT11_N_SUPPORT
- if (((pAd->StaCfg.WepStatus != Ndis802_11WEPEnabled) && (pAd->StaCfg.WepStatus != Ndis802_11Encryption2Enabled))
- || (pAd->CommonCfg.HT_DisallowTKIP == FALSE))
- {
- bAllowNrate = TRUE;
- }
-
- pAd->MlmeAux.NewExtChannelOffset = NewExtChannelOffset;
- pAd->MlmeAux.HtCapabilityLen = HtCapabilityLen;
-
- RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
- // filter out un-supported ht rates
- if (((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0)) &&
- ((pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED) && (bAllowNrate)))
- {
- RTMPMoveMemory(&pAd->MlmeAux.AddHtInfo, &AddHtInfo, SIZE_ADD_HT_INFO_IE);
-
- // StaActive.SupportedHtPhy.MCSSet stores Peer AP's 11n Rx capability
- NdisMoveMemory(pAd->StaActive.SupportedPhyInfo.MCSSet, HtCapability.MCSSet, 16);
- pAd->MlmeAux.NewExtChannelOffset = NewExtChannelOffset;
- pAd->MlmeAux.HtCapabilityLen = SIZE_HT_CAP_IE;
- pAd->StaActive.SupportedPhyInfo.bHtEnable = TRUE;
- if (PreNHtCapabilityLen > 0)
- pAd->StaActive.SupportedPhyInfo.bPreNHt = TRUE;
- RTMPCheckHt(pAd, BSSID_WCID, &HtCapability, &AddHtInfo);
- // Copy AP Parameter to StaActive. This is also in LinkUp.
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAtJoinAction! (MpduDensity=%d, MaxRAmpduFactor=%d, BW=%d)\n",
- pAd->StaActive.SupportedHtPhy.MpduDensity, pAd->StaActive.SupportedHtPhy.MaxRAmpduFactor, HtCapability.HtCapInfo.ChannelWidth));
-
- if (AddHtInfoLen > 0)
- {
- CentralChannel = AddHtInfo.ControlChan;
- // Check again the Bandwidth capability of this AP.
- if ((AddHtInfo.ControlChan > 2)&& (AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_BELOW) && (HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- CentralChannel = AddHtInfo.ControlChan - 2;
- }
- else if ((AddHtInfo.AddHtInfo.ExtChanOffset == EXTCHA_ABOVE) && (HtCapability.HtCapInfo.ChannelWidth == BW_40))
- {
- CentralChannel = AddHtInfo.ControlChan + 2;
- }
-
- // Check Error .
- if (pAd->MlmeAux.CentralChannel != CentralChannel)
- DBGPRINT(RT_DEBUG_ERROR, ("PeerBeaconAtJoinAction HT===>Beacon Central Channel = %d, Control Channel = %d. Mlmeaux CentralChannel = %d\n", CentralChannel, AddHtInfo.ControlChan, pAd->MlmeAux.CentralChannel));
-
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeaconAtJoinAction HT===>Central Channel = %d, Control Channel = %d, .\n", CentralChannel, AddHtInfo.ControlChan));
-
- }
-
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- // To prevent error, let legacy AP must have same CentralChannel and Channel.
- if ((HtCapabilityLen == 0) && (PreNHtCapabilityLen == 0))
- pAd->MlmeAux.CentralChannel = pAd->MlmeAux.Channel;
-
- pAd->StaActive.SupportedPhyInfo.bHtEnable = FALSE;
- pAd->MlmeAux.NewExtChannelOffset = 0xff;
- RTMPZeroMemory(&pAd->MlmeAux.HtCapability, SIZE_HT_CAP_IE);
- pAd->MlmeAux.HtCapabilityLen = 0;
- RTMPZeroMemory(&pAd->MlmeAux.AddHtInfo, SIZE_ADD_HT_INFO_IE);
- }
-
- RTMPUpdateMlmeRate(pAd);
-
- // copy QOS related information
- if ((pAd->CommonCfg.bWmmCapable)
-#ifdef DOT11_N_SUPPORT
- || (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
-#endif // DOT11_N_SUPPORT //
- )
- {
- NdisMoveMemory(&pAd->MlmeAux.APEdcaParm, &EdcaParm, sizeof(EDCA_PARM));
- NdisMoveMemory(&pAd->MlmeAux.APQbssLoad, &QbssLoad, sizeof(QBSS_LOAD_PARM));
- NdisMoveMemory(&pAd->MlmeAux.APQosCapability, &QosCapability, sizeof(QOS_CAPABILITY_PARM));
- }
- else
- {
- NdisZeroMemory(&pAd->MlmeAux.APEdcaParm, sizeof(EDCA_PARM));
- NdisZeroMemory(&pAd->MlmeAux.APQbssLoad, sizeof(QBSS_LOAD_PARM));
- NdisZeroMemory(&pAd->MlmeAux.APQosCapability, sizeof(QOS_CAPABILITY_PARM));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - after JOIN, SupRateLen=%d, ExtRateLen=%d\n",
- pAd->MlmeAux.SupRateLen, pAd->MlmeAux.ExtRateLen));
-
- if (AironetCellPowerLimit != 0xFF)
- {
- //We need to change our TxPower for CCX 2.0 AP Control of Client Transmit Power
- ChangeToCellPowerLimit(pAd, AironetCellPowerLimit);
- }
- else //Used the default TX Power Percentage.
- pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
-
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_SUCCESS;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status);
- }
- // not to me BEACON, ignored
- }
- // sanity check fail, ignore this frame
-}
-
-/*
- ==========================================================================
- Description:
- receive BEACON from peer
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID PeerBeacon(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Bssid[MAC_ADDR_LEN], Addr2[MAC_ADDR_LEN];
- CHAR Ssid[MAX_LEN_OF_SSID];
- CF_PARM CfParm;
- UCHAR SsidLen, MessageToMe=0, BssType, Channel, NewChannel, index=0;
- UCHAR DtimCount=0, DtimPeriod=0, BcastFlag=0;
- USHORT CapabilityInfo, AtimWin, BeaconPeriod;
- LARGE_INTEGER TimeStamp;
- USHORT TbttNumToNextWakeUp;
- UCHAR Erp;
- UCHAR SupRate[MAX_LEN_OF_SUPPORTED_RATES], ExtRate[MAX_LEN_OF_SUPPORTED_RATES];
- UCHAR SupRateLen, ExtRateLen;
- UCHAR CkipFlag;
- USHORT LenVIE;
- UCHAR AironetCellPowerLimit;
- EDCA_PARM EdcaParm;
- QBSS_LOAD_PARM QbssLoad;
- QOS_CAPABILITY_PARM QosCapability;
- ULONG RalinkIe;
- // New for WPA security suites
- UCHAR VarIE[MAX_VIE_LEN]; // Total VIE length = MAX_VIE_LEN - -5
- NDIS_802_11_VARIABLE_IEs *pVIE = NULL;
- HT_CAPABILITY_IE HtCapability;
- ADD_HT_INFO_IE AddHtInfo; // AP might use this additional ht info IE
- UCHAR HtCapabilityLen, PreNHtCapabilityLen;
- UCHAR AddHtInfoLen;
- UCHAR NewExtChannelOffset = 0xff;
-
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- return;
- }
-#endif // RALINK_ATE //
-
- if (!(INFRA_ON(pAd) || ADHOC_ON(pAd)
- ))
- return;
-
- // Init Variable IE structure
- pVIE = (PNDIS_802_11_VARIABLE_IEs) VarIE;
- pVIE->Length = 0;
- RTMPZeroMemory(&HtCapability, sizeof(HtCapability));
- RTMPZeroMemory(&AddHtInfo, sizeof(ADD_HT_INFO_IE));
-
- if (PeerBeaconAndProbeRspSanity(pAd,
- Elem->Msg,
- Elem->MsgLen,
- Elem->Channel,
- Addr2,
- Bssid,
- Ssid,
- &SsidLen,
- &BssType,
- &BeaconPeriod,
- &Channel,
- &NewChannel,
- &TimeStamp,
- &CfParm,
- &AtimWin,
- &CapabilityInfo,
- &Erp,
- &DtimCount,
- &DtimPeriod,
- &BcastFlag,
- &MessageToMe,
- SupRate,
- &SupRateLen,
- ExtRate,
- &ExtRateLen,
- &CkipFlag,
- &AironetCellPowerLimit,
- &EdcaParm,
- &QbssLoad,
- &QosCapability,
- &RalinkIe,
- &HtCapabilityLen,
- &PreNHtCapabilityLen,
- &HtCapability,
- &AddHtInfoLen,
- &AddHtInfo,
- &NewExtChannelOffset,
- &LenVIE,
- pVIE))
- {
- BOOLEAN is_my_bssid, is_my_ssid;
- ULONG Bssidx, Now;
- BSS_ENTRY *pBss;
- CHAR RealRssi = RTMPMaxRssi(pAd, ConvertToRssi(pAd, Elem->Rssi0, RSSI_0), ConvertToRssi(pAd, Elem->Rssi1, RSSI_1), ConvertToRssi(pAd, Elem->Rssi2, RSSI_2));
-
- is_my_bssid = MAC_ADDR_EQUAL(Bssid, pAd->CommonCfg.Bssid)? TRUE : FALSE;
- is_my_ssid = SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen)? TRUE:FALSE;
-
-
- // ignore BEACON not for my SSID
- if ((! is_my_ssid) && (! is_my_bssid))
- return;
-
- // It means STA waits disassoc completely from this AP, ignores this beacon.
- if (pAd->Mlme.CntlMachine.CurrState == CNTL_WAIT_DISASSOC)
- return;
-
-#ifdef DOT11_N_SUPPORT
- // Copy Control channel for this BSSID.
- if (AddHtInfoLen != 0)
- Channel = AddHtInfo.ControlChan;
-
- if ((HtCapabilityLen > 0) || (PreNHtCapabilityLen > 0))
- HtCapabilityLen = SIZE_HT_CAP_IE;
-#endif // DOT11_N_SUPPORT //
-
- //
- // Housekeeping "SsidBssTab" table for later-on ROAMing usage.
- //
- Bssidx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
- if (Bssidx == BSS_NOT_FOUND)
- {
- // discover new AP of this network, create BSS entry
- Bssidx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod,
- &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen,
- &HtCapability, &AddHtInfo,HtCapabilityLen,AddHtInfoLen,NewExtChannelOffset, Channel,
- RealRssi, TimeStamp, CkipFlag, &EdcaParm, &QosCapability,
- &QbssLoad, LenVIE, pVIE);
- if (Bssidx == BSS_NOT_FOUND) // return if BSS table full
- return;
-
- NdisMoveMemory(pAd->ScanTab.BssEntry[Bssidx].PTSF, &Elem->Msg[24], 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Bssidx].TTSF[0], &Elem->TimeStamp.u.LowPart, 4);
- NdisMoveMemory(&pAd->ScanTab.BssEntry[Bssidx].TTSF[4], &Elem->TimeStamp.u.LowPart, 4);
-
-
-
- }
-
- if ((pAd->CommonCfg.bIEEE80211H == 1) && (NewChannel != 0) && (Channel != NewChannel))
- {
- // Switching to channel 1 can prevent from rescanning the current channel immediately (by auto reconnection).
- // In addition, clear the MLME queue and the scan table to discard the RX packets and previous scanning results.
- AsicSwitchChannel(pAd, 1, FALSE);
- AsicLockChannel(pAd, 1);
- LinkDown(pAd, FALSE);
- MlmeQueueInit(&pAd->Mlme.Queue);
- BssTableInit(&pAd->ScanTab);
- RTMPusecDelay(1000000); // use delay to prevent STA do reassoc
-
- // channel sanity check
- for (index = 0 ; index < pAd->ChannelListNum; index++)
- {
- if (pAd->ChannelList[index].Channel == NewChannel)
- {
- pAd->ScanTab.BssEntry[Bssidx].Channel = NewChannel;
- pAd->CommonCfg.Channel = NewChannel;
- AsicSwitchChannel(pAd, pAd->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAd, pAd->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("PeerBeacon - STA receive channel switch announcement IE (New Channel =%d)\n", NewChannel));
- break;
- }
- }
-
- if (index >= pAd->ChannelListNum)
- {
- DBGPRINT_ERR(("PeerBeacon(can not find New Channel=%d in ChannelList[%d]\n", pAd->CommonCfg.Channel, pAd->ChannelListNum));
- }
- }
-
- // if the ssid matched & bssid unmatched, we should select the bssid with large value.
- // This might happened when two STA start at the same time
- if ((! is_my_bssid) && ADHOC_ON(pAd))
- {
- INT i;
-
- // Add the safeguard against the mismatch of adhoc wep status
- if (pAd->StaCfg.WepStatus != pAd->ScanTab.BssEntry[Bssidx].WepStatus)
- {
- return;
- }
-
- // collapse into the ADHOC network which has bigger BSSID value.
- for (i = 0; i < 6; i++)
- {
- if (Bssid[i] > pAd->CommonCfg.Bssid[i])
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - merge to the IBSS with bigger BSSID=%02x:%02x:%02x:%02x:%02x:%02x\n",
- Bssid[0], Bssid[1], Bssid[2], Bssid[3], Bssid[4], Bssid[5]));
- AsicDisableSync(pAd);
- COPY_MAC_ADDR(pAd->CommonCfg.Bssid, Bssid);
- AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy BEACON frame to on-chip memory
- is_my_bssid = TRUE;
- break;
- }
- else if (Bssid[i] < pAd->CommonCfg.Bssid[i])
- break;
- }
- }
-
-
- NdisGetSystemUpTime(&Now);
- pBss = &pAd->ScanTab.BssEntry[Bssidx];
- pBss->Rssi = RealRssi; // lastest RSSI
- pBss->LastBeaconRxTime = Now; // last RX timestamp
-
- //
- // BEACON from my BSSID - either IBSS or INFRA network
- //
- if (is_my_bssid)
- {
- RXWI_STRUC RxWI;
-
- pAd->StaCfg.DtimCount = DtimCount;
- pAd->StaCfg.DtimPeriod = DtimPeriod;
- pAd->StaCfg.LastBeaconRxTime = Now;
-
-
- RxWI.RSSI0 = Elem->Rssi0;
- RxWI.RSSI1 = Elem->Rssi1;
- RxWI.RSSI2 = Elem->Rssi2;
-
- Update_Rssi_Sample(pAd, &pAd->StaCfg.RssiSample, &RxWI);
- if (AironetCellPowerLimit != 0xFF)
- {
- //
- // We get the Cisco (ccx) "TxPower Limit" required
- // Changed to appropriate TxPower Limit for Ciso Compatible Extensions
- //
- ChangeToCellPowerLimit(pAd, AironetCellPowerLimit);
- }
- else
- {
- //
- // AironetCellPowerLimit equal to 0xFF means the Cisco (ccx) "TxPower Limit" not exist.
- // Used the default TX Power Percentage, that set from UI.
- //
- pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
- }
-
- if (ADHOC_ON(pAd) && (CAP_IS_IBSS_ON(CapabilityInfo)))
- {
- UCHAR MaxSupportedRateIn500Kbps = 0;
- UCHAR idx;
- MAC_TABLE_ENTRY *pEntry;
-
- // supported rates array may not be sorted. sort it and find the maximum rate
- for (idx=0; idx<SupRateLen; idx++)
- {
- if (MaxSupportedRateIn500Kbps < (SupRate[idx] & 0x7f))
- MaxSupportedRateIn500Kbps = SupRate[idx] & 0x7f;
- }
-
- for (idx=0; idx<ExtRateLen; idx++)
- {
- if (MaxSupportedRateIn500Kbps < (ExtRate[idx] & 0x7f))
- MaxSupportedRateIn500Kbps = ExtRate[idx] & 0x7f;
- }
-
- // look up the existing table
- pEntry = MacTableLookup(pAd, Addr2);
-
- // Ad-hoc mode is using MAC address as BA session. So we need to continuously find newly joined adhoc station by receiving beacon.
- // To prevent always check this, we use wcid == RESERVED_WCID to recognize it as newly joined adhoc station.
- if ((ADHOC_ON(pAd) && (Elem->Wcid == RESERVED_WCID)) ||
- (pEntry && ((pEntry->LastBeaconRxTime + ADHOC_ENTRY_BEACON_LOST_TIME) < Now)))
- {
- if (pEntry == NULL)
- // Another adhoc joining, add to our MAC table.
- pEntry = MacTableInsertEntry(pAd, Addr2, BSS0, FALSE);
-
- if (StaAddMacTableEntry(pAd,
- pEntry,
- MaxSupportedRateIn500Kbps,
- &HtCapability,
- HtCapabilityLen,
- &AddHtInfo,
- AddHtInfoLen,
- CapabilityInfo) == FALSE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("ADHOC - Add Entry failed.\n"));
- return;
- }
-
- if (pEntry &&
- (Elem->Wcid == RESERVED_WCID))
- {
- idx = pAd->StaCfg.DefaultKeyId;
- RTMP_STA_SECURITY_INFO_ADD(pAd, BSS0, idx, pEntry);
- }
- }
-
- if (pEntry && pEntry->ValidAsCLI)
- pEntry->LastBeaconRxTime = Now;
-
- // At least another peer in this IBSS, declare MediaState as CONNECTED
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED);
-
- pAd->IndicateMediaState = NdisMediaStateConnected;
- RTMP_IndicateMediaState(pAd);
- pAd->ExtraInfo = GENERAL_LINK_UP;
- AsicSetBssid(pAd, pAd->CommonCfg.Bssid);
-
- // 2003/03/12 - john
- // Make sure this entry in "ScanTab" table, thus complies to Microsoft's policy that
- // "site survey" result should always include the current connected network.
- //
- Bssidx = BssTableSearch(&pAd->ScanTab, Bssid, Channel);
- if (Bssidx == BSS_NOT_FOUND)
- {
- Bssidx = BssTableSetEntry(pAd, &pAd->ScanTab, Bssid, Ssid, SsidLen, BssType, BeaconPeriod,
- &CfParm, AtimWin, CapabilityInfo, SupRate, SupRateLen, ExtRate, ExtRateLen, &HtCapability,
- &AddHtInfo, HtCapabilityLen, AddHtInfoLen, NewExtChannelOffset, Channel, RealRssi, TimeStamp, 0,
- &EdcaParm, &QosCapability, &QbssLoad, LenVIE, pVIE);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("ADHOC fOP_STATUS_MEDIA_STATE_CONNECTED.\n"));
- }
- }
-
- if (INFRA_ON(pAd))
- {
- BOOLEAN bUseShortSlot, bUseBGProtection;
-
- // decide to use/change to -
- // 1. long slot (20 us) or short slot (9 us) time
- // 2. turn on/off RTS/CTS and/or CTS-to-self protection
- // 3. short preamble
-
- //bUseShortSlot = pAd->CommonCfg.bUseShortSlotTime && CAP_IS_SHORT_SLOT(CapabilityInfo);
- bUseShortSlot = CAP_IS_SHORT_SLOT(CapabilityInfo);
- if (bUseShortSlot != OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_SLOT_INUSED))
- AsicSetSlotTime(pAd, bUseShortSlot);
-
- bUseBGProtection = (pAd->CommonCfg.UseBGProtection == 1) || // always use
- ((pAd->CommonCfg.UseBGProtection == 0) && ERP_IS_USE_PROTECTION(Erp));
-
- if (pAd->CommonCfg.Channel > 14) // always no BG protection in A-band. falsely happened when switching A/G band to a dual-band AP
- bUseBGProtection = FALSE;
-
- if (bUseBGProtection != OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED))
- {
- if (bUseBGProtection)
- {
- OPSTATUS_SET_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED);
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, (OFDMSETPROTECT|CCKSETPROTECT|ALLN_SETPROTECT),FALSE,(pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1));
- }
- else
- {
- OPSTATUS_CLEAR_FLAG(pAd, fOP_STATUS_BG_PROTECTION_INUSED);
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, (OFDMSETPROTECT|CCKSETPROTECT|ALLN_SETPROTECT),TRUE,(pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1));
- }
-
- DBGPRINT(RT_DEBUG_WARN, ("SYNC - AP changed B/G protection to %d\n", bUseBGProtection));
- }
-
-#ifdef DOT11_N_SUPPORT
- // check Ht protection mode. and adhere to the Non-GF device indication by AP.
- if ((AddHtInfoLen != 0) &&
- ((AddHtInfo.AddHtInfo2.OperaionMode != pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode) ||
- (AddHtInfo.AddHtInfo2.NonGfPresent != pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent)))
- {
- pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent = AddHtInfo.AddHtInfo2.NonGfPresent;
- pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode = AddHtInfo.AddHtInfo2.OperaionMode;
- if (pAd->MlmeAux.AddHtInfo.AddHtInfo2.NonGfPresent == 1)
- {
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, TRUE);
- }
- else
- AsicUpdateProtect(pAd, pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode, ALLN_SETPROTECT, FALSE, FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP changed N OperaionMode to %d\n", pAd->MlmeAux.AddHtInfo.AddHtInfo2.OperaionMode));
- }
-#endif // DOT11_N_SUPPORT //
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_SHORT_PREAMBLE_INUSED) &&
- ERP_IS_USE_BARKER_PREAMBLE(Erp))
- {
- MlmeSetTxPreamble(pAd, Rt802_11PreambleLong);
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP forced to use LONG preamble\n"));
- }
-
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_WMM_INUSED) &&
- (EdcaParm.bValid == TRUE) &&
- (EdcaParm.EdcaUpdateCount != pAd->CommonCfg.APEdcaParm.EdcaUpdateCount))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - AP change EDCA parameters(from %d to %d)\n",
- pAd->CommonCfg.APEdcaParm.EdcaUpdateCount,
- EdcaParm.EdcaUpdateCount));
- AsicSetEdcaParm(pAd, &EdcaParm);
- }
-
- // copy QOS related information
- NdisMoveMemory(&pAd->CommonCfg.APQbssLoad, &QbssLoad, sizeof(QBSS_LOAD_PARM));
- NdisMoveMemory(&pAd->CommonCfg.APQosCapability, &QosCapability, sizeof(QOS_CAPABILITY_PARM));
- }
-
- // only INFRASTRUCTURE mode support power-saving feature
- if ((INFRA_ON(pAd) && (pAd->StaCfg.Psm == PWR_SAVE)) || (pAd->CommonCfg.bAPSDForcePowerSave))
- {
- UCHAR FreeNumber;
- // 1. AP has backlogged unicast-to-me frame, stay AWAKE, send PSPOLL
- // 2. AP has backlogged broadcast/multicast frame and we want those frames, stay AWAKE
- // 3. we have outgoing frames in TxRing or MgmtRing, better stay AWAKE
- // 4. Psm change to PWR_SAVE, but AP not been informed yet, we better stay AWAKE
- // 5. otherwise, put PHY back to sleep to save battery.
- if (MessageToMe)
- {
-#ifdef RTMP_MAC_PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- // Restore to correct BBP R3 value
- if (pAd->Antenna.field.RxPath > 1)
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
- // Turn clk to 80Mhz.
- }
-#endif // RTMP_MAC_PCI //
- if (pAd->CommonCfg.bAPSDCapable && pAd->CommonCfg.APEdcaParm.bAPSDCapable &&
- pAd->CommonCfg.bAPSDAC_BE && pAd->CommonCfg.bAPSDAC_BK && pAd->CommonCfg.bAPSDAC_VI && pAd->CommonCfg.bAPSDAC_VO)
- {
- pAd->CommonCfg.bNeedSendTriggerFrame = TRUE;
- }
- else
- RTMP_PS_POLL_ENQUEUE(pAd);
- }
- else if (BcastFlag && (DtimCount == 0) && OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM))
- {
-#ifdef RTMP_MAC_PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- if (pAd->Antenna.field.RxPath > 1)
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
- }
-#endif // RTMP_MAC_PCI //
- }
- else if ((pAd->TxSwQueue[QID_AC_BK].Number != 0) ||
- (pAd->TxSwQueue[QID_AC_BE].Number != 0) ||
- (pAd->TxSwQueue[QID_AC_VI].Number != 0) ||
- (pAd->TxSwQueue[QID_AC_VO].Number != 0) ||
- (RTMPFreeTXDRequest(pAd, QID_AC_BK, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) ||
- (RTMPFreeTXDRequest(pAd, QID_AC_BE, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) ||
- (RTMPFreeTXDRequest(pAd, QID_AC_VI, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) ||
- (RTMPFreeTXDRequest(pAd, QID_AC_VO, TX_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS) ||
- (RTMPFreeTXDRequest(pAd, QID_MGMT, MGMT_RING_SIZE - 1, &FreeNumber) != NDIS_STATUS_SUCCESS))
- {
- // TODO: consider scheduled HCCA. might not be proper to use traditional DTIM-based power-saving scheme
- // can we cheat here (i.e. just check MGMT & AC_BE) for better performance?
-#ifdef RTMP_MAC_PCI
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE))
- {
- if (pAd->Antenna.field.RxPath > 1)
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAd, BBP_R3, pAd->StaCfg.BBPR3);
- }
-#endif // RTMP_MAC_PCI //
- }
- else
- {
- if ((pAd->CommonCfg.bACMAPSDTr[QID_AC_VO]) ||
- (pAd->CommonCfg.bACMAPSDTr[QID_AC_VI]) ||
- (pAd->CommonCfg.bACMAPSDTr[QID_AC_BK]) ||
- (pAd->CommonCfg.bACMAPSDTr[QID_AC_BE]))
- {
- /*
- WMM Spec v1.0 3.6.2.4,
- The WMM STA shall remain awake until it receives a
- QoS Data or Null frame addressed to it, with the
- EOSP subfield in QoS Control field set to 1.
-
- So we can not sleep here or we will suffer a case:
-
- PS Management Frame -->
- Trigger frame -->
- Beacon (TIM=0) (Beacon is closer to Trig frame) -->
- Station goes to sleep -->
- AP delivery queued UAPSD packets -->
- Station can NOT receive the reply
-
- Maybe we need a timeout timer to avoid that we do
- NOT receive the EOSP frame.
-
- We can not use More Data to check if SP is ended
- due to MaxSPLength.
- */
- }
- else
- {
- USHORT NextDtim = DtimCount;
-
-
- if (NextDtim == 0)
- NextDtim = DtimPeriod;
-
- TbttNumToNextWakeUp = pAd->StaCfg.DefaultListenCount;
- if (OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_RECEIVE_DTIM) && (TbttNumToNextWakeUp > NextDtim))
- TbttNumToNextWakeUp = NextDtim;
-
- if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_DOZE))
- {
- // Set a flag to go to sleep . Then after parse this RxDoneInterrupt, will go to sleep mode.
- pAd->ThisTbttNumToNextWakeUp = TbttNumToNextWakeUp;
- AsicSleepThenAutoWakeup(pAd, pAd->ThisTbttNumToNextWakeUp);
-
- }
- }
- }
- }
- }
- // not my BSSID, ignore it
- }
- // sanity check fail, ignore this frame
-}
-
-/*
- ==========================================================================
- Description:
- Receive PROBE REQ from remote peer when operating in IBSS mode
- ==========================================================================
- */
-VOID PeerProbeReqAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- UCHAR Addr2[MAC_ADDR_LEN];
- CHAR Ssid[MAX_LEN_OF_SSID];
- UCHAR SsidLen;
-#ifdef DOT11_N_SUPPORT
- UCHAR HtLen, AddHtLen, NewExtLen;
-#endif // DOT11_N_SUPPORT //
- HEADER_802_11 ProbeRspHdr;
- NDIS_STATUS NStatus;
- PUCHAR pOutBuffer = NULL;
- ULONG FrameLen = 0;
- LARGE_INTEGER FakeTimestamp;
- UCHAR DsLen = 1, IbssLen = 2;
- UCHAR LocalErpIe[3] = {IE_ERP, 1, 0};
- BOOLEAN Privacy;
- USHORT CapabilityInfo;
- UCHAR RSNIe = IE_WPA;
-
- if (! ADHOC_ON(pAd))
- return;
-
- if (PeerProbeReqSanity(pAd, Elem->Msg, Elem->MsgLen, Addr2, Ssid, &SsidLen))
- {
- if ((SsidLen == 0) || SSID_EQUAL(Ssid, SsidLen, pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen))
- {
- // allocate and send out ProbeRsp frame
- NStatus = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NStatus != NDIS_STATUS_SUCCESS)
- return;
-
- //pAd->StaCfg.AtimWin = 0; // ??????
-
- Privacy = (pAd->StaCfg.WepStatus == Ndis802_11Encryption1Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled);
- CapabilityInfo = CAP_GENERATE(0, 1, Privacy, (pAd->CommonCfg.TxPreamble == Rt802_11PreambleShort), 0, 0);
-
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &ProbeRspHdr,
- TIMESTAMP_LEN, &FakeTimestamp,
- 2, &pAd->CommonCfg.BeaconPeriod,
- 2, &CapabilityInfo,
- 1, &SsidIe,
- 1, &pAd->CommonCfg.SsidLen,
- pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid,
- 1, &SupRateIe,
- 1, &pAd->StaActive.SupRateLen,
- pAd->StaActive.SupRateLen, pAd->StaActive.SupRate,
- 1, &DsIe,
- 1, &DsLen,
- 1, &pAd->CommonCfg.Channel,
- 1, &IbssIe,
- 1, &IbssLen,
- 2, &pAd->StaActive.AtimWin,
- END_OF_ARGS);
-
- if (pAd->StaActive.ExtRateLen)
- {
- ULONG tmp;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 3, LocalErpIe,
- 1, &ExtRateIe,
- 1, &pAd->StaActive.ExtRateLen,
- pAd->StaActive.ExtRateLen, &pAd->StaActive.ExtRate,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-
- // If adhoc secruity is set for WPA-None, append the cipher suite IE
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- ULONG tmp;
- MakeOutgoingFrame(pOutBuffer + FrameLen, &tmp,
- 1, &RSNIe,
- 1, &pAd->StaCfg.RSNIE_Len,
- pAd->StaCfg.RSNIE_Len, pAd->StaCfg.RSN_IE,
- END_OF_ARGS);
- FrameLen += tmp;
- }
-#ifdef DOT11_N_SUPPORT
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- {
- ULONG TmpLen;
- UCHAR BROADCOM[4] = {0x0, 0x90, 0x4c, 0x33};
- HtLen = sizeof(pAd->CommonCfg.HtCapability);
- AddHtLen = sizeof(pAd->CommonCfg.AddHTInfo);
- NewExtLen = 1;
- //New extension channel offset IE is included in Beacon, Probe Rsp or channel Switch Announcement Frame
- if (pAd->bBroadComHT == TRUE)
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &WpaIe,
- 4, &BROADCOM[0],
- pAd->MlmeAux.HtCapabilityLen, &pAd->MlmeAux.HtCapability,
- END_OF_ARGS);
- }
- else
- {
- MakeOutgoingFrame(pOutBuffer + FrameLen, &TmpLen,
- 1, &HtCapIe,
- 1, &HtLen,
- sizeof(HT_CAPABILITY_IE), &pAd->CommonCfg.HtCapability,
- 1, &AddHtInfoIe,
- 1, &AddHtLen,
- sizeof(ADD_HT_INFO_IE), &pAd->CommonCfg.AddHTInfo,
- 1, &NewExtChanIe,
- 1, &NewExtLen,
- sizeof(NEW_EXT_CHAN_IE), &pAd->CommonCfg.NewExtChanOffset,
- END_OF_ARGS);
- }
- FrameLen += TmpLen;
- }
-#endif // DOT11_N_SUPPORT //
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- }
- }
-}
-
-VOID BeaconTimeoutAtJoinAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("SYNC - BeaconTimeoutAtJoinAction\n"));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_REJ_TIMEOUT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- Scan timeout procedure. basically add channel index by 1 and rescan
- ==========================================================================
- */
-VOID ScanTimeoutAction(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- pAd->MlmeAux.Channel = NextChannel(pAd, pAd->MlmeAux.Channel);
-
- // Only one channel scanned for CISCO beacon request
- if ((pAd->MlmeAux.ScanType == SCAN_CISCO_ACTIVE) ||
- (pAd->MlmeAux.ScanType == SCAN_CISCO_PASSIVE) ||
- (pAd->MlmeAux.ScanType == SCAN_CISCO_NOISE) ||
- (pAd->MlmeAux.ScanType == SCAN_CISCO_CHANNEL_LOAD))
- pAd->MlmeAux.Channel = 0;
-
- // this routine will stop if pAd->MlmeAux.Channel == 0
- ScanNextChannel(pAd);
-}
-
-/*
- ==========================================================================
- Description:
- ==========================================================================
- */
-VOID InvalidStateWhenScan(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("AYNC - InvalidStateWhenScan(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_SCAN_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- ==========================================================================
- */
-VOID InvalidStateWhenJoin(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenJoin(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_JOIN_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
- ==========================================================================
- */
-VOID InvalidStateWhenStart(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- USHORT Status;
- DBGPRINT(RT_DEBUG_TRACE, ("InvalidStateWhenStart(state=%ld). Reset SYNC machine\n", pAd->Mlme.SyncMachine.CurrState));
- pAd->Mlme.SyncMachine.CurrState = SYNC_IDLE;
- Status = MLME_STATE_MACHINE_REJECT;
- MlmeEnqueue(pAd, MLME_CNTL_STATE_MACHINE, MT2_START_CONF, 2, &Status);
-}
-
-/*
- ==========================================================================
- Description:
-
- IRQL = DISPATCH_LEVEL
-
- ==========================================================================
- */
-VOID EnqueuePsPoll(
- IN PRTMP_ADAPTER pAd)
-{
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- return;
- }
-#endif // RALINK_ATE //
-
-
- if (pAd->StaCfg.WindowsPowerMode == Ndis802_11PowerModeLegacy_PSP)
- pAd->PsPollFrame.FC.PwrMgmt = PWR_SAVE;
- MiniportMMRequest(pAd, 0, (PUCHAR)&pAd->PsPollFrame, sizeof(PSPOLL_FRAME));
-}
-
-
-/*
- ==========================================================================
- Description:
- ==========================================================================
- */
-VOID EnqueueProbeRequest(
- IN PRTMP_ADAPTER pAd)
-{
- NDIS_STATUS NState;
- PUCHAR pOutBuffer;
- ULONG FrameLen = 0;
- HEADER_802_11 Hdr80211;
-
- DBGPRINT(RT_DEBUG_TRACE, ("force out a ProbeRequest ...\n"));
-
- NState = MlmeAllocateMemory(pAd, &pOutBuffer); //Get an unused nonpaged memory
- if (NState == NDIS_STATUS_SUCCESS)
- {
- MgtMacHeaderInit(pAd, &Hdr80211, SUBTYPE_PROBE_REQ, 0, BROADCAST_ADDR, BROADCAST_ADDR);
-
- // this ProbeRequest explicitly specify SSID to reduce unwanted ProbeResponse
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- sizeof(HEADER_802_11), &Hdr80211,
- 1, &SsidIe,
- 1, &pAd->CommonCfg.SsidLen,
- pAd->CommonCfg.SsidLen, pAd->CommonCfg.Ssid,
- 1, &SupRateIe,
- 1, &pAd->StaActive.SupRateLen,
- pAd->StaActive.SupRateLen, pAd->StaActive.SupRate,
- END_OF_ARGS);
- MiniportMMRequest(pAd, 0, pOutBuffer, FrameLen);
- MlmeFreeMemory(pAd, pOutBuffer);
- }
-
-}
-
-#ifdef DOT11_N_SUPPORT
-#ifdef DOT11N_DRAFT3
-VOID BuildEffectedChannelList(
- IN PRTMP_ADAPTER pAd)
-{
- UCHAR EChannel[11];
- UCHAR i, j, k;
- UCHAR UpperChannel = 0, LowerChannel = 0;
-
- RTMPZeroMemory(EChannel, 11);
- i = 0;
- // Find upper channel and lower channel.
- if (pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel)
- {
- UpperChannel = pAd->CommonCfg.Channel;
- LowerChannel = pAd->CommonCfg.CentralChannel;
- }
- else if (pAd->CommonCfg.CentralChannel > pAd->CommonCfg.Channel)
- {
- UpperChannel = pAd->CommonCfg.CentralChannel;
- LowerChannel = pAd->CommonCfg.Channel;
- }
- else
- {
- return;
- }
-
- // Record channels that is below lower channel..
- if (LowerChannel > 1)
- {
- EChannel[0] = LowerChannel - 1;
- i = 1;
- if (LowerChannel > 2)
- {
- EChannel[1] = LowerChannel - 2;
- i = 2;
- if (LowerChannel > 3)
- {
- EChannel[2] = LowerChannel - 3;
- i = 3;
- }
- }
- }
- // Record channels that is between lower channel and upper channel.
- for (k = LowerChannel;k < UpperChannel;k++)
- {
- EChannel[i] = k;
- i++;
- }
- // Record channels that is above upper channel..
- if (LowerChannel < 11)
- {
- EChannel[i] = UpperChannel + 1;
- i++;
- if (LowerChannel < 10)
- {
- EChannel[i] = LowerChannel + 2;
- i++;
- if (LowerChannel < 9)
- {
- EChannel[i] = LowerChannel + 3;
- i++;
- }
- }
- }
- //
- for (j = 0;j < i;j++)
- {
- for (k = 0;k < pAd->ChannelListNum;k++)
- {
- if (pAd->ChannelList[k].Channel == EChannel[j])
- {
- pAd->ChannelList[k].bEffectedChannel = TRUE;
- DBGPRINT(RT_DEBUG_TRACE,(" EffectedChannel( =%d)\n", EChannel[j]));
- break;
- }
- }
- }
-}
-#endif // DOT11N_DRAFT3 //
-#endif // DOT11_N_SUPPORT //
-
-BOOLEAN ScanRunning(
- IN PRTMP_ADAPTER pAd)
-{
- return (pAd->Mlme.SyncMachine.CurrState == SCAN_LISTEN) ? TRUE : FALSE;
-}
diff --git a/drivers/staging/rt3090/sta/wpa.c b/drivers/staging/rt3090/sta/wpa.c
deleted file mode 100644
index 2dbdba541c3f..000000000000
--- a/drivers/staging/rt3090/sta/wpa.c
+++ /dev/null
@@ -1,396 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- wpa.c
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Jan Lee 03-07-22 Initial
- Paul Lin 03-11-28 Modify for supplicant
-*/
-
-#include "../rt_config.h"
-
-
-void inc_byte_array(UCHAR *counter, int len);
-
-/*
- ========================================================================
-
- Routine Description:
- Process MIC error indication and record MIC error timer.
-
- Arguments:
- pAd Pointer to our adapter
- pWpaKey Pointer to the WPA key structure
-
- Return Value:
- None
-
- IRQL = DISPATCH_LEVEL
-
- Note:
-
- ========================================================================
-*/
-VOID RTMPReportMicError(
- IN PRTMP_ADAPTER pAd,
- IN PCIPHER_KEY pWpaKey)
-{
- ULONG Now;
- UCHAR unicastKey = (pWpaKey->Type == PAIRWISE_KEY ? 1:0);
-
- // Record Last MIC error time and count
- NdisGetSystemUpTime(&Now);
- if (pAd->StaCfg.MicErrCnt == 0)
- {
- pAd->StaCfg.MicErrCnt++;
- pAd->StaCfg.LastMicErrorTime = Now;
- NdisZeroMemory(pAd->StaCfg.ReplayCounter, 8);
- }
- else if (pAd->StaCfg.MicErrCnt == 1)
- {
- if ((pAd->StaCfg.LastMicErrorTime + (60 * OS_HZ)) < Now)
- {
- // Update Last MIC error time, this did not violate two MIC errors within 60 seconds
- pAd->StaCfg.LastMicErrorTime = Now;
- }
- else
- {
-
- if (pAd->CommonCfg.bWirelessEvent)
- RTMPSendWirelessEvent(pAd, IW_COUNTER_MEASURES_EVENT_FLAG, pAd->MacTab.Content[BSSID_WCID].Addr, BSS0, 0);
-
- pAd->StaCfg.LastMicErrorTime = Now;
- // Violate MIC error counts, MIC countermeasures kicks in
- pAd->StaCfg.MicErrCnt++;
- // We shall block all reception
- // We shall clean all Tx ring and disassoicate from AP after next EAPOL frame
- //
- // No necessary to clean all Tx ring, on RTMPHardTransmit will stop sending non-802.1X EAPOL packets
- // if pAd->StaCfg.MicErrCnt greater than 2.
- //
- // RTMPRingCleanUp(pAd, QID_AC_BK);
- // RTMPRingCleanUp(pAd, QID_AC_BE);
- // RTMPRingCleanUp(pAd, QID_AC_VI);
- // RTMPRingCleanUp(pAd, QID_AC_VO);
- // RTMPRingCleanUp(pAd, QID_HCCA);
- }
- }
- else
- {
- // MIC error count >= 2
- // This should not happen
- ;
- }
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_MIC_FAILURE_REPORT_FRAME,
- 1,
- &unicastKey);
-
- if (pAd->StaCfg.MicErrCnt == 2)
- {
- RTMPSetTimer(&pAd->StaCfg.WpaDisassocAndBlockAssocTimer, 100);
- }
-}
-
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-#define LENGTH_EAP_H 4
-// If the received frame is EAP-Packet ,find out its EAP-Code (Request(0x01), Response(0x02), Success(0x03), Failure(0x04)).
-INT WpaCheckEapCode(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR pFrame,
- IN USHORT FrameLen,
- IN USHORT OffSet)
-{
-
- PUCHAR pData;
- INT result = 0;
-
- if( FrameLen < OffSet + LENGTH_EAPOL_H + LENGTH_EAP_H )
- return result;
-
- pData = pFrame + OffSet; // skip offset bytes
-
- if(*(pData+1) == EAPPacket) // 802.1x header - Packet Type
- {
- result = *(pData+4); // EAP header - Code
- }
-
- return result;
-}
-
-VOID WpaSendMicFailureToWpaSupplicant(
- IN PRTMP_ADAPTER pAd,
- IN BOOLEAN bUnicast)
-{
- char custom[IW_CUSTOM_MAX] = {0};
-
- sprintf(custom, "MLME-MICHAELMICFAILURE.indication");
- if(bUnicast)
- sprintf(custom, "%s unicast", custom);
-
- RtmpOSWrielessEventSend(pAd, IWEVCUSTOM, -1, NULL, (PUCHAR)custom, strlen(custom));
-
- return;
-}
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-VOID WpaMicFailureReportFrame(
- IN PRTMP_ADAPTER pAd,
- IN MLME_QUEUE_ELEM *Elem)
-{
- PUCHAR pOutBuffer = NULL;
- UCHAR Header802_3[14];
- ULONG FrameLen = 0;
- EAPOL_PACKET Packet;
- UCHAR Mic[16];
- BOOLEAN bUnicast;
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame ----->\n"));
-
- bUnicast = (Elem->Msg[0] == 1 ? TRUE:FALSE);
- pAd->Sequence = ((pAd->Sequence) + 1) & (MAX_SEQ_NUMBER);
-
- // init 802.3 header and Fill Packet
- MAKE_802_3_HEADER(Header802_3, pAd->CommonCfg.Bssid, pAd->CurrentAddress, EAPOL);
-
- NdisZeroMemory(&Packet, sizeof(Packet));
- Packet.ProVer = EAPOL_VER;
- Packet.ProType = EAPOLKey;
-
- Packet.KeyDesc.Type = WPA1_KEY_DESC;
-
- // Request field presented
- Packet.KeyDesc.KeyInfo.Request = 1;
-
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 2;
- }
- else // TKIP
- {
- Packet.KeyDesc.KeyInfo.KeyDescVer = 1;
- }
-
- Packet.KeyDesc.KeyInfo.KeyType = (bUnicast ? PAIRWISEKEY : GROUPKEY);
-
- // KeyMic field presented
- Packet.KeyDesc.KeyInfo.KeyMic = 1;
-
- // Error field presented
- Packet.KeyDesc.KeyInfo.Error = 1;
-
- // Update packet length after decide Key data payload
- SET_UINT16_TO_ARRARY(Packet.Body_Len, LEN_EAPOL_KEY_MSG)
-
- // Key Replay Count
- NdisMoveMemory(Packet.KeyDesc.ReplayCounter, pAd->StaCfg.ReplayCounter, LEN_KEY_DESC_REPLAY);
- inc_byte_array(pAd->StaCfg.ReplayCounter, 8);
-
- // Convert to little-endian format.
- *((USHORT *)&Packet.KeyDesc.KeyInfo) = cpu2le16(*((USHORT *)&Packet.KeyDesc.KeyInfo));
-
-
- MlmeAllocateMemory(pAd, (PUCHAR *)&pOutBuffer); // allocate memory
- if(pOutBuffer == NULL)
- {
- return;
- }
-
- // Prepare EAPOL frame for MIC calculation
- // Be careful, only EAPOL frame is counted for MIC calculation
- MakeOutgoingFrame(pOutBuffer, &FrameLen,
- CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, &Packet,
- END_OF_ARGS);
-
- // Prepare and Fill MIC value
- NdisZeroMemory(Mic, sizeof(Mic));
- if(pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled)
- { // AES
- UCHAR digest[20] = {0};
- HMAC_SHA1(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, digest, SHA1_DIGEST_SIZE);
- NdisMoveMemory(Mic, digest, LEN_KEY_DESC_MIC);
- }
- else
- { // TKIP
- HMAC_MD5(pAd->StaCfg.PTK, LEN_EAP_MICK, pOutBuffer, FrameLen, Mic, MD5_DIGEST_SIZE);
- }
- NdisMoveMemory(Packet.KeyDesc.KeyMic, Mic, LEN_KEY_DESC_MIC);
-
- // copy frame to Tx ring and send MIC failure report frame to authenticator
- RTMPToWirelessSta(pAd, &pAd->MacTab.Content[BSSID_WCID],
- Header802_3, LENGTH_802_3,
- (PUCHAR)&Packet,
- CONV_ARRARY_TO_UINT16(Packet.Body_Len) + 4, FALSE);
-
- MlmeFreeMemory(pAd, (PUCHAR)pOutBuffer);
-
- DBGPRINT(RT_DEBUG_TRACE, ("WpaMicFailureReportFrame <-----\n"));
-}
-
-/** from wpa_supplicant
- * inc_byte_array - Increment arbitrary length byte array by one
- * @counter: Pointer to byte array
- * @len: Length of the counter in bytes
- *
- * This function increments the last byte of the counter by one and continues
- * rolling over to more significant bytes if the byte was incremented from
- * 0xff to 0x00.
- */
-void inc_byte_array(UCHAR *counter, int len)
-{
- int pos = len - 1;
- while (pos >= 0) {
- counter[pos]++;
- if (counter[pos] != 0)
- break;
- pos--;
- }
-}
-
-VOID WpaDisassocApAndBlockAssoc(
- IN PVOID SystemSpecific1,
- IN PVOID FunctionContext,
- IN PVOID SystemSpecific2,
- IN PVOID SystemSpecific3)
-{
- RTMP_ADAPTER *pAd = (PRTMP_ADAPTER)FunctionContext;
- MLME_DISASSOC_REQ_STRUCT DisassocReq;
-
- // disassoc from current AP first
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPReportMicError - disassociate with current AP after sending second continuous EAPOL frame\n"));
- DisassocParmFill(pAd, &DisassocReq, pAd->CommonCfg.Bssid, REASON_MIC_FAILURE);
- MlmeEnqueue(pAd, ASSOC_STATE_MACHINE, MT2_MLME_DISASSOC_REQ, sizeof(MLME_DISASSOC_REQ_STRUCT), &DisassocReq);
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_DISASSOC;
- pAd->StaCfg.bBlockAssoc = TRUE;
-}
-
-VOID WpaStaPairwiseKeySetting(
- IN PRTMP_ADAPTER pAd)
-{
- PCIPHER_KEY pSharedKey;
- PMAC_TABLE_ENTRY pEntry;
-
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
-
- // Pairwise key shall use key#0
- pSharedKey = &pAd->SharedKey[BSS0][0];
-
- NdisMoveMemory(pAd->StaCfg.PTK, pEntry->PTK, LEN_PTK);
-
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
- pSharedKey->KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pSharedKey->Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pSharedKey->CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pSharedKey->CipherAlg = CIPHER_AES;
- else
- pSharedKey->CipherAlg = CIPHER_NONE;
-
- // Update these related information to MAC_TABLE_ENTRY
- NdisMoveMemory(pEntry->PairwiseKey.Key, &pAd->StaCfg.PTK[32], LEN_TKIP_EK);
- NdisMoveMemory(pEntry->PairwiseKey.RxMic, &pAd->StaCfg.PTK[48], LEN_TKIP_RXMICK);
- NdisMoveMemory(pEntry->PairwiseKey.TxMic, &pAd->StaCfg.PTK[48+LEN_TKIP_RXMICK], LEN_TKIP_TXMICK);
- pEntry->PairwiseKey.CipherAlg = pSharedKey->CipherAlg;
-
- // Update pairwise key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pSharedKey->CipherAlg,
- pSharedKey->Key,
- pSharedKey->TxMic,
- pSharedKey->RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- pSharedKey->CipherAlg,
- pEntry);
- STA_PORT_SECURED(pAd);
- pAd->IndicateMediaState = NdisMediaStateConnected;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s : AID(%d) port secured\n", __FUNCTION__, pEntry->Aid));
-
-}
-
-VOID WpaStaGroupKeySetting(
- IN PRTMP_ADAPTER pAd)
-{
- PCIPHER_KEY pSharedKey;
-
- pSharedKey = &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId];
-
- // Prepare pair-wise key information into shared key table
- NdisZeroMemory(pSharedKey, sizeof(CIPHER_KEY));
- pSharedKey->KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pSharedKey->Key, pAd->StaCfg.GTK, LEN_TKIP_EK);
- NdisMoveMemory(pSharedKey->RxMic, &pAd->StaCfg.GTK[16], LEN_TKIP_RXMICK);
- NdisMoveMemory(pSharedKey->TxMic, &pAd->StaCfg.GTK[24], LEN_TKIP_TXMICK);
-
- // Update Shared Key CipherAlg
- pSharedKey->CipherAlg = CIPHER_NONE;
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- pSharedKey->CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
- pSharedKey->CipherAlg = CIPHER_AES;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled)
- pSharedKey->CipherAlg = CIPHER_WEP64;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
- pSharedKey->CipherAlg = CIPHER_WEP128;
-
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pSharedKey->CipherAlg,
- pSharedKey->Key,
- pSharedKey->TxMic,
- pSharedKey->RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pSharedKey->CipherAlg,
- NULL);
-
-}
diff --git a/drivers/staging/rt3090/sta_ioctl.c b/drivers/staging/rt3090/sta_ioctl.c
deleted file mode 100644
index b8ab84a0469b..000000000000
--- a/drivers/staging/rt3090/sta_ioctl.c
+++ /dev/null
@@ -1,7557 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- sta_ioctl.c
-
- Abstract:
- IOCTL related subroutines
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Rory Chen 01-03-2003 created
- Rory Chen 02-14-2005 modify to support RT61
-*/
-
-#include "rt_config.h"
-
-#ifdef DBG
-extern ULONG RTDebugLevel;
-#endif
-
-#define NR_WEP_KEYS 4
-#define WEP_SMALL_KEY_LEN (40/8)
-#define WEP_LARGE_KEY_LEN (104/8)
-
-#define GROUP_KEY_NO 4
-
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
-#define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_A, _B, _C, _D, _E)
-#define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_A, _B, _C, _D, _E)
-#define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_A, _B, _C, _D, _E, _F)
-#else
-#define IWE_STREAM_ADD_EVENT(_A, _B, _C, _D, _E) iwe_stream_add_event(_B, _C, _D, _E)
-#define IWE_STREAM_ADD_POINT(_A, _B, _C, _D, _E) iwe_stream_add_point(_B, _C, _D, _E)
-#define IWE_STREAM_ADD_VALUE(_A, _B, _C, _D, _E, _F) iwe_stream_add_value(_B, _C, _D, _E, _F)
-#endif
-
-extern UCHAR CipherWpa2Template[];
-
-typedef struct PACKED _RT_VERSION_INFO{
- UCHAR DriverVersionW;
- UCHAR DriverVersionX;
- UCHAR DriverVersionY;
- UCHAR DriverVersionZ;
- UINT DriverBuildYear;
- UINT DriverBuildMonth;
- UINT DriverBuildDay;
-} RT_VERSION_INFO, *PRT_VERSION_INFO;
-
-struct iw_priv_args privtab[] = {
-{ RTPRIV_IOCTL_SET,
- IW_PRIV_TYPE_CHAR | 1024, 0,
- "set"},
-
-{ RTPRIV_IOCTL_SHOW, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
- ""},
-/* --- sub-ioctls definitions --- */
- { SHOW_CONN_STATUS,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "connStatus" },
- { SHOW_DRVIER_VERION,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "driverVer" },
- { SHOW_BA_INFO,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "bainfo" },
- { SHOW_DESC_INFO,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "descinfo" },
- { RAIO_OFF,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_off" },
- { RAIO_ON,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "radio_on" },
-#ifdef QOS_DLS_SUPPORT
- { SHOW_DLS_ENTRY_INFO,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "dlsentryinfo" },
-#endif // QOS_DLS_SUPPORT //
- { SHOW_CFG_VALUE,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "show" },
- { SHOW_ADHOC_ENTRY_INFO,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, "adhocEntry" },
-/* --- sub-ioctls relations --- */
-
-#ifdef DBG
-{ RTPRIV_IOCTL_BBP,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
- "bbp"},
-{ RTPRIV_IOCTL_MAC,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | 1024,
- "mac"},
-#ifdef RTMP_RF_RW_SUPPORT
-{ RTPRIV_IOCTL_RF,
- IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
- "rf"},
-#endif // RTMP_RF_RW_SUPPORT //
-{ RTPRIV_IOCTL_E2P,
- IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | 1024,
- "e2p"},
-#endif /* DBG */
-
-{ RTPRIV_IOCTL_STATISTICS,
- 0, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK,
- "stat"},
-{ RTPRIV_IOCTL_GSITESURVEY,
- 0, IW_PRIV_TYPE_CHAR | 1024,
- "get_site_survey"},
-
-
-};
-
-static __s32 ralinkrate[] =
- {2, 4, 11, 22, // CCK
- 12, 18, 24, 36, 48, 72, 96, 108, // OFDM
- 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, // 20MHz, 800ns GI, MCS: 0 ~ 15
- 39, 78, 117, 156, 234, 312, 351, 390, // 20MHz, 800ns GI, MCS: 16 ~ 23
- 27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540, // 40MHz, 800ns GI, MCS: 0 ~ 15
- 81, 162, 243, 324, 486, 648, 729, 810, // 40MHz, 800ns GI, MCS: 16 ~ 23
- 14, 29, 43, 57, 87, 115, 130, 144, 29, 59, 87, 115, 173, 230, 260, 288, // 20MHz, 400ns GI, MCS: 0 ~ 15
- 43, 87, 130, 173, 260, 317, 390, 433, // 20MHz, 400ns GI, MCS: 16 ~ 23
- 30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, // 40MHz, 400ns GI, MCS: 0 ~ 15
- 90, 180, 270, 360, 540, 720, 810, 900};
-
-
-
-INT Set_SSID_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-#ifdef WMM_SUPPORT
-INT Set_WmmCapable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif
-
-INT Set_NetworkType_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_AuthMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_EncrypType_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_DefaultKeyID_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_Key1_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_Key2_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_Key3_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_Key4_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_WPAPSK_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-
-INT Set_PSMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-#ifdef RT3090
-INT Set_PCIePSLevel_Proc(
-IN PRTMP_ADAPTER pAdapter,
-IN PUCHAR arg);
-#endif // RT3090 //
-#ifdef WPA_SUPPLICANT_SUPPORT
-INT Set_Wpa_Support(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef DBG
-
-VOID RTMPIoctlMAC(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-
-VOID RTMPIoctlE2PROM(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-#endif // DBG //
-
-
-NDIS_STATUS RTMPWPANoneAddKeyProc(
- IN PRTMP_ADAPTER pAd,
- IN PVOID pBuf);
-
-INT Set_FragTest_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-#ifdef DOT11_N_SUPPORT
-INT Set_TGnWifiTest_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // DOT11_N_SUPPORT //
-
-INT Set_LongRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-INT Set_ShortRetryLimit_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-
-#ifdef EXT_BUILD_CHANNEL_LIST
-INT Set_Ieee80211dClientMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg);
-#endif // EXT_BUILD_CHANNEL_LIST //
-
-#ifdef CARRIER_DETECTION_SUPPORT
-INT Set_CarrierDetect_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-#endif // CARRIER_DETECTION_SUPPORT //
-
-INT Show_Adhoc_MacTable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING extra);
-
-#ifdef RTMP_RF_RW_SUPPORT
-VOID RTMPIoctlRF(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq);
-#endif // RTMP_RF_RW_SUPPORT //
-
-
-INT Set_BeaconLostTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_AutoRoaming_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_SiteSurvey_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-INT Set_ForceTxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg);
-
-#ifdef ANT_DIVERSITY_SUPPORT
-INT Set_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg);
-#endif // ANT_DIVERSITY_SUPPORT //
-
-static struct {
- PSTRING name;
- INT (*set_proc)(PRTMP_ADAPTER pAdapter, PSTRING arg);
-} *PRTMP_PRIVATE_SET_PROC, RTMP_PRIVATE_SUPPORT_PROC[] = {
- {"DriverVersion", Set_DriverVersion_Proc},
- {"CountryRegion", Set_CountryRegion_Proc},
- {"CountryRegionABand", Set_CountryRegionABand_Proc},
- {"SSID", Set_SSID_Proc},
- {"WirelessMode", Set_WirelessMode_Proc},
- {"TxBurst", Set_TxBurst_Proc},
- {"TxPreamble", Set_TxPreamble_Proc},
- {"TxPower", Set_TxPower_Proc},
- {"Channel", Set_Channel_Proc},
- {"BGProtection", Set_BGProtection_Proc},
- {"RTSThreshold", Set_RTSThreshold_Proc},
- {"FragThreshold", Set_FragThreshold_Proc},
-#ifdef DOT11_N_SUPPORT
- {"HtBw", Set_HtBw_Proc},
- {"HtMcs", Set_HtMcs_Proc},
- {"HtGi", Set_HtGi_Proc},
- {"HtOpMode", Set_HtOpMode_Proc},
- {"HtExtcha", Set_HtExtcha_Proc},
- {"HtMpduDensity", Set_HtMpduDensity_Proc},
- {"HtBaWinSize", Set_HtBaWinSize_Proc},
- {"HtRdg", Set_HtRdg_Proc},
- {"HtAmsdu", Set_HtAmsdu_Proc},
- {"HtAutoBa", Set_HtAutoBa_Proc},
- {"HtBaDecline", Set_BADecline_Proc},
- {"HtProtect", Set_HtProtect_Proc},
- {"HtMimoPs", Set_HtMimoPs_Proc},
- {"HtDisallowTKIP", Set_HtDisallowTKIP_Proc},
-#endif // DOT11_N_SUPPORT //
-
-#ifdef AGGREGATION_SUPPORT
- {"PktAggregate", Set_PktAggregate_Proc},
-#endif // AGGREGATION_SUPPORT //
-
-#ifdef WMM_SUPPORT
- {"WmmCapable", Set_WmmCapable_Proc},
-#endif
- {"IEEE80211H", Set_IEEE80211H_Proc},
- {"NetworkType", Set_NetworkType_Proc},
- {"AuthMode", Set_AuthMode_Proc},
- {"EncrypType", Set_EncrypType_Proc},
- {"DefaultKeyID", Set_DefaultKeyID_Proc},
- {"Key1", Set_Key1_Proc},
- {"Key2", Set_Key2_Proc},
- {"Key3", Set_Key3_Proc},
- {"Key4", Set_Key4_Proc},
- {"WPAPSK", Set_WPAPSK_Proc},
- {"ResetCounter", Set_ResetStatCounter_Proc},
- {"PSMode", Set_PSMode_Proc},
-#ifdef DBG
- {"Debug", Set_Debug_Proc},
-#endif // DBG //
-
-#ifdef RALINK_ATE
- {"ATE", Set_ATE_Proc},
- {"ATEDA", Set_ATE_DA_Proc},
- {"ATESA", Set_ATE_SA_Proc},
- {"ATEBSSID", Set_ATE_BSSID_Proc},
- {"ATECHANNEL", Set_ATE_CHANNEL_Proc},
- {"ATETXPOW0", Set_ATE_TX_POWER0_Proc},
- {"ATETXPOW1", Set_ATE_TX_POWER1_Proc},
- {"ATETXANT", Set_ATE_TX_Antenna_Proc},
- {"ATERXANT", Set_ATE_RX_Antenna_Proc},
- {"ATETXFREQOFFSET", Set_ATE_TX_FREQOFFSET_Proc},
- {"ATETXBW", Set_ATE_TX_BW_Proc},
- {"ATETXLEN", Set_ATE_TX_LENGTH_Proc},
- {"ATETXCNT", Set_ATE_TX_COUNT_Proc},
- {"ATETXMCS", Set_ATE_TX_MCS_Proc},
- {"ATETXMODE", Set_ATE_TX_MODE_Proc},
- {"ATETXGI", Set_ATE_TX_GI_Proc},
- {"ATERXFER", Set_ATE_RX_FER_Proc},
- {"ATERRF", Set_ATE_Read_RF_Proc},
- {"ATEWRF1", Set_ATE_Write_RF1_Proc},
- {"ATEWRF2", Set_ATE_Write_RF2_Proc},
- {"ATEWRF3", Set_ATE_Write_RF3_Proc},
- {"ATEWRF4", Set_ATE_Write_RF4_Proc},
- {"ATELDE2P", Set_ATE_Load_E2P_Proc},
- {"ATERE2P", Set_ATE_Read_E2P_Proc},
- {"ATESHOW", Set_ATE_Show_Proc},
- {"ATEHELP", Set_ATE_Help_Proc},
-
-#ifdef RALINK_28xx_QA
- {"TxStop", Set_TxStop_Proc},
- {"RxStop", Set_RxStop_Proc},
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- {"WpaSupport", Set_Wpa_Support},
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-
-
-
-
- {"FixedTxMode", Set_FixedTxMode_Proc},
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
- {"OpMode", Set_OpMode_Proc},
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
-#ifdef DOT11_N_SUPPORT
- {"TGnWifiTest", Set_TGnWifiTest_Proc},
- {"ForceGF", Set_ForceGF_Proc},
-#endif // DOT11_N_SUPPORT //
-#ifdef QOS_DLS_SUPPORT
- {"DlsAddEntry", Set_DlsAddEntry_Proc},
- {"DlsTearDownEntry", Set_DlsTearDownEntry_Proc},
-#endif // QOS_DLS_SUPPORT //
- {"LongRetry", Set_LongRetryLimit_Proc},
- {"ShortRetry", Set_ShortRetryLimit_Proc},
-#ifdef EXT_BUILD_CHANNEL_LIST
- {"11dClientMode", Set_Ieee80211dClientMode_Proc},
-#endif // EXT_BUILD_CHANNEL_LIST //
-#ifdef CARRIER_DETECTION_SUPPORT
- {"CarrierDetect", Set_CarrierDetect_Proc},
-#endif // CARRIER_DETECTION_SUPPORT //
-
-
-//2008/09/11:KH add to support efuse<--
-#ifdef RT30xx
-#ifdef RTMP_EFUSE_SUPPORT
- {"efuseFreeNumber", set_eFuseGetFreeBlockCount_Proc},
- {"efuseDump", set_eFusedump_Proc},
- {"efuseLoadFromBin", set_eFuseLoadFromBin_Proc},
- {"efuseBufferModeWriteBack", set_eFuseBufferModeWriteBack_Proc},
-#endif // RTMP_EFUSE_SUPPORT //
-#ifdef ANT_DIVERSITY_SUPPORT
- {"ant", Set_Antenna_Proc},
-#endif // ANT_DIVERSITY_SUPPORT //
-#endif // RT30xx //
-//2008/09/11:KH add to support efuse-->
-
- {"BeaconLostTime", Set_BeaconLostTime_Proc},
- {"AutoRoaming", Set_AutoRoaming_Proc},
- {"SiteSurvey", Set_SiteSurvey_Proc},
- {"ForceTxBurst", Set_ForceTxBurst_Proc},
-
- {NULL,}
-};
-
-
-VOID RTMPAddKey(
- IN PRTMP_ADAPTER pAd,
- IN PNDIS_802_11_KEY pKey)
-{
- ULONG KeyIdx;
- MAC_TABLE_ENTRY *pEntry;
-
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey ------>\n"));
-
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- if (pKey->KeyIndex & 0x80000000)
- {
- if (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- NdisZeroMemory(pAd->StaCfg.PMK, 32);
- NdisMoveMemory(pAd->StaCfg.PMK, pKey->KeyMaterial, pKey->KeyLength);
- goto end;
- }
- // Update PTK
- NdisZeroMemory(&pAd->SharedKey[BSS0][0], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][0].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][0].Key, pKey->KeyMaterial, LEN_TKIP_EK);
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- {
- NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- NdisMoveMemory(pAd->SharedKey[BSS0][0].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][0].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
- }
-
- // Decide its ChiperAlg
- if (pAd->StaCfg.PairCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.PairCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_AES;
- else
- pAd->SharedKey[BSS0][0].CipherAlg = CIPHER_NONE;
-
- // Update these related information to MAC_TABLE_ENTRY
- pEntry = &pAd->MacTab.Content[BSSID_WCID];
- NdisMoveMemory(pEntry->PairwiseKey.Key, pAd->SharedKey[BSS0][0].Key, LEN_TKIP_EK);
- NdisMoveMemory(pEntry->PairwiseKey.RxMic, pAd->SharedKey[BSS0][0].RxMic, LEN_TKIP_RXMICK);
- NdisMoveMemory(pEntry->PairwiseKey.TxMic, pAd->SharedKey[BSS0][0].TxMic, LEN_TKIP_TXMICK);
- pEntry->PairwiseKey.CipherAlg = pAd->SharedKey[BSS0][0].CipherAlg;
-
- // Update pairwise key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pAd->SharedKey[BSS0][0].Key,
- pAd->SharedKey[BSS0][0].TxMic,
- pAd->SharedKey[BSS0][0].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- 0,
- pAd->SharedKey[BSS0][0].CipherAlg,
- pEntry);
-
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
- {
- // set 802.1x port control
- //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAd);
-
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
- }
- }
- else
- {
- // Update GTK
- pAd->StaCfg.DefaultKeyId = (pKey->KeyIndex & 0xFF);
- NdisZeroMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId], sizeof(CIPHER_KEY));
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, pKey->KeyMaterial, LEN_TKIP_EK);
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- {
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
- }
- else
-#endif // WPA_SUPPLICANT_SUPPORT //
- {
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic, pKey->KeyMaterial + LEN_TKIP_EK, LEN_TKIP_TXMICK);
- NdisMoveMemory(pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic, pKey->KeyMaterial + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
- }
-
- // Update Shared Key CipherAlg
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_NONE;
- if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption2Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_TKIP;
- else if (pAd->StaCfg.GroupCipher == Ndis802_11Encryption3Enabled)
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg = CIPHER_AES;
-
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].TxMic,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].RxMic);
-
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAd,
- BSS0,
- pAd->StaCfg.DefaultKeyId,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].CipherAlg,
- NULL);
-
- // set 802.1x port control
- //pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAd);
-
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
- }
- }
- else // dynamic WEP from wpa_supplicant
- {
- UCHAR CipherAlg;
- PUCHAR Key;
-
- if(pKey->KeyLength == 32)
- goto end;
-
- KeyIdx = pKey->KeyIndex & 0x0fffffff;
-
- if (KeyIdx < 4)
- {
- // it is a default shared key, for Pairwise key setting
- if (pKey->KeyIndex & 0x80000000)
- {
- pEntry = MacTableLookup(pAd, pKey->BSSID);
-
- if (pEntry)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RTMPAddKey: Set Pair-wise Key\n"));
-
- // set key material and key length
- pEntry->PairwiseKey.KeyLen = (UCHAR)pKey->KeyLength;
- NdisMoveMemory(pEntry->PairwiseKey.Key, &pKey->KeyMaterial, pKey->KeyLength);
-
- // set Cipher type
- if (pKey->KeyLength == 5)
- pEntry->PairwiseKey.CipherAlg = CIPHER_WEP64;
- else
- pEntry->PairwiseKey.CipherAlg = CIPHER_WEP128;
-
- // Add Pair-wise key to Asic
- AsicAddPairwiseKeyEntry(
- pAd,
- pEntry->Addr,
- (UCHAR)pEntry->Aid,
- &pEntry->PairwiseKey);
-
- // update WCID attribute table and IVEIV table for this entry
- RTMPAddWcidAttributeEntry(
- pAd,
- BSS0,
- KeyIdx, // The value may be not zero
- pEntry->PairwiseKey.CipherAlg,
- pEntry);
-
- }
- }
- else
- {
- // Default key for tx (shared key)
- pAd->StaCfg.DefaultKeyId = (UCHAR) KeyIdx;
-
- // set key material and key length
- pAd->SharedKey[BSS0][KeyIdx].KeyLen = (UCHAR) pKey->KeyLength;
- NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key, &pKey->KeyMaterial, pKey->KeyLength);
-
- // Set Ciper type
- if (pKey->KeyLength == 5)
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CIPHER_WEP64;
- else
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CIPHER_WEP128;
-
- CipherAlg = pAd->SharedKey[BSS0][KeyIdx].CipherAlg;
- Key = pAd->SharedKey[BSS0][KeyIdx].Key;
-
- // Set Group key material to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, KeyIdx, CipherAlg, Key, NULL, NULL);
-
- // Update WCID attribute table and IVEIV table for this group key table
- RTMPAddWcidAttributeEntry(pAd, BSS0, KeyIdx, CipherAlg, NULL);
-
- }
- }
- }
-end:
- return;
-}
-
-char * rtstrchr(const char * s, int c)
-{
- for(; *s != (char) c; ++s)
- if (*s == '\0')
- return NULL;
- return (char *) s;
-}
-
-/*
-This is required for LinEX2004/kernel2.6.7 to provide iwlist scanning function
-*/
-
-int
-rt_ioctl_giwname(struct net_device *dev,
- struct iw_request_info *info,
- char *name, char *extra)
-{
-
-#ifdef RTMP_MAC_PCI
- strncpy(name, "RT2860 Wireless", IFNAMSIZ);
-#endif // RTMP_MAC_PCI //
- return 0;
-}
-
-int rt_ioctl_siwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- int chan = -1;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
-
- if (freq->e > 1)
- return -EINVAL;
-
- if((freq->e == 0) && (freq->m <= 1000))
- chan = freq->m; // Setting by channel number
- else
- MAP_KHZ_TO_CHANNEL_ID( (freq->m /100) , chan); // Setting by frequency - search the table , like 2.412G, 2.422G,
-
- if (ChannelSanity(pAdapter, chan) == TRUE)
- {
- pAdapter->CommonCfg.Channel = chan;
- DBGPRINT(RT_DEBUG_ERROR, ("==>rt_ioctl_siwfreq::SIOCSIWFREQ[cmd=0x%x] (Channel=%d)\n", SIOCSIWFREQ, pAdapter->CommonCfg.Channel));
- }
- else
- return -EINVAL;
-
- return 0;
-}
-
-
-int rt_ioctl_giwfreq(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_freq *freq, char *extra)
-{
- PRTMP_ADAPTER pAdapter = NULL;
- UCHAR ch;
- ULONG m = 2412000;
-
- pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- ch = pAdapter->CommonCfg.Channel;
-
- DBGPRINT(RT_DEBUG_TRACE,("==>rt_ioctl_giwfreq %d\n", ch));
-
- MAP_CHANNEL_ID_TO_KHZ(ch, m);
- freq->m = m * 100;
- freq->e = 1;
- return 0;
-}
-
-
-int rt_ioctl_siwmode(struct net_device *dev,
- struct iw_request_info *info,
- __u32 *mode, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- switch (*mode)
- {
- case IW_MODE_ADHOC:
- Set_NetworkType_Proc(pAdapter, "Adhoc");
- break;
- case IW_MODE_INFRA:
- Set_NetworkType_Proc(pAdapter, "Infra");
- break;
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20))
- case IW_MODE_MONITOR:
- Set_NetworkType_Proc(pAdapter, "Monitor");
- break;
-#endif
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_siwmode::SIOCSIWMODE (unknown %d)\n", *mode));
- return -EINVAL;
- }
-
- // Reset Ralink supplicant to not use, it will be set to start when UI set PMK key
- pAdapter->StaCfg.WpaState = SS_NOTUSE;
-
- return 0;
-}
-
-
-int rt_ioctl_giwmode(struct net_device *dev,
- struct iw_request_info *info,
- __u32 *mode, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- if (ADHOC_ON(pAdapter))
- *mode = IW_MODE_ADHOC;
- else if (INFRA_ON(pAdapter))
- *mode = IW_MODE_INFRA;
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,20))
- else if (MONITOR_ON(pAdapter))
- {
- *mode = IW_MODE_MONITOR;
- }
-#endif
- else
- *mode = IW_MODE_AUTO;
-
- DBGPRINT(RT_DEBUG_TRACE, ("==>rt_ioctl_giwmode(mode=%d)\n", *mode));
- return 0;
-}
-
-int rt_ioctl_siwsens(struct net_device *dev,
- struct iw_request_info *info,
- char *name, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- return 0;
-}
-
-int rt_ioctl_giwsens(struct net_device *dev,
- struct iw_request_info *info,
- char *name, char *extra)
-{
- return 0;
-}
-
-int rt_ioctl_giwrange(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_range *range = (struct iw_range *) extra;
- u16 val;
- int i;
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- DBGPRINT(RT_DEBUG_TRACE ,("===>rt_ioctl_giwrange\n"));
- data->length = sizeof(struct iw_range);
- memset(range, 0, sizeof(struct iw_range));
-
- range->txpower_capa = IW_TXPOW_DBM;
-
- if (INFRA_ON(pAdapter)||ADHOC_ON(pAdapter))
- {
- range->min_pmp = 1 * 1024;
- range->max_pmp = 65535 * 1024;
- range->min_pmt = 1 * 1024;
- range->max_pmt = 1000 * 1024;
- range->pmp_flags = IW_POWER_PERIOD;
- range->pmt_flags = IW_POWER_TIMEOUT;
- range->pm_capa = IW_POWER_PERIOD | IW_POWER_TIMEOUT |
- IW_POWER_UNICAST_R | IW_POWER_ALL_R;
- }
-
- range->we_version_compiled = WIRELESS_EXT;
- range->we_version_source = 14;
-
- range->retry_capa = IW_RETRY_LIMIT;
- range->retry_flags = IW_RETRY_LIMIT;
- range->min_retry = 0;
- range->max_retry = 255;
-
- range->num_channels = pAdapter->ChannelListNum;
-
- val = 0;
- for (i = 1; i <= range->num_channels; i++)
- {
- u32 m = 2412000;
- range->freq[val].i = pAdapter->ChannelList[i-1].Channel;
- MAP_CHANNEL_ID_TO_KHZ(pAdapter->ChannelList[i-1].Channel, m);
- range->freq[val].m = m * 100; /* OS_HZ */
-
- range->freq[val].e = 1;
- val++;
- if (val == IW_MAX_FREQUENCIES)
- break;
- }
- range->num_frequency = val;
-
- range->max_qual.qual = 100; /* what is correct max? This was not
- * documented exactly. At least
- * 69 has been observed. */
- range->max_qual.level = 0; /* dB */
- range->max_qual.noise = 0; /* dB */
-
- /* What would be suitable values for "average/typical" qual? */
- range->avg_qual.qual = 20;
- range->avg_qual.level = -60;
- range->avg_qual.noise = -95;
- range->sensitivity = 3;
-
- range->max_encoding_tokens = NR_WEP_KEYS;
- range->num_encoding_sizes = 2;
- range->encoding_size[0] = 5;
- range->encoding_size[1] = 13;
-
- range->min_rts = 0;
- range->max_rts = 2347;
- range->min_frag = 256;
- range->max_frag = 2346;
-
-#if WIRELESS_EXT > 17
- /* IW_ENC_CAPA_* bit field */
- range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_WPA2 |
- IW_ENC_CAPA_CIPHER_TKIP | IW_ENC_CAPA_CIPHER_CCMP;
-#endif
-
- return 0;
-}
-
-int rt_ioctl_siwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- NDIS_802_11_MAC_ADDRESS Bssid;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- // tell CNTL state machine to call NdisMSetInformationComplete() after completing
- // this request, because this request is initiated by NDIS.
- pAdapter->MlmeAux.CurrReqIsFromNdis = FALSE;
- // Prevent to connect AP again in STAMlmePeriodicExec
- pAdapter->MlmeAux.AutoReconnectSsidLen= 32;
-
- memset(Bssid, 0, MAC_ADDR_LEN);
- memcpy(Bssid, ap_addr->sa_data, MAC_ADDR_LEN);
- MlmeEnqueue(pAdapter,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID,
- sizeof(NDIS_802_11_MAC_ADDRESS),
- (VOID *)&Bssid);
-
- DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCSIWAP %02x:%02x:%02x:%02x:%02x:%02x\n",
- Bssid[0], Bssid[1], Bssid[2], Bssid[3], Bssid[4], Bssid[5]));
-
- return 0;
-}
-
-int rt_ioctl_giwap(struct net_device *dev,
- struct iw_request_info *info,
- struct sockaddr *ap_addr, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- if (INFRA_ON(pAdapter) || ADHOC_ON(pAdapter))
- {
- ap_addr->sa_family = ARPHRD_ETHER;
- memcpy(ap_addr->sa_data, &pAdapter->CommonCfg.Bssid, ETH_ALEN);
- }
-#ifdef WPA_SUPPLICANT_SUPPORT
- // Add for RT2870
- else if (pAdapter->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE)
- {
- ap_addr->sa_family = ARPHRD_ETHER;
- memcpy(ap_addr->sa_data, &pAdapter->MlmeAux.Bssid, ETH_ALEN);
- }
-#endif // WPA_SUPPLICANT_SUPPORT //
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCGIWAP(=EMPTY)\n"));
- return -ENOTCONN;
- }
-
- return 0;
-}
-
-/*
- * Units are in db above the noise floor. That means the
- * rssi values reported in the tx/rx descriptors in the
- * driver are the SNR expressed in db.
- *
- * If you assume that the noise floor is -95, which is an
- * excellent assumption 99.5 % of the time, then you can
- * derive the absolute signal level (i.e. -95 + rssi).
- * There are some other slight factors to take into account
- * depending on whether the rssi measurement is from 11b,
- * 11g, or 11a. These differences are at most 2db and
- * can be documented.
- *
- * NB: various calculations are based on the orinoco/wavelan
- * drivers for compatibility
- */
-static void set_quality(PRTMP_ADAPTER pAdapter,
- struct iw_quality *iq,
- signed char rssi)
-{
- __u8 ChannelQuality;
-
- // Normalize Rssi
- if (rssi >= -50)
- ChannelQuality = 100;
- else if (rssi >= -80) // between -50 ~ -80dbm
- ChannelQuality = (__u8)(24 + ((rssi + 80) * 26)/10);
- else if (rssi >= -90) // between -80 ~ -90dbm
- ChannelQuality = (__u8)((rssi + 90) * 26)/10;
- else
- ChannelQuality = 0;
-
- iq->qual = (__u8)ChannelQuality;
-
- iq->level = (__u8)(rssi);
- iq->noise = (pAdapter->BbpWriteLatch[66] > pAdapter->BbpTuning.FalseCcaUpperThreshold) ? ((__u8)pAdapter->BbpTuning.FalseCcaUpperThreshold) : ((__u8) pAdapter->BbpWriteLatch[66]); // noise level (dBm)
- iq->noise += 256 - 143;
- iq->updated = pAdapter->iw_stats.qual.updated;
-}
-
-int rt_ioctl_iwaplist(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- struct sockaddr addr[IW_MAX_AP];
- struct iw_quality qual[IW_MAX_AP];
- int i;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- data->length = 0;
- return 0;
- //return -ENETDOWN;
- }
-
- for (i = 0; i <IW_MAX_AP ; i++)
- {
- if (i >= pAdapter->ScanTab.BssNr)
- break;
- addr[i].sa_family = ARPHRD_ETHER;
- memcpy(addr[i].sa_data, &pAdapter->ScanTab.BssEntry[i].Bssid, MAC_ADDR_LEN);
- set_quality(pAdapter, &qual[i], pAdapter->ScanTab.BssEntry[i].Rssi);
- }
- data->length = i;
- memcpy(extra, &addr, i*sizeof(addr[0]));
- data->flags = 1; /* signal quality present (sort of) */
- memcpy(extra + i*sizeof(addr[0]), &qual, i*sizeof(qual[i]));
-
- return 0;
-}
-
-#ifdef SIOCGIWSCAN
-int rt_ioctl_siwscan(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- ULONG Now;
- int Status = NDIS_STATUS_SUCCESS;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (MONITOR_ON(pAdapter))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is in Monitor Mode now !!!\n"));
- return -EINVAL;
- }
-
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
- {
- pAdapter->StaCfg.WpaSupplicantScanCount++;
- }
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- pAdapter->StaCfg.bScanReqIsFromWebUI = TRUE;
- if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- return NDIS_STATUS_SUCCESS;
- do{
- Now = jiffies;
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if ((pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE) &&
- (pAdapter->StaCfg.WpaSupplicantScanCount > 3))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! WpaSupplicantScanCount > 3\n"));
- Status = NDIS_STATUS_SUCCESS;
- break;
- }
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- if ((OPSTATUS_TEST_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED)) &&
- ((pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)) &&
- (pAdapter->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Link UP, Port Not Secured! ignore this set::OID_802_11_BSSID_LIST_SCAN\n"));
- Status = NDIS_STATUS_SUCCESS;
- break;
- }
-
- if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- // tell CNTL state machine to call NdisMSetInformationComplete() after completing
- // this request, because this request is initiated by NDIS.
- pAdapter->MlmeAux.CurrReqIsFromNdis = FALSE;
- // Reset allowed scan retries
- pAdapter->StaCfg.ScanCnt = 0;
- pAdapter->StaCfg.LastScanTime = Now;
-
- MlmeEnqueue(pAdapter,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID_LIST_SCAN,
- 0,
- NULL);
-
- Status = NDIS_STATUS_SUCCESS;
- RTMP_MLME_HANDLER(pAdapter);
- }while(0);
- return NDIS_STATUS_SUCCESS;
-}
-
-int rt_ioctl_giwscan(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *extra)
-{
-
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- int i=0;
- PSTRING current_ev = extra, previous_ev = extra;
- PSTRING end_buf;
- PSTRING current_val;
- STRING custom[MAX_CUSTOM_LEN] = {0};
-#ifndef IWEVGENIE
- unsigned char idx;
-#endif // IWEVGENIE //
- struct iw_event iwe;
-
- if (RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- /*
- * Still scanning, indicate the caller should try again.
- */
- return -EAGAIN;
- }
-
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if (pAdapter->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
- {
- pAdapter->StaCfg.WpaSupplicantScanCount = 0;
- }
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- if (pAdapter->ScanTab.BssNr == 0)
- {
- data->length = 0;
- return 0;
- }
-
-#if WIRELESS_EXT >= 17
- if (data->length > 0)
- end_buf = extra + data->length;
- else
- end_buf = extra + IW_SCAN_MAX_DATA;
-#else
- end_buf = extra + IW_SCAN_MAX_DATA;
-#endif
-
- for (i = 0; i < pAdapter->ScanTab.BssNr; i++)
- {
- if (current_ev >= end_buf)
- {
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-
- //MAC address
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWAP;
- iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- memcpy(iwe.u.ap_addr.sa_data, &pAdapter->ScanTab.BssEntry[i].Bssid, ETH_ALEN);
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_EVENT(info, current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- /*
- Protocol:
- it will show scanned AP's WirelessMode .
- it might be
- 802.11a
- 802.11a/n
- 802.11g/n
- 802.11b/g/n
- 802.11g
- 802.11b/g
- */
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWNAME;
-
-
- {
- PBSS_ENTRY pBssEntry=&pAdapter->ScanTab.BssEntry[i];
- BOOLEAN isGonly=FALSE;
- int rateCnt=0;
-
- if (pBssEntry->Channel>14)
- {
- if (pBssEntry->HtCapabilityLen!=0)
- strcpy(iwe.u.name,"802.11a/n");
- else
- strcpy(iwe.u.name,"802.11a");
- }
- else
- {
- /*
- if one of non B mode rate is set supported rate . it mean G only.
- */
- for (rateCnt=0;rateCnt<pBssEntry->SupRateLen;rateCnt++)
- {
- /*
- 6Mbps(140) 9Mbps(146) and >=12Mbps(152) are supported rate , it mean G only.
- */
- if (pBssEntry->SupRate[rateCnt]==140 || pBssEntry->SupRate[rateCnt]==146 || pBssEntry->SupRate[rateCnt]>=152)
- isGonly=TRUE;
- }
-
- for (rateCnt=0;rateCnt<pBssEntry->ExtRateLen;rateCnt++)
- {
- if (pBssEntry->ExtRate[rateCnt]==140 || pBssEntry->ExtRate[rateCnt]==146 || pBssEntry->ExtRate[rateCnt]>=152)
- isGonly=TRUE;
- }
-
-
- if (pBssEntry->HtCapabilityLen!=0)
- {
- if (isGonly==TRUE)
- strcpy(iwe.u.name,"802.11g/n");
- else
- strcpy(iwe.u.name,"802.11b/g/n");
- }
- else
- {
- if (isGonly==TRUE)
- strcpy(iwe.u.name,"802.11g");
- else
- {
- if (pBssEntry->SupRateLen==4 && pBssEntry->ExtRateLen==0)
- strcpy(iwe.u.name,"802.11b");
- else
- strcpy(iwe.u.name,"802.11b/g");
- }
- }
- }
- }
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_EVENT(info, current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //ESSID
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWESSID;
- iwe.u.data.length = pAdapter->ScanTab.BssEntry[i].SsidLen;
- iwe.u.data.flags = 1;
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev,end_buf, &iwe, (PSTRING) pAdapter->ScanTab.BssEntry[i].Ssid);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //Network Type
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWMODE;
- if (pAdapter->ScanTab.BssEntry[i].BssType == Ndis802_11IBSS)
- {
- iwe.u.mode = IW_MODE_ADHOC;
- }
- else if (pAdapter->ScanTab.BssEntry[i].BssType == Ndis802_11Infrastructure)
- {
- iwe.u.mode = IW_MODE_INFRA;
- }
- else
- {
- iwe.u.mode = IW_MODE_AUTO;
- }
- iwe.len = IW_EV_UINT_LEN;
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_EVENT(info, current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //Channel and Frequency
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWFREQ;
- if (INFRA_ON(pAdapter) || ADHOC_ON(pAdapter))
- iwe.u.freq.m = pAdapter->ScanTab.BssEntry[i].Channel;
- else
- iwe.u.freq.m = pAdapter->ScanTab.BssEntry[i].Channel;
- iwe.u.freq.e = 0;
- iwe.u.freq.i = 0;
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_EVENT(info, current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //Add quality statistics
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = IWEVQUAL;
- iwe.u.qual.level = 0;
- iwe.u.qual.noise = 0;
- set_quality(pAdapter, &iwe.u.qual, pAdapter->ScanTab.BssEntry[i].Rssi);
- current_ev = IWE_STREAM_ADD_EVENT(info, current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //Encyption key
- //================================
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWENCODE;
- if (CAP_IS_PRIVACY_ON (pAdapter->ScanTab.BssEntry[i].CapabilityInfo ))
- iwe.u.data.flags =IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
- else
- iwe.u.data.flags = IW_ENCODE_DISABLED;
-
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf,&iwe, (char *)pAdapter->SharedKey[BSS0][(iwe.u.data.flags & IW_ENCODE_INDEX)-1].Key);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
-
- //Bit Rate
- //================================
- if (pAdapter->ScanTab.BssEntry[i].SupRateLen)
- {
- UCHAR tmpRate = pAdapter->ScanTab.BssEntry[i].SupRate[pAdapter->ScanTab.BssEntry[i].SupRateLen-1];
- memset(&iwe, 0, sizeof(iwe));
- iwe.cmd = SIOCGIWRATE;
- current_val = current_ev + IW_EV_LCP_LEN;
- if (tmpRate == 0x82)
- iwe.u.bitrate.value = 1 * 1000000;
- else if (tmpRate == 0x84)
- iwe.u.bitrate.value = 2 * 1000000;
- else if (tmpRate == 0x8B)
- iwe.u.bitrate.value = 5.5 * 1000000;
- else if (tmpRate == 0x96)
- iwe.u.bitrate.value = 11 * 1000000;
- else
- iwe.u.bitrate.value = (tmpRate/2) * 1000000;
-
- if (tmpRate == 0x6c && pAdapter->ScanTab.BssEntry[i].HtCapabilityLen > 0)
- {
- int rate_count = sizeof(ralinkrate)/sizeof(__s32);
- HT_CAP_INFO capInfo = pAdapter->ScanTab.BssEntry[i].HtCapability.HtCapInfo;
- int shortGI = capInfo.ChannelWidth ? capInfo.ShortGIfor40 : capInfo.ShortGIfor20;
- int maxMCS = pAdapter->ScanTab.BssEntry[i].HtCapability.MCSSet[1] ? 15 : 7;
- int rate_index = 12 + ((UCHAR)capInfo.ChannelWidth * 24) + ((UCHAR)shortGI *48) + ((UCHAR)maxMCS);
- if (rate_index < 0)
- rate_index = 0;
- if (rate_index > rate_count)
- rate_index = rate_count;
- iwe.u.bitrate.value = ralinkrate[rate_index] * 500000;
- }
-
- iwe.u.bitrate.disabled = 0;
- current_val = IWE_STREAM_ADD_VALUE(info, current_ev,
- current_val, end_buf, &iwe,
- IW_EV_PARAM_LEN);
-
- if((current_val-current_ev)>IW_EV_LCP_LEN)
- current_ev = current_val;
- else
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-
-#ifdef IWEVGENIE
- //WPA IE
- if (pAdapter->ScanTab.BssEntry[i].WpaIE.IELen > 0)
- {
- memset(&iwe, 0, sizeof(iwe));
- memset(&custom[0], 0, MAX_CUSTOM_LEN);
- memcpy(custom, &(pAdapter->ScanTab.BssEntry[i].WpaIE.IE[0]),
- pAdapter->ScanTab.BssEntry[i].WpaIE.IELen);
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = pAdapter->ScanTab.BssEntry[i].WpaIE.IELen;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf, &iwe, custom);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-
- //WPA2 IE
- if (pAdapter->ScanTab.BssEntry[i].RsnIE.IELen > 0)
- {
- memset(&iwe, 0, sizeof(iwe));
- memset(&custom[0], 0, MAX_CUSTOM_LEN);
- memcpy(custom, &(pAdapter->ScanTab.BssEntry[i].RsnIE.IE[0]),
- pAdapter->ScanTab.BssEntry[i].RsnIE.IELen);
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = pAdapter->ScanTab.BssEntry[i].RsnIE.IELen;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf, &iwe, custom);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-#else
- //WPA IE
- //================================
- if (pAdapter->ScanTab.BssEntry[i].WpaIE.IELen > 0)
- {
- NdisZeroMemory(&iwe, sizeof(iwe));
- memset(&custom[0], 0, MAX_CUSTOM_LEN);
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = (pAdapter->ScanTab.BssEntry[i].WpaIE.IELen * 2) + 7;
- NdisMoveMemory(custom, "wpa_ie=", 7);
- for (idx = 0; idx < pAdapter->ScanTab.BssEntry[i].WpaIE.IELen; idx++)
- sprintf(custom, "%s%02x", custom, pAdapter->ScanTab.BssEntry[i].WpaIE.IE[idx]);
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf, &iwe, custom);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-
- //WPA2 IE
- if (pAdapter->ScanTab.BssEntry[i].RsnIE.IELen > 0)
- {
- NdisZeroMemory(&iwe, sizeof(iwe));
- memset(&custom[0], 0, MAX_CUSTOM_LEN);
- iwe.cmd = IWEVCUSTOM;
- iwe.u.data.length = (pAdapter->ScanTab.BssEntry[i].RsnIE.IELen * 2) + 7;
- NdisMoveMemory(custom, "rsn_ie=", 7);
- for (idx = 0; idx < pAdapter->ScanTab.BssEntry[i].RsnIE.IELen; idx++)
- sprintf(custom, "%s%02x", custom, pAdapter->ScanTab.BssEntry[i].RsnIE.IE[idx]);
- previous_ev = current_ev;
- current_ev = IWE_STREAM_ADD_POINT(info, current_ev, end_buf, &iwe, custom);
- if (current_ev == previous_ev)
-#if WIRELESS_EXT >= 17
- return -E2BIG;
-#else
- break;
-#endif
- }
-#endif // IWEVGENIE //
- }
-
- data->length = current_ev - extra;
- pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
- DBGPRINT(RT_DEBUG_ERROR ,("===>rt_ioctl_giwscan. %d(%d) BSS returned, data->length = %d\n",i , pAdapter->ScanTab.BssNr, data->length));
- return 0;
-}
-#endif
-
-int rt_ioctl_siwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *essid)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (data->flags)
- {
- PSTRING pSsidString = NULL;
-
- // Includes null character.
- if (data->length > (IW_ESSID_MAX_SIZE + 1))
- return -E2BIG;
-
- pSsidString = kmalloc(MAX_LEN_OF_SSID+1, MEM_ALLOC_FLAG);
- if (pSsidString)
- {
- NdisZeroMemory(pSsidString, MAX_LEN_OF_SSID+1);
- NdisMoveMemory(pSsidString, essid, data->length);
- if (Set_SSID_Proc(pAdapter, pSsidString) == FALSE)
- return -EINVAL;
- }
- else
- return -ENOMEM;
- }
- else
- {
- // ANY ssid
- if (Set_SSID_Proc(pAdapter, "") == FALSE)
- return -EINVAL;
- }
- return 0;
-}
-
-int rt_ioctl_giwessid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *essid)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- data->flags = 1;
- if (MONITOR_ON(pAdapter))
- {
- data->length = 0;
- return 0;
- }
-
- if (OPSTATUS_TEST_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED))
- {
- DBGPRINT(RT_DEBUG_TRACE ,("MediaState is connected\n"));
- data->length = pAdapter->CommonCfg.SsidLen;
- memcpy(essid, pAdapter->CommonCfg.Ssid, pAdapter->CommonCfg.SsidLen);
- }
- else
- {//the ANY ssid was specified
- data->length = 0;
- DBGPRINT(RT_DEBUG_TRACE ,("MediaState is not connected, ess\n"));
- }
-
- return 0;
-
-}
-
-int rt_ioctl_siwnickn(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *nickname)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE ,("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (data->length > IW_ESSID_MAX_SIZE)
- return -EINVAL;
-
- memset(pAdapter->nickname, 0, IW_ESSID_MAX_SIZE + 1);
- memcpy(pAdapter->nickname, nickname, data->length);
-
-
- return 0;
-}
-
-int rt_ioctl_giwnickn(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *data, char *nickname)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- if (data->length > strlen((PSTRING) pAdapter->nickname) + 1)
- data->length = strlen((PSTRING) pAdapter->nickname) + 1;
- if (data->length > 0) {
- memcpy(nickname, pAdapter->nickname, data->length-1);
- nickname[data->length-1] = '\0';
- }
- return 0;
-}
-
-int rt_ioctl_siwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- u16 val;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (rts->disabled)
- val = MAX_RTS_THRESHOLD;
- else if (rts->value < 0 || rts->value > MAX_RTS_THRESHOLD)
- return -EINVAL;
- else if (rts->value == 0)
- val = MAX_RTS_THRESHOLD;
- else
- val = rts->value;
-
- if (val != pAdapter->CommonCfg.RtsThreshold)
- pAdapter->CommonCfg.RtsThreshold = val;
-
- return 0;
-}
-
-int rt_ioctl_giwrts(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *rts, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- rts->value = pAdapter->CommonCfg.RtsThreshold;
- rts->disabled = (rts->value == MAX_RTS_THRESHOLD);
- rts->fixed = 1;
-
- return 0;
-}
-
-int rt_ioctl_siwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- u16 val;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (frag->disabled)
- val = MAX_FRAG_THRESHOLD;
- else if (frag->value >= MIN_FRAG_THRESHOLD || frag->value <= MAX_FRAG_THRESHOLD)
- val = __cpu_to_le16(frag->value & ~0x1); /* even numbers only */
- else if (frag->value == 0)
- val = MAX_FRAG_THRESHOLD;
- else
- return -EINVAL;
-
- pAdapter->CommonCfg.FragmentThreshold = val;
- return 0;
-}
-
-int rt_ioctl_giwfrag(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *frag, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- frag->value = pAdapter->CommonCfg.FragmentThreshold;
- frag->disabled = (frag->value == MAX_FRAG_THRESHOLD);
- frag->fixed = 1;
-
- return 0;
-}
-
-#define MAX_WEP_KEY_SIZE 13
-#define MIN_WEP_KEY_SIZE 5
-int rt_ioctl_siwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if ((erq->length == 0) &&
- (erq->flags & IW_ENCODE_DISABLED))
- {
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- goto done;
- }
- else if (erq->flags & IW_ENCODE_RESTRICTED || erq->flags & IW_ENCODE_OPEN)
- {
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- if (erq->flags & IW_ENCODE_RESTRICTED)
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeShared;
- else
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- }
-
- if (erq->length > 0)
- {
- int keyIdx = (erq->flags & IW_ENCODE_INDEX) - 1;
- /* Check the size of the key */
- if (erq->length > MAX_WEP_KEY_SIZE)
- {
- return -EINVAL;
- }
- /* Check key index */
- if ((keyIdx < 0) || (keyIdx >= NR_WEP_KEYS))
- {
- DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::Wrong keyIdx=%d! Using default key instead (%d)\n",
- keyIdx, pAdapter->StaCfg.DefaultKeyId));
-
- //Using default key
- keyIdx = pAdapter->StaCfg.DefaultKeyId;
- }
- else
- pAdapter->StaCfg.DefaultKeyId = keyIdx;
-
- NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
-
- if (erq->length == MAX_WEP_KEY_SIZE)
- {
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = MAX_WEP_KEY_SIZE;
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_WEP128;
- }
- else if (erq->length == MIN_WEP_KEY_SIZE)
- {
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = MIN_WEP_KEY_SIZE;
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_WEP64;
- }
- else
- /* Disable the key */
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0;
-
- /* Check if the key is not marked as invalid */
- if(!(erq->flags & IW_ENCODE_NOKEY))
- {
- /* Copy the key in the driver */
- NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, extra, erq->length);
- }
- }
- else
- {
- /* Do we want to just set the transmit key index ? */
- int index = (erq->flags & IW_ENCODE_INDEX) - 1;
- if ((index >= 0) && (index < 4))
- {
- pAdapter->StaCfg.DefaultKeyId = index;
- }
- else
- /* Don't complain if only change the mode */
- if (!(erq->flags & IW_ENCODE_MODE))
- return -EINVAL;
- }
-
-done:
- DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::erq->flags=%x\n",erq->flags));
- DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::AuthMode=%x\n",pAdapter->StaCfg.AuthMode));
- DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::DefaultKeyId=%x, KeyLen = %d\n",pAdapter->StaCfg.DefaultKeyId , pAdapter->SharedKey[BSS0][pAdapter->StaCfg.DefaultKeyId].KeyLen));
- DBGPRINT(RT_DEBUG_TRACE ,("==>rt_ioctl_siwencode::WepStatus=%x\n",pAdapter->StaCfg.WepStatus));
- return 0;
-}
-
-int
-rt_ioctl_giwencode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *erq, char *key)
-{
- int kid;
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- kid = erq->flags & IW_ENCODE_INDEX;
- DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_giwencode %d\n", erq->flags & IW_ENCODE_INDEX));
-
- if (pAdapter->StaCfg.WepStatus == Ndis802_11WEPDisabled)
- {
- erq->length = 0;
- erq->flags = IW_ENCODE_DISABLED;
- }
- else if ((kid > 0) && (kid <=4))
- {
- // copy wep key
- erq->flags = kid ; /* NB: base 1 */
- if (erq->length > pAdapter->SharedKey[BSS0][kid-1].KeyLen)
- erq->length = pAdapter->SharedKey[BSS0][kid-1].KeyLen;
- memcpy(key, pAdapter->SharedKey[BSS0][kid-1].Key, erq->length);
- //if ((kid == pAdapter->PortCfg.DefaultKeyId))
- //erq->flags |= IW_ENCODE_ENABLED; /* XXX */
- if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeShared)
- erq->flags |= IW_ENCODE_RESTRICTED; /* XXX */
- else
- erq->flags |= IW_ENCODE_OPEN; /* XXX */
-
- }
- else if (kid == 0)
- {
- if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeShared)
- erq->flags |= IW_ENCODE_RESTRICTED; /* XXX */
- else
- erq->flags |= IW_ENCODE_OPEN; /* XXX */
- erq->length = pAdapter->SharedKey[BSS0][pAdapter->StaCfg.DefaultKeyId].KeyLen;
- memcpy(key, pAdapter->SharedKey[BSS0][pAdapter->StaCfg.DefaultKeyId].Key, erq->length);
- // copy default key ID
- if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeShared)
- erq->flags |= IW_ENCODE_RESTRICTED; /* XXX */
- else
- erq->flags |= IW_ENCODE_OPEN; /* XXX */
- erq->flags = pAdapter->StaCfg.DefaultKeyId + 1; /* NB: base 1 */
- erq->flags |= IW_ENCODE_ENABLED; /* XXX */
- }
-
- return 0;
-
-}
-
-static int
-rt_ioctl_setparam(struct net_device *dev, struct iw_request_info *info,
- void *w, char *extra)
-{
- PRTMP_ADAPTER pAdapter;
- POS_COOKIE pObj;
- PSTRING this_char = extra;
- PSTRING value;
- int Status=0;
-
- pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- if (pAdapter == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- pObj = (POS_COOKIE) pAdapter->OS_Cookie;
- {
- pObj->ioctl_if_type = INT_MAIN;
- pObj->ioctl_if = MAIN_MBSSID;
- }
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (!*this_char)
- return -EINVAL;
-
- if ((value = rtstrchr(this_char, '=')) != NULL)
- *value++ = 0;
-
- if (!value && (strcmp(this_char, "SiteSurvey") != 0))
- return -EINVAL;
- else
- goto SET_PROC;
-
- // reject setting nothing besides ANY ssid(ssidLen=0)
- if (!*value && (strcmp(this_char, "SSID") != 0))
- return -EINVAL;
-
-SET_PROC:
- for (PRTMP_PRIVATE_SET_PROC = RTMP_PRIVATE_SUPPORT_PROC; PRTMP_PRIVATE_SET_PROC->name; PRTMP_PRIVATE_SET_PROC++)
- {
- if (strcmp(this_char, PRTMP_PRIVATE_SET_PROC->name) == 0)
- {
- if(!PRTMP_PRIVATE_SET_PROC->set_proc(pAdapter, value))
- { //FALSE:Set private failed then return Invalid argument
- Status = -EINVAL;
- }
- break; //Exit for loop.
- }
- }
-
- if(PRTMP_PRIVATE_SET_PROC->name == NULL)
- { //Not found argument
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("===>rt_ioctl_setparam:: (iwpriv) Not Support Set Command [%s=%s]\n", this_char, value));
- }
-
- return Status;
-}
-
-
-static int
-rt_private_get_statistics(struct net_device *dev, struct iw_request_info *info,
- struct iw_point *wrq, char *extra)
-{
- INT Status = 0;
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if (extra == NULL)
- {
- wrq->length = 0;
- return -EIO;
- }
-
- memset(extra, 0x00, IW_PRIV_SIZE_MASK);
- sprintf(extra, "\n\n");
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- sprintf(extra+strlen(extra), "Tx success = %ld\n", (ULONG)pAd->ate.TxDoneCount);
- //sprintf(extra+strlen(extra), "Tx success without retry = %ld\n", (ULONG)pAd->ate.TxDoneCount);
- }
- else
-#endif // RALINK_ATE //
- {
- sprintf(extra+strlen(extra), "Tx success = %ld\n", (ULONG)pAd->WlanCounters.TransmittedFragmentCount.QuadPart);
- sprintf(extra+strlen(extra), "Tx success without retry = %ld\n", (ULONG)pAd->WlanCounters.TransmittedFragmentCount.QuadPart - (ULONG)pAd->WlanCounters.RetryCount.QuadPart);
- }
- sprintf(extra+strlen(extra), "Tx success after retry = %ld\n", (ULONG)pAd->WlanCounters.RetryCount.QuadPart);
- sprintf(extra+strlen(extra), "Tx fail to Rcv ACK after retry = %ld\n", (ULONG)pAd->WlanCounters.FailedCount.QuadPart);
- sprintf(extra+strlen(extra), "RTS Success Rcv CTS = %ld\n", (ULONG)pAd->WlanCounters.RTSSuccessCount.QuadPart);
- sprintf(extra+strlen(extra), "RTS Fail Rcv CTS = %ld\n", (ULONG)pAd->WlanCounters.RTSFailureCount.QuadPart);
-
- sprintf(extra+strlen(extra), "Rx success = %ld\n", (ULONG)pAd->WlanCounters.ReceivedFragmentCount.QuadPart);
- sprintf(extra+strlen(extra), "Rx with CRC = %ld\n", (ULONG)pAd->WlanCounters.FCSErrorCount.QuadPart);
- sprintf(extra+strlen(extra), "Rx drop due to out of resource = %ld\n", (ULONG)pAd->Counters8023.RxNoBuffer);
- sprintf(extra+strlen(extra), "Rx duplicate frame = %ld\n", (ULONG)pAd->WlanCounters.FrameDuplicateCount.QuadPart);
-
- sprintf(extra+strlen(extra), "False CCA (one second) = %ld\n", (ULONG)pAd->RalinkCounters.OneSecFalseCCACnt);
-
-#ifdef RALINK_ATE
- if (ATE_ON(pAd))
- {
- if (pAd->ate.RxAntennaSel == 0)
- {
- sprintf(extra+strlen(extra), "RSSI-A = %ld\n", (LONG)(pAd->ate.LastRssi0 - pAd->BbpRssiToDbmDelta));
- sprintf(extra+strlen(extra), "RSSI-B (if available) = %ld\n", (LONG)(pAd->ate.LastRssi1 - pAd->BbpRssiToDbmDelta));
- sprintf(extra+strlen(extra), "RSSI-C (if available) = %ld\n\n", (LONG)(pAd->ate.LastRssi2 - pAd->BbpRssiToDbmDelta));
- }
- else
- {
- sprintf(extra+strlen(extra), "RSSI = %ld\n", (LONG)(pAd->ate.LastRssi0 - pAd->BbpRssiToDbmDelta));
- }
- }
- else
-#endif // RALINK_ATE //
- {
- sprintf(extra+strlen(extra), "RSSI-A = %ld\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi0 - pAd->BbpRssiToDbmDelta));
- sprintf(extra+strlen(extra), "RSSI-B (if available) = %ld\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi1 - pAd->BbpRssiToDbmDelta));
- sprintf(extra+strlen(extra), "RSSI-C (if available) = %ld\n\n", (LONG)(pAd->StaCfg.RssiSample.LastRssi2 - pAd->BbpRssiToDbmDelta));
- }
-#ifdef WPA_SUPPLICANT_SUPPORT
- sprintf(extra+strlen(extra), "WpaSupplicantUP = %d\n\n", pAd->StaCfg.WpaSupplicantUP);
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-
-
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- DBGPRINT(RT_DEBUG_TRACE, ("<== rt_private_get_statistics, wrq->length = %d\n", wrq->length));
-
- return Status;
-}
-
-#ifdef DOT11_N_SUPPORT
-void getBaInfo(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING pOutBuf)
-{
- INT i, j;
- BA_ORI_ENTRY *pOriBAEntry;
- BA_REC_ENTRY *pRecBAEntry;
-
- for (i=0; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[i];
- if (((pEntry->ValidAsCLI || pEntry->ValidAsApCli) && (pEntry->Sst == SST_ASSOC))
- || (pEntry->ValidAsWDS) || (pEntry->ValidAsMesh))
- {
- sprintf(pOutBuf, "%s\n%02X:%02X:%02X:%02X:%02X:%02X (Aid = %d) (AP) -\n",
- pOutBuf,
- pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2],
- pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5], pEntry->Aid);
-
- sprintf(pOutBuf, "%s[Recipient]\n", pOutBuf);
- for (j=0; j < NUM_OF_TID; j++)
- {
- if (pEntry->BARecWcidArray[j] != 0)
- {
- pRecBAEntry =&pAd->BATable.BARecEntry[pEntry->BARecWcidArray[j]];
- sprintf(pOutBuf, "%sTID=%d, BAWinSize=%d, LastIndSeq=%d, ReorderingPkts=%d\n", pOutBuf, j, pRecBAEntry->BAWinSize, pRecBAEntry->LastIndSeq, pRecBAEntry->list.qlen);
- }
- }
- sprintf(pOutBuf, "%s\n", pOutBuf);
-
- sprintf(pOutBuf, "%s[Originator]\n", pOutBuf);
- for (j=0; j < NUM_OF_TID; j++)
- {
- if (pEntry->BAOriWcidArray[j] != 0)
- {
- pOriBAEntry =&pAd->BATable.BAOriEntry[pEntry->BAOriWcidArray[j]];
- sprintf(pOutBuf, "%sTID=%d, BAWinSize=%d, StartSeq=%d, CurTxSeq=%d\n", pOutBuf, j, pOriBAEntry->BAWinSize, pOriBAEntry->Sequence, pEntry->TxSeq[j]);
- }
- }
- sprintf(pOutBuf, "%s\n\n", pOutBuf);
- }
- if (strlen(pOutBuf) > (IW_PRIV_SIZE_MASK - 30))
- break;
- }
-
- return;
-}
-#endif // DOT11_N_SUPPORT //
-
-static int
-rt_private_show(struct net_device *dev, struct iw_request_info *info,
- struct iw_point *wrq, PSTRING extra)
-{
- INT Status = 0;
- PRTMP_ADAPTER pAd;
- POS_COOKIE pObj;
- u32 subcmd = wrq->flags;
-
- pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- if (pAd == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
-
- pObj = (POS_COOKIE) pAd->OS_Cookie;
- if (extra == NULL)
- {
- wrq->length = 0;
- return -EIO;
- }
- memset(extra, 0x00, IW_PRIV_SIZE_MASK);
-
- {
- pObj->ioctl_if_type = INT_MAIN;
- pObj->ioctl_if = MAIN_MBSSID;
- }
-
- switch(subcmd)
- {
-
- case SHOW_CONN_STATUS:
- if (MONITOR_ON(pAd))
- {
-#ifdef DOT11_N_SUPPORT
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED &&
- pAd->CommonCfg.RegTransmitSetting.field.BW)
- sprintf(extra, "Monitor Mode(CentralChannel %d)\n", pAd->CommonCfg.CentralChannel);
- else
-#endif // DOT11_N_SUPPORT //
- sprintf(extra, "Monitor Mode(Channel %d)\n", pAd->CommonCfg.Channel);
- }
- else
- {
- if (pAd->IndicateMediaState == NdisMediaStateConnected)
- {
- if (INFRA_ON(pAd))
- {
- sprintf(extra, "Connected(AP: %s[%02X:%02X:%02X:%02X:%02X:%02X])\n",
- pAd->CommonCfg.Ssid,
- pAd->CommonCfg.Bssid[0],
- pAd->CommonCfg.Bssid[1],
- pAd->CommonCfg.Bssid[2],
- pAd->CommonCfg.Bssid[3],
- pAd->CommonCfg.Bssid[4],
- pAd->CommonCfg.Bssid[5]);
- DBGPRINT(RT_DEBUG_TRACE ,("Ssid=%s ,Ssidlen = %d\n",pAd->CommonCfg.Ssid, pAd->CommonCfg.SsidLen));
- }
- else if (ADHOC_ON(pAd))
- sprintf(extra, "Connected\n");
- }
- else
- {
- sprintf(extra, "Disconnected\n");
- DBGPRINT(RT_DEBUG_TRACE ,("ConnStatus is not connected\n"));
- }
- }
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
- case SHOW_DRVIER_VERION:
- sprintf(extra, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION, __DATE__, __TIME__ );
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
-#ifdef DOT11_N_SUPPORT
- case SHOW_BA_INFO:
- getBaInfo(pAd, extra);
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
-#endif // DOT11_N_SUPPORT //
- case SHOW_DESC_INFO:
- {
- Show_DescInfo_Proc(pAd, NULL);
- wrq->length = 0; // 1: size of '\0'
- }
- break;
- case RAIO_OFF:
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
- }
- pAd->StaCfg.bSwRadio = FALSE;
- if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
- {
- pAd->StaCfg.bRadio = (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio);
- if (pAd->StaCfg.bRadio == FALSE)
- {
- MlmeRadioOff(pAd);
- // Update extra information
- pAd->ExtraInfo = SW_RADIO_OFF;
- }
- }
- sprintf(extra, "Radio Off\n");
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
- case RAIO_ON:
- pAd->StaCfg.bSwRadio = TRUE;
- //if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
- {
- pAd->StaCfg.bRadio = (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio);
- if (pAd->StaCfg.bRadio == TRUE)
- {
- MlmeRadioOn(pAd);
- // Update extra information
- pAd->ExtraInfo = EXTRA_INFO_CLEAR;
- }
- }
- sprintf(extra, "Radio On\n");
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
-
-
-#ifdef QOS_DLS_SUPPORT
- case SHOW_DLS_ENTRY_INFO:
- {
- Set_DlsEntryInfo_Display_Proc(pAd, NULL);
- wrq->length = 0; // 1: size of '\0'
- }
- break;
-#endif // QOS_DLS_SUPPORT //
-
- case SHOW_CFG_VALUE:
- {
- Status = RTMPShowCfgValue(pAd, (PSTRING) wrq->pointer, extra);
- if (Status == 0)
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- }
- break;
- case SHOW_ADHOC_ENTRY_INFO:
- Show_Adhoc_MacTable_Proc(pAd, extra);
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- break;
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("%s - unknow subcmd = %d\n", __FUNCTION__, subcmd));
- break;
- }
-
- return Status;
-}
-
-#ifdef SIOCSIWMLME
-int rt_ioctl_siwmlme(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_mlme *pMlme = (struct iw_mlme *)wrqu->data.pointer;
- MLME_QUEUE_ELEM MsgElem;
- MLME_DISASSOC_REQ_STRUCT DisAssocReq;
- MLME_DEAUTH_REQ_STRUCT DeAuthReq;
-
- DBGPRINT(RT_DEBUG_TRACE, ("====> %s\n", __FUNCTION__));
-
- if (pMlme == NULL)
- return -EINVAL;
-
- switch(pMlme->cmd)
- {
-#ifdef IW_MLME_DEAUTH
- case IW_MLME_DEAUTH:
- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DEAUTH\n", __FUNCTION__));
- COPY_MAC_ADDR(DeAuthReq.Addr, pAd->CommonCfg.Bssid);
- DeAuthReq.Reason = pMlme->reason_code;
- MsgElem.MsgLen = sizeof(MLME_DEAUTH_REQ_STRUCT);
- NdisMoveMemory(MsgElem.Msg, &DeAuthReq, sizeof(MLME_DEAUTH_REQ_STRUCT));
- MlmeDeauthReqAction(pAd, &MsgElem);
- if (INFRA_ON(pAd))
- {
- LinkDown(pAd, FALSE);
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- }
- break;
-#endif // IW_MLME_DEAUTH //
-#ifdef IW_MLME_DISASSOC
- case IW_MLME_DISASSOC:
- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - IW_MLME_DISASSOC\n", __FUNCTION__));
- COPY_MAC_ADDR(DisAssocReq.Addr, pAd->CommonCfg.Bssid);
- DisAssocReq.Reason = pMlme->reason_code;
-
- MsgElem.Machine = ASSOC_STATE_MACHINE;
- MsgElem.MsgType = MT2_MLME_DISASSOC_REQ;
- MsgElem.MsgLen = sizeof(MLME_DISASSOC_REQ_STRUCT);
- NdisMoveMemory(MsgElem.Msg, &DisAssocReq, sizeof(MLME_DISASSOC_REQ_STRUCT));
-
- pAd->Mlme.CntlMachine.CurrState = CNTL_WAIT_OID_DISASSOC;
- MlmeDisassocReqAction(pAd, &MsgElem);
- break;
-#endif // IW_MLME_DISASSOC //
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("====> %s - Unknow Command\n", __FUNCTION__));
- break;
- }
-
- return 0;
-}
-#endif // SIOCSIWMLME //
-
-#if WIRELESS_EXT > 17
-int rt_ioctl_siwauth(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_param *param = &wrqu->param;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
- switch (param->flags & IW_AUTH_INDEX) {
- case IW_AUTH_WPA_VERSION:
- if (param->value == IW_AUTH_WPA_VERSION_WPA)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPAPSK;
- if (pAdapter->StaCfg.BssType == BSS_ADHOC)
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
- }
- else if (param->value == IW_AUTH_WPA_VERSION_WPA2)
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
-
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_CIPHER_PAIRWISE:
- if (param->value == IW_AUTH_CIPHER_NONE)
- {
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
- }
- else if (param->value == IW_AUTH_CIPHER_WEP40 ||
- param->value == IW_AUTH_CIPHER_WEP104)
- {
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
-#ifdef WPA_SUPPLICANT_SUPPORT
- pAdapter->StaCfg.IEEE8021X = FALSE;
-#endif // WPA_SUPPLICANT_SUPPORT //
- }
- else if (param->value == IW_AUTH_CIPHER_TKIP)
- {
- pAdapter->StaCfg.WepStatus = Ndis802_11Encryption2Enabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
- }
- else if (param->value == IW_AUTH_CIPHER_CCMP)
- {
- pAdapter->StaCfg.WepStatus = Ndis802_11Encryption3Enabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.PairCipher = Ndis802_11Encryption3Enabled;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_PAIRWISE - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_CIPHER_GROUP:
- if (param->value == IW_AUTH_CIPHER_NONE)
- {
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
- }
- else if (param->value == IW_AUTH_CIPHER_WEP40 ||
- param->value == IW_AUTH_CIPHER_WEP104)
- {
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled;
- }
- else if (param->value == IW_AUTH_CIPHER_TKIP)
- {
- pAdapter->StaCfg.GroupCipher = Ndis802_11Encryption2Enabled;
- }
- else if (param->value == IW_AUTH_CIPHER_CCMP)
- {
- pAdapter->StaCfg.GroupCipher = Ndis802_11Encryption3Enabled;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_CIPHER_GROUP - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_KEY_MGMT:
- if (param->value == IW_AUTH_KEY_MGMT_802_1X)
- {
- if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
-#ifdef WPA_SUPPLICANT_SUPPORT
- pAdapter->StaCfg.IEEE8021X = FALSE;
-#endif // WPA_SUPPLICANT_SUPPORT //
- }
- else if (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
-#ifdef WPA_SUPPLICANT_SUPPORT
- pAdapter->StaCfg.IEEE8021X = FALSE;
-#endif // WPA_SUPPLICANT_SUPPORT //
- }
-#ifdef WPA_SUPPLICANT_SUPPORT
- else
- // WEP 1x
- pAdapter->StaCfg.IEEE8021X = TRUE;
-#endif // WPA_SUPPLICANT_SUPPORT //
- }
- else if (param->value == 0)
- {
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_KEY_MGMT - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_RX_UNENCRYPTED_EAPOL:
- break;
- case IW_AUTH_PRIVACY_INVOKED:
- /*if (param->value == 0)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
- }*/
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_PRIVACY_INVOKED - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_DROP_UNENCRYPTED:
- if (param->value != 0)
- pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- else
- {
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_VERSION - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_80211_AUTH_ALG:
- if (param->value & IW_AUTH_ALG_SHARED_KEY)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeShared;
- }
- else if (param->value & IW_AUTH_ALG_OPEN_SYSTEM)
- {
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- }
- else
- return -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_80211_AUTH_ALG - param->value = %d!\n", __FUNCTION__, param->value));
- break;
- case IW_AUTH_WPA_ENABLED:
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_AUTH_WPA_ENABLED - Driver supports WPA!(param->value = %d)\n", __FUNCTION__, param->value));
- break;
- default:
- return -EOPNOTSUPP;
-}
-
- return 0;
-}
-
-int rt_ioctl_giwauth(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_param *param = &wrqu->param;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- switch (param->flags & IW_AUTH_INDEX) {
- case IW_AUTH_DROP_UNENCRYPTED:
- param->value = (pAdapter->StaCfg.WepStatus == Ndis802_11WEPDisabled) ? 0 : 1;
- break;
-
- case IW_AUTH_80211_AUTH_ALG:
- param->value = (pAdapter->StaCfg.AuthMode == Ndis802_11AuthModeShared) ? IW_AUTH_ALG_SHARED_KEY : IW_AUTH_ALG_OPEN_SYSTEM;
- break;
-
- case IW_AUTH_WPA_ENABLED:
- param->value = (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) ? 1 : 0;
- break;
-
- default:
- return -EOPNOTSUPP;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("rt_ioctl_giwauth::param->value = %d!\n", param->value));
- return 0;
-}
-
-void fnSetCipherKey(
- IN PRTMP_ADAPTER pAdapter,
- IN INT keyIdx,
- IN UCHAR CipherAlg,
- IN BOOLEAN bGTK,
- IN struct iw_encode_ext *ext)
-{
- NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = LEN_TKIP_EK;
- NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, LEN_TKIP_EK);
- NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].TxMic, ext->key + LEN_TKIP_EK, LEN_TKIP_TXMICK);
- NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].RxMic, ext->key + LEN_TKIP_EK + LEN_TKIP_TXMICK, LEN_TKIP_RXMICK);
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CipherAlg;
-
- // Update group key information to ASIC Shared Key Table
- AsicAddSharedKeyEntry(pAdapter,
- BSS0,
- keyIdx,
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg,
- pAdapter->SharedKey[BSS0][keyIdx].Key,
- pAdapter->SharedKey[BSS0][keyIdx].TxMic,
- pAdapter->SharedKey[BSS0][keyIdx].RxMic);
-
- if (bGTK)
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAdapter,
- BSS0,
- keyIdx,
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg,
- NULL);
- else
- // Update ASIC WCID attribute table and IVEIV table
- RTMPAddWcidAttributeEntry(pAdapter,
- BSS0,
- keyIdx,
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg,
- &pAdapter->MacTab.Content[BSSID_WCID]);
-}
-
-int rt_ioctl_siwencodeext(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
- {
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_point *encoding = &wrqu->encoding;
- struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
- int keyIdx, alg = ext->alg;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAdapter, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (encoding->flags & IW_ENCODE_DISABLED)
- {
- keyIdx = (encoding->flags & IW_ENCODE_INDEX) - 1;
- // set BSSID wcid entry of the Pair-wise Key table as no-security mode
- AsicRemovePairwiseKeyEntry(pAdapter, BSS0, BSSID_WCID);
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = 0;
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_NONE;
- AsicRemoveSharedKeyEntry(pAdapter, 0, (UCHAR)keyIdx);
- NdisZeroMemory(&pAdapter->SharedKey[BSS0][keyIdx], sizeof(CIPHER_KEY));
- DBGPRINT(RT_DEBUG_TRACE, ("%s::Remove all keys!(encoding->flags = %x)\n", __FUNCTION__, encoding->flags));
- }
- else
- {
- // Get Key Index and convet to our own defined key index
- keyIdx = (encoding->flags & IW_ENCODE_INDEX) - 1;
- if((keyIdx < 0) || (keyIdx >= NR_WEP_KEYS))
- return -EINVAL;
-
- if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
- {
- pAdapter->StaCfg.DefaultKeyId = keyIdx;
- DBGPRINT(RT_DEBUG_TRACE, ("%s::DefaultKeyId = %d\n", __FUNCTION__, pAdapter->StaCfg.DefaultKeyId));
- }
-
- switch (alg) {
- case IW_ENCODE_ALG_NONE:
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_NONE\n", __FUNCTION__));
- break;
- case IW_ENCODE_ALG_WEP:
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_WEP - ext->key_len = %d, keyIdx = %d\n", __FUNCTION__, ext->key_len, keyIdx));
- if (ext->key_len == MAX_WEP_KEY_SIZE)
- {
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = MAX_WEP_KEY_SIZE;
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_WEP128;
- }
- else if (ext->key_len == MIN_WEP_KEY_SIZE)
- {
- pAdapter->SharedKey[BSS0][keyIdx].KeyLen = MIN_WEP_KEY_SIZE;
- pAdapter->SharedKey[BSS0][keyIdx].CipherAlg = CIPHER_WEP64;
- }
- else
- return -EINVAL;
-
- NdisZeroMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, 16);
- NdisMoveMemory(pAdapter->SharedKey[BSS0][keyIdx].Key, ext->key, ext->key_len);
-
- if (pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP40Enabled ||
- pAdapter->StaCfg.GroupCipher == Ndis802_11GroupWEP104Enabled)
- {
- // Set Group key material to Asic
- AsicAddSharedKeyEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, pAdapter->SharedKey[BSS0][keyIdx].Key, NULL, NULL);
- // Update WCID attribute table and IVEIV table for this group key table
- RTMPAddWcidAttributeEntry(pAdapter, BSS0, keyIdx, pAdapter->SharedKey[BSS0][keyIdx].CipherAlg, NULL);
- STA_PORT_SECURED(pAdapter);
- // Indicate Connected for GUI
- pAdapter->IndicateMediaState = NdisMediaStateConnected;
- }
- break;
- case IW_ENCODE_ALG_TKIP:
- DBGPRINT(RT_DEBUG_TRACE, ("%s::IW_ENCODE_ALG_TKIP - keyIdx = %d, ext->key_len = %d\n", __FUNCTION__, keyIdx, ext->key_len));
- if (ext->key_len == 32)
- {
- if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
- {
- fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, FALSE, ext);
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
- {
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- pAdapter->IndicateMediaState = NdisMediaStateConnected;
- }
- }
- else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
- {
- fnSetCipherKey(pAdapter, keyIdx, CIPHER_TKIP, TRUE, ext);
-
- // set 802.1x port control
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- pAdapter->IndicateMediaState = NdisMediaStateConnected;
- }
- }
- else
- return -EINVAL;
- break;
- case IW_ENCODE_ALG_CCMP:
- if (ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY)
- {
- fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, FALSE, ext);
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA2)
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- pAdapter->IndicateMediaState = NdisMediaStateConnected;
- }
- else if (ext->ext_flags & IW_ENCODE_EXT_GROUP_KEY)
- {
- fnSetCipherKey(pAdapter, keyIdx, CIPHER_AES, TRUE, ext);
-
- // set 802.1x port control
- //pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- STA_PORT_SECURED(pAdapter);
- pAdapter->IndicateMediaState = NdisMediaStateConnected;
- }
- break;
- default:
- return -EINVAL;
- }
- }
-
- return 0;
-}
-
-int
-rt_ioctl_giwencodeext(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- PCHAR pKey = NULL;
- struct iw_point *encoding = &wrqu->encoding;
- struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
- int idx, max_key_len;
-
- DBGPRINT(RT_DEBUG_TRACE ,("===> rt_ioctl_giwencodeext\n"));
-
- max_key_len = encoding->length - sizeof(*ext);
- if (max_key_len < 0)
- return -EINVAL;
-
- idx = encoding->flags & IW_ENCODE_INDEX;
- if (idx)
- {
- if (idx < 1 || idx > 4)
- return -EINVAL;
- idx--;
-
- if ((pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled) ||
- (pAd->StaCfg.WepStatus == Ndis802_11Encryption3Enabled))
- {
- if (idx != pAd->StaCfg.DefaultKeyId)
- {
- ext->key_len = 0;
- return 0;
- }
- }
- }
- else
- idx = pAd->StaCfg.DefaultKeyId;
-
- encoding->flags = idx + 1;
- memset(ext, 0, sizeof(*ext));
-
- ext->key_len = 0;
- switch(pAd->StaCfg.WepStatus) {
- case Ndis802_11WEPDisabled:
- ext->alg = IW_ENCODE_ALG_NONE;
- encoding->flags |= IW_ENCODE_DISABLED;
- break;
- case Ndis802_11WEPEnabled:
- ext->alg = IW_ENCODE_ALG_WEP;
- if (pAd->SharedKey[BSS0][idx].KeyLen > max_key_len)
- return -E2BIG;
- else
- {
- ext->key_len = pAd->SharedKey[BSS0][idx].KeyLen;
- pKey = (PCHAR)&(pAd->SharedKey[BSS0][idx].Key[0]);
- }
- break;
- case Ndis802_11Encryption2Enabled:
- case Ndis802_11Encryption3Enabled:
- if (pAd->StaCfg.WepStatus == Ndis802_11Encryption2Enabled)
- ext->alg = IW_ENCODE_ALG_TKIP;
- else
- ext->alg = IW_ENCODE_ALG_CCMP;
-
- if (max_key_len < 32)
- return -E2BIG;
- else
- {
- ext->key_len = 32;
- pKey = (PCHAR)&pAd->StaCfg.PMK[0];
- }
- break;
- default:
- return -EINVAL;
- }
-
- if (ext->key_len && pKey)
- {
- encoding->flags |= IW_ENCODE_ENABLED;
- memcpy(ext->key, pKey, ext->key_len);
- }
-
- return 0;
-}
-
-#ifdef SIOCSIWGENIE
-int rt_ioctl_siwgenie(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- DBGPRINT(RT_DEBUG_TRACE ,("===> rt_ioctl_siwgenie\n"));
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- pAd->StaCfg.bRSN_IE_FromWpaSupplicant = FALSE;
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- if (wrqu->data.length > MAX_LEN_OF_RSNIE ||
- (wrqu->data.length && extra == NULL))
- return -EINVAL;
-
- if (wrqu->data.length)
- {
- pAd->StaCfg.RSNIE_Len = wrqu->data.length;
- NdisMoveMemory(&pAd->StaCfg.RSN_IE[0], extra, pAd->StaCfg.RSNIE_Len);
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
- pAd->StaCfg.bRSN_IE_FromWpaSupplicant = TRUE;
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- }
- else
- {
- pAd->StaCfg.RSNIE_Len = 0;
- NdisZeroMemory(&pAd->StaCfg.RSN_IE[0], MAX_LEN_OF_RSNIE);
- }
-
- return 0;
-}
-#endif // SIOCSIWGENIE //
-
-int rt_ioctl_giwgenie(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
-
- if ((pAd->StaCfg.RSNIE_Len == 0) ||
- (pAd->StaCfg.AuthMode < Ndis802_11AuthModeWPA))
- {
- wrqu->data.length = 0;
- return 0;
- }
-
-#ifdef NATIVE_WPA_SUPPLICANT_SUPPORT
-#ifdef SIOCSIWGENIE
- if (pAd->StaCfg.WpaSupplicantUP == WPA_SUPPLICANT_ENABLE)
- {
- if (wrqu->data.length < pAd->StaCfg.RSNIE_Len)
- return -E2BIG;
-
- wrqu->data.length = pAd->StaCfg.RSNIE_Len;
- memcpy(extra, &pAd->StaCfg.RSN_IE[0], pAd->StaCfg.RSNIE_Len);
- }
- else
-#endif // SIOCSIWGENIE //
-#endif // NATIVE_WPA_SUPPLICANT_SUPPORT //
- {
- UCHAR RSNIe = IE_WPA;
-
- if (wrqu->data.length < (pAd->StaCfg.RSNIE_Len + 2)) // ID, Len
- return -E2BIG;
- wrqu->data.length = pAd->StaCfg.RSNIE_Len + 2;
-
- if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2))
- RSNIe = IE_RSN;
-
- extra[0] = (char)RSNIe;
- extra[1] = pAd->StaCfg.RSNIE_Len;
- memcpy(extra+2, &pAd->StaCfg.RSN_IE[0], pAd->StaCfg.RSNIE_Len);
- }
-
- return 0;
-}
-
-int rt_ioctl_siwpmksa(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu,
- char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- struct iw_pmksa *pPmksa = (struct iw_pmksa *)wrqu->data.pointer;
- INT CachedIdx = 0, idx = 0;
-
- if (pPmksa == NULL)
- return -EINVAL;
-
- DBGPRINT(RT_DEBUG_TRACE ,("===> rt_ioctl_siwpmksa\n"));
- switch(pPmksa->cmd)
- {
- case IW_PMKSA_FLUSH:
- NdisZeroMemory(pAd->StaCfg.SavedPMK, sizeof(BSSID_INFO)*PMKID_NO);
- DBGPRINT(RT_DEBUG_TRACE ,("rt_ioctl_siwpmksa - IW_PMKSA_FLUSH\n"));
- break;
- case IW_PMKSA_REMOVE:
- for (CachedIdx = 0; CachedIdx < pAd->StaCfg.SavedPMKNum; CachedIdx++)
- {
- // compare the BSSID
- if (NdisEqualMemory(pPmksa->bssid.sa_data, pAd->StaCfg.SavedPMK[CachedIdx].BSSID, MAC_ADDR_LEN))
- {
- NdisZeroMemory(pAd->StaCfg.SavedPMK[CachedIdx].BSSID, MAC_ADDR_LEN);
- NdisZeroMemory(pAd->StaCfg.SavedPMK[CachedIdx].PMKID, 16);
- for (idx = CachedIdx; idx < (pAd->StaCfg.SavedPMKNum - 1); idx++)
- {
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[idx].BSSID[0], &pAd->StaCfg.SavedPMK[idx+1].BSSID[0], MAC_ADDR_LEN);
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[idx].PMKID[0], &pAd->StaCfg.SavedPMK[idx+1].PMKID[0], 16);
- }
- pAd->StaCfg.SavedPMKNum--;
- break;
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE ,("rt_ioctl_siwpmksa - IW_PMKSA_REMOVE\n"));
- break;
- case IW_PMKSA_ADD:
- for (CachedIdx = 0; CachedIdx < pAd->StaCfg.SavedPMKNum; CachedIdx++)
- {
- // compare the BSSID
- if (NdisEqualMemory(pPmksa->bssid.sa_data, pAd->StaCfg.SavedPMK[CachedIdx].BSSID, MAC_ADDR_LEN))
- break;
- }
-
- // Found, replace it
- if (CachedIdx < PMKID_NO)
- {
- DBGPRINT(RT_DEBUG_OFF, ("Update PMKID, idx = %d\n", CachedIdx));
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx].BSSID[0], pPmksa->bssid.sa_data, MAC_ADDR_LEN);
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx].PMKID[0], pPmksa->pmkid, 16);
- pAd->StaCfg.SavedPMKNum++;
- }
- // Not found, replace the last one
- else
- {
- // Randomly replace one
- CachedIdx = (pPmksa->bssid.sa_data[5] % PMKID_NO);
- DBGPRINT(RT_DEBUG_OFF, ("Update PMKID, idx = %d\n", CachedIdx));
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx].BSSID[0], pPmksa->bssid.sa_data, MAC_ADDR_LEN);
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx].PMKID[0], pPmksa->pmkid, 16);
- }
-
- DBGPRINT(RT_DEBUG_TRACE ,("rt_ioctl_siwpmksa - IW_PMKSA_ADD\n"));
- break;
- default:
- DBGPRINT(RT_DEBUG_TRACE ,("rt_ioctl_siwpmksa - Unknow Command!!\n"));
- break;
- }
-
- return 0;
-}
-#endif // #if WIRELESS_EXT > 17
-
-#ifdef DBG
-static int
-rt_private_ioctl_bbp(struct net_device *dev, struct iw_request_info *info,
- struct iw_point *wrq, char *extra)
- {
- PSTRING this_char;
- PSTRING value = NULL;
- UCHAR regBBP = 0;
-// CHAR arg[255]={0};
- UINT32 bbpId;
- UINT32 bbpValue;
- BOOLEAN bIsPrintAllBBP = FALSE;
- INT Status = 0;
- PRTMP_ADAPTER pAdapter = RTMP_OS_NETDEV_GET_PRIV(dev);
-
-
- memset(extra, 0x00, IW_PRIV_SIZE_MASK);
-
- if (wrq->length > 1) //No parameters.
- {
- sprintf(extra, "\n");
-
- //Parsing Read or Write
- this_char = wrq->pointer;
- DBGPRINT(RT_DEBUG_TRACE, ("this_char=%s\n", this_char));
- if (!*this_char)
- goto next;
-
- if ((value = rtstrchr(this_char, '=')) != NULL)
- *value++ = 0;
-
- if (!value || !*value)
- { //Read
- DBGPRINT(RT_DEBUG_TRACE, ("this_char=%s, value=%s\n", this_char, value));
- if (sscanf(this_char, "%d", &(bbpId)) == 1)
- {
- if (bbpId <= MAX_BBP_ID)
- {
-#ifdef RALINK_ATE
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- }
- else
-#endif // RALINK_ATE //
- {
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- }
- sprintf(extra+strlen(extra), "R%02d[0x%02X]:%02X\n", bbpId, bbpId, regBBP);
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- DBGPRINT(RT_DEBUG_TRACE, ("msg=%s\n", extra));
- }
- else
- {//Invalid parametes, so default printk all bbp
- bIsPrintAllBBP = TRUE;
- goto next;
- }
- }
- else
- { //Invalid parametes, so default printk all bbp
- bIsPrintAllBBP = TRUE;
- goto next;
- }
- }
- else
- { //Write
- if ((sscanf(this_char, "%d", &(bbpId)) == 1) && (sscanf(value, "%x", &(bbpValue)) == 1))
- {
- if (bbpId <= MAX_BBP_ID)
- {
-#ifdef RALINK_ATE
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAdapter, bbpId, bbpValue);
- /* read it back for showing */
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- }
- else
-#endif // RALINK_ATE //
- {
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, bbpId, bbpValue);
- /* read it back for showing */
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- }
- sprintf(extra+strlen(extra), "R%02d[0x%02X]:%02X\n", bbpId, bbpId, regBBP);
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- DBGPRINT(RT_DEBUG_TRACE, ("msg=%s\n", extra));
- }
- else
- {//Invalid parametes, so default printk all bbp
- bIsPrintAllBBP = TRUE;
- goto next;
- }
- }
- else
- { //Invalid parametes, so default printk all bbp
- bIsPrintAllBBP = TRUE;
- goto next;
- }
- }
- }
- else
- bIsPrintAllBBP = TRUE;
-
-next:
- if (bIsPrintAllBBP)
- {
- memset(extra, 0x00, IW_PRIV_SIZE_MASK);
- sprintf(extra, "\n");
- for (bbpId = 0; bbpId <= MAX_BBP_ID; bbpId++)
- {
- if (strlen(extra) >= (IW_PRIV_SIZE_MASK - 20))
- break;
-#ifdef RALINK_ATE
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- }
- else
-#endif // RALINK_ATE //
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- sprintf(extra+strlen(extra), "R%02d[0x%02X]:%02X ", bbpId, bbpId, regBBP);
- if (bbpId%5 == 4)
- sprintf(extra+strlen(extra), "%03d = %02X\n", bbpId, regBBP); // edit by johnli, change display format
- }
-
- wrq->length = strlen(extra) + 1; // 1: size of '\0'
- DBGPRINT(RT_DEBUG_TRACE, ("wrq->length = %d\n", wrq->length));
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==rt_private_ioctl_bbp\n\n"));
-
- return Status;
-}
-#endif // DBG //
-
-int rt_ioctl_siwrate(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- UINT32 rate = wrqu->bitrate.value, fixed = wrqu->bitrate.fixed;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("rt_ioctl_siwrate::Network is down!\n"));
- return -ENETDOWN;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("rt_ioctl_siwrate::(rate = %d, fixed = %d)\n", rate, fixed));
- /* rate = -1 => auto rate
- rate = X, fixed = 1 => (fixed rate X)
- */
- if (rate == -1)
- {
- //Auto Rate
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
- pAd->StaCfg.bAutoTxRateSwitch = TRUE;
- if ((pAd->CommonCfg.PhyMode <= PHY_11G) ||
- (pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE <= MODE_OFDM))
- RTMPSetDesiredRates(pAd, -1);
-
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- }
- else
- {
- if (fixed)
- {
- pAd->StaCfg.bAutoTxRateSwitch = FALSE;
- if ((pAd->CommonCfg.PhyMode <= PHY_11G) ||
- (pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE <= MODE_OFDM))
- RTMPSetDesiredRates(pAd, rate);
- else
- {
- pAd->StaCfg.DesiredTransmitSetting.field.MCS = MCS_AUTO;
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- }
- DBGPRINT(RT_DEBUG_TRACE, ("rt_ioctl_siwrate::(HtMcs=%d)\n",pAd->StaCfg.DesiredTransmitSetting.field.MCS));
- }
- else
- {
- // TODO: rate = X, fixed = 0 => (rates <= X)
- return -EOPNOTSUPP;
- }
- }
-
- return 0;
-}
-
-int rt_ioctl_giwrate(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- PRTMP_ADAPTER pAd = RTMP_OS_NETDEV_GET_PRIV(dev);
- int rate_index = 0, rate_count = 0;
- HTTRANSMIT_SETTING ht_setting;
-/* Remove to global variable
- __s32 ralinkrate[] =
- {2, 4, 11, 22, // CCK
- 12, 18, 24, 36, 48, 72, 96, 108, // OFDM
- 13, 26, 39, 52, 78, 104, 117, 130, 26, 52, 78, 104, 156, 208, 234, 260, // 20MHz, 800ns GI, MCS: 0 ~ 15
- 39, 78, 117, 156, 234, 312, 351, 390, // 20MHz, 800ns GI, MCS: 16 ~ 23
- 27, 54, 81, 108, 162, 216, 243, 270, 54, 108, 162, 216, 324, 432, 486, 540, // 40MHz, 800ns GI, MCS: 0 ~ 15
- 81, 162, 243, 324, 486, 648, 729, 810, // 40MHz, 800ns GI, MCS: 16 ~ 23
- 14, 29, 43, 57, 87, 115, 130, 144, 29, 59, 87, 115, 173, 230, 260, 288, // 20MHz, 400ns GI, MCS: 0 ~ 15
- 43, 87, 130, 173, 260, 317, 390, 433, // 20MHz, 400ns GI, MCS: 16 ~ 23
- 30, 60, 90, 120, 180, 240, 270, 300, 60, 120, 180, 240, 360, 480, 540, 600, // 40MHz, 400ns GI, MCS: 0 ~ 15
- 90, 180, 270, 360, 540, 720, 810, 900}; // 40MHz, 400ns GI, MCS: 16 ~ 23
-*/
-
- rate_count = sizeof(ralinkrate)/sizeof(__s32);
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if ((pAd->StaCfg.bAutoTxRateSwitch == FALSE) &&
- (INFRA_ON(pAd)) &&
- ((pAd->CommonCfg.PhyMode <= PHY_11G) || (pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE <= MODE_OFDM)))
- ht_setting.word = pAd->StaCfg.HTPhyMode.word;
- else
- ht_setting.word = pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word;
-
-#ifdef DOT11_N_SUPPORT
- if (ht_setting.field.MODE >= MODE_HTMIX)
- {
-// rate_index = 12 + ((UCHAR)ht_setting.field.BW *16) + ((UCHAR)ht_setting.field.ShortGI *32) + ((UCHAR)ht_setting.field.MCS);
- rate_index = 12 + ((UCHAR)ht_setting.field.BW *24) + ((UCHAR)ht_setting.field.ShortGI *48) + ((UCHAR)ht_setting.field.MCS);
- }
- else
-#endif // DOT11_N_SUPPORT //
- if (ht_setting.field.MODE == MODE_OFDM)
- rate_index = (UCHAR)(ht_setting.field.MCS) + 4;
- else if (ht_setting.field.MODE == MODE_CCK)
- rate_index = (UCHAR)(ht_setting.field.MCS);
-
- if (rate_index < 0)
- rate_index = 0;
-
- if (rate_index > rate_count)
- rate_index = rate_count;
-
- wrqu->bitrate.value = ralinkrate[rate_index] * 500000;
- wrqu->bitrate.disabled = 0;
-
- return 0;
-}
-
-static const iw_handler rt_handler[] =
-{
- (iw_handler) NULL, /* SIOCSIWCOMMIT */
- (iw_handler) rt_ioctl_giwname, /* SIOCGIWNAME */
- (iw_handler) NULL, /* SIOCSIWNWID */
- (iw_handler) NULL, /* SIOCGIWNWID */
- (iw_handler) rt_ioctl_siwfreq, /* SIOCSIWFREQ */
- (iw_handler) rt_ioctl_giwfreq, /* SIOCGIWFREQ */
- (iw_handler) rt_ioctl_siwmode, /* SIOCSIWMODE */
- (iw_handler) rt_ioctl_giwmode, /* SIOCGIWMODE */
- (iw_handler) NULL, /* SIOCSIWSENS */
- (iw_handler) NULL, /* SIOCGIWSENS */
- (iw_handler) NULL /* not used */, /* SIOCSIWRANGE */
- (iw_handler) rt_ioctl_giwrange, /* SIOCGIWRANGE */
- (iw_handler) NULL /* not used */, /* SIOCSIWPRIV */
- (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
- (iw_handler) NULL /* not used */, /* SIOCSIWSTATS */
- (iw_handler) rt28xx_get_wireless_stats /* kernel code */, /* SIOCGIWSTATS */
- (iw_handler) NULL, /* SIOCSIWSPY */
- (iw_handler) NULL, /* SIOCGIWSPY */
- (iw_handler) NULL, /* SIOCSIWTHRSPY */
- (iw_handler) NULL, /* SIOCGIWTHRSPY */
- (iw_handler) rt_ioctl_siwap, /* SIOCSIWAP */
- (iw_handler) rt_ioctl_giwap, /* SIOCGIWAP */
-#ifdef SIOCSIWMLME
- (iw_handler) rt_ioctl_siwmlme, /* SIOCSIWMLME */
-#else
- (iw_handler) NULL, /* SIOCSIWMLME */
-#endif // SIOCSIWMLME //
- (iw_handler) rt_ioctl_iwaplist, /* SIOCGIWAPLIST */
-#ifdef SIOCGIWSCAN
- (iw_handler) rt_ioctl_siwscan, /* SIOCSIWSCAN */
- (iw_handler) rt_ioctl_giwscan, /* SIOCGIWSCAN */
-#else
- (iw_handler) NULL, /* SIOCSIWSCAN */
- (iw_handler) NULL, /* SIOCGIWSCAN */
-#endif /* SIOCGIWSCAN */
- (iw_handler) rt_ioctl_siwessid, /* SIOCSIWESSID */
- (iw_handler) rt_ioctl_giwessid, /* SIOCGIWESSID */
- (iw_handler) rt_ioctl_siwnickn, /* SIOCSIWNICKN */
- (iw_handler) rt_ioctl_giwnickn, /* SIOCGIWNICKN */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) rt_ioctl_siwrate, /* SIOCSIWRATE */
- (iw_handler) rt_ioctl_giwrate, /* SIOCGIWRATE */
- (iw_handler) rt_ioctl_siwrts, /* SIOCSIWRTS */
- (iw_handler) rt_ioctl_giwrts, /* SIOCGIWRTS */
- (iw_handler) rt_ioctl_siwfrag, /* SIOCSIWFRAG */
- (iw_handler) rt_ioctl_giwfrag, /* SIOCGIWFRAG */
- (iw_handler) NULL, /* SIOCSIWTXPOW */
- (iw_handler) NULL, /* SIOCGIWTXPOW */
- (iw_handler) NULL, /* SIOCSIWRETRY */
- (iw_handler) NULL, /* SIOCGIWRETRY */
- (iw_handler) rt_ioctl_siwencode, /* SIOCSIWENCODE */
- (iw_handler) rt_ioctl_giwencode, /* SIOCGIWENCODE */
- (iw_handler) NULL, /* SIOCSIWPOWER */
- (iw_handler) NULL, /* SIOCGIWPOWER */
- (iw_handler) NULL, /* -- hole -- */
- (iw_handler) NULL, /* -- hole -- */
-#if WIRELESS_EXT > 17
- (iw_handler) rt_ioctl_siwgenie, /* SIOCSIWGENIE */
- (iw_handler) rt_ioctl_giwgenie, /* SIOCGIWGENIE */
- (iw_handler) rt_ioctl_siwauth, /* SIOCSIWAUTH */
- (iw_handler) rt_ioctl_giwauth, /* SIOCGIWAUTH */
- (iw_handler) rt_ioctl_siwencodeext, /* SIOCSIWENCODEEXT */
- (iw_handler) rt_ioctl_giwencodeext, /* SIOCGIWENCODEEXT */
- (iw_handler) rt_ioctl_siwpmksa, /* SIOCSIWPMKSA */
-#endif
-};
-
-static const iw_handler rt_priv_handlers[] = {
- (iw_handler) NULL, /* + 0x00 */
- (iw_handler) NULL, /* + 0x01 */
- (iw_handler) rt_ioctl_setparam, /* + 0x02 */
-#ifdef DBG
- (iw_handler) rt_private_ioctl_bbp, /* + 0x03 */
-#else
- (iw_handler) NULL, /* + 0x03 */
-#endif
- (iw_handler) NULL, /* + 0x04 */
- (iw_handler) NULL, /* + 0x05 */
- (iw_handler) NULL, /* + 0x06 */
- (iw_handler) NULL, /* + 0x07 */
- (iw_handler) NULL, /* + 0x08 */
- (iw_handler) rt_private_get_statistics, /* + 0x09 */
- (iw_handler) NULL, /* + 0x0A */
- (iw_handler) NULL, /* + 0x0B */
- (iw_handler) NULL, /* + 0x0C */
- (iw_handler) NULL, /* + 0x0D */
- (iw_handler) NULL, /* + 0x0E */
- (iw_handler) NULL, /* + 0x0F */
- (iw_handler) NULL, /* + 0x10 */
- (iw_handler) rt_private_show, /* + 0x11 */
- (iw_handler) NULL, /* + 0x12 */
- (iw_handler) NULL, /* + 0x13 */
- (iw_handler) NULL, /* + 0x14 */
- (iw_handler) NULL, /* + 0x15 */
- (iw_handler) NULL, /* + 0x16 */
- (iw_handler) NULL, /* + 0x17 */
- (iw_handler) NULL, /* + 0x18 */
-};
-
-const struct iw_handler_def rt28xx_iw_handler_def =
-{
-#define N(a) (sizeof (a) / sizeof (a[0]))
- .standard = (iw_handler *) rt_handler,
- .num_standard = sizeof(rt_handler) / sizeof(iw_handler),
- .private = (iw_handler *) rt_priv_handlers,
- .num_private = N(rt_priv_handlers),
- .private_args = (struct iw_priv_args *) privtab,
- .num_private_args = N(privtab),
-#if IW_HANDLER_VERSION >= 7
- .get_wireless_stats = rt28xx_get_wireless_stats,
-#endif
-};
-
-INT RTMPSetInformation(
- IN PRTMP_ADAPTER pAd,
- IN OUT struct ifreq *rq,
- IN INT cmd)
-{
- struct iwreq *wrq = (struct iwreq *) rq;
- NDIS_802_11_SSID Ssid;
- NDIS_802_11_MAC_ADDRESS Bssid;
- RT_802_11_PHY_MODE PhyMode;
- RT_802_11_STA_CONFIG StaConfig;
- NDIS_802_11_RATES aryRates;
- RT_802_11_PREAMBLE Preamble;
- NDIS_802_11_WEP_STATUS WepStatus;
- NDIS_802_11_AUTHENTICATION_MODE AuthMode = Ndis802_11AuthModeMax;
- NDIS_802_11_NETWORK_INFRASTRUCTURE BssType;
- NDIS_802_11_RTS_THRESHOLD RtsThresh;
- NDIS_802_11_FRAGMENTATION_THRESHOLD FragThresh;
- NDIS_802_11_POWER_MODE PowerMode;
- PNDIS_802_11_KEY pKey = NULL;
- PNDIS_802_11_WEP pWepKey =NULL;
- PNDIS_802_11_REMOVE_KEY pRemoveKey = NULL;
- NDIS_802_11_CONFIGURATION Config, *pConfig = NULL;
- NDIS_802_11_NETWORK_TYPE NetType;
- ULONG Now;
- UINT KeyIdx = 0;
- INT Status = NDIS_STATUS_SUCCESS, MaxPhyMode = PHY_11G;
- ULONG PowerTemp;
- BOOLEAN RadioState;
- BOOLEAN StateMachineTouched = FALSE;
- PNDIS_802_11_PASSPHRASE ppassphrase = NULL;
-#ifdef DOT11_N_SUPPORT
- OID_SET_HT_PHYMODE HT_PhyMode; //11n ,kathy
-#endif // DOT11_N_SUPPORT //
-#ifdef WPA_SUPPLICANT_SUPPORT
- PNDIS_802_11_PMKID pPmkId = NULL;
- BOOLEAN IEEE8021xState = FALSE;
- BOOLEAN IEEE8021x_required_keys = FALSE;
- UCHAR wpa_supplicant_enable = 0;
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef SNMP_SUPPORT
- TX_RTY_CFG_STRUC tx_rty_cfg;
- ULONG ShortRetryLimit, LongRetryLimit;
- UCHAR ctmp;
-#endif // SNMP_SUPPORT //
-
-
-
-
-#ifdef DOT11_N_SUPPORT
- MaxPhyMode = PHY_11N_5G;
-#endif // DOT11_N_SUPPORT //
-
- DBGPRINT(RT_DEBUG_TRACE, ("-->RTMPSetInformation(), 0x%08x\n", cmd&0x7FFF));
- switch(cmd & 0x7FFF) {
- case RT_OID_802_11_COUNTRY_REGION:
- if (wrq->u.data.length < sizeof(UCHAR))
- Status = -EINVAL;
- // Only avaliable when EEPROM not programming
- else if (!(pAd->CommonCfg.CountryRegion & 0x80) && !(pAd->CommonCfg.CountryRegionForABand & 0x80))
- {
- ULONG Country;
- UCHAR TmpPhy;
-
- Status = copy_from_user(&Country, wrq->u.data.pointer, wrq->u.data.length);
- pAd->CommonCfg.CountryRegion = (UCHAR)(Country & 0x000000FF);
- pAd->CommonCfg.CountryRegionForABand = (UCHAR)((Country >> 8) & 0x000000FF);
- TmpPhy = pAd->CommonCfg.PhyMode;
- pAd->CommonCfg.PhyMode = 0xff;
- // Build all corresponding channel information
- RTMPSetPhyMode(pAd, TmpPhy);
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_COUNTRY_REGION (A:%d B/G:%d)\n", pAd->CommonCfg.CountryRegionForABand,
- pAd->CommonCfg.CountryRegion));
- }
- break;
- case OID_802_11_BSSID_LIST_SCAN:
- Now = jiffies;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_BSSID_LIST_SCAN, TxCnt = %d \n", pAd->RalinkCounters.LastOneSecTotalTxCount));
-
- if (MONITOR_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is in Monitor Mode now !!!\n"));
- break;
- }
-
- //Benson add 20080527, when radio off, sta don't need to scan
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF))
- break;
-
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is scanning now !!!\n"));
- pAd->StaCfg.bScanReqIsFromWebUI = TRUE;
- Status = NDIS_STATUS_SUCCESS;
- break;
- }
-
- if (pAd->RalinkCounters.LastOneSecTotalTxCount > 100)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Link UP, ignore this set::OID_802_11_BSSID_LIST_SCAN\n"));
- Status = NDIS_STATUS_SUCCESS;
- pAd->StaCfg.ScanCnt = 99; // Prevent auto scan triggered by this OID
- break;
- }
-
- if ((OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_MEDIA_STATE_CONNECTED)) &&
- ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK)) &&
- (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_NOT_SECURED))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Link UP, Port Not Secured! ignore this set::OID_802_11_BSSID_LIST_SCAN\n"));
- Status = NDIS_STATUS_SUCCESS;
- pAd->StaCfg.ScanCnt = 99; // Prevent auto scan triggered by this OID
- break;
- }
-
-
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- // tell CNTL state machine to call NdisMSetInformationComplete() after completing
- // this request, because this request is initiated by NDIS.
- pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
- // Reset allowed scan retries
- pAd->StaCfg.ScanCnt = 0;
- pAd->StaCfg.LastScanTime = Now;
-
- pAd->StaCfg.bScanReqIsFromWebUI = TRUE;
- RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS);
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID_LIST_SCAN,
- 0,
- NULL);
-
- Status = NDIS_STATUS_SUCCESS;
- StateMachineTouched = TRUE;
- break;
- case OID_802_11_SSID:
- if (wrq->u.data.length != sizeof(NDIS_802_11_SSID))
- Status = -EINVAL;
- else
- {
- PSTRING pSsidString = NULL;
- Status = copy_from_user(&Ssid, wrq->u.data.pointer, wrq->u.data.length);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SSID (Len=%d,Ssid=%s)\n", Ssid.SsidLength, Ssid.Ssid));
- if (Ssid.SsidLength > MAX_LEN_OF_SSID)
- Status = -EINVAL;
- else
- {
- if (Ssid.SsidLength == 0)
- {
- Set_SSID_Proc(pAd, "");
- }
- else
- {
- pSsidString = (PSTRING)kmalloc(MAX_LEN_OF_SSID+1, MEM_ALLOC_FLAG);
- if (pSsidString)
- {
- NdisZeroMemory(pSsidString, MAX_LEN_OF_SSID+1);
- NdisMoveMemory(pSsidString, Ssid.Ssid, Ssid.SsidLength);
- Set_SSID_Proc(pAd, pSsidString);
- kfree(pSsidString);
- }
- else
- Status = -ENOMEM;
- }
- }
- }
- break;
- case OID_802_11_SET_PASSPHRASE:
- ppassphrase= kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
-
- if(ppassphrase== NULL)
- {
- Status = -ENOMEM;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SET_PASSPHRASE, Failed!!\n"));
- break;
- }
- else
- {
- Status = copy_from_user(ppassphrase, wrq->u.data.pointer, wrq->u.data.length);
-
- if (Status)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SET_PASSPHRASE, Failed (length mismatch)!!\n"));
- }
- else
- {
- if(ppassphrase->KeyLength < 8 || ppassphrase->KeyLength > 64)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SET_PASSPHRASE, Failed (len less than 8 or greater than 64)!!\n"));
- }
- else
- {
- // set key passphrase and length
- NdisZeroMemory(pAd->StaCfg.WpaPassPhrase, 64);
- NdisMoveMemory(pAd->StaCfg.WpaPassPhrase, &ppassphrase->KeyMaterial, ppassphrase->KeyLength);
- pAd->StaCfg.WpaPassPhraseLen = ppassphrase->KeyLength;
- hex_dump("pAd->StaCfg.WpaPassPhrase", pAd->StaCfg.WpaPassPhrase, 64);
- printk("WpaPassPhrase=%s\n",pAd->StaCfg.WpaPassPhrase);
- }
- }
- }
- kfree(ppassphrase);
- break;
-
- case OID_802_11_BSSID:
- if (wrq->u.data.length != sizeof(NDIS_802_11_MAC_ADDRESS))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&Bssid, wrq->u.data.pointer, wrq->u.data.length);
-
- // tell CNTL state machine to call NdisMSetInformationComplete() after completing
- // this request, because this request is initiated by NDIS.
- pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
-
- // Prevent to connect AP again in STAMlmePeriodicExec
- pAd->MlmeAux.AutoReconnectSsidLen= 32;
-
- // Reset allowed scan retries
- pAd->StaCfg.ScanCnt = 0;
-
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID,
- sizeof(NDIS_802_11_MAC_ADDRESS),
- (VOID *)&Bssid);
- Status = NDIS_STATUS_SUCCESS;
- StateMachineTouched = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_BSSID %02x:%02x:%02x:%02x:%02x:%02x\n",
- Bssid[0], Bssid[1], Bssid[2], Bssid[3], Bssid[4], Bssid[5]));
- }
- break;
- case RT_OID_802_11_RADIO:
- if (wrq->u.data.length != sizeof(BOOLEAN))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&RadioState, wrq->u.data.pointer, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_RADIO (=%d)\n", RadioState));
- if (pAd->StaCfg.bSwRadio != RadioState)
- {
- pAd->StaCfg.bSwRadio = RadioState;
- if (pAd->StaCfg.bRadio != (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio))
- {
- pAd->StaCfg.bRadio = (pAd->StaCfg.bHwRadio && pAd->StaCfg.bSwRadio);
- if (pAd->StaCfg.bRadio == TRUE)
- {
- MlmeRadioOn(pAd);
- // Update extra information
- pAd->ExtraInfo = EXTRA_INFO_CLEAR;
- }
- else
- {
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
- }
-
- MlmeRadioOff(pAd);
- // Update extra information
- pAd->ExtraInfo = SW_RADIO_OFF;
- }
- }
- }
- }
- break;
- case RT_OID_802_11_PHY_MODE:
- if (wrq->u.data.length != sizeof(RT_802_11_PHY_MODE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&PhyMode, wrq->u.data.pointer, wrq->u.data.length);
- if (PhyMode <= MaxPhyMode)
- {
- RTMPSetPhyMode(pAd, PhyMode);
-#ifdef DOT11_N_SUPPORT
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_PHY_MODE (=%d)\n", PhyMode));
- }
- break;
- case RT_OID_802_11_STA_CONFIG:
- if (wrq->u.data.length != sizeof(RT_802_11_STA_CONFIG))
- Status = -EINVAL;
- else
- {
- UINT32 Value;
-
- Status = copy_from_user(&StaConfig, wrq->u.data.pointer, wrq->u.data.length);
- pAd->CommonCfg.bEnableTxBurst = StaConfig.EnableTxBurst;
- pAd->CommonCfg.UseBGProtection = StaConfig.UseBGProtection;
- pAd->CommonCfg.bUseShortSlotTime = 1; // 2003-10-30 always SHORT SLOT capable
- if ((pAd->CommonCfg.PhyMode != StaConfig.AdhocMode) &&
- (StaConfig.AdhocMode <= MaxPhyMode))
- {
- // allow dynamic change of "USE OFDM rate or not" in ADHOC mode
- // if setting changed, need to reset current TX rate as well as BEACON frame format
- if (pAd->StaCfg.BssType == BSS_ADHOC)
- {
- pAd->CommonCfg.PhyMode = StaConfig.AdhocMode;
- RTMPSetPhyMode(pAd, PhyMode);
- MlmeUpdateTxRates(pAd, FALSE, 0);
- MakeIbssBeacon(pAd); // re-build BEACON frame
- AsicEnableIbssSync(pAd); // copy to on-chip memory
- }
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_SET_STA_CONFIG (Burst=%d, Protection=%ld,ShortSlot=%d\n",
- pAd->CommonCfg.bEnableTxBurst,
- pAd->CommonCfg.UseBGProtection,
- pAd->CommonCfg.bUseShortSlotTime));
-
- if (pAd->CommonCfg.PSPXlink)
- Value = PSPXLINK;
- else
- Value = STANORMAL;
- RTMP_IO_WRITE32(pAd, RX_FILTR_CFG, Value);
- Value = 0;
- RTMP_IO_READ32(pAd, MAC_SYS_CTRL, &Value);
- Value &= (~0x80);
- RTMP_IO_WRITE32(pAd, MAC_SYS_CTRL, Value);
- }
- break;
- case OID_802_11_DESIRED_RATES:
- if (wrq->u.data.length != sizeof(NDIS_802_11_RATES))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&aryRates, wrq->u.data.pointer, wrq->u.data.length);
- NdisZeroMemory(pAd->CommonCfg.DesireRate, MAX_LEN_OF_SUPPORTED_RATES);
- NdisMoveMemory(pAd->CommonCfg.DesireRate, &aryRates, sizeof(NDIS_802_11_RATES));
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_DESIRED_RATES (%02x,%02x,%02x,%02x,%02x,%02x,%02x,%02x)\n",
- pAd->CommonCfg.DesireRate[0],pAd->CommonCfg.DesireRate[1],
- pAd->CommonCfg.DesireRate[2],pAd->CommonCfg.DesireRate[3],
- pAd->CommonCfg.DesireRate[4],pAd->CommonCfg.DesireRate[5],
- pAd->CommonCfg.DesireRate[6],pAd->CommonCfg.DesireRate[7] ));
- // Changing DesiredRate may affect the MAX TX rate we used to TX frames out
- MlmeUpdateTxRates(pAd, FALSE, 0);
- }
- break;
- case RT_OID_802_11_PREAMBLE:
- if (wrq->u.data.length != sizeof(RT_802_11_PREAMBLE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&Preamble, wrq->u.data.pointer, wrq->u.data.length);
- if (Preamble == Rt802_11PreambleShort)
- {
- pAd->CommonCfg.TxPreamble = Preamble;
- MlmeSetTxPreamble(pAd, Rt802_11PreambleShort);
- }
- else if ((Preamble == Rt802_11PreambleLong) || (Preamble == Rt802_11PreambleAuto))
- {
- // if user wants AUTO, initialize to LONG here, then change according to AP's
- // capability upon association.
- pAd->CommonCfg.TxPreamble = Preamble;
- MlmeSetTxPreamble(pAd, Rt802_11PreambleLong);
- }
- else
- {
- Status = -EINVAL;
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_PREAMBLE (=%d)\n", Preamble));
- }
- break;
- case OID_802_11_WEP_STATUS:
- if (wrq->u.data.length != sizeof(NDIS_802_11_WEP_STATUS))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&WepStatus, wrq->u.data.pointer, wrq->u.data.length);
- // Since TKIP, AES, WEP are all supported. It should not have any invalid setting
- if (WepStatus <= Ndis802_11Encryption3KeyAbsent)
- {
- if (pAd->StaCfg.WepStatus != WepStatus)
- {
- // Config has changed
- pAd->bConfigChanged = TRUE;
- }
- pAd->StaCfg.WepStatus = WepStatus;
- pAd->StaCfg.OrigWepStatus = WepStatus;
- pAd->StaCfg.PairCipher = WepStatus;
- pAd->StaCfg.GroupCipher = WepStatus;
- }
- else
- {
- Status = -EINVAL;
- break;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_WEP_STATUS (=%d)\n",WepStatus));
- }
- break;
- case OID_802_11_AUTHENTICATION_MODE:
- if (wrq->u.data.length != sizeof(NDIS_802_11_AUTHENTICATION_MODE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&AuthMode, wrq->u.data.pointer, wrq->u.data.length);
- if (AuthMode > Ndis802_11AuthModeMax)
- {
- Status = -EINVAL;
- break;
- }
- else
- {
- if (pAd->StaCfg.AuthMode != AuthMode)
- {
- // Config has changed
- pAd->bConfigChanged = TRUE;
- }
- pAd->StaCfg.AuthMode = AuthMode;
- }
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_AUTHENTICATION_MODE (=%d) \n",pAd->StaCfg.AuthMode));
- }
- break;
- case OID_802_11_INFRASTRUCTURE_MODE:
- if (wrq->u.data.length != sizeof(NDIS_802_11_NETWORK_INFRASTRUCTURE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&BssType, wrq->u.data.pointer, wrq->u.data.length);
-
- if (BssType == Ndis802_11IBSS)
- Set_NetworkType_Proc(pAd, "Adhoc");
- else if (BssType == Ndis802_11Infrastructure)
- Set_NetworkType_Proc(pAd, "Infra");
- else if (BssType == Ndis802_11Monitor)
- Set_NetworkType_Proc(pAd, "Monitor");
- else
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_INFRASTRUCTURE_MODE (unknown)\n"));
- }
- }
- break;
- case OID_802_11_REMOVE_WEP:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_WEP\n"));
- if (wrq->u.data.length != sizeof(NDIS_802_11_KEY_INDEX))
- {
- Status = -EINVAL;
- }
- else
- {
- KeyIdx = *(NDIS_802_11_KEY_INDEX *) wrq->u.data.pointer;
-
- if (KeyIdx & 0x80000000)
- {
- // Should never set default bit when remove key
- Status = -EINVAL;
- }
- else
- {
- KeyIdx = KeyIdx & 0x0fffffff;
- if (KeyIdx >= 4){
- Status = -EINVAL;
- }
- else
- {
- pAd->SharedKey[BSS0][KeyIdx].KeyLen = 0;
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CIPHER_NONE;
- AsicRemoveSharedKeyEntry(pAd, 0, (UCHAR)KeyIdx);
- }
- }
- }
- break;
- case RT_OID_802_11_RESET_COUNTERS:
- NdisZeroMemory(&pAd->WlanCounters, sizeof(COUNTER_802_11));
- NdisZeroMemory(&pAd->Counters8023, sizeof(COUNTER_802_3));
- NdisZeroMemory(&pAd->RalinkCounters, sizeof(COUNTER_RALINK));
- pAd->Counters8023.RxNoBuffer = 0;
- pAd->Counters8023.GoodReceives = 0;
- pAd->Counters8023.RxNoBuffer = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_RESET_COUNTERS \n"));
- break;
- case OID_802_11_RTS_THRESHOLD:
- if (wrq->u.data.length != sizeof(NDIS_802_11_RTS_THRESHOLD))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&RtsThresh, wrq->u.data.pointer, wrq->u.data.length);
- if (RtsThresh > MAX_RTS_THRESHOLD)
- Status = -EINVAL;
- else
- pAd->CommonCfg.RtsThreshold = (USHORT)RtsThresh;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_RTS_THRESHOLD (=%ld)\n",RtsThresh));
- break;
- case OID_802_11_FRAGMENTATION_THRESHOLD:
- if (wrq->u.data.length != sizeof(NDIS_802_11_FRAGMENTATION_THRESHOLD))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&FragThresh, wrq->u.data.pointer, wrq->u.data.length);
- pAd->CommonCfg.bUseZeroToDisableFragment = FALSE;
- if (FragThresh > MAX_FRAG_THRESHOLD || FragThresh < MIN_FRAG_THRESHOLD)
- {
- if (FragThresh == 0)
- {
- pAd->CommonCfg.FragmentThreshold = MAX_FRAG_THRESHOLD;
- pAd->CommonCfg.bUseZeroToDisableFragment = TRUE;
- }
- else
- Status = -EINVAL;
- }
- else
- pAd->CommonCfg.FragmentThreshold = (USHORT)FragThresh;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_FRAGMENTATION_THRESHOLD (=%ld) \n",FragThresh));
- break;
- case OID_802_11_POWER_MODE:
- if (wrq->u.data.length != sizeof(NDIS_802_11_POWER_MODE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&PowerMode, wrq->u.data.pointer, wrq->u.data.length);
- if (PowerMode == Ndis802_11PowerModeCAM)
- Set_PSMode_Proc(pAd, "CAM");
- else if (PowerMode == Ndis802_11PowerModeMAX_PSP)
- Set_PSMode_Proc(pAd, "Max_PSP");
- else if (PowerMode == Ndis802_11PowerModeFast_PSP)
- Set_PSMode_Proc(pAd, "Fast_PSP");
- else if (PowerMode == Ndis802_11PowerModeLegacy_PSP)
- Set_PSMode_Proc(pAd, "Legacy_PSP");
- else
- Status = -EINVAL;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_POWER_MODE (=%d)\n",PowerMode));
- break;
- case RT_OID_802_11_TX_POWER_LEVEL_1:
- if (wrq->u.data.length < sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&PowerTemp, wrq->u.data.pointer, wrq->u.data.length);
- if (PowerTemp > 100)
- PowerTemp = 0xffffffff; // AUTO
- pAd->CommonCfg.TxPowerDefault = PowerTemp; //keep current setting.
- pAd->CommonCfg.TxPowerPercentage = pAd->CommonCfg.TxPowerDefault;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_TX_POWER_LEVEL_1 (=%ld)\n", pAd->CommonCfg.TxPowerPercentage));
- }
- break;
- case OID_802_11_NETWORK_TYPE_IN_USE:
- if (wrq->u.data.length != sizeof(NDIS_802_11_NETWORK_TYPE))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&NetType, wrq->u.data.pointer, wrq->u.data.length);
-
- if (NetType == Ndis802_11DS)
- RTMPSetPhyMode(pAd, PHY_11B);
- else if (NetType == Ndis802_11OFDM24)
- RTMPSetPhyMode(pAd, PHY_11BG_MIXED);
- else if (NetType == Ndis802_11OFDM5)
- RTMPSetPhyMode(pAd, PHY_11A);
- else
- Status = -EINVAL;
-#ifdef DOT11_N_SUPPORT
- if (Status == NDIS_STATUS_SUCCESS)
- SetCommonHT(pAd);
-#endif // DOT11_N_SUPPORT //
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_NETWORK_TYPE_IN_USE (=%d)\n",NetType));
- }
- break;
- // For WPA PSK PMK key
- case RT_OID_802_11_ADD_WPA:
- pKey = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
- if(pKey == NULL)
- {
- Status = -ENOMEM;
- break;
- }
-
- Status = copy_from_user(pKey, wrq->u.data.pointer, wrq->u.data.length);
- if (pKey->Length != wrq->u.data.length)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_ADD_WPA, Failed!!\n"));
- }
- else
- {
- if ((pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPAPSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPA2PSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPANone) )
- {
- Status = -EOPNOTSUPP;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_ADD_WPA, Failed!! [AuthMode != WPAPSK/WPA2PSK/WPANONE]\n"));
- }
- else if ((pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPAPSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPA2PSK) ||
- (pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone) ) // Only for WPA PSK mode
- {
- NdisMoveMemory(pAd->StaCfg.PMK, &pKey->KeyMaterial, pKey->KeyLength);
- // Use RaConfig as PSK agent.
- // Start STA supplicant state machine
- if (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPANone)
- pAd->StaCfg.WpaState = SS_START;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_ADD_WPA (id=0x%x, Len=%d-byte)\n", pKey->KeyIndex, pKey->KeyLength));
- }
- else
- {
- pAd->StaCfg.WpaState = SS_NOTUSE;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_ADD_WPA (id=0x%x, Len=%d-byte)\n", pKey->KeyIndex, pKey->KeyLength));
- }
- }
- kfree(pKey);
- break;
- case OID_802_11_REMOVE_KEY:
- pRemoveKey = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
- if(pRemoveKey == NULL)
- {
- Status = -ENOMEM;
- break;
- }
-
- Status = copy_from_user(pRemoveKey, wrq->u.data.pointer, wrq->u.data.length);
- if (pRemoveKey->Length != wrq->u.data.length)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_KEY, Failed!!\n"));
- }
- else
- {
- if (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- {
- RTMPWPARemoveKeyProc(pAd, pRemoveKey);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_KEY, Remove WPA Key!!\n"));
- }
- else
- {
- KeyIdx = pRemoveKey->KeyIndex;
-
- if (KeyIdx & 0x80000000)
- {
- // Should never set default bit when remove key
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_KEY, Failed!!(Should never set default bit when remove key)\n"));
- }
- else
- {
- KeyIdx = KeyIdx & 0x0fffffff;
- if (KeyIdx > 3)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_KEY, Failed!!(KeyId[%d] out of range)\n", KeyIdx));
- }
- else
- {
- pAd->SharedKey[BSS0][KeyIdx].KeyLen = 0;
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CIPHER_NONE;
- AsicRemoveSharedKeyEntry(pAd, 0, (UCHAR)KeyIdx);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_REMOVE_KEY (id=0x%x, Len=%d-byte)\n", pRemoveKey->KeyIndex, pRemoveKey->Length));
- }
- }
- }
- }
- kfree(pRemoveKey);
- break;
- // New for WPA
- case OID_802_11_ADD_KEY:
- pKey = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
- if(pKey == NULL)
- {
- Status = -ENOMEM;
- break;
- }
- Status = copy_from_user(pKey, wrq->u.data.pointer, wrq->u.data.length);
- if (pKey->Length != wrq->u.data.length)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_KEY, Failed!!\n"));
- }
- else
- {
- RTMPAddKey(pAd, pKey);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_KEY (id=0x%x, Len=%d-byte)\n", pKey->KeyIndex, pKey->KeyLength));
- }
- kfree(pKey);
- break;
- case OID_802_11_CONFIGURATION:
- if (wrq->u.data.length != sizeof(NDIS_802_11_CONFIGURATION))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&Config, wrq->u.data.pointer, wrq->u.data.length);
- pConfig = &Config;
-
- if ((pConfig->BeaconPeriod >= 20) && (pConfig->BeaconPeriod <=400))
- pAd->CommonCfg.BeaconPeriod = (USHORT) pConfig->BeaconPeriod;
-
- pAd->StaActive.AtimWin = (USHORT) pConfig->ATIMWindow;
- MAP_KHZ_TO_CHANNEL_ID(pConfig->DSConfig, pAd->CommonCfg.Channel);
- //
- // Save the channel on MlmeAux for CntlOidRTBssidProc used.
- //
- pAd->MlmeAux.Channel = pAd->CommonCfg.Channel;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_CONFIGURATION (BeacnPeriod=%ld,AtimW=%ld,Ch=%d)\n",
- pConfig->BeaconPeriod, pConfig->ATIMWindow, pAd->CommonCfg.Channel));
- // Config has changed
- pAd->bConfigChanged = TRUE;
- }
- break;
-#ifdef DOT11_N_SUPPORT
- case RT_OID_802_11_SET_HT_PHYMODE:
- if (wrq->u.data.length != sizeof(OID_SET_HT_PHYMODE))
- Status = -EINVAL;
- else
- {
- POID_SET_HT_PHYMODE pHTPhyMode = &HT_PhyMode;
-
- Status = copy_from_user(&HT_PhyMode, wrq->u.data.pointer, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::pHTPhyMode (PhyMode = %d,TransmitNo = %d, HtMode = %d, ExtOffset = %d , MCS = %d, BW = %d, STBC = %d, SHORTGI = %d) \n",
- pHTPhyMode->PhyMode, pHTPhyMode->TransmitNo,pHTPhyMode->HtMode,pHTPhyMode->ExtOffset,
- pHTPhyMode->MCS, pHTPhyMode->BW, pHTPhyMode->STBC, pHTPhyMode->SHORTGI));
- if (pAd->CommonCfg.PhyMode >= PHY_11ABGN_MIXED)
- RTMPSetHT(pAd, pHTPhyMode);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_SET_HT_PHYMODE(MCS=%d,BW=%d,SGI=%d,STBC=%d)\n",
- pAd->StaCfg.HTPhyMode.field.MCS, pAd->StaCfg.HTPhyMode.field.BW, pAd->StaCfg.HTPhyMode.field.ShortGI,
- pAd->StaCfg.HTPhyMode.field.STBC));
- break;
-#endif // DOT11_N_SUPPORT //
- case RT_OID_802_11_SET_APSD_SETTING:
- if (wrq->u.data.length != sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- ULONG apsd ;
- Status = copy_from_user(&apsd, wrq->u.data.pointer, wrq->u.data.length);
-
- /*-------------------------------------------------------------------
- |B31~B7 | B6~B5 | B4 | B3 | B2 | B1 | B0 |
- ---------------------------------------------------------------------
- | Rsvd | Max SP Len | AC_VO | AC_VI | AC_BK | AC_BE | APSD Capable |
- ---------------------------------------------------------------------*/
- pAd->CommonCfg.bAPSDCapable = (apsd & 0x00000001) ? TRUE : FALSE;
- pAd->CommonCfg.bAPSDAC_BE = ((apsd & 0x00000002) >> 1) ? TRUE : FALSE;
- pAd->CommonCfg.bAPSDAC_BK = ((apsd & 0x00000004) >> 2) ? TRUE : FALSE;
- pAd->CommonCfg.bAPSDAC_VI = ((apsd & 0x00000008) >> 3) ? TRUE : FALSE;
- pAd->CommonCfg.bAPSDAC_VO = ((apsd & 0x00000010) >> 4) ? TRUE : FALSE;
- pAd->CommonCfg.MaxSPLength = (UCHAR)((apsd & 0x00000060) >> 5);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_SET_APSD_SETTING (apsd=0x%lx, APSDCap=%d, [BE,BK,VI,VO]=[%d/%d/%d/%d], MaxSPLen=%d)\n", apsd, pAd->CommonCfg.bAPSDCapable,
- pAd->CommonCfg.bAPSDAC_BE, pAd->CommonCfg.bAPSDAC_BK, pAd->CommonCfg.bAPSDAC_VI, pAd->CommonCfg.bAPSDAC_VO, pAd->CommonCfg.MaxSPLength));
- }
- break;
-
- case RT_OID_802_11_SET_APSD_PSM:
- if (wrq->u.data.length != sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- // Driver needs to notify AP when PSM changes
- Status = copy_from_user(&pAd->CommonCfg.bAPSDForcePowerSave, wrq->u.data.pointer, wrq->u.data.length);
- if (pAd->CommonCfg.bAPSDForcePowerSave != pAd->StaCfg.Psm)
- {
- RTMP_SET_PSM_BIT(pAd, pAd->CommonCfg.bAPSDForcePowerSave);
- RTMPSendNullFrame(pAd, pAd->CommonCfg.TxRate, TRUE);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_SET_APSD_PSM (bAPSDForcePowerSave:%d)\n", pAd->CommonCfg.bAPSDForcePowerSave));
- }
- break;
-#ifdef QOS_DLS_SUPPORT
- case RT_OID_802_11_SET_DLS:
- if (wrq->u.data.length != sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- BOOLEAN oldvalue = pAd->CommonCfg.bDLSCapable;
- Status = copy_from_user(&pAd->CommonCfg.bDLSCapable, wrq->u.data.pointer, wrq->u.data.length);
- if (oldvalue && !pAd->CommonCfg.bDLSCapable)
- {
- int i;
- // tear down local dls table entry
- for (i=0; i<MAX_NUM_OF_INIT_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
-
- // tear down peer dls table entry
- for (i=MAX_NUM_OF_INIT_DLS_ENTRY; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- if (pAd->StaCfg.DLSEntry[i].Valid && (pAd->StaCfg.DLSEntry[i].Status == DLS_FINISH))
- {
- pAd->StaCfg.DLSEntry[i].Status = DLS_NONE;
- pAd->StaCfg.DLSEntry[i].Valid = FALSE;
- RTMPSendDLSTearDownFrame(pAd, pAd->StaCfg.DLSEntry[i].MacAddr);
- }
- }
- }
-
- DBGPRINT(RT_DEBUG_TRACE,("Set::RT_OID_802_11_SET_DLS (=%d)\n", pAd->CommonCfg.bDLSCapable));
- }
- break;
-
- case RT_OID_802_11_SET_DLS_PARAM:
- if (wrq->u.data.length != sizeof(RT_802_11_DLS_UI))
- Status = -EINVAL;
- else
- {
- RT_802_11_DLS Dls;
-
- NdisZeroMemory(&Dls, sizeof(RT_802_11_DLS));
- RTMPMoveMemory(&Dls, wrq->u.data.pointer, sizeof(RT_802_11_DLS_UI));
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- RT_OID_802_11_SET_DLS_PARAM,
- sizeof(RT_802_11_DLS),
- &Dls);
- DBGPRINT(RT_DEBUG_TRACE,("Set::RT_OID_802_11_SET_DLS_PARAM \n"));
- }
- break;
-#endif // QOS_DLS_SUPPORT //
- case RT_OID_802_11_SET_WMM:
- if (wrq->u.data.length != sizeof(BOOLEAN))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&pAd->CommonCfg.bWmmCapable, wrq->u.data.pointer, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_SET_WMM (=%d) \n", pAd->CommonCfg.bWmmCapable));
- }
- break;
-
- case OID_802_11_DISASSOCIATE:
- //
- // Set NdisRadioStateOff to TRUE, instead of called MlmeRadioOff.
- // Later on, NDIS_802_11_BSSID_LIST_EX->NumberOfItems should be 0
- // when query OID_802_11_BSSID_LIST.
- //
- // TRUE: NumberOfItems will set to 0.
- // FALSE: NumberOfItems no change.
- //
- pAd->CommonCfg.NdisRadioStateOff = TRUE;
- // Set to immediately send the media disconnect event
- pAd->MlmeAux.CurrReqIsFromNdis = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_DISASSOCIATE \n"));
-
-
- if (INFRA_ON(pAd))
- {
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_DISASSOCIATE,
- 0,
- NULL);
-
- StateMachineTouched = TRUE;
- }
- break;
-
-#ifdef DOT11_N_SUPPORT
- case RT_OID_802_11_SET_IMME_BA_CAP:
- if (wrq->u.data.length != sizeof(OID_BACAP_STRUC))
- Status = -EINVAL;
- else
- {
- OID_BACAP_STRUC Orde ;
- Status = copy_from_user(&Orde, wrq->u.data.pointer, wrq->u.data.length);
- if (Orde.Policy > BA_NOTUSE)
- {
- Status = NDIS_STATUS_INVALID_DATA;
- }
- else if (Orde.Policy == BA_NOTUSE)
- {
- pAd->CommonCfg.BACapability.field.Policy = BA_NOTUSE;
- pAd->CommonCfg.BACapability.field.MpduDensity = Orde.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.MpduDensity = Orde.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.AmsduEnable = Orde.AmsduEnable;
- pAd->CommonCfg.DesiredHtPhy.AmsduSize= Orde.AmsduSize;
- pAd->CommonCfg.DesiredHtPhy.MimoPs= Orde.MMPSmode;
- pAd->CommonCfg.BACapability.field.MMPSmode = Orde.MMPSmode;
- // UPdata to HT IE
- pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = Orde.MMPSmode;
- pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = Orde.AmsduSize;
- pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = Orde.MpduDensity;
- }
- else
- {
- pAd->CommonCfg.BACapability.field.AutoBA = Orde.AutoBA;
- pAd->CommonCfg.BACapability.field.Policy = IMMED_BA; // we only support immediate BA.
- pAd->CommonCfg.BACapability.field.MpduDensity = Orde.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.MpduDensity = Orde.MpduDensity;
- pAd->CommonCfg.DesiredHtPhy.AmsduEnable = Orde.AmsduEnable;
- pAd->CommonCfg.DesiredHtPhy.AmsduSize= Orde.AmsduSize;
- pAd->CommonCfg.DesiredHtPhy.MimoPs = Orde.MMPSmode;
- pAd->CommonCfg.BACapability.field.MMPSmode = Orde.MMPSmode;
-
- // UPdata to HT IE
- pAd->CommonCfg.HtCapability.HtCapInfo.MimoPs = Orde.MMPSmode;
- pAd->CommonCfg.HtCapability.HtCapInfo.AMsduSize = Orde.AmsduSize;
- pAd->CommonCfg.HtCapability.HtCapParm.MpduDensity = Orde.MpduDensity;
-
- if (pAd->CommonCfg.BACapability.field.RxBAWinLimit > MAX_RX_REORDERBUF)
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = MAX_RX_REORDERBUF;
-
- }
-
- pAd->CommonCfg.REGBACapability.word = pAd->CommonCfg.BACapability.word;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::(Orde.AutoBA = %d) (Policy=%d)(ReBAWinLimit=%d)(TxBAWinLimit=%d)(AutoMode=%d)\n",Orde.AutoBA, pAd->CommonCfg.BACapability.field.Policy,
- pAd->CommonCfg.BACapability.field.RxBAWinLimit,pAd->CommonCfg.BACapability.field.TxBAWinLimit, pAd->CommonCfg.BACapability.field.AutoBA));
- DBGPRINT(RT_DEBUG_TRACE, ("Set::(MimoPs = %d)(AmsduEnable = %d) (AmsduSize=%d)(MpduDensity=%d)\n",pAd->CommonCfg.DesiredHtPhy.MimoPs, pAd->CommonCfg.DesiredHtPhy.AmsduEnable,
- pAd->CommonCfg.DesiredHtPhy.AmsduSize, pAd->CommonCfg.DesiredHtPhy.MpduDensity));
- }
-
- break;
- case RT_OID_802_11_ADD_IMME_BA:
- DBGPRINT(RT_DEBUG_TRACE, (" Set :: RT_OID_802_11_ADD_IMME_BA \n"));
- if (wrq->u.data.length != sizeof(OID_ADD_BA_ENTRY))
- Status = -EINVAL;
- else
- {
- UCHAR index;
- OID_ADD_BA_ENTRY BA;
- MAC_TABLE_ENTRY *pEntry;
-
- Status = copy_from_user(&BA, wrq->u.data.pointer, wrq->u.data.length);
- if (BA.TID > 15)
- {
- Status = NDIS_STATUS_INVALID_DATA;
- break;
- }
- else
- {
- //BATableInsertEntry
- //As ad-hoc mode, BA pair is not limited to only BSSID. so add via OID.
- index = BA.TID;
- // in ad hoc mode, when adding BA pair, we should insert this entry into MACEntry too
- pEntry = MacTableLookup(pAd, BA.MACAddr);
- if (!pEntry)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("RT_OID_802_11_ADD_IMME_BA. break on no connection.----:%x:%x\n", BA.MACAddr[4], BA.MACAddr[5]));
- break;
- }
- if (BA.IsRecipient == FALSE)
- {
- if (pEntry->bIAmBadAtheros == TRUE)
- pAd->CommonCfg.BACapability.field.RxBAWinLimit = 0x10;
-
- BAOriSessionSetUp(pAd, pEntry, index, 0, 100, TRUE);
- }
- else
- {
- //BATableInsertEntry(pAd, pEntry->Aid, BA.MACAddr, 0, 0xffff, BA.TID, BA.nMSDU, BA.IsRecipient);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_802_11_ADD_IMME_BA. Rec = %d. Mac = %x:%x:%x:%x:%x:%x . \n",
- BA.IsRecipient, BA.MACAddr[0], BA.MACAddr[1], BA.MACAddr[2], BA.MACAddr[2]
- , BA.MACAddr[4], BA.MACAddr[5]));
- }
- }
- break;
-
- case RT_OID_802_11_TEAR_IMME_BA:
- DBGPRINT(RT_DEBUG_TRACE, ("Set :: RT_OID_802_11_TEAR_IMME_BA \n"));
- if (wrq->u.data.length != sizeof(OID_ADD_BA_ENTRY))
- Status = -EINVAL;
- else
- {
- POID_ADD_BA_ENTRY pBA;
- MAC_TABLE_ENTRY *pEntry;
-
- pBA = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
-
- if (pBA == NULL)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Set :: RT_OID_802_11_TEAR_IMME_BA kmalloc() can't allocate enough memory\n"));
- Status = NDIS_STATUS_FAILURE;
- }
- else
- {
- Status = copy_from_user(pBA, wrq->u.data.pointer, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Set :: RT_OID_802_11_TEAR_IMME_BA(TID=%d, bAllTid=%d)\n", pBA->TID, pBA->bAllTid));
-
- if (!pBA->bAllTid && (pBA->TID > NUM_OF_TID))
- {
- Status = NDIS_STATUS_INVALID_DATA;
- break;
- }
-
- if (pBA->IsRecipient == FALSE)
- {
- pEntry = MacTableLookup(pAd, pBA->MACAddr);
- DBGPRINT(RT_DEBUG_TRACE, (" pBA->IsRecipient == FALSE\n"));
- if (pEntry)
- {
- DBGPRINT(RT_DEBUG_TRACE, (" pBA->pEntry\n"));
- BAOriSessionTearDown(pAd, pEntry->Aid, pBA->TID, FALSE, TRUE);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("Set :: Not found pEntry \n"));
- }
- else
- {
- pEntry = MacTableLookup(pAd, pBA->MACAddr);
- if (pEntry)
- {
- BARecSessionTearDown( pAd, (UCHAR)pEntry->Aid, pBA->TID, TRUE);
- }
- else
- DBGPRINT(RT_DEBUG_TRACE, ("Set :: Not found pEntry \n"));
- }
- kfree(pBA);
- }
- }
- break;
-#endif // DOT11_N_SUPPORT //
-
- // For WPA_SUPPLICANT to set static wep key
- case OID_802_11_ADD_WEP:
- pWepKey = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
-
- if(pWepKey == NULL)
- {
- Status = -ENOMEM;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_WEP, Failed!!\n"));
- break;
- }
- Status = copy_from_user(pWepKey, wrq->u.data.pointer, wrq->u.data.length);
- if (Status)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_WEP, Failed (length mismatch)!!\n"));
- }
- else
- {
- KeyIdx = pWepKey->KeyIndex & 0x0fffffff;
- // KeyIdx must be 0 ~ 3
- if (KeyIdx > 4)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_WEP, Failed (KeyIdx must be smaller than 4)!!\n"));
- }
- else
- {
- UCHAR CipherAlg = 0;
- PUCHAR Key;
-
- // set key material and key length
- NdisZeroMemory(pAd->SharedKey[BSS0][KeyIdx].Key, 16);
- pAd->SharedKey[BSS0][KeyIdx].KeyLen = (UCHAR) pWepKey->KeyLength;
- NdisMoveMemory(pAd->SharedKey[BSS0][KeyIdx].Key, &pWepKey->KeyMaterial, pWepKey->KeyLength);
-
- switch(pWepKey->KeyLength)
- {
- case 5:
- CipherAlg = CIPHER_WEP64;
- break;
- case 13:
- CipherAlg = CIPHER_WEP128;
- break;
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_WEP, only support CIPHER_WEP64(len:5) & CIPHER_WEP128(len:13)!!\n"));
- Status = -EINVAL;
- break;
- }
- pAd->SharedKey[BSS0][KeyIdx].CipherAlg = CipherAlg;
-
- // Default key for tx (shared key)
- if (pWepKey->KeyIndex & 0x80000000)
- {
-#ifdef WPA_SUPPLICANT_SUPPORT
- // set key material and key length
- NdisZeroMemory(pAd->StaCfg.DesireSharedKey[KeyIdx].Key, 16);
- pAd->StaCfg.DesireSharedKey[KeyIdx].KeyLen = (UCHAR) pWepKey->KeyLength;
- NdisMoveMemory(pAd->StaCfg.DesireSharedKey[KeyIdx].Key, &pWepKey->KeyMaterial, pWepKey->KeyLength);
- pAd->StaCfg.DesireSharedKeyId = KeyIdx;
- pAd->StaCfg.DesireSharedKey[KeyIdx].CipherAlg = CipherAlg;
-#endif // WPA_SUPPLICANT_SUPPORT //
- pAd->StaCfg.DefaultKeyId = (UCHAR) KeyIdx;
- }
-
-#ifdef WPA_SUPPLICANT_SUPPORT
- if ((pAd->StaCfg.WpaSupplicantUP != WPA_SUPPLICANT_DISABLE) &&
- (pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA))
- {
- Key = pWepKey->KeyMaterial;
-
- // Set Group key material to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, KeyIdx, CipherAlg, Key, NULL, NULL);
-
- // Update WCID attribute table and IVEIV table for this group key table
- RTMPAddWcidAttributeEntry(pAd, BSS0, KeyIdx, CipherAlg, NULL);
-
- STA_PORT_SECURED(pAd);
-
- // Indicate Connected for GUI
- pAd->IndicateMediaState = NdisMediaStateConnected;
- }
- else if (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED)
-#endif // WPA_SUPPLICANT_SUPPORT
- {
- Key = pAd->SharedKey[BSS0][KeyIdx].Key;
-
- // Set key material and cipherAlg to Asic
- AsicAddSharedKeyEntry(pAd, BSS0, KeyIdx, CipherAlg, Key, NULL, NULL);
-
- if (pWepKey->KeyIndex & 0x80000000)
- {
- PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[BSSID_WCID];
- // Assign group key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, KeyIdx, CipherAlg, NULL);
- // Assign pairwise key info
- RTMPAddWcidAttributeEntry(pAd, BSS0, KeyIdx, CipherAlg, pEntry);
- }
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_ADD_WEP (id=0x%x, Len=%d-byte), %s\n", pWepKey->KeyIndex, pWepKey->KeyLength, (pAd->StaCfg.PortSecured == WPA_802_1X_PORT_SECURED) ? "Port Secured":"Port NOT Secured"));
- }
- }
- kfree(pWepKey);
- break;
-#ifdef WPA_SUPPLICANT_SUPPORT
- case OID_SET_COUNTERMEASURES:
- if (wrq->u.data.length != sizeof(int))
- Status = -EINVAL;
- else
- {
- int enabled = 0;
- Status = copy_from_user(&enabled, wrq->u.data.pointer, wrq->u.data.length);
- if (enabled == 1)
- pAd->StaCfg.bBlockAssoc = TRUE;
- else
- // WPA MIC error should block association attempt for 60 seconds
- pAd->StaCfg.bBlockAssoc = FALSE;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_SET_COUNTERMEASURES bBlockAssoc=%s\n", pAd->StaCfg.bBlockAssoc ? "TRUE":"FALSE"));
- }
- break;
- case RT_OID_WPA_SUPPLICANT_SUPPORT:
- if (wrq->u.data.length != sizeof(UCHAR))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&wpa_supplicant_enable, wrq->u.data.pointer, wrq->u.data.length);
- pAd->StaCfg.WpaSupplicantUP = wpa_supplicant_enable;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::RT_OID_WPA_SUPPLICANT_SUPPORT (=%d)\n", pAd->StaCfg.WpaSupplicantUP));
- }
- break;
- case OID_802_11_DEAUTHENTICATION:
- if (wrq->u.data.length != sizeof(MLME_DEAUTH_REQ_STRUCT))
- Status = -EINVAL;
- else
- {
- MLME_DEAUTH_REQ_STRUCT *pInfo;
- MLME_QUEUE_ELEM *MsgElem = (MLME_QUEUE_ELEM *) kmalloc(sizeof(MLME_QUEUE_ELEM), MEM_ALLOC_FLAG);
- if (MsgElem == NULL)
- {
- DBGPRINT(RT_DEBUG_ERROR, ("%s():alloc memory failed!\n", __FUNCTION__));
- return -EINVAL;
- }
-
- pInfo = (MLME_DEAUTH_REQ_STRUCT *) MsgElem->Msg;
- Status = copy_from_user(pInfo, wrq->u.data.pointer, wrq->u.data.length);
- MlmeDeauthReqAction(pAd, MsgElem);
- kfree(MsgElem);
-
- if (INFRA_ON(pAd))
- {
- LinkDown(pAd, FALSE);
- pAd->Mlme.AssocMachine.CurrState = ASSOC_IDLE;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_DEAUTHENTICATION (Reason=%d)\n", pInfo->Reason));
- }
- break;
- case OID_802_11_DROP_UNENCRYPTED:
- if (wrq->u.data.length != sizeof(int))
- Status = -EINVAL;
- else
- {
- int enabled = 0;
- Status = copy_from_user(&enabled, wrq->u.data.pointer, wrq->u.data.length);
- if (enabled == 1)
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
- else
- pAd->StaCfg.PortSecured = WPA_802_1X_PORT_SECURED;
- NdisAcquireSpinLock(&pAd->MacTabLock);
- pAd->MacTab.Content[BSSID_WCID].PortSecured = pAd->StaCfg.PortSecured;
- NdisReleaseSpinLock(&pAd->MacTabLock);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_DROP_UNENCRYPTED (=%d)\n", enabled));
- }
- break;
- case OID_802_11_SET_IEEE8021X:
- if (wrq->u.data.length != sizeof(BOOLEAN))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&IEEE8021xState, wrq->u.data.pointer, wrq->u.data.length);
- pAd->StaCfg.IEEE8021X = IEEE8021xState;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SET_IEEE8021X (=%d)\n", IEEE8021xState));
- }
- break;
- case OID_802_11_SET_IEEE8021X_REQUIRE_KEY:
- if (wrq->u.data.length != sizeof(BOOLEAN))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&IEEE8021x_required_keys, wrq->u.data.pointer, wrq->u.data.length);
- pAd->StaCfg.IEEE8021x_required_keys = IEEE8021x_required_keys;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SET_IEEE8021X_REQUIRE_KEY (%d)\n", IEEE8021x_required_keys));
- }
- break;
- case OID_802_11_PMKID:
- pPmkId = kmalloc(wrq->u.data.length, MEM_ALLOC_FLAG);
-
- if(pPmkId == NULL) {
- Status = -ENOMEM;
- break;
- }
- Status = copy_from_user(pPmkId, wrq->u.data.pointer, wrq->u.data.length);
-
- // check the PMKID information
- if (pPmkId->BSSIDInfoCount == 0)
- NdisZeroMemory(pAd->StaCfg.SavedPMK, sizeof(BSSID_INFO)*PMKID_NO);
- else
- {
- PBSSID_INFO pBssIdInfo;
- UINT BssIdx;
- UINT CachedIdx;
-
- for (BssIdx = 0; BssIdx < pPmkId->BSSIDInfoCount; BssIdx++)
- {
- // point to the indexed BSSID_INFO structure
- pBssIdInfo = (PBSSID_INFO) ((PUCHAR) pPmkId + 2 * sizeof(UINT) + BssIdx * sizeof(BSSID_INFO));
- // Find the entry in the saved data base.
- for (CachedIdx = 0; CachedIdx < pAd->StaCfg.SavedPMKNum; CachedIdx++)
- {
- // compare the BSSID
- if (NdisEqualMemory(pBssIdInfo->BSSID, pAd->StaCfg.SavedPMK[CachedIdx].BSSID, sizeof(NDIS_802_11_MAC_ADDRESS)))
- break;
- }
-
- // Found, replace it
- if (CachedIdx < PMKID_NO)
- {
- DBGPRINT(RT_DEBUG_OFF, ("Update OID_802_11_PMKID, idx = %d\n", CachedIdx));
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx], pBssIdInfo, sizeof(BSSID_INFO));
- pAd->StaCfg.SavedPMKNum++;
- }
- // Not found, replace the last one
- else
- {
- // Randomly replace one
- CachedIdx = (pBssIdInfo->BSSID[5] % PMKID_NO);
- DBGPRINT(RT_DEBUG_OFF, ("Update OID_802_11_PMKID, idx = %d\n", CachedIdx));
- NdisMoveMemory(&pAd->StaCfg.SavedPMK[CachedIdx], pBssIdInfo, sizeof(BSSID_INFO));
- }
- }
- }
- if(pPmkId)
- kfree(pPmkId);
- break;
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-
-
-#ifdef SNMP_SUPPORT
- case OID_802_11_SHORTRETRYLIMIT:
- if (wrq->u.data.length != sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&ShortRetryLimit, wrq->u.data.pointer, wrq->u.data.length);
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.ShortRtyLimit = ShortRetryLimit;
- RTMP_IO_WRITE32(pAd, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_SHORTRETRYLIMIT (tx_rty_cfg.field.ShortRetryLimit=%d, ShortRetryLimit=%ld)\n", tx_rty_cfg.field.ShortRtyLimit, ShortRetryLimit));
- }
- break;
-
- case OID_802_11_LONGRETRYLIMIT:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_LONGRETRYLIMIT \n"));
- if (wrq->u.data.length != sizeof(ULONG))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&LongRetryLimit, wrq->u.data.pointer, wrq->u.data.length);
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &tx_rty_cfg.word);
- tx_rty_cfg.field.LongRtyLimit = LongRetryLimit;
- RTMP_IO_WRITE32(pAd, TX_RTY_CFG, tx_rty_cfg.word);
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_LONGRETRYLIMIT (tx_rty_cfg.field.LongRetryLimit= %d,LongRetryLimit=%ld)\n", tx_rty_cfg.field.LongRtyLimit, LongRetryLimit));
- }
- break;
-
- case OID_802_11_WEPDEFAULTKEYVALUE:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_WEPDEFAULTKEYVALUE\n"));
- pKey = kmalloc(wrq->u.data.length, GFP_KERNEL);
- Status = copy_from_user(pKey, wrq->u.data.pointer, wrq->u.data.length);
- //pKey = &WepKey;
-
- if ( pKey->Length != wrq->u.data.length)
- {
- Status = -EINVAL;
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_WEPDEFAULTKEYVALUE, Failed!!\n"));
- }
- KeyIdx = pKey->KeyIndex & 0x0fffffff;
- DBGPRINT(RT_DEBUG_TRACE,("pKey->KeyIndex =%d, pKey->KeyLength=%d\n", pKey->KeyIndex, pKey->KeyLength));
-
- // it is a shared key
- if (KeyIdx > 4)
- Status = -EINVAL;
- else
- {
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen = (UCHAR) pKey->KeyLength;
- NdisMoveMemory(&pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key, &pKey->KeyMaterial, pKey->KeyLength);
- if (pKey->KeyIndex & 0x80000000)
- {
- // Default key for tx (shared key)
- pAd->StaCfg.DefaultKeyId = (UCHAR) KeyIdx;
- }
- //RestartAPIsRequired = TRUE;
- }
- break;
-
-
- case OID_802_11_WEPDEFAULTKEYID:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_WEPDEFAULTKEYID \n"));
-
- if (wrq->u.data.length != sizeof(UCHAR))
- Status = -EINVAL;
- else
- Status = copy_from_user(&pAd->StaCfg.DefaultKeyId, wrq->u.data.pointer, wrq->u.data.length);
-
- break;
-
-
- case OID_802_11_CURRENTCHANNEL:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::OID_802_11_CURRENTCHANNEL \n"));
- if (wrq->u.data.length != sizeof(UCHAR))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&ctmp, wrq->u.data.pointer, wrq->u.data.length);
- sprintf((PSTRING)&ctmp,"%d", ctmp);
- Set_Channel_Proc(pAd, (PSTRING)&ctmp);
- }
- break;
-#endif
-
-
-
- case RT_OID_802_11_SET_PSPXLINK_MODE:
- if (wrq->u.data.length != sizeof(BOOLEAN))
- Status = -EINVAL;
- else
- {
- Status = copy_from_user(&pAd->CommonCfg.PSPXlink, wrq->u.data.pointer, wrq->u.data.length);
- /*if (pAd->CommonCfg.PSPXlink)
- RX_FILTER_SET_FLAG(pAd, fRX_FILTER_ACCEPT_PROMISCUOUS)*/
- DBGPRINT(RT_DEBUG_TRACE,("Set::RT_OID_802_11_SET_PSPXLINK_MODE(=%d) \n", pAd->CommonCfg.PSPXlink));
- }
- break;
-
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("Set::unknown IOCTL's subcmd = 0x%08x\n", cmd));
- Status = -EOPNOTSUPP;
- break;
- }
-
-
- return Status;
-}
-
-INT RTMPQueryInformation(
- IN PRTMP_ADAPTER pAd,
- IN OUT struct ifreq *rq,
- IN INT cmd)
-{
- struct iwreq *wrq = (struct iwreq *) rq;
- NDIS_802_11_BSSID_LIST_EX *pBssidList = NULL;
- PNDIS_WLAN_BSSID_EX pBss;
- NDIS_802_11_SSID Ssid;
- NDIS_802_11_CONFIGURATION *pConfiguration = NULL;
- RT_802_11_LINK_STATUS *pLinkStatus = NULL;
- RT_802_11_STA_CONFIG *pStaConfig = NULL;
- NDIS_802_11_STATISTICS *pStatistics = NULL;
- NDIS_802_11_RTS_THRESHOLD RtsThresh;
- NDIS_802_11_FRAGMENTATION_THRESHOLD FragThresh;
- NDIS_802_11_POWER_MODE PowerMode;
- NDIS_802_11_NETWORK_INFRASTRUCTURE BssType;
- RT_802_11_PREAMBLE PreamType;
- NDIS_802_11_AUTHENTICATION_MODE AuthMode;
- NDIS_802_11_WEP_STATUS WepStatus;
- NDIS_MEDIA_STATE MediaState;
- ULONG BssBufSize, ulInfo=0, NetworkTypeList[4], apsd = 0;
- USHORT BssLen = 0;
- PUCHAR pBuf = NULL, pPtr;
- INT Status = NDIS_STATUS_SUCCESS;
- UINT we_version_compiled;
- UCHAR i, Padding = 0;
- BOOLEAN RadioState;
- STRING driverVersion[8];
- OID_SET_HT_PHYMODE *pHTPhyMode = NULL;
-
-
-#ifdef SNMP_SUPPORT
- //for snmp, kathy
- DefaultKeyIdxValue *pKeyIdxValue;
- INT valueLen;
- TX_RTY_CFG_STRUC tx_rty_cfg;
- ULONG ShortRetryLimit, LongRetryLimit;
- UCHAR tmp[64];
-#endif //SNMP
-
- switch(cmd)
- {
- case RT_OID_DEVICE_NAME:
- wrq->u.data.length = sizeof(pAd->nickname);
- Status = copy_to_user(wrq->u.data.pointer, pAd->nickname, wrq->u.data.length);
- break;
- case RT_OID_VERSION_INFO:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_VERSION_INFO \n"));
- wrq->u.data.length = 8*sizeof(CHAR);
- sprintf(&driverVersion[0], "%s", STA_DRIVER_VERSION);
- driverVersion[7] = '\0';
- if (copy_to_user(wrq->u.data.pointer, &driverVersion[0], wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- break;
-
- case OID_802_11_BSSID_LIST:
- if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_BSS_SCAN_IN_PROGRESS))
- {
- /*
- * Still scanning, indicate the caller should try again.
- */
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_BSSID_LIST (Still scanning)\n"));
- return -EAGAIN;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_BSSID_LIST (%d BSS returned)\n",pAd->ScanTab.BssNr));
- pAd->StaCfg.bScanReqIsFromWebUI = FALSE;
- // Claculate total buffer size required
- BssBufSize = sizeof(ULONG);
-
- for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
- // Align pointer to 4 bytes boundary.
- //Padding = 4 - (pAdapter->ScanTab.BssEntry[i].VarIELen & 0x0003);
- //if (Padding == 4)
- // Padding = 0;
- BssBufSize += (sizeof(NDIS_WLAN_BSSID_EX) - 1 + sizeof(NDIS_802_11_FIXED_IEs) + pAd->ScanTab.BssEntry[i].VarIELen + Padding);
- }
-
- // For safety issue, we add 256 bytes just in case
- BssBufSize += 256;
- // Allocate the same size as passed from higher layer
- pBuf = kmalloc(BssBufSize, MEM_ALLOC_FLAG);
- if(pBuf == NULL)
- {
- Status = -ENOMEM;
- break;
- }
- // Init 802_11_BSSID_LIST_EX structure
- NdisZeroMemory(pBuf, BssBufSize);
- pBssidList = (PNDIS_802_11_BSSID_LIST_EX) pBuf;
- pBssidList->NumberOfItems = pAd->ScanTab.BssNr;
-
- // Calculate total buffer length
- BssLen = 4; // Consist of NumberOfItems
- // Point to start of NDIS_WLAN_BSSID_EX
- // pPtr = pBuf + sizeof(ULONG);
- pPtr = (PUCHAR) &pBssidList->Bssid[0];
- for (i = 0; i < pAd->ScanTab.BssNr; i++)
- {
- pBss = (PNDIS_WLAN_BSSID_EX) pPtr;
- NdisMoveMemory(&pBss->MacAddress, &pAd->ScanTab.BssEntry[i].Bssid, MAC_ADDR_LEN);
- if ((pAd->ScanTab.BssEntry[i].Hidden == 1) && (pAd->StaCfg.bShowHiddenSSID == FALSE))
- {
- //
- // We must return this SSID during 4way handshaking, otherwise Aegis will failed to parse WPA infomation
- // and then failed to send EAPOl farame.
- //
- if ((pAd->StaCfg.AuthMode >= Ndis802_11AuthModeWPA) && (pAd->StaCfg.PortSecured != WPA_802_1X_PORT_SECURED))
- {
- pBss->Ssid.SsidLength = pAd->ScanTab.BssEntry[i].SsidLen;
- NdisMoveMemory(pBss->Ssid.Ssid, pAd->ScanTab.BssEntry[i].Ssid, pAd->ScanTab.BssEntry[i].SsidLen);
- }
- else
- pBss->Ssid.SsidLength = 0;
- }
- else
- {
- pBss->Ssid.SsidLength = pAd->ScanTab.BssEntry[i].SsidLen;
- NdisMoveMemory(pBss->Ssid.Ssid, pAd->ScanTab.BssEntry[i].Ssid, pAd->ScanTab.BssEntry[i].SsidLen);
- }
- pBss->Privacy = pAd->ScanTab.BssEntry[i].Privacy;
- pBss->Rssi = pAd->ScanTab.BssEntry[i].Rssi - pAd->BbpRssiToDbmDelta;
- pBss->NetworkTypeInUse = NetworkTypeInUseSanity(&pAd->ScanTab.BssEntry[i]);
- pBss->Configuration.Length = sizeof(NDIS_802_11_CONFIGURATION);
- pBss->Configuration.BeaconPeriod = pAd->ScanTab.BssEntry[i].BeaconPeriod;
- pBss->Configuration.ATIMWindow = pAd->ScanTab.BssEntry[i].AtimWin;
-
- MAP_CHANNEL_ID_TO_KHZ(pAd->ScanTab.BssEntry[i].Channel, pBss->Configuration.DSConfig);
-
- if (pAd->ScanTab.BssEntry[i].BssType == BSS_INFRA)
- pBss->InfrastructureMode = Ndis802_11Infrastructure;
- else
- pBss->InfrastructureMode = Ndis802_11IBSS;
-
- NdisMoveMemory(pBss->SupportedRates, pAd->ScanTab.BssEntry[i].SupRate, pAd->ScanTab.BssEntry[i].SupRateLen);
- NdisMoveMemory(pBss->SupportedRates + pAd->ScanTab.BssEntry[i].SupRateLen,
- pAd->ScanTab.BssEntry[i].ExtRate,
- pAd->ScanTab.BssEntry[i].ExtRateLen);
-
- if (pAd->ScanTab.BssEntry[i].VarIELen == 0)
- {
- pBss->IELength = sizeof(NDIS_802_11_FIXED_IEs);
- NdisMoveMemory(pBss->IEs, &pAd->ScanTab.BssEntry[i].FixIEs, sizeof(NDIS_802_11_FIXED_IEs));
- pPtr = pPtr + sizeof(NDIS_WLAN_BSSID_EX) - 1 + sizeof(NDIS_802_11_FIXED_IEs);
- }
- else
- {
- pBss->IELength = (ULONG)(sizeof(NDIS_802_11_FIXED_IEs) + pAd->ScanTab.BssEntry[i].VarIELen);
- pPtr = pPtr + sizeof(NDIS_WLAN_BSSID_EX) - 1 + sizeof(NDIS_802_11_FIXED_IEs);
- NdisMoveMemory(pBss->IEs, &pAd->ScanTab.BssEntry[i].FixIEs, sizeof(NDIS_802_11_FIXED_IEs));
- NdisMoveMemory(pBss->IEs + sizeof(NDIS_802_11_FIXED_IEs), pAd->ScanTab.BssEntry[i].VarIEs, pAd->ScanTab.BssEntry[i].VarIELen);
- pPtr += pAd->ScanTab.BssEntry[i].VarIELen;
- }
- pBss->Length = (ULONG)(sizeof(NDIS_WLAN_BSSID_EX) - 1 + sizeof(NDIS_802_11_FIXED_IEs) + pAd->ScanTab.BssEntry[i].VarIELen + Padding);
-
-#if WIRELESS_EXT < 17
- if ((BssLen + pBss->Length) < wrq->u.data.length)
- BssLen += pBss->Length;
- else
- {
- pBssidList->NumberOfItems = i;
- break;
- }
-#else
- BssLen += pBss->Length;
-#endif
- }
-
-#if WIRELESS_EXT < 17
- wrq->u.data.length = BssLen;
-#else
- if (BssLen > wrq->u.data.length)
- {
- kfree(pBssidList);
- return -E2BIG;
- }
- else
- wrq->u.data.length = BssLen;
-#endif
- Status = copy_to_user(wrq->u.data.pointer, pBssidList, BssLen);
- kfree(pBssidList);
- break;
- case OID_802_3_CURRENT_ADDRESS:
- wrq->u.data.length = MAC_ADDR_LEN;
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CurrentAddress, wrq->u.data.length);
- break;
- case OID_GEN_MEDIA_CONNECT_STATUS:
- if (pAd->IndicateMediaState == NdisMediaStateConnected)
- MediaState = NdisMediaStateConnected;
- else
- MediaState = NdisMediaStateDisconnected;
-
- wrq->u.data.length = sizeof(NDIS_MEDIA_STATE);
- Status = copy_to_user(wrq->u.data.pointer, &MediaState, wrq->u.data.length);
- break;
- case OID_802_11_BSSID:
- if (INFRA_ON(pAd) || ADHOC_ON(pAd))
- {
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.Bssid, sizeof(NDIS_802_11_MAC_ADDRESS));
-
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_BSSID(=EMPTY)\n"));
- Status = -ENOTCONN;
- }
- break;
- case OID_802_11_SSID:
- NdisZeroMemory(&Ssid, sizeof(NDIS_802_11_SSID));
- NdisZeroMemory(Ssid.Ssid, MAX_LEN_OF_SSID);
- Ssid.SsidLength = pAd->CommonCfg.SsidLen;
- memcpy(Ssid.Ssid, pAd->CommonCfg.Ssid, Ssid.SsidLength);
- wrq->u.data.length = sizeof(NDIS_802_11_SSID);
- Status = copy_to_user(wrq->u.data.pointer, &Ssid, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_SSID (Len=%d, ssid=%s)\n", Ssid.SsidLength,Ssid.Ssid));
- break;
- case RT_OID_802_11_QUERY_LINK_STATUS:
- pLinkStatus = (RT_802_11_LINK_STATUS *) kmalloc(sizeof(RT_802_11_LINK_STATUS), MEM_ALLOC_FLAG);
- if (pLinkStatus)
- {
- pLinkStatus->CurrTxRate = RateIdTo500Kbps[pAd->CommonCfg.TxRate]; // unit : 500 kbps
- pLinkStatus->ChannelQuality = pAd->Mlme.ChannelQuality;
- pLinkStatus->RxByteCount = pAd->RalinkCounters.ReceivedByteCount;
- pLinkStatus->TxByteCount = pAd->RalinkCounters.TransmittedByteCount;
- pLinkStatus->CentralChannel = pAd->CommonCfg.CentralChannel;
- wrq->u.data.length = sizeof(RT_802_11_LINK_STATUS);
- Status = copy_to_user(wrq->u.data.pointer, pLinkStatus, wrq->u.data.length);
- kfree(pLinkStatus);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_LINK_STATUS\n"));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_LINK_STATUS(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case OID_802_11_CONFIGURATION:
- pConfiguration = (NDIS_802_11_CONFIGURATION *) kmalloc(sizeof(NDIS_802_11_CONFIGURATION), MEM_ALLOC_FLAG);
- if (pConfiguration)
- {
- pConfiguration->Length = sizeof(NDIS_802_11_CONFIGURATION);
- pConfiguration->BeaconPeriod = pAd->CommonCfg.BeaconPeriod;
- pConfiguration->ATIMWindow = pAd->StaActive.AtimWin;
- MAP_CHANNEL_ID_TO_KHZ(pAd->CommonCfg.Channel, pConfiguration->DSConfig);
- wrq->u.data.length = sizeof(NDIS_802_11_CONFIGURATION);
- Status = copy_to_user(wrq->u.data.pointer, pConfiguration, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_CONFIGURATION(BeaconPeriod=%ld,AtimW=%ld,Channel=%d) \n",
- pConfiguration->BeaconPeriod, pConfiguration->ATIMWindow, pAd->CommonCfg.Channel));
- kfree(pConfiguration);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_CONFIGURATION(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case RT_OID_802_11_SNR_0:
- if ((pAd->StaCfg.LastSNR0 > 0))
- {
- ulInfo = ((0xeb - pAd->StaCfg.LastSNR0) * 3) / 16 ;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_SNR_0(0x=%lx)\n", ulInfo));
- }
- else
- Status = -EFAULT;
- break;
- case RT_OID_802_11_SNR_1:
- if ((pAd->Antenna.field.RxPath > 1) &&
- (pAd->StaCfg.LastSNR1 > 0))
- {
- ulInfo = ((0xeb - pAd->StaCfg.LastSNR1) * 3) / 16 ;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE,("Query::RT_OID_802_11_SNR_1(0x=%lx)\n",ulInfo));
- }
- else
- Status = -EFAULT;
- DBGPRINT(RT_DEBUG_TRACE,("Query::RT_OID_802_11_SNR_1(pAd->StaCfg.LastSNR1=%d)\n",pAd->StaCfg.LastSNR1));
- break;
- case OID_802_11_RSSI_TRIGGER:
- ulInfo = pAd->StaCfg.RssiSample.LastRssi0 - pAd->BbpRssiToDbmDelta;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_RSSI_TRIGGER(=%ld)\n", ulInfo));
- break;
- case OID_802_11_RSSI:
- case RT_OID_802_11_RSSI:
- ulInfo = pAd->StaCfg.RssiSample.LastRssi0;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case RT_OID_802_11_RSSI_1:
- ulInfo = pAd->StaCfg.RssiSample.LastRssi1;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case RT_OID_802_11_RSSI_2:
- ulInfo = pAd->StaCfg.RssiSample.LastRssi2;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case OID_802_11_STATISTICS:
- pStatistics = (NDIS_802_11_STATISTICS *) kmalloc(sizeof(NDIS_802_11_STATISTICS), MEM_ALLOC_FLAG);
- if (pStatistics)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_STATISTICS \n"));
- // add the most up-to-date h/w raw counters into software counters
- NICUpdateRawCounters(pAd);
-
- // Sanity check for calculation of sucessful count
- if (pAd->WlanCounters.TransmittedFragmentCount.QuadPart < pAd->WlanCounters.RetryCount.QuadPart)
- pAd->WlanCounters.TransmittedFragmentCount.QuadPart = pAd->WlanCounters.RetryCount.QuadPart;
-
- pStatistics->TransmittedFragmentCount.QuadPart = pAd->WlanCounters.TransmittedFragmentCount.QuadPart;
- pStatistics->MulticastTransmittedFrameCount.QuadPart = pAd->WlanCounters.MulticastTransmittedFrameCount.QuadPart;
- pStatistics->FailedCount.QuadPart = pAd->WlanCounters.FailedCount.QuadPart;
- pStatistics->RetryCount.QuadPart = pAd->WlanCounters.RetryCount.QuadPart;
- pStatistics->MultipleRetryCount.QuadPart = pAd->WlanCounters.MultipleRetryCount.QuadPart;
- pStatistics->RTSSuccessCount.QuadPart = pAd->WlanCounters.RTSSuccessCount.QuadPart;
- pStatistics->RTSFailureCount.QuadPart = pAd->WlanCounters.RTSFailureCount.QuadPart;
- pStatistics->ACKFailureCount.QuadPart = pAd->WlanCounters.ACKFailureCount.QuadPart;
- pStatistics->FrameDuplicateCount.QuadPart = pAd->WlanCounters.FrameDuplicateCount.QuadPart;
- pStatistics->ReceivedFragmentCount.QuadPart = pAd->WlanCounters.ReceivedFragmentCount.QuadPart;
- pStatistics->MulticastReceivedFrameCount.QuadPart = pAd->WlanCounters.MulticastReceivedFrameCount.QuadPart;
-#ifdef DBG
- pStatistics->FCSErrorCount = pAd->RalinkCounters.RealFcsErrCount;
-#else
- pStatistics->FCSErrorCount.QuadPart = pAd->WlanCounters.FCSErrorCount.QuadPart;
- pStatistics->FrameDuplicateCount.u.LowPart = pAd->WlanCounters.FrameDuplicateCount.u.LowPart / 100;
-#endif
- wrq->u.data.length = sizeof(NDIS_802_11_STATISTICS);
- Status = copy_to_user(wrq->u.data.pointer, pStatistics, wrq->u.data.length);
- kfree(pStatistics);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_STATISTICS(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case OID_GEN_RCV_OK:
- ulInfo = pAd->Counters8023.GoodReceives;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case OID_GEN_RCV_NO_BUFFER:
- ulInfo = pAd->Counters8023.RxNoBuffer;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case RT_OID_802_11_PHY_MODE:
- ulInfo = (ULONG)pAd->CommonCfg.PhyMode;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_PHY_MODE (=%ld)\n", ulInfo));
- break;
- case RT_OID_802_11_STA_CONFIG:
- pStaConfig = (RT_802_11_STA_CONFIG *) kmalloc(sizeof(RT_802_11_STA_CONFIG), MEM_ALLOC_FLAG);
- if (pStaConfig)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_STA_CONFIG\n"));
- pStaConfig->EnableTxBurst = pAd->CommonCfg.bEnableTxBurst;
- pStaConfig->EnableTurboRate = 0;
- pStaConfig->UseBGProtection = pAd->CommonCfg.UseBGProtection;
- pStaConfig->UseShortSlotTime = pAd->CommonCfg.bUseShortSlotTime;
- //pStaConfig->AdhocMode = pAd->StaCfg.AdhocMode;
- pStaConfig->HwRadioStatus = (pAd->StaCfg.bHwRadio == TRUE) ? 1 : 0;
- pStaConfig->Rsv1 = 0;
- pStaConfig->SystemErrorBitmap = pAd->SystemErrorBitmap;
- wrq->u.data.length = sizeof(RT_802_11_STA_CONFIG);
- Status = copy_to_user(wrq->u.data.pointer, pStaConfig, wrq->u.data.length);
- kfree(pStaConfig);
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_STA_CONFIG(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case OID_802_11_RTS_THRESHOLD:
- RtsThresh = pAd->CommonCfg.RtsThreshold;
- wrq->u.data.length = sizeof(RtsThresh);
- Status = copy_to_user(wrq->u.data.pointer, &RtsThresh, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_RTS_THRESHOLD(=%ld)\n", RtsThresh));
- break;
- case OID_802_11_FRAGMENTATION_THRESHOLD:
- FragThresh = pAd->CommonCfg.FragmentThreshold;
- if (pAd->CommonCfg.bUseZeroToDisableFragment == TRUE)
- FragThresh = 0;
- wrq->u.data.length = sizeof(FragThresh);
- Status = copy_to_user(wrq->u.data.pointer, &FragThresh, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_FRAGMENTATION_THRESHOLD(=%ld)\n", FragThresh));
- break;
- case OID_802_11_POWER_MODE:
- PowerMode = pAd->StaCfg.WindowsPowerMode;
- wrq->u.data.length = sizeof(PowerMode);
- Status = copy_to_user(wrq->u.data.pointer, &PowerMode, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_POWER_MODE(=%d)\n", PowerMode));
- break;
- case RT_OID_802_11_RADIO:
- RadioState = (BOOLEAN) pAd->StaCfg.bSwRadio;
- wrq->u.data.length = sizeof(RadioState);
- Status = copy_to_user(wrq->u.data.pointer, &RadioState, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_RADIO (=%d)\n", RadioState));
- break;
- case OID_802_11_INFRASTRUCTURE_MODE:
- if (pAd->StaCfg.BssType == BSS_ADHOC)
- BssType = Ndis802_11IBSS;
- else if (pAd->StaCfg.BssType == BSS_INFRA)
- BssType = Ndis802_11Infrastructure;
- else if (pAd->StaCfg.BssType == BSS_MONITOR)
- BssType = Ndis802_11Monitor;
- else
- BssType = Ndis802_11AutoUnknown;
-
- wrq->u.data.length = sizeof(BssType);
- Status = copy_to_user(wrq->u.data.pointer, &BssType, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_INFRASTRUCTURE_MODE(=%d)\n", BssType));
- break;
- case RT_OID_802_11_PREAMBLE:
- PreamType = pAd->CommonCfg.TxPreamble;
- wrq->u.data.length = sizeof(PreamType);
- Status = copy_to_user(wrq->u.data.pointer, &PreamType, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_PREAMBLE(=%d)\n", PreamType));
- break;
- case OID_802_11_AUTHENTICATION_MODE:
- AuthMode = pAd->StaCfg.AuthMode;
- wrq->u.data.length = sizeof(AuthMode);
- Status = copy_to_user(wrq->u.data.pointer, &AuthMode, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_AUTHENTICATION_MODE(=%d)\n", AuthMode));
- break;
- case OID_802_11_WEP_STATUS:
- WepStatus = pAd->StaCfg.WepStatus;
- wrq->u.data.length = sizeof(WepStatus);
- Status = copy_to_user(wrq->u.data.pointer, &WepStatus, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_WEP_STATUS(=%d)\n", WepStatus));
- break;
- case OID_802_11_TX_POWER_LEVEL:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.TxPower, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_TX_POWER_LEVEL %x\n",pAd->CommonCfg.TxPower));
- break;
- case RT_OID_802_11_TX_POWER_LEVEL_1:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.TxPowerPercentage, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_TX_POWER_LEVEL_1 (=%ld)\n", pAd->CommonCfg.TxPowerPercentage));
- break;
- case OID_802_11_NETWORK_TYPES_SUPPORTED:
- if ((pAd->RfIcType == RFIC_2850) || (pAd->RfIcType == RFIC_2750) || (pAd->RfIcType == RFIC_3052))
- {
- NetworkTypeList[0] = 3; // NumberOfItems = 3
- NetworkTypeList[1] = Ndis802_11DS; // NetworkType[1] = 11b
- NetworkTypeList[2] = Ndis802_11OFDM24; // NetworkType[2] = 11g
- NetworkTypeList[3] = Ndis802_11OFDM5; // NetworkType[3] = 11a
- wrq->u.data.length = 16;
- Status = copy_to_user(wrq->u.data.pointer, &NetworkTypeList[0], wrq->u.data.length);
- }
- else
- {
- NetworkTypeList[0] = 2; // NumberOfItems = 2
- NetworkTypeList[1] = Ndis802_11DS; // NetworkType[1] = 11b
- NetworkTypeList[2] = Ndis802_11OFDM24; // NetworkType[2] = 11g
- wrq->u.data.length = 12;
- Status = copy_to_user(wrq->u.data.pointer, &NetworkTypeList[0], wrq->u.data.length);
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_NETWORK_TYPES_SUPPORTED\n"));
- break;
- case OID_802_11_NETWORK_TYPE_IN_USE:
- wrq->u.data.length = sizeof(ULONG);
- if (pAd->CommonCfg.PhyMode == PHY_11A)
- ulInfo = Ndis802_11OFDM5;
- else if ((pAd->CommonCfg.PhyMode == PHY_11BG_MIXED) || (pAd->CommonCfg.PhyMode == PHY_11G))
- ulInfo = Ndis802_11OFDM24;
- else
- ulInfo = Ndis802_11DS;
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
- case RT_OID_802_11_QUERY_LAST_RX_RATE:
- ulInfo = (ULONG)pAd->LastRxRate;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_LAST_RX_RATE (=%ld)\n", ulInfo));
- break;
- case RT_OID_802_11_QUERY_LAST_TX_RATE:
- //ulInfo = (ULONG)pAd->LastTxRate;
- ulInfo = (ULONG)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word;
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_LAST_TX_RATE (=%lx)\n", ulInfo));
- break;
- case RT_OID_802_11_QUERY_EEPROM_VERSION:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->EepromVersion, wrq->u.data.length);
- break;
- case RT_OID_802_11_QUERY_FIRMWARE_VERSION:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->FirmwareVersion, wrq->u.data.length);
- break;
- case RT_OID_802_11_QUERY_NOISE_LEVEL:
- wrq->u.data.length = sizeof(UCHAR);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->BbpWriteLatch[66], wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_NOISE_LEVEL (=%d)\n", pAd->BbpWriteLatch[66]));
- break;
- case RT_OID_802_11_EXTRA_INFO:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->ExtraInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_EXTRA_INFO (=%ld)\n", pAd->ExtraInfo));
- break;
- case RT_OID_WE_VERSION_COMPILED:
- wrq->u.data.length = sizeof(UINT);
- we_version_compiled = WIRELESS_EXT;
- Status = copy_to_user(wrq->u.data.pointer, &we_version_compiled, wrq->u.data.length);
- break;
- case RT_OID_802_11_QUERY_APSD_SETTING:
- apsd = (pAd->CommonCfg.bAPSDCapable | (pAd->CommonCfg.bAPSDAC_BE << 1) | (pAd->CommonCfg.bAPSDAC_BK << 2)
- | (pAd->CommonCfg.bAPSDAC_VI << 3) | (pAd->CommonCfg.bAPSDAC_VO << 4) | (pAd->CommonCfg.MaxSPLength << 5));
-
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &apsd, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_APSD_SETTING (=0x%lx,APSDCap=%d,AC_BE=%d,AC_BK=%d,AC_VI=%d,AC_VO=%d,MAXSPLen=%d)\n",
- apsd,pAd->CommonCfg.bAPSDCapable,pAd->CommonCfg.bAPSDAC_BE,pAd->CommonCfg.bAPSDAC_BK,pAd->CommonCfg.bAPSDAC_VI,pAd->CommonCfg.bAPSDAC_VO,pAd->CommonCfg.MaxSPLength));
- break;
- case RT_OID_802_11_QUERY_APSD_PSM:
- wrq->u.data.length = sizeof(ULONG);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.bAPSDForcePowerSave, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_APSD_PSM (=%d)\n", pAd->CommonCfg.bAPSDForcePowerSave));
- break;
- case RT_OID_802_11_QUERY_WMM:
- wrq->u.data.length = sizeof(BOOLEAN);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.bWmmCapable, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_WMM (=%d)\n", pAd->CommonCfg.bWmmCapable));
- break;
-#ifdef WPA_SUPPLICANT_SUPPORT
- case RT_OID_NEW_DRIVER:
- {
- UCHAR enabled = 1;
- wrq->u.data.length = sizeof(UCHAR);
- Status = copy_to_user(wrq->u.data.pointer, &enabled, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_NEW_DRIVER (=%d)\n", enabled));
- }
- break;
- case RT_OID_WPA_SUPPLICANT_SUPPORT:
- wrq->u.data.length = sizeof(UCHAR);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->StaCfg.WpaSupplicantUP, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_WPA_SUPPLICANT_SUPPORT (=%d)\n", pAd->StaCfg.WpaSupplicantUP));
- break;
-#endif // WPA_SUPPLICANT_SUPPORT //
-
- case RT_OID_DRIVER_DEVICE_NAME:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_DRIVER_DEVICE_NAME \n"));
- wrq->u.data.length = 16;
- if (copy_to_user(wrq->u.data.pointer, pAd->StaCfg.dev_name, wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- break;
- case RT_OID_802_11_QUERY_HT_PHYMODE:
- pHTPhyMode = (OID_SET_HT_PHYMODE *) kmalloc(sizeof(OID_SET_HT_PHYMODE), MEM_ALLOC_FLAG);
- if (pHTPhyMode)
- {
- pHTPhyMode->PhyMode = pAd->CommonCfg.PhyMode;
- pHTPhyMode->HtMode = (UCHAR)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MODE;
- pHTPhyMode->BW = (UCHAR)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.BW;
- pHTPhyMode->MCS= (UCHAR)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.MCS;
- pHTPhyMode->SHORTGI= (UCHAR)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.ShortGI;
- pHTPhyMode->STBC= (UCHAR)pAd->MacTab.Content[BSSID_WCID].HTPhyMode.field.STBC;
-
- pHTPhyMode->ExtOffset = ((pAd->CommonCfg.CentralChannel < pAd->CommonCfg.Channel) ? (EXTCHA_BELOW) : (EXTCHA_ABOVE));
- wrq->u.data.length = sizeof(OID_SET_HT_PHYMODE);
- if (copy_to_user(wrq->u.data.pointer, pHTPhyMode, wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_HT_PHYMODE (PhyMode = %d, MCS =%d, BW = %d, STBC = %d, ExtOffset=%d)\n",
- pHTPhyMode->HtMode, pHTPhyMode->MCS, pHTPhyMode->BW, pHTPhyMode->STBC, pHTPhyMode->ExtOffset));
- DBGPRINT(RT_DEBUG_TRACE, (" MlmeUpdateTxRates (.word = %x )\n", pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_STA_CONFIG(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case RT_OID_802_11_COUNTRY_REGION:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_COUNTRY_REGION \n"));
- wrq->u.data.length = sizeof(ulInfo);
- ulInfo = pAd->CommonCfg.CountryRegionForABand;
- ulInfo = (ulInfo << 8)|(pAd->CommonCfg.CountryRegion);
- if (copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- break;
- case RT_OID_802_11_QUERY_DAT_HT_PHYMODE:
- pHTPhyMode = (OID_SET_HT_PHYMODE *) kmalloc(sizeof(OID_SET_HT_PHYMODE), MEM_ALLOC_FLAG);
- if (pHTPhyMode)
- {
- pHTPhyMode->PhyMode = pAd->CommonCfg.PhyMode;
- pHTPhyMode->HtMode = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.HTMODE;
- pHTPhyMode->BW = (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.BW;
- pHTPhyMode->MCS= (UCHAR)pAd->StaCfg.DesiredTransmitSetting.field.MCS;
- pHTPhyMode->SHORTGI= (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.ShortGI;
- pHTPhyMode->STBC= (UCHAR)pAd->CommonCfg.RegTransmitSetting.field.STBC;
-
- wrq->u.data.length = sizeof(OID_SET_HT_PHYMODE);
- if (copy_to_user(wrq->u.data.pointer, pHTPhyMode, wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_HT_PHYMODE (PhyMode = %d, MCS =%d, BW = %d, STBC = %d, ExtOffset=%d)\n",
- pHTPhyMode->HtMode, pHTPhyMode->MCS, pHTPhyMode->BW, pHTPhyMode->STBC, pHTPhyMode->ExtOffset));
- DBGPRINT(RT_DEBUG_TRACE, (" MlmeUpdateTxRates (.word = %x )\n", pAd->MacTab.Content[BSSID_WCID].HTPhyMode.word));
- }
- else
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_STA_CONFIG(kmalloc failed)\n"));
- Status = -EFAULT;
- }
- break;
- case RT_OID_QUERY_MULTIPLE_CARD_SUPPORT:
- wrq->u.data.length = sizeof(UCHAR);
- i = 0;
-#ifdef MULTIPLE_CARD_SUPPORT
- i = 1;
-#endif // MULTIPLE_CARD_SUPPORT //
- if (copy_to_user(wrq->u.data.pointer, &i, wrq->u.data.length))
- {
- Status = -EFAULT;
- }
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_QUERY_MULTIPLE_CARD_SUPPORT(=%d) \n", i));
- break;
-#ifdef SNMP_SUPPORT
- case RT_OID_802_11_MAC_ADDRESS:
- wrq->u.data.length = MAC_ADDR_LEN;
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CurrentAddress, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_MANUFACTUREROUI:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_MANUFACTUREROUI \n"));
- wrq->u.data.length = ManufacturerOUI_LEN;
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CurrentAddress, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_MANUFACTURERNAME:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_MANUFACTURERNAME \n"));
- wrq->u.data.length = strlen(ManufacturerNAME);
- Status = copy_to_user(wrq->u.data.pointer, ManufacturerNAME, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_RESOURCETYPEIDNAME:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_RESOURCETYPEIDNAME \n"));
- wrq->u.data.length = strlen(ResourceTypeIdName);
- Status = copy_to_user(wrq->u.data.pointer, ResourceTypeIdName, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_PRIVACYOPTIONIMPLEMENTED:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_PRIVACYOPTIONIMPLEMENTED \n"));
- ulInfo = 1; // 1 is support wep else 2 is not support.
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_POWERMANAGEMENTMODE:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_POWERMANAGEMENTMODE \n"));
- if (pAd->StaCfg.Psm == PSMP_ACTION)
- ulInfo = 1; // 1 is power active else 2 is power save.
- else
- ulInfo = 2;
-
- wrq->u.data.length = sizeof(ulInfo);
- Status = copy_to_user(wrq->u.data.pointer, &ulInfo, wrq->u.data.length);
- break;
-
- case OID_802_11_WEPDEFAULTKEYVALUE:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_WEPDEFAULTKEYVALUE \n"));
- //KeyIdxValue.KeyIdx = pAd->PortCfg.MBSSID[pAd->IoctlIF].DefaultKeyId;
- pKeyIdxValue = wrq->u.data.pointer;
- DBGPRINT(RT_DEBUG_TRACE,("KeyIdxValue.KeyIdx = %d, \n",pKeyIdxValue->KeyIdx));
- valueLen = pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen;
- NdisMoveMemory(pKeyIdxValue->Value,
- &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].Key,
- valueLen);
- pKeyIdxValue->Value[valueLen]='\0';
-
- wrq->u.data.length = sizeof(DefaultKeyIdxValue);
-
- Status = copy_to_user(wrq->u.data.pointer, pKeyIdxValue, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE,("DefaultKeyId = %d, total len = %d, str len=%d, KeyValue= %02x %02x %02x %02x \n",
- pAd->StaCfg.DefaultKeyId,
- wrq->u.data.length,
- pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen,
- pAd->SharedKey[BSS0][0].Key[0],
- pAd->SharedKey[BSS0][1].Key[0],
- pAd->SharedKey[BSS0][2].Key[0],
- pAd->SharedKey[BSS0][3].Key[0]));
- break;
-
- case OID_802_11_WEPDEFAULTKEYID:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_WEPDEFAULTKEYID \n"));
- wrq->u.data.length = sizeof(UCHAR);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->StaCfg.DefaultKeyId, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("DefaultKeyId =%d \n", pAd->StaCfg.DefaultKeyId));
- break;
-
- case RT_OID_802_11_WEPKEYMAPPINGLENGTH:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_WEPKEYMAPPINGLENGTH \n"));
- wrq->u.data.length = sizeof(UCHAR);
- Status = copy_to_user(wrq->u.data.pointer,
- &pAd->SharedKey[BSS0][pAd->StaCfg.DefaultKeyId].KeyLen,
- wrq->u.data.length);
- break;
-
- case OID_802_11_SHORTRETRYLIMIT:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_SHORTRETRYLIMIT \n"));
- wrq->u.data.length = sizeof(ULONG);
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &tx_rty_cfg.word);
- ShortRetryLimit = tx_rty_cfg.field.ShortRtyLimit;
- DBGPRINT(RT_DEBUG_TRACE, ("ShortRetryLimit =%ld, tx_rty_cfg.field.ShortRetryLimit=%d\n", ShortRetryLimit, tx_rty_cfg.field.ShortRtyLimit));
- Status = copy_to_user(wrq->u.data.pointer, &ShortRetryLimit, wrq->u.data.length);
- break;
-
- case OID_802_11_LONGRETRYLIMIT:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_LONGRETRYLIMIT \n"));
- wrq->u.data.length = sizeof(ULONG);
- RTMP_IO_READ32(pAd, TX_RTY_CFG, &tx_rty_cfg.word);
- LongRetryLimit = tx_rty_cfg.field.LongRtyLimit;
- DBGPRINT(RT_DEBUG_TRACE, ("LongRetryLimit =%ld, tx_rty_cfg.field.LongRtyLimit=%d\n", LongRetryLimit, tx_rty_cfg.field.LongRtyLimit));
- Status = copy_to_user(wrq->u.data.pointer, &LongRetryLimit, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_PRODUCTID:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_PRODUCTID \n"));
-
-#ifdef RTMP_MAC_PCI
- {
-
- USHORT device_id;
- if (((POS_COOKIE)pAd->OS_Cookie)->pci_dev != NULL)
- pci_read_config_word(((POS_COOKIE)pAd->OS_Cookie)->pci_dev, PCI_DEVICE_ID, &device_id);
- else
- DBGPRINT(RT_DEBUG_TRACE, (" pci_dev = NULL\n"));
- sprintf((PSTRING)tmp, "%04x %04x\n", NIC_PCI_VENDOR_ID, device_id);
- }
-#endif // RTMP_MAC_PCI //
- wrq->u.data.length = strlen((PSTRING)tmp);
- Status = copy_to_user(wrq->u.data.pointer, tmp, wrq->u.data.length);
- break;
-
- case RT_OID_802_11_MANUFACTUREID:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_MANUFACTUREID \n"));
- wrq->u.data.length = strlen(ManufacturerNAME);
- Status = copy_to_user(wrq->u.data.pointer, ManufacturerNAME, wrq->u.data.length);
- break;
-
- case OID_802_11_CURRENTCHANNEL:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_CURRENTCHANNEL \n"));
- wrq->u.data.length = sizeof(UCHAR);
- DBGPRINT(RT_DEBUG_TRACE, ("sizeof UCHAR=%d, channel=%d \n", sizeof(UCHAR), pAd->CommonCfg.Channel));
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.Channel, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Status=%d\n", Status));
- break;
-#endif //SNMP_SUPPORT
-
- case OID_802_11_BUILD_CHANNEL_EX:
- {
- UCHAR value;
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_BUILD_CHANNEL_EX \n"));
- wrq->u.data.length = sizeof(UCHAR);
-#ifdef EXT_BUILD_CHANNEL_LIST
- DBGPRINT(RT_DEBUG_TRACE, ("Support EXT_BUILD_CHANNEL_LIST.\n"));
- value = 1;
-#else
- DBGPRINT(RT_DEBUG_TRACE, ("Doesn't support EXT_BUILD_CHANNEL_LIST.\n"));
- value = 0;
-#endif // EXT_BUILD_CHANNEL_LIST //
- Status = copy_to_user(wrq->u.data.pointer, &value, 1);
- DBGPRINT(RT_DEBUG_TRACE, ("Status=%d\n", Status));
- }
- break;
-
- case OID_802_11_GET_CH_LIST:
- {
- PRT_CHANNEL_LIST_INFO pChListBuf;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_GET_CH_LIST \n"));
- if (pAd->ChannelListNum == 0)
- {
- wrq->u.data.length = 0;
- break;
- }
-
- pChListBuf = (RT_CHANNEL_LIST_INFO *) kmalloc(sizeof(RT_CHANNEL_LIST_INFO), MEM_ALLOC_FLAG);
- if (pChListBuf == NULL)
- {
- wrq->u.data.length = 0;
- break;
- }
-
- pChListBuf->ChannelListNum = pAd->ChannelListNum;
- for (i = 0; i < pChListBuf->ChannelListNum; i++)
- pChListBuf->ChannelList[i] = pAd->ChannelList[i].Channel;
-
- wrq->u.data.length = sizeof(RT_CHANNEL_LIST_INFO);
- Status = copy_to_user(wrq->u.data.pointer, pChListBuf, sizeof(RT_CHANNEL_LIST_INFO));
- DBGPRINT(RT_DEBUG_TRACE, ("Status=%d\n", Status));
-
- if (pChListBuf)
- kfree(pChListBuf);
- }
- break;
-
- case OID_802_11_GET_COUNTRY_CODE:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_GET_COUNTRY_CODE \n"));
- wrq->u.data.length = 2;
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.CountryCode, 2);
- DBGPRINT(RT_DEBUG_TRACE, ("Status=%d\n", Status));
- break;
-
- case OID_802_11_GET_CHANNEL_GEOGRAPHY:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_GET_CHANNEL_GEOGRAPHY \n"));
- wrq->u.data.length = 1;
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.Geography, 1);
- DBGPRINT(RT_DEBUG_TRACE, ("Status=%d\n", Status));
- break;
-
-
-#ifdef QOS_DLS_SUPPORT
- case RT_OID_802_11_QUERY_DLS:
- wrq->u.data.length = sizeof(BOOLEAN);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.bDLSCapable, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_DLS(=%d)\n", pAd->CommonCfg.bDLSCapable));
- break;
-
- case RT_OID_802_11_QUERY_DLS_PARAM:
- {
- PRT_802_11_DLS_INFO pDlsInfo = kmalloc(sizeof(RT_802_11_DLS_INFO), GFP_ATOMIC);
- if (pDlsInfo == NULL)
- break;
-
- for (i=0; i<MAX_NUM_OF_DLS_ENTRY; i++)
- {
- RTMPMoveMemory(&pDlsInfo->Entry[i], &pAd->StaCfg.DLSEntry[i], sizeof(RT_802_11_DLS_UI));
- }
-
- pDlsInfo->num = MAX_NUM_OF_DLS_ENTRY;
- wrq->u.data.length = sizeof(RT_802_11_DLS_INFO);
- Status = copy_to_user(wrq->u.data.pointer, pDlsInfo, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::RT_OID_802_11_QUERY_DLS_PARAM\n"));
-
- if (pDlsInfo)
- kfree(pDlsInfo);
- }
- break;
-#endif // QOS_DLS_SUPPORT //
-
- case OID_802_11_SET_PSPXLINK_MODE:
- wrq->u.data.length = sizeof(BOOLEAN);
- Status = copy_to_user(wrq->u.data.pointer, &pAd->CommonCfg.PSPXlink, wrq->u.data.length);
- DBGPRINT(RT_DEBUG_TRACE, ("Query::OID_802_11_SET_PSPXLINK_MODE(=%d)\n", pAd->CommonCfg.PSPXlink));
- break;
-
-
- default:
- DBGPRINT(RT_DEBUG_TRACE, ("Query::unknown IOCTL's subcmd = 0x%08x\n", cmd));
- Status = -EOPNOTSUPP;
- break;
- }
- return Status;
-}
-
-INT rt28xx_sta_ioctl(
- IN struct net_device *net_dev,
- IN OUT struct ifreq *rq,
- IN INT cmd)
-{
- POS_COOKIE pObj;
- RTMP_ADAPTER *pAd = NULL;
- struct iwreq *wrq = (struct iwreq *) rq;
- BOOLEAN StateMachineTouched = FALSE;
- INT Status = NDIS_STATUS_SUCCESS;
- USHORT subcmd;
-
-
- pAd = RTMP_OS_NETDEV_GET_PRIV(net_dev);
- if (pAd == NULL)
- {
- /* if 1st open fail, pAd will be free;
- So the net_dev->priv will be NULL in 2rd open */
- return -ENETDOWN;
- }
- pObj = (POS_COOKIE) pAd->OS_Cookie;
-
- //check if the interface is down
- if(!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
-#ifdef CONFIG_APSTA_MIXED_SUPPORT
- if (wrq->u.data.pointer == NULL)
- {
- return Status;
- }
-
- if (strstr(wrq->u.data.pointer, "OpMode") == NULL)
-#endif // CONFIG_APSTA_MIXED_SUPPORT //
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
- }
-
- { // determine this ioctl command is comming from which interface.
- pObj->ioctl_if_type = INT_MAIN;
- pObj->ioctl_if = MAIN_MBSSID;
- }
-
- switch(cmd)
- {
-#ifdef RALINK_ATE
-#ifdef RALINK_28xx_QA
- case RTPRIV_IOCTL_ATE:
- {
- RtmpDoAte(pAd, wrq);
- }
- break;
-#endif // RALINK_28xx_QA //
-#endif // RALINK_ATE //
- case SIOCGIFHWADDR:
- DBGPRINT(RT_DEBUG_TRACE, ("IOCTL::SIOCGIFHWADDR\n"));
- memcpy(wrq->u.name, pAd->CurrentAddress, ETH_ALEN);
- break;
- case SIOCGIWNAME:
- {
- char *name=&wrq->u.name[0];
- rt_ioctl_giwname(net_dev, NULL, name, NULL);
- break;
- }
- case SIOCGIWESSID: //Get ESSID
- {
- struct iw_point *essid=&wrq->u.essid;
- rt_ioctl_giwessid(net_dev, NULL, essid, essid->pointer);
- break;
- }
- case SIOCSIWESSID: //Set ESSID
- {
- struct iw_point *essid=&wrq->u.essid;
- rt_ioctl_siwessid(net_dev, NULL, essid, essid->pointer);
- break;
- }
- case SIOCSIWNWID: // set network id (the cell)
- case SIOCGIWNWID: // get network id
- Status = -EOPNOTSUPP;
- break;
- case SIOCSIWFREQ: //set channel/frequency (Hz)
- {
- struct iw_freq *freq=&wrq->u.freq;
- rt_ioctl_siwfreq(net_dev, NULL, freq, NULL);
- break;
- }
- case SIOCGIWFREQ: // get channel/frequency (Hz)
- {
- struct iw_freq *freq=&wrq->u.freq;
- rt_ioctl_giwfreq(net_dev, NULL, freq, NULL);
- break;
- }
- case SIOCSIWNICKN: //set node name/nickname
- {
- //struct iw_point *data=&wrq->u.data;
- //rt_ioctl_siwnickn(net_dev, NULL, data, NULL);
- break;
- }
- case SIOCGIWNICKN: //get node name/nickname
- {
- struct iw_point *erq = NULL;
- erq = &wrq->u.data;
- erq->length = strlen((PSTRING) pAd->nickname);
- Status = copy_to_user(erq->pointer, pAd->nickname, erq->length);
- break;
- }
- case SIOCGIWRATE: //get default bit rate (bps)
- rt_ioctl_giwrate(net_dev, NULL, &wrq->u, NULL);
- break;
- case SIOCSIWRATE: //set default bit rate (bps)
- rt_ioctl_siwrate(net_dev, NULL, &wrq->u, NULL);
- break;
- case SIOCGIWRTS: // get RTS/CTS threshold (bytes)
- {
- struct iw_param *rts=&wrq->u.rts;
- rt_ioctl_giwrts(net_dev, NULL, rts, NULL);
- break;
- }
- case SIOCSIWRTS: //set RTS/CTS threshold (bytes)
- {
- struct iw_param *rts=&wrq->u.rts;
- rt_ioctl_siwrts(net_dev, NULL, rts, NULL);
- break;
- }
- case SIOCGIWFRAG: //get fragmentation thr (bytes)
- {
- struct iw_param *frag=&wrq->u.frag;
- rt_ioctl_giwfrag(net_dev, NULL, frag, NULL);
- break;
- }
- case SIOCSIWFRAG: //set fragmentation thr (bytes)
- {
- struct iw_param *frag=&wrq->u.frag;
- rt_ioctl_siwfrag(net_dev, NULL, frag, NULL);
- break;
- }
- case SIOCGIWENCODE: //get encoding token & mode
- {
- struct iw_point *erq=&wrq->u.encoding;
- if(erq)
- rt_ioctl_giwencode(net_dev, NULL, erq, erq->pointer);
- break;
- }
- case SIOCSIWENCODE: //set encoding token & mode
- {
- struct iw_point *erq=&wrq->u.encoding;
- if(erq)
- rt_ioctl_siwencode(net_dev, NULL, erq, erq->pointer);
- break;
- }
- case SIOCGIWAP: //get access point MAC addresses
- {
- struct sockaddr *ap_addr=&wrq->u.ap_addr;
- rt_ioctl_giwap(net_dev, NULL, ap_addr, ap_addr->sa_data);
- break;
- }
- case SIOCSIWAP: //set access point MAC addresses
- {
- struct sockaddr *ap_addr=&wrq->u.ap_addr;
- rt_ioctl_siwap(net_dev, NULL, ap_addr, ap_addr->sa_data);
- break;
- }
- case SIOCGIWMODE: //get operation mode
- {
- __u32 *mode=&wrq->u.mode;
- rt_ioctl_giwmode(net_dev, NULL, mode, NULL);
- break;
- }
- case SIOCSIWMODE: //set operation mode
- {
- __u32 *mode=&wrq->u.mode;
- rt_ioctl_siwmode(net_dev, NULL, mode, NULL);
- break;
- }
- case SIOCGIWSENS: //get sensitivity (dBm)
- case SIOCSIWSENS: //set sensitivity (dBm)
- case SIOCGIWPOWER: //get Power Management settings
- case SIOCSIWPOWER: //set Power Management settings
- case SIOCGIWTXPOW: //get transmit power (dBm)
- case SIOCSIWTXPOW: //set transmit power (dBm)
- case SIOCGIWRANGE: //Get range of parameters
- case SIOCGIWRETRY: //get retry limits and lifetime
- case SIOCSIWRETRY: //set retry limits and lifetime
- Status = -EOPNOTSUPP;
- break;
- case RT_PRIV_IOCTL:
- case RT_PRIV_IOCTL_EXT:
- subcmd = wrq->u.data.flags;
- if( subcmd & OID_GET_SET_TOGGLE)
- Status = RTMPSetInformation(pAd, rq, subcmd);
- else
- Status = RTMPQueryInformation(pAd, rq, subcmd);
- break;
- case SIOCGIWPRIV:
- if (wrq->u.data.pointer)
- {
- if ( access_ok(VERIFY_WRITE, wrq->u.data.pointer, sizeof(privtab)) != TRUE)
- break;
- wrq->u.data.length = sizeof(privtab) / sizeof(privtab[0]);
- if (copy_to_user(wrq->u.data.pointer, privtab, sizeof(privtab)))
- Status = -EFAULT;
- }
- break;
- case RTPRIV_IOCTL_SET:
- if(access_ok(VERIFY_READ, wrq->u.data.pointer, wrq->u.data.length) != TRUE)
- break;
- rt_ioctl_setparam(net_dev, NULL, NULL, wrq->u.data.pointer);
- break;
- case RTPRIV_IOCTL_GSITESURVEY:
- RTMPIoctlGetSiteSurvey(pAd, wrq);
- break;
-#ifdef DBG
- case RTPRIV_IOCTL_MAC:
- RTMPIoctlMAC(pAd, wrq);
- break;
- case RTPRIV_IOCTL_E2P:
- RTMPIoctlE2PROM(pAd, wrq);
- break;
-#ifdef RTMP_RF_RW_SUPPORT
- case RTPRIV_IOCTL_RF:
- RTMPIoctlRF(pAd, wrq);
- break;
-#endif // RTMP_RF_RW_SUPPORT //
-#endif // DBG //
-
- case SIOCETHTOOL:
- break;
- default:
- DBGPRINT(RT_DEBUG_ERROR, ("IOCTL::unknown IOCTL's cmd = 0x%08x\n", cmd));
- Status = -EOPNOTSUPP;
- break;
- }
-
- if(StateMachineTouched) // Upper layer sent a MLME-related operations
- RTMP_MLME_HANDLER(pAd);
-
- return Status;
-}
-
-/*
- ==========================================================================
- Description:
- Set SSID
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_SSID_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- NDIS_802_11_SSID Ssid, *pSsid=NULL;
- BOOLEAN StateMachineTouched = FALSE;
- int success = TRUE;
-
- if( strlen(arg) <= MAX_LEN_OF_SSID)
- {
- NdisZeroMemory(&Ssid, sizeof(NDIS_802_11_SSID));
- if (strlen(arg) != 0)
- {
- NdisMoveMemory(Ssid.Ssid, arg, strlen(arg));
- Ssid.SsidLength = strlen(arg);
- }
- else //ANY ssid
- {
- Ssid.SsidLength = 0;
- memcpy(Ssid.Ssid, "", 0);
- pAdapter->StaCfg.BssType = BSS_INFRA;
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- pAdapter->StaCfg.WepStatus = Ndis802_11EncryptionDisabled;
- }
- pSsid = &Ssid;
-
- if (pAdapter->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- if ((pAdapter->StaCfg.WpaPassPhraseLen >= 8) &&
- (pAdapter->StaCfg.WpaPassPhraseLen <= 64))
- {
- STRING passphrase_str[65] = {0};
- UCHAR keyMaterial[40];
-
- RTMPMoveMemory(passphrase_str, pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.WpaPassPhraseLen);
- RTMPZeroMemory(pAdapter->StaCfg.PMK, 32);
- if (pAdapter->StaCfg.WpaPassPhraseLen == 64)
- {
- AtoH((PSTRING) pAdapter->StaCfg.WpaPassPhrase, pAdapter->StaCfg.PMK, 32);
- }
- else
- {
- PasswordHash((PSTRING) pAdapter->StaCfg.WpaPassPhrase, Ssid.Ssid, Ssid.SsidLength, keyMaterial);
- NdisMoveMemory(pAdapter->StaCfg.PMK, keyMaterial, 32);
- }
- }
-
- pAdapter->MlmeAux.CurrReqIsFromNdis = TRUE;
- pAdapter->StaCfg.bScanReqIsFromWebUI = FALSE;
- pAdapter->bConfigChanged = TRUE;
-
- MlmeEnqueue(pAdapter,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_SSID,
- sizeof(NDIS_802_11_SSID),
- (VOID *)pSsid);
-
- StateMachineTouched = TRUE;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_SSID_Proc::(Len=%d,Ssid=%s)\n", Ssid.SsidLength, Ssid.Ssid));
- }
- else
- success = FALSE;
-
- if (StateMachineTouched) // Upper layer sent a MLME-related operations
- RTMP_MLME_HANDLER(pAdapter);
-
- return success;
-}
-
-#ifdef WMM_SUPPORT
-/*
- ==========================================================================
- Description:
- Set WmmCapable Enable or Disable
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_WmmCapable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- BOOLEAN bWmmCapable;
-
- bWmmCapable = simple_strtol(arg, 0, 10);
-
- if ((bWmmCapable == 1)
- )
- pAd->CommonCfg.bWmmCapable = TRUE;
- else if (bWmmCapable == 0)
- pAd->CommonCfg.bWmmCapable = FALSE;
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_WmmCapable_Proc::(bWmmCapable=%d)\n",
- pAd->CommonCfg.bWmmCapable));
-
- return TRUE;
-}
-#endif // WMM_SUPPORT //
-
-/*
- ==========================================================================
- Description:
- Set Network Type(Infrastructure/Adhoc mode)
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_NetworkType_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- UINT32 Value = 0;
-
- if (strcmp(arg, "Adhoc") == 0)
- {
- if (pAdapter->StaCfg.BssType != BSS_ADHOC)
- {
- // Config has changed
- pAdapter->bConfigChanged = TRUE;
- if (MONITOR_ON(pAdapter))
- {
- RTMP_IO_WRITE32(pAdapter, RX_FILTR_CFG, STANORMAL);
- RTMP_IO_READ32(pAdapter, MAC_SYS_CTRL, &Value);
- Value &= (~0x80);
- RTMP_IO_WRITE32(pAdapter, MAC_SYS_CTRL, Value);
- OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED);
- pAdapter->StaCfg.bAutoReconnect = TRUE;
- LinkDown(pAdapter, FALSE);
- }
- if (INFRA_ON(pAdapter))
- {
- //BOOLEAN Cancelled;
- // Set the AutoReconnectSsid to prevent it reconnect to old SSID
- // Since calling this indicate user don't want to connect to that SSID anymore.
- pAdapter->MlmeAux.AutoReconnectSsidLen= 32;
- NdisZeroMemory(pAdapter->MlmeAux.AutoReconnectSsid, pAdapter->MlmeAux.AutoReconnectSsidLen);
-
- LinkDown(pAdapter, FALSE);
-
- DBGPRINT(RT_DEBUG_TRACE, ("NDIS_STATUS_MEDIA_DISCONNECT Event BB!\n"));
- }
- }
- pAdapter->StaCfg.BssType = BSS_ADHOC;
- pAdapter->net_dev->type = pAdapter->StaCfg.OriDevType;
- DBGPRINT(RT_DEBUG_TRACE, ("===>Set_NetworkType_Proc::(AD-HOC)\n"));
- }
- else if (strcmp(arg, "Infra") == 0)
- {
- if (pAdapter->StaCfg.BssType != BSS_INFRA)
- {
- // Config has changed
- pAdapter->bConfigChanged = TRUE;
- if (MONITOR_ON(pAdapter))
- {
- RTMP_IO_WRITE32(pAdapter, RX_FILTR_CFG, STANORMAL);
- RTMP_IO_READ32(pAdapter, MAC_SYS_CTRL, &Value);
- Value &= (~0x80);
- RTMP_IO_WRITE32(pAdapter, MAC_SYS_CTRL, Value);
- OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED);
- pAdapter->StaCfg.bAutoReconnect = TRUE;
- LinkDown(pAdapter, FALSE);
- }
- if (ADHOC_ON(pAdapter))
- {
- // Set the AutoReconnectSsid to prevent it reconnect to old SSID
- // Since calling this indicate user don't want to connect to that SSID anymore.
- pAdapter->MlmeAux.AutoReconnectSsidLen= 32;
- NdisZeroMemory(pAdapter->MlmeAux.AutoReconnectSsid, pAdapter->MlmeAux.AutoReconnectSsidLen);
-
- LinkDown(pAdapter, FALSE);
- }
- }
- pAdapter->StaCfg.BssType = BSS_INFRA;
- pAdapter->net_dev->type = pAdapter->StaCfg.OriDevType;
- DBGPRINT(RT_DEBUG_TRACE, ("===>Set_NetworkType_Proc::(INFRA)\n"));
- }
- else if (strcmp(arg, "Monitor") == 0)
- {
- UCHAR bbpValue = 0;
- BCN_TIME_CFG_STRUC csr;
- OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_INFRA_ON);
- OPSTATUS_CLEAR_FLAG(pAdapter, fOP_STATUS_ADHOC_ON);
- OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_MEDIA_STATE_CONNECTED);
- // disable all periodic state machine
- pAdapter->StaCfg.bAutoReconnect = FALSE;
- // reset all mlme state machine
- RTMP_MLME_RESET_STATE_MACHINE(pAdapter);
- DBGPRINT(RT_DEBUG_TRACE, ("fOP_STATUS_MEDIA_STATE_CONNECTED \n"));
- if (pAdapter->CommonCfg.CentralChannel == 0)
- {
-#ifdef DOT11_N_SUPPORT
- if (pAdapter->CommonCfg.PhyMode == PHY_11AN_MIXED)
- pAdapter->CommonCfg.CentralChannel = 36;
- else
-#endif // DOT11_N_SUPPORT //
- pAdapter->CommonCfg.CentralChannel = 6;
- }
-#ifdef DOT11_N_SUPPORT
- else
- N_ChannelCheck(pAdapter);
-#endif // DOT11_N_SUPPORT //
-
-#ifdef DOT11_N_SUPPORT
- if (pAdapter->CommonCfg.PhyMode >= PHY_11ABGN_MIXED &&
- pAdapter->CommonCfg.RegTransmitSetting.field.BW == BW_40 &&
- pAdapter->CommonCfg.RegTransmitSetting.field.EXTCHA == EXTCHA_ABOVE)
- {
- // 40MHz ,control channel at lower
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R4, &bbpValue);
- bbpValue &= (~0x18);
- bbpValue |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R4, bbpValue);
- pAdapter->CommonCfg.BBPCurrentBW = BW_40;
- // RX : control channel at lower
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R3, &bbpValue);
- bbpValue &= (~0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R3, bbpValue);
-
- RTMP_IO_READ32(pAdapter, TX_BAND_CFG, &Value);
- Value &= 0xfffffffe;
- RTMP_IO_WRITE32(pAdapter, TX_BAND_CFG, Value);
- pAdapter->CommonCfg.CentralChannel = pAdapter->CommonCfg.Channel + 2;
- AsicSwitchChannel(pAdapter, pAdapter->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAdapter, pAdapter->CommonCfg.CentralChannel);
- DBGPRINT(RT_DEBUG_TRACE, ("BW_40 ,control_channel(%d), CentralChannel(%d) \n",
- pAdapter->CommonCfg.Channel,
- pAdapter->CommonCfg.CentralChannel));
- }
- else if (pAdapter->CommonCfg.PhyMode >= PHY_11ABGN_MIXED &&
- pAdapter->CommonCfg.RegTransmitSetting.field.BW == BW_40 &&
- pAdapter->CommonCfg.RegTransmitSetting.field.EXTCHA == EXTCHA_BELOW)
- {
- // 40MHz ,control channel at upper
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R4, &bbpValue);
- bbpValue &= (~0x18);
- bbpValue |= 0x10;
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R4, bbpValue);
- pAdapter->CommonCfg.BBPCurrentBW = BW_40;
- RTMP_IO_READ32(pAdapter, TX_BAND_CFG, &Value);
- Value |= 0x1;
- RTMP_IO_WRITE32(pAdapter, TX_BAND_CFG, Value);
-
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R3, &bbpValue);
- bbpValue |= (0x20);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R3, bbpValue);
- pAdapter->CommonCfg.CentralChannel = pAdapter->CommonCfg.Channel - 2;
- AsicSwitchChannel(pAdapter, pAdapter->CommonCfg.CentralChannel, FALSE);
- AsicLockChannel(pAdapter, pAdapter->CommonCfg.CentralChannel);
- DBGPRINT(RT_DEBUG_TRACE, ("BW_40 ,control_channel(%d), CentralChannel(%d) \n",
- pAdapter->CommonCfg.Channel,
- pAdapter->CommonCfg.CentralChannel));
- }
- else
-#endif // DOT11_N_SUPPORT //
- {
- // 20MHz
- RTMP_BBP_IO_READ8_BY_REG_ID(pAdapter, BBP_R4, &bbpValue);
- bbpValue &= (~0x18);
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R4, bbpValue);
- pAdapter->CommonCfg.BBPCurrentBW = BW_20;
- AsicSwitchChannel(pAdapter, pAdapter->CommonCfg.Channel, FALSE);
- AsicLockChannel(pAdapter, pAdapter->CommonCfg.Channel);
- DBGPRINT(RT_DEBUG_TRACE, ("BW_20, Channel(%d)\n", pAdapter->CommonCfg.Channel));
- }
- // Enable Rx with promiscuous reception
- RTMP_IO_WRITE32(pAdapter, RX_FILTR_CFG, 0x3);
- // ASIC supporsts sniffer function with replacing RSSI with timestamp.
- //RTMP_IO_READ32(pAdapter, MAC_SYS_CTRL, &Value);
- //Value |= (0x80);
- //RTMP_IO_WRITE32(pAdapter, MAC_SYS_CTRL, Value);
- // disable sync
- RTMP_IO_READ32(pAdapter, BCN_TIME_CFG, &csr.word);
- csr.field.bBeaconGen = 0;
- csr.field.bTBTTEnable = 0;
- csr.field.TsfSyncMode = 0;
- RTMP_IO_WRITE32(pAdapter, BCN_TIME_CFG, csr.word);
-
- pAdapter->StaCfg.BssType = BSS_MONITOR;
- pAdapter->net_dev->type = ARPHRD_IEEE80211_PRISM; //ARPHRD_IEEE80211; // IEEE80211
- DBGPRINT(RT_DEBUG_TRACE, ("===>Set_NetworkType_Proc::(MONITOR)\n"));
- }
-
- // Reset Ralink supplicant to not use, it will be set to start when UI set PMK key
- pAdapter->StaCfg.WpaState = SS_NOTUSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_NetworkType_Proc::(NetworkType=%d)\n", pAdapter->StaCfg.BssType));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Authentication mode
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_AuthMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- if ((strcmp(arg, "WEPAUTO") == 0) || (strcmp(arg, "wepauto") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeAutoSwitch;
- else if ((strcmp(arg, "OPEN") == 0) || (strcmp(arg, "open") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeOpen;
- else if ((strcmp(arg, "SHARED") == 0) || (strcmp(arg, "shared") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeShared;
- else if ((strcmp(arg, "WPAPSK") == 0) || (strcmp(arg, "wpapsk") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPAPSK;
- else if ((strcmp(arg, "WPANONE") == 0) || (strcmp(arg, "wpanone") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPANone;
- else if ((strcmp(arg, "WPA2PSK") == 0) || (strcmp(arg, "wpa2psk") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2PSK;
-#ifdef WPA_SUPPLICANT_SUPPORT
- else if ((strcmp(arg, "WPA") == 0) || (strcmp(arg, "wpa") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA;
- else if ((strcmp(arg, "WPA2") == 0) || (strcmp(arg, "wpa2") == 0))
- pAdapter->StaCfg.AuthMode = Ndis802_11AuthModeWPA2;
-#endif // WPA_SUPPLICANT_SUPPORT //
- else
- return FALSE;
-
- pAdapter->StaCfg.PortSecured = WPA_802_1X_PORT_NOT_SECURED;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_AuthMode_Proc::(AuthMode=%d)\n", pAdapter->StaCfg.AuthMode));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Encryption Type
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_EncrypType_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- if ((strcmp(arg, "NONE") == 0) || (strcmp(arg, "none") == 0))
- {
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPDisabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPDisabled;
- }
- else if ((strcmp(arg, "WEP") == 0) || (strcmp(arg, "wep") == 0))
- {
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- pAdapter->StaCfg.WepStatus = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.PairCipher = Ndis802_11WEPEnabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11WEPEnabled;
- }
- else if ((strcmp(arg, "TKIP") == 0) || (strcmp(arg, "tkip") == 0))
- {
- if (pAdapter->StaCfg.AuthMode < Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- pAdapter->StaCfg.WepStatus = Ndis802_11Encryption2Enabled;
- pAdapter->StaCfg.PairCipher = Ndis802_11Encryption2Enabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11Encryption2Enabled;
- }
- else if ((strcmp(arg, "AES") == 0) || (strcmp(arg, "aes") == 0))
- {
- if (pAdapter->StaCfg.AuthMode < Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- pAdapter->StaCfg.WepStatus = Ndis802_11Encryption3Enabled;
- pAdapter->StaCfg.PairCipher = Ndis802_11Encryption3Enabled;
- pAdapter->StaCfg.GroupCipher = Ndis802_11Encryption3Enabled;
- }
- else
- return FALSE;
-
- pAdapter->StaCfg.OrigWepStatus = pAdapter->StaCfg.WepStatus;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_EncrypType_Proc::(EncrypType=%d)\n", pAdapter->StaCfg.WepStatus));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Default Key ID
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_DefaultKeyID_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- ULONG KeyIdx;
-
- KeyIdx = simple_strtol(arg, 0, 10);
- if((KeyIdx >= 1 ) && (KeyIdx <= 4))
- pAdapter->StaCfg.DefaultKeyId = (UCHAR) (KeyIdx - 1 );
- else
- return FALSE; //Invalid argument
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_DefaultKeyID_Proc::(DefaultKeyID=%d)\n", pAdapter->StaCfg.DefaultKeyId));
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set WEP KEY1
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Key1_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- int KeyLen;
- int i;
- UCHAR CipherAlg=CIPHER_WEP64;
-
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- KeyLen = strlen(arg);
-
- switch (KeyLen)
- {
- case 5: //wep 40 Ascii type
- pAdapter->SharedKey[BSS0][0].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][0].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key1_Proc::(Key1=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 10: //wep 40 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][0].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][0].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key1_Proc::(Key1=%s and type=%s)\n", arg, "Hex"));
- break;
- case 13: //wep 104 Ascii type
- pAdapter->SharedKey[BSS0][0].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][0].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key1_Proc::(Key1=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 26: //wep 104 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][0].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][0].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key1_Proc::(Key1=%s and type=%s)\n", arg, "Hex"));
- break;
- default: //Invalid argument
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key1_Proc::Invalid argument (=%s)\n", arg));
- return FALSE;
- }
-
- pAdapter->SharedKey[BSS0][0].CipherAlg = CipherAlg;
-
- // Set keys (into ASIC)
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- ; // not support
- else // Old WEP stuff
- {
- AsicAddSharedKeyEntry(pAdapter,
- 0,
- 0,
- pAdapter->SharedKey[BSS0][0].CipherAlg,
- pAdapter->SharedKey[BSS0][0].Key,
- NULL,
- NULL);
- }
-
- return TRUE;
-}
-/*
- ==========================================================================
-
- Description:
- Set WEP KEY2
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Key2_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- int KeyLen;
- int i;
- UCHAR CipherAlg=CIPHER_WEP64;
-
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- KeyLen = strlen(arg);
-
- switch (KeyLen)
- {
- case 5: //wep 40 Ascii type
- pAdapter->SharedKey[BSS0][1].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][1].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key2_Proc::(Key2=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 10: //wep 40 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][1].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][1].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key2_Proc::(Key2=%s and type=%s)\n", arg, "Hex"));
- break;
- case 13: //wep 104 Ascii type
- pAdapter->SharedKey[BSS0][1].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][1].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key2_Proc::(Key2=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 26: //wep 104 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][1].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][1].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key2_Proc::(Key2=%s and type=%s)\n", arg, "Hex"));
- break;
- default: //Invalid argument
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key2_Proc::Invalid argument (=%s)\n", arg));
- return FALSE;
- }
- pAdapter->SharedKey[BSS0][1].CipherAlg = CipherAlg;
-
- // Set keys (into ASIC)
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- ; // not support
- else // Old WEP stuff
- {
- AsicAddSharedKeyEntry(pAdapter,
- 0,
- 1,
- pAdapter->SharedKey[BSS0][1].CipherAlg,
- pAdapter->SharedKey[BSS0][1].Key,
- NULL,
- NULL);
- }
-
- return TRUE;
-}
-/*
- ==========================================================================
- Description:
- Set WEP KEY3
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Key3_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- int KeyLen;
- int i;
- UCHAR CipherAlg=CIPHER_WEP64;
-
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- KeyLen = strlen(arg);
-
- switch (KeyLen)
- {
- case 5: //wep 40 Ascii type
- pAdapter->SharedKey[BSS0][2].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][2].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key3_Proc::(Key3=%s and type=Ascii)\n", arg));
- break;
- case 10: //wep 40 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][2].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][2].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key3_Proc::(Key3=%s and type=Hex)\n", arg));
- break;
- case 13: //wep 104 Ascii type
- pAdapter->SharedKey[BSS0][2].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][2].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key3_Proc::(Key3=%s and type=Ascii)\n", arg));
- break;
- case 26: //wep 104 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][2].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][2].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key3_Proc::(Key3=%s and type=Hex)\n", arg));
- break;
- default: //Invalid argument
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key3_Proc::Invalid argument (=%s)\n", arg));
- return FALSE;
- }
- pAdapter->SharedKey[BSS0][2].CipherAlg = CipherAlg;
-
- // Set keys (into ASIC)
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- ; // not support
- else // Old WEP stuff
- {
- AsicAddSharedKeyEntry(pAdapter,
- 0,
- 2,
- pAdapter->SharedKey[BSS0][2].CipherAlg,
- pAdapter->SharedKey[BSS0][2].Key,
- NULL,
- NULL);
- }
-
- return TRUE;
-}
-/*
- ==========================================================================
- Description:
- Set WEP KEY4
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Key4_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- int KeyLen;
- int i;
- UCHAR CipherAlg=CIPHER_WEP64;
-
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- return TRUE; // do nothing
-
- KeyLen = strlen(arg);
-
- switch (KeyLen)
- {
- case 5: //wep 40 Ascii type
- pAdapter->SharedKey[BSS0][3].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][3].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key4_Proc::(Key4=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 10: //wep 40 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][3].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][3].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP64;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key4_Proc::(Key4=%s and type=%s)\n", arg, "Hex"));
- break;
- case 13: //wep 104 Ascii type
- pAdapter->SharedKey[BSS0][3].KeyLen = KeyLen;
- memcpy(pAdapter->SharedKey[BSS0][3].Key, arg, KeyLen);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key4_Proc::(Key4=%s and type=%s)\n", arg, "Ascii"));
- break;
- case 26: //wep 104 Hex type
- for(i=0; i < KeyLen; i++)
- {
- if( !isxdigit(*(arg+i)) )
- return FALSE; //Not Hex value;
- }
- pAdapter->SharedKey[BSS0][3].KeyLen = KeyLen / 2 ;
- AtoH(arg, pAdapter->SharedKey[BSS0][3].Key, KeyLen / 2);
- CipherAlg = CIPHER_WEP128;
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key4_Proc::(Key4=%s and type=%s)\n", arg, "Hex"));
- break;
- default: //Invalid argument
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Key4_Proc::Invalid argument (=%s)\n", arg));
- return FALSE;
- }
- pAdapter->SharedKey[BSS0][3].CipherAlg = CipherAlg;
-
- // Set keys (into ASIC)
- if (pAdapter->StaCfg.AuthMode >= Ndis802_11AuthModeWPA)
- ; // not support
- else // Old WEP stuff
- {
- AsicAddSharedKeyEntry(pAdapter,
- 0,
- 3,
- pAdapter->SharedKey[BSS0][3].CipherAlg,
- pAdapter->SharedKey[BSS0][3].Key,
- NULL,
- NULL);
- }
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set WPA PSK key
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_WPAPSK_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- int status;
-
- if ((pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPAPSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPA2PSK) &&
- (pAd->StaCfg.AuthMode != Ndis802_11AuthModeWPANone)
- )
- return TRUE; // do nothing
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_WPAPSK_Proc::(WPAPSK=%s)\n", arg));
-
- status = RT_CfgSetWPAPSKKey(pAd, arg, pAd->MlmeAux.Ssid, pAd->MlmeAux.SsidLen, pAd->StaCfg.PMK);
- if (status == FALSE)
- {
- DBGPRINT(RT_DEBUG_TRACE, ("Set_WPAPSK_Proc(): Set key failed!\n"));
- return FALSE;
- }
- NdisZeroMemory(pAd->StaCfg.WpaPassPhrase, 64);
- NdisMoveMemory(pAd->StaCfg.WpaPassPhrase, arg, strlen(arg));
- pAd->StaCfg.WpaPassPhraseLen = (UINT)strlen(arg);
-
-
-
- if(pAd->StaCfg.BssType == BSS_ADHOC &&
- pAd->StaCfg.AuthMode == Ndis802_11AuthModeWPANone)
- {
- pAd->StaCfg.WpaState = SS_NOTUSE;
- }
- else
- {
- // Start STA supplicant state machine
- pAd->StaCfg.WpaState = SS_START;
- }
-
- return TRUE;
-}
-
-/*
- ==========================================================================
- Description:
- Set Power Saving mode
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_PSMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- if (pAdapter->StaCfg.BssType == BSS_INFRA)
- {
- if ((strcmp(arg, "Max_PSP") == 0) ||
- (strcmp(arg, "max_psp") == 0) ||
- (strcmp(arg, "MAX_PSP") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
- // to exclude certain situations.
- if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
- pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeMAX_PSP;
- pAdapter->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeMAX_PSP;
- OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
- pAdapter->StaCfg.DefaultListenCount = 5;
-
- }
- else if ((strcmp(arg, "Fast_PSP") == 0) ||
- (strcmp(arg, "fast_psp") == 0) ||
- (strcmp(arg, "FAST_PSP") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
- // to exclude certain situations.
- OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
- if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
- pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeFast_PSP;
- pAdapter->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeFast_PSP;
- pAdapter->StaCfg.DefaultListenCount = 3;
- }
- else if ((strcmp(arg, "Legacy_PSP") == 0) ||
- (strcmp(arg, "legacy_psp") == 0) ||
- (strcmp(arg, "LEGACY_PSP") == 0))
- {
- // do NOT turn on PSM bit here, wait until MlmeCheckPsmChange()
- // to exclude certain situations.
- OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
- if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
- pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeLegacy_PSP;
- pAdapter->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeLegacy_PSP;
- pAdapter->StaCfg.DefaultListenCount = 3;
- }
- else
- {
- //Default Ndis802_11PowerModeCAM
- // clear PSM bit immediately
- RTMP_SET_PSM_BIT(pAdapter, PWR_ACTIVE);
- OPSTATUS_SET_FLAG(pAdapter, fOP_STATUS_RECEIVE_DTIM);
- if (pAdapter->StaCfg.bWindowsACCAMEnable == FALSE)
- pAdapter->StaCfg.WindowsPowerMode = Ndis802_11PowerModeCAM;
- pAdapter->StaCfg.WindowsBatteryPowerMode = Ndis802_11PowerModeCAM;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_PSMode_Proc::(PSMode=%ld)\n", pAdapter->StaCfg.WindowsPowerMode));
- }
- else
- return FALSE;
-
-
- return TRUE;
-}
-//Add to suport the function which clould dynamicallly enable/disable PCIe Power Saving
-
-#ifdef WPA_SUPPLICANT_SUPPORT
-/*
- ==========================================================================
- Description:
- Set WpaSupport flag.
- Value:
- 0: Driver ignore wpa_supplicant.
- 1: wpa_supplicant initiates scanning and AP selection.
- 2: driver takes care of scanning, AP selection, and IEEE 802.11 association parameters.
- Return:
- TRUE if all parameters are OK, FALSE otherwise
- ==========================================================================
-*/
-INT Set_Wpa_Support(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
-
- if ( simple_strtol(arg, 0, 10) == 0)
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE;
- else if ( simple_strtol(arg, 0, 10) == 1)
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE;
- else if ( simple_strtol(arg, 0, 10) == 2)
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_ENABLE_WITH_WEB_UI;
- else
- pAd->StaCfg.WpaSupplicantUP = WPA_SUPPLICANT_DISABLE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Wpa_Support::(WpaSupplicantUP=%d)\n", pAd->StaCfg.WpaSupplicantUP));
-
- return TRUE;
-}
-#endif // WPA_SUPPLICANT_SUPPORT //
-
-#ifdef DBG
-/*
- ==========================================================================
- Description:
- Read / Write MAC
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 mac 0 ==> read MAC where Addr=0x0
- 2.) iwpriv ra0 mac 0=12 ==> write MAC where Addr=0x0, value=12
- ==========================================================================
-*/
-VOID RTMPIoctlMAC(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
-{
- PSTRING this_char;
- PSTRING value;
- INT j = 0, k = 0;
- STRING msg[1024];
- STRING arg[255];
- ULONG macAddr = 0;
- UCHAR temp[16];
- STRING temp2[16];
- UINT32 macValue = 0;
- INT Status;
- BOOLEAN bIsPrintAllMAC = FALSE;
-
-
- memset(msg, 0x00, 1024);
- if (wrq->u.data.length > 1) //No parameters.
- {
- Status = copy_from_user(arg, wrq->u.data.pointer, (wrq->u.data.length > 255) ? 255 : wrq->u.data.length);
- sprintf(msg, "\n");
-
- //Parsing Read or Write
- this_char = arg;
- if (!*this_char)
- goto next;
-
- if ((value = rtstrchr(this_char, '=')) != NULL)
- *value++ = 0;
-
- if (!value || !*value)
- { //Read
- // Sanity check
- if(strlen(this_char) > 4)
- goto next;
-
- j = strlen(this_char);
- while(j-- > 0)
- {
- if(this_char[j] > 'f' || this_char[j] < '0')
- return;
- }
-
- // Mac Addr
- k = j = strlen(this_char);
- while(j-- > 0)
- {
- this_char[4-k+j] = this_char[j];
- }
-
- while(k < 4)
- this_char[3-k++]='0';
- this_char[4]='\0';
-
- if(strlen(this_char) == 4)
- {
- AtoH(this_char, temp, 2);
- macAddr = *temp*256 + temp[1];
- if (macAddr < 0xFFFF)
- {
- RTMP_IO_READ32(pAdapter, macAddr, &macValue);
- DBGPRINT(RT_DEBUG_TRACE, ("MacAddr=%lx, MacValue=%x\n", macAddr, macValue));
- sprintf(msg+strlen(msg), "[0x%08lX]:%08X ", macAddr , macValue);
- }
- else
- {//Invalid parametes, so default printk all mac
- bIsPrintAllMAC = TRUE;
- goto next;
- }
- }
- }
- else
- { //Write
- memcpy(&temp2, value, strlen(value));
- temp2[strlen(value)] = '\0';
-
- // Sanity check
- if((strlen(this_char) > 4) || strlen(temp2) > 8)
- goto next;
-
- j = strlen(this_char);
- while(j-- > 0)
- {
- if(this_char[j] > 'f' || this_char[j] < '0')
- return;
- }
-
- j = strlen(temp2);
- while(j-- > 0)
- {
- if(temp2[j] > 'f' || temp2[j] < '0')
- return;
- }
-
- //MAC Addr
- k = j = strlen(this_char);
- while(j-- > 0)
- {
- this_char[4-k+j] = this_char[j];
- }
-
- while(k < 4)
- this_char[3-k++]='0';
- this_char[4]='\0';
-
- //MAC value
- k = j = strlen(temp2);
- while(j-- > 0)
- {
- temp2[8-k+j] = temp2[j];
- }
-
- while(k < 8)
- temp2[7-k++]='0';
- temp2[8]='\0';
-
- {
- AtoH(this_char, temp, 2);
- macAddr = *temp*256 + temp[1];
-
- AtoH(temp2, temp, 4);
- macValue = *temp*256*256*256 + temp[1]*256*256 + temp[2]*256 + temp[3];
-
- // debug mode
- if (macAddr == (HW_DEBUG_SETTING_BASE + 4))
- {
- // 0x2bf4: byte0 non-zero: enable R17 tuning, 0: disable R17 tuning
- if (macValue & 0x000000ff)
- {
- pAdapter->BbpTuning.bEnable = TRUE;
- DBGPRINT(RT_DEBUG_TRACE,("turn on R17 tuning\n"));
- }
- else
- {
- UCHAR R66;
- pAdapter->BbpTuning.bEnable = FALSE;
- R66 = 0x26 + GET_LNA_GAIN(pAdapter);
-#ifdef RALINK_ATE
- if (ATE_ON(pAdapter))
- {
- ATE_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R66, (0x26 + GET_LNA_GAIN(pAdapter)));
- }
- else
-#endif // RALINK_ATE //
-
- RTMP_BBP_IO_WRITE8_BY_REG_ID(pAdapter, BBP_R66, (0x26 + GET_LNA_GAIN(pAdapter)));
- DBGPRINT(RT_DEBUG_TRACE,("turn off R17 tuning, restore to 0x%02x\n", R66));
- }
- return;
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("MacAddr=%02lx, MacValue=0x%x\n", macAddr, macValue));
-
- RTMP_IO_WRITE32(pAdapter, macAddr, macValue);
- sprintf(msg+strlen(msg), "[0x%08lX]:%08X ", macAddr, macValue);
- }
- }
- }
- else
- bIsPrintAllMAC = TRUE;
-next:
- if (bIsPrintAllMAC)
- {
- struct file *file_w;
- PSTRING fileName = "MacDump.txt";
- mm_segment_t orig_fs;
-
- orig_fs = get_fs();
- set_fs(KERNEL_DS);
-
- // open file
- file_w = filp_open(fileName, O_WRONLY|O_CREAT, 0);
- if (IS_ERR(file_w))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("-->2) %s: Error %ld opening %s\n", __FUNCTION__, -PTR_ERR(file_w), fileName));
- }
- else
- {
- if (file_w->f_op && file_w->f_op->write)
- {
- file_w->f_pos = 0;
- macAddr = 0x1000;
-
- while (macAddr <= 0x1800)
- {
- RTMP_IO_READ32(pAdapter, macAddr, &macValue);
- sprintf(msg, "%08lx = %08X\n", macAddr, macValue);
-
- // write data to file
- file_w->f_op->write(file_w, msg, strlen(msg), &file_w->f_pos);
-
- printk("%s", msg);
- macAddr += 4;
- }
- sprintf(msg, "\nDump all MAC values to %s\n", fileName);
- }
- filp_close(file_w, NULL);
- }
- set_fs(orig_fs);
- }
- if(strlen(msg) == 1)
- sprintf(msg+strlen(msg), "===>Error command format!");
-
- // Copy the information into the user buffer
- wrq->u.data.length = strlen(msg);
- Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==RTMPIoctlMAC\n\n"));
-}
-
-/*
- ==========================================================================
- Description:
- Read / Write E2PROM
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 e2p 0 ==> read E2PROM where Addr=0x0
- 2.) iwpriv ra0 e2p 0=1234 ==> write E2PROM where Addr=0x0, value=1234
- ==========================================================================
-*/
-VOID RTMPIoctlE2PROM(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
-{
- PSTRING this_char;
- PSTRING value;
- INT j = 0, k = 0;
- STRING msg[1024];
- STRING arg[255];
- USHORT eepAddr = 0;
- UCHAR temp[16];
- STRING temp2[16];
- USHORT eepValue;
- int Status;
- BOOLEAN bIsPrintAllE2P = FALSE;
-
-
- memset(msg, 0x00, 1024);
- if (wrq->u.data.length > 1) //No parameters.
- {
- Status = copy_from_user(arg, wrq->u.data.pointer, (wrq->u.data.length > 255) ? 255 : wrq->u.data.length);
- sprintf(msg, "\n");
-
- //Parsing Read or Write
- this_char = arg;
-
-
- if (!*this_char)
- goto next;
-
- if ((value = rtstrchr(this_char, '=')) != NULL)
- *value++ = 0;
-
- if (!value || !*value)
- { //Read
-
- // Sanity check
- if(strlen(this_char) > 4)
- goto next;
-
- j = strlen(this_char);
- while(j-- > 0)
- {
- if(this_char[j] > 'f' || this_char[j] < '0')
- return;
- }
-
- // E2PROM addr
- k = j = strlen(this_char);
- while(j-- > 0)
- {
- this_char[4-k+j] = this_char[j];
- }
-
- while(k < 4)
- this_char[3-k++]='0';
- this_char[4]='\0';
-
- if(strlen(this_char) == 4)
- {
- AtoH(this_char, temp, 2);
- eepAddr = *temp*256 + temp[1];
- if (eepAddr < 0xFFFF)
- {
- RT28xx_EEPROM_READ16(pAdapter, eepAddr, eepValue);
- sprintf(msg+strlen(msg), "[0x%04X]:0x%04X ", eepAddr , eepValue);
- }
- else
- {//Invalid parametes, so default printk all bbp
- bIsPrintAllE2P = TRUE;
- goto next;
- }
- }
- }
- else
- { //Write
- memcpy(&temp2, value, strlen(value));
- temp2[strlen(value)] = '\0';
-
- // Sanity check
- if((strlen(this_char) > 4) || strlen(temp2) > 8)
- goto next;
-
- j = strlen(this_char);
- while(j-- > 0)
- {
- if(this_char[j] > 'f' || this_char[j] < '0')
- return;
- }
- j = strlen(temp2);
- while(j-- > 0)
- {
- if(temp2[j] > 'f' || temp2[j] < '0')
- return;
- }
-
- //MAC Addr
- k = j = strlen(this_char);
- while(j-- > 0)
- {
- this_char[4-k+j] = this_char[j];
- }
-
- while(k < 4)
- this_char[3-k++]='0';
- this_char[4]='\0';
-
- //MAC value
- k = j = strlen(temp2);
- while(j-- > 0)
- {
- temp2[4-k+j] = temp2[j];
- }
-
- while(k < 4)
- temp2[3-k++]='0';
- temp2[4]='\0';
-
- AtoH(this_char, temp, 2);
- eepAddr = *temp*256 + temp[1];
-
- AtoH(temp2, temp, 2);
- eepValue = *temp*256 + temp[1];
-
- RT28xx_EEPROM_WRITE16(pAdapter, eepAddr, eepValue);
- sprintf(msg+strlen(msg), "[0x%02X]:%02X ", eepAddr, eepValue);
- }
- }
- else
- bIsPrintAllE2P = TRUE;
-next:
- if (bIsPrintAllE2P)
- {
- struct file *file_w;
- PSTRING fileName = "EEPROMDump.txt";
- mm_segment_t orig_fs;
-
- orig_fs = get_fs();
- set_fs(KERNEL_DS);
-
- // open file
- file_w = filp_open(fileName, O_WRONLY|O_CREAT, 0);
- if (IS_ERR(file_w))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("-->2) %s: Error %ld opening %s\n", __FUNCTION__, -PTR_ERR(file_w), fileName));
- }
- else
- {
- if (file_w->f_op && file_w->f_op->write)
- {
- file_w->f_pos = 0;
- eepAddr = 0x00;
-
- while (eepAddr <= 0xFE)
- {
- RT28xx_EEPROM_READ16(pAdapter, eepAddr, eepValue);
- sprintf(msg, "%08x = %04x\n", eepAddr , eepValue);
-
- // write data to file
- file_w->f_op->write(file_w, msg, strlen(msg), &file_w->f_pos);
-
- printk("%s", msg);
- eepAddr += 2;
- }
- sprintf(msg, "\nDump all EEPROM values to %s\n", fileName);
- }
- filp_close(file_w, NULL);
- }
- set_fs(orig_fs);
- }
- if(strlen(msg) == 1)
- sprintf(msg+strlen(msg), "===>Error command format!");
-
-
- // Copy the information into the user buffer
- wrq->u.data.length = strlen(msg);
- Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length);
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==RTMPIoctlE2PROM\n"));
-}
-
-
-#ifdef RT30xx
-/*
- ==========================================================================
- Description:
- Read / Write RF register
-Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 rf ==> read all RF registers
- 2.) iwpriv ra0 rf 1 ==> read RF where RegID=1
- 3.) iwpriv ra0 rf 1=10 ==> write RF R1=0x10
- ==========================================================================
-*/
-VOID RTMPIoctlRF(
- IN PRTMP_ADAPTER pAdapter,
- IN struct iwreq *wrq)
-{
- CHAR *this_char;
- CHAR *value;
- UCHAR regRF = 0;
- STRING msg[2048];
- CHAR arg[255];
- INT rfId;
- LONG rfValue;
- int Status;
- BOOLEAN bIsPrintAllRF = FALSE;
-
-
- memset(msg, 0x00, 2048);
- if (wrq->u.data.length > 1) //No parameters.
- {
- Status = copy_from_user(arg, wrq->u.data.pointer, (wrq->u.data.length > 255) ? 255 : wrq->u.data.length);
- sprintf(msg, "\n");
-
- //Parsing Read or Write
- this_char = arg;
- if (!*this_char)
- goto next;
-
- if ((value = strchr(this_char, '=')) != NULL)
- *value++ = 0;
-
- if (!value || !*value)
- { //Read
- if (sscanf((PSTRING) this_char, "%d", &(rfId)) == 1)
- {
- if (rfId <= 31)
- {
-#ifdef RALINK_ATE
- /*
- In RT2860 ATE mode, we do not load 8051 firmware.
- We must access RF directly.
- For RT2870 ATE mode, ATE_RF_IO_WRITE8(/READ8)_BY_REG_ID are redefined.
- */
- if (ATE_ON(pAdapter))
- {
- ATE_RF_IO_READ8_BY_REG_ID(pAdapter, rfId, &regRF);
- }
- else
-#endif // RALINK_ATE //
- // according to Andy, Gary, David require.
- // the command rf shall read rf register directly for dubug.
- // BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- RT30xxReadRFRegister(pAdapter, rfId, &regRF);
-
- sprintf(msg+strlen(msg), "R%02d[0x%02x]:%02X ", rfId, rfId, regRF);
- }
- else
- {//Invalid parametes, so default printk all RF
- bIsPrintAllRF = TRUE;
- goto next;
- }
- }
- else
- { //Invalid parametes, so default printk all RF
- bIsPrintAllRF = TRUE;
- goto next;
- }
- }
- else
- { //Write
- if ((sscanf((PSTRING) this_char, "%d", &(rfId)) == 1) && (sscanf((PSTRING) value, "%lx", &(rfValue)) == 1))
- {
- if (rfId <= 31)
- {
-#ifdef RALINK_ATE
- /*
- In RT2860 ATE mode, we do not load 8051 firmware.
- We must access RF directly.
- For RT2870 ATE mode, ATE_RF_IO_WRITE8(/READ8)_BY_REG_ID are redefined.
- */
- if (ATE_ON(pAdapter))
- {
- ATE_RF_IO_READ8_BY_REG_ID(pAdapter, rfId, &regRF);
- ATE_RF_IO_WRITE8_BY_REG_ID(pAdapter, (UCHAR)rfId,(UCHAR) rfValue);
- //Read it back for showing
- ATE_RF_IO_READ8_BY_REG_ID(pAdapter, rfId, &regRF);
- sprintf(msg+strlen(msg), "R%02d[0x%02X]:%02X\n", rfId, rfId, regRF);
- }
- else
-#endif // RALINK_ATE //
- {
- // according to Andy, Gary, David require.
- // the command RF shall read/write RF register directly for dubug.
- //BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- //BBP_IO_WRITE8_BY_REG_ID(pAdapter, (UCHAR)bbpId,(UCHAR) bbpValue);
- RT30xxReadRFRegister(pAdapter, rfId, &regRF);
- RT30xxWriteRFRegister(pAdapter, (UCHAR)rfId,(UCHAR) rfValue);
- //Read it back for showing
- //BBP_IO_READ8_BY_REG_ID(pAdapter, bbpId, &regBBP);
- RT30xxReadRFRegister(pAdapter, rfId, &regRF);
- sprintf(msg+strlen(msg), "R%02d[0x%02X]:%02X\n", rfId, rfId, regRF);
- }
- }
- else
- {//Invalid parametes, so default printk all RF
- bIsPrintAllRF = TRUE;
- }
- }
- else
- { //Invalid parametes, so default printk all RF
- bIsPrintAllRF = TRUE;
- }
- }
- }
- else
- bIsPrintAllRF = TRUE;
-next:
- if (bIsPrintAllRF)
- {
- memset(msg, 0x00, 2048);
- sprintf(msg, "\n");
- for (rfId = 0; rfId <= 31; rfId++)
- {
-#ifdef RALINK_ATE
- /*
- In RT2860 ATE mode, we do not load 8051 firmware.
- We must access RF directly.
- For RT2870 ATE mode, ATE_RF_IO_WRITE8(/READ8)_BY_REG_ID are redefined.
- */
- if (ATE_ON(pAdapter))
- {
- ATE_RF_IO_READ8_BY_REG_ID(pAdapter, rfId, &regRF);
- }
- else
-#endif // RALINK_ATE //
-
- // according to Andy, Gary, David require.
- // the command RF shall read/write RF register directly for dubug.
- RT30xxReadRFRegister(pAdapter, rfId, &regRF);
- sprintf(msg+strlen(msg), "%03d = %02X\n", rfId, regRF);
- }
- // Copy the information into the user buffer
- DBGPRINT(RT_DEBUG_TRACE, ("strlen(msg)=%d\n", (UINT32)strlen(msg)));
- wrq->u.data.length = strlen(msg);
- if (copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("%s: copy_to_user() fail\n", __FUNCTION__));
- }
- }
- else
- {
- if(strlen(msg) == 1)
- sprintf(msg+strlen(msg), "===>Error command format!");
-
- DBGPRINT(RT_DEBUG_TRACE, ("copy to user [msg=%s]\n", msg));
- // Copy the information into the user buffer
- DBGPRINT(RT_DEBUG_TRACE, ("strlen(msg) =%d\n", (UINT32)strlen(msg)));
-
- // Copy the information into the user buffer
- wrq->u.data.length = strlen(msg);
- Status = copy_to_user(wrq->u.data.pointer, msg, wrq->u.data.length);
- }
-
- DBGPRINT(RT_DEBUG_TRACE, ("<==RTMPIoctlRF\n\n"));
-}
-#endif // RT30xx //
-#endif // DBG //
-
-
-
-
-INT Set_TGnWifiTest_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- if (simple_strtol(arg, 0, 10) == 0)
- pAd->StaCfg.bTGnWifiTest = FALSE;
- else
- pAd->StaCfg.bTGnWifiTest = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_TGnWifiTest_Proc::(bTGnWifiTest=%d)\n", pAd->StaCfg.bTGnWifiTest));
- return TRUE;
-}
-
-#ifdef EXT_BUILD_CHANNEL_LIST
-INT Set_Ieee80211dClientMode_Proc(
- IN PRTMP_ADAPTER pAdapter,
- IN PSTRING arg)
-{
- if (simple_strtol(arg, 0, 10) == 0)
- pAdapter->StaCfg.IEEE80211dClientMode = Rt802_11_D_None;
- else if (simple_strtol(arg, 0, 10) == 1)
- pAdapter->StaCfg.IEEE80211dClientMode = Rt802_11_D_Flexible;
- else if (simple_strtol(arg, 0, 10) == 2)
- pAdapter->StaCfg.IEEE80211dClientMode = Rt802_11_D_Strict;
- else
- return FALSE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_Ieee802dMode_Proc::(IEEEE0211dMode=%d)\n", pAdapter->StaCfg.IEEE80211dClientMode));
- return TRUE;
-}
-#endif // EXT_BUILD_CHANNEL_LIST //
-
-#ifdef CARRIER_DETECTION_SUPPORT
-INT Set_CarrierDetect_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- if (simple_strtol(arg, 0, 10) == 0)
- pAd->CommonCfg.CarrierDetect.Enable = FALSE;
- else
- pAd->CommonCfg.CarrierDetect.Enable = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_CarrierDetect_Proc::(CarrierDetect.Enable=%d)\n", pAd->CommonCfg.CarrierDetect.Enable));
- return TRUE;
-}
-#endif // CARRIER_DETECTION_SUPPORT //
-
-
-INT Show_Adhoc_MacTable_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING extra)
-{
- INT i;
-
- sprintf(extra, "\n");
-
-#ifdef DOT11_N_SUPPORT
- sprintf(extra, "%sHT Operating Mode : %d\n", extra, pAd->CommonCfg.AddHTInfo.AddHtInfo2.OperaionMode);
-#endif // DOT11_N_SUPPORT //
-
- sprintf(extra, "%s\n%-19s%-4s%-4s%-7s%-7s%-7s%-10s%-6s%-6s%-6s%-6s\n", extra,
- "MAC", "AID", "BSS", "RSSI0", "RSSI1", "RSSI2", "PhMd", "BW", "MCS", "SGI", "STBC");
-
- for (i=1; i<MAX_LEN_OF_MAC_TABLE; i++)
- {
- PMAC_TABLE_ENTRY pEntry = &pAd->MacTab.Content[i];
-
- if (strlen(extra) > (IW_PRIV_SIZE_MASK - 30))
- break;
- if ((pEntry->ValidAsCLI || pEntry->ValidAsApCli) && (pEntry->Sst == SST_ASSOC))
- {
- sprintf(extra, "%s%02X:%02X:%02X:%02X:%02X:%02X ", extra,
- pEntry->Addr[0], pEntry->Addr[1], pEntry->Addr[2],
- pEntry->Addr[3], pEntry->Addr[4], pEntry->Addr[5]);
- sprintf(extra, "%s%-4d", extra, (int)pEntry->Aid);
- sprintf(extra, "%s%-4d", extra, (int)pEntry->apidx);
- sprintf(extra, "%s%-7d", extra, pEntry->RssiSample.AvgRssi0);
- sprintf(extra, "%s%-7d", extra, pEntry->RssiSample.AvgRssi1);
- sprintf(extra, "%s%-7d", extra, pEntry->RssiSample.AvgRssi2);
- sprintf(extra, "%s%-10s", extra, GetPhyMode(pEntry->HTPhyMode.field.MODE));
- sprintf(extra, "%s%-6s", extra, GetBW(pEntry->HTPhyMode.field.BW));
- sprintf(extra, "%s%-6d", extra, pEntry->HTPhyMode.field.MCS);
- sprintf(extra, "%s%-6d", extra, pEntry->HTPhyMode.field.ShortGI);
- sprintf(extra, "%s%-6d", extra, pEntry->HTPhyMode.field.STBC);
- sprintf(extra, "%s%-10d, %d, %d%%\n", extra, pEntry->DebugFIFOCount, pEntry->DebugTxCount,
- (pEntry->DebugTxCount) ? ((pEntry->DebugTxCount-pEntry->DebugFIFOCount)*100/pEntry->DebugTxCount) : 0);
- sprintf(extra, "%s\n", extra);
- }
- }
-
- return TRUE;
-}
-
-
-INT Set_BeaconLostTime_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- ULONG ltmp = (ULONG)simple_strtol(arg, 0, 10);
-
- if ((ltmp != 0) && (ltmp <= 60))
- pAd->StaCfg.BeaconLostTime = (ltmp * OS_HZ);
-
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_BeaconLostTime_Proc::(BeaconLostTime=%ld)\n", pAd->StaCfg.BeaconLostTime));
- return TRUE;
-}
-
-INT Set_AutoRoaming_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- if (simple_strtol(arg, 0, 10) == 0)
- pAd->StaCfg.bAutoRoaming = FALSE;
- else
- pAd->StaCfg.bAutoRoaming = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_AutoRoaming_Proc::(bAutoRoaming=%d)\n", pAd->StaCfg.bAutoRoaming));
- return TRUE;
-}
-
-
-/*
- ==========================================================================
- Description:
- Issue a site survey command to driver
- Arguments:
- pAdapter Pointer to our adapter
- wrq Pointer to the ioctl argument
-
- Return Value:
- None
-
- Note:
- Usage:
- 1.) iwpriv ra0 set site_survey
- ==========================================================================
-*/
-INT Set_SiteSurvey_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- NDIS_802_11_SSID Ssid;
-
- //check if the interface is down
- if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("INFO::Network is down!\n"));
- return -ENETDOWN;
- }
-
- if (MONITOR_ON(pAd))
- {
- DBGPRINT(RT_DEBUG_TRACE, ("!!! Driver is in Monitor Mode now !!!\n"));
- return -EINVAL;
- }
-
- RTMPZeroMemory(&Ssid, sizeof(NDIS_802_11_SSID));
- Ssid.SsidLength = 0;
- if ((arg != NULL) &&
- (strlen(arg) <= MAX_LEN_OF_SSID))
- {
- RTMPMoveMemory(Ssid.Ssid, arg, strlen(arg));
- Ssid.SsidLength = strlen(arg);
- }
-
- pAd->StaCfg.bScanReqIsFromWebUI = TRUE;
-
- if (pAd->Mlme.CntlMachine.CurrState != CNTL_IDLE)
- {
- RTMP_MLME_RESET_STATE_MACHINE(pAd);
- DBGPRINT(RT_DEBUG_TRACE, ("!!! MLME busy, reset MLME state machine !!!\n"));
- }
-
- // tell CNTL state machine to call NdisMSetInformationComplete() after completing
- // this request, because this request is initiated by NDIS.
- pAd->MlmeAux.CurrReqIsFromNdis = FALSE;
- // Reset allowed scan retries
- pAd->StaCfg.ScanCnt = 0;
- NdisGetSystemUpTime(&pAd->StaCfg.LastScanTime);
-
- MlmeEnqueue(pAd,
- MLME_CNTL_STATE_MACHINE,
- OID_802_11_BSSID_LIST_SCAN,
- Ssid.SsidLength,
- Ssid.Ssid);
-
- RTMP_MLME_HANDLER(pAd);
-
- DBGPRINT(RT_DEBUG_TRACE, ("Set_SiteSurvey_Proc\n"));
-
- return TRUE;
-}
-
-INT Set_ForceTxBurst_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PSTRING arg)
-{
- if (simple_strtol(arg, 0, 10) == 0)
- pAd->StaCfg.bForceTxBurst = FALSE;
- else
- pAd->StaCfg.bForceTxBurst = TRUE;
-
- DBGPRINT(RT_DEBUG_TRACE, ("IF Set_ForceTxBurst_Proc::(bForceTxBurst=%d)\n", pAd->StaCfg.bForceTxBurst));
- return TRUE;
-}
-
-#ifdef ANT_DIVERSITY_SUPPORT
-INT Set_Antenna_Proc(
- IN PRTMP_ADAPTER pAd,
- IN PUCHAR arg)
-{
- UCHAR UsedAnt;
- DBGPRINT(RT_DEBUG_TRACE, ("==> Set_Antenna_Proc *******************\n"));
-
- if(simple_strtol(arg, 0, 10) <= 3)
- UsedAnt = simple_strtol(arg, 0, 10);
-
- pAd->CommonCfg.bRxAntDiversity = UsedAnt; // Auto switch
- if (UsedAnt == ANT_DIVERSITY_ENABLE)
- {
- pAd->RxAnt.EvaluateStableCnt = 0;
- DBGPRINT(RT_DEBUG_TRACE, ("<== Set_Antenna_Proc(Auto Switch Mode), (%d,%d)\n", pAd->RxAnt.Pair1PrimaryRxAnt, pAd->RxAnt.Pair1SecondaryRxAnt));
- }
- /* 2: Fix in the PHY Antenna CON1*/
- if (UsedAnt == ANT_FIX_ANT1)
- {
- AsicSetRxAnt(pAd, 0);
- DBGPRINT(RT_DEBUG_TRACE, ("<== Set_Antenna_Proc(Fix in Ant CON1), (%d,%d)\n", pAd->RxAnt.Pair1PrimaryRxAnt, pAd->RxAnt.Pair1SecondaryRxAnt));
- }
- /* 3: Fix in the PHY Antenna CON2*/
- if (UsedAnt == ANT_FIX_ANT2)
- {
- AsicSetRxAnt(pAd, 1);
- DBGPRINT(RT_DEBUG_TRACE, ("<== Set_Antenna_Proc(Fix in Ant CON2), (%d,%d)\n", pAd->RxAnt.Pair1PrimaryRxAnt, pAd->RxAnt.Pair1SecondaryRxAnt));
- }
-
- return TRUE;
-}
-#endif // ANT_DIVERSITY_SUPPORT // \ No newline at end of file
diff --git a/drivers/staging/rt3090/vr_ikans.h b/drivers/staging/rt3090/vr_ikans.h
deleted file mode 100644
index 16bff3bec43b..000000000000
--- a/drivers/staging/rt3090/vr_ikans.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- vr_ikans.h
-
- Abstract:
- Handle association related requests either from WSTA or from local MLME
-
- Revision History:
- Who When What
- --------- ---------- ----------------------------------------------
- Sample Lin 01-28-2008 Created
- */
-
-#ifndef __VR_IKANS_H__
-#define __VR_IKANS_H__
-
-#ifndef MODULE_IKANOS
-#define IKANOS_EXTERN extern
-#else
-#define IKANOS_EXTERN
-#endif // MODULE_IKANOS //
-
-#ifdef IKANOS_VX_1X0
- typedef void (*IkanosWlanTxCbFuncP)(void *, void *);
-
- struct IKANOS_TX_INFO
- {
- struct net_device *netdev;
- IkanosWlanTxCbFuncP *fp;
- };
-#endif // IKANOS_VX_1X0 //
-
-
-IKANOS_EXTERN void VR_IKANOS_FP_Init(UINT8 BssNum, UINT8 *pApMac);
-
-IKANOS_EXTERN INT32 IKANOS_DataFramesTx(struct sk_buff *pSkb,
- struct net_device *pNetDev);
-
-IKANOS_EXTERN void IKANOS_DataFrameRx(PRTMP_ADAPTER pAd,
- void *pRxParam,
- struct sk_buff *pSkb,
- UINT32 Length);
-
-#endif // __VR_IKANS_H__ //
-
-/* End of vr_ikans.h */
diff --git a/drivers/staging/rt3090/wpa.h b/drivers/staging/rt3090/wpa.h
deleted file mode 100644
index 8baa28774e30..000000000000
--- a/drivers/staging/rt3090/wpa.h
+++ /dev/null
@@ -1,447 +0,0 @@
-/*
- *************************************************************************
- * Ralink Tech Inc.
- * 5F., No.36, Taiyuan St., Jhubei City,
- * Hsinchu County 302,
- * Taiwan, R.O.C.
- *
- * (c) Copyright 2002-2007, Ralink Technology, Inc.
- *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
- * *
- *************************************************************************
-
- Module Name:
- wpa.h
-
- Abstract:
-
- Revision History:
- Who When What
- -------- ---------- ----------------------------------------------
- Name Date Modification logs
-*/
-
-#ifndef __WPA_H__
-#define __WPA_H__
-
-// EAPOL Key descripter frame format related length
-#define LEN_KEY_DESC_NONCE 32
-#define LEN_KEY_DESC_IV 16
-#define LEN_KEY_DESC_RSC 8
-#define LEN_KEY_DESC_ID 8
-#define LEN_KEY_DESC_REPLAY 8
-#define LEN_KEY_DESC_MIC 16
-
-// The length is the EAPoL-Key frame except key data field.
-// Please refer to 802.11i-2004 ,Figure 43u in p.78
-#define LEN_EAPOL_KEY_MSG (sizeof(KEY_DESCRIPTER) - MAX_LEN_OF_RSNIE)
-
-// EAP Code Type.
-#define EAP_CODE_REQUEST 1
-#define EAP_CODE_RESPONSE 2
-#define EAP_CODE_SUCCESS 3
-#define EAP_CODE_FAILURE 4
-
-// EAPOL frame Protocol Version
-#define EAPOL_VER 1
-#define EAPOL_VER2 2
-
-// EAPOL-KEY Descriptor Type
-#define WPA1_KEY_DESC 0xfe
-#define WPA2_KEY_DESC 0x02
-
-// Key Descriptor Version of Key Information
-#define DESC_TYPE_TKIP 1
-#define DESC_TYPE_AES 2
-
-#define LEN_MSG1_2WAY 0x7f
-#define MAX_LEN_OF_EAP_HS 256
-
-#define LEN_MASTER_KEY 32
-
-// EAPOL EK, MK
-#define LEN_EAP_EK 16
-#define LEN_EAP_MICK 16
-#define LEN_EAP_KEY ((LEN_EAP_EK)+(LEN_EAP_MICK))
-// TKIP key related
-#define LEN_PMKID 16
-#define LEN_TKIP_EK 16
-#define LEN_TKIP_RXMICK 8
-#define LEN_TKIP_TXMICK 8
-#define LEN_AES_EK 16
-#define LEN_AES_KEY LEN_AES_EK
-#define LEN_TKIP_KEY ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK))
-#define TKIP_AP_TXMICK_OFFSET ((LEN_EAP_KEY)+(LEN_TKIP_EK))
-#define TKIP_AP_RXMICK_OFFSET (TKIP_AP_TXMICK_OFFSET+LEN_TKIP_TXMICK)
-#define TKIP_GTK_LENGTH ((LEN_TKIP_EK)+(LEN_TKIP_RXMICK)+(LEN_TKIP_TXMICK))
-#define LEN_PTK ((LEN_EAP_KEY)+(LEN_TKIP_KEY))
-#define MIN_LEN_OF_GTK 5
-#define LEN_PMK 32
-#define LEN_PMK_NAME 16
-#define LEN_NONCE 32
-
-// RSN IE Length definition
-#define MAX_LEN_OF_RSNIE 255
-#define MIN_LEN_OF_RSNIE 8
-
-#define KEY_LIFETIME 3600
-
-//EAP Packet Type
-#define EAPPacket 0
-#define EAPOLStart 1
-#define EAPOLLogoff 2
-#define EAPOLKey 3
-#define EAPOLASFAlert 4
-#define EAPTtypeMax 5
-
-#define EAPOL_MSG_INVALID 0
-#define EAPOL_PAIR_MSG_1 1
-#define EAPOL_PAIR_MSG_2 2
-#define EAPOL_PAIR_MSG_3 3
-#define EAPOL_PAIR_MSG_4 4
-#define EAPOL_GROUP_MSG_1 5
-#define EAPOL_GROUP_MSG_2 6
-
-#define PAIRWISEKEY 1
-#define GROUPKEY 0
-
-// Retry timer counter initial value
-#define PEER_MSG1_RETRY_TIMER_CTR 0
-#define PEER_MSG3_RETRY_TIMER_CTR 10
-#define GROUP_MSG1_RETRY_TIMER_CTR 20
-
-// WPA mechanism retry timer interval
-#define PEER_MSG1_RETRY_EXEC_INTV 1000 // 1 sec
-#define PEER_MSG3_RETRY_EXEC_INTV 3000 // 3 sec
-#define GROUP_KEY_UPDATE_EXEC_INTV 1000 // 1 sec
-#define PEER_GROUP_KEY_UPDATE_INIV 2000 // 2 sec
-
-#define ENQUEUE_EAPOL_START_TIMER 200 // 200 ms
-
-// group rekey interval
-#define TIME_REKEY 0
-#define PKT_REKEY 1
-#define DISABLE_REKEY 2
-#define MAX_REKEY 2
-
-#define MAX_REKEY_INTER 0x3ffffff
-
-#define GROUP_SUITE 0
-#define PAIRWISE_SUITE 1
-#define AKM_SUITE 2
-#define PMKID_LIST 3
-
-
-#define EAPOL_START_DISABLE 0
-#define EAPOL_START_PSK 1
-#define EAPOL_START_1X 2
-
-#define MIX_CIPHER_WPA_TKIP_ON(x) (((x) & 0x08) != 0)
-#define MIX_CIPHER_WPA_AES_ON(x) (((x) & 0x04) != 0)
-#define MIX_CIPHER_WPA2_TKIP_ON(x) (((x) & 0x02) != 0)
-#define MIX_CIPHER_WPA2_AES_ON(x) (((x) & 0x01) != 0)
-
-#ifndef ROUND_UP
-#define ROUND_UP(__x, __y) \
- (((ULONG)((__x)+((__y)-1))) & ((ULONG)~((__y)-1)))
-#endif
-
-#define SET_UINT16_TO_ARRARY(_V, _LEN) \
-{ \
- _V[0] = (_LEN & 0xFF00) >> 8; \
- _V[1] = (_LEN & 0xFF); \
-}
-
-#define INC_UINT16_TO_ARRARY(_V, _LEN) \
-{ \
- UINT16 var_len; \
- \
- var_len = (_V[0]<<8) | (_V[1]); \
- var_len += _LEN; \
- \
- _V[0] = (var_len & 0xFF00) >> 8; \
- _V[1] = (var_len & 0xFF); \
-}
-
-#define CONV_ARRARY_TO_UINT16(_V) ((_V[0]<<8) | (_V[1]))
-
-
-#define ADD_ONE_To_64BIT_VAR(_V) \
-{ \
- UCHAR cnt = LEN_KEY_DESC_REPLAY; \
- do \
- { \
- cnt--; \
- _V[cnt]++; \
- if (cnt == 0) \
- break; \
- }while (_V[cnt] == 0); \
-}
-
-#define IS_WPA_CAPABILITY(a) (((a) >= Ndis802_11AuthModeWPA) && ((a) <= Ndis802_11AuthModeWPA1PSKWPA2PSK))
-
-// EAPOL Key Information definition within Key descriptor format
-typedef struct PACKED _KEY_INFO
-{
-#ifdef RT_BIG_ENDIAN
- UCHAR KeyAck:1;
- UCHAR Install:1;
- UCHAR KeyIndex:2;
- UCHAR KeyType:1;
- UCHAR KeyDescVer:3;
- UCHAR Rsvd:3;
- UCHAR EKD_DL:1; // EKD for AP; DL for STA
- UCHAR Request:1;
- UCHAR Error:1;
- UCHAR Secure:1;
- UCHAR KeyMic:1;
-#else
- UCHAR KeyMic:1;
- UCHAR Secure:1;
- UCHAR Error:1;
- UCHAR Request:1;
- UCHAR EKD_DL:1; // EKD for AP; DL for STA
- UCHAR Rsvd:3;
- UCHAR KeyDescVer:3;
- UCHAR KeyType:1;
- UCHAR KeyIndex:2;
- UCHAR Install:1;
- UCHAR KeyAck:1;
-#endif
-} KEY_INFO, *PKEY_INFO;
-
-// EAPOL Key descriptor format
-typedef struct PACKED _KEY_DESCRIPTER
-{
- UCHAR Type;
- KEY_INFO KeyInfo;
- UCHAR KeyLength[2];
- UCHAR ReplayCounter[LEN_KEY_DESC_REPLAY];
- UCHAR KeyNonce[LEN_KEY_DESC_NONCE];
- UCHAR KeyIv[LEN_KEY_DESC_IV];
- UCHAR KeyRsc[LEN_KEY_DESC_RSC];
- UCHAR KeyId[LEN_KEY_DESC_ID];
- UCHAR KeyMic[LEN_KEY_DESC_MIC];
- UCHAR KeyDataLen[2];
- UCHAR KeyData[MAX_LEN_OF_RSNIE];
-} KEY_DESCRIPTER, *PKEY_DESCRIPTER;
-
-typedef struct PACKED _EAPOL_PACKET
-{
- UCHAR ProVer;
- UCHAR ProType;
- UCHAR Body_Len[2];
- KEY_DESCRIPTER KeyDesc;
-} EAPOL_PACKET, *PEAPOL_PACKET;
-
-//802.11i D10 page 83
-typedef struct PACKED _GTK_ENCAP
-{
-#ifndef RT_BIG_ENDIAN
- UCHAR Kid:2;
- UCHAR tx:1;
- UCHAR rsv:5;
- UCHAR rsv1;
-#else
- UCHAR rsv:5;
- UCHAR tx:1;
- UCHAR Kid:2;
- UCHAR rsv1;
-#endif
- UCHAR GTK[TKIP_GTK_LENGTH];
-} GTK_ENCAP, *PGTK_ENCAP;
-
-typedef struct PACKED _KDE_ENCAP
-{
- UCHAR Type;
- UCHAR Len;
- UCHAR OUI[3];
- UCHAR DataType;
- GTK_ENCAP GTKEncap;
-} KDE_ENCAP, *PKDE_ENCAP;
-
-// For WPA1
-typedef struct PACKED _RSNIE {
- UCHAR oui[4];
- USHORT version;
- UCHAR mcast[4];
- USHORT ucount;
- struct PACKED {
- UCHAR oui[4];
- }ucast[1];
-} RSNIE, *PRSNIE;
-
-// For WPA2
-typedef struct PACKED _RSNIE2 {
- USHORT version;
- UCHAR mcast[4];
- USHORT ucount;
- struct PACKED {
- UCHAR oui[4];
- }ucast[1];
-} RSNIE2, *PRSNIE2;
-
-// AKM Suite
-typedef struct PACKED _RSNIE_AUTH {
- USHORT acount;
- struct PACKED {
- UCHAR oui[4];
- }auth[1];
-} RSNIE_AUTH,*PRSNIE_AUTH;
-
-typedef union PACKED _RSN_CAPABILITIES {
- struct PACKED {
-#ifdef RT_BIG_ENDIAN
- USHORT Rsvd:10;
- USHORT GTKSA_R_Counter:2;
- USHORT PTKSA_R_Counter:2;
- USHORT No_Pairwise:1;
- USHORT PreAuth:1;
-#else
- USHORT PreAuth:1;
- USHORT No_Pairwise:1;
- USHORT PTKSA_R_Counter:2;
- USHORT GTKSA_R_Counter:2;
- USHORT Rsvd:10;
-#endif
- } field;
- USHORT word;
-} RSN_CAPABILITIES, *PRSN_CAPABILITIES;
-
-typedef struct PACKED _EAP_HDR {
- UCHAR ProVer;
- UCHAR ProType;
- UCHAR Body_Len[2];
- UCHAR code;
- UCHAR identifier;
- UCHAR length[2]; // including code and identifier, followed by length-2 octets of data
-} EAP_HDR, *PEAP_HDR;
-
-// For supplicant state machine states. 802.11i Draft 4.1, p. 97
-// We simplified it
-typedef enum _WpaState
-{
- SS_NOTUSE, // 0
- SS_START, // 1
- SS_WAIT_MSG_3, // 2
- SS_WAIT_GROUP, // 3
- SS_FINISH, // 4
- SS_KEYUPDATE, // 5
-} WPA_STATE;
-
-//
-// The definition of the cipher combination
-//
-// bit3 bit2 bit1 bit0
-// +------------+------------+
-// | WPA | WPA2 |
-// +------+-----+------+-----+
-// | TKIP | AES | TKIP | AES |
-// | 0 | 1 | 1 | 0 | -> 0x06
-// | 0 | 1 | 1 | 1 | -> 0x07
-// | 1 | 0 | 0 | 1 | -> 0x09
-// | 1 | 0 | 1 | 1 | -> 0x0B
-// | 1 | 1 | 0 | 1 | -> 0x0D
-// | 1 | 1 | 1 | 0 | -> 0x0E
-// | 1 | 1 | 1 | 1 | -> 0x0F
-// +------+-----+------+-----+
-//
-typedef enum _WpaMixPairCipher
-{
- MIX_CIPHER_NOTUSE = 0x00,
- WPA_NONE_WPA2_TKIPAES = 0x03, // WPA2-TKIPAES
- WPA_AES_WPA2_TKIP = 0x06,
- WPA_AES_WPA2_TKIPAES = 0x07,
- WPA_TKIP_WPA2_AES = 0x09,
- WPA_TKIP_WPA2_TKIPAES = 0x0B,
- WPA_TKIPAES_WPA2_NONE = 0x0C, // WPA-TKIPAES
- WPA_TKIPAES_WPA2_AES = 0x0D,
- WPA_TKIPAES_WPA2_TKIP = 0x0E,
- WPA_TKIPAES_WPA2_TKIPAES = 0x0F,
-} WPA_MIX_PAIR_CIPHER;
-
-typedef struct PACKED _RSN_IE_HEADER_STRUCT {
- UCHAR Eid;
- UCHAR Length;
- USHORT Version; // Little endian format
-} RSN_IE_HEADER_STRUCT, *PRSN_IE_HEADER_STRUCT;
-
-// Cipher suite selector types
-typedef struct PACKED _CIPHER_SUITE_STRUCT {
- UCHAR Oui[3];
- UCHAR Type;
-} CIPHER_SUITE_STRUCT, *PCIPHER_SUITE_STRUCT;
-
-// Authentication and Key Management suite selector
-typedef struct PACKED _AKM_SUITE_STRUCT {
- UCHAR Oui[3];
- UCHAR Type;
-} AKM_SUITE_STRUCT, *PAKM_SUITE_STRUCT;
-
-// RSN capability
-typedef struct PACKED _RSN_CAPABILITY {
- USHORT Rsv:10;
- USHORT GTKSAReplayCnt:2;
- USHORT PTKSAReplayCnt:2;
- USHORT NoPairwise:1;
- USHORT PreAuth:1;
-} RSN_CAPABILITY, *PRSN_CAPABILITY;
-
-
-/*========================================
- The prototype is defined in cmm_wpa.c
- ========================================*/
-BOOLEAN WpaMsgTypeSubst(
- IN UCHAR EAPType,
- OUT INT *MsgType);
-
-VOID PRF(
- IN UCHAR *key,
- IN INT key_len,
- IN UCHAR *prefix,
- IN INT prefix_len,
- IN UCHAR *data,
- IN INT data_len,
- OUT UCHAR *output,
- IN INT len);
-
-int PasswordHash(
- char *password,
- unsigned char *ssid,
- int ssidlength,
- unsigned char *output);
-
-PUINT8 GetSuiteFromRSNIE(
- IN PUINT8 rsnie,
- IN UINT rsnie_len,
- IN UINT8 type,
- OUT UINT8 *count);
-
-VOID WpaShowAllsuite(
- IN PUINT8 rsnie,
- IN UINT rsnie_len);
-
-VOID RTMPInsertRSNIE(
- IN PUCHAR pFrameBuf,
- OUT PULONG pFrameLen,
- IN PUINT8 rsnie_ptr,
- IN UINT8 rsnie_len,
- IN PUINT8 pmkid_ptr,
- IN UINT8 pmkid_len);
-
-
-#endif
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
index 5e2e79b1e341..f882dd8cf9b5 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c
@@ -37,7 +37,6 @@
#include <linux/slab.h>
#include <linux/tcp.h>
#include <linux/types.h>
-#include <linux/version.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index e2945db61795..dde1f2e0cf32 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -47,7 +47,6 @@
#include <linux/slab.h>
#include <linux/tcp.h>
#include <linux/types.h>
-#include <linux/version.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
index a08b97a09512..6aad48fe2e18 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c
@@ -30,7 +30,6 @@
******************************************************************************/
#include <linux/wireless.h>
-#include <linux/version.h>
#include <linux/kmod.h>
#include <linux/module.h>
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
index 8e56f97a8f57..ac223cef1d33 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_rx.c
@@ -37,7 +37,6 @@
#include <linux/slab.h>
#include <linux/tcp.h>
#include <linux/types.h>
-#include <linux/version.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
index 47ff0efb6370..60621d6b2a6b 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_tx.c
@@ -47,7 +47,6 @@
#include <linux/slab.h>
#include <linux/tcp.h>
#include <linux/types.h>
-#include <linux/version.h>
#include <linux/wireless.h>
#include <linux/etherdevice.h>
#include <asm/uaccess.h>
diff --git a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
index 6146c6435dde..85c7e96b622d 100644
--- a/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
+++ b/drivers/staging/rtl8192su/ieee80211/ieee80211_wx.c
@@ -30,7 +30,6 @@
******************************************************************************/
#include <linux/wireless.h>
-#include <linux/version.h>
#include <linux/kmod.h>
#include <linux/module.h>
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index e67a130f9e46..5b191afc1442 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -354,7 +354,6 @@ static const struct net_device_ops slic_netdev_ops = {
.ndo_get_stats = slic_get_stats,
.ndo_set_multicast_list = slic_mcast_set_list,
.ndo_validate_addr = eth_validate_addr,
- .ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
};
diff --git a/drivers/staging/stlc45xx/Kconfig b/drivers/staging/stlc45xx/Kconfig
deleted file mode 100644
index 947fb75a9c68..000000000000
--- a/drivers/staging/stlc45xx/Kconfig
+++ /dev/null
@@ -1,8 +0,0 @@
-config STLC45XX
- tristate "stlc4550/4560 support"
- depends on MAC80211 && WLAN_80211 && SPI_MASTER && GENERIC_HARDIRQS
- ---help---
- This is a driver for stlc4550 and stlc4560 chipsets.
-
- To compile this driver as a module, choose M here: the module will be
- called stlc45xx. If unsure, say N.
diff --git a/drivers/staging/stlc45xx/Makefile b/drivers/staging/stlc45xx/Makefile
deleted file mode 100644
index 7ee32903055a..000000000000
--- a/drivers/staging/stlc45xx/Makefile
+++ /dev/null
@@ -1 +0,0 @@
-obj-$(CONFIG_STLC45XX) += stlc45xx.o
diff --git a/drivers/staging/stlc45xx/stlc45xx.c b/drivers/staging/stlc45xx/stlc45xx.c
deleted file mode 100644
index be99eb33d817..000000000000
--- a/drivers/staging/stlc45xx/stlc45xx.c
+++ /dev/null
@@ -1,2594 +0,0 @@
-/*
- * This file is part of stlc45xx
- *
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
- *
- * Contact: Kalle Valo <kalle.valo@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include "stlc45xx.h"
-
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/interrupt.h>
-#include <linux/firmware.h>
-#include <linux/delay.h>
-#include <linux/irq.h>
-#include <linux/spi/spi.h>
-#include <linux/etherdevice.h>
-#include <linux/gpio.h>
-#include <linux/moduleparam.h>
-
-#include "stlc45xx_lmac.h"
-
-/*
- * gpios should be handled in board files and provided via platform data,
- * but because it's currently impossible for stlc45xx to have a header file
- * in include/linux, let's use module paramaters for now
- */
-static int stlc45xx_gpio_power = 97;
-module_param(stlc45xx_gpio_power, int, 0444);
-MODULE_PARM_DESC(stlc45xx_gpio_power, "stlc45xx gpio number for power line");
-
-static int stlc45xx_gpio_irq = 87;
-module_param(stlc45xx_gpio_irq, int, 0444);
-MODULE_PARM_DESC(stlc45xx_gpio_irq, "stlc45xx gpio number for irq line");
-
-static const u8 default_cal_channels[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x09,
- 0x00, 0x00, 0xc9, 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01, 0x10,
- 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xe0, 0x00, 0xe0, 0x00,
- 0xe0, 0x00, 0xe0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0,
- 0x00, 0x54, 0x01, 0xab, 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42,
- 0xc0, 0x42, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00,
- 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9,
- 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00,
- 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc,
- 0x00, 0xbc, 0xfb, 0x00, 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0,
- 0x2b, 0xc0, 0x2b, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4,
- 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d,
- 0x54, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa,
- 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00,
- 0xaa, 0x00, 0xaa, 0xa7, 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17,
- 0xc0, 0x17, 0xc0, 0x17, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00,
- 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00,
- 0x06, 0x2c, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x71, 0x09, 0x00, 0x00, 0xc9, 0xff, 0xd8,
- 0xff, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01,
- 0x10, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xd0,
- 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54, 0x01, 0xab, 0xf6,
- 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0x00, 0xcb, 0x00,
- 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb,
- 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33, 0xc0, 0x33, 0xc0,
- 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc,
- 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0xfb, 0x00, 0xca,
- 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0x00, 0xb4,
- 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00,
- 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0, 0x21, 0xc0, 0x21,
- 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00,
- 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0xa7, 0x00,
- 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0x00,
- 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
- 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c, 0xc0, 0x0d, 0xc0,
- 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76,
- 0x09, 0x00, 0x00, 0xc9, 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01,
- 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xf0, 0x00, 0xf0,
- 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00,
- 0xd0, 0x00, 0x54, 0x01, 0xab, 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0,
- 0x42, 0xc0, 0x42, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb,
- 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37,
- 0xa9, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc,
- 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00,
- 0xbc, 0x00, 0xbc, 0xfb, 0x00, 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b,
- 0xc0, 0x2b, 0xc0, 0x2b, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00,
- 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00,
- 0x5d, 0x54, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00,
- 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa,
- 0x00, 0xaa, 0x00, 0xaa, 0xa7, 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0,
- 0x17, 0xc0, 0x17, 0xc0, 0x17, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
- 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a,
- 0x00, 0x06, 0x2c, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x7b, 0x09, 0x00, 0x00, 0xc9, 0xff,
- 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10,
- 0x01, 0x10, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00,
- 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54, 0x01, 0xab,
- 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0x00, 0xcb,
- 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00,
- 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33, 0xc0, 0x33,
- 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00,
- 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0xfb, 0x00,
- 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0x00,
- 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4,
- 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0, 0x21, 0xc0,
- 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa,
- 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0xa7,
- 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17,
- 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00,
- 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c, 0xc0, 0x0d,
- 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80,
- 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x80, 0x09, 0x00, 0x00, 0xc9, 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00,
- 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xf0, 0x00,
- 0xf0, 0x00, 0xf0, 0x00, 0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x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x09, 0x00, 0x00, 0xc9,
- 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x10, 0x01,
- 0x10, 0x01, 0x10, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0,
- 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54, 0x01,
- 0xab, 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0x00,
- 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb,
- 0x00, 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33, 0xc0,
- 0x33, 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc,
- 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0xfb,
- 0x00, 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b,
- 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00,
- 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0, 0x21,
- 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa, 0x00,
- 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa,
- 0xa7, 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0xc0,
- 0x17, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
- 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c, 0xc0,
- 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06,
- 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x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d, 0xc0, 0x0d, 0xc0, 0x0d,
- 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8f, 0x09, 0x00, 0x00,
- 0xc9, 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x10,
- 0x01, 0x10, 0x01, 0x10, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00,
- 0xf0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54,
- 0x01, 0xab, 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42,
- 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00,
- 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33,
- 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00,
- 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc,
- 0xfb, 0x00, 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0,
- 0x2b, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4,
- 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0,
- 0x21, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa,
- 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00,
- 0xaa, 0xa7, 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17,
- 0xc0, 0x17, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00,
- 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c,
- 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x94, 0x09, 0x00, 0x00, 0xc9, 0xff, 0xd8, 0xff, 0x00,
- 0x00, 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01,
- 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xd0, 0x00, 0xd0,
- 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54, 0x01, 0xab, 0xf6, 0xc0, 0x42,
- 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0x00, 0xcb, 0x00, 0xcb, 0x00,
- 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb,
- 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0xc0,
- 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc,
- 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0xfb, 0x00, 0xca, 0x79, 0xc0,
- 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0x00, 0xb4, 0x00, 0xb4,
- 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00,
- 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21,
- 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00,
- 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0xa7, 0x00, 0xa9, 0x3d,
- 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0x00, 0xa0, 0x00,
- 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
- 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0,
- 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x09, 0x00,
- 0x00, 0xc9, 0xff, 0xd8, 0xff, 0x00, 0x00, 0x00, 0x01, 0x10, 0x01,
- 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0,
- 0x00, 0xf0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00,
- 0x54, 0x01, 0xab, 0xf6, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0,
- 0x42, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb,
- 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0,
- 0x33, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc,
- 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00,
- 0xbc, 0xfb, 0x00, 0xca, 0x79, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b,
- 0xc0, 0x2b, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00,
- 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54,
- 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00,
- 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa,
- 0x00, 0xaa, 0xa7, 0x00, 0xa9, 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0,
- 0x17, 0xc0, 0x17, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
- 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06,
- 0x2c, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96,
- 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x06, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x9e, 0x09, 0x00, 0x00, 0xc9, 0xff, 0xd8, 0xff,
- 0x00, 0x00, 0x00, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10,
- 0x01, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xf0, 0x00, 0xd0, 0x00,
- 0xd0, 0x00, 0xd0, 0x00, 0xd0, 0x00, 0x54, 0x01, 0xab, 0xf6, 0xc0,
- 0x42, 0xc0, 0x42, 0xc0, 0x42, 0xc0, 0x42, 0x00, 0xcb, 0x00, 0xcb,
- 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00, 0xcb, 0x00,
- 0xcb, 0x22, 0x01, 0x37, 0xa9, 0xc0, 0x33, 0xc0, 0x33, 0xc0, 0x33,
- 0xc0, 0x33, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00,
- 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0x00, 0xbc, 0xfb, 0x00, 0xca, 0x79,
- 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0xc0, 0x2b, 0x00, 0xb4, 0x00,
- 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4, 0x00, 0xb4,
- 0x00, 0xb4, 0xd0, 0x00, 0x5d, 0x54, 0xc0, 0x21, 0xc0, 0x21, 0xc0,
- 0x21, 0xc0, 0x21, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa,
- 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0xa7, 0x00, 0xa9,
- 0x3d, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0xc0, 0x17, 0x00, 0xa0,
- 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00,
- 0xa0, 0x00, 0xa0, 0x7a, 0x00, 0x06, 0x2c, 0xc0, 0x0d, 0xc0, 0x0d,
- 0xc0, 0x0d, 0xc0, 0x0d, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00,
- 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x96, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x80, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00 };
-
-static const u8 default_cal_rssi[] = {
- 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72,
- 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00,
- 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a,
- 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe,
- 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00,
- 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01,
- 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a,
- 0x00, 0x00, 0x00, 0x0a, 0x01, 0x72, 0xfe, 0x1a, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00 };
-
-static void stlc45xx_tx_edcf(struct stlc45xx *stlc);
-static void stlc45xx_tx_setup(struct stlc45xx *stlc);
-static void stlc45xx_tx_scan(struct stlc45xx *stlc);
-static void stlc45xx_tx_psm(struct stlc45xx *stlc, bool enable);
-static int stlc45xx_tx_nullfunc(struct stlc45xx *stlc, bool powersave);
-static int stlc45xx_tx_pspoll(struct stlc45xx *stlc, bool powersave);
-
-static ssize_t stlc45xx_sysfs_show_cal_rssi(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct stlc45xx *stlc = dev_get_drvdata(dev);
- ssize_t len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- len = PAGE_SIZE;
-
- mutex_lock(&stlc->mutex);
-
- if (stlc->cal_rssi)
- hex_dump_to_buffer(stlc->cal_rssi, RSSI_CAL_ARRAY_LEN, 16,
- 2, buf, len, 0);
- mutex_unlock(&stlc->mutex);
-
- len = strlen(buf);
-
- return len;
-}
-
-static ssize_t stlc45xx_sysfs_store_cal_rssi(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct stlc45xx *stlc = dev_get_drvdata(dev);
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- if (count != RSSI_CAL_ARRAY_LEN) {
- stlc45xx_error("invalid cal_rssi length: %zu", count);
- count = 0;
- goto out_unlock;
- }
-
- kfree(stlc->cal_rssi);
-
- stlc->cal_rssi = kmemdup(buf, RSSI_CAL_ARRAY_LEN, GFP_KERNEL);
-
- if (!stlc->cal_rssi) {
- stlc45xx_error("failed to allocate memory for cal_rssi");
- count = 0;
- goto out_unlock;
- }
-
- out_unlock:
- mutex_unlock(&stlc->mutex);
-
- return count;
-}
-
-static ssize_t stlc45xx_sysfs_show_cal_channels(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct stlc45xx *stlc = dev_get_drvdata(dev);
- ssize_t len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- len = PAGE_SIZE;
-
- mutex_lock(&stlc->mutex);
-
- if (stlc->cal_channels)
- hex_dump_to_buffer(stlc->cal_channels, CHANNEL_CAL_ARRAY_LEN,
- 16, 2, buf, len, 0);
-
- mutex_unlock(&stlc->mutex);
-
- len = strlen(buf);
-
- return len;
-}
-
-static ssize_t stlc45xx_sysfs_store_cal_channels(struct device *dev,
- struct device_attribute *attr,
- const char *buf, size_t count)
-{
- struct stlc45xx *stlc = dev_get_drvdata(dev);
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- if (count != CHANNEL_CAL_ARRAY_LEN) {
- stlc45xx_error("invalid cal_channels size: %zu ", count);
- count = 0;
- goto out_unlock;
- }
-
- kfree(stlc->cal_channels);
-
- stlc->cal_channels = kmemdup(buf, count, GFP_KERNEL);
-
- if (!stlc->cal_channels) {
- stlc45xx_error("failed to allocate memory for cal_channels");
- count = 0;
- goto out_unlock;
- }
-
-out_unlock:
- mutex_unlock(&stlc->mutex);
-
- return count;
-}
-
-static ssize_t stlc45xx_sysfs_show_tx_buf(struct device *dev,
- struct device_attribute *attr,
- char *buf)
-{
- struct stlc45xx *stlc = dev_get_drvdata(dev);
- struct txbuffer *entry;
- ssize_t len = 0;
-
- stlc45xx_debug(DEBUG_FUNC, "%s()", __func__);
-
- mutex_lock(&stlc->mutex);
-
- list_for_each_entry(entry, &stlc->tx_sent, tx_list) {
- len += sprintf(buf + len, "0x%x: 0x%x-0x%x\n",
- entry->handle, entry->start,
- entry->end);
- }
-
- mutex_unlock(&stlc->mutex);
-
- return len;
-}
-
-static DEVICE_ATTR(cal_rssi, S_IRUGO | S_IWUSR,
- stlc45xx_sysfs_show_cal_rssi,
- stlc45xx_sysfs_store_cal_rssi);
-static DEVICE_ATTR(cal_channels, S_IRUGO | S_IWUSR,
- stlc45xx_sysfs_show_cal_channels,
- stlc45xx_sysfs_store_cal_channels);
-static DEVICE_ATTR(tx_buf, S_IRUGO, stlc45xx_sysfs_show_tx_buf, NULL);
-
-static void stlc45xx_spi_read(struct stlc45xx *stlc, unsigned long addr,
- void *buf, size_t len)
-{
- struct spi_transfer t[2];
- struct spi_message m;
-
- /* We first push the address */
- addr = (addr << 8) | ADDR_READ_BIT_15;
-
- spi_message_init(&m);
- memset(t, 0, sizeof(t));
-
- t[0].tx_buf = &addr;
- t[0].len = 2;
- spi_message_add_tail(&t[0], &m);
-
- t[1].rx_buf = buf;
- t[1].len = len;
- spi_message_add_tail(&t[1], &m);
-
- spi_sync(stlc->spi, &m);
-}
-
-
-static void stlc45xx_spi_write(struct stlc45xx *stlc, unsigned long addr,
- void *buf, size_t len)
-{
- struct spi_transfer t[3];
- struct spi_message m;
- u16 last_word;
-
- /* We first push the address */
- addr = addr << 8;
-
- spi_message_init(&m);
- memset(t, 0, sizeof(t));
-
- t[0].tx_buf = &addr;
- t[0].len = 2;
- spi_message_add_tail(&t[0], &m);
-
- t[1].tx_buf = buf;
- t[1].len = len;
- spi_message_add_tail(&t[1], &m);
-
- if (len % 2) {
- last_word = ((u8 *)buf)[len - 1];
-
- t[2].tx_buf = &last_word;
- t[2].len = 2;
- spi_message_add_tail(&t[2], &m);
- }
-
- spi_sync(stlc->spi, &m);
-}
-
-static u16 stlc45xx_read16(struct stlc45xx *stlc, unsigned long addr)
-{
- u16 val;
-
- stlc45xx_spi_read(stlc, addr, &val, sizeof(val));
-
- return val;
-}
-
-static u32 stlc45xx_read32(struct stlc45xx *stlc, unsigned long addr)
-{
- u32 val;
-
- stlc45xx_spi_read(stlc, addr, &val, sizeof(val));
-
- return val;
-}
-
-static void stlc45xx_write16(struct stlc45xx *stlc, unsigned long addr, u16 val)
-{
- stlc45xx_spi_write(stlc, addr, &val, sizeof(val));
-}
-
-static void stlc45xx_write32(struct stlc45xx *stlc, unsigned long addr, u32 val)
-{
- stlc45xx_spi_write(stlc, addr, &val, sizeof(val));
-}
-
-struct stlc45xx_spi_reg {
- u16 address;
- u16 length;
- char *name;
-};
-
-/* caller must hold tx_lock */
-static void stlc45xx_txbuffer_dump(struct stlc45xx *stlc)
-{
- struct txbuffer *txbuffer;
- char *buf, *pos;
- int buf_len, l, count;
-
- if (!(DEBUG_LEVEL & DEBUG_TXBUFFER))
- return;
-
- stlc45xx_debug(DEBUG_FUNC, "%s()", __func__);
-
- buf_len = 500;
- buf = kmalloc(buf_len, GFP_ATOMIC);
- if (!buf)
- return;
-
- pos = buf;
- count = 0;
-
- list_for_each_entry(txbuffer, &stlc->txbuffer, buffer_list) {
- l = snprintf(pos, buf_len, "0x%x-0x%x,",
- txbuffer->start, txbuffer->end);
- /* drop the null byte */
- pos += l;
- buf_len -= l;
- count++;
- }
-
- if (count == 0)
- *pos = '\0';
- else
- *--pos = '\0';
-
- stlc45xx_debug(DEBUG_TXBUFFER, "txbuffer: in buffer %d regions: %s",
- count, buf);
-
- kfree(buf);
-}
-
-/* caller must hold tx_lock */
-static int stlc45xx_txbuffer_find(struct stlc45xx *stlc, size_t len)
-{
- struct txbuffer *txbuffer;
- int pos;
-
- stlc45xx_debug(DEBUG_FUNC, "%s()", __func__);
-
- pos = FIRMWARE_TXBUFFER_START;
-
- if (list_empty(&stlc->txbuffer))
- goto out;
-
- /*
- * the entries in txbuffer must be in the same order as they are in
- * the real buffer
- */
- list_for_each_entry(txbuffer, &stlc->txbuffer, buffer_list) {
- if (pos + len < txbuffer->start)
- break;
- pos = ALIGN(txbuffer->end + 1, 4);
- }
-
- if (pos + len > FIRMWARE_TXBUFFER_END)
- /* not enough room */
- pos = -1;
-
- stlc45xx_debug(DEBUG_TXBUFFER, "txbuffer: find %zu B: 0x%x", len, pos);
-
-out:
- return pos;
-}
-
-static int stlc45xx_txbuffer_add(struct stlc45xx *stlc,
- struct txbuffer *txbuffer)
-{
- struct txbuffer *r, *prev = NULL;
-
- if (list_empty(&stlc->txbuffer)) {
- list_add(&txbuffer->buffer_list, &stlc->txbuffer);
- return 0;
- }
-
- r = list_first_entry(&stlc->txbuffer, struct txbuffer, buffer_list);
-
- if (txbuffer->start < r->start) {
- /* add to the beginning of the list */
- list_add(&txbuffer->buffer_list, &stlc->txbuffer);
- return 0;
- }
-
- prev = NULL;
- list_for_each_entry(r, &stlc->txbuffer, buffer_list) {
- /* skip first entry, we checked for that above */
- if (!prev) {
- prev = r;
- continue;
- }
-
- /* double-check overlaps */
- WARN_ON_ONCE(txbuffer->start >= r->start &&
- txbuffer->start <= r->end);
- WARN_ON_ONCE(txbuffer->end >= r->start &&
- txbuffer->end <= r->end);
-
- if (prev->end < txbuffer->start &&
- txbuffer->end < r->start) {
- /* insert at this spot */
- list_add_tail(&txbuffer->buffer_list, &r->buffer_list);
- return 0;
- }
-
- prev = r;
- }
-
- /* not found */
- list_add_tail(&txbuffer->buffer_list, &stlc->txbuffer);
-
- return 0;
-
-}
-
-/* caller must hold tx_lock */
-static struct txbuffer *stlc45xx_txbuffer_alloc(struct stlc45xx *stlc,
- size_t frame_len)
-{
- struct txbuffer *entry = NULL;
- size_t len;
- int pos;
-
- stlc45xx_debug(DEBUG_FUNC, "%s()", __func__);
-
- len = FIRMWARE_TXBUFFER_HEADER + frame_len + FIRMWARE_TXBUFFER_TRAILER;
- pos = stlc45xx_txbuffer_find(stlc, len);
-
- if (pos < 0)
- return NULL;
-
- WARN_ON_ONCE(pos + len > FIRMWARE_TXBUFFER_END);
- WARN_ON_ONCE(pos < FIRMWARE_TXBUFFER_START);
-
- entry = kmalloc(sizeof(*entry), GFP_ATOMIC);
- entry->start = pos;
- entry->frame_start = pos + FIRMWARE_TXBUFFER_HEADER;
- entry->end = entry->start + len - 1;
-
- stlc45xx_debug(DEBUG_TXBUFFER, "txbuffer: allocated 0x%x-0x%x",
- entry->start, entry->end);
-
- stlc45xx_txbuffer_add(stlc, entry);
-
- stlc45xx_txbuffer_dump(stlc);
-
- return entry;
-}
-
-/* caller must hold tx_lock */
-static void stlc45xx_txbuffer_free(struct stlc45xx *stlc,
- struct txbuffer *txbuffer)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s()", __func__);
-
- stlc45xx_debug(DEBUG_TXBUFFER, "txbuffer: freed 0x%x-0x%x",
- txbuffer->start, txbuffer->end);
-
- list_del(&txbuffer->buffer_list);
- kfree(txbuffer);
-}
-
-
-static int stlc45xx_wait_bit(struct stlc45xx *stlc, u16 reg, u32 mask,
- u32 expected)
-{
- int i;
- char buffer[4];
-
- for (i = 0; i < 2000; i++) {
- stlc45xx_spi_read(stlc, reg, buffer, sizeof(buffer));
- if (((*(u32 *)buffer) & mask) == expected)
- return 1;
- msleep(1);
- }
-
- return 0;
-}
-
-static int stlc45xx_request_firmware(struct stlc45xx *stlc)
-{
- const struct firmware *fw;
- int ret;
-
- /* FIXME: should driver use it's own struct device? */
- ret = request_firmware(&fw, "3826.arm", &stlc->spi->dev);
-
- if (ret < 0) {
- stlc45xx_error("request_firmware() failed: %d", ret);
- return ret;
- }
-
- if (fw->size % 4) {
- stlc45xx_error("firmware size is not multiple of 32bit: %zu",
- fw->size);
- return -EILSEQ; /* Illegal byte sequence */;
- }
-
- if (fw->size < 1000) {
- stlc45xx_error("firmware is too small: %zu", fw->size);
- return -EILSEQ;
- }
-
- stlc->fw = kmemdup(fw->data, fw->size, GFP_KERNEL);
- if (!stlc->fw) {
- stlc45xx_error("could not allocate memory for firmware");
- return -ENOMEM;
- }
-
- stlc->fw_len = fw->size;
-
- release_firmware(fw);
-
- return 0;
-}
-
-static int stlc45xx_upload_firmware(struct stlc45xx *stlc)
-{
- struct s_dma_regs dma_regs;
- unsigned long fw_len, fw_addr;
- long _fw_len;
- int ret;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- if (!stlc->fw) {
- ret = stlc45xx_request_firmware(stlc);
- if (ret < 0)
- return ret;
- }
-
- /* stop the device */
- stlc45xx_write16(stlc, SPI_ADRS_DEV_CTRL_STAT,
- SPI_CTRL_STAT_HOST_OVERRIDE | SPI_CTRL_STAT_HOST_RESET
- | SPI_CTRL_STAT_START_HALTED);
-
- msleep(TARGET_BOOT_SLEEP);
-
- stlc45xx_write16(stlc, SPI_ADRS_DEV_CTRL_STAT,
- SPI_CTRL_STAT_HOST_OVERRIDE
- | SPI_CTRL_STAT_START_HALTED);
-
- msleep(TARGET_BOOT_SLEEP);
-
- fw_addr = FIRMWARE_ADDRESS;
- fw_len = stlc->fw_len;
-
- while (fw_len > 0) {
- _fw_len = (fw_len > SPI_MAX_PACKET_SIZE)
- ? SPI_MAX_PACKET_SIZE : fw_len;
- dma_regs.cmd = SPI_DMA_WRITE_CTRL_ENABLE;
- dma_regs.len = cpu_to_le16(_fw_len);
- dma_regs.addr = cpu_to_le32(fw_addr);
-
- fw_len -= _fw_len;
- fw_addr += _fw_len;
-
- stlc45xx_write16(stlc, SPI_ADRS_DMA_WRITE_CTRL, dma_regs.cmd);
-
- if (stlc45xx_wait_bit(stlc, SPI_ADRS_DMA_WRITE_CTRL,
- HOST_ALLOWED, HOST_ALLOWED) == 0) {
- stlc45xx_error("fw_upload not allowed to DMA write");
- return -EAGAIN;
- }
-
- stlc45xx_write16(stlc, SPI_ADRS_DMA_WRITE_LEN, dma_regs.len);
- stlc45xx_write32(stlc, SPI_ADRS_DMA_WRITE_BASE, dma_regs.addr);
-
- stlc45xx_spi_write(stlc, SPI_ADRS_DMA_DATA, stlc->fw, _fw_len);
-
- /* FIXME: I think this doesn't work if firmware is large,
- * this loop goes to second round. fw->data is not
- * increased at all! */
- }
-
- BUG_ON(fw_len != 0);
-
- /* enable host interrupts */
- stlc45xx_write32(stlc, SPI_ADRS_HOST_INT_EN, SPI_HOST_INTS_DEFAULT);
-
- /* boot the device */
- stlc45xx_write16(stlc, SPI_ADRS_DEV_CTRL_STAT,
- SPI_CTRL_STAT_HOST_OVERRIDE | SPI_CTRL_STAT_HOST_RESET
- | SPI_CTRL_STAT_RAM_BOOT);
-
- msleep(TARGET_BOOT_SLEEP);
-
- stlc45xx_write16(stlc, SPI_ADRS_DEV_CTRL_STAT,
- SPI_CTRL_STAT_HOST_OVERRIDE | SPI_CTRL_STAT_RAM_BOOT);
- msleep(TARGET_BOOT_SLEEP);
-
- return 0;
-}
-
-/* caller must hold tx_lock */
-static void stlc45xx_check_txsent(struct stlc45xx *stlc)
-{
- struct txbuffer *entry, *n;
-
- list_for_each_entry_safe(entry, n, &stlc->tx_sent, tx_list) {
- if (time_after(jiffies, entry->lifetime)) {
- if (net_ratelimit())
- stlc45xx_warning("frame 0x%x lifetime exceeded",
- entry->start);
- list_del(&entry->tx_list);
- skb_pull(entry->skb, entry->header_len);
- ieee80211_tx_status(stlc->hw, entry->skb);
- stlc45xx_txbuffer_free(stlc, entry);
- }
- }
-}
-
-static void stlc45xx_power_off(struct stlc45xx *stlc)
-{
- disable_irq(gpio_to_irq(stlc45xx_gpio_irq));
- gpio_set_value(stlc45xx_gpio_power, 0);
-}
-
-static void stlc45xx_power_on(struct stlc45xx *stlc)
-{
- gpio_set_value(stlc45xx_gpio_power, 1);
- enable_irq(gpio_to_irq(stlc45xx_gpio_irq));
-
- /*
- * need to wait a while before device can be accessed, the length
- * is just a guess
- */
- msleep(10);
-}
-
-/* caller must hold tx_lock */
-static void stlc45xx_flush_queues(struct stlc45xx *stlc)
-{
- struct txbuffer *entry;
-
- while (!list_empty(&stlc->tx_sent)) {
- entry = list_first_entry(&stlc->tx_sent,
- struct txbuffer, tx_list);
- list_del(&entry->tx_list);
- dev_kfree_skb(entry->skb);
- stlc45xx_txbuffer_free(stlc, entry);
- }
-
- WARN_ON(!list_empty(&stlc->tx_sent));
-
- while (!list_empty(&stlc->tx_pending)) {
- entry = list_first_entry(&stlc->tx_pending,
- struct txbuffer, tx_list);
- list_del(&entry->tx_list);
- dev_kfree_skb(entry->skb);
- stlc45xx_txbuffer_free(stlc, entry);
- }
-
- WARN_ON(!list_empty(&stlc->tx_pending));
- WARN_ON(!list_empty(&stlc->txbuffer));
-}
-
-static void stlc45xx_work_reset(struct work_struct *work)
-{
- struct stlc45xx *stlc = container_of(work, struct stlc45xx,
- work_reset);
-
- mutex_lock(&stlc->mutex);
-
- if (stlc->fw_state != FW_STATE_RESET)
- goto out;
-
- stlc45xx_power_off(stlc);
-
- mutex_unlock(&stlc->mutex);
-
- /* wait that all work_structs have finished, we can't hold
- * stlc->mutex to avoid deadlock */
- cancel_work_sync(&stlc->work);
-
- /* FIXME: find out good value to wait for chip power down */
- msleep(100);
-
- mutex_lock(&stlc->mutex);
-
- /* FIXME: we should gracefully handle if the state has changed
- * after re-acquiring mutex */
- WARN_ON(stlc->fw_state != FW_STATE_RESET);
-
- spin_lock_bh(&stlc->tx_lock);
- stlc45xx_flush_queues(stlc);
- spin_unlock_bh(&stlc->tx_lock);
-
- stlc->fw_state = FW_STATE_RESETTING;
-
- stlc45xx_power_on(stlc);
- stlc45xx_upload_firmware(stlc);
-
-out:
- mutex_unlock(&stlc->mutex);
-}
-
-/* caller must hold mutex */
-static void stlc45xx_reset(struct stlc45xx *stlc)
-{
- stlc45xx_warning("resetting firmware");
- stlc->fw_state = FW_STATE_RESET;
- ieee80211_stop_queues(stlc->hw);
- queue_work(stlc->hw->workqueue, &stlc->work_reset);
-}
-
-static void stlc45xx_work_tx_timeout(struct work_struct *work)
-{
- struct stlc45xx *stlc = container_of(work, struct stlc45xx,
- work_tx_timeout.work);
-
- stlc45xx_warning("tx timeout");
-
- mutex_lock(&stlc->mutex);
-
- if (stlc->fw_state != FW_STATE_READY)
- goto out;
-
- stlc45xx_reset(stlc);
-
-out:
- mutex_unlock(&stlc->mutex);
-}
-
-static void stlc45xx_int_ack(struct stlc45xx *stlc, u32 val)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- stlc45xx_write32(stlc, SPI_ADRS_HOST_INT_ACK, val);
-}
-
-static void stlc45xx_wakeup(struct stlc45xx *stlc)
-{
- unsigned long timeout;
- u32 ints;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- /* wake the chip */
- stlc45xx_write32(stlc, SPI_ADRS_ARM_INTERRUPTS, SPI_TARGET_INT_WAKEUP);
-
- /* And wait for the READY interrupt */
- timeout = jiffies + HZ;
-
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- while (!(ints & SPI_HOST_INT_READY)) {
- if (time_after(jiffies, timeout))
- goto out;
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- }
-
- stlc45xx_int_ack(stlc, SPI_HOST_INT_READY);
-
-out:
- return;
-}
-
-static void stlc45xx_sleep(struct stlc45xx *stlc)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- stlc45xx_write32(stlc, SPI_ADRS_ARM_INTERRUPTS, SPI_TARGET_INT_SLEEP);
-}
-
-static void stlc45xx_int_ready(struct stlc45xx *stlc)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- stlc45xx_write32(stlc, SPI_ADRS_HOST_INT_EN,
- SPI_HOST_INT_UPDATE | SPI_HOST_INT_SW_UPDATE);
-
- switch (stlc->fw_state) {
- case FW_STATE_BOOTING:
- stlc->fw_state = FW_STATE_READY;
- complete(&stlc->fw_comp);
- break;
- case FW_STATE_RESETTING:
- stlc->fw_state = FW_STATE_READY;
-
- stlc45xx_tx_scan(stlc);
- stlc45xx_tx_setup(stlc);
- stlc45xx_tx_edcf(stlc);
-
- ieee80211_wake_queues(stlc->hw);
- break;
- default:
- break;
- }
-}
-
-static int stlc45xx_rx_txack(struct stlc45xx *stlc, struct sk_buff *skb)
-{
- struct ieee80211_tx_info *info;
- struct s_lm_control *control;
- struct s_lmo_tx *tx;
- struct txbuffer *entry;
- int found = 0;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- control = (struct s_lm_control *) skb->data;
- tx = (struct s_lmo_tx *) (control + 1);
-
- if (list_empty(&stlc->tx_sent)) {
- if (net_ratelimit())
- stlc45xx_warning("no frames waiting for "
- "acknowledgement");
- return -1;
- }
-
- list_for_each_entry(entry, &stlc->tx_sent, tx_list) {
- if (control->handle == entry->handle) {
- found = 1;
- break;
- }
- }
-
- if (!found) {
- if (net_ratelimit())
- stlc45xx_warning("couldn't find frame for tx ack 0x%x",
- control->handle);
- return -1;
- }
-
- stlc45xx_debug(DEBUG_TX, "TX ACK 0x%x", entry->handle);
-
- if (entry->status_needed) {
- info = IEEE80211_SKB_CB(entry->skb);
-
- if (!(tx->flags & LM_TX_FAILED)) {
- /* frame was acked */
- info->flags |= IEEE80211_TX_STAT_ACK;
- info->status.ack_signal = tx->rcpi / 2 - 110;
- }
-
- skb_pull(entry->skb, entry->header_len);
-
- ieee80211_tx_status(stlc->hw, entry->skb);
- }
-
- list_del(&entry->tx_list);
-
- stlc45xx_check_txsent(stlc);
- if (list_empty(&stlc->tx_sent))
- /* there are no pending frames, we can stop the tx timeout
- * timer */
- cancel_delayed_work(&stlc->work_tx_timeout);
-
- spin_lock_bh(&stlc->tx_lock);
-
- stlc45xx_txbuffer_free(stlc, entry);
-
- if (stlc->tx_queue_stopped &&
- stlc45xx_txbuffer_find(stlc, MAX_FRAME_LEN) != -1) {
- stlc45xx_debug(DEBUG_QUEUE, "room in tx buffer, waking queues");
- ieee80211_wake_queues(stlc->hw);
- stlc->tx_queue_stopped = 0;
- }
-
- spin_unlock_bh(&stlc->tx_lock);
-
- return 0;
-}
-
-static int stlc45xx_rx_control(struct stlc45xx *stlc, struct sk_buff *skb)
-{
- struct s_lm_control *control;
- int ret = 0;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- control = (struct s_lm_control *) skb->data;
-
- switch (control->oid) {
- case LM_OID_TX:
- ret = stlc45xx_rx_txack(stlc, skb);
- break;
- case LM_OID_SETUP:
- case LM_OID_SCAN:
- case LM_OID_TRAP:
- case LM_OID_EDCF:
- case LM_OID_KEYCACHE:
- case LM_OID_PSM:
- case LM_OID_STATS:
- case LM_OID_LED:
- default:
- stlc45xx_warning("unhandled rx control oid %d\n",
- control->oid);
- break;
- }
-
- dev_kfree_skb(skb);
-
- return ret;
-}
-
-/* copied from mac80211 */
-static void stlc45xx_parse_elems(u8 *start, size_t len,
- struct stlc45xx_ie_tim **tim,
- size_t *tim_len)
-{
- size_t left = len;
- u8 *pos = start;
-
- while (left >= 2) {
- u8 id, elen;
-
- id = *pos++;
- elen = *pos++;
- left -= 2;
-
- if (elen > left)
- return;
-
- switch (id) {
- case WLAN_EID_TIM:
- *tim = (struct stlc45xx_ie_tim *) pos;
- *tim_len = elen;
- break;
- default:
- break;
- }
-
- left -= elen;
- pos += elen;
- }
-}
-
-/*
- * mac80211 doesn't have support for asking frames with PS-Poll, so let's
- * implement in the driver for now. We have to add support to mac80211
- * later.
- */
-static int stlc45xx_check_more_data(struct stlc45xx *stlc, struct sk_buff *skb)
-{
- struct s_lm_data_in *data = (struct s_lm_data_in *) skb->data;
- struct ieee80211_hdr *hdr;
- size_t len;
- u16 fc;
-
- hdr = (void *) skb->data + sizeof(*data);
- len = skb->len - sizeof(*data);
-
- /* minimum frame length is the null frame length 24 bytes */
- if (len < 24) {
- stlc45xx_warning("invalid frame length when checking for "
- "more data");
- return -EINVAL;
- }
-
- fc = le16_to_cpu(hdr->frame_control);
- if (!(fc & IEEE80211_FCTL_FROMDS))
- /* this is not from DS */
- return 0;
-
- if (compare_ether_addr(hdr->addr1, stlc->mac_addr) != 0)
- /* the frame was not for us */
- return 0;
-
- if (!(fc & IEEE80211_FCTL_MOREDATA)) {
- /* AP has no more frames buffered for us */
- stlc45xx_debug(DEBUG_PSM, "all buffered frames retrieved");
- stlc->pspolling = false;
- return 0;
- }
-
- /* MOREDATA bit is set, let's ask for a new frame from the AP */
- stlc45xx_tx_pspoll(stlc, stlc->psm);
-
- return 0;
-}
-
-/*
- * mac80211 cannot read TIM from beacons, so let's add a hack to the
- * driver. We have to add support to mac80211 later.
- */
-static int stlc45xx_rx_data_beacon(struct stlc45xx *stlc, struct sk_buff *skb)
-{
- struct s_lm_data_in *data = (struct s_lm_data_in *) skb->data;
- size_t len = skb->len, tim_len = 0, baselen, pvbmap_len;
- struct ieee80211_mgmt *mgmt;
- struct stlc45xx_ie_tim *tim = NULL;
- int bmap_offset, index, aid_bit;
-
- mgmt = (void *) skb->data + sizeof(*data);
-
- baselen = (u8 *) mgmt->u.beacon.variable - (u8 *) mgmt;
- if (baselen > len) {
- stlc45xx_warning("invalid baselen in beacon");
- return -EINVAL;
- }
-
- stlc45xx_parse_elems(mgmt->u.beacon.variable, len - baselen, &tim,
- &tim_len);
-
- if (!tim) {
- stlc45xx_warning("didn't find tim from a beacon");
- return -EINVAL;
- }
-
- bmap_offset = tim->bmap_control & 0xfe;
- index = stlc->aid / 8 - bmap_offset;
-
- pvbmap_len = tim_len - 3;
- if (index > pvbmap_len)
- return -EINVAL;
-
- aid_bit = !!(tim->pvbmap[index] & (1 << stlc->aid % 8));
-
- stlc45xx_debug(DEBUG_PSM, "fc 0x%x duration %d seq %d dtim %u "
- "bmap_control 0x%x aid_bit %d",
- mgmt->frame_control, mgmt->duration, mgmt->seq_ctrl >> 4,
- tim->dtim_count, tim->bmap_control, aid_bit);
-
- if (!aid_bit)
- return 0;
-
- stlc->pspolling = true;
- stlc45xx_tx_pspoll(stlc, stlc->psm);
-
- return 0;
-}
-
-static int stlc45xx_rx_data(struct stlc45xx *stlc, struct sk_buff *skb)
-{
- struct ieee80211_rx_status status;
- struct s_lm_data_in *data = (struct s_lm_data_in *) skb->data;
- int align = 0;
- u8 *p, align_len;
- u16 len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- if (stlc->psm) {
- if (data->flags & LM_IN_BEACON)
- stlc45xx_rx_data_beacon(stlc, skb);
- else if (stlc->pspolling && (data->flags & LM_IN_DATA))
- stlc45xx_check_more_data(stlc, skb);
- }
-
- memset(&status, 0, sizeof(status));
-
- status.freq = data->frequency;
- status.signal = data->rcpi / 2 - 110;
-
- /* let's assume that maximum rcpi value is 140 (= 35 dBm) */
- status.qual = data->rcpi * 100 / 140;
-
- status.band = IEEE80211_BAND_2GHZ;
-
- /*
- * FIXME: this gives warning from __ieee80211_rx()
- *
- * status.rate_idx = data->rate;
- */
-
- len = data->length;
-
- if (data->flags & LM_FLAG_ALIGN)
- align = 1;
-
- skb_pull(skb, sizeof(*data));
-
- if (align) {
- p = skb->data;
- align_len = *p;
- skb_pull(skb, align_len);
- }
-
- skb_trim(skb, len);
-
- stlc45xx_debug(DEBUG_RX, "rx data 0x%p %d B", skb->data, skb->len);
- stlc45xx_dump(DEBUG_RX_CONTENT, skb->data, skb->len);
-
- memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
- ieee80211_rx(stlc->hw, skb);
-
- return 0;
-}
-
-
-
-static int stlc45xx_rx(struct stlc45xx *stlc)
-{
- struct s_lm_control *control;
- struct sk_buff *skb;
- int ret;
- u16 len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- stlc45xx_wakeup(stlc);
-
- /* dummy read to flush SPI DMA controller bug */
- stlc45xx_read16(stlc, SPI_ADRS_GEN_PURP_1);
-
- len = stlc45xx_read16(stlc, SPI_ADRS_DMA_DATA);
-
- if (len == 0) {
- stlc45xx_warning("rx request of zero bytes");
- return 0;
- }
-
- skb = dev_alloc_skb(len);
- if (!skb) {
- stlc45xx_warning("could not alloc skb");
- return 0;
- }
-
- stlc45xx_spi_read(stlc, SPI_ADRS_DMA_DATA, skb_put(skb, len), len);
-
- stlc45xx_sleep(stlc);
-
- stlc45xx_debug(DEBUG_RX, "rx frame 0x%p %d B", skb->data, skb->len);
- stlc45xx_dump(DEBUG_RX_CONTENT, skb->data, skb->len);
-
- control = (struct s_lm_control *) skb->data;
-
- if (control->flags & LM_FLAG_CONTROL)
- ret = stlc45xx_rx_control(stlc, skb);
- else
- ret = stlc45xx_rx_data(stlc, skb);
-
- return ret;
-}
-
-
-static irqreturn_t stlc45xx_interrupt(int irq, void *config)
-{
- struct spi_device *spi = config;
- struct stlc45xx *stlc = dev_get_drvdata(&spi->dev);
-
- stlc45xx_debug(DEBUG_IRQ, "IRQ");
-
- queue_work(stlc->hw->workqueue, &stlc->work);
-
- return IRQ_HANDLED;
-}
-
-static int stlc45xx_tx_frame(struct stlc45xx *stlc, u32 address,
- void *buf, size_t len)
-{
- struct s_dma_regs dma_regs;
- unsigned long timeout;
- int ret = 0;
- u32 ints;
-
- stlc->tx_frames++;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- stlc45xx_debug(DEBUG_TX, "tx frame 0x%p %zu B", buf, len);
- stlc45xx_dump(DEBUG_TX_CONTENT, buf, len);
-
- stlc45xx_wakeup(stlc);
-
- dma_regs.cmd = SPI_DMA_WRITE_CTRL_ENABLE;
- dma_regs.len = cpu_to_le16(len);
- dma_regs.addr = cpu_to_le32(address);
-
- stlc45xx_spi_write(stlc, SPI_ADRS_DMA_WRITE_CTRL, &dma_regs,
- sizeof(dma_regs));
-
- stlc45xx_spi_write(stlc, SPI_ADRS_DMA_DATA, buf, len);
-
- timeout = jiffies + 2 * HZ;
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- while (!(ints & SPI_HOST_INT_WR_READY)) {
- if (time_after(jiffies, timeout)) {
- stlc45xx_warning("WR_READY timeout");
- ret = -1;
- goto out;
- }
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- }
-
- stlc45xx_int_ack(stlc, SPI_HOST_INT_WR_READY);
-
- stlc45xx_sleep(stlc);
-
-out:
- return ret;
-}
-
-static int stlc45xx_wq_tx(struct stlc45xx *stlc)
-{
- struct txbuffer *entry;
- int ret = 0;
-
- spin_lock_bh(&stlc->tx_lock);
-
- while (!list_empty(&stlc->tx_pending)) {
- entry = list_entry(stlc->tx_pending.next,
- struct txbuffer, tx_list);
-
- list_del_init(&entry->tx_list);
-
- spin_unlock_bh(&stlc->tx_lock);
-
- ret = stlc45xx_tx_frame(stlc, entry->frame_start,
- entry->skb->data, entry->skb->len);
-
- spin_lock_bh(&stlc->tx_lock);
-
- if (ret < 0) {
- /* frame transfer to firmware buffer failed */
- /* FIXME: report this to mac80211 */
- dev_kfree_skb(entry->skb);
- stlc45xx_txbuffer_free(stlc, entry);
- goto out;
- }
-
- list_add(&entry->tx_list, &stlc->tx_sent);
- queue_delayed_work(stlc->hw->workqueue,
- &stlc->work_tx_timeout,
- msecs_to_jiffies(TX_TIMEOUT));
- }
-
-out:
- spin_unlock_bh(&stlc->tx_lock);
- return ret;
-}
-
-static void stlc45xx_work(struct work_struct *work)
-{
- struct stlc45xx *stlc = container_of(work, struct stlc45xx, work);
- u32 ints;
- int ret;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- if (stlc->fw_state == FW_STATE_OFF &&
- stlc->fw_state == FW_STATE_RESET)
- goto out;
-
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- stlc45xx_debug(DEBUG_BH, "begin host_ints 0x%08x", ints);
-
- if (ints & SPI_HOST_INT_READY) {
- stlc45xx_int_ready(stlc);
- stlc45xx_int_ack(stlc, SPI_HOST_INT_READY);
- }
-
- if (stlc->fw_state != FW_STATE_READY)
- goto out;
-
- if (ints & SPI_HOST_INT_UPDATE) {
- stlc45xx_int_ack(stlc, SPI_HOST_INT_UPDATE);
- ret = stlc45xx_rx(stlc);
- if (ret < 0) {
- stlc45xx_reset(stlc);
- goto out;
- }
- }
- if (ints & SPI_HOST_INT_SW_UPDATE) {
- stlc45xx_int_ack(stlc, SPI_HOST_INT_SW_UPDATE);
- ret = stlc45xx_rx(stlc);
- if (ret < 0) {
- stlc45xx_reset(stlc);
- goto out;
- }
- }
-
- ret = stlc45xx_wq_tx(stlc);
- if (ret < 0) {
- stlc45xx_reset(stlc);
- goto out;
- }
-
- ints = stlc45xx_read32(stlc, SPI_ADRS_HOST_INTERRUPTS);
- stlc45xx_debug(DEBUG_BH, "end host_ints 0x%08x", ints);
-
-out:
- mutex_unlock(&stlc->mutex);
-}
-
-static void stlc45xx_tx_edcf(struct stlc45xx *stlc)
-{
- struct s_lm_control *control;
- struct s_lmo_edcf *edcf;
- size_t len, edcf_len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- edcf_len = sizeof(*edcf);
- len = sizeof(*control) + edcf_len;
- control = kzalloc(len, GFP_KERNEL);
- edcf = (struct s_lmo_edcf *) (control + 1);
-
- control->flags = LM_FLAG_CONTROL | LM_CTRL_OPSET;
- control->length = edcf_len;
- control->oid = LM_OID_EDCF;
-
- edcf->slottime = 0x14;
- edcf->sifs = 10;
- edcf->eofpad = 6;
- edcf->maxburst = 1500;
-
- edcf->queues[0].aifs = 2;
- edcf->queues[0].pad0 = 1;
- edcf->queues[0].cwmin = 3;
- edcf->queues[0].cwmax = 7;
- edcf->queues[0].txop = 47;
- edcf->queues[1].aifs = 2;
- edcf->queues[1].pad0 = 0;
- edcf->queues[1].cwmin = 7;
- edcf->queues[1].cwmax = 15;
- edcf->queues[1].txop = 94;
- edcf->queues[2].aifs = 3;
- edcf->queues[2].pad0 = 0;
- edcf->queues[2].cwmin = 15;
- edcf->queues[2].cwmax = 1023;
- edcf->queues[2].txop = 0;
- edcf->queues[3].aifs = 7;
- edcf->queues[3].pad0 = 0;
- edcf->queues[3].cwmin = 15;
- edcf->queues[3].cwmax = 1023;
- edcf->queues[3].txop = 0;
- edcf->queues[4].aifs = 13;
- edcf->queues[4].pad0 = 99;
- edcf->queues[4].cwmin = 3437;
- edcf->queues[4].cwmax = 512;
- edcf->queues[4].txop = 12;
- edcf->queues[5].aifs = 142;
- edcf->queues[5].pad0 = 109;
- edcf->queues[5].cwmin = 8756;
- edcf->queues[5].cwmax = 6;
- edcf->queues[5].txop = 0;
- edcf->queues[6].aifs = 4;
- edcf->queues[6].pad0 = 0;
- edcf->queues[6].cwmin = 0;
- edcf->queues[6].cwmax = 58705;
- edcf->queues[6].txop = 25716;
- edcf->queues[7].aifs = 0;
- edcf->queues[7].pad0 = 0;
- edcf->queues[7].cwmin = 0;
- edcf->queues[7].cwmax = 0;
- edcf->queues[7].txop = 0;
-
- stlc45xx_tx_frame(stlc, FIRMWARE_CONFIG_START, control, len);
-
- kfree(control);
-}
-
-static void stlc45xx_tx_setup(struct stlc45xx *stlc)
-{
- struct s_lm_control *control;
- struct s_lmo_setup *setup;
- size_t len, setup_len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- setup_len = sizeof(*setup);
- len = sizeof(*control) + setup_len;
- control = kzalloc(len, GFP_KERNEL);
- setup = (struct s_lmo_setup *) (control + 1);
-
- control->flags = LM_FLAG_CONTROL | LM_CTRL_OPSET;
- control->length = setup_len;
- control->oid = LM_OID_SETUP;
-
- setup->flags = LM_SETUP_INFRA;
- setup->antenna = 2;
- setup->rx_align = 0;
- setup->rx_buffer = FIRMWARE_RXBUFFER_START;
- setup->rx_mtu = FIRMWARE_MTU;
- setup->frontend = 5;
- setup->timeout = 0;
- setup->truncate = 48896;
- setup->bratemask = 0xffffffff;
- setup->ref_clock = 644245094;
- setup->lpf_bandwidth = 65535;
- setup->osc_start_delay = 65535;
-
- memcpy(setup->macaddr, stlc->mac_addr, ETH_ALEN);
- memcpy(setup->bssid, stlc->bssid, ETH_ALEN);
-
- stlc45xx_tx_frame(stlc, FIRMWARE_CONFIG_START, control, len);
-
- kfree(control);
-}
-
-static void stlc45xx_tx_scan(struct stlc45xx *stlc)
-{
- struct s_lm_control *control;
- struct s_lmo_scan *scan;
- size_t len, scan_len;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- scan_len = sizeof(*scan);
- len = sizeof(*control) + scan_len;
- control = kzalloc(len, GFP_KERNEL);
- scan = (struct s_lmo_scan *) (control + 1);
-
- control->flags = LM_FLAG_CONTROL | LM_CTRL_OPSET;
- control->length = scan_len;
- control->oid = LM_OID_SCAN;
-
- scan->flags = LM_SCAN_EXIT;
- scan->bratemask = 0x15f;
- scan->aloft[0] = 3;
- scan->aloft[1] = 3;
- scan->aloft[2] = 1;
- scan->aloft[3] = 0;
- scan->aloft[4] = 0;
- scan->aloft[5] = 0;
- scan->aloft[6] = 0;
- scan->aloft[7] = 0;
-
- memcpy(&scan->rssical, &stlc->cal_rssi[(stlc->channel - 1) *
- RSSI_CAL_LEN],
- RSSI_CAL_LEN);
- memcpy(&scan->channel, &stlc->cal_channels[(stlc->channel - 1) *
- CHANNEL_CAL_LEN],
- CHANNEL_CAL_LEN);
-
- stlc45xx_tx_frame(stlc, FIRMWARE_CONFIG_START, control, len);
-
- kfree(control);
-}
-
-/*
- * caller must hold mutex
- */
-static int stlc45xx_tx_pspoll(struct stlc45xx *stlc, bool powersave)
-{
- struct ieee80211_hdr *pspoll;
- int payload_len, padding, i;
- struct s_lm_data_out *data;
- struct txbuffer *entry;
- struct sk_buff *skb;
- char *payload;
- u16 fc;
-
- skb = dev_alloc_skb(stlc->hw->extra_tx_headroom + 16);
- if (!skb) {
- stlc45xx_warning("failed to allocate pspoll frame");
- return -ENOMEM;
- }
- skb_reserve(skb, stlc->hw->extra_tx_headroom);
-
- pspoll = (struct ieee80211_hdr *) skb_put(skb, 16);
- memset(pspoll, 0, 16);
- fc = IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL;
- if (powersave)
- fc |= IEEE80211_FCTL_PM;
- pspoll->frame_control = cpu_to_le16(fc);
- pspoll->duration_id = cpu_to_le16(stlc->aid);
-
- /* aid in PS-Poll has its two MSBs each set to 1 */
- pspoll->duration_id |= cpu_to_le16(1 << 15) | cpu_to_le16(1 << 14);
-
- memcpy(pspoll->addr1, stlc->bssid, ETH_ALEN);
- memcpy(pspoll->addr2, stlc->mac_addr, ETH_ALEN);
-
- stlc45xx_debug(DEBUG_PSM, "sending PS-Poll frame to %pM (powersave %d, "
- "fc 0x%x, aid %d)", pspoll->addr1,
- powersave, fc, stlc->aid);
-
- spin_lock_bh(&stlc->tx_lock);
-
- entry = stlc45xx_txbuffer_alloc(stlc, skb->len);
-
- spin_unlock_bh(&stlc->tx_lock);
-
- if (!entry) {
- /*
- * The queue should be stopped before the firmware buffer
- * is full, so firmware buffer should always have enough
- * space.
- *
- * But I'm too lazy and omit it for now.
- */
- if (net_ratelimit())
- stlc45xx_warning("firmware tx buffer full is full "
- "for null frame");
- return -ENOSPC;
- }
-
- payload = skb->data;
- payload_len = skb->len;
- padding = (int) (skb->data - sizeof(*data)) & 3;
- entry->header_len = sizeof(*data) + padding;
-
- entry->skb = skb;
- entry->status_needed = false;
- entry->handle = (u32) skb;
- entry->lifetime = jiffies + msecs_to_jiffies(TX_FRAME_LIFETIME);
-
- stlc45xx_debug(DEBUG_TX, "tx data 0x%x (0x%p payload %d B "
- "padding %d header_len %d)",
- entry->handle, payload, payload_len, padding,
- entry->header_len);
- stlc45xx_dump(DEBUG_TX_CONTENT, payload, payload_len);
-
- data = (struct s_lm_data_out *) skb_push(skb, entry->header_len);
-
- memset(data, 0, entry->header_len);
-
- if (padding)
- data->flags = LM_FLAG_ALIGN;
-
- data->flags = LM_OUT_BURST;
- data->length = payload_len;
- data->handle = entry->handle;
- data->aid = 1;
- data->rts_retries = 7;
- data->retries = 7;
- data->aloft_ctrl = 0;
- data->crypt_offset = 58;
- data->keytype = 0;
- data->keylen = 0;
- data->queue = LM_QUEUE_DATA3;
- data->backlog = 32;
- data->antenna = 2;
- data->cts = 3;
- data->power = 127;
-
- for (i = 0; i < 8; i++)
- data->aloft[i] = 0;
-
- /*
- * check if there's enough space in tx buffer
- *
- * FIXME: ignored for now
- */
-
- stlc45xx_tx_frame(stlc, entry->start, skb->data, skb->len);
-
- list_add(&entry->tx_list, &stlc->tx_sent);
-
- return 0;
-}
-
-/*
- * caller must hold mutex
- *
- * shamelessly stolen from mac80211/ieee80211_send_nullfunc
- */
-static int stlc45xx_tx_nullfunc(struct stlc45xx *stlc, bool powersave)
-{
- struct ieee80211_hdr *nullfunc;
- int payload_len, padding, i;
- struct s_lm_data_out *data;
- struct txbuffer *entry;
- struct sk_buff *skb;
- char *payload;
- u16 fc;
-
- skb = dev_alloc_skb(stlc->hw->extra_tx_headroom + 24);
- if (!skb) {
- stlc45xx_warning("failed to allocate buffer for null frame\n");
- return -ENOMEM;
- }
- skb_reserve(skb, stlc->hw->extra_tx_headroom);
-
- nullfunc = (struct ieee80211_hdr *) skb_put(skb, 24);
- memset(nullfunc, 0, 24);
- fc = IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC |
- IEEE80211_FCTL_TODS;
-
- if (powersave)
- fc |= IEEE80211_FCTL_PM;
-
- nullfunc->frame_control = cpu_to_le16(fc);
- memcpy(nullfunc->addr1, stlc->bssid, ETH_ALEN);
- memcpy(nullfunc->addr2, stlc->mac_addr, ETH_ALEN);
- memcpy(nullfunc->addr3, stlc->bssid, ETH_ALEN);
-
- stlc45xx_debug(DEBUG_PSM, "sending Null frame to %pM (powersave %d, "
- "fc 0x%x)", nullfunc->addr1, powersave, fc);
-
- spin_lock_bh(&stlc->tx_lock);
-
- entry = stlc45xx_txbuffer_alloc(stlc, skb->len);
-
- spin_unlock_bh(&stlc->tx_lock);
-
- if (!entry) {
- /*
- * The queue should be stopped before the firmware buffer
- * is full, so firmware buffer should always have enough
- * space.
- *
- * But I'm too lazy and omit it for now.
- */
- if (net_ratelimit())
- stlc45xx_warning("firmware tx buffer full is full "
- "for null frame");
- return -ENOSPC;
- }
-
- payload = skb->data;
- payload_len = skb->len;
- padding = (int) (skb->data - sizeof(*data)) & 3;
- entry->header_len = sizeof(*data) + padding;
-
- entry->skb = skb;
- entry->status_needed = false;
- entry->handle = (u32) skb;
- entry->lifetime = jiffies + msecs_to_jiffies(TX_FRAME_LIFETIME);
-
- stlc45xx_debug(DEBUG_TX, "tx data 0x%x (0x%p payload %d B "
- "padding %d header_len %d)",
- entry->handle, payload, payload_len, padding,
- entry->header_len);
- stlc45xx_dump(DEBUG_TX_CONTENT, payload, payload_len);
-
- data = (struct s_lm_data_out *) skb_push(skb, entry->header_len);
-
- memset(data, 0, entry->header_len);
-
- if (padding)
- data->flags = LM_FLAG_ALIGN;
-
- data->flags = LM_OUT_BURST;
- data->length = payload_len;
- data->handle = entry->handle;
- data->aid = 1;
- data->rts_retries = 7;
- data->retries = 7;
- data->aloft_ctrl = 0;
- data->crypt_offset = 58;
- data->keytype = 0;
- data->keylen = 0;
- data->queue = LM_QUEUE_DATA3;
- data->backlog = 32;
- data->antenna = 2;
- data->cts = 3;
- data->power = 127;
-
- for (i = 0; i < 8; i++)
- data->aloft[i] = 0;
-
- /*
- * check if there's enough space in tx buffer
- *
- * FIXME: ignored for now
- */
-
- stlc45xx_tx_frame(stlc, entry->start, skb->data, skb->len);
-
- list_add(&entry->tx_list, &stlc->tx_sent);
-
- return 0;
-}
-
-/* caller must hold mutex */
-static void stlc45xx_tx_psm(struct stlc45xx *stlc, bool enable)
-{
- struct s_lm_control *control;
- struct s_lmo_psm *psm;
- size_t len, psm_len;
-
- WARN_ON(!stlc->associated);
- WARN_ON(stlc->aid < 1);
- WARN_ON(stlc->aid > 2007);
-
- psm_len = sizeof(*psm);
- len = sizeof(*control) + psm_len;
- control = kzalloc(len, GFP_KERNEL);
- psm = (struct s_lmo_psm *) (control + 1);
-
- control->flags = LM_FLAG_CONTROL | LM_CTRL_OPSET;
- control->length = psm_len;
- control->oid = LM_OID_PSM;
-
- if (enable)
- psm->flags |= LM_PSM;
-
- psm->aid = stlc->aid;
-
- psm->beacon_rcpi_skip_max = 60;
-
- psm->intervals[0].interval = 1;
- psm->intervals[0].periods = 1;
- psm->intervals[1].interval = 1;
- psm->intervals[1].periods = 1;
- psm->intervals[2].interval = 1;
- psm->intervals[2].periods = 1;
- psm->intervals[3].interval = 1;
- psm->intervals[3].periods = 1;
-
- psm->nr = 0;
- psm->exclude[0] = 0;
-
- stlc45xx_debug(DEBUG_PSM, "sending LM_OID_PSM (aid %d, interval %d)",
- psm->aid, psm->intervals[0].interval);
-
- stlc45xx_tx_frame(stlc, FIRMWARE_CONFIG_START, control, len);
-
- kfree(control);
-}
-
-static int stlc45xx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
-{
- struct stlc45xx *stlc = hw->priv;
- struct ieee80211_tx_info *info;
- struct ieee80211_rate *rate;
- int payload_len, padding, i;
- struct s_lm_data_out *data;
- struct txbuffer *entry;
- char *payload;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- spin_lock_bh(&stlc->tx_lock);
-
- entry = stlc45xx_txbuffer_alloc(stlc, skb->len);
- if (!entry) {
- /* the queue should be stopped before the firmware buffer
- * is full, so firmware buffer should always have enough
- * space */
- if (net_ratelimit())
- stlc45xx_warning("firmware buffer full");
- spin_unlock_bh(&stlc->tx_lock);
- return NETDEV_TX_BUSY;
- }
-
- info = IEEE80211_SKB_CB(skb);
-
- payload = skb->data;
- payload_len = skb->len;
- padding = (int) (skb->data - sizeof(*data)) & 3;
- entry->header_len = sizeof(*data) + padding;
-
- entry->skb = skb;
- entry->status_needed = true;
- entry->handle = (u32) skb;
- entry->lifetime = jiffies + msecs_to_jiffies(TX_FRAME_LIFETIME);
-
- stlc45xx_debug(DEBUG_TX, "tx data 0x%x (0x%p payload %d B "
- "padding %d header_len %d)",
- entry->handle, payload, payload_len, padding,
- entry->header_len);
- stlc45xx_dump(DEBUG_TX_CONTENT, payload, payload_len);
-
- data = (struct s_lm_data_out *) skb_push(skb, entry->header_len);
-
- memset(data, 0, entry->header_len);
-
- if (padding)
- data->flags = LM_FLAG_ALIGN;
-
- data->flags = LM_OUT_BURST;
- data->length = payload_len;
- data->handle = entry->handle;
- data->aid = 1;
- data->rts_retries = 7;
- data->retries = 7;
- data->aloft_ctrl = 0;
- data->crypt_offset = 58;
- data->keytype = 0;
- data->keylen = 0;
- data->queue = 2;
- data->backlog = 32;
- data->antenna = 2;
- data->cts = 3;
- data->power = 127;
-
- for (i = 0; i < 8; i++) {
- rate = ieee80211_get_tx_rate(stlc->hw, info);
- data->aloft[i] = rate->hw_value;
- }
-
- list_add_tail(&entry->tx_list, &stlc->tx_pending);
-
- /* check if there's enough space in tx buffer */
- if (stlc45xx_txbuffer_find(stlc, MAX_FRAME_LEN) == -1) {
- stlc45xx_debug(DEBUG_QUEUE, "tx buffer full, stopping queues");
- stlc->tx_queue_stopped = 1;
- ieee80211_stop_queues(stlc->hw);
- }
-
- queue_work(stlc->hw->workqueue, &stlc->work);
-
- spin_unlock_bh(&stlc->tx_lock);
-
- return NETDEV_TX_OK;
-}
-
-static int stlc45xx_op_start(struct ieee80211_hw *hw)
-{
- struct stlc45xx *stlc = hw->priv;
- unsigned long timeout;
- int ret = 0;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- stlc->fw_state = FW_STATE_BOOTING;
- stlc->channel = 1;
-
- stlc45xx_power_on(stlc);
-
- ret = stlc45xx_upload_firmware(stlc);
- if (ret < 0) {
- stlc45xx_power_off(stlc);
- goto out_unlock;
- }
-
- stlc->tx_queue_stopped = 0;
-
- mutex_unlock(&stlc->mutex);
-
- timeout = msecs_to_jiffies(2000);
- timeout = wait_for_completion_interruptible_timeout(&stlc->fw_comp,
- timeout);
- if (!timeout) {
- stlc45xx_error("firmware boot failed");
- stlc45xx_power_off(stlc);
- ret = -1;
- goto out;
- }
-
- stlc45xx_debug(DEBUG_BOOT, "firmware booted");
-
- /* FIXME: should we take mutex just after wait_for_completion()? */
- mutex_lock(&stlc->mutex);
-
- WARN_ON(stlc->fw_state != FW_STATE_READY);
-
-out_unlock:
- mutex_unlock(&stlc->mutex);
-
-out:
- return ret;
-}
-
-static void stlc45xx_op_stop(struct ieee80211_hw *hw)
-{
- struct stlc45xx *stlc = hw->priv;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- WARN_ON(stlc->fw_state != FW_STATE_READY);
-
- stlc45xx_power_off(stlc);
-
- /* FIXME: make sure that all work_structs have completed */
-
- spin_lock_bh(&stlc->tx_lock);
- stlc45xx_flush_queues(stlc);
- spin_unlock_bh(&stlc->tx_lock);
-
- stlc->fw_state = FW_STATE_OFF;
-
- mutex_unlock(&stlc->mutex);
-}
-
-static int stlc45xx_op_add_interface(struct ieee80211_hw *hw,
- struct ieee80211_if_init_conf *conf)
-{
- struct stlc45xx *stlc = hw->priv;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- switch (conf->type) {
- case NL80211_IFTYPE_STATION:
- break;
- default:
- return -EOPNOTSUPP;
- }
-
- memcpy(stlc->mac_addr, conf->mac_addr, ETH_ALEN);
-
- return 0;
-}
-
-static void stlc45xx_op_remove_interface(struct ieee80211_hw *hw,
- struct ieee80211_if_init_conf *conf)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-}
-
-static int stlc45xx_op_config(struct ieee80211_hw *hw, u32 changed)
-{
- struct stlc45xx *stlc = hw->priv;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- mutex_lock(&stlc->mutex);
-
- stlc->channel = hw->conf.channel->hw_value;
- stlc45xx_tx_scan(stlc);
- stlc45xx_tx_setup(stlc);
- stlc45xx_tx_edcf(stlc);
-
- if ((hw->conf.flags & IEEE80211_CONF_PS) != stlc->psm) {
- stlc->psm = hw->conf.flags & IEEE80211_CONF_PS;
- if (stlc->associated) {
- stlc45xx_tx_psm(stlc, stlc->psm);
- stlc45xx_tx_nullfunc(stlc, stlc->psm);
- }
- }
-
- mutex_unlock(&stlc->mutex);
-
- return 0;
-}
-
-static void stlc45xx_op_configure_filter(struct ieee80211_hw *hw,
- unsigned int changed_flags,
- unsigned int *total_flags,
- int mc_count,
- struct dev_addr_list *mc_list)
-{
- *total_flags = 0;
-}
-
-static void stlc45xx_op_bss_info_changed(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
- struct ieee80211_bss_conf *info,
- u32 changed)
-{
- struct stlc45xx *stlc = hw->priv;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
- mutex_lock(&stlc->mutex);
-
- memcpy(stlc->bssid, info->bssid, ETH_ALEN);
- stlc45xx_tx_setup(stlc);
-
- mutex_unlock(&stlc->mutex);
-
- if (changed & BSS_CHANGED_ASSOC) {
- stlc->associated = info->assoc;
- if (info->assoc)
- stlc->aid = info->aid;
- else
- stlc->aid = -1;
-
- if (stlc->psm) {
- stlc45xx_tx_psm(stlc, stlc->psm);
- stlc45xx_tx_nullfunc(stlc, stlc->psm);
- }
- }
-}
-
-
-/* can't be const, mac80211 writes to this */
-static struct ieee80211_rate stlc45xx_rates[] = {
- { .bitrate = 10, .hw_value = 0, .hw_value_short = 0, },
- { .bitrate = 20, .hw_value = 1, .hw_value_short = 1, },
- { .bitrate = 55, .hw_value = 2, .hw_value_short = 2, },
- { .bitrate = 110, .hw_value = 3, .hw_value_short = 3, },
- { .bitrate = 60, .hw_value = 4, .hw_value_short = 4, },
- { .bitrate = 90, .hw_value = 5, .hw_value_short = 5, },
- { .bitrate = 120, .hw_value = 6, .hw_value_short = 6, },
- { .bitrate = 180, .hw_value = 7, .hw_value_short = 7, },
- { .bitrate = 240, .hw_value = 8, .hw_value_short = 8, },
- { .bitrate = 360, .hw_value = 9, .hw_value_short = 9, },
- { .bitrate = 480, .hw_value = 10, .hw_value_short = 10, },
- { .bitrate = 540, .hw_value = 11, .hw_value_short = 11, },
-};
-
-/* can't be const, mac80211 writes to this */
-static struct ieee80211_channel stlc45xx_channels[] = {
- { .hw_value = 1, .center_freq = 2412},
- { .hw_value = 2, .center_freq = 2417},
- { .hw_value = 3, .center_freq = 2422},
- { .hw_value = 4, .center_freq = 2427},
- { .hw_value = 5, .center_freq = 2432},
- { .hw_value = 6, .center_freq = 2437},
- { .hw_value = 7, .center_freq = 2442},
- { .hw_value = 8, .center_freq = 2447},
- { .hw_value = 9, .center_freq = 2452},
- { .hw_value = 10, .center_freq = 2457},
- { .hw_value = 11, .center_freq = 2462},
- { .hw_value = 12, .center_freq = 2467},
- { .hw_value = 13, .center_freq = 2472},
-};
-
-/* can't be const, mac80211 writes to this */
-static struct ieee80211_supported_band stlc45xx_band_2ghz = {
- .channels = stlc45xx_channels,
- .n_channels = ARRAY_SIZE(stlc45xx_channels),
- .bitrates = stlc45xx_rates,
- .n_bitrates = ARRAY_SIZE(stlc45xx_rates),
-};
-
-static const struct ieee80211_ops stlc45xx_ops = {
- .start = stlc45xx_op_start,
- .stop = stlc45xx_op_stop,
- .add_interface = stlc45xx_op_add_interface,
- .remove_interface = stlc45xx_op_remove_interface,
- .config = stlc45xx_op_config,
- .configure_filter = stlc45xx_op_configure_filter,
- .tx = stlc45xx_op_tx,
- .bss_info_changed = stlc45xx_op_bss_info_changed,
-};
-
-static int stlc45xx_register_mac80211(struct stlc45xx *stlc)
-{
- /* FIXME: SET_IEEE80211_PERM_ADDR() requires default_mac_addr
- to be non-const for some strange reason */
- static u8 default_mac_addr[ETH_ALEN] = {
- 0x00, 0x02, 0xee, 0xc0, 0xff, 0xee
- };
- int ret;
-
- SET_IEEE80211_PERM_ADDR(stlc->hw, default_mac_addr);
-
- ret = ieee80211_register_hw(stlc->hw);
- if (ret) {
- stlc45xx_error("unable to register mac80211 hw: %d", ret);
- return ret;
- }
-
- return 0;
-}
-
-static void stlc45xx_device_release(struct device *dev)
-{
-
-}
-
-static struct platform_device stlc45xx_device = {
- .name = "stlc45xx",
- .id = -1,
-
- /* device model insists to have a release function */
- .dev = {
- .release = stlc45xx_device_release,
- },
-};
-
-static int __devinit stlc45xx_probe(struct spi_device *spi)
-{
- struct stlc45xx *stlc;
- struct ieee80211_hw *hw;
- int ret;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- /* mac80211 alloc */
- hw = ieee80211_alloc_hw(sizeof(*stlc), &stlc45xx_ops);
- if (!hw) {
- stlc45xx_error("could not alloc ieee80211_hw");
- ret = -ENOMEM;
- goto out;
- }
-
- /* mac80211 clears hw->priv */
- stlc = hw->priv;
-
- stlc->hw = hw;
- dev_set_drvdata(&spi->dev, stlc);
- stlc->spi = spi;
-
- spi->bits_per_word = 16;
- spi->max_speed_hz = 24000000;
-
- ret = spi_setup(spi);
- if (ret < 0)
- stlc45xx_error("spi_setup failed");
-
- ret = gpio_request(stlc45xx_gpio_power, "stlc45xx power");
- if (ret < 0) {
- stlc45xx_error("power GPIO request failed: %d", ret);
- return ret;
- }
-
- ret = gpio_request(stlc45xx_gpio_irq, "stlc45xx irq");
- if (ret < 0) {
- stlc45xx_error("irq GPIO request failed: %d", ret);
- goto out;
- }
-
- gpio_direction_output(stlc45xx_gpio_power, 0);
- gpio_direction_input(stlc45xx_gpio_irq);
-
- ret = request_irq(gpio_to_irq(stlc45xx_gpio_irq),
- stlc45xx_interrupt, IRQF_DISABLED, "stlc45xx",
- stlc->spi);
- if (ret < 0)
- /* FIXME: handle the error */
- stlc45xx_error("request_irq() failed");
-
- set_irq_type(gpio_to_irq(stlc45xx_gpio_irq),
- IRQ_TYPE_EDGE_RISING);
-
- disable_irq(gpio_to_irq(stlc45xx_gpio_irq));
-
- ret = platform_device_register(&stlc45xx_device);
- if (ret) {
- stlc45xx_error("Couldn't register wlan_omap device.");
- return ret;
- }
- dev_set_drvdata(&stlc45xx_device.dev, stlc);
-
- INIT_WORK(&stlc->work, stlc45xx_work);
- INIT_WORK(&stlc->work_reset, stlc45xx_work_reset);
- INIT_DELAYED_WORK(&stlc->work_tx_timeout, stlc45xx_work_tx_timeout);
- mutex_init(&stlc->mutex);
- init_completion(&stlc->fw_comp);
- spin_lock_init(&stlc->tx_lock);
- INIT_LIST_HEAD(&stlc->txbuffer);
- INIT_LIST_HEAD(&stlc->tx_pending);
- INIT_LIST_HEAD(&stlc->tx_sent);
-
- hw->flags = IEEE80211_HW_RX_INCLUDES_FCS |
- IEEE80211_HW_SIGNAL_DBM |
- IEEE80211_HW_NOISE_DBM;
- /* four bytes for padding */
- hw->extra_tx_headroom = sizeof(struct s_lm_data_out) + 4;
-
- /* unit us */
- hw->channel_change_time = 1000;
-
- hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION);
- hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &stlc45xx_band_2ghz;
-
- SET_IEEE80211_DEV(hw, &spi->dev);
-
- BUILD_BUG_ON(sizeof(default_cal_rssi) != RSSI_CAL_ARRAY_LEN);
- BUILD_BUG_ON(sizeof(default_cal_channels) != CHANNEL_CAL_ARRAY_LEN);
-
- stlc->cal_rssi = kmemdup(default_cal_rssi, RSSI_CAL_ARRAY_LEN,
- GFP_KERNEL);
- stlc->cal_channels = kmemdup(default_cal_channels,
- CHANNEL_CAL_ARRAY_LEN,
- GFP_KERNEL);
-
- ret = device_create_file(&stlc45xx_device.dev, &dev_attr_cal_rssi);
- if (ret < 0) {
- stlc45xx_error("failed to create sysfs file cal_rssi");
- goto out;
- }
-
- ret = device_create_file(&stlc45xx_device.dev, &dev_attr_cal_channels);
- if (ret < 0) {
- stlc45xx_error("failed to create sysfs file cal_channels");
- goto out;
- }
-
- ret = device_create_file(&stlc45xx_device.dev, &dev_attr_tx_buf);
- if (ret < 0) {
- stlc45xx_error("failed to create sysfs file tx_buf");
- goto out;
- }
-
- ret = stlc45xx_register_mac80211(stlc);
- if (ret < 0)
- goto out;
-
- stlc45xx_info("v" DRIVER_VERSION " loaded");
-
- stlc45xx_info("config buffer 0x%x-0x%x",
- FIRMWARE_CONFIG_START, FIRMWARE_CONFIG_END);
- stlc45xx_info("tx 0x%x-0x%x, rx 0x%x-0x%x",
- FIRMWARE_TXBUFFER_START, FIRMWARE_TXBUFFER_END,
- FIRMWARE_RXBUFFER_START, FIRMWARE_RXBUFFER_END);
-
-out:
- return ret;
-}
-
-static int __devexit stlc45xx_remove(struct spi_device *spi)
-{
- struct stlc45xx *stlc = dev_get_drvdata(&spi->dev);
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- platform_device_unregister(&stlc45xx_device);
-
- ieee80211_unregister_hw(stlc->hw);
-
- free_irq(gpio_to_irq(stlc45xx_gpio_irq), spi);
-
- gpio_free(stlc45xx_gpio_power);
- gpio_free(stlc45xx_gpio_irq);
-
- /* FIXME: free cal_channels and cal_rssi? */
-
- kfree(stlc->fw);
-
- mutex_destroy(&stlc->mutex);
-
- /* frees also stlc */
- ieee80211_free_hw(stlc->hw);
- stlc = NULL;
-
- return 0;
-}
-
-
-static struct spi_driver stlc45xx_spi_driver = {
- .driver = {
- /* use cx3110x name because board-n800.c uses that for the
- * SPI port */
- .name = "cx3110x",
- .bus = &spi_bus_type,
- .owner = THIS_MODULE,
- },
-
- .probe = stlc45xx_probe,
- .remove = __devexit_p(stlc45xx_remove),
-};
-
-static int __init stlc45xx_init(void)
-{
- int ret;
-
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- ret = spi_register_driver(&stlc45xx_spi_driver);
- if (ret < 0) {
- stlc45xx_error("failed to register SPI driver: %d", ret);
- goto out;
- }
-
-out:
- return ret;
-}
-
-static void __exit stlc45xx_exit(void)
-{
- stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
-
- spi_unregister_driver(&stlc45xx_spi_driver);
-
- stlc45xx_info("unloaded");
-}
-
-module_init(stlc45xx_init);
-module_exit(stlc45xx_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_AUTHOR("Kalle Valo <kalle.valo@nokia.com>");
-MODULE_ALIAS("spi:cx3110x");
diff --git a/drivers/staging/stlc45xx/stlc45xx.h b/drivers/staging/stlc45xx/stlc45xx.h
deleted file mode 100644
index ac96bbbde79f..000000000000
--- a/drivers/staging/stlc45xx/stlc45xx.h
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- * This file is part of stlc45xx
- *
- * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies).
- *
- * Contact: Kalle Valo <kalle.valo@nokia.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA
- *
- */
-
-#include <linux/mutex.h>
-#include <linux/list.h>
-#include <net/mac80211.h>
-
-#include "stlc45xx_lmac.h"
-
-#define DRIVER_NAME "stlc45xx"
-#define DRIVER_VERSION "0.1.3"
-
-#define DRIVER_PREFIX DRIVER_NAME ": "
-
-enum {
- DEBUG_NONE = 0,
- DEBUG_FUNC = 1 << 0,
- DEBUG_IRQ = 1 << 1,
- DEBUG_BH = 1 << 2,
- DEBUG_RX = 1 << 3,
- DEBUG_RX_CONTENT = 1 << 5,
- DEBUG_TX = 1 << 6,
- DEBUG_TX_CONTENT = 1 << 8,
- DEBUG_TXBUFFER = 1 << 9,
- DEBUG_QUEUE = 1 << 10,
- DEBUG_BOOT = 1 << 11,
- DEBUG_PSM = 1 << 12,
- DEBUG_ALL = ~0,
-};
-
-#define DEBUG_LEVEL DEBUG_NONE
-/* #define DEBUG_LEVEL DEBUG_ALL */
-/* #define DEBUG_LEVEL (DEBUG_TX | DEBUG_RX | DEBUG_IRQ) */
-/* #define DEBUG_LEVEL (DEBUG_TX | DEBUG_MEMREGION | DEBUG_QUEUE) */
-/* #define DEBUG_LEVEL (DEBUG_MEMREGION | DEBUG_QUEUE) */
-
-#define stlc45xx_error(fmt, arg...) \
- printk(KERN_ERR DRIVER_PREFIX "ERROR " fmt "\n", ##arg)
-
-#define stlc45xx_warning(fmt, arg...) \
- printk(KERN_WARNING DRIVER_PREFIX "WARNING " fmt "\n", ##arg)
-
-#define stlc45xx_info(fmt, arg...) \
- printk(KERN_INFO DRIVER_PREFIX fmt "\n", ##arg)
-
-#define stlc45xx_debug(level, fmt, arg...) \
- do { \
- if (level & DEBUG_LEVEL) \
- printk(KERN_DEBUG DRIVER_PREFIX fmt "\n", ##arg); \
- } while (0)
-
-#define stlc45xx_dump(level, buf, len) \
- do { \
- if (level & DEBUG_LEVEL) \
- print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, \
- 16, 1, buf, len, 1); \
- } while (0)
-
-#define MAC2STR(a) ((a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5])
-#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x"
-
-/* Bit 15 is read/write bit; ON = READ, OFF = WRITE */
-#define ADDR_READ_BIT_15 0x8000
-
-#define SPI_ADRS_ARM_INTERRUPTS 0x00
-#define SPI_ADRS_ARM_INT_EN 0x04
-
-#define SPI_ADRS_HOST_INTERRUPTS 0x08
-#define SPI_ADRS_HOST_INT_EN 0x0c
-#define SPI_ADRS_HOST_INT_ACK 0x10
-
-#define SPI_ADRS_GEN_PURP_1 0x14
-#define SPI_ADRS_GEN_PURP_2 0x18
-
-/* high word */
-#define SPI_ADRS_DEV_CTRL_STAT 0x26
-
-#define SPI_ADRS_DMA_DATA 0x28
-
-#define SPI_ADRS_DMA_WRITE_CTRL 0x2c
-#define SPI_ADRS_DMA_WRITE_LEN 0x2e
-#define SPI_ADRS_DMA_WRITE_BASE 0x30
-
-#define SPI_ADRS_DMA_READ_CTRL 0x34
-#define SPI_ADRS_DMA_READ_LEN 0x36
-#define SPI_ADRS_DMA_READ_BASE 0x38
-
-#define SPI_CTRL_STAT_HOST_OVERRIDE 0x8000
-#define SPI_CTRL_STAT_START_HALTED 0x4000
-#define SPI_CTRL_STAT_RAM_BOOT 0x2000
-#define SPI_CTRL_STAT_HOST_RESET 0x1000
-#define SPI_CTRL_STAT_HOST_CPU_EN 0x0800
-
-#define SPI_DMA_WRITE_CTRL_ENABLE 0x0001
-#define SPI_DMA_READ_CTRL_ENABLE 0x0001
-#define HOST_ALLOWED (1 << 7)
-
-#define FIRMWARE_ADDRESS 0x20000
-
-#define SPI_TIMEOUT 100 /* msec */
-
-#define SPI_MAX_TX_PACKETS 32
-
-#define SPI_MAX_PACKET_SIZE 32767
-
-#define SPI_TARGET_INT_WAKEUP 0x00000001
-#define SPI_TARGET_INT_SLEEP 0x00000002
-#define SPI_TARGET_INT_RDDONE 0x00000004
-
-#define SPI_TARGET_INT_CTS 0x00004000
-#define SPI_TARGET_INT_DR 0x00008000
-
-#define SPI_HOST_INT_READY 0x00000001
-#define SPI_HOST_INT_WR_READY 0x00000002
-#define SPI_HOST_INT_SW_UPDATE 0x00000004
-#define SPI_HOST_INT_UPDATE 0x10000000
-
-/* clear to send */
-#define SPI_HOST_INT_CTS 0x00004000
-
-/* data ready */
-#define SPI_HOST_INT_DR 0x00008000
-
-#define SPI_HOST_INTS_DEFAULT \
- (SPI_HOST_INT_READY | SPI_HOST_INT_UPDATE | SPI_HOST_INT_SW_UPDATE)
-
-#define TARGET_BOOT_SLEEP 50
-
-/* The firmware buffer is divided into three areas:
- *
- * o config area (for control commands)
- * o tx buffer
- * o rx buffer
- */
-#define FIRMWARE_BUFFER_START 0x20200
-#define FIRMWARE_BUFFER_END 0x27c60
-#define FIRMWARE_BUFFER_LEN (FIRMWARE_BUFFER_END - FIRMWARE_BUFFER_START)
-#define FIRMWARE_MTU 3240
-#define FIRMWARE_CONFIG_PAYLOAD_LEN 1024
-#define FIRMWARE_CONFIG_START FIRMWARE_BUFFER_START
-#define FIRMWARE_CONFIG_LEN (sizeof(struct s_lm_control) + \
- FIRMWARE_CONFIG_PAYLOAD_LEN)
-#define FIRMWARE_CONFIG_END (FIRMWARE_CONFIG_START + FIRMWARE_CONFIG_LEN - 1)
-#define FIRMWARE_RXBUFFER_LEN (5 * FIRMWARE_MTU + 1024)
-#define FIRMWARE_RXBUFFER_START (FIRMWARE_BUFFER_END - FIRMWARE_RXBUFFER_LEN)
-#define FIRMWARE_RXBUFFER_END (FIRMWARE_RXBUFFER_START + \
- FIRMWARE_RXBUFFER_LEN - 1)
-#define FIRMWARE_TXBUFFER_START (FIRMWARE_BUFFER_START + FIRMWARE_CONFIG_LEN)
-#define FIRMWARE_TXBUFFER_LEN (FIRMWARE_BUFFER_LEN - FIRMWARE_CONFIG_LEN - \
- FIRMWARE_RXBUFFER_LEN)
-#define FIRMWARE_TXBUFFER_END (FIRMWARE_TXBUFFER_START + \
- FIRMWARE_TXBUFFER_LEN - 1)
-
-#define FIRMWARE_TXBUFFER_HEADER 100
-#define FIRMWARE_TXBUFFER_TRAILER 4
-
-/* FIXME: come up with a proper value */
-#define MAX_FRAME_LEN 2500
-
-/* unit is ms */
-#define TX_FRAME_LIFETIME 2000
-#define TX_TIMEOUT 4000
-
-#define SUPPORTED_CHANNELS 13
-
-/* FIXME */
-/* #define CHANNEL_CAL_LEN offsetof(struct s_lmo_scan, bratemask) - \ */
-/* offsetof(struct s_lmo_scan, channel) */
-#define CHANNEL_CAL_LEN 292
-#define CHANNEL_CAL_ARRAY_LEN (SUPPORTED_CHANNELS * CHANNEL_CAL_LEN)
-/* FIXME */
-/* #define RSSI_CAL_LEN sizeof(struct s_lmo_scan) - \ */
-/* offsetof(struct s_lmo_scan, rssical) */
-#define RSSI_CAL_LEN 8
-#define RSSI_CAL_ARRAY_LEN (SUPPORTED_CHANNELS * RSSI_CAL_LEN)
-
-struct s_dma_regs {
- unsigned short cmd;
- unsigned short len;
- unsigned long addr;
-};
-
-struct stlc45xx_ie_tim {
- u8 dtim_count;
- u8 dtim_period;
- u8 bmap_control;
- u8 pvbmap[251];
-};
-
-struct txbuffer {
- /* can be removed when switched to skb queue */
- struct list_head tx_list;
-
- struct list_head buffer_list;
-
- int start;
- int frame_start;
- int end;
-
- struct sk_buff *skb;
- u32 handle;
-
- bool status_needed;
-
- int header_len;
-
- /* unit jiffies */
- unsigned long lifetime;
-};
-
-enum fw_state {
- FW_STATE_OFF,
- FW_STATE_BOOTING,
- FW_STATE_READY,
- FW_STATE_RESET,
- FW_STATE_RESETTING,
-};
-
-struct stlc45xx {
- struct ieee80211_hw *hw;
- struct spi_device *spi;
- struct work_struct work;
- struct work_struct work_reset;
- struct delayed_work work_tx_timeout;
- struct mutex mutex;
- struct completion fw_comp;
-
-
- u8 bssid[ETH_ALEN];
- u8 mac_addr[ETH_ALEN];
- int channel;
-
- u8 *cal_rssi;
- u8 *cal_channels;
-
- enum fw_state fw_state;
-
- spinlock_t tx_lock;
-
- /* protected by tx_lock */
- struct list_head txbuffer;
-
- /* protected by tx_lock */
- struct list_head tx_pending;
-
- /* protected by tx_lock */
- int tx_queue_stopped;
-
- /* protected by mutex */
- struct list_head tx_sent;
-
- int tx_frames;
-
- u8 *fw;
- int fw_len;
-
- bool psm;
- bool associated;
- int aid;
- bool pspolling;
-};
-
-
diff --git a/drivers/staging/stlc45xx/stlc45xx_lmac.h b/drivers/staging/stlc45xx/stlc45xx_lmac.h
deleted file mode 100644
index af5db801347f..000000000000
--- a/drivers/staging/stlc45xx/stlc45xx_lmac.h
+++ /dev/null
@@ -1,434 +0,0 @@
-/************************************************************************
-* This is the LMAC API interface header file for STLC4560. *
-* Copyright (C) 2007 Conexant Systems, Inc. *
-* This program is free software; you can redistribute it and/or *
-* modify it under the terms of the GNU General Public License *
-* as published by the Free Software Foundation; either version 2 *
-* of the License, or (at your option) any later version. *
-* *
-* This program is distributed in the hope that it will be useful, *
-* but WITHOUT ANY WARRANTY; without even the implied warranty of *
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
-* GNU General Public License for more details. *
-* *
-* You should have received a copy of the GNU General Public License *
-* along with this program. If not, see <http://www.gnu.org/licenses/>.*
-*************************************************************************/
-
-#ifndef __lmac_h__
-#define __lmac_h__
-
-#define LM_TOP_VARIANT 0x0506
-#define LM_BOTTOM_VARIANT 0x0506
-
-/*
- * LMAC - UMAC interface definition:
- */
-
-#define LM_FLAG_CONTROL 0x8000
-#define LM_FLAG_ALIGN 0x4000
-
-#define LM_CTRL_OPSET 0x0001
-
-#define LM_OUT_PROMISC 0x0001
-#define LM_OUT_TIMESTAMP 0x0002
-#define LM_OUT_SEQNR 0x0004
-#define LM_OUT_BURST 0x0010
-#define LM_OUT_NOCANCEL 0x0020
-#define LM_OUT_CLEARTIM 0x0040
-#define LM_OUT_HITCHHIKE 0x0080
-#define LM_OUT_COMPRESS 0x0100
-#define LM_OUT_CONCAT 0x0200
-#define LM_OUT_PCS_ACCEPT 0x0400
-#define LM_OUT_WAITEOSP 0x0800
-
-
-#define LM_ALOFT_SP 0x10
-#define LM_ALOFT_CTS 0x20
-#define LM_ALOFT_RTS 0x40
-#define LM_ALOFT_MASK 0x1f
-#define LM_ALOFT_RATE 0x0f
-
-#define LM_IN_FCS_GOOD 0x0001
-#define LM_IN_MATCH_MAC 0x0002
-#define LM_IN_MCBC 0x0004
-#define LM_IN_BEACON 0x0008
-#define LM_IN_MATCH_BSS 0x0010
-#define LM_IN_BCAST_BSS 0x0020
-#define LM_IN_DATA 0x0040
-#define LM_IN_TRUNCATED 0x0080
-
-#define LM_IN_TRANSPARENT 0x0200
-
-#define LM_QUEUE_BEACON 0
-#define LM_QUEUE_SCAN 1
-#define LM_QUEUE_MGT 2
-#define LM_QUEUE_MCBC 3
-#define LM_QUEUE_DATA 4
-#define LM_QUEUE_DATA0 4
-#define LM_QUEUE_DATA1 5
-#define LM_QUEUE_DATA2 6
-#define LM_QUEUE_DATA3 7
-
-#define LM_SETUP_INFRA 0x0001
-#define LM_SETUP_IBSS 0x0002
-#define LM_SETUP_TRANSPARENT 0x0008
-#define LM_SETUP_PROMISCUOUS 0x0010
-#define LM_SETUP_HIBERNATE 0x0020
-#define LM_SETUP_NOACK 0x0040
-#define LM_SETUP_RX_DISABLED 0x0080
-
-#define LM_ANTENNA_0 0
-#define LM_ANTENNA_1 1
-#define LM_ANTENNA_DIVERSITY 2
-
-#define LM_TX_FAILED 0x0001
-#define LM_TX_PSM 0x0002
-#define LM_TX_PSM_CANCELLED 0x0004
-
-#define LM_SCAN_EXIT 0x0001
-#define LM_SCAN_TRAP 0x0002
-#define LM_SCAN_ACTIVE 0x0004
-#define LM_SCAN_FILTER 0x0008
-
-#define LM_PSM 0x0001
-#define LM_PSM_DTIM 0x0002
-#define LM_PSM_MCBC 0x0004
-#define LM_PSM_CHECKSUM 0x0008
-#define LM_PSM_SKIP_MORE_DATA 0x0010
-#define LM_PSM_BEACON_TIMEOUT 0x0020
-#define LM_PSM_HFOSLEEP 0x0040
-#define LM_PSM_AUTOSWITCH_SLEEP 0x0080
-#define LM_PSM_LPIT 0x0100
-#define LM_PSM_BF_UCAST_SKIP 0x0200
-#define LM_PSM_BF_MCAST_SKIP 0x0400
-
-/* hfosleep */
-#define LM_PSM_SLEEP_OPTION_MASK (LM_PSM_AUTOSWITCH_SLEEP | LM_PSM_HFOSLEEP)
-#define LM_PSM_SLEEP_OPTION_SHIFT 6
-/* hfosleepend */
-#define LM_PSM_BF_OPTION_MASK (LM_PSM_BF_MCAST_SKIP | LM_PSM_BF_UCAST_SKIP)
-#define LM_PSM_BF_OPTION_SHIFT 9
-
-
-#define LM_PRIVACC_WEP 0x01
-#define LM_PRIVACC_TKIP 0x02
-#define LM_PRIVACC_MICHAEL 0x04
-#define LM_PRIVACC_CCX_KP 0x08
-#define LM_PRIVACC_CCX_MIC 0x10
-#define LM_PRIVACC_AES_CCMP 0x20
-
-/* size of s_lm_descr in words */
-#define LM_DESCR_SIZE_WORDS 11
-
-#ifndef __ASSEMBLER__
-
-enum {
- LM_MODE_CLIENT = 0,
- LM_MODE_AP
-};
-
-struct s_lm_descr {
- uint16_t modes;
- uint16_t flags;
- uint32_t buffer_start;
- uint32_t buffer_end;
- uint8_t header;
- uint8_t trailer;
- uint8_t tx_queues;
- uint8_t tx_depth;
- uint8_t privacy;
- uint8_t rx_keycache;
- uint8_t tim_size;
- uint8_t pad1;
- uint8_t rates[16];
- uint32_t link;
- uint16_t mtu;
-};
-
-
-struct s_lm_control {
- uint16_t flags;
- uint16_t length;
- uint32_t handle;
- uint16_t oid;
- uint16_t pad;
- /* uint8_t data[]; */
-};
-
-enum {
- LM_PRIV_NONE = 0,
- LM_PRIV_WEP,
- LM_PRIV_TKIP,
- LM_PRIV_TKIPMICHAEL,
- LM_PRIV_CCX_WEPMIC,
- LM_PRIV_CCX_KPMIC,
- LM_PRIV_CCX_KP,
- LM_PRIV_AES_CCMP
-};
-
-enum {
- LM_DECRYPT_NONE,
- LM_DECRYPT_OK,
- LM_DECRYPT_NOKEY,
- LM_DECRYPT_NOMICHAEL,
- LM_DECRYPT_NOCKIPMIC,
- LM_DECRYPT_FAIL_WEP,
- LM_DECRYPT_FAIL_TKIP,
- LM_DECRYPT_FAIL_MICHAEL,
- LM_DECRYPT_FAIL_CKIPKP,
- LM_DECRYPT_FAIL_CKIPMIC,
- LM_DECRYPT_FAIL_AESCCMP
-};
-
-struct s_lm_data_out {
- uint16_t flags;
- uint16_t length;
- uint32_t handle;
- uint16_t aid;
- uint8_t rts_retries;
- uint8_t retries;
- uint8_t aloft[8];
- uint8_t aloft_ctrl;
- uint8_t crypt_offset;
- uint8_t keytype;
- uint8_t keylen;
- uint8_t key[16];
- uint8_t queue;
- uint8_t backlog;
- uint16_t durations[4];
- uint8_t antenna;
- uint8_t cts;
- int16_t power;
- uint8_t pad[2];
- /*uint8_t data[];*/
-};
-
-#define LM_RCPI_INVALID (0xff)
-
-struct s_lm_data_in {
- uint16_t flags;
- uint16_t length;
- uint16_t frequency;
- uint8_t antenna;
- uint8_t rate;
- uint8_t rcpi;
- uint8_t sq;
- uint8_t decrypt;
- uint8_t rssi_raw;
- uint32_t clock[2];
- /*uint8_t data[];*/
-};
-
-union u_lm_data {
- struct s_lm_data_out out;
- struct s_lm_data_in in;
-};
-
-enum {
- LM_OID_SETUP = 0,
- LM_OID_SCAN = 1,
- LM_OID_TRAP = 2,
- LM_OID_EDCF = 3,
- LM_OID_KEYCACHE = 4,
- LM_OID_PSM = 6,
- LM_OID_TXCANCEL = 7,
- LM_OID_TX = 8,
- LM_OID_BURST = 9,
- LM_OID_STATS = 10,
- LM_OID_LED = 13,
- LM_OID_TIMER = 15,
- LM_OID_NAV = 20,
- LM_OID_PCS = 22,
- LM_OID_BT_BALANCER = 28,
- LM_OID_GROUP_ADDRESS_TABLE = 30,
- LM_OID_ARPTABLE = 31,
- LM_OID_BT_OPTIONS = 35
-};
-
-enum {
- LM_FRONTEND_UNKNOWN = 0,
- LM_FRONTEND_DUETTE3,
- LM_FRONTEND_DUETTE2,
- LM_FRONTEND_FRISBEE,
- LM_FRONTEND_CROSSBOW,
- LM_FRONTEND_LONGBOW
-};
-
-
-#define INVALID_LPF_BANDWIDTH 0xffff
-#define INVALID_OSC_START_DELAY 0xffff
-
-struct s_lmo_setup {
- uint16_t flags;
- uint8_t macaddr[6];
- uint8_t bssid[6];
- uint8_t antenna;
- uint8_t rx_align;
- uint32_t rx_buffer;
- uint16_t rx_mtu;
- uint16_t frontend;
- uint16_t timeout;
- uint16_t truncate;
- uint32_t bratemask;
- uint8_t sbss_offset;
- uint8_t mcast_window;
- uint8_t rx_rssi_threshold;
- uint8_t rx_ed_threshold;
- uint32_t ref_clock;
- uint16_t lpf_bandwidth;
- uint16_t osc_start_delay;
-};
-
-
-struct s_lmo_scan {
- uint16_t flags;
- uint16_t dwell;
- uint8_t channel[292];
- uint32_t bratemask;
- uint8_t aloft[8];
- uint8_t rssical[8];
-};
-
-
-enum {
- LM_TRAP_SCAN = 0,
- LM_TRAP_TIMER,
- LM_TRAP_BEACON_TX,
- LM_TRAP_FAA_RADIO_ON,
- LM_TRAP_FAA_RADIO_OFF,
- LM_TRAP_RADAR,
- LM_TRAP_NO_BEACON,
- LM_TRAP_TBTT,
- LM_TRAP_SCO_ENTER,
- LM_TRAP_SCO_EXIT
-};
-
-struct s_lmo_trap {
- uint16_t event;
- uint16_t frequency;
-};
-
-struct s_lmo_timer {
- uint32_t interval;
-};
-
-struct s_lmo_nav {
- uint32_t period;
-};
-
-
-struct s_lmo_edcf_queue;
-
-struct s_lmo_edcf {
- uint8_t flags;
- uint8_t slottime;
- uint8_t sifs;
- uint8_t eofpad;
- struct s_lmo_edcf_queue {
- uint8_t aifs;
- uint8_t pad0;
- uint16_t cwmin;
- uint16_t cwmax;
- uint16_t txop;
- } queues[8];
- uint8_t mapping[4];
- uint16_t maxburst;
- uint16_t round_trip_delay;
-};
-
-struct s_lmo_keycache {
- uint8_t entry;
- uint8_t keyid;
- uint8_t address[6];
- uint8_t pad[2];
- uint8_t keytype;
- uint8_t keylen;
- uint8_t key[24];
-};
-
-
-struct s_lm_interval;
-
-struct s_lmo_psm {
- uint16_t flags;
- uint16_t aid;
- struct s_lm_interval {
- uint16_t interval;
- uint16_t periods;
- } intervals[4];
- /* uint16_t pad; */
- uint8_t beacon_rcpi_skip_max;
- uint8_t rcpi_delta_threshold;
- uint8_t nr;
- uint8_t exclude[1];
-};
-
-#define MC_FILTER_ADDRESS_NUM 4
-
-struct s_lmo_group_address_table {
- uint16_t filter_enable;
- uint16_t num_address;
- uint8_t macaddr_list[MC_FILTER_ADDRESS_NUM][6];
-};
-
-struct s_lmo_txcancel {
- uint32_t address[1];
-};
-
-
-struct s_lmo_tx {
- uint8_t flags;
- uint8_t retries;
- uint8_t rcpi;
- uint8_t sq;
- uint16_t seqctrl;
- uint8_t antenna;
- uint8_t pad;
-};
-
-struct s_lmo_burst {
- uint8_t flags;
- uint8_t queue;
- uint8_t backlog;
- uint8_t pad;
- uint16_t durations[32];
-};
-
-struct s_lmo_stats {
- uint32_t valid;
- uint32_t fcs;
- uint32_t abort;
- uint32_t phyabort;
- uint32_t rts_success;
- uint32_t rts_fail;
- uint32_t timestamp;
- uint32_t time_tx;
- uint32_t noisefloor;
- uint32_t sample_noise[8];
- uint32_t sample_cca;
- uint32_t sample_tx;
-};
-
-
-struct s_lmo_led {
- uint16_t flags;
- uint16_t mask[2];
- uint16_t delay/*[2]*/;
-};
-
-
-struct s_lmo_bt_balancer {
- uint16_t prio_thresh;
- uint16_t acl_thresh;
-};
-
-
-struct s_lmo_arp_table {
- uint16_t filter_enable;
- uint32_t ipaddr;
-};
-
-#endif /* __ASSEMBLER__ */
-
-#endif /* __lmac_h__ */
diff --git a/drivers/staging/strip/Kconfig b/drivers/staging/strip/Kconfig
new file mode 100644
index 000000000000..36257b5cd6e1
--- /dev/null
+++ b/drivers/staging/strip/Kconfig
@@ -0,0 +1,22 @@
+config STRIP
+ tristate "STRIP (Metricom starmode radio IP)"
+ depends on INET
+ select WIRELESS_EXT
+ ---help---
+ Say Y if you have a Metricom radio and intend to use Starmode Radio
+ IP. STRIP is a radio protocol developed for the MosquitoNet project
+ to send Internet traffic using Metricom radios. Metricom radios are
+ small, battery powered, 100kbit/sec packet radio transceivers, about
+ the size and weight of a cellular telephone. (You may also have heard
+ them called "Metricom modems" but we avoid the term "modem" because
+ it misleads many people into thinking that you can plug a Metricom
+ modem into a phone line and use it as a modem.)
+
+ You can use STRIP on any Linux machine with a serial port, although
+ it is obviously most useful for people with laptop computers. If you
+ think you might get a Metricom radio in the future, there is no harm
+ in saying Y to STRIP now, except that it makes the kernel a bit
+ bigger.
+
+ To compile this as a module, choose M here: the module will be
+ called strip.
diff --git a/drivers/staging/strip/Makefile b/drivers/staging/strip/Makefile
new file mode 100644
index 000000000000..6417bdcac2fb
--- /dev/null
+++ b/drivers/staging/strip/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_STRIP) += strip.o
diff --git a/drivers/staging/strip/TODO b/drivers/staging/strip/TODO
new file mode 100644
index 000000000000..9bd15a2f6d9e
--- /dev/null
+++ b/drivers/staging/strip/TODO
@@ -0,0 +1,7 @@
+TODO:
+ - step up and maintain this driver to ensure that it continues
+ to work. Having the hardware for this is pretty much a
+ requirement. If this does not happen, the will be removed in
+ the 2.6.35 kernel release.
+
+Please send patches to Greg Kroah-Hartman <greg@kroah.com>.
diff --git a/drivers/net/wireless/strip.c b/drivers/staging/strip/strip.c
index ea6a87c19319..f945a306f255 100644
--- a/drivers/net/wireless/strip.c
+++ b/drivers/staging/strip/strip.c
@@ -22,27 +22,27 @@
* New byte stuffing (2+6 run-length encoding)
* New watchdog timer task
* New Protocol key (SIP0)
- *
+ *
* v0.9.1 3rd March 1996 (SC)
* Changed to dynamic device allocation -- no more compile
* time (or boot time) limit on the number of STRIP devices.
- *
+ *
* v0.9.2 13th March 1996 (SC)
* Uses arp cache lookups (but doesn't send arp packets yet)
- *
+ *
* v0.9.3 17th April 1996 (SC)
* Fixed bug where STR_ERROR flag was getting set unneccessarily
* (causing otherwise good packets to be unneccessarily dropped)
- *
+ *
* v0.9.4 27th April 1996 (SC)
* First attempt at using "&COMMAND" Starmode AT commands
- *
+ *
* v0.9.5 29th May 1996 (SC)
* First attempt at sending (unicast) ARP packets
- *
+ *
* v0.9.6 5th June 1996 (Elliot)
* Put "message level" tags in every "printk" statement
- *
+ *
* v0.9.7 13th June 1996 (laik)
* Added support for the /proc fs
*
@@ -298,7 +298,7 @@ struct strip {
/*
* Note: manual_dev_addr hack
- *
+ *
* It is not possible to change the hardware address of a Metricom radio,
* or to send packets with a user-specified hardware source address, thus
* trying to manually set a hardware source address is a questionable
@@ -315,22 +315,22 @@ struct strip {
* machine. This allows you to connect a pair of radios to one machine,
* and to use one exclusively for inbound traffic, and the other
* exclusively for outbound traffic. Pretty neat, huh?
- *
+ *
* Here's the full procedure to set this up:
- *
+ *
* 1. "slattach" two interfaces, e.g. st0 for outgoing packets,
* and st1 for incoming packets
- *
+ *
* 2. "ifconfig" st0 (outbound radio) to have the hardware address
* which is the real hardware address of st1 (inbound radio).
* Now when it sends out packets, it will masquerade as st1, and
* replies will be sent to that radio, which is exactly what we want.
- *
+ *
* 3. Set the route table entry ("route add default ..." or
* "route add -net ...", as appropriate) to send packets via the st0
* interface (outbound radio). Do not add any route which sends packets
* out via the st1 interface -- that radio is for inbound traffic only.
- *
+ *
* 4. "ifconfig" st1 (inbound radio) to have hardware address zero.
* This tells the STRIP driver to "shut down" that interface and not
* send any packets through it. In particular, it stops sending the
@@ -345,17 +345,17 @@ struct strip {
* st0, and if it sees the reply come from st1 then it will ignore
* it (to be accurate, it puts the entry in the ARP table, but
* labelled in such a way that st0 can't use it).
- *
+ *
* Thanks to Petros Maniatis for coming up with the idea of splitting
* inbound and outbound traffic between two interfaces, which turned
* out to be really easy to implement, even if it is a bit of a hack.
- *
+ *
* Having set a manual address on an interface, you can restore it
* to automatic operation (where the address is automatically kept
* consistent with the real address of the radio) by setting a manual
* address of all ones, e.g. "ifconfig st0 hw strip FFFFFFFFFFFF"
* This 'turns off' manual override mode for the device address.
- *
+ *
* Note: The IEEE 802 headers reported in tcpdump will show the *real*
* radio addresses the packets were sent and received from, so that you
* can see what is really going on with packets, and which interfaces
@@ -369,7 +369,7 @@ struct strip {
/*
* CommandString1 works on all radios
* Other CommandStrings are only used with firmware that provides structured responses.
- *
+ *
* ats319=1 Enables Info message for node additions and deletions
* ats319=2 Enables Info message for a new best node
* ats319=4 Enables checksums
@@ -620,7 +620,7 @@ static __u8 *StuffData(__u8 * src, __u32 length, __u8 * dst,
/* else, we only have one so far, so switch to Stuff_Diff code */
code = Stuff_Diff;
/* and fall through to Stuff_Diff case below
- * Note cunning cleverness here: case Stuff_Diff compares
+ * Note cunning cleverness here: case Stuff_Diff compares
* the current character with the previous two to see if it
* has a run of three the same. Won't this be an error if
* there aren't two previous characters stored to compare with?
@@ -677,7 +677,7 @@ static __u8 *StuffData(__u8 * src, __u32 length, __u8 * dst,
* It writes the decoded data into the buffer pointed to by "dst", up to a
* maximum of "dst_length", and returns the new value of "src" so that a
* follow-on call can read more data, continuing from where the first left off.
- *
+ *
* There are three types of results:
* 1. The source data runs out before extracting "dst_length" bytes:
* UnStuffData returns NULL to indicate failure.
@@ -686,7 +686,7 @@ static __u8 *StuffData(__u8 * src, __u32 length, __u8 * dst,
* 3. "dst_length" bytes are extracted, with more remaining.
* UnStuffData returns new_src < end to indicate that there are more bytes
* to be read.
- *
+ *
* Note: The decoding may be destructive, in that it may alter the source
* data in the process of decoding it (this is necessary to allow a follow-on
* call to resume correctly).
@@ -845,7 +845,7 @@ static int allocate_buffers(struct strip *strip_info, int mtu)
}
/*
- * MTU has been changed by the IP layer.
+ * MTU has been changed by the IP layer.
* We could be in
* an upcall from the tty driver, or in an ip packet queue.
*/
@@ -936,7 +936,7 @@ static char *time_delta(char buffer[], long time)
}
/* get Nth element of the linked list */
-static struct strip *strip_get_idx(loff_t pos)
+static struct strip *strip_get_idx(loff_t pos)
{
struct strip *str;
int i = 0;
@@ -1007,14 +1007,14 @@ static void strip_seq_neighbours(struct seq_file *seq,
/*
* This function prints radio status information via the seq_file
* interface. The interface takes care of buffer size and over
- * run issues.
+ * run issues.
*
- * The buffer in seq_file is PAGESIZE (4K)
+ * The buffer in seq_file is PAGESIZE (4K)
* so this routine should never print more or it will get truncated.
* With the maximum of 32 portables and 32 poletops
* reported, the routine outputs 3107 bytes into the buffer.
*/
-static void strip_seq_status_info(struct seq_file *seq,
+static void strip_seq_status_info(struct seq_file *seq,
const struct strip *strip_info)
{
char temp[32];
@@ -1159,7 +1159,7 @@ static void ResetRadio(struct strip *strip_info)
static const char init[] = "ate0q1dt**starmode\r**";
StringDescriptor s = { init, sizeof(init) - 1 };
- /*
+ /*
* If the radio isn't working anymore,
* we should clear the old status information.
*/
@@ -2755,7 +2755,7 @@ static int __init strip_init_driver(void)
printk(signon, StripVersion);
-
+
/*
* Fill in our line protocol discipline, and register it
*/
diff --git a/drivers/staging/vme/bridges/vme_ca91cx42.c b/drivers/staging/vme/bridges/vme_ca91cx42.c
index e139eaeaa174..2810d80fa0e6 100644
--- a/drivers/staging/vme/bridges/vme_ca91cx42.c
+++ b/drivers/staging/vme/bridges/vme_ca91cx42.c
@@ -15,7 +15,6 @@
* option) any later version.
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/mm.h>
#include <linux/types.h>
diff --git a/drivers/staging/vme/bridges/vme_tsi148.c b/drivers/staging/vme/bridges/vme_tsi148.c
index 00fe0803c21c..4d20125adcdd 100644
--- a/drivers/staging/vme/bridges/vme_tsi148.c
+++ b/drivers/staging/vme/bridges/vme_tsi148.c
@@ -13,7 +13,6 @@
* option) any later version.
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mm.h>
diff --git a/drivers/staging/vme/devices/vme_user.c b/drivers/staging/vme/devices/vme_user.c
index 78912883d153..dc9be4778fe5 100644
--- a/drivers/staging/vme/devices/vme_user.c
+++ b/drivers/staging/vme/devices/vme_user.c
@@ -31,7 +31,6 @@
#include <linux/spinlock.h>
#include <linux/syscalls.h>
#include <linux/types.h>
-#include <linux/version.h>
#include <asm/io.h>
#include <asm/uaccess.h>
diff --git a/drivers/staging/vme/vme.c b/drivers/staging/vme/vme.c
index 477a1adfd0e9..24743078a4af 100644
--- a/drivers/staging/vme/vme.c
+++ b/drivers/staging/vme/vme.c
@@ -13,7 +13,6 @@
* option) any later version.
*/
-#include <linux/version.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mm.h>
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index b02ca2d66fee..bf65b1118837 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -103,7 +103,7 @@
#include "card.h"
/*--------------------- Export Definitions -------------------------*/
-#define VNT_USB_VENDOR_ID 0x160A
+#define VNT_USB_VENDOR_ID 0x160a
#define VNT_USB_PRODUCT_ID 0x3184
#define MAC_MAX_CONTEXT_REG (256+128)
diff --git a/drivers/staging/wavelan/Kconfig b/drivers/staging/wavelan/Kconfig
new file mode 100644
index 000000000000..786060e025c0
--- /dev/null
+++ b/drivers/staging/wavelan/Kconfig
@@ -0,0 +1,38 @@
+config WAVELAN
+ tristate "AT&T/Lucent old WaveLAN & DEC RoamAbout DS ISA support"
+ depends on ISA
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ ---help---
+ The Lucent WaveLAN (formerly NCR and AT&T; or DEC RoamAbout DS) is
+ a Radio LAN (wireless Ethernet-like Local Area Network) using the
+ radio frequencies 900 MHz and 2.4 GHz.
+
+ If you want to use an ISA WaveLAN card under Linux, say Y and read
+ the Ethernet-HOWTO, available from
+ <http://www.tldp.org/docs.html#howto>. Some more specific
+ information is contained in
+ <file:Documentation/networking/wavelan.txt> and in the source code
+ <file:drivers/net/wireless/wavelan.p.h>.
+
+ You will also need the wireless tools package available from
+ <http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html>.
+ Please read the man pages contained therein.
+
+ To compile this driver as a module, choose M here: the module will be
+ called wavelan.
+
+config PCMCIA_WAVELAN
+ tristate "AT&T/Lucent old WaveLAN Pcmcia wireless support"
+ depends on PCMCIA
+ select WIRELESS_EXT
+ select WEXT_SPY
+ select WEXT_PRIV
+ help
+ Say Y here if you intend to attach an AT&T/Lucent Wavelan PCMCIA
+ (PC-card) wireless Ethernet networking card to your computer. This
+ driver is for the non-IEEE-802.11 Wavelan cards.
+
+ To compile this driver as a module, choose M here: the module will be
+ called wavelan_cs. If unsure, say N.
diff --git a/drivers/staging/wavelan/Makefile b/drivers/staging/wavelan/Makefile
new file mode 100644
index 000000000000..1cde17c69a43
--- /dev/null
+++ b/drivers/staging/wavelan/Makefile
@@ -0,0 +1,2 @@
+obj-$(CONFIG_WAVELAN) += wavelan.o
+obj-$(CONFIG_PCMCIA_WAVELAN) += wavelan_cs.o
diff --git a/drivers/staging/wavelan/TODO b/drivers/staging/wavelan/TODO
new file mode 100644
index 000000000000..9bd15a2f6d9e
--- /dev/null
+++ b/drivers/staging/wavelan/TODO
@@ -0,0 +1,7 @@
+TODO:
+ - step up and maintain this driver to ensure that it continues
+ to work. Having the hardware for this is pretty much a
+ requirement. If this does not happen, the will be removed in
+ the 2.6.35 kernel release.
+
+Please send patches to Greg Kroah-Hartman <greg@kroah.com>.
diff --git a/drivers/net/wireless/i82593.h b/drivers/staging/wavelan/i82593.h
index afac5c7a323d..afac5c7a323d 100644
--- a/drivers/net/wireless/i82593.h
+++ b/drivers/staging/wavelan/i82593.h
diff --git a/drivers/net/wireless/wavelan.c b/drivers/staging/wavelan/wavelan.c
index d634b2da3b84..7bb6bb314a4b 100644
--- a/drivers/net/wireless/wavelan.c
+++ b/drivers/staging/wavelan/wavelan.c
@@ -36,7 +36,7 @@ static u8 wv_irq_to_psa(int irq)
/*------------------------------------------------------------------*/
/*
- * Translate PSA irq parameter to irq number
+ * Translate PSA irq parameter to irq number
*/
static int __init wv_psa_to_irq(u8 irqval)
{
@@ -136,7 +136,7 @@ static inline void wv_ints_off(struct net_device * dev)
{
net_local *lp = netdev_priv(dev);
unsigned long ioaddr = dev->base_addr;
-
+
lp->hacr &= ~HACR_INTRON;
hacr_write(ioaddr, lp->hacr);
} /* wv_ints_off */
@@ -1403,7 +1403,7 @@ static void wavelan_set_multicast_list(struct net_device * dev)
}
} else {
/*
- * Switch to normal mode: disable promiscuous mode and
+ * Switch to normal mode: disable promiscuous mode and
* clear the multicast list.
*/
if (lp->promiscuous || lp->mc_count == 0) {
@@ -1640,7 +1640,7 @@ static int wv_frequency_list(unsigned long ioaddr, /* I/O port of the card */
if (table[9 - (freq / 16)] & (1 << (freq % 16))) {
/* Compute approximate channel number */
while ((c < ARRAY_SIZE(channel_bands)) &&
- (((channel_bands[c] >> 1) - 24) < freq))
+ (((channel_bands[c] >> 1) - 24) < freq))
c++;
list[i].i = c; /* Set the list index */
@@ -1736,7 +1736,7 @@ static int wavelan_set_nwid(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Set NWID in WaveLAN. */
if (!wrqu->nwid.disabled) {
/* Set NWID in psa */
@@ -1779,7 +1779,7 @@ static int wavelan_set_nwid(struct net_device *dev,
/*------------------------------------------------------------------*/
/*
- * Wireless Handler : get NWID
+ * Wireless Handler : get NWID
*/
static int wavelan_get_nwid(struct net_device *dev,
struct iw_request_info *info,
@@ -1794,7 +1794,7 @@ static int wavelan_get_nwid(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Read the NWID. */
psa_read(ioaddr, lp->hacr,
(char *) psa.psa_nwid - (char *) &psa,
@@ -1825,7 +1825,7 @@ static int wavelan_set_freq(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(ioaddr, mmroff(0, mmr_fee_status)) &
(MMR_FEE_STATUS_DWLD | MMR_FEE_STATUS_BUSY)))
@@ -1856,7 +1856,7 @@ static int wavelan_get_freq(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable).
* Does it work for everybody, especially old cards? */
if (!(mmc_in(ioaddr, mmroff(0, mmr_fee_status)) &
@@ -1902,7 +1902,7 @@ static int wavelan_set_sens(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Set the level threshold. */
/* We should complain loudly if wrqu->sens.fixed = 0, because we
* can't set auto mode... */
@@ -1938,7 +1938,7 @@ static int wavelan_get_sens(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Read the level threshold. */
psa_read(ioaddr, lp->hacr,
(char *) &psa.psa_thr_pre_set - (char *) &psa,
@@ -2039,7 +2039,7 @@ static int wavelan_get_encode(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Check if encryption is available */
if (!mmc_encr(ioaddr)) {
ret = -EOPNOTSUPP;
@@ -2118,7 +2118,7 @@ static int wavelan_get_range(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(ioaddr, mmroff(0, mmr_fee_status)) &
(MMR_FEE_STATUS_DWLD | MMR_FEE_STATUS_BUSY))) {
@@ -2160,7 +2160,7 @@ static int wavelan_set_qthr(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
psa.psa_quality_thr = *(extra) & 0x0F;
psa_write(ioaddr, lp->hacr,
(char *) &psa.psa_quality_thr - (char *) &psa,
@@ -2192,7 +2192,7 @@ static int wavelan_get_qthr(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
psa_read(ioaddr, lp->hacr,
(char *) &psa.psa_quality_thr - (char *) &psa,
(unsigned char *) &psa.psa_quality_thr, 1);
@@ -2374,10 +2374,10 @@ static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
/* Check */
if (lp == (net_local *) NULL)
return (iw_stats *) NULL;
-
+
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
wstats = &lp->wstats;
/* Get data from the mmc. */
@@ -2396,8 +2396,8 @@ static iw_stats *wavelan_get_wireless_stats(struct net_device * dev)
wstats->qual.qual = m.mmr_sgnl_qual & MMR_SGNL_QUAL;
wstats->qual.level = m.mmr_signal_lvl & MMR_SIGNAL_LVL;
wstats->qual.noise = m.mmr_silence_lvl & MMR_SILENCE_LVL;
- wstats->qual.updated = (((m. mmr_signal_lvl & MMR_SIGNAL_LVL_VALID) >> 7)
- | ((m.mmr_signal_lvl & MMR_SIGNAL_LVL_VALID) >> 6)
+ wstats->qual.updated = (((m. mmr_signal_lvl & MMR_SIGNAL_LVL_VALID) >> 7)
+ | ((m.mmr_signal_lvl & MMR_SIGNAL_LVL_VALID) >> 6)
| ((m.mmr_silence_lvl & MMR_SILENCE_LVL_VALID) >> 5));
wstats->discard.nwid += (m.mmr_wrong_nwid_h << 8) | m.mmr_wrong_nwid_l;
wstats->discard.code = 0L;
@@ -2821,7 +2821,7 @@ static int wv_packet_write(struct net_device * dev, void *buf, short length)
netif_wake_queue(dev);
spin_unlock_irqrestore(&lp->spinlock, flags);
-
+
#ifdef DEBUG_TX_INFO
wv_packet_info((u8 *) buf, length, dev->name,
"wv_packet_write");
@@ -2859,7 +2859,7 @@ static netdev_tx_t wavelan_packet_xmit(struct sk_buff *skb,
*/
netif_stop_queue(dev);
- /* If somebody has asked to reconfigure the controller,
+ /* If somebody has asked to reconfigure the controller,
* we can do it now.
*/
if (lp->reconfig_82586) {
@@ -3260,7 +3260,7 @@ static int wv_cu_start(struct net_device * dev)
/*------------------------------------------------------------------*/
/*
- * This routine does a standard configuration of the WaveLAN
+ * This routine does a standard configuration of the WaveLAN
* controller (i82586).
*
* It initialises the scp, iscp and scb structure
@@ -3574,7 +3574,7 @@ static void wv_82586_config(struct net_device * dev)
/*------------------------------------------------------------------*/
/*
- * This routine, called by wavelan_close(), gracefully stops the
+ * This routine, called by wavelan_close(), gracefully stops the
* WaveLAN controller (i82586).
* (called by wavelan_close())
*/
@@ -3701,7 +3701,7 @@ static int wv_check_ioaddr(unsigned long ioaddr, u8 * mac)
/*
* This function is the interrupt handler for the WaveLAN card. This
- * routine will be called whenever:
+ * routine will be called whenever:
*/
static irqreturn_t wavelan_interrupt(int irq, void *dev_id)
{
@@ -3921,7 +3921,7 @@ static void wavelan_watchdog(struct net_device * dev)
netif_wake_queue(dev);
spin_unlock_irqrestore(&lp->spinlock, flags);
-
+
#ifdef DEBUG_INTERRUPT_TRACE
printk(KERN_DEBUG "%s: <-wavelan_watchdog()\n", dev->name);
#endif
@@ -3930,7 +3930,7 @@ static void wavelan_watchdog(struct net_device * dev)
/********************* CONFIGURATION CALLBACKS *********************/
/*
* Here are the functions called by the Linux networking code (NET3)
- * for initialization, configuration and deinstallations of the
+ * for initialization, configuration and deinstallations of the
* WaveLAN ISA hardware.
*/
@@ -3958,7 +3958,7 @@ static int wavelan_open(struct net_device * dev)
return -ENXIO;
}
- if (request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", dev) != 0)
+ if (request_irq(dev->irq, &wavelan_interrupt, 0, "WaveLAN", dev) != 0)
{
#ifdef DEBUG_CONFIG_ERROR
printk(KERN_WARNING "%s: wavelan_open(): invalid IRQ\n",
@@ -3968,7 +3968,7 @@ static int wavelan_open(struct net_device * dev)
}
spin_lock_irqsave(&lp->spinlock, flags);
-
+
if (wv_hw_reset(dev) != -1) {
netif_start_queue(dev);
} else {
@@ -3982,7 +3982,7 @@ static int wavelan_open(struct net_device * dev)
return -EAGAIN;
}
spin_unlock_irqrestore(&lp->spinlock, flags);
-
+
#ifdef DEBUG_CALLBACK_TRACE
printk(KERN_DEBUG "%s: <-wavelan_open()\n", dev->name);
#endif
@@ -4151,7 +4151,7 @@ out:
/*------------------------------------------------------------------*/
/*
- * Check for a network adaptor of this type. Return '0' iff one
+ * Check for a network adaptor of this type. Return '0' iff one
* exists. There seem to be different interpretations of
* the initial value of dev->base_addr.
* We follow the example in drivers/net/ne.c.
@@ -4221,7 +4221,7 @@ struct net_device * __init wavelan_probe(int unit)
if (i == ARRAY_SIZE(iobase))
r = -ENODEV;
}
- if (r)
+ if (r)
goto out;
r = register_netdev(dev);
if (r)
diff --git a/drivers/net/wireless/wavelan.h b/drivers/staging/wavelan/wavelan.h
index 9ab360558ffd..9ab360558ffd 100644
--- a/drivers/net/wireless/wavelan.h
+++ b/drivers/staging/wavelan/wavelan.h
diff --git a/drivers/net/wireless/wavelan.p.h b/drivers/staging/wavelan/wavelan.p.h
index dbe8de6e5f52..e57e4eb4be19 100644
--- a/drivers/net/wireless/wavelan.p.h
+++ b/drivers/staging/wavelan/wavelan.p.h
@@ -125,7 +125,7 @@
* writing a WaveLAN ISA driver for the Mach microkernel. Girish
* Welling <welling@paul.rutgers.edu> had also worked on it.
* Keith Moore modified this for the PCMCIA hardware.
- *
+ *
* Robert Morris <rtm@das.harvard.edu> ported these two drivers to BSDI
* and added specific PCMCIA support (there is currently no equivalent
* of the PCMCIA package under BSD).
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/staging/wavelan/wavelan_cs.c
index 431a20ec6db6..d982aa06ef21 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/staging/wavelan/wavelan_cs.c
@@ -19,7 +19,7 @@
*
* -- Yunzhou Li (scip4166@nus.sg)
*
-#ifdef WAVELAN_ROAMING
+#ifdef WAVELAN_ROAMING
* Roaming support added 07/22/98 by Justin Seger (jseger@media.mit.edu)
* based on patch by Joe Finney from Lancaster University.
#endif
@@ -51,7 +51,7 @@
* in supporting documentation that copying and distribution is
* by permission of M.I.T. M.I.T. makes no representations about
* the suitability of this software for any purpose. It is pro-
- * vided "as is" without express or implied warranty.
+ * vided "as is" without express or implied warranty.
****************************************************************************
*
*/
@@ -483,7 +483,7 @@ fee_write(u_long base, /* i/o port of the card */
#ifdef WAVELAN_ROAMING /* Conditional compile, see wavelan_cs.h */
static unsigned char WAVELAN_BEACON_ADDRESS[] = {0x09,0x00,0x0e,0x20,0x03,0x00};
-
+
static void wv_roam_init(struct net_device *dev)
{
net_local *lp= netdev_priv(dev);
@@ -501,33 +501,33 @@ static void wv_roam_init(struct net_device *dev)
lp->wavepoint_table.locked=0;
lp->curr_point=NULL; /* No default WavePoint */
lp->cell_search=0;
-
+
lp->cell_timer.data=(long)lp; /* Start cell expiry timer */
lp->cell_timer.function=wl_cell_expiry;
lp->cell_timer.expires=jiffies+CELL_TIMEOUT;
add_timer(&lp->cell_timer);
-
+
wv_nwid_filter(NWID_PROMISC,lp) ; /* Enter NWID promiscuous mode */
/* to build up a good WavePoint */
/* table... */
printk(KERN_DEBUG "WaveLAN: Roaming enabled on device %s\n",dev->name);
}
-
+
static void wv_roam_cleanup(struct net_device *dev)
{
wavepoint_history *ptr,*old_ptr;
net_local *lp= netdev_priv(dev);
-
+
printk(KERN_DEBUG "WaveLAN: Roaming Disabled on device %s\n",dev->name);
-
+
/* Fixme : maybe we should check that the timer exist before deleting it */
del_timer(&lp->cell_timer); /* Remove cell expiry timer */
ptr=lp->wavepoint_table.head; /* Clear device's WavePoint table */
while(ptr!=NULL)
{
old_ptr=ptr;
- ptr=ptr->next;
- wl_del_wavepoint(old_ptr,lp);
+ ptr=ptr->next;
+ wl_del_wavepoint(old_ptr,lp);
}
}
@@ -536,17 +536,17 @@ static void wv_nwid_filter(unsigned char mode, net_local *lp)
{
mm_t m;
unsigned long flags;
-
+
#ifdef WAVELAN_ROAMING_DEBUG
printk(KERN_DEBUG "WaveLAN: NWID promisc %s, device %s\n",(mode==NWID_PROMISC) ? "on" : "off", lp->dev->name);
#endif
-
+
/* Disable interrupts & save flags */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
m.w.mmw_loopt_sel = (mode==NWID_PROMISC) ? MMW_LOOPT_SEL_DIS_NWID : 0x00;
mmc_write(lp->dev->base_addr, (char *)&m.w.mmw_loopt_sel - (char *)&m, (unsigned char *)&m.w.mmw_loopt_sel, 1);
-
+
if(mode==NWID_PROMISC)
lp->cell_search=1;
else
@@ -560,10 +560,10 @@ static void wv_nwid_filter(unsigned char mode, net_local *lp)
static wavepoint_history *wl_roam_check(unsigned short nwid, net_local *lp)
{
wavepoint_history *ptr=lp->wavepoint_table.head;
-
+
while(ptr!=NULL){
if(ptr->nwid==nwid)
- return ptr;
+ return ptr;
ptr=ptr->next;
}
return NULL;
@@ -574,34 +574,34 @@ static wavepoint_history *wl_new_wavepoint(unsigned short nwid, unsigned char se
{
wavepoint_history *new_wavepoint;
-#ifdef WAVELAN_ROAMING_DEBUG
+#ifdef WAVELAN_ROAMING_DEBUG
printk(KERN_DEBUG "WaveLAN: New Wavepoint, NWID:%.4X\n",nwid);
#endif
-
+
if(lp->wavepoint_table.num_wavepoints==MAX_WAVEPOINTS)
return NULL;
-
+
new_wavepoint = kmalloc(sizeof(wavepoint_history),GFP_ATOMIC);
if(new_wavepoint==NULL)
return NULL;
-
+
new_wavepoint->nwid=nwid; /* New WavePoints NWID */
new_wavepoint->average_fast=0; /* Running Averages..*/
new_wavepoint->average_slow=0;
new_wavepoint->qualptr=0; /* Start of ringbuffer */
new_wavepoint->last_seq=seq-1; /* Last sequence no.seen */
memset(new_wavepoint->sigqual,0,WAVEPOINT_HISTORY);/* Empty ringbuffer */
-
+
new_wavepoint->next=lp->wavepoint_table.head;/* Add to wavepoint table */
new_wavepoint->prev=NULL;
-
+
if(lp->wavepoint_table.head!=NULL)
lp->wavepoint_table.head->prev=new_wavepoint;
-
+
lp->wavepoint_table.head=new_wavepoint;
-
+
lp->wavepoint_table.num_wavepoints++; /* no. of visible wavepoints */
-
+
return new_wavepoint;
}
@@ -610,44 +610,44 @@ static void wl_del_wavepoint(wavepoint_history *wavepoint, struct net_local *lp)
{
if(wavepoint==NULL)
return;
-
+
if(lp->curr_point==wavepoint)
lp->curr_point=NULL;
-
+
if(wavepoint->prev!=NULL)
wavepoint->prev->next=wavepoint->next;
-
+
if(wavepoint->next!=NULL)
wavepoint->next->prev=wavepoint->prev;
-
+
if(lp->wavepoint_table.head==wavepoint)
lp->wavepoint_table.head=wavepoint->next;
-
+
lp->wavepoint_table.num_wavepoints--;
kfree(wavepoint);
}
-/* Timer callback function - checks WavePoint table for stale entries */
+/* Timer callback function - checks WavePoint table for stale entries */
static void wl_cell_expiry(unsigned long data)
{
net_local *lp=(net_local *)data;
wavepoint_history *wavepoint=lp->wavepoint_table.head,*old_point;
-
+
#if WAVELAN_ROAMING_DEBUG > 1
printk(KERN_DEBUG "WaveLAN: Wavepoint timeout, dev %s\n",lp->dev->name);
#endif
-
+
if(lp->wavepoint_table.locked)
{
#if WAVELAN_ROAMING_DEBUG > 1
printk(KERN_DEBUG "WaveLAN: Wavepoint table locked...\n");
#endif
-
+
lp->cell_timer.expires=jiffies+1; /* If table in use, come back later */
add_timer(&lp->cell_timer);
return;
}
-
+
while(wavepoint!=NULL)
{
if(time_after(jiffies, wavepoint->last_seen + CELL_TIMEOUT))
@@ -655,7 +655,7 @@ static void wl_cell_expiry(unsigned long data)
#ifdef WAVELAN_ROAMING_DEBUG
printk(KERN_DEBUG "WaveLAN: Bye bye %.4X\n",wavepoint->nwid);
#endif
-
+
old_point=wavepoint;
wavepoint=wavepoint->next;
wl_del_wavepoint(old_point,lp);
@@ -668,11 +668,11 @@ static void wl_cell_expiry(unsigned long data)
}
/* Update SNR history of a wavepoint */
-static void wl_update_history(wavepoint_history *wavepoint, unsigned char sigqual, unsigned char seq)
+static void wl_update_history(wavepoint_history *wavepoint, unsigned char sigqual, unsigned char seq)
{
int i=0,num_missed=0,ptr=0;
int average_fast=0,average_slow=0;
-
+
num_missed=(seq-wavepoint->last_seq)%WAVEPOINT_HISTORY;/* Have we missed
any beacons? */
if(num_missed)
@@ -682,26 +682,26 @@ static void wl_update_history(wavepoint_history *wavepoint, unsigned char sigqua
wavepoint->qualptr %=WAVEPOINT_HISTORY; /* in the ringbuffer. */
}
wavepoint->last_seen=jiffies; /* Add beacon to history */
- wavepoint->last_seq=seq;
- wavepoint->sigqual[wavepoint->qualptr++]=sigqual;
+ wavepoint->last_seq=seq;
+ wavepoint->sigqual[wavepoint->qualptr++]=sigqual;
wavepoint->qualptr %=WAVEPOINT_HISTORY;
ptr=(wavepoint->qualptr-WAVEPOINT_FAST_HISTORY+WAVEPOINT_HISTORY)%WAVEPOINT_HISTORY;
-
+
for(i=0;i<WAVEPOINT_FAST_HISTORY;i++) /* Update running averages */
{
average_fast+=wavepoint->sigqual[ptr++];
ptr %=WAVEPOINT_HISTORY;
}
-
+
average_slow=average_fast;
for(i=WAVEPOINT_FAST_HISTORY;i<WAVEPOINT_HISTORY;i++)
{
average_slow+=wavepoint->sigqual[ptr++];
ptr %=WAVEPOINT_HISTORY;
}
-
+
wavepoint->average_fast=average_fast/WAVEPOINT_FAST_HISTORY;
- wavepoint->average_slow=average_slow/WAVEPOINT_HISTORY;
+ wavepoint->average_slow=average_slow/WAVEPOINT_HISTORY;
}
/* Perform a handover to a new WavePoint */
@@ -716,19 +716,19 @@ static void wv_roam_handover(wavepoint_history *wavepoint, net_local *lp)
wv_nwid_filter(!NWID_PROMISC,lp);
return;
}
-
+
#ifdef WAVELAN_ROAMING_DEBUG
printk(KERN_DEBUG "WaveLAN: Doing handover to %.4X, dev %s\n",wavepoint->nwid,lp->dev->name);
#endif
-
+
/* Disable interrupts & save flags */
spin_lock_irqsave(&lp->spinlock, flags);
m.w.mmw_netw_id_l = wavepoint->nwid & 0xFF;
m.w.mmw_netw_id_h = (wavepoint->nwid & 0xFF00) >> 8;
-
+
mmc_write(base, (char *)&m.w.mmw_netw_id_l - (char *)&m, (unsigned char *)&m.w.mmw_netw_id_l, 2);
-
+
/* ReEnable interrupts & restore flags */
spin_unlock_irqrestore(&lp->spinlock, flags);
@@ -743,7 +743,7 @@ static void wl_roam_gather(struct net_device * dev,
of packet */
{
wavepoint_beacon *beacon= (wavepoint_beacon *)hdr; /* Rcvd. Beacon */
- unsigned short nwid=ntohs(beacon->nwid);
+ unsigned short nwid=ntohs(beacon->nwid);
unsigned short sigqual=stats[2] & MMR_SGNL_QUAL; /* SNR of beacon */
wavepoint_history *wavepoint=NULL; /* WavePoint table entry */
net_local *lp = netdev_priv(dev); /* Device info */
@@ -757,9 +757,9 @@ static void wl_roam_gather(struct net_device * dev,
printk(KERN_DEBUG "WaveLAN: beacon, dev %s:\n",dev->name);
printk(KERN_DEBUG "Domain: %.4X NWID: %.4X SigQual=%d\n",ntohs(beacon->domain_id),nwid,sigqual);
#endif
-
+
lp->wavepoint_table.locked=1; /* <Mutex> */
-
+
wavepoint=wl_roam_check(nwid,lp); /* Find WavePoint table entry */
if(wavepoint==NULL) /* If no entry, Create a new one... */
{
@@ -769,22 +769,22 @@ static void wl_roam_gather(struct net_device * dev,
}
if(lp->curr_point==NULL) /* If this is the only WavePoint, */
wv_roam_handover(wavepoint, lp); /* Jump on it! */
-
+
wl_update_history(wavepoint, sigqual, beacon->seq); /* Update SNR history
stats. */
-
+
if(lp->curr_point->average_slow < SEARCH_THRESH_LOW) /* If our current */
if(!lp->cell_search) /* WavePoint is getting faint, */
wv_nwid_filter(NWID_PROMISC,lp); /* start looking for a new one */
-
- if(wavepoint->average_slow >
+
+ if(wavepoint->average_slow >
lp->curr_point->average_slow + WAVELAN_ROAMING_DELTA)
wv_roam_handover(wavepoint, lp); /* Handover to a better WavePoint */
-
+
if(lp->curr_point->average_slow > SEARCH_THRESH_HIGH) /* If our SNR is */
if(lp->cell_search) /* getting better, drop out of cell search mode */
wv_nwid_filter(!NWID_PROMISC,lp);
-
+
out:
lp->wavepoint_table.locked=0; /* </MUTEX> :-) */
}
@@ -794,7 +794,7 @@ static inline int WAVELAN_BEACON(unsigned char *data)
{
wavepoint_beacon *beacon= (wavepoint_beacon *)data;
static const wavepoint_beacon beacon_template={0xaa,0xaa,0x03,0x08,0x00,0x0e,0x20,0x03,0x00};
-
+
if(memcmp(beacon,&beacon_template,9)==0)
return 1;
else
@@ -809,7 +809,7 @@ static inline int WAVELAN_BEACON(unsigned char *data)
/*------------------------------------------------------------------*/
/*
- * Routine to synchronously send a command to the i82593 chip.
+ * Routine to synchronously send a command to the i82593 chip.
* Should be called with interrupts disabled.
* (called by wv_packet_write(), wv_ru_stop(), wv_ru_start(),
* wv_82593_config() & wv_diag())
@@ -1431,7 +1431,7 @@ wavelan_set_multicast_list(struct net_device * dev)
else
{
/*
- * Switch to normal mode: disable promiscuous mode and
+ * Switch to normal mode: disable promiscuous mode and
* clear the multicast list.
*/
if(lp->promiscuous || lp->mc_count == 0)
@@ -1804,7 +1804,7 @@ static int wavelan_set_nwid(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Set NWID in WaveLAN. */
if (!wrqu->nwid.disabled) {
/* Set NWID in psa */
@@ -1847,7 +1847,7 @@ static int wavelan_set_nwid(struct net_device *dev,
/*------------------------------------------------------------------*/
/*
- * Wireless Handler : get NWID
+ * Wireless Handler : get NWID
*/
static int wavelan_get_nwid(struct net_device *dev,
struct iw_request_info *info,
@@ -1861,7 +1861,7 @@ static int wavelan_get_nwid(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Read the NWID. */
psa_read(dev,
(char *) psa.psa_nwid - (char *) &psa,
@@ -1892,7 +1892,7 @@ static int wavelan_set_freq(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(base, mmroff(0, mmr_fee_status)) &
(MMR_FEE_STATUS_DWLD | MMR_FEE_STATUS_BUSY)))
@@ -1923,7 +1923,7 @@ static int wavelan_get_freq(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable).
* Does it work for everybody, especially old cards? */
if (!(mmc_in(base, mmroff(0, mmr_fee_status)) &
@@ -1969,7 +1969,7 @@ static int wavelan_set_sens(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Set the level threshold. */
/* We should complain loudly if wrqu->sens.fixed = 0, because we
* can't set auto mode... */
@@ -2004,7 +2004,7 @@ static int wavelan_get_sens(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Read the level threshold. */
psa_read(dev,
(char *) &psa.psa_thr_pre_set - (char *) &psa,
@@ -2105,7 +2105,7 @@ static int wavelan_get_encode(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Check if encryption is available */
if (!mmc_encr(base)) {
ret = -EOPNOTSUPP;
@@ -2151,7 +2151,7 @@ static int wavelan_set_essid(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Check if disable */
if(wrqu->data.flags == 0)
lp->filter_domains = 0;
@@ -2351,7 +2351,7 @@ static int wavelan_get_range(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Attempt to recognise 2.00 cards (2.4 GHz frequency selectable). */
if (!(mmc_in(base, mmroff(0, mmr_fee_status)) &
(MMR_FEE_STATUS_DWLD | MMR_FEE_STATUS_BUSY))) {
@@ -2393,7 +2393,7 @@ static int wavelan_set_qthr(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
psa.psa_quality_thr = *(extra) & 0x0F;
psa_write(dev,
(char *) &psa.psa_quality_thr - (char *) &psa,
@@ -2424,7 +2424,7 @@ static int wavelan_get_qthr(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
psa_read(dev,
(char *) &psa.psa_quality_thr - (char *) &psa,
(unsigned char *) &psa.psa_quality_thr, 1);
@@ -2451,7 +2451,7 @@ static int wavelan_set_roam(struct net_device *dev,
/* Disable interrupts and save flags. */
spin_lock_irqsave(&lp->spinlock, flags);
-
+
/* Note : should check if user == root */
if(do_roaming && (*extra)==0)
wv_roam_cleanup(dev);
@@ -2745,7 +2745,7 @@ wv_start_of_frame(struct net_device * dev,
#endif
return(-1);
}
-
+
/* Frame too short */
if(len < 7)
{
@@ -2755,7 +2755,7 @@ wv_start_of_frame(struct net_device * dev,
#endif
return(-1);
}
-
+
/* Wrap around buffer */
if(len > ((wrap - (rfp - len) + RX_SIZE) % RX_SIZE)) /* magic formula ! */
{
@@ -2817,7 +2817,7 @@ wv_packet_read(struct net_device * dev,
#ifdef DEBUG_RX_INFO
wv_packet_info(skb_mac_header(skb), sksize, dev->name, "wv_packet_read");
#endif /* DEBUG_RX_INFO */
-
+
/* Statistics gathering & stuff associated.
* It seem a bit messy with all the define, but it's really simple... */
if(
@@ -2847,7 +2847,7 @@ wv_packet_read(struct net_device * dev,
if(WAVELAN_BEACON(skb->data))
wl_roam_gather(dev, skb->data, stats);
#endif /* WAVELAN_ROAMING */
-
+
#ifdef WIRELESS_SPY
wl_spy_gather(dev, skb_mac_header(skb) + WAVELAN_ADDR_SIZE, stats);
#endif /* WIRELESS_SPY */
@@ -3231,13 +3231,13 @@ wv_mmc_init(struct net_device * dev)
/* Copy PSA info to the mmc */
m.mmw_netw_id_l = psa.psa_nwid[1];
m.mmw_netw_id_h = psa.psa_nwid[0];
-
+
if(psa.psa_nwid_select & 1)
m.mmw_loopt_sel = 0x00;
else
m.mmw_loopt_sel = MMW_LOOPT_SEL_DIS_NWID;
- memcpy(&m.mmw_encr_key, &psa.psa_encryption_key,
+ memcpy(&m.mmw_encr_key, &psa.psa_encryption_key,
sizeof(m.mmw_encr_key));
if(psa.psa_encryption_select)
@@ -3518,7 +3518,7 @@ wv_82593_config(struct net_device * dev)
cfblk.prmisc = ((lp->promiscuous) ? TRUE: FALSE); /* Promiscuous mode */
cfblk.bc_dis = FALSE; /* Enable broadcast reception */
cfblk.crs_1 = TRUE; /* Transmit without carrier sense */
- cfblk.nocrc_ins = FALSE; /* i82593 generates CRC */
+ cfblk.nocrc_ins = FALSE; /* i82593 generates CRC */
cfblk.crc_1632 = FALSE; /* 32-bit Autodin-II CRC */
cfblk.crs_cdt = FALSE; /* CD not to be interpreted as CS */
cfblk.cs_filter = 0; /* CS is recognized immediately */
@@ -3660,7 +3660,7 @@ wv_pcmcia_reset(struct net_device * dev)
cs_error(link, AccessConfigurationRegister, i);
return FALSE;
}
-
+
#ifdef DEBUG_CONFIG_INFO
printk(KERN_DEBUG "%s: wavelan_pcmcia_reset(): Config reg is 0x%x\n",
dev->name, (u_int) reg.Value);
@@ -3674,7 +3674,7 @@ wv_pcmcia_reset(struct net_device * dev)
cs_error(link, AccessConfigurationRegister, i);
return FALSE;
}
-
+
reg.Action = CS_WRITE;
reg.Value = COR_LEVEL_IRQ | COR_CONFIG;
i = pcmcia_access_configuration_register(link, &reg);
@@ -3781,7 +3781,7 @@ wv_hw_config(struct net_device * dev)
break;
}
- /*
+ /*
* insert code for loopback test here
*/
@@ -3819,7 +3819,7 @@ wv_hw_reset(struct net_device * dev)
lp->nresets++;
lp->configured = 0;
-
+
/* Call wv_hw_config() for most of the reset & init stuff */
if(wv_hw_config(dev) == FALSE)
return;
@@ -3979,7 +3979,7 @@ wv_pcmcia_release(struct pcmcia_device *link)
/*
* This function is the interrupt handler for the WaveLAN card. This
- * routine will be called whenever:
+ * routine will be called whenever:
* 1. A packet is received.
* 2. A packet has successfully been transferred and the unit is
* ready to transmit another packet.
@@ -4027,7 +4027,7 @@ wavelan_interrupt(int irq,
status0 = inb(LCSR(base));
#ifdef DEBUG_INTERRUPT_INFO
- printk(KERN_DEBUG "status0 0x%x [%s => 0x%x]", status0,
+ printk(KERN_DEBUG "status0 0x%x [%s => 0x%x]", status0,
(status0&SR0_INTERRUPT)?"int":"no int",status0&~SR0_INTERRUPT);
if(status0&SR0_INTERRUPT)
{
@@ -4198,7 +4198,7 @@ wavelan_interrupt(int irq,
netif_wake_queue(dev);
outb(CR0_INT_ACK | OP0_NOP, LCCR(base)); /* Acknowledge the interrupt */
- }
+ }
else /* if interrupt = transmit done or retransmit done */
{
#ifdef DEBUG_INTERRUPT_ERROR
diff --git a/drivers/net/wireless/wavelan_cs.h b/drivers/staging/wavelan/wavelan_cs.h
index 2e4bfe4147c6..63a1fe4f6678 100644
--- a/drivers/net/wireless/wavelan_cs.h
+++ b/drivers/staging/wavelan/wavelan_cs.h
@@ -18,7 +18,7 @@
*/
/*
- * Definitions for the AT&T GIS (formerly NCR) WaveLAN PCMCIA card:
+ * Definitions for the AT&T GIS (formerly NCR) WaveLAN PCMCIA card:
* An Ethernet-like radio transceiver controlled by an Intel 82593
* coprocessor.
*
@@ -37,7 +37,7 @@
* in supporting documentation that copying and distribution is
* by permission of M.I.T. M.I.T. makes no representations about
* the suitability of this software for any purpose. It is pro-
- * vided "as is" without express or implied warranty.
+ * vided "as is" without express or implied warranty.
****************************************************************************
*
*
diff --git a/drivers/net/wireless/wavelan_cs.p.h b/drivers/staging/wavelan/wavelan_cs.p.h
index 81d91531c4f9..aa91f7ba06e2 100644
--- a/drivers/net/wireless/wavelan_cs.p.h
+++ b/drivers/staging/wavelan/wavelan_cs.p.h
@@ -123,7 +123,7 @@
* writing a Wavelan ISA driver for the MACH microkernel. Girish
* Welling <welling@paul.rutgers.edu> had also worked on it.
* Keith Moore modify this for the Pcmcia hardware.
- *
+ *
* Robert Morris <rtm@das.harvard.edu> port these two drivers to BSDI
* and add specific Pcmcia support (there is currently no equivalent
* of the PCMCIA package under BSD...).
@@ -283,7 +283,7 @@
* Changes made in sixth release (2.9.1a) :
* --------------------------------------
* - Change the detection code for multi manufacturer code support
- * - Correct bug (hang kernel) in init when we were "rejecting" a card
+ * - Correct bug (hang kernel) in init when we were "rejecting" a card
*
* Changes made in seventh release (2.9.1b) :
* ----------------------------------------
@@ -673,7 +673,7 @@ static void
int); /* number of registers */
/* ---------------------- I82593 SUBROUTINES ----------------------- */
static int
- wv_82593_cmd(struct net_device *, /* synchronously send a command to i82593 */
+ wv_82593_cmd(struct net_device *, /* synchronously send a command to i82593 */
char *,
int,
int);
diff --git a/drivers/staging/wlags49_h2/Kconfig b/drivers/staging/wlags49_h2/Kconfig
new file mode 100644
index 000000000000..f9978fc40d4b
--- /dev/null
+++ b/drivers/staging/wlags49_h2/Kconfig
@@ -0,0 +1,8 @@
+config WLAGS49_H2
+ tristate "Agere Systems HERMES II Wireless PC Card Model 0110"
+ depends on WLAN_80211 && WIRELESS_EXT
+ ---help---
+ Driver for wireless cards using Agere's HERMES II chipset
+ which are identified with Manufacture ID: 0156,0003
+ The software is a modified version of wl_lkm_722_abg.tar.gz
+ from the Agere Systems website, addapted for Ubuntu 9.04.
diff --git a/drivers/staging/wlags49_h2/Makefile b/drivers/staging/wlags49_h2/Makefile
new file mode 100644
index 000000000000..25d0a8a9ce30
--- /dev/null
+++ b/drivers/staging/wlags49_h2/Makefile
@@ -0,0 +1,81 @@
+#
+# Makefile for wlags49_h2_cs.ko and wlags49_h25_cs.ko
+#
+# Default build for Hermes-II base cards (possibly identified with
+# "manfid: 0x0156, 0x0003" in "pccardctl ident" output), comment
+# -DHERMES25 below
+#
+# If you want to build for Hermes-II.5 base cards (possibly identified with
+# "manfid: 0x0156, 0x0004" in "pccardctl ident" output), uncomment
+# -DHERMES25 below
+#
+# If you want to build AP support (untested), comment out -DSTA_ONLY
+
+INSTALLDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless
+EXTRA_CFLAGS += -I$(KERNELDIR)/include
+EXTRA_CFLAGS += -I$(src) \
+ -DBUS_PCMCIA \
+ -DUSE_WPA \
+ -DUSE_WEXT \
+ -DSTA_ONLY \
+ -DWVLAN_49 \
+# -DHERMES25 \
+# -DDBG \
+# -DDBG_LVL=5 \
+# -DUSE_UIL \
+# -DUSE_PROFILE \
+
+ifeq ($(findstring HERMES25,$(EXTRA_CFLAGS)),)
+WLNAME := wlags49_h2_cs
+$(WLNAME)-y := sta_h2.o
+ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
+$(WLNAME)-y += ap_h2.o
+endif
+else
+WLNAME=wlags49_h25_cs
+$(WLNAME)-y := sta_h25.o
+ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
+$(WLNAME)-y += ap_h25.o
+endif
+endif
+
+# If KERNELRELEASE is defined, we've been invoked from the
+# kernel build system and can use its language.
+ifneq ($(KERNELRELEASE),)
+
+obj-m += $(WLNAME).o
+
+$(WLNAME)-y += wl_profile.o \
+ wl_wext.o \
+ wl_priv.o \
+ wl_main.o \
+ wl_enc.o \
+ wl_util.o \
+ wl_netdev.o \
+ wl_cs.o \
+ mmd.o \
+ hcf.o \
+ dhf.o
+
+$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o
+
+# Otherwise we were called directly from the command
+# line; invoke the kernel build system.
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+endif
+
+clean:
+ rm -fr *.o *.ko *.mod.c *.mod.o .*.*.cmd Module.symvers \
+ Module.markers modules.order .tmp_versions
+
+install: default
+ -rmmod $(WLNAME)
+ install -d $(INSTALLDIR)
+ install -m 0644 -o root -g root $(WLNAME).ko $(INSTALLDIR)
+ /sbin/depmod -aq
+
diff --git a/drivers/staging/wlags49_h2/README.ubuntu b/drivers/staging/wlags49_h2/README.ubuntu
new file mode 100644
index 000000000000..47beaec86e4a
--- /dev/null
+++ b/drivers/staging/wlags49_h2/README.ubuntu
@@ -0,0 +1,180 @@
+=======================================================================
+WLAN driver for cards using the HERMES II and HERMES II.5 chipset
+
+HERMES II Card
+
+PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
+ Manufacture ID: 0156,0003
+
+HERMES II.5 Card
+
+PCMCIA Info: "Linksys" "WCF54G_Wireless-G_CompactFlash_Card"
+ Manufacture ID: 0156,0004
+
+Based on Agere Systems Linux LKM Wireless Driver Source Code,
+Version 7.22; complies with Open Source BSD License.
+=======================================================================
+
+DESCRIPTION
+
+The software is a modified version of wl_lkm_722_abg.tar.gz from the
+Agere Systems website, addapted for Ubuntu 9.04.
+
+Modified for kernel 2.6 by Henk de Groot <pe1dnn@amsat.org>
+Based on 7.18 version by Andrey Borzenkov <arvidjaar@mail.ru> $Revision: 39 $
+
+INSTALLATION
+
+Unpack in a new directory.
+
+Open a terminal screen.
+
+Change directory to the source directory
+
+Type command
+
+make
+
+and wait until it is finshed. Now you have build the module
+wlags49_h2_cs; this module is meant for a HERMES II card.
+
+The driver is tested with a Thomson SpeedTouch 110 Wireless PC Card.
+For the test Station mode was used with WEP. The driver is supposed
+to support WAP and as accesspoint that is NOT tested.
+
+If you have a card using the HERMES II.5 chip you have to make
+changes to the Makefile and uncomment -DHERMES25. This will build
+driver wlags49_h25_cs.
+
+Note: You can detemine the type with command "pccardctrl info"
+ MANIFID: 0156,0002 = HERMES - not supported by this driver
+ MANIFID: 0156,0003 = HERMES II (Wireless B)
+ MANIFID: 0156,0004 = HERMES II.5 (Wireless B/G)
+
+After succesfull compile type command
+
+sudo make install
+
+to install the module.
+
+Now the card should be recognized. It should be able to configure
+and use the card with NetworkManager. Wpa_supplicant also works, as does
+manual configuration using the iwconfig/iwlist programs.
+
+Note: I only tested Station mode with WEP but if I didn't break anything
+WPA and AP mode should also work; note however that WPA was experimental
+in the original Agere driver!
+
+Note: to compile as AP change the makefile and remove the line
+-DSTA_ONLY \
+
+(or comment it, but in that case make sure to move it after all the
+ flags you want to use)
+
+CHANGES
+
+The HCF functions to control the card are virtually unchanged, the only
+changes are meant to fix compiler warnings. The only real change is in
+HCF_WAIT_WHILE which now has a udelay(2) added to give a small delay.
+
+The linux driver files (wl_xxxx.c) are changed in the following ways:
+- Addaptations of Andrey Borzenkov applied to 7.22 source
+- Alterations to avoid most HCF_ASSERTs
+-- Switching interrupts off and on in the HCF
+-- Bugfixes, things that were aparently wrong like reporting link status
+ change which checked a variable that was not changed in HCF anymore.
+-- Used on WEP but setting keys via SIOCSIWENCODEEXT was not supported
+-- Recovery actions added
+
+The major problem was the order in which calls can be made. The original
+looks like a traditonal UNIX driver. To call an "ioctl" function you
+have to "open" the device first to get a handle and after "close" no
+"ioctl" function can be called anymore. With the 2.6 driver this all
+changed; the former ioctl functions are now called before "open" and
+after "close", which was not expected. One of the problems was enable/
+disable of interrupts in the HCF. Interrupt handling starts at "open"
+so if a former "ioctl" routinge is called before "open" or after "close"
+then nothing should be done with interrupt switching in the HCF. Once
+this was solved most HCF_ASSERTS went away.
+
+The last point, recovery actions added, needs some clarification.
+Starting the card works most of the time, but unfortunately not always.
+At a few times recovery code was added; when the card starts to
+misbehave or the communication between the HCF and the card is
+out of sync and the HCF enters DEFUNCT mode everything is reset and
+reinitialized. Note, hcf.c contains a lot of documentation. It takes
+some time but slowly some things become clear. Also some unresolved
+issues are mentioned in hcf.c, so there are still unknown bugs.
+
+The card problems are almost in all cases when starting up and before
+the first association with an AP, once the card is in operation it
+seems to stay that way; when debugging no HCF_ASSERTS appear anymore.
+Note: some HCF_ASSERTS still appear, in a number of cases it is a real
+error, for example at card removal the missing card is detected.
+
+LICENSE
+
+The Agere Systems license applies. This is why I include the original
+README.wlags49. The instructions in that file are bogus now. I also
+include the man page. Eventhough setting parameters on the module
+does not work anymore but it provides some information about all the
+settings.
+
+I have not have personal contact with Agere, but others have. Agere
+agreed to make their software available under the BSD licence.
+This driver is based on the 7.22 version.
+
+The following was mailed by Agere to Andrey Borzenkov about this:
+
+ --- Begin Message ---
+
+ * From: TJ <tj@xxxxxxxxxxx>
+ * Date: Mon, 05 Feb 2007 19:28:59 +0000
+
+ Hi Andrey,
+
+ I've got some good news for you/us/the world of Hermes :)
+
+ I got a reply from the legal representative at Agere confirming that
+ their source-code is BSD licensed, and I've included the contents of the
+ email here.
+
+ I hope this re-assures you so that your excellent work on the drivers
+ can be made widely available for other hackers to work with.
+
+ Regards,
+
+ TJ.
+
+ ---------
+ On Mon, 2007-02-05 at 13:54 -0500, Pathare, Viren M (Viren) wrote:
+
+
+ "I would like to confirm that the two drivers; Linux LKM Wireless Driver
+ Source Code, Version 7.18 and Linux LKM Wireless Driver Source Code,
+ Version 7.22 comply with Open Source BSD License. Therefore the source
+ code can be distributed in unmodified or modified form consistent with
+ the terms of the license.
+
+ The Linux driver architecture was based on two modules, the MSF (Module
+ specific functions) and the HCF (Hardware Control Functions). Included
+ in the HCF is run-time firmware (binary format) which is downloaded into
+ the RAM of the Hermes 1/2/2.5 WMAC.
+
+ This hex coded firmware is not based on any open source software and
+ hence it is not subject to any Open Source License. The firmware was
+ developed by Agere and runs on the DISC processor embedded within the
+ Hermes 1/2/2.5 Wireless MAC devices.
+
+ Hope this helps.
+
+ Sincerely,
+
+ Viren Pathare
+ Intellectual Property Licensing Manager
+ Agere"
+
+
+
+ --- End Message ---
+
diff --git a/drivers/staging/wlags49_h2/README.wlags49 b/drivers/staging/wlags49_h2/README.wlags49
new file mode 100644
index 000000000000..7586fd09adc9
--- /dev/null
+++ b/drivers/staging/wlags49_h2/README.wlags49
@@ -0,0 +1,641 @@
+==============================================================================
+Agere Systems Inc. July 2004
+Readme for Linux Driver Source for Wavelan Version: 7.22-abg
+==============================================================================
+
+This text file includes update information, installation instructions,
+limitations to the current version of the product, and suggestions to solve
+known issues or problems.
+
+
+TABLE OF CONTENTS.
+
+1. DESCRIPTION
+2. SYSTEM REQUIREMENTS
+3. NEW IN THIS RELEASE
+4. INSTALLATION NOTES
+5. TECHNICAL CONSTRAINTS
+6. KNOWN ISSUES
+7. TECHNICAL SUPPORT
+
+------------------------------------------------------------------------------
+1. DESCRIPTION
+
+ With this package, you can build and install a Wireless driver for a
+ specific Linux kernel.
+
+ The driver in this package supports the network interface cards based on:
+ - WL60010, a.k.a. Hermes-II
+ - WL60040, a.k.a. Hermes-II.5
+
+ Although derived from the Hermes-I/II Linux driver, this release ONLY
+ Supports Hermes-II/II.5 chipsets. Hermes-I is no longer supported.
+
+ The software is distributed in a compressed source file archive:
+ - wl_lkm_7_22_abg.tar.gz
+
+ Because this release supports more than one Hermes CPU and bus
+ architecture, a naming convention is used for the resulting binaries that
+ can be built from this source code. Driver binaries are named as follows:
+
+ wlags49_<hermes_type>_<bus_arch>.o
+
+ where 'wlags49' denotes an Agere WaveLan Linux build,
+
+ <hermes_type> is: 'h2' for Hermes-II, 'h25' for Hermes-II.5
+
+ <bus_arch> is: 'cs' for Card Services (PCMCIA, Compact Flash), PCI for
+ PCI or MiniPCI.
+
+ For example, a driver built for Hermes-II Card Services (PCMCIA/Compact
+ Flash) is named wlags49_h2_cs.o, whereas a driver built for Hermes-II
+ MiniPCI is named wlags49_h2_pci.o.
+ The following software is included with this distribution:
+
+ General information:
+ * README.wlags49 This file
+ * LICENSE.wlags49 License
+ * wlags49.mk Top level Makefile
+ * Build Script to build driver
+ * Install Script to install driver
+
+ Driver source:
+ * wireless/ MSF source
+ * hcf/ HCF and F/W source
+ * wireless/wlags49_cs.mk Driver Makefile, PC Card
+ * wireless/wlags49_pci.mk Driver Makefile, PCI
+ * include/hcf/debug.h Driver debug support
+ * include/hcf/hcfcfg.h Header to configure HCF
+ * include/wireless/*.h Driver source headers
+
+ Driver online manual page:
+ * man/wlags49.4 Driver manual page
+
+ PCMCIA configuration update:
+ * etc/wlags49.conf Add-on config file
+ * etc/wlags49.mk config update Makefile
+ * etc/wlags49.patch config update patch file
+
+ The driver is build up of 2 modules:
+ - a higher module called Module Specific Functions (MSF), which contains
+ the functions of the driver that are network driver interface and
+ Operating System specific.
+ - a lower module called Hardware Control Functions (HCF), which contains
+ the functions to interface to the Network Interface Card (NIC). The HCF
+ provides for all WaveLAN NIC types one standard interface to the MSF.
+ This I/F is called the Wireless Connection Interface (WCI) and is the
+ subject of a seperate document (025726).
+
+ The HCF directory contains firmware images to allow the card to operate in
+ either station (STA) or Access Point (AP) mode. In the build process, the
+ files fw_h2.c and fw_h25.c are used for Hermes-II and Hermes-II.5
+ respectively. The firmware images in this release are identified as:
+ - HII Station F/W: fw_h2.c.sta
+ - HII.5 Station F/W: fw_h25.c.sta
+ - HII AccesPoint F/W: fw_h2.c.ap
+ - HII.5 AccesPoint F/W: fw_h25.c.ap
+ To build a STA or AP mode driver, the suffix .sta or .ap must be removed.
+ The files as distributed by this release build STA drivers by default.
+
+------------------------------------------------------------------------------
+2. SYSTEM REQUIREMENTS
+
+2.1 Operating System
+
+ This software can be compiled and installed with Linux kernel versions
+ 2.4.x. Although this driver should compile for other CPUs as well, as of
+ the date of this release, no CPU architectures other than x86 have been
+ verified.
+
+ wl_lkm_7_22_abg is tested with the following Linux Distributions:
+ * Red Hat version 9.0
+ * Suse version 9.0
+
+ If you're building for PC Card or Compact Flash, you need the Card Services
+ from David Hinds.
+
+ wl_lkm_7_22_abg is tested with:
+ * pcmcia-cs-3.2.7.tar.gz
+
+2.2 Free Disk Space
+
+ To compile the software you need to have the full set of Linux kernel
+ source files installed, as well as a sane build environment which includes
+ all tools necessary for compiling and linking code. Depending on the exact
+ version of the kernel, you need approximately 150 MB of free disk space.
+ Once compiled, the driver uses about 150-200 KB. Please note, this size is
+ approximate and can vary depending on which version of the driver is built.
+ In addition, adding debug tracing support increases this size.
+
+------------------------------------------------------------------------------
+3. NEW IN THIS RELEASE
+
+Version 7.22 abg - July 28, 2004
+
+------------------------------------------------------------------------------
+4. INSTALLATION NOTES
+
+ The driver files for the Linux driver are not "ready" for direct
+ installation onto any Linux computer. To build and install the driver you
+ need some expertise on the Linux operating system in general and the type
+ and version installed of the kernel installed on your computer. With this
+ knowledge you can use the driver source files provided to build your own
+ Linux driver for your specific computer and kernel.
+
+4.1 Before you start
+
+ 1) Determine the type and version of the Linux kernel of your computer and
+ check whether it meets the system requirements listed in section 2 of this
+ README.
+
+ 2) If you're building for PC Card or Compact Flash, read the Linux
+ PCMCIA-HOWTO by David Hinds. This document is probably provided on the
+ CD-ROM of your Linux distribution. You can download the latest version
+ from:
+
+ http://pcmcia-cs.sourceforge.net
+
+ Please read the section titled "Prerequisites and kernel setup" of the
+ PCMCIA-HOWTO.
+
+4.2 Build the driver for PC Card / Compact Flash
+
+ 1) Obtain a copy of the Linux PCMCIA package from a CD-ROM of your Linux
+ distribution or download the latest version.
+ For your convenience, the Agere Systems Wireless CD-ROM contains a copy of
+ the PCMCIA package in sub-directory: Xtras/Linux/PCMCIA
+
+ 2) To unpack the Linux PCMCIA package, copy it to the current working
+ directory and type:
+ % tar xzvf pcmcia-cs-x.y.z.tar.gz
+ % mv pcmcia-cs-x.y.z pcmcia-cs
+
+ Note: If you use the archive supplied on the CDROM, use archive name
+ "pc3_2_1.tgz" instead of "pcmcia-cs-3.2.7.tar.gz".
+
+ Note: even though PCMCIA code exists in the kernel source tree, the PCMCIA
+ Card Services package needs to be unpacked locally to build drivers based
+ on it.
+
+ 3) Extract the wlags49 distribution archive on top of the Linux PCMCIA
+ package.
+ % cd pcmcia-cs
+ % tar xzvf ../wl_lkm_7_22_abg.tar.gz
+
+ 4) To build and install the driver, follow the procedure below:
+ % ./Configure
+
+ Answer the presented questions. Usually the default answers are OK and
+ pressing "Enter" is enough.
+ On newer RedHat systems, however, you should specify "/usr/src/linux-2.4"
+ as the Linux source directory instead of the default "/usr/src/linux".
+
+ For more detailed information on configuration, building and installing,
+ see the PCMCIA-HOWTO.
+
+ To build the default drivers, which support Hermes-II in station mode, run
+ the Build script:
+ % ./Build
+
+ This script determines whether your system uses in-kernel PCMCIA and either
+ builds the full PCMCIA package or just the driver.
+
+ Before installing the driver with the Install script, you must become
+ 'root':
+ % su
+ ..
+ % ./Install
+
+ This script determines whether your system uses in-kernel PCMCIA and either
+ installs the full PCMCIA package or just the driver.
+
+ 5) If it becomes necessary to clean the build, issue the following
+ commands:
+ % make clean
+ % make -C lib clean
+
+4.3 Build the driver for PCI
+
+ 1) Extract the wlags49 to the current working directory.
+ % tar xzvf wl_lkm_7_22.tar.gz
+
+ Note: there is no need to unpack the driver source into a PCMCIA build
+ directory.
+
+ 2) To build the PCI driver:
+ % make -f wlags49.mk wlags49_h2_pci
+ or
+ % make -f wlags49.mk wlags49_h25_pci
+
+ 3) Install the driver.
+ % insmod ./wireless/wlags49_h25.o
+
+ 4) If it becomes necessary to clean the build.
+ % make -f wlags49.mk pci_clean
+
+4.4 Configure your Wireless PC Card
+
+ There are 3 ways to configure the driver
+ - module parameters (/etc/pcmcia/config.opts)
+ - wireless extension (/etc/pcmcia/wireless.opts)
+ - Agere configuration file (/etc/agere/iwconfig-eth#)
+
+
+4.4.1 Configure through /etc/pcmcia/config.opts
+
+ To use this method, make sure that /etc/pcmcia/wireless.opts file is either
+ absent or contains blank parameter values as shown below.
+
+ *,*,*,00:60:1D:*|*,*,*,00:02:2D:*)
+ INFO=""
+ ESSID=""
+ MODE=""
+ KEY=""
+ ;;
+
+ 1) To configure the Wireless PC Card, please refer to:
+ * The online manual page (wlags49.4)
+ % man wlags49
+ * The network adapter sections of the PCMCIA documentation.
+ % more PCMCIA-HOWTO
+
+ 2) Use an editor to configure the module parameters:
+ # vi /etc/pcmcia/config.opts
+
+ a) To connect your computer to a wireless infrastructure that includes
+ access points such as the AP-1000 or AP-500, you need to identify the
+ network name of the wireless infrastructure.
+
+ For example if your infrastructure uses the network name "My Network",
+ edit the config.opts file to include the following:
+
+ module "<driver_name>" opts "network_name=My\ Network"
+
+ Notice that the space character needs to be escaped with a backslash.
+
+ b) To connect your computer to a Residential Gateway RG-1000, you need
+ to know the RG ID (=network_name) and the encryption key. You can find
+ the RG ID on a small label on the rear of the unit.
+
+ For example if your RG-1000 has ID 225ccf and you did not change the
+ encryption key yet, edit the config.opts file to include the following:
+
+ module "<driver_name>" opts "network_name=\"225ccf\" key_1=\"25ccf\"
+ enable_encryption=Y"
+
+ If you changed your encryption key, you should specify this key as key_1
+ on the parameter line.
+
+ c) To connect your computer to a peer-to-peer network, in an environment
+ without access points, the IBSS mode is recommended.
+
+ For example to connect to a peer-to-peer network called "My Network",
+ enter the following in the config.opts file:
+
+ module "<driver_name>" opts "create_ibss=Y network_name=My\ Network"
+
+ d) Optionally you can also include a "Station Name" value that can be
+ used to indentify your computer on the wireless network.
+
+ For example if you wish to name your computer "Wave1" when connecting it
+ to a wireless infrastructure, edit the config.opts file to include the
+ following:
+
+ module "<driver_name>" opts "network_name=Ocean station_name=Wave1"
+
+ e) To connect your computer to an Ad-Hoc workgroup of wireless
+ computers, enter the following in the config.opts file:
+
+ module "<driver_name>" opts "port_type=3"
+
+ Note that the "Ad-Hoc Demo Mode" is not the recommended mode for a
+ peer-to-peer network. The configuration of this non-interoperable mode
+ is only explained here for special applications (e.g. research, or
+ compatibility with other / previous WaveLAN/IEEE products).
+
+ The IBSS mode described in c) is the preferred and interoperable mode
+ for creating a peer-to-peer network.
+
+ 3) Use an editor to modify the network options for your adapter.
+ # vi /etc/pcmcia/network.opts
+
+ The parameters need to be correct for the connected network. Check with
+ your system administrator for the correct network information. Refer to
+ the PCMCIA-HOWTO for more configuration information.
+
+ For example:
+ *,*,*,*)
+ IF_PORT=""
+ BOOTP="n"
+ IPADDR="10.0.0.5"
+ NETMASK="255.255.255.0"
+ NETWORK="10.0.0.0"
+ BROADCAST="10.0.0.255"
+ GATEWAY="10.0.0.1"
+ DOMAIN="domain.org"
+ DNS_1="dns1.domain.org"
+ ;;
+
+ RedHat and Suse do not use the network.opts to configure the driver.
+ Instead RedHat uses a GUI-based tool called 'neat' ('net.cfg' in older
+ versions) and SuSE Linux uses 'YaST'. These tools creates scripts, like
+ ifcfg-eth0, in the directory /etc/sysconfig/network-scripts. Using the
+ default GNOME menu, you can start netcfg from: Programs->System->Network
+ Configuration.
+
+ 4) Restart the PCMCIA services.
+ # /etc/rc.d/rc.pcmcia restart
+ or
+ # /etc/rc.d/init.d/pcmcia restart
+
+
+ For a more detailed description about the various configuration options and
+ definitions, please consult the Wireless documentation.
+
+4.4.2 Configure through /etc/pcmcia/wireless.opts
+
+ This driver has support for the "Wireless Extensions". This interface
+ allows the "Wireless Tools" to get statistics from the driver and allows to
+ change the configuration of the driver on the fly.
+
+ The latest versions of the PCMCIA package contain scripts that use the
+ wireless extension to configure the driver as an alternative to the
+ configuration through module parameters as described in section 4.4.1.
+ Read the /etc/pcmcia/wireless.opts file for the theory of operation. When
+ the driver is configured, go to section 4.4.1 step 3 to configure the
+ network parameters.
+
+ For more information, refer to the following WEB pages:
+ http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Linux.Wireless.Extensions.html
+ http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html
+
+4.4.3 Configure through /etc/agere/iwconfig-eth#
+
+ In addition to using either the module options or the wireless extensions
+ methods to configure a wireless device, this version of the software also
+ supports an Agere specific implementation. This was done because:
+ * Module options configures multiple devices the same.
+ * Wireless extensions parameters do not cover all of the available options
+ in the driver.
+
+ For each wireless ethernet device (identified by eth<n>, where n is a
+ positive integer), a file /etc/agere/iwconfig-eth<n> can be created which
+ contains configuration information for a wireless device. For example, the
+ file /etc/agere/iwconfig-eth1 is the config file for eth1. This file should
+ contain Key/Value pairs in the format:
+
+ <Key>=<Value>
+
+ where <Key> is the parameter to configure and <Value> is the value to
+ assign it. For example, if the config file /etc/agere/iwconfig-eth1
+ described above contains the following:
+
+ DesiredSSID=some_network
+ EnableEncryption=Y
+ Key1=net01
+ TxKey=1
+
+ this configures eth1 to associate to the ESSID 'some_network' with
+ encryption on, where the the first encryption key is 'net01' and the key to
+ use for encryption is Key 1.
+
+ Note that this only works on Agere hardware which uses this driver. For
+ other wireless drivers, or non-wireless devices, this file can be present,
+ but has no effect.
+
+ Please refer to the man page for more information on this configuration
+ file and the parameters that can be set.
+
+
+4.5 Configuring your Wireless PCI card
+
+ Note that the above method of configuring the card using
+ /etc/pcmcia/config.opts is only valid for PCMCIA/CF cards. For [mini]PCI
+ and CardBus cards, refer to your system's documentation on modules.conf to
+ load the driver with the proper options for a given wireless ethernet
+ interface. In addition, network configuration tools like 'netcfg', 'neat',
+ or 'YaST' (see Section 4.4.1, Step 3) can be used to configure the miniPCI
+ card. Lastly, the Agere configuration file described in Section 4.4.3 may
+ also be used for [mini]PCI and CardBus devices.
+
+4.6 Troubleshooting
+
+ When the Wireless PC Card is inserted, the card manager emit beeps in
+ different tones to indicate success or failure of particular configuration
+ steps.
+ a) Two high beeps
+ - The card was identified and configured successfully.
+ b) One high beep followed by a low beep
+ - The card was identified, but could not be configured.
+ - Examine the system log (dmesg) for PCMCIA error or warning messages.
+ c) One low beep
+ - The card could not be identified.
+ - Execute "cardctl ident" to display the adapter PnP information.
+ Verify the PnP information matches an entry in the PCMCIA
+ configuration file (/etc/pcmcia/config).
+ - Examine the system log (dmesg) for PCMCIA error or warning messages.
+
+ The Wireless PC Card has two LEDs that indicate the state of the adapter
+ and network.
+ * Power LED (toward the middle of the adapter)
+ - This LED indicates power has been applied, and the card is
+ functional. In normal operation mode with Card Power Management
+ disabled, it is steady-on. With Card Power Management enabled, it
+ blinks rapidly (several times per second).
+ * Transmit/Receive LED (closer to the edge of the adapter)
+ - This LED flashes when it detects transmit or receive packets.
+
+ * Both LEDs blink at the same time every 10 seconds.
+ - The adapter was unable to make contact with the named wireless
+ network. Verify the network_name, in the config.opts file matches the
+ network name of the access point.
+ * LEDs indicate normal operation with the Power LED
+ steady-on or blinking rapidly and Transmit/Receive LED flashing, but no
+ traffic.
+ - If the network is operating in normal mode (ie. port_type = 0 or not
+ specified), and a network_name has been specified, verify the
+ workstation network parameters (ifconfig, route, etc.) are correct
+ for the wireless network.
+ - If the network is operating in Ad-Hoc (peer-to-peer) mode (ie.
+ port_type = 3), the adapter needs another workstation/adapter to
+ communicate with. Verify the network parameters on both of the
+ workstations (ifconfig, route, etc.) are correct.
+
+ Refer to the online manual page for additional configuration, feature and
+ support information.
+ % man wlags49
+ or
+ % man 4 wlags49
+ or
+ % nroff -man wlags49.4 | more
+
+4.7 Identifying the software
+
+ This section explains how to identify the version of this software once it
+ is unpacked or installed.
+
+ The Linux Driver Source/Library distribution consist of two main
+ components, the driver source and the HCF module.
+
+ * To quickly identify the version of the source, type:
+ % grep DRV.*VERSION include/wireless/wl_version.h
+ #define DRV_MAJOR_VERSION 7
+ #define DRV_MINOR_VERSION 22
+
+ * To identify the revision of the HCF library contained in the driver,
+ type:
+ % grep HCF.Revision hcf/hcf.c
+ #define HCF_VERSION TEXT( "HCF$Revision: 1.8 $" )
+
+ To identify a compiled wlags49 driver, go to the directory where the driver
+ is located. Card Services drivers (wlags49_h2_cs.o and wlags49_h25_cs.o)
+ are located in:
+ /lib/modules/<kernel-version>/pcmcia
+
+ PCI drivers (wlags49_h2.o) are located in:
+ /lib/modules/<kernel-version>/kernel/drivers/net
+
+ * To retrieve the version of the source used to compile the driver, type:
+ % strings <driver_name>.o | grep Agere
+ <driver_name> v7.22-abg-Beta for PCMCIA
+ <driver_name> v7.22-abg-Beta for PCI
+
+ * Likewise, to retrieve the revision of the HCF used to compile the driver,
+ type:
+ % strings <driver_name>.o | grep Revision
+ HCF$Revision: 5.15
+
+ At startup the wlags49 driver reports its version in the system log file
+ (/var/log/messages).
+
+------------------------------------------------------------------------------
+5. TECHNICAL CONSTRAINTS
+
+ At the time of release of this software, the following constraints are
+ identified:
+
+5.1 Using the ISA adapter
+
+ Description: To allow operation in desktop computers Agere also provides an
+ optional ISA bus to PC Card adapter (also referred to as "swapbox").
+
+ This ISA Adapter can be configured for two different I/O Address values:
+ * 3E2 (factory-set default)
+ * 3E0
+
+ Impact: By default the i82365 module of the Linux pcmcia package only
+ probes at 3E0.
+
+ Actions:
+ 1) Read the manual page on the probing of the i82365 module, by typing the
+ command:
+ man i82365
+
+ 2) Apply one of the two following options:
+ a) Change the I/O address strapping of the ISA adapter by replacing the
+ jumper on the ISA adapter. The correct jumper setting is pictured in
+ the electronic "Wireless ISA Adapter, Getting Started Guide" provided
+ on the Wireless Software CD-ROM. This guide is provided in Adobe's
+ Acrobat PDF format.
+
+ b) Alternatively, you can load the i82365 module with the
+ "extra_sockets" parameter set to 1.
+
+ On a RedHat 5.x thru 7.x, system, put this in the file
+ "/etc/sysconfig/pcmcia":
+ PCMCIA=yes
+ PCIC=i82365
+ PCIC_OPTS="extra_sockets=1"
+ CORE_OPTS=
+ CARDMGR_OPTS=
+
+ For other Linux distributions, you are advised to consult the
+ "PCMCIA-HOWTO" notes for information about changing the I/O Address
+ probing.
+
+5.2 Using the PCI Adapter
+
+ Description: To allow operation in desktop computers Agere also provides an
+ optional PCI bus to PC Card adapter (also referred to as "swapbox").
+
+ For correct interrupt assignment, the system should support PCIBIOS 2.2.
+ It is recommended to use PCMCIA package version 3.2.7 or higher.
+
+ The default configuration of the interrupt routing method of the PCI
+ Adapter's TI CardBus Controller is incorrect.
+
+ Actions:
+ 1) Read the manual page on the "Options specific for TI CardBus
+ Controllers" of the i82365 module, by typing the command:
+ man i82365
+
+ 2) Load the i82365 module with the "irq_mode" parameter set to 0.
+ On a RedHat 5.x thru 7.x system, put this in the file
+ "/etc/sysconfig/pcmcia":
+ PCMCIA=yes
+ PCIC=i82365
+ PCIC_OPTS="irq_mode=0"
+ CORE_OPTS=
+ CARDMGR_OPTS=
+
+ For the location of the PCMCIA scripts on other Linux distributions, you
+ are advised to consult the "PCMCIA-HOWTO", "Notes about specific Linux
+ distributions".
+
+------------------------------------------------------------------------------
+6. KNOWN ISSUES
+
+ This is the current list of known issues for this release, and will be
+ addressed in the near future:
+
+ 1. This driver release contains a version of Hermes-II.5 firmware which
+ REQUIRES calibrated cards. If there is no calibration data present in the
+ PDA of the hardware, the firmware does not operate.
+
+ 2. WDS is not yet supported.
+
+ 3. DMA is not yet supported.
+
+ 4. WPA is not yet supported.
+
+ 5. 32-bits I/O is not yet supported.
+
+ 6. The current Build script also builds the PCI drivers.
+
+ 7. The current Install script also copies the PCI drivers to the lib
+ directory.
+
+ 8. If F/W files are required from outside this release, the entry points
+ inside these F/W files have to be renamed from "ap" and "station" to
+ "fw_image" and they have to be renamed to fw_h2.c and fw_h25.c for
+ Hermes-II and Hermes-II.5.
+
+------------------------------------------------------------------------------
+7. TECHNICAL SUPPORT
+
+7.1 Finding Information
+
+ On the Agere Systems Web Site you can find the most recent device drivers,
+ software updates and user documentation.
+
+ World Wide Web: http://www.agere.com
+
+7.2 Contact Technical Support
+
+ If you encounter problems when installing or using this product, or would
+ like information about our other "Wireless" products, please contact your
+ local Authorized "Wireless" Reseller or Agere Systems sales office.
+
+ Addresses and telephone numbers of the Agere Systems sales offices are
+ listed on our Agere Systems web site.
+
+ When contacting Technical Support, please use the Problem Report Form and
+ send it to us by Fax or E-Mail. The Problem Report Form 'REPORT.TXT'
+ (Plain text format) is included on the disk. Alternatively, you can
+ download the Problem Report Form from the Agere Systems web site.
+
+ Include Product Name, Serial Number and software version number with each
+ request to help the Support Group helping you.
+
+==============================================================================
+ END OF FILE
diff --git a/drivers/staging/wlags49_h2/WARNING.txt b/drivers/staging/wlags49_h2/WARNING.txt
new file mode 100644
index 000000000000..5d12973ba19c
--- /dev/null
+++ b/drivers/staging/wlags49_h2/WARNING.txt
@@ -0,0 +1,3 @@
+These sources are shared with the wlags49_h25 driver. Some files are even
+exclusively used by that driver. Do not delete them here without looking
+at that other driver.
diff --git a/drivers/staging/wlags49_h2/ap_h2.c b/drivers/staging/wlags49_h2/ap_h2.c
new file mode 100644
index 000000000000..f5123d2cb4c1
--- /dev/null
+++ b/drivers/staging/wlags49_h2/ap_h2.c
@@ -0,0 +1,3337 @@
+/*
+ * File: ap_h24.236
+ *
+ * Abstract: This file contains memory image 'fw_image'.
+ *
+ * Contents: Total size of the memory image: 51010 bytes.
+ * Total number of blocks: 4 blocks.
+ * Block 1 : load address 00000060, 326 bytes.
+ * Block 2 : load address 00000C16, 6424 bytes.
+ * Block 3 : load address 001E252E, 444 bytes.
+ * Block 4 : load address 001F4000, 43816 bytes.
+ *
+ * Identity: component id: 32 (variant 2) version 2.36
+ *
+ * Compatibility:
+ * supplying interface 8 (variant 2) : 2 - 4
+ * acting on interface 1 (variant 4) : 6 - 7
+ * acting on interface 1 (variant 5) : 6 - 7
+ * acting on interface 1 (variant 6) : 6 - 7
+ * acting on interface 2 (variant 2) : 1 - 2
+ *
+ * Generated: by g:\fw\fupu3.exe version 4.26
+ *
+ * Commandline: g:\fw\fupu3.exe /f=4 /n=fw_image /i=t2023600.hex
+ */
+
+
+#include "hcfcfg.h" // to get hcf_16 etc defined as well as
+ // possible settings which inluence mdd.h or dhf.h
+#include "mdd.h" //to get COMP_ID_STA etc defined
+#include "dhf.h" //used to be "fhfmem.h", to get memblock,plugrecord,
+
+static const hcf_8 fw_image_1_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0D, 0x00, 0x00,
+ 0x3A, 0x0C, 0x00, 0x00, 0x3A, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00,
+ 0x0A, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xEA, 0x00, 0x00, 0xFF, 0x07, 0x02, 0x00, 0x64, 0x00, 0x64, 0x00, 0x10, 0x27, 0x10, 0x27,
+ 0x14, 0x00, 0xD0, 0x07, 0xD0, 0x07, 0x10, 0x27, 0x2F, 0x00, 0x32, 0x00, 0x32, 0x00, 0x05, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x10, 0x27, 0x05, 0x00, 0x00, 0x02, 0x00, 0x02, 0x13, 0x00, 0x0A, 0x00,
+ 0x07, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x09, 0x2B, 0x09, 0x2B, 0x09,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x14, 0x01, 0x00, 0x40, 0x00, 0x32, 0x00, 0x32, 0x00,
+ 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_1_data */
+
+static const hcf_8 fw_image_2_data[] = {
+ 0x9B, 0xA7, 0x00, 0x0A, 0x10, 0x01, 0x68, 0xA4, 0xB0, 0x01, 0x84, 0x01, 0x30, 0x33, 0x31, 0x33,
+ 0x44, 0x44, 0x30, 0x33, 0x31, 0x33, 0x30, 0x33, 0x31, 0x33, 0x32, 0x33, 0x32, 0x33, 0x90, 0x00,
+ 0x78, 0x04, 0xAE, 0xE4, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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00, 0x30, 0x00, 0x31, 0x00, 0x33,
+ 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x38, 0x00, 0x3A, 0x00, 0x3B,
+ 0x00, 0x3C, 0x00, 0x3D, 0x00, 0x3E, 0x00, 0x3F, 0x00, 0x3F, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x02, 0x14,
+ 0x05, 0x32, 0x0B, 0x37, 0x08, 0x50, 0x0B, 0x6E, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x3F, 0x00,
+ 0x0C, 0x00, 0x30, 0x00, 0x03, 0x00, 0x0F, 0x00, 0x3E, 0x00, 0x3C, 0x00, 0x02, 0x00, 0x04, 0x00,
+ 0x0A, 0x00, 0x0B, 0x00, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x63, 0x00, 0x20, 0x00, 0x63, 0x00, 0x63, 0x00, 0x20, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x10,
+ 0x9E, 0x10, 0x56, 0x10, 0x98, 0x10, 0x5C, 0x10, 0x92, 0x10, 0x62, 0x10, 0x8C, 0x10, 0x68, 0x10,
+ 0x86, 0x10, 0x6E, 0x10, 0x80, 0x10, 0x74, 0x10, 0x7A, 0x10, 0x07, 0x01, 0x00, 0x00, 0x0A, 0x22,
+ 0x00, 0x04, 0x08, 0x01, 0x00, 0x00, 0x0A, 0x26, 0x00, 0x04, 0x09, 0x01, 0x00, 0x00, 0x0A, 0x2A,
+ 0x00, 0x04, 0x0A, 0x01, 0x00, 0x00, 0x0A, 0x2E, 0x00, 0x04, 0x0B, 0x01, 0x00, 0x00, 0x10, 0x24,
+ 0x04, 0x04, 0x0C, 0x01, 0x00, 0x00, 0x10, 0x28, 0x04, 0x04, 0x0D, 0x01, 0x00, 0x00, 0x10, 0x2C,
+ 0x04, 0x04, 0x0E, 0x01, 0x00, 0x00, 0x10, 0x30, 0x04, 0x04, 0x0F, 0x01, 0x00, 0x00, 0x16, 0x34,
+ 0x08, 0x04, 0x10, 0x01, 0x00, 0x00, 0x16, 0x38, 0x08, 0x04, 0x11, 0x01, 0x00, 0x00, 0x16, 0x3C,
+ 0x08, 0x04, 0x12, 0x01, 0x00, 0x00, 0x16, 0x40, 0x08, 0x04, 0x13, 0x01, 0x00, 0x00, 0x17, 0x64,
+ 0x0C, 0x0B, 0x14, 0x01, 0x00, 0x00, 0x17, 0x68, 0x0C, 0x0B, 0x15, 0x01, 0x00, 0x00, 0x17, 0x6C,
+ 0x0C, 0x0B, 0x16, 0x01, 0x00, 0x00, 0x17, 0x70, 0x0C, 0x0B, 0x17, 0x01, 0x00, 0x00, 0x17, 0x74,
+ 0x0C, 0x0B, 0x18, 0x01, 0x00, 0x00, 0x17, 0x78, 0x0C, 0x0B, 0x19, 0x01, 0x00, 0x00, 0x17, 0x7C,
+ 0x0C, 0x0B, 0x1A, 0x01, 0x00, 0x00, 0x17, 0x80, 0x0C, 0x0B, 0x1B, 0x01, 0x00, 0x00, 0x17, 0x84,
+ 0x0C, 0x0B, 0x1C, 0x01, 0x00, 0x00, 0x17, 0x88, 0x0C, 0x0B, 0x1D, 0x01, 0x00, 0x00, 0x17, 0x8C,
+ 0x0C, 0x0B, 0x1E, 0x01, 0x00, 0x00, 0x1D, 0x95, 0x17, 0x04, 0x1F, 0x01, 0x00, 0x00, 0x1D, 0x99,
+ 0x17, 0x04, 0x20, 0x01, 0x00, 0x00, 0x1D, 0x9D, 0x17, 0x04, 0x21, 0x01, 0x00, 0x00, 0x1D, 0xA1,
+ 0x17, 0x04, 0x22, 0x01, 0x00, 0x00, 0x0E, 0xA5, 0x00, 0x00, 0xC0, 0x10, 0xE0, 0x10, 0x00, 0x11,
+ 0x20, 0x11, 0x78, 0x11, 0xC8, 0x10, 0xE8, 0x10, 0x08, 0x11, 0x28, 0x11, 0x80, 0x11, 0xD0, 0x10,
+ 0xF0, 0x10, 0x10, 0x11, 0x30, 0x11, 0x88, 0x11, 0xD8, 0x10, 0xF8, 0x10, 0x18, 0x11, 0x38, 0x11,
+ 0x90, 0x11, 0x40, 0x11, 0x48, 0x11, 0x50, 0x11, 0x58, 0x11, 0x60, 0x11, 0x68, 0x11, 0x70, 0x11,
+ 0x98, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD2, 0x14, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA1, 0xEB, 0xBA, 0xEB,
+ 0xDF, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB,
+ 0x57, 0xEB, 0x90, 0xF1, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0xD6, 0xED,
+ 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB,
+ 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57, 0xEB, 0x57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08,
+ 0x02, 0x00, 0x85, 0xFD, 0xBC, 0xEF, 0x73, 0xEE, 0x1C, 0x0A, 0x02, 0x00, 0x00, 0xF1, 0x46, 0x00,
+ 0x2D, 0xEE, 0xF8, 0x00, 0x00, 0x03, 0x8A, 0xEA, 0x1F, 0x00, 0x36, 0x01, 0xCA, 0x00, 0x96, 0x01,
+ 0xCE, 0x00, 0xFC, 0x00, 0x78, 0x01, 0xDA, 0x1E, 0x1A, 0x01, 0x86, 0x1B, 0xC8, 0x00, 0x00, 0x00,
+ 0xCE, 0x12, 0x00, 0x00, 0xD2, 0x14, 0x14, 0x01, 0x03, 0x00, 0xAE, 0x00, 0xE4, 0x00, 0x3C, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x77, 0xB4, 0xEA, 0xB3, 0x26, 0xB5, 0x2F, 0xB5, 0xFB, 0xB3, 0xA4, 0xB4, 0x69, 0xB4, 0xE7, 0xC5,
+ 0x4A, 0xC5, 0xE7, 0xC5, 0xBE, 0xC5, 0x54, 0xC5, 0x48, 0xC5, 0x06, 0xC6, 0x17, 0xC6, 0x17, 0xC6,
+ 0x17, 0xC6, 0x20, 0xC6, 0x3B, 0xC6, 0x98, 0xC6, 0xB4, 0xC6, 0xBF, 0xC5, 0xD2, 0xC5, 0xA6, 0xC5,
+ 0x10, 0x00, 0x12, 0x00, 0x13, 0x00, 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x30, 0x00, 0x31, 0x00,
+ 0x32, 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x39, 0x00,
+ 0x3A, 0x00, 0x00, 0x00, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01,
+ 0x14, 0x01, 0x14, 0x01, 0xF3, 0x02, 0xAD, 0x03, 0x60, 0x04, 0x04, 0x05, 0x07, 0x06, 0x08, 0x07,
+ 0x0A, 0x08, 0x16, 0x09, 0x44, 0x0A, 0x04, 0x0B, 0x40, 0x0C, 0x80, 0x0D, 0x00, 0x0E, 0x84, 0x0F,
+ 0x01, 0x10, 0x10, 0x11, 0x02, 0x14, 0x40, 0x20, 0x32, 0x21, 0x32, 0x22, 0x04, 0x23, 0x01, 0x24,
+ 0x0F, 0x25, 0x00, 0x26, 0x00, 0x27, 0x00, 0x28, 0x00, 0x29, 0x00, 0x2A, 0x01, 0x2B, 0x06, 0x2C,
+ 0x00, 0x38, 0x00, 0x39, 0xD6, 0x3A, 0x00, 0x3B, 0x00, 0x3C, 0x14, 0x3D, 0x7F, 0x3E, 0x00, 0x3F,
+ 0x68, 0x40, 0x75, 0x41, 0x07, 0x42, 0x07, 0x43, 0x00, 0x45, 0x3B, 0x4A, 0x00, 0x4B, 0x00, 0x4C,
+ 0x0F, 0x4D, 0x02, 0x75, 0x00, 0x76, 0x80, 0x00, 0x08, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x01,
+ 0x0A, 0x01, 0x0B, 0x01, 0x0B, 0x01, 0x0C, 0x01, 0x0C, 0x01, 0x0D, 0x01, 0x0D, 0x01, 0x0E, 0x01,
+ 0x0E, 0x01, 0x0F, 0x01, 0x0F, 0x01, 0x10, 0x01, 0x10, 0x01, 0x11, 0x01, 0x11, 0x01, 0x12, 0x01,
+ 0x12, 0x01, 0x13, 0x01, 0x13, 0x01, 0x14, 0x01, 0x14, 0x01, 0x15, 0x01, 0x15, 0x01, 0x16, 0x01,
+ 0x16, 0x01, 0x17, 0x01, 0x17, 0x01, 0x18, 0x01, 0x18, 0x01, 0x19, 0x01, 0x19, 0x01, 0x4D, 0x01,
+ 0x4D, 0x01, 0x4E, 0x01, 0x4E, 0x01, 0x4F, 0x01, 0x4F, 0x01, 0x50, 0x01, 0x50, 0x01, 0x51, 0x01,
+ 0x51, 0x01, 0x52, 0x01, 0x52, 0x01, 0x53, 0x01, 0x53, 0x01, 0x54, 0x01, 0x54, 0x01, 0x65, 0x01,
+ 0x65, 0x01, 0x66, 0x01, 0x66, 0x01, 0x67, 0x01, 0x67, 0x01, 0x68, 0x01, 0x68, 0x01, 0x69, 0x01,
+ 0x69, 0x01, 0x6A, 0x01, 0x6A, 0x01, 0x6B, 0x01, 0x6B, 0x01, 0x6C, 0x01, 0x6C, 0x01, 0x6D, 0x01,
+ 0x6D, 0x01, 0x6E, 0x01, 0x6E, 0x01, 0x6F, 0x01, 0x6F, 0x01, 0x70, 0x01, 0x70, 0x01, 0x71, 0x01,
+ 0x71, 0x01, 0x72, 0x01, 0x72, 0x01, 0x73, 0x01, 0x73, 0x01, 0x74, 0x01, 0x74, 0x01, 0x75, 0x01,
+ 0x75, 0x01, 0x76, 0x01, 0x76, 0x01, 0x77, 0x01, 0x77, 0x01, 0x78, 0x01, 0x78, 0x01, 0x79, 0x01,
+ 0x79, 0x01, 0x7A, 0x01, 0x7A, 0x01, 0x7B, 0x01, 0x7B, 0x01, 0x7C, 0x01, 0x7C, 0x01, 0x7D, 0x01,
+ 0x7D, 0x01, 0x7E, 0x01, 0x7E, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12,
+ 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12,
+ 0x80, 0x12, 0x80, 0x12, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13,
+ 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13,
+ 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44,
+ 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x22, 0x46, 0x22, 0x46,
+ 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46,
+ 0x22, 0x46, 0x23, 0x46, 0x23, 0x46, 0x23, 0x46, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1D, 0x47, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48,
+ 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0x33, 0x48,
+ 0x78, 0x49, 0x78, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x7A, 0x49, 0x7A, 0x49,
+ 0x7A, 0x49, 0x7A, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7C, 0x49, 0x32, 0x00, 0x46, 0x00,
+ 0x5A, 0x00, 0x6E, 0x00, 0x82, 0x00, 0x96, 0x00, 0xAA, 0x00, 0xBE, 0x00, 0xD2, 0x00, 0xE6, 0x00,
+ 0xFA, 0x00, 0x0E, 0x01, 0x22, 0x01, 0x52, 0x01, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00,
+ 0x04, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70,
+ 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00,
+ 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32,
+ 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70,
+ 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00,
+ 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32,
+ 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x69, 0x72, 0x73, 0x74, 0x20,
+ 0x57, 0x61, 0x76, 0x65, 0x4C, 0x41, 0x4E, 0x20, 0x49, 0x49, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x02, 0x01, 0x82, 0x84, 0x8B, 0x96, 0x00, 0x00,
+ 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
+ 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xDD, 0x00, 0x50, 0xF2, 0x01,
+ 0x01, 0x00, 0x00, 0x50, 0xF2, 0x05, 0x02, 0x00, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x50, 0xF2, 0x04,
+ 0x02, 0x00, 0x00, 0x50, 0xF2, 0x00, 0x00, 0x50, 0xF2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00,
+ 0x15, 0x00, 0x02, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x04, 0x00, 0x10, 0x00, 0x02, 0x00,
+ 0x01, 0x00, 0x04, 0x00, 0x15, 0x00, 0x20, 0x00, 0x11, 0x00, 0x20, 0x00, 0x1E, 0x1F, 0x8E, 0x21,
+ 0x00, 0x23, 0xDA, 0x22, 0x04, 0x23, 0xC0, 0x21, 0xFF, 0xFF, 0xFF, 0xFF, 0x34, 0x23, 0x00, 0x00,
+ 0x50, 0x21, 0x8E, 0x21, 0xFF, 0xFF, 0x00, 0x00, 0x1E, 0x1F, 0x8E, 0x21, 0x00, 0x23, 0xFF, 0xFF,
+ 0x04, 0x23, 0xC0, 0x21, 0xFF, 0xFF, 0xFF, 0xFF, 0x34, 0x23, 0x00, 0x00, 0x8E, 0x21, 0x3C, 0x23,
+ 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x00, 0x06, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80,
+ 0x00, 0x60, 0x1D, 0x00, 0x00, 0x00, 0x0D, 0x81, 0x00, 0x60, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_2_data */
+
+static const hcf_8 fw_image_3_data[] = {
+ 0x3F, 0x41, 0xA5, 0x4C, 0x50, 0x37, 0x04, 0x00, 0x01, 0xB9, 0x41, 0x5F, 0xB5, 0x60, 0x55, 0xE0,
+ 0x0C, 0x60, 0x10, 0x62, 0xA2, 0xD3, 0x01, 0x60, 0x01, 0x65, 0xD4, 0x80, 0x5A, 0xD1, 0x0F, 0x02,
+ 0x5A, 0xD3, 0x3E, 0x60, 0x00, 0x66, 0xE0, 0x87, 0x40, 0x4A, 0xEA, 0x60, 0x88, 0x61, 0x64, 0x44,
+ 0xC8, 0x84, 0x0C, 0x63, 0xAA, 0x46, 0x58, 0xD0, 0xAA, 0x46, 0x59, 0xD8, 0xFB, 0x1F, 0x08, 0x60,
+ 0x00, 0x63, 0xFA, 0x60, 0x00, 0x65, 0xBD, 0xD3, 0xA3, 0xD3, 0x02, 0xA8, 0xD4, 0x80, 0x61, 0x02,
+ 0x60, 0x02, 0x26, 0x60, 0x6A, 0x61, 0x3C, 0x60, 0x00, 0x66, 0x41, 0x4B, 0x2B, 0x41, 0x26, 0x60,
+ 0xB2, 0x7C, 0xD1, 0x80, 0xA1, 0xD2, 0x25, 0x05, 0x59, 0xD0, 0x60, 0x45, 0x59, 0xD2, 0x44, 0x47,
+ 0xE0, 0x87, 0x40, 0x4A, 0x59, 0xD2, 0x59, 0x8B, 0x40, 0x4C, 0x08, 0x60, 0x00, 0x63, 0xBE, 0xD3,
+ 0xBD, 0xD1, 0xEC, 0x18, 0xD4, 0x80, 0xEA, 0x18, 0x03, 0x03, 0xC3, 0x83, 0xC3, 0x83, 0xF7, 0x01,
+ 0x67, 0x44, 0xC0, 0x84, 0xE0, 0x85, 0x2C, 0x44, 0xD4, 0x80, 0x63, 0x41, 0x01, 0x06, 0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 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x87, 0xF3, 0x88, 0xF3, 0xDC, 0x81, 0x00, 0x7C, 0x01, 0x00, 0x00, 0xFA, 0x60, 0x46, 0xFE, 0x63,
+ 0xA3, 0xD8, 0xFE, 0x1F, 0xCD, 0x81, 0xD8, 0x84, 0xF8, 0x02, 0x87, 0xF3, 0x88, 0xF5, 0xDC, 0x81,
+ 0x80, 0x67, 0x40, 0x4A, 0x14, 0x60, 0x02, 0x65, 0x01, 0x7C, 0x07, 0x18, 0x2A, 0x43, 0x02, 0xFC,
+ 0x5F, 0x8A, 0x8E, 0xF8, 0x70, 0xF8, 0x00, 0xF4, 0xF8, 0x01, 0x2E, 0x58, 0xFF, 0xFF, 0x89, 0xF5,
+ 0x06, 0x64, 0x66, 0x43, 0x00, 0x7C, 0x63, 0x46, 0xFE, 0x63, 0xA3, 0xD8, 0xFE, 0x1F, 0xCC, 0x84,
+ 0x66, 0x43, 0xDB, 0x83, 0xF8, 0x02, 0x14, 0x60, 0x02, 0x65, 0x09, 0x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3, 0x0F, 0x60, 0xFE, 0x65, 0x0C, 0xF3, 0x24, 0x86, 0x24, 0x46, 0x60, 0x40,
+ 0xFB, 0x3B, 0x07, 0x00, 0x80, 0x26, 0x02, 0x00, 0x23, 0x46, 0x03, 0x4C, 0x46, 0x61, 0x3A, 0x65,
+ 0x0C, 0x00, 0x2E, 0xF3, 0x40, 0x45, 0xF8, 0x2B, 0x02, 0x00, 0x40, 0x45, 0x03, 0x00, 0x58, 0x4F,
+ 0x39, 0x00, 0x07, 0x02, 0x58, 0x4F, 0x45, 0x00, 0x04, 0x05, 0x66, 0x50, 0x65, 0x52, 0x61, 0x51,
+ 0x09, 0x00, 0x26, 0x47, 0x00, 0xBF, 0x0E, 0xFB, 0x2E, 0xF5, 0x05, 0xF0, 0x80, 0x60, 0x64, 0x50,
+ 0x00, 0x72, 0x7E, 0x71, 0xAC, 0xFF, 0xB1, 0x60, 0xC0, 0x78, 0xFF, 0xFF, 0x8E, 0xFF, 0x0F, 0xF3,
+ 0x0F, 0x60, 0xFE, 0x65, 0x24, 0x86, 0x0D, 0xF3, 0x2E, 0xF3, 0x40, 0x45, 0xF8, 0x2B, 0x02, 0x00,
+ 0x40, 0x45, 0x03, 0x00, 0x58, 0x4F, 0x16, 0x00, 0x07, 0x02, 0x58, 0x4F, 0x22, 0x00, 0x04, 0x05,
+ 0x66, 0x50, 0x65, 0x52, 0x61, 0x51, 0x09, 0x00, 0x26, 0x47, 0x00, 0xBF, 0x0F, 0xFB, 0x2E, 0xF5,
+ 0x05, 0xF0, 0x80, 0x60, 0x64, 0x50, 0x00, 0x72, 0x7E, 0x71, 0x8D, 0xFF, 0xAD, 0xFF, 0xB1, 0x60,
+ 0xC0, 0x78, 0xFF, 0xFF, 0x25, 0x44, 0x8A, 0xF1, 0x8B, 0xF1, 0xD0, 0x80, 0xD0, 0x80, 0x07, 0x04,
+ 0x01, 0x06, 0x05, 0x00, 0x25, 0x46, 0x01, 0xF0, 0x03, 0x67, 0xA0, 0x85, 0x94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10, 0x26, 0x01, 0x00, 0x2D, 0x00, 0xA3, 0x46, 0x37, 0xF2, 0xFF, 0xFF, 0x60, 0x40,
+ 0x80, 0x2B, 0x53, 0x00, 0x3A, 0x00, 0xA3, 0x46, 0x65, 0x44, 0x01, 0x26, 0x0B, 0x00, 0x04, 0x26,
+ 0x03, 0x00, 0x10, 0x26, 0x01, 0x00, 0x1D, 0x00, 0x37, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x27,
+ 0x2C, 0x00, 0x17, 0x00, 0x88, 0xF3, 0xFF, 0xFF, 0x60, 0x46, 0x36, 0xF2, 0x66, 0x43, 0xFF, 0xB4,
+ 0x3C, 0x46, 0x22, 0xF0, 0x60, 0x47, 0xB0, 0x84, 0x22, 0xFA, 0x63, 0x46, 0x37, 0xF0, 0x60, 0x40,
+ 0x04, 0x27, 0x03, 0x00, 0x10, 0x27, 0x01, 0x00, 0x04, 0x00, 0x64, 0x40, 0x80, 0x27, 0x15, 0x00,
+ 0x00, 0x00, 0x3C, 0x46, 0x02, 0x65, 0xBC, 0x60, 0x58, 0x78, 0xFF, 0xFF, 0xCD, 0x81, 0x63, 0x42,
+ 0x5A, 0xD0, 0x3C, 0x46, 0x0A, 0x02, 0x64, 0x44, 0x88, 0x3A, 0x07, 0x00, 0x77, 0x37, 0x1D, 0x00,
+ 0x78, 0x37, 0x1B, 0x00, 0x8E, 0x37, 0x19, 0x00, 0xF1, 0x01, 0x3C, 0x46, 0x22, 0xF0, 0x80, 0x67,
+ 0xB0, 0x84, 0xA2, 0xDA, 0xFF, 0xFF, 0x3F, 0xF2, 0x3E, 0xF0, 0x08, 0xA4, 0x60, 0x41, 0x22, 0xF2,
+ 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x26, 0x03, 0x00, 0x04, 0x26, 0x03, 0x00, 0x06, 0x00, 0x04, 0x2B,
+ 0x04, 0x00, 0x61, 0x44, 0x64, 0x40, 0x10, 0x26, 0x3F, 0xFA, 0x3C, 0x46, 0x2C, 0xF2, 0x27, 0x40,
+ 0x01, 0x27, 0x32, 0xF2, 0xB5, 0xF1, 0x60, 0x40, 0x01, 0x26, 0x53, 0x00, 0x09, 0x60, 0x00, 0x64,
+ 0xD0, 0x80, 0x3F, 0xF2, 0x09, 0x06, 0x2C, 0x45, 0xC4, 0x84, 0xD0, 0x80, 0x40, 0x4A, 0x40, 0x06,
+ 0x60, 0x43, 0x64, 0x44, 0x54, 0x88, 0x18, 0x00, 0x60, 0x45, 0x1F, 0x60, 0x9C, 0x64, 0xA0, 0xD3,
+ 0xBB, 0xF3, 0x00, 0xBC, 0x60, 0x47, 0xEC, 0xA0, 0x33, 0x03, 0x32, 0x07, 0x2C, 0x44, 0xC4, 0x81,
+ 0x02, 0x60, 0x1C, 0x65, 0x45, 0x4A, 0xD5, 0x80, 0x2C, 0x45, 0x2A, 0x06, 0x27, 0x40, 0x04, 0x27,
+ 0x30, 0x00, 0x2A, 0x43, 0xD7, 0x85, 0x45, 0x48, 0xB6, 0xF1, 0x0F, 0xF2, 0xD3, 0x80, 0x01, 0x65,
+ 0x01, 0x07, 0x00, 0x65, 0xB4, 0x84, 0x0F, 0xFA, 0x00, 0x63, 0x3F, 0xF2, 0x28, 0x45, 0x60, 0x41,
+ 0xD4, 0x84, 0xDF, 0x83, 0xFC, 0x07, 0x14, 0xFC, 0x61, 0x44, 0x01, 0x36, 0x02, 0x00, 0x09, 0x3A,
+ 0x06, 0x00, 0x28, 0x44, 0x48, 0x88, 0x2A, 0x44, 0xC8, 0x83, 0x43, 0x4A, 0xE5, 0x01, 0x17, 0xFA,
+ 0x04, 0x60, 0x00, 0x64, 0x27, 0x45, 0xB4, 0x84, 0x2A, 0xFA, 0x28, 0x43, 0x16, 0xFC, 0x0D, 0x00,
+ 0x3F, 0xF2, 0x2C, 0x45, 0xB6, 0xF1, 0xC4, 0x81, 0xD1, 0x80, 0x0F, 0xF2, 0x01, 0x06, 0x01, 0xBC,
+ 0x0F, 0xFA, 0x3F, 0xF2, 0x17, 0xFA, 0x01, 0x64, 0x14, 0xFA, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46,
+ 0x0E, 0xF0, 0x63, 0x46, 0x00, 0x7F, 0x64, 0x5E, 0x4B, 0xFB, 0x64, 0x44, 0x00, 0x7E, 0xBB, 0xFB,
+ 0x62, 0xF1, 0x60, 0x43, 0x60, 0x47, 0xD0, 0x80, 0xC0, 0x65, 0x01, 0x06, 0x64, 0x44, 0x0A, 0x36,
+ 0x70, 0x64, 0x14, 0x36, 0x38, 0x64, 0x37, 0x36, 0x15, 0x64, 0x6E, 0x36, 0x0B, 0x64, 0x44, 0x86,
+ 0x2A, 0xF2, 0x07, 0xF0, 0x60, 0x40, 0xB0, 0x3A, 0x03, 0x00, 0x40, 0x3B, 0x01, 0x00, 0x12, 0x00,
+ 0x0C, 0xB4, 0x08, 0x3A, 0x55, 0x00, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x2B, 0x50, 0x00,
+ 0x17, 0xF2, 0x22, 0xF0, 0xFF, 0xFF, 0x64, 0x40, 0x22, 0x22, 0x04, 0x00, 0x00, 0xA8, 0x01, 0xA8,
+ 0x47, 0x03, 0x46, 0x03, 0x3C, 0x46, 0x2A, 0xF0, 0x40, 0x67, 0xB0, 0x84, 0xA2, 0xDA, 0x60, 0x45,
+ 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x43, 0x60, 0x40, 0x01, 0x26, 0x03, 0x00, 0x04, 0x26, 0x0A, 0x00,
+ 0x02, 0x00, 0x04, 0x27, 0x07, 0x00, 0x65, 0x44, 0x2A, 0x65, 0x60, 0x40, 0x03, 0x2B, 0x24, 0x65,
+ 0x45, 0x4C, 0x2E, 0x00, 0x65, 0x44, 0x2E, 0x65, 0x60, 0x40, 0x03, 0x2B, 0x28, 0x65, 0x45, 0x4C,
+ 0x07, 0xF0, 0x88, 0xF3, 0xFF, 0xFF, 0xD0, 0x80, 0x00, 0x7C, 0x03, 0x03, 0x63, 0x40, 0x01, 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 0x2A, 0xF0, 0xFF, 0xFF, 0x64, 0x40,
+ 0x08, 0x2A, 0x20, 0x00, 0x32, 0x40, 0x02, 0x2A, 0x1D, 0x00, 0x03, 0x67, 0xA0, 0x84, 0x00, 0x37,
+ 0x64, 0x63, 0x60, 0x40, 0x02, 0x37, 0x5E, 0x63, 0x60, 0x40, 0x01, 0x37, 0x58, 0x63, 0x60, 0x40,
+ 0x03, 0x37, 0x0D, 0x00, 0xBD, 0xD2, 0x67, 0xF1, 0xBD, 0xD2, 0xD0, 0x80, 0x68, 0xF1, 0x07, 0x02,
+ 0xD0, 0x80, 0xBD, 0xD2, 0x69, 0xF1, 0x03, 0x02, 0xD0, 0x80, 0xFF, 0xFF, 0x03, 0x03, 0xCB, 0x60,
+ 0xBC, 0x78, 0xFF, 0xFF, 0x2A, 0xF2, 0x87, 0xF4, 0x60, 0x40, 0x03, 0x2B, 0x31, 0x00, 0x89, 0xF3,
+ 0x06, 0x61, 0x60, 0x43, 0x66, 0x45, 0x31, 0xF0, 0x63, 0x46, 0x05, 0xF2, 0x65, 0x46, 0xD0, 0x80,
+ 0x30, 0xF0, 0x0F, 0x02, 0x63, 0x46, 0x04, 0xF2, 0x65, 0x46, 0xD0, 0x80, 0x2F, 0xF0, 0x09, 0x02,
+ 0x63, 0x46, 0x03, 0xF2, 0x65, 0x46, 0xD0, 0x80, 0xFF, 0xFF, 0x03, 0x02, 0xFF, 0xFF, 0x48, 0xFE,
+ 0x06, 0x00, 0xCD, 0x81, 0x02, 0xA3, 0xE7, 0x02, 0x88, 0xF1, 0x08, 0xFE, 0x64, 0x43, 0x03, 0x03,
+ 0xCB, 0x60, 0xBC, 0x78, 0xFF, 0xFF, 0x43, 0x43, 0x23, 0x46, 0x06, 0xF0, 0x26, 0x46, 0x07, 0x67,
+ 0xA0, 0x84, 0x23, 0xFA, 0x64, 0x40, 0x02, 0x26, 0x2B, 0x00, 0xCB, 0x60, 0xBC, 0x78, 0xFF, 0xFF,
+ 0x26, 0x1B, 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0x45, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xD4, 0x80, 0x01, 0x18,
+ 0xFA, 0x04, 0x80, 0xF8, 0x65, 0x46, 0x00, 0xFA, 0x06, 0xF2, 0xFF, 0xFF, 0x00, 0x7E, 0x06, 0xFA,
+ 0x61, 0x46, 0x2E, 0xF0, 0x66, 0x41, 0x12, 0x60, 0xCE, 0x65, 0x64, 0x47, 0x00, 0x7F, 0x88, 0xF1,
+ 0xE0, 0x84, 0x44, 0xD3, 0x64, 0x43, 0x11, 0x18, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xFC, 0x1B,
+ 0x66, 0x44, 0x64, 0x46, 0x80, 0xF0, 0x60, 0x46, 0x80, 0xF8, 0x65, 0x46, 0x65, 0x43, 0x80, 0xF0,
+ 0x01, 0xFA, 0x80, 0xFC, 0x64, 0x46, 0x80, 0xF8, 0x0B, 0x00, 0x64, 0x46, 0x62, 0x43, 0x00, 0xF2,
+ 0xA3, 0xDB, 0x60, 0x46, 0x80, 0xF0, 0x81, 0xFC, 0x80, 0xFC, 0x64, 0x46, 0x80, 0xF8, 0x60, 0x43,
+ 0x61, 0x46, 0xD3, 0x60, 0x2D, 0x78, 0xFF, 0xFF, 0x00, 0x60, 0x02, 0x61, 0xB3, 0x60, 0x58, 0x4D,
+ 0x77, 0x78, 0xFF, 0xFF, 0x87, 0xF1, 0x72, 0x44, 0xFF, 0xB4, 0xD0, 0x80, 0xFF, 0xFF, 0x02, 0x04,
+ 0xD0, 0x84, 0xFB, 0x01, 0xE0, 0x83, 0x88, 0xF3, 0x02, 0xA3, 0x43, 0x93, 0x66, 0x44, 0x00, 0xA8,
+ 0x56, 0xFD, 0x37, 0x03, 0x00, 0x64, 0x2B, 0xFA, 0x00, 0x60, 0xC0, 0x64, 0x2A, 0xFA, 0x66, 0x45,
+ 0x63, 0x46, 0x03, 0xF2, 0x04, 0xF0, 0x85, 0xF2, 0x65, 0x46, 0x2C, 0xFA, 0x2D, 0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0x60, 0x00, 0x63, 0xA5, 0xD0, 0xDA, 0x85, 0x64, 0x44,
+ 0x00, 0x7F, 0xCD, 0x81, 0xBD, 0xDB, 0x05, 0x03, 0x64, 0x47, 0x00, 0x7F, 0xCD, 0x81, 0xBD, 0xDB,
+ 0xF4, 0x02, 0x02, 0x60, 0x02, 0x61, 0xA1, 0xD3, 0xFF, 0xFF, 0xE0, 0x84, 0x04, 0xA5, 0xC5, 0x81,
+ 0xA1, 0xD3, 0x00, 0x65, 0x60, 0x43, 0x59, 0xD3, 0xFF, 0xFF, 0x7F, 0xB4, 0x02, 0x3A, 0x02, 0x00,
+ 0x01, 0x64, 0x15, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x11, 0x00, 0x0A, 0x3A, 0x02, 0x00,
+ 0x04, 0x64, 0x0D, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x09, 0x00, 0x10, 0x3A, 0x02, 0x00,
+ 0x10, 0x64, 0x05, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x01, 0x00, 0x00, 0x64, 0xCF, 0x83,
+ 0xB4, 0x85, 0xE1, 0x02, 0x65, 0x44, 0x60, 0xFB, 0xB8, 0xF3, 0x2B, 0x45, 0x66, 0x41, 0x65, 0x46,
+ 0x8C, 0xFA, 0x60, 0x40, 0x01, 0x36, 0x06, 0x00, 0x02, 0x36, 0x04, 0x00, 0x04, 0x36, 0x02, 0x00,
+ 0x05, 0x3A, 0x02, 0x00, 0x00, 0x64, 0x01, 0x00, 0x01, 0x64, 0x6F, 0xFA, 0x5F, 0xF3, 0x60, 0xF1,
+ 0xFF, 0xFF, 0xA0, 0x84, 0x65, 0x43, 0x02, 0x02, 0x5F, 0xF3, 0xFF, 0xFF, 0x60, 0x41, 0x0F, 0x60,
+ 0xAE, 0x65, 0xB8, 0xF3, 0xFF, 0xFF, 0xE0, 0x84, 0x44, 0xD3, 0x61, 0x45, 0xA4, 0x80, 0xFF, 0xFF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0xA2, 0xD3, 0x21, 0x60, 0xE2, 0x62, 0x60, 0x40, 0xFD, 0xA0,
+ 0xA2, 0xD3, 0x74, 0x03, 0x50, 0x60, 0x00, 0x7C, 0x60, 0x40, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60,
+ 0xF2, 0x63, 0x0E, 0x00, 0x04, 0x2A, 0x03, 0x00, 0x02, 0x60, 0xF2, 0x63, 0x09, 0x00, 0x10, 0x2A,
+ 0x03, 0x00, 0x04, 0x60, 0xF2, 0x63, 0x04, 0x00, 0x20, 0x2A, 0x04, 0x00, 0x05, 0x60, 0xF2, 0x63,
+ 0x59, 0xD9, 0x59, 0xDD, 0x21, 0x60, 0xEA, 0x62, 0xA2, 0xD3, 0x21, 0x60, 0xE4, 0x62, 0xFE, 0xA0,
+ 0xA2, 0xD3, 0x54, 0x03, 0x00, 0x60, 0x00, 0x63, 0x59, 0xDD, 0x61, 0x45, 0x60, 0x40, 0x01, 0x2A,
+ 0x04, 0x00, 0x00, 0x60, 0xF2, 0x63, 0x59, 0xD9, 0x59, 0xDD, 0x60, 0x40, 0x02, 0x2A, 0x04, 0x00,
+ 0x01, 0x60, 0xF2, 0x63, 0x59, 0xD9, 0x59, 0xDD, 0x60, 0x40, 0x04, 0x2A, 0x04, 0x00, 0x02, 0x60,
+ 0xF2, 0x63, 0x59, 0xD9, 0x59, 0xDD, 0x60, 0x40, 0x10, 0x2A, 0x04, 0x00, 0x04, 0x60, 0xF2, 0x63,
+ 0x59, 0xD9, 0x59, 0xDD, 0x60, 0x40, 0x20, 0x2A, 0x04, 0x00, 0x05, 0x60, 0xF2, 0x63, 0x59, 0xD9,
+ 0x59, 0xDD, 0xD5, 0x83, 0xEB, 0x83, 0xEB, 0x83, 0xA5, 0xDD, 0x21, 0x60, 0xEA, 0x62, 0xA2, 0xD3,
+ 0x21, 0x60, 0xE6, 0x62, 0xFF, 0xA0, 0xA2, 0xD3, 0x21, 0x03, 0x00, 0x60, 0x00, 0x63, 0x59, 0xDD,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x24, 0x44, 0xBD, 0xDB, 0x25, 0x44, 0xBD, 0xDB,
+ 0x26, 0x44, 0xBD, 0xDB, 0x27, 0x44, 0xBD, 0xDB, 0x28, 0x44, 0xBD, 0xDB, 0x29, 0x44, 0xBD, 0xDB,
+ 0x2A, 0x44, 0xBD, 0xDB, 0x2B, 0x44, 0xBD, 0xDB, 0x2C, 0x44, 0xBD, 0xDB, 0x2D, 0x44, 0xBD, 0xDB,
+ 0x2E, 0x44, 0xBD, 0xDB, 0x2F, 0x44, 0xBD, 0xDB, 0xDD, 0x81, 0x08, 0x3A, 0xD0, 0x01, 0x54, 0x00,
+ 0x27, 0x40, 0x10, 0x26, 0x30, 0x00, 0x26, 0x44, 0x01, 0x36, 0x2D, 0x00, 0x02, 0x36, 0x82, 0xFF,
+ 0x03, 0x36, 0x83, 0xFF, 0x04, 0x36, 0x84, 0xFF, 0x05, 0x36, 0x85, 0xFF, 0x06, 0x36, 0x86, 0xFF,
+ 0x25, 0x44, 0x00, 0x36, 0x44, 0x40, 0x01, 0x36, 0x44, 0x41, 0x02, 0x36, 0x44, 0x42, 0x03, 0x36,
+ 0x44, 0x43, 0x04, 0x36, 0x44, 0x44, 0x05, 0x36, 0x44, 0x45, 0x06, 0x36, 0x44, 0x46, 0x07, 0x36,
+ 0x44, 0x47, 0x08, 0x36, 0x44, 0x48, 0x09, 0x36, 0x44, 0x49, 0x0A, 0x36, 0x44, 0x4A, 0x0B, 0x36,
+ 0x44, 0x4B, 0x0C, 0x36, 0x44, 0x4C, 0x0D, 0x36, 0x44, 0x4D, 0x0E, 0x36, 0x44, 0x4E, 0x0F, 0x36,
+ 0x44, 0x4F, 0x87, 0xFF, 0x21, 0x00, 0x25, 0x44, 0x10, 0x36, 0x44, 0x50, 0x11, 0x36, 0x44, 0x51,
+ 0x12, 0x36, 0x44, 0x52, 0x13, 0x36, 0x44, 0x53, 0x14, 0x36, 0x44, 0x54, 0x15, 0x36, 0x44, 0x55,
+ 0x16, 0x36, 0x44, 0x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, 0x58, 0xD8, 0xFB, 0x1F, 0xD9, 0x81, 0xAE, 0x64, 0x0E, 0x63,
+ 0xAB, 0x46, 0x59, 0xD0, 0xAB, 0x46, 0x58, 0xD8, 0xFB, 0x1F, 0x00, 0x67, 0x00, 0x61, 0x23, 0x58,
+ 0xFF, 0xFF, 0x01, 0x67, 0x20, 0x61, 0x23, 0x58, 0xFF, 0xFF, 0x21, 0x60, 0x80, 0x64, 0xA0, 0xD1,
+ 0x7F, 0xF9, 0x64, 0x40, 0x01, 0x2A, 0x31, 0x00, 0x27, 0xF2, 0x12, 0x60, 0xCE, 0x65, 0x60, 0x47,
+ 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD3, 0x66, 0x41, 0x60, 0x46, 0x60, 0x43, 0x05, 0xF2, 0x16, 0x18,
+ 0x61, 0x46, 0x27, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x04, 0xF2, 0x0C, 0x02, 0x61, 0x46, 0x26, 0xF0,
+ 0x63, 0x46, 0xD0, 0x80, 0x03, 0xF2, 0x06, 0x02, 0x61, 0x46, 0x25, 0xF0, 0x63, 0x46, 0xD0, 0x80,
+ 0xFF, 0xFF, 0x07, 0x03, 0x80, 0xF4, 0xFF, 0xFF, 0x63, 0x46, 0xE8, 0x1B, 0x88, 0xF3, 0x08, 0xFE,
+ 0x60, 0x43, 0x61, 0x46, 0x01, 0x03, 0x0D, 0x00, 0x43, 0x4B, 0xAB, 0x46, 0x37, 0xF2, 0x80, 0x60,
+ 0x30, 0x61, 0x9D, 0x85, 0xA4, 0x84, 0xA2, 0xDA, 0xAB, 0x46, 0x00, 0x67, 0x00, 0x61, 0x23, 0x58,
+ 0xFF, 0xFF, 0x01, 0x67, 0x20, 0x61, 0x23, 0x58, 0xFF, 0xFF, 0x3E, 0xF2, 0xAC, 0xF1, 0x08, 0xB0,
+ 0x19, 0xF8, 0x4A, 0x02, 0x07, 0x23, 0x2B, 0x00, 0x60, 0x47, 0x07, 0xB4, 0x89, 0xF1, 0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x07, 0x36, 0xCB, 0x01, 0x08, 0x36, 0xB7, 0x01, 0x09, 0x36,
+ 0x0C, 0x00, 0x0A, 0x36, 0x0D, 0x00, 0x0B, 0x36, 0x0E, 0x00, 0x0C, 0x36, 0x17, 0x00, 0x0D, 0x36,
+ 0x0D, 0x00, 0x0E, 0x36, 0x1E, 0x00, 0x0F, 0x36, 0x32, 0x00, 0x02, 0x60, 0x00, 0x64, 0x08, 0x00,
+ 0x04, 0x60, 0x00, 0x64, 0x05, 0x00, 0x00, 0x60, 0x01, 0x64, 0x02, 0x00, 0x20, 0x60, 0x00, 0x64,
+ 0x32, 0x45, 0xB4, 0x85, 0x45, 0x52, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0xB0, 0x60, 0xC1, 0x63,
+ 0x0C, 0x60, 0x16, 0x64, 0xA0, 0xDD, 0x62, 0xFF, 0xFF, 0xFF, 0x1A, 0xFF, 0x00, 0x67, 0x23, 0x58,
+ 0xFF, 0xFF, 0x3F, 0x40, 0x02, 0x2B, 0x05, 0x00, 0x90, 0x60, 0x00, 0xE8, 0xAF, 0x60, 0xFD, 0x63,
+ 0x04, 0x00, 0x91, 0x60, 0x00, 0xE8, 0xB0, 0x60, 0xAB, 0x63, 0x28, 0xE8, 0x0C, 0x60, 0x16, 0x64,
+ 0xA0, 0xDD, 0x62, 0xFF, 0xFF, 0xFF, 0x1A, 0xFF, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x91, 0x60,
+ 0x00, 0xE8, 0x28, 0xE8, 0xD9, 0x60, 0xFE, 0x64, 0x32, 0x45, 0xA4, 0x85, 0x45, 0x52, 0x99, 0xFF,
+ 0xA5, 0x4F, 0xFF, 0xB4, 0x07, 0xFB, 0x98, 0xFF, 0xA7, 0x60, 0x9B, 0x63, 0x0C, 0x60, 0x16, 0x64,
+ 0xA0, 0xDD, 0x62, 0xFF, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x42, 0x6F, 0x6F, 0x74, 0x63, 0x6F,
+ 0x64, 0x65, 0x20, 0x21, 0x21, 0x20, 0x20, 0x00, 0x53, 0x54, 0x41, 0x2F, 0x41, 0x50, 0x20, 0x46,
+ 0x75, 0x6E, 0x63, 0x27, 0x73, 0x00, 0x20, 0x00, 0x02, 0x00, 0x02, 0x00, 0x24, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x06, 0x00,
+ 0x07, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00, 0x01, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00,
+ 0x40, 0x00, 0x32, 0x00, 0x32, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x40, 0x00, 0x32, 0x00,
+ 0x36, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x40, 0x00, 0x3B, 0x00, 0x40, 0x00, 0x17, 0x00,
+ 0x07, 0x00, 0x07, 0x00, 0x4A, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x1E, 0x00, 0x0C, 0x00, 0x08, 0x00,
+ 0x57, 0x00, 0x4D, 0x00, 0x57, 0x00, 0x2B, 0x00, 0x19, 0x00, 0x08, 0x00, 0x5D, 0x00, 0x53, 0x00,
+ 0x5D, 0x00, 0x31, 0x00, 0x1F, 0x00, 0x08, 0x00,
+
+}; /* fw_image_4_data */
+
+static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = {
+ {
+ sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1,
+ CFG_FW_IDENTITY,
+ COMP_ID_FW_AP,
+ 2, //Variant
+ 2, //Major
+ 36 //Minor
+ },
+ { 0000, 0000, 0000, 0000, 0000, 0000 } //endsentinel
+};
+
+static const CFG_PROG_STRCT fw_image_code[] = {
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x0146, // sizeof(fw_image_1_data),
+ 0x00000060, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_1_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x1918, // sizeof(fw_image_2_data),
+ 0x00000C16, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_2_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x01bc, // sizeof(fw_image_3_data),
+ 0x001E252E, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_3_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0xab28, // sizeof(fw_image_4_data),
+ 0x001F4000, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_4_data
+ },
+ {
+ 5,
+ CFG_PROG,
+ CFG_PROG_STOP, // mode
+ 0000,
+ 0x000F1297, // Start execution address
+ },
+ { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000}
+};
+
+static const CFG_RANGE20_STRCT fw_image_infocompat[] = {
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_FW_SUP_RANGE,
+ COMP_ROLE_SUPL,
+ COMP_ID_APF,
+ {
+ { 2, 2, 4 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_MFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_MFI,
+ {
+ { 4, 6, 7 }, //variant, bottom, top
+ { 5, 6, 7 }, //variant, bottom, top
+ { 6, 6, 7 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_CFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_CFI,
+ {
+ { 2, 1, 2 } //variant, bottom, top
+ }
+ },
+ { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } //endsentinel
+};
+
+memimage fw_image = {
+ "FUPU7D37dhfwci\001C", //signature, <format number>, C/Bin type
+ (CFG_PROG_STRCT *) fw_image_code,
+ 0x000F1297,
+ 00000000, //(dummy) pdaplug
+ 00000000, //(dummy) priplug
+ (CFG_RANGE20_STRCT *) fw_image_infocompat,
+ (CFG_IDENTITY_STRCT *) fw_image_infoidentity,
+};
+
diff --git a/drivers/staging/wlags49_h2/ap_h25.c b/drivers/staging/wlags49_h2/ap_h25.c
new file mode 100644
index 000000000000..f4491cbd08d3
--- /dev/null
+++ b/drivers/staging/wlags49_h2/ap_h25.c
@@ -0,0 +1,4094 @@
+/*
+ * File: ap_h54.124
+ *
+ * Abstract: This file contains memory image 'fw_image'.
+ *
+ * Contents: Total size of the memory image: 63146 bytes.
+ * Total number of blocks: 4 blocks.
+ * Block 1 : load address 00000060, 328 bytes.
+ * Block 2 : load address 00000C16, 9266 bytes.
+ * Block 3 : load address 001E3048, 6476 bytes.
+ * Block 4 : load address 001F4000, 47076 bytes.
+ *
+ * Identity: component id: 32 (variant 3) version 1.24
+ *
+ * Compatibility:
+ * supplying interface 8 (variant 4) : 1 - 1
+ * acting on interface 1 (variant 7) : 3 - 3
+ * acting on interface 1 (variant 8) : 1 - 1
+ * acting on interface 2 (variant 4) : 1 - 2
+ *
+ * Generated: by g:\fw\fupu3.exe version 4.26
+ *
+ * Commandline: g:\fw\fupu3.exe /f=4 /n=fw_image /i=t3012400.hex
+ */
+
+
+#include "hcfcfg.h" // to get hcf_16 etc defined as well as
+ // possible settings which inluence mdd.h or dhf.h
+#include "mdd.h" //to get COMP_ID_STA etc defined
+#include "dhf.h" //used to be "fhfmem.h", to get memblock,plugrecord,
+
+static const hcf_8 fw_image_1_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x0C, 0x00, 0x00,
+ 0x02, 0x0D, 0x00, 0x00, 0x02, 0x0D, 0xD6, 0xA2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC8, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x09, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA,
+ 0x00, 0x00, 0xFF, 0x07, 0x02, 0x00, 0x64, 0x00, 0x64, 0x00, 0x10, 0x27, 0x10, 0x27, 0x14, 0x00,
+ 0xD0, 0x07, 0xD0, 0x07, 0x10, 0x27, 0x2F, 0x00, 0x32, 0x00, 0x32, 0x00, 0x05, 0x00, 0x02, 0x00,
+ 0x02, 0x00, 0x10, 0x27, 0x05, 0x00, 0x00, 0x02, 0x00, 0x02, 0x13, 0x00, 0x07, 0x00, 0x03, 0x00,
+ 0x32, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x09, 0x2B, 0x09, 0x2B, 0x09, 0xFF, 0x0F,
+ 0xF0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x40, 0x00, 0x32, 0x00, 0x32, 0x00,
+ 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_1_data */
+
+static const hcf_8 fw_image_2_data[] = {
+ 0x7C, 0xA4, 0x00, 0x16, 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, 0xF1, 0x84,
+ 0x44, 0x08, 0xAB, 0xAE, 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03,
+ 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xC6, 0x84, 0xF8,
+ 0x99, 0xEE, 0x8D, 0xF6, 0x0D, 0xFF, 0xBD, 0xD6, 0xB1, 0xDE, 0x54, 0x91, 0x50, 0x60, 0x03, 0x02,
+ 0xA9, 0xCE, 0x7D, 0x56, 0x19, 0xE7, 0x62, 0xB5, 0xE6, 0x4D, 0x9A, 0xEC, 0x45, 0x8F, 0x9D, 0x1F,
+ 0x40, 0x89, 0x87, 0xFA, 0x15, 0xEF, 0xEB, 0xB2, 0xC9, 0x8E, 0x0B, 0xFB, 0xEC, 0x41, 0x67, 0xB3,
+ 0xFD, 0x5F, 0xEA, 0x45, 0xBF, 0x23, 0xF7, 0x53, 0x96, 0xE4, 0x5B, 0x9B, 0xC2, 0x75, 0x1C, 0xE1,
+ 0xAE, 0x3D, 0x6A, 0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, 0x90, 0x05, 0x06, 0x01, 0xF7, 0x12, 0x1C, 0xA3, 0xC2, 0x5F, 0x6A,
+ 0xF9, 0xAE, 0xD0, 0x69, 0x91, 0x17, 0x58, 0x99, 0x27, 0x3A, 0xB9, 0x27, 0x38, 0xD9, 0x13, 0xEB,
+ 0xB3, 0x2B, 0x33, 0x22, 0xBB, 0xD2, 0x70, 0xA9, 0x89, 0x07, 0xA7, 0x33, 0xB6, 0x2D, 0x22, 0x3C,
+ 0x92, 0x15, 0x20, 0xC9, 0x49, 0x87, 0xFF, 0xAA, 0x78, 0x50, 0x7A, 0xA5, 0x8F, 0x03, 0xF8, 0x59,
+ 0x80, 0x09, 0x17, 0x1A, 0xDA, 0x65, 0x31, 0xD7, 0xC6, 0x84, 0xB8, 0xD0, 0xC3, 0x82, 0xB0, 0x29,
+ 0x77, 0x5A, 0x11, 0x1E, 0xCB, 0x7B, 0xFC, 0xA8, 0xD6, 0x6D, 0x3A, 0x2C, 0x00, 0x30, 0x00, 0x31,
+ 0x00, 0x33, 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x38, 0x00, 0x3A,
+ 0x00, 0x3B, 0x00, 0x3C, 0x00, 0x3D, 0x00, 0x3E, 0x00, 0x3F, 0x00, 0x3F, 0x59, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEC, 0x21, 0x10, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x20, 0x03, 0xE0, 0x01, 0x40, 0x01, 0x20, 0x03, 0xE0, 0x01,
+ 0x40, 0x01, 0x18, 0x08, 0xF0, 0x3F, 0xFC, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x02, 0x14, 0x05, 0x32, 0x0B, 0x37,
+ 0x08, 0x50, 0x0B, 0x6E, 0x02, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x16, 0x00, 0x0C, 0x00, 0x12, 0x00,
+ 0x18, 0x00, 0x24, 0x00, 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x39, 0x00, 0x20, 0x00, 0x39, 0x00,
+ 0x39, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xA4, 0x10, 0xF2, 0x10, 0xAA, 0x10, 0xEC, 0x10, 0xB0, 0x10, 0xE6, 0x10, 0xB6, 0x10,
+ 0xE0, 0x10, 0xBC, 0x10, 0xDA, 0x10, 0xC2, 0x10, 0xD4, 0x10, 0xC8, 0x10, 0xCE, 0x10, 0x07, 0x01,
+ 0x00, 0x00, 0x16, 0x22, 0x00, 0x04, 0x08, 0x01, 0x00, 0x00, 0x16, 0x26, 0x00, 0x04, 0x09, 0x01,
+ 0x00, 0x00, 0x16, 0x2A, 0x00, 0x04, 0x0A, 0x01, 0x00, 0x00, 0x16, 0x2E, 0x00, 0x04, 0x0B, 0x01,
+ 0x00, 0x00, 0x10, 0x24, 0x04, 0x04, 0x0C, 0x01, 0x00, 0x00, 0x10, 0x28, 0x04, 0x04, 0x0D, 0x01,
+ 0x00, 0x00, 0x10, 0x2C, 0x04, 0x04, 0x0E, 0x01, 0x00, 0x00, 0x10, 0x30, 0x04, 0x04, 0x0F, 0x01,
+ 0x00, 0x00, 0x14, 0x34, 0x08, 0x84, 0x10, 0x01, 0x00, 0x00, 0x14, 0x38, 0x08, 0x84, 0x11, 0x01,
+ 0x00, 0x00, 0x14, 0x3C, 0x08, 0x84, 0x12, 0x01, 0x00, 0x00, 0x14, 0x40, 0x08, 0x84, 0x13, 0x01,
+ 0x00, 0x00, 0x17, 0x64, 0x0C, 0x8B, 0x14, 0x01, 0x00, 0x00, 0x17, 0x68, 0x0C, 0x8B, 0x15, 0x01,
+ 0x00, 0x00, 0x17, 0x6C, 0x0C, 0x8B, 0x16, 0x01, 0x00, 0x00, 0x17, 0x70, 0x0C, 0x8B, 0x17, 0x01,
+ 0x00, 0x00, 0x17, 0x74, 0x0C, 0x8B, 0x18, 0x01, 0x00, 0x00, 0x17, 0x78, 0x0C, 0x8B, 0x19, 0x01,
+ 0x00, 0x00, 0x17, 0x7C, 0x0C, 0x8B, 0x1A, 0x01, 0x00, 0x00, 0x17, 0x80, 0x0C, 0x8B, 0x1B, 0x01,
+ 0x00, 0x00, 0x17, 0x84, 0x0C, 0x8B, 0x1C, 0x01, 0x00, 0x00, 0x17, 0x88, 0x0C, 0x8B, 0x1D, 0x01,
+ 0x00, 0x00, 0x17, 0x8C, 0x0C, 0x8B, 0x1E, 0x01, 0x00, 0x00, 0x0E, 0x95, 0x17, 0x04, 0x1F, 0x01,
+ 0x00, 0x00, 0x0E, 0x99, 0x17, 0x04, 0x20, 0x01, 0x00, 0x00, 0x0E, 0x9D, 0x17, 0x04, 0x21, 0x01,
+ 0x00, 0x00, 0x0E, 0xA1, 0x17, 0x04, 0x22, 0x01, 0x00, 0x00, 0x0E, 0xA5, 0x00, 0x00, 0x14, 0x11,
+ 0x34, 0x11, 0x54, 0x11, 0x74, 0x11, 0xCC, 0x11, 0x1C, 0x11, 0x3C, 0x11, 0x5C, 0x11, 0x7C, 0x11,
+ 0xD4, 0x11, 0x24, 0x11, 0x44, 0x11, 0x64, 0x11, 0x84, 0x11, 0xDC, 0x11, 0x2C, 0x11, 0x4C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00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x17,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,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D, 0x96, 0xF9, 0xAA, 0xF3, 0x00, 0x00, 0x12, 0x00,
+ 0x8B, 0xFD, 0x96, 0xF9, 0xAA, 0xF3, 0x00, 0x00, 0x12, 0x00, 0x8E, 0xFD, 0xC0, 0xF3, 0xAA, 0xF3,
+ 0xEE, 0x14, 0x02, 0x00, 0x80, 0xFD, 0xEF, 0xF4, 0xAA, 0xF3, 0x22, 0x00, 0x02, 0x00, 0x81, 0xFD,
+ 0xEF, 0xF4, 0xAA, 0xF3, 0x22, 0x02, 0x02, 0x00, 0x82, 0xFD, 0xEF, 0xF4, 0xAA, 0xF3, 0x22, 0x04,
+ 0x02, 0x00, 0x83, 0xFD, 0xEF, 0xF4, 0xAA, 0xF3, 0x22, 0x06, 0x02, 0x00, 0x84, 0xFD, 0xEF, 0xF4,
+ 0xAA, 0xF3, 0x22, 0x08, 0x02, 0x00, 0x85, 0xFD, 0xEF, 0xF4, 0xAA, 0xF3, 0x22, 0x0A, 0x02, 0x00,
+ 0x00, 0xF1, 0x46, 0x00, 0x64, 0xF3, 0xF6, 0x00, 0x00, 0x03, 0x8E, 0xF7, 0x1F, 0x00, 0x34, 0x01,
+ 0xC8, 0x00, 0x96, 0x01, 0xCC, 0x00, 0xFA, 0x00, 0x78, 0x01, 0xD2, 0x25, 0x18, 0x01, 0xCC, 0x1E,
+ 0xC8, 0x00, 0x00, 0x00, 0x02, 0x15, 0x00, 0x00, 0x06, 0x17, 0x12, 0x01, 0x03, 0x00, 0xAE, 0x00,
+ 0xEC, 0x00, 0x44, 0x00, 0xDC, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x09, 0x08, 0x24, 0x28, 0x06,
+ 0x0C, 0x18, 0x08, 0x30, 0x14, 0x0C, 0x08, 0x36, 0x10, 0x12, 0xA1, 0xB6, 0x14, 0xB6, 0x50, 0xB7,
+ 0x59, 0xB7, 0x25, 0xB6, 0xCE, 0xB6, 0x93, 0xB6, 0x15, 0x1C, 0xD0, 0x1A, 0x15, 0x1C, 0x8B, 0x1B,
+ 0xEE, 0x1A, 0xCB, 0x1A, 0xD2, 0x1B, 0xF1, 0x1B, 0x06, 0x1C, 0x48, 0x1C, 0x74, 0x1C, 0x74, 0x1B,
+ 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46,
+ 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x23, 0x46, 0x23, 0x46, 0x23, 0x46, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1D, 0x47, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48,
+ 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48,
+ 0x9A, 0x48, 0x33, 0x48, 0x78, 0x49, 0x78, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49,
+ 0x7A, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7C, 0x49,
+ 0xD8, 0x03, 0xDC, 0x03, 0xE0, 0x03, 0xE4, 0x03, 0xF0, 0x03, 0xF4, 0x03, 0xF8, 0x03, 0x0A, 0x04,
+ 0x0E, 0x04, 0x12, 0x04, 0x16, 0x04, 0x0C, 0x04, 0x10, 0x04, 0x14, 0x04, 0x18, 0x04, 0x1C, 0x04,
+ 0x20, 0x04, 0x24, 0x04, 0x28, 0x04, 0x4C, 0x04, 0x50, 0x04, 0x54, 0x04, 0x58, 0x04, 0x5C, 0x04,
+ 0x60, 0x04, 0x64, 0x04, 0x68, 0x04, 0x6C, 0x04, 0x70, 0x04, 0x74, 0x04, 0x7D, 0x04, 0x81, 0x04,
+ 0x85, 0x04, 0x89, 0x04, 0x8D, 0x04, 0x10, 0x00, 0x8E, 0x19, 0xAC, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0x3C, 0x0C, 0x00, 0x00, 0xFF, 0x3F, 0x44, 0x04, 0x00, 0x00, 0xD3, 0x22, 0x44, 0x04,
+ 0x9C, 0x02, 0xCB, 0x54, 0x44, 0x04, 0x00, 0x00, 0x01, 0x00, 0x44, 0x04, 0x00, 0x00, 0x00, 0x03,
+ 0x00, 0x0C, 0x71, 0x00, 0x30, 0x50, 0x20, 0x00, 0x80, 0xBF, 0x1F, 0xA6, 0x28, 0x00, 0x0B, 0x02,
+ 0x60, 0x84, 0x4C, 0x00, 0x02, 0x00, 0x4B, 0x1C, 0x98, 0x00, 0x00, 0x00, 0x20, 0x0B, 0x34, 0x04,
+ 0xFD, 0x34, 0x34, 0x00, 0x38, 0x04, 0xFD, 0x34, 0x34, 0x00, 0x3C, 0x04, 0x01, 0x00, 0x10, 0x00,
+ 0x00, 0x08, 0x00, 0x52, 0x14, 0x00, 0x04, 0x08, 0x0E, 0x32, 0x00, 0xA6, 0x10, 0x08, 0xC4, 0x03,
+ 0x50, 0x60, 0x18, 0x08, 0xF0, 0x3F, 0xFC, 0x01, 0x10, 0x0C, 0x00, 0x00, 0x80, 0x04, 0x14, 0x0C,
+ 0x00, 0x00, 0x00, 0x41, 0x20, 0x0C, 0xB0, 0x00, 0xB0, 0xB8, 0x24, 0x0C, 0x00, 0x00, 0xAB, 0x05,
+ 0x2C, 0x0C, 0x80, 0x05, 0x00, 0xFF, 0x30, 0x0C, 0x00, 0x00, 0xB0, 0x04, 0x34, 0x0C, 0x03, 0x00,
+ 0x00, 0xE8, 0x44, 0x0C, 0x04, 0x00, 0xFF, 0x0F, 0x00, 0x10, 0x2E, 0x00, 0x0C, 0xE3, 0x44, 0x04,
+ 0x00, 0x00, 0x01, 0x04, 0x44, 0x04, 0x00, 0x00, 0x01, 0x01, 0x44, 0x04, 0x00, 0x00, 0x01, 0x00,
+ 0x44, 0x04, 0x00, 0x00, 0x01, 0x04, 0x44, 0x04, 0x00, 0x00, 0x80, 0x03, 0x48, 0x0C, 0x00, 0x00,
+ 0x7F, 0x00, 0x04, 0x04, 0x08, 0x48, 0x00, 0x00, 0x04, 0x04, 0x08, 0x40, 0x00, 0x00, 0x00, 0x0C,
+ 0x71, 0x00, 0x30, 0x30, 0x00, 0x00, 0x5E, 0x40, 0x01, 0x00, 0x18, 0x00, 0x36, 0xC0, 0xE8, 0x0E,
+ 0x1C, 0x00, 0x78, 0xC8, 0xA5, 0x40, 0x24, 0x00, 0x9E, 0xB0, 0xB9, 0x95, 0x08, 0x08, 0x00, 0xEA,
+ 0x40, 0x01, 0x0C, 0x08, 0x00, 0xEA, 0x00, 0x00, 0x1C, 0x08, 0x00, 0x00, 0x42, 0x07, 0x20, 0x08,
+ 0x7B, 0x00, 0xD4, 0x09, 0x2C, 0x04, 0x14, 0x00, 0x50, 0x14, 0x30, 0x04, 0x28, 0x0F, 0x28, 0x7F,
+ 0x18, 0x08, 0x20, 0x00, 0xFC, 0x01, 0x04, 0x10, 0x69, 0x00, 0xFD, 0xC3, 0x08, 0x10, 0x69, 0x00,
+ 0xFD, 0xC3, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x48, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x48, 0x0C,
+ 0x00, 0x00, 0x7F, 0x00, 0x04, 0x04, 0x08, 0x48, 0x02, 0x00, 0x00, 0x00, 0x5E, 0x48, 0x00, 0x00,
+ 0x04, 0x04, 0x08, 0x40, 0x02, 0x00, 0x00, 0x0C, 0x71, 0x00, 0x30, 0x50, 0x00, 0x00, 0x5E, 0x48,
+ 0x01, 0x00, 0x18, 0x00, 0x3A, 0xC0, 0xE8, 0x04, 0x1C, 0x00, 0x78, 0xD0, 0xA5, 0x40, 0x24, 0x00,
+ 0x9E, 0xB0, 0xB9, 0x85, 0x2C, 0x04, 0x14, 0x00, 0x50, 0x14, 0x30, 0x04, 0x28, 0x0F, 0x28, 0x7F,
+ 0x08, 0x08, 0x00, 0xEA, 0x40, 0x01, 0x0C, 0x08, 0x00, 0xEA, 0x00, 0x00, 0x1C, 0x08, 0x00, 0x00,
+ 0x42, 0x07, 0x20, 0x08, 0x7B, 0x00, 0xD4, 0x09, 0x18, 0x08, 0xF0, 0x3F, 0xFC, 0x01, 0x04, 0x10,
+ 0x69, 0x00, 0xDD, 0xCD, 0x08, 0x10, 0x69, 0x00, 0xDD, 0xCD, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x00,
+ 0x48, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04, 0x40, 0x04,
+ 0x41, 0x04, 0x10, 0x04, 0xD6, 0x08, 0x56, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x56, 0x0A, 0x18, 0x04,
+ 0x56, 0x0A, 0x40, 0x02, 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0xC2, 0x00, 0xD6, 0x08,
+ 0x24, 0x04, 0xD6, 0x08, 0xC0, 0x00, 0x28, 0x04, 0xC2, 0x08, 0xC2, 0x28, 0x08, 0x04, 0x40, 0x01,
+ 0x41, 0x01, 0x0C, 0x04, 0x00, 0x01, 0x01, 0x01, 0x10, 0x04, 0x56, 0x0A, 0x56, 0x0A, 0x14, 0x04,
+ 0x42, 0x02, 0x56, 0x0A, 0x18, 0x04, 0x56, 0x0A, 0x40, 0x02, 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A,
+ 0x20, 0x04, 0x42, 0x02, 0x56, 0x0A, 0x24, 0x04, 0x56, 0x0A, 0x40, 0x02, 0x28, 0x04, 0x42, 0x0A,
+ 0x42, 0x2A, 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04, 0x40, 0x04, 0x41, 0x04, 0x10, 0x04,
+ 0xCE, 0x08, 0x4E, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x4E, 0x0A, 0x18, 0x04, 0x4E, 0x0A, 0x40, 0x02,
+ 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0xC2, 0x00, 0xCE, 0x08, 0x24, 0x04, 0xCE, 0x08,
+ 0xC0, 0x00, 0x28, 0x04, 0xC2, 0x08, 0xC2, 0x28, 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04,
+ 0x00, 0x01, 0x01, 0x01, 0x10, 0x04, 0x4E, 0x0A, 0x4E, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x4E, 0x0A,
+ 0x18, 0x04, 0x4E, 0x0A, 0x40, 0x02, 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0x42, 0x02,
+ 0x4E, 0x0A, 0x24, 0x04, 0x4E, 0x0A, 0x40, 0x02, 0x28, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00,
+ 0x05, 0x00, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x17, 0xA0, 0x17, 0xA0, 0x17,
+ 0xA0, 0x18, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0x00, 0x00, 0x65, 0x00, 0x65, 0x00, 0x65, 0x00, 0x65, 0x00, 0x5D, 0x00, 0x52, 0x00,
+ 0x48, 0x00, 0x40, 0x00, 0x38, 0x00, 0x31, 0x00, 0x2C, 0x00, 0x27, 0x00, 0x23, 0x00, 0x1F, 0x00,
+ 0x00, 0x00, 0x65, 0x00, 0x65, 0x00, 0x65, 0x00, 0x65, 0x00, 0x5D, 0x00, 0x52, 0x00, 0x48, 0x00,
+ 0x40, 0x00, 0x38, 0x00, 0x31, 0x00, 0x2C, 0x00, 0x27, 0x00, 0x23, 0x00, 0x1F, 0x00, 0x00, 0x00,
+ 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00,
+ 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00,
+ 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20,
+ 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x01, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x00, 0x00,
+ 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x14, 0x00, 0x03, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66,
+ 0x69, 0x65, 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00,
+ 0x64, 0x00, 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32, 0x00, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x69, 0x72, 0x73, 0x74, 0x20, 0x57, 0x61,
+ 0x76, 0x65, 0x4C, 0x41, 0x4E, 0x20, 0x49, 0x49, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x0F, 0xF0, 0x0F, 0x0F, 0x00, 0x50, 0x01, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x14, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x07, 0x00, 0x30, 0x00, 0xFF, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00,
+ 0x0A, 0x00, 0x0A, 0x00, 0x0B, 0x00, 0x0B, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x0A, 0x00,
+ 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x0B, 0x16, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x82, 0x84,
+ 0x8B, 0x96, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x20, 0x00, 0x1B, 0x00, 0x17, 0x00, 0x11, 0x00, 0x10, 0x00, 0x0B, 0x00,
+ 0x0B, 0x00, 0x09, 0x00, 0x17, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0D, 0x00, 0x0B, 0x00, 0x09, 0x00,
+ 0x08, 0x00, 0x07, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x09, 0x00, 0x08, 0x00, 0x05, 0x00, 0x05, 0x00,
+ 0xD8, 0x0C, 0xC0, 0x08, 0x90, 0x0D, 0x60, 0x09, 0x48, 0x0E, 0x30, 0x0A, 0x24, 0x0F, 0x18, 0x0B,
+ 0x0B, 0x6E, 0x0B, 0x37, 0x02, 0x14, 0x01, 0x0A, 0xFF, 0x0F, 0xF0, 0x0F, 0xFF, 0x0F, 0xF0, 0x0F,
+ 0xFF, 0x0F, 0xF0, 0x0F, 0xFF, 0x0F, 0xF0, 0x0F, 0xFF, 0x0F, 0xF0, 0x0F, 0xFF, 0x0F, 0xF0, 0x0F,
+ 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xDD, 0x00, 0x50, 0xF2, 0x01, 0x01, 0x00,
+ 0x00, 0x50, 0xF2, 0x05, 0x02, 0x00, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x50, 0xF2, 0x04, 0x02, 0x00,
+ 0x00, 0x50, 0xF2, 0x00, 0x00, 0x50, 0xF2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x04, 0x00, 0x15, 0x00, 0x02, 0x00,
+ 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x04, 0x00, 0x10, 0x00, 0x02, 0x00, 0x04, 0x00, 0x04, 0x00,
+ 0x15, 0x00, 0x20, 0x00, 0x11, 0x00, 0x20, 0x00, 0x16, 0x26, 0xE2, 0x2B, 0xEA, 0x2D, 0xC4, 0x2D,
+ 0xEE, 0x2D, 0x7E, 0x2C, 0x1E, 0x2E, 0x22, 0x2E, 0xFF, 0xFF, 0x2C, 0x2E, 0x00, 0x00, 0x4E, 0x28,
+ 0xD8, 0x2B, 0x22, 0x2E, 0xFF, 0xFF, 0x00, 0x00, 0x16, 0x26, 0xE2, 0x2B, 0xEA, 0x2D, 0xFF, 0xFF,
+ 0xEE, 0x2D, 0x7E, 0x2C, 0x1E, 0x2E, 0x22, 0x2E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x2C, 0x2E, 0x00, 0x00, 0xE2, 0x2B, 0x34, 0x2E, 0x22, 0x2E, 0x00, 0x00, 0x00, 0x05,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x00, 0x06, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2A, 0x00, 0x00, 0x08, 0x32, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x00, 0x60, 0x1D, 0x00, 0x00, 0x00, 0x0D, 0x81,
+ 0x00, 0x60, 0x1D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0xDD, 0x00, 0xFF, 0xFF, 0x97, 0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x10, 0x00, 0x19, 0x0A, 0x09, 0x46, 0x1C, 0x60, 0x18, 0x00, 0x19, 0x1D, 0x09, 0x42,
+ 0x1C, 0x60,
+
+}; /* fw_image_2_data */
+
+static const hcf_8 fw_image_3_data[] = {
+ 0x00, 0x60, 0x46, 0x74, 0xCD, 0xE2, 0x04, 0xE1, 0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60, 0x40, 0x01, 0x27, 0x09, 0x00, 0x64, 0x40, 0x10, 0x26,
+ 0x06, 0x00, 0x13, 0x64, 0xAD, 0xFB, 0x01, 0x60, 0x67, 0x64, 0x37, 0xFB, 0x09, 0x00, 0x08, 0x64,
+ 0xAD, 0xFB, 0x82, 0xF3, 0x01, 0x60, 0x67, 0x7C, 0x60, 0x40, 0x01, 0x27, 0x5B, 0x7C, 0x37, 0xF9,
+ 0x13, 0x60, 0x5B, 0xF1, 0x64, 0xF3, 0x15, 0x60, 0xD2, 0xF9, 0x15, 0x60, 0xD6, 0xF9, 0x60, 0x40,
+ 0x01, 0x27, 0x0A, 0x00, 0xFF, 0xB5, 0x10, 0x60, 0xA8, 0x63, 0x65, 0x41, 0xCD, 0x81, 0x06, 0xA3,
+ 0xFD, 0x02, 0xFA, 0xA3, 0xA3, 0xD3, 0x0F, 0x00, 0x01, 0x60, 0xFF, 0x65, 0xA4, 0x84, 0x11, 0x60,
+ 0x14, 0x61, 0xA1, 0xD1, 0xFF, 0xFF, 0xD0, 0x80, 0x08, 0xA1, 0xFB, 0x02, 0xFC, 0xA1, 0xA1, 0xD3,
+ 0x15, 0x60, 0xD2, 0xF1, 0xFF, 0xB4, 0xD0, 0x80, 0xFF, 0xFF, 0x04, 0x07, 0x15, 0x60, 0xD2, 0xFB,
+ 0x15, 0x60, 0xD6, 0xFB, 0x25, 0x60, 0x7A, 0x63, 0x24, 0x60, 0x08, 0x65, 0x12, 0x60, 0xB6, 0xF1,
+ 0x23, 0x60, 0xF0, 0x61, 0x25, 0x60, 0x68, 0x64, 0x40, 0x4F, 0x04, 0x64, 0xC3, 0x60, 0x58, 0x4D,
+ 0x25, 0x78, 0xFF, 0xFF, 0x25, 0x60, 0x82, 0x63, 0x12, 0x60, 0xB5, 0xF1, 0x24, 0x60, 0x48, 0x65,
+ 0x25, 0x60, 0x66, 0x64, 0x40, 0x4F, 0x08, 0x64, 0xC3, 0x60, 0x58, 0x4D, 0x25, 0x78, 0xFF, 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 0x11, 0x09, 0x00,
+ 0x71, 0x40, 0x80, 0x27, 0xFB, 0x01, 0x88, 0xE2, 0xBA, 0x60, 0xD0, 0x64, 0x03, 0xFB, 0x8D, 0xFF,
+ 0x15, 0x00, 0x8D, 0xFF, 0xB1, 0x60, 0xED, 0x63, 0x06, 0x60, 0x0B, 0xFD, 0xFF, 0xFF, 0x62, 0xFF,
+ 0x1D, 0x60, 0x3C, 0x63, 0x7F, 0xFD, 0xFF, 0xFF, 0x1A, 0xFF, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF,
+ 0xA4, 0x60, 0x7C, 0x63, 0x06, 0x60, 0x0B, 0xFD, 0xFF, 0xFF, 0x62, 0xFF, 0x29, 0xF5, 0x1F, 0x60,
+ 0x26, 0x63, 0x1E, 0x60, 0xF8, 0x64, 0xBD, 0xDB, 0x66, 0x44, 0xBD, 0xDB, 0x02, 0x64, 0xA3, 0xDB,
+ 0xFF, 0xFF, 0x2B, 0xFF, 0xF9, 0xFE, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x66, 0x01, 0x00, 0x36,
+ 0x67, 0x01, 0x01, 0x36, 0x69, 0x01, 0x02, 0x36, 0x7F, 0x01, 0x03, 0x36, 0x89, 0x01, 0x04, 0x36,
+ 0xC1, 0x01, 0x05, 0x36, 0xBF, 0x01, 0x06, 0x36, 0xF1, 0x01, 0x07, 0x36, 0xBB, 0x01, 0x08, 0x36,
+ 0x8A, 0x01, 0x09, 0x36, 0x0C, 0x00, 0x0A, 0x36, 0x0D, 0x00, 0x0B, 0x36, 0x0E, 0x00, 0x0C, 0x36,
+ 0x17, 0x00, 0x0D, 0x36, 0x0D, 0x00, 0x0E, 0x36, 0x1D, 0x00, 0x0F, 0x36, 0x41, 0x00, 0x02, 0x60,
+ 0x00, 0x64, 0x08, 0x00, 0x04, 0x60, 0x00, 0x64, 0x05, 0x00, 0x00, 0x60, 0x01, 0x64, 0x02, 0x00,
+ 0x20, 0x60, 0x00, 0x64, 0x32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EB,
+ 0x5C, 0x60, 0xC0, 0xEB, 0x5D, 0x60, 0xD0, 0xEB, 0x5E, 0x60, 0x91, 0xEB, 0x00, 0xEA, 0x00, 0xEB,
+ 0xE0, 0x60, 0x02, 0xEA, 0xE0, 0x60, 0x03, 0xEB, 0xA0, 0x60, 0x00, 0xEB, 0xB0, 0x60, 0x00, 0xEB,
+ 0xAB, 0x48, 0x40, 0x3B, 0x01, 0x00, 0xFC, 0x01, 0x00, 0xEB, 0x03, 0x60, 0x02, 0x64, 0xA0, 0xDB,
+ 0x0F, 0x64, 0x60, 0x7F, 0xA0, 0x5A, 0x80, 0x60, 0x00, 0xEA, 0xA0, 0x60, 0x00, 0xEA, 0xD1, 0x60,
+ 0x00, 0xEA, 0x24, 0x44, 0xFF, 0xB4, 0x04, 0xFB, 0x50, 0x60, 0x00, 0x64, 0x05, 0xFB, 0x10, 0x60,
+ 0x10, 0x75, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x3F, 0x40, 0x40, 0x26, 0x40, 0x00, 0x05, 0x60,
+ 0xF9, 0xF1, 0x42, 0x60, 0x08, 0x64, 0x09, 0x60, 0x19, 0x63, 0x64, 0x40, 0x01, 0x2B, 0x04, 0x00,
+ 0x42, 0x60, 0x09, 0x64, 0x0A, 0x60, 0x19, 0x63, 0x18, 0x60, 0x22, 0xFB, 0x04, 0x60, 0x00, 0xBC,
+ 0x18, 0x60, 0x1E, 0xFB, 0x18, 0x60, 0x1D, 0xFD, 0x1D, 0x60, 0x19, 0x63, 0x18, 0x60, 0x21, 0xFD,
+ 0x80, 0x60, 0x1C, 0x64, 0x3F, 0x40, 0x01, 0x2A, 0x02, 0x00, 0x60, 0x60, 0x1C, 0x64, 0x18, 0x60,
+ 0x23, 0xFB, 0x18, 0x60, 0x1F, 0xFB, 0x18, 0x60, 0x22, 0xF3, 0xA0, 0x50, 0xA0, 0x50, 0x0B, 0x60,
+ 0xF8, 0x63, 0xA3, 0xD1, 0x30, 0x60, 0x38, 0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 0x60, 0x00, 0x65, 0x3F, 0x43,
+ 0x21, 0x60, 0x00, 0x65, 0xC0, 0x60, 0x8F, 0xEE, 0x08, 0x00, 0x02, 0x60, 0x00, 0x65, 0x00, 0x60,
+ 0x00, 0x64, 0x18, 0xFB, 0x3F, 0x43, 0x11, 0x60, 0x10, 0xE6, 0xB7, 0x84, 0x40, 0x5F, 0x30, 0x60,
+ 0x20, 0x63, 0x3F, 0x40, 0x20, 0x27, 0x06, 0x00, 0x0F, 0x60, 0xFF, 0x64, 0xBD, 0xDB, 0x0F, 0x60,
+ 0xF0, 0x64, 0x03, 0x00, 0x0F, 0x64, 0xBD, 0xDB, 0x00, 0x64, 0xA3, 0xDB, 0x00, 0x60, 0x30, 0xE2,
+ 0x00, 0x60, 0x50, 0xE2, 0x00, 0x60, 0x79, 0xE2, 0x00, 0x60, 0x90, 0xE2, 0x01, 0x60, 0xD0, 0xE2,
+ 0x01, 0x60, 0xF0, 0xE2, 0x01, 0x60, 0xB0, 0xE2, 0x13, 0x64, 0xAD, 0xFB, 0x01, 0x60, 0x67, 0x64,
+ 0x37, 0xFB, 0x00, 0x60, 0x50, 0x64, 0x36, 0xFB, 0x09, 0x60, 0x2A, 0x64, 0x98, 0xFB, 0x82, 0xFF,
+ 0x92, 0xFF, 0x5C, 0x41, 0x5C, 0x46, 0x5C, 0x47, 0x00, 0xE1, 0xA4, 0x60, 0x7C, 0x63, 0x0C, 0x60,
+ 0x16, 0x64, 0xA0, 0xDD, 0x87, 0xFF, 0x97, 0xFF, 0x0C, 0x60, 0x02, 0x64, 0x40, 0x5A, 0x06, 0xA4,
+ 0x40, 0x5B, 0x5C, 0x5E, 0x13, 0x60, 0x52, 0xF3, 0x64, 0xFB, 0x3F, 0x40, 0x01, 0x22, 0x03, 0x00,
+ 0x80, 0x60, 0x37, 0x7C, 0x02, 0x00, 0x80, 0x60, 0x27, 0x7C, 0x16, 0x60, 0x55, 0xF9, 0x00, 0x60,
+ 0x80, 0x64, 0x89, 0xFB,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xFE, 0x15, 0x60, 0xCB, 0xF3,
+ 0x12, 0x63, 0x60, 0x40, 0x01, 0x27, 0x04, 0x00, 0x0B, 0x60, 0xEA, 0x62, 0x5A, 0xDF, 0xFE, 0x1F,
+ 0x1F, 0x60, 0xC8, 0x78, 0xFF, 0xFF, 0x08, 0x60, 0x06, 0x63, 0xBE, 0xD3, 0xBD, 0xD1, 0x07, 0x18,
+ 0xD4, 0x80, 0x05, 0x18, 0x03, 0x03, 0xC3, 0x83, 0xC3, 0x83, 0xF7, 0x01, 0xDB, 0x83, 0x00, 0xBC,
+ 0x2D, 0x58, 0xFF, 0xFF, 0x86, 0xFD, 0xB0, 0x26, 0x00, 0x00, 0x06, 0x00, 0x10, 0xFD, 0x32, 0x01,
+ 0x00, 0x00, 0x02, 0x00, 0x14, 0xFD, 0x94, 0x2B, 0x00, 0x00, 0x0A, 0x00, 0x41, 0xFA, 0x46, 0x23,
+ 0x00, 0x00, 0x22, 0x00, 0x42, 0xFA, 0x68, 0x23, 0x00, 0x00, 0x22, 0x00, 0x43, 0xFA, 0x8A, 0x23,
+ 0x00, 0x00, 0x22, 0x00, 0x44, 0xFA, 0xAC, 0x23, 0x00, 0x00, 0x22, 0x00, 0x45, 0xFA, 0xCE, 0x23,
+ 0x00, 0x00, 0x22, 0x00, 0x25, 0xFD, 0x62, 0x01, 0x00, 0x00, 0x02, 0x00,
+
+}; /* fw_image_3_data */
+
+static const hcf_8 fw_image_4_data[] = {
+ 0x6C, 0x40, 0xA1, 0xFF, 0x98, 0xFF, 0x80, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x41, 0xFF, 0x33, 0xF3, 0x32, 0x11, 0x31, 0x18, 0x40, 0x64, 0x3A, 0xDB, 0x1C, 0x00, 0xFF, 0xFF,
+ 0xC4, 0xE2, 0x27, 0x44, 0x20, 0x2A, 0x01, 0x00, 0xFF, 0xFF, 0x42, 0x64, 0x3A, 0xDB, 0x23, 0x00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00, 0x00,
+ 0x43, 0xF7, 0xA7, 0xFF, 0x41, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xA2, 0x60, 0x00, 0x78, 0x47, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x2E, 0x60, 0x54, 0x63, 0x20, 0x44, 0xBD, 0xDB, 0x21, 0x44, 0xBD, 0xDB, 0x22, 0x44, 0xBD, 0xDB,
+ 0x23, 0x44, 0xBD, 0xDB, 0x24, 0x44, 0xBD, 0xDB, 0x25, 0x44, 0xBD, 0xDB, 0x26, 0x44, 0xBD, 0xDB,
+ 0x27, 0x44, 0xBD, 0xDB, 0x28, 0x44, 0xBD, 0xDB, 0x29, 0x44, 0xBD, 0xDB, 0x2A, 0x44, 0xBD, 0xDB,
+ 0x2B, 0x44, 0xBD, 0xDB, 0x2C, 0x44, 0xBD, 0xDB, 0x2D, 0x44, 0xBD, 0xDB, 0x2E, 0x44, 0xBD, 0xDB,
+ 0x2F, 0x44, 0xBD, 0xDB, 0x17, 0x60, 0x24, 0xFD, 0x2F, 0x60, 0x74, 0x63, 0x17, 0x60, 0x25, 0xFD,
+ 0x30, 0x44, 0x17, 0x60, 0x26, 0xFB, 0x31, 0x44, 0x17, 0x60, 0x27, 0xFB, 0x32, 0x44, 0x17, 0x60,
+ 0x28, 0xFB, 0x33, 0x44, 0x17, 0x60, 0x29, 0xFB, 0x81, 0xFF, 0x91, 0xFF, 0x58, 0x51, 0x44, 0x00,
+ 0x82, 0xFF, 0x92, 0xFF, 0x58, 0x51, 0x40, 0x00, 0x83, 0xFF, 0x93, 0xFF, 0x58, 0x51, 0x3C, 0x00,
+ 0x84, 0xFF, 0x94, 0xFF, 0x58, 0x51, 0x38, 0x00, 0x85, 0xFF, 0x95, 0xFF, 0x58, 0x51, 0x34, 0x00,
+ 0x86, 0xFF, 0x96, 0xFF, 0x58, 0x51, 0x30, 0x00, 0x87, 0xFF, 0x97, 0xFF, 0x58, 0x51, 0x2C, 0x00,
+ 0x80, 0xFF, 0x90, 0xFF, 0x99, 0xFF, 0x17, 0x60, 0x24, 0xF1, 0x30, 0x44, 0x64, 0x43, 0xBD, 0xDB,
+ 0x31, 0x44, 0xBD, 0xDB, 0x32, 0x44, 0xBD, 0xDB, 0x33, 0x44, 0xBD, 0xDB, 0x34, 0x44, 0xBD, 0xDB,
+ 0x35, 0x44, 0xBD, 0xDB, 0x36, 0x44, 0xBD, 0xDB, 0x37, 0x44, 0xBD, 0xDB, 0x38, 0x44, 0xBD, 0xDB,
+ 0x39, 0x44, 0xBD, 0xDB, 0x3A, 0x44, 0xBD, 0xDB, 0x3B, 0x44, 0xBD, 0xDB, 0x3C, 0x44, 0xBD, 0xDB,
+ 0x3D, 0x44, 0xBD, 0xDB, 0x3E, 0x44, 0xBD, 0xDB, 0x3F, 0x44, 0xBD, 0xDB, 0xEE, 0x60, 0x48, 0x64,
+ 0x0A, 0xFB, 0x40, 0x21, 0xFE, 0x01, 0x70, 0x00, 0x42, 0x50, 0x40, 0x53, 0x17, 0x60, 0x25, 0x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BF, 0x60, 0xFF, 0x65,
+ 0x29, 0x44, 0x24, 0x89, 0x80, 0x60, 0x00, 0x65, 0x29, 0x44, 0x34, 0x89, 0x80, 0x60, 0x00, 0x63,
+ 0x05, 0x00, 0x3F, 0x60, 0xFF, 0x65, 0x29, 0x44, 0x24, 0x89, 0x00, 0x63, 0x1E, 0xF2, 0x39, 0xF1,
+ 0xC0, 0x60, 0xFF, 0xB5, 0x0A, 0x18, 0x60, 0x47, 0x1F, 0xB4, 0xD0, 0x84, 0xE0, 0xA0, 0x02, 0x0D,
+ 0x00, 0x64, 0x02, 0x00, 0x01, 0x04, 0x1F, 0x64, 0x60, 0x47, 0xB4, 0x84, 0x07, 0x60, 0xEB, 0xF1,
+ 0x3C, 0x94, 0xB0, 0x84, 0x60, 0x4C, 0x22, 0x60, 0xC6, 0x65, 0x60, 0x47, 0x1F, 0xB4, 0xE0, 0x84,
+ 0xE0, 0x84, 0x44, 0xD3, 0x5A, 0xD1, 0x01, 0x60, 0x00, 0xE1, 0x05, 0x60, 0x69, 0x6B, 0x60, 0x4C,
+ 0xB5, 0xFF, 0x64, 0x4C, 0x7C, 0x44, 0x29, 0x40, 0x80, 0x2B, 0x67, 0x44, 0x60, 0x4C, 0x32, 0x00,
+ 0x15, 0x60, 0xDD, 0xF3, 0xFF, 0xFF, 0x60, 0x40, 0x04, 0x26, 0xCB, 0x01, 0xBF, 0x01, 0x40, 0x60,
+ 0x00, 0x65, 0x29, 0x44, 0x34, 0x89, 0x40, 0x60, 0x00, 0x63, 0x9F, 0xF2, 0x1E, 0xF2, 0x39, 0xF1,
+ 0xC0, 0x60, 0xFF, 0xB5, 0x0A, 0x18, 0x60, 0x47, 0x1F, 0xB4, 0xD0, 0x84, 0xE0, 0xA0, 0x02, 0x0D,
+ 0x00, 0x64, 0x02, 0x00, 0x01, 0x04, 0x1F, 0x64, 0x60, 0x47, 0xB4, 0x84, 0x07, 0x60, 0xEB, 0xF1,
+ 0x3C, 0x94, 0xB0, 0x81, 0x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D3, 0xF1, 0xFF, 0xFF, 0x15, 0x60, 0xD8, 0xF9, 0x39, 0xF1, 0x12, 0x60, 0xBF, 0xF1,
+ 0x64, 0x41, 0x64, 0x5E, 0x60, 0x45, 0x64, 0x47, 0x1F, 0xB4, 0x54, 0x94, 0xE0, 0xA0, 0x02, 0x0D,
+ 0x00, 0x64, 0x02, 0x00, 0x01, 0x04, 0x1F, 0x64, 0x60, 0x47, 0x07, 0x60, 0xEB, 0xF1, 0xB4, 0x84,
+ 0xB0, 0x8C, 0x22, 0x60, 0xC6, 0x7C, 0x60, 0x47, 0x1F, 0xB4, 0xE0, 0x84, 0xE0, 0x84, 0x40, 0xD3,
+ 0x5A, 0xD1, 0x01, 0x60, 0x00, 0xE1, 0x05, 0x60, 0x69, 0x6B, 0x60, 0x4C, 0xB5, 0xFF, 0x64, 0x4C,
+ 0x7C, 0x44, 0x29, 0x40, 0x80, 0x2B, 0x67, 0x44, 0x60, 0x4C, 0x40, 0xE1, 0x01, 0x60, 0x08, 0xE1,
+ 0x84, 0xFF, 0xC1, 0x60, 0x6B, 0x64, 0x40, 0x42, 0x82, 0xFF, 0x3C, 0x44, 0x60, 0x46, 0x40, 0x42,
+ 0x13, 0x64, 0x3A, 0xDB, 0x10, 0x60, 0x00, 0x65, 0x3C, 0x46, 0x2A, 0xF2, 0x15, 0x60, 0xBE, 0xF1,
+ 0xA4, 0x84, 0xC4, 0xBC, 0x40, 0x48, 0x64, 0x44, 0x04, 0x26, 0x09, 0x00, 0x02, 0x26, 0x0A, 0x00,
+ 0x01, 0x26, 0x0B, 0x00, 0x08, 0x2A, 0x03, 0x00, 0x0B, 0x63, 0x6E, 0x64, 0x08, 0x00, 0x15, 0x63,
+ 0x37, 0x64, 0x05, 0x00, 0x38, 0x63, 0x14, 0x64, 0x02, 0x00, 0x70, 0x63, 0x0A, 0x64, 0x43, 0x4D,
+ 0x40, 0x45, 0x00, 0xE1, 0xF0, 0xFE, 0x00, 0x60, 0x1E, 0x64, 0x1B, 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, 0x44, 0x40, 0x2B, 0x03, 0x15, 0xAF, 0x60, 0x10, 0x78, 0xFF, 0xFF, 0x29, 0x40, 0x10, 0x26,
+ 0x04, 0x00, 0x04, 0x74, 0xCD, 0xE2, 0xA1, 0xFF, 0xFF, 0xFF, 0x6C, 0x44, 0xB6, 0xFF, 0xB7, 0xFF,
+ 0xC4, 0xE2, 0x01, 0x60, 0x18, 0xE1, 0x05, 0x76, 0xAD, 0xE2, 0x41, 0xE1, 0xA1, 0xFF, 0x6C, 0x45,
+ 0xA1, 0xFF, 0x65, 0x41, 0x7F, 0x60, 0x7F, 0x7C, 0x6C, 0x44, 0xA0, 0x84, 0x15, 0xA7, 0x15, 0xA4,
+ 0x21, 0x46, 0x26, 0xFA, 0x22, 0x46, 0x10, 0xFA, 0x21, 0x46, 0x29, 0x40, 0x40, 0x2B, 0x07, 0x00,
+ 0xB6, 0xFF, 0xA1, 0xFF, 0x40, 0x60, 0x00, 0x65, 0x6C, 0x44, 0x1A, 0xFA, 0x09, 0x00, 0x65, 0x44,
+ 0x0F, 0xB4, 0x06, 0xA8, 0x80, 0x60, 0x00, 0x65, 0x08, 0x28, 0x7C, 0x45, 0x29, 0x44, 0x34, 0x89,
+ 0x27, 0xF0, 0x65, 0x47, 0x1F, 0xB1, 0x34, 0x97, 0x64, 0x5E, 0x07, 0x60, 0xF5, 0xF1, 0x29, 0x40,
+ 0x40, 0x2B, 0x04, 0x00, 0x64, 0x40, 0x02, 0x26, 0x10, 0x60, 0x00, 0xBC, 0x27, 0xFA, 0x01, 0x60,
+ 0x18, 0xE1, 0x00, 0x64, 0x33, 0xFB, 0xA8, 0xE2, 0x05, 0xE1, 0x28, 0x40, 0x03, 0x26, 0xCE, 0x00,
+ 0x31, 0x40, 0x20, 0x2A, 0x03, 0x00, 0x28, 0x40, 0x50, 0x3A, 0xC8, 0x00, 0x24, 0x44, 0x20, 0x2A,
+ 0xC5, 0x00, 0x2B, 0x44, 0xAC, 0x80, 0x28, 0x40, 0xB4,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 0x86, 0x24, 0x46, 0x60, 0x40, 0xFB, 0x3B, 0x07, 0x00,
+ 0x80, 0x26, 0x02, 0x00, 0x23, 0x46, 0x03, 0x4C, 0x46, 0x61, 0x3A, 0x65, 0x0C, 0x00, 0x2E, 0xF3,
+ 0x40, 0x45, 0xF8, 0x2B, 0x02, 0x00, 0x40, 0x45, 0x03, 0x00, 0x58, 0x4F, 0x44, 0x00, 0x07, 0x02,
+ 0x58, 0x4F, 0x50, 0x00, 0x04, 0x05, 0x66, 0x50, 0x65, 0x52, 0x61, 0x51, 0x09, 0x00, 0x26, 0x47,
+ 0x00, 0xBF, 0x0E, 0xFB, 0x2E, 0xF5, 0x05, 0xF0, 0x80, 0x60, 0x64, 0x50, 0x00, 0x72, 0x7E, 0x71,
+ 0xAC, 0xFF, 0xB3, 0x60, 0xBE, 0x78, 0xFF, 0xFF, 0x8E, 0xFF, 0x0F, 0xF3, 0x0F, 0x60, 0xFE, 0x65,
+ 0x24, 0x86, 0x0D, 0xF3, 0x24, 0x46, 0x60, 0x40, 0xFB, 0x3B, 0x07, 0x00, 0x80, 0x26, 0x02, 0x00,
+ 0x23, 0x46, 0x03, 0x4C, 0x46, 0x61, 0x3A, 0x65, 0x0C, 0x00, 0x2E, 0xF3, 0x40, 0x45, 0xF8, 0x2B,
+ 0x02, 0x00, 0x40, 0x45, 0x03, 0x00, 0x58, 0x4F, 0x16, 0x00, 0x07, 0x02, 0x58, 0x4F, 0x22, 0x00,
+ 0x04, 0x05, 0x66, 0x50, 0x65, 0x52, 0x61, 0x51, 0x09, 0x00, 0x26, 0x47, 0x00, 0xBF, 0x0F, 0xFB,
+ 0x2E, 0xF5, 0x05, 0xF0, 0x80, 0x60, 0x64, 0x50, 0x00, 0x72, 0x7E, 0x71, 0x8D, 0xFF, 0xAD, 0xFF,
+ 0xB3, 0x60, 0xBE, 0x78, 0xFF, 0xFF, 0x25, 0x44, 0x89, 0xF1, 0x8A, 0xF1, 0xD0, 0x80, 0xD0, 0x80,
+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 0x62, 0x43, 0x46, 0x43, 0x3C, 0x46, 0x07, 0xF4, 0x3A, 0xF2, 0xFF, 0xFF, 0xA3, 0x46, 0x60, 0x40,
+ 0x22, 0x26, 0x49, 0x00, 0x60, 0x45, 0x63, 0x42, 0x5A, 0xD0, 0xCD, 0x81, 0x3C, 0x46, 0x18, 0x02,
+ 0x64, 0x44, 0x88, 0x3A, 0x15, 0x00, 0x8E, 0x37, 0x00, 0x00, 0x65, 0x44, 0x01, 0x26, 0x5F, 0x00,
+ 0x04, 0x26, 0x03, 0x00, 0x10, 0x26, 0x01, 0x00, 0x31, 0x00, 0xA3, 0x46, 0x3B, 0xF2, 0xFF, 0xFF,
+ 0x60, 0x40, 0x80, 0x27, 0x3E, 0x00, 0xA3, 0x46, 0x00, 0x7C, 0x22, 0xF8, 0xA3, 0x46, 0x4F, 0x00,
+ 0xA3, 0x46, 0x65, 0x44, 0x01, 0x26, 0x0B, 0x00, 0x04, 0x26, 0x03, 0x00, 0x10, 0x26, 0x01, 0x00,
+ 0x1D, 0x00, 0x3B, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x27, 0x2B, 0x00, 0x17, 0x00, 0x87, 0xF3,
+ 0xFF, 0xFF, 0x60, 0x46, 0x3A, 0xF2, 0x66, 0x43, 0xFF, 0xB4, 0x3C, 0x46, 0x22, 0xF0, 0x60, 0x47,
+ 0xB0, 0x84, 0x22, 0xFA, 0x63, 0x46, 0x3B, 0xF0, 0x60, 0x40, 0x04, 0x27, 0x03, 0x00, 0x10, 0x27,
+ 0x01, 0x00, 0x04, 0x00, 0x64, 0x40, 0x80, 0x27, 0x14, 0x00, 0x00, 0x00, 0x3C, 0x46, 0x02, 0x65,
+ 0xBE, 0x60, 0xB6, 0x78, 0xFF, 0xFF, 0xCD, 0x81, 0x63, 0x42, 0x5A, 0xD0, 0x3C, 0x46, 0x09, 0x02,
+ 0x64, 0x44, 0x88, 0x3A, 0x06, 0x00, 0x77, 0x37, 0x1A, 0x00, 0x78, 0x37, 0x18, 0x00, 0x8E, 0x37,
+ 0x16, 0x00, 0x3C, 0x46, 0x22, 0xF0, 0x80, 0x67, 0xB0, 0x84, 0xA2, 0xDA, 0xFF, 0xFF, 0x3F, 0xF2,
+ 0x3E, 0xF0, 0x08, 0xA4, 0x60, 0x41, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x26, 0x03, 0x00,
+ 0x04, 0x26, 0x03, 0x00, 0x04, 0x00, 0x04, 0x2B, 0x02, 0x00, 0x61, 0x44, 0x3F, 0xFA, 0x3C, 0x46,
+ 0x2C, 0xF2, 0x27, 0x40, 0x01, 0x27, 0x32, 0xF2, 0xB4, 0xF1, 0x60, 0x40, 0x01, 0x26, 0x47, 0x00,
+ 0x09, 0x60, 0x00, 0x64, 0xD0, 0x80, 0x3F, 0xF2, 0x09, 0x06, 0x2C, 0x45, 0xC4, 0x84, 0xD0, 0x80,
+ 0x40, 0x4A, 0x34, 0x06, 0x60, 0x43, 0x64, 0x44, 0x54, 0x88, 0x17, 0x00, 0x60, 0x45, 0x13, 0x60,
+ 0x4B, 0xF3, 0xBB, 0xF3, 0x00, 0xBC, 0x60, 0x47, 0xEC, 0xA0, 0x28, 0x03, 0x27, 0x07, 0x2C, 0x44,
+ 0xC4, 0x81, 0x02, 0x60, 0x1C, 0x65, 0x45, 0x4A, 0xD5, 0x80, 0x2C, 0x45, 0x1F, 0x06, 0x27, 0x40,
+ 0x04, 0x27, 0x25, 0x00, 0x2A, 0x43, 0xD7, 0x85, 0x45, 0x48, 0xB5, 0xF1, 0x0F, 0xF2, 0xD3, 0x80,
+ 0x01, 0x65, 0x01, 0x07, 0x00, 0x65, 0xB4, 0x84, 0x0F, 0xFA, 0x00, 0x63, 0x3F, 0xF2, 0x28, 0x45,
+ 0x60, 0x41, 0xD4, 0x84, 0xDF, 0x83, 0xFC, 0x07, 0x14, 0xFC, 0x17, 0xFA, 0x04, 0x60, 0x00, 0x64,
+ 0x27, 0x45, 0xB4, 0x84, 0x2A, 0xFA, 0x28, 0x43, 0x16, 0xFC, 0x0D, 0x00, 0x3F, 0xF2, 0x2C, 0x45,
+ 0xB5, 0xF1, 0xC4, 0x81, 0xD1, 0x80, 0x0F, 0xF2, 0x01, 0x06, 0x01, 0xBC, 0x0F, 0xFA, 0x3F, 0xF2,
+ 0x17, 0xFA, 0x01, 0x64, 0x14, 0xFA, 0x0F, 0xF0, 0xFF, 0xFF, 0x64, 0x40, 0x01, 0x2A, 0x6F, 0x00,
+ 0x64, 0xF1, 0x15, 0x60, 0xDD, 0xF3, 0x64, 0x40, 0x01, 0x27, 0x03, 0x00, 0x60, 0x40, 0x02, 0x26,
+ 0x14, 0x00, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x12, 0xF0, 0x15, 0x60, 0xDE, 0xF3, 0x63, 0x46,
+ 0x64, 0x40, 0x10, 0x2A, 0x20, 0x00, 0x60, 0x40, 0x02, 0x26, 0x07, 0x00, 0x01, 0x26, 0x08, 0x00,
+ 0x04, 0x26, 0x09, 0x00, 0x06, 0x61, 0x6E, 0x63, 0x08, 0x00, 0x02, 0x61, 0x14, 0x63, 0x05, 0x00,
+ 0x00, 0x61, 0x0A, 0x63, 0x02, 0x00, 0x04, 0x61, 0x37, 0x63, 0x00, 0x64, 0x25, 0x60, 0xA2, 0x65,
+ 0x45, 0xD1, 0xD5, 0x81, 0x15, 0x60, 0xDA, 0xF9, 0x25, 0x60, 0x7A, 0x65, 0x45, 0xD1, 0x1C, 0xFC,
+ 0xB0, 0x84, 0x1E, 0xFA, 0x3C, 0x00, 0x60, 0x40, 0x10, 0x2A, 0x04, 0x00, 0x08, 0x61, 0x1E, 0x60,
+ 0x0B, 0x63, 0x27, 0x00, 0x20, 0x2A, 0x04, 0x00, 0x0A, 0x61, 0x16, 0x60, 0x0F, 0x63, 0x21, 0x00,
+ 0x40, 0x2A, 0x04, 0x00, 0x0C, 0x61, 0x12, 0x60, 0x0A, 0x63, 0x1B, 0x00, 0x80, 0x2A, 0x04, 0x00,
+ 0x0E, 0x61, 0x0E, 0x60, 0x0E, 0x63, 0x15, 0x00, 0x01, 0x2B, 0x04, 0x00, 0x10, 0x61, 0x0E, 0x60,
+ 0x09, 0x63, 0x0F, 0x00, 0x02, 0x2B, 0x04, 0x00, 0x12, 0x61, 0x0A, 0x60, 0x0D, 0x63, 0x09, 0x00,
+ 0x04, 0x2B, 0x04, 0x00, 0x14, 0x61, 0x0A, 0x60, 0x08, 0x63, 0x03, 0x00, 0x16, 0x61, 0x0A, 0x60,
+ 0x0C, 0x63, 0x1E, 0xF0, 0x40, 0x67, 0x25, 0x60, 0xA2, 0x65, 0x45, 0xD1, 0xD5, 0x81, 0x15, 0x60,
+ 0xDA, 0xF9, 0x25, 0x60, 0x7A, 0x65, 0x45, 0xD1, 0x1C, 0xFC, 0xB0, 0x84, 0x1E, 0xFA, 0xAA, 0xF2,
+ 0x15, 0x60, 0xC2, 0xF3, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x44, 0x44, 0x61, 0x40, 0x08, 0x26,
+ 0x02, 0x00, 0x61, 0x40, 0x80, 0x36, 0x12, 0xF2, 0x63, 0x46, 0x2C, 0x60, 0x26, 0x61, 0x00, 0x7F,
+ 0x60, 0x45, 0x45, 0xD3, 0xFF, 0xFF, 0x60, 0x45, 0x00, 0x7F, 0x4B, 0xFB, 0x65, 0x44, 0x00, 0x7E,
+ 0xBB, 0xFB, 0x62, 0xF1, 0x60, 0x43, 0x60, 0x47, 0xD0, 0x80, 0xC0, 0x65, 0x01, 0x06, 0x64, 0x44,
+ 0x0A, 0x36, 0x70, 0x64, 0x14, 0x36, 0x38, 0x64, 0x37, 0x36, 0x15, 0x64, 0x6E, 0x36, 0x0B, 0x64,
+ 0x44, 0x86, 0x2A, 0xF2, 0x07, 0xF0, 0x60, 0x40, 0xB0, 0x3A, 0x03, 0x00, 0x40, 0x3B, 0x01, 0x00,
+ 0x12, 0x00, 0x0C, 0xB4, 0x08, 0x3A, 0x44, 0x00, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x2B,
+ 0x3F, 0x00, 0x17, 0xF2, 0x22, 0xF0, 0xFF, 0xFF, 0x64, 0x40, 0x22, 0x22, 0x04, 0x00, 0x00, 0xA8,
+ 0x01, 0xA8, 0x36, 0x03, 0x35, 0x03, 0x3C, 0x46, 0x2A, 0xF0, 0x40, 0x67, 0xB0, 0x84, 0xA2, 0xDA,
+ 0x60, 0x45, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x43, 0x60, 0x40, 0x01, 0x26, 0x05, 0x00, 0x04, 0x26,
+ 0x1D, 0x00, 0x10, 0x26, 0x10, 0x00, 0x04, 0x00, 0x04, 0x27, 0x18, 0x00, 0x10, 0x27, 0x0B, 0x00,
+ 0x65, 0x44, 0x2A, 0x61, 0x60, 0x40, 0x03, 0x2B, 0x24, 0x61, 0x8F, 0xB0, 0x88, 0x36, 0x02, 0xA1,
+ 0x41, 0x4C, 0x98, 0xFA, 0x15, 0x00, 0x65, 0x44, 0x32, 0x61, 0x60, 0x40, 0x03, 0x2B, 0x2C, 0x61,
+ 0x8F, 0xB0, 0x88, 0x36, 0x02, 0xA1, 0x41, 0x4C, 0x98, 0xFA, 0x0A, 0x00, 0x65, 0x44, 0x2E, 0x61,
+ 0x60, 0x40, 0x03, 0x2B, 0x28, 0x61, 0x8F, 0xB0, 0x88, 0x36, 0x02, 0xA1, 0x41, 0x4C, 0x98, 0xFA,
+ 0xBB, 0x60, 0xFB, 0x78, 0xFF, 0xFF, 0x66, 0x45, 0xAA, 0xF2, 0x15, 0x60, 0xC2, 0xF3, 0x24, 0x46,
+ 0x61, 0x40, 0x08, 0x26, 0x02, 0x00, 0x61, 0x40, 0x80, 0x36, 0x12, 0xF2, 0x65, 0x46, 0x60, 0x40,
+ 0x10, 0x26, 0x34, 0x00, 0x2C, 0x45, 0x17, 0xF2, 0x4B, 0xF1, 0xC4, 0x84, 0xE0, 0x84, 0xE0, 0x84,
+ 0xE0, 0x81, 0x64, 0x45, 0x16, 0xA1, 0xB7, 0x60, 0x58, 0x4D, 0xC0, 0x78, 0xFF, 0xFF, 0x64, 0xF1,
+ 0x01, 0xA4, 0xE0, 0x84, 0xE0, 0x84, 0x64, 0x40, 0x01, 0x2B, 0x06, 0xA4, 0x1B, 0xFA, 0xBB, 0xF3,
+ 0x25, 0x60, 0x82, 0x65, 0x60, 0x40, 0x0B, 0x37, 0x00, 0x63, 0x0F, 0x37, 0x02, 0x63, 0x0A, 0x37,
+ 0x04, 0x63, 0x0E, 0x37, 0x06, 0x63, 0x09, 0x37, 0x08, 0x63, 0x0D, 0x37, 0x0A, 0x63, 0x08, 0x37,
+ 0x0C, 0x63, 0x0C, 0x37, 0x0E, 0x63, 0x28, 0xA3, 0x47, 0xD1, 0xD8, 0xA3, 0xD7, 0x83, 0x15, 0x60,
+ 0xD9, 0xF9, 0x47, 0xD1, 0x40, 0x67, 0xB0, 0x84, 0x1F, 0xFA, 0x56, 0x00, 0x2A, 0xF2, 0xFF, 0xFF,
+ 0x60, 0x40, 0x80, 0x36, 0x17, 0x00, 0x50, 0x36, 0x15, 0x00, 0x10, 0x36, 0x13, 0x00, 0x30, 0x36,
+ 0x11, 0x00, 0xA0, 0x36, 0x0F, 0x00, 0xB0, 0x36, 0x0D, 0x00, 0xC0, 0x36, 0x0B, 0x00, 0xBB, 0xF3,
+ 0xFF, 0xFF, 0x60, 0x40, 0x0A, 0x37, 0x06, 0x00, 0x15, 0x60, 0xDD, 0xF3, 0x80, 0x60, 0x00, 0x61,
+ 0x60, 0x40, 0x04, 0x26, 0x00, 0x61, 0xBB, 0xF3, 0x25, 0x60, 0x7A, 0x65, 0x60, 0x40, 0x0A, 0x37,
+ 0x00, 0x63, 0x14, 0x37, 0x02, 0x63, 0x37, 0x37, 0x04, 0x63, 0x6E, 0x37, 0x06, 0x63, 0x28, 0xA3,
+ 0x47, 0xD1, 0xD8, 0xA3, 0xD7, 0x83, 0x15, 0x60, 0xD9, 0xF9,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0x46, 0x60, 0x40, 0x00, 0x36, 0x2E, 0x00,
+ 0x01, 0x36, 0x1E, 0x00, 0x03, 0x3A, 0x25, 0x00, 0x64, 0x46, 0x10, 0xF2, 0x11, 0xFA, 0x12, 0xF2,
+ 0x00, 0x61, 0x60, 0x47, 0x00, 0x7F, 0x12, 0xFA, 0x97, 0xFA, 0x46, 0x44, 0x63, 0x46, 0xC1, 0x60,
+ 0x58, 0x4E, 0x72, 0x78, 0xFF, 0xFF, 0x65, 0x40, 0x00, 0x3A, 0x04, 0x00, 0xC1, 0x60, 0x58, 0x4E,
+ 0xBC, 0x78, 0xFF, 0xFF, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x96, 0xFC, 0x63, 0x46, 0x43, 0x00,
+ 0x64, 0x46, 0x16, 0xF2, 0x00, 0x61, 0x20, 0x28, 0xFF, 0xA4, 0x97, 0xFA, 0x16, 0xFA, 0x63, 0x46,
+ 0x3A, 0x00, 0x64, 0x46, 0x00, 0x61, 0x97, 0xFA, 0x63, 0x46, 0x35, 0x00, 0x07, 0xF0, 0x66, 0x41,
+ 0x64, 0x46, 0x16, 0xF2, 0xFF, 0xFF, 0x20, 0x28, 0xFF, 0xA4, 0x16, 0xFA, 0x93, 0xF4, 0x12, 0xF2,
+ 0x20, 0x28, 0xFF, 0xA3, 0x13, 0xFC, 0x61, 0x46, 0x63, 0x40, 0x00, 0x3A, 0x24, 0x00, 0xC1, 0x60,
+ 0x58, 0x4E, 0x93, 0x78, 0xFF, 0xFF, 0x61, 0x40, 0xFF, 0x36, 0x1D, 0x00, 0x66, 0x41, 0x64, 0x46,
+ 0x12, 0xF2, 0x93, 0xF4, 0x61, 0x46, 0x20, 0x28, 0x16, 0x00, 0x44, 0x44, 0xC1, 0x60, 0x58, 0x4E,
+ 0x72, 0x78, 0xFF, 0xFF, 0x24, 0x5C, 0x65, 0x40, 0x00, 0x36, 0x06, 0x00, 0x66, 0x41, 0x64, 0x46,
+ 0x01, 0x64, 0x17, 0xFA, 0x61, 0x46, 0x07, 0x00, 0x66, 0x43, 0x64, 0x46, 0xC1, 0x60, 0x58, 0x4E,
+ 0xBC, 0x78, 0xFF, 0xFF, 0x63, 0x46, 0xBE, 0x60, 0xA6, 0x78, 0xFF, 0xFF, 0x07, 0xF0, 0x66, 0x43,
+ 0x64, 0x46, 0x17, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0xFF, 0x27, 0xFF, 0xFF, 0x00, 0x36, 0x07, 0x00,
+ 0x01, 0x36, 0x1C, 0x00, 0x02, 0x36, 0x24, 0x00, 0x03, 0x36, 0x43, 0x00, 0xFF, 0xFF, 0x15, 0x60,
+ 0xF9, 0xF1, 0x16, 0xF2, 0x43, 0x44, 0xD0, 0x80, 0x2C, 0x60, 0x24, 0x61, 0x09, 0x03, 0xA1, 0xD1,
+ 0x2C, 0x60, 0x22, 0x63, 0xC0, 0x84, 0x16, 0xFA, 0xA3, 0xD3, 0xFF, 0xFF, 0x13, 0xFA, 0x39, 0x00,
+ 0x96, 0xFC, 0xC1, 0x60, 0x58, 0x4E, 0xBC, 0x78, 0xFF, 0xFF, 0x33, 0x00, 0x43, 0x44, 0xC1, 0x60,
+ 0x58, 0x4E, 0xBC, 0x78, 0xFF, 0xFF, 0x16, 0x60, 0x11, 0xF3, 0x96, 0xFC, 0x13, 0xFA, 0x29, 0x00,
+ 0x63, 0x46, 0x2B, 0x60, 0xF4, 0x63, 0xA3, 0xD3, 0x15, 0xF2, 0x60, 0x45, 0xD4, 0x80, 0x07, 0xF0,
+ 0x0C, 0x03, 0x66, 0x41, 0x44, 0x44, 0x64, 0x46, 0x12, 0xF2, 0x61, 0x46, 0xC1, 0x60, 0x58, 0x4E,
+ 0x72, 0x78, 0xFF, 0xFF, 0x65, 0x40, 0x00, 0x3A, 0x19, 0x00, 0x66, 0x43, 0x24, 0x46, 0xC1, 0x60,
+ 0x58, 0x4E, 0xBC, 0x78, 0xFF, 0xFF, 0x12, 0xF2, 0x91, 0xF2, 0x90, 0xFA, 0x60, 0x5F, 0x12, 0xFA,
+ 0x04, 0x00, 0xC1, 0x60, 0x58, 0x4E, 0xBC, 0x78, 0xFF, 0xFF, 0x03, 0x64, 0x17, 0xFA, 0x63, 0x46,
+ 0x05, 0x00, 0x24, 0x43, 0x02, 0x64, 0x17, 0xFA, 0x63, 0x46, 0x00, 0x00, 0x03, 0x64, 0x3B, 0xDB,
+ 0xCA, 0xFE, 0x47, 0xF1, 0x01, 0x65, 0x32, 0x40, 0x04, 0x27, 0x08, 0x00, 0x2C, 0xF2, 0x64, 0x45,
+ 0x02, 0x22, 0x04, 0x00, 0x60, 0x40, 0x01, 0x26, 0x01, 0x00, 0x7B, 0x00, 0x14, 0xF2, 0x65, 0x40,
+ 0x01, 0x26, 0x0C, 0x00, 0x60, 0x45, 0x05, 0x64, 0x3B, 0xDB, 0x65, 0x44, 0xCC, 0x85, 0x25, 0x60,
+ 0xD6, 0x64, 0xE5, 0x60, 0x78, 0x41, 0xD3, 0x78, 0x97, 0xF1, 0x50, 0x00, 0x60, 0x41, 0x2A, 0xF0,
+ 0x00, 0x60, 0x0C, 0x64, 0xA0, 0x84, 0x04, 0x36, 0x02, 0x00, 0x0C, 0x3A, 0x01, 0x00, 0x46, 0x00,
+ 0x61, 0x45, 0x60, 0x43, 0x25, 0x60, 0xD6, 0x64, 0xE5, 0x60, 0x78, 0x41, 0xD3, 0x78, 0x97, 0xF1,
+ 0x63, 0x40, 0x08, 0x36, 0x01, 0x00, 0x3A, 0x00, 0x14, 0xF2, 0x1C, 0x65, 0x60, 0x41, 0x00, 0x63,
+ 0xCD, 0x81, 0xC7, 0x83, 0xFD, 0x02, 0x3F, 0xF0, 0x2C, 0xF2, 0xC3, 0x83, 0x60, 0x40, 0x01, 0x2A,
+ 0x0D, 0x00, 0x25, 0x60, 0xD4, 0x64, 0xE5, 0x60, 0x78, 0x41, 0xC7, 0x78, 0x97, 0xF1, 0x25, 0x60,
+ 0xDA, 0x64, 0xE5, 0x60, 0x78, 0x41, 0x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E1, 0x31, 0x40, 0x01, 0x26, 0xF9, 0xE1, 0xA4, 0x60,
+ 0xAA, 0x78, 0xFF, 0xFF, 0x15, 0x60, 0xFB, 0xF1, 0x60, 0x45, 0x2C, 0x60, 0x0A, 0x61, 0xC5, 0x83,
+ 0xA3, 0xD3, 0xFF, 0xFF, 0x60, 0x41, 0x66, 0x45, 0x24, 0x46, 0x0E, 0xF2, 0x65, 0x46, 0x64, 0x45,
+ 0xD5, 0x81, 0x61, 0x45, 0x00, 0x7F, 0xD4, 0x80, 0x64, 0x43, 0x08, 0x04, 0xE3, 0x83, 0x63, 0x45,
+ 0xC5, 0x81, 0x61, 0x45, 0xD4, 0x80, 0x02, 0x65, 0x03, 0x07, 0x03, 0x00, 0x00, 0x65, 0x01, 0x00,
+ 0x01, 0x65, 0x2E, 0x58, 0xFF, 0xFF, 0x66, 0x43, 0x64, 0x46, 0x8F, 0xF0, 0x12, 0xF2, 0x91, 0xF2,
+ 0x60, 0x40, 0x10, 0x36, 0x05, 0x00, 0x12, 0x36, 0x08, 0x00, 0x0C, 0x36, 0x0B, 0x00, 0x0F, 0x00,
+ 0x40, 0x61, 0xA5, 0x80, 0x0A, 0x64, 0x13, 0x02, 0xF3, 0x01, 0x10, 0x61, 0xA5, 0x80, 0x0E, 0x64,
+ 0x0E, 0x02, 0xEE, 0x01, 0x08, 0x61, 0xA5, 0x80, 0x10, 0x64, 0x09, 0x02, 0xE9, 0x01, 0xE1, 0x81,
+ 0xA5, 0x80, 0x03, 0x05, 0xC8, 0x84, 0x03, 0x02, 0xE3, 0x01, 0xFF, 0x61, 0x02, 0x00, 0x12, 0xFA,
+ 0x91, 0xFA, 0x63, 0x46, 0x2E, 0x58, 0xFF, 0xFF, 0x8F, 0xF0, 0x12, 0xF2, 0x91, 0xF2, 0x60, 0x40,
+ 0x0A, 0x36, 0x05, 0x00, 0x0E, 0x36, 0x08, 0x00, 0x10, 0x36, 0x0B, 0x00, 0x0F, 0x00, 0x08, 0x61,
+ 0xA5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0x43, 0x4C, 0x0D, 0x60, 0x72, 0x65, 0xBD, 0xD2, 0x25, 0x5C, 0x90, 0x9C,
+ 0x64, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x44, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1,
+ 0x64, 0x47, 0x90, 0x9C, 0x20, 0x44, 0x40, 0x80, 0xBD, 0xD2, 0x20, 0x5C, 0x90, 0x9C, 0x64, 0x47,
+ 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x44, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x47,
+ 0x90, 0x9C, 0x21, 0x44, 0x40, 0x81, 0xBD, 0xD2, 0x21, 0x5C, 0x90, 0x9C, 0x64, 0x47, 0x00, 0x7F,
+ 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x44, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x47, 0x90, 0x9C,
+ 0x22, 0x44, 0x40, 0x82, 0xBD, 0xD2, 0x22, 0x5C, 0x90, 0x9C, 0x64, 0x47, 0x00, 0x7F, 0xE0, 0x84,
+ 0x44, 0xD1, 0x64, 0x44, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x47, 0x90, 0x9C, 0x23, 0x44,
+ 0x40, 0x83, 0xBD, 0xD2, 0x23, 0x5C, 0x90, 0x9C, 0x64, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1,
+ 0x64, 0x44, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x47, 0x90, 0x9C, 0x24, 0x44, 0x40, 0x84,
+ 0xBD, 0xD2, 0x24, 0x5C, 0x90, 0x9C, 0x64, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x44,
+ 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD1, 0x64, 0x47, 0x90, 0x9C, 0x25, 0x44, 0x40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0x76,
+ 0x14, 0x1B, 0x26, 0x46, 0x3B, 0xF2, 0x0C, 0x60, 0xBC, 0x63, 0x60, 0x47, 0xC0, 0xB4, 0xE8, 0x84,
+ 0xE8, 0x84, 0xE8, 0x84, 0x43, 0x93, 0xE3, 0x9C, 0x64, 0x47, 0x80, 0x7C, 0x64, 0x5F, 0x60, 0x50,
+ 0x7F, 0x64, 0x23, 0x97, 0x80, 0xBF, 0x60, 0x51, 0x07, 0x00, 0x01, 0xA7, 0x80, 0xBF, 0x60, 0x50,
+ 0x80, 0x60, 0x40, 0x71, 0x80, 0x60, 0x7C, 0x72, 0x01, 0x76, 0xFF, 0xFF, 0xA1, 0xFF, 0xFF, 0xFF,
+ 0x0C, 0x21, 0xFC, 0x01, 0x04, 0x25, 0xD5, 0x01, 0x40, 0x76, 0x43, 0xFF, 0x0C, 0x60, 0x22, 0x61,
+ 0x26, 0x46, 0x00, 0xF4, 0x02, 0x64, 0x0A, 0x63, 0x58, 0xD0, 0x59, 0xD9, 0xFD, 0x1F, 0x59, 0xDF,
+ 0x59, 0xDF, 0x80, 0x60, 0x18, 0x70, 0x80, 0x60, 0x24, 0x71, 0x80, 0x60, 0x7C, 0x72, 0x80, 0x60,
+ 0x10, 0x73, 0x02, 0x76, 0xFF, 0xFF, 0xA1, 0xFF, 0xFF, 0xFF, 0x0C, 0x21, 0xFC, 0x01, 0x04, 0x25,
+ 0xB8, 0x01, 0x40, 0x76, 0x43, 0xFF, 0x26, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0x60, 0x47, 0x80, 0xBF,
+ 0x60, 0x50, 0x80, 0x60, 0x12, 0x71, 0x3F, 0xF2, 0x80, 0x60, 0x6E, 0x72, 0x60, 0x47, 0x80, 0xBF,
+ 0x60, 0x53, 0x04, 0x76, 0xFF, 0xFF, 0xA1, 0xFF, 0xFF, 0xFF, 0x0C, 0x21, 0xFC, 0x01, 0x04, 0x25,
+ 0xA0, 0x01, 0x40, 0x76, 0x43, 0xFF, 0x08, 0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xCD, 0x60, 0xEE, 0x78, 0xFF, 0xFF, 0x32, 0x40, 0x40, 0x26, 0xFA, 0x01,
+ 0x2A, 0xF0, 0xFF, 0xFF, 0x64, 0x40, 0x08, 0x2A, 0x20, 0x00, 0x32, 0x40, 0x02, 0x2A, 0x1D, 0x00,
+ 0x03, 0x67, 0xA0, 0x84, 0x00, 0x37, 0x64, 0x63, 0x60, 0x40, 0x02, 0x37, 0x5E, 0x63, 0x60, 0x40,
+ 0x01, 0x37, 0x58, 0x63, 0x60, 0x40, 0x03, 0x37, 0x0D, 0x00, 0xBD, 0xD2, 0x66, 0xF1, 0xBD, 0xD2,
+ 0xD0, 0x80, 0x67, 0xF1, 0x07, 0x02, 0xD0, 0x80, 0xBD, 0xD2, 0x68, 0xF1, 0x03, 0x02, 0xD0, 0x80,
+ 0xFF, 0xFF, 0x03, 0x03, 0xCE, 0x60, 0x38, 0x78, 0xFF, 0xFF, 0x2A, 0xF2, 0x87, 0xF4, 0x60, 0x40,
+ 0x03, 0x2B, 0x31, 0x00, 0x88, 0xF3, 0x06, 0x61, 0x60, 0x43, 0x66, 0x45, 0x31, 0xF0, 0x63, 0x46,
+ 0x05, 0xF2, 0x65, 0x46, 0xD0, 0x80, 0x30, 0xF0, 0x0F, 0x02, 0x63, 0x46, 0x04, 0xF2, 0x65, 0x46,
+ 0xD0, 0x80, 0x2F, 0xF0, 0x09, 0x02, 0x63, 0x46, 0x03, 0xF2, 0x65, 0x46, 0xD0, 0x80, 0xFF, 0xFF,
+ 0x03, 0x02, 0xFF, 0xFF, 0x48, 0xFE, 0x06, 0x00, 0xCD, 0x81, 0x02, 0xA3, 0xE7, 0x02, 0x87, 0xF1,
+ 0x08, 0xFE, 0x64, 0x43, 0x03, 0x03, 0xCE, 0x60, 0x38, 0x78, 0xFF, 0xFF, 0x43, 0x43, 0x23, 0x46,
+ 0x06, 0xF0, 0x26, 0x46, 0x07, 0x67, 0xA0, 0x84, 0x23, 0xFA, 0x64, 0x40, 0x02, 0x26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87, 0xF3, 0x07, 0xFA, 0x66, 0x41, 0x00, 0xF4,
+ 0x05, 0x64, 0x09, 0xFA, 0x1E, 0x60, 0xD4, 0x64, 0x0F, 0x60, 0x90, 0xFB, 0x61, 0x44, 0x5A, 0xDB,
+ 0x02, 0x64, 0x5A, 0xDB, 0xFF, 0xFF, 0x2B, 0xFF, 0xC1, 0xFE, 0x56, 0xF3, 0xA3, 0xFF, 0x60, 0x43,
+ 0xE7, 0x60, 0x58, 0x4E, 0x81, 0x78, 0xFF, 0xFF, 0x56, 0xF3, 0xFF, 0xFF, 0x40, 0x58, 0x03, 0x65,
+ 0xE5, 0x60, 0x58, 0x4E, 0x51, 0x78, 0xFF, 0xFF, 0x56, 0xF3, 0x26, 0x46, 0x60, 0x43, 0x66, 0x41,
+ 0x63, 0x46, 0x05, 0xF2, 0x00, 0xF0, 0x81, 0xF0, 0x02, 0x18, 0x64, 0x46, 0x81, 0xF8, 0x07, 0x1B,
+ 0x15, 0x60, 0x02, 0x65, 0x60, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD9, 0x02, 0x00, 0x65, 0x46,
+ 0x00, 0xF8, 0x87, 0xF3, 0x63, 0x45, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xD4, 0x80, 0x01, 0x18,
+ 0xFA, 0x04, 0x80, 0xF8, 0x65, 0x46, 0x00, 0xFA, 0x06, 0xF2, 0xFF, 0xFF, 0x00, 0x7E, 0x06, 0xFA,
+ 0x61, 0x46, 0x2E, 0xF0, 0x66, 0x41, 0x15, 0x60, 0x02, 0x65, 0x64, 0x47, 0x00, 0x7F, 0x87, 0xF1,
+ 0xE0, 0x84, 0x44, 0xD3, 0x64, 0x43, 0x11, 0x18, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xFC, 0x1B,
+ 0x66, 0x44, 0x64, 0x46, 0x80, 0xF0, 0x60, 0x46, 0x80, 0xF8, 0x65, 0x46, 0x65, 0x43, 0x80, 0xF0,
+ 0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0x5C, 0xFB, 0x64, 0x40, 0x00, 0x36, 0x19, 0x00, 0x5D, 0xD0, 0x16, 0x60, 0x5D, 0xF9,
+ 0x5D, 0xD0, 0x2C, 0x60, 0xBB, 0x62, 0xA2, 0xD9, 0xD9, 0x60, 0xF9, 0x78, 0xFF, 0xFF, 0x20, 0xFE,
+ 0x00, 0x60, 0x04, 0x64, 0x16, 0x60, 0x5A, 0xFB, 0x20, 0xFE, 0x00, 0x60, 0x04, 0x64, 0x16, 0x60,
+ 0x5B, 0xFB, 0x20, 0xFE, 0x00, 0x60, 0x02, 0x64, 0x16, 0x60, 0x5C, 0xFB, 0x20, 0xFE, 0x00, 0x60,
+ 0x00, 0x64, 0x16, 0x60, 0x5D, 0xFB, 0xD9, 0x60, 0xF9, 0x78, 0xFF, 0xFF, 0x16, 0x60, 0x5E, 0xFB,
+ 0xE0, 0x84, 0xE0, 0x84, 0x03, 0x02, 0x01, 0x64, 0xA2, 0xDB, 0x02, 0x64, 0x02, 0xA5, 0x64, 0x44,
+ 0xD4, 0x9C, 0x16, 0x60, 0x5F, 0xF9, 0x2C, 0x60, 0xC0, 0x62, 0xA2, 0xDF, 0x5D, 0xD0, 0x00, 0x65,
+ 0x64, 0x40, 0x00, 0x3A, 0x01, 0x65, 0x5D, 0xD0, 0xFF, 0xFF, 0x64, 0x40, 0x50, 0x3A, 0x01, 0x65,
+ 0x5D, 0xD0, 0xFF, 0xFF, 0x64, 0x40, 0xF2, 0x3A, 0x01, 0x65, 0x5D, 0xD0, 0x65, 0x40, 0x00, 0x3A,
+ 0x17, 0x00, 0x00, 0x60, 0x00, 0x65, 0x64, 0x40, 0x00, 0x36, 0x01, 0x65, 0x64, 0x40, 0x01, 0x36,
+ 0x02, 0x65, 0x64, 0x40, 0x02, 0x36, 0x04, 0x65, 0x64, 0x40, 0x04, 0x36, 0x10, 0x65, 0x64, 0x40,
+ 0x05, 0x36, 0x20, 0x65, 0x65, 0x5C, 0x16, 0x60, 0x60, 0xF3, 0xFF,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 0x16, 0x60, 0x54, 0xF3,
+ 0x2C, 0x60, 0xA0, 0x62, 0xFD, 0xA0, 0xA2, 0xD3, 0xEE, 0x03, 0x60, 0x40, 0x02, 0x2A, 0x02, 0x00,
+ 0x01, 0x63, 0x0B, 0x00, 0x04, 0x2A, 0x02, 0x00, 0x02, 0x63, 0x07, 0x00, 0x10, 0x2A, 0x02, 0x00,
+ 0x04, 0x63, 0x03, 0x00, 0x20, 0x2A, 0x01, 0x00, 0x05, 0x63, 0x63, 0x47, 0xB4, 0x83, 0x59, 0xD9,
+ 0x59, 0xDD, 0x16, 0x60, 0x54, 0xF3, 0x16, 0x60, 0x51, 0xF3, 0xFE, 0xA0, 0x40, 0x4C, 0xD3, 0x03,
+ 0x00, 0x60, 0x00, 0x63, 0x59, 0xDD, 0x41, 0x4A, 0x2C, 0x40, 0x01, 0x2A, 0x05, 0x00, 0x00, 0x63,
+ 0x63, 0x47, 0xB4, 0x83, 0x59, 0xD9, 0x59, 0xDD, 0x2C, 0x40, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x63,
+ 0x59, 0xD9, 0x59, 0xDD, 0x2C, 0x40, 0x04, 0x2A, 0x05, 0x00, 0x02, 0x63, 0x63, 0x47, 0xB4, 0x83,
+ 0x59, 0xD9, 0x59, 0xDD, 0x2C, 0x40, 0x10, 0x2A, 0x05, 0x00, 0x04, 0x63, 0x63, 0x47, 0xB4, 0x83,
+ 0x59, 0xD9, 0x59, 0xDD, 0x2C, 0x40, 0x20, 0x2A, 0x05, 0x00, 0x05, 0x63, 0x63, 0x47, 0xB4, 0x83,
+ 0x59, 0xD9, 0x59, 0xDD, 0x2A, 0x44, 0x51, 0x93, 0xEB, 0x83, 0xEB, 0x83, 0xA0, 0xDD, 0x16, 0x60,
+ 0x54, 0xF3, 0x16, 0x60, 0x52, 0xF3, 0xFF, 0xA0, 0x40, 0x4C, 0x9D, 0x03, 0x59, 0xDF, 0x41, 0x4A,
+ 0x2C, 0x40, 0x01, 0x2A, 0x05,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x61,
+ 0x28, 0x44, 0x59, 0xDA, 0x03, 0x64, 0x38, 0x43, 0xBD, 0xD1, 0xCC, 0x84, 0x59, 0xD8, 0xFC, 0x02,
+ 0x39, 0x44, 0x59, 0xDA, 0x06, 0x64, 0x23, 0xFA, 0x1F, 0x60, 0x10, 0x64, 0x0F, 0x60, 0x90, 0xFB,
+ 0x66, 0x44, 0x5A, 0xDB, 0x02, 0x64, 0x5A, 0xDB, 0xFF, 0xFF, 0x2B, 0xFF, 0xFA, 0xFE, 0x37, 0x58,
+ 0xFF, 0xFF, 0x0E, 0x57, 0x32, 0x40, 0x40, 0x26, 0x4F, 0x00, 0x45, 0x48, 0x00, 0x60, 0x68, 0x61,
+ 0xB5, 0x60, 0x58, 0x4D, 0x9F, 0x78, 0xFF, 0xFF, 0x47, 0x03, 0xF2, 0x60, 0x01, 0x64, 0x24, 0xFA,
+ 0x02, 0x60, 0x00, 0x61, 0x46, 0x4A, 0x38, 0x44, 0x54, 0x94, 0x03, 0x64, 0x01, 0x02, 0x09, 0x00,
+ 0x06, 0x63, 0x4A, 0x61, 0x38, 0x46, 0xBD, 0xD0, 0xCC, 0x84, 0x2A, 0x46, 0x59, 0xD8, 0xFA, 0x02,
+ 0x06, 0x00, 0xDA, 0x81, 0x38, 0x43, 0xBD, 0xD1, 0xCC, 0x84, 0x59, 0xD8, 0xFC, 0x02, 0x05, 0x63,
+ 0x28, 0x44, 0x02, 0xA8, 0x25, 0xFA, 0x07, 0x02, 0x03, 0x64, 0x39, 0x43, 0xBD, 0xD1, 0xCC, 0x84,
+ 0x59, 0xD8, 0xFC, 0x02, 0x08, 0x63, 0x28, 0x44, 0x03, 0xA8, 0x16, 0x60, 0x82, 0xF3, 0x0F, 0x03,
+ 0xE8, 0x85, 0xC7, 0x85, 0x60, 0x43, 0xFE, 0xA3, 0x2D, 0x60, 0x06, 0x64, 0x58, 0xD1, 0xD9, 0x81,
+ 0xA1, 0xD8, 0x7E, 0x2A, 0x02, 0x00, 0x00, 0x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x63, 0x46, 0xD0, 0x80, 0x04, 0xF2, 0x0C, 0x02, 0x61, 0x46, 0x26, 0xF0, 0x63, 0x46,
+ 0xD0, 0x80, 0x03, 0xF2, 0x06, 0x02, 0x61, 0x46, 0x25, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0xFF, 0xFF,
+ 0x07, 0x03, 0x80, 0xF4, 0xFF, 0xFF, 0x63, 0x46, 0xE8, 0x1B, 0x87, 0xF3, 0x08, 0xFE, 0x60, 0x43,
+ 0x61, 0x46, 0x26, 0x02, 0x0B, 0x60, 0x82, 0xF3, 0xDA, 0x81, 0x60, 0x45, 0xD5, 0x80, 0xA1, 0xD1,
+ 0x04, 0x03, 0xD3, 0x80, 0xD9, 0x81, 0xFA, 0x02, 0x08, 0x00, 0xA1, 0xDD, 0xD9, 0x84, 0x0B, 0x60,
+ 0x82, 0xFB, 0x4A, 0xD3, 0xFF, 0xFF, 0xDC, 0x84, 0xA2, 0xDB, 0x66, 0x45, 0x63, 0x46, 0x06, 0xF2,
+ 0xFF, 0x60, 0x01, 0x7C, 0xA0, 0x9C, 0x06, 0xF8, 0x65, 0x46, 0x70, 0xF3, 0x60, 0x40, 0x10, 0x2A,
+ 0x03, 0x00, 0xCC, 0x84, 0x80, 0x2B, 0x70, 0xFB, 0xE7, 0x60, 0x58, 0x4E, 0x81, 0x78, 0xFF, 0xFF,
+ 0xAD, 0x01, 0x2E, 0xF5, 0x28, 0xF0, 0x18, 0x60, 0x12, 0xF9, 0x27, 0xF2, 0x15, 0x60, 0x02, 0x65,
+ 0x60, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD3, 0x66, 0x41, 0x60, 0x46, 0x60, 0x43, 0x05, 0xF2,
+ 0x16, 0x18, 0x61, 0x46, 0x27, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x04, 0xF2, 0x0C, 0x02, 0x61, 0x46,
+ 0x26, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x03, 0xF2, 0x06, 0x02, 0x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 0x63, 0xEF, 0x60, 0x58, 0x4D, 0x5E, 0x78,
+ 0xFF, 0xFF, 0x15, 0x60, 0xE8, 0xFB, 0x02, 0x63, 0xEF, 0x60, 0x58, 0x4D, 0x5E, 0x78, 0xFF, 0xFF,
+ 0x15, 0x60, 0xE9, 0xFB, 0x01, 0x63, 0xEF, 0x60, 0x58, 0x4D, 0x5E, 0x78, 0xFF, 0xFF, 0x15, 0x60,
+ 0xEA, 0xFB, 0x2E, 0x58, 0xFF, 0xFF, 0x63, 0x5C, 0xA7, 0x84, 0xEB, 0x83, 0x14, 0x02, 0x01, 0x03,
+ 0xFB, 0x01, 0x64, 0x44, 0x01, 0x36, 0x0B, 0x64, 0x02, 0x36, 0x0B, 0x64, 0x04, 0x36, 0x0A, 0x64,
+ 0x08, 0x36, 0x0A, 0x64, 0x10, 0x36, 0x09, 0x64, 0x20, 0x36, 0x09, 0x64, 0x40, 0x36, 0x09, 0x64,
+ 0x80, 0x36, 0x09, 0x64, 0x11, 0x00, 0x60, 0x40, 0x01, 0x36, 0x0B, 0x64, 0x02, 0x36, 0x0F, 0x64,
+ 0x04, 0x36, 0x0A, 0x64, 0x08, 0x36, 0x0E, 0x64, 0x10, 0x36, 0x09, 0x64, 0x20, 0x36, 0x0D, 0x64,
+ 0x40, 0x36, 0x08, 0x64, 0x80, 0x36, 0x0C, 0x64, 0x2D, 0x58, 0xFF, 0xFF, 0x63, 0x5C, 0xA7, 0x84,
+ 0xEB, 0x83, 0x0C, 0x02, 0x01, 0x03, 0xFB, 0x01, 0x64, 0x44, 0x01, 0x36, 0x0A, 0x64, 0x02, 0x36,
+ 0x14, 0x64, 0x04, 0x36, 0x37, 0x64, 0x08, 0x36, 0x6E, 0x64, 0x09, 0x00, 0x60, 0x40, 0x01, 0x36,
+ 0x0A, 0x64, 0x02, 0x36, 0x14, 0x64, 0x04, 0x36, 0x37, 0x64, 0x08, 0x36, 0x6E, 0x64, 0x2D, 0x58,
+ 0xFF, 0xFF, 0x60, 0xFE, 0x81, 0xA1, 0x7F, 0xA1, 0x02, 0x06, 0x00, 0xF4, 0x03, 0x61, 0x5D, 0xD2,
+ 0xCF, 0x83, 0xD4, 0x80, 0x25, 0x03, 0x16, 0x03, 0xCF, 0x83, 0x61, 0x44, 0x80, 0xA0, 0x20, 0x03,
+ 0x02, 0x02, 0x00, 0xF4, 0x03, 0x61, 0x5D, 0xD2, 0xCF, 0x83, 0x81, 0xA1, 0x19, 0x03, 0x05, 0x07,
+ 0x7F, 0xA1, 0xCC, 0x84, 0xDD, 0x81, 0xE6, 0x03, 0xF7, 0x01, 0x00, 0xF4, 0x00, 0xB8, 0x04, 0x61,
+ 0xE6, 0x03, 0xF2, 0x01, 0x2C, 0x43, 0x5D, 0xD0, 0xDE, 0xD9, 0x64, 0x44, 0x5D, 0xD0, 0xDE, 0xD9,
+ 0xCC, 0x84, 0x81, 0xA1, 0x05, 0x03, 0x7F, 0xA1, 0xF9, 0x04, 0x00, 0xF4, 0x03, 0x61, 0xF6, 0x01,
+ 0x20, 0xFE, 0x2E, 0x58, 0xFF, 0xFF, 0x01, 0x3A, 0x02, 0x00, 0x16, 0x64, 0x2B, 0x00, 0x02, 0x3A,
+ 0x02, 0x00, 0x14, 0x64, 0x27, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x12, 0x64, 0x23, 0x00, 0x08, 0x3A,
+ 0x02, 0x00, 0x10, 0x64, 0x1F, 0x00, 0x10, 0x3A, 0x02, 0x00, 0x0E, 0x64, 0x1B, 0x00, 0x20, 0x3A,
+ 0x02, 0x00, 0x0C, 0x64, 0x17, 0x00, 0x40, 0x3A, 0x02, 0x00, 0x0A, 0x64, 0x13, 0x00, 0x80, 0x3A,
+ 0x02, 0x00, 0x08, 0x64, 0x0F, 0x00, 0x01, 0x3B, 0x02, 0x00, 0x06, 0x64, 0x0B, 0x00, 0x02, 0x3B,
+ 0x02, 0x00, 0x04, 0x64, 0x07, 0x00, 0x04, 0x3B, 0x02, 0x00, 0x02, 0x64, 0x03, 0x00, 0x08, 0x3B,
+ 0xFF, 0x01, 0x00, 0x64, 0x2E, 0x58, 0xFF, 0xFF, 0x27, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x36, 0x3A,
+ 0x02, 0x00, 0x00, 0x61, 0x2C, 0x00, 0x30, 0x3A, 0x02, 0x00, 0x02, 0x61, 0x28, 0x00, 0x24, 0x3A,
+ 0x02, 0x00, 0x04, 0x61, 0x24, 0x00, 0x18, 0x3A, 0x02, 0x00, 0x06, 0x61, 0x20, 0x00, 0x12, 0x3A,
+ 0x02, 0x00, 0x08, 0x61, 0x1C, 0x00, 0x0C, 0x3A, 0x02, 0x00, 0x0A, 0x61, 0x18, 0x00, 0x09, 0x3A,
+ 0x02, 0x00, 0x0C, 0x61, 0x14, 0x00, 0x06, 0x3A, 0x02, 0x00, 0x0E, 0x61, 0x10, 0x00, 0x6E, 0x3A,
+ 0x02, 0x00, 0x10, 0x61, 0x0C, 0x00, 0x37, 0x3A, 0x02, 0x00, 0x12, 0x61, 0x08, 0x00, 0x14, 0x3A,
+ 0x02, 0x00, 0x14, 0x61, 0x04, 0x00, 0x0A, 0x3A, 0xFF, 0xFF, 0x16, 0x61, 0x00, 0x00, 0x65, 0x40,
+ 0x01, 0x3A, 0x13, 0x00, 0x66, 0x45, 0x2B, 0x46, 0x92, 0xFA, 0x65, 0x46, 0x26, 0xF2, 0xFF, 0xFF,
+ 0x60, 0x41, 0x00, 0x7F, 0x60, 0x45, 0x61, 0x47, 0x00, 0x7F, 0xD4, 0x84, 0x66, 0x41, 0x2B, 0x46,
+ 0x0E, 0xF2, 0x60, 0x45, 0x65, 0x5E, 0x0E, 0xFA, 0x61, 0x46, 0x2E, 0x58, 0xFF, 0xFF, 0xCD, 0x81,
+ 0x7F, 0xB4, 0x02, 0x3A, 0x02, 0x00, 0x01, 0x64, 0x2E, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64,
+ 0x2A, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x04, 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x02, 0x61, 0x10, 0x02, 0x10, 0x64, 0x40, 0x40, 0x02, 0x64, 0x40, 0x50, 0x61, 0xFF,
+ 0x3F, 0x40, 0x40, 0x26, 0x04, 0x00, 0x10, 0xE0, 0x46, 0x60, 0x09, 0xE0, 0x00, 0x00, 0x27, 0xF1,
+ 0x00, 0x66, 0x20, 0x78, 0x42, 0xFE, 0x23, 0x58, 0xFF, 0xFF, 0x7F, 0x60, 0xC0, 0x64, 0x24, 0x45,
+ 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x19, 0x02, 0x0A, 0x60, 0x7E, 0xF3, 0x07, 0x7C, 0x20, 0xB5,
+ 0x0C, 0xB5, 0x04, 0x03, 0x03, 0x02, 0xBC, 0xF9, 0x00, 0x67, 0x0F, 0x00, 0x00, 0x61, 0x41, 0x56,
+ 0xC7, 0xFE, 0xB5, 0x01, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00, 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67,
+ 0x04, 0x00, 0x20, 0x44, 0x80, 0xBC, 0x40, 0x40, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x7F, 0x60,
+ 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x31, 0x02, 0x0A, 0x60, 0x7E, 0xF3,
+ 0x01, 0x7C, 0x20, 0xB5, 0x0C, 0xB5, 0x03, 0x03, 0x02, 0x02, 0xBC, 0xF9, 0xFF, 0xFF, 0x02, 0x61,
+ 0x41, 0x56, 0xC7, 0xFE, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x7D, 0xF1, 0x20, 0x44, 0x64, 0x40,
+ 0xFF, 0x26, 0x1C, 0x00, 0x7F, 0xB4, 0x40, 0x40, 0x5C, 0x5E, 0x82, 0xFF, 0x26, 0x44, 0xFD, 0xB4,
+ 0x40, 0x46, 0x5C, 0x41, 0x87, 0xFF, 0x62, 0xFF, 0x0F, 0x60, 0x85, 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,
+ 0x06, 0x36, 0x86, 0xFF, 0x07, 0x36, 0x87, 0xFF, 0x20, 0x44, 0xBD, 0xDB, 0x21, 0x44, 0xBD, 0xDB,
+ 0x22, 0x44, 0xBD, 0xDB, 0x23, 0x44, 0xBD, 0xDB, 0x24, 0x44, 0xBD, 0xDB, 0x25, 0x44, 0xBD, 0xDB,
+ 0x26, 0x44, 0xBD, 0xDB, 0x27, 0x44, 0xBD, 0xDB, 0x28, 0x44, 0xBD, 0xDB, 0x29, 0x44, 0xBD, 0xDB,
+ 0x2A, 0x44, 0xBD, 0xDB, 0x2B, 0x44, 0xBD, 0xDB, 0x2C, 0x44, 0xBD, 0xDB, 0x2D, 0x44, 0xBD, 0xDB,
+ 0x2E, 0x44, 0xBD, 0xDB, 0x2F, 0x44, 0xBD, 0xDB, 0xDD, 0x81, 0x08, 0x3A, 0xD0, 0x01, 0x54, 0x00,
+ 0x27, 0x40, 0x10, 0x26, 0x30, 0x00, 0x26, 0x44, 0x01, 0x36, 0x2D, 0x00, 0x02, 0x36, 0x82, 0xFF,
+ 0x03, 0x36, 0x83, 0xFF, 0x04, 0x36, 0x84, 0xFF, 0x05, 0x36, 0x85, 0xFF, 0x06, 0x36, 0x86, 0xFF,
+ 0x25, 0x44, 0x00, 0x36, 0x44, 0x40, 0x01, 0x36, 0x44, 0x41, 0x02, 0x36, 0x44, 0x42, 0x03, 0x36,
+ 0x44, 0x43, 0x04, 0x36, 0x44, 0x44, 0x05, 0x36, 0x44, 0x45, 0x06, 0x36, 0x44, 0x46, 0x07, 0x36,
+ 0x44, 0x47, 0x08, 0x36, 0x44, 0x48, 0x09, 0x36, 0x44, 0x49, 0x0A, 0x36, 0x44, 0x4A, 0x0B, 0x36,
+ 0x44, 0x4B, 0x0C, 0x36, 0x44, 0x4C, 0x0D, 0x36, 0x44, 0x4D, 0x0E, 0x36, 0x44, 0x4E, 0x0F, 0x36,
+ 0x44, 0x4F, 0x87, 0xFF, 0x21, 0x00, 0x25, 0x44, 0x10, 0x36, 0x44, 0x50, 0x11, 0x36, 0x44, 0x51,
+ 0x12, 0x36, 0x44, 0x52, 0x13, 0x36, 0x44, 0x53, 0x14, 0x36, 0x44, 0x54, 0x15, 0x36, 0x44, 0x55,
+ 0x16, 0x36, 0x44, 0x56, 0x17, 0x36, 0x44, 0x57, 0x18, 0x36, 0x44, 0x58, 0x19, 0x36, 0x44, 0x59,
+ 0x1A, 0x36, 0x44, 0x5A, 0x1B, 0x36, 0x44, 0x5B, 0x1C, 0x36, 0x44, 0x5C, 0x1D, 0x36, 0x44, 0x5D,
+ 0x1E, 0x36, 0x44, 0x5E, 0x1F, 0x36, 0x44, 0x5F, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0x46,
+ 0xB5, 0x60, 0x58, 0x4F, 0x4B, 0x78, 0xFF, 0xFF, 0x03, 0x61, 0x7F, 0x67, 0x0A, 0x02, 0x00, 0xF0,
+ 0x04, 0x64, 0x0F, 0x60, 0x93, 0xFB, 0x5A, 0xD9, 0x0A, 0x64, 0x5A, 0xDB, 0xFF, 0xFF, 0x2B, 0xFF,
+ 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x40, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67,
+ 0x02, 0x61, 0x12, 0x02, 0x14, 0x64, 0x0F, 0x60, 0x9F, 0xFB, 0x00, 0x60, 0x50, 0x63, 0x5A, 0xDD,
+ 0xF2, 0x60, 0xF7, 0x64, 0x7F, 0xFB, 0x2D, 0xFF, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x2A, 0xF3,
+ 0x05, 0xFB, 0x2B, 0xF3, 0x06, 0xFB, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x40, 0x60, 0xC0, 0x64,
+ 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x0E, 0x02, 0x16, 0x64, 0x0F, 0x60, 0x9F, 0xFB,
+ 0x00,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x15, 0x60, 0xD0, 0xFB, 0x00, 0x67, 0x23, 0x58,
+ 0xFF, 0xFF, 0x25, 0xF2, 0x15, 0x60, 0xD1, 0xFB, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0xF2,
+ 0x15, 0x60, 0xEB, 0xFB, 0xFF, 0xFF, 0x0F, 0x22, 0x41, 0x75, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF,
+ 0x04, 0x61, 0x06, 0x00, 0x01, 0x64, 0x01, 0x00, 0x00, 0x64, 0x18, 0x60, 0x13, 0xFB, 0x06, 0x61,
+ 0x41, 0x56, 0xC7, 0xFE, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF,
+ 0x78, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x10, 0x02, 0x08, 0x61,
+ 0x41, 0x56, 0xC7, 0xFE, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00,
+ 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x03, 0x00, 0x04, 0x7C, 0xBC, 0xF9, 0x00, 0x67, 0x23, 0x58,
+ 0xFF, 0xFF, 0x78, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x10, 0x02,
+ 0x0A, 0x61, 0x41, 0x56, 0xC7, 0xFE, 0xF0, 0x60, 0xC7, 0x78, 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23,
+ 0x04, 0x00, 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x03, 0x00, 0x01, 0x7C, 0xBC, 0xF9, 0x00, 0x67,
+ 0x23, 0x58, 0xFF, 0xFF, 0x02, 0x63, 0x64, 0xF3, 0x23, 0xFC, 0x60, 0x40, 0x01, 0x23, 0x17, 0x00,
+ 0x01, 0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 0x57, 0x78,
+ 0xFF, 0xFF, 0xFB, 0x60, 0x58, 0x4F, 0x75, 0x78, 0xFF, 0xFF, 0x0B, 0x04, 0x23, 0xF0, 0x04, 0x64,
+ 0xB0, 0x84, 0xA2, 0xDA, 0x25, 0x60, 0xF4, 0x64, 0xE5, 0x60, 0x78, 0x41, 0xC7, 0x78, 0x97, 0xF1,
+ 0x46, 0x00, 0x3E, 0xF0, 0x88, 0xF1, 0x64, 0x47, 0x07, 0xB4, 0x07, 0x36, 0x3B, 0x00, 0x04, 0x03,
+ 0xCC, 0x84, 0xE0, 0x84, 0xC0, 0x83, 0x2D, 0x00, 0x2C, 0xF2, 0x87, 0xF1, 0x01, 0xB0, 0x64, 0x43,
+ 0x35, 0x02, 0x2E, 0xF2, 0x15, 0x60, 0x02, 0x65, 0x60, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD3,
+ 0x66, 0x41, 0x60, 0x46, 0x60, 0x43, 0x05, 0xF2, 0x16, 0x18, 0x61, 0x46, 0x2E, 0xF0, 0x63, 0x46,
+ 0xD0, 0x80, 0x04, 0xF2, 0x0C, 0x02, 0x61, 0x46, 0x2D, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x03, 0xF2,
+ 0x06, 0x02, 0x61, 0x46, 0x2C, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0xFF, 0xFF, 0x07, 0x03, 0x80, 0xF4,
+ 0xFF, 0xFF, 0x63, 0x46, 0xE8, 0x1B, 0x87, 0xF3, 0x08, 0xFE, 0x60, 0x43, 0x61, 0x46, 0x01, 0x03,
+ 0x09, 0x00, 0x66, 0x45, 0x63, 0x46, 0x06, 0xF0, 0x65, 0x46, 0x64, 0x44, 0x0C, 0x26, 0x02, 0x00,
+ 0x02, 0x26, 0x04, 0x00, 0x23, 0xF0, 0x04, 0x64, 0xB0, 0x84, 0xA2, 0xDA, 0x07, 0xFC, 0x23, 0xF2,
+ 0xFF, 0xFF, 0x0F, 0x1B, 0x1E, 0x60,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x30, 0xF8, 0xCD, 0xF1,
+ 0x31, 0xF8, 0x46, 0x4A, 0x00, 0xF4, 0x02, 0xF2, 0x03, 0xF0, 0x04, 0xF2, 0x60, 0x43, 0xAA, 0x46,
+ 0x32, 0xFC, 0x33, 0xF8, 0x34, 0xFA, 0xAA, 0x46, 0x05, 0xF2, 0x06, 0xF0, 0x07, 0xF2, 0x60, 0x43,
+ 0xAA, 0x46, 0x36, 0xFC, 0x37, 0xF8, 0x38, 0xFA, 0x03, 0x60, 0x08, 0x64, 0x1C, 0x00, 0x66, 0xF1,
+ 0x2F, 0xF8, 0x67, 0xF1, 0x30, 0xF8, 0x68, 0xF1, 0x31, 0xF8, 0x46, 0x4A, 0x00, 0xF4, 0x02, 0xF2,
+ 0x03, 0xF0, 0x04, 0xF2, 0x60, 0x43, 0xAA, 0x46, 0x2C, 0xFC, 0x2D, 0xF8, 0x2E, 0xFA, 0xAA, 0x46,
+ 0x05, 0xF2, 0x06, 0xF0, 0x07, 0xF2, 0x60, 0x43, 0xAA, 0x46, 0x32, 0xFC, 0x33, 0xF8, 0x34, 0xFA,
+ 0x02, 0x60, 0x08, 0x64, 0x00, 0x00, 0x2A, 0xFA, 0x02, 0xFE, 0x2F, 0x58, 0xFF, 0xFF, 0x42, 0x6F,
+ 0x6F, 0x74, 0x63, 0x6F, 0x64, 0x65, 0x20, 0x21, 0x21, 0x20, 0x20, 0x00, 0x53, 0x54, 0x41, 0x2F,
+ 0x41, 0x50, 0x20, 0x46, 0x75, 0x6E, 0x63, 0x27, 0x73, 0x00, 0x20, 0x00, 0x03, 0x00, 0x01, 0x00,
+ 0x18, 0x00, 0x00, 0x00, 0x08, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x04, 0x00, 0x06, 0x00, 0x07, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00,
+ 0x07, 0x00, 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x02, 0x00, 0x00, 0x00,
+
+}; /* fw_image_4_data */
+
+static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = {
+ {
+ sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1,
+ CFG_FW_IDENTITY,
+ COMP_ID_FW_AP,
+ 3, //Variant
+ 1, //Major
+ 24 //Minor
+ },
+ { 0000, 0000, 0000, 0000, 0000, 0000 } //endsentinel
+};
+
+static const CFG_PROG_STRCT fw_image_code[] = {
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x0148, // sizeof(fw_image_1_data),
+ 0x00000060, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_1_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x2432, // sizeof(fw_image_2_data),
+ 0x00000C16, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_2_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x194c, // sizeof(fw_image_3_data),
+ 0x001E3048, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_3_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0xb7e4, // sizeof(fw_image_4_data),
+ 0x001F4000, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_4_data
+ },
+ {
+ 5,
+ CFG_PROG,
+ CFG_PROG_STOP, // mode
+ 0000,
+ 0x000F2101, // Start execution address
+ },
+ { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000}
+};
+
+static const CFG_RANGE20_STRCT fw_image_infocompat[] = {
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_FW_SUP_RANGE,
+ COMP_ROLE_SUPL,
+ COMP_ID_APF,
+ {
+ { 4, 1, 1 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_MFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_MFI,
+ {
+ { 7, 3, 3 }, //variant, bottom, top
+ { 8, 1, 1 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_CFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_CFI,
+ {
+ { 4, 1, 2 } //variant, bottom, top
+ }
+ },
+ { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } //endsentinel
+};
+
+memimage fw_image = {
+ "FUPU7D37dhfwci\001C", //signature, <format number>, C/Bin type
+ (CFG_PROG_STRCT *) fw_image_code,
+ 0x000F2101,
+ 00000000, //(dummy) pdaplug
+ 00000000, //(dummy) priplug
+ (CFG_RANGE20_STRCT *) fw_image_infocompat,
+ (CFG_IDENTITY_STRCT *) fw_image_infoidentity,
+};
+
diff --git a/drivers/staging/wlags49_h2/debug.h b/drivers/staging/wlags49_h2/debug.h
new file mode 100644
index 000000000000..d3db6266f6e3
--- /dev/null
+++ b/drivers/staging/wlags49_h2/debug.h
@@ -0,0 +1,229 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains definitions and macros for debugging.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/20 09:29:45 $
+ * $Revision: 1.3 $
+ * $Source: /usr/local/cvs/wl_lkm/include/hcf/debug.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef _DEBUG_H
+#define _DEBUG_H
+
+
+
+
+/* Turn on debugging here if not done with a preprocessor define */
+#ifndef DBG
+#define DBG 0
+#else
+#undef DBG
+#define DBG 1
+#endif //DBG
+
+
+
+
+#if DBG
+/****************************************************************************/
+
+/* Set the level of debugging if not done with a preprocessor define. See
+ wl_main.c, init_module() for how the debug level translates into the
+ the types of messages displayed */
+#ifndef DBG_LVL
+#define DBG_LVL 5 /* yields nothing via init_module,
+ original value of 5 yields DBG_TRACE_ON and DBG_VERBOSE_ON */
+#endif // DBG_LVL
+
+
+#define DBG_ERROR_ON 0x00000001L
+#define DBG_WARNING_ON 0x00000002L
+#define DBG_NOTICE_ON 0x00000004L
+#define DBG_TRACE_ON 0x00000008L
+#define DBG_VERBOSE_ON 0x00000010L
+#define DBG_PARAM_ON 0x00000020L
+#define DBG_BREAK_ON 0x00000040L
+#define DBG_RX_ON 0x00000100L
+#define DBG_TX_ON 0x00000200L
+#define DBG_DS_ON 0x00000400L
+
+#define DBG_DEFAULTS (DBG_ERROR_ON | DBG_WARNING_ON | DBG_BREAK_ON)
+
+#define DBG_FLAGS(A) (A)->DebugFlag
+#define DBG_NAME(A) (A)->dbgName
+#define DBG_LEVEL(A) (A)->dbgLevel
+
+
+#ifndef PRINTK
+# define PRINTK(S...) printk(S)
+#endif // PRINTK
+
+
+#ifndef DBG_PRINT
+# define DBG_PRINT(S...) PRINTK(KERN_DEBUG S)
+#endif // DBG_PRINT
+
+
+#ifndef DBG_PRINTC
+# define DBG_PRINTC(S...) PRINTK(S)
+#endif // DBG_PRINTC
+
+
+#ifndef DBG_TRAP
+# define DBG_TRAP {}
+#endif // DBG_TRAP
+
+
+#define _ENTER_STR ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
+#define _LEAVE_STR "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
+
+
+#define _DBG_ENTER(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),++DBG_LEVEL(A),_ENTER_STR,__FUNC__)
+#define _DBG_LEAVE(A) DBG_PRINT("%s:%.*s:%s\n",DBG_NAME(A),DBG_LEVEL(A)--,_LEAVE_STR,__FUNC__)
+
+
+#define DBG_FUNC(F) static const char *__FUNC__ = F;
+
+#define DBG_ENTER(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_ENTER(A);}
+
+#define DBG_LEAVE(A) {if (DBG_FLAGS(A) & DBG_TRACE_ON) _DBG_LEAVE(A);}
+
+#define DBG_PARAM(A,N,F,S...) {if (DBG_FLAGS(A) & DBG_PARAM_ON) \
+ DBG_PRINT(" %s -- "F"\n",N,S);}
+
+
+#define DBG_ERROR(A,S...) {if (DBG_FLAGS(A) & DBG_ERROR_ON) \
+ {DBG_PRINT("%s:ERROR:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);DBG_TRAP;}}
+
+
+#define DBG_WARNING(A,S...) {if (DBG_FLAGS(A) & DBG_WARNING_ON) \
+ {DBG_PRINT("%s:WARNING:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
+
+
+#define DBG_NOTICE(A,S...) {if (DBG_FLAGS(A) & DBG_NOTICE_ON) \
+ {DBG_PRINT("%s:NOTICE:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}}
+
+
+#define DBG_TRACE(A,S...) do {if (DBG_FLAGS(A) & DBG_TRACE_ON) \
+ {DBG_PRINT("%s:%s ",DBG_NAME(A),__FUNC__);DBG_PRINTC(S);}} while (0)
+
+
+#define DBG_RX(A,S...) {if (DBG_FLAGS(A) & DBG_RX_ON) \
+ {DBG_PRINT(S);}}
+
+
+#define DBG_TX(A,S...) {if (DBG_FLAGS(A) & DBG_TX_ON) \
+ {DBG_PRINT(S);}}
+
+#define DBG_DS(A,S...) {if (DBG_FLAGS(A) & DBG_DS_ON) \
+ {DBG_PRINT(S);}}
+
+
+#define DBG_ASSERT(C) {if (!(C)) \
+ {DBG_PRINT("ASSERT(%s) -- %s#%d (%s)\n", \
+ #C,__FILE__,__LINE__,__FUNC__); \
+ DBG_TRAP;}}
+
+typedef struct {
+ char *dbgName;
+ int dbgLevel;
+ unsigned long DebugFlag;
+} dbg_info_t;
+
+
+/****************************************************************************/
+#else // DBG
+/****************************************************************************/
+
+#define DBG_DEFN
+#define DBG_TRAP
+#define DBG_FUNC(F)
+#define DBG_PRINT(S...)
+#define DBG_ENTER(A)
+#define DBG_LEAVE(A)
+#define DBG_PARAM(A,N,F,S...)
+#define DBG_ERROR(A,S...)
+#define DBG_WARNING(A,S...)
+#define DBG_NOTICE(A,S...)
+#define DBG_TRACE(A,S...)
+#define DBG_RX(A,S...)
+#define DBG_TX(A,S...)
+#define DBG_DS(A,S...)
+#define DBG_ASSERT(C)
+
+#endif // DBG
+/****************************************************************************/
+
+
+
+
+#endif // _DEBUG_H
+
diff --git a/drivers/staging/wlags49_h2/dhf.c b/drivers/staging/wlags49_h2/dhf.c
new file mode 100644
index 000000000000..b6f5834b1aff
--- /dev/null
+++ b/drivers/staging/wlags49_h2/dhf.c
@@ -0,0 +1,390 @@
+
+// vim:tw=110:ts=4:
+/**************************************************************************************************************
+*
+* FILE : DHF.C
+*
+* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
+* Original : 2004/05/28 14:05:34 Revision: 1.36 Tag: hcf7_t20040602_01
+* Original : 2004/05/11 06:22:57 Revision: 1.32 Tag: hcf7_t7_20040513_01
+* Original : 2004/04/15 09:24:42 Revision: 1.28 Tag: hcf7_t7_20040415_01
+* Original : 2004/04/08 15:18:16 Revision: 1.27 Tag: t7_20040413_01
+* Original : 2004/04/01 15:32:55 Revision: 1.25 Tag: t7_20040401_01
+* Original : 2004/03/10 15:39:28 Revision: 1.21 Tag: t20040310_01
+* Original : 2004/03/04 11:03:37 Revision: 1.19 Tag: t20040304_01
+* Original : 2004/03/02 09:27:11 Revision: 1.17 Tag: t20040302_03
+* Original : 2004/02/24 13:00:28 Revision: 1.15 Tag: t20040224_01
+* Original : 2004/02/19 10:57:28 Revision: 1.14 Tag: t20040219_01
+* Original : 2003/11/27 09:00:09 Revision: 1.3 Tag: t20021216_01
+*
+* AUTHOR : John Meertens
+* Nico Valster
+*
+* SPECIFICATION: ........
+*
+* DESC : generic functions to handle the download of NIC firmware
+* Local Support Routines for above procedures
+*
+* Customizable via HCFCFG.H, which is included by HCF.H
+*
+*
+* DHF is (intended to be) platform-independent.
+* DHF is a module that provides a number of routines to download firmware
+* images (the names primary, station, access point, secondary and tertiary
+* are used or have been used) to volatile or nonvolatile memory
+* in WaveLAN/IEEE NICs. To achieve this DHF makes use of the WaveLAN/IEEE
+* WCI as implemented by the HCF-module.
+*
+* Download to non-volatile memory is used to update a WaveLAN/IEEE NIC to new
+* firmware. Normally this will be an upgrade to newer firmware, although
+* downgrading to older firmware is possible too.
+*
+* Note: relative to Asserts, the following can be observed:
+* Since the IFB is not known inside the routine, the macro HCFASSERT is replaced with MMDASSERT.
+* Also the line number reported in the assert is raised by FILE_NAME_OFFSET (10000) to discriminate the
+* DHF Asserts from HCF and MMD asserts.
+*
+***************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1999 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+**************************************************************************************************************/
+
+#include "hcf.h"
+#include "hcfdef.h"
+#include "dhf.h"
+#include "mmd.h"
+
+//to distinguish MMD from HCF asserts by means of line number
+#undef FILE_NAME_OFFSET
+#define FILE_NAME_OFFSET MMD_FILE_NAME_OFFSET
+/*-----------------------------------------------------------------------------
+ *
+ * Defines, data structures, and global variables
+ *
+ *---------------------------------------------------------------------------*/
+
+// 12345678901234
+char signature[14] = "FUPU7D37dhfwci";
+
+//The binary download function "relocates" the image using constructions like:
+// fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw );
+//under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic.
+//fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment.
+//However the segment is not set at all.
+//As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in
+//which case we know that a 32-bit quantity is adequate as a pointer.
+//Note that other platforms may experience comparable problems when using the binary download feature.
+#if defined(_MSC_VER) && _MSC_VER == 800 // Visual C++ 1.5
+#define PSEUDO_CHARP hcf_32
+#else
+#define PSEUDO_CHARP hcf_8*
+#endif
+
+/*-----------------------------------------------------------------------------
+ *
+ * LTV-records retrieved from the NIC to:
+ * - determine compatibility between NIC and image
+ * - ((setup the buffer size dynamically for non-volatile download (see note below) ))
+ * - supply plugging information contained in the PDA (H-I only)
+ *
+ *---------------------------------------------------------------------------*/
+
+// for USB/H1 we needed a smaller value than the CFG_DL_BUF_STRCT reported 8192
+// for the time being it seems simpler to always use 2000 for USB/H1 as well as all other cases rather than
+// using the "fixed anyway" CFG_DL_BUF_STRCT.
+#define DL_SIZE 2000
+
+//CFG_IDENTITY_STRCT pri_identity = { LOF(CFG_IDENTITY_STRCT), CFG_PRI_IDENTITY };
+CFG_SUP_RANGE_STRCT mfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_MFI_SUP_RANGE };
+CFG_SUP_RANGE_STRCT cfi_sup = { LOF(CFG_SUP_RANGE_STRCT), CFG_NIC_CFI_SUP_RANGE };
+/* Note: could be used rather than the above explained and defined DL_SIZE if need arises
+ * CFG_DL_BUF_STRCT dl_buf = { LOF(CFG_DL_BUF_STRCT), CFG_DL_BUF };
+*/
+
+/*-----------------------------------------------------------------------------
+ * Array ltv_info stores NIC information (in the form of LTV-records)
+ * needed for download. A NULL record indicates the end of the array.
+ *---------------------------------------------------------------------------*/
+
+/* The LTV_INFO_STRUCT is needed to save the sizes of the structs, because after a GET_INFO()
+ * the len field is changed to the real len of the RID by the called routine.
+ * This is only relevant if the DHF used without reloading the driver/utility.
+ */
+
+LTV_INFO_STRUCT ltv_info[] = {
+ { (LTVP)&mfi_sup, LOF(CFG_SUP_RANGE_STRCT) } ,
+ { (LTVP)&cfi_sup, LOF(CFG_SUP_RANGE_STRCT) } ,
+ { (LTVP) NULL, 0 }
+};
+
+
+/***********************************************************************************************************/
+/*************************************** PROTOTYPES ******************************************************/
+/***********************************************************************************************************/
+static int check_comp_fw( memimage *fw );
+
+
+/************************************************************************************************************
+*.SUBMODULE int check_comp_fw( memimage *fw )
+*.PURPOSE Checks compatibility of CFI and MFI, NIC as supplier, station/AP firmware image as supplier.
+*
+*.ARGUMENTS
+* fw F/W image to be downloaded
+*
+*.RETURNS
+* HFC_SUCCESS - firmware OK
+* DHF_ERR_INCOMP_FW
+*
+*.DESCRIPTION
+* This function uses compatibility and identity information that has been
+* retrieved from the card which is currently inserted to check whether the
+* station firmware image to be downloaded is compatible.
+*.ENDDOC END DOCUMENTATION
+*************************************************************************************************************/
+int
+check_comp_fw( memimage *fw )
+{
+CFG_RANGE20_STRCT *p;
+int rc = HCF_SUCCESS;
+CFG_RANGE_SPEC_STRCT* i;
+
+ switch( fw->identity->typ ) {
+ case CFG_FW_IDENTITY: //Station F/W
+ case COMP_ID_FW_AP_FAKE: //;?is this useful (used to be: CFG_AP_IDENTITY)
+ break;
+ default:
+ MMDASSERT( DO_ASSERT, fw->identity->typ ) //unknown/unsupported firmware_type:
+ rc = DHF_ERR_INCOMP_FW;
+ return rc; /* ;? how useful is this anyway,
+ * till that is sorted out might as well violate my own single exit principle
+ */
+ }
+ p = fw->compat;
+ i = NULL;
+ while( p->len && i == NULL ) { // check the MFI ranges
+ if ( p->typ == CFG_MFI_ACT_RANGES_STA ) {
+ i = mmd_check_comp( (void*)p, &mfi_sup );
+ }
+ p++;
+ }
+ MMDASSERT( i, 0 ) //MFI: NIC Supplier not compatible with F/W image Actor
+ if ( i ) {
+ p = fw->compat;
+ i = NULL;
+ while ( p->len && i == NULL ) { // check the CFI ranges
+ if ( p->typ == CFG_CFI_ACT_RANGES_STA ) {
+ i = mmd_check_comp( (void*)p, &cfi_sup );
+ }
+ p++;
+ }
+ MMDASSERT( i, 0 ) //CFI: NIC Supplier not compatible with F/W image Actor
+ }
+ if ( i == NULL ) {
+ rc = DHF_ERR_INCOMP_FW;
+ }
+ return rc;
+} // check_comp_fw
+
+
+
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Exported functions
+ *
+ *---------------------------------------------------------------------------*/
+
+
+
+/*************************************************************************************************************
+*
+*.MODULE int dhf_download_binary( void *ifbp, memimage *fw )
+*.PURPOSE Downloads a complete (primary, station, or access point) firmware image to the NIC.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* fw F/W image to be downloaded
+*
+*.RETURNS
+* HCF_SUCCESS - download completed successfully.
+* DHF_ERR_INCOMP_FW - firmware not compatible
+*
+*.DESCRIPTION
+* Initialize global variables
+* Connect to the DHF
+* Check the compatibility of the image (For primary firmware images it is checked first
+* whether download is necessary).
+* If everything's download the firmware.
+* Disconnect from the DHF.
+*
+*
+*.DIAGRAM
+*
+*.NOTICE:
+ MMDASSERT is unacceptable because some drivers call dhf_download_binary before hcf_connect
+
+* The old comment was:
+*.ENDDOC END DOCUMENTATION
+*************************************************************************************************************/
+int
+dhf_download_binary( memimage *fw )
+{
+int rc = HCF_SUCCESS;
+CFG_PROG_STRCT *p;
+int i;
+
+ //validate the image
+ for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /*NOP*/;
+ if ( i != sizeof(signature) ||
+ fw->signature[i] != 0x01 ||
+ //test for Little/Big Endian Binary flag
+ fw->signature[i+1] != ( /*HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) rc = DHF_ERR_INCOMP_FW;
+ else { //Little Endian Binary format
+ fw->codep = (CFG_PROG_STRCT FAR *)((PSEUDO_CHARP)fw->codep + (hcf_32)fw );
+ fw->identity = (CFG_IDENTITY_STRCT FAR *)((PSEUDO_CHARP)fw->identity + (hcf_32)fw );
+ fw->compat = (CFG_RANGE20_STRCT FAR *)((PSEUDO_CHARP)fw->compat + (hcf_32)fw );
+ for ( i = 0; fw->p[i]; i++ ) fw->p[i] = ((PSEUDO_CHARP)fw->p[i] + (hcf_32)fw );
+ p = fw->codep;
+ while ( p->len ) {
+ p->host_addr = (PSEUDO_CHARP)p->host_addr + (hcf_32)fw;
+ p++;
+ }
+ }
+ return rc;
+} // dhf_download_binary
+
+
+/*************************************************************************************************************
+*
+*.MODULE int dhf_download_fw( void *ifbp, memimage *fw )
+*.PURPOSE Downloads a complete (primary or tertiary) firmware image to the NIC.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* fw F/W image to be downloaded
+*
+*.RETURNS
+* HCF_SUCCESS - download completed successfully.
+* HCF_ERR_NO_NIC - no NIC present
+* DHF_ERR_INCOMP_FW - firmware not compatible
+*
+*.DESCRIPTION
+* - check the signature of the image
+* - get the compatibility information from the components on the NIC
+* - Primary Firmware Identity
+* - Modem - Firmware I/F
+* - Controller - Firmware I/F
+*!! - if necessary ( i.e. H-I) get the PDA contents from the NIC
+* - check the compatibility of the MFI and CFI of the NIC with the F/W image
+* Note: the Primary F/W compatibility is only relevant for the "running" HCF and is already verified in
+* hcf_connect
+*!! - if necessary ( i.e. H-I)
+*!! - verify the sumcheck of the PDA
+*!! - plug the image (based on the PDA and the default plug records)
+* - loop over all the download LTVs in the image which consists of a sequence of
+* - CFG_PROG_VOLATILE/CFG_PROG_NON_VOLATILE
+* - 1 or more sequences of CFG_PROG_ADDR, CFG_PROG_DATA,....,CFG_PROG_DATA
+* - CFG_PROG_STOP
+*
+*.DIAGRAM
+*
+*.NOTICE
+* The old comment was:
+* // Download primary firmware if necessary and allowed. This is done silently (without telling
+* // the user) and only if the firmware in the download image is newer than the firmware in the
+* // card. In Major version 4 of the primary firmware functions of Hermes and Shark were
+* // combined. Prior to that two separate versions existed. We only have to download primary
+* // firmware if major version of primary firmware in the NIC < 4.
+* // download = pri_identity.version_major < 4;
+* // if ( download ) {
+* // rc = check_comp_primary( fw );
+* // }
+* It is my understanding that Pri Variant 1 must be updated by Pri Variant 2. The test on
+* major version < 4 should amount to the same result but be "principally" less correct
+* In deliberation with the Architecture team, it was decided that this upgrade for old H-I
+* NICs, is an aspect which belongs on the WSU level not on the DHF level
+*
+*.ENDDOC END DOCUMENTATION
+*************************************************************************************************************/
+int
+dhf_download_fw( void *ifbp, memimage *fw )
+{
+int rc = HCF_SUCCESS;
+LTV_INFO_STRUCT_PTR pp = ltv_info;
+CFG_PROG_STRCT *p = fw->codep;
+LTVP ltvp;
+int i;
+
+ MMDASSERT( fw != NULL, 0 )
+ //validate the image
+ for ( i = 0; i < sizeof(signature) && fw->signature[i] == signature[i]; i++ ) /*NOP*/;
+ if ( i != sizeof(signature) ||
+ fw->signature[i] != 0x01 ||
+ //check for binary image
+ ( fw->signature[i+1] != 'C' && fw->signature[i+1] != ( /*HCF_BIG_ENDIAN ? 'B' : */ 'L' ) ) )
+ rc = DHF_ERR_INCOMP_FW;
+
+// Retrieve all information needed for download from the NIC
+ while ( ( rc == HCF_SUCCESS ) && ( ( ltvp = pp->ltvp) != NULL ) ) {
+ ltvp->len = pp++->len; // Set len to original len. This len is changed to real len by GET_INFO()
+ rc = GET_INFO( ltvp );
+ MMDASSERT( rc == HCF_SUCCESS, rc )
+ MMDASSERT( rc == HCF_SUCCESS, ltvp->typ )
+ MMDASSERT( rc == HCF_SUCCESS, ltvp->len )
+ }
+ if ( rc == HCF_SUCCESS ) rc = check_comp_fw( fw );
+ if ( rc == HCF_SUCCESS ) {
+ while ( rc == HCF_SUCCESS && p->len ) {
+ rc = PUT_INFO( p );
+ p++;
+ }
+ }
+ MMDASSERT( rc == HCF_SUCCESS, rc )
+ return rc;
+} // dhf_download_fw
+
+
diff --git a/drivers/staging/wlags49_h2/dhf.h b/drivers/staging/wlags49_h2/dhf.h
new file mode 100644
index 000000000000..c071f342a655
--- /dev/null
+++ b/drivers/staging/wlags49_h2/dhf.h
@@ -0,0 +1,226 @@
+
+// vim:tw=110:ts=4:
+#ifndef DHF_H
+#define DHF_H
+
+/**************************************************************************************************************
+*
+* FILE : DHF.H
+*
+* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
+* Original : 2004/05/17 07:33:13 Revision: 1.25 Tag: hcf7_t20040602_01
+* Original : 2004/05/11 06:03:14 Revision: 1.24 Tag: hcf7_t7_20040513_01
+* Original : 2004/04/15 09:24:42 Revision: 1.22 Tag: hcf7_t7_20040415_01
+* Original : 2004/04/09 14:35:52 Revision: 1.21 Tag: t7_20040413_01
+* Original : 2004/04/01 15:32:55 Revision: 1.18 Tag: t7_20040401_01
+* Original : 2004/03/10 15:39:28 Revision: 1.15 Tag: t20040310_01
+* Original : 2004/03/04 11:03:38 Revision: 1.13 Tag: t20040304_01
+* Original : 2004/02/25 14:14:37 Revision: 1.11 Tag: t20040302_03
+* Original : 2004/02/24 13:00:28 Revision: 1.10 Tag: t20040224_01
+* Original : 2004/02/19 10:57:28 Revision: 1.8 Tag: t20040219_01
+*
+* AUTHOR : John Meertens
+* Nico Valster
+*
+* SPECIFICATION: .........
+*
+* DESC : structure definitions and function prototypes for unit DHF.
+*
+* Customizable via HCFCFG.H, which is included indirectly via HCF.H
+*
+***************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1999 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+**************************************************************************************************************/
+
+
+#ifdef _WIN32_WCE
+#include <windef.h>
+#endif
+
+#include "hcf.h" // includes HCFCFG.H too
+
+#ifdef DHF_UIL
+#define GET_INFO( pp ) uil_get_info( (LTVP)pp )
+#define PUT_INFO( pp ) uil_put_info( (LTVP)pp )
+#else
+#define GET_INFO( pp ) hcf_get_info( ifbp, (LTVP)pp )
+#define PUT_INFO( pp ) hcf_put_info( ifbp, (LTVP)pp )
+#endif
+
+
+/*---- Defines --------------------------------------------------------------*/
+#define CODEMASK 0x0000FFFFL // Codemask for plug records
+
+/*---- Error numbers --------------------------------------------------------*/
+
+#define DHF_ERR_INCOMP_FW 0x40 //Image not compatible with NIC
+
+/*---- Type definitions -----------------------------------------------------*/
+//* needed by dhf_wrap.c
+//
+typedef struct {
+ LTVP ltvp;
+ hcf_16 len;
+} LTV_INFO_STRUCT , *LTV_INFO_STRUCT_PTR;
+
+
+/*
+ * Type: plugrecord
+ *
+ * Abstract: This structure represents a Plug Data Record.
+ *
+ * Description:
+ * This structure is used to overlay the plug records in the firmware memory image.
+ */
+
+typedef struct {
+ hcf_32 code; // Code to plug
+ hcf_32 addr; // Address within the memory image to plug it in
+ hcf_32 len; // The # of bytes which are available to store it
+} plugrecord;
+
+/*
+ * Type: stringrecord
+ *
+ * Abstract: This structure represents a Firmware debug/assert string
+ *
+ * Description:
+ * This structure is used to get assert and debug outputs in the driver and/or utility to be
+ * able to get more visability of the FW.
+ */
+
+#define MAX_DEBUGSTRINGS 1024
+#define MAX_DEBUGSTRING_LEN 82
+
+typedef struct {
+ hcf_32 id;
+ char str[MAX_DEBUGSTRING_LEN];
+} stringrecord;
+
+/*
+ * Type: exportrecord
+ *
+ * Abstract: This structure represents a Firmware export of a variable
+ *
+ * Description:
+ * This structure is used to get the address and name of a FW variable.
+ */
+
+#define MAX_DEBUGEXPORTS 2048
+#define MAX_DEBUGEXPORT_LEN 12
+
+typedef struct {
+ hcf_32 id;
+ char str[MAX_DEBUGEXPORT_LEN];
+} exportrecord;
+
+// Offsets in memimage array p[]
+#define FWSTRINGS_FUNCTION 0
+#define FWEXPORTS_FUNCTION 1
+
+/*
+ * Type: memimage
+ *
+ * Abstract: The "root" description of a complete memory image
+ *
+ * Description:
+ * This type represents an entire memory image. The image is built up of several
+ * segments. These segments need not be contiguous areas in memory, in other words
+ * the image may contain 'holes'.
+ *
+ * The 'codep' field points to an array of segment_descriptor structures.
+ * The end of the array is indicated by a segment_descriptor of which all fields are zero.
+ * The 'execution' field is a 32-bit address representing the execution address
+ * of the firmware within the memory image. This address is zero in case of non-volatile
+ * memory download.
+ * The 'compat' field points to an array of TODO
+ * The end of the array is indicated by a plug record of which all fields are zero.
+ * The 'identity' field points to an array of TODO
+ * The end of the array is indicated by a plug record of which all fields are zero.
+ * The Hermes-I specific 'pdaplug' field points to an array of Production Data Plug record structures.
+ * The end of the array is indicated by a plug record of which all fields are zero.
+ * The Hermes-I specific 'priplug' field points to an array of Primary Information Plug record structures.
+ * The end of the array is indicated by a plug record of which all fields are zero.
+ */
+typedef struct {
+ char signature[14+1+1]; // signature (see DHF.C) + C/LE-Bin/BE-Bin-flag + format version
+ CFG_PROG_STRCT FAR *codep; //
+ hcf_32 execution; // Execution address of the firmware
+ void FAR *place_holder_1;
+ void FAR *place_holder_2;
+ CFG_RANGE20_STRCT FAR *compat; // Pointer to the compatibility info records
+ CFG_IDENTITY_STRCT FAR *identity; // Pointer to the identity info records
+ void FAR *p[2]; /* (Up to 9) pointers for (future) expansion
+ * currently in use:
+ * - F/W printf information
+ */
+} memimage;
+
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * DHF function prototypes
+ *
+ *---------------------------------------------------------------------------*/
+
+EXTERN_C int dhf_download_fw( void *ifbp, memimage *fw ); // ifbp, ignored when using the UIL
+EXTERN_C int dhf_download_binary( memimage *fw );
+
+
+/*-----------------------------------------------------------------------------
+ *
+ * Functions to be provided by the user of the DHF module.
+ *
+ *---------------------------------------------------------------------------*/
+
+// defined in DHF.C; see there for comments
+EXTERN_C hcf_16 *find_record_in_pda( hcf_16 *pdap, hcf_16 code );
+
+#endif // DHF_H
+
diff --git a/drivers/staging/wlags49_h2/dhfcfg.h b/drivers/staging/wlags49_h2/dhfcfg.h
new file mode 100644
index 000000000000..55bd90e422e8
--- /dev/null
+++ b/drivers/staging/wlags49_h2/dhfcfg.h
@@ -0,0 +1,175 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains DHF configuration info.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 07:08:33 $
+ * $Revision: 1.1.1.1 $
+ * $Source: /usr/local/cvs/wl_lkm/include/hcf/dhfcfg.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef DHFCFG_H
+#define DHFCFG_H
+/*-----------------------------------------------------------------------------
+ * File DHFCFG.H
+ *
+ * Contents: #defines for the DHF module
+ *
+ * Comments:
+ * Some combinations of the #defines in this file are illegal (as noted below).
+ * If an illegal combinations of #defines is specified a compile error is
+ * generated. See document DHFUG.DOC for more information.
+ *
+ * Author: John Meertens
+ * Date: 11-01-2000
+ *
+ * Change history:
+ *---------------------------------------------------------------------------*/
+
+
+// Define DHF_WCI if you want to use the WCI to access the ORiNOCO card.
+// Define DHF_UIL if you want to use the UIL to access the ORiNOCO card.
+// You must define either DHF_WCI or DHF_UIL. If neither of the two is defined
+// or both a compile error is generated.
+#define DHF_WCI
+//!!!#define DHF_UIL
+
+// Define DHF_BIG_ENDIAN if you are working on a big endian platform.
+// Define DHF_LITTLE_ENDIAN if you are working on a little endian platform.
+// You must define either DHF_BIG_ENDIAN or DHF_LITTLE_ENDIAN. If neither of
+// the two is defined or both a compile error is generated.
+#ifdef USE_BIG_ENDIAN
+#define DHF_BIG_ENDIAN
+#else
+#define DHF_LITTLE_ENDIAN
+#endif /* USE_BIG_ENDIAN */
+
+// Define DHF_WIN if you are working on Windows platform.
+// Define DHF_DOS if you are working on DOS.
+// You must define either DHF_WIN or DHF_DOS. If neither of
+// the two is defined or both a compile error is generated.
+//!!!#define DHF_WIN
+//!!!#define DHF_DOS
+
+// Define if you want the DHF to users. Not defining DHF_GET_RES_MSG
+// leads to a decrease in code size as message strings are not included.
+//!!!#define DHF_GET_RES_MSG
+
+// Linux driver specific
+// Prevent inclusion of stdlib.h and string.h
+#define _INC_STDLIB
+#define _INC_STRING
+
+//-----------------------------------------------------------------------------
+// Define one or more of the following DSF #defines if you want to implement
+// the related DSF-function. Function dsf_callback must allways be implemented.
+// See file DHF.H for prototypes of the functions.
+
+// Define DSF_ALLOC if you want to manage memory allocation and de-allocation
+// for the DHF. If DSF_ALLOC is defined you must implement dsf_alloc and dsf_free.
+//!!!#define DSF_ALLOC
+
+// Define DSF_CONFIRM if you want the DHF to ask the user for confirmation in a
+// number of situations. If DSF_CONFIRM is defined you must implement dsf_confirm.
+// Not defining DSF_CONFIRM leads to a decrease in code size as confirmation
+// strings are not included.
+//!!!#define DSF_CONFIRM
+
+// Define DSF_DEBUG_MESSAGE if you want debug messages added to your output.
+// If you define DSF_DEBUG_MESSAGE then you must implement function
+// dsf_debug_message.
+//#define DSF_DEBUG_MESSAGE
+
+// Define DSF_ASSERT if you want asserts to be activated.
+// If you define DSF_ASSERT then you must implement function dsf_assert.
+//#define DBG 1
+//#define DSF_ASSERT
+
+// Define DSF_DBWIN if you want asserts and debug messages to be send to a debug
+// window like SOFTICE or DebugView from SysInternals.
+//!!!#define DSF_DBWIN
+//!!! Not implemented yet!
+
+// Define DSF_VOLATILE_ONLY if you only wants to use valatile functions
+// This is a typical setting for a AP and a driver.
+#define DSF_VOLATILE_ONLY
+
+// Define DSF_HERMESII if you want to use the DHF for the Hermes-II
+#ifdef HERMES2
+#define DSF_HERMESII
+#else
+#undef DSF_HERMESII
+#endif // HERMES2
+
+// Define DSF_BINARY_FILE if you want to use the DHF in combination with
+// reading the Firmware from a separate binary file.
+//!!!#define DSF_BINARY_FILE
+
+#endif // DHFCFG_H
diff --git a/drivers/staging/wlags49_h2/hcf.c b/drivers/staging/wlags49_h2/hcf.c
new file mode 100644
index 000000000000..6e39f5081e27
--- /dev/null
+++ b/drivers/staging/wlags49_h2/hcf.c
@@ -0,0 +1,4881 @@
+// vim:tw=110:ts=4:
+/************************************************************************************************************
+*
+* FILE : HCF.C
+*
+* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.10 $
+* Original: 2004/06/02 10:22:22 Revision: 1.85 Tag: hcf7_t20040602_01
+* Original: 2004/04/15 09:24:41 Revision: 1.63 Tag: hcf7_t7_20040415_01
+* Original: 2004/04/13 14:22:44 Revision: 1.62 Tag: t7_20040413_01
+* Original: 2004/04/01 15:32:55 Revision: 1.59 Tag: t7_20040401_01
+* Original: 2004/03/10 15:39:27 Revision: 1.55 Tag: t20040310_01
+* Original: 2004/03/04 11:03:37 Revision: 1.53 Tag: t20040304_01
+* Original: 2004/03/02 14:51:21 Revision: 1.50 Tag: t20040302_03
+* Original: 2004/02/24 13:00:27 Revision: 1.43 Tag: t20040224_01
+* Original: 2004/02/19 10:57:25 Revision: 1.39 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* SPECIFICATION: ........
+*
+* DESCRIPTION : HCF Routines for Hermes-II (callable via the Wireless Connection I/F or WCI)
+* Local Support Routines for above procedures
+*
+* Customizable via HCFCFG.H, which is included by HCF.H
+*
+*************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+************************************************************************************************************/
+
+
+/************************************************************************************************************
+**
+** Implementation Notes
+**
+* - a leading marker of //! is used. The purpose of such a sequence is to help to understand the flow
+* An example is: //!rc = HCF_SUCCESS;
+* if this is superfluous because rc is already guaranteed to be 0 but it shows to the (maintenance)
+* programmer it is an intentional omission at the place where someone could consider it most appropriate at
+* first glance
+* - using near pointers in a model where ss!=ds is an invitation for disaster, so be aware of how you specify
+* your model and how you define variables which are used at interrupt time
+* - remember that sign extension on 32 bit platforms may cause problems unless code is carefully constructed,
+* e.g. use "(hcf_16)~foo" rather than "~foo"
+*
+************************************************************************************************************/
+
+#include "hcf.h" // HCF and MSF common include file
+#include "hcfdef.h" // HCF specific include file
+#include "mmd.h" // MoreModularDriver common include file
+
+#if ! defined offsetof
+#define offsetof(s,m) ((unsigned int)&(((s *)0)->m))
+#endif // offsetof
+
+
+/***********************************************************************************************************/
+/*************************************** PROTOTYPES ******************************************************/
+/***********************************************************************************************************/
+HCF_STATIC int cmd_exe( IFBP ifbp, hcf_16 cmd_code, hcf_16 par_0 );
+HCF_STATIC int init( IFBP ifbp );
+HCF_STATIC int put_info( IFBP ifbp, LTVP ltvp );
+#if (HCF_EXT) & HCF_EXT_MB
+HCF_STATIC int put_info_mb( IFBP ifbp, CFG_MB_INFO_STRCT FAR * ltvp );
+#endif // HCF_EXT_MB
+#if (HCF_TYPE) & HCF_TYPE_WPA
+HCF_STATIC void calc_mic( hcf_32* p, hcf_32 M );
+void calc_mic_rx_frag( IFBP ifbp, wci_bufp p, int len );
+void calc_mic_tx_frag( IFBP ifbp, wci_bufp p, int len );
+HCF_STATIC int check_mic( IFBP ifbp );
+#endif // HCF_TYPE_WPA
+
+HCF_STATIC void calibrate( IFBP ifbp );
+HCF_STATIC int cmd_cmpl( IFBP ifbp );
+HCF_STATIC hcf_16 get_fid( IFBP ifbp );
+HCF_STATIC void isr_info( IFBP ifbp );
+#if HCF_DMA
+HCF_STATIC DESC_STRCT* get_frame_lst(IFBP ifbp, int tx_rx_flag);
+#endif // HCF_DMA
+HCF_STATIC void get_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) ); //char*, byte count (usually even)
+#if HCF_DMA
+HCF_STATIC void put_frame_lst( IFBP ifbp, DESC_STRCT *descp, int tx_rx_flag );
+#endif // HCF_DMA
+HCF_STATIC void put_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) );
+HCF_STATIC void put_frag_finalize( IFBP ifbp );
+HCF_STATIC int setup_bap( IFBP ifbp, hcf_16 fid, int offset, int type );
+#if (HCF_ASSERT) & HCF_ASSERT_PRINTF
+static int fw_printf(IFBP ifbp, CFG_FW_PRINTF_STRCT FAR *ltvp);
+#endif // HCF_ASSERT_PRINTF
+
+HCF_STATIC int download( IFBP ifbp, CFG_PROG_STRCT FAR *ltvp );
+#if (HCF_ENCAP) & HCF_ENC
+HCF_STATIC hcf_8 hcf_encap( wci_bufp type );
+#endif // HCF_ENCAP
+HCF_STATIC hcf_8 null_addr[4] = { 0, 0, 0, 0 };
+#if ! defined IN_PORT_WORD //replace I/O Macros with logging facility
+extern FILE *log_file;
+
+#define IN_PORT_WORD(port) in_port_word( (hcf_io)(port) )
+
+static hcf_16 in_port_word( hcf_io port ) {
+hcf_16 i = (hcf_16)_inpw( port );
+ if ( log_file ) {
+ fprintf( log_file, "\nR %2.2x %4.4x", (port)&0xFF, i);
+ }
+ return i;
+} // in_port_word
+
+#define OUT_PORT_WORD(port, value) out_port_word( (hcf_io)(port), (hcf_16)(value) )
+
+static void out_port_word( hcf_io port, hcf_16 value ) {
+ _outpw( port, value );
+ if ( log_file ) {
+ fprintf( log_file, "\nW %2.02x %4.04x", (port)&0xFF, value );
+ }
+}
+
+void IN_PORT_STRING_32( hcf_io prt, hcf_32 FAR * dst, int n) {
+ int i = 0;
+ hcf_16 FAR * p;
+ if ( log_file ) {
+ fprintf( log_file, "\nread string_32 length %04x (%04d) at port %02.2x to addr %lp",
+ (hcf_16)n, (hcf_16)n, (hcf_16)(prt)&0xFF, dst);
+ }
+ while ( n-- ) {
+ p = (hcf_16 FAR *)dst;
+ *p++ = (hcf_16)_inpw( prt );
+ *p = (hcf_16)_inpw( prt );
+ if ( log_file ) {
+ fprintf( log_file, "%s%08lx ", i++ % 0x08 ? " " : "\n", *dst);
+ }
+ dst++;
+ }
+} // IN_PORT_STRING_32
+
+void IN_PORT_STRING_8_16( hcf_io prt, hcf_8 FAR * dst, int n) { //also handles byte alignment problems
+ hcf_16 FAR * p = (hcf_16 FAR *)dst; //this needs more elaborate code in non-x86 platforms
+ int i = 0;
+ if ( log_file ) {
+ fprintf( log_file, "\nread string_16 length %04x (%04d) at port %02.2x to addr %lp",
+ (hcf_16)n, (hcf_16)n, (hcf_16)(prt)&0xFF, dst );
+ }
+ while ( n-- ) {
+ *p =(hcf_16)_inpw( prt);
+ if ( log_file ) {
+ if ( i++ % 0x10 ) {
+ fprintf( log_file, "%04x ", *p);
+ } else {
+ fprintf( log_file, "\n%04x ", *p);
+ }
+ }
+ p++;
+ }
+} // IN_PORT_STRING_8_16
+
+void OUT_PORT_STRING_32( hcf_io prt, hcf_32 FAR * src, int n) {
+ int i = 0;
+ hcf_16 FAR * p;
+ if ( log_file ) {
+ fprintf( log_file, "\nwrite string_32 length %04x (%04d) at port %02.2x",
+ (hcf_16)n, (hcf_16)n, (hcf_16)(prt)&0xFF);
+ }
+ while ( n-- ) {
+ p = (hcf_16 FAR *)src;
+ _outpw( prt, *p++ );
+ _outpw( prt, *p );
+ if ( log_file ) {
+ fprintf( log_file, "%s%08lx ", i++ % 0x08 ? " " : "\n", *src);
+ }
+ src++;
+ }
+} // OUT_PORT_STRING_32
+
+void OUT_PORT_STRING_8_16( hcf_io prt, hcf_8 FAR * src, int n) { //also handles byte alignment problems
+ hcf_16 FAR * p = (hcf_16 FAR *)src; //this needs more elaborate code in non-x86 platforms
+ int i = 0;
+ if ( log_file ) {
+ fprintf( log_file, "\nwrite string_16 length %04x (%04d) at port %04x", n, n, (hcf_16)prt);
+ }
+ while ( n-- ) {
+ (void)_outpw( prt, *p);
+ if ( log_file ) {
+ if ( i++ % 0x10 ) {
+ fprintf( log_file, "%04x ", *p);
+ } else {
+ fprintf( log_file, "\n%04x ", *p);
+ }
+ }
+ p++;
+ }
+} // OUT_PORT_STRING_8_16
+
+#endif // IN_PORT_WORD
+
+/************************************************************************************************************
+******************************* D A T A D E F I N I T I O N S ********************************************
+************************************************************************************************************/
+
+#if HCF_ASSERT
+IFBP BASED assert_ifbp = NULL; //to make asserts easily work under MMD and DHF
+#endif // HCF_ASSERT
+
+#if HCF_ENCAP
+/* SNAP header to be inserted in Ethernet-II frames */
+HCF_STATIC hcf_8 BASED snap_header[] = { 0xAA, 0xAA, 0x03, 0x00, 0x00, //5 bytes signature +
+ 0 }; //1 byte protocol identifier
+#endif // HCF_ENCAP
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+HCF_STATIC hcf_8 BASED mic_pad[8] = { 0x5A, 0, 0, 0, 0, 0, 0, 0 }; //MIC padding of message
+#endif // HCF_TYPE_WPA
+
+#if defined MSF_COMPONENT_ID
+CFG_IDENTITY_STRCT BASED cfg_drv_identity = {
+ sizeof(cfg_drv_identity)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_IDENTITY, // (0x0826)
+ MSF_COMPONENT_ID,
+ MSF_COMPONENT_VAR,
+ MSF_COMPONENT_MAJOR_VER,
+ MSF_COMPONENT_MINOR_VER
+} ;
+
+CFG_RANGES_STRCT BASED cfg_drv_sup_range = {
+ sizeof(cfg_drv_sup_range)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_SUP_RANGE, // (0x0827)
+
+ COMP_ROLE_SUPL,
+ COMP_ID_DUI,
+ {{ DUI_COMPAT_VAR,
+ DUI_COMPAT_BOT,
+ DUI_COMPAT_TOP
+ }}
+} ;
+
+struct CFG_RANGE3_STRCT BASED cfg_drv_act_ranges_pri = {
+ sizeof(cfg_drv_act_ranges_pri)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_ACT_RANGES_PRI, // (0x0828)
+
+ COMP_ROLE_ACT,
+ COMP_ID_PRI,
+ {
+ { 0, 0, 0 }, // HCF_PRI_VAR_1 not supported by HCF 7
+ { 0, 0, 0 }, // HCF_PRI_VAR_2 not supported by HCF 7
+ { 3, //var_rec[2] - Variant number
+ CFG_DRV_ACT_RANGES_PRI_3_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_PRI_3_TOP // - Top Compatibility
+ }
+ }
+} ;
+
+
+struct CFG_RANGE4_STRCT BASED cfg_drv_act_ranges_sta = {
+ sizeof(cfg_drv_act_ranges_sta)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_ACT_RANGES_STA, // (0x0829)
+
+ COMP_ROLE_ACT,
+ COMP_ID_STA,
+ {
+#if defined HCF_STA_VAR_1
+ { 1, //var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_STA_1_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_STA_1_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_STA_VAR_1
+#if defined HCF_STA_VAR_2
+ { 2, //var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_STA_2_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_STA_2_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_STA_VAR_2
+// For Native_USB (Not used!)
+#if defined HCF_STA_VAR_3
+ { 3, //var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_STA_3_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_STA_3_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_STA_VAR_3
+// Warp
+#if defined HCF_STA_VAR_4
+ { 4, //var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_STA_4_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_STA_4_TOP // - Top Compatibility
+ }
+#else
+ { 0, 0, 0 }
+#endif // HCF_STA_VAR_4
+ }
+} ;
+
+
+struct CFG_RANGE6_STRCT BASED cfg_drv_act_ranges_hsi = {
+ sizeof(cfg_drv_act_ranges_hsi)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_ACT_RANGES_HSI, // (0x082A)
+ COMP_ROLE_ACT,
+ COMP_ID_HSI,
+ {
+#if defined HCF_HSI_VAR_0 // Controlled deployment
+ { 0, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_HSI_0_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_HSI_0_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_HSI_VAR_0
+ { 0, 0, 0 }, // HCF_HSI_VAR_1 not supported by HCF 7
+ { 0, 0, 0 }, // HCF_HSI_VAR_2 not supported by HCF 7
+ { 0, 0, 0 }, // HCF_HSI_VAR_3 not supported by HCF 7
+#if defined HCF_HSI_VAR_4 // Hermes-II all types
+ { 4, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_HSI_4_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_HSI_4_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_HSI_VAR_4
+#if defined HCF_HSI_VAR_5 // WARP Hermes-2.5
+ { 5, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_HSI_5_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_HSI_5_TOP // - Top Compatibility
+ }
+#else
+ { 0, 0, 0 }
+#endif // HCF_HSI_VAR_5
+ }
+} ;
+
+
+CFG_RANGE4_STRCT BASED cfg_drv_act_ranges_apf = {
+ sizeof(cfg_drv_act_ranges_apf)/sizeof(hcf_16) - 1, //length of RID
+ CFG_DRV_ACT_RANGES_APF, // (0x082B)
+
+ COMP_ROLE_ACT,
+ COMP_ID_APF,
+ {
+#if defined HCF_APF_VAR_1 //(Fake) Hermes-I
+ { 1, //var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_APF_1_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_APF_1_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_APF_VAR_1
+#if defined HCF_APF_VAR_2 //Hermes-II
+ { 2, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_APF_2_BOTTOM, // - Bottom Compatibility
+ CFG_DRV_ACT_RANGES_APF_2_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_APF_VAR_2
+#if defined HCF_APF_VAR_3 // Native_USB
+ { 3, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_APF_3_BOTTOM, // - Bottom Compatibility !!!!!see note below!!!!!!!
+ CFG_DRV_ACT_RANGES_APF_3_TOP // - Top Compatibility
+ },
+#else
+ { 0, 0, 0 },
+#endif // HCF_APF_VAR_3
+#if defined HCF_APF_VAR_4 // WARP Hermes 2.5
+ { 4, // var_rec[1] - Variant number
+ CFG_DRV_ACT_RANGES_APF_4_BOTTOM, // - Bottom Compatibility !!!!!see note below!!!!!!!
+ CFG_DRV_ACT_RANGES_APF_4_TOP // - Top Compatibility
+ }
+#else
+ { 0, 0, 0 }
+#endif // HCF_APF_VAR_4
+ }
+} ;
+#define HCF_VERSION TEXT( "HCF$Revision: 1.10 $" )
+
+static struct /*CFG_HCF_OPT_STRCT*/ {
+ hcf_16 len; //length of cfg_hcf_opt struct
+ hcf_16 typ; //type 0x082C
+ hcf_16 v0; //offset HCF_VERSION
+ hcf_16 v1; // MSF_COMPONENT_ID
+ hcf_16 v2; // HCF_ALIGN
+ hcf_16 v3; // HCF_ASSERT
+ hcf_16 v4; // HCF_BIG_ENDIAN
+ hcf_16 v5; // /* HCF_DLV | HCF_DLNV */
+ hcf_16 v6; // HCF_DMA
+ hcf_16 v7; // HCF_ENCAP
+ hcf_16 v8; // HCF_EXT
+ hcf_16 v9; // HCF_INT_ON
+ hcf_16 v10; // HCF_IO
+ hcf_16 v11; // HCF_LEGACY
+ hcf_16 v12; // HCF_MAX_LTV
+ hcf_16 v13; // HCF_PROT_TIME
+ hcf_16 v14; // HCF_SLEEP
+ hcf_16 v15; // HCF_TALLIES
+ hcf_16 v16; // HCF_TYPE
+ hcf_16 v17; // HCF_NIC_TAL_CNT
+ hcf_16 v18; // HCF_HCF_TAL_CNT
+ hcf_16 v19; // offset tallies
+ TCHAR val[sizeof(HCF_VERSION)];
+} BASED cfg_hcf_opt = {
+ sizeof(cfg_hcf_opt)/sizeof(hcf_16) -1,
+ CFG_HCF_OPT, // (0x082C)
+ ( sizeof(cfg_hcf_opt) - sizeof(HCF_VERSION) - 4 )/sizeof(hcf_16),
+#if defined MSF_COMPONENT_ID
+ MSF_COMPONENT_ID,
+#else
+ 0,
+#endif // MSF_COMPONENT_ID
+ HCF_ALIGN,
+ HCF_ASSERT,
+ HCF_BIG_ENDIAN,
+ 0, // /* HCF_DLV | HCF_DLNV*/,
+ HCF_DMA,
+ HCF_ENCAP,
+ HCF_EXT,
+ HCF_INT_ON,
+ HCF_IO,
+ HCF_LEGACY,
+ HCF_MAX_LTV,
+ HCF_PROT_TIME,
+ HCF_SLEEP,
+ HCF_TALLIES,
+ HCF_TYPE,
+#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
+ HCF_NIC_TAL_CNT,
+ HCF_HCF_TAL_CNT,
+ offsetof(IFB_STRCT, IFB_TallyLen ),
+#else
+ 0, 0, 0,
+#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
+ HCF_VERSION
+}; // cfg_hcf_opt
+#endif // MSF_COMPONENT_ID
+
+#if defined HCF_TALLIES_EXTRA
+ replaced by HCF_EXT_TALLIES_FW ;
+#endif // HCF_TALLIES_EXTRA
+
+#if defined MSF_COMPONENT_ID || (HCF_EXT) & HCF_EXT_MB
+#if (HCF_EXT) & HCF_EXT_MB
+HCF_STATIC LTV_STRCT BASED cfg_null = { 1, CFG_NULL, {0} };
+#endif // HCF_EXT_MB
+HCF_STATIC hcf_16* BASED xxxx[ ] = {
+#if (HCF_EXT) & HCF_EXT_MB
+ &cfg_null.len, //CFG_NULL 0x0820
+#endif // HCF_EXT_MB
+#if defined MSF_COMPONENT_ID
+ &cfg_drv_identity.len, //CFG_DRV_IDENTITY 0x0826
+ &cfg_drv_sup_range.len, //CFG_DRV_SUP_RANGE 0x0827
+ &cfg_drv_act_ranges_pri.len, //CFG_DRV_ACT_RANGES_PRI 0x0828
+ &cfg_drv_act_ranges_sta.len, //CFG_DRV_ACT_RANGES_STA 0x0829
+ &cfg_drv_act_ranges_hsi.len, //CFG_DRV_ACT_RANGES_HSI 0x082A
+ &cfg_drv_act_ranges_apf.len, //CFG_DRV_ACT_RANGES_APF 0x082B
+ &cfg_hcf_opt.len, //CFG_HCF_OPT 0x082C
+ NULL, //IFB_PRIIdentity placeholder 0xFD02
+ NULL, //IFB_PRISup placeholder 0xFD03
+#endif // MSF_COMPONENT_ID
+ NULL //endsentinel
+ };
+#define xxxx_PRI_IDENTITY_OFFSET (sizeof(xxxx)/sizeof(xxxx[0]) - 3)
+
+#endif // MSF_COMPONENT_ID / HCF_EXT_MB
+
+
+/************************************************************************************************************
+************************** T O P L E V E L H C F R O U T I N E S **************************************
+************************************************************************************************************/
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.MODULE int hcf_action( IFBP ifbp, hcf_16 action )
+*.PURPOSE Changes the run-time Card behavior.
+* Performs Miscellanuous actions.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* action number identifying the type of change
+* - HCF_ACT_CCX_OFF disable CKIP
+* - HCF_ACT_CCX_ON enable CKIP
+* - HCF_ACT_INT_FORCE_ON enable interrupt generation by WaveLAN NIC
+* - HCF_ACT_INT_OFF disable interrupt generation by WaveLAN NIC
+* - HCF_ACT_INT_ON compensate 1 HCF_ACT_INT_OFF, enable interrupt generation if balance reached
+* - HCF_ACT_PRS_SCAN Hermes Probe Respons Scan (F102) command
+* - HCF_ACT_RX_ACK acknowledge non-DMA receiver to Hermes
+* - HCF_ACT_SCAN Hermes Inquire Scan (F101) command (non-WARP only)
+* - HCF_ACT_SLEEP DDS Sleep request
+* - HCF_ACT_TALLIES Hermes Inquire Tallies (F100) command
+*
+*.RETURNS
+* HCF_SUCCESS all (including invalid)
+* HCF_INT_PENDING HCF_ACT_INT_OFF, interrupt pending
+* HCF_ERR_NO_NIC HCF_ACT_INT_OFF, NIC presence check fails
+*
+*.CONDITIONS
+* Except for hcf_action with HCF_ACT_INT_FORCE_ON or HCF_ACT_INT_OFF as parameter or hcf_connect with an I/O
+* address (i.e. not HCF_DISCONNECT), all hcf-function calls MUST be preceeded by a call of hcf_action with
+* HCF_ACT_INT_OFF as parameter.
+* Note that hcf_connect defaults to NIC interrupt disabled mode, i.e. as if hcf_action( HCF_ACT_INT_OFF )
+* was called.
+*
+*.DESCRIPTION
+* hcf_action supports the following mode changing action-code pairs that are antonyms
+* - HCF_ACT_CCX_OFF / HCF_ACT_CCX_ON
+* - HCF_ACT_INT_[FORCE_]ON / HCF_ACT_INT_OFF
+*
+* Additionally hcf_action can start the following actions in the NIC:
+* - HCF_ACT_PRS_SCAN
+* - HCF_ACT_RX_ACK
+* - HCF_ACT_SCAN
+* - HCF_ACT_SLEEP
+* - HCF_ACT_TALLIES
+*
+* o HCF_ACT_INT_OFF: Sets NIC Interrupts mode Disabled.
+* This command, and the associated [Force] Enable NIC interrupts command, are only available if the HCF_INT_ON
+* compile time option is not set at 0x0000.
+*
+* o HCF_ACT_INT_ON: Sets NIC Interrupts mode Enabled.
+* Enable NIC Interrupts, depending on the number of preceding Disable NIC Interrupt calls.
+*
+* o HCF_ACT_INT_FORCE_ON: Force NIC Interrupts mode Enabled.
+* Sets NIC Interrupts mode Enabled, regardless off the number of preceding Disable NIC Interrupt calls.
+*
+* The disabling and enabling of interrupts are antonyms.
+* These actions must be balanced.
+* For each "disable interrupts" there must be a matching "enable interrupts".
+* The disable interrupts may be executed multiple times in a row without intervening enable interrupts, in
+* other words, the disable interrupts may be nested.
+* The interrupt generation mechanism is disabled at the first call with HCF_ACT_INT_OFF.
+* The interrupt generation mechanism is re-enabled when the number of calls with HCF_ACT_INT_ON matches the
+* number of calls with INT_OFF.
+*
+* It is not allowed to have more Enable NIC Interrupts calls than Disable NIC Interrupts calls.
+* The interrupt generation mechanism is initially (i.e. after hcf_connect) disabled.
+* An MSF based on a interrupt strategy must call hcf_action with INT_ON in its initialization logic.
+*
+*! The INT_OFF/INT_ON housekeeping is initialized at 0x0000 by hcf_connect, causing the interrupt generation
+* mechanism to be disabled at first. This suits MSF implementation based on a polling strategy.
+*
+* o HCF_ACT_CCX_OFF / HCF_ACT_CCX_ON
+*!! This can use some more explanation;?
+* Disables and Enables support in the HCF runtime code for the CCX feature. Each time one of these action
+* codes is used, the effects of the preceding use cease.
+*
+* o HCF_ACT_SLEEP: Initiates the Disconnected DeepSleep process
+* This command is only available if the HCF_DDS compile time option is set. It triggers the F/W to start the
+* sleep handshaking. Regardless whether the Host initiates a Disconnected DeepSleep (DDS) or the F/W initiates
+* a Connected DeepSleep (CDS), the Host-F/W sleep handshaking is completed when the NIC Interrupts mode is
+* enabled (by means of the balancing HCF_ACT_INT_ON), i.e. at that moment the F/W really goes into sleep mode.
+* The F/W is wokenup by the HCF when the NIC Interrupts mode are disabled, i.e. at the first HCF_ACT_INT_OFF
+* after going into sleep.
+*
+* The following Miscellanuous actions are defined:
+*
+* o HCF_ACT_RX_ACK: Receiver Acknowledgement (non-DMA, non-USB mode only)
+* Acking the receiver, frees the NIC memory used to hold the Rx frame and allows the F/W to
+* report the existence of the next Rx frame.
+* If the MSF does not need access (any longer) to the current frame, e.g. because it is rejected based on the
+* look ahead or copied to another buffer, the receiver may be acked. Acking earlier is assumed to have the
+* potential of improving the performance.
+* If the MSF does not explitly ack te receiver, the acking is done implicitly if:
+* - the received frame fits in the look ahead buffer, by the hcf_service_nic call that reported the Rx frame
+* - if not in the above step, by hcf_rcv_msg (assuming hcf_rcv_msg is called)
+* - if neither of the above implicit acks nor an explicit ack by the MSF, by the first hcf_service_nic after
+* the hcf_service_nic that reported the Rx frame.
+* Note: If an Rx frame is already acked, an explicit ACK by the MSF acts as a NoOperation.
+*
+* o HCF_ACT_TALLIES: Inquire Tallies command
+* This command is only operational if the F/W is enabled.
+* The Inquire Tallies command requests the F/W to provide its current set of tallies.
+* See also hcf_get_info with CFG_TALLIES as parameter.
+*
+* o HCF_ACT_PRS_SCAN: Inquire Probe Respons Scan command
+* This command is only operational if the F/W is enabled.
+* The Probe Respons Scan command starts a scan sequence.
+* The HCF puts the result of this action in an MSF defined buffer (see CFG_RID_LOG_STRCT).
+*
+* o HCF_ACT_SCAN: Inquire Scan command
+* This command is only supported for HII F/W (i.e. pre-WARP) and it is operational if the F/W is enabled.
+* The Inquire Scan command starts a scan sequence.
+* The HCF puts the result of this action in an MSF defined buffer (see CFG_RID_LOG_STRCT).
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - NIC interrupts are not disabled while required by parameter action.
+* - an invalid code is specified in parameter action.
+* - HCF_ACT_INT_ON commands outnumber the HCF_ACT_INT_OFF commands.
+* - reentrancy, may be caused by calling hcf_functions without adequate protection against NIC interrupts or
+* multi-threading
+*
+* - Since the HCF does not maintain status information relative to the F/W enabled state, it is not asserted
+* whether HCF_ACT_SCAN, HCF_ACT_PRS_SCAN or HCF_ACT_TALLIES are only used while F/W is enabled.
+*
+*.DIAGRAM
+* 0: The assert embedded in HCFLOGENTRY checks against re-entrancy. Re-entrancy could be caused by a MSF logic
+* at task-level calling hcf_functions without shielding with HCF_ACT_ON/_OFF. However the HCF_ACT_INT_OFF
+* action itself can per definition not be protected this way. Based on code inspection, it can be concluded,
+* that there is no re-entrancy PROBLEM in this particular flow. It does not seem worth the trouble to
+* explicitly check for this condition (although there was a report of an MSF which ran into this assert.
+* 2:IFB_IntOffCnt is used to balance the INT_OFF and INT_ON calls. Disabling of the interrupts is achieved by
+* writing a zero to the Hermes IntEn register. In a shared interrupt environment (e.g. the mini-PCI NDIS
+* driver) it is considered more correct to return the status HCF_INT_PENDING if and only if, the current
+* invocation of hcf_service_nic is (apparently) called in the ISR when the ISR was activated as result of a
+* change in HREG_EV_STAT matching a bit in HREG_INT_EN, i.e. not if invoked as result of another device
+* generating an interrupt on the shared interrupt line.
+* Note 1: it has been observed that under certain adverse conditions on certain platforms the writing of
+* HREG_INT_EN can apparently fail, therefor it is paramount that HREG_INT_EN is written again with 0 for
+* each and every call to HCF_ACT_INT_OFF.
+* Note 2: it has been observed that under certain H/W & S/W architectures this logic is called when there is
+* no NIC at all. To cater for this, the value of HREG_INT_EN is validated. If the unused bit 0x0100 is set,
+* it is assumed there is no NIC.
+* Note 3: During the download process, some versions of the F/W reset HREG_SW_0, hence checking this
+* register for HCF_MAGIC (the classical NIC presence test) when HCF_ACT_INT_OFF is called due to another
+* card interrupting via a shared IRQ during a download, fails.
+*4: The construction "if ( ifbp->IFB_IntOffCnt-- == 0 )" is optimal (in the sense of shortest/quickest
+* path in error free flows) but NOT fail safe in case of too many INT_ON invocations compared to INT_OFF).
+* Enabling of the interrupts is achieved by writing the Hermes IntEn register.
+* - If the HCF is in Defunct mode, the interrupts stay disabled.
+* - Under "normal" conditions, the HCF is only interested in Info Events, Rx Events and Notify Events.
+* - When the HCF is out of Tx/Notify resources, the HCF is also interested in Alloc Events.
+* - via HCF_EXT, the MSF programmer can also request HREG_EV_TICK and/or HREG_EV_TX_EXC interrupts.
+* For DMA operation, the DMA hardware handles the alloc events. The DMA engine will generate a 'TxDmaDone'
+* event as soon as it has pumped a frame from host ram into NIC-RAM (note that the frame does not have to be
+* transmitted then), and a 'RxDmaDone' event as soon as a received frame has been pumped from NIC-RAM into
+* host ram. Note that the 'alloc' event has been removed from the event-mask, because the DMA engine will
+* react to and acknowledge this event.
+*6: ack the "old" Rx-event. See "Rx Buffer free strategy" in hcf_service_nic above for more explanation.
+* IFB_RxFID and IFB_RxLen must be cleared to bring both the internal HCF house keeping and the information
+* supplied to the MSF in the state "no frame received".
+*8: The HCF_ACT_SCAN, HCF_ACT_PRS_SCAN and HCF_ACT_TALLIES activity are merged by "clever" algebraic
+* manipulations of the RID-values and action codes, so foregoing robustness against migration problems for
+* ease of implementation. The assumptions about numerical relationships between CFG_TALLIES etc and
+* HCF_ACT_TALLIES etc are checked by the "#if" statements just prior to the body of this routine, resulting
+* in: err "maintenance" during compilation if the assumptions are no longer met. The writing of HREG_PARAM_1
+* with 0x3FFF in case of an PRS scan, is a kludge to get around lack of specification, hence different
+* implementation in F/W and Host.
+* When there is no NIC RAM available, some versions of the Hermes F/W do report 0x7F00 as error in the
+* Result field of the Status register and some F/W versions don't. To mask this difference to the MSF all
+* return codes of the Hermes are ignored ("best" and "most simple" solution to these types of analomies with
+* an acceptable loss due to ignoring all error situations as well).
+* The "No inquire space" is reported via the Hermes tallies.
+*30: do not HCFASSERT( rc, rc ) since rc == HCF_INT_PENDING is no error
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
+#if CFG_SCAN != CFG_TALLIES - HCF_ACT_TALLIES + HCF_ACT_SCAN
+err: "maintenance" apparently inviolated the underlying assumption about the numerical values of these macros
+#endif
+#endif // HCF_TYPE_HII5
+#if CFG_PRS_SCAN != CFG_TALLIES - HCF_ACT_TALLIES + HCF_ACT_PRS_SCAN
+err: "maintenance" apparently inviolated the underlying assumption about the numerical values of these macros
+#endif
+int
+hcf_action( IFBP ifbp, hcf_16 action )
+{
+int rc = HCF_SUCCESS;
+
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+#if HCF_INT_ON
+ HCFLOGENTRY( action == HCF_ACT_INT_FORCE_ON ? HCF_TRACE_ACTION_KLUDGE : HCF_TRACE_ACTION, action ) /* 0 */
+#if (HCF_SLEEP)
+ HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFE || action == HCF_ACT_INT_OFF,
+ MERGE_2( action, ifbp->IFB_IntOffCnt ) )
+#else
+ HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFE, action )
+#endif // HCF_SLEEP
+ HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF ||
+ action == HCF_ACT_INT_OFF || action == HCF_ACT_INT_FORCE_ON, action )
+ HCFASSERT( ifbp->IFB_IntOffCnt <= 16 || ifbp->IFB_IntOffCnt >= 0xFFFE,
+ MERGE_2( action, ifbp->IFB_IntOffCnt ) ) //nesting more than 16 deep seems unreasonable
+#endif // HCF_INT_ON
+
+ switch (action) {
+#if HCF_INT_ON
+hcf_16 i;
+ case HCF_ACT_INT_OFF: // Disable Interrupt generation
+#if HCF_SLEEP
+ if ( ifbp->IFB_IntOffCnt == 0xFFFE ) { // WakeUp test ;?tie this to the "new" super-LinkStat
+ ifbp->IFB_IntOffCnt++; // restore conventional I/F
+ OPW(HREG_IO, HREG_IO_WAKEUP_ASYNC ); // set wakeup bit
+ OPW(HREG_IO, HREG_IO_WAKEUP_ASYNC ); // set wakeup bit to counteract the clearing by F/W
+ // 800 us latency before FW switches to high power
+ MSF_WAIT(800); // MSF-defined function to wait n microseconds.
+//OOR if ( ifbp->IFB_DSLinkStat & CFG_LINK_STAT_DS_OOR ) { // OutOfRange
+// printk( "<5>ACT_INT_OFF: Deepsleep phase terminated, enable and go to AwaitConnection\n" ); //;?remove me 1 day
+// hcf_cntl( ifbp, HCF_CNTL_ENABLE );
+// }
+// ifbp->IFB_DSLinkStat &= ~( CFG_LINK_STAT_DS_IR | CFG_LINK_STAT_DS_OOR); //clear IR/OOR state
+ }
+#endif // HCF_SLEEP
+/*2*/ ifbp->IFB_IntOffCnt++;
+//! rc = 0;
+ i = IPW( HREG_INT_EN );
+ OPW( HREG_INT_EN, 0 );
+ if ( i & 0x1000 ) {
+ rc = HCF_ERR_NO_NIC;
+ } else {
+ if ( i & IPW( HREG_EV_STAT ) ) {
+ rc = HCF_INT_PENDING;
+ }
+ }
+ break;
+
+ case HCF_ACT_INT_FORCE_ON: // Enforce Enable Interrupt generation
+ ifbp->IFB_IntOffCnt = 0;
+ //Fall through in HCF_ACT_INT_ON
+
+ case HCF_ACT_INT_ON: // Enable Interrupt generation
+/*4*/ if ( ifbp->IFB_IntOffCnt-- == 0 && ifbp->IFB_CardStat == 0 ) {
+ //determine Interrupt Event mask
+#if HCF_DMA
+ if ( ifbp->IFB_CntlOpt & USE_DMA ) {
+ i = HREG_EV_INFO | HREG_EV_RDMAD | HREG_EV_TDMAD | HREG_EV_TX_EXT; //mask when DMA active
+ } else
+#endif // HCF_DMA
+ {
+ i = HREG_EV_INFO | HREG_EV_RX | HREG_EV_TX_EXT; //mask when DMA not active
+ if ( ifbp->IFB_RscInd == 0 ) {
+ i |= HREG_EV_ALLOC; //mask when no TxFID available
+ }
+ }
+#if HCF_SLEEP
+ if ( ( IPW(HREG_EV_STAT) & ( i | HREG_EV_SLEEP_REQ ) ) == HREG_EV_SLEEP_REQ ) {
+ // firmware indicates it would like to go into sleep modus
+ // only acknowledge this request if no other events that can cause an interrupt are pending
+ ifbp->IFB_IntOffCnt--; //becomes 0xFFFE
+ OPW( HREG_INT_EN, i | HREG_EV_TICK );
+ OPW( HREG_EV_ACK, HREG_EV_SLEEP_REQ | HREG_EV_TICK | HREG_EV_ACK_REG_READY );
+ } else
+#endif // HCF_SLEEP
+ {
+ OPW( HREG_INT_EN, i | HREG_EV_SLEEP_REQ );
+ }
+ }
+ break;
+#endif // HCF_INT_ON
+
+#if (HCF_SLEEP) & HCF_DDS
+ case HCF_ACT_SLEEP: // DDS Sleep request
+ hcf_cntl( ifbp, HCF_CNTL_DISABLE );
+ cmd_exe( ifbp, HCMD_SLEEP, 0 );
+ break;
+// case HCF_ACT_WAKEUP: // DDS Wakeup request
+// HCFASSERT( ifbp->IFB_IntOffCnt == 0xFFFE, ifbp->IFB_IntOffCnt )
+// ifbp->IFB_IntOffCnt++; // restore conventional I/F
+// OPW( HREG_IO, HREG_IO_WAKEUP_ASYNC );
+// MSF_WAIT(800); // MSF-defined function to wait n microseconds.
+// rc = hcf_action( ifbp, HCF_ACT_INT_OFF ); /*bogus, IFB_IntOffCnt == 0xFFFF, so if you carefully look
+// *at the #if HCF_DDS statements, HCF_ACT_INT_OFF is empty
+// *for DDS. "Much" better would be to merge the flows for
+// *DDS and DEEP_SLEEP
+// */
+// break;
+#endif // HCF_DDS
+
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ case HCF_ACT_CCX_ON: // enable CKIP
+ case HCF_ACT_CCX_OFF: // disable CKIP
+ ifbp->IFB_CKIPStat = action;
+ break;
+#endif // HCF_TYPE_CCX
+
+ case HCF_ACT_RX_ACK: //Receiver ACK
+/*6*/ if ( ifbp->IFB_RxFID ) {
+ DAWA_ACK( HREG_EV_RX );
+ }
+ ifbp->IFB_RxFID = ifbp->IFB_RxLen = 0;
+ break;
+
+/*8*/ case HCF_ACT_PRS_SCAN: // Hermes PRS Scan (F102)
+ OPW( HREG_PARAM_1, 0x3FFF );
+ //Fall through in HCF_ACT_TALLIES
+ case HCF_ACT_TALLIES: // Hermes Inquire Tallies (F100)
+#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
+ case HCF_ACT_SCAN: // Hermes Inquire Scan (F101)
+#endif // HCF_TYPE_HII5
+ /*!! the assumptions about numerical relationships between CFG_TALLIES etc and HCF_ACT_TALLIES etc
+ * are checked by #if statements just prior to this routine resulting in: err "maintenance" */
+ cmd_exe( ifbp, HCMD_INQUIRE, action - HCF_ACT_TALLIES + CFG_TALLIES );
+ break;
+
+ default:
+ HCFASSERT( DO_ASSERT, action )
+ break;
+ }
+ //! do not HCFASSERT( rc == HCF_SUCCESS, rc ) /* 30*/
+ HCFLOGEXIT( HCF_TRACE_ACTION )
+ return rc;
+} // hcf_action
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.MODULE int hcf_cntl( IFBP ifbp, hcf_16 cmd )
+*.PURPOSE Connect or disconnect a specific port to a specific network.
+*!! ;???????????????? continue needs more explanation
+* recovers by means of "continue" when the connect proces in CCX mode fails
+* Enables or disables data transmission and reception for the NIC.
+* Activates static NIC configuration for a specific port at connect.
+* Activates static configuration for all ports at enable.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* cmd 0x001F: Hermes command (disable, enable, connect, disconnect, continue)
+* HCF_CNTL_ENABLE Enable
+* HCF_CNTL_DISABLE Disable
+* HCF_CNTL_CONTINUE Continue
+* HCF_CNTL_CONNECT Connect
+* HCF_CNTL_DISCONNECT Disconnect
+* 0x0100: command qualifier (continue)
+* HCMD_RETRY retry flag
+* 0x0700: port number (connect/disconnect)
+* HCF_PORT_0 MAC Port 0
+* HCF_PORT_1 MAC Port 1
+* HCF_PORT_2 MAC Port 2
+* HCF_PORT_3 MAC Port 3
+* HCF_PORT_4 MAC Port 4
+* HCF_PORT_5 MAC Port 5
+* HCF_PORT_6 MAC Port 6
+*
+*.RETURNS
+* HCF_SUCCESS
+*!! via cmd_exe
+* HCF_ERR_NO_NIC
+* HCF_ERR_DEFUNCT_...
+* HCF_ERR_TIME_OUT
+*
+*.DESCRIPTION
+* The parameter cmd contains a number of subfields.
+* The actual value for cmd is created by logical or-ing the appropriate mnemonics for the subfields.
+* The field 0x001F contains the command code
+* - HCF_CNTL_ENABLE
+* - HCF_CNTL_DISABLE
+* - HCF_CNTL_CONNECT
+* - HCF_CNTL_DISCONNECT
+* - HCF_CNTL_CONTINUE
+*
+* For HCF_CNTL_CONTINUE, the field 0x0100 contains the retry flag HCMD_RETRY.
+* For HCF_CNTL_CONNECT and HCF_CNTL_DISCONNECT, the field 0x0700 contains the port number as HCF_PORT_#.
+* For Station as well as AccessPoint F/W, MAC Port 0 is the "normal" communication channel.
+* For AccessPoint F/W, MAC Port 1 through 6 control the WDS links.
+*
+* Note that despite the names HCF_CNTL_DISABLE and HCF_CNTL_ENABLE, hcf_cntl does not influence the NIC
+* Interrupts mode.
+*
+* The Connect is used by the MSF to bring a particular port in an inactive state as far as data transmission
+* and reception are concerned.
+* When a particular port is disconnected:
+* - the F/W disables the receiver for that port.
+* - the F/W ignores send commands for that port.
+* - all frames (Receive as well as pending Transmit) for that port on the NIC are discarded.
+*
+* When the NIC is disabled, above list applies to all ports, i.e. the result is like all ports are
+* disconnected.
+*
+* When a particular port is connected:
+* - the F/W effectuates the static configuration for that port.
+* - enables the receiver for that port.
+* - accepts send commands for that port.
+*
+* Enabling has the following effects:
+* - the F/W effectuates the static configuration for all ports.
+* The F/W only updates its static configuration at a transition from disabled to enabled or from
+* disconnected to connected.
+* In order to enforce the static configuration, the MSF must assure that such a transition takes place.
+* Due to such a disable/enable or disconnect/connect sequence, Rx/Tx frames may be lost, in other words,
+* configuration may impact communication.
+* - The DMA Engine (if applicable) is enabled.
+* Note that the Enable Function by itself only enables data transmission and reception, it
+* does not enable the Interrupt Generation mechanism. This is done by hcf_action.
+*
+* Disabling has the following effects:
+*!! ;?????is the following statement really true
+* - it acts as a disconnect on all ports.
+* - The DMA Engine (if applicable) is disabled.
+*
+* For impact of the disable command on the behavior of hcf_dma_tx/rx_get see the appropriate sections.
+*
+* Although the Enable/Disable and Connect/Disconnect are antonyms, there is no restriction on their sequencing,
+* in other words, they may be called multiple times in arbitrary sequence without being paired or balanced.
+* Each time one of these functions is called, the effects of the preceding calls cease.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - NIC interrupts are not disabled.
+* - A command other than Continue, Enable, Disable, Connect or Disconnect is given.
+* - An invalid combination of the subfields is given or a bit outside the subfields is given.
+* - any return code besides HCF_SUCCESS.
+* - reentrancy, may be caused by calling a hcf_function without adequate protection against NIC interrupts or
+* multi-threading
+*
+*.DIAGRAM
+* hcf_cntl takes successively the following actions:
+*2: If the HCF is in Defunct mode or incompatible with the Primary or Station Supplier in the Hermes,
+* hcf_cntl() returns immediately with HCF_ERR_NO_NIC;? as status.
+*8: when the port is disabled, the DMA engine needs to be de-activated, so the host can safely reclaim tx
+* packets from the tx descriptor chain.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_cntl( IFBP ifbp, hcf_16 cmd )
+{
+int rc = HCF_ERR_INCOMP_FW;
+#if HCF_ASSERT
+{ int x = cmd & HCMD_CMD_CODE;
+ if ( x == HCF_CNTL_CONTINUE ) x &= ~HCMD_RETRY;
+ else if ( (x == HCMD_DISABLE || x == HCMD_ENABLE) && ifbp->IFB_FWIdentity.comp_id == COMP_ID_FW_AP ) {
+ x &= ~HFS_TX_CNTL_PORT;
+ }
+ HCFASSERT( x==HCF_CNTL_ENABLE || x==HCF_CNTL_DISABLE || HCF_CNTL_CONTINUE ||
+ x==HCF_CNTL_CONNECT || x==HCF_CNTL_DISCONNECT, cmd )
+}
+#endif // HCF_ASSERT
+// #if (HCF_SLEEP) & HCF_DDS
+// HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFE, cmd )
+// #endif // HCF_DDS
+ HCFLOGENTRY( HCF_TRACE_CNTL, cmd )
+ if ( ifbp->IFB_CardStat == 0 ) { /*2*/
+/*6*/ rc = cmd_exe( ifbp, cmd, 0 );
+#if (HCF_SLEEP) & HCF_DDS
+ ifbp->IFB_TickCnt = 0; //start 2 second period (with 1 tick uncertanty)
+#endif // HCF_DDS
+ }
+#if HCF_DMA
+ //!rlav : note that this piece of code is always executed, regardless of the DEFUNCT bit in IFB_CardStat.
+ // The reason behind this is that the MSF should be able to get all its DMA resources back from the HCF,
+ // even if the hardware is disfunctional. Practical example under Windows : surprise removal.
+ if ( ifbp->IFB_CntlOpt & USE_DMA ) {
+ hcf_io io_port = ifbp->IFB_IOBase;
+ DESC_STRCT *p;
+ if ( cmd == HCF_CNTL_DISABLE || cmd == HCF_CNTL_ENABLE ) {
+ OUT_PORT_DWORD( (io_port + HREG_DMA_CTRL), DMA_CTRLSTAT_RESET); /*8*/
+ ifbp->IFB_CntlOpt &= ~DMA_ENABLED;
+ }
+ if ( cmd == HCF_CNTL_ENABLE ) {
+ OUT_PORT_DWORD( (io_port + HREG_DMA_CTRL), DMA_CTRLSTAT_GO);
+ /* ;? by rewriting hcf_dma_rx_put you can probably just call hcf_dma_rx_put( ifbp->IFB_FirstDesc[DMA_RX] )
+ * as additional beneficiary side effect, the SOP and EOP bits will also be cleared
+ */
+ ifbp->IFB_CntlOpt |= DMA_ENABLED;
+ HCFASSERT( NT_ASSERT, NEVER_TESTED )
+ // make the entire rx descriptor chain DMA-owned, so the DMA engine can (re-)use it.
+ if ( ( p = ifbp->IFB_FirstDesc[DMA_RX] ) != NULL ) { //;? Think this over again in the light of the new chaining strategy
+ if ( 1 ) { //begin alternative
+ HCFASSERT( NT_ASSERT, NEVER_TESTED )
+ put_frame_lst( ifbp, ifbp->IFB_FirstDesc[DMA_RX], DMA_RX );
+ if ( ifbp->IFB_FirstDesc[DMA_RX] ) {
+ put_frame_lst( ifbp, ifbp->IFB_FirstDesc[DMA_RX]->next_desc_addr, DMA_RX );
+ }
+ } else {
+ while ( p ) {
+ //p->buf_cntl.cntl_stat |= DESC_DMA_OWNED;
+ p->BUF_CNT |= DESC_DMA_OWNED;
+ p = p->next_desc_addr;
+ }
+ // a rx chain is available so hand it over to the DMA engine
+ p = ifbp->IFB_FirstDesc[DMA_RX];
+ OUT_PORT_DWORD( (io_port + HREG_RXDMA_PTR32), p->desc_phys_addr);
+ } //end alternative
+ }
+ }
+ }
+#endif // HCF_DMA
+ HCFASSERT( rc == HCF_SUCCESS, rc )
+ HCFLOGEXIT( HCF_TRACE_CNTL )
+ return rc;
+} // hcf_cntl
+
+
+/************************************************************************************************************
+*
+*.MODULE int hcf_connect( IFBP ifbp, hcf_io io_base )
+*.PURPOSE Grants access right for the HCF to the IFB.
+* Initializes Card and HCF housekeeping.
+*
+*.ARGUMENTS
+* ifbp (near) address of the Interface Block
+* io_base non-USB: I/O Base address of the NIC (connect)
+* non-USB: HCF_DISCONNECT
+* USB: HCF_CONNECT, HCF_DISCONNECT
+*
+*.RETURNS
+* HCF_SUCCESS
+* HCF_ERR_INCOMP_PRI
+* HCF_ERR_INCOMP_FW
+* HCF_ERR_DEFUNCT_CMD_SEQ
+*!! HCF_ERR_NO_NIC really returned ;?
+* HCF_ERR_NO_NIC
+* HCF_ERR_TIME_OUT
+*
+* MSF-accessible fields of Result Block:
+* IFB_IOBase entry parameter io_base
+* IFB_IORange HREG_IO_RANGE (0x40/0x80)
+* IFB_Version version of the IFB layout
+* IFB_FWIdentity CFG_FW_IDENTITY_STRCT, specifies the identity of the
+* "running" F/W, i.e. tertiary F/W under normal conditions
+* IFB_FWSup CFG_SUP_RANGE_STRCT, specifies the supplier range of
+* the "running" F/W, i.e. tertiary F/W under normal conditions
+* IFB_HSISup CFG_SUP_RANGE_STRCT, specifies the HW/SW I/F range of the NIC
+* IFB_PRIIdentity CFG_PRI_IDENTITY_STRCT, specifies the Identity of the Primary F/W
+* IFB_PRISup CFG_SUP_RANGE_STRCT, specifies the supplier range of the Primary F/W
+* all other all MSF accessible fields, which are not specified above, are zero-filled
+*
+*.CONDITIONS
+* It is the responsibility of the MSF to assure the correctness of the I/O Base address.
+*
+* Note: hcf_connect defaults to NIC interrupt disabled mode, i.e. as if hcf_action( HCF_ACT_INT_OFF )
+* was called.
+*
+*.DESCRIPTION
+* hcf_connect passes the MSF-defined location of the IFB to the HCF and grants or revokes access right for the
+* HCF to the IFB. Revoking is done by specifying HCF_DISCONNECT rather than an I/O address for the parameter
+* io_base. Every call of hcf_connect in "connect" mode, must eventually be followed by a call of hcf_connect
+* in "disconnect" mode. Clalling hcf_connect in "connect"/"disconnect" mode can not be nested.
+* The IFB address must be used as a handle with all subsequent HCF-function calls and the HCF uses the IFB
+* address as a handle when it performs a call(back) of an MSF-function (i.e. msf_assert).
+*
+* Note that not only the MSF accessible fields are cleared, but also all internal housekeeping
+* information is re-initialized.
+* This implies that all settings which are done via hcf_action and hcf_put_info (e.g. CFG_MB_ASSERT, CFG_REG_MB,
+* CFG_REG_INFO_LOG) must be done again. The only field which is not cleared, is IFB_MSFSup.
+*
+* If HCF_INT_ON is selected as compile option, NIC interrupts are disabled.
+*
+* Assert fails if
+* - ifbp is not properly aligned ( ref chapter HCF_ALIGN in 4.1.1)
+* - I/O Base Address is not a multiple of 0x40 (note: 0x0000 is explicitly allowed).
+*
+*.DIAGRAM
+*
+*0: Throughout hcf_connect you need to distinguish the connect from the disconnect case, which requires
+* some attention about what to use as "I/O" address when for which purpose.
+*2:
+*2a: Reset H-II by toggling reset bit in IO-register on and off.
+* The HCF_TYPE_PRELOADED caters for the DOS environment where H-II is loaded by a separate program to
+* overcome the 64k size limit posed on DOS drivers.
+* The macro OPW is not yet useable because the IFB_IOBase field is not set.
+* Note 1: hopefully the clearing and initializing of the IFB (see below) acts as a delay which meets the
+* specification for S/W reset
+* Note 2: it turns out that on some H/W constellations, the clock to access the EEProm is not lowered
+* to an appropriate frequency by HREG_IO_SRESET. By giving an HCMD_INI first, this problem is worked around.
+*2b: Experimentally it is determined over a wide range of F/W versions that waiting for the for Cmd bit in
+* Ev register gives a workable strategy. The available documentation does not give much clues.
+*4: clear and initialize the IFB
+* The HCF house keeping info is designed such that zero is the appropriate initial value for as much as
+* feasible IFB-items.
+* The readable fields mentioned in the description section and some HCF specific fields are given their
+* actual value.
+* IFB_TickIni is initialized at best guess before calibration
+* Hcf_connect defaults to "no interrupt generation" (implicitly achieved by the zero-filling).
+*6: Register compile-time linked MSF Routine and set default filter level
+* cast needed to get around the "near" problem in DOS COM model
+* er C2446: no conversion from void (__near __cdecl *)(unsigned char __far *,unsigned int,unsigned short,int)
+* to void (__far __cdecl *)(unsigned char __far *,unsigned int,unsigned short,int)
+*8: If a command is apparently still active (as indicated by the Busy bit in Cmd register) this may indicate a
+* blocked cmd pipe line. To unblock the following actions are done:
+* - Ack everything
+* - Wait for Busy bit drop in Cmd register
+* - Wait for Cmd bit raise in Ev register
+* The two waits are combined in a single HCF_WAIT_WHILE to optimize memory size. If either of these waits
+* fail (prot_cnt becomes 0), then something is serious wrong. Rather than PANICK, the assumption is that the
+* next cmd_exe will fail, causing the HCF to go into DEFUNCT mode
+*10: Ack everything to unblock a (possibly blocked) cmd pipe line
+* Note 1: it is very likely that an Alloc event is pending and very well possible that a (Send) Cmd event is
+* pending on non-initial calls
+* Note 2: it is assumed that this strategy takes away the need to ack every conceivable event after an
+* Hermes Initialize
+*12: Only H-II NEEDS the Hermes Initialize command. Due to the different semantics for H-I and H-II
+* Initialize command, init() does not (and can not, since it is called e.g. after a download) execute the
+* Hermes Initialize command. Executing the Hermes Initialize command for H-I would not harm but not do
+* anything useful either, so it is skipped.
+* The return status of cmd_exe is ignored. It is assumed that if cmd_exe fails, init fails too
+*14: use io_base as a flag to merge hcf_connect and hcf_disconnect into 1 routine
+* the call to init and its subsequent call of cmd_exe will return HCF_ERR_NO_NIC if appropriate. This status
+* is (badly) needed by some legacy combination of NT4 and card services which do not yield an I/O address in
+* time.
+*
+*.NOTICE
+* On platforms where the NULL-pointer is not a bit-pattern of all zeros, the zero-filling of the IFB results
+* in an incorrect initialization of pointers.
+* The implementation of the MailBox manipulation in put_mb_info protects against the absence of a MailBox
+* based on IFB_MBSize, IFB_MBWp and ifbp->IFB_MBRp. This has ramifications on the initialization of the
+* MailBox via hcf_put_info with the CFG_REG_MB type, but it prevents dependency on the "NULL-"ness of
+* IFB_MBp.
+*
+*.NOTICE
+* There are a number of problems when asserting and logging hcf_connect, e.g.
+* - Asserting on re-entrancy of hcf_connect by means of
+* "HCFASSERT( (ifbp->IFB_AssertTrace & HCF_ASSERT_CONNECT) == 0, 0 )" is not useful because IFB contents
+* are undefined
+* - Asserting before the IFB is cleared will cause mdd_assert() to interpret the garbage in IFB_AssertRtn
+* as a routine address
+* Therefore HCFTRACE nor HCFLOGENTRY is called by hcf_connect.
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_connect( IFBP ifbp, hcf_io io_base )
+{
+int rc = HCF_SUCCESS;
+hcf_io io_addr;
+hcf_32 prot_cnt;
+hcf_8 *q;
+LTV_STRCT x;
+#if HCF_ASSERT
+ hcf_16 xa = ifbp->IFB_FWIdentity.typ;
+ /* is assumed to cause an assert later on if hcf_connect is called without intervening hcf_disconnect.
+ * xa == CFG_FW_IDENTITY in subsequent calls without preceding hcf_disconnect,
+ * xa == 0 in subsequent calls with preceding hcf_disconnect,
+ * xa == "garbage" (any value except CFG_FW_IDENTITY is acceptable) in the initial call
+ */
+#endif // HCF_ASSERT
+
+ if ( io_base == HCF_DISCONNECT ) { //disconnect
+ io_addr = ifbp->IFB_IOBase;
+ OPW( HREG_INT_EN, 0 ); //;?workaround against dying F/W on subsequent hcf_connect calls
+ } else { //connect /* 0 */
+ io_addr = io_base;
+ }
+
+#if 0 //;? if a subsequent hcf_connect is preceeded by an hcf_disconnect the wakeup is not needed !!
+#if HCF_SLEEP
+ OUT_PORT_WORD( .....+HREG_IO, HREG_IO_WAKEUP_ASYNC ); //OPW not yet useable
+ MSF_WAIT(800); // MSF-defined function to wait n microseconds.
+ note that MSF_WAIT uses not yet defined!!!! IFB_IOBase and IFB_TickIni (via PROT_CNT_INI)
+ so be carefull if this code is restored
+#endif // HCF_SLEEP
+#endif // 0
+
+#if ( (HCF_TYPE) & HCF_TYPE_PRELOADED ) == 0 //switch clock back for SEEPROM access !!!
+ OUT_PORT_WORD( io_addr + HREG_CMD, HCMD_INI ); //OPW not yet useable
+ prot_cnt = INI_TICK_INI;
+ HCF_WAIT_WHILE( (IN_PORT_WORD( io_addr + HREG_EV_STAT) & HREG_EV_CMD) == 0 );
+ OUT_PORT_WORD( (io_addr + HREG_IO), HREG_IO_SRESET ); //OPW not yet useable /* 2a*/
+#endif // HCF_TYPE_PRELOADED
+ for ( q = (hcf_8*)(&ifbp->IFB_Magic); q > (hcf_8*)ifbp; *--q = 0 ) /*NOP*/; /* 4 */
+ ifbp->IFB_Magic = HCF_MAGIC;
+ ifbp->IFB_Version = IFB_VERSION;
+#if defined MSF_COMPONENT_ID //a new IFB demonstrates how dirty the solution is
+ xxxx[xxxx_PRI_IDENTITY_OFFSET] = NULL; //IFB_PRIIdentity placeholder 0xFD02
+ xxxx[xxxx_PRI_IDENTITY_OFFSET+1] = NULL; //IFB_PRISup placeholder 0xFD03
+#endif // MSF_COMPONENT_ID
+#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
+ ifbp->IFB_TallyLen = 1 + 2 * (HCF_NIC_TAL_CNT + HCF_HCF_TAL_CNT); //convert # of Tallies to L value for LTV
+ ifbp->IFB_TallyTyp = CFG_TALLIES; //IFB_TallyTyp: set T value
+#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
+ ifbp->IFB_IOBase = io_addr; //set IO_Base asap, so asserts via HREG_SW_2 don't harm
+ ifbp->IFB_IORange = HREG_IO_RANGE;
+ ifbp->IFB_CntlOpt = USE_16BIT;
+#if HCF_ASSERT
+ assert_ifbp = ifbp;
+ ifbp->IFB_AssertLvl = 1;
+#if (HCF_ASSERT) & HCF_ASSERT_LNK_MSF_RTN
+ if ( io_base != HCF_DISCONNECT ) {
+ ifbp->IFB_AssertRtn = (MSF_ASSERT_RTNP)msf_assert; /* 6 */
+ }
+#endif // HCF_ASSERT_LNK_MSF_RTN
+#if (HCF_ASSERT) & HCF_ASSERT_MB //build the structure to pass the assert info to hcf_put_info
+ ifbp->IFB_AssertStrct.len = sizeof(ifbp->IFB_AssertStrct)/sizeof(hcf_16) - 1;
+ ifbp->IFB_AssertStrct.typ = CFG_MB_INFO;
+ ifbp->IFB_AssertStrct.base_typ = CFG_MB_ASSERT;
+ ifbp->IFB_AssertStrct.frag_cnt = 1;
+ ifbp->IFB_AssertStrct.frag_buf[0].frag_len =
+ ( offsetof(IFB_STRCT, IFB_AssertLvl) - offsetof(IFB_STRCT, IFB_AssertLine) ) / sizeof(hcf_16);
+ ifbp->IFB_AssertStrct.frag_buf[0].frag_addr = &ifbp->IFB_AssertLine;
+#endif // HCF_ASSERT_MB
+#endif // HCF_ASSERT
+ IF_PROT_TIME( prot_cnt = ifbp->IFB_TickIni = INI_TICK_INI; )
+#if ( (HCF_TYPE) & HCF_TYPE_PRELOADED ) == 0
+ //!! No asserts before Reset-bit in HREG_IO is cleared
+ OPW( HREG_IO, 0x0000 ); //OPW useable /* 2b*/
+ HCF_WAIT_WHILE( (IPW( HREG_EV_STAT) & HREG_EV_CMD) == 0 );
+ IF_PROT_TIME( HCFASSERT( prot_cnt, IPW( HREG_EV_STAT) ) )
+ IF_PROT_TIME( if ( prot_cnt ) prot_cnt = ifbp->IFB_TickIni; )
+#endif // HCF_TYPE_PRELOADED
+ //!! No asserts before Reset-bit in HREG_IO is cleared
+ HCFASSERT( DO_ASSERT, MERGE_2( HCF_ASSERT, 0xCAF0 ) ) //just to proof that the complete assert machinery is working
+ HCFASSERT( xa != CFG_FW_IDENTITY, 0 ) // assert if hcf_connect is called without intervening hcf_disconnect.
+ HCFASSERT( ((hcf_32)(void*)ifbp & (HCF_ALIGN-1) ) == 0, (hcf_32)(void*)ifbp )
+ HCFASSERT( (io_addr & 0x003F) == 0, io_addr )
+ //if Busy bit in Cmd register
+ if (IPW( HREG_CMD ) & HCMD_BUSY ) { /* 8 */
+ //. Ack all to unblock a (possibly) blocked cmd pipe line
+ OPW( HREG_EV_ACK, ~HREG_EV_SLEEP_REQ );
+ //. Wait for Busy bit drop in Cmd register
+ //. Wait for Cmd bit raise in Ev register
+ HCF_WAIT_WHILE( ( IPW( HREG_CMD ) & HCMD_BUSY ) && (IPW( HREG_EV_STAT) & HREG_EV_CMD) == 0 );
+ IF_PROT_TIME( HCFASSERT( prot_cnt, IPW( HREG_EV_STAT) ) ) /* if prot_cnt == 0, cmd_exe will fail, causing DEFUNCT */
+ }
+ OPW( HREG_EV_ACK, ~HREG_EV_SLEEP_REQ );
+#if ( (HCF_TYPE) & HCF_TYPE_PRELOADED ) == 0 /*12*/
+ (void)cmd_exe( ifbp, HCMD_INI, 0 );
+#endif // HCF_TYPE_PRELOADED
+if ( io_base != HCF_DISCONNECT ) {
+ rc = init( ifbp ); /*14*/
+ if ( rc == HCF_SUCCESS ) {
+ x.len = 2;
+ x.typ = CFG_NIC_BUS_TYPE;
+ (void)hcf_get_info( ifbp, &x );
+ ifbp->IFB_BusType = x.val[0];
+ //CFG_NIC_BUS_TYPE not supported -> default 32 bits/DMA, MSF has to overrule via CFG_CNTL_OPT
+ if ( x.len == 0 || x.val[0] == 0x0002 || x.val[0] == 0x0003 ) {
+#if (HCF_IO) & HCF_IO_32BITS
+ ifbp->IFB_CntlOpt &= ~USE_16BIT; //reset USE_16BIT
+#endif // HCF_IO_32BITS
+#if HCF_DMA
+ ifbp->IFB_CntlOpt |= USE_DMA; //SET DMA
+#else
+ ifbp->IFB_IORange = 0x40 /*i.s.o. HREG_IO_RANGE*/;
+#endif // HCF_DMA
+ }
+ }
+ } else HCFASSERT( ( ifbp->IFB_Magic ^= HCF_MAGIC ) == 0, ifbp->IFB_Magic ) /*NOP*/;
+ /* of above HCFASSERT only the side effect is needed, NOP in case HCFASSERT is dummy */
+ ifbp->IFB_IOBase = io_base; /* 0*/
+ return rc;
+} // hcf_connect
+
+#if HCF_DMA
+/************************************************************************************************************
+* Function get_frame_lst
+* - resolve the "last host-owned descriptor" problems when a descriptor list is reclaimed by the MSF.
+*
+* The FrameList to be reclaimed as well as the DescriptorList always start in IFB_FirstDesc[tx_rx_flag]
+* and this is always the "current" DELWA Descriptor.
+*
+* If a FrameList is available, the last descriptor of the FrameList to turned into a new DELWA Descriptor:
+* - a copy is made from the information in the last descriptor of the FrameList into the current
+* DELWA Descriptor
+* - the remainder of the DescriptorList is detached from the copy by setting the next_desc_addr at NULL
+* - the DMA control bits of the copy are cleared to do not confuse the MSF
+* - the copy of the last descriptor (i.e. the "old" DELWA Descriptor) is chained to the prev Descriptor
+* of the FrameList, thus replacing the original last Descriptor of the FrameList.
+* - IFB_FirstDesc is changed to the address of that replaced (original) last descriptor of the FrameList,
+* i.e. the "new" DELWA Descriptor.
+*
+* This function makes a copy of that last host-owned descriptor, so the MSF will get a copy of the descriptor.
+* On top of that, it adjusts DMA related fields in the IFB structure.
+ // perform a copying-scheme to circumvent the 'last host owned descriptor cannot be reclaimed' limitation imposed by H2.5's DMA hardware design
+ // a 'reclaim descriptor' should be available in the HCF:
+*
+* Returns: address of the first descriptor of the FrameList
+*
+ 8: Be careful once you start re-ordering the steps in the copy process, that it still works for cases
+* of FrameLists of 1, 2 and more than 2 descriptors
+*
+* Input parameters:
+* tx_rx_flag : specifies 'transmit' or 'receive' descriptor.
+*
+************************************************************************************************************/
+HCF_STATIC DESC_STRCT*
+get_frame_lst( IFBP ifbp, int tx_rx_flag )
+{
+
+DESC_STRCT *head = ifbp->IFB_FirstDesc[tx_rx_flag];
+DESC_STRCT *copy, *p, *prev;
+
+ HCFASSERT( tx_rx_flag == DMA_RX || tx_rx_flag == DMA_TX, tx_rx_flag )
+ //if FrameList
+ if ( head ) {
+ //. search for last descriptor of first FrameList
+ p = prev = head;
+ while ( ( p->BUF_SIZE & DESC_EOP ) == 0 && p->next_desc_addr ) {
+ if ( ( ifbp->IFB_CntlOpt & DMA_ENABLED ) == 0 ) { //clear control bits when disabled
+ p->BUF_CNT &= DESC_CNT_MASK;
+ }
+ prev = p;
+ p = p->next_desc_addr;
+ }
+ //. if DMA enabled
+ if ( ifbp->IFB_CntlOpt & DMA_ENABLED ) {
+ //. . if last descriptor of FrameList is DMA owned
+ //. . or if FrameList is single (DELWA) Descriptor
+ if ( p->BUF_CNT & DESC_DMA_OWNED || head->next_desc_addr == NULL ) {
+ //. . . refuse to return FrameList to caller
+ head = NULL;
+ }
+ }
+ }
+ //if returnable FrameList found
+ if ( head ) {
+ //. if FrameList is single (DELWA) Descriptor (implies DMA disabled)
+ if ( head->next_desc_addr == NULL ) {
+ //. . clear DescriptorList
+ /*;?ifbp->IFB_LastDesc[tx_rx_flag] =*/ ifbp->IFB_FirstDesc[tx_rx_flag] = NULL;
+ //. else
+ } else {
+ //. . strip hardware-related bits from last descriptor
+ //. . remove DELWA Descriptor from head of DescriptorList
+ copy = head;
+ head = head->next_desc_addr;
+ //. . exchange first (Confined) and last (possibly imprisoned) Descriptor
+ copy->buf_phys_addr = p->buf_phys_addr;
+ copy->buf_addr = p->buf_addr;
+ copy->BUF_SIZE = p->BUF_SIZE &= DESC_CNT_MASK; //get rid of DESC_EOP and possibly DESC_SOP
+ copy->BUF_CNT = p->BUF_CNT &= DESC_CNT_MASK; //get rid of DESC_DMA_OWNED
+#if (HCF_EXT) & HCF_DESC_STRCT_EXT
+ copy->DESC_MSFSup = p->DESC_MSFSup;
+#endif // HCF_DESC_STRCT_EXT
+ //. . turn into a DELWA Descriptor
+ p->buf_addr = NULL;
+ //. . chain copy to prev /* 8*/
+ prev->next_desc_addr = copy;
+ //. . detach remainder of the DescriptorList from FrameList
+ copy->next_desc_addr = NULL;
+ copy->next_desc_phys_addr = 0xDEAD0000; //! just to be nice, not really needed
+ //. . save the new start (i.e. DELWA Descriptor) in IFB_FirstDesc
+ ifbp->IFB_FirstDesc[tx_rx_flag] = p;
+ }
+ //. strip DESC_SOP from first descriptor
+ head->BUF_SIZE &= DESC_CNT_MASK;
+ //head->BUF_CNT &= DESC_CNT_MASK; get rid of DESC_DMA_OWNED
+ head->next_desc_phys_addr = 0xDEAD0000; //! just to be nice, not really needed
+ }
+ //return the just detached FrameList (if any)
+ return head;
+} // get_frame_lst
+
+
+/************************************************************************************************************
+* Function put_frame_lst
+*
+* This function
+*
+* Returns: address of the first descriptor of the FrameList
+*
+* Input parameters:
+* tx_rx_flag : specifies 'transmit' or 'receive' descriptor.
+*
+* The following list should be kept in sync with hcf_dma_tx/rx_put, in order to get them in the WCI-spec !!!!
+* Assert fails if
+* - DMA is not enabled
+* - descriptor list is NULL
+* - a descriptor in the descriptor list is not double word aligned
+* - a count of size field of a descriptor contains control bits, i.e. bits in the high order nibble.
+* - the DELWA descriptor is not a "singleton" DescriptorList.
+* - the DELWA descriptor is not the first Descriptor supplied
+* - a non_DMA descriptor is supplied before the DELWA Descriptor is supplied
+* - Possibly more checks could be added !!!!!!!!!!!!!
+
+*.NOTICE
+* The asserts marked with *sc* are really sanity checks for the HCF, they can (supposedly) not be influenced
+* by incorrect MSF behavior
+
+ // The MSF is required to supply the HCF with a single descriptor for MSF tx reclaim purposes.
+ // This 'reclaim descriptor' can be recognized by the fact that its buf_addr field is zero.
+ *********************************************************************************************
+ * Although not required from a hardware perspective:
+ * - make each descriptor in this rx-chain DMA-owned.
+ * - Also set the count to zero. EOP and SOP bits are also cleared.
+ *********************************************************************************************/
+HCF_STATIC void
+put_frame_lst( IFBP ifbp, DESC_STRCT *descp, int tx_rx_flag )
+{
+ DESC_STRCT *p = descp;
+ hcf_16 port;
+
+ HCFASSERT( ifbp->IFB_CntlOpt & USE_DMA, ifbp->IFB_CntlOpt) //only hcf_dma_tx_put must also be DMA_ENABLED
+ HCFASSERT( tx_rx_flag == DMA_RX || tx_rx_flag == DMA_TX, tx_rx_flag )
+ HCFASSERT( p , 0 )
+
+ while ( p ) {
+ HCFASSERT( ((hcf_32)p & 3 ) == 0, (hcf_32)p )
+ HCFASSERT( (p->BUF_CNT & ~DESC_CNT_MASK) == 0, p->BUF_CNT )
+ HCFASSERT( (p->BUF_SIZE & ~DESC_CNT_MASK) == 0, p->BUF_SIZE )
+ p->BUF_SIZE &= DESC_CNT_MASK; //!!this SHOULD be superfluous in case of correct MSF
+ p->BUF_CNT &= tx_rx_flag == DMA_RX ? 0 : DESC_CNT_MASK; //!!this SHOULD be superfluous in case of correct MSF
+ p->BUF_CNT |= DESC_DMA_OWNED;
+ if ( p->next_desc_addr ) {
+// HCFASSERT( p->buf_addr && p->buf_phys_addr && p->BUF_SIZE && +/- p->BUF_SIZE, ... )
+ HCFASSERT( p->next_desc_addr->desc_phys_addr, (hcf_32)p->next_desc_addr )
+ p->next_desc_phys_addr = p->next_desc_addr->desc_phys_addr;
+ } else { //
+ p->next_desc_phys_addr = 0;
+ if ( p->buf_addr == NULL ) { // DELWA Descriptor
+ HCFASSERT( descp == p, (hcf_32)descp ) //singleton DescriptorList
+ HCFASSERT( ifbp->IFB_FirstDesc[tx_rx_flag] == NULL, (hcf_32)ifbp->IFB_FirstDesc[tx_rx_flag])
+ HCFASSERT( ifbp->IFB_LastDesc[tx_rx_flag] == NULL, (hcf_32)ifbp->IFB_LastDesc[tx_rx_flag])
+ descp->BUF_CNT = 0; //&= ~DESC_DMA_OWNED;
+ ifbp->IFB_FirstDesc[tx_rx_flag] = descp;
+// part of alternative ifbp->IFB_LastDesc[tx_rx_flag] = ifbp->IFB_FirstDesc[tx_rx_flag] = descp;
+ // if "recycling" a FrameList
+ // (e.g. called from hcf_cntl( HCF_CNTL_ENABLE )
+ // . prepare for activation DMA controller
+// part of alternative descp = descp->next_desc_addr;
+ } else { //a "real" FrameList, hand it over to the DMA engine
+ HCFASSERT( ifbp->IFB_FirstDesc[tx_rx_flag], (hcf_32)descp )
+ HCFASSERT( ifbp->IFB_LastDesc[tx_rx_flag], (hcf_32)descp )
+ HCFASSERT( ifbp->IFB_LastDesc[tx_rx_flag]->next_desc_addr == NULL,
+ (hcf_32)ifbp->IFB_LastDesc[tx_rx_flag]->next_desc_addr)
+// p->buf_cntl.cntl_stat |= DESC_DMA_OWNED;
+ ifbp->IFB_LastDesc[tx_rx_flag]->next_desc_addr = descp;
+ ifbp->IFB_LastDesc[tx_rx_flag]->next_desc_phys_addr = descp->desc_phys_addr;
+ port = HREG_RXDMA_PTR32;
+ if ( tx_rx_flag ) {
+ p->BUF_SIZE |= DESC_EOP; // p points at the last descriptor in the caller-supplied descriptor chain
+ descp->BUF_SIZE |= DESC_SOP;
+ port = HREG_TXDMA_PTR32;
+ }
+ OUT_PORT_DWORD( (ifbp->IFB_IOBase + port), descp->desc_phys_addr );
+ }
+ ifbp->IFB_LastDesc[tx_rx_flag] = p;
+ }
+ p = p->next_desc_addr;
+ }
+} // put_frame_lst
+
+
+/************************************************************************************************************
+*
+*.MODULE DESC_STRCT* hcf_dma_rx_get( IFBP ifbp )
+*.PURPOSE decapsulate a message and provides that message to the MSF.
+* reclaim all descriptors in the rx descriptor chain.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* pointer to a FrameList
+*
+*.DESCRIPTION
+* hcf_dma_rx_get is intended to return a received frame when such a frame is deposited in Host memory by the
+* DMA engine. In addition hcf_dma_rx_get can be used to reclaim all descriptors in the rx descriptor chain
+* when the DMA Engine is disabled, e.g. as part of a driver unloading strategy.
+* hcf_dma_rx_get must be called repeatedly by the MSF when hcf_service_nic signals availability of a rx frame
+* through the HREG_EV_RDMAD flag of IFB_DmaPackets. The calling must stop when a NULL pointer is returned, at
+* which time the HREG_EV_RDMAD flag is also cleared by the HCF to arm the mechanism for the next frame
+* reception.
+* Regardless whether the DMA Engine is currently enabled (as controlled via hcf_cntl), if the DMA controller
+* deposited an Rx-frame in the Rx-DescriptorList, this frame is detached from the Rx-DescriptorList,
+* transformed into a FrameList (i.e. updating the housekeeping fields in the descriptors) and returned to the
+* caller.
+* If no such Rx-frame is available in the Rx-DescriptorList, the behavior of hcf_dma_rx_get depends on the
+* status of the DMA Engine.
+* If the DMA Engine is enabled, a NULL pointer is returned.
+* If the DMA Engine is disabled, the following strategy is used:
+* - the complete Rx-DescriptorList is returned. The DELWA Descriptor is not part of the Rx-DescriptorList.
+* - If there is no Rx-DescriptorList, the DELWA Descriptor is returned.
+* - If there is no DELWA Descriptor, a NULL pointer is returned.
+*
+* If the MSF performs an disable/enable sequence without exhausting the Rx-DescriptorList as described above,
+* the enable command will reset all house keeping information, i.e. already received but not yet by the MSF
+* retrieved frames are lost and the next frame will be received starting with the oldest descriptor.
+*
+* The HCF can be used in 2 fashions: with and without decapsulation for data transfer.
+* This is controlled at compile time by the HCF_ENC bit of the HCF_ENCAP system constant.
+* If appropriate, decapsulation is done by moving some data inside the buffers and updating the descriptors
+* accordingly.
+*!! ;?????where did I describe why a simple manipulation with the count values does not suffice?
+*
+*.DIAGRAM
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+
+DESC_STRCT*
+hcf_dma_rx_get (IFBP ifbp)
+{
+DESC_STRCT *descp; // pointer to start of FrameList
+
+ descp = get_frame_lst( ifbp, DMA_RX );
+ if ( descp && descp->buf_addr ) //!be aware of the missing curly bracket
+
+ //skip decapsulation at confined descriptor
+#if (HCF_ENCAP) == HCF_ENC
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ if ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF )
+#endif // HCF_TYPE_CCX
+ {
+int i;
+DESC_STRCT *p = descp->next_desc_addr; //pointer to 2nd descriptor of frame
+ HCFASSERT(p, 0)
+ // The 2nd descriptor contains (maybe) a SNAP header plus part or whole of the payload.
+ //determine decapsulation sub-flag in RxFS
+ i = *(wci_recordp)&descp->buf_addr[HFS_STAT] & ( HFS_STAT_MSG_TYPE | HFS_STAT_ERR );
+ if ( i == HFS_STAT_TUNNEL ||
+ ( i == HFS_STAT_1042 && hcf_encap( (wci_bufp)&p->buf_addr[HCF_DASA_SIZE] ) != ENC_TUNNEL )) {
+ // The 2nd descriptor contains a SNAP header plus part or whole of the payload.
+ HCFASSERT( p->BUF_CNT == (p->buf_addr[5] + (p->buf_addr[4]<<8) + 2*6 + 2 - 8), p->BUF_CNT )
+ // perform decapsulation
+ HCFASSERT(p->BUF_SIZE >=8, p->BUF_SIZE)
+ // move SA[2:5] in the second buffer to replace part of the SNAP header
+ for ( i=3; i >= 0; i--) p->buf_addr[i+8] = p->buf_addr[i];
+ // copy DA[0:5], SA[0:1] from first buffer to second buffer
+ for ( i=0; i<8; i++) p->buf_addr[i] = descp->buf_addr[HFS_ADDR_DEST + i];
+ // make first buffer shorter in count
+ descp->BUF_CNT = HFS_ADDR_DEST;
+ }
+ }
+#endif // HCF_ENC
+ if ( descp == NULL ) ifbp->IFB_DmaPackets &= (hcf_16)~HREG_EV_RDMAD; //;?could be integrated into get_frame_lst
+ HCFLOGEXIT( HCF_TRACE_DMA_RX_GET )
+ return descp;
+} // hcf_dma_rx_get
+
+
+/************************************************************************************************************
+*
+*.MODULE void hcf_dma_rx_put( IFBP ifbp, DESC_STRCT *descp )
+*.PURPOSE supply buffers for receive purposes.
+* supply the Rx-DELWA descriptor.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* descp address of a DescriptorList
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* This function is called by the MSF to supply the HCF with new/more buffers for receive purposes.
+* The HCF can be used in 2 fashions: with and without encapsulation for data transfer.
+* This is controlled at compile time by the HCF_ENC bit of the HCF_ENCAP system constant.
+* As a consequence, some additional constaints apply to the number of descriptor and the buffers associated
+* with the first 2 descriptors. Independent of the encapsulation feature, the COUNT fields are ignored.
+* A special case is the supplying of the DELWA descriptor, which must be supplied as the first descriptor.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - NIC interrupts are not disabled while required by parameter action.
+* - in case decapsulation by the HCF is selected:
+* - The first databuffer does not have the exact size corresponding with the RxFS up to the 802.3 DestAddr
+* field (== 29 words).
+* - The FrameList does not consists of at least 2 Descriptors.
+* - The second databuffer does not have the minimum size of 8 bytes.
+*!! The 2nd part of the list of asserts should be kept in sync with put_frame_lst, in order to get
+*!! them in the WCI-spec !!!!
+* - DMA is not enabled
+* - descriptor list is NULL
+* - a descriptor in the descriptor list is not double word aligned
+* - a count of size field of a descriptor contains control bits, i.e. bits in the high order nibble.
+* - the DELWA descriptor is not a "singleton" DescriptorList.
+* - the DELWA descriptor is not the first Descriptor supplied
+* - a non_DMA descriptor is supplied before the DELWA Descriptor is supplied
+*!! - Possibly more checks could be added !!!!!!!!!!!!!
+*
+*.DIAGRAM
+*
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+void
+hcf_dma_rx_put( IFBP ifbp, DESC_STRCT *descp )
+{
+
+ HCFLOGENTRY( HCF_TRACE_DMA_RX_PUT, 0xDA01 )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+
+ put_frame_lst( ifbp, descp, DMA_RX );
+#if HCF_ASSERT && (HCF_ENCAP) == HCF_ENC
+ if ( descp->buf_addr ) {
+ HCFASSERT( descp->BUF_SIZE == HCF_DMA_RX_BUF1_SIZE, descp->BUF_SIZE )
+ HCFASSERT( descp->next_desc_addr, 0 ) // first descriptor should be followed by another descriptor
+ // The second DB is for SNAP and payload purposes. It should be a minimum of 12 bytes in size.
+ HCFASSERT( descp->next_desc_addr->BUF_SIZE >= 12, descp->next_desc_addr->BUF_SIZE )
+ }
+#endif // HCFASSERT / HCF_ENC
+ HCFLOGEXIT( HCF_TRACE_DMA_RX_PUT )
+} // hcf_dma_rx_put
+
+
+/************************************************************************************************************
+*
+*.MODULE DESC_STRCT* hcf_dma_tx_get( IFBP ifbp )
+*.PURPOSE DMA mode: reclaims and decapsulates packets in the tx descriptor chain if:
+* - A Tx packet has been copied from host-RAM into NIC-RAM by the DMA engine
+* - The Hermes/DMAengine have been disabled
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* pointer to a reclaimed Tx packet.
+*
+*.DESCRIPTION
+* impact of the disable command:
+* When a non-empty pool of Tx descriptors exists (created by means of hcf_dma_put_tx), the MSF
+* is supposed to empty that pool by means of hcf_dma_tx_get calls after the disable in an
+* disable/enable sequence.
+*
+*.DIAGRAM
+*
+*.NOTICE
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+DESC_STRCT*
+hcf_dma_tx_get( IFBP ifbp )
+{
+DESC_STRCT *descp; // pointer to start of FrameList
+
+ descp = get_frame_lst( ifbp, DMA_TX );
+ if ( descp && descp->buf_addr ) //!be aware of the missing curly bracket
+ //skip decapsulation at confined descriptor
+#if (HCF_ENCAP) == HCF_ENC
+ if ( ( descp->BUF_CNT == HFS_TYPE )
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ || ( descp->BUF_CNT == HFS_DAT )
+#endif // HCF_TYPE_CCX
+ ) { // perform decapsulation if needed
+ descp->next_desc_addr->buf_phys_addr -= HCF_DASA_SIZE;
+ descp->next_desc_addr->BUF_CNT += HCF_DASA_SIZE;
+ }
+#endif // HCF_ENC
+ if ( descp == NULL ) { //;?could be integrated into get_frame_lst
+ ifbp->IFB_DmaPackets &= (hcf_16)~HREG_EV_TDMAD;
+ }
+ HCFLOGEXIT( HCF_TRACE_DMA_TX_GET )
+ return descp;
+} // hcf_dma_tx_get
+
+
+/************************************************************************************************************
+*
+*.MODULE void hcf_dma_tx_put( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
+*.PURPOSE puts a packet in the Tx DMA queue in host ram and kicks off the TxDma engine.
+* supply the Tx-DELWA descriptor.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* descp address of Tx Descriptor Chain (i.e. a single Tx frame)
+* tx_cntl indicates MAC-port and (Hermes) options
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* The HCF can be used in 2 fashions: with and without encapsulation for data transfer.
+* This is controlled at compile time by the HCF_ENC bit of the HCF_ENCAP system constant.
+*
+* Regardless of the HCF_ENCAP system constant, the descriptor list created to describe the frame to be
+* transmitted, must supply space to contain the 802.11 header, preceding the actual frame to be transmitted.
+* Basically, this only supplies working storage to the HCF which passes this on to the DMA engine.
+* As a consequence the contents of this space do not matter.
+* Nevertheless BUF_CNT must take in account this storage.
+* This working space to contain the 802.11 header may not be fragmented, the first buffer must be
+* sufficiently large to contain at least the 802.11 header, i.e. HFS_ADDR_DEST (29 words or 0x3A bytes).
+* This way, the HCF can simply, regardless whether or not the HCF encapsulates the frame, write the parameter
+* tx_cntl at offset 0x36 (HFS_TX_CNTL) in the first buffer.
+* Note that it is allowed to have part or all of the actual frame represented by the first descriptor as long
+* as the requirement for storage for the 802.11 header is met, i.e. the 802.3 frame starts at offset
+* HFS_ADDR_DEST.
+* Except for the Assert on the 1st buffer in case of Encapsualtion, the SIZE fields are ignored.
+*
+* In case the encapsulation feature is compiled in, there are the following additional requirements.
+* o The BUF_CNT of the first buffer changes from a minimum of 0x3A bytes to exactly 0x3A, i.e. the workspace
+* to store the 802.11 header
+* o The BUF_SIZE of the first buffer is at least the space needed to store the
+* - 802.11 header (29 words)
+* - 802.3 header, i.e. 12 bytes addressing information and 2 bytes length field
+* - 6 bytes SNAP-header
+* This results in 39 words or 0x4E bytes or HFS_TYPE.
+* Note that if the BUF_SIZE is larger than 0x4E, this surplus is not used.
+* o The actual frame begins in the 2nd descriptor (which is already implied by the BUF_CNT == 0x3A requirement) and the associated buffer contains at least the 802.3 header, i.e. the 14 bytes representing addressing information and length/type field
+*
+* When the HCF does not encapsulates (i.e. length/type field <= 1500), no changes are made to descriptors
+* or buffers.
+*
+* When the HCF actually encapsulates (i.e. length/type field > 1500), it successively writes, starting at
+* offset HFS_ADDR_DEST (0x3A) in the first buffer:
+* - the 802.3 addressing information, copied from the begin of the second buffer
+* - the frame length, derived from the total length of the individual fragments, corrected for the SNAP
+* header length and Type field and ignoring the Destination Address, Source Address and Length field
+* - the appropriate snap header (Tunnel or 1042, depending on the value of the type field).
+*
+* The information in the first two descriptors is adjusted accordingly:
+* - the first descriptor count is changed from 0x3A to 0x4E (HFS_TYPE), which matches 0x3A + 12 + 2 + 6
+* - the second descriptor count is decreased by 12, being the moved addressing information
+* - the second descriptor (physical) buffer address is increased by 12.
+*
+* When the descriptors are returned by hcf_dma_tx_get, the transformation of the first two descriptors is
+* undone.
+*
+* Under any of the above scenarios, the assert BUF_CNT <= BUF_SIZE must be true for all descriptors
+* In case of encapsulation, BUF_SIZE of the 1st descriptor is asserted to be at least HFS_TYPE (0x4E), so it is NOT tested.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - tx_cntl has a recognizable out-of-range value.
+* - NIC interrupts are not disabled while required by parameter action.
+* - in case encapsulation by the HCF is selected:
+* - The FrameList does not consists of at least 2 Descriptors.
+* - The first databuffer does not contain exactly the (space for) the 802.11 header (== 28 words)
+* - The first databuffer does not have a size to additionally accomodate the 802.3 header and the
+* SNAP header of the frame after encapsulation (== 39 words).
+* - The second databuffer does not contain at least DA, SA and 'type/length' (==14 bytes or 7 words)
+*!! The 2nd part of the list of asserts should be kept in sync with put_frame_lst, in order to get
+*!! them in the WCI-spec !!!!
+* - DMA is not enabled
+* - descriptor list is NULL
+* - a descriptor in the descriptor list is not double word aligned
+* - a count of size field of a descriptor contains control bits, i.e. bits in the high order nibble.
+* - the DELWA descriptor is not a "singleton" DescriptorList.
+* - the DELWA descriptor is not the first Descriptor supplied
+* - a non_DMA descriptor is supplied before the DELWA Descriptor is supplied
+*!! - Possibly more checks could be added !!!!!!!!!!!!!
+*.DIAGRAM
+*
+*.NOTICE
+*
+*.ENDDOC END DOCUMENTATION
+*
+*
+*1: Write tx_cntl parameter to HFS_TX_CNTL field into the Hermes-specific header in buffer 1
+*4: determine whether encapsulation is needed and write the type (tunnel or 1042) already at the appropriate
+* offset in the 1st buffer
+*6: Build the encapsualtion enveloppe in the free space at the end of the 1st buffer
+* - Copy DA/SA fields from the 2nd buffer
+* - Calculate total length of the message (snap-header + type-field + the length of all buffer fragments
+* associated with the 802.3 frame (i.e all descriptors except the first), but not the DestinationAddress,
+* SourceAddress and lenght-field)
+* Assert the message length
+* Write length. Note that the message is in BE format, hence on LE platforms the length must be converted
+* ;? THIS IS NOT WHAT CURRENTLY IS IMPLEMENTED
+* - Write snap header. Note that the last byte of the snap header is NOT copied, that byte is already in
+* place as result of the call to hcf_encap.
+* Note that there are many ways to skin a cat. To express the offsets in the 1st buffer while writing
+* the snap header, HFS_TYPE is choosen as a reference point to make it easier to grasp that the snap header
+* and encapsualtion type are at least relative in the right.
+*8: modify 1st descriptor to reflect moved part of the 802.3 header + Snap-header
+* modify 2nd descriptor to skip the moved part of the 802.3 header (DA/SA
+*10: set each descriptor to 'DMA owned', clear all other control bits.
+* Set SOP bit on first descriptor. Set EOP bit on last descriptor.
+*12: Either append the current frame to an existing descriptor list or
+*14: create a list beginning with the current frame
+*16: remember the new end of the list
+*20: hand the frame over to the DMA engine
+************************************************************************************************************/
+void
+hcf_dma_tx_put( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
+{
+DESC_STRCT *p = descp->next_desc_addr;
+int i;
+
+#if HCF_ASSERT
+ int x = ifbp->IFB_FWIdentity.comp_id == COMP_ID_FW_AP ? tx_cntl & ~HFS_TX_CNTL_PORT : tx_cntl;
+ HCFASSERT( (x & ~HCF_TX_CNTL_MASK ) == 0, tx_cntl )
+#endif // HCF_ASSERT
+ HCFLOGENTRY( HCF_TRACE_DMA_TX_PUT, 0xDA03 )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+ HCFASSERT( ( ifbp->IFB_CntlOpt & (USE_DMA|DMA_ENABLED) ) == (USE_DMA|DMA_ENABLED), ifbp->IFB_CntlOpt)
+
+ if ( descp->buf_addr ) {
+ *(hcf_16*)(descp->buf_addr + HFS_TX_CNTL) = tx_cntl; /*1*/
+#if (HCF_ENCAP) == HCF_ENC
+ HCFASSERT( descp->next_desc_addr, 0 ) //at least 2 descripors
+ HCFASSERT( descp->BUF_CNT == HFS_ADDR_DEST, descp->BUF_CNT ) //exact length required for 1st buffer
+ HCFASSERT( descp->BUF_SIZE >= HCF_DMA_TX_BUF1_SIZE, descp->BUF_SIZE ) //minimal storage for encapsulation
+ HCFASSERT( p->BUF_CNT >= 14, p->BUF_CNT ); //at least DA, SA and 'type' in 2nd buffer
+
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ /* if we are doing PPK +/- CMIC, or we are sending a DDP frame */
+ if ( ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_ON ) ||
+ ( ( p->BUF_CNT >= 20 ) && ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF ) &&
+ ( p->buf_addr[12] == 0xAA ) && ( p->buf_addr[13] == 0xAA ) &&
+ ( p->buf_addr[14] == 0x03 ) && ( p->buf_addr[15] == 0x00 ) &&
+ ( p->buf_addr[16] == 0x40 ) && ( p->buf_addr[17] == 0x96 ) &&
+ ( p->buf_addr[18] == 0x00 ) && ( p->buf_addr[19] == 0x00 )))
+ {
+ /* copy the DA/SA to the first buffer */
+ for ( i = 0; i < HCF_DASA_SIZE; i++ ) {
+ descp->buf_addr[i + HFS_ADDR_DEST] = p->buf_addr[i];
+ }
+ /* calculate the length of the second fragment only */
+ i = 0;
+ do { i += p->BUF_CNT; } while( p = p->next_desc_addr );
+ i -= HCF_DASA_SIZE ;
+ /* convert the length field to big endian, using the endian friendly macros */
+ i = CNV_SHORT_TO_BIG(i); //!! this converts ONLY on LE platforms, how does that relate to the non-CCX code
+ *(hcf_16*)(&descp->buf_addr[HFS_LEN]) = (hcf_16)i;
+ descp->BUF_CNT = HFS_DAT;
+ // modify 2nd descriptor to skip the 'Da/Sa' fields
+ descp->next_desc_addr->buf_phys_addr += HCF_DASA_SIZE;
+ descp->next_desc_addr->BUF_CNT -= HCF_DASA_SIZE;
+ }
+ else
+#endif // HCF_TYPE_CCX
+ {
+ descp->buf_addr[HFS_TYPE-1] = hcf_encap(&descp->next_desc_addr->buf_addr[HCF_DASA_SIZE]); /*4*/
+ if ( descp->buf_addr[HFS_TYPE-1] != ENC_NONE ) {
+ for ( i=0; i < HCF_DASA_SIZE; i++ ) { /*6*/
+ descp->buf_addr[i + HFS_ADDR_DEST] = descp->next_desc_addr->buf_addr[i];
+ }
+ i = sizeof(snap_header) + 2 - ( 2*6 + 2 );
+ do { i += p->BUF_CNT; } while ( ( p = p->next_desc_addr ) != NULL );
+ *(hcf_16*)(&descp->buf_addr[HFS_LEN]) = CNV_END_SHORT(i); //!! this converts on ALL platforms, how does that relate to the CCX code
+ for ( i=0; i < sizeof(snap_header) - 1; i++) {
+ descp->buf_addr[HFS_TYPE - sizeof(snap_header) + i] = snap_header[i];
+ }
+ descp->BUF_CNT = HFS_TYPE; /*8*/
+ descp->next_desc_addr->buf_phys_addr += HCF_DASA_SIZE;
+ descp->next_desc_addr->BUF_CNT -= HCF_DASA_SIZE;
+ }
+ }
+#endif // HCF_ENC
+ }
+ put_frame_lst( ifbp, descp, DMA_TX );
+ HCFLOGEXIT( HCF_TRACE_DMA_TX_PUT )
+} // hcf_dma_tx_put
+
+#endif // HCF_DMA
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.MODULE hcf_8 hcf_encap( wci_bufp type )
+*.PURPOSE test whether RFC1042 or Bridge-Tunnel encapsulation is needed.
+*
+*.ARGUMENTS
+* type (Far) pointer to the (Big Endian) Type/Length field in the message
+*
+*.RETURNS
+* ENC_NONE len/type is "len" ( (BIG_ENDIAN)type <= 1500 )
+* ENC_TUNNEL len/type is "type" and 0x80F3 or 0x8137
+* ENC_1042 len/type is "type" but not 0x80F3 or 0x8137
+*
+*.CONDITIONS
+* NIC Interrupts d.c
+*
+*.DESCRIPTION
+* Type must point to the Len/Type field of the message, this is the 2-byte field immediately after the 6 byte
+* Destination Address and 6 byte Source Address. The 2 successive bytes addressed by type are interpreted as
+* a Big Endian value. If that value is less than or equal to 1500, the message is assumed to be in 802.3
+* format. Otherwise the message is assumed to be in Ethernet-II format. Depending on the value of Len/Typ,
+* Bridge Tunnel or RFC1042 encapsulation is needed.
+*
+*.DIAGRAM
+*
+* 1: presume 802.3, hence preset return value at ENC_NONE
+* 2: convert type from "network" Endian format to native Endian
+* 4: the litmus test to distinguish type and len.
+* The hard code "magic" value of 1500 is intentional and should NOT be replaced by a mnemonic because it is
+* not related at all to the maximum frame size supported by the Hermes.
+* 6: check type against:
+* 0x80F3 //AppleTalk Address Resolution Protocol (AARP)
+* 0x8137 //IPX
+* to determine the type of encapsulation
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+#if HCF_ENCAP //i.e HCF_ENC or HCF_ENC_SUP
+#if ! ( (HCF_ENCAP) & HCF_ENC_SUP )
+HCF_STATIC
+#endif // HCF_ENCAP
+hcf_8
+hcf_encap( wci_bufp type )
+{
+
+hcf_8 rc = ENC_NONE; /* 1 */
+hcf_16 t = (hcf_16)(*type<<8) + *(type+1); /* 2 */
+
+ if ( t > 1500 ) { /* 4 */
+ if ( t == 0x8137 || t == 0x80F3 ) {
+ rc = ENC_TUNNEL; /* 6 */
+ } else {
+ rc = ENC_1042;
+ }
+ }
+ return rc;
+} // hcf_encap
+#endif // HCF_ENCAP
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.MODULE int hcf_get_info( IFBP ifbp, LTVP ltvp )
+*.PURPOSE Obtains transient and persistent configuration information from the Card and from the HCF.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* ltvp address of LengthTypeValue structure specifying the "what" and the "how much" of the
+* information to be collected from the HCF or from the Hermes
+*
+*.RETURNS
+* HCF_ERR_LEN The provided buffer was too small
+* HCF_SUCCESS Success
+*!! via cmd_exe ( type >= CFG_RID_FW_MIN )
+* HCF_ERR_NO_NIC NIC removed during retrieval
+* HCF_ERR_TIME_OUT Expected Hermes event did not occure in expected time
+*!! via cmd_exe and setup_bap (type >= CFG_RID_FW_MIN )
+* HCF_ERR_DEFUNCT_... HCF is in defunct mode (bits 0x7F reflect cause)
+*
+*.DESCRIPTION
+* The T-field of the LTV-record (provided by the MSF in parameter ltvp) specifies the RID wanted. The RID
+* information identified by the T-field is copied into the V-field.
+* On entry, the L-field specifies the size of the buffer, also called the "Initial DataLength". The L-value
+* includes the size of the T-field, but not the size of the L-field itself.
+* On return, the L-field indicates the number of words actually contained by the Type and Value fields.
+* As the size of the Type field in the LTV-record is included in the "Initial DataLength" of the record, the
+* V-field can contain at most "Initial DataLength" - 1 words of data.
+* Copying stops if either the complete Information is copied or if the number of words indicated by the
+* "Initial DataLength" were copied. The "Initial DataLength" acts as a safe guard against Configuration
+* Information blocks that have different sizes for different F/W versions, e.g. when later versions support
+* more tallies than earlier versions.
+* If the size of Value field of the RID exceeds the size of the "Initial DataLength" -1, as much data
+* as fits is copied, and an error status of HCF_ERR_LEN is returned.
+*
+* It is the responsibility of the MSF to detect card removal and re-insertion and not call the HCF when the
+* NIC is absent. The MSF cannot, however, timely detect a Card removal if the Card is removed while
+* hcf_get_info is in progress. Therefore, the HCF performs its own check on Card presence after the read
+* operation of the NIC data. If the Card is not present or removed during the execution of hcf_get_info,
+* HCF_ERR_NO_NIC is returned and the content of the Data Buffer is unpredictable. This check is not performed
+* in case of the "HCF embedded" pseudo RIDs like CFG_TALLIES.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - reentrancy, may be caused by calling hcf_functions without adequate protection
+* against NIC interrupts or multi-threading.
+* - ltvp is a NULL pointer.
+* - length field of the LTV-record at entry is 0 or 1 or has an excessive value (i.e. exceeds HCF_MAX_LTV).
+* - type field of the LTV-record is invalid.
+*
+*.DIAGRAM
+* Hcf_get_mb_info copies the contents of the oldest MailBox Info block in the MailBox to PC RAM. If len is
+* less than the size of the MailBox Info block, only as much as fits in the PC RAM buffer is copied. After
+* the copying the MailBox Read pointer is updated to point to the next MailBox Info block, hence the
+* remainder of an "oversized" MailBox Info block is lost. The truncation of the MailBox Info block is NOT
+* reflected in the return status. Note that hcf_get_info guarantees the length of the PC RAM buffer meets
+* the minimum requirements of at least 2, so no PC RAM buffer overrun.
+*
+* Calling hcf_get_mb_info when their is no MailBox Info block available or when there is no MailBox at all,
+* results in a "NULL" MailBox Info block.
+*
+*12: see NOTICE
+*17: The return status of cmd_wait and the first hcfio_in_string can be ignored, because when one fails, the
+* other fails via the IFB_DefunctStat mechanism
+*20: "HCFASSERT( rc == HCF_SUCCESS, rc )" is not suitable because this will always trigger as side effect of
+* the HCFASSERT in hcf_put_info which calls hcf_get_info to figure out whether the RID exists at all.
+
+*.NOTICE
+*
+* "HCF embedded" pseudo RIDs:
+* CFG_MB_INFO, CFG_TALLIES, CFG_DRV_IDENTITY, CFG_DRV_SUP_RANGE, CFG_DRV_ACT_RANGES_PRI,
+* CFG_DRV_ACT_RANGES_STA, CFG_DRV_ACT_RANGES_HSI
+* Note the HCF_ERR_LEN is NOT adequately set, when L >= 2 but less than needed
+*
+* Remarks: Transfers operation information and transient and persistent configuration information from the
+* Card and from the HCF to the MSF.
+* The exact layout of the provided data structure depends on the action code. Copying stops if either the
+* complete Configuration Information is copied or if the number of bytes indicated by len is copied. Len
+* acts as a safe guard against Configuration Information blocks which have different sizes for different
+* Hermes versions, e.g. when later versions support more tallies than earlier versions. It is a conscious
+* decision that unused parts of the PC RAM buffer are not cleared.
+*
+* Remarks: The only error against which is protected is the "Read error" as result of Card removal. Only the
+* last hcf_io_string need to be protected because if the first fails the second will fail as well. Checking
+* for cmd_exe errors is supposed superfluous because problems in cmd_exe are already caught or will be
+* caught by hcf_enable.
+*
+* CFG_MB_INFO: copy the oldest MailBox Info Block or the "null" block if none available.
+*
+* The mechanism to HCF_ASSERT on invalid typ-codes in the LTV record is based on the following strategy:
+* - during the pseudo-asynchronous Hermes commands (diagnose, download) only CFG_MB_INFO is acceptable
+* - some codes (e.g. CFG_TALLIES) are explicitly handled by the HCF which implies that these codes
+* are valid
+* - all other codes in the range 0xFC00 through 0xFFFF are passed to the Hermes. The Hermes returns an
+* LTV record with a zero value in the L-field for all Typ-codes it does not recognize. This is
+* defined and intended behavior, so HCF_ASSERT does not catch on this phenomena.
+* - all remaining codes are invalid and cause an ASSERT.
+*
+*.CONDITIONS
+* In case of USB, HCF_MAX_MSG ;?USED;? to limit the amount of data that can be retrieved via hcf_get_info.
+*
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_get_info( IFBP ifbp, LTVP ltvp )
+{
+
+int rc = HCF_SUCCESS;
+hcf_16 len = ltvp->len;
+hcf_16 type = ltvp->typ;
+wci_recordp p = &ltvp->len; //destination word pointer (in LTV record)
+hcf_16 *q = NULL; /* source word pointer Note!! DOS COM can't cope with FAR
+ * as a consequence MailBox must be near which is usually true anyway
+ */
+int i;
+
+ HCFLOGENTRY( HCF_TRACE_GET_INFO, ltvp->typ )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+ HCFASSERT( ltvp, 0 )
+ HCFASSERT( 1 < ltvp->len && ltvp->len <= HCF_MAX_LTV + 1, MERGE_2( ltvp->typ, ltvp->len ) )
+
+ ltvp->len = 0; //default to: No Info Available
+#if defined MSF_COMPONENT_ID || (HCF_EXT) & HCF_EXT_MB //filter out all specials
+ for ( i = 0; ( q = xxxx[i] ) != NULL && q[1] != type; i++ ) /*NOP*/;
+#endif // MSF_COMPONENT_ID / HCF_EXT_MB
+#if HCF_TALLIES
+ if ( type == CFG_TALLIES ) { /*3*/
+ (void)hcf_action( ifbp, HCF_ACT_TALLIES );
+ q = (hcf_16*)&ifbp->IFB_TallyLen;
+ }
+#endif // HCF_TALLIES
+#if (HCF_EXT) & HCF_EXT_MB
+ if ( type == CFG_MB_INFO ) {
+ if ( ifbp->IFB_MBInfoLen ) {
+ if ( ifbp->IFB_MBp[ifbp->IFB_MBRp] == 0xFFFF ) {
+ ifbp->IFB_MBRp = 0; //;?Probably superfluous
+ }
+ q = &ifbp->IFB_MBp[ifbp->IFB_MBRp];
+ ifbp->IFB_MBRp += *q + 1; //update read pointer
+ if ( ifbp->IFB_MBp[ifbp->IFB_MBRp] == 0xFFFF ) {
+ ifbp->IFB_MBRp = 0;
+ }
+ ifbp->IFB_MBInfoLen = ifbp->IFB_MBp[ifbp->IFB_MBRp];
+ }
+ }
+#endif // HCF_EXT_MB
+ if ( q != NULL ) { //a special or CFG_TALLIES or CFG_MB_INFO
+ i = min( len, *q ) + 1; //total size of destination (including T-field)
+ while ( i-- ) {
+ *p++ = *q;
+#if (HCF_TALLIES) & HCF_TALLIES_RESET
+ if ( q > &ifbp->IFB_TallyTyp && type == CFG_TALLIES ) {
+ *q = 0;
+ }
+#endif // HCF_TALLIES_RESET
+ q++;
+ }
+ } else { // not a special nor CFG_TALLIES nor CFG_MB_INFO
+ if ( type == CFG_CNTL_OPT ) { //read back effective options
+ ltvp->len = 2;
+ ltvp->val[0] = ifbp->IFB_CntlOpt;
+#if (HCF_EXT) & HCF_EXT_NIC_ACCESS
+ } else if ( type == CFG_PROD_DATA ) { //only needed for some test tool on top of H-II NDIS driver
+hcf_io io_port;
+wci_bufp pt; //pointer with the "right" type, just to help ease writing macros with embedded assembly
+ OPW( HREG_AUX_PAGE, (hcf_16)(PLUG_DATA_OFFSET >> 7) );
+ OPW( HREG_AUX_OFFSET, (hcf_16)(PLUG_DATA_OFFSET & 0x7E) );
+ io_port = ifbp->IFB_IOBase + HREG_AUX_DATA; //to prevent side effects of the MSF-defined macro
+ p = ltvp->val; //destination char pointer (in LTV record)
+ if ( ( i = len - 1 ) > 0 ) {
+ pt = (wci_bufp)p; //just to help ease writing macros with embedded assembly
+ IN_PORT_STRING_8_16( io_port, pt, i ); //space used by T: -1
+ }
+ } else if ( type == CFG_CMD_HCF ) {
+#define P ((CFG_CMD_HCF_STRCT FAR *)ltvp)
+ HCFASSERT( P->cmd == CFG_CMD_HCF_REG_ACCESS, P->cmd ) //only Hermes register access supported
+ if ( P->cmd == CFG_CMD_HCF_REG_ACCESS ) {
+ HCFASSERT( P->mode < ifbp->IFB_IOBase, P->mode ) //Check Register space
+ ltvp->len = min( len, 4 ); //RESTORE ltv length
+ P->add_info = IPW( P->mode );
+ }
+#undef P
+#endif // HCF_EXT_NIC_ACCESS
+#if (HCF_ASSERT) & HCF_ASSERT_PRINTF
+ } else if (type == CFG_FW_PRINTF) {
+ rc = fw_printf(ifbp, (CFG_FW_PRINTF_STRCT*)ltvp);
+#endif // HCF_ASSERT_PRINTF
+ } else if ( type >= CFG_RID_FW_MIN ) {
+//;? by using HCMD_BUSY option when calling cmd_exe, using a get_frag with length 0 just to set up the
+//;? BAP and calling cmd_cmpl, you could merge the 2 Busy waits. Whether this really helps (and what
+//;? would be the optimal sequence in cmd_exe and get_frag) would have to be MEASURED
+/*17*/ if ( ( rc = cmd_exe( ifbp, HCMD_ACCESS, type ) ) == HCF_SUCCESS &&
+ ( rc = setup_bap( ifbp, type, 0, IO_IN ) ) == HCF_SUCCESS ) {
+ get_frag( ifbp, (wci_bufp)&ltvp->len, 2*len+2 BE_PAR(2) );
+ if ( IPW( HREG_STAT ) == 0xFFFF ) { //NIC removal test
+ ltvp->len = 0;
+ HCFASSERT( DO_ASSERT, type )
+ }
+ }
+/*12*/ } else HCFASSERT( DO_ASSERT, type ) /*NOP*/; //NOP in case HCFASSERT is dummy
+ }
+ if ( len < ltvp->len ) {
+ ltvp->len = len;
+ if ( rc == HCF_SUCCESS ) {
+ rc = HCF_ERR_LEN;
+ }
+ }
+ HCFASSERT( rc == HCF_SUCCESS || ( rc == HCF_ERR_LEN && ifbp->IFB_AssertTrace & 1<<HCF_TRACE_PUT_INFO ),
+ MERGE_2( type, rc ) ) /*20*/
+ HCFLOGEXIT( HCF_TRACE_GET_INFO )
+ return rc;
+} // hcf_get_info
+
+
+/************************************************************************************************************
+*
+*.MODULE int hcf_put_info( IFBP ifbp, LTVP ltvp )
+*.PURPOSE Transfers operation and configuration information to the Card and to the HCF.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* ltvp specifies the RID (as defined by Hermes I/F) or pseudo-RID (as defined by WCI)
+*
+*.RETURNS
+* HCF_SUCCESS
+*!! via cmd_exe
+* HCF_ERR_NO_NIC NIC removed during data retrieval
+* HCF_ERR_TIME_OUT Expected F/W event did not occur in time
+* HCF_ERR_DEFUNCT_...
+*!! via download CFG_DLNV_START <= type <= CFG_DL_STOP
+*!! via put_info CFG_RID_CFG_MIN <= type <= CFG_RID_CFG_MAX
+*!! via put_frag
+*
+*.DESCRIPTION
+* The L-field of the LTV-record (provided by the MSF in parameter ltvp) specifies the size of the buffer.
+* The L-value includes the size of the T-field, but not the size of the L-field.
+* The T- field specifies the RID placed in the V-field by the MSF.
+*
+* Not all CFG-codes can be used for hcf_put_info. The following CFG-codes are valid for hcf_put_info:
+* o One of the CFG-codes in the group "Network Parameters, Static Configuration Entities"
+* Changes made by hcf_put_info to CFG_codes in this group will not affect the F/W
+* and HCF behavior until hcf_cntl_port( HCF_PORT_ENABLE) is called.
+* o One of the CFG-codes in the group "Network Parameters, Dynamic Configuration Entities"
+* Changes made by hcf_put_info to CFG_codes will affect the F/W and HCF behavior immediately.
+* o CFG_PROG.
+* This code is used to initiate and terminate the process to download data either to
+* volatile or to non-volatile RAM on the NIC as well as for the actual download.
+* o CFG-codes related to the HCF behavior.
+* The related CFG-codes are:
+* - CFG_REG_MB
+* - CFG_REG_ASSERT_RTNP
+* - CFG_REG_INFO_LOG
+* - CFG_CMD_NIC
+* - CFG_CMD_DONGLE
+* - CFG_CMD_HCF
+* - CFG_NOTIFY
+*
+* All LTV-records "unknown" to the HCF are forwarded to the F/W.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value.
+* - ltvp is a NULL pointer.
+* - hcf_put_info was called without prior call to hcf_connect
+* - type field of the LTV-record is invalid, i.e. neither HCF nor F/W can handle the value.
+* - length field of the LTV-record at entry is less than 1 or exceeds MAX_LTV_SIZE.
+* - registering a MailBox with size less than 60 or a non-aligned buffer address is used.
+* - reentrancy, may be caused by calling hcf_functions without adequate protection against
+* NIC interrupts or multi-threading.
+*
+*.DIAGRAM
+*
+*.NOTICE
+* Remarks: In case of Hermes Configuration LTVs, the codes for the type are "cleverly" chosen to be
+* identical to the RID. Hermes Configuration information is copied from the provided data structure into the
+* Card.
+* In case of HCF Configuration LTVs, the type values are chosen in a range which does not overlap the
+* RID-range.
+*
+*20:
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+
+int
+hcf_put_info( IFBP ifbp, LTVP ltvp )
+{
+int rc = HCF_SUCCESS;
+
+ HCFLOGENTRY( HCF_TRACE_PUT_INFO, ltvp->typ )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+ HCFASSERT( ltvp, 0 )
+ HCFASSERT( 1 < ltvp->len && ltvp->len <= HCF_MAX_LTV + 1, ltvp->len )
+
+ //all codes between 0xFA00 and 0xFCFF are passed to Hermes
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ { hcf_16 i;
+ hcf_32 FAR * key_p;
+
+ if ( ltvp->typ == CFG_ADD_TKIP_DEFAULT_KEY || ltvp->typ == CFG_ADD_TKIP_MAPPED_KEY ) {
+ key_p = (hcf_32*)((CFG_ADD_TKIP_MAPPED_KEY_STRCT FAR *)ltvp)->tx_mic_key;
+ i = TX_KEY; //i.e. TxKeyIndicator == 1, KeyID == 0
+ if ( ltvp->typ == CFG_ADD_TKIP_DEFAULT_KEY ) {
+ key_p = (hcf_32*)((CFG_ADD_TKIP_DEFAULT_KEY_STRCT FAR *)ltvp)->tx_mic_key;
+ i = CNV_LITTLE_TO_SHORT(((CFG_ADD_TKIP_DEFAULT_KEY_STRCT FAR *)ltvp)->tkip_key_id_info);
+ }
+ if ( i & TX_KEY ) { /* TxKeyIndicator == 1
+ (either really set by MSF in case of DEFAULT or faked by HCF in case of MAPPED ) */
+ ifbp->IFB_MICTxCntl = (hcf_16)( HFS_TX_CNTL_MIC | (i & KEY_ID )<<8 );
+ ifbp->IFB_MICTxKey[0] = CNV_LONGP_TO_LITTLE( key_p );
+ ifbp->IFB_MICTxKey[1] = CNV_LONGP_TO_LITTLE( (key_p+1) );
+ }
+ i = ( i & KEY_ID ) * 2;
+ ifbp->IFB_MICRxKey[i] = CNV_LONGP_TO_LITTLE( (key_p+2) );
+ ifbp->IFB_MICRxKey[i+1] = CNV_LONGP_TO_LITTLE( (key_p+3) );
+ }
+#define P ((CFG_REMOVE_TKIP_DEFAULT_KEY_STRCT FAR *)ltvp)
+ if ( ( ltvp->typ == CFG_REMOVE_TKIP_MAPPED_KEY ) ||
+ ( ltvp->typ == CFG_REMOVE_TKIP_DEFAULT_KEY &&
+ ( (ifbp->IFB_MICTxCntl >> 8) & KEY_ID ) == CNV_SHORT_TO_LITTLE(P->tkip_key_id )
+ )
+ ) { ifbp->IFB_MICTxCntl = 0; } //disable MIC-engine
+#undef P
+ }
+#endif // HCF_TYPE_WPA
+
+ if ( ltvp->typ == CFG_PROG ) {
+ rc = download( ifbp, (CFG_PROG_STRCT FAR *)ltvp );
+ } else switch (ltvp->typ) {
+#if (HCF_ASSERT) & HCF_ASSERT_RT_MSF_RTN
+ case CFG_REG_ASSERT_RTNP: //Register MSF Routines
+#define P ((CFG_REG_ASSERT_RTNP_STRCT FAR *)ltvp)
+ ifbp->IFB_AssertRtn = P->rtnp;
+// ifbp->IFB_AssertLvl = P->lvl; //TODO not yet supported so default is set in hcf_connect
+ HCFASSERT( DO_ASSERT, MERGE_2( HCF_ASSERT, 0xCAF1 ) ) //just to proof that the complete assert machinery is working
+#undef P
+ break;
+#endif // HCF_ASSERT_RT_MSF_RTN
+#if (HCF_EXT) & HCF_EXT_INFO_LOG
+ case CFG_REG_INFO_LOG: //Register Log filter
+ ifbp->IFB_RIDLogp = ((CFG_RID_LOG_STRCT FAR*)ltvp)->recordp;
+ break;
+#endif // HCF_EXT_INFO_LOG
+ case CFG_CNTL_OPT: //overrule option
+ HCFASSERT( ( ltvp->val[0] & ~(USE_DMA | USE_16BIT) ) == 0, ltvp->val[0] )
+ if ( ( ltvp->val[0] & USE_DMA ) == 0 ) ifbp->IFB_CntlOpt &= ~USE_DMA;
+ ifbp->IFB_CntlOpt |= ltvp->val[0] & USE_16BIT;
+ break;
+#if (HCF_EXT) & HCF_EXT_MB
+ case CFG_REG_MB: //Register MailBox
+#define P ((CFG_REG_MB_STRCT FAR *)ltvp)
+ HCFASSERT( ( (hcf_32)P->mb_addr & 0x0001 ) == 0, (hcf_32)P->mb_addr )
+ HCFASSERT( (P)->mb_size >= 60, (P)->mb_size )
+ ifbp->IFB_MBp = P->mb_addr;
+ /* if no MB present, size must be 0 for ;?the old;? put_info_mb to work correctly */
+ ifbp->IFB_MBSize = ifbp->IFB_MBp == NULL ? 0 : P->mb_size;
+ ifbp->IFB_MBWp = ifbp->IFB_MBRp = 0;
+ ifbp->IFB_MBp[0] = 0; //flag the MailBox as empty
+ ifbp->IFB_MBInfoLen = 0;
+ HCFASSERT( ifbp->IFB_MBSize >= 60 || ifbp->IFB_MBp == NULL, ifbp->IFB_MBSize )
+#undef P
+ break;
+ case CFG_MB_INFO: //store MailBoxInfoBlock
+ rc = put_info_mb( ifbp, (CFG_MB_INFO_STRCT FAR *)ltvp );
+ break;
+#endif // HCF_EXT_MB
+
+#if (HCF_EXT) & HCF_EXT_NIC_ACCESS
+ case CFG_CMD_NIC:
+#define P ((CFG_CMD_NIC_STRCT FAR *)ltvp)
+ OPW( HREG_PARAM_2, P->parm2 );
+ OPW( HREG_PARAM_1, P->parm1 );
+ rc = cmd_exe( ifbp, P->cmd, P->parm0 );
+ P->hcf_stat = (hcf_16)rc;
+ P->stat = IPW( HREG_STAT );
+ P->resp0 = IPW( HREG_RESP_0 );
+ P->resp1 = IPW( HREG_RESP_1 );
+ P->resp2 = IPW( HREG_RESP_2 );
+ P->ifb_err_cmd = ifbp->IFB_ErrCmd;
+ P->ifb_err_qualifier = ifbp->IFB_ErrQualifier;
+#undef P
+ break;
+ case CFG_CMD_HCF:
+#define P ((CFG_CMD_HCF_STRCT FAR *)ltvp)
+ HCFASSERT( P->cmd == CFG_CMD_HCF_REG_ACCESS, P->cmd ) //only Hermes register access supported
+ if ( P->cmd == CFG_CMD_HCF_REG_ACCESS ) {
+ HCFASSERT( P->mode < ifbp->IFB_IOBase, P->mode ) //Check Register space
+ OPW( P->mode, P->add_info);
+ }
+#undef P
+ break;
+#endif // HCF_EXT_NIC_ACCESS
+
+#if (HCF_ASSERT) & HCF_ASSERT_PRINTF
+ case CFG_FW_PRINTF_BUFFER_LOCATION:
+ ifbp->IFB_FwPfBuff = *(CFG_FW_PRINTF_BUFFER_LOCATION_STRCT*)ltvp;
+ break;
+#endif // HCF_ASSERT_PRINTF
+
+ default: //pass everything unknown above the "FID" range to the Hermes or Dongle
+ rc = put_info( ifbp, ltvp );
+ }
+ //DO NOT !!! HCFASSERT( rc == HCF_SUCCESS, rc ) /* 20 */
+ HCFLOGEXIT( HCF_TRACE_PUT_INFO )
+ return rc;
+} // hcf_put_info
+
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.MODULE int hcf_rcv_msg( IFBP ifbp, DESC_STRCT *descp, unsigned int offset )
+*.PURPOSE All: decapsulate a message.
+* pre-HermesII.5: verify MIC.
+* non-USB, non-DMA mode: Transfer a message from the NIC to the Host and acknowledge reception.
+* USB: Transform a message from proprietary USB format to 802.3 format
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* descp Pointer to the Descriptor List location.
+* offset USB: not used
+* non-USB: specifies the beginning of the data to be obtained (0 corresponds with DestAddr field
+* of frame).
+*
+*.RETURNS
+* HCF_SUCCESS No SSN error ( or HCF_ERR_MIC already reported by hcf_service_nic)
+* HCF_ERR_MIC message contains an erroneous MIC ( HCF_SUCCESS is reported if HCF_ERR_MIC is already
+* reported by hcf_service_nic)
+* HCF_ERR_NO_NIC NIC removed during data retrieval
+* HCF_ERR_DEFUNCT...
+*
+*.DESCRIPTION
+* The Receive Message Function can be executed by the MSF to obtain the Data Info fields of the message that
+* is reported to be available by the Service NIC Function.
+*
+* The Receive Message Function copies the message data available in the Card memory into a buffer structure
+* provided by the MSF.
+* Only data of the message indicated by the Service NIC Function can be obtained.
+* Execution of the Service NIC function may result in the availability of a new message, but it definitely
+* makes the message reported by the preceding Service NIC function, unavailable.
+*
+* in non-USB/non-DMA mode, hcf_rcv_msg starts the copy process at the (non-negative) offset requested by the
+* parameter offset, relative to HFS_ADDR_DEST, e.g offset 0 starts copying from the Destination Address, the
+* very begin of the 802.3 frame message. Offset must either lay within the part of the 802.3 frame as stored
+* by hcf_service_nic in the lookahead buffer or be just behind it, i.e. the first byte not yet read.
+* When offset is within lookahead, data is copied from lookahead.
+* When offset is beyond lookahead, data is read directly from RxFS in NIC with disregard of the actual value
+* of offset
+*
+*.NOTICE:
+* o at entry: look ahead buffer as passed with hcf_service_nic is still accessible and unchanged
+* o at exit: Receive Frame in NIC memory is released
+*
+* Description:
+* Starting at the byte indicated by the Offset value, the bytes are copied from the Data Info
+* Part of the current Receive Frame Structure to the Host memory data buffer structure
+* identified by descp.
+* The maximum value for Offset is the number of characters of the 802.3 frame read into the
+* look ahead buffer by hcf_service_nic (i.e. the look ahead buffer size minus
+* Control and 802.11 fields)
+* If Offset is less than the maximum value, copying starts from the look ahead buffer till the
+* end of that buffer is reached
+* Then (or if the maximum value is specified for Offset), the
+* message is directly copied from NIC memory to Host memory.
+* If an invalid (i.e. too large) offset is specified, an assert catches but the buffer contents are
+* undefined.
+* Copying stops if either:
+* o the end of the 802.3 frame is reached
+* o the Descriptor with a NULL pointer in the next_desc_addr field is reached
+*
+* When the copying stops, the receiver is ack'ed, thus freeing the NIC memory where the frame is stored
+* As a consequence, hcf_rcv_msg can only be called once for any particular Rx frame.
+*
+* For the time being (PCI Bus mastering not yet supported), only the following fields of each
+* of the descriptors in the descriptor list must be set by the MSF:
+* o buf_cntl.buf_dim[1]
+* o *next_desc_addr
+* o *buf_addr
+* At return from hcf_rcv_msg, the field buf_cntl.buf_dim[0] of the used Descriptors reflects
+* the number of bytes in the buffer corresponding with the Descriptor.
+* On the last used Descriptor, buf_cntl.buf_dim[0] is less or equal to buf_cntl.buf_dim[1].
+* On all preceding Descriptors buf_cntl.buf_dim[0] is equal to buf_cntl.buf_dim[1].
+* On all succeeding (unused) Descriptors, buf_cntl.buf_dim[0] is zero.
+* Note: this I/F is based on the assumptions how the I/F needed for PCI Bus mastering will
+* be, so it may change.
+*
+* The most likely handling of HCF_ERR_NO_NIC by the MSF is to drop the already copied
+* data as elegantly as possible under the constraints and requirements posed by the (N)OS.
+* If no received Frame Structure is pending, "Success" rather than "Read error" is returned.
+* This error constitutes a logic flaw in the MSF
+* The HCF can only catch a minority of this
+* type of errors
+* Based on consistency ideas, the HCF catches none of these errors.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value
+* - there is no unacknowledged Rx-message available
+* - offset is out of range (outside look ahead buffer)
+* - descp is a NULL pointer
+* - any of the descriptors is not double word aligned
+* - reentrancy, may be caused by calling hcf_functions without adequate protection
+* against NIC interrupts or multi-threading.
+* - Interrupts are enabled.
+*
+*.DIAGRAM
+*
+*.NOTICE
+* - by using unsigned int as type for offset, no need to worry about negative offsets
+* - Asserting on being enabled/present is superfluous, since a non-zero IFB_lal implies that hcf_service_nic
+* was called and detected a Rx-message. A zero IFB_lal will set the BUF_CNT field of at least the first
+* descriptor to zero.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_rcv_msg( IFBP ifbp, DESC_STRCT *descp, unsigned int offset )
+{
+int rc = HCF_SUCCESS;
+wci_bufp cp; //char oriented working pointer
+hcf_16 i;
+int tot_len = ifbp->IFB_RxLen - offset; //total length
+wci_bufp lap = ifbp->IFB_lap + offset; //start address in LookAhead Buffer
+hcf_16 lal = ifbp->IFB_lal - offset; //available data within LookAhead Buffer
+hcf_16 j;
+
+ HCFLOGENTRY( HCF_TRACE_RCV_MSG, offset )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+ HCFASSERT( descp, HCF_TRACE_RCV_MSG )
+ HCFASSERT( ifbp->IFB_RxLen, HCF_TRACE_RCV_MSG )
+ HCFASSERT( ifbp->IFB_RxLen >= offset, MERGE_2( offset, ifbp->IFB_RxLen ) )
+ HCFASSERT( ifbp->IFB_lal >= offset, offset )
+ HCFASSERT( (ifbp->IFB_CntlOpt & USE_DMA) == 0, 0xDADA )
+
+ if ( tot_len < 0 ) {
+ lal = 0; tot_len = 0; //suppress all copying activity in the do--while loop
+ }
+ do { //loop over all available fragments
+ // obnoxious hcf.c(1480) : warning C4769: conversion of near pointer to long integer
+ HCFASSERT( ((hcf_32)descp & 3 ) == 0, (hcf_32)descp )
+ cp = descp->buf_addr;
+ j = min( (hcf_16)tot_len, descp->BUF_SIZE ); //minimum of "what's` available" and fragment size
+ descp->BUF_CNT = j;
+ tot_len -= j; //adjust length still to go
+ if ( lal ) { //if lookahead Buffer not yet completely copied
+ i = min( lal, j ); //minimum of "what's available" in LookAhead and fragment size
+ lal -= i; //adjust length still available in LookAhead
+ j -= i; //adjust length still available in current fragment
+ /*;? while loop could be improved by moving words but that is complicated on platforms with
+ * alignment requirements*/
+ while ( i-- ) *cp++ = *lap++;
+ }
+ if ( j ) { //if LookAhead Buffer exhausted but still space in fragment, copy directly from NIC RAM
+ get_frag( ifbp, cp, j BE_PAR(0) );
+ CALC_RX_MIC( cp, j );
+ }
+ } while ( ( descp = descp->next_desc_addr ) != NULL );
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ if ( ifbp->IFB_RxFID ) {
+ rc = check_mic( ifbp ); //prevents MIC error report if hcf_service_nic already consumed all
+ }
+#endif // HCF_TYPE_WPA
+ (void)hcf_action( ifbp, HCF_ACT_RX_ACK ); //only 1 shot to get the data, so free the resources in the NIC
+ HCFASSERT( rc == HCF_SUCCESS, rc )
+ HCFLOGEXIT( HCF_TRACE_RCV_MSG )
+ return rc;
+} // hcf_rcv_msg
+#endif // HCF_DL_ONLY
+
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.MODULE int hcf_send_msg( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
+*.PURPOSE Encapsulate a message and append padding and MIC.
+* non-USB: Transfers the resulting message from Host to NIC and initiates transmission.
+* USB: Transfer resulting message into a flat buffer.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* descp pointer to the DescriptorList or NULL
+* tx_cntl indicates MAC-port and (Hermes) options
+* HFS_TX_CNTL_SPECTRALINK
+* HFS_TX_CNTL_PRIO
+* HFS_TX_CNTL_TX_OK
+* HFS_TX_CNTL_TX_EX
+* HFS_TX_CNTL_TX_DELAY
+* HFS_TX_CNTL_TX_CONT
+* HCF_PORT_0 MAC Port 0 (default)
+* HCF_PORT_1 (AP only) MAC Port 1
+* HCF_PORT_2 (AP only) MAC Port 2
+* HCF_PORT_3 (AP only) MAC Port 3
+* HCF_PORT_4 (AP only) MAC Port 4
+* HCF_PORT_5 (AP only) MAC Port 5
+* HCF_PORT_6 (AP only) MAC Port 6
+*
+*.RETURNS
+* HCF_SUCCESS
+* HCF_ERR_DEFUNCT_..
+* HCF_ERR_TIME_OUT
+*
+*.DESCRIPTION:
+* The Send Message Function embodies 2 functions:
+* o transfers a message (including MAC header) from the provided buffer structure in Host memory to the Transmit
+* Frame Structure (TxFS) in NIC memory.
+* o Issue a send command to the F/W to actually transmit the contents of the TxFS.
+*
+* Control is based on the Resource Indicator IFB_RscInd.
+* The Resource Indicator is maintained by the HCF and should only be interpreted but not changed by the MSF.
+* The MSF must check IFB_RscInd to be non-zero before executing the call to the Send Message Function.
+* When no resources are available, the MSF must handle the queuing of the Transmit frame and check the
+* Resource Indicator periodically after calling hcf_service_nic.
+*
+* The Send Message Functions transfers a message to NIC memory when it is called with a non-NULL descp.
+* Before the Send Message Function is invoked this way, the Resource Indicator (IFB_RscInd) must be checked.
+* If the Resource is not available, Send Message Function execution must be postponed until after processing of
+* a next hcf_service_nic it appears that the Resource has become available.
+* The message is copied from the buffer structure identified by descp to the NIC.
+* Copying stops if a NULL pointer in the next_desc_addr field is reached.
+* Hcf_send_msg does not check for transmit buffer overflow, because the F/W does this protection.
+* In case of a transmit buffer overflow, the surplus which does not fit in the buffer is simply dropped.
+*
+* The Send Message Function activates the F/W to actually send the message to the medium when the
+* HFS_TX_CNTL_TX_DELAY bit of the tx_cntl parameter is not set.
+* If the descp parameter of the current call is non-NULL, the message as represented by descp is send.
+* If the descp parameter of the current call is NULL, and if the preceding call of the Send Message Function had
+* a non-NULL descp and the preceding call had the HFS_TX_CNTL_TX_DELAY bit of tx_cntl set, then the message as
+* represented by the descp of the preceding call is send.
+*
+* Hcf_send_msg supports encapsulation (see HCF_ENCAP) of Ethernet-II frames.
+* An Ethernet-II frame is transferred to the Transmit Frame structure as an 802.3 frame.
+* Hcf_send_msg distinguishes between an 802.3 and an Ethernet-II frame by looking at the data length/type field
+* of the frame. If this field contains a value larger than 1514, the frame is considered to be an Ethernet-II
+* frame, otherwise it is treated as an 802.3 frame.
+* To ease implementation of the HCF, this type/type field must be located in the first descriptor structure,
+* i.e. the 1st fragment must have a size of at least 14 (to contain DestAddr, SrcAddr and Len/Type field).
+* An Ethernet-II frame is encapsulated by inserting a SNAP header between the addressing information and the
+* type field. This insertion is transparent for the MSF.
+* The HCF contains a fixed table that stores a number of types. If the value specified by the type/type field
+* occurs in this table, Bridge Tunnel Encapsulation is used, otherwise RFC1042 encapsulation is used.
+* Bridge Tunnel uses AA AA 03 00 00 F8 as SNAP header,
+* RFC1042 uses AA AA 03 00 00 00 as SNAP header.
+* The table currently contains:
+* 0 0x80F3 AppleTalk Address Resolution Protocol (AARP)
+* 0 0x8137 IPX
+*
+* The algorithm to distinguish between 802.3 and Ethernet-II frames limits the maximum length for frames of
+* 802.3 frames to 1514 bytes.
+* Encapsulation can be suppressed by means of the system constant HCF_ENCAP, e.g. to support proprietary
+* protocols with 802.3 like frames with a size larger than 1514 bytes.
+*
+* In case the HCF encapsulates the frame, the number of bytes that is actually transmitted is determined by the
+* cumulative value of the buf_cntl.buf_dim[0] fields.
+* In case the HCF does not encapsulate the frame, the number of bytes that is actually transmitted is not
+* determined by the cumulative value of the buf_cntl.buf_dim[DESC_CNTL_CNT] fields of the desc_strct's but by
+* the Length field of the 802.3 frame.
+* If there is a conflict between the cumulative value of the buf_cntl.buf_dim[0] fields and the
+* 802.3 Length field the 802.3 Length field determines the number of bytes actually transmitted by the NIC while
+* the cumulative value of the buf_cntl.buf_dim[0] fields determines the position of the MIC, hence a mismatch
+* will result in MIC errors on the Receiving side.
+* Currently this problem is flagged on the Transmit side by an Assert.
+* The following fields of each of the descriptors in the descriptor list must be set by the MSF:
+* o buf_cntl.buf_dim[0]
+* o *next_desc_addr
+* o *buf_addr
+*
+* All bits of the tx_cntl parameter except HFS_TX_CNTL_TX_DELAY and the HCF_PORT# bits are passed to the F/W via
+* the HFS_TX_CNTL field of the TxFS.
+*
+* Note that hcf_send_msg does not detect NIC absence. The MSF is supposed to have its own -platform dependent-
+* way to recognize card removal/insertion.
+* The total system must be robust against card removal and there is no principal difference between card removal
+* just after hcf_send_msg returns but before the actual transmission took place or sometime earlier.
+*
+* Assert fails if
+* - ifbp has a recognizable out-of-range value
+* - descp is a NULL pointer
+* - no resources for PIF available.
+* - Interrupts are enabled.
+* - reentrancy, may be caused by calling hcf_functions without adequate protection
+* against NIC interrupts or multi-threading.
+*
+*.DIAGRAM
+*4: for the normal case (i.e. no HFS_TX_CNTL_TX_DELAY option active), a fid is acquired via the
+* routine get_fid. If no FID is acquired, the remainder is skipped without an error notification. After
+* all, the MSF is not supposed to call hcf_send_msg when no Resource is available.
+*7: The ControlField of the TxFS is written. Since put_frag can only return the fatal Defunct or "No NIC", the
+* return status can be ignored because when it fails, cmd_wait will fail as well. (see also the note on the
+* need for a return code below).
+* Note that HFS_TX_CNTL has different values for H-I, H-I/SSN and H-II and HFS_ADDR_DEST has different
+* values for H-I (regardless of SSN) and H-II.
+* By writing 17, 1 or 2 ( implying 16, 0 or 1 garbage word after HFS_TX_CNTL) the BAP just gets to
+* HFS_ADDR_DEST for H-I, H-I/SSN and H-II respectively.
+*10: if neither encapsulation nor MIC calculation is needed, splitting the first fragment in two does not
+* really help but it makes the flow easier to follow to do not optimize on this difference
+*
+* hcf_send_msg checks whether the frame is an Ethernet-II rather than an "official" 802.3 frame.
+* The E-II check is based on the length/type field in the MAC header. If this field has a value larger than
+* 1500, E-II is assumed. The implementation of this test fails if the length/type field is not in the first
+* descriptor. If E-II is recognized, a SNAP header is inserted. This SNAP header represents either RFC1042
+* or Bridge-Tunnel encapsulation, depending on the return status of the support routine hcf_encap.
+*
+*.NOTICE
+* hcf_send_msg leaves the responsibility to only send messages on enabled ports at the MSF level.
+* This is considered the strategy which is sufficiently adequate for all "robust" MSFs, have the least
+* processor utilization and being still acceptable robust at the WCI !!!!!
+*
+* hcf_send_msg does not NEED a return value to report NIC absence or removal during the execution of
+* hcf_send_msg(), because the MSF and higher layers must be able to cope anyway with the NIC being removed
+* after a successful completion of hcf_send_msg() but before the actual transmission took place.
+* To accommodate user expectations the current implementation does report NIC absence.
+* Defunct blocks all NIC access and will (also) be reported on a number of other calls.
+*
+* hcf_send_msg does not check for transmit buffer overflow because the Hermes does this protection.
+* In case of a transmit buffer overflow, the surplus which does not fit in the buffer is simply dropped.
+* Note that this possibly results in the transmission of incomplete frames.
+*
+* After some deliberation with F/W team, it is decided that - being in the twilight zone of not knowing
+* whether the problem at hand is an MSF bug, HCF buf, F/W bug, H/W malfunction or even something else - there
+* is no "best thing to do" in case of a failing send, hence the HCF considers the TxFID ownership to be taken
+* over by the F/W and hopes for an Allocate event in due time
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_send_msg( IFBP ifbp, DESC_STRCT *descp, hcf_16 tx_cntl )
+{
+int rc = HCF_SUCCESS;
+DESC_STRCT *p /* = descp*/; //working pointer
+hcf_16 len; // total byte count
+hcf_16 i;
+
+hcf_16 fid = 0;
+
+ HCFASSERT( ifbp->IFB_RscInd || descp == NULL, ifbp->IFB_RscInd )
+ HCFASSERT( (ifbp->IFB_CntlOpt & USE_DMA) == 0, 0xDADB )
+
+ HCFLOGENTRY( HCF_TRACE_SEND_MSG, tx_cntl )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+ /* obnoxious c:/hcf/hcf.c(1480) : warning C4769: conversion of near pointer to long integer,
+ * so skip */
+ HCFASSERT( ((hcf_32)descp & 3 ) == 0, (hcf_32)descp )
+#if HCF_ASSERT
+{ int x = ifbp->IFB_FWIdentity.comp_id == COMP_ID_FW_AP ? tx_cntl & ~HFS_TX_CNTL_PORT : tx_cntl;
+ HCFASSERT( (x & ~HCF_TX_CNTL_MASK ) == 0, tx_cntl )
+}
+#endif // HCF_ASSERT
+
+ if ( descp ) ifbp->IFB_TxFID = 0; //cancel a pre-put message
+
+#if (HCF_EXT) & HCF_EXT_TX_CONT // Continuous transmit test
+ if ( tx_cntl == HFS_TX_CNTL_TX_CONT ) {
+ if ( ( fid = get_fid( ifbp ) ) != 0 ) {
+ //setup BAP to begin of TxFS
+ (void)setup_bap( ifbp, fid, 0, IO_OUT );
+ //copy all the fragments in a transparent fashion
+ for ( p = descp; p; p = p->next_desc_addr ) {
+ /* obnoxious warning C4769: conversion of near pointer to long integer */
+ HCFASSERT( ((hcf_32)p & 3 ) == 0, (hcf_32)p )
+ put_frag( ifbp, p->buf_addr, p->BUF_CNT BE_PAR(0) );
+ }
+ rc = cmd_exe( ifbp, HCMD_THESEUS | HCMD_BUSY | HCMD_STARTPREAMBLE, fid );
+ if ( ifbp->IFB_RscInd == 0 ) {
+ ifbp->IFB_RscInd = get_fid( ifbp );
+ }
+ }
+ // een slecht voorbeeld doet goed volgen ;?
+ HCFLOGEXIT( HCF_TRACE_SEND_MSG )
+ return rc;
+ }
+#endif // HCF_EXT_TX_CONT
+ /* the following initialization code is redundant for a pre-put message
+ * but moving it inside the "if fid" logic makes the merging with the
+ * USB flow awkward
+ */
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ tx_cntl |= ifbp->IFB_MICTxCntl;
+#endif // HCF_TYPE_WPA
+ if ( (fid = ifbp->IFB_TxFID) == 0 && ( fid = get_fid( ifbp ) ) != 0 ) /* 4 */
+ /* skip the next compound statement if:
+ - pre-put message or
+ - no fid available (which should never occur if the MSF adheres to the WCI)
+ */
+ { // to match the closing curly bracket of above "if" in case of HCF_TYPE_USB
+ //calculate total length ;? superfluous unless CCX or Encapsulation
+ len = 0;
+ p = descp;
+ do len += p->BUF_CNT; while ( ( p = p->next_desc_addr ) != NULL );
+ p = descp;
+//;? HCFASSERT( len <= HCF_MAX_MSG, len )
+/*7*/ (void)setup_bap( ifbp, fid, HFS_TX_CNTL, IO_OUT );
+#if (HCF_TYPE) & HCF_TYPE_TX_DELAY
+ HCFASSERT( ( descp != NULL ) ^ ( tx_cntl & HFS_TX_CNTL_TX_DELAY ), tx_cntl )
+ if ( tx_cntl & HFS_TX_CNTL_TX_DELAY ) {
+ tx_cntl &= ~HFS_TX_CNTL_TX_DELAY; //!!HFS_TX_CNTL_TX_DELAY no longer available
+ ifbp->IFB_TxFID = fid;
+ fid = 0; //!!fid no longer available, be careful when modifying code
+ }
+#endif // HCF_TYPE_TX_DELAY
+ OPW( HREG_DATA_1, tx_cntl ) ;
+ OPW( HREG_DATA_1, 0 );
+#if ! ( (HCF_TYPE) & HCF_TYPE_CCX )
+ HCFASSERT( p->BUF_CNT >= 14, p->BUF_CNT )
+ /* assume DestAddr/SrcAddr/Len/Type ALWAYS contained in 1st fragment
+ * otherwise life gets too cumbersome for MIC and Encapsulation !!!!!!!!
+ if ( p->BUF_CNT >= 14 ) { alternatively: add a safety escape !!!!!!!!!!!! } */
+#endif // HCF_TYPE_CCX
+ CALC_TX_MIC( NULL, -1 ); //initialize MIC
+/*10*/ put_frag( ifbp, p->buf_addr, HCF_DASA_SIZE BE_PAR(0) ); //write DA, SA with MIC calculation
+ CALC_TX_MIC( p->buf_addr, HCF_DASA_SIZE ); //MIC over DA, SA
+ CALC_TX_MIC( null_addr, 4 ); //MIC over (virtual) priority field
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ //!!be careful do not use positive test on HCF_ACT_CCX_OFF, because IFB_CKIPStat is initially 0
+ if(( ifbp->IFB_CKIPStat == HCF_ACT_CCX_ON ) ||
+ ((GET_BUF_CNT(p) >= 20 ) && ( ifbp->IFB_CKIPStat == HCF_ACT_CCX_OFF ) &&
+ (p->buf_addr[12] == 0xAA) && (p->buf_addr[13] == 0xAA) &&
+ (p->buf_addr[14] == 0x03) && (p->buf_addr[15] == 0x00) &&
+ (p->buf_addr[16] == 0x40) && (p->buf_addr[17] == 0x96) &&
+ (p->buf_addr[18] == 0x00) && (p->buf_addr[19] == 0x00)))
+ {
+ i = HCF_DASA_SIZE;
+
+ OPW( HREG_DATA_1, CNV_SHORT_TO_BIG( len - i ));
+
+ /* need to send out the remainder of the fragment */
+ put_frag( ifbp, &p->buf_addr[i], GET_BUF_CNT(p) - i BE_PAR(0) );
+ }
+ else
+#endif // HCF_TYPE_CCX
+ {
+ //if encapsulation needed
+#if (HCF_ENCAP) == HCF_ENC
+ //write length (with SNAP-header,Type, without //DA,SA,Length ) no MIC calc.
+ if ( ( snap_header[sizeof(snap_header)-1] = hcf_encap( &p->buf_addr[HCF_DASA_SIZE] ) ) != ENC_NONE ) {
+ OPW( HREG_DATA_1, CNV_END_SHORT( len + (sizeof(snap_header) + 2) - ( 2*6 + 2 ) ) );
+ //write splice with MIC calculation
+ put_frag( ifbp, snap_header, sizeof(snap_header) BE_PAR(0) );
+ CALC_TX_MIC( snap_header, sizeof(snap_header) ); //MIC over 6 byte SNAP
+ i = HCF_DASA_SIZE;
+ } else
+#endif // HCF_ENC
+ {
+ OPW( HREG_DATA_1, *(wci_recordp)&p->buf_addr[HCF_DASA_SIZE] );
+ i = 14;
+ }
+ //complete 1st fragment starting with Type with MIC calculation
+ put_frag( ifbp, &p->buf_addr[i], p->BUF_CNT - i BE_PAR(0) );
+ CALC_TX_MIC( &p->buf_addr[i], p->BUF_CNT - i );
+ }
+ //do the remaining fragments with MIC calculation
+ while ( ( p = p->next_desc_addr ) != NULL ) {
+ /* obnoxious c:/hcf/hcf.c(1480) : warning C4769: conversion of near pointer to long integer,
+ * so skip */
+ HCFASSERT( ((hcf_32)p & 3 ) == 0, (hcf_32)p )
+ put_frag( ifbp, p->buf_addr, p->BUF_CNT BE_PAR(0) );
+ CALC_TX_MIC( p->buf_addr, p->BUF_CNT );
+ }
+ //pad message, finalize MIC calculation and write MIC to NIC
+ put_frag_finalize( ifbp );
+ }
+ if ( fid ) {
+/*16*/ rc = cmd_exe( ifbp, HCMD_BUSY | HCMD_TX | HCMD_RECL, fid );
+ ifbp->IFB_TxFID = 0;
+ /* probably this (i.e. no RscInd AND "HREG_EV_ALLOC") at this point in time occurs so infrequent,
+ * that it might just as well be acceptable to skip this
+ * "optimization" code and handle that additional interrupt once in a while
+ */
+// 180 degree error in logic ;? #if ALLOC_15
+/*20*/ if ( ifbp->IFB_RscInd == 0 ) {
+ ifbp->IFB_RscInd = get_fid( ifbp );
+ }
+// #endif // ALLOC_15
+ }
+// HCFASSERT( level::ifbp->IFB_RscInd, ifbp->IFB_RscInd )
+ HCFLOGEXIT( HCF_TRACE_SEND_MSG )
+ return rc;
+} // hcf_send_msg
+#endif // HCF_DL_ONLY
+
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.MODULE int hcf_service_nic( IFBP ifbp, wci_bufp bufp, unsigned int len )
+*.PURPOSE Services (most) NIC events.
+* Provides received message
+* Provides status information.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* In non-DMA mode:
+* bufp address of char buffer, sufficiently large to hold the first part of the RxFS up through HFS_TYPE
+* len length in bytes of buffer specified by bufp
+* value between HFS_TYPE + 2 and HFS_ADDR_DEST + HCF_MAX_MSG
+*
+*.RETURNS
+* HCF_SUCCESS
+* HCF_ERR_MIC message contains an erroneous MIC (only if frame fits completely in bufp)
+*
+*.DESCRIPTION
+*
+* MSF-accessible fields of Result Block
+* - IFB_RxLen 0 or Frame size.
+* - IFB_MBInfoLen 0 or the L-field of the oldest MBIB.
+* - IFB_RscInd
+* - IFB_HCF_Tallies updated if a corresponding event occurred.
+* - IFB_NIC_Tallies updated if a Tally Info frame received from the NIC.
+* - IFB_DmaPackets
+* - IFB_TxFsStat
+* - IFB_TxFsSwSup
+* - IFB_LinkStat reflects new link status or 0x0000 if no change relative to previous hcf_service_nic call.
+or
+* - IFB_LinkStat link status, 0x8000 reflects change relative to previous hcf_service_nic call.
+*
+* When IFB_MBInfoLen is non-zero, at least one MBIB is available.
+*
+* IFB_RxLen reflects the number of received bytes in 802.3 view (Including DestAddr, SrcAddr and Length,
+* excluding MIC-padding, MIC and sum check) of active Rx Frame Structure. If no Rx Data s available, IFB_RxLen
+* equals 0x0000.
+* Repeated execution causes the Service NIC Function to provide information about subsequently received
+* messages, irrespective whether a hcf_rcv_msg or hcf_action(HCF_ACT_RX) is performed in between.
+*
+* When IFB_RxLen is non-zero, a Received Frame Structure is available to be routed to the protocol stack.
+* When Monitor Mode is not active, this is guaranteed to be an error-free non-WMP frame.
+* In case of Monitor Mode, it may also be a frame with an error or a WMP frame.
+* Erroneous frames have a non-zero error-sub field in the HFS_STAT field in the look ahead buffer.
+*
+* If a Receive message is available in NIC RAM, the Receive Frame Structure is (partly) copied from the NIC to
+* the buffer identified by bufp.
+* Copying stops either after len bytes or when the complete 802.3 frame is copied.
+* During the copying the message is decapsulated (if appropriate).
+* If the frame is read completely by hcf_service_nic (i.e. the frame fits completely in the lookahead buffer),
+* the frame is automatically ACK'ed to the F/W and still available via the look ahead buffer and hcf_rcv_msg.
+* Only if the frame is read completely by hcf_service_nic, hcf_service_nic checks the MIC and sets the return
+* status accordingly. In this case, hcf_rcv_msg does not check the MIC.
+*
+* The MIC calculation algorithm works more efficient if the length of the look ahead buffer is
+* such that it fits exactly 4 n bytes of the 802.3 frame, i.e. len == HFS_ADDR_DEST + 4*n.
+*
+* The Service NIC Function supports the NIC event service handling process.
+* It performs the appropriate actions to service the NIC, such that the event cause is eliminated and related
+* information is saved.
+* The Service NIC Function is executed by the MSF ISR or polling routine as first step to determine the event
+* cause(s). It is the responsibility of the MSF to perform all not directly NIC related interrupt service
+* actions, e.g. in a PC environment this includes servicing the PIC, and managing the Processor Interrupt
+* Enabling/Disabling.
+* In case of a polled based system, the Service NIC Function must be executed "frequently".
+* The Service NIC Function may have side effects related to the Mailbox and Resource Indicator (IFB_RscInd).
+*
+* hcf_service_nic returns:
+* - The length of the data in the available MBIB (IFB_MBInfoLen)
+* - Changes in the link status (IFB_LinkStat)
+* - The length of the data in the available Receive Frame Structure (IFB_RxLen)
+* - updated IFB_RscInd
+* - Updated Tallies
+*
+* hcf_service_nic is presumed to neither interrupt other HCF-tasks nor to be interrupted by other HCF-tasks.
+* A way to achieve this is to precede hcf_service_nic as well as all other HCF-tasks with a call to
+* hcf_action to disable the card interrupts and, after all work is completed, with a call to hcf_action to
+* restore (which is not necessarily the same as enabling) the card interrupts.
+* In case of a polled environment, it is assumed that the MSF programmer is sufficiently familiar with the
+* specific requirements of that environment to translate the interrupt strategy to a polled strategy.
+*
+* hcf_service_nic services the following Hermes events:
+* - HREG_EV_INFO Asynchronous Information Frame
+* - HREG_EV_INFO_DROP WMAC did not have sufficient RAM to build Unsolicited Information Frame
+* - HREG_EV_TX_EXC (if applicable, i.e. selected via HCF_EXT_INT_TX_EX bit of HCF_EXT)
+* - HREG_EV_SLEEP_REQ (if applicable, i.e. selected via HCF_DDS/HCF_CDS bit of HCF_SLEEP)
+* ** in non_DMA mode
+* - HREG_EV_ALLOC Asynchronous part of Allocation/Reclaim completed while out of resources at
+* completion of hcf_send_msg/notify
+* - HREG_EV_RX the detection of the availability of received messages
+* including WaveLAN Management Protocol (WMP) message processing
+* ** in DMA mode
+* - HREG_EV_RDMAD
+* - HREG_EV_TDMAD
+*!! hcf_service_nic does not service the following Hermes events:
+*!! HREG_EV_TX (the "OK" Tx Event) is no longer supported by the WCI, if it occurs it is unclear
+*!! what the cause is, so no meaningful strategy is available. Not acking the bit is
+*!! probably the best help that can be given to the debugger.
+*!! HREG_EV_CMD handled in cmd_wait.
+*!! HREG_EV_FW_DMA (i.e. HREG_EV_RXDMA, HREG_EV_TXDMA and_EV_LPESC) are either not used or used
+*!! between the F/W and the DMA engine.
+*!! HREG_EV_ACK_REG_READY is only applicable for H-II (i.e. not HII.5 and up, see DAWA)
+*
+* If, in non-DMA mode, a Rx message is available, its length is reflected by the IFB_RxLen field of the IFB.
+* This length reflects the data itself and the Destination Address, Source Address and DataLength/Type field
+* but not the SNAP-header in case of decapsulation by the HCF. If no message is available, IFB_RxLen is
+* zero. Former versions of the HCF handled WMP messages and supported a "monitor" mode in hcf_service_nic,
+* which deposited certain or all Rx messages in the MailBox. The responsibility to handle these frames is
+* moved to the MSF. The HCF offers as supports hcf_put_info with CFG_MB_INFO as parameter to emulate the old
+* implementation under control of the MSF.
+*
+* **Rx Buffer free strategy
+* When hcf_service_nic reports the availability of a non-DMA message, the MSF can access that message by
+* means of hcf_rcv_msg. It must be prevented that the LAN Controller writes new data in the NIC buffer
+* before the MSF is finished with the current message. The NIC buffer is returned to the LAN Controller
+* when:
+* - the complete frame fits in the lookahead buffer or
+* - hcf_rcv_msg is called or
+* - hcf_action with HCF_ACT_RX is called or
+* - hcf_service_nic is called again
+* It can be reasoned that hcf_action( INT_ON ) should not be given before the MSF has completely processed
+* a reported Rx-frame. The reason is that the INT_ON action is guaranteed to cause a (Rx-)interrupt (the
+* MSF is processing a Rx-frame, hence the Rx-event bit in the Hermes register must be active). This
+* interrupt will cause hcf_service_nic to be called, which will cause the ack-ing of the "last" Rx-event
+* to the Hermes, causing the Hermes to discard the associated NIC RAM buffer.
+* Assert fails if
+* - ifbp is zero or other recognizable out-of-range value.
+* - hcf_service_nic is called without a prior call to hcf_connect.
+* - interrupts are enabled.
+* - reentrancy, may be caused by calling hcf_functions without adequate protection
+* against NIC interrupts or multi-threading.
+*
+*
+*.DIAGRAM
+*1: IFB_LinkStat is cleared, if a LinkStatus frame is received, IFB_LinkStat will be updated accordingly
+* by isr_info.
+or
+*1: IFB_LinkStat change indication is cleared. If a LinkStatus frame is received, IFB_LinkStat will be updated
+* accordingly by isr_info.
+*2: IFB_RxLen must be cleared before the NIC presence check otherwise:
+* - this value may stay non-zero if the NIC is pulled out at an inconvenient moment.
+* - the RxAck on a zero-FID needs a zero-value for IFB_RxLen to work
+* Note that as side-effect of the hcf_action call, the remainder of Rx related info is re-initialized as
+* well.
+*4: In case of Defunct mode, the information supplied by Hermes is unreliable, so the body of
+* hcf_service_nic is skipped. Since hcf_cntl turns into a NOP if Primary or Station F/W is incompatible,
+* hcf_service_nic is also skipped in those cases.
+* To prevent that hcf_service_nic reports bogus information to the MSF with all - possibly difficult to
+* debug - undesirable side effects, it is paramount to check the NIC presence. In former days the presence
+* test was based on the Hermes register HREG_SW_0. Since in HCF_ACT_INT_OFF is choosen for strategy based on
+* HREG_EV_STAT, this is now also used in hcf_service_nic. The motivation to change strategy is partly
+* due to inconsistent F/W implementations with respect to HREG_SW_0 manipulation around reset and download.
+* Note that in polled environments Card Removal is not detected by INT_OFF which makes the check in
+* hcf_service_nic even more important.
+*8: The event status register of the Hermes is sampled
+* The assert checks for unexpected events ;?????????????????????????????????????.
+* - HREG_EV_INFO_DROP is explicitly excluded from the acceptable HREG_EV_STAT bits because it indicates
+* a too heavily loaded system.
+* - HREG_EV_ACK_REG_READY is 0x0000 for H-I (and hopefully H-II.5)
+*
+*
+* HREG_EV_TX_EXC is accepted (via HREG_EV_TX_EXT) if and only if HCF_EXT_INT_TX_EX set in the HCF_EXT
+* definition at compile time.
+* The following activities are handled:
+* - Alloc events are handled by hcf_send_msg (and notify). Only if there is no "spare" resource, the
+* alloc event is superficially serviced by hcf_service_nic to create a pseudo-resource with value
+* 0x001. This value is recognized by get_fid (called by hcf_send_msg and notify) where the real
+* TxFid is retrieved and the Hermes is acked and - hopefully - the "normal" case with a spare TxFid
+* in IFB_RscInd is restored.
+* - Info drop events are handled by incrementing a tally
+* - LinkEvent (including solicited and unsolicited tallies) are handled by procedure isr_info.
+* - TxEx (if selected at compile time) is handled by copying the significant part of the TxFS
+* into the IFB for further processing by the MSF.
+* Note the complication of the zero-FID protection sub-scheme in DAWA.
+* Note, the Ack of all of above events is handled at the end of hcf_service_nic
+*16: In case of non-DMA ( either not compiled in or due to a run-time choice):
+* If an Rx-frame is available, first the FID of that frame is read, including the complication of the
+* zero-FID protection sub-scheme in DAWA. Note that such a zero-FID is acknowledged at the end of
+* hcf_service_nic and that this depends on the IFB_RxLen initialization in the begin of hcf_service_nic.
+* The Assert validates the HCF assumption about Hermes implementation upon which the range of
+* Pseudo-RIDs is based.
+* Then the control fields up to the start of the 802.3 frame are read from the NIC into the lookahead buffer.
+* The status field is converted to native Endianess.
+* The length is, after implicit Endianess conversion if needed, and adjustment for the 14 bytes of the
+* 802.3 MAC header, stored in IFB_RxLen.
+* In MAC Monitor mode, 802.11 control frames with a TOTAL length of 14 are received, so without this
+* length adjustment, IFB_RxLen could not be used to distinguish these frames from "no frame".
+* No MIC calculation processes are associated with the reading of these Control fields.
+*26: This length test feels like superfluous robustness against malformed frames, but it turned out to be
+* needed in the real (hostile) world.
+* The decapsulation check needs sufficient data to represent DA, SA, L, SNAP and Type which amounts to
+* 22 bytes. In MAC Monitor mode, 802.11 control frames with a smaller length are received. To prevent
+* that the implementation goes haywire, a check on the length is needed.
+* The actual decapsulation takes place on the fly in the copying process by overwriting the SNAP header.
+* Note that in case of decapsulation the SNAP header is not passed to the MSF, hence IFB_RxLen must be
+* compensated for the SNAP header length.
+* The 22 bytes needed for decapsulation are (more than) sufficient for the exceptional handling of the
+* MIC algorithm of the L-field (replacing the 2 byte L-field with 4 0x00 bytes).
+*30: The 12 in the no-SSN branch corresponds with the get_frag, the 2 with the IPW of the SSN branch
+*32: If Hermes reported MIC-presence, than the MIC engine is initialized with the non-dummy MIC calculation
+* routine address and appropriate key.
+*34: The 8 bytes after the DA, SA, L are read and it is checked whether decapsulation is needed i.e.:
+* - the Hermes reported Tunnel encapsulation or
+* - the Hermes reported 1042 Encapsulation and hcf_encap reports that the HCF would not have used
+* 1042 as the encapsulation mechanism
+* Note that the first field of the RxFS in bufp has Native Endianess due to the conversion done by the
+* BE_PAR in get_frag.
+*36: The Type field is the only word kept (after moving) of the just read 8 bytes, it is moved to the
+* L-field. The original L-field and 6 byte SNAP header are discarded, so IFB_RxLen and buf_addr must
+* be adjusted by 8.
+*40: Determine how much of the frame (starting with DA) fits in the Lookahead buffer, then read the not-yet
+* read data into the lookahead buffer.
+* If the lookahead buffer contains the complete message, check the MIC. The majority considered this
+* I/F more appropriate then have the MSF call hcf_get_data only to check the MIC.
+*44: Since the complete message is copied from NIC RAM to PC RAM, the Rx can be acknowledged to the Hermes
+* to optimize the flow ( a better chance to get new Rx data in the next pass through hcf_service_nic ).
+* This acknowledgement can not be done via hcf_action( HCF_ACT_RX_ACK ) because this also clears
+* IFB_RxLEN thus corrupting the I/F to the MSF.
+*;?: In case of DMA (compiled in and activated):
+
+
+*54: Limiting the number of places where the F/W is acked (e.g. the merging of the Rx-ACK with the other
+* ACKs), is supposed to diminish the potential of race conditions in the F/W.
+* Note 1: The CMD event is acknowledged in cmd_cmpl
+* Note 2: HREG_EV_ACK_REG_READY is 0x0000 for H-I (and hopefully H-II.5)
+* Note 3: The ALLOC event is acknowledged in get_fid (except for the initialization flow)
+*
+*.NOTICE
+* The Non-DMA HREG_EV_RX is handled different compared with the other F/W events.
+* The HREG_EV_RX event is acknowledged by the first hcf_service_nic call after the
+* hcf_service_nic call that reported the occurrence of this event.
+* This acknowledgment
+* makes the next Receive Frame Structure (if any) available.
+* An updated IFB_RxLen
+* field reflects this availability.
+*
+*.NOTICE
+* The minimum size for Len must supply space for:
+* - an F/W dependent number of bytes of Control Info field including the 802.11 Header field
+* - Destination Address
+* - Source Address
+* - Length field
+* - [ SNAP Header]
+* - [ Ethernet-II Type]
+* This results in 68 for Hermes-I and 80 for Hermes-II
+* This way the minimum amount of information is available needed by the HCF to determine whether the frame
+* must be decapsulated.
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+hcf_service_nic( IFBP ifbp, wci_bufp bufp, unsigned int len )
+{
+
+int rc = HCF_SUCCESS;
+hcf_16 stat;
+wci_bufp buf_addr;
+hcf_16 i;
+
+ HCFLOGENTRY( HCF_TRACE_SERVICE_NIC, ifbp->IFB_IntOffCnt )
+ HCFASSERT( ifbp->IFB_Magic == HCF_MAGIC, ifbp->IFB_Magic )
+ HCFASSERT_INT
+
+ ifbp->IFB_LinkStat = 0; // ;? to be obsoleted ASAP /* 1*/
+ ifbp->IFB_DSLinkStat &= ~CFG_LINK_STAT_CHANGE; /* 1*/
+ (void)hcf_action( ifbp, HCF_ACT_RX_ACK ); /* 2*/
+ if ( ifbp->IFB_CardStat == 0 && ( stat = IPW( HREG_EV_STAT ) ) != 0xFFFF ) { /* 4*/
+/* IF_NOT_DMA( HCFASSERT( !( stat & ~HREG_EV_BASIC_MASK, stat ) )
+ * IF_NOT_USE_DMA( HCFASSERT( !( stat & ~HREG_EV_BASIC_MASK, stat ) )
+ * IF_USE_DMA( HCFASSERT( !( stat & ~( HREG_EV_BASIC_MASK ^ ( HREG_EV_...DMA.... ), stat ) )
+ */
+ /* 8*/
+ if ( ifbp->IFB_RscInd == 0 && stat & HREG_EV_ALLOC ) { //Note: IFB_RscInd is ALWAYS 1 for DMA
+ ifbp->IFB_RscInd = 1;
+ }
+ IF_TALLY( if ( stat & HREG_EV_INFO_DROP ) ifbp->IFB_HCF_Tallies.NoBufInfo++; )
+#if (HCF_EXT) & HCF_EXT_INT_TICK
+ if ( stat & HREG_EV_TICK ) {
+ ifbp->IFB_TickCnt++;
+ }
+#if 0 // (HCF_SLEEP) & HCF_DDS
+ if ( ifbp->IFB_TickCnt == 3 && ( ifbp->IFB_DSLinkStat & CFG_LINK_STAT_CONNECTED ) == 0 ) {
+CFG_DDS_TICK_TIME_STRCT ltv;
+ // 2 second period (with 1 tick uncertanty) in not-connected mode -->go into DS_OOR
+ hcf_action( ifbp, HCF_ACT_SLEEP );
+ ifbp->IFB_DSLinkStat |= CFG_LINK_STAT_DS_OOR; //set OutOfRange
+ ltv.len = 2;
+ ltv.typ = CFG_DDS_TICK_TIME;
+ ltv.tick_time = ( ( ifbp->IFB_DSLinkStat & CFG_LINK_STAT_TIMER ) + 0x10 ) *64; //78 is more right
+ hcf_put_info( ifbp, (LTVP)&ltv );
+ printk( "<5>Preparing for sleep, link_status: %04X, timer : %d\n",
+ ifbp->IFB_DSLinkStat, ltv.tick_time );//;?remove me 1 day
+ ifbp->IFB_TickCnt++; //;?just to make sure we do not keep on printing above message
+ if ( ltv.tick_time < 300 * 125 ) ifbp->IFB_DSLinkStat += 0x0010;
+
+ }
+#endif // HCF_DDS
+#endif // HCF_EXT_INT_TICK
+ if ( stat & HREG_EV_INFO ) {
+ isr_info( ifbp );
+ }
+#if (HCF_EXT) & HCF_EXT_INT_TX_EX
+ if ( stat & HREG_EV_TX_EXT && ( i = IPW( HREG_TX_COMPL_FID ) ) != 0 /*DAWA*/ ) {
+ DAWA_ZERO_FID( HREG_TX_COMPL_FID )
+ (void)setup_bap( ifbp, i, 0, IO_IN );
+ get_frag( ifbp, &ifbp->IFB_TxFsStat, HFS_SWSUP BE_PAR(1) );
+ }
+#endif // HCF_EXT_INT_TX_EX
+//!rlav DMA engine will handle the rx event, not the driver
+#if HCF_DMA
+ if ( !( ifbp->IFB_CntlOpt & USE_DMA ) ) //!! be aware of the logical indentations
+#endif // HCF_DMA
+/*16*/ if ( stat & HREG_EV_RX && ( ifbp->IFB_RxFID = IPW( HREG_RX_FID ) ) != 0 ) { //if 0 then DAWA_ACK
+ HCFASSERT( bufp, len )
+ HCFASSERT( len >= HFS_DAT + 2, len )
+ DAWA_ZERO_FID( HREG_RX_FID )
+ HCFASSERT( ifbp->IFB_RxFID < CFG_PROD_DATA, ifbp->IFB_RxFID)
+ (void)setup_bap( ifbp, ifbp->IFB_RxFID, 0, IO_IN );
+ get_frag( ifbp, bufp, HFS_ADDR_DEST BE_PAR(1) );
+ ifbp->IFB_lap = buf_addr = bufp + HFS_ADDR_DEST;
+ ifbp->IFB_RxLen = (hcf_16)(bufp[HFS_DAT_LEN] + (bufp[HFS_DAT_LEN+1]<<8) + 2*6 + 2);
+/*26*/ if ( ifbp->IFB_RxLen >= 22 ) { // convenient for MIC calculation (5 DWs + 1 "skipped" W)
+ //. get DA,SA,Len/Type and (SNAP,Type or 8 data bytes)
+/*30*/ get_frag( ifbp, buf_addr, 22 BE_PAR(0) );
+/*32*/ CALC_RX_MIC( bufp, -1 ); //. initialize MIC
+ CALC_RX_MIC( buf_addr, HCF_DASA_SIZE ); //. MIC over DA, SA
+ CALC_RX_MIC( null_addr, 4 ); //. MIC over (virtual) priority field
+ CALC_RX_MIC( buf_addr+14, 8 ); //. skip Len, MIC over SNAP,Type or 8 data bytes)
+ buf_addr += 22;
+#if (HCF_TYPE) & HCF_TYPE_CCX
+//!!be careful do not use positive test on HCF_ACT_CCX_OFF, because IFB_CKIPStat is initially 0
+ if( ifbp->IFB_CKIPStat != HCF_ACT_CCX_ON )
+#endif // HCF_TYPE_CCX
+ {
+#if (HCF_ENCAP) == HCF_ENC
+ HCFASSERT( len >= HFS_DAT + 2 + sizeof(snap_header), len )
+/*34*/ i = *(wci_recordp)&bufp[HFS_STAT] & ( HFS_STAT_MSG_TYPE | HFS_STAT_ERR );
+ if ( i == HFS_STAT_TUNNEL ||
+ ( i == HFS_STAT_1042 && hcf_encap( (wci_bufp)&bufp[HFS_TYPE] ) != ENC_TUNNEL ) ) {
+ //. copy E-II Type to 802.3 LEN field
+/*36*/ bufp[HFS_LEN ] = bufp[HFS_TYPE ];
+ bufp[HFS_LEN+1] = bufp[HFS_TYPE+1];
+ //. discard Snap by overwriting with data
+ ifbp->IFB_RxLen -= (HFS_TYPE - HFS_LEN);
+ buf_addr -= ( HFS_TYPE - HFS_LEN ); // this happens to bring us at a DW boundary of 36
+ }
+#endif // HCF_ENC
+ }
+ }
+/*40*/ ifbp->IFB_lal = min( (hcf_16)(len - HFS_ADDR_DEST), ifbp->IFB_RxLen );
+ i = ifbp->IFB_lal - ( buf_addr - ( bufp + HFS_ADDR_DEST ) );
+ get_frag( ifbp, buf_addr, i BE_PAR(0) );
+ CALC_RX_MIC( buf_addr, i );
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ if ( ifbp->IFB_lal == ifbp->IFB_RxLen ) {
+ rc = check_mic( ifbp );
+ }
+#endif // HCF_TYPE_WPA
+/*44*/ if ( len - HFS_ADDR_DEST >= ifbp->IFB_RxLen ) {
+ ifbp->IFB_RxFID = 0;
+ } else { /* IFB_RxFID is cleared, so you do not get another Rx_Ack at next entry of hcf_service_nic */
+ stat &= (hcf_16)~HREG_EV_RX; //don't ack Rx if processing not yet completed
+ }
+ }
+ // in case of DMA: signal availability of rx and/or tx packets to MSF
+ IF_USE_DMA( ifbp->IFB_DmaPackets |= stat & ( HREG_EV_RDMAD | HREG_EV_TDMAD ); )
+ // rlav : pending HREG_EV_RDMAD or HREG_EV_TDMAD events get acknowledged here.
+/*54*/ stat &= (hcf_16)~( HREG_EV_SLEEP_REQ | HREG_EV_CMD | HREG_EV_ACK_REG_READY | HREG_EV_ALLOC | HREG_EV_FW_DMA );
+//a positive mask would be easier to understand /*54*/ stat &= (hcf_16)~( HREG_EV_SLEEP_REQ | HREG_EV_CMD | HREG_EV_ACK_REG_READY | HREG_EV_ALLOC | HREG_EV_FW_DMA );
+ IF_USE_DMA( stat &= (hcf_16)~HREG_EV_RX; )
+ if ( stat ) {
+ DAWA_ACK( stat ); /*DAWA*/
+ }
+ }
+ HCFLOGEXIT( HCF_TRACE_SERVICE_NIC )
+ return rc;
+} // hcf_service_nic
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+************************** H C F S U P P O R T R O U T I N E S ******************************************
+************************************************************************************************************/
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE void calc_mic( hcf_32* p, hcf_32 m )
+*.PURPOSE calculate MIC on a quad byte.
+*
+*.ARGUMENTS
+* p address of the MIC
+* m 32 bit value to be processed by the MIC calculation engine
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* calc_mic is the implementation of the MIC algorithm. It is a monkey-see monkey-do copy of
+* Michael::appendByte()
+* of Appendix C of ..........
+*
+*
+*.DIAGRAM
+*
+*.NOTICE
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+
+#define ROL32( A, n ) ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
+#define ROR32( A, n ) ROL32( (A), 32-(n) )
+
+#define L *p
+#define R *(p+1)
+
+void
+calc_mic( hcf_32* p, hcf_32 m )
+{
+#if HCF_BIG_ENDIAN
+ m = (m >> 16) | (m << 16);
+#endif // HCF_BIG_ENDIAN
+ L ^= m;
+ R ^= ROL32( L, 17 );
+ L += R;
+ R ^= ((L & 0xff00ff00) >> 8) | ((L & 0x00ff00ff) << 8);
+ L += R;
+ R ^= ROL32( L, 3 );
+ L += R;
+ R ^= ROR32( L, 2 );
+ L += R;
+} // calc_mic
+#undef R
+#undef L
+#endif // HCF_TYPE_WPA
+
+
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+/************************************************************************************************************
+*
+*.SUBMODULE void calc_mic_rx_frag( IFBP ifbp, wci_bufp p, int len )
+*.PURPOSE calculate MIC on a single fragment.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* bufp (byte) address of buffer
+* len length in bytes of buffer specified by bufp
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* calc_mic_rx_frag ........
+*
+* The MIC is located in the IFB.
+* The MIC is separate for Tx and Rx, thus allowing hcf_send_msg to occur between hcf_service_nic and
+* hcf_rcv_msg.
+*
+*
+*.DIAGRAM
+*
+*.NOTICE
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+void
+calc_mic_rx_frag( IFBP ifbp, wci_bufp p, int len )
+{
+static union { hcf_32 x32; hcf_16 x16[2]; hcf_8 x8[4]; } x; //* area to accumulate 4 bytes input for MIC engine
+int i;
+
+ if ( len == -1 ) { //initialize MIC housekeeping
+ i = *(wci_recordp)&p[HFS_STAT];
+ /* i = CNV_SHORTP_TO_LITTLE(&p[HFS_STAT]); should not be neede to prevent alignment poroblems
+ * since len == -1 if and only if p is lookahaead buffer which MUST be word aligned
+ * to be re-investigated by NvR
+ */
+
+ if ( ( i & HFS_STAT_MIC ) == 0 ) {
+ ifbp->IFB_MICRxCarry = 0xFFFF; //suppress MIC calculation
+ } else {
+ ifbp->IFB_MICRxCarry = 0;
+//* Note that "coincidentally" the bit positions used in HFS_STAT
+//* correspond with the offset of the key in IFB_MICKey
+ i = ( i & HFS_STAT_MIC_KEY_ID ) >> 10; /* coincidentally no shift needed for i itself */
+ ifbp->IFB_MICRx[0] = CNV_LONG_TO_LITTLE(ifbp->IFB_MICRxKey[i ]);
+ ifbp->IFB_MICRx[1] = CNV_LONG_TO_LITTLE(ifbp->IFB_MICRxKey[i+1]);
+ }
+ } else {
+ if ( ifbp->IFB_MICRxCarry == 0 ) {
+ x.x32 = CNV_LONGP_TO_LITTLE(p);
+ p += 4;
+ if ( len < 4 ) {
+ ifbp->IFB_MICRxCarry = (hcf_16)len;
+ } else {
+ ifbp->IFB_MICRxCarry = 4;
+ len -= 4;
+ }
+ } else while ( ifbp->IFB_MICRxCarry < 4 && len ) { //note for hcf_16 applies: 0xFFFF > 4
+ x.x8[ifbp->IFB_MICRxCarry++] = *p++;
+ len--;
+ }
+ while ( ifbp->IFB_MICRxCarry == 4 ) { //contrived so we have only 1 call to calc_mic so we could bring it in-line
+ calc_mic( ifbp->IFB_MICRx, x.x32 );
+ x.x32 = CNV_LONGP_TO_LITTLE(p);
+ p += 4;
+ if ( len < 4 ) {
+ ifbp->IFB_MICRxCarry = (hcf_16)len;
+ }
+ len -= 4;
+ }
+ }
+} // calc_mic_rx_frag
+#endif // HCF_TYPE_WPA
+
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+/************************************************************************************************************
+*
+*.SUBMODULE void calc_mic_tx_frag( IFBP ifbp, wci_bufp p, int len )
+*.PURPOSE calculate MIC on a single fragment.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* bufp (byte) address of buffer
+* len length in bytes of buffer specified by bufp
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* calc_mic_tx_frag ........
+*
+* The MIC is located in the IFB.
+* The MIC is separate for Tx and Rx, thus allowing hcf_send_msg to occur between hcf_service_nic and
+* hcf_rcv_msg.
+*
+*
+*.DIAGRAM
+*
+*.NOTICE
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+void
+calc_mic_tx_frag( IFBP ifbp, wci_bufp p, int len )
+{
+static union { hcf_32 x32; hcf_16 x16[2]; hcf_8 x8[4]; } x; //* area to accumulate 4 bytes input for MIC engine
+
+ //if initialization request
+ if ( len == -1 ) {
+ //. presume MIC calculation disabled
+ ifbp->IFB_MICTxCarry = 0xFFFF;
+ //. if MIC calculation enabled
+ if ( ifbp->IFB_MICTxCntl ) {
+ //. . clear MIC carry
+ ifbp->IFB_MICTxCarry = 0;
+ //. . initialize MIC-engine
+ ifbp->IFB_MICTx[0] = CNV_LONG_TO_LITTLE(ifbp->IFB_MICTxKey[0]); /*Tx always uses Key 0 */
+ ifbp->IFB_MICTx[1] = CNV_LONG_TO_LITTLE(ifbp->IFB_MICTxKey[1]);
+ }
+ //else
+ } else {
+ //. if MIC enabled (Tx) / if MIC present (Rx)
+ //. and no carry from previous calc_mic_frag
+ if ( ifbp->IFB_MICTxCarry == 0 ) {
+ //. . preset accu with 4 bytes from buffer
+ x.x32 = CNV_LONGP_TO_LITTLE(p);
+ //. . adjust pointer accordingly
+ p += 4;
+ //. . if buffer contained less then 4 bytes
+ if ( len < 4 ) {
+ //. . . promote valid bytes in accu to carry
+ //. . . flag accu to contain incomplete double word
+ ifbp->IFB_MICTxCarry = (hcf_16)len;
+ //. . else
+ } else {
+ //. . . flag accu to contain complete double word
+ ifbp->IFB_MICTxCarry = 4;
+ //. . adjust remaining buffer length
+ len -= 4;
+ }
+ //. else if MIC enabled
+ //. and if carry bytes from previous calc_mic_tx_frag
+ //. . move (1-3) bytes from carry into accu
+ } else while ( ifbp->IFB_MICTxCarry < 4 && len ) { /* note for hcf_16 applies: 0xFFFF > 4 */
+ x.x8[ifbp->IFB_MICTxCarry++] = *p++;
+ len--;
+ }
+ //. while accu contains complete double word
+ //. and MIC enabled
+ while ( ifbp->IFB_MICTxCarry == 4 ) {
+ //. . pass accu to MIC engine
+ calc_mic( ifbp->IFB_MICTx, x.x32 );
+ //. . copy next 4 bytes from buffer to accu
+ x.x32 = CNV_LONGP_TO_LITTLE(p);
+ //. . adjust buffer pointer
+ p += 4;
+ //. . if buffer contained less then 4 bytes
+ //. . . promote valid bytes in accu to carry
+ //. . . flag accu to contain incomplete double word
+ if ( len < 4 ) {
+ ifbp->IFB_MICTxCarry = (hcf_16)len;
+ }
+ //. . adjust remaining buffer length
+ len -= 4;
+ }
+ }
+} // calc_mic_tx_frag
+#endif // HCF_TYPE_WPA
+
+
+#if HCF_PROT_TIME
+/************************************************************************************************************
+*
+*.SUBMODULE void calibrate( IFBP ifbp )
+*.PURPOSE calibrates the S/W protection counter against the Hermes Timer tick.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* calibrates the S/W protection counter against the Hermes Timer tick
+* IFB_TickIni is the value used to initialize the S/W protection counter such that the expiration period
+* more or less independent of the processor speed. If IFB_TickIni is not yet calibrated, it is done now.
+* This calibration is "reasonably" accurate because the Hermes is in a quiet state as a result of the
+* Initialize command.
+*
+*
+*.DIAGRAM
+*
+*1: IFB_TickIni is initialized at INI_TICK_INI by hcf_connect. If calibrate succeeds, IFB_TickIni is
+* guaranteed to be changed. As a consequence there will be only 1 shot at calibration (regardless of the
+* number of init calls) under normal circumstances.
+*2: Calibration is done HCF_PROT_TIME_CNT times. This diminish the effects of jitter and interference,
+* especially in a pre-emptive environment. HCF_PROT_TIME_CNT is in the range of 16 through 32 and derived
+* from the HCF_PROT_TIME specified by the MSF programmer. The divisor needed to scale HCF_PROT_TIME into the
+* 16-32 range, is used as a multiplicator after the calibration, to scale the found value back to the
+* requested range. This way a compromise is achieved between accuracy and duration of the calibration
+* process.
+*3: Acknowledge the Timer Tick Event.
+* Each cycle is limited to at most INI_TICK_INI samples of the TimerTick status of the Hermes.
+* Since the start of calibrate is unrelated to the Hermes Internal Timer, the first interval may last from 0
+* to the normal interval, all subsequent intervals should be the full length of the Hermes Tick interval.
+* The Hermes Timer Tick is not reprogrammed by the HCF, hence it is running at the default of 10 k
+* microseconds.
+*4: If the Timer Tick Event is continuously up (prot_cnt still has the value INI_TICK_INI) or no Timer Tick
+* Event occurred before the protection counter expired, reset IFB_TickIni to INI_TICK_INI,
+* set the defunct bit of IFB_CardStat (thus rendering the Hermes inoperable) and exit the calibrate routine.
+*8: ifbp->IFB_TickIni is multiplied to scale the found value back to the requested range as explained under 2.
+*
+*.NOTICE
+* o Although there are a number of viewpoints possible, calibrate() uses as error strategy that a single
+* failure of the Hermes TimerTick is considered fatal.
+* o There is no hard and concrete time-out value defined for Hermes activities. The default 1 seconds is
+* believed to be sufficiently "relaxed" for real life and to be sufficiently short to be still useful in an
+* environment with humans.
+* o Note that via IFB_DefunctStat time outs in cmd_wait and in hcfio_string block all Hermes access till the
+* next init so functions which call a mix of cmd_wait and hcfio_string only need to check the return status
+* of the last call
+* o The return code is preset at Time out.
+* The additional complication that no calibrated value for the protection count can be assumed since
+* calibrate() does not yet have determined a calibrated value (a catch 22), is handled by setting the
+* initial value at INI_TICK_INI (by hcf_connect). This approach is considered safe, because:
+* - the HCF does not use the pipeline mechanism of Hermes commands.
+* - the likelihood of failure (the only time when protection count is relevant) is small.
+* - the time will be sufficiently large on a fast machine (busy bit drops on good NIC before counter
+* expires)
+* - the time will be sufficiently small on a slow machine (counter expires on bad NIC before the end user
+* switches the power off in despair
+* The time needed to wrap a 32 bit counter around is longer than many humans want to wait, hence the more or
+* less arbitrary value of 0x40000L is chosen, assuming it does not take too long on an XT and is not too
+* short on a scream-machine.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC void
+calibrate( IFBP ifbp )
+{
+int cnt = HCF_PROT_TIME_CNT;
+hcf_32 prot_cnt;
+
+ HCFTRACE( ifbp, HCF_TRACE_CALIBRATE );
+ if ( ifbp->IFB_TickIni == INI_TICK_INI ) { /*1*/
+ ifbp->IFB_TickIni = 0; /*2*/
+ while ( cnt-- ) {
+ prot_cnt = INI_TICK_INI;
+ OPW( HREG_EV_ACK, HREG_EV_TICK ); /*3*/
+ while ( (IPW( HREG_EV_STAT ) & HREG_EV_TICK) == 0 && --prot_cnt ) {
+ ifbp->IFB_TickIni++;
+ }
+ if ( prot_cnt == 0 || prot_cnt == INI_TICK_INI ) { /*4*/
+ ifbp->IFB_TickIni = INI_TICK_INI;
+ ifbp->IFB_DefunctStat = HCF_ERR_DEFUNCT_TIMER;
+ ifbp->IFB_CardStat |= CARD_STAT_DEFUNCT;
+ HCFASSERT( DO_ASSERT, prot_cnt )
+ }
+ }
+ ifbp->IFB_TickIni <<= HCF_PROT_TIME_SHFT; /*8*/
+ }
+ HCFTRACE( ifbp, HCF_TRACE_CALIBRATE | HCF_TRACE_EXIT );
+} // calibrate
+#endif // HCF_PROT_TIME
+
+
+#if (HCF_DL_ONLY) == 0
+#if (HCF_TYPE) & HCF_TYPE_WPA
+/************************************************************************************************************
+*
+*.SUBMODULE int check_mic( IFBP ifbp )
+*.PURPOSE verifies the MIC of a received non-USB frame.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* HCF_SUCCESS
+* HCF_ERR_MIC
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*
+*4: test whether or not a MIC is reported by the Hermes
+*14: the calculated MIC and the received MIC are compared, the return status is set when there is a mismatch
+*
+*.NOTICE
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+int
+check_mic( IFBP ifbp )
+{
+int rc = HCF_SUCCESS;
+hcf_32 x32[2]; //* area to save rcvd 8 bytes MIC
+
+ //if MIC present in RxFS
+ if ( *(wci_recordp)&ifbp->IFB_lap[-HFS_ADDR_DEST] & HFS_STAT_MIC ) {
+ //or if ( ifbp->IFB_MICRxCarry != 0xFFFF )
+ CALC_RX_MIC( mic_pad, 8 ); //. process up to 3 remaining bytes of data and append 5 to 8 bytes of padding to MIC calculation
+ get_frag( ifbp, (wci_bufp)x32, 8 BE_PAR(0));//. get 8 byte MIC from NIC
+ //. if calculated and received MIC do not match
+ //. . set status at HCF_ERR_MIC
+/*14*/ if ( x32[0] != CNV_LITTLE_TO_LONG(ifbp->IFB_MICRx[0]) ||
+ x32[1] != CNV_LITTLE_TO_LONG(ifbp->IFB_MICRx[1]) ) {
+ rc = HCF_ERR_MIC;
+ }
+ }
+ //return status
+ return rc;
+} // check_mic
+#endif // HCF_TYPE_WPA
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE int cmd_cmpl( IFBP ifbp )
+*.PURPOSE waits for Hermes Command Completion.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* IFB_DefunctStat
+* HCF_ERR_TIME_OUT
+* HCF_ERR_DEFUNCT_CMD_SEQ
+* HCF_SUCCESS
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*
+*2: Once cmd_cmpl is called, the Busy option bit in IFB_Cmd must be cleared
+*4: If Status register and command code don't match either:
+* - the Hermes and Host are out of sync ( a fatal error)
+* - error bits are reported via the Status Register.
+* Out of sync is considered fatal and brings the HCF in Defunct mode
+* Errors reported via the Status Register should be caused by sequence violations in Hermes command
+* sequences and hence these bugs should have been found during engineering testing. Since there is no
+* strategy to cope with this problem, it might as well be ignored at run time. Note that for any particular
+* situation where a strategy is formulated to handle the consequences of a particular bug causing a
+* particular Error situation reported via the Status Register, the bug should be removed rather than adding
+* logic to cope with the consequences of the bug.
+* There have been HCF versions where an error report via the Status Register even brought the HCF in defunct
+* mode (although it was not yet named like that at that time). This is particular undesirable behavior for a
+* general library.
+* Simply reporting the error (as "interesting") is debatable. There also have been HCF versions with this
+* strategy using the "vague" HCF_FAILURE code.
+* The error is reported via:
+* - MiscErr tally of the HCF Tally set
+* - the (informative) fields IFB_ErrCmd and IFB_ErrQualifier
+* - the assert mechanism
+*8: Here the Defunct case and the Status error are separately treated
+*
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC int
+cmd_cmpl( IFBP ifbp )
+{
+
+PROT_CNT_INI
+int rc = HCF_SUCCESS;
+hcf_16 stat;
+
+ HCFLOGENTRY( HCF_TRACE_CMD_CPL, ifbp->IFB_Cmd )
+ ifbp->IFB_Cmd &= ~HCMD_BUSY; /* 2 */
+ HCF_WAIT_WHILE( (IPW( HREG_EV_STAT) & HREG_EV_CMD) == 0 ); /* 4 */
+ stat = IPW( HREG_STAT );
+#if HCF_PROT_TIME
+ if ( prot_cnt == 0 ) {
+ IF_TALLY( ifbp->IFB_HCF_Tallies.MiscErr++; )
+ rc = HCF_ERR_TIME_OUT;
+ HCFASSERT( DO_ASSERT, ifbp->IFB_Cmd )
+ } else
+#endif // HCF_PROT_TIME
+ {
+ DAWA_ACK( HREG_EV_CMD );
+/*4*/ if ( stat != (ifbp->IFB_Cmd & HCMD_CMD_CODE) ) {
+/*8*/ if ( ( (stat ^ ifbp->IFB_Cmd ) & HCMD_CMD_CODE) != 0 ) {
+ rc = ifbp->IFB_DefunctStat = HCF_ERR_DEFUNCT_CMD_SEQ;
+ ifbp->IFB_CardStat |= CARD_STAT_DEFUNCT;
+ }
+ IF_TALLY( ifbp->IFB_HCF_Tallies.MiscErr++; )
+ ifbp->IFB_ErrCmd = stat;
+ ifbp->IFB_ErrQualifier = IPW( HREG_RESP_0 );
+ HCFASSERT( DO_ASSERT, MERGE_2( IPW( HREG_PARAM_0 ), ifbp->IFB_Cmd ) )
+ HCFASSERT( DO_ASSERT, MERGE_2( ifbp->IFB_ErrQualifier, ifbp->IFB_ErrCmd ) )
+ }
+ }
+ HCFASSERT( rc == HCF_SUCCESS, rc)
+ HCFLOGEXIT( HCF_TRACE_CMD_CPL )
+ return rc;
+} // cmd_cmpl
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE int cmd_exe( IFBP ifbp, int cmd_code, int par_0 )
+*.PURPOSE Executes synchronous part of Hermes Command and - optionally - waits for Command Completion.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* cmd_code
+* par_0
+*
+*.RETURNS
+* IFB_DefunctStat
+* HCF_ERR_DEFUNCT_CMD_SEQ
+* HCF_SUCCESS
+* HCF_ERR_TO_BE_ADDED <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+*
+*.DESCRIPTION
+* Executes synchronous Hermes Command and waits for Command Completion
+*
+* The general HCF strategy is to wait for command completion. As a consequence:
+* - the read of the busy bit before writing the command register is superfluous
+* - the Hermes requirement that no Inquiry command may be executed if there is still an unacknowledged
+* Inquiry command outstanding, is automatically met.
+* The Tx command uses the "Busy" bit in the cmd_code parameter to deviate from this general HCF strategy.
+* The idea is that by not busy-waiting on completion of this frequently used command the processor
+* utilization is diminished while using the busy-wait on all other seldom used commands the flow is kept
+* simple.
+*
+*
+*
+*.DIAGRAM
+*
+*1: skip the body of cmd_exe when in defunct mode or when - based on the S/W Support register write and
+* read back test - there is apparently no NIC.
+* Note: we gave up on the "old" strategy to write the S/W Support register at magic only when needed. Due to
+* the intricateness of Hermes F/W varieties ( which behave differently as far as corruption of the S/W
+* Support register is involved), the increasing number of Hermes commands which do an implicit initialize
+* (thus modifying the S/W Support register) and the workarounds of some OS/Support S/W induced aspects (e.g.
+* the System Soft library at WinNT which postpones the actual mapping of I/O space up to 30 seconds after
+* giving the go-ahead), the "magic" strategy is now reduced to a simple write and read back. This means that
+* problems like a bug tramping over the memory mapped Hermes registers will no longer be noticed as side
+* effect of the S/W Support register check.
+*2: check whether the preceding command skipped the busy wait and if so, check for command completion
+*
+*.NOTICE
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+
+HCF_STATIC int
+cmd_exe( IFBP ifbp, hcf_16 cmd_code, hcf_16 par_0 ) //if HCMD_BUSY of cmd_code set, then do NOT wait for completion
+{
+int rc;
+
+ HCFLOGENTRY( HCF_TRACE_CMD_EXE, cmd_code )
+ HCFASSERT( (cmd_code & HCMD_CMD_CODE) != HCMD_TX || cmd_code & HCMD_BUSY, cmd_code ) //Tx must have Busy bit set
+ OPW( HREG_SW_0, HCF_MAGIC );
+ if ( IPW( HREG_SW_0 ) == HCF_MAGIC ) { /* 1 */
+ rc = ifbp->IFB_DefunctStat;
+ }
+ else rc = HCF_ERR_NO_NIC;
+ if ( rc == HCF_SUCCESS ) {
+ //;?is this a hot idea, better MEASURE performance impact
+/*2*/ if ( ifbp->IFB_Cmd & HCMD_BUSY ) {
+ rc = cmd_cmpl( ifbp );
+ }
+ OPW( HREG_PARAM_0, par_0 );
+ OPW( HREG_CMD, cmd_code &~HCMD_BUSY );
+ ifbp->IFB_Cmd = cmd_code;
+ if ( (cmd_code & HCMD_BUSY) == 0 ) { //;?is this a hot idea, better MEASURE performance impact
+ rc = cmd_cmpl( ifbp );
+ }
+ }
+ HCFASSERT( rc == HCF_SUCCESS, MERGE_2( rc, cmd_code ) )
+ HCFLOGEXIT( HCF_TRACE_CMD_EXE )
+ return rc;
+} // cmd_exe
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE int download( IFBP ifbp, CFG_PROG_STRCT FAR *ltvp )
+*.PURPOSE downloads F/W image into NIC and initiates execution of the downloaded F/W.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* ltvp specifies the pseudo-RID (as defined by WCI)
+*
+*.RETURNS
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*1: First, Ack everything to unblock a (possibly) blocked cmd pipe line
+* Note 1: it is very likely that an Alloc event is pending and very well possible that a (Send) Cmd event is
+* pending
+* Note 2: it is assumed that this strategy takes away the need to ack every conceivable event after an
+* Hermes Initialize
+*
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC int
+download( IFBP ifbp, CFG_PROG_STRCT FAR *ltvp ) //Hermes-II download (volatile only)
+{
+hcf_16 i;
+int rc = HCF_SUCCESS;
+wci_bufp cp;
+hcf_io io_port = ifbp->IFB_IOBase + HREG_AUX_DATA;
+
+ HCFLOGENTRY( HCF_TRACE_DL, ltvp->typ )
+#if (HCF_TYPE) & HCF_TYPE_PRELOADED
+ HCFASSERT( DO_ASSERT, ltvp->mode )
+#else
+ //if initial "program" LTV
+ if ( ifbp->IFB_DLMode == CFG_PROG_STOP && ltvp->mode == CFG_PROG_VOLATILE) {
+ //. switch Hermes to initial mode
+/*1*/ OPW( HREG_EV_ACK, ~HREG_EV_SLEEP_REQ );
+ rc = cmd_exe( ifbp, HCMD_INI, 0 ); /* HCMD_INI can not be part of init() because that is called on
+ * other occasions as well */
+ rc = init( ifbp );
+ }
+ //if final "program" LTV
+ if ( ltvp->mode == CFG_PROG_STOP && ifbp->IFB_DLMode == CFG_PROG_VOLATILE) {
+ //. start tertiary (or secondary)
+ OPW( HREG_PARAM_1, (hcf_16)(ltvp->nic_addr >> 16) );
+ rc = cmd_exe( ifbp, HCMD_EXECUTE, (hcf_16) ltvp->nic_addr );
+ if (rc == HCF_SUCCESS) {
+ rc = init( ifbp ); /*;? do we really want to skip init if cmd_exe failed, i.e.
+ * IFB_FW_Comp_Id is than possibly incorrect */
+ }
+ //else (non-final)
+ } else {
+ //. if mode == Readback SEEPROM
+#if 0 //;? as long as the next if contains a hard coded 0, might as well leave it out even more obvious
+ if ( 0 /*len is definitely not want we want;?*/ && ltvp->mode == CFG_PROG_SEEPROM_READBACK ) {
+ OPW( HREG_PARAM_1, (hcf_16)(ltvp->nic_addr >> 16) );
+ OPW( HREG_PARAM_2, MUL_BY_2(ltvp->len - 4));
+ //. . perform Hermes prog cmd with appropriate mode bits
+ rc = cmd_exe( ifbp, HCMD_PROGRAM | ltvp->mode, (hcf_16)ltvp->nic_addr );
+ //. . set up NIC RAM addressability according Resp0-1
+ OPW( HREG_AUX_PAGE, IPW( HREG_RESP_1) );
+ OPW( HREG_AUX_OFFSET, IPW( HREG_RESP_0) );
+ //. . set up L-field of LTV according Resp2
+ i = ( IPW( HREG_RESP_2 ) + 1 ) / 2; // i contains max buffer size in words, a probably not very useful piece of information ;?
+/*Nico's code based on i is the "real amount of data available"
+ if ( ltvp->len - 4 < i ) rc = HCF_ERR_LEN;
+ else ltvp->len = i + 4;
+*/
+/* Rolands code based on the idea that a MSF should not ask for more than is available
+ // check if number of bytes requested exceeds max buffer size
+ if ( ltvp->len - 4 > i ) {
+ rc = HCF_ERR_LEN;
+ ltvp->len = i + 4;
+ }
+*/
+ //. . copy data from NIC via AUX port to LTV
+ cp = (wci_bufp)ltvp->host_addr; /*IN_PORT_STRING_8_16 macro may modify its parameters*/
+ i = ltvp->len - 4;
+ IN_PORT_STRING_8_16( io_port, cp, i ); //!!!WORD length, cp MUST be a char pointer // $$ char
+ //. else (non-final programming)
+ } else
+#endif //;? as long as the above if contains a hard coded 0, might as well leave it out even more obvious
+ { //. . get number of words to program
+ HCFASSERT( ltvp->segment_size, *ltvp->host_addr )
+ i = ltvp->segment_size/2;
+ //. . copy data (words) from LTV via AUX port to NIC
+ cp = (wci_bufp)ltvp->host_addr; //OUT_PORT_STRING_8_16 macro may modify its parameters
+ //. . if mode == volatile programming
+ if ( ltvp->mode == CFG_PROG_VOLATILE ) {
+ //. . . set up NIC RAM addressability via AUX port
+ OPW( HREG_AUX_PAGE, (hcf_16)(ltvp->nic_addr >> 16 << 9 | (ltvp->nic_addr & 0xFFFF) >> 7 ) );
+ OPW( HREG_AUX_OFFSET, (hcf_16)(ltvp->nic_addr & 0x007E) );
+ OUT_PORT_STRING_8_16( io_port, cp, i ); //!!!WORD length, cp MUST be a char pointer
+ }
+ }
+ }
+ ifbp->IFB_DLMode = ltvp->mode; //save state in IFB_DLMode
+#endif // HCF_TYPE_PRELOADED
+ HCFASSERT( rc == HCF_SUCCESS, rc )
+ HCFLOGEXIT( HCF_TRACE_DL )
+ return rc;
+} // download
+
+
+#if (HCF_ASSERT) & HCF_ASSERT_PRINTF
+/**************************************************
+* Certain Hermes-II firmware versions can generate
+* debug information. This debug information is
+* contained in a buffer in nic-RAM, and can be read
+* via the aux port.
+**************************************************/
+HCF_STATIC int
+fw_printf(IFBP ifbp, CFG_FW_PRINTF_STRCT FAR *ltvp)
+{
+ int rc = HCF_SUCCESS;
+ hcf_16 fw_cnt;
+// hcf_32 DbMsgBuffer = 0x29D2, DbMsgCount= 0x000029D0;
+// hcf_16 DbMsgSize=0x00000080;
+ hcf_32 DbMsgBuffer;
+ CFG_FW_PRINTF_BUFFER_LOCATION_STRCT *p = &ifbp->IFB_FwPfBuff;
+ ltvp->len = 1;
+ if ( p->DbMsgSize != 0 ) {
+ // first, check the counter in nic-RAM and compare it to the latest counter value of the HCF
+ OPW( HREG_AUX_PAGE, (hcf_16)(p->DbMsgCount >> 7) );
+ OPW( HREG_AUX_OFFSET, (hcf_16)(p->DbMsgCount & 0x7E) );
+ fw_cnt = ((IPW( HREG_AUX_DATA) >>1 ) & ((hcf_16)p->DbMsgSize - 1));
+ if ( fw_cnt != ifbp->IFB_DbgPrintF_Cnt ) {
+// DbgPrint("fw_cnt=%d IFB_DbgPrintF_Cnt=%d\n", fw_cnt, ifbp->IFB_DbgPrintF_Cnt);
+ DbMsgBuffer = p->DbMsgBuffer + ifbp->IFB_DbgPrintF_Cnt * 6; // each entry is 3 words
+ OPW( HREG_AUX_PAGE, (hcf_16)(DbMsgBuffer >> 7) );
+ OPW( HREG_AUX_OFFSET, (hcf_16)(DbMsgBuffer & 0x7E) );
+ ltvp->msg_id = IPW(HREG_AUX_DATA);
+ ltvp->msg_par = IPW(HREG_AUX_DATA);
+ ltvp->msg_tstamp = IPW(HREG_AUX_DATA);
+ ltvp->len = 4;
+ ifbp->IFB_DbgPrintF_Cnt++;
+ ifbp->IFB_DbgPrintF_Cnt &= (p->DbMsgSize - 1);
+ }
+ }
+ return rc;
+};
+#endif // HCF_ASSERT_PRINTF
+
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.SUBMODULE hcf_16 get_fid( IFBP ifbp )
+*.PURPOSE get allocated FID for either transmit or notify.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* 0 no FID available
+* <>0 FID number
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+* The preference is to use a "pending" alloc. If no alloc is pending, then - if available - the "spare" FID
+* is used.
+* If the spare FID is used, IFB_RscInd (representing the spare FID) must be cleared
+* If the pending alloc is used, the alloc event must be acknowledged to the Hermes.
+* In case the spare FID was depleted and the IFB_RscInd has been "faked" as pseudo resource with a 0x0001
+* value by hcf_service_nic, IFB_RscInd has to be "corrected" again to its 0x0000 value.
+*
+* Note that due to the Hermes-II H/W problems which are intended to be worked around by DAWA, the Alloc bit
+* in the Event register is no longer a reliable indication of the presence/absence of a FID. The "Clear FID"
+* part of the DAWA logic, together with the choice of the definition of the return information from get_fid,
+* handle this automatically, i.e. without additional code in get_fid.
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC hcf_16
+get_fid( IFBP ifbp )
+{
+
+hcf_16 fid = 0;
+#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
+PROT_CNT_INI
+#endif // HCF_TYPE_HII5
+
+ IF_DMA( HCFASSERT(!(ifbp->IFB_CntlOpt & USE_DMA), ifbp->IFB_CntlOpt) )
+
+ if ( IPW( HREG_EV_STAT) & HREG_EV_ALLOC) {
+ fid = IPW( HREG_ALLOC_FID );
+ HCFASSERT( fid, ifbp->IFB_RscInd )
+ DAWA_ZERO_FID( HREG_ALLOC_FID )
+#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
+ HCF_WAIT_WHILE( ( IPW( HREG_EV_STAT ) & HREG_EV_ACK_REG_READY ) == 0 );
+ HCFASSERT( prot_cnt, IPW( HREG_EV_STAT ) )
+#endif // HCF_TYPE_HII5
+ DAWA_ACK( HREG_EV_ALLOC ); //!!note that HREG_EV_ALLOC is written only once
+// 180 degree error in logic ;? #if ALLOC_15
+ if ( ifbp->IFB_RscInd == 1 ) {
+ ifbp->IFB_RscInd = 0;
+ }
+//#endif // ALLOC_15
+ } else {
+// 180 degree error in logic ;? #if ALLOC_15
+ fid = ifbp->IFB_RscInd;
+//#endif // ALLOC_15
+ ifbp->IFB_RscInd = 0;
+ }
+ return fid;
+} // get_fid
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE void get_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) )
+*.PURPOSE reads with 16/32 bit I/O via BAP1 port from NIC RAM to Host memory.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* bufp (byte) address of buffer
+* len length in bytes of buffer specified by bufp
+* word_len Big Endian only: number of leading bytes to swap in pairs
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* process the single byte (if applicable) read by the previous get_frag and copy len (or len-1) bytes from
+* NIC to bufp.
+* On a Big Endian platform, the parameter word_len controls the number of leading bytes whose endianess is
+* converted (i.e. byte swapped)
+*
+*
+*.DIAGRAM
+*10: The PCMCIA card can be removed in the middle of the transfer. By depositing a "magic number" in the
+* HREG_SW_0 register of the Hermes at initialization time and by verifying this register, it can be
+* determined whether the card is still present. The return status is set accordingly.
+* Clearing the buffer is a (relative) cheap way to prevent that failing I/O results in run-away behavior
+* because the garbage in the buffer is interpreted by the caller irrespective of the return status (e.g.
+* hcf_service_nic has this behavior).
+*
+*.NOTICE
+* It turns out DOS ODI uses zero length fragments. The HCF code can cope with it, but as a consequence, no
+* Assert on len is possible
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC void
+get_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) )
+{
+hcf_io io_port = ifbp->IFB_IOBase + HREG_DATA_1; //BAP data register
+wci_bufp p = bufp; //working pointer
+int i; //prevent side effects from macro
+int j;
+
+ HCFASSERT( ((hcf_32)bufp & (HCF_ALIGN-1) ) == 0, (hcf_32)bufp )
+
+/*1: here recovery logic for intervening BAP access between hcf_service_nic and hcf_rcv_msg COULD be added
+ * if current access is RxInitial
+ * . persistent_offset += len
+ */
+
+ i = len;
+ //if buffer length > 0 and carry from previous get_frag
+ if ( i && ifbp->IFB_CarryIn ) {
+ //. move carry to buffer
+ //. adjust buffer length and pointer accordingly
+ *p++ = (hcf_8)(ifbp->IFB_CarryIn>>8);
+ i--;
+ //. clear carry flag
+ ifbp->IFB_CarryIn = 0;
+ }
+#if (HCF_IO) & HCF_IO_32BITS
+ //skip zero-length I/O, single byte I/O and I/O not worthwhile (i.e. less than 6 bytes)for DW logic
+ //if buffer length >= 6 and 32 bits I/O support
+ if ( !(ifbp->IFB_CntlOpt & USE_16BIT) && i >= 6 ) {
+hcf_32 FAR *p4; //prevent side effects from macro
+ if ( ( (hcf_32)p & 0x1 ) == 0 ) { //. if buffer at least word aligned
+ if ( (hcf_32)p & 0x2 ) { //. . if buffer not double word aligned
+ //. . . read single word to get double word aligned
+ *(wci_recordp)p = IN_PORT_WORD( io_port );
+ //. . . adjust buffer length and pointer accordingly
+ p += 2;
+ i -= 2;
+ }
+ //. . read as many double word as possible
+ p4 = (hcf_32 FAR *)p;
+ j = i/4;
+ IN_PORT_STRING_32( io_port, p4, j );
+ //. . adjust buffer length and pointer accordingly
+ p += i & ~0x0003;
+ i &= 0x0003;
+ }
+ }
+#endif // HCF_IO_32BITS
+ //if no 32-bit support OR byte aligned OR 1-3 bytes left
+ if ( i ) {
+ //. read as many word as possible in "alignment safe" way
+ j = i/2;
+ IN_PORT_STRING_8_16( io_port, p, j );
+ //. if 1 byte left
+ if ( i & 0x0001 ) {
+ //. . read 1 word
+ ifbp->IFB_CarryIn = IN_PORT_WORD( io_port );
+ //. . store LSB in last char of buffer
+ bufp[len-1] = (hcf_8)ifbp->IFB_CarryIn;
+ //. . save MSB in carry, set carry flag
+ ifbp->IFB_CarryIn |= 0x1;
+ }
+ }
+#if HCF_BIG_ENDIAN
+ HCFASSERT( word_len == 0 || word_len == 2 || word_len == 4, word_len )
+ HCFASSERT( word_len == 0 || ((hcf_32)bufp & 1 ) == 0, (hcf_32)bufp )
+ HCFASSERT( word_len <= len, MERGE2( word_len, len ) )
+ //see put_frag for an alternative implementation, but be carefull about what are int's and what are
+ //hcf_16's
+ if ( word_len ) { //. if there is anything to convert
+hcf_8 c;
+ c = bufp[1]; //. . convert the 1st hcf_16
+ bufp[1] = bufp[0];
+ bufp[0] = c;
+ if ( word_len > 1 ) { //. . if there is to convert more than 1 word ( i.e 2 )
+ c = bufp[3]; //. . . convert the 2nd hcf_16
+ bufp[3] = bufp[2];
+ bufp[2] = c;
+ }
+ }
+#endif // HCF_BIG_ENDIAN
+} // get_frag
+
+/************************************************************************************************************
+*
+*.SUBMODULE int init( IFBP ifbp )
+*.PURPOSE Handles common initialization aspects (H-I init, calibration, config.mngmt, allocation).
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS
+* HCF_ERR_INCOMP_PRI
+* HCF_ERR_INCOMP_FW
+* HCF_ERR_TIME_OUT
+* >>hcf_get_info
+* HCF_ERR_NO_NIC
+* HCF_ERR_LEN
+*
+*.DESCRIPTION
+* init will successively:
+* - in case of a (non-preloaded) H-I, initialize the NIC
+* - calibrate the S/W protection timer against the Hermes Timer
+* - collect HSI, "active" F/W Configuration Management Information
+* - in case active F/W is Primary F/W: collect Primary F/W Configuration Management Information
+* - check HSI and Primary F/W compatibility with the HCF
+* - in case active F/W is Station or AP F/W: check Station or AP F/W compatibility with the HCF
+* - in case active F/W is not Primary F/W: allocate FIDs to be used in transmit/notify process
+*
+*
+*.DIAGRAM
+*2: drop all error status bits in IFB_CardStat since they are expected to be re-evaluated.
+*4: Ack everything except HREG_EV_SLEEP_REQ. It is very likely that an Alloc event is pending and
+* very well possible that a Send Cmd event is pending. Acking HREG_EV_SLEEP_REQ is handled by hcf_action(
+* HCF_ACT_INT_ON ) !!!
+*10: Calibrate the S/W time-out protection mechanism by calling calibrate(). Note that possible errors
+* in the calibration process are nor reported by init but will show up via the defunct mechanism in
+* subsequent hcf-calls.
+*14: usb_check_comp() is called to have the minimal visual clutter for the legacy H-I USB dongle
+* compatibility check.
+*16: The following configuration management related information is retrieved from the NIC:
+* - HSI supplier
+* - F/W Identity
+* - F/W supplier
+* if appropriate:
+* - PRI Identity
+* - PRI supplier
+* appropriate means on H-I: always
+* and on H-II if F/W supplier reflects a primary (i.e. only after an Hermes Reset or Init
+* command).
+* QUESTION ;? !!!!!! should, For each of the above RIDs the Endianess is converted to native Endianess.
+* Only the return code of the first hcf_get_info is used. All hcf_get_info calls are made, regardless of
+* the success or failure of the 1st hcf_get_info. The assumptions are:
+* - if any call fails, they all fail, so remembering the result of the 1st call is adequate
+* - a failing call will overwrite the L-field with a 0x0000 value, which services both as an
+* error indication for the values cached in the IFB as making mmd_check_comp fail.
+* In case of H-I, when getting the F/W identity fails, the F/W is assumed to be H-I AP F/W pre-dating
+* version 9.0 and the F/W Identity and Supplier are faked accordingly.
+* In case of H-II, the Primary, Station and AP Identity are merged into a single F/W Identity.
+* The same applies to the Supplier information. As a consequence the PRI information can no longer be
+* retrieved when a Tertiary runs. To accommodate MSFs and Utilities who depend on PRI information being
+* available at any time, this information is cached in the IFB. In this cache the generic "F/W" value of
+* the typ-fields is overwritten with the specific (legacy) "PRI" values. To actually re-route the (legacy)
+* PRI request via hcf_get_info, the xxxx-table must be set. In case of H-I, this caching, modifying and
+* re-routing is not needed because PRI information is always available directly from the NIC. For
+* consistency the caching fields in the IFB are filled with the PRI information anyway.
+*18: mdd_check_comp() is called to check the Supplier Variant and Range of the Host-S/W I/F (HSI) and the
+* Primary Firmware Variant and Range against the Top and Bottom level supported by this HCF. If either of
+* these tests fails, the CARD_STAT_INCOMP_PRI bit of IFB_CardStat is set
+* Note: There should always be a primary except during production, so this makes the HCF in its current form
+* unsuitable for manufacturing test systems like the FTS. This can be remedied by an adding a test like
+* ifbp->IFB_PRISup.id == COMP_ID_PRI
+*20: In case there is Tertiary F/W and this F/W is Station F/W, the Supplier Variant and Range of the Station
+* Firmware function as retrieved from the Hermes is checked against the Top and Bottom level supported by
+* this HCF.
+* Note: ;? the tertiary F/W compatibility checks could be moved to the DHF, which already has checked the
+* CFI and MFI compatibility of the image with the NIC before the image was downloaded.
+*28: In case of non-Primary F/W: allocates and acknowledge a (TX or Notify) FID and allocates without
+* acknowledge another (TX or Notify) FID (the so-called 1.5 alloc scheme) with the following steps:
+* - execute the allocate command by calling cmd_exe
+* - wait till either the alloc event or a time-out occurs
+* - regardless whether the alloc event occurs, call get_fid to
+* - read the FID and save it in IFB_RscInd to be used as "spare FID"
+* - acknowledge the alloc event
+* - do another "half" allocate to complete the "1.5 Alloc scheme"
+* Note that above 3 steps do not harm and thus give the "cheapest" acceptable strategy.
+* If a time-out occurred, then report time out status (after all)
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC int
+init( IFBP ifbp )
+{
+
+int rc = HCF_SUCCESS;
+
+ HCFLOGENTRY( HCF_TRACE_INIT, 0 )
+
+ ifbp->IFB_CardStat = 0; /* 2*/
+ OPW( HREG_EV_ACK, ~HREG_EV_SLEEP_REQ ); /* 4*/
+ IF_PROT_TIME( calibrate( ifbp ); ) /*10*/
+#if 0 // OOR
+ ifbp->IFB_FWIdentity.len = 2; //misuse the IFB space for a put
+ ifbp->IFB_FWIdentity.typ = CFG_TICK_TIME;
+ ifbp->IFB_FWIdentity.comp_id = (1000*1000)/1024 + 1; //roughly 1 second
+ hcf_put_info( ifbp, (LTVP)&ifbp->IFB_FWIdentity.len );
+#endif // OOR
+ ifbp->IFB_FWIdentity.len = sizeof(CFG_FW_IDENTITY_STRCT)/sizeof(hcf_16) - 1;
+ ifbp->IFB_FWIdentity.typ = CFG_FW_IDENTITY;
+ rc = hcf_get_info( ifbp, (LTVP)&ifbp->IFB_FWIdentity.len );
+/* ;? conversion should not be needed for mmd_check_comp */
+#if HCF_BIG_ENDIAN
+ ifbp->IFB_FWIdentity.comp_id = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWIdentity.comp_id );
+ ifbp->IFB_FWIdentity.variant = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWIdentity.variant );
+ ifbp->IFB_FWIdentity.version_major = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWIdentity.version_major );
+ ifbp->IFB_FWIdentity.version_minor = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWIdentity.version_minor );
+#endif // HCF_BIG_ENDIAN
+#if defined MSF_COMPONENT_ID /*14*/
+ if ( rc == HCF_SUCCESS ) { /*16*/
+ ifbp->IFB_HSISup.len = sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1;
+ ifbp->IFB_HSISup.typ = CFG_NIC_HSI_SUP_RANGE;
+ rc = hcf_get_info( ifbp, (LTVP)&ifbp->IFB_HSISup.len );
+/* ;? conversion should not be needed for mmd_check_comp , BUT according to a report of a BE-user it is
+ * should be resolved in the WARP release
+ * since some compilers make ugly but unnecessary code of these instructions even for LE,
+ * it is conditionally compiled */
+#if HCF_BIG_ENDIAN
+ ifbp->IFB_HSISup.role = CNV_LITTLE_TO_SHORT( ifbp->IFB_HSISup.role );
+ ifbp->IFB_HSISup.id = CNV_LITTLE_TO_SHORT( ifbp->IFB_HSISup.id );
+ ifbp->IFB_HSISup.variant = CNV_LITTLE_TO_SHORT( ifbp->IFB_HSISup.variant );
+ ifbp->IFB_HSISup.bottom = CNV_LITTLE_TO_SHORT( ifbp->IFB_HSISup.bottom );
+ ifbp->IFB_HSISup.top = CNV_LITTLE_TO_SHORT( ifbp->IFB_HSISup.top );
+#endif // HCF_BIG_ENDIAN
+ ifbp->IFB_FWSup.len = sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1;
+ ifbp->IFB_FWSup.typ = CFG_FW_SUP_RANGE;
+ (void)hcf_get_info( ifbp, (LTVP)&ifbp->IFB_FWSup.len );
+/* ;? conversion should not be needed for mmd_check_comp */
+#if HCF_BIG_ENDIAN
+ ifbp->IFB_FWSup.role = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWSup.role );
+ ifbp->IFB_FWSup.id = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWSup.id );
+ ifbp->IFB_FWSup.variant = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWSup.variant );
+ ifbp->IFB_FWSup.bottom = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWSup.bottom );
+ ifbp->IFB_FWSup.top = CNV_LITTLE_TO_SHORT( ifbp->IFB_FWSup.top );
+#endif // HCF_BIG_ENDIAN
+
+ if ( ifbp->IFB_FWSup.id == COMP_ID_PRI ) { /* 20*/
+int i = sizeof( CFG_FW_IDENTITY_STRCT) + sizeof(CFG_SUP_RANGE_STRCT );
+ while ( i-- ) ((hcf_8*)(&ifbp->IFB_PRIIdentity))[i] = ((hcf_8*)(&ifbp->IFB_FWIdentity))[i];
+ ifbp->IFB_PRIIdentity.typ = CFG_PRI_IDENTITY;
+ ifbp->IFB_PRISup.typ = CFG_PRI_SUP_RANGE;
+ xxxx[xxxx_PRI_IDENTITY_OFFSET] = &ifbp->IFB_PRIIdentity.len;
+ xxxx[xxxx_PRI_IDENTITY_OFFSET+1] = &ifbp->IFB_PRISup.len;
+ }
+ if ( !mmd_check_comp( (void*)&cfg_drv_act_ranges_hsi, &ifbp->IFB_HSISup) /* 22*/
+#if ( (HCF_TYPE) & HCF_TYPE_PRELOADED ) == 0
+//;? the PRI compatibility check is only relevant for DHF
+ || !mmd_check_comp( (void*)&cfg_drv_act_ranges_pri, &ifbp->IFB_PRISup)
+#endif // HCF_TYPE_PRELOADED
+ ) {
+ ifbp->IFB_CardStat = CARD_STAT_INCOMP_PRI;
+ rc = HCF_ERR_INCOMP_PRI;
+ }
+ if ( ( ifbp->IFB_FWSup.id == COMP_ID_STA && !mmd_check_comp( (void*)&cfg_drv_act_ranges_sta, &ifbp->IFB_FWSup) ) ||
+ ( ifbp->IFB_FWSup.id == COMP_ID_APF && !mmd_check_comp( (void*)&cfg_drv_act_ranges_apf, &ifbp->IFB_FWSup) )
+ ) { /* 24 */
+ ifbp->IFB_CardStat |= CARD_STAT_INCOMP_FW;
+ rc = HCF_ERR_INCOMP_FW;
+ }
+ }
+#endif // MSF_COMPONENT_ID
+#if (HCF_DL_ONLY) == 0 /* 28 */
+ if ( rc == HCF_SUCCESS && ifbp->IFB_FWIdentity.comp_id >= COMP_ID_FW_STA ) {
+PROT_CNT_INI
+ /**************************************************************************************
+ * rlav: the DMA engine needs the host to cause a 'hanging alloc event' for it to consume.
+ * not sure if this is the right spot in the HCF, thinking about hcf_enable...
+ **************************************************************************************/
+ rc = cmd_exe( ifbp, HCMD_ALLOC, 0 );
+// 180 degree error in logic ;? #if ALLOC_15
+// ifbp->IFB_RscInd = 1; //let's hope that by the time hcf_send_msg isa called, there will be a FID
+//#else
+ if ( rc == HCF_SUCCESS ) {
+ HCF_WAIT_WHILE( (IPW( HREG_EV_STAT ) & HREG_EV_ALLOC) == 0 );
+ IF_PROT_TIME( HCFASSERT(prot_cnt, IPW( HREG_EV_STAT ) ) /*NOP*/;)
+#if HCF_DMA
+ if ( ! ( ifbp->IFB_CntlOpt & USE_DMA ) )
+#endif // HCF_DMA
+ {
+ ifbp->IFB_RscInd = get_fid( ifbp );
+ HCFASSERT( ifbp->IFB_RscInd, 0 )
+ cmd_exe( ifbp, HCMD_ALLOC, 0 );
+ IF_PROT_TIME( if ( prot_cnt == 0 ) rc = HCF_ERR_TIME_OUT; )
+ }
+ }
+//#endif // ALLOC_15
+ }
+#endif // HCF_DL_ONLY
+ HCFASSERT( rc == HCF_SUCCESS, rc )
+ HCFLOGEXIT( HCF_TRACE_INIT )
+ return rc;
+} // init
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.SUBMODULE void isr_info( IFBP ifbp )
+*.PURPOSE handles link events.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*1: First the FID number corresponding with the InfoEvent is determined.
+* Note the complication of the zero-FID protection sub-scheme in DAWA.
+* Next the L-field and the T-field are fetched into scratch buffer info.
+*2: In case of tallies, the 16 bits Hermes values are accumulated in the IFB into 32 bits values. Info[0]
+* is (expected to be) HCF_NIC_TAL_CNT + 1. The contraption "while ( info[0]-- >1 )" rather than
+* "while ( --info[0] )" is used because it is dangerous to determine the length of the Value field by
+* decrementing info[0]. As a result of a bug in some version of the F/W, info[0] may be 0, resulting
+* in a very long loop in the pre-decrement logic.
+*4: In case of a link status frame, the information is copied to the IFB field IFB_linkStat
+*6: All other than Tallies (including "unknown" ones) are checked against the selection set by the MSF
+* via CFG_RID_LOG. If a match is found or the selection set has the wild-card type (i.e non-NULL buffer
+* pointer at the terminating zero-type), the frame is copied to the (type-specific) log buffer.
+* Note that to accumulate tallies into IFB AND to log them or to log a frame when a specific match occures
+* AND based on the wild-card selection, you have to call setup_bap again after the 1st copy.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC void
+isr_info( IFBP ifbp )
+{
+hcf_16 info[2], fid;
+#if (HCF_EXT) & HCF_EXT_INFO_LOG
+RID_LOGP ridp = ifbp->IFB_RIDLogp; //NULL or pointer to array of RID_LOG structures (terminated by zero typ)
+#endif // HCF_EXT_INFO_LOG
+
+ HCFTRACE( ifbp, HCF_TRACE_ISR_INFO ); /* 1 */
+ fid = IPW( HREG_INFO_FID );
+ DAWA_ZERO_FID( HREG_INFO_FID )
+ if ( fid ) {
+ (void)setup_bap( ifbp, fid, 0, IO_IN );
+ get_frag( ifbp, (wci_bufp)info, 4 BE_PAR(2) );
+ HCFASSERT( info[0] <= HCF_MAX_LTV + 1, MERGE_2( info[1], info[0] ) ) //;? a smaller value makes more sense
+#if (HCF_TALLIES) & HCF_TALLIES_NIC //Hermes tally support
+ if ( info[1] == CFG_TALLIES ) {
+hcf_32 *p;
+/*2*/ if ( info[0] > HCF_NIC_TAL_CNT ) {
+ info[0] = HCF_NIC_TAL_CNT + 1;
+ }
+ p = (hcf_32*)&ifbp->IFB_NIC_Tallies;
+ while ( info[0]-- >1 ) *p++ += IPW( HREG_DATA_1 ); //request may return zero length
+ }
+ else
+#endif // HCF_TALLIES_NIC
+ {
+/*4*/ if ( info[1] == CFG_LINK_STAT ) {
+ ifbp->IFB_LinkStat = IPW( HREG_DATA_1 );
+ }
+#if (HCF_EXT) & HCF_EXT_INFO_LOG
+/*6*/ while ( 1 ) {
+ if ( ridp->typ == 0 || ridp->typ == info[1] ) {
+ if ( ridp->bufp ) {
+ HCFASSERT( ridp->len >= 2, ridp->typ )
+ ridp->bufp[0] = min((hcf_16)(ridp->len - 1), info[0] ); //save L
+ ridp->bufp[1] = info[1]; //save T
+ get_frag( ifbp, (wci_bufp)&ridp->bufp[2], (ridp->bufp[0] - 1)*2 BE_PAR(0) );
+ }
+ break;
+ }
+ ridp++;
+ }
+#endif // HCF_EXT_INFO_LOG
+ }
+ HCFTRACE( ifbp, HCF_TRACE_ISR_INFO | HCF_TRACE_EXIT );
+ }
+ return;
+} // isr_info
+#endif // HCF_DL_ONLY
+
+//
+//
+// #endif // HCF_TALLIES_NIC
+// /*4*/ if ( info[1] == CFG_LINK_STAT ) {
+// ifbp->IFB_DSLinkStat = IPW( HREG_DATA_1 ) | CFG_LINK_STAT_CHANGE; //corrupts BAP !! ;?
+// ifbp->IFB_LinkStat = ifbp->IFB_DSLinkStat & CFG_LINK_STAT_FW; //;? to be obsoleted
+// printk( "<4>linkstatus: %04x\n", ifbp->IFB_DSLinkStat ); //;?remove me 1 day
+// #if (HCF_SLEEP) & HCF_DDS
+// if ( ( ifbp->IFB_DSLinkStat & CFG_LINK_STAT_CONNECTED ) == 0 ) { //even values are disconnected etc.
+// ifbp->IFB_TickCnt = 0; //start 2 second period (with 1 tick uncertanty)
+// printk( "<5>isr_info: AwaitConnection phase started, IFB_TickCnt = 0\n" ); //;?remove me 1 day
+// }
+// #endif // HCF_DDS
+// }
+// #if (HCF_EXT) & HCF_EXT_INFO_LOG
+// /*6*/ while ( 1 ) {
+// if ( ridp->typ == 0 || ridp->typ == info[1] ) {
+// if ( ridp->bufp ) {
+// HCFASSERT( ridp->len >= 2, ridp->typ )
+// (void)setup_bap( ifbp, fid, 2, IO_IN ); //restore BAP for tallies, linkstat and specific type followed by wild card
+// ridp->bufp[0] = min( ridp->len - 1, info[0] ); //save L
+// get_frag( ifbp, (wci_bufp)&ridp->bufp[1], ridp->bufp[0]*2 BE_PAR(0) );
+// }
+// break; //;?this break is no longer needed due to setup_bap but lets concentrate on DDS first
+// }
+// ridp++;
+// }
+// #endif // HCF_EXT_INFO_LOG
+// }
+// HCFTRACE( ifbp, HCF_TRACE_ISR_INFO | HCF_TRACE_EXIT );
+//
+//
+//
+//
+// return;
+//} // isr_info
+//#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE void mdd_assert( IFBP ifbp, unsigned int line_number, hcf_32 q )
+*.PURPOSE filters assert on level and interfaces to the MSF supplied msf_assert routine.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* line_number line number of the line which caused the assert
+* q qualifier, additional information which may give a clue about the problem
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*
+*.NOTICE
+* mdd_assert has been through a turmoil, renaming hcf_assert to assert and hcf_assert again and supporting off
+* and on being called from the MSF level and other ( immature ) ModularDriverDevelopment modules like DHF and
+* MMD.
+ * !!!! The assert routine is not an hcf_..... routine in the sense that it may be called by the MSF,
+ * however it is called from mmd.c and dhf.c, so it must be external.
+ * To prevent namespace pollution it needs a prefix, to prevent that MSF programmers think that
+ * they are allowed to call the assert logic, the prefix HCF can't be used, so MDD is selected!!!!
+ *
+* When called from the DHF module the line number is incremented by DHF_FILE_NAME_OFFSET and when called from
+* the MMD module by MMD_FILE_NAME_OFFSET.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+#if HCF_ASSERT
+void
+mdd_assert( IFBP ifbp, unsigned int line_number, hcf_32 q )
+{
+hcf_16 run_time_flag = ifbp->IFB_AssertLvl;
+
+ if ( run_time_flag /* > ;?????? */ ) { //prevent recursive behavior, later to be extended to level filtering
+ ifbp->IFB_AssertQualifier = q;
+ ifbp->IFB_AssertLine = (hcf_16)line_number;
+#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
+ if ( ifbp->IFB_AssertRtn ) {
+ ifbp->IFB_AssertRtn( line_number, ifbp->IFB_AssertTrace, q );
+ }
+#endif // HCF_ASSERT_LNK_MSF_RTN / HCF_ASSERT_RT_MSF_RTN
+#if (HCF_ASSERT) & HCF_ASSERT_SW_SUP
+ OPW( HREG_SW_2, line_number );
+ OPW( HREG_SW_2, ifbp->IFB_AssertTrace );
+ OPW( HREG_SW_2, (hcf_16)q );
+ OPW( HREG_SW_2, (hcf_16)(q >> 16 ) );
+#endif // HCF_ASSERT_SW_SUP
+
+#if (HCF_EXT) & HCF_EXT_MB && (HCF_ASSERT) & HCF_ASSERT_MB
+ ifbp->IFB_AssertLvl = 0; // prevent recursive behavior
+ hcf_put_info( ifbp, (LTVP)&ifbp->IFB_AssertStrct );
+ ifbp->IFB_AssertLvl = run_time_flag; // restore appropriate filter level
+#endif // HCF_EXT_MB / HCF_ASSERT_MB
+ }
+} // mdd_assert
+#endif // HCF_ASSERT
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE void put_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) )
+*.PURPOSE writes with 16/32 bit I/O via BAP1 port from Host memory to NIC RAM.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* bufp (byte) address of buffer
+* len length in bytes of buffer specified by bufp
+* word_len Big Endian only: number of leading bytes to swap in pairs
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* process the single byte (if applicable) not yet written by the previous put_frag and copy len
+* (or len-1) bytes from bufp to NIC.
+*
+*
+*.DIAGRAM
+*
+*.NOTICE
+* It turns out DOS ODI uses zero length fragments. The HCF code can cope with it, but as a consequence, no
+* Assert on len is possible
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC void
+put_frag( IFBP ifbp, wci_bufp bufp, int len BE_PAR( int word_len ) )
+{
+hcf_io io_port = ifbp->IFB_IOBase + HREG_DATA_1; //BAP data register
+int i; //prevent side effects from macro
+hcf_16 j;
+ HCFASSERT( ((hcf_32)bufp & (HCF_ALIGN-1) ) == 0, (hcf_32)bufp )
+#if HCF_BIG_ENDIAN
+ HCFASSERT( word_len == 0 || word_len == 2 || word_len == 4, word_len )
+ HCFASSERT( word_len == 0 || ((hcf_32)bufp & 1 ) == 0, (hcf_32)bufp )
+ HCFASSERT( word_len <= len, MERGE_2( word_len, len ) )
+
+ if ( word_len ) { //if there is anything to convert
+ //. convert and write the 1st hcf_16
+ j = bufp[1] | bufp[0]<<8;
+ OUT_PORT_WORD( io_port, j );
+ //. update pointer and counter accordingly
+ len -= 2;
+ bufp += 2;
+ if ( word_len > 1 ) { //. if there is to convert more than 1 word ( i.e 2 )
+ //. . convert and write the 2nd hcf_16
+ j = bufp[1] | bufp[0]<<8; /*bufp is already incremented by 2*/
+ OUT_PORT_WORD( io_port, j );
+ //. . update pointer and counter accordingly
+ len -= 2;
+ bufp += 2;
+ }
+ }
+#endif // HCF_BIG_ENDIAN
+ i = len;
+ if ( i && ifbp->IFB_CarryOut ) { //skip zero-length
+ j = ((*bufp)<<8) + ( ifbp->IFB_CarryOut & 0xFF );
+ OUT_PORT_WORD( io_port, j );
+ bufp++; i--;
+ ifbp->IFB_CarryOut = 0;
+ }
+#if (HCF_IO) & HCF_IO_32BITS
+ //skip zero-length I/O, single byte I/O and I/O not worthwhile (i.e. less than 6 bytes)for DW logic
+ //if buffer length >= 6 and 32 bits I/O support
+ if ( !(ifbp->IFB_CntlOpt & USE_16BIT) && i >= 6 ) {
+hcf_32 FAR *p4; //prevent side effects from macro
+ if ( ( (hcf_32)bufp & 0x1 ) == 0 ) { //. if buffer at least word aligned
+ if ( (hcf_32)bufp & 0x2 ) { //. . if buffer not double word aligned
+ //. . . write a single word to get double word aligned
+ j = *(wci_recordp)bufp; //just to help ease writing macros with embedded assembly
+ OUT_PORT_WORD( io_port, j );
+ //. . . adjust buffer length and pointer accordingly
+ bufp += 2; i -= 2;
+ }
+ //. . write as many double word as possible
+ p4 = (hcf_32 FAR *)bufp;
+ j = (hcf_16)i/4;
+ OUT_PORT_STRING_32( io_port, p4, j );
+ //. . adjust buffer length and pointer accordingly
+ bufp += i & ~0x0003;
+ i &= 0x0003;
+ }
+ }
+#endif // HCF_IO_32BITS
+ //if no 32-bit support OR byte aligned OR 1 word left
+ if ( i ) {
+ //. if odd number of bytes left
+ if ( i & 0x0001 ) {
+ //. . save left over byte (before bufp is corrupted) in carry, set carry flag
+ ifbp->IFB_CarryOut = (hcf_16)bufp[i-1] | 0x0100; //note that i and bufp are always simultaneously modified, &bufp[i-1] is invariant
+ }
+ //. write as many word as possible in "alignment safe" way
+ j = (hcf_16)i/2;
+ OUT_PORT_STRING_8_16( io_port, bufp, j );
+ }
+} // put_frag
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE void put_frag_finalize( IFBP ifbp )
+*.PURPOSE cleanup after put_frag for trailing odd byte and MIC transfer to NIC.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+*
+*.RETURNS N.A.
+*
+*.DESCRIPTION
+* finalize the MIC calculation with the padding pattern, output the last byte (if applicable)
+* of the message and the MIC to the TxFS
+*
+*
+*.DIAGRAM
+*2: 1 byte of the last put_frag may be still in IFB_CarryOut ( the put_frag carry holder ), so ........
+* 1 - 3 bytes of the last put_frag may be still in IFB_tx_32 ( the MIC engine carry holder ), so ........
+* The call to the MIC calculation routine feeds these remaining bytes (if any) of put_frag and the
+* just as many bytes of the padding as needed to the MIC calculation engine. Note that the "unneeded" pad
+* bytes simply end up in the MIC engine carry holder and are never used.
+*8: write the remainder of the MIC and possible some garbage to NIC RAM
+* Note: i is always 4 (a loop-invariant of the while in point 2)
+*
+*.NOTICE
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC void
+put_frag_finalize( IFBP ifbp )
+{
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ if ( ifbp->IFB_MICTxCarry != 0xFFFF) { //if MIC calculation active
+ CALC_TX_MIC( mic_pad, 8); //. feed (up to 8 bytes of) virtual padding to MIC engine
+ //. write (possibly) trailing byte + (most of) MIC
+ put_frag( ifbp, (wci_bufp)ifbp->IFB_MICTx, 8 BE_PAR(0) );
+ }
+#endif // HCF_TYPE_WPA
+ put_frag( ifbp, null_addr, 1 BE_PAR(0) ); //write (possibly) trailing data or MIC byte
+} // put_frag_finalize
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE int put_info( IFBP ifbp, LTVP ltvp )
+*.PURPOSE support routine to handle the "basic" task of hcf_put_info to pass RIDs to the NIC.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* ltvp address in NIC RAM where LVT-records are located
+*
+*.RETURNS
+* HCF_SUCCESS
+* >>put_frag
+* >>cmd_wait
+*
+*.DESCRIPTION
+*
+*
+*.DIAGRAM
+*20: do not write RIDs to NICs which have incompatible Firmware
+*24: If the RID does not exist, the L-field is set to zero.
+* Note that some RIDs can not be read, e.g. the pseudo RIDs for direct Hermes commands and CFG_DEFAULT_KEYS
+*28: If the RID is written successful, pass it to the NIC by means of an Access Write command
+*
+*.NOTICE
+* The mechanism to HCF_ASSERT on invalid typ-codes in the LTV record is based on the following strategy:
+* - some codes (e.g. CFG_REG_MB) are explicitly handled by the HCF which implies that these codes
+* are valid. These codes are already consumed by hcf_put_info.
+* - all other codes are passed to the Hermes. Before the put action is executed, hcf_get_info is called
+* with an LTV record with a value of 1 in the L-field and the intended put action type in the Typ-code
+* field. If the put action type is valid, it is also valid as a get action type code - except
+* for CFG_DEFAULT_KEYS and CFG_ADD_TKIP_DEFAULT_KEY - so the HCF_ASSERT logic of hcf_get_info should
+* not catch.
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC int
+put_info( IFBP ifbp, LTVP ltvp )
+{
+
+int rc = HCF_SUCCESS;
+
+ HCFASSERT( ifbp->IFB_CardStat == 0, MERGE_2( ltvp->typ, ifbp->IFB_CardStat ) )
+ HCFASSERT( CFG_RID_CFG_MIN <= ltvp->typ && ltvp->typ <= CFG_RID_CFG_MAX, ltvp->typ )
+
+ if ( ifbp->IFB_CardStat == 0 && /* 20*/
+ ( ( CFG_RID_CFG_MIN <= ltvp->typ && ltvp->typ <= CFG_RID_CFG_MAX ) ||
+ ( CFG_RID_ENG_MIN <= ltvp->typ /* && ltvp->typ <= 0xFFFF */ ) ) ) {
+#if HCF_ASSERT //FCC8, FCB0, FCB4, FCB6, FCB7, FCB8, FCC0, FCC4, FCBC, FCBD, FCBE, FCBF
+ {
+ hcf_16 t = ltvp->typ;
+ LTV_STRCT x = { 2, t, {0} }; /*24*/
+ hcf_get_info( ifbp, (LTVP)&x );
+ if ( x.len == 0 &&
+ ( t != CFG_DEFAULT_KEYS && t != CFG_ADD_TKIP_DEFAULT_KEY && t != CFG_REMOVE_TKIP_DEFAULT_KEY &&
+ t != CFG_ADD_TKIP_MAPPED_KEY && t != CFG_REMOVE_TKIP_MAPPED_KEY &&
+ t != CFG_HANDOVER_ADDR && t != CFG_DISASSOCIATE_ADDR &&
+ t != CFG_FCBC && t != CFG_FCBD && t != CFG_FCBE && t != CFG_FCBF &&
+ t != CFG_DEAUTHENTICATE_ADDR
+ )
+ ) {
+ HCFASSERT( DO_ASSERT, ltvp->typ )
+ }
+ }
+#endif // HCF_ASSERT
+
+ rc = setup_bap( ifbp, ltvp->typ, 0, IO_OUT );
+ put_frag( ifbp, (wci_bufp)ltvp, 2*ltvp->len + 2 BE_PAR(2) );
+/*28*/ if ( rc == HCF_SUCCESS ) {
+ rc = cmd_exe( ifbp, HCMD_ACCESS + HCMD_ACCESS_WRITE, ltvp->typ );
+ }
+ }
+ return rc;
+} // put_info
+
+
+#if (HCF_DL_ONLY) == 0
+/************************************************************************************************************
+*
+*.SUBMODULE int put_info_mb( IFBP ifbp, CFG_MB_INFO_STRCT FAR * ltvp )
+*.PURPOSE accumulates a ( series of) buffers into a single Info block into the MailBox.
+*
+*.ARGUMENTS
+* ifbp address of the Interface Block
+* ltvp address of structure specifying the "type" and the fragments of the information to be synthesized
+* as an LTV into the MailBox
+*
+*.RETURNS
+*
+*.DESCRIPTION
+* If the data does not fit (including no MailBox is available), the IFB_MBTally is incremented and an
+* error status is returned.
+* HCF_ASSERT does not catch.
+* Calling put_info_mb when their is no MailBox available, is considered a design error in the MSF.
+*
+* Note that there is always at least 1 word of unused space in the mail box.
+* As a consequence:
+* - no problem in pointer arithmetic (MB_RP == MB_WP means unambiguously mail box is completely empty
+* - There is always free space to write an L field with a value of zero after each MB_Info block. This
+* allows for an easy scan mechanism in the "get MB_Info block" logic.
+*
+*
+*.DIAGRAM
+*1: Calculate L field of the MBIB, i.e. 1 for the T-field + the cumulative length of the fragments.
+*2: The free space in the MailBox is calculated (2a: free part from Write Ptr to Read Ptr, 2b: free part
+* turns out to wrap around) . If this space suffices to store the number of words reflected by len (T-field
+* + Value-field) plus the additional MailBox Info L-field + a trailing 0 to act as the L-field of a trailing
+* dummy or empty LTV record, then a MailBox Info block is build in the MailBox consisting of
+* - the value len in the first word
+* - type in the second word
+* - a copy of the contents of the fragments in the second and higher word
+*
+*4: Since put_info_mb() can more or less directly be called from the MSF level, the I/F must be robust
+* against out-of-range variables. As failsafe coding, the MB update is skipped by changing tlen to 0 if
+* len == 0; This will indirectly cause an assert as result of the violation of the next if clause.
+*6: Check whether the free space in MailBox suffices (this covers the complete absence of the MailBox).
+* Note that len is unsigned, so even MSF I/F violation works out O.K.
+* The '2' in the expression "len+2" is used because 1 word is needed for L itself and 1 word is needed
+* for the zero-sentinel
+*8: update MailBox Info length report to MSF with "oldest" MB Info Block size. Be carefull here, if you get
+* here before the MailBox is registered, you can't read from the buffer addressed by IFB_MBp (it is the
+* Null buffer) so don't move this code till the end of this routine but keep it where there is garuanteed
+* a buffer.
+*
+*.NOTICE
+* boundary testing depends on the fact that IFB_MBSize is guaranteed to be zero if no MailBox is present,
+* and to a lesser degree, that IFB_MBWp = IFB_MBRp = 0
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+#if (HCF_EXT) & HCF_EXT_MB
+
+HCF_STATIC int
+put_info_mb( IFBP ifbp, CFG_MB_INFO_STRCT FAR * ltvp )
+{
+
+int rc = HCF_SUCCESS;
+hcf_16 i; //work counter
+hcf_16 *dp; //destination pointer (in MailBox)
+wci_recordp sp; //source pointer
+hcf_16 len; //total length to copy to MailBox
+hcf_16 tlen; //free length/working length/offset in WMP frame
+
+ if ( ifbp->IFB_MBp == NULL ) return rc; //;?not sufficient
+ HCFASSERT( ifbp->IFB_MBp != NULL, 0 ) //!!!be careful, don't get into an endless recursion
+ HCFASSERT( ifbp->IFB_MBSize, 0 )
+
+ len = 1; /* 1 */
+ for ( i = 0; i < ltvp->frag_cnt; i++ ) {
+ len += ltvp->frag_buf[i].frag_len;
+ }
+ if ( ifbp->IFB_MBRp > ifbp->IFB_MBWp ) {
+ tlen = ifbp->IFB_MBRp - ifbp->IFB_MBWp; /* 2a*/
+ } else {
+ if ( ifbp->IFB_MBRp == ifbp->IFB_MBWp ) {
+ ifbp->IFB_MBRp = ifbp->IFB_MBWp = 0; // optimize Wrapping
+ }
+ tlen = ifbp->IFB_MBSize - ifbp->IFB_MBWp; /* 2b*/
+ if ( ( tlen <= len + 2 ) && ( len + 2 < ifbp->IFB_MBRp ) ) { //if trailing space is too small but
+ // leading space is sufficiently large
+ ifbp->IFB_MBp[ifbp->IFB_MBWp] = 0xFFFF; //flag dummy LTV to fill the trailing space
+ ifbp->IFB_MBWp = 0; //reset WritePointer to begin of MailBox
+ tlen = ifbp->IFB_MBRp; //get new available space size
+ }
+ }
+ dp = &ifbp->IFB_MBp[ifbp->IFB_MBWp];
+ if ( len == 0 ) {
+ tlen = 0; //;? what is this good for
+ }
+ if ( len + 2 >= tlen ){ /* 6 */
+ //Do Not ASSERT, this is a normal condition
+ IF_TALLY( ifbp->IFB_HCF_Tallies.NoBufMB++; ) /*NOP to cover against analomies with empty compound*/;
+ rc = HCF_ERR_LEN;
+ } else {
+ *dp++ = len; //write Len (= size of T+V in words to MB_Info block
+ *dp++ = ltvp->base_typ; //write Type to MB_Info block
+ ifbp->IFB_MBWp += len + 1; //update WritePointer of MailBox
+ for ( i = 0; i < ltvp->frag_cnt; i++ ) { // process each of the fragments
+ sp = ltvp->frag_buf[i].frag_addr;
+ len = ltvp->frag_buf[i].frag_len;
+ while ( len-- ) *dp++ = *sp++;
+ }
+ ifbp->IFB_MBp[ifbp->IFB_MBWp] = 0; //to assure get_info for CFG_MB_INFO stops
+ ifbp->IFB_MBInfoLen = ifbp->IFB_MBp[ifbp->IFB_MBRp]; /* 8 */
+ }
+ return rc;
+} // put_info_mb
+
+#endif // HCF_EXT_MB
+#endif // HCF_DL_ONLY
+
+
+/************************************************************************************************************
+*
+*.SUBMODULE int setup_bap( IFBP ifbp, hcf_16 fid, int offset, int type )
+*.PURPOSE set up data access to NIC RAM via BAP_1.
+*
+*.ARGUMENTS
+* ifbp address of I/F Block
+* fid FID/RID
+* offset !!even!! offset in FID/RID
+* type IO_IN, IO_OUT
+*
+*.RETURNS
+* HCF_SUCCESS O.K
+* HCF_ERR_NO_NIC card is removed
+* HCF_ERR_DEFUNCT_TIME_OUT Fatal malfunction detected
+* HCF_ERR_DEFUNCT_..... if and only if IFB_DefunctStat <> 0
+*
+*.DESCRIPTION
+*
+* A non-zero return status indicates:
+* - the NIC is considered nonoperational, e.g. due to a time-out of some Hermes activity in the past
+* - BAP_1 could not properly be initialized
+* - the card is removed before completion of the data transfer
+* In all other cases, a zero is returned.
+* BAP Initialization failure indicates an H/W error which is very likely to signal complete H/W failure.
+* Once a BAP Initialization failure has occurred all subsequent interactions with the Hermes will return a
+* "defunct" status till the Hermes is re-initialized by means of an hcf_connect.
+*
+* A BAP is a set of registers (Offset, Select and Data) offering read/write access to a particular FID or
+* RID. This access is based on a auto-increment feature.
+* There are two BAPs but these days the HCF uses only BAP_1 and leaves BAP_0 to the PCI Busmastering H/W.
+*
+* The BAP-mechanism is based on the Busy bit in the Offset register (see the Hermes definition). The waiting
+* for Busy must occur between writing the Offset register and accessing the Data register. The
+* implementation to wait for the Busy bit drop after each write to the Offset register, implies that the
+* requirement that the Busy bit is low before the Select register is written, is automatically met.
+* BAP-setup may be time consuming (e.g. 380 usec for large offsets occurs frequently). The wait for Busy bit
+* drop is protected by a loop counter, which is initialized with IFB_TickIni, which is calibrated in init.
+*
+* The NIC I/F is optimized for word transfer and can only handle word transfer at a word boundary in NIC
+* RAM. The intended solution for transfer of a single byte has multiple H/W flaws. There have been different
+* S/W Workaround strategies. RID access is hcf_16 based by "nature", so no byte access problems. For Tx/Rx
+* FID access, the byte logic became obsolete by absorbing it in the double word oriented nature of the MIC
+* feature.
+*
+*
+*.DIAGRAM
+*
+*2: the test on rc checks whether the HCF went into "defunct" mode ( e.g. BAP initialization or a call to
+* cmd_wait did ever fail).
+*4: the select register and offset register are set
+* the offset register is monitored till a successful condition (no busy bit) is detected or till the
+* (calibrated) protection counter expires
+* If the counter expires, this is reflected in IFB_DefunctStat, so all subsequent calls to setup_bap fail
+* immediately ( see 2)
+*6: initialization of the carry as used by pet/get_frag
+*8: HREG_OFFSET_ERR is ignored as error because:
+* a: the Hermes is robust against it
+* b: it is not known what causes it (probably a bug), hence no strategy can be specified which level is
+* to handle this error in which way. In the past, it could be induced by the MSF level, e.g. by calling
+* hcf_rcv_msg while there was no Rx-FID available. Since this is an MSF-error which is caught by ASSERT,
+* there is no run-time action required by the HCF.
+* Lumping the Offset error in with the Busy bit error, as has been done in the past turns out to be a
+* disaster or a life saver, just depending on what the cause of the error is. Since no prediction can be
+* done about the future, it is "felt" to be the best strategy to ignore this error. One day the code was
+* accompanied by the following comment:
+* // ignore HREG_OFFSET_ERR, someone, supposedly the MSF programmer ;) made a bug. Since we don't know
+* // what is going on, we might as well go on - under management pressure - by ignoring it
+*
+*.ENDDOC END DOCUMENTATION
+*
+************************************************************************************************************/
+HCF_STATIC int
+setup_bap( IFBP ifbp, hcf_16 fid, int offset, int type )
+{
+PROT_CNT_INI
+int rc;
+
+ HCFTRACE( ifbp, HCF_TRACE_STRIO );
+ if ( ( rc = ifbp->IFB_DefunctStat ) == HCF_SUCCESS ) { /*2*/
+ OPW( HREG_SELECT_1, fid ); /*4*/
+ OPW( HREG_OFFSET_1, offset );
+ if ( type == IO_IN ) {
+ ifbp->IFB_CarryIn = 0;
+ }
+ else ifbp->IFB_CarryOut = 0;
+ HCF_WAIT_WHILE( IPW( HREG_OFFSET_1) & HCMD_BUSY );
+ HCFASSERT( !( IPW( HREG_OFFSET_1) & HREG_OFFSET_ERR ), MERGE_2( fid, offset ) ) /*8*/
+ if ( prot_cnt == 0 ) {
+ HCFASSERT( DO_ASSERT, MERGE_2( fid, offset ) )
+ rc = ifbp->IFB_DefunctStat = HCF_ERR_DEFUNCT_TIME_OUT;
+ ifbp->IFB_CardStat |= CARD_STAT_DEFUNCT;
+ }
+ }
+ HCFTRACE( ifbp, HCF_TRACE_STRIO | HCF_TRACE_EXIT );
+ return rc;
+} // setup_bap
+
diff --git a/drivers/staging/wlags49_h2/hcf.h b/drivers/staging/wlags49_h2/hcf.h
new file mode 100644
index 000000000000..2cd573944cdc
--- /dev/null
+++ b/drivers/staging/wlags49_h2/hcf.h
@@ -0,0 +1,405 @@
+
+// vim:tw=110:ts=4:
+#ifndef HCF_H
+#define HCF_H 1
+
+/************************************************************************************************************
+*
+* FILE : hcf.h
+*
+* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.7 $
+* Original: 2004/05/19 07:26:01 Revision: 1.56 Tag: hcf7_t20040602_01
+* Original: 2004/05/12 08:47:23 Revision: 1.53 Tag: hcf7_t7_20040513_01
+* Original: 2004/04/15 09:24:42 Revision: 1.46 Tag: hcf7_t7_20040415_01
+* Original: 2004/04/08 15:18:16 Revision: 1.45 Tag: t7_20040413_01
+* Original: 2004/04/01 15:32:55 Revision: 1.43 Tag: t7_20040401_01
+* Original: 2004/03/10 15:39:28 Revision: 1.39 Tag: t20040310_01
+* Original: 2004/03/04 11:03:38 Revision: 1.37 Tag: t20040304_01
+* Original: 2004/03/02 14:51:21 Revision: 1.35 Tag: t20040302_03
+* Original: 2004/02/24 13:00:28 Revision: 1.28 Tag: t20040224_01
+* Original: 2004/02/09 14:50:14 Revision: 1.26 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* SPECIFICATION: ..........
+*
+* DESC : Definitions and Prototypes for MSF as well as HCF sources
+*
+* Customizable via HCFCFG.H
+*
+*
+**************************************************************************************************************
+
+**************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+*************************************************************************************************************/
+
+
+#include "hcfcfg.h" // System Constants to be defined by the MSF-programmer to tailor the HCF
+#include "mdd.h" // Include file common for HCF, MSF
+
+
+/************************************************************************************************/
+/************************************** MACROS ************************************************/
+/************************************************************************************************/
+
+#define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
+
+/* Endianess
+ * Little Endian (a.k.a. Intel), least significant byte first
+ * Big Endian (a.k.a. Motorola), most significant byte first
+ *
+ * The following macros are supplied
+ * o CNV_LITTLE_TO_SHORT(w) interprets the 16-bits input value as Little Endian, returns an hcf_16
+ * o CNV_BIG_TO_SHORT(w) interprets the 16-bits input value as Big Endian, returns an hcf_16
+ *
+ */
+
+/* To increase portability, use unsigned char and unsigned char * when accessing parts of larger
+ * types to convert their Endianess
+ */
+
+#define CNV_END_SHORT(w) (hcf_16)( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
+#define CNV_END_LONG(dw) (hcf_32)( (dw >> 24) | ((dw >> 8) & 0xff00) | ((dw << 8) & 0xff0000) | (dw << 24) )
+
+#if HCF_BIG_ENDIAN
+//******************************************** B I G E N D I A N *******************************************
+#define CNV_LITTLE_TO_SHORT(w) CNV_END_SHORT(w) // endianess conversion needed
+#define CNV_BIG_TO_SHORT(w) (w) // no endianess conversion needed
+#define CNV_LITTLE_TO_LONG(dw) CNV_END_LONG(dw)
+#define CNV_LONG_TO_LITTLE(dw) CNV_END_LONG(dw)
+#else
+//****************************************** L I T T L E E N D I A N ****************************************
+#define CNV_LITTLE_TO_SHORT(w) (w) // no endianess conversion needed
+#define CNV_BIG_TO_SHORT(w) CNV_END_SHORT(w) // endianess conversion needed
+#define CNV_LITTLE_TO_LONG(dw) (dw)
+#define CNV_LONG_TO_LITTLE(dw) (dw)
+
+#if defined HCF_ALIGN && HCF_ALIGN > 1
+#define CNV_SHORTP_TO_LITTLE(pw) ((hcf_16)(*(hcf_8 *)pw)) | ((hcf_16)(*((hcf_8 *)pw+1)) << 8)
+#define CNV_LONGP_TO_LITTLE(pdw) ((hcf_32)(*(hcf_8 *)pdw)) | ((hcf_32)(*((hcf_8 *)pdw+1)) << 8) | \
+ ((hcf_32)(*((hcf_8 *)pdw+2)) << 16) | ((hcf_32)(*((hcf_8 *)pdw+3)) << 24)
+#else
+#define CNV_LONGP_TO_LITTLE(pdw) (*(hcf_32 *)pdw)
+#define CNV_SHORTP_TO_LITTLE(pw) (*(hcf_16 *)pw)
+#endif
+
+#endif // HCF_BIG_ENDIAN
+
+// conversion macros which can be expressed in other macros
+#define CNV_SHORT_TO_LITTLE(w) CNV_LITTLE_TO_SHORT(w)
+#define CNV_SHORT_TO_BIG(w) CNV_BIG_TO_SHORT(w)
+
+/************************************************************************************************/
+/************************************** END OF MACROS *****************************************/
+/************************************************************************************************/
+
+/***********************************************************************************************************/
+/***************** ****************************************/
+/***********************************************************************************************************/
+
+// offsets Transmit/Receive Frame Structure
+#define HFS_STAT 0x0000
+#define HFS_SWSUP 0x0006 //SW Support
+#define HFS_Q_INFO 0x0006 //Signal/Silence level
+#define HFS_RATE 0x0008 //RxFlow/Rate
+#define HFS_STAT_ERR RX_STAT_ERR //link "natural" HCF name to "natural" MSF name
+#define HFS_TX_CNTL 0x0036
+ // H-I H-II
+#define HFS_DAT_LEN (HFS_ADDR_DEST - 2) // 0x002C 0x0038
+#define HFS_ADDR_DEST 0x003A // 0x002E 0x003A
+#define HFS_ADDR_SRC (HFS_ADDR_DEST + 6) // 0x0034 0x0040
+#define HFS_LEN (HFS_ADDR_SRC + 6) // 0x003A 0x0046
+#define HFS_DAT (HFS_LEN + 2) // 0x003C 0x0048
+#define HFS_TYPE (HFS_DAT + 6) // 0x0042 0x004E
+
+
+//============================= D E S C R I P T O R S T R U C T U R E ==============================
+//;?MDD.H stuff ;?
+
+#if HCF_BIG_ENDIAN
+#define DESC_STRCT_CNT 0
+#define DESC_STRCT_SIZE 1
+#else
+#define DESC_STRCT_CNT 1
+#define DESC_STRCT_SIZE 0
+#endif // HCF_BIG_ENDIAN
+
+#define BUF_CNT buf_dim[DESC_STRCT_CNT]
+#define BUF_SIZE buf_dim[DESC_STRCT_SIZE]
+
+typedef struct DESC_STRCT {
+ hcf_16 buf_dim[2];
+ hcf_32 buf_phys_addr;
+ hcf_32 next_desc_phys_addr; // physical address of next descriptor
+ hcf_32 desc_phys_addr; // physical address of this descriptor
+ struct DESC_STRCT *next_desc_addr;
+ hcf_8 FAR *buf_addr;
+#if (HCF_EXT) & HCF_EXT_DESC_STRCT
+ void FAR *DESC_MSFSup; // pointer for arbitrary use by the MSF
+#endif // HCF_DESC_STRCT_EXT
+} DESC_STRCT;
+
+#define HCF_DASA_SIZE 12 //size in bytes for DA/SA
+
+#define DESC_CNT_MASK 0x0FFF
+
+#define GET_BUF_SIZE(descp) ((descp)->BUF_SIZE)
+#define GET_BUF_CNT(descp) ((descp)->BUF_CNT)
+#define SET_BUF_SIZE(descp, size) (descp)->BUF_SIZE = size;
+#define SET_BUF_CNT(descp, count) (descp)->BUF_CNT = count;
+
+//========================================= T A L L I E S ===================================================
+
+typedef struct { //Hermes Tallies (IFB substructure)
+ hcf_32 TxUnicastFrames;
+ hcf_32 TxMulticastFrames;
+ hcf_32 TxFragments;
+ hcf_32 TxUnicastOctets;
+ hcf_32 TxMulticastOctets;
+ hcf_32 TxDeferredTransmissions;
+ hcf_32 TxSingleRetryFrames;
+ hcf_32 TxMultipleRetryFrames;
+ hcf_32 TxRetryLimitExceeded;
+ hcf_32 TxDiscards;
+ hcf_32 RxUnicastFrames;
+ hcf_32 RxMulticastFrames;
+ hcf_32 RxFragments;
+ hcf_32 RxUnicastOctets;
+ hcf_32 RxMulticastOctets;
+ hcf_32 RxFCSErrors;
+ hcf_32 RxDiscardsNoBuffer;
+ hcf_32 TxDiscardsWrongSA;
+ hcf_32 RxWEPUndecryptable;
+ hcf_32 RxMsgInMsgFragments;
+ hcf_32 RxMsgInBadMsgFragments;
+ hcf_32 RxDiscardsWEPICVError;
+ hcf_32 RxDiscardsWEPExcluded;
+#if (HCF_EXT) & HCF_EXT_TALLIES_FW
+ hcf_32 TalliesExtra[32];
+#endif // HCF_EXT_TALLIES_FW
+} CFG_HERMES_TALLIES_STRCT;
+
+typedef struct { //HCF Tallies (IFB substructure)
+ hcf_32 NoBufInfo; //No buffer available for unsolicited Notify frame
+ hcf_32 NoBufMB; //No space available in MailBox
+ hcf_32 MiscErr; /* Command errors
+ * - time out on completion synchronous part Hermes Command
+ * - completed Hermes Command doesn't match original command
+ * - status of completed Hermes Command contains error bits
+ */
+#if (HCF_EXT) & HCF_EXT_TALLIES_FW
+ hcf_32 EngCnt[8];
+#endif // HCF_EXT_TALLIES_FW
+} CFG_HCF_TALLIES_STRCT;
+
+//Note this way to define ..._TAL_CNT implies that all tallies must keep the same (hcf_32) size
+#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
+#if (HCF_TALLIES) & HCF_TALLIES_NIC //Hermes tally support
+#define HCF_NIC_TAL_CNT (sizeof(CFG_HERMES_TALLIES_STRCT)/ sizeof(hcf_32))
+#else
+#define HCF_NIC_TAL_CNT 0
+#endif // HCF_TALLIES
+#if (HCF_TALLIES) & HCF_TALLIES_HCF //HCF tally support
+#define HCF_HCF_TAL_CNT (sizeof(CFG_HCF_TALLIES_STRCT) / sizeof(hcf_32))
+#else
+#define HCF_HCF_TAL_CNT 0
+#endif // HCF_TALLIES
+#define HCF_TOT_TAL_CNT ( HCF_NIC_TAL_CNT + HCF_NIC_TAL_CNT )
+#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
+
+
+/***********************************************************************************************************/
+/********************************** I N T E R F A C E B L O C K ******************************************/
+/***********************************************************************************************************/
+
+#define IFB_VERSION 0x0E // initially 0, to be incremented by every IFB layout change
+
+typedef struct {
+ hcf_io IFB_IOBase; // I/O address of Hermes chip as passed by MSF at hcf_connect call
+ hcf_16 IFB_IORange; // I/O Range used by Hermes chip
+ hcf_16 IFB_DLMode; // Download Mode state
+ hcf_16 IFB_Cmd; // cmd in progress flag, to be ack-ed before next cmd can be issued
+ hcf_16 IFB_RxFID; // FID of "current" RxFS (non-DMA mode)
+//;?#if tx_delay option
+ hcf_16 IFB_TxFID; // fid storage during "delayed" send
+//;?#endif tx_delay option
+ hcf_16 IFB_RxLen; //
+ hcf_16 IFB_DefunctStat; // BAP initialization or Cmd Completion failed
+ hcf_16 IFB_ErrCmd; // contents Status reg when error bits and/or mismatch in cmd_wait
+ hcf_16 IFB_ErrQualifier; // contents Resp0 reg when error bits and/or mismatch in cmd_wait
+ hcf_16 IFB_lal; // LookAhead Length
+ wci_bufp IFB_lap; // LookAhead Buffer pointer
+ hcf_16 IFB_LinkStat; // Link Status
+ hcf_16 IFB_DSLinkStat; // Link Status, new strategy introduced for DeepSleep
+ hcf_16 IFB_CarryIn; // carry and carry-flag to move 1 byte from one get_frag to the next
+ hcf_16 IFB_CarryOut; // carry and carry-flag to move 1 byte from one put_frag to the next
+ hcf_16 IFB_Version; // IFB_VERSION, incremented by every SIGNIFICANT IFB layout change
+ hcf_16 IFB_CardStat; // NIC error / F/W incompatibility status
+ hcf_16 IFB_RscInd; // non-DMA: TxFID available, DMA: always 1
+ hcf_16 IFB_CntlOpt; // flags: 32 bits I/O, DMA available, DMA enabled
+ hcf_16 IFB_BusType; // BusType, derived via CFG_NIC_BUS_TYPE
+ CFG_FW_IDENTITY_STRCT IFB_FWIdentity; /* keep FWIdentity/Sup and PRIIdentity/Sup in sequence
+ * because of the (dumb) copy in init() */
+#if defined MSF_COMPONENT_ID
+ CFG_SUP_RANGE_STRCT IFB_FWSup;
+ CFG_PRI_IDENTITY_STRCT IFB_PRIIdentity;
+ CFG_SUP_RANGE_STRCT IFB_PRISup;
+ CFG_SUP_RANGE_STRCT IFB_HSISup;
+#endif // MSF_COMPONENT_ID
+#if (HCF_EXT) & HCF_EXT_INFO_LOG
+ RID_LOGP IFB_RIDLogp; // pointer to RID_LOG structure
+#endif // HCF_EXT_INFO_LOG
+#if HCF_PROT_TIME
+ hcf_32 IFB_TickIni; // initialization of S/W counter based protection loop
+#endif // HCF_PROT_TIME
+#if (HCF_EXT) & HCF_EXT_INT_TICK
+ int IFB_TickCnt; // Hermes Timer Tick Counter
+#endif // HCF_EXT_INT_TICK
+#if (HCF_EXT) & HCF_EXT_MB
+ hcf_16 *IFB_MBp; // pointer to the MailBox
+ hcf_16 IFB_MBSize; // size of the MailBox
+ hcf_16 IFB_MBWp; // zero-based write index into the MailBox
+ hcf_16 IFB_MBRp; // zero-based read index into the MailBox
+ hcf_16 IFB_MBInfoLen; // contents of L-field of the oldest available MailBoxInfoBlock
+#endif // HCF_EXT_MB
+#if (HCF_TYPE) & HCF_TYPE_WPA
+ hcf_16 IFB_MICTxCntl; // MIC bit and Key index in TxControl field of TxFS
+ hcf_32 IFB_MICTxKey[2]; // calculating key
+ hcf_32 IFB_MICTx[2]; // Tx MIC calculation Engine state
+ hcf_16 IFB_MICTxCarry; // temp length, carries over from one Tx fragment to another
+ hcf_16 IFB_MICRxCarry; // temp length, carries over from one Rx fragment to another
+ hcf_32 IFB_MICRxKey[4*2]; // 4 checking keys
+ hcf_32 IFB_MICRx[2]; // Rx MIC calculation Engine state
+#endif // HCF_TYPE_WPA
+#if HCF_ASSERT
+#if (HCF_ASSERT) & HCF_ASSERT_MB
+ CFG_MB_INFO_RANGE1_STRCT IFB_AssertStrct; // Add some complication to the HCF as prize for the new MSF I/F
+#endif // HCF_ASSERT_MB
+ // target of above IFB_AssertStrct
+ hcf_16 IFB_AssertLine; // - line number ( + encoded module name )
+ hcf_16 IFB_AssertTrace; // - bit based trace of all hcf_.... invocations
+ hcf_32 IFB_AssertQualifier; // - qualifier
+ hcf_16 IFB_AssertLvl; // Assert Filtering, Not yet implemented
+ hcf_16 IFB_AssertWhere; // Where parameter of the Assert macro
+#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
+ MSF_ASSERT_RTNP IFB_AssertRtn; // MSF Assert Call back routine (inspired by GEF, DrDobbs Nov 1998 )
+#endif // HCF_ASSERT_LNK_MSF_RTN
+#if (HCF_ASSERT) & HCF_ASSERT_PRINTF // engineering facilty intended as F/W debugging aid
+ hcf_16 IFB_DbgPrintF_Cnt;
+ CFG_FW_PRINTF_BUFFER_LOCATION_STRCT IFB_FwPfBuff;
+#endif // HCF_ASSERT_PRINTF
+#endif // HCF_ASSERT
+#if ! defined HCF_INT_OFF
+ hcf_16 volatile IFB_IntOffCnt; // 0xFFFF based HCF_ACT_INT_OFF nesting counter, DeepSleep flag
+#endif // HCF_INT_OFF
+#if (HCF_TYPE) & HCF_TYPE_CCX
+ hcf_16 IFB_CKIPStat; // CKIP Status flag
+#endif // HCF_TYPE_CCX
+#if (HCF_TALLIES) & ( HCF_TALLIES_NIC | HCF_TALLIES_HCF ) //Hermes and/or HCF tally support
+ hcf_32 IFB_Silly_you_should_align; //;?
+ hcf_16 IFB_TallyLen; // Tally length (to build an LTV)
+ hcf_16 IFB_TallyTyp; // Tally Type (to build an LTV)
+#endif // HCF_TALLIES_NIC / HCF_TALLIES_HCF
+#if (HCF_TALLIES) & HCF_TALLIES_NIC //Hermes tally support
+ CFG_HERMES_TALLIES_STRCT IFB_NIC_Tallies;
+#endif // HCF_TALLIES_NIC
+#if (HCF_TALLIES) & HCF_TALLIES_HCF //HCF tally support
+ CFG_HCF_TALLIES_STRCT IFB_HCF_Tallies;
+#endif // HCF_TALLIES_HCF
+#if HCF_DMA
+ //used for a pool of destination_address descriptor/buffers, used during tx encapsulation points to the
+ //first/last descriptor in the descriptor chain, so we can easily remove and append a packet.
+ DESC_STRCT *IFB_FirstDesc[2];
+ DESC_STRCT *IFB_LastDesc[2];
+ DESC_STRCT *IFB_ConfinedDesc[2]; // pointers to descriptor used for host reclaim purposes.
+ hcf_16 IFB_DmaPackets; // HREG_EV_[TX/RX]DMA_DONE flags, reports DMA Frame availability to MSF
+#endif // HCF_DMA
+#if (HCF_EXT) & HCF_EXT_INT_TX_EX
+ hcf_16 IFB_TxFsStat; // Tx message monitoring
+ hcf_16 IFB_TxFsGap[2]; //;?make this robust
+ hcf_16 IFB_TxFsSwSup;
+#endif // HCF_EXT_INT_TX_EX
+ hcf_16 IFB_Magic; /* "Magic" signature, to help the debugger interpret a memory dump
+ * also the last field cleared at hcf_connect
+ */
+#if (HCF_EXT) & HCF_EXT_IFB_STRCT // for usage by the MSF
+ void FAR *IFB_MSFSup; // pointer for arbitrary use by the MSF
+#endif // HCF_EXT_IFB_STRCT_EXT
+} IFB_STRCT;
+
+typedef IFB_STRCT* IFBP;
+
+
+/***********************************************************************************************************/
+/********************** W C I F U N C T I O N S P R O T O T Y P E S ******************************/
+/***********************************************************************************************************/
+
+EXTERN_C int hcf_action (IFBP ifbp, hcf_16 cmd );
+EXTERN_C int hcf_connect (IFBP ifbp, hcf_io io_base );
+#if (HCF_ENCAP) & HCF_ENC_SUP
+EXTERN_C hcf_8 hcf_encap (wci_bufp type );
+#endif // HCF_ENC_SUP
+EXTERN_C int hcf_get_info (IFBP ifbp, LTVP ltvp );
+EXTERN_C int hcf_service_nic (IFBP ifbp, wci_bufp bufp, unsigned int len );
+EXTERN_C int hcf_cntl (IFBP ifbp, hcf_16 cmd );
+EXTERN_C int hcf_put_info (IFBP ifbp, LTVP ltvp );
+EXTERN_C int hcf_rcv_msg (IFBP ifbp, DESC_STRCT *descp, unsigned int offset );
+EXTERN_C int hcf_send_msg (IFBP ifbp, DESC_STRCT *dp, hcf_16 tx_cntl );
+#if HCF_DMA
+EXTERN_C void hcf_dma_tx_put (IFBP ifbp, DESC_STRCT *d, hcf_16 tx_cntl );
+EXTERN_C DESC_STRCT* hcf_dma_tx_get (IFBP ifbp );
+EXTERN_C DESC_STRCT* hcf_dma_rx_get (IFBP ifbp );
+EXTERN_C void hcf_dma_rx_put (IFBP ifbp, DESC_STRCT *d );
+#endif // HCF_DMA
+#if (HCF_ASSERT) & HCF_ASSERT_LNK_MSF_RTN
+EXTERN_C void msf_assert (unsigned int line_number, hcf_16 trace, hcf_32 qual );
+#endif // HCF_ASSERT_LNK_MSF_RTN
+
+#endif // HCF_H
+
diff --git a/drivers/staging/wlags49_h2/hcfcfg.h b/drivers/staging/wlags49_h2/hcfcfg.h
new file mode 100644
index 000000000000..83475b1060a1
--- /dev/null
+++ b/drivers/staging/wlags49_h2/hcfcfg.h
@@ -0,0 +1,2344 @@
+
+// vim:tw=110:ts=4:
+#ifndef HCFCFG_H
+#define HCFCFG_H 1
+
+/*************************************************************************************************************
+*
+* FILE : hcfcfg.tpl // hcfcfg.h
+*
+* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.6 $
+* Original: 2004/04/08 15:18:16 Revision: 1.40 Tag: t20040408_01
+* Original: 2004/04/01 15:32:55 Revision: 1.38 Tag: t7_20040401_01
+* Original: 2004/03/10 15:39:28 Revision: 1.34 Tag: t20040310_01
+* Original: 2004/03/03 14:10:12 Revision: 1.32 Tag: t20040304_01
+* Original: 2004/03/02 09:27:12 Revision: 1.30 Tag: t20040302_03
+* Original: 2004/02/24 13:00:28 Revision: 1.25 Tag: t20040224_01
+* Original: 2004/02/18 17:13:57 Revision: 1.23 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* DESC : HCF Customization Macros
+* hcfcfg.tpl list all #defines which must be specified to:
+* adjust the HCF functions defined in HCF.C to the characteristics of a specific environment
+* o maximum sizes for messages
+* o Endianess
+* Compiler specific macros
+* o port I/O macros
+* o type definitions
+*
+* By copying HCFCFG.TPL to HCFCFG.H and -if needed- modifying the #defines the WCI functionality can be
+* tailored
+*
+* Supported environments:
+* WVLAN_41 Miniport NDIS 3.1
+* WVLAN_42 Packet Microsoft Visual C 1.5
+* WVLAN_43 16 bits DOS ODI Microsoft Visual C 1.5
+* WVLAN_44 32 bits ODI (__NETWARE_386__) WATCOM
+* WVLAN_45 MAC_OS MPW?, Symantec?
+* WVLAN_46 Windows CE (_WIN32_WCE) Microsoft ?
+* WVLAN_47 LINUX (__LINUX__) GCC, discarded, based on GPL'ed HCF-light
+* WVLAN_48 Miniport NDIS 5
+* WVLAN_49 LINUX (__LINUX__) GCC, originally based on pre-compiled HCF_library
+* migrated to use the HCF sources when Lucent Technologies
+* brought the HCF module under GPL
+* WVLAN_51 Miniport USB NDIS 5
+* WVLAN_52 Miniport NDIS 4
+* WVLAN_53 VxWorks END Station driver
+* WVLAN_54 VxWorks END Access Point driver
+* WVLAN_81 WavePoint BORLAND C
+* WCITST Inhouse test tool Microsoft Visual C 1.5
+* WSU WaveLAN Station Update Microsoft Visual C ??
+* SCO UNIX not yet actually used ? ?
+* __ppc OEM supplied ?
+* _AM29K OEM supplied ?
+* ? OEM supplied Microtec Research 80X86 Compiler
+*
+**************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+*************************************************************************************************************/
+
+/* Alignment
+* Some platforms can access words on odd boundaries (with possibly an performance impact), at other
+* platforms such an access may result in a memory access violation.
+* It is assumed that everywhere where the HCF casts a char pointer into a word pointer, the alignment
+* criteria are met. This put some restrictions on the MSF, which are assumed to be "automatically" fulfilled
+* at the applicable platforms
+* To assert this assumption, the macro HCF_ALIGN can be defined. The default value is 1, meaning byte
+* alignment (or no alignment), a value of 2 means word alignment, a value of 4 means double word alignment
+*/
+
+/***************************** IN_PORT_STRING_8_16 S a m p l e s *****************************************
+
+ // C implementation which let the processor handle the word-at-byte-boundary problem
+#define IN_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); ((hcf_8 FAR*)addr)+=2; }
+
+ // C implementation which handles the word-at-byte-boundary problem
+#define IN_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { hcf_16 i = IN_PORT_WORD(port); *((hcf_8 FAR*)addr)++ = (hcf_8)i; *((hcf_8 FAR*)addr)++ = (hcf_8)(i>>8);}
+
+ // Assembler implementation
+#define IN_PORT_STRING_8_16( port, addr, len) __asm \
+{ \
+ __asm push di \
+ __asm push es \
+ __asm mov cx,len \
+ __asm les di,addr \
+ __asm mov dx,port \
+ __asm rep insw \
+ __asm pop es \
+ __asm pop di \
+}
+
+
+***************************** OUT_PORT_STRING_8_16 S a m p l e s ******************************************
+
+ // C implementation which let the processor handle the word-at-byte-boundary problem
+#define OUT_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; ((hcf_8 FAR*)addr)+=2; }
+
+ // C implementation which handles the word-at-byte-boundary problem
+#define OUT_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { OUT_PORT_WORD( port, *((hcf_8 FAR*)addr) | *(((hcf_8 FAR*)addr)+1)<<8 ); (hcf_8 FAR*)addr+=2; }
+
+ // Assembler implementation
+#define OUT_PORT_STRING_8_16( port, addr, len) __asm \
+{ \
+ __asm push si \
+ __asm push ds \
+ __asm mov cx,len \
+ __asm lds si,addr \
+ __asm mov dx,port \
+ __asm rep outsw \
+ __asm pop ds \
+ __asm pop si \
+}
+
+*************************************************************************************************************/
+
+
+/************************************************************************************************/
+/****************** C O M P I L E R S P E C I F I C M A C R O S ***************************/
+/************************************************************************************************/
+/*************************************************************************************************
+*
+* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
+* !!!! Do not call these macros with parameters which introduce side effects !!!!
+* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
+*
+*
+* By selecting the appropriate Macro definitions by means of modifying the "#ifdef 0/1" lines, the HCF can be
+* adjusted for the I/O characteristics of a specific compiler
+*
+* If needed the macros can be modified or replaced with definitions appropriate for your personal platform.
+* If you need to make such changes it is appreciated if you inform Agere Systems
+* That way the changes can become part of the next release of the WCI
+*
+* For convenience of the MSF-programmer, all macros are allowed to modify their parameters (although some
+* might argue that this would constitute bad coding practice). This has its implications on the HCF, e.g. as a
+* consequence these macros should not be called with parameters which have side effects, e.g auto-increment.
+*
+* in the Microsoft implementation of inline assembly it is O.K. to corrupt all flags except the direction flag
+* and to corrupt all registers except the segment registers and EDI, ESI, ESP and EBP (or their 16 bits
+* equivalents). Other environments may have other constraints
+*
+* in the Intel environment it is O.K to have a word (as a 16 bits quantity) at a byte boundary, hence
+* IN_/OUT_PORT_STRING_8_16 can move words between PC-memory and NIC-memory with as only constraint that the
+* words are on a word boundary in NIC-memory. This does not hold true for all conceivable environments, e.g.
+* an Motorola 68xxx does not allow this. Probably/hopefully the boundary conditions imposed by these type of
+* platforms prevent this case from materializing. If this is not the case, OUT_PORT_STRING_8_16 must be coded
+* by combining two Host memory hcf_8 values at a time to a single hcf_16 value to be passed to the NIC and
+* IN_PORT_STRING_8_16 the single hcf_16 retrieved from the NIC must be split in two hcf_8 values to be stored
+* in Host memory (see the sample code above)
+*
+* The prototypes and functional description of the macros are:
+*
+* hcf_16 IN_PORT_WORD( hcf_16 port )
+* Reads a word (16 bits) from the specified port
+*
+* void OUT_PORT_WORD( hcf_16 port, hcf_16 value)
+* Writes a word (16 bits) to the specified port
+*
+* hcf_16 IN_PORT_DWORD( hcf_16 port )
+* Reads a dword (32 bits) from the specified port
+*
+* void OUT_PORT_DWORD( hcf_16 port, hcf_32 value)
+* Writes a dword (32 bits) to the specified port
+*
+* void IN_PORT_STRING_8_16( port, addr, len)
+* Reads len number of words (16 bits) from NIC memory via the specified port to the (FAR)
+* byte-pointer addr in PC-RAM
+* Note that len specifies the number of words, NOT the number of bytes
+* !!!NOTE, although len specifies the number of words, addr MUST be a char pointer NOTE!!!
+* See also the common notes for IN_PORT_STRING_8_16 and OUT_PORT_STRING_8_16
+*
+* void OUT_PORT_STRING_8_16( port, addr, len)
+* Writes len number of words (16 bits) from the (FAR) byte-pointer addr in PC-RAM via the specified
+* port to NIC memory
+* Note that len specifies the number of words, NOT the number of bytes.
+* !!!NOTE, although len specifies the number of words, addr MUST be a char pointer NOTE!!!
+*
+* The peculiar combination of word-length and char pointers for IN_PORT_STRING_8_16 as well as
+* OUT_PORT_STRING_8_16 is justified by the assumption that it offers a more optimal algorithm
+*
+* void IN_PORT_STRING_32( port, addr, len)
+* Reads len number of double-words (32 bits) from NIC memory via the specified port to the (FAR)
+* double-word address addr in PC-RAM
+*
+* void OUT_PORT_STRING_32( port, addr, len)
+* Writes len number of double-words (32 bits) from the (FAR) double-word address addr in PC-RAM via
+* the specified port to NIC memory
+*
+* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
+* !!!! Do not call these macros with parameters which introduce side effects !!!!
+* !!!!!!!!!!!!!!!!!!!!!!!!! Note to the HCF-implementor !!!!!!!!!!!!!!!!!!!!!!!!!
+*
+*************************************************************************************************/
+
+/**************************** define INT Types ******************************/
+typedef unsigned char hcf_8;
+typedef unsigned short hcf_16;
+typedef unsigned long hcf_32;
+
+/**************************** define I/O Types ******************************/
+#define HCF_IO_MEM 0x0001 // memory mapped I/O ( 0: Port I/O )
+#define HCF_IO_32BITS 0x0002 // 32Bits support ( 0: only 16 Bits I/O)
+
+/****************************** #define HCF_TYPE ********************************/
+#define HCF_TYPE_NONE 0x0000 // No type
+#define HCF_TYPE_WPA 0x0001 // WPA support
+#define HCF_TYPE_USB 0x0002 // reserved (USB Dongle driver support)
+//#define HCF_TYPE_HII 0x0004 // Hermes-II, to discriminate H-I and H-II CFG_HCF_OPT_STRCT
+#define HCF_TYPE_WARP 0x0008 // WARP F/W
+#define HCF_TYPE_PRELOADED 0x0040 // pre-loaded F/W
+#define HCF_TYPE_HII5 0x0080 // Hermes-2.5 H/W
+#define HCF_TYPE_CCX 0x0100 // CKIP
+#define HCF_TYPE_BEAGLE_HII5 0x0200 // Beagle Hermes-2.5 H/W
+#define HCF_TYPE_TX_DELAY 0x4000 // Delayed transmission ( non-DMA only)
+
+/****************************** #define HCF_ASSERT ******************************/
+#define HCF_ASSERT_NONE 0x0000 // No assert support
+#define HCF_ASSERT_PRINTF 0x0001 // Hermes generated debug info
+#define HCF_ASSERT_SW_SUP 0x0002 // logging via Hermes support register
+#define HCF_ASSERT_MB 0x0004 // logging via Mailbox
+#define HCF_ASSERT_RT_MSF_RTN 0x4000 // dynamically binding of msf_assert routine
+#define HCF_ASSERT_LNK_MSF_RTN 0x8000 // statically binding of msf_assert routine
+
+/****************************** #define HCF_ENCAP *******************************/
+#define HCF_ENC_NONE 0x0000 // No encapsulation support
+#define HCF_ENC 0x0001 // HCF handles En-/Decapsulation
+#define HCF_ENC_SUP 0x0002 // HCF supports MSF to handle En-/Decapsulation
+
+/****************************** #define HCF_EXT *********************************/
+#define HCF_EXT_NONE 0x0000 // No expanded features
+#define HCF_EXT_INFO_LOG 0x0001 // logging of Hermes Info frames
+//#define HCF_EXT_INT_TX_OK 0x0002 // RESERVED!!! monitoring successful Tx message
+#define HCF_EXT_INT_TX_EX 0x0004 // monitoring unsuccessful Tx message
+//#define HCF_EXT_MON_MODE 0x0008 // LEGACY
+#define HCF_EXT_TALLIES_FW 0x0010 // support for up to 32 Hermes Engineering tallies
+#define HCF_EXT_TALLIES_HCF 0x0020 // support for up to 8 HCF Engineering tallies
+#define HCF_EXT_NIC_ACCESS 0x0040 // direct access via Aux-ports and to Hermes registers and commands
+#define HCF_EXT_MB 0x0080 // MailBox code expanded
+#define HCF_EXT_IFB_STRCT 0x0100 // MSF custom pointer in IFB
+#define HCF_EXT_DESC_STRCT 0x0200 // MSF custom pointer in Descriptor
+#define HCF_EXT_TX_CONT 0x4000 // Continuous transmit test
+#define HCF_EXT_INT_TICK 0x8000 // enables TimerTick interrupt generation
+
+/****************************** #define HCF_SLEEP *******************************/
+#define HCF_DDS 0x0001 // Disconnected Deep Sleep
+#define HCF_CDS 0x0002 // Connected Deep Sleep
+
+/****************************** #define HCF_TALLIES ******************************/
+#define HCF_TALLIES_NONE 0x0000 // No tally support
+#define HCF_TALLIES_NIC 0x0001 // Hermes Tallies accumulated in IFB
+#define HCF_TALLIES_HCF 0x0002 // HCF Tallies accumulated in IFB
+#define HCF_TALLIES_RESET 0x8000 // Tallies in IFB are reset when reported via hcf_get_info
+
+
+/************************************************************************************************/
+/****************************** M I N I P O R T N D I S *************************************/
+/************************************************************************************************/
+
+#if defined WVLAN_41 || defined WVLAN_48 || defined WVLAN_52 || defined _WIN32_WCE
+
+#ifndef WVLAN_46
+#define HCF_EXT (HCF_EXT_INFO_LOG | HCF_EXT_MB | HCF_EXT_NIC_ACCESS )
+#else
+#define HCF_EXT ( HCF_EXT_TX_CONT | HCF_EXT_INFO_LOG | HCF_EXT_MB | HCF_EXT_NIC_ACCESS )
+#endif
+#define HCF_DLV 1 //H-I legacy, superfluous for H-II
+
+#ifdef _WIN32_WCE
+#define HCF_IO HCF_IO_MEM
+#define HCF_DMA 0 // To enable DMA
+#endif
+
+#if _VARIANT == 7
+#define HCF_SLEEP HCF_CDS
+#endif // _VARIANT == 7
+
+#if _VARIANT == 5 || _VARIANT == 6
+#define _WARP
+#define _AES
+#define HCF_SLEEP HCF_CDS
+#if _VARIANT == 6
+//! #define _RSN
+#endif // _VARIANT == 6
+#ifndef _WIN32_WCE
+#define HCF_IO HCF_IO_32BITS
+#define HCF_DMA 1 // To enable DMA
+#endif
+#endif // _VARIANT == 5 || _VARIANT == 6
+
+
+//HWi for migration purposes I defined a define which will be TRUE for ALL drivers
+//Meaning that _CCX defined code which we think will get a all driver OK flag can be defined from _CCX to _CCX_OK
+#if defined WVLAN_48 // && !defined _WIN32_WCE
+#if _VARIANT == 4 || _VARIANT == 6
+#define _CCX_OK 1
+#endif // _VARIANT == 4 || _VARIANT == 6
+#endif // WVLAN_48
+
+//#if !defined WVLAN_46
+#if defined WVLAN_48
+#if _VARIANT == 4 || _VARIANT == 6
+#define _CCX
+#define HCF_MAX_MSG_CKIP_PADDING 86 //, use 86 for rx fragmentation. 28 is enuf for MIC+PPK encapsulation
+#define HCF_MAX_MSG ( 1514 + HCF_MAX_MSG_CKIP_PADDING ) // need extra padding for CKIP (need to subtract 28 for NDIS)
+#endif // _VARIANT == 4 || _VARIANT == 6
+#endif // WVLAN_48
+//#endif // WVLAN_46
+
+#if !defined WVLAN_46
+#define _PEEK
+#endif
+
+#ifndef _WIN32_WCE
+// ASSERT already used by WinCE...
+#ifdef ASSERT
+#undef ASSERT
+#define ASSERT(x) ASSERTDEBUGMSG((x), (TEXT("SIMULATE ASSERT:")))
+#endif
+#endif
+
+
+#if defined WVLAN_41
+#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_31
+#endif // WVLAN_41
+#if defined WVLAN_48 && !defined _WIN32_WCE
+#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_50
+#endif // WVLAN_48 / _WIN32_WCE
+#if defined WVLAN_52 && !defined _WIN32_WCE
+#define MSF_COMPONENT_ID COMP_ID_MINIPORT_NDIS_40
+#endif // WVLAN_52 / _WIN32_WCE
+#if defined WVLAN_46
+#define MSF_COMPONENT_ID COMP_ID_WIN_CE
+#endif // _WIN32_WCE
+
+#define MSF_COMPONENT_VAR _VARIANT
+
+#define T1__HCF_TYPE (HCF_TYPE_NONE)
+
+#define T2__HCF_TYPE (T1__HCF_TYPE)
+
+#ifdef _WARP
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5 | HCF_TYPE_WARP )
+#else
+#if _VARIANT == 7
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
+#else // _VARIANT == 7
+#define T3__HCF_TYPE (T2__HCF_TYPE)
+#endif // _VARIANT == 7
+#endif // _WARP
+
+#ifdef _CCX_OK
+#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
+#else
+#define T4__HCF_TYPE (T3__HCF_TYPE)
+#endif // _CCX_OK
+
+//not suitable for H-II #define HCF_CFG_STA_1_BOTTOM 16
+
+// Default WPA in ON for all drivers except for WARP driver
+#ifdef _WARP
+#define T5__HCF_TYPE (T4__HCF_TYPE)
+#else // _WARP
+#define T5__HCF_TYPE (T4__HCF_TYPE | HCF_TYPE_WPA)
+#endif // _WARP
+
+#define HCF_TYPE (T5__HCF_TYPE)
+
+// This is needed to get aux_ctrl() from the HCF for WlFreezeAndDump()
+#if (defined DBG && DBG != 0)
+#ifndef STATIC
+#define STATIC
+#endif
+#endif
+
+#if !defined SOFTRONICS_CODE && !defined _APIDLL && !defined _WIN32_WCE
+#include <ndis.h>
+#endif // SOFTRONICS_CODE / _APIDLL / _WIN32_WCE
+#if defined _WIN32_WCE
+#include <windows.h>
+#include <winnt.h>
+#endif // _WIN32_WCE
+#include "version.h"
+
+#define MSF_COMPONENT_MAJOR_VER TPI_MAJOR_VERSION
+#define MSF_COMPONENT_MINOR_VER TPI_MINOR_VERSION
+
+#if !defined _APIDLL && !defined _WIN32_WCE
+
+__inline UCHAR NDIS_IN_BYTE( ULONG port )
+{
+ UCHAR value;
+ NdisRawReadPortUchar(port , &value);
+ return (value);
+}
+
+__inline ULONG NDIS_IN_LONG( ULONG port )
+{
+ ULONG value;
+ NdisRawReadPortUlong(port , &value);
+ return (value);
+}
+__inline USHORT NDIS_IN_WORD( ULONG port )
+{
+ USHORT value;
+ NdisRawReadPortUshort(port , &value);
+ return (value);
+}
+
+#define IN_PORT_DWORD(port) NDIS_IN_LONG( (ULONG) (port) )
+#define IN_PORT_WORD(port) NDIS_IN_WORD( (ULONG) (port) )
+#define OUT_PORT_DWORD(port, value) NdisRawWritePortUlong((ULONG) (port) , value)
+#define OUT_PORT_WORD(port, value) NdisRawWritePortUshort((ULONG) (port) , (USHORT) (value))
+
+#define IN_PORT_STRING_8_16(port, addr, len) IN_PORT_STRING_16(port, addr, len)
+#define OUT_PORT_STRING_8_16(port, addr, len) OUT_PORT_STRING_16(port, addr, len)
+
+#define IN_PORT_STRING_32(port, addr, len) { \
+ NdisRawReadPortBufferUlong(port, addr, (len)); \
+}
+
+#define OUT_PORT_STRING_32(port, addr, len) { \
+ NdisRawWritePortBufferUlong(port, addr, (len)); \
+}
+
+#define IN_PORT_STRING_16(port, addr, len) NdisRawReadPortBufferUshort(port, addr, (len));
+#define OUT_PORT_STRING_16(port, addr, len) NdisRawWritePortBufferUshort(port, addr, (len));
+
+#endif // _APIDLL / _WIN32_WCE
+
+#if defined _WIN32_WCE
+
+#define HCF_ALIGN 2
+#define HCF_MEM_IO 1 // overrule standard Port I/O with Memory mapped I/O
+#define HCF_PROT_TIME 49
+
+#define IN_PORT_BYTE CE_IN_PORT_BYTE
+#define OUT_PORT_BYTE CE_OUT_PORT_BYTE
+#define IN_PORT_WORD CE_IN_PORT_WORD
+#define OUT_PORT_WORD CE_OUT_PORT_WORD
+#define IN_PORT_STRING_16 CE_IN_PORT_STRING
+#define OUT_PORT_STRING_16 CE_OUT_PORT_STRING
+
+extern hcf_8 CE_IN_PORT_BYTE(hcf_32 port);
+extern void CE_OUT_PORT_BYTE(hcf_32 port, hcf_8 value);
+extern hcf_16 CE_IN_PORT_WORD(hcf_32 port);
+extern void CE_OUT_PORT_WORD(hcf_32 port, hcf_16 value);
+extern void CE_IN_PORT_STRING(hcf_32 port, void *addr, hcf_16 len);
+extern void CE_OUT_PORT_STRING(hcf_32 port, void *addr, hcf_16 len);
+
+
+#endif
+
+#if defined _DEBUG || (defined DBG && DBG != 0)
+#define HCF_ASSERT ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN | HCF_ASSERT_PRINTF ) //0xC001
+//#define HCF_ASSERT ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN | HCF_ASSERT_PRINTF | HCF_ASSERT_MB ) //just to test
+#endif // _DEBUG || DBG
+
+#if defined DEBUG || defined _DEBUG || (defined DBG && DBG != 0)
+#ifdef _WIN32_WCE
+#define DBGA2W(DBGSTR) CeConvertAnsiToUnicodeLen((char*)DBGSTR)
+#define OUTPUTDEBUGMSG(dprintf_exp) ((void)((! ZONE_DEBUG) ? 0:ce_debug_out dprintf_exp))
+#define ASSERTDEBUGMSG(cond, dprintf_exp) ((void)((cond) ? 0:ce_debug_out dprintf_exp))
+
+#define ZONE_ERROR DEBUGZONE(0)
+#define ZONE_WARN DEBUGZONE(1)
+#define ZONE_FUNCTION DEBUGZONE(2)
+#define ZONE_INIT DEBUGZONE(3)
+#define ZONE_INTR DEBUGZONE(4)
+#define ZONE_RCV DEBUGZONE(5)
+#define ZONE_XMIT DEBUGZONE(6)
+#define ZONE_ASSERT DEBUGZONE(7)
+#define ZONE_DEBUG DEBUGZONE(8)
+#define ZONE_OEM DEBUGZONE(9)
+#define ZONE_HCF DEBUGZONE(10)
+#define ZONE_PORTIO DEBUGZONE(11)
+#define ZONE_LOGTOFILE DEBUGZONE(15)
+
+#else // !(_WIN32_WCE)
+
+#define OUTPUTDEBUGMSG(dprintf_exp) ((void) (DbgPrint dprintf_exp))
+// the assertdebugmsg macro will print filename, line followed by a caller-defined text, when cond == 0
+#define ASSERTDEBUGMSG(cond, print) ((void)((cond) ? 0: (DbgPrint("%s %s:%d - ", print, __FILE__, __LINE__))))
+
+#define ZONE_ERROR 1
+#define ZONE_WARN 1
+#define ZONE_FUNCTION 1
+#define ZONE_INIT 1
+#define ZONE_INTR 1
+#define ZONE_RCV 1
+#define ZONE_XMIT 1
+#define ZONE_ASSERT 1
+#define ZONE_DEBUG 1
+#define ZONE_OEM 1
+#define ZONE_HCF 1
+#define ZONE_PORTIO 1
+#define ZONE_LOGTOFILE 1
+
+#endif // _WIN32_WCE
+#ifndef DBGA2W
+#define DBGA2W
+#endif // DBGA2W
+
+#else // !(defined DEBUG || defined _DEBUG || (defined DBG && DBG != 0) )
+#define OUTPUTDEBUGMSG(dprintf_exp)
+#define ASSERTDEBUGMSG(cond, dprintf_exp)
+#endif // DEBUG / DBG
+
+#if !defined HCF_MAX_MSG_CKIP_PADDING
+#define HCF_MAX_MSG_CKIP_PADDING 0
+#endif // HCF_MAX_MSG_CKIP_PADDING
+
+#if !defined HCF_MAX_MSG
+#define HCF_MAX_MSG 1514
+#endif // HCF_MAX_MSG
+
+#define HCF_LEGACY 1 //;?nv je moet wat
+
+#endif //WVLAN_41 / WVLAN_48 / WVLAN_52 / _WIN32_WCE
+
+
+/************************************************************************************************/
+/**************************** P A C K E T D R I V E R ***************************************/
+/********************************** D O S O D I *********************************************/
+/************************************************************************************************/
+
+#if defined WVLAN_42 || defined WVLAN_43
+
+#pragma warning ( disable: 4001 )
+#define FAR __far //segmented 16 bits mode
+#define BASED __based(__segname("_CODE")) //force all the "const" structures in the CODE segment
+
+//#define HCF_IO 0 //no DMA, no 32 bits
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#define HCF_EXT HCF_EXT_MB
+#define HCF_PROT_TIME 49 //49*10240 microseconds H/W failure protection timer
+
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+/******************************** CONFIGURATION MANAGEMENT *****************************************/
+#ifdef WVLAN_42
+#define MSF_COMPONENT_ID COMP_ID_PACKET
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 6
+#define MSF_COMPONENT_MINOR_VER 12
+#endif // WVLAN_42
+
+#ifdef WVLAN_43
+#define MSF_COMPONENT_ID COMP_ID_ODI_16
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 6
+#define MSF_COMPONENT_MINOR_VER 10
+#endif // WVLAN_43
+
+/************************************** INPUT / OUTPUT **********************************************/
+#ifndef H_2_INC
+#include <stdio.h>
+#include <conio.h>
+#if 1 //temorary use functions defined in hcf.c
+#ifndef _DEBUG
+#pragma intrinsic( _inp, _inpw, _outp, _outpw )
+#endif // _DEBUG
+
+#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
+
+#if 1 // C implementation which let the processor handle the word-at-byte-boundary problem
+#define IN_PORT_STRING_8_16( port, addr, n) while (n--) \
+ { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); ((hcf_8 FAR*)addr)+=2; }
+#define OUT_PORT_STRING_8_16( port, addr, n) while (n--) \
+ { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; ((hcf_8 FAR*)addr)+=2; }
+#elif 0 // C implementation which handles the word-at-byte-boundary problem
+#define IN_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { hcf_16 i = IN_PORT_WORD(port); *((hcf_8 FAR*)addr)++ = (hcf_8)i; *((hcf_8 FAR*)addr)++ = (hcf_8)(i>>8);}
+#define OUT_PORT_STRING_8_16( port, addr, n) while ( n-- ) \
+ { OUT_PORT_WORD( port, *((hcf_8 FAR*)addr) | *(((hcf_8 FAR*)addr)+1)<<8 ); (hcf_8 FAR*)addr+=2; }
+#else // Assembler implementation
+#define IN_PORT_STRING_8_16( port, addr, n) __asm \
+{ \
+ __asm push di \
+ __asm push es \
+ __asm mov cx,n \
+ __asm les di,addr \
+ __asm mov dx,port \
+ __asm rep insw \
+ __asm pop es \
+ __asm pop di \
+}
+
+#define OUT_PORT_STRING_8_16( port, addr, n) __asm \
+{ \
+ __asm push si \
+ __asm push ds \
+ __asm mov cx,n \
+ __asm lds si,addr \
+ __asm mov dx,port \
+ __asm rep outsw \
+ __asm pop ds \
+ __asm pop si \
+}
+
+#endif // Asm or C implementation
+#define IN_PORT_STRING_32( port, addr, n) { int n2 = 2*n; IN_PORT_STRING_8_16(port, addr, n2) }
+#define OUT_PORT_STRING_32( port, addr, n) { int n2 = 2*n; OUT_PORT_STRING_8_16(port, addr, n2) }
+#endif // 0 //temorary use functions defined in hcf.c
+#endif // H_2_INC
+
+#endif // WVLAN_42 / WVLAN_43
+
+
+
+/************************************************************************************************/
+/**************************** D O S H - I / II L O A D E R **********************************/
+/************************************************************************************************/
+
+#if defined H0_LDR || defined H1_LDR || defined H2_LDR || defined H5_LDR
+
+#if defined H0_LDR //implies H-I
+#define HCF_DLV 0 //H-I legacy, meaningless under H-II
+#define HCF_DLNV 1 //H-I legacy, meaningless under H-II
+#endif // H0_LDR
+
+#if defined H1_LDR //implies H-I
+#define HCF_DLV 1 //H-I legacy, meaningless under H-II
+#define HCF_DLNV 0 //H-I legacy, meaningless under H-II
+#endif // H1_LDR / H2_LDR
+
+//#if defined H2_LDR : not needed, H-II defaults are O.K for H2_LDR
+
+#ifdef H5_LDR
+#define HCF_TYPE (HCF_TYPE_HII5 | HCF_TYPE_WARP )
+//;? why does only this subset of the H_LDRs need HCF_TYPE to be defined here
+#endif
+
+#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN //support dynamic linking of msf_assert routine
+#define HCF_ENCAP 0
+#define HCF_INT_ON 0
+#define HCF_TALLIES 0
+
+#define MSF_COMPONENT_ID COMP_ID_ODI_16 //;?By lack of any better
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 0
+#define MSF_COMPONENT_MINOR_VER 0
+
+#include <stdio.h>
+#include <conio.h>
+#if defined NDEBUG
+#pragma intrinsic( _inp, _inpw, _outp, _outpw )
+#endif // NDEBUG
+
+#if 0 //use 0 to replace I/O Macros with logging facility
+#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
+#endif //use 0 to replace I/O Macros with logging facility
+
+#endif // H0_LDR / H1_LDR / H2_LDR
+
+
+
+/************************************************************************************************/
+/**************************** H C F D E M O P R O G R A M ***********************************/
+/************************************************************************************************/
+
+#if defined HCF_DEMO
+
+#define HCF_DLV 1 //;?should become the default !defaults to 1 anyway for H-II
+//#define HCF_DLNV 0 //defaults to 0 anyway for H-II
+
+#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN //support dynamic linking of msf_assert routine
+
+#define HCF_ENCAP 0
+#define HCF_INT_ON 0
+#define HCF_TALLIES ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
+
+//#define MSF_COMPONENT_ID NO configuration management
+
+#include <stdio.h>
+#include <conio.h>
+#if defined NDEBUG
+#pragma intrinsic( _inp, _inpw, _outp, _outpw )
+#endif // NDEBUG
+
+#if 0 //use 0 to replace I/O Macros with logging facility
+#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
+#endif //use 0 to replace I/O Macros with logging facility
+
+#endif // HCF_DEMO
+
+
+
+/************************************************************************************************/
+/*********************************** M A C O S **********************************************/
+/************************************************************************************************/
+
+#if defined WVLAN_45
+
+#include "Version.h"
+
+#define MSF_COMPONENT_ID COMP_ID_MAC_OS
+#define MSF_COMPONENT_VAR VARIANT
+#define MSF_COMPONENT_MAJOR_VER VERSION_MAJOR
+#define MSF_COMPONENT_MINOR_VER VERSION_MINOR
+
+#define MAC_OS 1
+
+#define HCF_BIG_ENDIAN 1 // selects Big Endian (a.k.a. Motorola), most significant byte first
+
+#if defined DEBUG
+#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
+#endif // DEBUG
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+extern volatile unsigned char *MacIOaddr;
+extern hcf_16 IN_PORT_WORD(hcf_16 port);
+extern void OUT_PORT_WORD(hcf_16 port, hcf_16 value);
+extern void IN_PORT_STRING_16(hcf_16 port, void *addr, hcf_16 len);
+extern void OUT_PORT_STRING_16(hcf_16 port, void *addr, hcf_16 len);
+
+#define SwapBytes(t) (((t) >> 8) + (((t) & 0xff) << 8))
+
+#ifdef __cplusplus
+}
+#endif // __cplusplus
+
+#endif // WVLAN_45
+
+
+
+/************************************************************************************************/
+/****************************************** L I N U X *****************************************/
+/************************************************************************************************/
+
+#ifdef WVLAN_49
+#include <asm/io.h>
+//#include <linux/module.h>
+#include <wl_version.h>
+
+/* The following macro ensures that no symbols are exported, minimizing the chance of a symbol
+ collision in the kernel */
+//EXPORT_NO_SYMBOLS; //;?this place seems not appropriately to me
+
+//#define HCF_SLEEP (HCF_CDS | HCF_DDS )
+#define HCF_SLEEP (HCF_CDS)
+
+//#define HCF_TYPE (HCF_TYPE_HII5|HCF_TYPE_STA|HCF_TYPE_AP)
+#ifdef HERMES25
+#ifdef WARP
+#define HCF_TYPE ( HCF_TYPE_WARP | HCF_TYPE_HII5 )
+#else
+#define HCF_TYPE HCF_TYPE_HII5
+#endif // WARP
+#else
+#define HCF_TYPE HCF_TYPE_NONE
+#endif // HERMES25
+
+#ifdef ENABLE_DMA
+#define HCF_DMA 1
+#endif // ENABLE_DMA
+
+/* We now need a switch to include support for the Mailbox and other necessary extensions */
+#define HCF_EXT ( HCF_EXT_MB | HCF_EXT_INFO_LOG | HCF_EXT_INT_TICK )//get deepsleep exercise going
+
+/* ;? The Linux MSF still uses these definitions; define it here until it's removed */
+#ifndef HCF_TYPE_HII
+#define HCF_TYPE_HII 0x0004
+#endif
+
+#ifndef HCF_TYPE_AP
+#define HCF_TYPE_AP 0x0010
+#endif
+
+#ifndef HCF_TYPE_STA
+#define HCF_TYPE_STA 0x0020
+#endif // HCF_TYPE_STA
+
+/* Guarantees word alignment */
+#define HCF_ALIGN 2
+
+/* Endian macros CNV_INT_TO_LITTLE() and CNV_LITTLE_TO_INT() were renamed to
+ CNV_SHORT_TO_LITTLE() and CNV_LITTLE_TO_SHORT() */
+#ifndef CNV_INT_TO_LITTLE
+#define CNV_INT_TO_LITTLE CNV_SHORT_TO_LITTLE
+#endif
+
+#ifndef CNV_LITTLE_TO_INT
+#define CNV_LITTLE_TO_INT CNV_LITTLE_TO_SHORT
+#endif
+
+#define HCF_ERR_BUSY 0x06
+
+/* UIL defines were removed from the HCF */
+#define UIL_SUCCESS HCF_SUCCESS
+#define UIL_ERR_TIME_OUT HCF_ERR_TIME_OUT
+#define UIL_ERR_NO_NIC HCF_ERR_NO_NIC
+#define UIL_ERR_LEN HCF_ERR_LEN
+#define UIL_ERR_MIN HCF_ERR_MAX /*end of HCF errors which are passed through to UIL
+ *** ** *** ****** ***** *** ****** ******* ** *** */
+#define UIL_ERR_IN_USE 0x44
+#define UIL_ERR_WRONG_IFB 0x46
+#define UIL_ERR_MAX 0x7F /*upper boundary of UIL errors without HCF-pendant
+ ***** ******** ** *** ****** ******* *** ******* */
+#define UIL_ERR_BUSY HCF_ERR_BUSY
+#define UIL_ERR_DIAG_1 HCF_ERR_DIAG_1
+#define UIL_FAILURE 0xFF /* 20010705 nv this relick should be eridicated */
+#define UIL_ERR_PIF_CONFLICT 0x40 //obsolete
+#define UIL_ERR_INCOMP_DRV 0x41 //obsolete
+#define UIL_ERR_DOS_CALL 0x43 //obsolete
+#define UIL_ERR_NO_DRV 0x42 //obsolete
+#define UIL_ERR_NSTL 0x45 //obsolete
+
+
+
+#if 0 //;? #ifdef get this going LATER HERMES25
+#define HCF_IO HCF_IO_32BITS
+#define HCF_DMA 1
+#define HCF_DESC_STRCT_EXT 4
+
+/* Switch for BusMaster DMA support. Note that the above define includes the DMA-specific HCF
+ code in the build. This define sets the MSF to use DMA; if ENABLE_DMA is not defined, then
+ port I/O will be used in the build */
+#ifndef BUS_PCMCIA
+#define ENABLE_DMA
+#endif // USE_PCMCIA
+
+#endif // HERMES25
+
+
+/* Overrule standard WaveLAN Packet Size when in DMA mode */
+#ifdef ENABLE_DMA
+#define HCF_MAX_PACKET_SIZE 2304
+#else
+#define HCF_MAX_PACKET_SIZE 1514
+#endif // ENABLE_DMA
+
+/* The following sets the component ID, as well as the versioning. See also wl_version.h */
+#define MSF_COMPONENT_ID COMP_ID_LINUX
+
+#define MSF_COMPONENT_VAR DRV_VARIANT
+#define MSF_COMPONENT_MAJOR_VER DRV_MAJOR_VERSION
+#define MSF_COMPONENT_MINOR_VER DRV_MINOR_VERSION
+
+/* Define the following to turn on assertions in the HCF */
+//#define HCF_ASSERT 0x8000
+#define HCF_ASSERT HCF_ASSERT_LNK_MSF_RTN // statically binding of msf_assert routine
+
+#ifdef USE_BIG_ENDIAN
+#define HCF_BIG_ENDIAN 1
+#else
+#define HCF_BIG_ENDIAN 0
+#endif /* USE_BIG_ENDIAN */
+
+/* Define the following if your system uses memory-mapped IO */
+//#define HCF_MEM_IO
+
+/* The following defines the standard macros required by the HCF to move data to/from the card */
+#define IN_PORT_BYTE(port) ((hcf_8)inb( (hcf_io)(port) ))
+#define IN_PORT_WORD(port) ((hcf_16)inw( (hcf_io)(port) ))
+#define OUT_PORT_BYTE(port, value) (outb( (hcf_8) (value), (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (outw((hcf_16) (value), (hcf_io)(port) ))
+
+#define IN_PORT_STRING_16(port, dst, n) insw((hcf_io)(port), dst, n)
+#define OUT_PORT_STRING_16(port, src, n) outsw((hcf_io)(port), src, n)
+//#define IN_PORT_STRINGL(port, dst, n) insl((port), (dst), (n))
+//#define OUT_PORT_STRINGL(port, src, n) outsl((port), (src), (n))
+#define IN_PORT_STRING_32(port, dst, n) insl((port), (dst), (n))
+#define OUT_PORT_STRING_32(port, src, n) outsl((port), (src), (n))
+#define IN_PORT_HCF32(port) inl( (hcf_io)(port) )
+#define OUT_PORT_HCF32(port, value) outl((hcf_32)(value), (hcf_io)(port) )
+
+#define IN_PORT_DWORD(port) IN_PORT_HCF32(port)
+#define OUT_PORT_DWORD(port, value) OUT_PORT_HCF32(port, value)
+
+#define IN_PORT_STRING_8_16(port, addr, len) IN_PORT_STRING_16(port, addr, len)
+#define OUT_PORT_STRING_8_16(port, addr, len) OUT_PORT_STRING_16(port, addr, len)
+
+
+#ifndef OUTPUTDEBUGMSG
+#define OUTPUTDEBUGMSG(dprintf_exp)
+#endif
+
+
+#ifndef ASSERTDEBUGMSG
+#define ASSERTDEBUGMSG(cond, dprintf_exp)
+#endif
+
+#ifndef CFG_SCAN_CHANNELS_2GHZ
+#define CFG_SCAN_CHANNELS_2GHZ 0xFCC2
+#endif /* CFG_SCAN_CHANNELS_2GHZ */
+
+#define HCF_MAX_MSG 1600 //get going ;?
+#endif // WVLAN_49
+
+
+
+/************************************************************************************************/
+/********************************************* Q N X ******************************************/
+/************************************************************************************************/
+
+#if defined __QNX__ || defined WVLAN_50
+
+#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
+#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
+#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
+#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
+
+#include <conio.h>
+
+#define IN_PORT_WORD(port) ((hcf_16)inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (outpw( (hcf_io)(port), (hcf_16) (value) ))
+/*
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
+*/
+
+#endif // QNX / WVLAN_50
+
+
+
+/************************************************************************************************/
+/********************************************* B E O S ****************************************/
+/************************************************************************************************/
+
+#if defined __BEOS__
+
+#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
+#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
+#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
+#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
+
+#include <drivers/Drivers.h>
+#include <drivers/KernelExport.h>
+
+uint8 read_io_8 (int);
+void write_io_8 (int, uint8);
+uint16 read_io_16 (int);
+void write_io_16 (int, uint16);
+
+#define IN_PORT_WORD(port) ((hcf_16)read_io_16( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (write_io_16( (hcf_io)(port), (hcf_16) (value) ))
+/*
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
+*/
+#endif // __BEOS__
+
+
+
+/************************************************************************************************/
+/******************************** U S B D O N G L E *****************************************/
+/************************************************************************************************/
+
+#if defined USB
+#include "gpif.h"
+
+#define MSF_COMPONENT_MAJOR_VER 0
+#define MSF_COMPONENT_MINOR_VER 1
+
+#define IN_PORT_WORD(port) (Hermes_IO_Read( (hcf_8)(port)))
+#define OUT_PORT_WORD(port, value) (Hermes_IO_Write( (hcf_8)port, /*(hcf_16)*/(value) ) )
+/* !!!! NOTE USB supports only 16-bits I/O and no 8-bits I/O
+ * as a consequence the IN_/OUT_PORT_STRING_16 macros use hcf_16* rather than hcf_8 pointers
+ * to get more optimal code
+ * therefore the pointers are incremented by 1 (which means two "bytes") rather than by 2
+ */
+//#define IN_PORT_STRING_16( port, addr, n) while ( n-- ) { *((hcf_16*)addr)++ = IN_PORT_WORD( port ); }
+//#define OUT_PORT_STRING_16( port, addr, n) while ( n-- ) { OUT_PORT_WORD( port, *((hcf_16*)addr)++ ); }
+#define IN_PORT_STRING_16( port, dst, n) while ( n-- ) { *dst++ = IN_PORT_WORD( port ); }
+#define OUT_PORT_STRING_16( port, src, n) while ( n-- ) { OUT_PORT_WORD( port, *src++ ); }
+
+//#define HCF_TYPE ( HCF_TYPE_AP | HCF_TYPE_WPA )
+#define HCF_TYPE HCF_TYPE_WPA
+
+#endif // USB
+
+
+/************************************************************************************************/
+/****************************************** FreeBSD *******************************************/
+/************************************************************************************************/
+
+#if defined __FREE_BSD__
+
+#define MSF_COMPONENT_ID COMP_ID_FreeBSD
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#include <machine/cpufunc.h>
+
+#define IN_PORT_WORD(port) ((hcf_16)inw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (outw((hcf_io)(port), (hcf_16)(value)))
+
+/*
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16*)addr ) ; (cast)addr += 2; }
+*/
+#endif // __FREE_BSD__
+
+
+
+/************************************************************************************************/
+/********************************* W A V E P O I N T ******************************************/
+/************************************************************************************************/
+
+#if defined WVLAN_81 /* BORLANDC */
+
+#define EXTERN_C extern // needed because DHF uses this instead of 'extern'
+
+#define MSF_COMPONENT_ID COMP_ID_AP1
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 4
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_PROT_TIME 49 //49*10240 microseconds H/W failure protection timer
+
+//#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox /* debug build only */
+
+#if !defined FAR
+#define FAR far // segmented 16 bits mode
+#endif // FAR
+
+#define IN_PORT_WORD(port) (inport( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (outport( (hcf_io)(port), value ))
+
+#define IN_PORT_STRING_16(port, addr, len) \
+ asm { push di; push es; mov cx,len; les di,addr; mov dx,port; rep insw; pop es; pop di }
+
+#define OUT_PORT_STRING_16(port, addr, len) \
+ asm { push si; push ds; mov cx,len; lds si,addr; mov dx,port; rep outsw; pop ds; pop si }
+
+#endif // WVLAN_81
+
+
+/************************************************************************************************/
+/******************************** W A V E L A U N C H *****************************************/
+/************************************************************************************************/
+
+#if defined WVLAUNCH
+
+#include "DriverX.h"
+extern HWDEVICE* g_pDevice;
+
+//#define MSF_COMPONENT_ID 0 //;? to get around browser problem
+
+#define IN_PORT_WORD(port) HwInpw( g_pDevice, port )
+#define OUT_PORT_WORD(port, value) HwOutpw( g_pDevice, port, value )
+
+
+// C implementation which let the processor handle the word-at-byte-boundary problem
+/*
+#define IN_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); (cast)addr += 2; }
+#define OUT_PORT_STRING_16( port, addr, n) \
+ while ( n-- ) { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ) ; (cast)addr += 2; }
+*/
+#endif // WVLAUNCH
+
+
+
+/************************************************************************************************/
+/************************************* W C I T S T *********************************************/
+/************************************************************************************************/
+
+#if defined WCITST
+#define MSF_COMPONENT_ID 0 //Although there is no DUI support, we need this to get ...
+#define MSF_COMPONENT_VAR 0 //...compatibilty check to function
+#define MSF_COMPONENT_MAJOR_VER 0 //...;?this is worth looking into to make this a more
+#define MSF_COMPONENT_MINOR_VER 0 //..."defined" I/F so OEMers can figure out what to do
+
+//#define HCF_ENCAP HCF_ENC_NONE //to get going
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#define HCF_TYPE (HCF_TYPE_WPA | HCF_TYPE_PRELOADED) // Hermes-I for HCF6, II for HCF7
+#define HCF_DMA 1
+//#define LLB //!!!!MIC Debug Only
+#if defined LLB && !((HCF_TYPE) & HCF_TYPE_WPA)
+err: no LLB unless SSN;
+#endif // LLB / HCF_TYPE_WPA
+//#define HCF_ALIGN 2
+#define HCF_DLV 1 //just to change memory layout ????;?
+//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ease testing the different options ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+#define HCF_ASSERT HCF_ASSERT_SW_SUP // logging via Hermes support registerr
+//#define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
+
+#if defined __GNUC__
+#include "stdio.h"
+//#include "unistd.h" //ioperm libc5
+#include "sys/io.h" //ioperm glibc
+#define extern //see IO Port Programming mini-HOWTO
+//#include "asm/io.h" //
+#define IN_PORT_WORD(port) inw( (hcf_io)(port) )
+#define IN_PORT_DWORD(port) inl( (hcf_io)(port) )
+#define OUT_PORT_WORD(port, value) outw( (hcf_io)(port), (hcf_16)(value) )
+#define OUT_PORT_DWORD(port, value) outl( (hcf_io)(port), (hcf_16)(value) )
+#else
+#pragma warning ( disable: 4001 )
+#define FAR __far // segmented 16 bits mode
+
+#include <stdio.h>
+#include <conio.h>
+#ifndef _DEBUG
+#pragma intrinsic( _inp, _inpw, _outp, _outpw )
+#endif // _DEBUG
+
+#ifdef LOG
+extern FILE* utm_logfile;
+hcf_16 ipw( hcf_16 port );
+hcf_8 ipb( hcf_16 port );
+void opw( hcf_16 port, hcf_16 value );
+void opb( hcf_16 port, hcf_8 value );
+
+#define IN_PORT_WORD(port) ipw( (hcf_io)(port) )
+#define OUT_PORT_WORD(port, value) opw( (hcf_io)(port), (hcf_16)(value) )
+#else // LOG
+#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))
+#endif // LOG
+
+#if 1 //ASM example
+#define IN_PORT_STRING_16( port, addr, len) __asm \
+{ \
+ __asm push di \
+ __asm push es \
+ __asm mov cx,len \
+ __asm les di,addr \
+ __asm mov dx,port \
+ __asm rep insw \
+ __asm pop es \
+ __asm pop di \
+}
+
+#define OUT_PORT_STRING_16( port, addr, len) __asm \
+{ \
+ __asm push si \
+ __asm push ds \
+ __asm mov cx,len \
+ __asm lds si,addr \
+ __asm mov dx,port \
+ __asm rep outsw \
+ __asm pop ds \
+ __asm pop si \
+}
+
+#endif // asm example
+
+#endif // __GCC__
+
+#if ! defined IN_PORT_STRING_16
+#define IN_PORT_STRING_16( port, addr, n) while (n--) \
+ { *(hcf_16 FAR*)addr = IN_PORT_WORD( port ); ((hcf_16 FAR*)addr)++; }
+#define OUT_PORT_STRING_16( port, addr, n) while (n--) \
+ { OUT_PORT_WORD( port, *(hcf_16 FAR*)addr ); ((hcf_16 FAR*)addr)++; }
+#endif // IN_PORT_STRING_16
+
+#endif // WCITST
+
+
+/************************************************************************************************/
+/******************************* Motorola Power PC 800 family *********************************/
+/************************************************************************************************/
+/* known users: LH@I
+ */
+
+#if defined I_MPC8XX
+
+#define MSF_COMPONENT_VAR 0
+#define MSF_COMPONENT_ID 0
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_HSI_VAR 1
+
+#define HCF_BIG_ENDIAN 1
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#include "o_portbl.h"
+#include "ipcmcia.h"
+typedef o_uint8_t hcf_8;
+typedef o_uint16_t hcf_16;
+typedef o_uint32_t hcf_32;
+
+/***************************************************************************/
+
+
+#ifdef _lint
+#else
+asm hcf_16 IN_PORT_WORD(int port)
+{
+% reg port
+ lhbrx r3,r0,port
+ eieio
+}
+#endif // _lint
+
+
+#ifdef _lint
+#else
+asm void OUT_PORT_WORD(int port, hcf_16 value)
+{
+% reg port, value
+ sthbrx value,r0,port
+ eieio
+}
+#endif // _lint
+
+/***************************************************************************/
+
+#define IN_PORT_STRING_16(port, addr, len) \
+ { \
+ unsigned l = (len); \
+ hcf_16 *d = (volatile hcf_16 *)(addr); \
+ while (l--) \
+ { \
+ *d++ = *(volatile hcf_16 *)(port); \
+ EIEIO(); \
+ } \
+ }
+
+#define OUT_PORT_STRING_16(port, addr, len) \
+ { \
+ unsigned l = (len); \
+ hcf_16 *s = (volatile hcf_16 *)(addr); \
+ while (l--) \
+ { \
+ *(volatile hcf_16 *)(port) = *s++; \
+ EIEIO(); \
+ } \
+ }
+
+#endif // I_MPC8XX
+
+
+
+/************************************************************************************************/
+/********************************** Diab or High C 29K **************************************/
+/************************************************************************************************/
+/* known users: GK@C
+ */
+
+#if defined _AM29K
+
+#define MSF_COMPONENT_VAR 0
+#define MSF_COMPONENT_ID COMP_ID_AP1
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_BIG_ENDIAN 1
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
+
+#if defined __ppc
+ #ifndef __GNUC__
+ #define __asm__ asm
+ #endif
+
+ #if ! defined _lint
+ #define EIEIO() __asm__(" eieio")
+ #else
+ #define EIEIO()
+ #endif
+
+ static hcf_16 IN_PORT_WORD(int port) {
+ hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
+ value = SwapBytes(value);
+ return value;
+ }
+
+ #define OUT_PORT_WORD(port, value) \
+ { *(volatile hcf_16 *)(port) = SwapBytes(value); EIEIO(); }
+#else
+ #define IN_PORT_WORD(port) (*(volatile hcf_16 *)(port))
+ #define OUT_PORT_WORD(port, value) (*(volatile hcf_16 *)(port) = (value))
+#endif // __ppc
+
+/***************************************************************************/
+
+#define IN_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 t, *d = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ t = IN_PORT_WORD(port); \
+ *d++ = SwapBytes(t); \
+ } \
+ }
+
+#define OUT_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 t, *s = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ t = *s++; \
+ OUT_PORT_WORD(port, SwapBytes(t)); \
+ } \
+ }
+
+#if PRODUCT == 9150
+ #define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
+ #undef MSF_COMPONENT_ID
+#endif // 9150
+
+#endif // _AM29K
+
+
+
+/************************************************************************************************/
+/***************************************** MPC860 **********************************************/
+/************************************************************************************************/
+/* known users: RR
+ */
+
+#if defined CPU
+#if CPU == PPC860
+
+#define MSF_COMPONENT_VAR 0
+#define MSF_COMPONENT_ID 0
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_BIG_ENDIAN 1
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
+
+#ifndef __GNUC__
+ #define __asm__ asm
+#endif
+
+#if ! defined _lint
+ #define EIEIO() __asm__(" eieio")
+#else
+ #define EIEIO()
+#endif
+
+static hcf_16 IN_PORT_WORD(int port) {
+ hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
+ value = SwapBytes(value);
+ return value;
+ #ifdef __GNUC__
+ /* the following serves to avoid the compiler warnings that
+ * IN_PORT_WORD() is not used in some files */
+ (void)IN_PORT_WORD;
+ #endif
+}
+
+#define OUT_PORT_WORD(port, value) \
+ { *(volatile hcf_16 *)(port) = SwapBytes(value); EIEIO(); }
+
+/***************************************************************************/
+
+#define IN_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 t; \
+ volatile hcf_16 *d = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ t = IN_PORT_WORD(port); \
+ *d++ = SwapBytes(t); \
+ } \
+ }
+
+#define OUT_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 t; \
+ volatile hcf_16 *s = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ t = *s++; \
+ OUT_PORT_WORD(port, SwapBytes(t)); \
+ } \
+ }
+
+#if PRODUCT == 9150
+ #define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
+ #undef MSF_COMPONENT_ID
+#endif
+
+#endif /* PPC860 */
+#endif /* CPU */
+
+
+
+/************************************************************************************************/
+/**************************** Microtec Research 80X86 Compiler *********************************/
+/************************************************************************************************/
+
+#if 0
+
+//#undef HCF_TYPE // Hermes-I Station F/W without SSN support
+
+#define MSF_COMPONENT_VAR 0
+#define MSF_COMPONENT_ID 0
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+extern int far inp( int );
+extern void far outp( int, int );
+extern int far inpw( int );
+extern void far outpw( int, int );
+
+#define IN_PORT_WORD(port) ((hcf_16)inpw( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) ((void)outpw( (hcf_io)(port), value ))
+
+#define IN_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 *d = (hcf_16 *)(addr); \
+ while (l--) *d++ = IN_PORT_WORD(port); \
+ }
+
+#define OUT_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 *s = (hcf_16 *)(addr); \
+ while (l--) OUT_PORT_WORD(port, *s++); \
+ }
+#endif /* Microtec 80X86 C Compiler */
+
+
+
+/************************************************************************************************/
+/****************************** W A V E L A N E C ********************************************/
+/************************************************************************************************/
+/* known users: KM
+ */
+
+#ifdef mc68302
+
+#define MSF_COMPONENT_ID COMP_ID_EC
+
+#include <version.h>
+
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER MAJOR_VERSION
+#define MSF_COMPONENT_MINOR_VER MINOR_VERSION
+
+#define HCF_BIG_ENDIAN 1
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#define SwapBytes(t) /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/
+
+#define PCMCIA_ADDRESS 0xc80000UL
+
+#define IN_PORT_2BYTES(port) (*(hcf_16 *)(port))
+#if 0
+static hcf_16 IN_PORT_WORD(hcf_32 port) // should be hcf_io, not hcf_32
+{
+ hcf_16 word = IN_PORT_2BYTES(port);
+ return SwapBytes(word);
+}
+#else
+static hcf_16 swap_var;
+#define IN_PORT_WORD(port) \
+ (((swap_var = IN_PORT_2BYTES(port)) >> 8) + (((swap_var) & 0xff) << 8))
+#endif
+#define OUT_PORT_2BYTES(port, value) (*(hcf_16 *)(port) = (hcf_16)(value))
+#define OUT_PORT_WORD(port, value) OUT_PORT_2BYTES(port, SwapBytes(value))
+
+/*
+#define IN_PORT_STRING_16(port, addr, len) \
+ while ((len)--) {*(hcf_16 *)(addr) = IN_PORT_2BYTES(port); ((cast)addr) += 2; }
+#define OUT_PORT_STRING_16(port, addr, len) \
+ while ((len)--) {OUT_PORT_2BYTES((port), *(hcf_16 *)(addr)) ; ((cast)addr) += 2; }
+*/
+
+#endif /* mc68302 */
+
+
+
+/************************************************************************************************/
+/********************************* NGAP ***************************************/
+/************************************************************************************************/
+
+#if defined __VX_WORKS__ /* VxWorks */
+
+#if defined WLC_STATION
+//#undef HCF_TYPE /* Hermes-I Station F/W without SSN support */
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
+#else
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
+#endif // WLC_STATION
+
+#define HCF_YIELD (taskDelay(0) == 0)
+
+#define MSF_COMPONENT_VAR 1
+#define MSF_COMPONENT_MAJOR_VER 1
+#define MSF_COMPONENT_MINOR_VER 0
+
+// #define HCF_ASSERT HCF_ASSERT_MB // logging via Mailbox
+
+#if defined PC486BSP
+
+#define IN_PORT_WORD(port) (sysInWord ((hcf_io)(port)))
+#define OUT_PORT_WORD(port, value) (sysOutWord ((hcf_io)(port), (hcf_16) (value)))
+#define IN_PORT_STRING_16(port, addr, n) (sysInWordString ((hcf_io)(port), addr, n))
+#define OUT_PORT_STRING_16(port, addr, n) (sysOutWordString ((hcf_io)(port), addr, n))
+
+#elif defined AS2000BSP
+
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+/* Define PCI stuff here. */
+unsigned short sysRead16( unsigned short *port );
+void sysWrite16( unsigned short *port, unsigned short value );
+
+#define PCI_IN_BYTE( port ) \
+ *(unsigned char *)( port )
+
+#define PCI_IN_WORD( port ) \
+ sysRead16( (unsigned short *)( port ) )
+
+#define PCI_OUT_BYTE( port, value ) \
+ *(unsigned char *)( port ) = (unsigned char)( value )
+
+#define PCI_OUT_WORD( port, value ) \
+ sysWrite16( (unsigned short *)( port ), (unsigned short)( value ) )
+
+#define IN_PORT_WORD( port ) \
+ PCI_IN_WORD( port )
+
+#define OUT_PORT_WORD( port, value ) \
+ PCI_OUT_WORD( port, value )
+
+#define IN_PORT_STRING_16( port, buf, len ) \
+ do { \
+ hcf_16 *p; \
+ \
+ for ( p = (hcf_16 *)(buf); p < &( (hcf_16 *)(buf) )[ (int)len ]; p++ ) { \
+ *p = PCI_IN_WORD( port ); \
+ } \
+ } while ( 0 )
+
+#define OUT_PORT_STRING_16( port, buf, len ) \
+ do { \
+ const hcf_16 *p; \
+ \
+ for ( p = (const hcf_16 *)( buf ); p < &( (const hcf_16 *)(buf) )[ (int)len ]; p++ ) { \
+ PCI_OUT_WORD( port, *p ); \
+ } \
+ } while ( 0 )
+
+#elif defined FADS860BSP /* elif defined AS2000BSP */
+
+#define HCF_BIG_ENDIAN 1
+
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#ifndef __GNUC__
+ #define __asm__ asm
+#endif
+
+#if ! defined _lint
+ #define EIEIO() __asm__(" eieio")
+#else
+ #define EIEIO()
+#endif
+
+static hcf_16 IN_PORT_WORD(int port) {
+ hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();
+ value = ((value & 0xff00) >> 8) + ((value & 0x00ff) << 8);
+/* value = CNV_LITTLE_TO_SHORT(value); */
+ return value;
+ #ifdef __GNUC__
+ /* the following serves to avoid the compiler warnings that
+ * IN_PORT_WORD() is not used in some files */
+ (void)IN_PORT_WORD;
+ #endif
+}
+
+#define OUT_PORT_WORD(port, value) \
+ { *(volatile hcf_16 *)(port) = CNV_SHORT_TO_LITTLE(value); EIEIO(); }
+
+/***********************************************************************/
+
+#define IN_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ volatile hcf_16 *d = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ *d++ = *(volatile hcf_16 *)(port); \
+ EIEIO(); \
+ } \
+ }
+
+#define OUT_PORT_STRING_16( port, addr, len) { \
+ unsigned l = (len); \
+ volatile hcf_16 *s = (volatile hcf_16 *)(addr); \
+ while (l--) { \
+ *(volatile hcf_16 *)(port) = *s++; \
+ EIEIO(); \
+ } \
+ }
+
+#elif defined DAYTONABSP
+
+#define HCF_BIG_ENDIAN 1
+
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#ifndef __GNUC__
+ #define __asm__ asm
+#endif
+
+#define IN_PORT_WORD(port) (sysOrinocoInWord((unsigned long)(port)))
+#define OUT_PORT_WORD(port,value) (sysOrinocoOutWord((unsigned long)(port), (unsigned short)(value)))
+
+#define IN_PORT_STRING_16(port,addr,len) (sysOrinocoInString((port), (addr), (len)))
+#define OUT_PORT_STRING_16(port,addr,len) (sysOrinocoOutString((port), (addr), (len)))
+
+extern unsigned char sysOrinocoInByte (unsigned long port);
+extern unsigned short sysOrinocoInWord (unsigned long port);
+extern void sysOrinocoInString (unsigned long port, void *addr, unsigned short len);
+
+extern void sysOrinocoOutByte (unsigned long port, unsigned char value);
+extern void sysOrinocoOutWord (unsigned long port, unsigned short value);
+extern void sysOrinocoOutString (unsigned long port, void *addr, unsigned short len);
+
+#elif defined ALPHA_BSP
+
+#define HCF_BIG_ENDIAN 1
+
+#define HCF_IO HCF_IO_MEM // overrule standard Port I/O with Memory mapped I/O
+
+#ifndef __GNUC__
+ #define __asm__ asm
+#endif
+
+#define IN_PORT_WORD(port) (sysOrinocoInWord((unsigned long)(port)))
+#define OUT_PORT_WORD(port,value) (sysOrinocoOutWord((unsigned long)(port), (unsigned short)(value)))
+
+#define IN_PORT_STRING_16(port,addr,len) (sysOrinocoInString((port), (addr), (len)))
+#define OUT_PORT_STRING_16(port,addr,len) (sysOrinocoOutString((port), (addr), (len)))
+
+extern unsigned char sysOrinocoInByte (unsigned long port);
+extern unsigned short sysOrinocoInWord (unsigned long port);
+extern void sysOrinocoInString (unsigned long port, void *addr, unsigned short len);
+
+extern void sysOrinocoOutByte (unsigned long port, unsigned char value);
+extern void sysOrinocoOutWord (unsigned long port, unsigned short value);
+extern void sysOrinocoOutString (unsigned long port, void *addr, unsigned short len);
+
+#else
+
+err: /* commented here */ /* "BSP is not defined..." */
+
+#endif /* else PC486BSP */
+
+#endif // __VX_WORKS__
+
+
+
+/************************************************************************************************/
+/****************************** VXWORKS. Motorola Sandpoint PowerPC 824X ***********************/
+/************************************************************************************************/
+#ifdef __VX_WORKS_SANDPOINT_824X__
+
+#include <vxWorks.h>
+#include <sysLib.h>
+#include <taskLib.h>
+
+#ifdef WVLAN_53
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
+#endif /* WVLAN_53 */
+
+#ifdef WVLAN_54
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
+#endif /* WVLAN_54 */
+
+#ifdef WVLAN_56
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_END
+#endif /* WVLAN_56 */
+
+#if !defined MSF_COMPONENT_ID
+#error "you must define an MSF component ID: WVLAN_53, WVLAN_54, WVLAN_56"
+#endif
+
+#define MSF_COMPONENT_VAR 1
+
+#define HCF_EXT HCF_EXT_INFO_LOG
+#define HCF_SLEEP ( HCF_CDS | HCF_DDS )
+//#define HCF_SLEEP ( HCF_DDS )
+
+#ifndef HCF_ACT_WAKEUP
+#define HCF_ACT_WAKEUP 0x1D
+#endif // HCF_ACT_WAKEUP
+
+#if defined FATNIC | defined BEAGLE_H253
+#define T1__HCF_TYPE HCF_TYPE_STA
+#else
+#define T1__HCF_TYPE HCF_TYPE_AP | HCF_TYPE_STA
+#endif
+
+#ifdef HERMES_USB
+#define T2__HCF_TYPE (T1__HCF_TYPE | HCF_TYPE_USB)
+#else // HERMES_USB
+#define T2__HCF_TYPE (T1__HCF_TYPE)
+#endif // HERMES_USB
+
+#ifdef _WARP
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
+#else // _WARP
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_WPA | HCF_TYPE_HII)
+#endif // WARP
+
+#ifdef _CCX
+#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
+#else // _WARP
+#define T4__HCF_TYPE (T3__HCF_TYPE)
+#endif // _CCX
+
+#define T5__HCF_TYPE (T4__HCF_TYPE)
+
+// Default to TYPE_AP + SSN!
+#define HCF_TYPE (T5__HCF_TYPE )
+
+
+
+#define MSF_COMPONENT_MAJOR_VER 2
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_IO HCF_IO_MEM
+#define HCF_DMA 0
+#define HCF_MEM_IO 1
+#define HCF_BIG_ENDIAN 1
+
+//#define support_32bits 1
+
+#define IN_PORT_WORD(port) (sysInWord( (hcf_io)(port) ))
+#define OUT_PORT_WORD(port, value) (sysOutWord( (hcf_io)(port), (hcf_16)(value) ))
+#define IN_PORT_DWORD(port) (sysInLong( (hcf_io)(port) ))
+#define OUT_PORT_DWORD(port, value) (sysOutLong( (hcf_io)(port), (hcf_16)(value) ))
+#define IN_PORT_STRING_16(port, dst, n) (sysInWordString((hcf_io)(port), (hcf_16 *)dst, n))
+#define OUT_PORT_STRING_16(port, src, n) (sysOutWordString((hcf_io)(port), (hcf_16 *)src, n))
+
+#ifdef WVLAN_DEBUG
+#define DBG 1
+#define _DEBUG 1
+#endif
+
+/* we'll need to add these prints someday */
+#define OUTPUTDEBUGMSG(dprintf_exp)
+#define ASSERTDEBUGMSG(cond, dprintf_exp)
+
+#define HCF_INTERFACE_CONNECT(ifbp)
+#define HCF_INTERFACE_DISCONNECT(ifbp)
+#define HCF_ENTER_INTERFACE_FUNCT(ibfb)
+#define HCF_LEAVE_INTERFACE_FUNCT(ifbp)
+
+#define CNV_END_INT(w) ( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
+#define CNV_LITTLE_TO_INT(w) CNV_END_INT(w)
+#define CNV_INT_TO_LITTLE(w) CNV_LITTLE_TO_INT(w)
+
+#endif /* __VX_WORKS_SANDPOINT_824X__ */
+
+/************************************************************************************************/
+/************************************* VXWORKS. ARM T8300 IPPhone *****************************/
+/************************************************************************************************/
+#if defined( IPT_T8300 ) || defined( IPT_T8307 )
+
+#include <vxWorks.h>
+#include <sysLib.h>
+#include <taskLib.h>
+
+#define HCF_ALIGN 4 /* default to 4 byte alignment */
+
+#define BEAGLE_H253 /* Hermes 2.5.3 build, better to be in the project file */
+#define OOR_DDS /* Hermes 2.5.3 build, better to be in the project file */
+#define FATNIC
+
+
+#ifdef WVLAN_53
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDSTA
+#endif /* WVLAN_53 */
+
+#ifdef WVLAN_54
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_ENDAP
+#endif /* WVLAN_54 */
+
+#ifdef WVLAN_56
+#define MSF_COMPONENT_ID COMP_ID_VX_WORKS_END
+#endif /* WVLAN_56 */
+
+#if !defined MSF_COMPONENT_ID
+#error "you must define an MSF component ID: WVLAN_53, WVLAN_54, WVLAN_56"
+#endif
+
+#define MSF_COMPONENT_VAR 1
+
+#define HCF_EXT HCF_EXT_INFO_LOG
+//#define HCF_EXT HCF_EXT_INFO_LOG | HCF_EXT_MB
+#define HCF_SLEEP ( HCF_CDS | HCF_DDS )
+//#define HCF_SLEEP ( HCF_DDS )
+
+#ifndef HCF_ACT_WAKEUP
+#define HCF_ACT_WAKEUP 0x1D
+#endif // HCF_ACT_WAKEUP
+
+#if defined FATNIC || defined BEAGLE_H253
+#define T1__HCF_TYPE HCF_TYPE_STA
+#else
+//#define T1__HCF_TYPE HCF_TYPE_AP | HCF_TYPE_STA
+#define T1__HCF_TYPE HCF_TYPE_STA /* dz, Station code only */
+#endif
+
+#ifdef HERMES_USB
+#define T2__HCF_TYPE (T1__HCF_TYPE | HCF_TYPE_USB)
+#else // HERMES_USB
+#define T2__HCF_TYPE (T1__HCF_TYPE)
+#endif // HERMES_USB
+
+#ifdef _WARP
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII5)
+#else // _WARP
+#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_WPA | HCF_TYPE_HII)
+//#define T3__HCF_TYPE (T2__HCF_TYPE | HCF_TYPE_HII) /* dz. no WPA support at this time, test code */
+#endif // WARP
+
+#ifdef _CCX
+#define T4__HCF_TYPE (T3__HCF_TYPE | HCF_TYPE_CCX)
+#else // _WARP
+#define T4__HCF_TYPE (T3__HCF_TYPE)
+#endif // _CCX
+
+#define T5__HCF_TYPE (T4__HCF_TYPE)
+
+// Default to TYPE_AP + SSN!
+#define HCF_TYPE (T5__HCF_TYPE )
+
+
+#define MSF_COMPONENT_MAJOR_VER 2
+#define MSF_COMPONENT_MINOR_VER 0
+
+#define HCF_IO HCF_IO_MEM
+#define HCF_DMA 0
+#define HCF_MEM_IO 1
+
+
+/* Endian is determined by vxWorks project compile option */
+#if (_BYTE_ORDER == _BIG_ENDIAN)
+#undef HCF_LITTLE_ENDIAN
+#define HCF_BIG_ENDIAN 1
+#endif
+
+
+#define CNV_END(w) ( ((hcf_16)(w) & 0x00FF) << 8 | ((hcf_16)(w) & 0xFF00) >> 8 )
+#if defined HCF_BIG_ENDIAN
+//******************************************** B I G E N D I A N *******************************************
+#define CNV_LITTLE_TO_INT(w) CNV_END(w) // endianess conversion needed
+#define CNV_BIG_TO_INT(w) (w) // no endianess conversion needed
+#else
+//****************************************** L I T T L E E N D I A N ****************************************
+#define CNV_LITTLE_TO_INT(w) (w) // no endianess conversion needed
+#define CNV_BIG_TO_INT(w) CNV_END(w) // endianess conversion needed
+#endif // HCF_BIG_ENDIAN
+
+// conversion macros which can be expressed in other macros
+#define CNV_INT_TO_LITTLE(w) CNV_LITTLE_TO_INT(w)
+#define CNV_INT_TO_BIG(w) CNV_BIG_TO_INT(w)
+
+
+
+#define IN_PORT_WORD( port ) *((volatile hcf_16 *)( port ))
+#define OUT_PORT_WORD( port, value ) *((volatile hcf_16 *)( port )) = ((hcf_16)( value ))
+//#define IN_PORT_BYTE( port ) *((volatile hcf_8 *)( port ))
+
+#define IN_PORT_STRING( port, addr, len) { \
+ unsigned l = len; \
+ hcf_16 *d = (hcf_16 *)(addr); \
+ hcf_16 t; \
+ while (l--) { \
+ t = IN_PORT_WORD(port); \
+ *d++ = CNV_LITTLE_TO_INT(t); \
+ } \
+} // IN_PORT_STRING
+
+#define OUT_PORT_STRING( port, addr, len) { \
+ unsigned l = (len); \
+ hcf_16 *s = (hcf_16 *)(addr); \
+ hcf_16 t; \
+ while (l--) { \
+ t = *s++; \
+ t = CNV_LITTLE_TO_INT(t); \
+ OUT_PORT_WORD(port, t); \
+ } \
+} // OUT_PORT_STRING
+
+#define IN_PORT_STRING_16(port, dst, n) { \
+ unsigned l = (n); \
+ hcf_16 *d = (hcf_16 *)(dst); \
+ while (l--) { \
+ *d++ = IN_PORT_WORD(port); \
+ } \
+} // IN_PORT_STRING_16
+
+#define OUT_PORT_STRING_16(port, src, n) { \
+ hcf_16 t; \
+ int l = (n); \
+ hcf_16 *s = (hcf_16 *)(src); \
+ while (l--) { \
+ t = *s++; \
+ OUT_PORT_WORD(port, t); \
+ } \
+} // OUT_PORT_STRING_16
+
+/* #define HCF_YIELD (taskDelay(0) == 0) */
+
+
+
+#ifdef WVLAN_DEBUG
+#define DBG 1
+#define _DEBUG 1
+#endif
+
+/* we'll need to add these prints someday */
+#define OUTPUTDEBUGMSG(dprintf_exp)
+#define ASSERTDEBUGMSG(cond, dprintf_exp)
+
+#define HCF_INTERFACE_CONNECT(ifbp)
+#define HCF_INTERFACE_DISCONNECT(ifbp)
+#define HCF_ENTER_INTERFACE_FUNCT(ibfb)
+#define HCF_LEAVE_INTERFACE_FUNCT(ifbp)
+
+#define sysInWord(offsetAddr) IN_PORT_WORD(offsetAddr)
+#define sysInByte(offsetAddr) IN_PORT_BYTE(offsetAddr)
+#define sysOutWord(addr, value) OUT_PORT_WORD(addr, value)
+
+#endif /*IPT_T8300 */
+
+/************************************************************************************************************/
+/*********************************** **************************************/
+/************************************************************************************************************/
+#if ! defined HCF_ALIGN
+#define HCF_ALIGN 1 //default to no alignment
+#endif // HCF_ALIGN
+
+#if ! defined HCF_ASSERT
+#define HCF_ASSERT 0
+#endif // HCF_ASSERT
+
+#if ! defined HCF_BIG_ENDIAN
+#define HCF_BIG_ENDIAN 0
+#endif // HCF_BIG_ENDIAN
+
+#if ! defined HCF_DL_ONLY
+#define HCF_DL_ONLY 0
+#endif // HCF_DL_ONLY
+
+#if ! defined HCF_DMA
+#define HCF_DMA 0
+#endif // HCF_DMA
+
+#if ! defined HCF_ENCAP
+#define HCF_ENCAP HCF_ENC
+#endif // HCF_ENCAP
+
+#if ! defined HCF_ENTRY
+#define HCF_ENTRY( ifbp )
+#endif // HCF_ENTRY
+
+#if ! defined HCF_EXIT
+#define HCF_EXIT( ifbp )
+#endif // HCF_EXIT
+
+#if ! defined HCF_EXT
+#define HCF_EXT 0
+#endif // HCF_EXT
+
+#if ! defined HCF_INT_ON
+#define HCF_INT_ON 1
+#endif // HCF_INT_ON
+
+#if ! defined HCF_IO
+#define HCF_IO 0 //default 16 bits support only, port I/O
+#endif // HCF_IO
+
+#if ! defined HCF_LEGACY
+#define HCF_LEGACY 0
+#endif // HCF_LEGACY
+
+#if ! defined HCF_MAX_LTV
+#define HCF_MAX_LTV 1200 // sufficient for all known purposes
+#endif // HCF_MAX_LTV
+
+#if ! defined HCF_PROT_TIME
+#define HCF_PROT_TIME 100 // number of 10K microsec protection timer against H/W malfunction
+#endif // HCF_PROT_TIME
+
+#if ! defined HCF_SLEEP
+#define HCF_SLEEP 0
+#endif // HCF_SLEEP
+
+#if ! defined HCF_TALLIES
+#define HCF_TALLIES ( HCF_TALLIES_NIC | HCF_TALLIES_HCF )
+#endif // HCF_TALLIES
+
+#if ! defined HCF_TYPE
+#define HCF_TYPE 0
+#endif // HCF_TYPE
+
+#if HCF_BIG_ENDIAN
+#undef HCF_BIG_ENDIAN
+#define HCF_BIG_ENDIAN 1 //just for convenience of generating cfg_hcf_opt
+#endif // HCF_BIG_ENDIAN
+
+#if HCF_DL_ONLY
+#undef HCF_DL_ONLY
+#define HCF_DL_ONLY 1 //just for convenience of generating cfg_hcf_opt
+#endif // HCF_DL_ONLY
+
+#if HCF_DMA
+#undef HCF_DMA
+#define HCF_DMA 1 //just for convenience of generating cfg_hcf_opt
+#endif // HCF_DMA
+
+#if HCF_INT_ON
+#undef HCF_INT_ON
+#define HCF_INT_ON 1 //just for convenience of generating cfg_hcf_opt
+#endif // HCF_INT_ON
+
+
+#if ! defined IN_PORT_STRING_8_16
+#define IN_PORT_STRING_8_16(port, addr, len) IN_PORT_STRING_16(port, addr, len)
+#define OUT_PORT_STRING_8_16(port, addr, len) OUT_PORT_STRING_16(port, addr, len)
+#endif // IN_PORT_STRING_8_16
+
+/************************************************************************************************/
+/********** *************/
+/************************************************************************************************/
+
+#if ! defined FAR
+#define FAR // default to flat 32-bits code
+#endif // FAR
+
+typedef hcf_8 FAR *wci_bufp; // segmented 16-bits or flat 32-bits pointer to 8 bits unit
+typedef hcf_16 FAR *wci_recordp; // segmented 16-bits or flat 32-bits pointer to 16 bits unit
+
+/* I/O Address size
+* Platforms which use port mapped I/O will (in general) have a 64k I/O space, conveniently expressed in a
+* 16-bits quantity
+* Platforms which use memory mapped I/O will (in general) have an I/O space much larger than 64k, and need a
+* 32-bits quantity to express the I/O base
+*/
+
+#if HCF_IO & HCF_IO_MEM
+typedef hcf_32 hcf_io;
+#else
+typedef hcf_16 hcf_io;
+#endif //HCF_IO
+
+#if HCF_PROT_TIME > 128
+#define HCF_PROT_TIME_SHFT 3
+#define HCF_PROT_TIME_DIV 8
+#elif HCF_PROT_TIME > 64
+#define HCF_PROT_TIME_SHFT 2
+#define HCF_PROT_TIME_DIV 4
+#elif HCF_PROT_TIME > 32
+#define HCF_PROT_TIME_SHFT 1
+#define HCF_PROT_TIME_DIV 2
+#else //HCF_PROT_TIME >= 19
+#define HCF_PROT_TIME_SHFT 0
+#define HCF_PROT_TIME_DIV 1
+#endif
+
+#define HCF_PROT_TIME_CNT (HCF_PROT_TIME / HCF_PROT_TIME_DIV)
+
+
+/************************************************************************************************************/
+/******************************************* . . . . . . . . . *********************************************/
+/************************************************************************************************************/
+
+/* MSF_COMPONENT_ID is used to define the CFG_IDENTITY_STRCT in HCF.C
+* CFG_IDENTITY_STRCT is defined in HCF.C purely based on convenience arguments.
+* The HCF can not have the knowledge to determine the ComponentId field of the Identity record (aka as
+* Version Record), therefore the MSF part of the Drivers must supply this value via the System Constant
+* MSF_COMPONENT_ID.
+* There is a set of values predefined in MDD.H (format COMP_ID_.....)
+*
+* Note that taking MSF_COMPONENT_ID as a default value for DUI_COMPAT_VAR is purely an implementation
+* convenience, the numerical values of these two quantities have none functional relationship whatsoever.
+*/
+
+#if defined MSF_COMPONENT_ID
+
+#if ! defined DUI_COMPAT_VAR
+#define DUI_COMPAT_VAR MSF_COMPONENT_ID
+#endif // DUI_COMPAT_VAR
+
+#if ! defined DUI_COMPAT_BOT //;?this way utilities can lower as well raise the bottom
+#define DUI_COMPAT_BOT 8
+#endif // DUI_COMPAT_BOT
+
+#if ! defined DUI_COMPAT_TOP //;?this way utilities can lower as well raise the top
+#define DUI_COMPAT_TOP 8
+#endif // DUI_COMPAT_TOP
+
+#endif // MSF_COMPONENT_ID
+
+#if (HCF_TYPE) & HCF_TYPE_HII5
+
+#if ! defined HCF_HSI_VAR_5
+#define HCF_HSI_VAR_5
+#endif // HCF_HSI_VAR_5
+
+#if ! defined HCF_APF_VAR_4
+#define HCF_APF_VAR_4
+#endif // HCF_APF_VAR_4
+
+#if (HCF_TYPE) & HCF_TYPE_WARP
+#if ! defined HCF_STA_VAR_4
+#define HCF_STA_VAR_4
+#endif // HCF_STA_VAR_4
+#else
+#if ! defined HCF_STA_VAR_2
+#define HCF_STA_VAR_2
+#endif // HCF_STA_VAR_2
+#endif
+
+#if defined HCF_HSI_VAR_4
+err: HSI variants 4 correspond with HII;
+#endif // HCF_HSI_VAR_4
+
+#else
+
+#if ! defined HCF_HSI_VAR_4
+#define HCF_HSI_VAR_4 //Hermes-II all types (for the time being!)
+#endif // HCF_HSI_VAR_4
+
+#if ! defined HCF_APF_VAR_2
+#define HCF_APF_VAR_2
+#endif // HCF_APF_VAR_2
+
+#if ! defined HCF_STA_VAR_2
+#define HCF_STA_VAR_2
+#endif // HCF_STA_VAR_2
+
+#endif // HCF_TYPE_HII5
+
+#if ! defined HCF_PRI_VAR_3
+#define HCF_PRI_VAR_3
+#endif // HCF_PRI_VAR_3
+
+#if defined HCF_HSI_VAR_1 || defined HCF_HSI_VAR_2 || defined HCF_HSI_VAR_3
+err: HSI variants 1, 2 and 3 correspond with H-I only;
+#endif // HCF_HSI_VAR_1, HCF_HSI_VAR_2, HCF_HSI_VAR_3
+
+#if defined HCF_PRI_VAR_1 || defined HCF_PRI_VAR_2
+err: primary variants 1 and 2 correspond with H-I only;
+#endif // HCF_PRI_VAR_1 / HCF_PRI_VAR_2
+
+
+/************************************************************************************************************/
+/******************************************* . . . . . . . . . *********************************************/
+/************************************************************************************************************/
+
+
+/* The BASED customization macro is used to resolves the SS!=DS conflict for the Interrupt Service logic in
+ * DOS Drivers. Due to the cumbersomeness of mixing C and assembler local BASED variables still end up in the
+ * wrong segment. The workaround is that the HCF uses only global BASED variables or IFB-based variables.
+ * The "BASED" construction (supposedly) only amounts to something in the small memory model.
+ *
+ * Note that the whole BASED rigmarole is needlessly complicated because both the Microsoft Compiler and
+ * Linker are unnecessary restrictive in what far pointer manipulation they allow
+ */
+
+#if ! defined BASED
+#define BASED
+#endif // BASED
+
+#if ! defined EXTERN_C
+#ifdef __cplusplus
+#define EXTERN_C extern "C"
+#else
+#define EXTERN_C
+#endif // __cplusplus
+#endif // EXTERN_C
+
+#if ! defined NULL
+#define NULL ((void *) 0)
+#endif // NULL
+
+#if ! defined TEXT
+#define TEXT(x) x
+#endif // TEXT
+
+#if !defined _TCHAR_DEFINED
+#define TCHAR char
+#endif // _TCHAR_DEFINED
+
+/************************************************************************************************************/
+/*********************** C O N F L I C T D E T E C T I O N & R E S O L U T I O N ************************/
+/************************************************************************************************************/
+#if defined HCF_LITTLE_ENDIAN
+err: HCF_LITTLE_ENDIAN is obsolete;
+#endif // HCF_LITTLE_ENDIAN
+
+#if defined HCF_INT_OFF
+err: HCF_INT_OFF is obsolete;
+#endif //HCF_INT_OFF
+
+#if HCF_ALIGN != 1 && HCF_ALIGN != 2 && HCF_ALIGN != 4 && HCF_ALIGN != 8
+err: invalid value for HCF_ALIGN;
+#endif // HCF_ALIGN
+
+#if (HCF_ASSERT) & ~( HCF_ASSERT_PRINTF | HCF_ASSERT_SW_SUP | HCF_ASSERT_MB | HCF_ASSERT_RT_MSF_RTN | \
+ HCF_ASSERT_LNK_MSF_RTN )
+err: invalid value for HCF_ASSERT;
+#endif // HCF_ASSERT
+
+#if (HCF_ASSERT) & HCF_ASSERT_MB && ! ( (HCF_EXT) & HCF_EXT_MB ) //detect potential conflict
+err: these macros are not used consistently;
+#endif // HCF_ASSERT_MB / HCF_EXT_MB
+
+#if HCF_BIG_ENDIAN != 0 && HCF_BIG_ENDIAN != 1
+err: invalid value for HCF_BIG_ENDIAN;
+#endif // HCF_BIG_ENDIAN
+
+#if HCF_DL_ONLY != 0 && HCF_DL_ONLY != 1
+err: invalid value for HCF_DL_ONLY;
+#endif // HCF_DL_ONLY
+
+#if HCF_DMA != 0 && HCF_DMA != 1
+err: invalid value for HCF_DMA;
+#endif // HCF_DMA
+
+#if (HCF_ENCAP) & ~( HCF_ENC | HCF_ENC_SUP )
+err: invalid value for HCF_ENCAP;
+#endif // HCF_ENCAP
+
+#if (HCF_EXT) & ~( HCF_EXT_INFO_LOG | HCF_EXT_INT_TX_EX | HCF_EXT_TALLIES_FW | HCF_EXT_TALLIES_HCF | \
+ HCF_EXT_NIC_ACCESS | HCF_EXT_MB | HCF_EXT_INT_TICK | \
+ HCF_EXT_IFB_STRCT | HCF_EXT_DESC_STRCT | HCF_EXT_TX_CONT )
+err: invalid value for HCF_EXT;
+#endif // HCF_EXT
+
+#if HCF_INT_ON != 0 && HCF_INT_ON != 1
+err: invalid value for HCF_INT_ON;
+#endif // HCF_INT_ON
+
+#if (HCF_IO) & ~( HCF_IO_MEM | HCF_IO_32BITS )
+err: invalid value for HCF_IO;
+#endif // HCF_IO
+
+#if HCF_LEGACY != 0 && HCF_LEGACY != 1
+err: invalid value for HCF_LEGACY;
+#endif // HCF_LEGACY
+
+#if HCF_MAX_LTV < 16 || HCF_MAX_LTV > 2304
+err: invalid value for HCF_MAX_LTV;
+#endif // HCF_MAX_LTV
+
+#if HCF_PROT_TIME != 0 && ( HCF_PROT_TIME < 19 || 256 < HCF_PROT_TIME )
+err: below minimum .08 second required by Hermes or possibly above hcf_32 capacity;
+#endif // HCF_PROT_TIME
+
+#if (HCF_SLEEP) & ~( HCF_CDS | HCF_DDS )
+err: invalid value for HCF_SLEEP;
+#endif // HCF_SLEEP
+
+#if (HCF_SLEEP) && ! (HCF_INT_ON)
+err: these macros are not used consistently;
+#endif // HCF_SLEEP / HCF_INT_ON
+
+#if (HCF_SLEEP) && ! ( (HCF_EXT) & HCF_EXT_INT_TICK )
+//;? err: these macros are not used consistently;
+#endif // HCF_SLEEP / HCF_EXT_INT_TICK
+
+#if (HCF_TALLIES) & ~( HCF_TALLIES_HCF | HCF_TALLIES_NIC | HCF_TALLIES_RESET ) || \
+ (HCF_TALLIES) == HCF_TALLIES_RESET
+err: invalid value for HCF_TALLIES;
+#endif // HCF_TALLIES
+
+#if (HCF_TYPE) & ~(HCF_TYPE_WPA | HCF_TYPE_USB | HCF_TYPE_PRELOADED | HCF_TYPE_HII5 | HCF_TYPE_WARP | \
+ HCF_TYPE_CCX /* | HCF_TYPE_TX_DELAY */ )
+err: invalid value for HCF_TYPE;
+#endif //HCF_TYPE
+
+#if (HCF_TYPE) & HCF_TYPE_WARP && (HCF_TYPE) & HCF_TYPE_WPA
+err: at most 1 of these macros should be defined;
+#endif //HCF_TYPE_WARP / HCF_TYPE_WPA
+
+#endif //HCFCFG_H
+
diff --git a/drivers/staging/wlags49_h2/hcfdef.h b/drivers/staging/wlags49_h2/hcfdef.h
new file mode 100644
index 000000000000..f7e74bfbadfa
--- /dev/null
+++ b/drivers/staging/wlags49_h2/hcfdef.h
@@ -0,0 +1,809 @@
+
+// vim:tw=110:ts=4:
+#ifndef HCFDEFC_H
+#define HCFDEFC_H 1
+
+/*************************************************************************************************
+*
+* FILE : HCFDEF.H
+*
+* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.8 $
+* Original: 2004/05/28 14:05:35 Revision: 1.59 Tag: hcf7_t20040602_01
+* Original: 2004/05/13 15:31:45 Revision: 1.53 Tag: hcf7_t7_20040513_01
+* Original: 2004/04/15 09:24:42 Revision: 1.44 Tag: hcf7_t7_20040415_01
+* Original: 2004/04/13 14:22:45 Revision: 1.43 Tag: t7_20040413_01
+* Original: 2004/04/01 15:32:55 Revision: 1.40 Tag: t7_20040401_01
+* Original: 2004/03/10 15:39:28 Revision: 1.36 Tag: t20040310_01
+* Original: 2004/03/03 14:10:12 Revision: 1.34 Tag: t20040304_01
+* Original: 2004/03/02 09:27:12 Revision: 1.32 Tag: t20040302_03
+* Original: 2004/02/24 13:00:29 Revision: 1.29 Tag: t20040224_01
+* Original: 2004/02/18 17:13:57 Revision: 1.26 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* SPECIFICATION: ...........
+*
+* DESC : Definitions and Prototypes for HCF only
+*
+**************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+*************************************************************************************************/
+
+
+/************************************************************************************************/
+/********************************* P R E F I X E S ********************************************/
+/************************************************************************************************/
+//IFB_ Interface Block
+//HCMD_ Hermes Command
+//HFS_ Hermes (Transmit/Receive) Frame Structure
+//HREG_ Hermes Register
+
+/*************************************************************************************************/
+
+#if 0 //
+#define BIT0 0x0001
+#define BIT1 0x0002
+#define BIT2 0x0004
+#define BIT3 0x0008
+#define BIT4 0x0010
+#define BIT5 0x0020
+#define BIT6 0x0040
+#define BIT7 0x0080
+#define BIT8 0x0100
+#define BIT9 0x0200
+#define BIT10 0x0400
+#define BIT11 0x0800
+#define BIT12 0x1000
+#define BIT13 0x2000
+#define BIT14 0x4000
+#define BIT15 0x8000
+#define BIT16 0x00010000
+#define BIT17 0x00020000
+#define BIT18 0x00040000
+#define BIT19 0x00080000
+#define BIT20 0x00100000
+#define BIT21 0x00200000
+#define BIT22 0x00400000
+#define BIT23 0x00800000
+#define BIT24 0x01000000
+#define BIT25 0x02000000
+#define BIT26 0x04000000
+#define BIT27 0x08000000
+#define BIT28 0x10000000
+#define BIT29 0x20000000
+#define BIT30 0x40000000
+#define BIT31 0x80000000
+#endif // 0
+
+/************************************************************************************************/
+/********************************* GENERAL EQUATES **********************************************/
+/************************************************************************************************/
+
+
+#define HCF_MAGIC 0x7D37 // "}7" Handle validation
+
+#define PLUG_DATA_OFFSET 0x00000800 //needed by some test tool on top of H-II NDIS driver
+
+#define INI_TICK_INI 0x00040000L
+
+#define IO_IN 0 //hcfio_in_string
+#define IO_OUT 1 //hcfio_out_string
+
+//DO_ASSERT, create an artificial FALSE to force an ASSERT without the nasty compiler warning
+#define DO_ASSERT ( assert_ifbp->IFB_Magic != HCF_MAGIC && assert_ifbp->IFB_Magic == HCF_MAGIC )
+#define NT_ASSERT 0x0000 //, NEVER_TESTED
+#define NEVER_TESTED MERGE_2( 0xEFFE, 0xFEEF )
+#define SE_ASSERT 0x5EFF /* Side Effect, HCFASSERT invokation which are only called for the
+ * side effect and which should never trigger */
+#define DHF_FILE_NAME_OFFSET 10000 //to distinguish DHF from HCF asserts by means of line number
+#define MMD_FILE_NAME_OFFSET 20000 //to distinguish MMD from HCF asserts by means of line number
+
+// trace codes used to
+// 1: profile execution times via HCF_TRACE and HCF_TRACE_VALUE
+// 2: hierarchical flow information via HCFLOGENTRY / HCFLOGEXIT
+
+//#define HCF_TRACE_CONNECT useless
+//#define HCF_TRACE_DISCONNECT useless
+#define HCF_TRACE_ACTION 0x0000 // 0x0001
+#define HCF_TRACE_CNTL 0x0001 // 0x0002
+#define HCF_TRACE_DMA_RX_GET 0x0002 // 0x0004
+#define HCF_TRACE_DMA_RX_PUT 0x0003 // 0x0008
+#define HCF_TRACE_DMA_TX_GET 0x0004 // 0x0010
+#define HCF_TRACE_DMA_TX_PUT 0x0005 // 0x0020
+#define HCF_TRACE_GET_INFO 0x0006 // 0x0040
+#define HCF_TRACE_PUT_INFO 0x0007 // 0x0080
+#define HCF_TRACE_RCV_MSG 0x0008 // 0x0100
+#define HCF_TRACE_SEND_MSG 0x0009 // 0x0200
+#define HCF_TRACE_SERVICE_NIC 0x000A // 0x0400
+// #define HCF_TRACE_ 0x000C // 0x1000
+// #define HCF_TRACE_ 0x000D // 0x2000
+// #define HCF_TRACE_ 0x000E // 0x4000
+// #define HCF_TRACE_ 0x000F // 0x8000
+// ============================================ HCF_TRACE_... codes below 0x0010 are asserted on re-entry
+#define HCF_TRACE_ACTION_KLUDGE 0x0010 /* once you start introducing kludges there is no end to it
+ * this is an escape to do not assert on re-entrancy problem caused
+ * by HCF_ACT_INT_FORCE_ON used to get Microsofts NDIS drivers going
+ */
+#define HCF_TRACE_STRIO 0x0020
+#define HCF_TRACE_ALLOC 0X0021
+#define HCF_TRACE_DL 0X0023
+#define HCF_TRACE_ISR_INFO 0X0024
+#define HCF_TRACE_CALIBRATE 0x0026
+
+#define HCF_TRACE_CMD_CPL 0x0040
+#define HCF_TRACE_CMD_EXE 0x0041
+#define HCF_TRACE_GET_FID 0x0042
+#define HCF_TRACE_GET_FRAG 0x0043
+#define HCF_TRACE_INIT 0x0044
+#define HCF_TRACE_PUT_FRAG 0x0045
+#define HCF_TRACE_SETUP_BAP 0x0046
+
+#define HCF_TRACE_EXIT 0x8000 // Keil C warns "long constant truncated to int"
+
+//#define BAP_0 HREG_DATA_0 //Used by DMA controller to access NIC RAM
+#define BAP_1 HREG_DATA_1 //Used by HCF to access NIC RAM
+
+
+//************************* Hermes Receive/Transmit Frame Structures
+//HFS_STAT
+//see MMD.H for HFS_STAT_ERR
+#define HFS_STAT_MSG_TYPE 0xE000 //Hermes reported Message Type
+#define HFS_STAT_MIC_KEY_ID 0x1800 //MIC key used (if any)
+#define HFS_STAT_1042 0x2000 //RFC1042 Encoded
+#define HFS_STAT_TUNNEL 0x4000 //Bridge-Tunnel Encoded
+#define HFS_STAT_WMP_MSG 0x6000 //WaveLAN-II Management Protocol Frame
+#if (HCF_TYPE) & HCF_TYPE_WPA
+#define HFS_STAT_MIC 0x0010 //Frame contains MIC //;? re-instate when F/W ready
+#endif
+
+//************************* Hermes Register Offsets and Command bits
+#define HREG_IO_RANGE 0x80 //I/O Range used by Hermes
+
+
+//************************* Command/Status
+#define HREG_CMD 0x00 //
+#define HCMD_CMD_CODE 0x3F
+#define HREG_PARAM_0 0x02 //
+#define HREG_PARAM_1 0x04 //
+#define HREG_PARAM_2 0x06 //
+#define HREG_STAT 0x08 //
+#define HREG_STAT_CMD_CODE 0x003F //
+#define HREG_STAT_DIAG_ERR 0x0100
+#define HREG_STAT_INQUIRE_ERR 0x0500
+#define HREG_STAT_CMD_RESULT 0x7F00 //
+#define HREG_RESP_0 0x0A //
+#define HREG_RESP_1 0x0C //
+#define HREG_RESP_2 0x0E //
+
+
+//************************* FID Management
+#define HREG_INFO_FID 0x10 //
+#define HREG_RX_FID 0x20 //
+#define HREG_ALLOC_FID 0x22 //
+#define HREG_TX_COMPL_FID 0x24 //
+
+
+//************************* BAP
+//20031030 HWi Inserted this again because the dongle code uses this (GPIF.C)
+//#define HREG_SELECT_0 0x18 //
+//#define HREG_OFFSET_0 0x1C //
+//#define HREG_DATA_0 0x36 //
+
+//#define HREG_OFFSET_BUSY 0x8000 // use HCMD_BUSY
+#define HREG_OFFSET_ERR 0x4000 //
+//rsrvd #define HREG_OFFSET_DATA_OFFSET 0x0FFF //
+
+#define HREG_SELECT_1 0x1A //
+#define HREG_OFFSET_1 0x1E //
+#define HREG_DATA_1 0x38 //
+
+
+//************************* Event
+#define HREG_EV_STAT 0x30 //
+#define HREG_INT_EN 0x32 //
+#define HREG_EV_ACK 0x34 //
+
+#define HREG_EV_TICK 0x8000 //Auxiliary Timer Tick
+//#define HREG_EV_RES 0x4000 //H-I only: H/W error (Wait Time-out)
+#define HREG_EV_INFO_DROP 0x2000 //WMAC did not have sufficient RAM to build Unsollicited Frame
+#if (HCF_TYPE) & HCF_TYPE_HII5
+#define HREG_EV_ACK_REG_READY 0x0000
+#else
+#define HREG_EV_ACK_REG_READY 0x1000 //Workaround Kludge bit for H-II (not H-II.5)
+#endif // HCF_TYPE_HII5
+#if (HCF_SLEEP) & ( HCF_CDS | HCF_DDS )
+#define HREG_EV_SLEEP_REQ 0x0800
+#else
+#define HREG_EV_SLEEP_REQ 0x0000
+#endif // HCF_CDS / HCF_DDS
+#if HCF_DMA
+//#define HREG_EV_LPESC 0x0400 // firmware sets this bit and clears it, not for host usage.
+#define HREG_EV_RDMAD 0x0200 // rx frame in host memory
+#define HREG_EV_TDMAD 0x0100 // tx frame in host memory processed
+//#define HREG_EV_RXDMA 0x0040 // firmware kicks off DMA engine (bit is not for host usage)
+//#define HREG_EV_TXDMA 0x0020 // firmware kicks off DMA engine (bit is not for host usage)
+#define HREG_EV_FW_DMA 0x0460 // firmware / DMA engine I/F (bits are not for host usage)
+#else
+#define HREG_EV_FW_DMA 0x0000
+#endif // HCF_DMA
+#define HREG_EV_INFO 0x0080 // Asynchronous Information Frame
+#define HREG_EV_CMD 0x0010 // Command completed, Status and Response available
+#define HREG_EV_ALLOC 0x0008 // Asynchronous part of Allocation/Reclaim completed
+#define HREG_EV_TX_EXC 0x0004 // Asynchronous Transmission unsuccessful completed
+#define HREG_EV_TX 0x0002 // Asynchronous Transmission successful completed
+#define HREG_EV_RX 0x0001 // Asynchronous Receive Frame
+
+#define HREG_EV_TX_EXT ( (HCF_EXT) & (HCF_EXT_INT_TX_EX | HCF_EXT_INT_TICK ) )
+ /* HREG_EV_TX_EXT := 0x0000 or HREG_EV_TX_EXC and/or HREG_EV_TICK
+ * could be extended with HREG_EV_TX */
+#if HCF_EXT_INT_TX_EX != HREG_EV_TX_EXC
+err: these values should match;
+#endif // HCF_EXT_INT_TX_EX / HREG_EV_TX_EXC
+
+#if HCF_EXT_INT_TICK != HREG_EV_TICK
+err: these values should match;
+#endif // HCF_EXT_INT_TICK / HREG_EV_TICK
+
+//************************* Host Software
+#define HREG_SW_0 0x28 //
+#define HREG_SW_1 0x2A //
+#define HREG_SW_2 0x2C //
+//rsrvd #define HREG_SW_3 0x2E //
+//************************* Control and Auxiliary Port
+
+#define HREG_IO 0x12
+#define HREG_IO_SRESET 0x0001
+#define HREG_IO_WAKEUP_ASYNC 0x0002
+#define HREG_IO_WOKEN_UP 0x0004
+#define HREG_CNTL 0x14 //
+//#define HREG_CNTL_WAKEUP_SYNC 0x0001
+#define HREG_CNTL_AUX_ENA_STAT 0xC000
+#define HREG_CNTL_AUX_DIS_STAT 0x0000
+#define HREG_CNTL_AUX_ENA_CNTL 0x8000
+#define HREG_CNTL_AUX_DIS_CNTL 0x4000
+#define HREG_CNTL_AUX_DSD 0x2000
+#define HREG_CNTL_AUX_ENA (HREG_CNTL_AUX_ENA_CNTL | HREG_CNTL_AUX_DIS_CNTL )
+#define HREG_SPARE 0x16 //
+#define HREG_AUX_PAGE 0x3A //
+#define HREG_AUX_OFFSET 0x3C //
+#define HREG_AUX_DATA 0x3E //
+
+#if HCF_DMA
+//************************* DMA (bus mastering)
+ // Be carefull to use these registers only at a genuine 32 bits NIC
+ // On 16 bits NICs, these addresses are mapped into the range 0x00 through 0x3F with all consequences
+ // thereof, e.g. HREG_DMA_CTRL register maps to HREG_CMD.
+#define HREG_DMA_CTRL 0x0040
+#define HREG_TXDMA_PTR32 0x0044
+#define HREG_TXDMA_PRIO_PTR32 0x0048
+#define HREG_TXDMA_HIPRIO_PTR32 0x004C
+#define HREG_RXDMA_PTR32 0x0050
+#define HREG_CARDDETECT_1 0x007C // contains 7D37
+#define HREG_CARDDETECT_2 0x007E // contains 7DE7
+#define HREG_FREETIMER 0x0058
+#define HREG_DMA_RX_CNT 0x0026
+
+/******************************************************************************
+* Defines for the bits in the DmaControl register (@40h)
+******************************************************************************/
+#define HREG_DMA_CTRL_RXHWEN 0x80000000 // high word enable bit
+#define HREG_DMA_CTRL_RXRESET 0x40000000 // tx dma init bit
+#define HREG_DMA_CTRL_RXBAP1 BIT29
+#define HREG_DMA_CTRL_RX_STALLED BIT28
+#define HREG_DMA_CTRL_RXAUTOACK_DMADONE BIT27 // no host involvement req. for TDMADONE event
+#define HREG_DMA_CTRL_RXAUTOACK_INFO BIT26 // no host involvement req. for alloc event
+#define HREG_DMA_CTRL_RXAUTOACK_DMAEN 0x02000000 // no host involvement req. for TxDMAen event
+#define HREG_DMA_CTRL_RXAUTOACK_RX 0x01000000 // no host involvement req. for tx event
+#define HREG_DMA_CTRL_RX_BUSY BIT23 // read only bit
+//#define HREG_DMA_CTRL_RX_RBUFCONT_PLAIN 0 // bits 21..20
+//#define HREG_DMA_CTRL_RX_MODE_PLAIN_DMA 0 // mode 0
+#define HREG_DMA_CTRL_RX_MODE_SINGLE_PACKET 0x00010000 // mode 1
+#define HREG_DMA_CTRL_RX_MODE_MULTI_PACKET 0x00020000 // mode 2
+//#define HREG_DMA_CTRL_RX_MODE_DISABLE (0x00020000|0x00010000) // disable tx dma engine
+#define HREG_DMA_CTRL_TXHWEN 0x8000 // low word enable bit
+#define HREG_DMA_CTRL_TXRESET 0x4000 // rx dma init bit
+#define HREG_DMA_CTRL_TXBAP1 BIT13
+#define HREG_DMA_CTRL_TXAUTOACK_DMADONE BIT11 // no host involvement req. for RxDMADONE event
+#define HREG_DMA_CTRL_TXAUTOACK_DMAEN 0x00000400 // no host involvement req. for RxDMAen event
+#define HREG_DMA_CTRL_TXAUTOACK_DMAALLOC 0x00000200 // no host involvement req. for info event
+#define HREG_DMA_CTRL_TXAUTOACK_TX 0x00000100 // no host involvement req. for rx event
+#define HREG_DMA_CTRL_TX_BUSY BIT7 // read only bit
+//#define HREG_DMA_CTRL_TX_TBUFCONT_PLAIN 0 // bits 6..5
+//#define HREG_DMA_CTRL_TX_MODE_PLAIN_DMA 0 // mode 0
+#define HREG_DMA_CTRL_TX_MODE_SINGLE_PACKET BIT0 // mode 1
+#define HREG_DMA_CTRL_TX_MODE_MULTI_PACKET 0x00000002 // mode 2
+//#define HREG_DMA_CTRL_TX_MODE_DISABLE (0x00000001|0x00000002) // disable tx dma engine
+
+//configuration DWORD to configure DMA for mode2 operation, using BAP0 as the DMA BAP.
+#define DMA_CTRLSTAT_GO (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RX_MODE_MULTI_PACKET | \
+ HREG_DMA_CTRL_RXAUTOACK_DMAEN | HREG_DMA_CTRL_RXAUTOACK_RX | \
+ HREG_DMA_CTRL_TXHWEN | /*;?HREG_DMA_CTRL_TX_TBUFCONT_PLAIN |*/ \
+ HREG_DMA_CTRL_TX_MODE_MULTI_PACKET | HREG_DMA_CTRL_TXAUTOACK_DMAEN |\
+ HREG_DMA_CTRL_TXAUTOACK_DMAALLOC)
+
+//configuration DWORD to reset both the Tx and Rx DMA engines
+#define DMA_CTRLSTAT_RESET (HREG_DMA_CTRL_RXHWEN | HREG_DMA_CTRL_RXRESET | HREG_DMA_CTRL_TXHWEN | HREG_DMA_CTRL_TXRESET)
+
+//#define DESC_DMA_OWNED 0x80000000 // BIT31
+#define DESC_DMA_OWNED 0x8000 // BIT31
+#define DESC_SOP 0x8000 // BIT15
+#define DESC_EOP 0x4000 // BIT14
+
+#define DMA_RX 0
+#define DMA_TX 1
+
+// #define IFB_RxFirstDesc IFB_FirstDesc[DMA_RX]
+// #define IFB_TxFirstDesc IFB_FirstDesc[DMA_TX]
+// #define IFB_RxLastDesc IFB_LastDesc[DMA_RX]
+// #define IFB_TxLastDesc IFB_LastDesc[DMA_TX]
+
+#endif // HCF_DMA
+//
+/************************************************************************************************/
+/********************************** EQUATES ***************************************************/
+/************************************************************************************************/
+
+
+// Hermes Command Codes and Qualifier bits
+#define HCMD_BUSY 0x8000 // Busy bit, applicable for all commands
+#define HCMD_INI 0x0000 //
+#define HCMD_ENABLE HCF_CNTL_ENABLE // 0x0001
+#define HCMD_DISABLE HCF_CNTL_DISABLE // 0x0002
+#define HCMD_CONNECT HCF_CNTL_CONNECT // 0x0003
+#define HCMD_EXECUTE 0x0004 //
+#define HCMD_DISCONNECT HCF_CNTL_DISCONNECT // 0x0005
+#define HCMD_SLEEP 0x0006 //
+#define HCMD_CONTINUE HCF_CNTL_CONTINUE // 0x0007
+#define HCMD_RETRY 0x0100 // Retry bit
+#define HCMD_ALLOC 0x000A //
+#define HCMD_TX 0x000B //
+#define HCMD_RECL 0x0100 // Reclaim bit, applicable for Tx and Inquire
+#define HCMD_INQUIRE 0x0011 //
+#define HCMD_ACCESS 0x0021 //
+#define HCMD_ACCESS_WRITE 0x0100 // Write bit
+#define HCMD_PROGRAM 0x0022 //
+#define HCMD_READ_MIF 0x0030
+#define HCMD_WRITE_MIF 0x0031
+#define HCMD_THESEUS 0x0038
+#define HCMD_STARTPREAMBLE 0x0E00 // Start continuous preamble Tx
+#define HCMD_STOP 0x0F00 // Stop Theseus test mode
+
+
+//Configuration Management
+//
+
+#define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM 1 // Default Bottom Compatibility for Primary Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_PRI_3_TOP 1 // Default Top Compatibility for Primary Firmware - driver I/F
+
+#define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
+#define CFG_DRV_ACT_RANGES_HSI_4_TOP 1 // Default Top Compatibility for H/W - driver I/F
+
+#define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM 1 // Default Bottom Compatibility for H/W - driver I/F
+#define CFG_DRV_ACT_RANGES_HSI_5_TOP 1 // Default Top Compatibility for H/W - driver I/F
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+#define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 16 // Default Bottom Compatibility for AP Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_APF_1_TOP 16 // Default Top Compatibility for AP Firmware - driver I/F
+#else //;? is this REALLY O.K.
+#define CFG_DRV_ACT_RANGES_APF_1_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_APF_1_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
+#endif // HCF_TYPE_WPA
+
+#define CFG_DRV_ACT_RANGES_APF_2_BOTTOM 2 // Default Bottom Compatibility for AP Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_APF_2_TOP 2 // Default Top Compatibility for AP Firmware - driver I/F
+
+#define CFG_DRV_ACT_RANGES_APF_3_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_APF_3_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
+
+#define CFG_DRV_ACT_RANGES_APF_4_BOTTOM 1 // Default Bottom Compatibility for AP Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_APF_4_TOP 1 // Default Top Compatibility for AP Firmware - driver I/F
+
+#if (HCF_TYPE) & HCF_TYPE_HII5
+#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 6 // Default Bottom Compatibility for Station Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_STA_2_TOP 6 // Default Top Compatibility for Station Firmware - driver I/F
+#else // (HCF_TYPE) & HCF_TYPE_HII5
+#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_STA_2_TOP 2 // Default Top Compatibility for Station Firmware - driver I/F
+#endif // (HCF_TYPE) & HCF_TYPE_HII5
+
+#define CFG_DRV_ACT_RANGES_STA_3_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_STA_3_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
+
+#define CFG_DRV_ACT_RANGES_STA_4_BOTTOM 1 // Default Bottom Compatibility for Station Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_STA_4_TOP 1 // Default Top Compatibility for Station Firmware - driver I/F
+
+//---------------------------------------------------------------------------------------------------------------------
+#if defined HCF_CFG_PRI_1_TOP || defined HCF_CFG_PRI_1_BOTTOM
+err: PRI_1 not supported for H-I; // Compatibility for Primary Firmware - driver I/F
+#endif // HCF_CFG_PRI_1_TOP / HCF_CFG_PRI_1_BOTTOM
+
+#if defined HCF_CFG_PRI_2_TOP || defined HCF_CFG_PRI_2_BOTTOM
+err: PRI_2 not supported for H-I; // Compatibility for Primary Firmware - driver I/F
+#endif // HCF_CFG_PRI_2_TOP / HCF_CFG_PRI_2_BOTTOM
+
+#ifdef HCF_CFG_PRI_3_TOP // Top Compatibility for Primary Firmware - driver I/F
+#if HCF_CFG_PRI_3_TOP == 0 || \
+ CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_TOP && HCF_CFG_PRI_3_TOP <= CFG_DRV_ACT_RANGES_PRI_3_TOP
+#undef CFG_DRV_ACT_RANGES_PRI_3_TOP
+#define CFG_DRV_ACT_RANGES_PRI_3_TOP HCF_CFG_PRI_3_TOP
+#else
+err: ;
+#endif
+#endif // HCF_CFG_PRI_3_TOP
+
+#ifdef HCF_CFG_PRI_3_BOTTOM // Bottom Compatibility for Primary Firmware - driver I/F
+#if CFG_DRV_ACT_RANGES_PRI_3_BOTTOM <= HCF_CFG_PRI_3_BOTTOM && HCF_CFG_PRI_3_BOTTOM <= CFG_DRV_ACT_RANGES_PRI_3_TOP
+#undef CFG_DRV_ACT_RANGES_PRI_3_BOTTOM
+#define CFG_DRV_ACT_RANGES_PRI_3_BOTTOM HCF_CFG_PRI_3_BOTTOM
+#else
+err: ;
+#endif
+#endif // HCF_CFG_PRI_3_BOTTOM
+
+
+//---------------------------------------------------------------------------------------------------------------------
+#if defined HCF_CFG_HSI_0_TOP || defined HCF_CFG_HSI_0_BOTTOM
+err: HSI_0 not supported for H-I; // Compatibility for HSI I/F
+#endif // HCF_CFG_HSI_0_TOP / HCF_CFG_HSI_0_BOTTOM
+
+#if defined HCF_CFG_HSI_1_TOP || defined HCF_CFG_HSI_1_BOTTOM
+err: HSI_1 not supported for H-I; // Compatibility for HSI I/F
+#endif // HCF_CFG_HSI_1_TOP / HCF_CFG_HSI_1_BOTTOM
+
+#if defined HCF_CFG_HSI_2_TOP || defined HCF_CFG_HSI_2_BOTTOM
+err: HSI_2 not supported for H-I; // Compatibility for HSI I/F
+#endif // HCF_CFG_HSI_2_TOP / HCF_CFG_HSI_2_BOTTOM
+
+#if defined HCF_CFG_HSI_3_TOP || defined HCF_CFG_HSI_3_BOTTOM
+err: HSI_3 not supported for H-I; // Compatibility for HSI I/F
+#endif // HCF_CFG_HSI_3_TOP / HCF_CFG_HSI_3_BOTTOM
+
+#ifdef HCF_CFG_HSI_4_TOP // Top Compatibility for HSI I/F
+#if HCF_CFG_HSI_4_TOP == 0 || \
+ CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= CF_CFG_HSI_4_TOP && HCF_CFG_HSI_4_TOP <= CFG_DRV_ACT_RANGES_HSI_4_TOP
+#undef CFG_DRV_ACT_RANGES_HSI_4_TOP
+#define CFG_DRV_ACT_RANGES_HSI_4_TOP HCF_CFG_HSI_4_TOP
+#else
+err: ;
+#endif
+#endif // HCF_CFG_HSI_4_TOP
+
+#ifdef HCF_CFG_HSI_4_BOTTOM // Bottom Compatibility for HSI I/F
+#if CFG_DRV_ACT_RANGES_HSI_4_BOTTOM <= HCF_CFG_HSI_4_BOTTOM && HCF_CFG_HSI_4_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_4_TOP
+#undef CFG_DRV_ACT_RANGES_HSI_4_BOTTOM
+#define CFG_DRV_ACT_RANGES_HSI_4_BOTTOM HCF_CFG_HSI_4_BOTTOM
+#else
+err: ;
+#endif
+#endif // HCF_CFG_HSI_4_BOTTOM
+
+#ifdef HCF_CFG_HSI_5_TOP // Top Compatibility for HSI I/F
+#if HCF_CFG_HSI_5_TOP == 0 || \
+ CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= CF_CFG_HSI_5_TOP && HCF_CFG_HSI_5_TOP <= CFG_DRV_ACT_RANGES_HSI_5_TOP
+#undef CFG_DRV_ACT_RANGES_HSI_5_TOP
+#define CFG_DRV_ACT_RANGES_HSI_5_TOP HCF_CFG_HSI_5_TOP
+#else
+err: ;
+#endif
+#endif // HCF_CFG_HSI_5_TOP
+
+#ifdef HCF_CFG_HSI_5_BOTTOM // Bottom Compatibility for HSI I/F
+#if CFG_DRV_ACT_RANGES_HSI_5_BOTTOM <= HCF_CFG_HSI_5_BOTTOM && HCF_CFG_HSI_5_BOTTOM <= CFG_DRV_ACT_RANGES_HSI_5_TOP
+#undef CFG_DRV_ACT_RANGES_HSI_5_BOTTOM
+#define CFG_DRV_ACT_RANGES_HSI_5_BOTTOM HCF_CFG_HSI_5_BOTTOM
+#else
+err: ;
+#endif
+#endif // HCF_CFG_HSI_5_BOTTOM
+//---------------------------------------------------------------------------------------------------------------------
+#if defined HCF_CFG_APF_1_TOP || defined HCF_CFG_APF_1_BOTTOM
+err: APF_1 not supported for H-I; // Compatibility for AP Firmware - driver I/F
+#endif // HCF_CFG_APF_1_TOP / HCF_CFG_APF_1_BOTTOM
+
+#ifdef HCF_CFG_APF_2_TOP // Top Compatibility for AP Firmware - driver I/F
+#if HCF_CFG_APF_2_TOP == 0 || \
+ CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_TOP && HCF_CFG_APF_2_TOP <= CFG_DRV_ACT_RANGES_APF_2_TOP
+#undef CFG_DRV_ACT_RANGES_APF_2_TOP
+#define CFG_DRV_ACT_RANGES_APF_2_TOP HCF_CFG_APF_2_TOP
+#else
+err: ;
+#endif
+#endif // HCF_CFG_APF_TOP
+
+#ifdef HCF_CFG_APF_2_BOTTOM // Bottom Compatibility for AP Firmware - driver I/F
+#if CFG_DRV_ACT_RANGES_APF_2_BOTTOM <= HCF_CFG_APF_2_BOTTOM && HCF_CFG_APF_2_BOTTOM <= CFG_DRV_ACT_RANGES_APF_2_TOP
+#undef CFG_DRV_ACT_RANGES_APF_2_BOTTOM
+#define CFG_DRV_ACT_RANGES_APF_2_BOTTOM HCF_CFG_APF_2_BOTTOM
+#else
+err: ;
+#endif
+#endif // HCF_CFG_APF_BOTTOM
+
+//---------------------------------------------------------------------------------------------------------------------
+#if defined HCF_CFG_STA_1_TOP || defined HCF_CFG_STA_1_BOTTOM
+err: STA_1 not supported for H-I; // Compatibility for Station Firmware - driver I/F
+#endif // HCF_CFG_STA_1_TOP / HCF_CFG_STA_1_BOTTOM
+
+#ifdef HCF_CFG_STA_2_TOP // Top Compatibility for Station Firmware - driver I/F
+#if HCF_CFG_STA_2_TOP == 0 || \
+ CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_TOP && HCF_CFG_STA_2_TOP <= CFG_DRV_ACT_RANGES_STA_2_TOP
+#undef CFG_DRV_ACT_RANGES_STA_2_TOP
+#define CFG_DRV_ACT_RANGES_STA_2_TOP HCF_CFG_STA_2_TOP
+#else
+err: ;
+#endif
+#endif // HCF_CFG_STA_TOP
+
+#ifdef HCF_CFG_STA_2_BOTTOM // Bottom Compatibility for Station Firmware - driver I/F
+#if CFG_DRV_ACT_RANGES_STA_2_BOTTOM <= HCF_CFG_STA_2_BOTTOM && HCF_CFG_STA_2_BOTTOM <= CFG_DRV_ACT_RANGES_STA_2_TOP
+#undef CFG_DRV_ACT_RANGES_STA_2_BOTTOM
+#define CFG_DRV_ACT_RANGES_STA_2_BOTTOM HCF_CFG_STA_2_BOTTOM
+#else
+err: ;
+#endif
+#endif // HCF_CFG_STA_BOTTOM
+
+
+/************************************************************************************************/
+/************************************** MACROS ************************************************/
+/************************************************************************************************/
+
+/* min and max macros */
+#if ! defined max
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#if ! defined min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#ifdef HCF_SLEEP
+#if defined MSF_WAIT
+err: MSF should no longer supply this macro;
+#else
+#define MSF_WAIT(x) \
+ { PROT_CNT_INI \
+ HCF_WAIT_WHILE( ( IPW( HREG_IO ) & HREG_IO_WOKEN_UP ) == 0 ); \
+ HCFASSERT( prot_cnt, IPW( HREG_IO ) ) \
+ }
+#endif // MSF_WAIT
+#else
+#define MSF_WAIT(x) /*NOP*/
+#endif // HCF_SLEEP
+
+#define LOF(x) (sizeof(x)/sizeof(hcf_16)-1)
+
+#define MUL_BY_2( x ) ( (x) << 1 ) //used to multiply by 2
+#define DIV_BY_2( x ) ( (x) >> 1 ) //used to divide by 2
+
+//resolve problems on for some 16 bits compilers to create 32 bit values
+#define MERGE_2( hw, lw ) ( ( ((hcf_32)(hw)) << 16 ) | ((hcf_16)(lw)) )
+
+#if ! defined HCF_STATIC
+#define HCF_STATIC static
+#endif // HCF_STATIC
+
+#if ( (HCF_TYPE) & HCF_TYPE_HII5 ) == 0
+#define DAWA_ACK( mask) { \
+ OPW( HREG_EV_ACK, mask | HREG_EV_ACK_REG_READY ); \
+ OPW( HREG_EV_ACK, (mask & ~HREG_EV_ALLOC) | HREG_EV_ACK_REG_READY ); }
+#define DAWA_ZERO_FID(reg) OPW( reg, 0 );
+#else
+#define DAWA_ACK( mask) OPW( HREG_EV_ACK, mask );
+#define DAWA_ZERO_FID(reg)
+#endif // HCF_TYPE_HII5
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+#define CALC_RX_MIC( p, len ) calc_mic_rx_frag( ifbp, p, len )
+#define CALC_TX_MIC( p, len ) calc_mic_tx_frag( ifbp, p, len )
+#define IF_SSN(x) x
+#define IF_NOT_SSN(x)
+#else
+#define CALC_RX_MIC( p, len )
+#define CALC_TX_MIC( p, len )
+#define MIC_RX_RTN( mic, dw )
+#define MIC_TX_RTN( mic, dw )
+#define IF_SSN(x)
+#define IF_NOT_SSN(x) x
+#endif // HCF_TYPE_WPA
+
+#if HCF_TALLIES & HCF_TALLIES_HCF //HCF tally support
+#define IF_TALLY(x) x
+#else
+#define IF_TALLY(x)
+#endif // HCF_TALLIES_HCF
+
+
+#if HCF_DMA
+#define IF_DMA(x) x
+#define IF_NOT_DMA(x)
+#define IF_USE_DMA(x) if ( ifbp->IFB_CntlOpt & USE_DMA ) x
+#define IF_NOT_USE_DMA(x) if ( !(ifbp->IFB_CntlOpt & USE_DMA) ) x
+#else
+#define IF_DMA(x)
+#define IF_NOT_DMA(x) x
+#define IF_USE_DMA(x)
+#define IF_NOT_USE_DMA(x) x
+#endif // HCF_DMA
+
+
+#define IPW(x) ((hcf_16)IN_PORT_WORD( ifbp->IFB_IOBase + (x) ) )
+#define OPW(x, y) OUT_PORT_WORD( ifbp->IFB_IOBase + (x), y )
+ /* make sure the implementation of HCF_WAIT_WHILE is such that there may be multiple HCF_WAIT_WHILE calls
+ * in a row and that when one fails all subsequent fail immediately without reinitialization of prot_cnt
+ */
+#if HCF_PROT_TIME == 0
+#define PROT_CNT_INI
+#define IF_PROT_TIME(x)
+#if defined HCF_YIELD
+#define HCF_WAIT_WHILE( x ) while ( (x) && (HCF_YIELD) ) /*NOP*/;
+#else
+#define HCF_WAIT_WHILE( x ) while ( x ) /*NOP*/;
+#endif // HCF_YIELD
+#else
+#define PROT_CNT_INI hcf_32 prot_cnt = ifbp->IFB_TickIni;
+#define IF_PROT_TIME(x) x
+#if defined HCF_YIELD
+#define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) && (HCF_YIELD) ) prot_cnt--;
+#else
+#include <linux/delay.h>
+#define HCF_WAIT_WHILE( x ) while ( prot_cnt && (x) ) { udelay(2); prot_cnt--; }
+#endif // HCF_YIELD
+#endif // HCF_PROT_TIME
+
+#if defined HCF_EX_INT
+//#if HCF_EX_INT & ~( HCF_EX_INT_TX_EX | HCF_EX_INT_TX_OK | HCF_EX_INT_TICK )
+;? out dated checking
+err: you used an invalid bitmask;
+// #endif // HCF_EX_INT validation
+// #else
+// #define HCF_EX_INT 0x000
+#endif // HCF_EX_INT
+
+#if 0 //get compiler going
+#if HCF_EX_INT_TICK != HREG_EV_TICK
+;? out dated checking
+err: someone redefined these macros while the implemenation assumes they are equal;
+#endif
+#if HCF_EX_INT_TX_OK != HFS_TX_CNTL_TX_OK || HFS_TX_CNTL_TX_OK != HREG_EV_TX_OK
+;? out dated checking
+err: someone redefined these macros while the implemenation assumes they are equal;
+#endif
+#if HCF_EX_INT_TX_EX != HFS_TX_CNTL_TX_EX || HFS_TX_CNTL_TX_EX != HREG_EV_TX_EX
+;? out dated checking
+err: someone redefined these macros while the implemenation assumes they are equal;
+#endif
+#endif // 0 get compiler going
+
+
+/* The assert in HCFLOGENTRY checks against re-entrancy. Re-entrancy could be caused by MSF logic at
+ * task-level calling hcf_functions without shielding with HCF_ACT_ON/_OFF. When an interrupt occurs,
+ * the ISR could (either directly or indirectly) cause re-entering of the interrupted HCF-routine.
+ *
+ * The "(ifbp->IFB_AssertWhere = where)" test in HCFLOGENTRY services ALSO as a statement to get around:
+ * #pragma warning: conditional expression is constant
+ * on the if-statement
+ */
+#if HCF_ASSERT
+#define HCFASSERT(x,q) {if (!(x)) {mdd_assert( ifbp, __LINE__ , q );}}
+#define MMDASSERT(x,q) {if (!(x)) {mdd_assert( assert_ifbp, __LINE__ + FILE_NAME_OFFSET, q );}}
+
+#define HCFLOGENTRY( where, what ) \
+{if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
+ HCF_ENTRY( ifbp ); \
+ HCFASSERT( (ifbp->IFB_AssertTrace & 1<<((where)&0xF)) == 0, ifbp->IFB_AssertTrace ); \
+ ifbp->IFB_AssertTrace |= 1<<((where)&0xF); \
+ } \
+HCFTRACE(ifbp, where ) \
+HCFTRACEVALUE(ifbp, what ) \
+}
+
+#define HCFLOGEXIT( where ) \
+{if ( (ifbp->IFB_AssertWhere = where) <= 15 ) { \
+ HCF_EXIT( ifbp ); \
+ ifbp->IFB_AssertTrace &= ~(1<<((where)&0xF)); \
+ } \
+HCFTRACE(ifbp, (where)|HCF_TRACE_EXIT ) \
+}
+
+#else // HCF_ASSERT
+#define HCFASSERT( x, q )
+#define MMDASSERT( x, q )
+#define HCFLOGENTRY( where, what ) {HCF_ENTRY( ifbp );}
+#define HCFLOGEXIT( where ) {HCF_EXIT( ifbp );}
+#endif // HCF_ASSERT
+
+#if HCF_INT_ON
+/* ;? HCFASSERT_INT
+ * #if (HCF_SLEEP) & HCF_DDS
+ * #define HCFASSERT_INT HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF && ifbp->IFB_IntOffCnt != 0xFFFE, \
+ * ifbp->IFB_IntOffCnt )
+ * #else
+ */
+#define HCFASSERT_INT HCFASSERT( ifbp->IFB_IntOffCnt != 0xFFFF, ifbp->IFB_IntOffCnt )
+// #endif // HCF_DDS
+#else
+#define HCFASSERT_INT
+#endif // HCF_INT_ON
+
+
+#if defined HCF_TRACE
+#define HCFTRACE(ifbp, where ) {OPW( HREG_SW_1, where );}
+//#define HCFTRACE(ifbp, where ) {HCFASSERT( DO_ASSERT, where );}
+#define HCFTRACEVALUE(ifbp, what ) {OPW( HREG_SW_2, what );}
+//#define HCFTRACEVALUE(ifbp, what ) {HCFASSERT( DO_ASSERT, what );}
+#else
+#define HCFTRACE(ifbp, where )
+#define HCFTRACEVALUE(ifbp, what )
+#endif // HCF_TRACE
+
+
+#if HCF_BIG_ENDIAN
+#define BE_PAR(x) ,x
+#else
+#define BE_PAR(x)
+#endif // HCF_BIG_ENDIAN
+
+/************************************************************************************************/
+/************************************** END OF MACROS *****************************************/
+/************************************************************************************************/
+
+/************************************************************************************************/
+/*************************************** PROTOTYPES *******************************************/
+/************************************************************************************************/
+
+#if HCF_ASSERT
+extern IFBP BASED assert_ifbp; //to make asserts easily work under MMD and DHF
+EXTERN_C void mdd_assert (IFBP ifbp, unsigned int line_number, hcf_32 q );
+#endif //HCF_ASSERT
+
+#if ! ( (HCF_IO) & HCF_IO_32BITS ) // defined 16 bits only
+#undef OUT_PORT_STRING_32
+#undef IN_PORT_STRING_32
+#endif // HCF_IO
+#endif //HCFDEFC_H
+
diff --git a/drivers/staging/wlags49_h2/man/wlags49.4 b/drivers/staging/wlags49_h2/man/wlags49.4
new file mode 100644
index 000000000000..a34588530740
--- /dev/null
+++ b/drivers/staging/wlags49_h2/man/wlags49.4
@@ -0,0 +1,734 @@
+.\" vim:tw=78:
+.\" Copyright (c) 1999-2003 Agere Systems Inc. -- http://www.agere.com
+.\" wlags49.4 7.20-abg 04/28/2004 13:30:00
+.\"
+.TH WLAGS49 4 "04/28/2004 13:30:00" "pcmcia-cs"
+.SH NAME
+wlags49 \- Agere Systems Wireless PC Card / PCI device drivers
+
+wlags49_h2_cs.o \- Hermes-II Card Services (PCMCIA/CF) driver
+.br
+wlags49_h2.o \- Hermes-II MiniPCI driver
+.br
+wlags49_h25.o \- Hermes-II.5 PCI/CardBus driver
+.br
+wlags49_h25_cs.o\- Hermes-II.5 Card Services (PCMCIA/CF) driver
+
+.SH SYNOPSIS
+.nh
+.fi
+.B insmod wlags49_[h1,h2]_[cs].o
+.br
+.RB [ Authentication=n ]
+.RB [ AuthKeyMngmtSuite=???? ]
+.RB [ BRSC2GHz=b ]\p
+.RB [ BRSC5GHz=b ]
+.RB [ Coexistence=n ]
+.RB [ Configured=???? ]\p
+.RB [ ConnectionControl=???? ]
+.RB [ CreateIBSS=s ]
+.RB [ DebugFlag=n ]\p
+.RB [ DesiredSSID=s ]
+.RB [ DownloadFirmware=n ]
+.RB [ DriverEnable=???? ]\p
+.RB [ EnableEncryption=s ]
+.RB [ Encryption=???? ]
+.RB [ ExcludeUnencrypted=s ]\p
+.RB [ IntraBSSRelay=s ]
+.RB [ IrqList=i,j,... ]
+.RB [ IrqMask=n ]\p
+.RB [ Key1=s ]
+.RB [ Key2=s ]
+.RB [ Key3=s ]
+.RB [ Key4=s ]\p
+.RB [ LoadBalancing=s ]
+.RB [ MaxSleepDuration=n ]
+.RB [ MediumDistribution=s ]\p
+.RB [ MicroWaveRobustness=s ]
+.RB [ MulticastPMBuffering=s ]
+.RB [ MulticastRate=n ]\p
+.RB [ MulticastReceive=s ]
+.RB [ NetworkAddress=n,n,n,n,n,n ]
+.RB [ NetworkType=???? ]\p
+.RB [ OwnATIMWindow=n ]
+.RB [ OwnBeaconInterval=n ]
+.RB [ OwnChannel=n ]\p
+.RB [ OwnDTIMPeriod=n ]
+.RB [ OwnName=s ]
+.RB [ OwnSSID=s ]\p
+.RB [ pc_debug=n ]
+.RB [ PMEnabled=b ]
+.RB [ PMHoldoverDuration=n ]\p
+.RB [ PortType=n ]
+.RB [ PowerMode=???? ]
+.RB [ PromiscuousMode=s ]\p
+.RB [ RejectANY=s ]
+.RB [ RTSThreshold=n ]\p
+.RB [ RTSThreshold1=n ]
+.RB [ RTSThreshold2=n ]
+.RB [ RTSThreshold3=n ]\p
+.RB [ RTSThreshold4=n ]
+.RB [ RTSThreshold5=n ]
+.RB [ RTSThreshold6=n ]\p
+.RB [ SRSC2GHz=b ]
+.RB [ SRSC5GHz=b ]
+.RB [ SystemScale=n ]\p
+.RB [ TxKey=n ]
+.RB [ TxRateControl=n ]\p
+.RB [ TxRateControl1=n ]
+.RB [ TxRateControl2=n ]
+.RB [ TxRateControl3=n ]\p
+.RB [ TxRateControl4=n ]
+.RB [ TxRateControl5=n ]
+.RB [ TxRateControl6=n ]\p
+.RB [ WDSAddress=n,n,n,n,n,n ]\p
+.RB [ WDSAddress1=n,n,n,n,n,n ]
+.RB [ WDSAddress2=n,n,n,n,n,n ]\p
+.RB [ WDSAddress3=n,n,n,n,n,n ]
+.RB [ WDSAddress4=n,n,n,n,n,n ]\p
+.RB [ WDSAddress5=n,n,n,n,n,n ]
+.RB [ WDSAddress6=n,n,n,n,n,n ]\p
+.fi
+
+
+
+.SH DESCRIPTION
+.I wlags49
+is the low-level Card Services / PCI driver for the
+.B Wireless PC Card, Wireless Integrated Card, Wireless Embedded Card
+and other wireless adapters based on the Agere Systems Hermes-II, and Hermes-II.5 wireless MAC. When this driver is attached to a card, it
+allocates the next available ethernet device (eth0..eth#). This
+device name will be passed on to
+.IR cardmgr (8),
+or the PCI subsystem, for the card configuration, and reported in the kernel log file
+with the I/O base address and MAC address used by the card.
+.SH FEATURES
+ \- Hot plug/unplug
+ \- Access Point and peer-to-peer communication
+ \- Card power management
+ \- Support for Hermes-II & Hermes-II.5 based PCMCIA, Mini PCI, and CardBus cards
+ \- Wired Equivalent Privacy (WEP)
+ \- WPA-PSK support (EXPERIMENTAL)
+ \- Driver utility interface (UIL)
+ \- Wireless Extensions
+ \- Software AP mode
+.SH PARAMETERS
+.TP
+.B Authentication=n
+Algorithm used for Authentication.
+.BR
+ 1 \- Open System
+.BR
+ 2 \- Shared Key
+.BR
+ Default: 1
+.TP
+.B Auth_key_mgmt_suite
+???????????????
+.TP
+.B BRSC2GHz=b
+Sets the card\'s Basic Rate Set in the 2.4GHz band. See SRSC2GHz
+for the value\'s format.
+.BR
+ Default: 15 (or 0x000F, only 11b rates to accept legacy 11b stations)
+.TP
+.B BRSC5GHz-b
+Sets the card\'s Basic Rate Set in the 5.0GHz band. See SRSC2GHz for the
+value\'s format
+.BR
+ Default: 4080 (or 0x0FF0, all 11a rates)
+.TP
+.B Coexistence=n
+Used to make the 802.11a/b/g coexistence behavior more strict.
+.BR
+ Default \- 0 (Use standard behavior)
+.TP
+.B ConnectionControl=n
+Configures the card\'s connection control process in dealing with multiple
+bands (802.11b/g vs. 802.11a).
+.BR
+ 0 \- Single Band operation in 2GHz
+.BR
+ 1 \- Single Band operation in 5GHz
+.BR
+ 2 \- Multiple Band operation starting with 2GHz
+.BR
+ 3 \- Multiple Band operation starting with 5GHz
+.BR
+ Default \- 2
+.TP
+.B Configured
+???????????????
+.TP
+.B ConnectionControl
+???????????????
+.TP
+.B CreateIBSS=s
+Enable or disable IBSS Creation.
+For correct operation, specification of a OwnSSID is required.
+This mode requires firmware 6.04 or higher.
+.BR
+ N \- Disable
+.BR
+ Y \- Enable
+.BR
+ Default: N
+.TP
+.B DebugFlag=n
+Selects the driver debugging level. This parameter is only available
+if the module is compiled with debugging enabled. Refer to the
+file
+.B debug.h
+in the source directory for information on the flag values.
+.BR
+ 0x00000001L \- DBG_ERROR_ON
+.BR
+ 0x00000002L \- DBG_WARNING_ON
+.BR
+ 0x00000004L \- DBG_NOTICE_ON
+.BR
+ 0x00000008L \- DBG_TRACE_ON
+.BR
+ 0x00000010L \- DBG_VERBOSE_ON
+.BR
+ 0x00000020L \- DBG_PARAM_ON
+.BR
+ 0x00000040L \- DBG_BREAK_ON
+.BR
+ 0x00000100L \- DBG_RX_ON
+.BR
+ 0x00000200L \- DBG_TX_ON
+.BR
+ 0x00000400L \- DBG_DS_ON
+.BR
+If the module is compiled with debugging enabled, DebugFlag
+defaults to DBG_ERROR_ON, DBG_WARNING_ON and DBG_BREAK_ON.
+DebugFlag overrules pc_debug.
+.TP
+.B DesiredSSID=s
+Same as OwnSSID.
+.TP
+.B DownloadFirmware=n
+This release of the driver introduces the ability to perform downloads of the STA/AP
+firmware. In fact, this is required for Hermes-II based cards. This parameter tells
+the driver which version of the firmware to download to the card.
+.BR
+ 0 \- No download performed (Hermes-I only)
+.BR
+ 1 \- Download STA firmware
+.BR
+ 2 \- Download AP firmware
+.BR
+ Default: 1, when STA mode functionality is
+ included in the build
+ 2, when code is built exclusively for
+ AP mode
+.TP
+.B DriverEnable
+???????????????
+.TP
+.B EnableEncryption=n
+Set the method of Data encryption.
+.BR
+ 0 \- Disable
+.BR
+ 1 \- Enable WEP Encryption
+.BR
+ 2 \- Enable WPA with TKIP encryption
+.BR
+ Default: 0
+.TP
+.B Encryption
+???????????????
+.TP
+.B ExcludeUnencrypted=s
+Controls how the stations must communicate with the AP.
+.BR
+ Y \- Stations must enable encryption and provide
+ the proper encryption key to communicate
+ with the AP.
+.BR
+ N \- Stations do not need to enable encryption
+ to communicate with the AP.
+.BR
+ Default: N
+.TP
+.B IntraBSSRelay=s
+Controls the automatic relay of received messages that are destined for other
+stations in the BSS.
+.BR
+ Y \- Messages are relayed to the appropriate
+ station(s).
+.BR
+ N \- Messages are passed up to the host.
+.BR
+ Default: Y
+.TP
+.B IrqList=i,j,...
+Specifies the set of interrupts (up to 4) that may be allocated by
+this driver. This overrides the values set in the
+.B IrqMask
+parameter. NOTE: This parameter is for PCMCIA only.
+.TP
+.B IrqMask=n
+Specifies a mask of valid interrupts that may be allocated by this driver.
+If
+.B IrqList
+is also specified, the values in
+.B IrqList
+are used instead. NOTE: This parameter is for PCMCIA only.
+.BR
+ Default: 0xdeb8 (IRQ 3,4,5,7,9,10,11,12,14,15)
+.TP
+.B Key1=s
+Specifies one of 4 possible keys for the Data encryption.
+One of these keys, identified by TxKey,
+is used for the enciphering of Data that is transmitted by this station.
+All keys specified can be used for the deciphering of Data that is received.
+.BR
+The key value can be an ASCII character string or a hexadecimal value.
+The length of the key value can be 5 characters or 10 hexadecimal digits for
+the standard encryption (Silver or Gold card), or 13 characters or 26
+hexadecimal digits for the encryption with extended keys (Gold card only).
+The keys defined in the station must match the keys defined in the access
+points; both on value and number (1 through 4).
+.BR
+In 2.0 series Linux kernel modules, values that begin with a number are
+considered integers. In this case a hexadecimal value string or a character
+string starting with a number, will need to be surrounded by escaped
+double quotes (ie. Key1=\\"0x1122334455\\" Key2=\\"12xyz\\").
+.BR
+ 5 or 13, printable character string, or
+.BR
+ 10 or 26 hex digits if preceded by "0x".
+.BR
+ If this parameter is omitted, the default of the MAC is used ( = 0-length).
+.TP
+.B Key2=s
+Same as Key1.
+.TP
+.B Key3=s
+Same as Key1.
+.TP
+.B Key4=s
+Same as Key1.
+.TP
+.B LoadBalancing=s
+Control for the Load Balancing algorithm for both STAs and APs. The AP
+includes a load balancing element in the Probe Response and Beacon frames.
+The STA uses this info to select an AP, not only based on comms quality, but
+also on the load of that AP.
+.BR
+ Default: Y
+.TP
+.B MaxDataLength
+???????????????
+.TP
+.B MaxSleepDuration=n
+Set the maximum Power Management sleep duration in milliseconds.
+Valid values are 0 to 65535 milliseconds.
+.BR
+ Default: 100
+.TP
+.B MediumDistribution=s
+Control for the distribution of medium parameters, like communication
+thresholds, microwave robustness, RTS/CTS thresholds, by APs. The associated
+stations replace their own values with the received values.
+.BR
+ Default=Y
+.TP
+.B MicroWaveRobustness=s
+Enable or disable Microwave Oven Robustness.
+.BR
+ N \- Disable
+.BR
+ Y \- Enable
+.BR
+ Default: N
+.TP
+.B MulticastPMBuffering=s
+Controls buffering of multicast MAC frames for transmission after DTIM. If no,
+multicast MAC frames are directly placed in the output queue.
+.BR
+ Default: Y
+.TP
+.B MulticastRate=n
+Sets the data rate for multicast message transmission.
+.BR
+ 1 \- Fixed 1Mb/s
+ 2 \- Fixed 2Mb/s
+ 3 \- Fixed 5.5Mb/s
+ 4 \- Fixed 11Mb/s
+.BR
+ Default: 2
+
+For Hermes-II.5, an INTEGER CONVERTED bit mask representing the
+rate to multicast, where the rates supported are as follows:
+
+Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
+.br
+------------------------------------------------------
+.br
+Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
+
+ Default: 4 (Translates to 0x0004 = 5.5 Mb/sec)
+
+.TP
+.B MulticastReceive=s
+Enable or disable receiving of all multicast packets when Card Power Management
+is enabled. When enabled, the station will wake up frequently
+to receive the multicast frames. This causes less optimal power savings.
+.BR
+ N \- Disable
+.BR
+ Y \- Enable
+.BR
+ Default: Y
+.TP
+.B NetworkAddress=n,n,n,n,n,n
+Sets the adapter hardware ethernet address (MAC address) to the value
+specified. Note that this is to be used to specify a Local MAC address. Do
+not specify this parameter if the card\'s universal address is to be used.
+Valid values are six hexadecimal digit-pairs (prefixed with 0x).
+.BR
+ Default: <factory assigned address>
+.TP
+.B NetworkType
+???????????????
+.TP
+.B OwnATIMWindow=n
+ATIM window time used for creating an IBSS.
+.BR
+ Range: 0..100
+.BR
+ Default: 0
+.TP
+.B OwnBeaconInterval=b
+Beacon Interval in TU
+.BR
+ Range 20..200
+.BR
+ Default \- 100
+.TP
+.B channel=n
+Same as OwnChannel.
+.TP
+.B OwnChannel=n
+Sets the channel the Ad-Hoc or IBSS mode will use.
+The default channel for Ad-Hoc mode is determined by the Wireless PC Card.
+The default channel for IBSS is set to 10 by the driver.
+This value has no effect when the adapter is used with an Access Point
+(BSS network) since the Access Point automatically determines the channel.
+Valid values are 0 to 14. However the channels allowed in
+your region are subject to local regulations and are limited at
+manufacturing time of the Wireless PC Card. When the provided value is
+not allowed, the value remains unchanged.
+.BR
+ 0 \- Use default channel
+.BR
+ Default: 0
+.TP
+.B OwnDTIMPeriod=n
+The number of beacon intervals between successive Delivery Traffic Identification
+Maps (DTIMs).
+.BR
+ Range: 1..65535
+.BR
+ Default: 1
+.TP
+.B OwnName=s
+Sets the station name to the specified string value. This parameter
+is used for diagnostic purposes, as a user\-friendly identification
+of this system. This parameter accepts a maximum of 32 characters.
+.BR
+ Default: Linux
+.TP
+.B OwnSSID=s
+Sets the card network name to the specified string value. This parameter
+accepts a maximum of 32 characters. Whitespace in the network name
+will need to be escaped with a backslash (ie. OwnSSID=My\\ Network).
+.BR
+ Default: ANY
+.TP
+.B pc_debug=n
+Selects the PCMCIA debugging level. This parameter is only available
+if the module is compiled with debugging enabled. A non\-zero value
+enables debugging. Higher values yield more information, i.e. for any value all
+lower values are implied.
+.BR
+ 8 \- DBG_DS_ON
+.BR
+ 7 \- DBG_RX_ON | DBG_TX_ON
+.BR
+ 6 \- DBG_PARAM_ON
+.BR
+ 5 \- DBG_TRACE_ON
+.BR
+ 4 \- DBG_VERBOSE_ON
+.BR
+If the module is compiled with debugging enabled, pc_debug defaults to 5.
+DebugFlag overrules pc_debug.
+.BR
+The name pc_debug rather than PcDebug, since pc_debug is used by many PCMCIA driver.
+.TP
+.B PMEnabled=b
+Sets the card\'s Power Management state.
+.BR
+ 0 \- Disable
+.BR
+ 1 \- Enable Enhanced Mode
+.BR
+ 2 \- Enabled Standard Mode
+.BR
+ 0x8000 \- Enhanced?????? Mode (to be combined with 0x0001 or 0x0002)
+
+ Default: 0 (Disabled)
+.TP
+.B PMHoldoverDuration=n
+Time that the station remains in an awake state after a MAC frame transfer if
+Enhanced Power Save is active.
+.BR
+ Range: 1..1000
+.BR
+ Default: 100
+.TP
+.B PowerMode
+???????????????
+.TP
+.B PortType=n
+Selects the type of network operation.
+.BR
+ 1 \- Normal Operation (BSS or IBSS)
+.BR
+ 3 \- Ad-Hoc Demo Mode
+.BR
+ Default: 1
+.TP
+.B PromiscuousMode=s
+Switch for promiscuous mode reception.
+.BR
+ Default: N
+.TP
+.B RejectANY=s
+Controls how stations associate to the device.
+.BR
+ Y \- Stations must provide the correct SSID to
+ associate to the AP.
+.BR
+ N \- Stations are not required to provide the
+ correct SSID to associate to the AP.
+ Known as an \'open\' network.
+.BR
+ Default - N
+.TP
+.B RTSThreshold=n
+Controls the RTS/CTS handshake threshold for transmissions in Station mode.
+Valid values are 0 to 2347.
+.BR
+ 500 \- Hidden Stations
+.BR
+ 2347 \- No RTS/CTS
+.BR
+ Default: 2347
+.TP
+.B RTSThreshold1=n
+Same as RTSThreshold, only for port 1 of in AccessPoint mode.
+.TP
+.B RTSThreshold2=n
+Same as RTSThreshold1, only for port 2.
+.TP
+.B RTSThreshold3=n
+Same as RTSThreshold1, only for port 3.
+.TP
+.B RTSThreshold4=n
+Same as RTSThreshold1, only for port 4.
+.TP
+.B RTSThreshold5=n
+Same as RTSThreshold1, only for port 5.
+.TP
+.B RTSThreshold6=n
+Same as RTSThreshold1, only for port 6.
+.TP
+.B SRSC2GHz=b
+Sets the card\'s Supported Rate Set in the 2.4GHz band. The value
+is an INTEGER CONVERTED bit mask representing the rates to support,
+where the rates supported are as follows:
+
+Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
+.br
+------------------------------------------------------
+.br
+Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
+.BR
+ Default: 4095 (or 0x0FFF, all 11b and 11g rates)
+.TP
+.B SRSC5GHz=b
+Sets the card\'s Supported Rate Set in the 5.0GHz band. See SRSC2GHz
+for the value\'s format.
+.BR
+ Default: 4080 (or 0x0FF0, all 11a rates)
+.TP
+.B SystemScale=n
+Sets the distance between Access Points in the network. This value
+influences the Modem Thresholds (EnergyDetectThreshold,
+CarrierDetectThreshold and DeferThreshold) and
+the Roaming Thresholds (CellSearchThreshold and OutOfRangeThreshold).
+.BR
+ 1 \- Large
+.BR
+ 2 \- Medium
+.BR
+ 3 \- Small
+.BR
+ Default: 1
+.TP
+.B TxRateControl=n
+Sets the data rate to be used by the transmitter. For Hermes-II:
+.BR
+ 1 \- Fixed Low (1 Mb/sec)
+.BR
+ 2 \- Fixed Standard (2 Mb/sec)
+.BR
+ 3 \- Auto Rate Select High (11, 5.5, 2, 1 Mb/sec)
+.BR
+ 4 \- Fixed Medium (5.5 Mb/sec)
+.BR
+ 5 \- Fixed High (11 Mb/sec)
+.BR
+ 6 \- Auto Rate Select Standard (2, 1 Mb/sec)
+.BR
+ 7 \- Auto Rate Select Medium (5.5, 2, 1 Mb/sec)
+.BR
+ Default: 3
+
+For Hermes-II.5, an INTEGER CONVERTED bit mask representing all of the
+rates to support, where the rates supported are as follows:
+
+Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
+.br
+------------------------------------------------------
+.br
+Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
+.BR
+ Default: 4095 (Translates to 0xFFF, which is all rates)
+.TP
+.B RTSThreshold=n
+Sets the number of octets in a message or fragment above which a
+RTS/CTS handshake is performed.
+Valid values are 0 to 2347.
+.BR
+ 500 \- Hidden Stations
+.BR
+ 2347 \- No RTS/CTS
+.BR
+ Default: 2347
+.TP
+.B TxKey=n
+Designates which of the keys is to be used for the enciphering of data that is
+transmitted by this station.
+.BR
+ Integer in the range 1..4.
+.BR
+ Default: 1
+.TP
+.B TxPowLevel
+???????????????
+.TP
+.B TxRateControl=n
+Sets the data rate to be used by the transmitter in Station mode.
+.BR
+ 1 \- Fixed Low
+.BR
+ 2 \- Fixed Standard
+.BR
+ 3 \- Auto Rate Select (High)
+.BR
+ 4 \- Fixed Medium
+.BR
+ 5 \- Fixed High
+.BR
+ 6 \- Auto Rate Select (Standard)
+.BR
+ 7 \- Auto Rate Select (Medium)
+.BR
+ Default: 3
+
+For Hermes-II.5, an INTEGER CONVERTED bit mask representing all of the
+rates to support, where the rates supported are as follows:
+
+Bit : 15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00
+.br
+------------------------------------------------------
+.br
+Rate : XX|XX|XX|XX|54|48|36|24|18|12| 9| 6|11|5.5|2| 1
+.BR
+ Default: 4095 (Translates to 0xFFF, which is all rates)
+
+.TP
+.B TxRateControl1=n
+Same as TxRateControl, only for port 1 in AccessPoint mode.
+.TP
+.B TxRateControl2=n
+Same as TxRateControl1, only for port 2.
+.TP
+.B TxRateControl3=n
+Same as TxRateControl1, only for port 3.
+.TP
+.B TxRateControl4=n
+Same as TxRateControl1, only for port 4.
+.TP
+.B TxRateControl5=n
+Same as TxRateControl1, only for port 5.
+.TP
+.B TxRateControl6=n
+Same as TxRateControl1, only for port 6.
+.TP
+.B VendorDescription
+???????????????
+.TP
+.B WDSAddress=n,n,n,n,n,n
+MAC address that identifies the corresponding node of the WDS port in Station mode.
+Note that for WDS to work properly, a bridge interface must be setup between the device and
+the wds network devices created by the driver. For more information on bridge
+interfaces, please refer to the man page for \'brctl\'.
+.BR
+ Default: 00:00:00:00:00:00
+.TP
+.B WDSAddress1=n,n,n,n,n,n
+Same as WDSAddress, only for port 1 in AccessPoint mode.
+.TP
+.B WDSAddress2=n,n,n,n,n,n
+Same as WDSAddress1, only for port 2.
+.TP
+.B WDSAddress3=n,n,n,n,n,n
+Same as WDSAddress1, only for port 3.
+.TP
+.B WDSAddress4=n,n,n,n,n,n
+Same as WDSAddress1, only for port 4.
+.TP
+.B WDSAddress5=n,n,n,n,n,n
+Same as WDSAddress1, only for port 5.
+.TP
+.B WDSAddress6=n,n,n,n,n,n
+Same as WDSAddress1, only for port 6.
+.SH SECURITY
+On a multi-user system only the system administrator needs access to the WEP
+encryption keys. In this case, consider removing the read permission for
+normal users of the PCMCIA config.opts file, the system log file, and any
+Agere proprietary iwconfig-eth<n> scripts.
+.SH CONTACT
+If you encounter problems when installing or using this product, or would like
+information about our other "Wireless" products, please contact your local
+Authorized "Wireless" Reseller or Agere Systems sales office.
+
+Addresses and telephone numbers of the Agere Systems sales offices are
+listed on our Agere Systems web site.
+.TP
+.B WWW
+http://www.agere.com
+.SH SEE ALSO
+.BR cardmgr (8),
+.BR pcmcia (5),
+.BR ifconfig (8),
+.BR insmod (8),
+.BR brctl (8).
diff --git a/drivers/staging/wlags49_h2/mdd.h b/drivers/staging/wlags49_h2/mdd.h
new file mode 100644
index 000000000000..b45c7ddd92e2
--- /dev/null
+++ b/drivers/staging/wlags49_h2/mdd.h
@@ -0,0 +1,1156 @@
+
+// vim:tw=110:ts=4:
+#ifndef MDD_H
+#define MDD_H 1
+
+/*************************************************************************************************************
+*
+* FILE : mdd.h
+*
+* DATE : $Date: 2004/08/05 11:47:10 $ $Revision: 1.6 $
+* Original : 2004/05/25 05:59:37 Revision: 1.57 Tag: hcf7_t20040602_01
+* Original : 2004/05/13 15:31:45 Revision: 1.54 Tag: hcf7_t7_20040513_01
+* Original : 2004/04/15 09:24:41 Revision: 1.47 Tag: hcf7_t7_20040415_01
+* Original : 2004/04/13 14:22:45 Revision: 1.46 Tag: t7_20040413_01
+* Original : 2004/04/01 15:32:55 Revision: 1.42 Tag: t7_20040401_01
+* Original : 2004/03/10 15:39:28 Revision: 1.38 Tag: t20040310_01
+* Original : 2004/03/04 11:03:37 Revision: 1.36 Tag: t20040304_01
+* Original : 2004/03/02 09:27:11 Revision: 1.34 Tag: t20040302_03
+* Original : 2004/02/24 13:00:27 Revision: 1.29 Tag: t20040224_01
+* Original : 2004/02/18 17:13:57 Revision: 1.26 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* DESC : Definitions and Prototypes for HCF, DHF, MMD and MSF
+*
+***************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 1994 - 1995 by AT&T. All Rights Reserved
+* COPYRIGHT © 1996 - 2000 by Lucent Technologies. All Rights Reserved
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+************************************************************************************************************/
+
+
+/************************************************************************************************************
+*
+* The macros Xn(...) and XXn(...) are used to define the LTV's (short for Length Type Value[ ]) ,
+* aka RIDs, processed by the Hermes.
+* The n in Xn and XXn reflects the number of "Value" fields in these RIDs.
+*
+* Xn(...) : Macros used for RIDs which use only type hcf_16 for the "V" fields of the LTV.
+* Xn takes as parameters a RID name and "n" name(s), one for each of the "V" fields of the LTV.
+*
+* XXn(...) : Macros used for RIDs which use at least one other type then hcf_16 for a "V" field
+* of the LTV.
+* XXn(..) takes as parameters a RID name and "n" pair(s) of type and name, one for each "V" field
+* of the LTV
+
+ ****************************************** e x a m p l e s ***********************************************
+
+* X1(RID_NAME, parameters...) : expands to :
+* typedef struct RID_NAME_STRCT {
+* hcf_16 len;
+* hcf_16 typ;
+* hcf_16 par1;
+* } RID_NAME_STRCT;
+
+* X2(RID_NAME, parameters...) : expands to :
+* typedef struct RID_NAME_STRCT {
+* hcf_16 len;
+* hcf_16 typ;
+* hcf_16 par1;
+* hcf_16 par2;
+* } RID_NAME_STRCT;
+
+
+* XX1(RID_NAME, par1type, par1name, ...) : expands to :
+* typedef struct RID_NAME_STRCT {
+* hcf_16 len;
+* hcf_16 typ;
+* par1type par1name;
+* } RID_NAME_STRCT;
+
+************************************************************************************************************/
+
+/******************************* XX Sub-macro definitions **************************************************/
+
+#define XX1( name, type1, par1 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ type1 par1; \
+} name##_STRCT;
+
+#define XX2( name, type1, par1, type2, par2 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ type1 par1; \
+ type2 par2; \
+} name##_STRCT;
+
+#define XX3( name, type1, par1, type2, par2, type3, par3 ) \
+typedef struct name##_STRCT { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ type1 par1; \
+ type2 par2; \
+ type3 par3; \
+} name##_STRCT;
+
+#define XX4( name, type1, par1, type2, par2, type3, par3, type4, par4 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ type1 par1; \
+ type2 par2; \
+ type3 par3; \
+ type4 par4; \
+} name##_STRCT;
+
+#define X1( name, par1 ) \
+typedef struct name##_STRCT { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+} name##_STRCT;
+
+#define X2( name, par1, par2 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+} name##_STRCT;
+
+#define X3( name, par1, par2, par3 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+} name##_STRCT;
+
+#define X4( name, par1, par2, par3, par4 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+ hcf_16 par4; \
+} name##_STRCT;
+
+#define X5( name, par1, par2, par3, par4, par5 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+ hcf_16 par4; \
+ hcf_16 par5; \
+} name##_STRCT;
+
+#define X6( name, par1, par2, par3, par4, par5, par6 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+ hcf_16 par4; \
+ hcf_16 par5; \
+ hcf_16 par6; \
+} name##_STRCT;
+
+#define X8( name, par1, par2, par3, par4, par5, par6, par7, par8 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+ hcf_16 par4; \
+ hcf_16 par5; \
+ hcf_16 par6; \
+ hcf_16 par7; \
+ hcf_16 par8; \
+} name##_STRCT;
+
+#define X11( name, par1, par2, par3, par4, par5, par6, par7, par8, par9, par10, par11 ) \
+typedef struct { \
+ hcf_16 len; \
+ hcf_16 typ; \
+ hcf_16 par1; \
+ hcf_16 par2; \
+ hcf_16 par3; \
+ hcf_16 par4; \
+ hcf_16 par5; \
+ hcf_16 par6; \
+ hcf_16 par7; \
+ hcf_16 par8; \
+ hcf_16 par9; \
+ hcf_16 par10; \
+ hcf_16 par11; \
+} name##_STRCT;
+
+/******************************* Substructure definitions **************************************************/
+
+//apparently not needed (CFG_CNF_COUNTRY)
+typedef struct CHANNEL_SET { //channel set structure used in the CFG_CNF_COUNTRY LTV
+ hcf_16 first_channel;
+ hcf_16 number_of_channels;
+ hcf_16 max_tx_output_level;
+} CHANNEL_SET;
+
+typedef struct KEY_STRCT { // key structure used in the CFG_DEFAULT_KEYS LTV
+ hcf_16 len; //length of key
+ hcf_8 key[14]; //encryption key
+} KEY_STRCT;
+
+typedef struct SCAN_RS_STRCT { // Scan Result structure used in the CFG_SCAN LTV
+ hcf_16 channel_id;
+ hcf_16 noise_level;
+ hcf_16 signal_level;
+ hcf_8 bssid[6];
+ hcf_16 beacon_interval_time;
+ hcf_16 capability;
+ hcf_16 ssid_len;
+ hcf_8 ssid_val[32];
+} SCAN_RS_STRCT;
+
+typedef struct CFG_RANGE_SPEC_STRCT { // range specification structure used in CFG_RANGES, CFG_RANGE1 etc
+ hcf_16 variant;
+ hcf_16 bottom;
+ hcf_16 top;
+} CFG_RANGE_SPEC_STRCT;
+
+typedef struct CFG_RANGE_SPEC_BYTE_STRCT { // byte oriented range specification structure used in CFG_RANGE_B LTV
+ hcf_8 variant[2];
+ hcf_8 bottom[2];
+ hcf_8 top[2];
+} CFG_RANGE_SPEC_BYTE_STRCT;
+
+//used to set up "T" functionality for Info frames, i.e. log info frames in MSF supplied buffer and MailBox
+XX1( RID_LOG, unsigned short FAR*, bufp )
+typedef RID_LOG_STRCT FAR *RID_LOGP;
+XX1( CFG_RID_LOG, RID_LOGP, recordp )
+
+ X1( LTV, val[1] ) /*minimum LTV proto typ */
+ X1( LTV_MAX, val[HCF_MAX_LTV] ) /*maximum LTV proto typ */
+XX2( CFG_REG_MB, hcf_16* , mb_addr, hcf_16, mb_size )
+
+typedef struct CFG_MB_INFO_FRAG { // specification of buffer fragment
+ unsigned short FAR* frag_addr;
+ hcf_16 frag_len;
+} CFG_MB_INFO_FRAG;
+
+/* Mail Box Info Block structures,
+ * the base form: CFG_MB_INFO_STRCT
+ * and the derived forms: CFG_MB_INFO_RANGE<n>_STRCT with n is 1, 2, 3 or 20
+ * predefined for a payload of 1, and up to 2, 3 and 20 CFG_MB_INFO_FRAG elements */
+XX3( CFG_MB_INFO, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
+XX3( CFG_MB_INFO_RANGE1, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 1] )
+XX3( CFG_MB_INFO_RANGE2, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 2] )
+XX3( CFG_MB_INFO_RANGE3, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[ 3] )
+XX3( CFG_MB_INFO_RANGE20, hcf_16, base_typ, hcf_16, frag_cnt, CFG_MB_INFO_FRAG, frag_buf[20] )
+
+XX3( CFG_MB_ASSERT, hcf_16, line, hcf_16, trace, hcf_32, qualifier ) /*MBInfoBlock for asserts */
+#if (HCF_ASSERT) & ( HCF_ASSERT_LNK_MSF_RTN | HCF_ASSERT_RT_MSF_RTN )
+typedef void (MSF_ASSERT_RTN)( unsigned int , hcf_16, hcf_32 );
+typedef MSF_ASSERT_RTN /*can't link FAR*/ * MSF_ASSERT_RTNP;
+/* CFG_REG_ASSERT_RTNP (0x0832) (de-)register MSF Callback routines
+ * lvl: Assert level filtering (not yet implemented)
+ * rtnp: address of MSF_ASSERT_RTN (native Endian format) */
+XX2( CFG_REG_ASSERT_RTNP, hcf_16, lvl, MSF_ASSERT_RTNP, rtnp )
+#endif // HCF_ASSERT_LNK_MSF_RTN / HCF_ASSERT_RT_MSF_RTN
+
+ X1( CFG_HCF_OPT, val[20] ) /*(Compile time) options */
+ X3( CFG_CMD_HCF, cmd, mode, add_info ) /*HCF Engineering command */
+
+typedef struct {
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_16 mode; // PROG_STOP/VOLATILE [FLASH/SEEPROM/SEEPROM_READBACK]
+ hcf_16 segment_size; // size of the segment in bytes
+ hcf_32 nic_addr; // destination address (in NIC memory)
+ hcf_16 flags; // 0x0001 : CRC Yes/No
+// hcf_32 flags; // 0x0001 : CRC Yes/No
+ /* ;? still not the whole story
+ * flags is extended from 16 to 32 bits to force that compiling FW.C produces the same structures
+ * in memory as FUPU4 BIN files.
+ * Note that the problem arises from the violation of the constraint to use packing at byte boundaries
+ * as was stipulated in the WCI-specification
+ * The Pack pragma can't resolve this issue, because that impacts all members of the structure with
+ * disregard of their actual size, so aligning host_addr under MSVC 1.5 at 4 bytes, also aligns
+ * len, typ etc on 4 bytes
+ * */
+// hcf_16 pad; //!! be careful alignment problems for Bin download versus C download
+ hcf_8 FAR *host_addr; // source address (in Host memory)
+} CFG_PROG_STRCT; // segment_descp;
+
+// a structure used for transporting debug-related information from firmware
+// via the HCF, into the MSF
+typedef struct {
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_16 msg_id, msg_par, msg_tstamp;
+} CFG_FW_PRINTF_STRCT;
+
+// a structure used to define the location and size of a certain debug-related
+// buffer in nic-ram.
+typedef struct {
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_32 DbMsgCount, // ds (nicram) address of a counter
+ DbMsgBuffer, // ds (nicram) address of the buffer
+ DbMsgSize, // number of entries (each 3 word in size) in this buffer
+ DbMsgIntrvl; // ds (nicram) address of interval for generating InfDrop event
+} CFG_FW_PRINTF_BUFFER_LOCATION_STRCT;
+
+XX3( CFG_RANGES, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
+XX3( CFG_RANGE1, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 1] ) /*Actor/Supplier range (1 variant)*/
+XX3( CFG_RANGE2, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 2] ) /*Actor range ( 2 variants) */
+XX3( CFG_RANGE3, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 3] ) /*Actor range ( 3 variants) */
+XX3( CFG_RANGE4, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 4] ) /*Actor range ( 4 variants) */
+XX3( CFG_RANGE5, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 5] ) /*Actor range ( 5 variants) */
+XX3( CFG_RANGE6, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 6] ) /*Actor range ( 6 variants) */
+XX3( CFG_RANGE7, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[ 7] ) /*Actor range ( 7 variants) */
+XX3( CFG_RANGE20, hcf_16, role, hcf_16, id, CFG_RANGE_SPEC_STRCT, var_rec[20] ) /*Actor range (20 variants) */
+
+/*Frames */
+ X3( CFG_ASSOC_STAT, assoc_stat, station_addr[3], val[46] ) /*Association status, basic */
+ X2( CFG_ASSOC_STAT3, assoc_stat, station_addr[3] ) /*assoc_stat:3 */
+ X3( CFG_ASSOC_STAT1, assoc_stat, station_addr[3], frame_body[43] ) /*assoc_stat:1 */
+ X4( CFG_ASSOC_STAT2, assoc_stat, station_addr[3], old_ap_addr[3], frame_body[43] ) /*assoc_stat:2 */
+
+/*Static Configurations */
+ X1( CFG_CNF_PORT_TYPE, port_type ) /*[STA] Connection control characteristics */
+ X1( CFG_MAC_ADDR, mac_addr[3] ) /*general: FC01,FC08,FC11,FC12,FC13,FC14,FC15,FC16 */
+ X1( CFG_CNF_OWN_MAC_ADDR, mac_addr[3] )
+ X1( CFG_ID, ssid[17] ) /*0xFC02, 0xFC04, 0xFC0E */
+/* X1( CFG_DESIRED_SSID, ssid[17] ) see Dynamic Configurations */
+ X1( CFG_CNF_OWN_CHANNEL, channel ) /*Communication channel for BSS creation */
+ X1( CFG_CNF_OWN_SSID, ssid[17] )
+ X1( CFG_CNF_OWN_ATIM_WINDOW, atim_window )
+ X1( CFG_CNF_SYSTEM_SCALE, system_scale )
+ X1( CFG_CNF_MAX_DATA_LEN, max_data_len )
+ X1( CFG_CNF_WDS_ADDR, mac_addr[3] ) /*[STA] MAC Address of corresponding WDS Link node */
+ X1( CFG_CNF_PM_ENABLED, pm_enabled ) /*[STA] Switch for ESS Power Management (PM) On/Off */
+ X1( CFG_CNF_PM_EPS, pm_eps ) /*[STA] Switch for ESS PM EPS/PS Mode */
+ X1( CFG_CNF_MCAST_RX, mcast_rx ) /*[STA] Switch for ESS PM Multicast reception On/Off */
+ X1( CFG_CNF_MAX_SLEEP_DURATION, duration ) /*[STA] Maximum sleep time for ESS PM */
+ X1( CFG_CNF_PM_HOLDOVER_DURATION, duration ) /*[STA] Holdover time for ESS PM */
+ X1( CFG_CNF_OWN_NAME, ssid[17] ) /*Identification text for diagnostic purposes */
+ X1( CFG_CNF_OWN_DTIM_PERIOD, period ) /*[AP] Beacon intervals between successive DTIMs */
+ X1( CFG_CNF_WDS_ADDR1, mac_addr[3] ) /*[AP] Port 1 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_WDS_ADDR2, mac_addr[3] ) /*[AP] Port 2 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_WDS_ADDR3, mac_addr[3] ) /*[AP] Port 3 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_WDS_ADDR4, mac_addr[3] ) /*[AP] Port 4 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_WDS_ADDR5, mac_addr[3] ) /*[AP] Port 5 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_WDS_ADDR6, mac_addr[3] ) /*[AP] Port 6 MAC Adrs of corresponding WDS Link node */
+ X1( CFG_CNF_MCAST_PM_BUF, mcast_pm_buf ) /*[AP] Switch for PM buffering of Multicast Messages */
+ X1( CFG_CNF_REJECT_ANY, reject_any ) /*[AP] Switch for PM buffering of Multicast Messages */
+//X1( CFG_CNF_ENCRYPTION_ENABLED, encryption ) /*specify encryption type of Tx/Rx messages */
+ X1( CFG_CNF_ENCRYPTION, encryption ) /*specify encryption type of Tx/Rx messages */
+ X1( CFG_CNF_AUTHENTICATION, authentication ) /*selects Authentication algorithm */
+ X1( CFG_CNF_EXCL_UNENCRYPTED, exclude_unencrypted ) /*[AP] Switch for 'clear-text' rx message acceptance */
+ X1( CFG_CNF_MCAST_RATE, mcast_rate ) /*Transmit Data rate for Multicast frames */
+ X1( CFG_CNF_INTRA_BSS_RELAY, intra_bss_relay ) /*[AP] Switch for IntraBBS relay */
+ X1( CFG_CNF_MICRO_WAVE, micro_wave ) /*MicroWave (Robustness) */
+ X1( CFG_CNF_LOAD_BALANCING, load_balancing ) /*Load Balancing (Boolean, 0=OFF, 1=ON, default=1) */
+ X1( CFG_CNF_MEDIUM_DISTRIBUTION, medium_distribution ) /*Medium Distribution (Boolean, 0=OFF, 1=ON, default=1) */
+ X1( CFG_CNF_GROUP_ADDR_FILTER, group_addr_filter ) /*Group Address Filter */
+ X1( CFG_CNF_TX_POW_LVL, tx_pow_lvl ) /*Tx Power Level */
+XX4( CFG_CNF_COUNTRY_INFO, \
+ hcf_16, n_channel_sets, hcf_16, country_code[2], \
+ hcf_16, environment, CHANNEL_SET, channel_set[1] ) /*Current Country Info */
+XX4( CFG_CNF_COUNTRY_INFO_MAX, \
+ hcf_16, n_channel_sets, hcf_16, country_code[2], \
+ hcf_16, environment, CHANNEL_SET, channel_set[14]) /*Current Country Info */
+
+/*Dynamic Configurations */
+ X1( CFG_DESIRED_SSID, ssid[17] ) /*[STA] Service Set identification for connection */
+#define GROUP_ADDR_SIZE (32 * 6) //32 6-byte MAC-addresses
+ X1( CFG_GROUP_ADDR, mac_addr[GROUP_ADDR_SIZE/2] ) /*[STA] Multicast MAC Addresses for Rx-message */
+ X1( CFG_CREATE_IBSS, create_ibss ) /*[STA] Switch for IBSS creation On/Off */
+ X1( CFG_RTS_THRH, rts_thrh ) /*[STA] Frame length used for RTS/CTS handshake */
+ X1( CFG_TX_RATE_CNTL, tx_rate_cntl ) /*[STA] Data rate control for message transmission */
+ X1( CFG_PROMISCUOUS_MODE, promiscuous_mode ) /*[STA] Switch for Promiscuous mode reception On/Of */
+ X1( CFG_WOL, wake_on_lan ) /*[STA] Switch for Wake-On-LAN mode */
+ X1( CFG_RTS_THRH0, rts_thrh ) /*[AP] Port 0 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH1, rts_thrh ) /*[AP] Port 1 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH2, rts_thrh ) /*[AP] Port 2 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH3, rts_thrh ) /*[AP] Port 3 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH4, rts_thrh ) /*[AP] Port 4 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH5, rts_thrh ) /*[AP] Port 5 frame length for RTS/CTS handshake */
+ X1( CFG_RTS_THRH6, rts_thrh ) /*[AP] Port 6 frame length for RTS/CTS handshake */
+ X1( CFG_TX_RATE_CNTL0, rate_cntl ) /*[AP] Port 0 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL1, rate_cntl ) /*[AP] Port 1 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL2, rate_cntl ) /*[AP] Port 2 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL3, rate_cntl ) /*[AP] Port 3 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL4, rate_cntl ) /*[AP] Port 4 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL5, rate_cntl ) /*[AP] Port 5 data rate control for transmission */
+ X1( CFG_TX_RATE_CNTL6, rate_cntl ) /*[AP] Port 6 data rate control for transmission */
+XX1( CFG_DEFAULT_KEYS, KEY_STRCT, key[4] ) /*defines set of encryption keys */
+ X1( CFG_TX_KEY_ID, tx_key_id ) /*select key for encryption of Tx messages */
+ X1( CFG_SCAN_SSID, ssid[17] ) /*identification for connection */
+ X5( CFG_ADD_TKIP_DEFAULT_KEY, \
+ tkip_key_id_info, tkip_key_iv_info[4], tkip_key[8], \
+ tx_mic_key[4], rx_mic_key[4] ) /* */
+ X6( CFG_ADD_TKIP_MAPPED_KEY, bssid[3], tkip_key[8], \
+ tsc[4], rsc[4], tx_mic_key[4], rx_mic_key[4] ) /* */
+ X1( CFG_SET_SSN_AUTHENTICATION_SUITE, \
+ ssn_authentication_suite ) /* */
+ X1( CFG_REMOVE_TKIP_DEFAULT_KEY,tkip_key_id ) /* */
+ X1( CFG_TICK_TIME, tick_time ) /*Auxiliary Timer tick interval */
+ X1( CFG_DDS_TICK_TIME, tick_time ) /*Disconnected DeepSleep Timer tick interval */
+
+/**********************************************************************
+* Added for Pattern-matching WakeOnLan. (See firmware design note WMDN281C)
+**********************************************************************/
+#define WOL_PATTERNS 5 // maximum of 5 patterns in firmware
+#define WOL_PATTERN_LEN 124 // maximum 124 bytes pattern length per pattern in firmware
+#define WOL_MASK_LEN 30 // maximum 30 bytes mask length per pattern in firmware
+#define WOL_BUF_SIZE (WOL_PATTERNS * (WOL_PATTERN_LEN + WOL_MASK_LEN + 6) / 2)
+X2( CFG_WOL_PATTERNS, nPatterns, buffer[WOL_BUF_SIZE] ) /*[STA] WakeOnLan pattern match, room for 5 patterns*/
+
+ X5( CFG_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
+/* NIC Information */
+ X4( CFG_IDENTITY, comp_id, variant, version_major, version_minor ) /*identification Prototype */
+#define CFG_DRV_IDENTITY_STRCT CFG_IDENTITY_STRCT
+#define CFG_PRI_IDENTITY_STRCT CFG_IDENTITY_STRCT
+#define CFG_NIC_IDENTITY_STRCT CFG_IDENTITY_STRCT
+#define CFG_FW_IDENTITY_STRCT CFG_IDENTITY_STRCT
+ X1( CFG_RID_INF_MIN, y ) /*lowest value representing an Information RID */
+ X1( CFG_MAX_LOAD_TIME, max_load_time ) /*[PRI] Max response time of the Download command */
+ X3( CFG_DL_BUF, buf_page, buf_offset, buf_len ) /*[PRI] Download buffer location and size */
+// X5( CFG_PRI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Primary Supplier compatibility range */
+ X5( CFG_CFI_ACT_RANGES_PRI,role, id, variant, bottom, top ) /*[PRI] Controller Actor compatibility ranges */
+// X5( CFG_NIC_HSI_SUP_RANGE, role, id, variant, bottom, top ) /*H/W - S/W I/F supplier range */
+ X1( CFG_NIC_SERIAL_NUMBER, serial_number[17] ) /*[PRI] Network I/F Card serial number */
+ X5( CFG_NIC_MFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Modem I/F Supplier compatibility range */
+ X5( CFG_NIC_CFI_SUP_RANGE, role, id, variant, bottom, top ) /*[PRI] Controller I/F Supplier compatibility range*/
+//H-I X1( CFG_CHANNEL_LIST, channel_list ) /*Allowed communication channels */
+//H-I XX2( CFG_REG_DOMAINS, hcf_16, num_domain, hcf_8, reg_domains[10] ) /*List of intended regulatory domains */
+ X1( CFG_NIC_TEMP_TYPE, temp_type ) /*Hardware temperature range code */
+//H-I X1( CFG_CIS, cis[240] ) /*PC Card Standard Card Information Structure */
+ X5( CFG_NIC_PROFILE, \
+ profile_code, capability_options, allowed_data_rates, val4, val5 ) /*Card Profile */
+// X5( CFG_FW_SUP_RANGE, role, id, variant, bottom, top ) /*[STA] Station I/F Supplier compatibility range */
+ X5( CFG_MFI_ACT_RANGES, role, id, variant, bottom, top ) /*[STA] Modem I/F Actor compatibility ranges */
+ X5( CFG_CFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
+ X5( CFG_MFI_ACT_RANGES_STA,role, id, variant, bottom, top ) /*[STA] Controller I/F Actor compatibility ranges */
+ X1( CFG_NIC_BUS_TYPE, nic_bus_type ) /*NIC bustype derived from BUSSEL host I/F signals */
+
+/* MAC INFORMATION */
+ X1( CFG_PORT_STAT, port_stat ) /*[STA] Actual MAC Port connection control status */
+ X1( CFG_CUR_SSID, ssid[17] ) /*[STA] Identification of the actually connected SS */
+ X1( CFG_CUR_BSSID, mac_addr[3] ) /*[STA] Identification of the actually connected BSS */
+ X3( CFG_COMMS_QUALITY, coms_qual, signal_lvl, noise_lvl ) /*[STA] Quality of the Basic Service Set connection */
+ X1( CFG_CUR_TX_RATE, rate ) /*[STA] Actual transmit data rate */
+ X1( CFG_CUR_BEACON_INTERVAL, interval ) /*Beacon transmit interval time for BSS creation */
+#if (HCF_TYPE) & HCF_TYPE_WARP
+ X11( CFG_CUR_SCALE_THRH, \
+ carrier_detect_thrh_cck, carrier_detect_thrh_ofdm, defer_thrh, \
+ energy_detect_thrh, rssi_on_thrh_deviation, \
+ rssi_off_thrh_deviation, cck_drop_thrh, ofdm_drop_thrh, \
+ cell_search_thrh, out_of_range_thrh, delta_snr )
+#else
+ X6( CFG_CUR_SCALE_THRH, \
+ energy_detect_thrh, carrier_detect_thrh, defer_thrh, \
+ cell_search_thrh, out_of_range_thrh, delta_snr ) /*Actual System Scale thresholds settings */
+#endif // HCF_TYPE_WARP
+ X1( CFG_PROTOCOL_RSP_TIME, time ) /*Max time to await a response to a request message */
+ X1( CFG_CUR_SHORT_RETRY_LIMIT, limit ) /*Max number of transmit attempts for short frames */
+ X1( CFG_CUR_LONG_RETRY_LIMIT, limit ) /*Max number of transmit attempts for long frames */
+ X1( CFG_MAX_TX_LIFETIME, time ) /*Max transmit frame handling duration */
+ X1( CFG_MAX_RX_LIFETIME, time ) /*Max received frame handling duration */
+ X1( CFG_CF_POLLABLE, cf_pollable ) /*[STA] Contention Free pollable capability indication */
+ X2( CFG_AUTHENTICATION_ALGORITHMS,authentication_type, type_enabled ) /*Authentication Algorithm */
+ X1( CFG_PRIVACY_OPT_IMPLEMENTED,privacy_opt_implemented ) /*WEP Option availability indication */
+ X1( CFG_CUR_REMOTE_RATES, rates ) /*CurrentRemoteRates */
+ X1( CFG_CUR_USED_RATES, rates ) /*CurrentUsedRates */
+ X1( CFG_CUR_SYSTEM_SCALE, current_system_scale ) /*CurrentUsedRates */
+ X1( CFG_CUR_TX_RATE1, rate ) /*[AP] Actual Port 1 transmit data rate */
+ X1( CFG_CUR_TX_RATE2, rate ) /*[AP] Actual Port 2 transmit data rate */
+ X1( CFG_CUR_TX_RATE3, rate ) /*[AP] Actual Port 3 transmit data rate */
+ X1( CFG_CUR_TX_RATE4, rate ) /*[AP] Actual Port 4 transmit data rate */
+ X1( CFG_CUR_TX_RATE5, rate ) /*[AP] Actual Port 5 transmit data rate */
+ X1( CFG_CUR_TX_RATE6, rate ) /*[AP] Actual Port 6 transmit data rate */
+ X1( CFG_OWN_MAC_ADDR, mac_addr[3] ) /*[AP] Unique local node MAC Address */
+ X3( CFG_PCF_INFO, medium_occupancy_limit, \
+ cfp_period, cfp_max_duration ) /*[AP] Point Coordination Function capability info */
+ X1( CFG_CUR_SSN_INFO_ELEMENT, ssn_info_element[1] ) /* */
+ X4( CFG_CUR_TKIP_IV_INFO, \
+ tkip_seq_cnt0[4], tkip_seq_cnt1[4], \
+ tkip_seq_cnt2[4], tkip_seq_cnt3[4] ) /* */
+ X2( CFG_CUR_ASSOC_REQ_INFO, frame_type, frame_body[1] ) /* 0xFD8C */
+ X2( CFG_CUR_ASSOC_RESP_INFO, frame_type, frame_body[1] ) /* 0xFD8D */
+
+
+/* Modem INFORMATION */
+ X1( CFG_PHY_TYPE, phy_type ) /*Physical layer type indication */
+ X1( CFG_CUR_CHANNEL, current_channel ) /*Actual frequency channel used for transmission */
+ X1( CFG_CUR_POWER_STATE, current_power_state ) /*Actual power consumption status */
+ X1( CFG_CCAMODE, cca_mode ) /*Clear channel assessment mode indication */
+ X1( CFG_SUPPORTED_DATA_RATES, rates[5] ) /*Data rates capability information */
+
+
+/* FRAMES */
+XX1( CFG_SCAN, SCAN_RS_STRCT, scan_result[32] ) /*Scan results */
+
+
+
+//--------------------------------------------------------------------------------------
+// UIL management function to be passed to WaveLAN/IEEE Drivers in DUI_STRCT field fun
+//--------------------------------------------------------------------------------------
+
+// HCF and UIL Common
+#define MDD_ACT_SCAN 0x06 // Hermes Inquire Scan (F101) command
+#define MDD_ACT_PRS_SCAN 0x07 // Hermes Probe Response Scan (F102) command
+
+// UIL Specific
+#define UIL_FUN_CONNECT 0x00 // Perform connect command
+#define UIL_FUN_DISCONNECT 0x01 // Perform disconnect command
+#define UIL_FUN_ACTION 0x02 // Perform UIL Action command.
+#define UIL_FUN_SEND_DIAG_MSG 0x03 // Send a diagnostic message.
+#define UIL_FUN_GET_INFO 0x04 // Retrieve information from NIC.
+#define UIL_FUN_PUT_INFO 0x05 // Put information on NIC.
+
+/* UIL_ACT_TALLIES 0x05 * this should not be exported to the USF
+ * it is solely intended as a strategic choice for the MSF to either
+ * - use HCF_ACT_TALLIES and direct IFB access
+ * - use CFG_TALLIES
+ */
+#define UIL_ACT_SCAN MDD_ACT_SCAN
+#define UIL_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
+#define UIL_ACT_BLOCK 0x0B
+#define UIL_ACT_UNBLOCK 0x0C
+#define UIL_ACT_RESET 0x80
+#define UIL_ACT_REBIND 0x81
+#define UIL_ACT_APPLY 0x82
+#define UIL_ACT_DISCONNECT 0x83 //;?040108 possibly obsolete //Special for WINCE
+
+// HCF Specific
+/* Note that UIL_ACT-codes must match HCF_ACT-codes across a run-time bound I/F
+ * The initial matching is achieved by "#define HCF_ACT_xxx HCF_UIL_ACT_xxx" where appropriate
+ * In other words, these codes should never, ever change to minimize migration problems between
+ * combinations of old drivers and new utilities and vice versa
+ */
+#define HCF_DISCONNECT 0x01 //disconnect request for hcf_connect (invalid as IO Address)
+#define HCF_ACT_TALLIES 0x05 // ! UIL_ACT_TALLIES does not exist ! Hermes Inquire Tallies (F100) cmd
+#if ( (HCF_TYPE) & HCF_TYPE_WARP ) == 0
+#define HCF_ACT_SCAN MDD_ACT_SCAN
+#endif // HCF_TYPE_WARP
+#define HCF_ACT_PRS_SCAN MDD_ACT_PRS_SCAN
+#if HCF_INT_ON
+#define HCF_ACT_INT_OFF 0x0D // Disable Interrupt generation
+#define HCF_ACT_INT_ON 0x0E // Enable Interrupt generation
+#define HCF_ACT_INT_FORCE_ON 0x0F // Enforce Enable Interrupt generation
+#endif // HCF_INT_ON
+#define HCF_ACT_RX_ACK 0x15 // Receiever ACK (optimization)
+#if (HCF_TYPE) & HCF_TYPE_CCX
+#define HCF_ACT_CCX_ON 0x1A // enable CKIP
+#define HCF_ACT_CCX_OFF 0x1B // disable CKIP
+#endif // HCF_TYPE_CCX
+#if (HCF_SLEEP) & HCF_DDS
+#define HCF_ACT_SLEEP 0x1C // DDS Sleep request
+//#define HCF_ACT_WAKEUP 0x1D // DDS Wakeup request
+#endif // HCF_DDS
+
+/* HCF_ACT_MAX // xxxx: start value for UIL-range, NOT to be passed to HCF
+ * Too bad, there was originally no spare room created to use
+ * HCF_ACT_MAX as an equivalent of HCF_ERR_MAX. Since creating
+ * this room in retrospect would create a backward incompatibility
+ * we will just have to live with the haphazard sequence of
+ * UIL- and HCF specific codes. Theoretically this could be
+ * corrected when and if there will ever be an overall
+ * incompatibility introduced for another reason
+ */
+
+/*============================================================= HERMES RECORDS ============================*/
+#define CFG_RID_FW_MIN 0xFA00 //lowest value representing a Hermes-II based RID
+// #define CFG_PDA_BEGIN 0xFA //
+// #define CFG_PDA_END 0xFA //
+// #define CFG_PDA_NIC_TOP_LVL_ASSEMBLY_NUMBER 0xFA //
+// #define CFG_PDA_PCB_TRACER_NUMBER 0xFA //
+// #define CFG_PDA_RMM_TRACER_NUMBER 0xFA //
+// #define CFG_PDA_RMM_COMP_ID 0xFA //
+// #define CFG_PDA_ 0xFA //
+
+/*============================================================= CONFIGURATION RECORDS =====================*/
+/*============================================================= mask 0xFCxx =====================*/
+#define CFG_RID_CFG_MIN 0xFC00 //lowest value representing a Hermes configuration RID
+
+// NETWORK PARAMETERS, STATIC CONFIGURATION ENTITIES
+//FC05, FC0B, FC0C, FC0D: SEE W2DN149
+
+#define CFG_CNF_PORT_TYPE 0xFC00 //[STA] Connection control characteristics
+#define CFG_CNF_OWN_MAC_ADDR 0xFC01 //[STA] MAC Address of this node
+// 0xFC02 see DYNAMIC CONFIGURATION ENTITIES
+#define CFG_CNF_OWN_CHANNEL 0xFC03 //Communication channel for BSS creation
+#define CFG_CNF_OWN_SSID 0xFC04 //IBSS creation (STA) or ESS (AP) Service Set Ident
+#define CFG_CNF_OWN_ATIM_WINDOW 0xFC05 //[STA] ATIM Window time for IBSS creation
+#define CFG_CNF_SYSTEM_SCALE 0xFC06 //System Scale that specifies the AP density
+#define CFG_CNF_MAX_DATA_LEN 0xFC07 //Maximum length of MAC Frame Body data
+#define CFG_CNF_PM_ENABLED 0xFC09 //[STA] Switch for ESS Power Management (PM)
+#define CFG_CNF_MCAST_RX 0xFC0B //[STA] Switch for ESS PM Multicast reception On/Off
+#define CFG_CNF_MAX_SLEEP_DURATION 0xFC0C //[STA] Maximum sleep time for ESS PM
+#define CFG_CNF_HOLDOVER_DURATION 0xFC0D //[STA] Holdover time for ESS PM
+#define CFG_CNF_OWN_NAME 0xFC0E //Identification text for diagnostic purposes
+
+#define CFG_CNF_OWN_DTIM_PERIOD 0xFC10 //[AP] Beacon intervals between successive DTIMs
+#define CFG_CNF_WDS_ADDR1 0xFC11 //[AP] Port 1 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_WDS_ADDR2 0xFC12 //[AP] Port 2 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_WDS_ADDR3 0xFC13 //[AP] Port 3 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_WDS_ADDR4 0xFC14 //[AP] Port 4 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_WDS_ADDR5 0xFC15 //[AP] Port 5 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_WDS_ADDR6 0xFC16 //[AP] Port 6 MAC Adrs of corresponding WDS Link node
+#define CFG_CNF_PM_MCAST_BUF 0xFC17 //[AP] Switch for PM buffereing of Multicast Messages
+#define CFG_CNF_MCAST_PM_BUF CFG_CNF_PM_MCAST_BUF //name does not match H-II spec
+#define CFG_CNF_REJECT_ANY 0xFC18 //[AP] Switch for PM buffereing of Multicast Messages
+
+#define CFG_CNF_ENCRYPTION 0xFC20 //select en/de-cryption of Tx/Rx messages
+#define CFG_CNF_AUTHENTICATION 0xFC21 //[STA] selects Authentication algorithm
+#define CFG_CNF_EXCL_UNENCRYPTED 0xFC22 //[AP] Switch for 'clear-text' rx message acceptance
+#define CFG_CNF_MCAST_RATE 0xFC23 //Transmit Data rate for Multicast frames
+#define CFG_CNF_INTRA_BSS_RELAY 0xFC24 //[AP] Switch for IntraBBS relay
+#define CFG_CNF_MICRO_WAVE 0xFC25 //MicroWave (Robustness)
+#define CFG_CNF_LOAD_BALANCING 0xFC26 //Load Balancing (Boolean, 0=OFF, 1=ON, default=1)
+#define CFG_CNF_MEDIUM_DISTRIBUTION 0xFC27 //Medium Distribution (Boolean, 0=OFF, 1=ON, default=1)
+#define CFG_CNF_RX_ALL_GROUP_ADDR 0xFC28 //[STA] Group Address Filter
+#define CFG_CNF_COUNTRY_INFO 0xFC29 //Country Info
+#if (HCF_TYPE) & HCF_TYPE_WARP
+#define CFG_CNF_TX_POW_LVL 0xFC2A //TxPower Level
+#define CFG_CNF_CONNECTION_CNTL 0xFC30 //[STA] Connection Control
+#define CFG_CNF_OWN_BEACON_INTERVAL 0xFC31 //[AP]
+#define CFG_CNF_SHORT_RETRY_LIMIT 0xFC32 //
+#define CFG_CNF_LONG_RETRY_LIMIT 0xFC33 //
+#define CFG_CNF_TX_EVENT_MODE 0xFC34 //
+#define CFG_CNF_WIFI_COMPATIBLE 0xFC35 //[STA] Wifi compatible
+#endif // HCF_TYPE_WARP
+#if (HCF_TYPE) & HCF_TYPE_BEAGLE_HII5
+#define CFG_VOICE_RETRY_LIMIT 0xFC36 /* Voice frame retry limit. Range: 1-15, default: 4 */
+#define CFG_VOICE_CONTENTION_WINDOW 0xFC37 /* Contention window for voice frames. */
+#endif // BEAGLE_HII5
+
+// NETWORK PARAMETERS, DYNAMIC CONFIGURATION ENTITIES
+#define CFG_DESIRED_SSID 0xFC02 //[STA] Service Set identification for connection and scan
+
+#define CFG_GROUP_ADDR 0xFC80 //[STA] Multicast MAC Addresses for Rx-message
+#define CFG_CREATE_IBSS 0xFC81 //[STA] Switch for IBSS creation On/Off
+#define CFG_RTS_THRH 0xFC83 //Frame length used for RTS/CTS handshake
+#define CFG_TX_RATE_CNTL 0xFC84 //[STA] Data rate control for message transmission
+#define CFG_PROMISCUOUS_MODE 0xFC85 //[STA] Switch for Promiscuous mode reception On/Off
+#define CFG_WOL 0xFC86 //[STA] Switch for Wake-On-LAN mode
+#define CFG_WOL_PATTERNS 0xFC87 //[STA] Patterns for Wake-On-LAN
+#define CFG_SUPPORTED_RATE_SET_CNTL 0xFC88 //
+#define CFG_BASIC_RATE_SET_CNTL 0xFC89 //
+
+#define CFG_SOFTWARE_ACK_MODE 0xFC90 //
+#define CFG_RTS_THRH0 0xFC97 //[AP] Port 0 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH1 0xFC98 //[AP] Port 1 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH2 0xFC99 //[AP] Port 2 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH3 0xFC9A //[AP] Port 3 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH4 0xFC9B //[AP] Port 4 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH5 0xFC9C //[AP] Port 5 frame length for RTS/CTS handshake
+#define CFG_RTS_THRH6 0xFC9D //[AP] Port 6 frame length for RTS/CTS handshake
+
+#define CFG_TX_RATE_CNTL0 0xFC9E //[AP] Port 0 data rate control for transmission
+#define CFG_TX_RATE_CNTL1 0xFC9F //[AP] Port 1 data rate control for transmission
+#define CFG_TX_RATE_CNTL2 0xFCA0 //[AP] Port 2 data rate control for transmission
+#define CFG_TX_RATE_CNTL3 0xFCA1 //[AP] Port 3 data rate control for transmission
+#define CFG_TX_RATE_CNTL4 0xFCA2 //[AP] Port 4 data rate control for transmission
+#define CFG_TX_RATE_CNTL5 0xFCA3 //[AP] Port 5 data rate control for transmission
+#define CFG_TX_RATE_CNTL6 0xFCA4 //[AP] Port 6 data rate control for transmission
+
+#define CFG_DEFAULT_KEYS 0xFCB0 //defines set of encryption keys
+#define CFG_TX_KEY_ID 0xFCB1 //select key for encryption of Tx messages
+#define CFG_SCAN_SSID 0xFCB2 //Scan SSID
+#define CFG_ADD_TKIP_DEFAULT_KEY 0xFCB4 //set KeyID and TxKey indication
+#define KEY_ID 0x0003 //KeyID mask for tkip_key_id_info field
+#define TX_KEY 0x8000 //Default Tx Key flag of tkip_key_id_info field
+#define CFG_SET_WPA_AUTH_KEY_MGMT_SUITE 0xFCB5 //Authenticated Key Management Suite
+#define CFG_REMOVE_TKIP_DEFAULT_KEY 0xFCB6 //invalidate KeyID and TxKey indication
+#define CFG_ADD_TKIP_MAPPED_KEY 0xFCB7 //set MAC address pairwise station
+#define CFG_REMOVE_TKIP_MAPPED_KEY 0xFCB8 //invalidate MAC address pairwise station
+#define CFG_SET_WPA_CAPABILITIES_INFO 0xFCB9 //WPA Capabilities
+#define CFG_CACHED_PMK_ADDR 0xFCBA //set MAC address of pre-authenticated AP
+#define CFG_REMOVE_CACHED_PMK_ADDR 0xFCBB //invalidate MAC address of pre-authenticated AP
+#define CFG_FCBC 0xFCBC //FW codes ahead of available documentation, so ???????
+#define CFG_FCBD 0xFCBD //FW codes ahead of available documentation, so ???????
+#define CFG_FCBE 0xFCBE //FW codes ahead of available documentation, so ???????
+#define CFG_FCBF 0xFCBF //FW codes ahead of available documentation, so ???????
+
+#define CFG_HANDOVER_ADDR 0xFCC0 //[AP] Station MAC Adrress re-associated with other AP
+#define CFG_SCAN_CHANNEL 0xFCC2 //Channel set for host requested scan
+//;?#define CFG_SCAN_CHANNEL_MASK 0xFCC2 // contains
+#define CFG_DISASSOCIATE_ADDR 0xFCC4 //[AP] Station MAC Adrress to be disassociated
+#define CFG_PROBE_DATA_RATE 0xFCC5 //WARP connection control
+#define CFG_FRAME_BURST_LIMIT 0xFCC6 //
+#define CFG_COEXISTENSE_BEHAVIOUR 0xFCC7 //[AP]
+#define CFG_DEAUTHENTICATE_ADDR 0xFCC8 //MAC address of Station to be deauthenticated
+
+// BEHAVIOR PARAMETERS
+#define CFG_TICK_TIME 0xFCE0 //Auxiliary Timer tick interval
+#define CFG_DDS_TICK_TIME 0xFCE1 //Disconnected DeepSleep Timer tick interval
+//#define CFG_CNF_COUNTRY 0xFCFE apparently not needed ;?
+#define CFG_RID_CFG_MAX 0xFCFF //highest value representing an Configuration RID
+
+
+/*============================================================= INFORMATION RECORDS =====================*/
+/*============================================================= mask 0xFDxx =====================*/
+// NIC INFORMATION
+#define CFG_RID_INF_MIN 0xFD00 //lowest value representing an Information RID
+#define CFG_MAX_LOAD_TIME 0xFD00 //[INT] Maximum response time of the Download command.
+#define CFG_DL_BUF 0xFD01 //[INT] Download buffer location and size.
+#define CFG_PRI_IDENTITY 0xFD02 //[PRI] Primary Functions firmware identification.
+#define CFG_PRI_SUP_RANGE 0xFD03 //[PRI] Primary Functions I/F Supplier compatibility range.
+#define CFG_NIC_HSI_SUP_RANGE 0xFD09 //H/W - S/W I/F supplier range
+#define CFG_NIC_SERIAL_NUMBER 0xFD0A //[PRI] Network Interface Card serial number.
+#define CFG_NIC_IDENTITY 0xFD0B //[PRI] Network Interface Card identification.
+#define CFG_NIC_MFI_SUP_RANGE 0xFD0C //[PRI] Modem I/F Supplier compatibility range.
+#define CFG_NIC_CFI_SUP_RANGE 0xFD0D //[PRI] Controller I/F Supplier compatibility range.
+#define CFG_CHANNEL_LIST 0xFD10 //Allowed communication channels.
+#define CFG_NIC_TEMP_TYPE 0xFD12 //Hardware temperature range code.
+#define CFG_CIS 0xFD13 //PC Card Standard Card Information Structure
+#define CFG_NIC_PROFILE 0xFD14 //Card Profile
+#define CFG_FW_IDENTITY 0xFD20 //firmware identification.
+#define CFG_FW_SUP_RANGE 0xFD21 //firmware Supplier compatibility range.
+#define CFG_MFI_ACT_RANGES_STA 0xFD22 //[STA] Modem I/F Actor compatibility ranges.
+#define CFG_CFI_ACT_RANGES_STA 0xFD23 //[STA] Controller I/F Actor compatibility ranges.
+#define CFG_NIC_BUS_TYPE 0xFD24 //Card Bustype
+#define CFG_NIC_BUS_TYPE_PCCARD_CF 0x0000 //16 bit PC Card or Compact Flash
+#define CFG_NIC_BUS_TYPE_USB 0x0001 //USB
+#define CFG_NIC_BUS_TYPE_CARDBUS 0x0002 //CardBus
+#define CFG_NIC_BUS_TYPE_PCI 0x0003 //(mini)PCI
+#define CFG_DOMAIN_CODE 0xFD25
+
+// MAC INFORMATION
+#define CFG_PORT_STAT 0xFD40 //Actual MAC Port connection control status
+#define CFG_CUR_SSID 0xFD41 //[STA] Identification of the actually connected SS
+#define CFG_CUR_BSSID 0xFD42 //[STA] Identification of the actually connected BSS
+#define CFG_COMMS_QUALITY 0xFD43 //[STA] Quality of the Basic Service Set connection
+#define CFG_CUR_TX_RATE 0xFD44 //[STA] Actual transmit data rate
+#define CFG_CUR_BEACON_INTERVAL 0xFD45 //Beacon transmit interval time for BSS creation
+#define CFG_CUR_SCALE_THRH 0xFD46 //Actual System Scale thresholds settings
+#define CFG_PROTOCOL_RSP_TIME 0xFD47 //Max time to await a response to a request message
+#define CFG_CUR_SHORT_RETRY_LIMIT 0xFD48 //Max number of transmit attempts for short frames
+#define CFG_CUR_LONG_RETRY_LIMIT 0xFD49 //Max number of transmit attempts for long frames
+#define CFG_MAX_TX_LIFETIME 0xFD4A //Max transmit frame handling duration
+#define CFG_MAX_RX_LIFETIME 0xFD4B //Max received frame handling duration
+#define CFG_CF_POLLABLE 0xFD4C //[STA] Contention Free pollable capability indication
+#define CFG_AUTHENTICATION_ALGORITHMS 0xFD4D //Available Authentication Algorithms indication
+#define CFG_PRIVACY_OPT_IMPLEMENTED 0xFD4F //WEP Option availability indication
+
+#define CFG_CUR_REMOTE_RATES 0xFD50 //[STA] CurrentRemoteRates
+#define CFG_CUR_USED_RATES 0xFD51 //[STA] CurrentUsedRates
+#define CFG_CUR_SYSTEM_SCALE 0xFD52 //[STA] CurrentSystemScale
+
+#define CFG_CUR_TX_RATE1 0xFD80 //[AP] Actual Port 1 transmit data rate
+#define CFG_CUR_TX_RATE2 0xFD81 //[AP] Actual Port 2 transmit data rate
+#define CFG_CUR_TX_RATE3 0xFD82 //[AP] Actual Port 3 transmit data rate
+#define CFG_CUR_TX_RATE4 0xFD83 //[AP] Actual Port 4 transmit data rate
+#define CFG_CUR_TX_RATE5 0xFD84 //[AP] Actual Port 5 transmit data rate
+#define CFG_CUR_TX_RATE6 0xFD85 //[AP] Actual Port 6 transmit data rate
+#define CFG_NIC_MAC_ADDR 0xFD86 //Unique local node MAC Address
+#define CFG_PCF_INFO 0xFD87 //[AP] Point Coordination Function capability info
+//*RESERVED* #define CFG_HIGHEST_BASIC_RATE 0xFD88 //
+#define CFG_CUR_COUNTRY_INFO 0xFD89 //
+#define CFG_CUR_SSN_INFO_ELEMENT 0xFD8A //
+#define CFG_CUR_TKIP_IV_INFO 0xFD8B //
+#define CFG_CUR_ASSOC_REQ_INFO 0xFD8C //
+#define CFG_CUR_ASSOC_RESP_INFO 0xFD8D //
+#define CFG_CUR_LOAD 0xFD8E //[AP] current load on AP's channel
+
+#define CFG_SECURITY_CAPABILITIES 0xFD90 //Combined capabilities information
+
+// MODEM INFORMATION
+#define CFG_PHY_TYPE 0xFDC0 //Physical layer type indication
+#define CFG_CUR_CHANNEL 0xFDC1 //Actual frequency channel used for transmission
+#define CFG_CUR_POWER_STATE 0xFDC2 //Actual power consumption status
+#define CFG_CCA_MODE 0xFDC3 //Clear channel assessment mode indication
+#define CFG_SUPPORTED_DATA_RATES 0xFDC6 //Data rates capability information
+
+#define CFG_RID_INF_MAX 0xFDFF //highest value representing an Information RID
+
+// ENGINEERING INFORMATION
+#define CFG_RID_ENG_MIN 0xFFE0 //lowest value representing a Hermes engineering RID
+
+
+/****************************** General define *************************************************************/
+
+
+//IFB field related
+// IFB_CardStat
+#define CARD_STAT_INCOMP_PRI 0x2000U // no compatible HSI / primary F/W
+#define CARD_STAT_INCOMP_FW 0x1000U // no compatible station / tertiary F/W
+#define CARD_STAT_DEFUNCT 0x0100U // HCF is in Defunct mode
+// IFB_RxStat
+#define RX_STAT_PRIO 0x00E0U //Priority subfield
+#define RX_STAT_ERR 0x000FU //Error mask
+#define RX_STAT_UNDECR 0x0002U //Non-decryptable encrypted message
+#define RX_STAT_FCS_ERR 0x0001U //FCS error
+
+// SNAP header for E-II Encapsulation
+#define ENC_NONE 0xFF
+#define ENC_1042 0x00
+#define ENC_TUNNEL 0xF8
+/****************************** Xxxxxxxx *******************************************************************/
+
+
+#define HCF_SUCCESS 0x00 // OK
+#define HCF_ERR_TIME_OUT 0x04 // Expected Hermes event did not occure in expected time
+#define HCF_ERR_NO_NIC 0x05 /* card not found (usually yanked away during hcfio_in_string
+ * Also: card is either absent or disabled while it should be neither */
+#define HCF_ERR_LEN 0x08 /* buffer size insufficient
+ * - IFB_ConfigTable too small
+ * - hcf_get_info buffer has a size of 0 or 1 or less than needed
+ * to accomodate all data
+ * - hcf_put_info: CFG_DLNV_DATA exceeds intermediate
+ * buffer size */
+#define HCF_ERR_INCOMP_PRI 0x09 // primary functions are not compatible
+#define HCF_ERR_INCOMP_FW 0x0A // station functions are compatible
+#define HCF_ERR_MIC 0x0D // MIC check fails
+#define HCF_ERR_SLEEP 0x0E // NIC in sleep mode
+#define HCF_ERR_MAX 0x3F /* end of HCF range
+ *** ** *** ****** *** *************** */
+#define HCF_ERR_DEFUNCT 0x80 // BIT, reflecting that the HCF is in defunct mode (bits 0x7F reflect cause)
+#define HCF_ERR_DEFUNCT_AUX 0x82 // Timeout on acknowledgement on en/disabling AUX registers
+#define HCF_ERR_DEFUNCT_TIMER 0x83 // Timeout on timer calibration during initialization process
+#define HCF_ERR_DEFUNCT_TIME_OUT 0x84 // Timeout on Busy bit drop during BAP setup
+#define HCF_ERR_DEFUNCT_CMD_SEQ 0x86 // Hermes and HCF are out of sync in issuing/processing commands
+
+#define HCF_INT_PENDING 0x01 // return status of hcf_act( HCF_ACT_INT_OFF )
+
+#define HCF_PORT_0 0x0000 // Station supports only single MAC Port
+#define HCF_PORT_1 0x0100 // HCF_PORT_1 through HCF_PORT_6 are only supported by AP F/W
+#define HCF_PORT_2 0x0200
+#define HCF_PORT_3 0x0300
+#define HCF_PORT_4 0x0400
+#define HCF_PORT_5 0x0500
+#define HCF_PORT_6 0x0600
+
+#define HCF_CNTL_ENABLE 0x01
+#define HCF_CNTL_DISABLE 0x02
+#define HCF_CNTL_CONNECT 0x03
+#define HCF_CNTL_DISCONNECT 0x05
+#define HCF_CNTL_CONTINUE 0x07
+
+#define USE_DMA 0x0001
+#define USE_16BIT 0x0002
+#define DMA_ENABLED 0x8000 //weak name, it really means: F/W enabled and DMA selected
+
+//#define HCF_DMA_FD_CNT (2*29) //size in bytes of one Tx/RxFS minus DA/SA
+//;?the MSF ( H2PCI.C uses the next 2 mnemonics )
+#define HCF_DMA_RX_BUF1_SIZE (HFS_ADDR_DEST + 8) //extra bytes for LEN/SNAP if decapsulation
+#define HCF_DMA_TX_BUF1_SIZE (HFS_ADDR_DEST + 2*6 + 8) //extra bytes for DA/SA/LEN/SNAP if encapsulation
+
+//HFS_TX_CNTL
+/* Note that the HCF_.... System Constants influence the HFS_.... values below
+ * H-I H-I | H-II H-II H-II.5
+ * WPA | WPA
+ * HFS_TX_CNTL_TX_OK 0002 0002 | 0002 0002 N/A <<<<<<<<deprecated
+ * HFS_TX_CNTL_TX_EX 0004 0004 | 0004 0004 N/A
+ * HFS_TX_CNTL_MIC N/A 0010 | N/A 0010 N/A
+ * HFS_TX_CNTL_TID N/A N/A | N/A N/A 000F
+ * HFS_TX_CNTL_SERVICE_CLASS N/A N/A | N/A N/A 00C0
+ * HFS_TX_CNTL_PORT 0700 0700 | 0700 0700 0700
+ * HFS_TX_CNTL_MIC_KEY_ID 1800 1800 | 0000 1800 N/A
+ * HFS_TX_CNTL_CKIP 0000 0000 | 0000 2000 2000
+ * HFS_TX_CNTL_TX_DELAY 4000 4000 | 4000 4000 N/A
+ * HFS_TX_CNTL_ACTION N/A N/A | N/A N/A 4000
+ * ==== ==== | ==== ==== ====
+ * 5F06 5F16 | 4706 7F06 67CF
+ *
+ * HCF_TX_CNTL_MASK specifies the bits allowed on the Host I/F
+ * note: bit 0x4000 has different meaning for H-II and H-II.5
+ * note: [] indicate bits which are possibly added by the HCF to TxControl at the Host I/F
+ * note: () indicate bits which are supposedly never ever used in a WCI environment
+ * note: ? denote bits which seem not to be documented in the documents I have available
+ */
+//H-I: HCF_TX_CNTL_MASK 0x47FE //TX_DELAY, MACPort, Priority, (StrucType), TxEx, TxOK
+//H-I WPA: HCF_TX_CNTL_MASK 0x5FE6 //TX_DELAY, MICKey, MACPort, Priority, (StrucType), TxEx, TxOK
+#if (HCF_TYPE) & HCF_TYPE_WARP
+#define HCF_TX_CNTL_MASK 0x27E7 //no TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
+//#elif (HCF_TYPE) & HCF_TYPE_WPA
+//#define HCF_TX_CNTL_MASK 0x7F06 //TX_DELAY, CKIP?, MICKeyID, MACPort, [MIC],TxEx, TxOK (TAR419D7)
+#else
+#define HCF_TX_CNTL_MASK 0x67E7 //TX_DELAY?, CCX, MACPort, Priority, (StrucType), TxEx, TxOK, Spectralink
+#endif // HCF_TYPE_WARP
+
+#define HFS_TX_CNTL_TX_EX 0x0004U
+
+#if (HCF_TYPE) & HCF_TYPE_WPA
+#define HFS_TX_CNTL_MIC 0x0010U //802.3 format with TKIP ;?changes to 0x0008 for H-II
+#define HFS_TX_CNTL_MIC_KEY_ID 0x1800U //MIC Key ID subfield
+#endif // HCF_TYPE_WPA
+
+#define HFS_TX_CNTL_PORT 0x0700U //Port subfield of TxControl field of Transmit Frame Structure
+
+#if (HCF_TYPE) & HCF_TYPE_CCX
+#define HFS_TX_CNTL_CKIP 0x2000U //CKIP encrypted flag
+#endif // HCF_TYPE_CCX
+
+#if (HCF_TYPE) & HCF_TYPE_TX_DELAY
+#define HFS_TX_CNTL_TX_DELAY 0x4000U //decouple "put data" and send
+#endif // HCF_TYPE_TX_DELAY
+#define HFS_TX_CNTL_TX_CONT 0x4000u //engineering: continuous transmit
+
+/*============================================================= HCF Defined RECORDS =========================*/
+#define CFG_PROD_DATA 0x0800 //Plug Data (Engineering Test purposes only)
+#define CFG_DL_EEPROM 0x0806 //Up/Download I2PROM for USB
+#define CFG_PDA 0x0002 //Download PDA
+#define CFG_MEM_I2PROM 0x0004 //Up/Download EEPROM
+
+#define CFG_MEM_READ 0x0000
+#define CFG_MEM_WRITE 0x0001
+
+#define CFG_NULL 0x0820 //Empty Mail Box Info Block
+#define CFG_MB_INFO 0x0820 //Mail Box Info Block
+#define CFG_WMP 0x0822 //WaveLAN Management Protocol
+
+#if defined MSF_COMPONENT_ID
+#define CFG_DRV_INFO 0x0825 //Driver Information structure (see CFG_DRV_INFO_STRCT for details)
+#define CFG_DRV_IDENTITY 0x0826 //driver identity (see CFG_DRV_IDENTITY_STRCT for details)
+#define CFG_DRV_SUP_RANGE 0x0827 //Supplier range of driver - utility I/F
+#define CFG_DRV_ACT_RANGES_PRI 0x0828 //(Acceptable) Actor range for Primary Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_STA 0x0829 //(Acceptable) Actor range for Station Firmware - driver I/F
+#define CFG_DRV_ACT_RANGES_HSI 0x082A //(Acceptable) Actor range for H/W - driver I/F
+#define CFG_DRV_ACT_RANGES_APF 0x082B //(Acceptable) Actor range for AP Firmware - driver I/F
+#define CFG_HCF_OPT 0x082C //HCF (Compile time) options
+#endif // MSF_COMPONENT_ID
+
+#define CFG_REG_MB 0x0830 //Register Mail Box
+#define CFG_MB_ASSERT 0x0831 //Assert information
+#define CFG_REG_ASSERT_RTNP 0x0832 //(de-)register MSF Assert Callback routine
+#if (HCF_EXT) & HCF_EXT_INFO_LOG
+#define CFG_REG_INFO_LOG 0x0839 //(de-)register Info frames to Log
+#endif // HCF_INFO_LOG
+#define CFG_CNTL_OPT 0x083A //Control options
+
+#define CFG_PROG 0x0857 //Program NIC memory
+#define CFG_PROG_STOP 0x0000
+#define CFG_PROG_VOLATILE 0x0100
+//#define CFG_PROG_FLASH 0x0300 //restore if H-II non-volatile is introduced
+//#define CFG_PROG_SEEPROM 0x1300 //restore if H-II non-volatile is introduced
+#define CFG_PROG_SEEPROM_READBACK 0x0400
+
+#define CFG_FW_PRINTF 0x0858 //Related to firmware debug printf functionality
+#define CFG_FW_PRINTF_BUFFER_LOCATION 0x0859 //Also related to firmware debug printf functionality
+
+#define CFG_CMD_NIC 0x0860 //Hermes Engineering command
+#define CFG_CMD_HCF 0x0863 //HCF Engineering command
+#define CFG_CMD_HCF_REG_ACCESS 0x0000 //Direct register access
+#define CFG_CMD_HCF_RX_MON 0x0001 //Rx-monitor
+
+
+/*============================================================= MSF Defined RECORDS ========================*/
+#define CFG_ENCRYPT_STRING 0x0900 //transfer encryption info from CPL to MSF
+#define CFG_AP_MODE 0x0901 //control mode of STAP driver from CPL
+#define CFG_DRIVER_ENABLE 0x0902 //extend&export En-/Disable facility to Utility
+#define CFG_PCI_COMMAND 0x0903 //PCI adapter (Ooievaar) structure
+#define CFG_WOLAS_ENABLE 0x0904 //extend&export En-/Disable WOLAS facility to Utility
+#define CFG_COUNTRY_STRING 0x0905 //transfer CountryInfo info from CPL to MSF
+#define CFG_FW_DUMP 0x0906 //transfer nic memory to utility
+#define CFG_POWER_MODE 0x0907 //controls the PM mode of the card
+#define CFG_CONNECTION_MODE 0x0908 //controls the mode of the FW (ESS/AP/IBSS/ADHOC)
+#define CFG_IFB 0x0909 //byte wise copy of IFB
+#define CFG_MSF_TALLIES 0x090A //MSF tallies (int's, rx and tx)
+#define CFG_CURRENT_LINK_STATUS 0x090B //Latest link status got trough 0xF200 LinkEvent
+
+/*============================================================ INFORMATION FRAMES =========================*/
+#define CFG_INFO_FRAME_MIN 0xF000 //lowest value representing an Informatio Frame
+
+#define CFG_TALLIES 0xF100 //Communications Tallies
+#define CFG_SCAN 0xF101 //Scan results
+#define CFG_PRS_SCAN 0xF102 //Probe Response Scan results
+
+#define CFG_LINK_STAT 0xF200 //Link Status
+ /* 1 through 5 are F/W defined values, produced by CFG_LINK_STAT frame
+ * 1 through 5 are shared by CFG_LINK_STAT, IFB_LinkStat and IFB_DSLinkStat
+ * 1 plays a double role as CFG_LINK_STAT_CONNECTED and as bit reflecting:
+ * - connected: ON
+ * - disconnected: OFF
+ */
+#define CFG_LINK_STAT_CONNECTED 0x0001
+#define CFG_LINK_STAT_DISCONNECTED 0x0002
+#define CFG_LINK_STAT_AP_CHANGE 0x0003
+#define CFG_LINK_STAT_AP_OOR 0x0004
+#define CFG_LINK_STAT_AP_IR 0x0005
+#define CFG_LINK_STAT_FW 0x000F //mask to isolate F/W defined bits
+//#define CFG_LINK_STAT_TIMER 0x0FF0 //mask to isolate OOR timer
+//#define CFG_LINK_STAT_DS_OOR 0x2000 //2000 and up are IFB_LinkStat specific
+//#define CFG_LINK_STAT_DS_IR 0x4000
+#define CFG_LINK_STAT_CHANGE 0x8000
+#define CFG_ASSOC_STAT 0xF201 //Association Status
+#define CFG_SECURITY_STAT 0xF202 //Security Status
+#define CFG_UPDATED_INFO_RECORD 0xF204 //Updated Info Record
+
+/*============================================================ CONFIGURATION RECORDS ======================*/
+/***********************************************************************************************************/
+
+/****************************** S T R U C T U R E D E F I N I T I O N S **********************************/
+
+//Quick&Dirty to get download for DOS ODI Hermes-II running typedef LTV_STRCT FAR * LTVP;
+typedef LTV_STRCT FAR * LTVP; // i.s.o #define LTVP LTV_STRCT FAR *
+
+#if defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a little while longer (4aug2003)
+typedef struct DUI_STRCT { /* "legacy", still used by WVLAN42/43, NDIS drivers use WLAPI */
+ void FAR *ifbp; /* Pointer to IFB
+ * returned from MSF to USF by uil_connect
+ * passed from USF to MSF as a "magic cookie" by all other UIL function calls
+ */
+ hcf_16 stat; // status returned from MSF to USF
+ hcf_16 fun; // command code from USF to MSF
+ LTV_STRCT ltv; /* LTV structure
+ *** during uil_put_info:
+ * the L, T and V-fields carry information from USF to MSF
+ *** during uil_get_info:
+ * the L and T fields carry information from USF to MSF
+ * the L and V-fields carry information from MSF to USF
+ */
+} DUI_STRCT;
+typedef DUI_STRCT FAR * DUIP;
+#endif //defined WVLAN_42 || defined WVLAN_43 //;?keepup with legacy a liitle while longer (4aug2003)
+
+
+typedef struct CFG_CMD_NIC_STRCT { // CFG_CMD_NIC (0x0860) Hermes Engineering command
+ hcf_16 len; //default length of RID
+ hcf_16 typ; //RID identification as defined by Hermes
+ hcf_16 cmd; //Command code (0x003F) and control bits (0xFFC0)
+ hcf_16 parm0; //parameters for Hermes Param0 register
+ hcf_16 parm1; //parameters for Hermes Param1 register
+ hcf_16 parm2; //parameters for Hermes Param2 register
+ hcf_16 stat; //result code from Hermes Status register
+ hcf_16 resp0; //responses from Hermes Resp0 register
+ hcf_16 resp1; //responses from Hermes Resp1 register
+ hcf_16 resp2; //responses from Hermes Resp2 register
+ hcf_16 hcf_stat; //result code from cmd_exe routine
+ hcf_16 ifb_err_cmd; //IFB_ErrCmd
+ hcf_16 ifb_err_qualifier; //IFB_ErrQualifier
+} CFG_CMD_NIC_STRCT;
+
+
+typedef struct CFG_DRV_INFO_STRCT { //CFG_DRV_INFO (0x0825) driver information
+ hcf_16 len; //default length of RID
+ hcf_16 typ; //RID identification as defined by Hermes
+ hcf_8 driver_name[8]; //Driver name, 8 bytes, right zero padded
+ hcf_16 driver_version; //BCD 2 digit major and 2 digit minor driver version
+ hcf_16 HCF_version; //BCD 2 digit major and 2 digit minor HCF version
+ hcf_16 driver_stat; //
+ hcf_16 IO_address; //base IO address used by NIC
+ hcf_16 IO_range; //range of IO addresses used by NIC
+ hcf_16 IRQ_number; //Interrupt used by NIC
+ hcf_16 card_stat; /*NIC status
+ @* 0x8000 Card present
+ @* 0x4000 Card Enabled
+ @* 0x2000 Driver incompatible with NIC Primary Functions
+ @* 0x1000 Driver incompatible with NIC Station Functions */
+ hcf_16 frame_type; /*Frame type
+ @* 0x000 802.3
+ @* 0x008 802.11 */
+ hcf_32 drv_info; /*driver specific info
+ * CE: virtual I/O base */
+}CFG_DRV_INFO_STRCT;
+
+#define COMP_ID_FW_PRI 21 //Primary Functions Firmware
+#define COMP_ID_FW_INTERMEDIATE 22 //Intermediate Functions Firmware
+#define COMP_ID_FW_STA 31 //Station Functions Firmware
+#define COMP_ID_FW_AP 32 //AP Functions Firmware
+#define COMP_ID_FW_AP_FAKE 331 //AP Functions Firmware
+
+#define COMP_ID_MINIPORT_NDIS_31 41 //Windows 9x/NT Miniport NDIS 3.1
+#define COMP_ID_PACKET 42 //Packet
+#define COMP_ID_ODI_16 43 //DOS ODI
+#define COMP_ID_ODI_32 44 //32-bits ODI
+#define COMP_ID_MAC_OS 45 //Macintosh OS
+#define COMP_ID_WIN_CE 46 //Windows CE Miniport
+//#define COMP_ID_LINUX_PD 47 //Linux, HCF-light based, MSF source code in Public Domain
+#define COMP_ID_MINIPORT_NDIS_50 48 //Windows 9x/NT Miniport NDIS 5.0
+#define COMP_ID_LINUX 49 /*Linux, GPL'ed HCF based, full source code in Public Domain
+ *thanks to Andreas Neuhaus */
+#define COMP_ID_QNX 50 //QNX
+#define COMP_ID_MINIPORT_NDIS_50_USB 51 //Windows 9x/NT Miniport NDIS 4.0
+#define COMP_ID_MINIPORT_NDIS_40 52 //Windows 9x/NT Miniport NDIS 4.0
+#define COMP_ID_VX_WORKS_ENDSTA 53 // VxWorks END Station driver
+#define COMP_ID_VX_WORKS_ENDAP 54 // VxWorks END Access Point driver
+//;?#define COMP_ID_MAC_OS_???? 55 //;?check with HM
+#define COMP_ID_VX_WORKS_END 56 // VxWorks END Station/Access Point driver
+// 57 //NucleusOS@ARM Driver.
+#define COMP_ID_WSU 63 /* WaveLAN Station Firmware Update utility
+ * variant 1: Windows
+ * variant 2: DOS
+ */
+#define COMP_ID_AP1 81 //WaveLAN/IEEE AP
+#define COMP_ID_EC 83 //WaveLAN/IEEE Ethernet Converter
+#define COMP_ID_UBL 87 //USB Boot Loader
+
+#define COMP_ROLE_SUPL 0x00 //supplier
+#define COMP_ROLE_ACT 0x01 //actor
+
+ //Supplier - actor
+#define COMP_ID_MFI 0x01 //Modem - Firmware I/F
+#define COMP_ID_CFI 0x02 //Controller - Firmware I/F
+#define COMP_ID_PRI 0x03 //Primary Firmware - Driver I/F
+#define COMP_ID_STA 0x04 //Station Firmware - Driver I/F
+#define COMP_ID_DUI 0x05 //Driver - Utility I/F
+#define COMP_ID_HSI 0x06 //H/W - Driver I/F
+#define COMP_ID_DAI 0x07 //API - Driver I/F
+#define COMP_ID_APF 0x08 //H/W - Driver I/F
+#define COMP_ID_INT 0x09 //Intermediate FW - Driver I/F
+
+#ifdef HCF_LEGACY
+#define HCF_ACT_ACS_SCAN HCF_ACT_PRS_SCAN
+#define UIL_ACT_ACS_SCAN UIL_ACT_PRS_SCAN
+#define MDD_ACT_ACS_SCAN MDD_ACT_PRS_SCAN
+#define CFG_ACS_SCAN CFG_PRS_SCAN
+#endif // HCF_LEGACY
+
+#endif // MDD_H
+
diff --git a/drivers/staging/wlags49_h2/mmd.c b/drivers/staging/wlags49_h2/mmd.c
new file mode 100644
index 000000000000..de138c481a9e
--- /dev/null
+++ b/drivers/staging/wlags49_h2/mmd.c
@@ -0,0 +1,251 @@
+
+// vim:tw=110:ts=4:
+/************************************************************************************************************
+*
+* FILE : mmd.c
+*
+* DATE : $Date: 2004/07/23 11:57:45 $ $Revision: 1.4 $
+* Original: 2004/05/28 14:05:35 Revision: 1.32 Tag: hcf7_t20040602_01
+* Original: 2004/05/13 15:31:45 Revision: 1.30 Tag: hcf7_t7_20040513_01
+* Original: 2004/04/15 09:24:42 Revision: 1.25 Tag: hcf7_t7_20040415_01
+* Original: 2004/04/08 15:18:17 Revision: 1.24 Tag: t7_20040413_01
+* Original: 2004/04/01 15:32:55 Revision: 1.22 Tag: t7_20040401_01
+* Original: 2004/03/10 15:39:28 Revision: 1.18 Tag: t20040310_01
+* Original: 2004/03/03 14:10:12 Revision: 1.16 Tag: t20040304_01
+* Original: 2004/03/02 09:27:12 Revision: 1.14 Tag: t20040302_03
+* Original: 2004/02/24 13:00:29 Revision: 1.12 Tag: t20040224_01
+* Original: 2004/01/30 09:59:33 Revision: 1.11 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* DESC : Common routines for HCF, MSF, UIL as well as USF sources
+*
+* Note: relative to Asserts, the following can be observed:
+* Since the IFB is not known inside the routine, the macro HCFASSERT is replaced with MDDASSERT.
+* Also the line number reported in the assert is raised by FILE_NAME_OFFSET (20000) to discriminate the
+* MMD Asserts from HCF and DHF asserts.
+*
+***************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+**************************************************************************************************************/
+
+#include "hcf.h" // Needed as long as we do not really sort out the mess
+#include "hcfdef.h" // get CNV_LITTLE_TO_SHORT
+#include "mmd.h" // MoreModularDriver common include file
+
+//to distinguish DHF from HCF asserts by means of line number
+#undef FILE_NAME_OFFSET
+#define FILE_NAME_OFFSET DHF_FILE_NAME_OFFSET
+
+
+/*************************************************************************************************************
+*
+*.MODULE CFG_RANGE_SPEC_STRCT* mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp )
+*.PURPOSE Checks compatibility between an actor and a supplier.
+*
+*.ARGUMENTS
+* actp
+* supp
+*
+*.RETURNS
+* NULL incompatible
+* <>NULL pointer to matching CFG_RANGE_SPEC_STRCT substructure in actor-structure matching the supplier
+*
+*.NARRATIVE
+*
+* Parameters:
+* actp address of the actor specification
+* supp address of the supplier specification
+*
+* Description: mmd_check_comp is a support routine to check the compatibility between an actor and a
+* supplier. mmd_check_comp is independent of the endianess of the actp and supp structures. This is
+* achieved by checking the "bottom" or "role" fields of these structures. Since these fields are restricted
+* to a limited range, comparing the contents to a value with a known endian-ess gives a clue to their actual
+* endianess.
+*
+*.DIAGRAM
+*1a: The role-field of the actor structure has a known non-zero, not "byte symmetric" value (namely
+* COMP_ROLE_ACT or 0x0001), so if and only the contents of this field matches COMP_ROLE_ACT (in Native
+* Endian format), the actor structure is Native Endian.
+*2a: Since the role-field of the supplier structure is 0x0000, the test as used for the actor does not work
+* for a supplier. A supplier has always exactly 1 variant,top,bottom record with (officially, but see the
+* note below) each of these 3 values in the range 1 through 99, so one byte of the word value of variant,
+* top and bottom words is 0x00 and the other byte is non-zero. Whether the lowest address byte or the
+* highest address byte is non-zero depends on the Endianess of the LTV. If and only if the word value of
+* bottom is less than 0x0100, the supplier is Native Endian.
+* NOTE: the variant field of the supplier structure can not be used for the Endian Detection Algorithm,
+* because a a zero-valued variant has been used as Controlled Deployment indication in the past.
+* Note: An actor may have multiple sets of variant,top,bottom records, including dummy sets with variant,
+* top and bottom fields with a zero-value. As a consequence the endianess of the actor can not be determined
+* based on its variant,top,bottom values.
+*
+* Note: the L and T field of the structures are always in Native Endian format, so you can not draw
+* conclusions concerning the Endianess of the structure based on these two fields.
+*
+*1b/2b
+* The only purpose of the CFG_RANGE_SPEC_BYTE_STRCT is to give easy access to the non-zero byte of the word
+* value of variant, top and bottom. The variables sup_endian and act_endian are used for the supplier and
+* actor structure respectively. These variables must be 0 when the structure has LE format and 1 if the
+* structure has BE format. This can be phrased as:
+* the variable is false (i.e 0x0000) if either
+* (the platform is LE and the LTV is the same as the platform)
+* or
+* (the platform is BE and the LTV differs from the platform).
+* the variable is true (i.e 0x0001) if either
+* (the platform is BE and the LTV is the same as the platform)
+* or
+* (the platform is LE and the LTV differs from the platform).
+*
+* Alternatively this can be phrased as:
+* if the platform is LE
+* if the LTV is LE (i.e the same as the platform), then the variable = 0
+* else (the LTV is BE (i.e. different from the platform) ), then the variable = 1
+* if the platform is BE
+* if the LTV is BE (i.e the same as the platform), then the variable = 1
+* else (the LTV is LE (i.e. different from the platform) ), then the variable = 0
+*
+* This is implemented as:
+* #if HCF_BIG_ENDIAN == 0 //platform is LE
+* sup/act_endian becomes reverse of structure-endianess as determined in 1a/1b
+* #endif
+*6: Each of the actor variant-bottom-top records is checked against the (single) supplier variant-bottom-top
+* range till either an acceptable match is found or all actor records are tried. As explained above, due to
+* the limited ranges of these values, checking a byte is acceptable and suitable.
+*8: depending on whether a match was found or not (as reflected by the value of the control variable of the
+* for loop), the NULL pointer or a pointer to the matching Number/Bottom/Top record of the Actor structure
+* is returned.
+* As an additional safety, checking the supplier length protects against invalid Supplier structures, which
+* may be caused by failing hcf_get_info (in which case the len-field is zero). Note that the contraption
+* "supp->len != sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1"
+* did turn out not to work for a compiler which padded the structure definition.
+*
+* Note: when consulting references like DesignNotes and Architecture specifications there is a confusing use
+* of the notions number and variant. This resulted in an inconsistent use in the HCF nomenclature as well.
+* This makes the logic hard to follow and one has to be very much aware of the context when walking through
+* the code.
+* NOTE: The Endian Detection Algorithm places limitations on future extensions of the fields, i.e. they should
+* stay within the currently defined boundaries of 1 through 99 (although 1 through 255) would work as well
+* and there should never be used a zero value for the bottom of a valid supplier.
+* Note: relative to Asserts, the following can be observed:
+* 1: Supplier variant 0x0000 has been used for Controlled Deployment
+* 2: An actor may have one or more variant record specifications with a top of zero and a non-zero bottom
+* to override the HCF default support of a particular variant by the MSF programmer via hcfcfg.h
+* 3: An actor range can be specified as all zeros, e.g. as padding in the automatically generated firmware
+* image files.
+*.ENDDOC END DOCUMENTATION
+*************************************************************************************************************/
+CFG_RANGE_SPEC_STRCT*
+mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp )
+{
+
+CFG_RANGE_SPEC_BYTE_STRCT *actq = (CFG_RANGE_SPEC_BYTE_STRCT*)actp->var_rec;
+CFG_RANGE_SPEC_BYTE_STRCT *supq = (CFG_RANGE_SPEC_BYTE_STRCT*)&(supp->variant);
+hcf_16 i;
+int act_endian; //actor endian flag
+int sup_endian; //supplier endian flag
+
+ act_endian = actp->role == COMP_ROLE_ACT; //true if native endian /* 1a */
+ sup_endian = supp->bottom < 0x0100; //true if native endian /* 2a */
+
+#if HCF_ASSERT
+ MMDASSERT( supp->len == 6, supp->len )
+ MMDASSERT( actp->len >= 6 && actp->len%3 == 0, actp->len )
+
+ if ( act_endian ) { //native endian
+ MMDASSERT( actp->role == COMP_ROLE_ACT, actp->role )
+ MMDASSERT( 1 <= actp->id && actp->id <= 99, actp->id )
+ } else { //non-native endian
+ MMDASSERT( actp->role == CNV_END_SHORT(COMP_ROLE_ACT), actp->role )
+ MMDASSERT( 1 <= CNV_END_SHORT(actp->id) && CNV_END_SHORT(actp->id) <= 99, actp->id )
+ }
+ if ( sup_endian ) { //native endian
+ MMDASSERT( supp->role == COMP_ROLE_SUPL, supp->role )
+ MMDASSERT( 1 <= supp->id && supp->id <= 99, supp->id )
+ MMDASSERT( 1 <= supp->variant && supp->variant <= 99, supp->variant )
+ MMDASSERT( 1 <= supp->bottom && supp->bottom <= 99, supp->bottom )
+ MMDASSERT( 1 <= supp->top && supp->top <= 99, supp->top )
+ MMDASSERT( supp->bottom <= supp->top, supp->bottom << 8 | supp->top )
+ } else { //non-native endian
+ MMDASSERT( supp->role == CNV_END_SHORT(COMP_ROLE_SUPL), supp->role )
+ MMDASSERT( 1 <= CNV_END_SHORT(supp->id) && CNV_END_SHORT(supp->id) <= 99, supp->id )
+ MMDASSERT( 1 <= CNV_END_SHORT(supp->variant) && CNV_END_SHORT(supp->variant) <= 99, supp->variant )
+ MMDASSERT( 1 <= CNV_END_SHORT(supp->bottom) && CNV_END_SHORT(supp->bottom) <=99, supp->bottom )
+ MMDASSERT( 1 <= CNV_END_SHORT(supp->top) && CNV_END_SHORT(supp->top) <=99, supp->top )
+ MMDASSERT( CNV_END_SHORT(supp->bottom) <= CNV_END_SHORT(supp->top), supp->bottom << 8 | supp->top )
+ }
+#endif // HCF_ASSERT
+
+#if HCF_BIG_ENDIAN == 0
+ act_endian = !act_endian; /* 1b*/
+ sup_endian = !sup_endian; /* 2b*/
+#endif // HCF_BIG_ENDIAN
+
+ for ( i = actp->len ; i > 3; actq++, i -= 3 ) { /* 6 */
+ MMDASSERT( actq->variant[act_endian] <= 99, i<<8 | actq->variant[act_endian] )
+ MMDASSERT( actq->bottom[act_endian] <= 99 , i<<8 | actq->bottom[act_endian] )
+ MMDASSERT( actq->top[act_endian] <= 99 , i<<8 | actq->top[act_endian] )
+ MMDASSERT( actq->bottom[act_endian] <= actq->top[act_endian], i<<8 | actq->bottom[act_endian] )
+ if ( actq->variant[act_endian] == supq->variant[sup_endian] &&
+ actq->bottom[act_endian] <= supq->top[sup_endian] &&
+ actq->top[act_endian] >= supq->bottom[sup_endian]
+ ) break;
+ }
+ if ( i <= 3 || supp->len != 6 /*sizeof(CFG_SUP_RANGE_STRCT)/sizeof(hcf_16) - 1 */ ) {
+ actq = NULL; /* 8 */
+ }
+#if HCF_ASSERT
+ if ( actq == NULL ) {
+ for ( i = 0; i <= supp->len; i += 2 ) {
+ MMDASSERT( DO_ASSERT, MERGE_2( ((hcf_16*)supp)[i], ((hcf_16*)supp)[i+1] ) );
+ }
+ for ( i = 0; i <= actp->len; i += 2 ) {
+ MMDASSERT( DO_ASSERT, MERGE_2( ((hcf_16*)actp)[i], ((hcf_16*)actp)[i+1] ) );
+ }
+ }
+#endif // HCF_ASSERT
+ return (CFG_RANGE_SPEC_STRCT*)actq;
+} // mmd_check_comp
+
diff --git a/drivers/staging/wlags49_h2/mmd.h b/drivers/staging/wlags49_h2/mmd.h
new file mode 100644
index 000000000000..06890c1b30a4
--- /dev/null
+++ b/drivers/staging/wlags49_h2/mmd.h
@@ -0,0 +1,78 @@
+
+// vim:tw=110:ts=4:
+#ifndef MMD_H
+#define MMD_H 1
+
+/*************************************************************************************************************
+*
+* FILE : mmd.h
+*
+* DATE : $Date: 2004/07/19 08:16:14 $ $Revision: 1.2 $
+* Original: 2004/05/17 07:33:14 Revision: 1.18 Tag: hcf7_t20040602_01
+* Original: 2004/05/11 06:22:59 Revision: 1.17 Tag: hcf7_t7_20040513_01
+* Original: 2004/04/15 09:24:42 Revision: 1.13 Tag: hcf7_t7_20040415_01
+* Original: 2004/04/08 15:18:17 Revision: 1.12 Tag: t7_20040413_01
+* Original: 2004/04/01 15:32:55 Revision: 1.10 Tag: t7_20040401_01
+* Original: 2004/03/04 16:47:50 Revision: 1.7 Tag: t20040310_01
+* Original: 2004/03/03 12:47:05 Revision: 1.6 Tag: t20040304_01
+* Original: 2004/02/25 14:14:39 Revision: 1.5 Tag: t20040302_03
+* Original: 2004/02/24 13:00:29 Revision: 1.4 Tag: t20040224_01
+* Original: 2004/01/30 09:59:33 Revision: 1.3 Tag: t20040219_01
+*
+* AUTHOR : Nico Valster
+*
+* DESC : Definitions and Prototypes for HCF, MSF, UIL as well as USF sources
+*
+***************************************************************************************************************
+*
+*
+* SOFTWARE LICENSE
+*
+* This software is provided subject to the following terms and conditions,
+* which you should read carefully before using the software. Using this
+* software indicates your acceptance of these terms and conditions. If you do
+* not agree with these terms and conditions, do not use the software.
+*
+* COPYRIGHT © 2001 - 2004 by Agere Systems Inc. All Rights Reserved
+* All rights reserved.
+*
+* Redistribution and use in source or binary forms, with or without
+* modifications, are permitted provided that the following conditions are met:
+*
+* . Redistributions of source code must retain the above copyright notice, this
+* list of conditions and the following Disclaimer as comments in the code as
+* well as in the documentation and/or other materials provided with the
+* distribution.
+*
+* . Redistributions in binary form must reproduce the above copyright notice,
+* this list of conditions and the following Disclaimer in the documentation
+* and/or other materials provided with the distribution.
+*
+* . Neither the name of Agere Systems Inc. nor the names of the contributors
+* may be used to endorse or promote products derived from this software
+* without specific prior written permission.
+*
+* Disclaimer
+*
+* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+* INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+* USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+* RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+* ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+* DAMAGE.
+*
+*
+**************************************************************************************************************/
+#ifndef HCF_H
+#include "hcf.h" //just to get going with swig
+#endif
+
+EXTERN_C CFG_RANGE_SPEC_STRCT* mmd_check_comp( CFG_RANGES_STRCT *actp, CFG_SUP_RANGE_STRCT *supp );
+
+#endif // MMD_H
diff --git a/drivers/staging/wlags49_h2/sta_h2.c b/drivers/staging/wlags49_h2/sta_h2.c
new file mode 100644
index 000000000000..f9a38523724c
--- /dev/null
+++ b/drivers/staging/wlags49_h2/sta_h2.c
@@ -0,0 +1,4480 @@
+/*
+ * File: sta_h24.236
+ *
+ * Abstract: This file contains memory image 'fw_image'.
+ *
+ * Contents: Total size of the memory image: 69294 bytes.
+ * Total number of blocks: 4 blocks.
+ * Block 1 : load address 00000060, 390 bytes.
+ * Block 2 : load address 00000C16, 9496 bytes.
+ * Block 3 : load address 001E312E, 15786 bytes.
+ * Block 4 : load address 001F4000, 43622 bytes.
+ *
+ * Identity: component id: 31 (variant 3) version 2.36
+ *
+ * Compatibility:
+ * supplying interface 4 (variant 2) : 2 - 5
+ * acting on interface 1 (variant 4) : 6 - 7
+ * acting on interface 1 (variant 5) : 6 - 7
+ * acting on interface 1 (variant 6) : 6 - 7
+ * acting on interface 2 (variant 2) : 1 - 2
+ *
+ * Generated: by g:\fw\fupu3.exe version 4.26
+ *
+ * Commandline: g:\fw\fupu3.exe /f=4 /n=fw_image /i=r3023600.hex
+ */
+
+
+#include "hcfcfg.h" // to get hcf_16 etc defined as well as
+ // possible settings which inluence mdd.h or dhf.h
+#include "mdd.h" //to get COMP_ID_STA etc defined
+#include "dhf.h" //used to be "fhfmem.h", to get memblock,plugrecord,
+
+static const hcf_8 fw_image_1_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x0D, 0x00, 0x00,
+ 0x3A, 0x0C, 0x00, 0x00, 0x3A, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x1B, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x86, 0x19, 0x86, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00,
+ 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0xEA, 0x00, 0x00, 0xFF, 0x07, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x10, 0x27, 0x10, 0x27,
+ 0x14, 0x00, 0xD0, 0x07, 0xD0, 0x07, 0x10, 0x27, 0x2F, 0x00, 0x32, 0x00, 0x32, 0x00, 0x05, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x10, 0x27, 0x05, 0x00, 0x00, 0x02, 0x00, 0x02, 0x13, 0x00, 0x0A, 0x00,
+ 0x07, 0x00, 0x03, 0x00, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x09, 0x2B, 0x09, 0x2B, 0x09,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x00, 0x14, 0x01, 0x00, 0x40, 0x00, 0x32, 0x00, 0x32, 0x00,
+ 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_1_data */
+
+static const hcf_8 fw_image_2_data[] = {
+ 0x4B, 0xA3, 0x00, 0x0A, 0x10, 0x01, 0x68, 0xA4, 0xB0, 0x01, 0x84, 0x01, 0x30, 0x33, 0x31, 0x33,
+ 0x44, 0x44, 0x30, 0x33, 0x31, 0x33, 0x30, 0x33, 0x31, 0x33, 0x32, 0x33, 0x32, 0x33, 0x90, 0x00,
+ 0x78, 0x04, 0xAE, 0xE4, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B,
+ 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA5, 0xC6, 0x84, 0xF8, 0x99, 0xEE,
+ 0x8D, 0xF6, 0x0D, 0xFF, 0xBD, 0xD6, 0xB1, 0xDE, 0x54, 0x91, 0x50, 0x60, 0x03, 0x02, 0xA9, 0xCE,
+ 0x7D, 0x56, 0x19, 0xE7, 0x62, 0xB5, 0xE6, 0x4D, 0x9A, 0xEC, 0x45, 0x8F, 0x9D, 0x1F, 0x40, 0x89,
+ 0x87, 0xFA, 0x15, 0xEF, 0xEB, 0xB2, 0xC9, 0x8E, 0x0B, 0xFB, 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 0x30, 0x00, 0x03, 0x00, 0x0F, 0x00, 0x3E, 0x00, 0x3C, 0x00, 0x02, 0x00, 0x04, 0x00,
+ 0x0A, 0x00, 0x0B, 0x00, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x63, 0x00, 0x63, 0x00, 0x20, 0x00, 0x63, 0x00, 0x63, 0x00, 0x20, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0xA0, 0x10,
+ 0xEE, 0x10, 0xA6, 0x10, 0xE8, 0x10, 0xAC, 0x10, 0xE2, 0x10, 0xB2, 0x10, 0xDC, 0x10, 0xB8, 0x10,
+ 0xD6, 0x10, 0xBE, 0x10, 0xD0, 0x10, 0xC4, 0x10, 0xCA, 0x10, 0x07, 0x01, 0x00, 0x00, 0x0A, 0x22,
+ 0x00, 0x04, 0x08, 0x01, 0x00, 0x00, 0x0A, 0x26, 0x00, 0x04, 0x09, 0x01, 0x00, 0x00, 0x0A, 0x2A,
+ 0x00, 0x04, 0x0A, 0x01, 0x00, 0x00, 0x0A, 0x2E, 0x00, 0x04, 0x0B, 0x01, 0x00, 0x00, 0x10, 0x24,
+ 0x04, 0x04, 0x0C, 0x01, 0x00, 0x00, 0x10, 0x28, 0x04, 0x04, 0x0D, 0x01, 0x00, 0x00, 0x10, 0x2C,
+ 0x04, 0x04, 0x0E, 0x01, 0x00, 0x00, 0x10, 0x30, 0x04, 0x04, 0x0F, 0x01, 0x00, 0x00, 0x16, 0x34,
+ 0x08, 0x04, 0x10, 0x01, 0x00, 0x00, 0x16, 0x38, 0x08, 0x04, 0x11, 0x01, 0x00, 0x00, 0x16, 0x3C,
+ 0x08, 0x04, 0x12, 0x01, 0x00, 0x00, 0x16, 0x40, 0x08, 0x04, 0x13, 0x01, 0x00, 0x00, 0x17, 0x64,
+ 0x0C, 0x0B, 0x14, 0x01, 0x00, 0x00, 0x17, 0x68, 0x0C, 0x0B, 0x15, 0x01, 0x00, 0x00, 0x17, 0x6C,
+ 0x0C, 0x0B, 0x16, 0x01, 0x00, 0x00, 0x17, 0x70, 0x0C, 0x0B, 0x17, 0x01, 0x00, 0x00, 0x17, 0x74,
+ 0x0C, 0x0B, 0x18, 0x01, 0x00, 0x00, 0x17, 0x78, 0x0C, 0x0B, 0x19, 0x01, 0x00, 0x00, 0x17, 0x7C,
+ 0x0C, 0x0B, 0x1A, 0x01, 0x00, 0x00, 0x17, 0x80, 0x0C, 0x0B, 0x1B, 0x01, 0x00, 0x00, 0x17, 0x84,
+ 0x0C, 0x0B, 0x1C, 0x01, 0x00, 0x00, 0x17, 0x88, 0x0C, 0x0B, 0x1D, 0x01, 0x00, 0x00, 0x17, 0x8C,
+ 0x0C, 0x0B, 0x1E, 0x01, 0x00, 0x00, 0x1D, 0x95, 0x17, 0x04, 0x1F, 0x01, 0x00, 0x00, 0x1D, 0x99,
+ 0x17, 0x04, 0x20, 0x01, 0x00, 0x00, 0x1D, 0x9D, 0x17, 0x04, 0x21, 0x01, 0x00, 0x00, 0x1D, 0xA1,
+ 0x17, 0x04, 0x22, 0x01, 0x00, 0x00, 0x0E, 0xA5, 0x00, 0x00, 0x10, 0x11, 0x30, 0x11, 0x50, 0x11,
+ 0x70, 0x11, 0xC8, 0x11, 0x18, 0x11, 0x38, 0x11, 0x58, 0x11, 0x78, 0x11, 0xD0, 0x11, 0x20, 0x11,
+ 0x40, 0x11, 0x60, 0x11, 0x80, 0x11, 0xD8, 0x11, 0x28, 0x11, 0x48, 0x11, 0x68, 0x11, 0x88, 0x11,
+ 0xE0, 0x11, 0x90, 0x11, 0x98, 0x11, 0xA0, 0x11, 0xA8, 0x11, 0xB0, 0x11, 0xB8, 0x11, 0xC0, 0x11,
+ 0xE8, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBE, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x36, 0x25, 0x4F, 0x25, 0x72, 0x25, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xAC, 0x25,
+ 0x02, 0x2B, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xF3, 0x2D, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24,
+ 0xE1, 0x24, 0xE1, 0x24, 0x8B, 0x27, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24,
+ 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x24,
+ 0xE1, 0x24, 0xE1, 0x24, 0xE5, 0x27, 0xE1, 0x24, 0xE1, 0x24, 0xE1, 0x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, 0x3B, 0x2C, 0x00, 0x00, 0x00, 0x00,
+ 0xB8, 0xFC, 0x1F, 0x28, 0x98, 0x2C, 0x00, 0x00, 0x00, 0x00, 0xB5, 0xFC, 0x4C, 0x28, 0x62, 0x28,
+ 0xC6, 0x2D, 0x02, 0x00, 0xB9, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xC8, 0x2D, 0x02, 0x00, 0x90, 0xFD,
+ 0x4C, 0x28, 0x29, 0x28, 0xCC, 0x2D, 0x02, 0x00, 0x23, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xD2, 0x28,
+ 0x02, 0x00, 0x29, 0xFC, 0x44, 0x29, 0xF1, 0x28, 0x00, 0x00, 0x00, 0x00, 0xC2, 0xFC, 0x4C, 0x28,
+ 0x62, 0x28, 0x0E, 0x2D, 0x02, 0x00, 0x32, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xA0, 0x01, 0x02, 0x00,
+ 0x33, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xA2, 0x01, 0x02, 0x00, 0x00, 0xFC, 0x4C, 0x28, 0x62, 0x28,
+ 0x56, 0x28, 0x02, 0x00, 0x01, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0x50, 0x28, 0x06, 0x00, 0x02, 0xFC,
+ 0x4C, 0x28, 0xDC, 0x28, 0xA4, 0x29, 0x22, 0x00, 0x05, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0x46, 0x28,
+ 0x02, 0x00, 0x08, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0x4A, 0x28, 0x06, 0x00, 0x09, 0xFC, 0x4C, 0x28,
+ 0x62, 0x28, 0x9E, 0x28, 0x02, 0x00, 0x0B, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xA0, 0x28, 0x02, 0x00,
+ 0x0C, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xA2, 0x28, 0x02, 0x00, 0x0D, 0xFC, 0x4C, 0x28, 0x62, 0x28,
+ 0xA4, 0x28, 0x02, 0x00, 0x21, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xCE, 0x28, 0x02, 0x00, 0x80, 0xFC,
+ 0xB8, 0x28, 0xC8, 0x28, 0xE2, 0x28, 0xC0, 0x00, 0x81, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xA8, 0x01,
+ 0x02, 0x00, 0x83, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xAC, 0x01, 0x02, 0x00, 0x85, 0xFC, 0x4C, 0x28,
+ 0x49, 0x2A, 0xA6, 0x01, 0x02, 0x00, 0x86, 0xFC, 0x4C, 0x28, 0x5B, 0x2A, 0xB2, 0x01, 0x02, 0x00,
+ 0x28, 0xFC, 0x4C, 0x28, 0x62, 0x28, 0xDC, 0x28, 0x02, 0x00, 0x87, 0xFC, 0x4C, 0x28, 0x62, 0x28,
+ 0xEC, 0x29, 0x22, 0x03, 0x84, 0xFC, 0x4C, 0x28, 0x70, 0x2A, 0xB0, 0x01, 0x02, 0x00, 0x2B, 0xFC,
+ 0x4C, 0x28, 0x62, 0x28, 0x14, 0x31, 0x02, 0x00, 0xF8, 0xFF, 0x4C, 0x28, 0x62, 0x28, 0x0E, 0x31,
+ 0x02, 0x00, 0xF3, 0xFF, 0x4C, 0x28, 0x62, 0x28, 0x16, 0x31, 0x02, 0x00, 0x20, 0xFD, 0x7D, 0x28,
+ 0x29, 0x28, 0x23, 0x34, 0x08, 0x00, 0x21, 0xFD, 0x7D, 0x28, 0x29, 0x28, 0x27, 0x34, 0x0A, 0x00,
+ 0x22, 0xFD, 0x7D, 0x28, 0x29, 0x28, 0x2C, 0x34, 0x16, 0x00, 0x23, 0xFD, 0x7D, 0x28, 0x29, 0x28,
+ 0x37, 0x34, 0x0A, 0x00, 0x10, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x74, 0x01, 0x02, 0x00, 0x45, 0xFD,
+ 0x4C, 0x28, 0x29, 0x28, 0x00, 0x01, 0x02, 0x00, 0x47, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x78, 0x01,
+ 0x02, 0x00, 0x48, 0xFD, 0x9A, 0x29, 0x29, 0x28, 0xA0, 0x01, 0x02, 0x00, 0x49, 0xFD, 0x9A, 0x29,
+ 0x29, 0x28, 0xA2, 0x01, 0x02, 0x00, 0x4A, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x98, 0x01, 0x02, 0x00,
+ 0x4B, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x9A, 0x01, 0x02, 0x00, 0x4D, 0xFD, 0x7D, 0x28, 0x29, 0x28,
+ 0x3C, 0x34, 0x04, 0x00, 0x4F, 0xFD, 0xAE, 0x29, 0x29, 0x28, 0x1A, 0x2D, 0x02, 0x00, 0xC0, 0xFD,
+ 0x7D, 0x28, 0x29, 0x28, 0x3E, 0x34, 0x02, 0x00, 0xC2, 0xFD, 0xA4, 0x29, 0x29, 0x28, 0x00, 0x00,
+ 0x02, 0x00, 0xC3, 0xFD, 0x7D, 0x28, 0x29, 0x28, 0x3F, 0x34, 0x02, 0x00, 0x40, 0xFD, 0x75, 0x28,
+ 0x29, 0x28, 0xB8, 0x01, 0x02, 0x00, 0x24, 0xFD, 0xCB, 0x29, 0x29, 0x28, 0x00, 0x00, 0x02, 0x00,
+ 0x91, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x20, 0x24, 0x02, 0x00, 0x93, 0xFD, 0x4C, 0x28, 0x29, 0x28,
+ 0x26, 0x24, 0x02, 0x00, 0xC1, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0xFE, 0x00, 0x02, 0x00, 0xC6, 0xFD,
+ 0xAA, 0x28, 0x29, 0x28, 0x28, 0x2D, 0x0A, 0x00, 0x89, 0xFD, 0x5B, 0x29, 0x29, 0x28, 0x00, 0x00,
+ 0x00, 0x00, 0x8A, 0xFD, 0x9A, 0x28, 0x29, 0x28, 0xA0, 0x2D, 0x24, 0x00, 0x41, 0xFD, 0x4C, 0x28,
+ 0x29, 0x28, 0x7A, 0x2D, 0x22, 0x00, 0x42, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x02, 0x01, 0x06, 0x00,
+ 0x43, 0xFD, 0xD8, 0x29, 0x29, 0x28, 0x00, 0x00, 0x06, 0x00, 0x44, 0xFD, 0xB8, 0x29, 0x29, 0x28,
+ 0xB4, 0x01, 0x02, 0x00, 0x46, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0xBA, 0x01, 0x0C, 0x00, 0x4C, 0xFD,
+ 0x4C, 0x28, 0x29, 0x28, 0xEA, 0x29, 0x02, 0x00, 0x50, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0xF4, 0x00,
+ 0x02, 0x00, 0x51, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0xF6, 0x00, 0x02, 0x00, 0x52, 0xFD, 0x4C, 0x28,
+ 0x29, 0x28, 0xC6, 0x01, 0x02, 0x00, 0x8F, 0xFD, 0xEB, 0x29, 0x29, 0x28, 0x00, 0x00, 0x08, 0x00,
+ 0x92, 0xFD, 0x4C, 0x28, 0x29, 0x28, 0x54, 0x2D, 0x02, 0x00, 0x8C, 0xFD, 0x3F, 0x28, 0x29, 0x28,
+ 0x08, 0x2E, 0x56, 0x00, 0x8D, 0xFD, 0x3F, 0x28, 0x29, 0x28, 0x62, 0x2E, 0x14, 0x00, 0x00, 0xF1,
+ 0x46, 0x00, 0xE3, 0x27, 0x3A, 0x01, 0x01, 0xF1, 0x44, 0x07, 0xE1, 0x27, 0x3C, 0x01, 0x00, 0x03,
+ 0x2A, 0x68, 0x1E, 0x00, 0x76, 0x01, 0xFE, 0x00, 0xD6, 0x01, 0x02, 0x01, 0x3E, 0x01, 0xB8, 0x01,
+ 0x74, 0x27, 0x5A, 0x01, 0x20, 0x24, 0x20, 0x00, 0x00, 0x00, 0xBA, 0x1C, 0x00, 0x00, 0xBE, 0x1E,
+ 0x54, 0x01, 0x0B, 0x00, 0xBA, 0x00, 0xE4, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0xAF, 0x37, 0xAF, 0x43, 0xB0,
+ 0x4C, 0xB0, 0x48, 0xAF, 0xDE, 0xAF, 0xB6, 0xAF, 0x1C, 0x33, 0x7F, 0x32, 0x1C, 0x33, 0xF3, 0x32,
+ 0x89, 0x32, 0x7D, 0x32, 0x3B, 0x33, 0x4C, 0x33, 0x4C, 0x33, 0x4C, 0x33, 0x55, 0x33, 0x70, 0x33,
+ 0xCD, 0x33, 0xE9, 0x33, 0xF4, 0x32, 0x07, 0x33, 0xDB, 0x32, 0x10, 0x00, 0x12, 0x00, 0x13, 0x00,
+ 0x20, 0x00, 0x21, 0x00, 0x22, 0x00, 0x30, 0x00, 0x31, 0x00, 0x32, 0x00, 0x33, 0x00, 0x34, 0x00,
+ 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x39, 0x00, 0x3A, 0x00, 0x00, 0x00, 0x14, 0x01,
+ 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0x14, 0x01, 0xF3, 0x02,
+ 0xAD, 0x03, 0x60, 0x04, 0x04, 0x05, 0x07, 0x06, 0x08, 0x07, 0x0A, 0x08, 0x16, 0x09, 0x44, 0x0A,
+ 0x04, 0x0B, 0x40, 0x0C, 0x80, 0x0D, 0x00, 0x0E, 0x84, 0x0F, 0x01, 0x10, 0x10, 0x11, 0x02, 0x14,
+ 0x40, 0x20, 0x32, 0x21, 0x32, 0x22, 0x04, 0x23, 0x01, 0x24, 0x0F, 0x25, 0x00, 0x26, 0x00, 0x27,
+ 0x00, 0x28, 0x00, 0x29, 0x00, 0x2A, 0x01, 0x2B, 0x06, 0x2C, 0x00, 0x38, 0x00, 0x39, 0xD6, 0x3A,
+ 0x00, 0x3B, 0x00, 0x3C, 0x14, 0x3D, 0x7F, 0x3E, 0x00, 0x3F, 0x68, 0x40, 0x75, 0x41, 0x07, 0x42,
+ 0x07, 0x43, 0x00, 0x45, 0x3B, 0x4A, 0x00, 0x4B, 0x00, 0x4C, 0x0F, 0x4D, 0x02, 0x75, 0x00, 0x76,
+ 0x80, 0x00, 0x08, 0x01, 0x09, 0x01, 0x09, 0x01, 0x0A, 0x01, 0x0A, 0x01, 0x0B, 0x01, 0x0B, 0x01,
+ 0x0C, 0x01, 0x0C, 0x01, 0x0D, 0x01, 0x0D, 0x01, 0x0E, 0x01, 0x0E, 0x01, 0x0F, 0x01, 0x0F, 0x01,
+ 0x10, 0x01, 0x10, 0x01, 0x11, 0x01, 0x11, 0x01, 0x12, 0x01, 0x12, 0x01, 0x13, 0x01, 0x13, 0x01,
+ 0x14, 0x01, 0x14, 0x01, 0x15, 0x01, 0x15, 0x01, 0x16, 0x01, 0x16, 0x01, 0x17, 0x01, 0x17, 0x01,
+ 0x18, 0x01, 0x18, 0x01, 0x19, 0x01, 0x19, 0x01, 0x4D, 0x01, 0x4D, 0x01, 0x4E, 0x01, 0x4E, 0x01,
+ 0x4F, 0x01, 0x4F, 0x01, 0x50, 0x01, 0x50, 0x01, 0x51, 0x01, 0x51, 0x01, 0x52, 0x01, 0x52, 0x01,
+ 0x53, 0x01, 0x53, 0x01, 0x54, 0x01, 0x54, 0x01, 0x65, 0x01, 0x65, 0x01, 0x66, 0x01, 0x66, 0x01,
+ 0x67, 0x01, 0x67, 0x01, 0x68, 0x01, 0x68, 0x01, 0x69, 0x01, 0x69, 0x01, 0x6A, 0x01, 0x6A, 0x01,
+ 0x6B, 0x01, 0x6B, 0x01, 0x6C, 0x01, 0x6C, 0x01, 0x6D, 0x01, 0x6D, 0x01, 0x6E, 0x01, 0x6E, 0x01,
+ 0x6F, 0x01, 0x6F, 0x01, 0x70, 0x01, 0x70, 0x01, 0x71, 0x01, 0x71, 0x01, 0x72, 0x01, 0x72, 0x01,
+ 0x73, 0x01, 0x73, 0x01, 0x74, 0x01, 0x74, 0x01, 0x75, 0x01, 0x75, 0x01, 0x76, 0x01, 0x76, 0x01,
+ 0x77, 0x01, 0x77, 0x01, 0x78, 0x01, 0x78, 0x01, 0x79, 0x01, 0x79, 0x01, 0x7A, 0x01, 0x7A, 0x01,
+ 0x7B, 0x01, 0x7B, 0x01, 0x7C, 0x01, 0x7C, 0x01, 0x7D, 0x01, 0x7D, 0x01, 0x7E, 0x01, 0x7E, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01, 0x7F, 0x01,
+ 0x7F, 0x01, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12,
+ 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x12, 0x80, 0x13,
+ 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13,
+ 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x80, 0x13, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44,
+ 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x51, 0x44,
+ 0x51, 0x44, 0x51, 0x44, 0x51, 0x44, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46,
+ 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x23, 0x46, 0x23, 0x46,
+ 0x23, 0x46, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1D, 0x47, 0x9A, 0x48,
+ 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48,
+ 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0x33, 0x48, 0x78, 0x49, 0x78, 0x49, 0x79, 0x49,
+ 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7B, 0x49,
+ 0x7B, 0x49, 0x7B, 0x49, 0x7C, 0x49, 0x32, 0x00, 0x46, 0x00, 0x5A, 0x00, 0x6E, 0x00, 0x82, 0x00,
+ 0x96, 0x00, 0xAA, 0x00, 0xBE, 0x00, 0xD2, 0x00, 0xE6, 0x00, 0xFA, 0x00, 0x0E, 0x01, 0x22, 0x01,
+ 0x52, 0x01, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x03, 0x00, 0x03, 0x00,
+ 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65,
+ 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00,
+ 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65,
+ 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00,
+ 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x46, 0x69, 0x72, 0x73, 0x74, 0x20, 0x57, 0x61, 0x76, 0x65, 0x4C, 0x41, 0x4E, 0x20, 0x49, 0x49,
+ 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x19, 0x00, 0x02, 0x01, 0x82, 0x84, 0x8B, 0x96, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x85, 0x00, 0x01,
+ 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x01, 0x00, 0x01,
+ 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x43, 0x75, 0x72, 0x72, 0x65, 0x6E, 0x74, 0x20, 0x53,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x53, 0x65, 0x74, 0x20, 0x49, 0x64, 0x65, 0x6E, 0x74,
+ 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x00, 0x00, 0x00, 0x00, 0x06, 0xDD, 0x00, 0x50, 0xF2, 0x01,
+ 0x01, 0x00, 0x00, 0x50, 0xF2, 0x05, 0x02, 0x00, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x50, 0xF2, 0x04,
+ 0x02, 0x00, 0x00, 0x50, 0xF2, 0x00, 0x00, 0x50, 0xF2, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x15, 0x00, 0x14, 0x00, 0x15, 0x00, 0x36, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x14, 0x00,
+ 0x11, 0x00, 0x36, 0x00, 0x01, 0x00, 0x04, 0x00, 0x7A, 0x2D, 0x28, 0x2D, 0x0C, 0x2F, 0x10, 0x2F,
+ 0x14, 0x2F, 0xA0, 0x2D, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xC6, 0x29, 0x28, 0x2D,
+ 0xFF, 0xFF, 0x00, 0x00, 0x7A, 0x2D, 0x28, 0x2D, 0x0C, 0x2F, 0x10, 0x2F, 0x14, 0x2F, 0xA0, 0x2D,
+ 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x7A, 0x2D, 0x28, 0x2D, 0xFF, 0xFF, 0xE6, 0x2D,
+ 0x34, 0x2D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x00, 0x02, 0x06, 0x00, 0x00, 0x06, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_2_data */
+
+static const hcf_8 fw_image_3_data[] = {
+ 0x00, 0xE1, 0x30, 0x40, 0x02, 0x36, 0xA1, 0xFF, 0x83, 0xFF, 0x8D, 0xFF, 0x5C, 0x44, 0x5C, 0x43,
+ 0x5C, 0x42, 0x5C, 0x41, 0x5C, 0x40, 0xAC, 0xFF, 0xAD, 0xFF, 0xE7, 0xE1, 0xAD, 0x60, 0x08, 0x78,
+ 0xFF, 0xFF, 0x30, 0x44, 0x02, 0xA8, 0x00, 0xE1, 0x03, 0x02, 0x28, 0xE2, 0x40, 0xFF, 0xA1, 0xFF,
+ 0x84, 0xFF, 0xBB, 0x60, 0x18, 0x64, 0x40, 0x42, 0xB0, 0x60, 0x97, 0x64, 0x40, 0x40, 0xBD, 0xF3,
+ 0x80, 0xFB, 0x0F, 0x60, 0x9A, 0x63, 0xCA, 0xF3, 0xBD, 0xDB, 0x00, 0x60, 0x9A, 0x64, 0xBD, 0xDB,
+ 0x02, 0x64, 0xBD, 0xDB, 0x04, 0x64, 0xA3, 0xDB, 0x5C, 0x49, 0x0A, 0x64, 0x40, 0x4B, 0x5C, 0x5C,
+ 0x01, 0x60, 0x39, 0xE2, 0x04, 0x60, 0x00, 0x7A, 0x89, 0xFF, 0x03, 0x60, 0xFF, 0x73, 0x88, 0xFF,
+ 0xB0, 0x60, 0x97, 0x78, 0xFF, 0xFF, 0x30, 0x44, 0x02, 0xA8, 0x00, 0xE1, 0x06, 0x02, 0x40, 0xFF,
+ 0x42, 0xFF, 0x43, 0xFF, 0x44, 0xFF, 0x45, 0xFF, 0xA1, 0xFF, 0x88, 0xFF, 0x85, 0xFF, 0x21, 0xE1,
+ 0x5C, 0x40, 0xBB, 0x60, 0x20, 0x78, 0xFF, 0xFF,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x94, 0x80, 0xFF, 0xFF, 0xD4, 0x02, 0x60, 0x45, 0x28, 0x47, 0x2A, 0x5F, 0x40, 0x48, 0x2A, 0x47,
+ 0x2C, 0x5F, 0x40, 0x4A, 0x2C, 0x47, 0x65, 0x5F, 0x40, 0x4C, 0x10, 0x64, 0x40, 0x42, 0x28, 0x45,
+ 0x05, 0x00, 0x58, 0x4F, 0x47, 0x00, 0x94, 0x80, 0x28, 0x45, 0x26, 0x02, 0x58, 0x4F, 0x42, 0x00,
+ 0x94, 0x80, 0x2A, 0x45, 0x21, 0x02, 0x58, 0x4F, 0x3D, 0x00, 0x94, 0x80, 0xFF, 0xFF, 0x1C, 0x02,
+ 0x22, 0x44, 0x4C, 0x82, 0x2C, 0x45, 0x31, 0x03, 0xEC, 0x01, 0x10, 0x65, 0x45, 0x42, 0x28, 0x45,
+ 0x94, 0x80, 0x2A, 0x45, 0x21, 0x02, 0x58, 0x4F, 0x2D, 0x00, 0x94, 0x80, 0x2C, 0x45, 0x1C, 0x02,
+ 0x58, 0x4F, 0x28, 0x00, 0x94, 0x80, 0xFF, 0xFF, 0x17, 0x02, 0x22, 0x44, 0x4C, 0x82, 0x28, 0x45,
+ 0x1C, 0x03, 0x58, 0x4F, 0x1F, 0x00, 0xEC, 0x01, 0x40, 0x4B, 0x28, 0x47, 0x40, 0x48, 0x2A, 0x47,
+ 0x40, 0x4A, 0x2C, 0x47, 0x60, 0x45, 0x2A, 0x5E, 0x40, 0x4C, 0x2A, 0x44, 0x28, 0x5E, 0x40, 0x4A,
+ 0x28, 0x44, 0x65, 0x5E, 0x40, 0x48, 0x2B, 0x44, 0x68, 0x65, 0xD7, 0x80, 0xFF, 0xFF, 0x17, 0x0E,
+ 0x90, 0x01, 0x26, 0x46, 0xC5, 0x60, 0x5B, 0x78, 0xFF, 0xFF, 0xB9, 0xFF, 0x26, 0x46, 0xC5, 0x60,
+ 0x5B, 0x78, 0xFF, 0xFF, 0xC9, 0x81, 0xCB, 0x83, 0x07, 0x1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64, 0x41, 0x28, 0x43, 0x00, 0x65, 0x45, 0x4C, 0x65, 0x5C,
+ 0xBD, 0xD3, 0x61, 0x40, 0x00, 0x36, 0x27, 0x00, 0xCD, 0x81, 0x60, 0x40, 0x02, 0x36, 0x60, 0x45,
+ 0x04, 0x36, 0x60, 0x45, 0x82, 0x36, 0x60, 0x45, 0x84, 0x36, 0x60, 0x45, 0x0B, 0x36, 0x60, 0x45,
+ 0x8B, 0x36, 0x60, 0x45, 0x16, 0x36, 0x60, 0x45, 0x96, 0x36, 0x60, 0x45, 0x65, 0x40, 0x00, 0x36,
+ 0xE7, 0x01, 0x64, 0x44, 0xDC, 0x9C, 0x2C, 0x44, 0x00, 0x3A, 0x02, 0x00, 0x45, 0x4C, 0xE0, 0x01,
+ 0x2C, 0x5E, 0x65, 0x5F, 0x00, 0x65, 0x45, 0x4C, 0x43, 0x48, 0x2A, 0x43, 0xBD, 0xDB, 0xFF, 0xFF,
+ 0x43, 0x4A, 0x28, 0x43, 0xD5, 0x01, 0x2D, 0x60, 0x28, 0x64, 0x60, 0xFE, 0xA0, 0xD9, 0xFF, 0xFF,
+ 0x20, 0xFE, 0x64, 0x40, 0x01, 0x3A, 0x39, 0x00, 0x2A, 0x43, 0x65, 0x44, 0xA3, 0xDB, 0x35, 0x00,
+ 0x23, 0x60, 0x34, 0x78, 0xFF, 0xFF, 0xDC, 0xF3, 0xFF, 0xFF, 0x03, 0xA8, 0x02, 0xA8, 0x02, 0x03,
+ 0x41, 0x02, 0xF6, 0x01, 0x0F, 0x60, 0xEA, 0x62, 0xA2, 0xD1, 0xFF, 0x60, 0xFB, 0x64, 0xA0, 0x84,
+ 0xA2, 0xDB, 0x24, 0x60, 0xAA, 0x62, 0x1A, 0x60, 0x66, 0x64, 0xA2, 0xDB, 0x02, 0x64, 0x4A, 0xDB,
+ 0xFF, 0xFF, 0x04, 0xFF, 0x26, 0x46, 0x1F, 0x60, 0x5A, 0x61, 0xA1, 0xD3, 0x25, 0xF2, 0x60, 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0xDD, 0x78, 0x7F, 0x60,
+ 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x10, 0x02, 0x10, 0x64, 0x40, 0x40,
+ 0x02, 0x64, 0x40, 0x50, 0x61, 0xFF, 0x3F, 0x40, 0x40, 0x26, 0x04, 0x00, 0x10, 0xE0, 0x46, 0x60,
+ 0x09, 0xE0, 0x00, 0x00, 0x27, 0xF1, 0x00, 0x66, 0x20, 0x78, 0x42, 0xFE, 0x23, 0x58, 0xFF, 0xFF,
+ 0x7F, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x1A, 0x02, 0x1C, 0x60,
+ 0xB4, 0x63, 0xA3, 0xD3, 0x07, 0x7C, 0x20, 0xB5, 0x0C, 0xB5, 0x04, 0x03, 0x03, 0x02, 0xDC, 0xF9,
+ 0x00, 0x67, 0x0F, 0x00, 0x00, 0x61, 0x41, 0x56, 0xC7, 0xFE, 0xAC, 0x01, 0x36, 0x47, 0xFF, 0x23,
+ 0x04, 0x00, 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x04, 0x00, 0x20, 0x44, 0x80, 0xBC, 0x40, 0x40,
+ 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x7F, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67,
+ 0x02, 0x61, 0x31, 0x02, 0x1C, 0x60, 0xB4, 0x63, 0xA3, 0xD3, 0x01, 0x7C, 0x20, 0xB5, 0x0C, 0xB5,
+ 0x03, 0x03, 0x02, 0x02, 0xDC, 0xF9, 0xFF, 0xFF, 0x02, 0x61, 0x41, 0x56, 0xC7, 0xFE, 0x25, 0x60,
+ 0x11, 0x78, 0xFF, 0xFF, 0x9F, 0xF1, 0x20, 0x44, 0x64, 0x40, 0xFF, 0x26, 0x1B, 0x00, 0x7F, 0xB4,
+ 0x40, 0x40, 0x5C, 0x5E, 0x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0x36, 0x84, 0xFF, 0x05, 0x36, 0x85, 0xFF, 0x06, 0x36, 0x86, 0xFF, 0x25, 0x44, 0x00, 0x36,
+ 0x44, 0x40, 0x01, 0x36, 0x44, 0x41, 0x02, 0x36, 0x44, 0x42, 0x03, 0x36, 0x44, 0x43, 0x04, 0x36,
+ 0x44, 0x44, 0x05, 0x36, 0x44, 0x45, 0x06, 0x36, 0x44, 0x46, 0x07, 0x36, 0x44, 0x47, 0x08, 0x36,
+ 0x44, 0x48, 0x09, 0x36, 0x44, 0x49, 0x0A, 0x36, 0x44, 0x4A, 0x0B, 0x36, 0x44, 0x4B, 0x0C, 0x36,
+ 0x44, 0x4C, 0x0D, 0x36, 0x44, 0x4D, 0x0E, 0x36, 0x44, 0x4E, 0x0F, 0x36, 0x44, 0x4F, 0x87, 0xFF,
+ 0x21, 0x00, 0x25, 0x44, 0x10, 0x36, 0x44, 0x50, 0x11, 0x36, 0x44, 0x51, 0x12, 0x36, 0x44, 0x52,
+ 0x13, 0x36, 0x44, 0x53, 0x14, 0x36, 0x44, 0x54, 0x15, 0x36, 0x44, 0x55, 0x16, 0x36, 0x44, 0x56,
+ 0x17, 0x36, 0x44, 0x57, 0x18, 0x36, 0x44, 0x58, 0x19, 0x36, 0x44, 0x59, 0x1A, 0x36, 0x44, 0x5A,
+ 0x1B, 0x36, 0x44, 0x5B, 0x1C, 0x36, 0x44, 0x5C, 0x1D, 0x36, 0x44, 0x5D, 0x1E, 0x36, 0x44, 0x5E,
+ 0x1F, 0x36, 0x44, 0x5F, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0x46, 0xAE, 0x60, 0x58, 0x4F,
+ 0x6F, 0x78, 0xFF, 0xFF, 0x03, 0x61, 0x7F, 0x67, 0x0B, 0x02, 0x00, 0xF0, 0x24, 0x60, 0x7A, 0x62,
+ 0x04, 0x64, 0xA2, 0xDB, 0x5A, 0xD9, 0x0A, 0x64, 0x5A, 0xDB, 0xFF, 0xFF, 0x2B, 0x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64, 0x58, 0xD0, 0x59, 0xD9,
+ 0xFD, 0x1F, 0x25, 0xF0, 0x20, 0x64, 0xD0, 0x81, 0xFF, 0xFF, 0x02, 0x07, 0x25, 0xFA, 0x0F, 0x00,
+ 0x28, 0x60, 0xA8, 0x63, 0xC3, 0x83, 0x01, 0x2A, 0x06, 0x00, 0xCF, 0x83, 0xA3, 0xD3, 0xCD, 0x81,
+ 0x00, 0x7F, 0xBD, 0xDB, 0x04, 0x03, 0x00, 0x64, 0xC9, 0x81, 0xBD, 0xDB, 0xFD, 0x02, 0x00, 0x67,
+ 0x23, 0x58, 0xFF, 0xFF, 0x23, 0xF2, 0x25, 0xF0, 0x02, 0xA8, 0x01, 0x60, 0xA6, 0x62, 0x09, 0x02,
+ 0xA2, 0xD9, 0x64, 0x41, 0x32, 0x44, 0x02, 0xB5, 0x00, 0xB9, 0xD4, 0x84, 0x08, 0x28, 0x02, 0xBC,
+ 0x40, 0x52, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x23, 0xF2, 0x25, 0xF0, 0x02, 0xA8, 0x01, 0x60,
+ 0xB2, 0x62, 0x0C, 0x02, 0xA2, 0xD9, 0x64, 0x41, 0x32, 0x44, 0x40, 0xB5, 0x00, 0xB9, 0xD4, 0x84,
+ 0x08, 0x24, 0x03, 0x00, 0x40, 0xBC, 0x02, 0xB5, 0xD4, 0x84, 0x40, 0x52, 0x00, 0x67, 0x23, 0x58,
+ 0xFF, 0xFF, 0x23, 0xF2, 0x25, 0xF0, 0x01, 0x60, 0xB0, 0x63, 0xA3, 0xD9, 0xA9, 0xF1, 0x20, 0x61,
+ 0x41, 0x4B, 0x64, 0x43, 0xD8, 0xF3, 0x63, 0x45, 0x66, 0x41, 0x65, 0x46, 0x8C, 0xFA, 0x60, 0x40,
+ 0x01, 0x36, 0x06, 0x00, 0x02, 0x36, 0x04, 0x00, 0x04, 0x36, 0x02, 0x00, 0x05, 0x3A, 0x02, 0x00,
+ 0x00, 0x64, 0x01, 0x00,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x61, 0x01, 0x64, 0xA1, 0xDB, 0x04, 0x00,
+ 0x31, 0x60, 0x2C, 0x61, 0x00, 0x64, 0xA1, 0xDB, 0x7E, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80,
+ 0x7F, 0x67, 0x02, 0x61, 0x0E, 0x02, 0x06, 0x61, 0x41, 0x56, 0xC7, 0xFE, 0x25, 0x60, 0x11, 0x78,
+ 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00, 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x01, 0x00,
+ 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x7E, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67,
+ 0x02, 0x61, 0x12, 0x02, 0x2D, 0x60, 0x58, 0x61, 0x65, 0x43, 0xA1, 0xDD, 0x0C, 0x61, 0x41, 0x56,
+ 0xC7, 0xFE, 0x25, 0x60, 0x11, 0x78, 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00, 0x00, 0x7F,
+ 0x60, 0x41, 0x7F, 0x67, 0x01, 0x00, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0xF0, 0x29, 0x60,
+ 0xA2, 0x62, 0xA2, 0xD9, 0x19, 0x00, 0x2D, 0x60, 0x1A, 0x64, 0xA0, 0xD1, 0xA0, 0xF9, 0x0C, 0x60,
+ 0x38, 0x62, 0x40, 0x63, 0x00, 0x64, 0x5A, 0xDB, 0xFE, 0x1F, 0x64, 0x40, 0x01, 0x2A, 0x0C, 0x00,
+ 0x04, 0x65, 0x0C, 0x60, 0x38, 0x61, 0x48, 0x64, 0x3E, 0x63, 0x7C, 0xA8, 0x58, 0xD0, 0x59, 0xD9,
+ 0x02, 0x02, 0x00, 0xF4, 0x02, 0x64, 0xF9, 0x1F, 0x29, 0x60, 0xA2, 0x62, 0xA2, 0xD1, 0x0D, 0x60,
+ 0x1C, 0x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, 0xFE, 0x01, 0x75, 0x01, 0x42, 0x6F, 0x6F, 0x74,
+ 0x63, 0x6F, 0x64, 0x65, 0x20, 0x21, 0x21, 0x20, 0x20, 0x00, 0x53, 0x54, 0x41, 0x2F, 0x41, 0x50,
+ 0x20, 0x46, 0x75, 0x6E, 0x63, 0x27, 0x73, 0x00, 0x1F, 0x00, 0x03, 0x00, 0x02, 0x00, 0x24, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x02, 0x00, 0x02, 0x00, 0x05, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x06, 0x00, 0x07, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00,
+ 0x02, 0x00, 0x40, 0x00, 0x32, 0x00, 0x32, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x40, 0x00,
+ 0x32, 0x00, 0x36, 0x00, 0x0A, 0x00, 0x02, 0x00, 0x06, 0x00, 0x40, 0x00, 0x3B, 0x00, 0x40, 0x00,
+ 0x17, 0x00, 0x07, 0x00, 0x07, 0x00, 0x4A, 0x00, 0x40, 0x00, 0x4A, 0x00, 0x1E, 0x00, 0x0C, 0x00,
+ 0x08, 0x00, 0x57, 0x00, 0x4D, 0x00, 0x57, 0x00, 0x2B, 0x00, 0x19, 0x00, 0x08, 0x00, 0x5D, 0x00,
+ 0x53, 0x00, 0x5D, 0x00, 0x31, 0x00, 0x1F, 0x00, 0x08, 0x00, 0xA9, 0xF3, 0x21, 0x61, 0x00, 0x7C,
+ 0x01, 0x00, 0x00, 0xFA, 0x60, 0x46, 0xFE, 0x63, 0xA3, 0xD8, 0xFE, 0x1F, 0xCD, 0x81, 0xD8, 0x84,
+ 0xF8, 0x02, 0x21, 0x61, 0x80, 0x67, 0x40, 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F, 0x08, 0x02, 0x00, 0xF0, 0x04, 0x63, 0x64, 0x46,
+ 0x01, 0xF2, 0x22, 0x46, 0x1A, 0xFA, 0x03, 0xFC, 0x02, 0x00, 0x22, 0x46, 0x1A, 0xFA, 0x35, 0xF2,
+ 0x04, 0xF8, 0xDC, 0x84, 0x35, 0xFA, 0x14, 0xF2, 0x0F, 0xB5, 0x0F, 0xB4, 0xCC, 0x84, 0x94, 0x80,
+ 0x04, 0x60, 0x00, 0x65, 0x2A, 0xF2, 0x01, 0x02, 0x94, 0x84, 0x2A, 0xFA, 0x95, 0xFC, 0x06, 0x00,
+ 0xC4, 0x3A, 0x07, 0x00, 0x27, 0x44, 0xFD, 0xB4, 0x40, 0x47, 0x48, 0xE2, 0xA4, 0x60, 0x0B, 0x78,
+ 0xFF, 0xFF, 0x28, 0x44, 0x04, 0x26, 0x05, 0x00, 0x68, 0x3A, 0x03, 0x00, 0x32, 0x44, 0x00, 0x27,
+ 0x03, 0x00, 0xA3, 0x60, 0x4B, 0x78, 0xFF, 0xFF, 0x0A, 0x64, 0x3A, 0xDB, 0xA3, 0x60, 0x4B, 0x78,
+ 0xFF, 0xFF, 0x0E, 0x64, 0x3A, 0xDB, 0x10, 0x60, 0x00, 0x65, 0x3C, 0x46, 0x2A, 0xF2, 0x13, 0xF0,
+ 0xA4, 0x84, 0xB4, 0xBC, 0x40, 0x48, 0x7C, 0xF1, 0x64, 0x47, 0xFF, 0xB4, 0x60, 0x45, 0xD0, 0x80,
+ 0x70, 0x61, 0x01, 0x06, 0x64, 0x44, 0x0A, 0x36, 0x70, 0x64, 0x14, 0x36, 0x38, 0x64, 0x37, 0x36,
+ 0x15, 0x64, 0x6E, 0x36, 0x0B, 0x64, 0x40, 0x4E, 0xA0, 0x63, 0x0A, 0x64, 0x65, 0x40, 0x0A, 0x36,
+ 0x03, 0x00, 0x38, 0x61, 0x14, 0x64, 0xEB, 0x83, 0x40, 0x45, 0x43, 0x44, 0x02, 0x60, 0x5E, 0x65,
+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x2B, 0x6F, 0x00, 0x56, 0x00, 0xA3, 0x46, 0x65, 0x44,
+ 0x01, 0x26, 0x0B, 0x00, 0x04, 0x26, 0x03, 0x00, 0x10, 0x26, 0x01, 0x00, 0x1D, 0x00, 0x37, 0xF2,
+ 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x27, 0x48, 0x00, 0x17, 0x00, 0xA9, 0xF3, 0xFF, 0xFF, 0x60, 0x46,
+ 0x36, 0xF2, 0x66, 0x43, 0xFF, 0xB4, 0x3C, 0x46, 0x22, 0xF0, 0x60, 0x47, 0xB0, 0x84, 0x22, 0xFA,
+ 0x63, 0x46, 0x37, 0xF0, 0x60, 0x40, 0x04, 0x27, 0x03, 0x00, 0x10, 0x27, 0x01, 0x00, 0x04, 0x00,
+ 0x64, 0x40, 0x80, 0x27, 0x31, 0x00, 0x00, 0x00, 0x3C, 0x46, 0x02, 0x65, 0xB7, 0x60, 0x66, 0x78,
+ 0xFF, 0xFF, 0xCD, 0x81, 0x63, 0x42, 0x5A, 0xD0, 0x3C, 0x46, 0x26, 0x02, 0x64, 0x44, 0x88, 0x3A,
+ 0x23, 0x00, 0x77, 0x37, 0x39, 0x00, 0x78, 0x37, 0x37, 0x00, 0x8E, 0x37, 0x35, 0x00, 0xF1, 0x01,
+ 0x2D, 0x60, 0x52, 0x62, 0xA2, 0xD3, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x2A, 0x2D, 0x00, 0x07, 0x00,
+ 0x2D, 0x60, 0x52, 0x62, 0xA2, 0xD3, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x2A, 0xE2, 0x01, 0x3C, 0x46,
+ 0x3E, 0xF2, 0x40, 0x60, 0x00, 0x65, 0xF0, 0x84, 0xA4, 0x84, 0x18, 0xFA, 0x2A, 0xF2, 0xBF, 0x60,
+ 0xFF, 0x65, 0xA4, 0x84, 0x2A, 0xFA, 0x18, 0x00, 0x3C, 0x46, 0x22, 0xF0, 0x80, 0x67, 0xB0, 0x84,
+ 0xA2, 0xDA, 0xFF, 0xFF, 0x3F, 0xF2, 0x3E, 0xF0, 0x08, 0xA4, 0x60, 0x41, 0x22, 0xF2, 0xFF, 0xFF,
+ 0x60, 0x40, 0x01, 0x26, 0x03, 0x00, 0x04, 0x26, 0x03, 0x00, 0x06, 0x00, 0x04, 0x2B, 0x04, 0x00,
+ 0x61, 0x44, 0x64, 0x40, 0x10, 0x26, 0x3F, 0xFA, 0x3C, 0x46, 0x2C, 0xF2, 0x27, 0x40, 0x01, 0x27,
+ 0x32, 0xF2, 0xD5, 0xF1, 0x60, 0x40, 0x01, 0x26, 0x53, 0x00, 0x09, 0x60, 0x00, 0x64, 0xD0, 0x80,
+ 0x3F, 0xF2, 0x09, 0x06, 0x2C, 0x45, 0xC4, 0x84, 0xD0, 0x80, 0x40, 0x4A, 0x40, 0x06, 0x60, 0x43,
+ 0x64, 0x44, 0x54, 0x88, 0x18, 0x00, 0x60, 0x45, 0x28, 0x60, 0x36, 0x64, 0xA0, 0xD3, 0xDB, 0xF3,
+ 0x00, 0xBC, 0x60, 0x47, 0xEC, 0xA0, 0x33, 0x03, 0x32, 0x07, 0x2C, 0x44, 0xC4, 0x81, 0x02, 0x60,
+ 0x1C, 0x65, 0x45, 0x4A, 0xD5, 0x80, 0x2C, 0x45, 0x2A, 0x06, 0x27, 0x40, 0x04, 0x27, 0x30, 0x00,
+ 0x2A, 0x43, 0xD7, 0x85, 0x45, 0x48, 0xD6, 0xF1, 0x0F, 0xF2, 0xD3, 0x80, 0x01, 0x65, 0x01, 0x07,
+ 0x00, 0x65, 0xB4, 0x84, 0x0F, 0xFA, 0x00, 0x63, 0x3F, 0xF2, 0x28, 0x45, 0x60, 0x41, 0xD4, 0x84,
+ 0xDF, 0x83, 0xFC, 0x07, 0x14, 0xFC, 0x61, 0x44, 0x01, 0x36, 0x02, 0x00, 0x09, 0x3A, 0x06, 0x00,
+ 0x28, 0x44, 0x48, 0x88, 0x2A, 0x44, 0xC8, 0x83, 0x43, 0x4A, 0xE5, 0x01, 0x17, 0xFA, 0x04, 0x60,
+ 0x00, 0x64, 0x27, 0x45, 0xB4, 0x84, 0x2A, 0xFA, 0x28, 0x43, 0x16, 0xFC, 0x0D, 0x00, 0x3F, 0xF2,
+ 0x2C, 0x45, 0xD6, 0xF1, 0xC4, 0x81, 0xD1, 0x80, 0x0F, 0xF2, 0x01, 0x06, 0x01, 0xBC, 0x0F, 0xFA,
+ 0x3F, 0xF2, 0x17, 0xFA, 0x01, 0x64, 0x14, 0xFA, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x0E, 0xF0,
+ 0x63, 0x46, 0x00, 0x7F, 0x64, 0x5E, 0x4B, 0xFB, 0x64, 0x44, 0x00, 0x7E, 0xDB, 0xFB, 0x7C, 0xF1,
+ 0x60, 0x43, 0x60, 0x47, 0xD0, 0x80, 0xC0, 0x65, 0x01, 0x06, 0x64, 0x44, 0x0A, 0x36, 0x70, 0x64,
+ 0x14, 0x36, 0x38, 0x64, 0x37, 0x36, 0x15, 0x64, 0x6E, 0x36, 0x0B, 0x64, 0x44, 0x86, 0x2A, 0xF2,
+ 0x07, 0xF0, 0x60, 0x40, 0xB0, 0x3A, 0x03, 0x00, 0x40, 0x3B, 0x01, 0x00, 0x12, 0x00, 0x0C, 0xB4,
+ 0x08, 0x3A, 0x55, 0x00, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x2B, 0x50, 0x00, 0x17, 0xF2,
+ 0x22, 0xF0, 0xFF, 0xFF, 0x64, 0x40, 0x22, 0x22, 0x04, 0x00, 0x00, 0xA8, 0x01, 0xA8, 0x47, 0x03,
+ 0x46, 0x03, 0x3C, 0x46, 0x2A, 0xF0, 0x40, 0x67, 0xB0, 0x84, 0xA2, 0xDA, 0x60, 0x45, 0x22, 0xF2,
+ 0xFF, 0xFF, 0x60, 0x43, 0x60, 0x40, 0x01, 0x26, 0x03, 0x00, 0x04, 0x26, 0x0A, 0x00, 0x02, 0x00,
+ 0x04, 0x27, 0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 0xFE, 0xB4, 0xF2, 0xFB, 0x0F, 0x60, 0xF0, 0x62,
+ 0x00, 0x64, 0xA2, 0xDB, 0x00, 0x60, 0x14, 0x63, 0x01, 0x60, 0xC4, 0x61, 0x28, 0x60, 0x3E, 0x64,
+ 0x58, 0xD1, 0x59, 0xD9, 0xFD, 0x1F, 0x00, 0x60, 0x88, 0x63, 0x27, 0x60, 0xB4, 0x61, 0x28, 0x60,
+ 0x54, 0x64, 0x58, 0xD1, 0x59, 0xD9, 0xFD, 0x1F, 0x28, 0x60, 0x2C, 0x62, 0xA2, 0xD1, 0xFF, 0xFF,
+ 0x64, 0x45, 0xA9, 0xF1, 0x66, 0x41, 0x64, 0x46, 0x36, 0xF2, 0xFF, 0xFF, 0x65, 0x40, 0x01, 0x36,
+ 0x22, 0x64, 0x36, 0xFA, 0x61, 0x46, 0x32, 0x45, 0x28, 0x60, 0x3C, 0x62, 0xA2, 0xD1, 0x10, 0x67,
+ 0xB4, 0x85, 0x64, 0x40, 0x01, 0x2A, 0x94, 0x85, 0x45, 0x52, 0xFF, 0x60, 0xE7, 0x65, 0x32, 0x41,
+ 0xA5, 0x81, 0x2D, 0x60, 0x1A, 0x62, 0xA2, 0xD1, 0x28, 0x60, 0x2C, 0x62, 0xA2, 0xD3, 0x64, 0x40,
+ 0x01, 0x2A, 0x0D, 0x00, 0x08, 0x65, 0xFF, 0xA0, 0xFF, 0xFF, 0x01, 0x03, 0x08, 0x00, 0x28, 0x60,
+ 0x30, 0x62, 0xA2, 0xD3, 0xB5, 0x81, 0x10, 0x65, 0x60, 0x40, 0x01, 0x26, 0xB5, 0x81, 0x41, 0x52,
+ 0x2D, 0x60, 0x1A, 0x62, 0xA2, 0xD3, 0x31, 0x60, 0x18, 0x63, 0xF0, 0x84, 0xF0, 0x84, 0xF0, 0x84,
+ 0x01, 0xB5, 0xF0, 0x84, 0xF0, 0x84, 0x03, 0xB4, 0x65, 0x5C, 0xA3, 0xD9, 0x31, 0x60, 0x1A, 0x63,
+ 0x02, 0xA8, 0xA3, 0xDB, 0x1B, 0x02, 0x07, 0x60, 0xD0, 0x64, 0x31, 0x60, 0x1C, 0x63, 0xA3, 0xDB,
+ 0x31, 0x60, 0x24, 0x63, 0xA3, 0xDB, 0x00, 0x60, 0xC8, 0x64, 0x31, 0x60, 0x1E, 0x63, 0xA3, 0xDB,
+ 0x31, 0x60, 0x26, 0x63, 0xA3, 0xDB, 0x00, 0x60, 0x64, 0x64, 0x31, 0x60, 0x20, 0x63, 0xA3, 0xDB,
+ 0x01, 0x60, 0x90, 0x64, 0x31, 0x60, 0x22, 0x63, 0xA3, 0xDB, 0x08, 0x00, 0x0A, 0x64, 0x31, 0x60,
+ 0x20, 0x63, 0xA3, 0xDB, 0x01, 0x64, 0x31, 0x60, 0x22, 0x63, 0xA3, 0xDB, 0x2D, 0x60, 0x1A, 0x62,
+ 0xA2, 0xD1, 0x01, 0x64, 0x64, 0x40, 0x40, 0x2A, 0x03, 0x00, 0x31, 0x60, 0x0E, 0x7C, 0xA4, 0xDB,
+ 0x12, 0x60, 0x28, 0x63, 0xBA, 0xF3, 0x0E, 0x61, 0x60, 0x45, 0x65, 0x44, 0xE8, 0x85, 0x05, 0x64,
+ 0xCD, 0x81, 0x02, 0x28, 0x00, 0x64, 0xBD, 0xDB, 0xF8, 0x02, 0x2D, 0x60, 0x78, 0x61, 0x27, 0x60,
+ 0xB6, 0x64, 0x20, 0x63, 0x58, 0xD1, 0x59, 0xD9, 0xFD, 0x1F, 0xBD, 0xF1, 0x80, 0xF9, 0x1A, 0x63,
+ 0x01, 0x60, 0x00, 0x61, 0x00, 0x64, 0x59, 0xDB, 0xFE, 0x1F, 0x40, 0x40, 0x01, 0x64, 0x87, 0xFB,
+ 0x28, 0x60, 0xCC, 0x61, 0xA1, 0xD3, 0x2E, 0x60, 0x96, 0x61, 0xFE, 0xA4, 0xE0, 0x84, 0x04, 0x24,
+ 0x0F, 0x00, 0xE0, 0x84, 0x41, 0x91, 0x2D, 0x60, 0x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0xD1, 0xC8, 0x84,
+ 0x59, 0xD8, 0xFC, 0x05, 0x27, 0x41, 0x10, 0xA1, 0xA1, 0xD1, 0xFF, 0xFF, 0xC1, 0x81, 0x01, 0x26,
+ 0xDD, 0x81, 0x41, 0x4C, 0x59, 0xD1, 0x7C, 0x44, 0xB0, 0x84, 0x59, 0xD1, 0x59, 0xD1, 0xB0, 0x84,
+ 0xB0, 0x84, 0xFF, 0xFF, 0x02, 0x02, 0x67, 0x44, 0x5D, 0x00, 0x2D, 0x60, 0xE6, 0x63, 0xDD, 0x60,
+ 0x18, 0x64, 0xBD, 0xDA, 0x50, 0x60, 0x00, 0x64, 0xBD, 0xDA, 0x01, 0x60, 0xF2, 0x64, 0xBD, 0xDA,
+ 0x00, 0x60, 0x01, 0x64, 0xBD, 0xDA, 0x2C, 0x41, 0x59, 0xD3, 0x50, 0x60, 0x00, 0x7C, 0x60, 0x40,
+ 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60, 0xF2, 0x64, 0x0E, 0x00, 0x04, 0x2A, 0x03, 0x00, 0x02, 0x60,
+ 0xF2, 0x64, 0x09, 0x00, 0x10, 0x2A, 0x03, 0x00, 0x04, 0x60, 0xF2, 0x64, 0x04, 0x00, 0x20, 0x2A,
+ 0x04, 0x00, 0x05, 0x60, 0xF2, 0x64, 0xBD, 0xD9, 0xBD, 0xDB, 0x01, 0x64, 0xBD, 0xDB, 0x59, 0xD3,
+ 0x50, 0x60, 0x00, 0x7C, 0x60, 0x40, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60, 0xF2, 0x64, 0x0E, 0x00,
+ 0x04, 0x2A, 0x03, 0x00, 0x02, 0x60, 0xF2, 0x64, 0x09, 0x00, 0x10, 0x2A, 0x03, 0x00, 0x04, 0x60,
+ 0xF2, 0x64, 0x04, 0x00, 0x20, 0x2A, 0x04, 0x00, 0x05, 0x60, 0xF2, 0x64, 0xBD, 0xD9, 0xBD, 0xDB,
+ 0x01, 0x64, 0xBD, 0xDB, 0x59,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66, 0x41,
+ 0x1C, 0x60, 0xBA, 0x65, 0x60, 0x47, 0x00, 0x7F, 0xA9, 0xF1, 0xE0, 0x84, 0x44, 0xD3, 0x64, 0x43,
+ 0x11, 0x18, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xFC, 0x1B, 0x66, 0x44, 0x64, 0x46, 0x80, 0xF0,
+ 0x60, 0x46, 0x80, 0xF8, 0x65, 0x46, 0x65, 0x43, 0x80, 0xF0, 0x01, 0xFA, 0x80, 0xFC, 0x64, 0x46,
+ 0x80, 0xF8, 0x0B, 0x00, 0x64, 0x46, 0x62, 0x43, 0x00, 0xF2, 0xA3, 0xDB, 0x60, 0x46, 0x80, 0xF0,
+ 0x81, 0xFC, 0x80, 0xFC, 0x64, 0x46, 0x80, 0xF8, 0x60, 0x43, 0x61, 0x46, 0x43, 0x47, 0x00, 0xF4,
+ 0x18, 0x65, 0x0C, 0x61, 0x02, 0x60, 0x00, 0x63, 0xA5, 0xD0, 0xDA, 0x85, 0x64, 0x44, 0x00, 0x7F,
+ 0xCD, 0x81, 0xBD, 0xDB, 0x05, 0x03, 0x64, 0x47, 0x00, 0x7F, 0xCD, 0x81, 0xBD, 0xDB, 0xF4, 0x02,
+ 0x02, 0x60, 0x02, 0x61, 0xA1, 0xD3, 0x00, 0x65, 0x60, 0x43, 0x59, 0xD3, 0xFF, 0xFF, 0x7F, 0xB4,
+ 0x02, 0x3A, 0x02, 0x00, 0x01, 0x64, 0x15, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x11, 0x00,
+ 0x0A, 0x3A, 0x02, 0x00, 0x04, 0x64, 0x0D, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x09, 0x00,
+ 0x10, 0x3A, 0x02, 0x00, 0x10, 0x64, 0x05, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x01, 0x00,
+ 0x00, 0x64, 0xCF, 0x83, 0xB4, 0x85, 0xE1, 0x02, 0x65, 0x44, 0x7A, 0xFB, 0x02, 0x60, 0x02, 0x61,
+ 0xA1, 0xD3, 0x00, 0x65, 0x60, 0x43, 0x59, 0xD3, 0xFF, 0xFF, 0x80, 0xB0, 0xFF, 0xFF, 0x01, 0x03,
+ 0x60, 0x45, 0xCF, 0x83, 0x65, 0x44, 0xF7, 0x02, 0x7F, 0xB4, 0x02, 0x3A, 0x02, 0x00, 0x0A, 0x64,
+ 0x15, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x14, 0x64, 0x11, 0x00, 0x0A, 0x3A, 0x02, 0x00, 0x32, 0x64,
+ 0x0D, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x37, 0x64, 0x09, 0x00, 0x10, 0x3A, 0x02, 0x00, 0x50, 0x64,
+ 0x05, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x6E, 0x64, 0x01, 0x00, 0x14, 0x64, 0x7C, 0xFB, 0x27, 0x44,
+ 0xD8, 0xF3, 0x60, 0x45, 0x66, 0x41, 0x65, 0x46, 0x8C, 0xFA, 0x60, 0x40, 0x01, 0x36, 0x06, 0x00,
+ 0x02, 0x36, 0x04, 0x00, 0x04, 0x36, 0x02, 0x00, 0x05, 0x3A, 0x02, 0x00, 0x00, 0x64, 0x01, 0x00,
+ 0x01, 0x64, 0x6F, 0xFA, 0x79, 0xF3, 0x7A, 0xF1, 0xFF, 0xFF, 0xA0, 0x84, 0x65, 0x43, 0x02, 0x02,
+ 0x79, 0xF3, 0xFF, 0xFF, 0x60, 0x41, 0x0F, 0x60, 0xAE, 0x65, 0xD8, 0xF3, 0xFF, 0xFF, 0xE0, 0x84,
+ 0x44, 0xD3, 0x61, 0x45, 0xA4, 0x80, 0xFF, 0xFF, 0x04, 0x02, 0xE8, 0x84, 0xA4, 0x80, 0xFF, 0xFF,
+ 0xFC, 0x03, 0xA4, 0x84, 0x7B, 0xFB, 0x6F, 0xF0, 0x60, 0x47, 0x90, 0x84, 0x6F, 0xFA, 0x60, 0x47,
+ 0x60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0x47, 0x56, 0xFB, 0x64, 0x47,
+ 0x55, 0xFB, 0x00, 0x64, 0x5C, 0xFB, 0x0C, 0x62, 0x46, 0xD3, 0x80, 0xFB, 0x0B, 0xF0, 0x0F, 0x60,
+ 0xFF, 0x64, 0xA0, 0x84, 0x85, 0xFB, 0x1A, 0x60, 0x3E, 0x62, 0xA2, 0xD3, 0x87, 0xFB, 0x26, 0x46,
+ 0x32, 0xF0, 0x81, 0xF9, 0x33, 0xF0, 0x82, 0xF9, 0x34, 0xF0, 0x83, 0xF9, 0x00, 0xF4, 0x18, 0x65,
+ 0x0C, 0x61, 0x02, 0x60, 0x00, 0x63, 0xA5, 0xD0, 0xDA, 0x85, 0x64, 0x44, 0x00, 0x7F, 0xCD, 0x81,
+ 0xBD, 0xDB, 0x05, 0x03, 0x64, 0x47, 0x00, 0x7F, 0xCD, 0x81, 0xBD, 0xDB, 0xF4, 0x02, 0x02, 0x60,
+ 0x02, 0x61, 0xA1, 0xD3, 0x00, 0x65, 0x60, 0x43, 0x59, 0xD3, 0xFF, 0xFF, 0x7F, 0xB4, 0x02, 0x3A,
+ 0x02, 0x00, 0x01, 0x64, 0x15, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x11, 0x00, 0x0A, 0x3A,
+ 0x02, 0x00, 0x04, 0x64, 0x0D, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x09, 0x00, 0x10, 0x3A,
+ 0x02, 0x00, 0x10, 0x64, 0x05, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x01, 0x00, 0x00, 0x64,
+ 0xCF, 0x83, 0xB4, 0x85, 0xE1, 0x02, 0x65, 0x44, 0x7A, 0xFB, 0x02, 0x60, 0x02, 0x61, 0xA1, 0xD3,
+ 0x00, 0x65, 0x60, 0x43, 0x59, 0xD3, 0xFF, 0xFF, 0x80, 0xB0, 0xFF, 0xFF, 0x01, 0x03, 0x60, 0x45,
+ 0xCF, 0x83, 0x65, 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+
+}; /* fw_image_4_data */
+
+static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = {
+ {
+ sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1,
+ CFG_FW_IDENTITY,
+ COMP_ID_FW_STA,
+ 3, //Variant
+ 2, //Major
+ 36 //Minor
+ },
+ { 0000, 0000, 0000, 0000, 0000, 0000 } //endsentinel
+};
+
+static const CFG_PROG_STRCT fw_image_code[] = {
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x0186, // sizeof(fw_image_1_data),
+ 0x00000060, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_1_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x2518, // sizeof(fw_image_2_data),
+ 0x00000C16, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_2_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x3daa, // sizeof(fw_image_3_data),
+ 0x001E312E, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_3_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0xaa66, // sizeof(fw_image_4_data),
+ 0x001F4000, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_4_data
+ },
+ {
+ 5,
+ CFG_PROG,
+ CFG_PROG_STOP, // mode
+ 0000,
+ 0x000F368E, // Start execution address
+ },
+ { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000}
+};
+
+static const CFG_RANGE20_STRCT fw_image_infocompat[] = {
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_FW_SUP_RANGE,
+ COMP_ROLE_SUPL,
+ COMP_ID_STA,
+ {
+ { 2, 2, 5 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_MFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_MFI,
+ {
+ { 4, 6, 7 }, //variant, bottom, top
+ { 5, 6, 7 }, //variant, bottom, top
+ { 6, 6, 7 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_CFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_CFI,
+ {
+ { 2, 1, 2 } //variant, bottom, top
+ }
+ },
+ { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } //endsentinel
+};
+
+memimage fw_image = {
+ "FUPU7D37dhfwci\001C", //signature, <format number>, C/Bin type
+ (CFG_PROG_STRCT *) fw_image_code,
+ 0x000F368E,
+ 00000000, //(dummy) pdaplug
+ 00000000, //(dummy) priplug
+ (CFG_RANGE20_STRCT *) fw_image_infocompat,
+ (CFG_IDENTITY_STRCT *) fw_image_infoidentity,
+};
+
diff --git a/drivers/staging/wlags49_h2/sta_h25.c b/drivers/staging/wlags49_h2/sta_h25.c
new file mode 100644
index 000000000000..86ca1cdd8497
--- /dev/null
+++ b/drivers/staging/wlags49_h2/sta_h25.c
@@ -0,0 +1,5255 @@
+/*
+ * File: sta_h54.136
+ *
+ * Abstract: This file contains memory image 'fw_image'.
+ *
+ * Contents: Total size of the memory image: 81742 bytes.
+ * Total number of blocks: 4 blocks.
+ * Block 1 : load address 00000060, 388 bytes.
+ * Block 2 : load address 00000C16, 11278 bytes.
+ * Block 3 : load address 001E3824, 21726 bytes.
+ * Block 4 : load address 001F4000, 48350 bytes.
+ *
+ * Identity: component id: 31 (variant 4) version 1.36
+ *
+ * Compatibility:
+ * supplying interface 4 (variant 4) : 1 - 2
+ * acting on interface 1 (variant 7) : 3 - 3
+ * acting on interface 1 (variant 8) : 1 - 1
+ * acting on interface 2 (variant 4) : 1 - 2
+ *
+ * Generated: by g:\fw\fupu3.exe version 4.26
+ *
+ * Commandline: g:\fw\fupu3.exe /f=4 /n=fw_image /i=r4013600.hex
+ */
+
+
+#include "hcfcfg.h" // to get hcf_16 etc defined as well as
+ // possible settings which inluence mdd.h or dhf.h
+#include "mdd.h" //to get COMP_ID_STA etc defined
+#include "dhf.h" //used to be "fhfmem.h", to get memblock,plugrecord,
+
+static const hcf_8 fw_image_1_data[] = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDA, 0x0C, 0x00, 0x00,
+ 0x00, 0x0D, 0x00, 0x00, 0x00, 0x0D, 0x65, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1B, 0x00, 0x1B, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB2, 0x1B, 0xB2, 0x1B,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00,
+ 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xEA, 0x00, 0x00, 0xFF, 0x07,
+ 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x10, 0x27, 0x10, 0x27, 0x14, 0x00, 0xD0, 0x07, 0xD0, 0x07,
+ 0x10, 0x27, 0x2F, 0x00, 0x32, 0x00, 0x32, 0x00, 0x05, 0x00, 0x02, 0x00, 0x02, 0x00, 0x10, 0x27,
+ 0x05, 0x00, 0x00, 0x02, 0x00, 0x02, 0x13, 0x00, 0x07, 0x00, 0x03, 0x00, 0x32, 0x00, 0x02, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2A, 0x09, 0x2B, 0x09, 0x2B, 0x09, 0xFF, 0x0F, 0xF0, 0x0F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x40, 0x00, 0x32, 0x00, 0x32, 0x00, 0x0A, 0x00,
+ 0x02, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+
+}; /* fw_image_1_data */
+
+static const hcf_8 fw_image_2_data[] = {
+ 0xF4, 0xA3, 0x00, 0x16, 0x08, 0x40, 0x0F, 0xD2, 0xE1, 0x28, 0xA5, 0x7C, 0x50, 0x30, 0xF1, 0x84,
+ 0x44, 0x08, 0xAB, 0xAE, 0xA5, 0xB8, 0xFC, 0xBA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05,
+ 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 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, 0x00, 0x31, 0x00, 0x33,
+ 0x00, 0x34, 0x00, 0x35, 0x00, 0x36, 0x00, 0x37, 0x00, 0x38, 0x00, 0x38, 0x00, 0x3A, 0x00, 0x3B,
+ 0x00, 0x3C, 0x00, 0x3D, 0x00, 0x3E, 0x00, 0x3F, 0x00, 0x3F, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE6, 0x28, 0x10, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x0A, 0x02, 0x14, 0x05, 0x32, 0x0B, 0x37, 0x08, 0x50, 0x0B, 0x6E,
+ 0x02, 0x00, 0x04, 0x00, 0x0B, 0x00, 0x16, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x18, 0x00, 0x24, 0x00,
+ 0x30, 0x00, 0x48, 0x00, 0x60, 0x00, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x39, 0x00, 0x39, 0x00, 0x20, 0x00, 0x39, 0x00, 0x39, 0x00, 0x20, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10,
+ 0x3E, 0x11, 0xF6, 0x10, 0x38, 0x11, 0xFC, 0x10, 0x32, 0x11, 0x02, 0x11, 0x2C, 0x11, 0x08, 0x11,
+ 0x26, 0x11, 0x0E, 0x11, 0x20, 0x11, 0x14, 0x11, 0x1A, 0x11, 0x07, 0x01, 0x00, 0x00, 0x16, 0x22,
+ 0x00, 0x04, 0x08, 0x01, 0x00, 0x00, 0x16, 0x26, 0x00, 0x04, 0x09, 0x01, 0x00, 0x00, 0x16, 0x2A,
+ 0x00, 0x04, 0x0A, 0x01, 0x00, 0x00, 0x16, 0x2E, 0x00, 0x04, 0x0B, 0x01, 0x00, 0x00, 0x10, 0x24,
+ 0x04, 0x04, 0x0C, 0x01, 0x00, 0x00, 0x10, 0x28, 0x04, 0x04, 0x0D, 0x01, 0x00, 0x00, 0x10, 0x2C,
+ 0x04, 0x04, 0x0E, 0x01, 0x00, 0x00, 0x10, 0x30, 0x04, 0x04, 0x0F, 0x01, 0x00, 0x00, 0x14, 0x34,
+ 0x08, 0x84, 0x10, 0x01, 0x00, 0x00, 0x14, 0x38, 0x08, 0x84, 0x11, 0x01, 0x00, 0x00, 0x14, 0x3C,
+ 0x08, 0x84, 0x12, 0x01, 0x00, 0x00, 0x14, 0x40, 0x08, 0x84, 0x13, 0x01, 0x00, 0x00, 0x17, 0x64,
+ 0x0C, 0x8B, 0x14, 0x01, 0x00, 0x00, 0x17, 0x68, 0x0C, 0x8B, 0x15, 0x01, 0x00, 0x00, 0x17, 0x6C,
+ 0x0C, 0x8B, 0x16, 0x01, 0x00, 0x00, 0x17, 0x70, 0x0C, 0x8B, 0x17, 0x01, 0x00, 0x00, 0x17, 0x74,
+ 0x0C, 0x8B, 0x18, 0x01, 0x00, 0x00, 0x17, 0x78, 0x0C, 0x8B, 0x19, 0x01, 0x00, 0x00, 0x17, 0x7C,
+ 0x0C, 0x8B, 0x1A, 0x01, 0x00, 0x00, 0x17, 0x80, 0x0C, 0x8B, 0x1B, 0x01, 0x00, 0x00, 0x17, 0x84,
+ 0x0C, 0x8B, 0x1C, 0x01, 0x00, 0x00, 0x17, 0x88, 0x0C, 0x8B, 0x1D, 0x01, 0x00, 0x00, 0x17, 0x8C,
+ 0x0C, 0x8B, 0x1E, 0x01, 0x00, 0x00, 0x0E, 0x95, 0x17, 0x04, 0x1F, 0x01, 0x00, 0x00, 0x0E, 0x99,
+ 0x17, 0x04, 0x20, 0x01, 0x00, 0x00, 0x0E, 0x9D, 0x17, 0x04, 0x21, 0x01, 0x00, 0x00, 0x0E, 0xA1,
+ 0x17, 0x04, 0x22, 0x01, 0x00, 0x00, 0x0E, 0xA5, 0x00, 0x00, 0x60, 0x11, 0x80, 0x11, 0xA0, 0x11,
+ 0xC0, 0x11, 0x18, 0x12, 0x68, 0x11, 0x88, 0x11, 0xA8, 0x11, 0xC8, 0x11, 0x20, 0x12, 0x70, 0x11,
+ 0x90, 0x11, 0xB0, 0x11, 0xD0, 0x11, 0x28, 0x12, 0x78, 0x11, 0x98, 0x11, 0xB8, 0x11, 0xD8, 0x11,
+ 0x30, 0x12, 0xE0, 0x11, 0xE8, 0x11, 0xF0, 0x11, 0xF8, 0x11, 0x00, 0x12, 0x08, 0x12, 0x10, 0x12,
+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, 0x14, 0x14,
+ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F,
+ 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x9D, 0x9D, 0xA1, 0xB4,
+ 0x10, 0x10, 0x00, 0x9D, 0x08, 0x02, 0x06, 0x00, 0xA5, 0xA5, 0xAA, 0xB4, 0x10, 0x10, 0x00, 0xA2,
+ 0x15, 0x05, 0x07, 0x00, 0xAA, 0xAA, 0xB4, 0xB4, 0x10, 0x10, 0x00, 0xA7, 0x1C, 0x0A, 0x08, 0x00,
+ 0xB7, 0xB7, 0xC1, 0xC1, 0x10, 0x10, 0x00, 0xB4, 0x29, 0x17, 0x08, 0x00, 0xBD, 0xBD, 0xC7, 0xC7,
+ 0x10, 0x10, 0x00, 0xBA, 0x2F, 0x1D, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC4, 0x1F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x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0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x1C, 0x09, 0x08, 0x24, 0x28, 0x06, 0x0C, 0x18, 0x08, 0x30, 0x14, 0x0C,
+ 0x08, 0x36, 0x10, 0x12, 0x24, 0xB7, 0x97, 0xB6, 0xA3, 0xB7, 0xAC, 0xB7, 0xA8, 0xB6, 0x3E, 0xB7,
+ 0x16, 0xB7, 0x79, 0x3E, 0x57, 0x3D, 0x79, 0x3E, 0xF9, 0x3D, 0x5F, 0x3D, 0x52, 0x3D, 0x33, 0x3E,
+ 0x55, 0x3E, 0x6A, 0x3E, 0xAC, 0x3E, 0xD8, 0x3E, 0xF8, 0x3D, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46,
+ 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46, 0x22, 0x46,
+ 0x23, 0x46, 0x23, 0x46, 0x23, 0x46, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47, 0x1C, 0x47,
+ 0x1D, 0x47, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48,
+ 0x5A, 0x48, 0x9A, 0x48, 0xDA, 0x48, 0x1A, 0x48, 0x5A, 0x48, 0x9A, 0x48, 0x33, 0x48, 0x78, 0x49,
+ 0x78, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x79, 0x49, 0x7A, 0x49, 0x7A, 0x49, 0x7A, 0x49,
+ 0x7A, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7B, 0x49, 0x7C, 0x49, 0xD8, 0x03, 0xDC, 0x03, 0xE0, 0x03,
+ 0xE4, 0x03, 0xF0, 0x03, 0xF4, 0x03, 0xF8, 0x03, 0x0A, 0x04, 0x0E, 0x04, 0x12, 0x04, 0x16, 0x04,
+ 0x0C, 0x04, 0x10, 0x04, 0x14, 0x04, 0x18, 0x04, 0x1C, 0x04, 0x20, 0x04, 0x24, 0x04, 0x28, 0x04,
+ 0x4C, 0x04, 0x50, 0x04, 0x54, 0x04, 0x58, 0x04, 0x5C, 0x04, 0x60, 0x04, 0x64, 0x04, 0x68, 0x04,
+ 0x6C, 0x04, 0x70, 0x04, 0x74, 0x04, 0x7D, 0x04, 0x81, 0x04, 0x85, 0x04, 0x89, 0x04, 0x8D, 0x04,
+ 0x10, 0x00, 0x8E, 0x19, 0xAC, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3C, 0x0C, 0x00, 0x00,
+ 0xFF, 0x3F, 0x44, 0x04, 0x00, 0x00, 0xD3, 0x22, 0x44, 0x04, 0x9C, 0x02, 0xCB, 0x54, 0x44, 0x04,
+ 0x00, 0x00, 0x01, 0x00, 0x44, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x0C, 0x71, 0x00, 0x30, 0x50,
+ 0x20, 0x00, 0x80, 0xBF, 0x1F, 0xA6, 0x28, 0x00, 0x0B, 0x02, 0x60, 0x84, 0x4C, 0x00, 0x02, 0x00,
+ 0x4B, 0x1C, 0x98, 0x00, 0x00, 0x00, 0x20, 0x0B, 0x34, 0x04, 0xFD, 0x34, 0x34, 0x00, 0x38, 0x04,
+ 0xFD, 0x34, 0x34, 0x00, 0x3C, 0x04, 0x01, 0x00, 0x10, 0x00, 0x00, 0x08, 0x00, 0x52, 0x14, 0x00,
+ 0x04, 0x08, 0x0E, 0x32, 0x00, 0xA6, 0x10, 0x08, 0xC4, 0x03, 0x50, 0x60, 0x18, 0x08, 0xF0, 0x3F,
+ 0xFC, 0x01, 0x10, 0x0C, 0x00, 0x00, 0x80, 0x04, 0x14, 0x0C, 0x00, 0x00, 0x00, 0x41, 0x20, 0x0C,
+ 0xB0, 0x00, 0xB0, 0xB8, 0x24, 0x0C, 0x00, 0x00, 0xAB, 0x05, 0x2C, 0x0C, 0x80, 0x05, 0x00, 0xFF,
+ 0x30, 0x0C, 0x00, 0x00, 0xB0, 0x04, 0x34, 0x0C, 0x03, 0x00, 0x00, 0xE8, 0x44, 0x0C, 0x04, 0x00,
+ 0xFF, 0x0F, 0x00, 0x10, 0x2E, 0x00, 0x0C, 0xE3, 0x44, 0x04, 0x00, 0x00, 0x01, 0x04, 0x44, 0x04,
+ 0x00, 0x00, 0x01, 0x01, 0x44, 0x04, 0x00, 0x00, 0x01, 0x00, 0x44, 0x04, 0x00, 0x00, 0x01, 0x04,
+ 0x44, 0x04, 0x00, 0x00, 0x80, 0x03, 0x48, 0x0C, 0x00, 0x00, 0x7F, 0x00, 0x04, 0x04, 0x08, 0x48,
+ 0x00, 0x00, 0x04, 0x04, 0x08, 0x40, 0x00, 0x00, 0x00, 0x0C, 0x71, 0x00, 0x30, 0x30, 0x00, 0x00,
+ 0x5E, 0x40, 0x01, 0x00, 0x18, 0x00, 0x36, 0xC0, 0xE8, 0x0E, 0x1C, 0x00, 0x78, 0xC8, 0xA5, 0x40,
+ 0x24, 0x00, 0x9E, 0xB0, 0xB9, 0x95, 0x08, 0x08, 0x00, 0xEA, 0x40, 0x01, 0x0C, 0x08, 0x00, 0xEA,
+ 0x00, 0x00, 0x1C, 0x08, 0x00, 0x00, 0x42, 0x07, 0x20, 0x08, 0x7B, 0x00, 0xD4, 0x09, 0x2C, 0x04,
+ 0x14, 0x00, 0x50, 0x14, 0x30, 0x04, 0x28, 0x0F, 0x28, 0x7F, 0x18, 0x08, 0x20, 0x00, 0xFC, 0x01,
+ 0x04, 0x10, 0x69, 0x00, 0xFD, 0xC3, 0x08, 0x10, 0x69, 0x00, 0xFD, 0xC3, 0x08, 0x0C, 0x00, 0x00,
+ 0x00, 0x00, 0x48, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x48, 0x0C, 0x00, 0x00, 0x7F, 0x00, 0x04, 0x04,
+ 0x08, 0x48, 0x02, 0x00, 0x00, 0x00, 0x5E, 0x48, 0x00, 0x00, 0x04, 0x04, 0x08, 0x40, 0x02, 0x00,
+ 0x00, 0x0C, 0x71, 0x00, 0x30, 0x50, 0x00, 0x00, 0x5E, 0x48, 0x01, 0x00, 0x18, 0x00, 0x3A, 0xC0,
+ 0xE8, 0x04, 0x1C, 0x00, 0x78, 0xD0, 0xA5, 0x40, 0x24, 0x00, 0x9E, 0xB0, 0xB9, 0x85, 0x2C, 0x04,
+ 0x14, 0x00, 0x50, 0x14, 0x30, 0x04, 0x28, 0x0F, 0x28, 0x7F, 0x08, 0x08, 0x00, 0xEA, 0x40, 0x01,
+ 0x0C, 0x08, 0x00, 0xEA, 0x00, 0x00, 0x1C, 0x08, 0x00, 0x00, 0x42, 0x07, 0x20, 0x08, 0x7B, 0x00,
+ 0xD4, 0x09, 0x18, 0x08, 0xF0, 0x3F, 0xFC, 0x01, 0x04, 0x10, 0x69, 0x00, 0xDD, 0xCD, 0x08, 0x10,
+ 0x69, 0x00, 0xDD, 0xCD, 0x08, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x48, 0x0C, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04, 0x40, 0x04, 0x41, 0x04, 0x10, 0x04, 0xD6, 0x08,
+ 0x56, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x56, 0x0A, 0x18, 0x04, 0x56, 0x0A, 0x40, 0x02, 0x1C, 0x04,
+ 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0xC2, 0x00, 0xD6, 0x08, 0x24, 0x04, 0xD6, 0x08, 0xC0, 0x00,
+ 0x28, 0x04, 0xC2, 0x08, 0xC2, 0x28, 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04, 0x00, 0x01,
+ 0x01, 0x01, 0x10, 0x04, 0x56, 0x0A, 0x56, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x56, 0x0A, 0x18, 0x04,
+ 0x56, 0x0A, 0x40, 0x02, 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0x42, 0x02, 0x56, 0x0A,
+ 0x24, 0x04, 0x56, 0x0A, 0x40, 0x02, 0x28, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x08, 0x04, 0x40, 0x01,
+ 0x41, 0x01, 0x0C, 0x04, 0x40, 0x04, 0x41, 0x04, 0x10, 0x04, 0xCE, 0x08, 0x4E, 0x0A, 0x14, 0x04,
+ 0x42, 0x02, 0x4E, 0x0A, 0x18, 0x04, 0x4E, 0x0A, 0x40, 0x02, 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A,
+ 0x20, 0x04, 0xC2, 0x00, 0xCE, 0x08, 0x24, 0x04, 0xCE, 0x08, 0xC0, 0x00, 0x28, 0x04, 0xC2, 0x08,
+ 0xC2, 0x28, 0x08, 0x04, 0x40, 0x01, 0x41, 0x01, 0x0C, 0x04, 0x00, 0x01, 0x01, 0x01, 0x10, 0x04,
+ 0x4E, 0x0A, 0x4E, 0x0A, 0x14, 0x04, 0x42, 0x02, 0x4E, 0x0A, 0x18, 0x04, 0x4E, 0x0A, 0x40, 0x02,
+ 0x1C, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x20, 0x04, 0x42, 0x02, 0x4E, 0x0A, 0x24, 0x04, 0x4E, 0x0A,
+ 0x40, 0x02, 0x28, 0x04, 0x42, 0x0A, 0x42, 0x2A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x03, 0x00, 0x05, 0x00, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x16,
+ 0xA0, 0x16, 0xA0, 0x16, 0xA0, 0x17, 0xA0, 0x17, 0xA0, 0x17, 0xA0, 0x18, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06,
+ 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0xFF, 0x06, 0x00, 0x00, 0x65, 0x00,
+ 0x65, 0x00, 0x65, 0x00, 0x65, 0x00, 0x5D, 0x00, 0x52, 0x00, 0x48, 0x00, 0x40, 0x00, 0x38, 0x00,
+ 0x31, 0x00, 0x2C, 0x00, 0x27, 0x00, 0x23, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x65, 0x00, 0x65, 0x00,
+ 0x65, 0x00, 0x65, 0x00, 0x5D, 0x00, 0x52, 0x00, 0x48, 0x00, 0x40, 0x00, 0x38, 0x00, 0x31, 0x00,
+ 0x2C, 0x00, 0x27, 0x00, 0x23, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00,
+ 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x19, 0x00,
+ 0x19, 0x00, 0x19, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00,
+ 0x0C, 0x00, 0x0C, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x15, 0x00, 0x6E, 0x6F, 0x6E, 0x2D,
+ 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x53, 0x53, 0x49, 0x44, 0x20, 0x21,
+ 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x09,
+ 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x00, 0x00, 0x48, 0x45, 0x52, 0x4D, 0x45, 0x53,
+ 0x20, 0x32, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x01, 0x00, 0x15, 0x00,
+ 0x6E, 0x6F, 0x6E, 0x2D, 0x73, 0x70, 0x65, 0x63, 0x69, 0x66, 0x69, 0x65, 0x64, 0x20, 0x53, 0x53,
+ 0x49, 0x44, 0x20, 0x21, 0x21, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x01, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x00, 0x09, 0x00, 0x00, 0x01, 0x00, 0x64, 0x00, 0x64, 0x00, 0x00, 0x00, 0x48, 0x45,
+ 0x52, 0x4D, 0x45, 0x53, 0x20, 0x32, 0x00, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x69,
+ 0x72, 0x73, 0x74, 0x20, 0x57, 0x61, 0x76, 0x65, 0x4C, 0x41, 0x4E, 0x20, 0x49, 0x49, 0x20, 0x53,
+ 0x53, 0x49, 0x44, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x0F, 0xF0, 0x0F,
+ 0x0F, 0x00, 0x50, 0x01, 0x02, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14,
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00,
+ 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x24, 0x00, 0xFF, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x09, 0x00, 0x0A, 0x00, 0x0A, 0x00,
+ 0x0B, 0x00, 0x0B, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x0A, 0x00, 0x00, 0x00, 0x02, 0x01,
+ 0x02, 0x04, 0x0B, 0x16, 0x00, 0x00, 0x00, 0x00, 0x02, 0x01, 0x82, 0x84, 0x8B, 0x96, 0x00, 0x00,
+ 0x00, 0x00, 0x1C, 0x85, 0x00, 0x00, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x03, 0x00, 0x20, 0x00, 0x1B, 0x00, 0x17, 0x00, 0x11, 0x00, 0x10, 0x00, 0x0B, 0x00,
+ 0x0B, 0x00, 0x09, 0x00, 0x17, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0D, 0x00, 0x0B, 0x00, 0x09, 0x00,
+ 0x08, 0x00, 0x07, 0x00, 0x0D, 0x00, 0x0A, 0x00, 0x09, 0x00, 0x08, 0x00, 0x05, 0x00, 0x05, 0x00,
+ 0xD8, 0x0C, 0xC0, 0x08, 0x90, 0x0D, 0x60, 0x09, 0x48, 0x0E, 0x30, 0x0A, 0x24, 0x0F, 0x18, 0x0B,
+ 0x0B, 0x6E, 0x0B, 0x37, 0x02, 0x14, 0x01, 0x0A, 0x04, 0x00, 0x04, 0x00, 0x04, 0x00, 0x03, 0x00,
+ 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x43, 0x75, 0x72, 0x72, 0x65,
+ 0x6E, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x20, 0x53, 0x65, 0x74, 0x20, 0x49,
+ 0x64, 0x65, 0x6E, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x20, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x30, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0xDD, 0x00, 0x50,
+ 0xF2, 0x01, 0x01, 0x00, 0x00, 0x50, 0xF2, 0x05, 0x02, 0x00, 0x00, 0x50, 0xF2, 0x02, 0x00, 0x50,
+ 0xF2, 0x04, 0x02, 0x00, 0x00, 0x50, 0xF2, 0x00, 0x00, 0x50, 0xF2, 0x01, 0x06, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x15, 0x00, 0x14, 0x00, 0x15, 0x00, 0x36, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x14, 0x00,
+ 0x11, 0x00, 0x36, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x01, 0x00, 0x10, 0x00, 0xBE, 0x33, 0x1E, 0x33, 0xCC, 0x35, 0xD0, 0x35, 0xD4, 0x35, 0x12, 0x34,
+ 0x04, 0x36, 0x08, 0x36, 0xF2, 0x33, 0x00, 0x00, 0x00, 0x00, 0x24, 0x2F, 0x14, 0x33, 0x08, 0x36,
+ 0xFF, 0xFF, 0x00, 0x00, 0xBE, 0x33, 0x1E, 0x33, 0xCC, 0x35, 0xD0, 0x35, 0xD4, 0x35, 0x12, 0x34,
+ 0x04, 0x36, 0x08, 0x36, 0xF2, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x00, 0x00, 0xBE, 0x33, 0x14, 0x33, 0x08, 0x36, 0x5C, 0x34, 0x2A, 0x33, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x03, 0x00, 0x02, 0x06, 0x00, 0x00, 0x06, 0x07,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x2A,
+ 0x00, 0x00, 0x08, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDD, 0x00, 0x30, 0x00, 0xFF, 0xFF, 0x1D, 0xFA,
+ 0xF9, 0xF9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x19, 0x0A,
+ 0x09, 0x46, 0x1C, 0x60, 0x18, 0x00, 0x19, 0x1D, 0x09, 0x42, 0x1C, 0x60, 0x00, 0x00,
+
+}; /* fw_image_2_data */
+
+static const hcf_8 fw_image_3_data[] = {
+ 0x2A, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x08, 0x26, 0x1A, 0x00, 0x80, 0x3A, 0x15, 0x00, 0x7F, 0xF1,
+ 0x32, 0xF2, 0x33, 0xF2, 0xD0, 0x80, 0x80, 0xF1, 0x0F, 0x02, 0xD0, 0x80, 0x34, 0xF2, 0x81, 0xF1,
+ 0x0B, 0x02, 0xD0, 0x80, 0xFF, 0xFF, 0x08, 0x02, 0xE9, 0x60, 0x58, 0x4F, 0x30, 0x78, 0xFF, 0xFF,
+ 0x24, 0x60, 0x58, 0x4F, 0xE3, 0x78, 0xFF, 0xFF, 0x1C, 0x60, 0xD7, 0x78, 0xFF, 0xFF, 0x00, 0xF4,
+ 0xAA, 0x60, 0xAA, 0x65, 0x09, 0xF2, 0x5A, 0xD0, 0xD4, 0x80, 0x03, 0x64, 0x12, 0x02, 0xD0, 0x80,
+ 0x1D, 0x60, 0x60, 0x65, 0x0E, 0x02, 0x5A, 0xD2, 0xFF, 0xFF, 0xD4, 0x80, 0x01, 0x60, 0x00, 0x65,
+ 0x08, 0x02, 0x5A, 0xD2, 0xFF, 0xFF, 0xD4, 0x80, 0xFF, 0xFF, 0x03, 0x02, 0x1C, 0x60, 0xD7, 0x78,
+ 0xFF, 0xFF, 0x00, 0x60, 0xEA, 0xF1, 0x5A, 0xD1, 0x44, 0x48, 0x5A, 0xD1, 0x44, 0x4A, 0x26, 0x46,
+ 0x3F, 0xF2, 0x00, 0xF4, 0x44, 0x4C, 0xD8, 0x83, 0x70, 0x61, 0x68, 0x65, 0xD7, 0x80, 0xFF, 0xFF,
+ 0x07, 0x0E, 0x08, 0xF2, 0x08, 0x00, 0x68, 0x65, 0xD7, 0x80, 0xFF, 0xFF, 0x01, 0x0E, 0x03, 0x00,
+ 0x1C, 0x60, 0xED, 0x78, 0xFF, 0xFF, 0x58, 0x4F, 0x79, 0x00, 0x9C, 0x80, 0x01, 0x65, 0x02, 0x02,
+ 0x00, 0x65, 0x02, 0x00, 0xFF, 0x3B, 0xF7, 0x01, 0x58, 0x4F, 0x70, 0x00, 0x9C, 0x80, 0x45, 0x42,
+ 0xEA, 0x02, 0x58, 0x4F, 0x6B, 0x00, 0x9C, 0x80, 0xFF, 0xFF, 0xE5, 0x02, 0x58, 0x4F, 0x66, 0x00,
+ 0x9C, 0x80, 0xFF, 0xFF, 0x03, 0x02, 0x00, 0x65, 0x45, 0x42, 0xF8, 0x01, 0xFF, 0x3A, 0x29, 0x00,
+ 0x60, 0x47, 0xFF, 0xB5, 0x28, 0x44, 0xFF, 0xB4, 0x94, 0x80, 0xFF, 0xFF, 0xD4, 0x02, 0x60, 0x45,
+ 0x28, 0x47, 0x2A, 0x5F, 0x40, 0x48, 0x2A, 0x47, 0x2C, 0x5F, 0x40, 0x4A, 0x2C, 0x47, 0x65, 0x5F,
+ 0x40, 0x4C, 0x10, 0x64, 0x40, 0x42, 0x28, 0x45, 0x05, 0x00, 0x58, 0x4F, 0x47, 0x00, 0x94, 0x80,
+ 0x28, 0x45, 0x26, 0x02, 0x58, 0x4F, 0x42, 0x00, 0x94, 0x80, 0x2A, 0x45, 0x21, 0x02, 0x58, 0x4F,
+ 0x3D, 0x00, 0x94, 0x80, 0xFF, 0xFF, 0x1C, 0x02, 0x22, 0x44, 0x4C, 0x82, 0x2C, 0x45, 0x31, 0x03,
+ 0xEC, 0x01, 0x10, 0x65, 0x45, 0x42, 0x28, 0x45, 0x94, 0x80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x60, 0x48, 0xF1, 0xFF, 0xB5, 0x64, 0x40, 0x02, 0x2B,
+ 0x0B, 0x00, 0x60, 0x40, 0x03, 0x2E, 0x08, 0x00, 0x80, 0x2B, 0x06, 0x00, 0x32, 0x44, 0x00, 0x60,
+ 0x80, 0x63, 0x3C, 0x94, 0x40, 0x52, 0x05, 0x00, 0x32, 0x44, 0xFF, 0x60, 0x7F, 0x63, 0x2C, 0x94,
+ 0x40, 0x52, 0x65, 0x43, 0x16, 0x60, 0xAB, 0xFD, 0x16, 0x60, 0xC2, 0xF1, 0x66, 0x41, 0xA6, 0xF5,
+ 0x3A, 0xF2, 0x64, 0x40, 0x01, 0x36, 0x22, 0x64, 0x3A, 0xFA, 0x61, 0x46, 0x32, 0x45, 0x16, 0x60,
+ 0xCB, 0xF1, 0x10, 0x67, 0xB4, 0x85, 0x64, 0x40, 0x01, 0x2A, 0x94, 0x85, 0x45, 0x52, 0xFF, 0x60,
+ 0xE7, 0x65, 0x32, 0x41, 0xA5, 0x81, 0x16, 0x60, 0xC2, 0xF3, 0x08, 0x65, 0xFF, 0xA0, 0xFF, 0xFF,
+ 0x01, 0x03, 0x07, 0x00, 0x16, 0x60, 0xC4, 0xF3, 0xB5, 0x81, 0x10, 0x65, 0x60, 0x40, 0x01, 0x26,
+ 0xB5, 0x81, 0x41, 0x52, 0x19, 0x60, 0x48, 0xF3, 0x37, 0x60, 0xE6, 0x63, 0xF0, 0x84, 0xF0, 0x84,
+ 0xF0, 0x84, 0x03, 0xB5, 0xF0, 0x84, 0xF0, 0x84, 0x03, 0xB4, 0x65, 0x5C, 0xA3, 0xD9, 0x37, 0x60,
+ 0xE8, 0x63, 0x02, 0xA8, 0xA3, 0xDB, 0x15, 0x02, 0x00, 0x60, 0xC8, 0x64, 0x1B, 0x60, 0xF5, 0xFB,
+ 0x1B, 0x60, 0xF9, 0xFB, 0x07, 0x60, 0xD0, 0x64, 0x1B, 0x60, 0xF6, 0xFB, 0x1B, 0x60, 0xFA, 0xFB,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, 0x84, 0xA2, 0xDB, 0xCF, 0xFE, 0x2F, 0x58,
+ 0xFF, 0xFF, 0x08, 0x60, 0x0C, 0xF1, 0x00, 0x60, 0x20, 0x64, 0xB0, 0x84, 0xA2, 0xDB, 0xCF, 0xFE,
+ 0x08, 0x60, 0x1B, 0xF1, 0x00, 0x60, 0x40, 0x64, 0xB0, 0x84, 0xA2, 0xDB, 0xCF, 0xFE, 0x2F, 0x58,
+ 0xFF, 0xFF, 0x26, 0x46, 0x27, 0xF2, 0x70, 0x63, 0x60, 0x40, 0x0A, 0x36, 0x10, 0x00, 0x14, 0x36,
+ 0x14, 0x00, 0x37, 0x36, 0x0E, 0x00, 0x6E, 0x36, 0x0E, 0x00, 0x06, 0x36, 0x04, 0x00, 0x09, 0x36,
+ 0x04, 0x00, 0x18, 0x63, 0x0A, 0x00, 0x30, 0x63, 0x08, 0x00, 0x26, 0x63, 0x06, 0x00, 0xD0, 0x63,
+ 0x04, 0x00, 0x33, 0x63, 0x02, 0x00, 0x21, 0x63, 0x00, 0x00, 0x10, 0x60, 0x0E, 0xFD, 0x26, 0x46,
+ 0x3F, 0xF2, 0x87, 0xF0, 0x00, 0xF4, 0x45, 0x43, 0x03, 0x4B, 0x60, 0x43, 0xF4, 0xA3, 0x00, 0x60,
+ 0x1D, 0x61, 0x00, 0x60, 0x01, 0x65, 0x01, 0x60, 0xFF, 0x64, 0x40, 0x4C, 0xFD, 0x60, 0x58, 0x4E,
+ 0x7A, 0x78, 0xFF, 0xFF, 0x00, 0xBB, 0xFF, 0xFF, 0x00, 0x02, 0x00, 0x64, 0x40, 0x4A, 0x60, 0xFE,
+ 0x02, 0x60, 0x00, 0x63, 0xBD, 0xD3, 0xBD, 0xD3, 0x60, 0x41, 0xFE, 0x60, 0x58, 0x4E, 0x2C, 0x78,
+ 0xFF, 0xFF, 0x20, 0xFE, 0x26, 0x46, 0x3F, 0xF2, 0x00, 0xF4, 0x60, 0x43, 0xF4, 0xA3, 0x00, 0x60,
+ 0x1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60, 0x0B, 0xFD, 0xFF, 0xFF, 0x62, 0xFF, 0x28, 0x60, 0x67, 0x63, 0x9F, 0xFD,
+ 0xFF, 0xFF, 0x1A, 0xFF, 0x2A, 0x60, 0x1D, 0x78, 0xFF, 0xFF, 0xA3, 0x60, 0xF4, 0x63, 0x06, 0x60,
+ 0x0B, 0xFD, 0xFF, 0xFF, 0x62, 0xFF, 0x29, 0xF5, 0x26, 0x60, 0x20, 0x63, 0x25, 0x60, 0xF2, 0x64,
+ 0xBD, 0xDB, 0x66, 0x44, 0xBD, 0xDB, 0x02, 0x64, 0xA3, 0xDB, 0xFF, 0xFF, 0x2B, 0xFF, 0xF9, 0xFE,
+ 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x68, 0x01, 0x00, 0x36, 0x69, 0x01, 0x01, 0x36, 0x6B, 0x01,
+ 0x02, 0x36, 0x81, 0x01, 0x03, 0x36, 0x8B, 0x01, 0x04, 0x36, 0xC1, 0x01, 0x05, 0x36, 0xBF, 0x01,
+ 0x06, 0x36, 0xF1, 0x01, 0x07, 0x36, 0xBB, 0x01, 0x08, 0x36, 0x8C, 0x01, 0x09, 0x36, 0x0C, 0x00,
+ 0x0A, 0x36, 0x0D, 0x00, 0x0B, 0x36, 0x0E, 0x00, 0x0C, 0x36, 0x17, 0x00, 0x0D, 0x36, 0x0D, 0x00,
+ 0x0E, 0x36, 0x1D, 0x00, 0x0F, 0x36, 0x41, 0x00, 0x02, 0x60, 0x00, 0x64, 0x08, 0x00, 0x04, 0x60,
+ 0x00, 0x64, 0x05, 0x00, 0x00, 0x60, 0x01, 0x64, 0x02, 0x00, 0x20, 0x60, 0x00, 0x64, 0x32, 0x45,
+ 0xB4, 0x85, 0x45, 0x52, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x29, 0x60, 0xDE, 0x63, 0x06, 0x60,
+ 0x0B, 0xFD, 0x62, 0xFF, 0xFF, 0xFF, 0x1A, 0xFF, 0x00, 0x67, 0x23, 0x58, 0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0xFF, 0x86, 0x3E, 0xB4, 0xFE, 0x0B, 0x05,
+ 0xB5, 0xFE, 0x02, 0x24, 0x9F, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xB7, 0xFE, 0x07, 0x05, 0x78, 0x43,
+ 0x01, 0x61, 0x29, 0x60, 0xEA, 0x78, 0x34, 0x60, 0xC8, 0x78, 0xFF, 0xFF, 0x36, 0x44, 0x00, 0x7F,
+ 0xEE, 0xA0, 0x60, 0x45, 0x05, 0x05, 0x20, 0x60, 0xBA, 0x64, 0x44, 0xD7, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x78, 0x43, 0x01, 0x61, 0x29, 0x60, 0xEA, 0x78, 0x78, 0x43, 0x01, 0x61, 0x29, 0x60, 0xEA, 0x78,
+ 0x7F, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x10, 0x02, 0x10, 0x64,
+ 0x40, 0x40, 0x02, 0x64, 0x40, 0x50, 0x61, 0xFF, 0x3F, 0x40, 0x40, 0x26, 0x04, 0x00, 0x10, 0xE0,
+ 0x46, 0x60, 0x09, 0xE0, 0x00, 0x00, 0x27, 0xF1, 0x00, 0x66, 0x20, 0x78, 0x42, 0xFE, 0x23, 0x58,
+ 0xFF, 0xFF, 0x7F, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x1A, 0x02,
+ 0x0E, 0x60, 0xDD, 0xF3, 0x07, 0x7C, 0x20, 0xB5, 0x0C, 0xB5, 0x04, 0x03, 0x03, 0x02, 0xDB, 0xF9,
+ 0x00, 0x67, 0x10, 0x00, 0x00, 0x61, 0x41, 0x56, 0xC7, 0xFE, 0xAD, 0x01, 0x36, 0x47, 0xFF, 0x23,
+ 0x04, 0x00, 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x05, 0x00, 0x62, 0xFF, 0x20, 0x44, 0x80, 0xBC,
+ 0x40, 0x40,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B,
+ 0x28, 0x44, 0xBD, 0xDB, 0x29, 0x44, 0xBD, 0xDB, 0x2A, 0x44, 0xBD, 0xDB, 0x2B, 0x44, 0xBD, 0xDB,
+ 0x2C, 0x44, 0xBD, 0xDB, 0x2D, 0x44, 0xBD, 0xDB, 0x2E, 0x44, 0xBD, 0xDB, 0x2F, 0x44, 0xBD, 0xDB,
+ 0xDD, 0x81, 0x08, 0x3A, 0xD0, 0x01, 0x54, 0x00, 0x27, 0x40, 0x10, 0x26, 0x30, 0x00, 0x26, 0x44,
+ 0x01, 0x36, 0x2D, 0x00, 0x02, 0x36, 0x82, 0xFF, 0x03, 0x36, 0x83, 0xFF, 0x04, 0x36, 0x84, 0xFF,
+ 0x05, 0x36, 0x85, 0xFF, 0x06, 0x36, 0x86, 0xFF, 0x25, 0x44, 0x00, 0x36, 0x44, 0x40, 0x01, 0x36,
+ 0x44, 0x41, 0x02, 0x36, 0x44, 0x42, 0x03, 0x36, 0x44, 0x43, 0x04, 0x36, 0x44, 0x44, 0x05, 0x36,
+ 0x44, 0x45, 0x06, 0x36, 0x44, 0x46, 0x07, 0x36, 0x44, 0x47, 0x08, 0x36, 0x44, 0x48, 0x09, 0x36,
+ 0x44, 0x49, 0x0A, 0x36, 0x44, 0x4A, 0x0B, 0x36, 0x44, 0x4B, 0x0C, 0x36, 0x44, 0x4C, 0x0D, 0x36,
+ 0x44, 0x4D, 0x0E, 0x36, 0x44, 0x4E, 0x0F, 0x36, 0x44, 0x4F, 0x87, 0xFF, 0x21, 0x00, 0x25, 0x44,
+ 0x10, 0x36, 0x44, 0x50, 0x11, 0x36, 0x44, 0x51, 0x12, 0x36, 0x44, 0x52, 0x13, 0x36, 0x44, 0x53,
+ 0x14, 0x36, 0x44, 0x54, 0x15, 0x36, 0x44, 0x55, 0x16, 0x36, 0x44, 0x56, 0x17, 0x36, 0x44, 0x57,
+ 0x18, 0x36, 0x44, 0x58, 0x19, 0x36, 0x44, 0x59, 0x1A, 0x36, 0x44, 0x5A,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62, 0x15, 0x02, 0xA2, 0xD9, 0x64, 0x41, 0x32, 0x44, 0x40, 0xB5, 0x00, 0xB9, 0xD4, 0x84,
+ 0x08, 0x24, 0x0C, 0x00, 0x40, 0xBC, 0x02, 0xB5, 0xD4, 0x84, 0x43, 0xF9, 0x37, 0x60, 0x76, 0x63,
+ 0xD3, 0x80, 0x2F, 0x60, 0x50, 0x7C, 0x02, 0x03, 0x43, 0xFD, 0xA4, 0xDF, 0x40, 0x52, 0x00, 0x67,
+ 0x23, 0x58, 0xFF, 0xFF, 0x37, 0x60, 0x76, 0x64, 0x43, 0xFB, 0x2D, 0x60, 0x5B, 0x78, 0xFF, 0xFF,
+ 0x23, 0xF2, 0x25, 0xF0, 0x01, 0x60, 0xAC, 0x63, 0x7F, 0x67, 0x39, 0x18, 0xA3, 0xD9, 0x26, 0xF0,
+ 0x7F, 0x67, 0x35, 0x18, 0x5B, 0xD9, 0x16, 0x60, 0x87, 0xF3, 0x25, 0xF0, 0x60, 0x40, 0x03, 0x3A,
+ 0x2D, 0x00, 0xA6, 0xF3, 0x20, 0x63, 0xE3, 0x83, 0x60, 0x46, 0x0F, 0xF8, 0x30, 0x61, 0x94, 0xFA,
+ 0x01, 0x61, 0x91, 0xFA, 0x16, 0x64, 0x12, 0xFA, 0x60, 0x40, 0x10, 0x36, 0x05, 0x00, 0x12, 0x36,
+ 0x08, 0x00, 0x0C, 0x36, 0x0B, 0x00, 0x0F, 0x00, 0x40, 0x61, 0xA1, 0x80, 0x0A, 0x64, 0x11, 0x02,
+ 0xF3, 0x01, 0x10, 0x61, 0xA1, 0x80, 0x0E, 0x64, 0x0C, 0x02, 0xEE, 0x01, 0x08, 0x61, 0xA1, 0x80,
+ 0x10, 0x64, 0x07, 0x02, 0xE9, 0x01, 0xE1, 0x81, 0xA1, 0x80, 0x05, 0x05, 0xC8, 0x84, 0x01, 0x02,
+ 0xE3, 0x01, 0x12, 0xFA, 0x91, 0xFA, 0x66, 0x44, 0x02, 0xA6, 0xD7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0xFB, 0x13, 0x64, 0xCB, 0xFB, 0x01, 0x60, 0x67, 0x64, 0x37, 0xFB, 0x0C, 0x00, 0x10, 0xBC,
+ 0x19, 0x60, 0x7B, 0xFB, 0x08, 0x64, 0xCB, 0xFB, 0xA1, 0xF3, 0x01, 0x60, 0x67, 0x7C, 0x60, 0x40,
+ 0x01, 0x27, 0x5B, 0x7C, 0x37, 0xF9, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0xF2, 0x19, 0x60,
+ 0x4D, 0xFB, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x25, 0xF2, 0x19, 0x60, 0x4E, 0xFB, 0x00, 0x67,
+ 0x23, 0x58, 0xFF, 0xFF, 0x25, 0xF2, 0x19, 0x60, 0x89, 0xFB, 0xFF, 0xFF, 0x0F, 0x22, 0x41, 0x75,
+ 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x01, 0x64, 0x01, 0x00, 0x00, 0x64, 0x1B, 0x60, 0xFE, 0xFB,
+ 0x7E, 0x60, 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x0E, 0x02, 0x06, 0x61,
+ 0x41, 0x56, 0xC7, 0xFE, 0x2A, 0x60, 0x1D, 0x78, 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00,
+ 0x00, 0x7F, 0x60, 0x41, 0x7F, 0x67, 0x01, 0x00, 0x00, 0x67, 0x23, 0x58, 0xFF, 0xFF, 0x7F, 0x60,
+ 0xC0, 0x64, 0x24, 0x45, 0xA4, 0x80, 0x7F, 0x67, 0x02, 0x61, 0x0E, 0x02, 0x08, 0x61, 0x41, 0x56,
+ 0xC7, 0xFE, 0x2A, 0x60, 0x1D, 0x78, 0xFF, 0xFF, 0x36, 0x47, 0xFF, 0x23, 0x04, 0x00, 0x00, 0x7F,
+ 0x60, 0x41, 0x7F, 0x67, 0x01, 0x00, 0x00, 0x67, 0x23, 0x58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, 0x63, 0xAB, 0x46, 0x59, 0xD0, 0xAB, 0x46, 0x58, 0xD8, 0xFB, 0x1F, 0xA0, 0x64, 0x04, 0x63,
+ 0xAB, 0x46, 0x59, 0xD0, 0xAB, 0x46, 0x58, 0xD8, 0xFB, 0x1F, 0x00, 0x67, 0x00, 0x61, 0x23, 0x58,
+ 0xFF, 0xFF, 0x01, 0x67, 0x20, 0x61, 0x23, 0x58, 0xFF, 0xFF, 0x27, 0xF2, 0x1D, 0x60, 0xC0, 0x65,
+ 0x60, 0x47, 0x00, 0x7F, 0xE0, 0x84, 0x44, 0xD3, 0x66, 0x41, 0x60, 0x46, 0x60, 0x43, 0x05, 0xF2,
+ 0x16, 0x18, 0x61, 0x46, 0x27, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x04, 0xF2, 0x0C, 0x02, 0x61, 0x46,
+ 0x26, 0xF0, 0x63, 0x46, 0xD0, 0x80, 0x03, 0xF2, 0x06, 0x02, 0x61, 0x46, 0x25, 0xF0, 0x63, 0x46,
+ 0xD0, 0x80, 0xFF, 0xFF, 0x07, 0x03, 0x80, 0xF4, 0xFF, 0xFF, 0x63, 0x46, 0xE8, 0x1B, 0xA6, 0xF3,
+ 0x08, 0xFE, 0x60, 0x43, 0x61, 0x46, 0x01, 0x03, 0x0D, 0x00, 0x43, 0x4B, 0xAB, 0x46, 0x3B, 0xF2,
+ 0x80, 0x60, 0x30, 0x61, 0x9D, 0x85, 0xA4, 0x84, 0xA2, 0xDA, 0xAB, 0x46, 0x00, 0x67, 0x00, 0x61,
+ 0x23, 0x58, 0xFF, 0xFF, 0x01, 0x67, 0x20, 0x61, 0x23, 0x58, 0xFF, 0xFF, 0xA2, 0xFF, 0x46, 0x45,
+ 0x02, 0xF0, 0x09, 0x60, 0x08, 0x64, 0xD0, 0x80, 0x00, 0xF4, 0x01, 0xF2, 0x66, 0x5C, 0x25, 0x46,
+ 0x56, 0x02, 0x70, 0x27, 0x54, 0x00, 0x12, 0x64, 0x03, 0xFA,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x85, 0xE8, 0xE2, 0xE4, 0xE2, 0x61, 0x42, 0x49, 0x91, 0x64, 0x44,
+ 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0xB4, 0x84, 0x60, 0x45,
+ 0x51, 0x94, 0x04, 0x60, 0x00, 0x61, 0x01, 0x0D, 0x44, 0x94, 0x62, 0x41, 0x19, 0x60, 0xF5, 0xF1,
+ 0x61, 0x42, 0x64, 0x43, 0xCF, 0x83, 0xCF, 0x83, 0x03, 0x03, 0xE3, 0x83, 0x48, 0x94, 0xFE, 0x1F,
+ 0x2E, 0x40, 0x01, 0x26, 0xE0, 0x84, 0x60, 0x41, 0xE9, 0x81, 0xE9, 0x81, 0xE9, 0x81, 0xE9, 0x81,
+ 0x44, 0x94, 0xE9, 0x81, 0xE9, 0x81, 0x54, 0x94, 0xE9, 0x81, 0xE9, 0x81, 0xE9, 0x81, 0x44, 0x94,
+ 0xE9, 0x81, 0xE9, 0x81, 0xE9, 0x81, 0x54, 0x94, 0x19, 0xE2, 0x2E, 0x40, 0x01, 0x26, 0xE8, 0x84,
+ 0x29, 0x61, 0x54, 0x91, 0x61, 0x43, 0x11, 0x06, 0x75, 0x44, 0x80, 0x2B, 0xAB, 0xFF, 0x80, 0x27,
+ 0x0C, 0x00, 0x14, 0xE0, 0x94, 0xE0, 0x34, 0xE2, 0x61, 0x5A, 0x48, 0x21, 0xFE, 0x01, 0x00, 0xE0,
+ 0x7A, 0x43, 0x15, 0xA1, 0x75, 0x40, 0x80, 0x2B, 0x06, 0xA1, 0x5D, 0x91, 0x61, 0x44, 0x2E, 0x40,
+ 0x01, 0x26, 0xE0, 0x84, 0x60, 0x43, 0xEB, 0x83, 0xEB, 0x83, 0xEB, 0x83, 0x89, 0xFF, 0x10, 0xE0,
+ 0x80, 0x60, 0x00, 0x75, 0x88, 0xFF, 0xEB, 0x83, 0xEB, 0x83, 0x5C, 0x94, 0xEB, 0x83, 0x5C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x50, 0xA4, 0x52, 0x27, 0x60, 0x36, 0x63, 0x1E, 0x61, 0x3D, 0x60,
+ 0x58, 0x4D, 0x23, 0x78, 0xFF, 0xFF, 0x00, 0x60, 0x14, 0x71, 0x8D, 0xE2, 0x40, 0xE1, 0x40, 0x29,
+ 0xFE, 0x01, 0x31, 0x44, 0x40, 0x26, 0x02, 0x00, 0x80, 0x26, 0x17, 0x00, 0x28, 0x60, 0xE6, 0x63,
+ 0x07, 0x60, 0xE8, 0xFD, 0x09, 0x61, 0x3D, 0x60, 0x58, 0x4D, 0x23, 0x78, 0xFF, 0xFF, 0x31, 0x44,
+ 0x40, 0x2A, 0x14, 0x00, 0x31, 0x44, 0x7F, 0xB4, 0x40, 0x51, 0xAE, 0x4C, 0x10, 0x26, 0x0E, 0x00,
+ 0x07, 0x60, 0xE9, 0xFB, 0x31, 0x44, 0x80, 0xBC, 0x40, 0x51, 0x29, 0x60, 0x1C, 0x63, 0x07, 0x60,
+ 0xE8, 0xFD, 0x09, 0x61, 0x3D, 0x60, 0x58, 0x4D, 0x23, 0x78, 0xFF, 0xFF, 0x27, 0x60, 0xEA, 0x63,
+ 0x03, 0x61, 0x3D, 0x60, 0x58, 0x4D, 0x23, 0x78, 0xFF, 0xFF, 0x00, 0x60, 0x10, 0x62, 0x19, 0x60,
+ 0x8F, 0x7C, 0x00, 0x60, 0xAC, 0x65, 0x3D, 0x60, 0x58, 0x4D, 0x0F, 0x78, 0xFF, 0xFF, 0x80, 0xE1,
+ 0xBF, 0xFE, 0xA1, 0x4F, 0x70, 0xB4, 0x50, 0x36, 0x0C, 0x00, 0x20, 0x36, 0x03, 0x00, 0x3A, 0x60,
+ 0x77, 0x78, 0xFF, 0xFF, 0x01, 0x60, 0x1A, 0xE1, 0xDF, 0xFE, 0x19, 0xFF, 0x00, 0xE1, 0xA1, 0xFF,
+ 0xFF, 0xFF, 0x20, 0x44, 0x40, 0x2A, 0x85, 0x00, 0x7D, 0xF1, 0x3B, 0x00, 0x83, 0x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0x24, 0x89, 0x31, 0x40, 0x08, 0x26, 0x0B, 0x00, 0x21, 0x46,
+ 0xA7, 0xF4, 0x1D, 0xF2, 0xFF, 0xB3, 0x00, 0x7C, 0x05, 0x03, 0x06, 0x61, 0x5D, 0x91, 0x09, 0x60,
+ 0x02, 0x65, 0x02, 0x03, 0x00, 0x61, 0x15, 0x00, 0xD4, 0x80, 0x63, 0x45, 0xFB, 0x07, 0x65, 0x43,
+ 0x80, 0x60, 0x00, 0x62, 0xF6, 0x82, 0x53, 0x90, 0xE3, 0x83, 0xFC, 0x04, 0xEB, 0x83, 0xEB, 0x83,
+ 0xEA, 0x82, 0x5C, 0x94, 0xB2, 0x9C, 0xF3, 0x07, 0x64, 0x41, 0xDD, 0x81, 0xE1, 0x81, 0xE1, 0x81,
+ 0xE1, 0x81, 0x2B, 0x44, 0x54, 0x90, 0x70, 0x45, 0x02, 0x28, 0x61, 0x44, 0xC4, 0x84, 0xFF, 0xFF,
+ 0x04, 0x24, 0x00, 0xB4, 0x60, 0x50, 0x08, 0x28, 0x01, 0x00, 0x20, 0x29, 0x6D, 0xE2, 0xA4, 0xE2,
+ 0xC4, 0xE2, 0x47, 0xFF, 0xB6, 0xFF, 0xB7, 0xFF, 0xB4, 0xFF, 0x32, 0xF1, 0x08, 0x29, 0x09, 0x00,
+ 0x64, 0x40, 0x07, 0x22, 0x06, 0x00, 0x43, 0xFF, 0x27, 0x44, 0x10, 0xBC, 0x40, 0x47, 0x00, 0x64,
+ 0x32, 0xFB, 0x31, 0x41, 0x3C, 0x44, 0x01, 0xB1, 0x00, 0xBC, 0x0A, 0x02, 0x09, 0x03, 0x32, 0xF3,
+ 0x00, 0x7C, 0x01, 0xB4, 0xFF, 0xFF, 0x04, 0x03, 0x32, 0xF9, 0x02, 0x64, 0x31, 0xFB, 0xC0, 0xFE,
+ 0xC8, 0x60, 0x09, 0x7D, 0x00, 0x60, 0x00, 0x6B, 0x00, 0x64, 0x33, 0xFB, 0x0C, 0x60, 0x16, 0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0x5C, 0x40, 0xEF, 0x60, 0x58, 0x4F, 0x1B, 0x78, 0xFF, 0xFF, 0x1D, 0x60, 0x58, 0x4F,
+ 0x81, 0x78, 0xFF, 0xFF, 0xD3, 0x60, 0x58, 0x4F, 0x58, 0x78, 0xFF, 0xFF, 0xE7, 0x60, 0x58, 0x4F,
+ 0x99, 0x78, 0xFF, 0xFF, 0x20, 0x60, 0x58, 0x4F, 0x19, 0x78, 0xFF, 0xFF, 0xF4, 0x60, 0x58, 0x4F,
+ 0xE9, 0x78, 0xFF, 0xFF, 0xE9, 0x60, 0x58, 0x4F, 0xCA, 0x78, 0xFF, 0xFF, 0x27, 0x60, 0x58, 0x4F,
+ 0x71, 0x78, 0xFF, 0xFF, 0xEE, 0x60, 0x58, 0x4F, 0x69, 0x78, 0xFF, 0xFF, 0x1F, 0xE1, 0xA3, 0xFF,
+ 0xCA, 0x60, 0xD4, 0x78, 0xFF, 0xFF, 0x03, 0xE1, 0xA3, 0xFF, 0xFE, 0xFC, 0xFF, 0xFC, 0x25, 0x60,
+ 0x96, 0x63, 0x17, 0xFD, 0xAE, 0xFF, 0x2A, 0x60, 0x1D, 0x78, 0xFF, 0xFF, 0x42, 0x6F, 0x6F, 0x74,
+ 0x63, 0x6F, 0x64, 0x65, 0x20, 0x21, 0x21, 0x20, 0x20, 0x00, 0x53, 0x54, 0x41, 0x2F, 0x41, 0x50,
+ 0x20, 0x46, 0x75, 0x6E, 0x63, 0x27, 0x73, 0x00, 0x1F, 0x00, 0x04, 0x00, 0x01, 0x00, 0x24, 0x00,
+ 0x00, 0x00, 0x04, 0x00, 0x04, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00,
+ 0x06, 0x00, 0x07, 0x00, 0x05, 0x00, 0x06, 0x00, 0x07, 0x00, 0x06, 0x00, 0x06, 0x00, 0x07, 0x00,
+ 0x01, 0x00, 0x02, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x01, 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 0x43, 0xFA,
+ 0x84, 0x2A, 0x00, 0x00, 0x22, 0x00, 0x44, 0xFA, 0xA6, 0x2A, 0x00, 0x00, 0x22, 0x00, 0x45, 0xFA,
+ 0xC8, 0x2A, 0x00, 0x00, 0x22, 0x00, 0x25, 0xFD, 0x9E, 0x01, 0x00, 0x00, 0x02, 0x00,
+
+}; /* fw_image_3_data */
+
+static const hcf_8 fw_image_4_data[] = {
+ 0x6C, 0x40, 0xA1, 0xFF, 0x98, 0xFF, 0x80, 0x3E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
+ 0x41, 0xFF, 0x33, 0xF3, 0x02, 0x11, 0x31, 0x18, 0x1E, 0x00, 0x44, 0xFF, 0x2E, 0x00, 0xFF, 0xFF,
+ 0xC4, 0xE2, 0x27, 0x44, 0x20, 0x2A, 0x01, 0x00, 0xFF, 0xFF, 0x42, 0x64, 0x3A, 0xDB, 0x23, 0x00,
+ 0x41, 0xFF, 0xA2, 0x60, 0x45, 0x78, 0xE2, 0xFE, 0x40, 0x49, 0x02, 0x60, 0x01, 0xE1, 0x1D, 0x00,
+ 0x44, 0xFF, 0x1B, 0x09, 0x29, 0x44, 0x10, 0x2A, 0x04, 0x74, 0xCD, 0xE2, 0x10, 0x65, 0x0B, 0x00,
+ 0xA3, 0x60, 0xC1, 0x78, 0xA4, 0xE2, 0x29, 0x44, 0x20, 0x2A, 0x0D, 0x00, 0x20, 0xAC, 0xEC, 0x01,
+ 0xA3, 0x60, 0xC1, 0x78, 0x46, 0xFF, 0xB4, 0x84, 0x40, 0x49, 0xA1, 0xFF, 0xFF, 0xFF, 0x80, 0x3E,
+ 0xA3, 0x60, 0xC1, 0x78, 0xFF, 0xFF, 0x62, 0xFF, 0x08, 0xE1, 0xA1, 0xFF, 0x98, 0xFF, 0x80, 0x3E,
+ 0xAA, 0x60, 0xA5, 0x78, 0x4C, 0x4E, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF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0x04, 0x64, 0x22, 0x46, 0x03, 0xFA, 0x60, 0x41, 0x64, 0x46, 0x01, 0xF2,
+ 0xFC, 0xA1, 0x61, 0x45, 0xD4, 0x84, 0xFF, 0xFF, 0x08, 0x02, 0x00, 0xF0, 0x04, 0x63, 0x64, 0x46,
+ 0x01, 0xF2, 0x22, 0x46, 0x1A, 0xFA, 0x03, 0xFC, 0x02, 0x00, 0x22, 0x46, 0x1A, 0xFA, 0x35, 0xF2,
+ 0x04, 0xF8, 0xDC, 0x84, 0x35, 0xFA, 0x14, 0xF2, 0x0F, 0xB5, 0x0F, 0xB4, 0xCC, 0x84, 0x94, 0x80,
+ 0x04, 0x60, 0x00, 0x65, 0x2A, 0xF2, 0x01, 0x02, 0x94, 0x84, 0x2A, 0xFA, 0x95, 0xFC, 0x06, 0x00,
+ 0xC4, 0x3A, 0x07, 0x00, 0x27, 0x44, 0xFD, 0xB4, 0x40, 0x47, 0xA8, 0xE2, 0xA5, 0x60, 0x1C, 0x78,
+ 0xFF, 0xFF, 0x28, 0x44, 0x04, 0x26, 0x05, 0x00, 0x68, 0x3A, 0x03, 0x00, 0x32, 0x44, 0x00, 0x27,
+ 0x03, 0x00, 0xA3, 0x60, 0xF4, 0x78, 0xFF, 0xFF, 0x0A, 0x64, 0x3A, 0xDB, 0xA3, 0x60, 0xF4, 0x78,
+ 0xFF, 0xFF, 0x0E, 0x64, 0x3A, 0xDB, 0x3C, 0x44, 0x60, 0x46, 0x1E, 0xF0, 0x40, 0x42, 0x64, 0x40,
+ 0x40, 0x27, 0x48, 0x00, 0x1F, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x40, 0x27, 0x3C, 0x00, 0x80, 0x2B,
+ 0x0B, 0x00, 0xBF, 0x60, 0xFF, 0x65, 0x29, 0x44, 0x24, 0x89, 0x80, 0x60, 0x00, 0x65, 0x29, 0x44,
+ 0x34, 0x89, 0x80, 0x60, 0x00, 0x63, 0x05, 0x00, 0x3F, 0x60, 0xFF, 0x65, 0x29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6B, 0x60, 0x4C, 0xB5, 0xFF, 0x64, 0x4C, 0x40, 0xE1, 0x01, 0x60, 0x08, 0xE1,
+ 0x84, 0xFF, 0xC2, 0x60, 0x45, 0x64, 0x40, 0x42, 0x82, 0xFF, 0x2A, 0xF2, 0x10, 0x60, 0x00, 0x65,
+ 0xA4, 0x84, 0xB4, 0xBC, 0x1E, 0xF0, 0x40, 0x48, 0x64, 0x40, 0x40, 0x27, 0x17, 0x00, 0x1C, 0xF2,
+ 0xFF, 0xFF, 0x60, 0x40, 0x0A, 0x36, 0x06, 0x00, 0x14, 0x36, 0x07, 0x00, 0x37, 0x36, 0x08, 0x00,
+ 0x6E, 0x36, 0x09, 0x00, 0x70, 0x7C, 0xA0, 0x63, 0x0F, 0x00, 0x38, 0x7C, 0x50, 0x63, 0x0C, 0x00,
+ 0x15, 0x7C, 0x1E, 0x63, 0x09, 0x00, 0x0B, 0x7C, 0x0F, 0x63, 0x06, 0x00, 0x9C, 0xF4, 0xFF, 0x65,
+ 0x63, 0x47, 0xA4, 0x9C, 0xA7, 0x84, 0x23, 0x00, 0x40, 0x45, 0x43, 0x4D, 0x00, 0xE1, 0xF0, 0xFE,
+ 0x29, 0x40, 0x80, 0x2B, 0x03, 0x00, 0x00, 0x60, 0x6A, 0x65, 0x02, 0x00, 0x00, 0x60, 0xCA, 0x65,
+ 0x1F, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x40, 0x27, 0x0E, 0x00, 0x2A, 0xF2, 0xFF, 0xFF, 0x60, 0x40,
+ 0x04, 0x27, 0x03, 0x00, 0x65, 0x44, 0xE0, 0x85, 0x12, 0x00, 0x2B, 0xF2, 0x11, 0xF0, 0xC0, 0x84,
+ 0xD0, 0x84, 0xC4, 0x83, 0x11, 0x00, 0x1E, 0x64, 0xC4, 0x84, 0x60, 0x45, 0x08, 0x00, 0x40, 0x45,
+ 0xFF, 0x60, 0xF8, 0x64, 0x40, 0x43, 0x00, 0xE1, 0xF0, 0xFE, 0x00, 0x60,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, 0xE0, 0xA0, 0x02, 0x0D, 0x00, 0x64, 0x02, 0x00, 0x01, 0x04, 0x1F, 0x64, 0x60, 0x47,
+ 0x07, 0x60, 0xEA, 0xF1, 0xB4, 0x84, 0xB0, 0x8C, 0x29, 0x60, 0xC0, 0x7C, 0x60, 0x47, 0x1F, 0xB4,
+ 0xE0, 0x84, 0xE0, 0x84, 0x40, 0xD3, 0x5A, 0xD1, 0x01, 0x60, 0x00, 0xE1, 0x05, 0x60, 0x69, 0x6B,
+ 0x60, 0x4C, 0xB5, 0xFF, 0x64, 0x4C, 0x7C, 0x44, 0x29, 0x40, 0x80, 0x2B, 0x67, 0x44, 0x60, 0x4C,
+ 0x40, 0xE1, 0x01, 0x60, 0x08, 0xE1, 0x84, 0xFF, 0xC2, 0x60, 0x45, 0x64, 0x40, 0x42, 0x82, 0xFF,
+ 0x3C, 0x44, 0x60, 0x46, 0x40, 0x42, 0x13, 0x64, 0x3A, 0xDB, 0x10, 0x60, 0x00, 0x65, 0x3C, 0x46,
+ 0x2A, 0xF2, 0x19, 0x60, 0x3B, 0xF1, 0xA4, 0x84, 0xC4, 0xBC, 0x40, 0x48, 0x64, 0x44, 0x04, 0x26,
+ 0x09, 0x00, 0x02, 0x26, 0x0A, 0x00, 0x01, 0x26, 0x0B, 0x00, 0x08, 0x2A, 0x03, 0x00, 0x0B, 0x63,
+ 0x6E, 0x64, 0x08, 0x00, 0x15, 0x63, 0x37, 0x64, 0x05, 0x00, 0x38, 0x63, 0x14, 0x64, 0x02, 0x00,
+ 0x70, 0x63, 0x0A, 0x64, 0x43, 0x4D, 0x40, 0x45, 0x00, 0xE1, 0xF0, 0xFE, 0x00, 0x60, 0x1E, 0x64,
+ 0x1B, 0xF0, 0x11, 0xF0, 0xC0, 0x84, 0xC0, 0x84, 0x60, 0x43, 0x28, 0x44, 0xA1, 0xFF, 0x12, 0x74,
+ 0x80, 0x4E, 0x12, 0x74, 0x83, 0x4C, 0x9A, 0xFF, 0x12, 0x74, 0x5C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0x00, 0x64, 0x32, 0xFB, 0x43, 0xFF, 0x84, 0xFF, 0xC2, 0x60, 0x45, 0x64, 0x40, 0x42, 0x82, 0xFF,
+ 0x30, 0xF1, 0x27, 0x44, 0x05, 0x22, 0x34, 0x00, 0xFA, 0xB4, 0x40, 0x47, 0x24, 0x44, 0x10, 0x2A,
+ 0x2B, 0x00, 0x28, 0x40, 0xD4, 0x3A, 0x28, 0x00, 0x31, 0x40, 0x08, 0x26, 0x00, 0x7C, 0x29, 0x40,
+ 0x50, 0x2B, 0x0D, 0x00, 0xEF, 0x60, 0xFF, 0x65, 0x29, 0x44, 0x24, 0x89, 0x31, 0x40, 0x08, 0x2A,
+ 0x06, 0x00, 0x1C, 0x60, 0x11, 0xF3, 0xFF, 0xFF, 0xE0, 0x85, 0x2B, 0x44, 0x05, 0x05, 0x2B, 0x44,
+ 0xFF, 0xA4, 0x01, 0xA4, 0x04, 0x24, 0x00, 0x64, 0xD0, 0x80, 0x70, 0x45, 0x02, 0x28, 0x64, 0x44,
+ 0xC4, 0x84, 0xFF, 0xFF, 0x04, 0x24, 0x00, 0xB4, 0x60, 0x50, 0x08, 0x28, 0x01, 0x00, 0x20, 0x29,
+ 0x6D, 0xE2, 0xA5, 0x60, 0x7F, 0x78, 0xFF, 0xFF, 0x02, 0x64, 0x31, 0xFB, 0xC0, 0xFE, 0x07, 0x00,
+ 0x02, 0x2A, 0x05, 0x00, 0xFD, 0xB4, 0x40, 0x47, 0x06, 0x64, 0x31, 0xFB, 0xC0, 0xFE, 0x05, 0x64,
+ 0x3A, 0xDB, 0x28, 0x44, 0xA4, 0x3A, 0x07, 0x00, 0x01, 0x60, 0x02, 0x7C, 0x25, 0x44, 0x0A, 0x3A,
+ 0x02, 0x00, 0x01, 0x60, 0x3A, 0x7C, 0x31, 0x40, 0x08, 0x26, 0x00, 0x7C, 0x29, 0x40, 0x50, 0x2B,
+ 0x0D, 0x00, 0xEF, 0x60, 0xFF, 0x65, 0x29, 0x44, 0x24, 0x89,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, 0x6C, 0x45, 0xA1, 0xFF, 0x65, 0x41, 0x7F, 0x60,
+ 0x7F, 0x7C, 0x6C, 0x44, 0xA0, 0x84, 0x15, 0xA7, 0x15, 0xA4, 0x21, 0x46, 0x26, 0xFA, 0x22, 0x46,
+ 0x10, 0xFA, 0x21, 0x46, 0x29, 0x40, 0x40, 0x2B, 0x07, 0x00, 0xB6, 0xFF, 0xA1, 0xFF, 0x40, 0x60,
+ 0x00, 0x65, 0x6C, 0x44, 0x1A, 0xFA, 0x09, 0x00, 0x65, 0x44, 0x0F, 0xB4, 0x06, 0xA8, 0x80, 0x60,
+ 0x00, 0x65, 0x08, 0x28, 0x7C, 0x45, 0x29, 0x44, 0x34, 0x89, 0x00, 0x64, 0x33, 0xFB, 0x40, 0x21,
+ 0x00, 0x00, 0xAC, 0xE2, 0x05, 0xE1, 0x27, 0xF0, 0x65, 0x44, 0x64, 0x5E, 0x27, 0xFA, 0x28, 0x44,
+ 0x8F, 0xB0, 0x88, 0x3A, 0x09, 0x00, 0x39, 0xF2, 0xFF, 0xFF, 0x60, 0xB0, 0x20, 0x3A, 0x04, 0x00,
+ 0x24, 0x44, 0xFF, 0x60, 0xDF, 0xB4, 0x40, 0x44, 0x28, 0x40, 0x03, 0x26, 0xE2, 0x00, 0x31, 0x40,
+ 0x20, 0x2A, 0x03, 0x00, 0x28, 0x40, 0x50, 0x3A, 0xDC, 0x00, 0x24, 0x44, 0x20, 0x2A, 0xD9, 0x00,
+ 0x29, 0x40, 0x50, 0x2B, 0x0D, 0x00, 0xEF, 0x60, 0xFF, 0x65, 0x29, 0x44, 0x24, 0x89, 0x31, 0x40,
+ 0x08, 0x2A, 0x06, 0x00, 0x1C, 0x60, 0x11, 0xF3, 0xFF, 0xFF, 0xE0, 0x85, 0x2B, 0x44, 0x06, 0x05,
+ 0x2B, 0x44, 0xFF, 0xA4, 0x01, 0xA4, 0x04, 0x24, 0x00, 0x64, 0x40, 0x4B, 0xAC, 0x80, 0x28, 0x40,
+ 0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x48, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x00, 0x60, 0x00, 0x6A, 0xFF, 0xFF, 0x01, 0x16,
+ 0xFE, 0x01, 0x00, 0x60, 0x7F, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x84, 0x60, 0x04, 0x6A,
+ 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x48, 0x60, 0x08, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01,
+ 0x65, 0x4A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x84, 0x60, 0x04, 0x6A, 0xFF, 0xFF, 0x01, 0x16,
+ 0xFE, 0x01, 0x40, 0x60, 0x08, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x65, 0x4A, 0xFF, 0xFF,
+ 0x01, 0x16, 0xFE, 0x01, 0x8C, 0x60, 0x48, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x00, 0x60,
+ 0x00, 0x6A, 0xFF, 0xFF, 0x01, 0x16, 0xFE, 0x01, 0x00, 0x60, 0x00, 0x6A, 0xFF, 0xFF, 0x01, 0x16,
+ 0xFE, 0x01, 0x95, 0x60, 0x84, 0xE7, 0x64, 0x58, 0xFF, 0xFF, 0x12, 0x74, 0x6A, 0x40, 0x87, 0x4F,
+ 0x12, 0x74, 0x87, 0x4C, 0x12, 0x74, 0x29, 0x40, 0x40, 0x2B, 0x08, 0x00, 0x0A, 0x64, 0x89, 0xFF,
+ 0x60, 0x54, 0x88, 0xFF, 0x87, 0x4D, 0x12, 0x74, 0x87, 0x4D, 0x09, 0x00, 0x03, 0x64, 0x89, 0xFF,
+ 0x60, 0x54, 0x88, 0xFF, 0x87, 0x4F, 0x12, 0x74, 0x87, 0x4D, 0x12, 0x74, 0x87, 0x4D, 0x7C, 0x44,
+ 0x01, 0x08, 0x01, 0x00, 0x67, 0x44, 0x12, 0x74, 0x87,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D0, 0x80, 0x00, 0x64, 0x5A, 0xD0,
+ 0x06, 0x02, 0xD0, 0x80, 0xF8, 0x7F, 0xD0, 0x80, 0x01, 0x03, 0x01, 0x02, 0x01, 0x61, 0x62, 0x43,
+ 0x46, 0x43, 0x3C, 0x46, 0x07, 0xF4, 0x3A, 0xF2, 0xFF, 0xFF, 0xA3, 0x46, 0x60, 0x40, 0x22, 0x26,
+ 0x64, 0x00, 0x60, 0x45, 0x63, 0x42, 0x5A, 0xD0, 0xCD, 0x81, 0x3C, 0x46, 0x1B, 0x02, 0x64, 0x44,
+ 0x88, 0x3A, 0x18, 0x00, 0x8E, 0x37, 0x03, 0x00, 0xC7, 0x37, 0x01, 0x00, 0x13, 0x00, 0x65, 0x44,
+ 0x01, 0x26, 0x7C, 0x00, 0x04, 0x26, 0x03, 0x00, 0x10, 0x26, 0x01, 0x00, 0x31, 0x00, 0xA3, 0x46,
+ 0x3B, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x27, 0x5B, 0x00, 0xA3, 0x46, 0x00, 0x7C, 0x22, 0xF8,
+ 0xA3, 0x46, 0x6C, 0x00, 0xA3, 0x46, 0x65, 0x44, 0x01, 0x26, 0x0B, 0x00, 0x04, 0x26, 0x03, 0x00,
+ 0x10, 0x26, 0x01, 0x00, 0x1D, 0x00, 0x3B, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x27, 0x48, 0x00,
+ 0x17, 0x00, 0xA6, 0xF3, 0xFF, 0xFF, 0x60, 0x46, 0x3A, 0xF2, 0x66, 0x43, 0xFF, 0xB4, 0x3C, 0x46,
+ 0x22, 0xF0, 0x60, 0x47, 0xB0, 0x84, 0x22, 0xFA, 0x63, 0x46, 0x3B, 0xF0, 0x60, 0x40, 0x04, 0x27,
+ 0x03, 0x00, 0x10, 0x27, 0x01, 0x00, 0x04, 0x00, 0x64, 0x40, 0x80, 0x27, 0x31, 0x00, 0x00, 0x00,
+ 0x3C, 0x46, 0x02, 0x65, 0xBF, 0x60, 0x19, 0x78, 0xFF, 0xFF, 0xCD, 0x81, 0x63, 0x42, 0x5A, 0xD0,
+ 0x3C, 0x46, 0x26, 0x02, 0x64, 0x44, 0x88, 0x3A, 0x23, 0x00, 0x77, 0x37, 0x37, 0x00, 0x78, 0x37,
+ 0x35, 0x00, 0x8E, 0x37, 0x33, 0x00, 0xC7, 0x37, 0x31, 0x00, 0x1A, 0x00, 0x19, 0x60, 0xA3, 0xF3,
+ 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x2A, 0x2A, 0x00, 0x06, 0x00, 0x19, 0x60, 0xA3, 0xF3, 0xFF, 0xFF,
+ 0x60, 0x40, 0x01, 0x2A, 0xE2, 0x01, 0x3C, 0x46, 0x3E, 0xF2, 0x40, 0x60, 0x00, 0x65, 0xF0, 0x84,
+ 0xA4, 0x84, 0x3D, 0xFA, 0x2A, 0xF2, 0xBF, 0x60, 0xFF, 0x65, 0xA4, 0x84, 0x2A, 0xFA, 0x16, 0x00,
+ 0x3C, 0x46, 0x22, 0xF0, 0x80, 0x67, 0xB0, 0x84, 0xA2, 0xDA, 0xFF, 0xFF, 0x3F, 0xF2, 0x3E, 0xF0,
+ 0x08, 0xA4, 0x60, 0x41, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x26, 0x03, 0x00, 0x04, 0x26,
+ 0x03, 0x00, 0x04, 0x00, 0x04, 0x2B, 0x02, 0x00, 0x61, 0x44, 0x3F, 0xFA, 0x3C, 0x46, 0x2C, 0xF2,
+ 0x27, 0x40, 0x01, 0x27, 0x32, 0xF2, 0xD3, 0xF1, 0x60, 0x40, 0x01, 0x26, 0x47, 0x00, 0x09, 0x60,
+ 0x00, 0x64, 0xD0, 0x80, 0x3F, 0xF2, 0x09, 0x06, 0x2C, 0x45, 0xC4, 0x84, 0xD0, 0x80, 0x40, 0x4A,
+ 0x34, 0x06, 0x60, 0x43, 0x64, 0x44, 0x54, 0x88, 0x17, 0x00, 0x60, 0x45, 0x16, 0x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, 0xF0, 0x60, 0x40,
+ 0xB0, 0x3A, 0x03, 0x00, 0x40, 0x3B, 0x01, 0x00, 0x12, 0x00, 0x0C, 0xB4, 0x08, 0x3A, 0x44, 0x00,
+ 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x2B, 0x3F, 0x00, 0x17, 0xF2, 0x22, 0xF0, 0xFF, 0xFF,
+ 0x64, 0x40, 0x22, 0x22, 0x04, 0x00, 0x00, 0xA8, 0x01, 0xA8, 0x36, 0x03, 0x35, 0x03, 0x3C, 0x46,
+ 0x2A, 0xF0, 0x40, 0x67, 0xB0, 0x84, 0xA2, 0xDA, 0x60, 0x45, 0x22, 0xF2, 0xFF, 0xFF, 0x60, 0x43,
+ 0x60, 0x40, 0x01, 0x26, 0x05, 0x00, 0x04, 0x26, 0x1D, 0x00, 0x10, 0x26, 0x10, 0x00, 0x04, 0x00,
+ 0x04, 0x27, 0x18, 0x00, 0x10, 0x27, 0x0B, 0x00, 0x65, 0x44, 0x2A, 0x61, 0x60, 0x40, 0x03, 0x2B,
+ 0x24, 0x61, 0x8F, 0xB0, 0x88, 0x36, 0x02, 0xA1, 0x41, 0x4C, 0x98, 0xFA, 0x15, 0x00, 0x65, 0x44,
+ 0x32, 0x61, 0x60, 0x40, 0x03, 0x2B, 0x2C, 0x61, 0x8F, 0xB0, 0x88, 0x36, 0x02, 0xA1, 0x41, 0x4C,
+ 0x98, 0xFA, 0x0A, 0x00, 0x65, 0x44, 0x2E, 0x61, 0x60, 0x40, 0x03, 0x2B, 0x28, 0x61, 0x8F, 0xB0,
+ 0x88, 0x36, 0x02, 0xA1, 0x41, 0x4C, 0x98, 0xFA, 0x2A, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x40, 0x27,
+ 0x03, 0x00, 0xBC, 0x60, 0x46, 0x78, 0xFF, 0xFF, 0x22, 0xF2, 0x46, 0x43, 0x60, 0x40, 0x22, 0x26,
+ 0x09, 0x00, 0x01, 0x26, 0x0A, 0x00, 0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, 0x00, 0xEA, 0xA0, 0x60, 0x00, 0xEA, 0xD1, 0x60, 0x00, 0xEA, 0x66, 0x45, 0xAA, 0xF2,
+ 0x19, 0x60, 0x3F, 0xF3, 0x24, 0x46, 0x61, 0x40, 0x08, 0x26, 0x02, 0x00, 0x61, 0x40, 0x80, 0x36,
+ 0x12, 0xF2, 0x65, 0x46, 0x60, 0x40, 0x10, 0x26, 0x34, 0x00, 0x2C, 0x45, 0x17, 0xF2, 0x4B, 0xF1,
+ 0xC4, 0x84, 0xE0, 0x84, 0xE0, 0x84, 0xE0, 0x81, 0x64, 0x45, 0x16, 0xA1, 0xB8, 0x60, 0x58, 0x4D,
+ 0x15, 0x78, 0xFF, 0xFF, 0x7D, 0xF1, 0x01, 0xA4, 0xE0, 0x84, 0xE0, 0x84, 0x64, 0x40, 0x01, 0x2B,
+ 0x06, 0xA4, 0x1B, 0xFA, 0xDA, 0xF3, 0x2C, 0x60, 0x7C, 0x65, 0x60, 0x40, 0x0B, 0x37, 0x00, 0x63,
+ 0x0F, 0x37, 0x02, 0x63, 0x0A, 0x37, 0x04, 0x63, 0x0E, 0x37, 0x06, 0x63, 0x09, 0x37, 0x08, 0x63,
+ 0x0D, 0x37, 0x0A, 0x63, 0x08, 0x37, 0x0C, 0x63, 0x0C, 0x37, 0x0E, 0x63, 0x28, 0xA3, 0x47, 0xD1,
+ 0xD8, 0xA3, 0xD7, 0x83, 0x19, 0x60, 0x77, 0xF9, 0x47, 0xD1, 0x40, 0x67, 0xB0, 0x84, 0x1F, 0xFA,
+ 0x58, 0x00, 0x2A, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0x80, 0x36, 0x19, 0x00, 0x50, 0x36, 0x17, 0x00,
+ 0x40, 0x36, 0x15, 0x00, 0x00, 0x36, 0x13, 0x00, 0x20, 0x36, 0x11, 0x00, 0xA0, 0x36, 0x0F, 0x00,
+ 0xB0, 0x36, 0x0D, 0x00, 0xC0, 0x36, 0x0B, 0x00, 0xDA, 0xF3, 0x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 0x58, 0x4D, 0x15, 0x78, 0xFF, 0xFF, 0xAE, 0x82, 0xFC, 0xA2, 0x0A, 0x03, 0x63, 0x40,
+ 0x6E, 0x3B, 0x06, 0x00, 0x60, 0x41, 0x04, 0x0D, 0x80, 0x67, 0xB0, 0x84, 0x0F, 0xFA, 0x61, 0x44,
+ 0xDC, 0x84, 0x1D, 0xFA, 0x1F, 0xF0, 0x01, 0x60, 0x3E, 0x65, 0x64, 0x40, 0x80, 0x27, 0x02, 0x00,
+ 0x02, 0x60, 0x5E, 0x65, 0x1B, 0xF0, 0x26, 0x41, 0xE1, 0x81, 0xC5, 0x81, 0x44, 0x94, 0xC1, 0x81,
+ 0x2B, 0xFA, 0x90, 0xFA, 0x26, 0x44, 0x2C, 0xF0, 0x0A, 0xA4, 0x66, 0x45, 0x24, 0x46, 0x92, 0xF2,
+ 0x65, 0x46, 0x9F, 0xF0, 0x61, 0x40, 0x10, 0x2A, 0x05, 0x00, 0x60, 0xA4, 0x65, 0x40, 0x80, 0x2B,
+ 0x60, 0xA4, 0x01, 0x00, 0x14, 0xA4, 0x64, 0x40, 0x01, 0x26, 0x00, 0x64, 0x60, 0x45, 0x2A, 0xF2,
+ 0x39, 0xF0, 0x8F, 0xB0, 0x88, 0x3A, 0x04, 0x00, 0x64, 0x44, 0x60, 0xB0, 0x20, 0x36, 0x00, 0x65,
+ 0x65, 0x44, 0x11, 0xFA, 0xDA, 0xF3, 0x13, 0xFA, 0x7C, 0x44, 0x1D, 0xFA, 0x0F, 0xF0, 0xFF, 0xFF,
+ 0x64, 0x40, 0x01, 0x2A, 0x6F, 0x00, 0x7D, 0xF1, 0x19, 0x60, 0x7B, 0xF3, 0x64, 0x40, 0x01, 0x27,
+ 0x03, 0x00, 0x60, 0x40, 0x02, 0x26, 0x14, 0x00, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x12, 0xF0,
+ 0x19, 0x60, 0x7C, 0xF3, 0x63, 0x46, 0x64, 0x40, 0x10, 0x2A, 0x20, 0x00, 0x60, 0x40, 0x02, 0x26,
+ 0x07, 0x00, 0x01, 0x26, 0x08, 0x00, 0x04, 0x26, 0x09, 0x00, 0x06, 0x61, 0x6E, 0x63, 0x08, 0x00,
+ 0x02, 0x61, 0x14, 0x63, 0x05, 0x00, 0x00, 0x61, 0x0A, 0x63, 0x02, 0x00, 0x04, 0x61, 0x37, 0x63,
+ 0x00, 0x64, 0x2C, 0x60, 0x9C, 0x65, 0x45, 0xD1, 0xD5, 0x81, 0x19, 0x60, 0x78, 0xF9, 0x2C, 0x60,
+ 0x74, 0x65, 0x45, 0xD1, 0x1C, 0xFC, 0xB0, 0x84, 0x1E, 0xFA, 0x3C, 0x00, 0x60, 0x40, 0x10, 0x2A,
+ 0x04, 0x00, 0x08, 0x61, 0x1E, 0x60, 0x0B, 0x63, 0x27, 0x00, 0x20, 0x2A, 0x04, 0x00, 0x0A, 0x61,
+ 0x16, 0x60, 0x0F, 0x63, 0x21, 0x00, 0x40, 0x2A, 0x04, 0x00, 0x0C, 0x61, 0x12, 0x60, 0x0A, 0x63,
+ 0x1B, 0x00, 0x80, 0x2A, 0x04, 0x00, 0x0E, 0x61, 0x0E, 0x60, 0x0E, 0x63, 0x15, 0x00, 0x01, 0x2B,
+ 0x04, 0x00, 0x10, 0x61, 0x0E, 0x60, 0x09, 0x63, 0x0F, 0x00, 0x02, 0x2B, 0x04, 0x00, 0x12, 0x61,
+ 0x0A, 0x60, 0x0D, 0x63, 0x09, 0x00, 0x04, 0x2B, 0x04, 0x00, 0x14, 0x61, 0x0A, 0x60, 0x08, 0x63,
+ 0x03, 0x00, 0x16, 0x61, 0x0A, 0x60, 0x0C, 0x63, 0x1E, 0xF0, 0x40, 0x67, 0x2C, 0x60, 0x9C, 0x65,
+ 0x45, 0xD1, 0xD5, 0x81, 0x19, 0x60, 0x78, 0xF9, 0x2C, 0x60, 0x74, 0x65, 0x45, 0xD1, 0x1C, 0xFC,
+ 0xB0, 0x84, 0x1E, 0xFA, 0xFF, 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xA4, 0x06, 0x0E, 0xE8, 0x84,
+ 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x84, 0x07, 0x00, 0xC2, 0xA4, 0xE8, 0x84, 0xE8, 0x84,
+ 0xE8, 0x84, 0xE8, 0x84, 0xE8, 0x87, 0xF8, 0xBF, 0xC0, 0x84, 0x14, 0xFA, 0x60, 0x5C, 0x2F, 0x67,
+ 0xD0, 0x80, 0x60, 0x45, 0x02, 0x28, 0x64, 0x45, 0x25, 0x5C, 0x8B, 0x67, 0xD0, 0x80, 0x60, 0x41,
+ 0x02, 0x24, 0x64, 0x41, 0xD5, 0x84, 0x80, 0x65, 0xC4, 0x87, 0x01, 0x05, 0x00, 0x64, 0xFF, 0xB4,
+ 0x0E, 0xFA, 0x63, 0x46, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x17, 0xF2, 0x63, 0x46, 0x60, 0x40,
+ 0x00, 0x36, 0x2E, 0x00, 0x01, 0x36, 0x1E, 0x00, 0x03, 0x3A, 0x25, 0x00, 0x64, 0x46, 0x10, 0xF2,
+ 0x11, 0xFA, 0x12, 0xF2, 0x00, 0x61, 0x60, 0x47, 0x00, 0x7F, 0x12, 0xFA, 0x97, 0xFA, 0x46, 0x44,
+ 0x63, 0x46, 0xC2, 0x60, 0x58, 0x4E, 0x4C, 0x78, 0xFF, 0xFF, 0x65, 0x40, 0x00, 0x3A, 0x04, 0x00,
+ 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x96, 0xFC,
+ 0x63, 0x46, 0x43, 0x00, 0x64, 0x46, 0x16, 0xF2, 0x00, 0x61, 0x20, 0x28, 0xFF, 0xA4, 0x97, 0xFA,
+ 0x16, 0xFA, 0x63, 0x46, 0x3A, 0x00, 0x64, 0x46, 0x00, 0x61, 0x97, 0xFA, 0x63, 0x46, 0x35, 0x00,
+ 0x07, 0xF0, 0x66, 0x41, 0x64, 0x46, 0x16, 0xF2, 0xFF, 0xFF, 0x20, 0x28, 0xFF, 0xA4, 0x16, 0xFA,
+ 0x93, 0xF4, 0x12, 0xF2, 0x20, 0x28, 0xFF, 0xA3, 0x13, 0xFC, 0x61, 0x46, 0x63, 0x40, 0x00, 0x3A,
+ 0x24, 0x00, 0xC2, 0x60, 0x58, 0x4E, 0x6D, 0x78, 0xFF, 0xFF, 0x61, 0x40, 0xFF, 0x36, 0x1D, 0x00,
+ 0x66, 0x41, 0x64, 0x46, 0x12, 0xF2, 0x93, 0xF4, 0x61, 0x46, 0x20, 0x28, 0x16, 0x00, 0x44, 0x44,
+ 0xC2, 0x60, 0x58, 0x4E, 0x4C, 0x78, 0xFF, 0xFF, 0x24, 0x5C, 0x65, 0x40, 0x00, 0x36, 0x06, 0x00,
+ 0x66, 0x41, 0x64, 0x46, 0x01, 0x64, 0x17, 0xFA, 0x61, 0x46, 0x07, 0x00, 0x66, 0x43, 0x64, 0x46,
+ 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x63, 0x46, 0xBF, 0x60, 0x00, 0x78, 0xFF, 0xFF,
+ 0x07, 0xF0, 0x66, 0x43, 0x64, 0x46, 0x17, 0xF2, 0xFF, 0xFF, 0x60, 0x40, 0xFF, 0x27, 0xFF, 0xFF,
+ 0x00, 0x36, 0x07, 0x00, 0x01, 0x36, 0x1C, 0x00, 0x02, 0x36, 0x24, 0x00, 0x03, 0x36, 0x43, 0x00,
+ 0xFF, 0xFF, 0x19, 0x60, 0xA9, 0xF1, 0x16, 0xF2, 0x43, 0x44, 0xD0, 0x80, 0x33, 0x60, 0x84, 0x61,
+ 0x09, 0x03, 0xA1, 0xD1, 0x33, 0x60, 0x82, 0x63, 0xC0, 0x84, 0x16, 0xFA, 0xA3, 0xD3, 0xFF, 0xFF,
+ 0x13, 0xFA, 0x39, 0x00, 0x96, 0xFC, 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x33, 0x00,
+ 0x43, 0x44, 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x19, 0x60, 0xC1, 0xF3, 0x96, 0xFC,
+ 0x13, 0xFA, 0x29, 0x00, 0x63, 0x46, 0x33, 0x60, 0x54, 0x63, 0xA3, 0xD3, 0x15, 0xF2, 0x60, 0x45,
+ 0xD4, 0x80, 0x07, 0xF0, 0x0C, 0x03, 0x66, 0x41, 0x44, 0x44, 0x64, 0x46, 0x12, 0xF2, 0x61, 0x46,
+ 0xC2, 0x60, 0x58, 0x4E, 0x4C, 0x78, 0xFF, 0xFF, 0x65, 0x40, 0x00, 0x3A, 0x19, 0x00, 0x66, 0x43,
+ 0x24, 0x46, 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x12, 0xF2, 0x91, 0xF2, 0x90, 0xFA,
+ 0x60, 0x5F, 0x12, 0xFA, 0x04, 0x00, 0xC2, 0x60, 0x58, 0x4E, 0x96, 0x78, 0xFF, 0xFF, 0x03, 0x64,
+ 0x17, 0xFA, 0x63, 0x46, 0x05, 0x00, 0x24, 0x43, 0x02, 0x64, 0x17, 0xFA, 0x63, 0x46, 0x00, 0x00,
+ 0x03, 0x64, 0x3B, 0xDB, 0xCA, 0xFE, 0x47, 0xF1, 0x01, 0x65, 0x32, 0x40, 0x04, 0x27, 0x11, 0x00,
+ 0x2C, 0xF2, 0x64, 0x45, 0x02, 0x22, 0x0D, 0x00, 0x60, 0x40, 0x01, 0x26, 0x0A, 0x00, 0x2A, 0xF2,
+ 0x39, 0xF0, 0x8F, 0xB0, 0x88, 0x3A, 0x77, 0x00, 0x64, 0x44, 0x60, 0xB0, 0x20, 0x36, 0x01, 0x00,
+ 0x72, 0x00, 0x14, 0xF2, 0x65, 0x40, 0x01, 0x26, 0x0C, 0x00, 0x60, 0x45, 0x05, 0x64, 0x3B, 0xDB,
+ 0x65, 0x44, 0xCC, 0x85, 0x2C, 0x60, 0xD0, 0x64, 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 0xA3, 0xD3, 0xFF, 0xFF, 0x60, 0x41, 0x66, 0x45, 0x24, 0x46, 0x0E, 0xF2,
+ 0x65, 0x46, 0x64, 0x45, 0xD5, 0x81, 0x61, 0x45, 0x00, 0x7F, 0xD4, 0x80, 0x64, 0x43, 0x08, 0x04,
+ 0xE3, 0x83, 0x63, 0x45, 0xC5, 0x81, 0x61, 0x45, 0xD4, 0x80, 0x02, 0x65, 0x03, 0x07, 0x03, 0x00,
+ 0x00, 0x65, 0x01, 0x00, 0x01, 0x65, 0x2E, 0x58, 0xFF, 0xFF, 0x66, 0x43, 0x64, 0x46, 0x8F, 0xF0,
+ 0x12, 0xF2, 0x91, 0xF2, 0x60, 0x40, 0x10, 0x36, 0x05, 0x00, 0x12, 0x36, 0x08, 0x00, 0x0C, 0x36,
+ 0x0B, 0x00, 0x0F, 0x00, 0x40, 0x61, 0xA5, 0x80, 0x0A, 0x64, 0x13, 0x02, 0xF3, 0x01, 0x10, 0x61,
+ 0xA5, 0x80, 0x0E, 0x64, 0x0E, 0x02, 0xEE, 0x01, 0x08, 0x61, 0xA5, 0x80, 0x10, 0x64, 0x09, 0x02,
+ 0xE9, 0x01, 0xE1, 0x81, 0xA5, 0x80, 0x03, 0x05, 0xC8, 0x84, 0x03, 0x02, 0xE3, 0x01, 0xFF, 0x61,
+ 0x02, 0x00, 0x12, 0xFA, 0x91, 0xFA, 0x63, 0x46, 0x2E, 0x58, 0xFF, 0xFF, 0x8F, 0xF0, 0x12, 0xF2,
+ 0x91, 0xF2, 0x60, 0x40, 0x0A, 0x36, 0x05, 0x00, 0x0E, 0x36, 0x08, 0x00, 0x10, 0x36, 0x0B, 0x00,
+ 0x0F, 0x00, 0x08, 0x61, 0xA5, 0x80, 0x10, 0x7E, 0x11, 0x02, 0xF3, 0x01, 0x04, 0x61, 0xA5, 0x80,
+ 0x12, 0x7E, 0x0C, 0x02, 0xEE, 0x01, 0x20, 0x61, 0xA5, 0x80, 0x0C, 0x7E, 0x07, 0x02, 0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0x60, 0xFE,
+ 0x02, 0x60, 0x00, 0x63, 0xBD, 0xD3, 0xBD, 0xD3, 0x60, 0x41, 0xFE, 0x60, 0x58, 0x4E, 0x2C, 0x78,
+ 0xFF, 0xFF, 0x20, 0xFE, 0x00, 0x65, 0x00, 0x64, 0x19, 0x60, 0x3B, 0xFB, 0x02, 0x00, 0x20, 0xFE,
+ 0xFF, 0x65, 0x02, 0x60, 0x00, 0x63, 0x60, 0xFE, 0xBD, 0xD3, 0xBD, 0xD3, 0x60, 0x41, 0x20, 0xFE,
+ 0xCD, 0x81, 0x60, 0x40, 0x80, 0x2A, 0x39, 0x00, 0x7F, 0xB4, 0x02, 0x3A, 0x02, 0x00, 0x01, 0x64,
+ 0x2E, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x2A, 0x00, 0x0B, 0x3A, 0x02, 0x00, 0x04, 0x64,
+ 0x26, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x22, 0x00, 0x0C, 0x3A, 0x02, 0x00, 0x10, 0x64,
+ 0x1E, 0x00, 0x12, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x1A, 0x00, 0x18, 0x3A, 0x02, 0x00, 0x40, 0x64,
+ 0x16, 0x00, 0x24, 0x3A, 0x02, 0x00, 0x80, 0x64, 0x12, 0x00, 0x30, 0x3A, 0x02, 0x00, 0x01, 0x67,
+ 0x0E, 0x00, 0x48, 0x3A, 0x02, 0x00, 0x02, 0x67, 0x0A, 0x00, 0x60, 0x3A, 0x02, 0x00, 0x04, 0x67,
+ 0x06, 0x00, 0x6C, 0x3A, 0x02, 0x00, 0x08, 0x67, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x19, 0x60,
+ 0x3B, 0xF1, 0xFF, 0xFF, 0xB0, 0x84, 0x19, 0x60, 0x3B, 0xFB, 0x61, 0x40, 0x00, 0x36, 0x05, 0x00,
+ 0x60, 0xFE, 0xBD, 0xD3, 0xFF, 0xFF, 0x20, 0xFE,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x03,
+ 0x43, 0x43, 0xDB, 0xF3, 0x32, 0x40, 0x02, 0x26, 0x04, 0x00, 0x07, 0xB4, 0x03, 0xA8, 0x2A, 0xF2,
+ 0x45, 0x02, 0xA6, 0xF1, 0x23, 0x43, 0xD3, 0x80, 0xFF, 0xFF, 0x40, 0x02, 0xD0, 0x60, 0x58, 0x4F,
+ 0xFC, 0x78, 0xFF, 0xFF, 0x32, 0x40, 0x02, 0x2A, 0x05, 0x00, 0x63, 0x46, 0x02, 0x64, 0x06, 0xFA,
+ 0x26, 0x46, 0x34, 0x00, 0x32, 0x40, 0x08, 0x2A, 0x05, 0x00, 0x63, 0x46, 0x80, 0x60, 0x02, 0x64,
+ 0x06, 0xFA, 0x26, 0x46, 0x43, 0x43, 0x7D, 0xF3, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x27, 0x09, 0x00,
+ 0x19, 0x60, 0x44, 0xF3, 0xFF, 0xFF, 0x60, 0x40, 0x01, 0x2A, 0x03, 0x00, 0x23, 0x46, 0x0F, 0x64,
+ 0x10, 0x00, 0x37, 0x60, 0xF8, 0x61, 0xA1, 0xD1, 0xA1, 0xF3, 0x01, 0x60, 0xAC, 0x63, 0x60, 0x45,
+ 0xA3, 0xD3, 0x65, 0x40, 0x01, 0x27, 0x5B, 0xD3, 0x65, 0x40, 0x01, 0x27, 0x59, 0xD1, 0x23, 0x46,
+ 0xA0, 0x84, 0x0F, 0xFA, 0x7A, 0xFB, 0x79, 0xFB, 0x16, 0x64, 0x12, 0xFA, 0x01, 0x64, 0x11, 0xFA,
+ 0x66, 0x5C, 0xC2, 0x60, 0x58, 0x4E, 0x6D, 0x78, 0xFF, 0xFF, 0x26, 0x46, 0x07, 0xFC, 0x43, 0x43,
+ 0x2A, 0xF2, 0x63, 0x45, 0x0C, 0xB4, 0x08, 0x3A, 0x0A, 0x00, 0xDB, 0xF3, 0x23, 0x46, 0x07, 0xB4,
+ 0xFD, 0xA0, 0x06, 0xF2, 0x26, 0x46, 0x03, 0x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,
+ 0x4E, 0x62, 0x00, 0x64, 0xA2, 0xDB, 0xF7, 0x60, 0xFF, 0x65, 0x20, 0x44, 0x24, 0x80, 0x08, 0x60,
+ 0x08, 0xF1, 0x80, 0x60, 0x00, 0x64, 0xB0, 0x84, 0xA2, 0xDB, 0xCF, 0xFE, 0xBB, 0xFE, 0xFD, 0x60,
+ 0x40, 0x65, 0xF3, 0x60, 0x58, 0x4E, 0x27, 0x78, 0xFF, 0xFF, 0x00, 0x60, 0x03, 0x64, 0x08, 0x60,
+ 0x28, 0xFB, 0xD4, 0x60, 0x87, 0x64, 0x5A, 0xDB, 0xCF, 0xFE, 0x2F, 0x58, 0xFF, 0xFF, 0x08, 0x60,
+ 0x27, 0xF1, 0x00, 0x60, 0x02, 0x64, 0xA0, 0x80, 0x9C, 0x84, 0x07, 0x03, 0xA0, 0x84, 0xA2, 0xDB,
+ 0x10, 0x60, 0x4E, 0x62, 0x00, 0x64, 0xA2, 0xDB, 0xE2, 0x01, 0x10, 0x60, 0x4E, 0x62, 0x00, 0x64,
+ 0xA2, 0xDB, 0x00, 0x64, 0x08, 0x60, 0x27, 0xFB, 0x5A, 0xDB, 0x20, 0x40, 0x04, 0x2B, 0x14, 0x00,
+ 0x9B, 0xFE, 0x08, 0x04, 0xBB, 0xFE, 0x08, 0x60, 0x08, 0xF1, 0x80, 0x60, 0x00, 0x64, 0xB0, 0x84,
+ 0xA2, 0xDB, 0xCF, 0xFE, 0x80, 0x60, 0x00, 0x64, 0x08, 0x60, 0x16, 0xFB, 0xD4, 0x60, 0x95, 0x64,
+ 0x5A, 0xDB, 0xCF, 0xFE, 0x2F, 0x58, 0xFF, 0xFF, 0x08, 0x60, 0x00, 0x65, 0x20, 0x44, 0x34, 0x80,
+ 0x16, 0x60, 0xCC, 0xF3, 0x00, 0x61, 0x60, 0x40, 0x00, 0x36, 0x00, 0xB9, 0x60, 0x40, 0x01, 0x36,
+ 0x01, 0xB9, 0x60, 0x40, 0x02, 0x36, 0x06, 0xB9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0x08, 0x60, 0x00, 0x65,
+ 0x20, 0x44, 0x34, 0x80, 0x08, 0x60, 0x07, 0xF1, 0x02, 0x60, 0x00, 0x65, 0x20, 0x44, 0x34, 0x80,
+ 0x64, 0x40, 0x01, 0x2A, 0x06, 0x00, 0xA2, 0xDF, 0x02, 0x65, 0xF1, 0x60, 0x58, 0x4E, 0xC3, 0x78,
+ 0xFF, 0xFF, 0xCF, 0xF3, 0x20, 0x60, 0x20, 0x65, 0x36, 0x1B, 0xA5, 0xD3, 0x24, 0x40, 0x01, 0x26,
+ 0x16, 0x00, 0x60, 0x40, 0x20, 0x26, 0x2F, 0x00, 0x01, 0xBC, 0xA5, 0xDB, 0x08, 0x60, 0x1E, 0xF1,
+ 0x00, 0x60, 0x20, 0x64, 0xB0, 0x84, 0xA2, 0xDB, 0xCF, 0xFE, 0x10, 0x60, 0x00, 0x64, 0x08, 0x60,
+ 0x16, 0xFB, 0xD5, 0x60, 0x65, 0x64, 0x5A, 0xDB, 0xCF, 0xFE, 0x2F, 0x58, 0xFF, 0xFF, 0x60, 0x40,
+ 0x10, 0x26, 0x19, 0x00, 0x01, 0xBC, 0xA5, 0xDB, 0x08, 0x60, 0x1E, 0xF1, 0x00, 0x60, 0x40, 0x64,
+ 0xB0, 0x84, 0xA2, 0xDB, 0xCF, 0xFE, 0x10, 0x60, 0x00, 0x64, 0x08, 0x60, 0x16, 0xFB, 0xD5, 0x60,
+ 0x65, 0x64, 0x5A, 0xDB, 0xCF, 0xFE, 0x2F, 0x58, 0xFF, 0xFF, 0xFD, 0x60, 0x89, 0x65, 0xF3, 0x60,
+ 0x58, 0x4E, 0x27, 0x78, 0xFF, 0xFF, 0xCF, 0xF1, 0x07, 0x60, 0xE9, 0xF3, 0x64, 0x40, 0x02, 0x3A,
+ 0x0C, 0x00, 0x01, 0x63, 0x60, 0x40, 0x10, 0x22, 0x00, 0x63, 0x08, 0x60, 0xC1, 0xFD, 0x08, 0x60,
+ 0xC5, 0xFD, 0x08, 0x60, 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0x58, 0xD1, 0x5B, 0xD9, 0x7D, 0xF3, 0x66, 0x45,
+ 0xA6, 0xF5, 0x60, 0x40, 0x01, 0x27, 0x08, 0x00, 0x91, 0xFA, 0x61, 0x44, 0xFD, 0x60, 0x58, 0x4E,
+ 0xAC, 0x78, 0xFF, 0xFF, 0x12, 0xFA, 0x07, 0x00, 0x11, 0xF8, 0x64, 0x44, 0xFD, 0x60, 0x58, 0x4E,
+ 0xAC, 0x78, 0xFF, 0xFF, 0x12, 0xFA, 0x65, 0x46, 0x04, 0x00, 0xBB, 0xFE, 0xD4, 0x60, 0xF6, 0x78,
+ 0xFF, 0xFF, 0x16, 0x60, 0xC2, 0xF1, 0x00, 0x65, 0x64, 0x40, 0x01, 0x36, 0x22, 0x65, 0x64, 0x40,
+ 0x07, 0x36, 0x01, 0x65, 0x64, 0x40, 0x0A, 0x36, 0x01, 0x65, 0x64, 0x40, 0x0B, 0x36, 0x22, 0x65,
+ 0xA6, 0xF3, 0x66, 0x5C, 0x60, 0x46, 0x1F, 0x63, 0xE3, 0x83, 0xBA, 0xF8, 0x02, 0xA6, 0x66, 0x44,
+ 0xFC, 0x1F, 0x16, 0x60, 0xC2, 0xF3, 0xFF, 0xFF, 0x60, 0x40, 0x07, 0x36, 0x03, 0x00, 0x0A, 0x36,
+ 0x06, 0x00, 0x09, 0x00, 0xA6, 0xF3, 0x04, 0x65, 0x60, 0x46, 0xBA, 0xF8, 0x04, 0x00, 0xA6, 0xF3,
+ 0x10, 0x65, 0x60, 0x46, 0xBA, 0xF8, 0x64, 0x46, 0xA6, 0xF3, 0x32, 0x41, 0x60, 0x45, 0x08, 0xB1,
+ 0x66, 0x41, 0x16, 0x03, 0x65, 0x46, 0x17, 0x60, 0x80, 0xF3, 0x06, 0xF0, 0xE0, 0x84, 0xE0, 0x84,
+ 0xE0, 0x84, 0xE0, 0x84, 0x80, 0xBF, 0xB0, 0x84, 0x06, 0xFA, 0x66, 0x43, 0x02, 0xA3, 0x63, 0x46,
+ 0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 0x60, 0x00, 0x7C, 0x60, 0x40, 0x02, 0x2A, 0x03, 0x00,
+ 0x01, 0x60, 0xF2, 0x64, 0x0E, 0x00, 0x04, 0x2A, 0x03, 0x00, 0x02, 0x60, 0xF2, 0x64, 0x09, 0x00,
+ 0x10, 0x2A, 0x03, 0x00, 0x04, 0x60, 0xF2, 0x64, 0x04, 0x00, 0x20, 0x2A, 0x04, 0x00, 0x05, 0x60,
+ 0xF2, 0x64, 0xBD, 0xD9, 0xBD, 0xDB, 0x01, 0x64, 0xBD, 0xDB, 0x59, 0xD3, 0x50, 0x60, 0x00, 0x7C,
+ 0x60, 0x40, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60, 0xF2, 0x64, 0x0E, 0x00, 0x04, 0x2A, 0x03, 0x00,
+ 0x02, 0x60, 0xF2, 0x64, 0x09, 0x00, 0x10, 0x2A, 0x03, 0x00, 0x04, 0x60, 0xF2, 0x64, 0x04, 0x00,
+ 0x20, 0x2A, 0x04, 0x00, 0x05, 0x60, 0xF2, 0x64, 0xBD, 0xD9, 0xBD, 0xDB, 0x01, 0x64, 0xBD, 0xDB,
+ 0x59, 0xD3, 0x50, 0x60, 0x00, 0x7C, 0x60, 0x40, 0x01, 0x2A, 0x03, 0x00, 0x00, 0x60, 0xF2, 0x64,
+ 0x09, 0x00, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60, 0xF2, 0x64, 0x04, 0x00, 0x04, 0x2A, 0x02, 0x00,
+ 0x02, 0x60, 0xF2, 0x64, 0xBD, 0xD9, 0xBD, 0xDB, 0x4B, 0x00, 0x2C, 0x41, 0x59, 0xD3, 0x0F, 0x60,
+ 0x00, 0x7C, 0x60, 0x40, 0x02, 0x2A, 0x03, 0x00, 0x01, 0x60, 0xAC, 0x64, 0x0E, 0x00, 0x04, 0x2A,
+ 0x03, 0x00, 0x02, 0x60, 0xAC, 0x64, 0x09, 0x00, 0x10, 0x2A, 0x03, 0x00, 0x04, 0x60, 0xAC, 0x64,
+ 0x04, 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, 0x46, 0xA6, 0xF1, 0xFF, 0xFF, 0xD3, 0x80, 0x31, 0xF2, 0x27, 0x02, 0x66, 0x41,
+ 0x1D, 0x60, 0xC0, 0x65, 0x60, 0x47, 0x00, 0x7F, 0xA6, 0xF1, 0xE0, 0x84, 0x44, 0xD3, 0x64, 0x43,
+ 0x11, 0x18, 0x60, 0x46, 0x00, 0xF2, 0xFF, 0xFF, 0xFC, 0x1B, 0x66, 0x44, 0x64, 0x46, 0x80, 0xF0,
+ 0x60, 0x46, 0x80, 0xF8, 0x65, 0x46, 0x65, 0x43, 0x80, 0xF0, 0x01, 0xFA, 0x80, 0xFC, 0x64, 0x46,
+ 0x80, 0xF8, 0x0B, 0x00, 0x64, 0x46, 0x62, 0x43, 0x00, 0xF2, 0xA3, 0xDB, 0x60, 0x46, 0x80, 0xF0,
+ 0x81, 0xFC, 0x80, 0xFC, 0x64, 0x46, 0x80, 0xF8, 0x60, 0x43, 0x61, 0x46, 0x43, 0x4B, 0x01, 0x65,
+ 0xFD, 0x60, 0x58, 0x4E, 0xDD, 0x78, 0xFF, 0xFF, 0x43, 0x47, 0x3F, 0xF2, 0x00, 0xF4, 0x60, 0x43,
+ 0xFA, 0xA3, 0x00, 0x60, 0x17, 0x61, 0x00, 0x60, 0x01, 0x65, 0x01, 0x60, 0xFF, 0x64, 0x40, 0x4C,
+ 0xFD, 0x60, 0x58, 0x4E, 0x7A, 0x78, 0xFF, 0xFF, 0x00, 0xBB, 0xFF, 0xFF, 0x00, 0x02, 0x00, 0x64,
+ 0x40, 0x4A, 0x60, 0xFE, 0x02, 0x60, 0x00, 0x63, 0xBD, 0xD3, 0xBD, 0xD3, 0x60, 0x41, 0xFE, 0x60,
+ 0x58, 0x4E, 0x2C, 0x78, 0xFF, 0xFF, 0x20, 0xFE, 0x00, 0x65, 0x00, 0x64, 0x19, 0x60, 0x3B, 0xFB,
+ 0x02, 0x00, 0x20, 0xFE, 0xFF, 0x65, 0x02, 0x60, 0x00, 0x63, 0x60, 0xFE, 0xBD, 0xD3, 0xBD, 0xD3,
+ 0x60, 0x41, 0x20, 0xFE, 0xCD, 0x81, 0x60, 0x40, 0x80, 0x2A, 0x39, 0x00, 0x7F, 0xB4, 0x02, 0x3A,
+ 0x02, 0x00, 0x01, 0x64, 0x2E, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x2A, 0x00, 0x0B, 0x3A,
+ 0x02, 0x00, 0x04, 0x64, 0x26, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x22, 0x00, 0x0C, 0x3A,
+ 0x02, 0x00, 0x10, 0x64, 0x1E, 0x00, 0x12, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x1A, 0x00, 0x18, 0x3A,
+ 0x02, 0x00, 0x40, 0x64, 0x16, 0x00, 0x24, 0x3A, 0x02, 0x00, 0x80, 0x64, 0x12, 0x00, 0x30, 0x3A,
+ 0x02, 0x00, 0x01, 0x67, 0x0E, 0x00, 0x48, 0x3A, 0x02, 0x00, 0x02, 0x67, 0x0A, 0x00, 0x60, 0x3A,
+ 0x02, 0x00, 0x04, 0x67, 0x06, 0x00, 0x6C, 0x3A, 0x02, 0x00, 0x08, 0x67, 0x02, 0x00, 0x00, 0x64,
+ 0x00, 0x00, 0x19, 0x60, 0x3B, 0xF1, 0xFF, 0xFF, 0xB0, 0x84, 0x19, 0x60, 0x3B, 0xFB, 0x61, 0x40,
+ 0x00, 0x36, 0x05, 0x00, 0x60, 0xFE, 0xBD, 0xD3, 0xFF, 0xFF, 0x20, 0xFE, 0xBB, 0x01, 0x65, 0x40,
+ 0x00, 0x3A, 0x1E, 0x00, 0x26, 0x46, 0x3F, 0xF2, 0x00, 0xF4, 0x60, 0x43, 0xFA, 0xA3, 0x00, 0x60,
+ 0x17, 0x61, 0x00, 0x60, 0x32, 0x65, 0x01, 0x60, 0xFF, 0x64, 0x40, 0x4C, 0xFD, 0x60, 0x58, 0x4E,
+ 0x7A, 0x78, 0xFF, 0xFF, 0x00,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 0xFB, 0xD9, 0x01, 0x1C, 0x60, 0x7A, 0x64, 0x13, 0x60,
+ 0x22, 0xFB, 0x03, 0x64, 0x4A, 0xDB, 0xFF, 0xFF, 0x04, 0xFF, 0xB7, 0x01, 0x19, 0x60, 0x3E, 0xF3,
+ 0xFD, 0x60, 0x58, 0x4E, 0xAC, 0x78, 0xFF, 0xFF, 0x19, 0x60, 0x3F, 0xFB, 0x19, 0x60, 0x3A, 0xF3,
+ 0x0F, 0x60, 0xFF, 0x65, 0xA4, 0x84, 0xFC, 0x60, 0x58, 0x4E, 0x34, 0x78, 0xFF, 0xFF, 0x5D, 0xF5,
+ 0x35, 0x60, 0x70, 0x64, 0x00, 0xF4, 0x40, 0x48, 0x2F, 0x60, 0x24, 0x64, 0x20, 0x40, 0x10, 0x27,
+ 0x02, 0x00, 0x2F, 0x60, 0x02, 0x64, 0x28, 0xDB, 0x04, 0x61, 0x00, 0x60, 0x00, 0x64, 0xF1, 0x60,
+ 0x58, 0x4D, 0x34, 0x78, 0xFF, 0xFF, 0x5D, 0xF5, 0x3F, 0xFC, 0x53, 0xF3, 0x20, 0x40, 0x10, 0x23,
+ 0x02, 0x00, 0x20, 0xBC, 0x04, 0x00, 0x60, 0x40, 0x01, 0x22, 0x40, 0xBC, 0x04, 0xBC, 0x80, 0xBC,
+ 0x53, 0xFB, 0x11, 0x60, 0x62, 0x64, 0x08, 0x60, 0x6C, 0xFB, 0x06, 0x64, 0x08, 0x60, 0x73, 0xFB,
+ 0x19, 0x60, 0x43, 0xF3, 0xFF, 0xFF, 0x07, 0xB4, 0xA2, 0xDB, 0x53, 0xF3, 0x08, 0x60, 0x6C, 0xF1,
+ 0x60, 0x40, 0x20, 0x26, 0x03, 0x00, 0x01, 0x26, 0x32, 0x00, 0x45, 0x00, 0x08, 0x60, 0x73, 0xF3,
+ 0xFF, 0xFF, 0xDD, 0xA0, 0x01, 0xA4, 0x58, 0x03, 0xA2, 0xDB, 0x32, 0x60, 0x82, 0x61, 0xE0, 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, 0xF1, 0xBD, 0xD9, 0x72, 0x00,
+ 0x16, 0x60, 0xC2, 0xF3, 0xFF, 0xFF, 0xFF, 0xA0, 0xFF, 0xFF, 0x0C, 0x24, 0x6B, 0x00, 0x60, 0x40,
+ 0x0B, 0x36, 0x68, 0x00, 0x20, 0x40, 0x10, 0x27, 0x65, 0x00, 0x91, 0x00, 0x20, 0xFE, 0x00, 0x65,
+ 0x60, 0xFE, 0x1A, 0x60, 0x28, 0xFB, 0xE0, 0x84, 0xE0, 0x84, 0x08, 0x20, 0x03, 0x00, 0x01, 0x64,
+ 0xA2, 0xDB, 0x02, 0x64, 0x02, 0xA5, 0x64, 0x44, 0xD4, 0x9C, 0xD4, 0x80, 0x34, 0x60, 0x52, 0x62,
+ 0x02, 0x05, 0x08, 0x65, 0x4D, 0x00, 0xA2, 0xD9, 0x7C, 0x44, 0x34, 0x60, 0x54, 0x62, 0xA2, 0xDB,
+ 0x20, 0xFE, 0x00, 0x64, 0x60, 0xFE, 0x1C, 0x60, 0x08, 0xF3, 0xFF, 0xFF, 0x00, 0xA0, 0x5D, 0xD0,
+ 0x00, 0x65, 0x04, 0x03, 0x64, 0x40, 0x00, 0x3A, 0x01, 0x65, 0x03, 0x00, 0x64, 0x40, 0x00, 0x3A,
+ 0x01, 0x65, 0x5D, 0xD0, 0x04, 0x03, 0x64, 0x40, 0x0F, 0x3A, 0x01, 0x65, 0x03, 0x00, 0x64, 0x40,
+ 0x50, 0x3A, 0x01, 0x65, 0x5D, 0xD0, 0x04, 0x03, 0x64, 0x40, 0xAC, 0x3A, 0x01, 0x65, 0x03, 0x00,
+ 0x64, 0x40, 0xF2, 0x3A, 0x01, 0x65, 0x5D, 0xD0, 0x65, 0x40, 0x00, 0x3A, 0x17, 0x00, 0x00, 0x60,
+ 0x00, 0x65, 0x64, 0x40, 0x00, 0x36, 0x01, 0x65, 0x64, 0x40, 0x01, 0x36, 0x02, 0x65, 0x64, 0x40,
+ 0x02, 0x36, 0x04, 0x65, 0x64,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x60, 0x58, 0x4D,
+ 0x5F, 0x78, 0xFF, 0xFF, 0x19, 0x60, 0x86, 0xFB, 0x02, 0x63, 0xFD, 0x60, 0x58, 0x4D, 0x5F, 0x78,
+ 0xFF, 0xFF, 0x19, 0x60, 0x87, 0xFB, 0x01, 0x63, 0xFD, 0x60, 0x58, 0x4D, 0x5F, 0x78, 0xFF, 0xFF,
+ 0x19, 0x60, 0x88, 0xFB, 0x2E, 0x58, 0xFF, 0xFF, 0x63, 0x5C, 0xA7, 0x84, 0xEB, 0x83, 0x14, 0x02,
+ 0x01, 0x03, 0xFB, 0x01, 0x64, 0x44, 0x01, 0x36, 0x0B, 0x64, 0x02, 0x36, 0x0B, 0x64, 0x04, 0x36,
+ 0x0A, 0x64, 0x08, 0x36, 0x0A, 0x64, 0x10, 0x36, 0x09, 0x64, 0x20, 0x36, 0x09, 0x64, 0x40, 0x36,
+ 0x09, 0x64, 0x80, 0x36, 0x09, 0x64, 0x11, 0x00, 0x60, 0x40, 0x01, 0x36, 0x0B, 0x64, 0x02, 0x36,
+ 0x0F, 0x64, 0x04, 0x36, 0x0A, 0x64, 0x08, 0x36, 0x0E, 0x64, 0x10, 0x36, 0x09, 0x64, 0x20, 0x36,
+ 0x0D, 0x64, 0x40, 0x36, 0x08, 0x64, 0x80, 0x36, 0x0C, 0x64, 0x2D, 0x58, 0xFF, 0xFF, 0x63, 0x5C,
+ 0xA7, 0x84, 0xEB, 0x83, 0x0C, 0x02, 0x01, 0x03, 0xFB, 0x01, 0x64, 0x44, 0x01, 0x36, 0x0A, 0x64,
+ 0x02, 0x36, 0x14, 0x64, 0x04, 0x36, 0x37, 0x64, 0x08, 0x36, 0x6E, 0x64, 0x09, 0x00, 0x60, 0x40,
+ 0x01, 0x36, 0x0A, 0x64, 0x02, 0x36, 0x14, 0x64, 0x04, 0x36, 0x37, 0x64, 0x08, 0x36, 0x6E, 0x64,
+ 0x2D, 0x58, 0xFF, 0xFF, 0x60, 0xFE, 0x81, 0xA1, 0x7F, 0xA1, 0x02, 0x06, 0x00, 0xF4, 0x03, 0x61,
+ 0x5D, 0xD2, 0xCF, 0x83, 0xD4, 0x80, 0x25, 0x03, 0x16, 0x03, 0xCF, 0x83, 0x61, 0x44, 0x80, 0xA0,
+ 0x20, 0x03, 0x02, 0x02, 0x00, 0xF4, 0x03, 0x61, 0x5D, 0xD2, 0xCF, 0x83, 0x81, 0xA1, 0x19, 0x03,
+ 0x05, 0x07, 0x7F, 0xA1, 0xCC, 0x84, 0xDD, 0x81, 0xE6, 0x03, 0xF7, 0x01, 0x00, 0xF4, 0x00, 0xB8,
+ 0x04, 0x61, 0xE6, 0x03, 0xF2, 0x01, 0x2C, 0x43, 0x5D, 0xD0, 0xDE, 0xD9, 0x64, 0x44, 0x5D, 0xD0,
+ 0xDE, 0xD9, 0xCC, 0x84, 0x81, 0xA1, 0x05, 0x03, 0x7F, 0xA1, 0xF9, 0x04, 0x00, 0xF4, 0x03, 0x61,
+ 0xF6, 0x01, 0x20, 0xFE, 0x2E, 0x58, 0xFF, 0xFF, 0x01, 0x3A, 0x02, 0x00, 0x16, 0x64, 0x2B, 0x00,
+ 0x02, 0x3A, 0x02, 0x00, 0x14, 0x64, 0x27, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x12, 0x64, 0x23, 0x00,
+ 0x08, 0x3A, 0x02, 0x00, 0x10, 0x64, 0x1F, 0x00, 0x10, 0x3A, 0x02, 0x00, 0x0E, 0x64, 0x1B, 0x00,
+ 0x20, 0x3A, 0x02, 0x00, 0x0C, 0x64, 0x17, 0x00, 0x40, 0x3A, 0x02, 0x00, 0x0A, 0x64, 0x13, 0x00,
+ 0x80, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x0F, 0x00, 0x01, 0x3B, 0x02, 0x00, 0x06, 0x64, 0x0B, 0x00,
+ 0x02, 0x3B, 0x02, 0x00, 0x04, 0x64, 0x07, 0x00, 0x04, 0x3B, 0x02, 0x00, 0x02, 0x64, 0x03, 0x00,
+ 0x08, 0x3B, 0xFF, 0x01, 0x00, 0x64, 0x2E, 0x58, 0xFF, 0xFF, 0x27, 0xF2, 0xFF, 0xFF, 0x60, 0x40,
+ 0x36, 0x3A, 0x02, 0x00, 0x00, 0x61, 0x30, 0x00, 0x30, 0x3A, 0x02, 0x00, 0x02, 0x61, 0x2C, 0x00,
+ 0x24, 0x3A, 0x02, 0x00, 0x04, 0x61, 0x28, 0x00, 0x18, 0x3A, 0x02, 0x00, 0x06, 0x61, 0x24, 0x00,
+ 0x12, 0x3A, 0x02, 0x00, 0x08, 0x61, 0x20, 0x00, 0x0C, 0x3A, 0x02, 0x00, 0x0A, 0x61, 0x1C, 0x00,
+ 0x09, 0x3A, 0x02, 0x00, 0x0C, 0x61, 0x18, 0x00, 0x06, 0x3A, 0x02, 0x00, 0x0E, 0x61, 0x14, 0x00,
+ 0x6E, 0x3A, 0x02, 0x00, 0x10, 0x61, 0x10, 0x00, 0x37, 0x3A, 0x02, 0x00, 0x12, 0x61, 0x0C, 0x00,
+ 0x14, 0x3A, 0x02, 0x00, 0x14, 0x61, 0x08, 0x00, 0x0A, 0x3A, 0x02, 0x00, 0x16, 0x61, 0x04, 0x00,
+ 0x78, 0x43, 0x03, 0x61, 0x29, 0x60, 0xEA, 0x78, 0x65, 0x40, 0x01, 0x3A, 0x13, 0x00, 0x66, 0x45,
+ 0x2B, 0x46, 0x92, 0xFA, 0x65, 0x46, 0x26, 0xF2, 0xFF, 0xFF, 0x60, 0x41, 0x00, 0x7F, 0x60, 0x45,
+ 0x61, 0x47, 0x00, 0x7F, 0xD4, 0x84, 0x66, 0x41, 0x2B, 0x46, 0x0E, 0xF2, 0x60, 0x45, 0x65, 0x5E,
+ 0x0E, 0xFA, 0x61, 0x46, 0x2E, 0x58, 0xFF, 0xFF, 0xCD, 0x81, 0x7F, 0xB4, 0x02, 0x3A, 0x02, 0x00,
+ 0x01, 0x64, 0x32, 0x00, 0x04, 0x3A, 0x02, 0x00, 0x02, 0x64, 0x2E, 0x00, 0x0B, 0x3A, 0x02, 0x00,
+ 0x04, 0x64, 0x2A, 0x00, 0x16, 0x3A, 0x02, 0x00, 0x08, 0x64, 0x26, 0x00, 0x0C, 0x3A, 0x02, 0x00,
+ 0x10, 0x64, 0x22, 0x00, 0x12, 0x3A, 0x02, 0x00, 0x20, 0x64, 0x1E, 0x00, 0x18, 0x3A, 0x02, 0x00,
+ 0x40, 0x64, 0x1A, 0x00, 0x24, 0x3A, 0x02, 0x00, 0x80, 0x64, 0x16, 0x00, 0x30, 0x3A, 0x03, 0x00,
+ 0x00, 0x7E, 0x01, 0x7F, 0x11, 0x00, 0x48, 0x3A, 0x03, 0x00, 0x00, 0x7E, 0x02, 0x7F, 0x0C, 0x00,
+ 0x60, 0x3A, 0x03, 0x00, 0x00, 0x7E, 0x04, 0x7F, 0x07, 0x00, 0x6C, 0x3A, 0x03, 0x00, 0x00, 0x7E,
+ 0x08, 0x7F, 0x02, 0x00, 0x00, 0x64, 0x00, 0x00, 0x20, 0xFE, 0x2A, 0x45, 0x34, 0x8A, 0x60, 0xFE,
+ 0x61, 0x40, 0x00, 0x36, 0x02, 0x00, 0xBD, 0xD3, 0xBF, 0x01, 0x2E, 0x58, 0xFF, 0xFF,
+
+}; /* fw_image_4_data */
+
+static const CFG_IDENTITY_STRCT fw_image_infoidentity[] = {
+ {
+ sizeof( CFG_IDENTITY_STRCT ) / sizeof(hcf_16) - 1,
+ CFG_FW_IDENTITY,
+ COMP_ID_FW_STA,
+ 4, //Variant
+ 1, //Major
+ 36 //Minor
+ },
+ { 0000, 0000, 0000, 0000, 0000, 0000 } //endsentinel
+};
+
+static const CFG_PROG_STRCT fw_image_code[] = {
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x0184, // sizeof(fw_image_1_data),
+ 0x00000060, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_1_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x2c0e, // sizeof(fw_image_2_data),
+ 0x00000C16, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_2_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0x54de, // sizeof(fw_image_3_data),
+ 0x001E3824, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_3_data
+ },
+ {
+ 8,
+ CFG_PROG,
+ CFG_PROG_VOLATILE, // mode
+ 0xbcde, // sizeof(fw_image_4_data),
+ 0x001F4000, // Target address in NIC Memory
+ 0x0000, // CRC: yes/no TYPE: primary/station/tertiary
+ (hcf_8 FAR *) fw_image_4_data
+ },
+ {
+ 5,
+ CFG_PROG,
+ CFG_PROG_STOP, // mode
+ 0000,
+ 0x000F429B, // Start execution address
+ },
+ { 0000, 0000, 0000, 0000, 00000000, 0000, 00000000}
+};
+
+static const CFG_RANGE20_STRCT fw_image_infocompat[] = {
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_FW_SUP_RANGE,
+ COMP_ROLE_SUPL,
+ COMP_ID_STA,
+ {
+ { 4, 1, 2 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_MFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_MFI,
+ {
+ { 7, 3, 3 }, //variant, bottom, top
+ { 8, 1, 1 } //variant, bottom, top
+ }
+ },
+ { 3 + ((20 * sizeof(CFG_RANGE_SPEC_STRCT)) / sizeof(hcf_16)),
+ CFG_CFI_ACT_RANGES_STA,
+ COMP_ROLE_ACT,
+ COMP_ID_CFI,
+ {
+ { 4, 1, 2 } //variant, bottom, top
+ }
+ },
+ { 0000, 0000, 0000, 0000, { { 0000, 0000, 0000 } } } //endsentinel
+};
+
+memimage fw_image = {
+ "FUPU7D37dhfwci\001C", //signature, <format number>, C/Bin type
+ (CFG_PROG_STRCT *) fw_image_code,
+ 0x000F429B,
+ 00000000, //(dummy) pdaplug
+ 00000000, //(dummy) priplug
+ (CFG_RANGE20_STRCT *) fw_image_infocompat,
+ (CFG_IDENTITY_STRCT *) fw_image_infoidentity,
+};
+
diff --git a/drivers/staging/wlags49_h2/wl_cs.c b/drivers/staging/wlags49_h2/wl_cs.c
new file mode 100644
index 000000000000..c93e8c8b9699
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_cs.c
@@ -0,0 +1,715 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains processing and initialization specific to Card Services
+ * devices (PCMCIA, CF).
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/06 11:25:37 $
+ * $Revision: 1.5 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_cs.c,v $
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/kernel.h>
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/ctype.h>
+#include <linux/string.h>
+#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/in.h>
+#include <linux/delay.h>
+#include <asm/io.h>
+#include <asm/system.h>
+#include <asm/bitops.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/if_arp.h>
+#include <linux/ioport.h>
+
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/cisreg.h>
+#include <pcmcia/ciscode.h>
+#include <pcmcia/ds.h>
+#include <debug.h>
+
+#include <hcf.h>
+#include <dhf.h>
+#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_main.h>
+#include <wl_netdev.h>
+#include <wl_cs.h>
+#include <wl_sysfs.h>
+
+
+/*******************************************************************************
+ * macro definitions
+ ******************************************************************************/
+#define CS_CHECK(fn, ret) do { \
+ last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
+ } while (0)
+
+/*******************************************************************************
+ * global definitions
+ ******************************************************************************/
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif /* DBG */
+
+
+/*******************************************************************************
+ * wl_adapter_attach()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Creates an instance of the driver, allocating local data structures for
+ * one device. The device is registered with Card Services.
+ *
+ * PARAMETERS:
+ *
+ * none
+ *
+ * RETURNS:
+ *
+ * pointer to an allocated dev_link_t structure
+ * NULL on failure
+ *
+ ******************************************************************************/
+static int wl_adapter_attach(struct pcmcia_device *link)
+{
+ struct net_device *dev;
+ struct wl_private *lp;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_adapter_attach" );
+ DBG_ENTER( DbgInfo );
+
+ dev = wl_device_alloc();
+ if(dev == NULL) {
+ DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n");
+ return -ENOMEM;
+ }
+
+ link->io.NumPorts1 = HCF_NUM_IO_PORTS;
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
+ link->io.IOAddrLines = 6;
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_HANDLE_PRESENT;
+ link->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
+ link->irq.Handler = &wl_isr;
+ link->conf.Attributes = CONF_ENABLE_IRQ;
+ link->conf.IntType = INT_MEMORY_AND_IO;
+ link->conf.ConfigIndex = 5;
+ link->conf.Present = PRESENT_OPTION;
+
+ link->priv = link->irq.Instance = dev;
+ lp = wl_priv(dev);
+ lp->link = link;
+
+ wl_adapter_insert(link);
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_adapter_attach
+/*============================================================================*/
+
+
+
+/*******************************************************************************
+ * wl_adapter_detach()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This deletes a driver "instance". The device is de-registered with Card
+ * Services. If it has been released, then the net device is unregistered, and
+ * all local data structures are freed. Otherwise, the structures will be
+ * freed when the device is released.
+ *
+ * PARAMETERS:
+ *
+ * link - pointer to the dev_link_t structure representing the device to
+ * detach
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+static void wl_adapter_detach(struct pcmcia_device *link)
+{
+ struct net_device *dev = link->priv;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_adapter_detach" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "link", "0x%p", link );
+
+ wl_adapter_release(link);
+
+ if (dev) {
+ unregister_wlags_sysfs(dev);
+ unregister_netdev(dev);
+ }
+
+ wl_device_dealloc(dev);
+
+ DBG_LEAVE( DbgInfo );
+} // wl_adapter_detach
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_adapter_release()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * After a card is removed, this routine will release the PCMCIA
+ * configuration. If the device is still open, this will be postponed until it
+ * is closed.
+ *
+ * PARAMETERS:
+ *
+ * arg - a u_long representing a pointer to a dev_link_t structure for the
+ * device to be released.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_adapter_release( struct pcmcia_device *link )
+{
+ DBG_FUNC( "wl_adapter_release" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "link", "0x%p", link);
+
+ /* Stop hardware */
+ wl_remove(link->priv);
+
+ pcmcia_disable_device(link);
+
+ DBG_LEAVE( DbgInfo );
+} // wl_adapter_release
+/*============================================================================*/
+
+static int wl_adapter_suspend(struct pcmcia_device *link)
+{
+ struct net_device *dev = link->priv;
+
+ //if (link->open) {
+ netif_device_detach(dev);
+ wl_suspend(dev);
+//// CHECK! pcmcia_release_configuration(link->handle);
+ //}
+
+ return 0;
+} // wl_adapter_suspend
+
+static int wl_adapter_resume(struct pcmcia_device *link)
+{
+ struct net_device *dev = link->priv;
+
+ wl_resume(dev);
+
+ netif_device_attach( dev );
+
+ return 0;
+} // wl_adapter_resume
+
+/*******************************************************************************
+ * wl_adapter_insert()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * wl_adapter_insert() is scheduled to run after a CARD_INSERTION event is
+ * received, to configure the PCMCIA socket, and to make the ethernet device
+ * available to the system.
+ *
+ * PARAMETERS:
+ *
+ * link - pointer to the dev_link_t structure representing the device to
+ * insert
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_adapter_insert( struct pcmcia_device *link )
+{
+ struct net_device *dev;
+ int i;
+ int last_fn, last_ret;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_adapter_insert" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "link", "0x%p", link );
+
+ dev = link->priv;
+
+ /* Do we need to allocate an interrupt? */
+ link->conf.Attributes |= CONF_ENABLE_IRQ;
+
+ CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
+ CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
+ CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+
+
+ dev->irq = link->irq.AssignedIRQ;
+ dev->base_addr = link->io.BasePort1;
+
+ SET_NETDEV_DEV(dev, &handle_to_dev(link));
+ if (register_netdev(dev) != 0) {
+ printk("%s: register_netdev() failed\n", MODULE_NAME);
+ goto failed;
+ }
+ link->dev_node = &( wl_priv(dev) )->node;
+ strcpy(( wl_priv(dev) )->node.dev_name, dev->name);
+ register_wlags_sysfs(dev);
+
+ printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
+ dev->name, dev->base_addr, dev->irq);
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n'));
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+
+
+cs_failed:
+ cs_error( link, last_fn, last_ret );
+
+
+failed:
+ wl_adapter_release( link );
+
+ DBG_LEAVE(DbgInfo);
+ return;
+} // wl_adapter_insert
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_adapter_open()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Open the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to a net_device structure representing the network
+ * device to open.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_adapter_open( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ struct pcmcia_device *link = lp->link;
+ int result = 0;
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_adapter_open" );
+ DBG_ENTER( DbgInfo );
+ DBG_PRINT( "%s\n", VERSION_INFO );
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ if(!pcmcia_dev_present(link))
+ {
+ DBG_LEAVE( DbgInfo );
+ return -ENODEV;
+ }
+
+ link->open++;
+
+ hcf_status = wl_open( dev );
+
+ if( hcf_status != HCF_SUCCESS ) {
+ link->open--;
+ result = -ENODEV;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wl_adapter_open
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_adapter_close()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Close the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to a net_device structure representing the network
+ * device to close.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_adapter_close( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ struct pcmcia_device *link = lp->link;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_adapter_close" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ if( link == NULL ) {
+ DBG_LEAVE( DbgInfo );
+ return -ENODEV;
+ }
+
+ DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name );
+ wl_close( dev );
+
+ link->open--;
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_adapter_close
+/*============================================================================*/
+
+static struct pcmcia_device_id wl_adapter_ids[] = {
+#if ! ((HCF_TYPE) & HCF_TYPE_HII5)
+ PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0003),
+ PCMCIA_DEVICE_PROD_ID12("Agere Systems", "Wireless PC Card Model 0110",
+ 0x33103a9b, 0xe175b0dd),
+#else
+ PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0004),
+ PCMCIA_DEVICE_PROD_ID12("Linksys", "WCF54G_Wireless-G_CompactFlash_Card",
+ 0x0733cc81, 0x98a599e1),
+#endif // (HCF_TYPE) & HCF_TYPE_HII5
+ PCMCIA_DEVICE_NULL,
+ };
+MODULE_DEVICE_TABLE(pcmcia, wl_adapter_ids);
+
+static struct pcmcia_driver wlags49_driver = {
+ .owner = THIS_MODULE,
+ .drv = {
+ .name = DRIVER_NAME,
+ },
+ .probe = wl_adapter_attach,
+ .remove = wl_adapter_detach,
+ .id_table = wl_adapter_ids,
+ .suspend = wl_adapter_suspend,
+ .resume = wl_adapter_resume,
+};
+
+
+
+/*******************************************************************************
+ * wl_adapter_init_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by init_module() to perform PCMCIA driver initialization.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * -1 on error
+ *
+ ******************************************************************************/
+int wl_adapter_init_module( void )
+{
+ int ret;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_adapter_init_module" );
+ DBG_ENTER( DbgInfo );
+ DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCMCIA\n" );
+
+ ret = pcmcia_register_driver(&wlags49_driver);
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wl_adapter_init_module
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_adapter_cleanup_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by cleanup_module() to perform driver uninitialization.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_adapter_cleanup_module( void )
+{
+ DBG_FUNC( "wl_adapter_cleanup_module" );
+ DBG_ENTER( DbgInfo );
+ DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n" );
+
+
+ pcmcia_unregister_driver(&wlags49_driver);
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_adapter_cleanup_module
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_adapter_is_open()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Check with Card Services to determine if this device is open.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the net_device structure whose open status will be
+ * checked
+ *
+ * RETURNS:
+ *
+ * nonzero if device is open
+ * 0 otherwise
+ *
+ ******************************************************************************/
+int wl_adapter_is_open( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ struct pcmcia_device *link = lp->link;
+
+ if(!pcmcia_dev_present(link)) {
+ return 0;
+ }
+
+ return( link->open );
+} // wl_adapter_is_open
+/*============================================================================*/
+
+
+#if DBG
+
+/*******************************************************************************
+ * DbgEvent()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Converts the card serivces events to text for debugging.
+ *
+ * PARAMETERS:
+ *
+ * mask - a integer representing the error(s) being reported by Card
+ * Services.
+ *
+ * RETURNS:
+ *
+ * a pointer to a string describing the error(s)
+ *
+ ******************************************************************************/
+const char* DbgEvent( int mask )
+{
+ static char DbgBuffer[256];
+ char *pBuf;
+ /*------------------------------------------------------------------------*/
+
+
+ pBuf = DbgBuffer;
+ *pBuf = '\0';
+
+
+ if( mask & CS_EVENT_WRITE_PROTECT )
+ strcat( pBuf, "WRITE_PROTECT " );
+
+ if(mask & CS_EVENT_CARD_LOCK)
+ strcat( pBuf, "CARD_LOCK " );
+
+ if(mask & CS_EVENT_CARD_INSERTION)
+ strcat( pBuf, "CARD_INSERTION " );
+
+ if(mask & CS_EVENT_CARD_REMOVAL)
+ strcat( pBuf, "CARD_REMOVAL " );
+
+ if(mask & CS_EVENT_BATTERY_DEAD)
+ strcat( pBuf, "BATTERY_DEAD " );
+
+ if(mask & CS_EVENT_BATTERY_LOW)
+ strcat( pBuf, "BATTERY_LOW " );
+
+ if(mask & CS_EVENT_READY_CHANGE)
+ strcat( pBuf, "READY_CHANGE " );
+
+ if(mask & CS_EVENT_CARD_DETECT)
+ strcat( pBuf, "CARD_DETECT " );
+
+ if(mask & CS_EVENT_RESET_REQUEST)
+ strcat( pBuf, "RESET_REQUEST " );
+
+ if(mask & CS_EVENT_RESET_PHYSICAL)
+ strcat( pBuf, "RESET_PHYSICAL " );
+
+ if(mask & CS_EVENT_CARD_RESET)
+ strcat( pBuf, "CARD_RESET " );
+
+ if(mask & CS_EVENT_REGISTRATION_COMPLETE)
+ strcat( pBuf, "REGISTRATION_COMPLETE " );
+
+ // if(mask & CS_EVENT_RESET_COMPLETE)
+ // strcat( pBuf, "RESET_COMPLETE " );
+
+ if(mask & CS_EVENT_PM_SUSPEND)
+ strcat( pBuf, "PM_SUSPEND " );
+
+ if(mask & CS_EVENT_PM_RESUME)
+ strcat( pBuf, "PM_RESUME " );
+
+ if(mask & CS_EVENT_INSERTION_REQUEST)
+ strcat( pBuf, "INSERTION_REQUEST " );
+
+ if(mask & CS_EVENT_EJECTION_REQUEST)
+ strcat( pBuf, "EJECTION_REQUEST " );
+
+ if(mask & CS_EVENT_MTD_REQUEST)
+ strcat( pBuf, "MTD_REQUEST " );
+
+ if(mask & CS_EVENT_ERASE_COMPLETE)
+ strcat( pBuf, "ERASE_COMPLETE " );
+
+ if(mask & CS_EVENT_REQUEST_ATTENTION)
+ strcat( pBuf, "REQUEST_ATTENTION " );
+
+ if(mask & CS_EVENT_CB_DETECT)
+ strcat( pBuf, "CB_DETECT " );
+
+ if(mask & CS_EVENT_3VCARD)
+ strcat( pBuf, "3VCARD " );
+
+ if(mask & CS_EVENT_XVCARD)
+ strcat( pBuf, "XVCARD " );
+
+
+ if( *pBuf ) {
+ pBuf[strlen(pBuf) - 1] = '\0';
+ } else {
+ if( mask != 0x0 ) {
+ sprintf( pBuf, "<<0x%08x>>", mask );
+ }
+ }
+
+ return pBuf;
+} // DbgEvent
+/*============================================================================*/
+
+#endif /* DBG */
diff --git a/drivers/staging/wlags49_h2/wl_cs.h b/drivers/staging/wlags49_h2/wl_cs.h
new file mode 100644
index 000000000000..3971fbc4e6ef
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_cs.h
@@ -0,0 +1,112 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for the driver to support PCMCIA.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_cs.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_CS_H__
+#define __WL_CS_H__
+
+
+
+
+/*******************************************************************************
+ * function protoypes
+ ******************************************************************************/
+
+void wl_adapter_insert(struct pcmcia_device *link);
+
+void wl_adapter_release(struct pcmcia_device *link);
+
+int wl_adapter_event(event_t event, int priority, event_callback_args_t *args );
+
+int wl_adapter_init_module( void );
+
+void wl_adapter_cleanup_module( void );
+
+int wl_adapter_open(struct net_device *dev);
+
+int wl_adapter_close(struct net_device *dev);
+
+int wl_adapter_is_open(struct net_device *dev);
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+void cs_error(client_handle_t handle, int func, int ret);
+#endif
+
+const char *DbgEvent( int mask );
+
+
+
+#endif // __WL_CS_H__
diff --git a/drivers/staging/wlags49_h2/wl_enc.c b/drivers/staging/wlags49_h2/wl_enc.c
new file mode 100644
index 000000000000..33181da413cb
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_enc.c
@@ -0,0 +1,248 @@
+
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file defines functions related to WEP key coding/decoding.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_enc.c,v $
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <debug.h>
+#include <hcf.h>
+
+#include <wl_enc.h>
+
+
+
+
+/*******************************************************************************
+ * global definitions
+ ******************************************************************************/
+#if DBG
+
+extern dbg_info_t *DbgInfo;
+
+#endif /* DBG */
+
+
+
+
+/*******************************************************************************
+ * wl_wep_code()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function encodes a set of wep keys for privacy
+ *
+ * PARAMETERS:
+ *
+ * szCrypt -
+ * szDest -
+ * Data -
+ * nLen -
+ *
+ * RETURNS:
+ *
+ * OK
+ *
+ ******************************************************************************/
+int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen )
+{
+ int i;
+ int t;
+ int k ;
+ char bits;
+ char *szData = (char *) Data;
+ /*------------------------------------------------------------------------*/
+
+
+ for( i = bits = 0 ; i < MACADDRESS_STR_LEN; i++ ) {
+ bits ^= szCrypt[i];
+ bits += szCrypt[i];
+ }
+
+ for( i = t = *szDest = 0; i < nLen; i++, t++ ) {
+ k = szData[i] ^ ( bits + i );
+
+
+ switch( i % 3 ) {
+
+ case 0 :
+
+ szDest[t] = ((k & 0xFC) >> 2) + CH_START ;
+ szDest[t+1] = ((k & 0x03) << 4) + CH_START ;
+ szDest[t+2] = '\0';
+
+ break;
+
+
+ case 1 :
+
+ szDest[t] += (( k & 0xF0 ) >> 4 );
+ szDest[t+1] = (( k & 0x0F ) << 2 ) + CH_START ;
+ szDest[t+2] = '\0';
+
+ break;
+
+
+ case 2 :
+
+ szDest[t] += (( k & 0xC0 ) >> 6 );
+ szDest[t+1] = ( k & 0x3F ) + CH_START ;
+ szDest[t+2] = '\0';
+ t++;
+
+ break;
+ }
+ }
+
+ return( strlen( szDest )) ;
+
+}
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wep_decode()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function decodes a set of WEP keys for use by the card.
+ *
+ * PARAMETERS:
+ *
+ * szCrypt -
+ * szDest -
+ * Data -
+ *
+ * RETURNS:
+ *
+ * OK
+ *
+ ******************************************************************************/
+int wl_wep_decode( char *szCrypt, void *Dest, char *szData )
+{
+ int i;
+ int t;
+ int nLen;
+ char bits;
+ char *szDest = Dest;
+ /*------------------------------------------------------------------------*/
+
+
+ for( i = bits = 0 ; i < 12; i++ ) {
+ bits ^= szCrypt[i] ;
+ bits += szCrypt[i] ;
+ }
+
+ nLen = ( strlen( szData ) * 3) / 4 ;
+
+ for( i = t = 0; i < nLen; i++, t++ ) {
+ switch( i % 3 ) {
+ case 0 :
+
+ szDest[i] = ((( szData[t]-CH_START ) & 0x3f ) << 2 ) +
+ ((( szData[t+1]-CH_START ) & 0x30 ) >> 4 );
+ break;
+
+
+ case 1 :
+ szDest[i] = ((( szData[t]-CH_START ) & 0x0f ) << 4 ) +
+ ((( szData[t+1]-CH_START ) & 0x3c ) >> 2 );
+ break;
+
+
+ case 2 :
+ szDest[i] = ((( szData[t]-CH_START ) & 0x03 ) << 6 ) +
+ (( szData[t+1]-CH_START ) & 0x3f );
+ t++;
+ break;
+ }
+
+ szDest[i] ^= ( bits + i ) ;
+
+ }
+
+ return( i ) ;
+
+}
+/*============================================================================*/
+
diff --git a/drivers/staging/wlags49_h2/wl_enc.h b/drivers/staging/wlags49_h2/wl_enc.h
new file mode 100644
index 000000000000..15467a33b3b5
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_enc.h
@@ -0,0 +1,135 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header for performing coding/decoding of the WEP keys.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_enc.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WAVELAN2_ENCRYPTION_H__
+#define __WAVELAN2_ENCRYPTION_H__
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+#define CRYPT_CODE "57617665A5D6"
+#define ENCRYPTION_LEN 102
+#define ENCRYPTION_MAGIC 0x48576877L // HWhw
+#define DEF_CRYPT_STR "G?TIUEA]d5MAdZV'eUb&&6.)'&:,'VF/(FR2)6^5*'*8*W6;+GB>,7NA-'ZD-X&G.H2J/8>M0(JP0XVS1HbV29.Y3):\\3YF_4IRb56"
+
+#define DEFAULT_CRYPT_MAC "W\x01\x6B\x66\xA5\x5A"
+#define CH_START '&'
+#define MACADDRESS_STR_LEN 12
+
+#define KEY_LEN 14
+#define NUM_KEYS 4
+
+#define KEY_LENGTH_NONE_ASCII 0
+#define KEY_LENGTH_64_BIT_ASCII 5
+#define KEY_LENGTH_128_BIT_ASCII 13
+
+#define KEY_LENGTH_NONE_HEX ( KEY_LENGTH_NONE_ASCII * sizeof( unsigned short ))
+#define KEY_LENGTH_64_BIT_HEX ( KEY_LENGTH_64_BIT_ASCII * sizeof( unsigned short ))
+#define KEY_LENGTH_128_BIT_HEX ( KEY_LENGTH_128_BIT_ASCII * sizeof( unsigned short ))
+
+
+
+
+/*******************************************************************************
+ * type definitions
+ ******************************************************************************/
+typedef struct _encstct
+{
+ hcf_32 dwMagic;
+ hcf_16 wTxKeyID;
+ hcf_16 wEnabled;
+ CFG_DEFAULT_KEYS_STRCT EncStr;
+}
+ENCSTRCT, *PENCSTRCT;
+
+
+
+
+/*******************************************************************************
+ * function prrottypes
+ ******************************************************************************/
+int wl_wep_code( char *szCrypt, char *szDest, void *Data, int nLen );
+
+int wl_wep_decode( char *szCrypt, void *Dest, char *szData );
+
+
+
+
+#endif // __WAVELAN2_ENCRYPTION_H__
diff --git a/drivers/staging/wlags49_h2/wl_if.h b/drivers/staging/wlags49_h2/wl_if.h
new file mode 100644
index 000000000000..8f0cb10a5be6
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_if.h
@@ -0,0 +1,232 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Driver common header for info needed by driver source and user-space
+ * processes communicating with the driver.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_if.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WAVELAN2_IF_H__
+#define __WAVELAN2_IF_H__
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+#define MAX_LTV_BUF_SIZE (512 - (sizeof(hcf_16) * 2))
+
+#define HCF_TALLIES_SIZE (sizeof(CFG_HERMES_TALLIES_STRCT) + \
+ (sizeof(hcf_16) * 2))
+
+#define HCF_MAX_MULTICAST 16
+#define HCF_MAX_NAME_LEN 32
+#define MAX_LINE_SIZE 256
+#define HCF_NUM_IO_PORTS 0x80
+#define TX_TIMEOUT ((800 * HZ) / 1000)
+
+
+#define HCF_MIN_COMM_QUALITY 0
+#define HCF_MAX_COMM_QUALITY 92
+#define HCF_MIN_SIGNAL_LEVEL 47
+#define HCF_MAX_SIGNAL_LEVEL 138
+#define HCF_MIN_NOISE_LEVEL 47
+#define HCF_MAX_NOISE_LEVEL 138
+#define HCF_0DBM_OFFSET 149
+
+/* For encryption (WEP) */
+#define MIN_KEY_SIZE 5 // 40 bits RC4 - WEP
+#define MAX_KEY_SIZE 13 // 104 bits
+#define MAX_KEYS 4
+
+#define RADIO_CHANNELS 14
+#define RADIO_SENSITIVITY_LEVELS 3
+#define RADIO_TX_POWER_MWATT 32
+#define RADIO_TX_POWER_DBM 15
+
+#define MIN_RTS_BYTES 0
+#define MAX_RTS_BYTES 2347
+
+#define MAX_RATES 8
+#define MEGABIT 1024*1024
+
+#define HCF_FAILURE 0xFF
+#define UIL_FAILURE 0xFF
+#define CFG_UIL_CONNECT 0xA123 // Define differently?
+#define CFG_UIL_CONNECT_ACK_CODE 0x5653435A // VSCZ
+#define WVLAN2_UIL_CONNECTED (0x01L << 0)
+#define WVLAN2_UIL_BUSY (0x01L << 1)
+
+
+
+
+/*******************************************************************************
+ * driver ioctl interface
+ ******************************************************************************/
+#define WVLAN2_IOCTL_UIL SIOCDEVPRIVATE
+
+/* The UIL Interface used in conjunction with the WVLAN2_IOCTL_UIL code above
+ is defined in mdd.h. A quick reference of the UIL codes is listed below */
+/*
+UIL_FUN_CONNECT
+UIL_FUN_DISCONNECT
+UIL_FUN_ACTION
+ UIL_ACT_BLOCK
+ UIL_ACT_UNBLOCK
+ UIL_ACT_SCA
+ UIL_ACT_DIAG
+ UIL_ACT_APPLY
+UIL_FUN_SEND_DIAG_MSG
+UIL_FUN_GET_INFO
+UIL_FUN_PUT_INFO
+*/
+
+#define SIOCSIWNETNAME SIOCDEVPRIVATE+1
+#define SIOCGIWNETNAME SIOCDEVPRIVATE+2
+#define SIOCSIWSTANAME SIOCDEVPRIVATE+3
+#define SIOCGIWSTANAME SIOCDEVPRIVATE+4
+#define SIOCSIWPORTTYPE SIOCDEVPRIVATE+5
+#define SIOCGIWPORTTYPE SIOCDEVPRIVATE+6
+
+/* IOCTL code for the RTS interface */
+#define WL_IOCTL_RTS SIOCDEVPRIVATE+7
+
+/* IOCTL subcodes for WL_IOCTL_RTS */
+#define WL_IOCTL_RTS_READ 1
+#define WL_IOCTL_RTS_WRITE 2
+#define WL_IOCTL_RTS_BATCH_READ 3
+#define WL_IOCTL_RTS_BATCH_WRITE 4
+
+
+/*******************************************************************************
+ * STRUCTURE DEFINITIONS
+ ******************************************************************************/
+typedef struct
+{
+ __u16 length;
+ __u8 name[HCF_MAX_NAME_LEN];
+}
+wvName_t;
+
+
+typedef struct
+{
+ hcf_16 len;
+ hcf_16 typ;
+ union
+ {
+ hcf_8 u8[MAX_LTV_BUF_SIZE / sizeof(hcf_8)];
+ hcf_16 u16[MAX_LTV_BUF_SIZE / sizeof(hcf_16)];
+ hcf_32 u32[MAX_LTV_BUF_SIZE / sizeof(hcf_32)];
+ } u;
+}
+ltv_t;
+
+
+struct uilreq
+{
+ union
+ {
+ char ifrn_name[IFNAMSIZ];
+ } ifr_ifrn;
+
+ IFBP hcfCtx;
+ __u8 command;
+ __u8 result;
+
+ /* The data field in this structure is typically an LTV of some type. The
+ len field is the size of the buffer in bytes, as opposed to words (like
+ the L-field in the LTV */
+ __u16 len;
+ void *data;
+};
+
+
+struct rtsreq
+{
+ union
+ {
+ char ifrn_name[IFNAMSIZ];
+ }
+ ifr_ifrn;
+
+ __u16 typ;
+ __u16 reg;
+ __u16 len;
+ __u16 *data;
+};
+
+
+#endif // __WAVELAN2_IF_H__
+
diff --git a/drivers/staging/wlags49_h2/wl_internal.h b/drivers/staging/wlags49_h2/wl_internal.h
new file mode 100644
index 000000000000..1d9bdfa2fbfb
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_internal.h
@@ -0,0 +1,1073 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header for defintions and macros internal to the drvier.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/03 11:39:39 $
+ * $Revision: 1.8 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_internal.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WAVELAN2_H__
+#define __WAVELAN2_H__
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <linux/version.h>
+#ifdef BUS_PCMCIA
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#include <pcmcia/version.h>
+#endif
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/cisreg.h>
+#include <pcmcia/ciscode.h>
+#include <pcmcia/ds.h>
+#endif // BUS_PCMCIA
+
+#ifdef HAS_WIRELESS_EXTENSIONS
+#include <linux/wireless.h>
+#if WIRELESS_EXT > 13
+#include <net/iw_handler.h>
+#endif // WIRELESS_EXT > 13
+#define USE_DBM
+#define RETURN_CURRENT_NETWORKNAME
+#define USE_FREQUENCY
+#endif // HAS_WIRELESS_EXTENSIONS/
+
+#include <linux/list.h>
+
+#include <linux/interrupt.h>
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+#define p_u8 __u8
+#define p_s8 __s8
+#define p_u16 __u16
+#define p_s16 __s16
+#define p_u32 __u32
+#define p_s32 __s32
+#define p_char char
+
+#define MAX_KEY_LEN (2 + (13 * 2)) // 0x plus 13 hex digit pairs
+#define MB_SIZE 1024
+#define MAX_ENC_LEN 104
+
+#define MAX_SCAN_TIME_SEC 8
+#define MAX_NAPS 32
+
+#define CFG_MB_INFO 0x0820 //Mail Box Info Block
+
+#define NUM_WDS_PORTS 6
+
+#define WVLAN_MAX_LOOKAHEAD (HCF_MAX_MSG+46) /* as per s0005MIC_4.doc */
+
+
+/* Min/Max/Default Parameter Values */
+#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
+//;? why this difference depending on compile option, seems to me it should depend on runtime if anything
+#define PARM_DEFAULT_SSID "LinuxAP"
+#else
+#define PARM_DEFAULT_SSID "ANY"
+#endif // HCF_TYPE_AP
+
+#define PARM_MIN_NAME_LEN 1
+#define PARM_MAX_NAME_LEN 32
+
+
+/* The following definitions pertain to module and profile parameters */
+// #define PARM_AP_MODE APMode
+// #define PARM_NAME_AP_MODE TEXT("APMode")
+// #define PARM_DEFAULT_AP_MODE FALSE
+
+#define PARM_AUTHENTICATION Authentication
+#define PARM_NAME_AUTHENTICATION TEXT("Authentication")
+#define PARM_MIN_AUTHENTICATION 1
+#define PARM_MAX_AUTHENTICATION 2
+#define PARM_DEFAULT_AUTHENTICATION 1
+
+#define PARM_AUTH_KEY_MGMT_SUITE AuthKeyMgmtSuite
+#define PARM_NAME_AUTH_KEY_MGMT_SUITE TEXT("AuthKeyMgmtSuite")
+#define PARM_MIN_AUTH_KEY_MGMT_SUITE 0
+#define PARM_MAX_AUTH_KEY_MGMT_SUITE 4
+#define PARM_DEFAULT_AUTH_KEY_MGMT_SUITE 0
+
+#define PARM_BRSC_2GHZ BRSC2GHz
+#define PARM_NAME_BRSC_2GHZ TEXT("BRSC2GHz")
+#define PARM_MIN_BRSC 0x0000
+#define PARM_MAX_BRSC 0x0FFF
+#define PARM_DEFAULT_BRSC_2GHZ 0x000F
+
+#define PARM_BRSC_5GHZ BRSC5GHz
+#define PARM_NAME_BRSC_5GHZ TEXT("BRSC5GHz")
+#define PARM_DEFAULT_BRSC_5GHZ 0x0150
+
+#define PARM_COEXISTENCE Coexistence
+#define PARM_NAME_COEXISTENCE TEXT("Coexistence")
+#define PARM_MIN_COEXISTENCE 0x0000
+#define PARM_MAX_COEXISTENCE 0x0007
+#define PARM_DEFAULT_COEXISTENCE 0x0000
+
+#define PARM_CONFIGURED Configured
+#define PARM_NAME_CONFIGURED TEXT("Configured")
+
+#define PARM_CONNECTION_CONTROL ConnectionControl
+#define PARM_NAME_CONNECTION_CONTROL TEXT("ConnectionControl")
+#define PARM_MIN_CONNECTION_CONTROL 0
+#define PARM_MAX_CONNECTION_CONTROL 3
+#define PARM_DEFAULT_CONNECTION_CONTROL 2
+
+#define PARM_CREATE_IBSS CreateIBSS
+#define PARM_NAME_CREATE_IBSS TEXT("CreateIBSS")
+#define PARM_DEFAULT_CREATE_IBSS FALSE
+#define PARM_DEFAULT_CREATE_IBSS_STR "N"
+
+#define PARM_DEBUG_FLAG DebugFlag
+#define PARM_NAME_DEBUG_FLAG TEXT("DebugFlag")
+#define PARM_MIN_DEBUG_FLAG 0
+#define PARM_MAX_DEBUG_FLAG 0xFFFF
+#define PARM_DEFAULT_DEBUG_FLAG 0xFFFF
+
+#define PARM_DESIRED_SSID DesiredSSID
+#define PARM_NAME_DESIRED_SSID TEXT("DesiredSSID")
+
+#define PARM_DOWNLOAD_FIRMWARE DownloadFirmware
+#define PARM_NAME_DOWNLOAD_FIRMWARE TEXT("DownloadFirmware")
+
+#define PARM_DRIVER_ENABLE DriverEnable
+#define PARM_NAME_DRIVER_ENABLE TEXT("DriverEnable")
+#define PARM_DEFAULT_DRIVER_ENABLE TRUE
+
+#define PARM_ENABLE_ENCRYPTION EnableEncryption
+#define PARM_NAME_ENABLE_ENCRYPTION TEXT("EnableEncryption")
+#define PARM_MIN_ENABLE_ENCRYPTION 0
+#define PARM_MAX_ENABLE_ENCRYPTION 7
+#define PARM_DEFAULT_ENABLE_ENCRYPTION 0
+
+#define PARM_ENCRYPTION Encryption
+#define PARM_NAME_ENCRYPTION TEXT("Encryption")
+
+#define PARM_EXCLUDE_UNENCRYPTED ExcludeUnencrypted
+#define PARM_NAME_EXCLUDE_UNENCRYPTED TEXT("ExcludeUnencrypted")
+#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED TRUE
+#define PARM_DEFAULT_EXCLUDE_UNENCRYPTED_STR "N"
+
+#define PARM_INTRA_BSS_RELAY IntraBSSRelay
+#define PARM_NAME_INTRA_BSS_RELAY TEXT("IntraBSSRelay")
+#define PARM_DEFAULT_INTRA_BSS_RELAY TRUE
+#define PARM_DEFAULT_INTRA_BSS_RELAY_STR "Y"
+
+#define PARM_KEY1 Key1
+#define PARM_NAME_KEY1 TEXT("Key1")
+#define PARM_KEY2 Key2
+#define PARM_NAME_KEY2 TEXT("Key2")
+#define PARM_KEY3 Key3
+#define PARM_NAME_KEY3 TEXT("Key3")
+#define PARM_KEY4 Key4
+#define PARM_NAME_KEY4 TEXT("Key4")
+
+//;? #define PARM_KEY_FORMAT AsciiHex
+//;? #define PARM_NAME_KEY_FORMAT TEXT("AsciiHex")
+
+#define PARM_LOAD_BALANCING LoadBalancing
+#define PARM_NAME_LOAD_BALANCING TEXT("LoadBalancing")
+#define PARM_DEFAULT_LOAD_BALANCING TRUE
+#define PARM_DEFAULT_LOAD_BALANCING_STR "Y"
+
+#define PARM_MAX_DATA_LENGTH MaxDataLength
+#define PARM_NAME_MAX_DATA_LENGTH TEXT("MaxDataLength")
+
+#define PARM_MAX_SLEEP MaxSleepDuration
+#define PARM_NAME_MAX_SLEEP TEXT("MaxSleepDuration")
+#define PARM_MIN_MAX_PM_SLEEP 1 //;?names nearly right?
+#define PARM_MAX_MAX_PM_SLEEP 65535
+#define PARM_DEFAULT_MAX_PM_SLEEP 100
+
+#define PARM_MEDIUM_DISTRIBUTION MediumDistribution
+#define PARM_NAME_MEDIUM_DISTRIBUTION TEXT("MediumDistribution")
+#define PARM_DEFAULT_MEDIUM_DISTRIBUTION TRUE
+#define PARM_DEFAULT_MEDIUM_DISTRIBUTION_STR "Y"
+
+#define PARM_MICROWAVE_ROBUSTNESS MicroWaveRobustness
+#define PARM_NAME_MICROWAVE_ROBUSTNESS TEXT("MicroWaveRobustness")
+#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS FALSE
+#define PARM_DEFAULT_MICROWAVE_ROBUSTNESS_STR "N"
+
+#define PARM_MULTICAST_PM_BUFFERING MulticastPMBuffering
+#define PARM_NAME_MULTICAST_PM_BUFFERING TEXT("MulticastPMBuffering")
+#define PARM_DEFAULT_MULTICAST_PM_BUFFERING TRUE
+#define PARM_DEFAULT_MULTICAST_PM_BUFFERING_STR "Y"
+
+#define PARM_MULTICAST_RATE MulticastRate
+#define PARM_NAME_MULTICAST_RATE TEXT("MulticastRate")
+#ifdef WARP
+#define PARM_MIN_MULTICAST_RATE 0x0001
+#define PARM_MAX_MULTICAST_RATE 0x0fff
+#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0004
+#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0010
+#else
+#define PARM_MIN_MULTICAST_RATE 0x0001
+#define PARM_MAX_MULTICAST_RATE 0x0004
+#define PARM_DEFAULT_MULTICAST_RATE_2GHZ 0x0002
+#define PARM_DEFAULT_MULTICAST_RATE_5GHZ 0x0000
+#endif // WARP
+
+#define PARM_MULTICAST_RX MulticastReceive
+#define PARM_NAME_MULTICAST_RX TEXT("MulticastReceive")
+#define PARM_DEFAULT_MULTICAST_RX TRUE
+#define PARM_DEFAULT_MULTICAST_RX_STR "Y"
+
+#define PARM_NETWORK_ADDR NetworkAddress
+#define PARM_NAME_NETWORK_ADDR TEXT("NetworkAddress")
+#define PARM_DEFAULT_NETWORK_ADDR { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }
+
+#define PARM_NETWORK_TYPE NetworkType
+#define PARM_NAME_NETWORK_TYPE TEXT("NetworkType")
+#define PARM_DEFAULT_NETWORK_TYPE 0
+
+#define PARM_OWN_ATIM_WINDOW OwnATIMWindow
+#define PARM_NAME_OWN_ATIM_WINDOW TEXT("OwnATIMWindow")
+#define PARM_MIN_OWN_ATIM_WINDOW 0
+#define PARM_MAX_OWN_ATIM_WINDOW 100
+#define PARM_DEFAULT_OWN_ATIM_WINDOW 0
+
+#define PARM_OWN_BEACON_INTERVAL OwnBeaconInterval
+#define PARM_NAME_OWN_BEACON_INTERVAL TEXT("OwnBeaconInterval")
+#define PARM_MIN_OWN_BEACON_INTERVAL 20
+#define PARM_MAX_OWN_BEACON_INTERVAL 200
+#define PARM_DEFAULT_OWN_BEACON_INTERVAL 100
+
+#define PARM_OWN_CHANNEL OwnChannel
+#define PARM_NAME_OWN_CHANNEL TEXT("OwnChannel")
+#define PARM_MIN_OWN_CHANNEL 1
+#define PARM_MAX_OWN_CHANNEL 161
+#define PARM_DEFAULT_OWN_CHANNEL 10
+
+#define PARM_OWN_DTIM_PERIOD OwnDTIMPeriod
+#define PARM_NAME_OWN_DTIM_PERIOD TEXT("OwnDTIMPeriod")
+#define PARM_MIN_OWN_DTIM_PERIOD 1
+#define PARM_MAX_OWN_DTIM_PERIOD 65535
+#define PARM_DEFAULT_OWN_DTIM_PERIOD 1
+
+#define PARM_OWN_NAME OwnName
+#define PARM_NAME_OWN_NAME TEXT("OwnName")
+#define PARM_DEFAULT_OWN_NAME "Linux"
+
+#define PARM_OWN_SSID OwnSSID
+#define PARM_NAME_OWN_SSID TEXT("OwnSSID")
+
+#define PARM_PM_ENABLED PMEnabled
+#define PARM_NAME_PM_ENABLED TEXT("PMEnabled")
+#define PARM_MAX_PM_ENABLED 3
+
+#define PARM_PMEPS PMEPS
+#define PARM_NAME_PMEPS TEXT("PMEPS")
+
+#define PARM_PM_HOLDOVER_DURATION PMHoldoverDuration
+#define PARM_NAME_PM_HOLDOVER_DURATION TEXT("PMHoldoverDuration")
+#define PARM_MIN_PM_HOLDOVER_DURATION 1
+#define PARM_MAX_PM_HOLDOVER_DURATION 1000
+#define PARM_DEFAULT_PM_HOLDOVER_DURATION 100
+
+#define PARM_PM_MODE PowerMode
+#define PARM_NAME_PM_MODE TEXT("PowerMode")
+
+#define PARM_PORT_TYPE PortType
+#define PARM_NAME_PORT_TYPE TEXT("PortType")
+#define PARM_MIN_PORT_TYPE 1
+#define PARM_MAX_PORT_TYPE 3
+#define PARM_DEFAULT_PORT_TYPE 1
+
+#define PARM_PROMISCUOUS_MODE PromiscuousMode
+#define PARM_NAME_PROMISCUOUS_MODE TEXT("PromiscuousMode")
+#define PARM_DEFAULT_PROMISCUOUS_MODE FALSE
+#define PARM_DEFAULT_PROMISCUOUS_MODE_STR "N"
+
+#define PARM_REJECT_ANY RejectANY
+#define PARM_NAME_REJECT_ANY TEXT("RejectANY")
+#define PARM_DEFAULT_REJECT_ANY FALSE
+#define PARM_DEFAULT_REJECT_ANY_STR "N"
+
+#define PARM_RTS_THRESHOLD RTSThreshold
+#define PARM_NAME_RTS_THRESHOLD TEXT("RTSThreshold")
+#define PARM_MIN_RTS_THRESHOLD 0
+#define PARM_MAX_RTS_THRESHOLD 2347
+#define PARM_DEFAULT_RTS_THRESHOLD 2347
+
+#define PARM_RTS_THRESHOLD1 RTSThreshold1
+#define PARM_NAME_RTS_THRESHOLD1 TEXT("RTSThreshold1")
+#define PARM_RTS_THRESHOLD2 RTSThreshold2
+#define PARM_NAME_RTS_THRESHOLD2 TEXT("RTSThreshold2")
+#define PARM_RTS_THRESHOLD3 RTSThreshold3
+#define PARM_NAME_RTS_THRESHOLD3 TEXT("RTSThreshold3")
+#define PARM_RTS_THRESHOLD4 RTSThreshold4
+#define PARM_NAME_RTS_THRESHOLD4 TEXT("RTSThreshold4")
+#define PARM_RTS_THRESHOLD5 RTSThreshold5
+#define PARM_NAME_RTS_THRESHOLD5 TEXT("RTSThreshold5")
+#define PARM_RTS_THRESHOLD6 RTSThreshold6
+#define PARM_NAME_RTS_THRESHOLD6 TEXT("RTSThreshold6")
+
+#define PARM_SRSC_2GHZ SRSC2GHz
+#define PARM_NAME_SRSC_2GHZ TEXT("SRSC2GHz")
+#define PARM_MIN_SRSC 0x0000
+#define PARM_MAX_SRSC 0x0FFF
+#define PARM_DEFAULT_SRSC_2GHZ 0x0FFF
+
+#define PARM_SRSC_5GHZ SRSC5GHz
+#define PARM_NAME_SRSC_5GHZ TEXT("SRSC5GHz")
+#define PARM_DEFAULT_SRSC_5GHZ 0x0FF0
+
+#define PARM_SYSTEM_SCALE SystemScale
+#define PARM_NAME_SYSTEM_SCALE TEXT("SystemScale")
+#define PARM_MIN_SYSTEM_SCALE 1
+#define PARM_MAX_SYSTEM_SCALE 5
+#define PARM_DEFAULT_SYSTEM_SCALE 1
+
+#define PARM_TX_KEY TxKey
+#define PARM_NAME_TX_KEY TEXT("TxKey")
+#define PARM_MIN_TX_KEY 1
+#define PARM_MAX_TX_KEY 4
+#define PARM_DEFAULT_TX_KEY 1
+
+#define PARM_TX_POW_LEVEL TxPowLevel
+#define PARM_NAME_TX_POW_LEVEL TEXT("TxPowLevel")
+#define PARM_MIN_TX_POW_LEVEL 1 // 20 dBm
+#define PARM_MAX_TX_POW_LEVEL 6 // 8 dBm
+#define PARM_DEFAULT_TX_POW_LEVEL 3 // 15 dBm
+
+#define PARM_TX_RATE TxRateControl
+#define PARM_NAME_TX_RATE TEXT("TxRateControl")
+#define PARM_MIN_TX_RATE 0x0001
+#ifdef WARP
+#define PARM_MAX_TX_RATE 0x0FFF
+#define PARM_DEFAULT_TX_RATE_2GHZ 0x0FFF
+#define PARM_DEFAULT_TX_RATE_5GHZ 0x0FF0
+#else
+#define PARM_MAX_TX_RATE 0x0007
+#define PARM_DEFAULT_TX_RATE_2GHZ 0x0003
+#define PARM_DEFAULT_TX_RATE_5GHZ 0x0000
+#endif // WARP
+
+#define PARM_TX_RATE1 TxRateControl1
+#define PARM_NAME_TX_RATE1 TEXT("TxRateControl1")
+#define PARM_TX_RATE2 TxRateControl2
+#define PARM_NAME_TX_RATE2 TEXT("TxRateControl2")
+#define PARM_TX_RATE3 TxRateControl3
+#define PARM_NAME_TX_RATE3 TEXT("TxRateControl3")
+#define PARM_TX_RATE4 TxRateControl4
+#define PARM_NAME_TX_RATE4 TEXT("TxRateControl4")
+#define PARM_TX_RATE5 TxRateControl5
+#define PARM_NAME_TX_RATE5 TEXT("TxRateControl5")
+#define PARM_TX_RATE6 TxRateControl6
+#define PARM_NAME_TX_RATE6 TEXT("TxRateControl6")
+
+#define PARM_VENDORDESCRIPTION VendorDescription
+#define PARM_NAME_VENDORDESCRIPTION TEXT("VendorDescription")
+
+#define PARM_WDS_ADDRESS WDSAddress
+#define PARM_NAME_WDS_ADDRESS TEXT("WDSAddress")
+
+#define PARM_WDS_ADDRESS1 WDSAddress1
+#define PARM_NAME_WDS_ADDRESS1 TEXT("WDSAddress1")
+#define PARM_WDS_ADDRESS2 WDSAddress2
+#define PARM_NAME_WDS_ADDRESS2 TEXT("WDSAddress2")
+#define PARM_WDS_ADDRESS3 WDSAddress3
+#define PARM_NAME_WDS_ADDRESS3 TEXT("WDSAddress3")
+#define PARM_WDS_ADDRESS4 WDSAddress4
+#define PARM_NAME_WDS_ADDRESS4 TEXT("WDSAddress4")
+#define PARM_WDS_ADDRESS5 WDSAddress5
+#define PARM_NAME_WDS_ADDRESS5 TEXT("WDSAddress5")
+#define PARM_WDS_ADDRESS6 WDSAddress6
+#define PARM_NAME_WDS_ADDRESS6 TEXT("WDSAddress6")
+
+/*
+#define PARM_LONG_RETRY_LIMIT LongRetryLimit
+#define PARM_NAME_LONG_RETRY_LIMIT TEXT("LongRetryLimit")
+#define PARM_MIN_LONG_RETRY_LIMIT 1
+#define PARM_MAX_LONG_RETRY_LIMIT 15
+#define PARM_DEFAULT_LONG_RETRY_LIMIT 3
+
+
+#define PARM_PROBE_DATA_RATES ProbeDataRates
+#define PARM_NAME_PROBE_DATA_RATES TEXT("ProbeDataRates")
+#define PARM_MIN_PROBE_DATA_RATES 0x0000
+#define PARM_MAX_PROBE_DATA_RATES 0x0FFF
+#define PARM_DEFAULT_PROBE_DATA_RATES_2GHZ 0x0002
+#define PARM_DEFAULT_PROBE_DATA_RATES_5GHZ 0x0010
+
+#define PARM_SHORT_RETRY_LIMIT ShortRetryLimit
+#define PARM_NAME_SHORT_RETRY_LIMIT TEXT("ShortRetryLimit")
+#define PARM_MIN_SHORT_RETRY_LIMIT 1
+#define PARM_MAX_SHORT_RETRY_LIMIT 15
+#define PARM_DEFAULT_SHORT_RETRY_LIMIT 7
+
+
+*/
+
+/*******************************************************************************
+ * state definitions
+ ******************************************************************************/
+/* The following constants are used to track state the device */
+#define WL_FRIMWARE_PRESENT 1 // Download if needed
+#define WL_FRIMWARE_NOT_PRESENT 0 // Skip over download, assume its already there
+#define WL_HANDLING_INT 1 // Actually call the HCF to switch interrupts on/off
+#define WL_NOT_HANDLING_INT 0 // Not yet handling interrupts, do not switch on/off
+
+/*******************************************************************************
+ * macro definitions
+ ******************************************************************************/
+/* The following macro ensures that no symbols are exported, minimizing the
+ chance of a symbol collision in the kernel */
+// EXPORT_NO_SYMBOLS;
+
+#define NELEM(arr) (sizeof(arr) / sizeof(arr[0]))
+
+#define WVLAN_VALID_MAC_ADDRESS( x ) \
+((x[0]!=0xFF) && (x[1]!=0xFF) && (x[2]!=0xFF) && (x[3]!=0xFF) && (x[4]!=0xFF) && (x[5]!=0xFF))
+
+
+
+
+/*******************************************************************************
+ * type definitions
+ ******************************************************************************/
+#undef FALSE
+#undef TRUE
+
+typedef enum
+{
+ FALSE = 0,
+ TRUE = 1
+}
+bool_t;
+
+
+typedef struct _ScanResult
+{
+ //hcf_16 len;
+ //hcf_16 typ;
+ int scan_complete;
+ int num_aps;
+ SCAN_RS_STRCT APTable [MAX_NAPS];
+}
+ScanResult;
+
+
+typedef struct _LINK_STATUS_STRCT
+{
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_16 linkStatus; /* 1..5 */
+}
+LINK_STATUS_STRCT;
+
+
+typedef struct _ASSOC_STATUS_STRCT
+{
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_16 assocStatus; /* 1..3 */
+ hcf_8 staAddr[ETH_ALEN];
+ hcf_8 oldApAddr[ETH_ALEN];
+}
+ASSOC_STATUS_STRCT;
+
+
+typedef struct _SECURITY_STATUS_STRCT
+{
+ hcf_16 len;
+ hcf_16 typ;
+ hcf_16 securityStatus; /* 1..3 */
+ hcf_8 staAddr[ETH_ALEN];
+ hcf_16 reason;
+}
+SECURITY_STATUS_STRCT;
+
+#define WVLAN_WMP_PDU_TYPE_LT_REQ 0x00
+#define WVLAN_WMP_PDU_TYPE_LT_RSP 0x01
+#define WVLAN_WMP_PDU_TYPE_APL_REQ 0x02
+#define WVLAN_WMP_PDU_TYPE_APL_RSP 0x03
+
+typedef struct wvlan_eth_hdr
+{
+ unsigned char dst[ETH_ALEN]; /* Destination address. */
+ unsigned char src[ETH_ALEN]; /* Source address. */
+ unsigned short len; /* Length of the PDU. */
+}
+WVLAN_ETH_HDR, *PWVLAN_ETH_HDR;
+
+typedef struct wvlan_llc_snap
+{
+ unsigned char dsap; /* DSAP (0xAA) */
+ unsigned char ssap; /* SSAP (0xAA) */
+ unsigned char ctrl; /* Control (0x03) */
+ unsigned char oui[3]; /* Organization Unique ID (00-60-1d). */
+ unsigned char specid[2]; /* Specific ID code (00-01). */
+}
+WVLAN_LLC_SNAP, *PWVLAN_LLC_SNAP;
+
+
+typedef struct wvlan_lt_hdr
+{
+ unsigned char version; /* Version (0x00) */
+ unsigned char type; /* PDU type: 0-req/1-resp. */
+ unsigned short id; /* Identifier to associate resp to req. */
+}
+WVLAN_LT_HDR, *PWVLAN_LT_HDR;
+
+
+typedef struct wvlan_wmp_hdr
+{
+ unsigned char version; /* Version */
+ unsigned char type; /* PDU type */
+}
+WVLAN_WMP_HDR, *PWVLAN_WMP_HDR;
+
+
+#define FILLER_SIZE 1554
+#define TEST_PATTERN_SIZE 54
+
+
+typedef struct wvlan_lt_req
+{
+ unsigned char Filler[TEST_PATTERN_SIZE]; /* minimal length of 54 bytes */
+}
+WVLAN_LT_REQ, *PWVLAN_LT_REQ;
+
+
+typedef struct wvlan_lt_rsp
+{
+ char name[32];
+ /* Measured Data */
+ unsigned char signal;
+ unsigned char noise;
+ unsigned char rxFlow;
+ unsigned char dataRate;
+ unsigned short protocol;
+ /* Capabilities */
+ unsigned char station;
+ unsigned char dataRateCap;
+ unsigned char powerMgmt[4];
+ unsigned char robustness[4];
+ unsigned char scaling;
+ unsigned char reserved[5];
+}
+WVLAN_LT_RSP, *PWVLAN_LT_RSP;
+
+
+typedef struct wvlan_rx_wmp_hdr
+{
+ unsigned short status;
+ unsigned short reserved1[2];
+ unsigned char silence;
+ unsigned char signal;
+ unsigned char rate;
+ unsigned char rxFlow;
+ unsigned short reserved2[2];
+ unsigned short frameControl;
+ unsigned short duration;
+ unsigned short address1[3];
+ unsigned short address2[3];
+ unsigned short address3[3];
+ unsigned short sequenceControl;
+ unsigned short address4[3];
+#ifndef HERMES25 //;?just to be on the safe side of inherited but not comprehended code #ifdef HERMES2
+ unsigned short seems_to_be_unused_reserved3[5]; //;?
+ unsigned short seems_to_be_unused_reserved4; //;?
+#endif // HERMES25
+ unsigned short HeaderDataLen;
+}
+WVLAN_RX_WMP_HDR, *PWVLAN_RX_WMP_HDR;
+
+
+typedef struct wvlan_linktest_req_pdu
+{
+ WVLAN_ETH_HDR ethHdr;
+ WVLAN_LLC_SNAP llcSnap;
+ WVLAN_LT_HDR ltHdr;
+ WVLAN_LT_REQ ltReq;
+}
+WVLAN_LINKTEST_REQ_PDU, *PWVLAN_LINKTEST_REQ_PDU;
+
+
+typedef struct wvlan_linktest_rsp_pdu
+{
+ WVLAN_RX_WMP_HDR wmpRxHdr;
+ WVLAN_ETH_HDR ethHdr;
+ WVLAN_LLC_SNAP llcSnap;
+ WVLAN_LT_HDR ltHdr;
+ WVLAN_LT_RSP ltRsp;
+}
+WVLAN_LINKTEST_RSP_PDU, *PWVLAN_LINKTEST_RSP_PDU;
+
+
+typedef struct _LINKTEST_RSP_STRCT
+{
+ hcf_16 len;
+ hcf_16 typ;
+ WVLAN_LINKTEST_RSP_PDU ltRsp;
+}
+LINKTEST_RSP_STRCT;
+
+
+typedef struct wvlan_wmp_rsp_pdu
+{
+ WVLAN_RX_WMP_HDR wmpRxHdr;
+ WVLAN_ETH_HDR ethHdr;
+ WVLAN_LLC_SNAP llcSnap;
+ WVLAN_WMP_HDR wmpHdr;
+}
+WVLAN_WMP_RSP_PDU, *PWVLAN_WMP_RSP_PDU;
+
+
+typedef struct _WMP_RSP_STRCT
+{
+ hcf_16 len;
+ hcf_16 typ;
+ WVLAN_WMP_RSP_PDU wmpRsp;
+}
+WMP_RSP_STRCT;
+
+
+typedef struct _PROBE_RESP
+{
+ // first part: 802.11
+ hcf_16 length;
+ hcf_16 infoType;
+ hcf_16 reserved0;
+ //hcf_8 signal;
+ hcf_8 silence;
+ hcf_8 signal; // Moved signal here as signal/noise values were flipped
+ hcf_8 rxFlow;
+ hcf_8 rate;
+ hcf_16 reserved1[2];
+
+ // second part:
+ hcf_16 frameControl;
+ hcf_16 durID;
+ hcf_8 address1[6];
+ hcf_8 address2[6];
+ hcf_8 BSSID[6]; //! this is correct, right ?
+ hcf_16 sequence;
+ hcf_8 address4[6];
+
+#ifndef WARP
+ hcf_8 reserved2[12];
+#endif // WARP
+
+ hcf_16 dataLength;
+ // the information in the next 3 fields (DA/SA/LenType) is actually not filled in.
+ hcf_8 DA[6];
+ hcf_8 SA[6];
+
+#ifdef WARP
+ hcf_8 channel;
+ hcf_8 band;
+#else
+ hcf_16 lenType;
+#endif // WARP
+
+ hcf_8 timeStamp[8];
+ hcf_16 beaconInterval;
+ hcf_16 capability;
+ hcf_8 rawData[200]; //! <<< think about this number !
+ hcf_16 flags;
+}
+PROBE_RESP, *PPROBE_RESP;
+
+
+typedef struct _ProbeResult
+{
+ int scan_complete;
+ int num_aps;
+ PROBE_RESP ProbeTable[MAX_NAPS];
+}
+ProbeResult;
+
+/* Definitions used to parse capabilities out of the probe responses */
+#define CAPABILITY_ESS 0x0001
+#define CAPABILITY_IBSS 0x0002
+#define CAPABILITY_PRIVACY 0x0010
+
+/* Definitions used to parse the Information Elements out of probe responses */
+#define DS_INFO_ELEM 0x03
+#define GENERIC_INFO_ELEM 0xdd
+#define WPA_MAX_IE_LEN 40
+#define WPA_SELECTOR_LEN 4
+#define WPA_OUI_TYPE { 0x00, 0x50, 0xf2, 1 }
+#define WPA_VERSION 1
+#define WPA_AUTH_KEY_MGMT_UNSPEC_802_1X { 0x00, 0x50, 0xf2, 1 }
+#define WPA_AUTH_KEY_MGMT_PSK_OVER_802_1X { 0x00, 0x50, 0xf2, 2 }
+#define WPA_CIPHER_SUITE_NONE { 0x00, 0x50, 0xf2, 0 }
+#define WPA_CIPHER_SUITE_WEP40 { 0x00, 0x50, 0xf2, 1 }
+#define WPA_CIPHER_SUITE_TKIP { 0x00, 0x50, 0xf2, 2 }
+#define WPA_CIPHER_SUITE_WRAP { 0x00, 0x50, 0xf2, 3 }
+#define WPA_CIPHER_SUITE_CCMP { 0x00, 0x50, 0xf2, 4 }
+#define WPA_CIPHER_SUITE_WEP104 { 0x00, 0x50, 0xf2, 5 }
+
+typedef enum wvlan_drv_mode
+{
+ WVLAN_DRV_MODE_NO_DOWNLOAD, /* this is the same as STA for Hermes 1 */
+ /* it is also only applicable for Hermes 1 */
+ WVLAN_DRV_MODE_STA,
+ WVLAN_DRV_MODE_AP,
+ WVLAN_DRV_MODE_MAX
+}
+WVLAN_DRV_MODE, *PWVLAN_DRV_MODE;
+
+
+typedef enum wvlan_port_state
+{
+ WVLAN_PORT_STATE_ENABLED,
+ WVLAN_PORT_STATE_DISABLED,
+ WVLAN_PORT_STATE_CONNECTED
+}
+WVLAN_PORT_STATE, *PWVLAN_PORT_STATE;
+
+/*
+typedef enum wvlan_connect_state
+{
+ WVLAN_CONNECT_STATE_CONNECTED,
+ WVLAN_CONNECT_STATE_DISCONNECTED
+}
+WVLAN_CONNECT_STATE, *PWVLAN_CONNECT_STATE;
+*/
+
+typedef enum wvlan_pm_state
+{
+ WVLAN_PM_STATE_DISABLED,
+ WVLAN_PM_STATE_ENHANCED,
+ WVLAN_PM_STATE_STANDARD
+}
+WVLAN_PM_STATE, *PWVLAN_PM_STATE;
+
+
+typedef struct wvlan_frame
+{
+ struct sk_buff *skb; /* sk_buff for frame. */
+ hcf_16 port; /* MAC port for the frame. */
+ hcf_16 len; /* Length of the frame. */
+}
+WVLAN_FRAME, *PWVLAN_FRAME;
+
+
+typedef struct wvlan_lframe
+{
+ struct list_head node; /* Node in the list */
+ WVLAN_FRAME frame; /* Frame. */
+}
+WVLAN_LFRAME, *PWVLAN_LFRAME;
+
+
+
+#define DEFAULT_NUM_TX_FRAMES 48
+#define TX_Q_LOW_WATER_MARK (DEFAULT_NUM_TX_FRAMES/3)
+
+#define WVLAN_MAX_TX_QUEUES 1
+
+
+#ifdef USE_WDS
+
+typedef struct wvlan_wds_if
+{
+ struct net_device *dev;
+ int is_registered;
+ int netif_queue_on;
+ struct net_device_stats stats;
+ hcf_16 rtsThreshold;
+ hcf_16 txRateCntl;
+ hcf_8 wdsAddress[ETH_ALEN];
+} WVLAN_WDS_IF, *PWVLAN_WDS_IF;
+
+#endif // USE_WDS
+
+
+
+#define NUM_RX_DESC 5
+#define NUM_TX_DESC 5
+
+typedef struct dma_strct
+{
+ DESC_STRCT *tx_packet[NUM_TX_DESC];
+ DESC_STRCT *rx_packet[NUM_RX_DESC];
+ DESC_STRCT *rx_reclaim_desc, *tx_reclaim_desc; // Descriptors for host-reclaim purposes (see HCF)
+ int tx_rsc_ind; // DMA Tx resource indicator is maintained in the MSF, not in the HCF
+ int rx_rsc_ind; // Also added rx rsource indicator so that cleanup can be performed if alloc fails
+ int status;
+} DMA_STRCT;
+
+
+/* Macros used in DMA support */
+/* get bus address of {rx,tx}dma structure member, in little-endian byte order */
+#define WL_DMA_BUS_ADDR_LE(str, i, mem) \
+ cpu_to_le32(str##_dma_addr[(i)] + ((hcf_8 *)&str[(i)]->mem - (hcf_8 *)str[(i)]))
+
+
+struct wl_private
+{
+
+#ifdef BUS_PCMCIA
+ dev_node_t node;
+ struct pcmcia_device *link;
+#endif // BUS_PCMCIA
+
+
+ struct net_device *dev;
+// struct net_device *dev_next;
+ spinlock_t slock;
+ struct tasklet_struct task;
+ struct net_device_stats stats;
+
+
+#ifdef WIRELESS_EXT
+ struct iw_statistics wstats;
+// int spy_number;
+// u_char spy_address[IW_MAX_SPY][ETH_ALEN];
+// struct iw_quality spy_stat[IW_MAX_SPY];
+ struct iw_spy_data spy_data;
+ struct iw_public_data wireless_data;
+#endif // WIRELESS_EXT
+
+
+ IFB_STRCT hcfCtx;
+//;? struct timer_list timer_oor;
+//;? hcf_16 timer_oor_cnt;
+ u_long wlags49_type; //controls output in /proc/wlags49
+ u_long flags;
+ hcf_16 DebugFlag;
+ int is_registered;
+ int is_handling_int;
+ int firmware_present;
+ char sysfsCreated;
+ CFG_DRV_INFO_STRCT driverInfo;
+ CFG_IDENTITY_STRCT driverIdentity;
+ CFG_FW_IDENTITY_STRCT StationIdentity;
+ CFG_PRI_IDENTITY_STRCT PrimaryIdentity;
+ CFG_PRI_IDENTITY_STRCT NICIdentity;
+
+ ltv_t ltvRecord;
+ u_long txBytes;
+ hcf_16 maxPort; /* 0 for STA, 6 for AP */
+
+ /* Elements used for async notification from hardware */
+ RID_LOG_STRCT RidList[10];
+ ltv_t updatedRecord;
+ PROBE_RESP ProbeResp;
+ ASSOC_STATUS_STRCT assoc_stat;
+ SECURITY_STATUS_STRCT sec_stat;
+
+ u_char lookAheadBuf[WVLAN_MAX_LOOKAHEAD];
+
+ hcf_8 PortType; // 1 - 3 (1 [Normal] | 3 [AdHoc])
+ hcf_16 Channel; // 0 - 14 (0)
+ hcf_16 TxRateControl[2];
+ hcf_8 DistanceBetweenAPs; // 1 - 3 (1)
+ hcf_16 RTSThreshold; // 0 - 2347 (2347)
+ hcf_16 PMEnabled; // 0 - 2, 8001 - 8002 (0)
+ hcf_8 MicrowaveRobustness;// 0 - 1 (0)
+ hcf_8 CreateIBSS; // 0 - 1 (0)
+ hcf_8 MulticastReceive; // 0 - 1 (1)
+ hcf_16 MaxSleepDuration; // 0 - 65535 (100)
+ hcf_8 MACAddress[ETH_ALEN];
+ char NetworkName[HCF_MAX_NAME_LEN+1];
+ char StationName[HCF_MAX_NAME_LEN+1];
+ hcf_8 EnableEncryption; // 0 - 1 (0)
+ char Key1[MAX_KEY_LEN+1];
+ char Key2[MAX_KEY_LEN+1];
+ char Key3[MAX_KEY_LEN+1];
+ char Key4[MAX_KEY_LEN+1];
+ hcf_8 TransmitKeyID; // 1 - 4 (1)
+ CFG_DEFAULT_KEYS_STRCT DefaultKeys;
+ u_char mailbox[MB_SIZE];
+ char szEncryption[MAX_ENC_LEN];
+
+ hcf_16 driverEnable;
+ hcf_16 wolasEnable;
+ hcf_16 atimWindow;
+ hcf_16 holdoverDuration;
+ hcf_16 MulticastRate[2];
+
+ hcf_16 authentication; // is this AP specific?
+ hcf_16 promiscuousMode;
+ WVLAN_DRV_MODE DownloadFirmware; // 0 - 2 (0 [None] | 1 [STA] | 2 [AP])
+
+ char fw_image_filename[MAX_LINE_SIZE+1];
+
+ hcf_16 AuthKeyMgmtSuite;
+
+ hcf_16 loadBalancing;
+ hcf_16 mediumDistribution;
+ hcf_16 txPowLevel;
+ //hcf_16 shortRetryLimit;
+ //hcf_16 longRetryLimit;
+ hcf_16 srsc[2];
+ hcf_16 brsc[2];
+ hcf_16 connectionControl;
+ //hcf_16 probeDataRates[2];
+ hcf_16 ownBeaconInterval;
+ hcf_16 coexistence;
+
+ WVLAN_FRAME txF;
+ WVLAN_LFRAME txList[DEFAULT_NUM_TX_FRAMES];
+ struct list_head txFree;
+ struct list_head txQ[WVLAN_MAX_TX_QUEUES];
+ int netif_queue_on;
+ int txQ_count;
+ DESC_STRCT desc_rx;
+ DESC_STRCT desc_tx;
+
+ WVLAN_PORT_STATE portState;
+
+ ScanResult scan_results;
+ ProbeResult probe_results;
+ int probe_num_aps;
+
+ int use_dma;
+ DMA_STRCT dma;
+#ifdef USE_RTS
+ int useRTS;
+#endif // USE_RTS
+ hcf_8 DTIMPeriod; // 1 - 255 (1)
+ hcf_16 multicastPMBuffering;
+ hcf_8 RejectAny; // 0 - 1 (0)
+ hcf_8 ExcludeUnencrypted; // 0 - 1 (1)
+ hcf_16 intraBSSRelay;
+#ifdef USE_WDS
+ WVLAN_WDS_IF wds_port[NUM_WDS_PORTS];
+#endif // USE_WDS
+}; // wl_private
+
+#ifdef HAVE_NETDEV_PRIV
+#define wl_priv(dev) ((struct wl_private *) netdev_priv(dev))
+#else
+extern inline struct wl_private *wl_priv(struct net_device *dev)
+{
+ return dev->priv;
+}
+#endif
+
+/********************************************************************/
+/* Locking and synchronization functions */
+/********************************************************************/
+
+/* These functions *must* be inline or they will break horribly on
+ * SPARC, due to its weird semantics for save/restore flags. extern
+ * inline should prevent the kernel from linking or module from
+ * loading if they are not inlined. */
+extern inline void wl_lock(struct wl_private *lp,
+ unsigned long *flags)
+{
+ spin_lock_irqsave(&lp->slock, *flags);
+}
+
+extern inline void wl_unlock(struct wl_private *lp,
+ unsigned long *flags)
+{
+ spin_unlock_irqrestore(&lp->slock, *flags);
+}
+
+/********************************************************************/
+/* Interrupt enable disable functions */
+/********************************************************************/
+
+extern inline void wl_act_int_on(struct wl_private *lp)
+{
+ /*
+ * Only do something when the driver is handling
+ * interrupts. Handling starts at wl_open and
+ * ends at wl_close when not in RTS mode
+ */
+ if(lp->is_handling_int == WL_HANDLING_INT) {
+ hcf_action( &lp->hcfCtx, HCF_ACT_INT_ON );
+ }
+}
+
+extern inline void wl_act_int_off(struct wl_private *lp)
+{
+ /*
+ * Only do something when the driver is handling
+ * interrupts. Handling starts at wl_open and
+ * ends at wl_close when not in RTS mode
+ */
+ if(lp->is_handling_int == WL_HANDLING_INT) {
+ hcf_action( &lp->hcfCtx, HCF_ACT_INT_OFF );
+ }
+}
+
+#endif // __WAVELAN2_H__
diff --git a/drivers/staging/wlags49_h2/wl_main.c b/drivers/staging/wlags49_h2/wl_main.c
new file mode 100644
index 000000000000..69571938a676
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_main.c
@@ -0,0 +1,3878 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains the main driver entry points and other adapter
+ * specific routines.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/06 11:25:37 $
+ * $Revision: 1.14 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_main.c,v $
+ *
+ ******************************************************************************/
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+
+/* Allow support for calling system fcns to access F/W iamge file */
+#define __KERNEL_SYSCALLS__
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+// #include <linux/sched.h>
+// #include <linux/ptrace.h>
+// #include <linux/slab.h>
+// #include <linux/ctype.h>
+// #include <linux/string.h>
+// #include <linux/timer.h>
+//#include <linux/interrupt.h>
+// #include <linux/tqueue.h>
+// #include <linux/in.h>
+// #include <linux/delay.h>
+// #include <asm/io.h>
+// #include <asm/system.h>
+// #include <asm/bitops.h>
+#include <linux/unistd.h>
+#include <asm/uaccess.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+// #include <linux/skbuff.h>
+// #include <linux/if_arp.h>
+// #include <linux/ioport.h>
+
+#define BIN_DL 0
+#if BIN_DL
+#include <linux/vmalloc.h>
+#endif // BIN_DL
+
+
+#include <debug.h>
+
+#include <hcf.h>
+#include <dhf.h>
+//in order to get around:: wl_main.c:2229: `HREG_EV_RDMAD' undeclared (first use in this function)
+#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_main.h>
+#include <wl_netdev.h>
+#include <wl_wext.h>
+
+#ifdef USE_PROFILE
+#include <wl_profile.h>
+#endif /* USE_PROFILE */
+
+#ifdef BUS_PCMCIA
+#include <wl_cs.h>
+#endif /* BUS_PCMCIA */
+
+#ifdef BUS_PCI
+#include <wl_pci.h>
+#endif /* BUS_PCI */
+/*******************************************************************************
+ * macro defintions
+ ******************************************************************************/
+#define VALID_PARAM(C) \
+ { \
+ if (!(C)) \
+ { \
+ printk(KERN_INFO "Wireless, parameter error: \"%s\"\n", #C); \
+ goto failed; \
+ } \
+ }
+/*******************************************************************************
+ * local functions
+ ******************************************************************************/
+void wl_isr_handler( unsigned long p );
+
+#if 0 //SCULL_USE_PROC /* don't waste space if unused */
+//int scull_read_procmem(char *buf, char **start, off_t offset, int len, int unused);
+int scull_read_procmem(char *buf, char **start, off_t offset, int len, int *eof, void *data );
+static int write_int(struct file *file, const char *buffer, unsigned long count, void *data);
+static void proc_write(const char *name, write_proc_t *w, void *data);
+
+#endif /* SCULL_USE_PROC */
+
+/*******************************************************************************
+ * module parameter definitions - set with 'insmod'
+ ******************************************************************************/
+static p_u16 irq_mask = 0xdeb8; // IRQ3,4,5,7,9,10,11,12,14,15
+static p_s8 irq_list[4] = { -1 };
+
+#if 0
+MODULE_PARM(irq_mask, "h");
+MODULE_PARM_DESC(irq_mask, "IRQ mask [0xdeb8]");
+MODULE_PARM(irq_list, "1-4b");
+MODULE_PARM_DESC(irq_list, "IRQ list [<irq_mask>]");
+#endif
+
+static p_u8 PARM_AUTHENTICATION = PARM_DEFAULT_AUTHENTICATION;
+static p_u16 PARM_AUTH_KEY_MGMT_SUITE = PARM_DEFAULT_AUTH_KEY_MGMT_SUITE;
+static p_u16 PARM_BRSC_2GHZ = PARM_DEFAULT_BRSC_2GHZ;
+static p_u16 PARM_BRSC_5GHZ = PARM_DEFAULT_BRSC_5GHZ;
+static p_u16 PARM_COEXISTENCE = PARM_DEFAULT_COEXISTENCE;
+static p_u16 PARM_CONNECTION_CONTROL = PARM_DEFAULT_CONNECTION_CONTROL; //;?rename and move
+static p_char *PARM_CREATE_IBSS = PARM_DEFAULT_CREATE_IBSS_STR;
+static p_char *PARM_DESIRED_SSID = PARM_DEFAULT_SSID;
+static p_char *PARM_DOWNLOAD_FIRMWARE = "";
+static p_u16 PARM_ENABLE_ENCRYPTION = PARM_DEFAULT_ENABLE_ENCRYPTION;
+static p_char *PARM_EXCLUDE_UNENCRYPTED = PARM_DEFAULT_EXCLUDE_UNENCRYPTED_STR;
+static p_char *PARM_INTRA_BSS_RELAY = PARM_DEFAULT_INTRA_BSS_RELAY_STR;
+static p_char *PARM_KEY1 = "";
+static p_char *PARM_KEY2 = "";
+static p_char *PARM_KEY3 = "";
+static p_char *PARM_KEY4 = "";
+static p_char *PARM_LOAD_BALANCING = PARM_DEFAULT_LOAD_BALANCING_STR;
+static p_u16 PARM_MAX_SLEEP = PARM_DEFAULT_MAX_PM_SLEEP;
+static p_char *PARM_MEDIUM_DISTRIBUTION = PARM_DEFAULT_MEDIUM_DISTRIBUTION_STR;
+static p_char *PARM_MICROWAVE_ROBUSTNESS = PARM_DEFAULT_MICROWAVE_ROBUSTNESS_STR;
+static p_char *PARM_MULTICAST_PM_BUFFERING = PARM_DEFAULT_MULTICAST_PM_BUFFERING_STR;
+static p_u16 PARM_MULTICAST_RATE = PARM_DEFAULT_MULTICAST_RATE_2GHZ;
+static p_char *PARM_MULTICAST_RX = PARM_DEFAULT_MULTICAST_RX_STR;
+static p_u8 PARM_NETWORK_ADDR[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u16 PARM_OWN_ATIM_WINDOW = PARM_DEFAULT_OWN_ATIM_WINDOW;
+static p_u16 PARM_OWN_BEACON_INTERVAL = PARM_DEFAULT_OWN_BEACON_INTERVAL;
+static p_u8 PARM_OWN_CHANNEL = PARM_DEFAULT_OWN_CHANNEL;
+static p_u8 PARM_OWN_DTIM_PERIOD = PARM_DEFAULT_OWN_DTIM_PERIOD;
+static p_char *PARM_OWN_NAME = PARM_DEFAULT_OWN_NAME;
+static p_char *PARM_OWN_SSID = PARM_DEFAULT_SSID;
+static p_u16 PARM_PM_ENABLED = WVLAN_PM_STATE_DISABLED;
+static p_u16 PARM_PM_HOLDOVER_DURATION = PARM_DEFAULT_PM_HOLDOVER_DURATION;
+static p_u8 PARM_PORT_TYPE = PARM_DEFAULT_PORT_TYPE;
+static p_char *PARM_PROMISCUOUS_MODE = PARM_DEFAULT_PROMISCUOUS_MODE_STR;
+static p_char *PARM_REJECT_ANY = PARM_DEFAULT_REJECT_ANY_STR;
+#ifdef USE_WDS
+static p_u16 PARM_RTS_THRESHOLD1 = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_RTS_THRESHOLD2 = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_RTS_THRESHOLD3 = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_RTS_THRESHOLD4 = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_RTS_THRESHOLD5 = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_RTS_THRESHOLD6 = PARM_DEFAULT_RTS_THRESHOLD;
+#endif // USE_WDS
+static p_u16 PARM_RTS_THRESHOLD = PARM_DEFAULT_RTS_THRESHOLD;
+static p_u16 PARM_SRSC_2GHZ = PARM_DEFAULT_SRSC_2GHZ;
+static p_u16 PARM_SRSC_5GHZ = PARM_DEFAULT_SRSC_5GHZ;
+static p_u8 PARM_SYSTEM_SCALE = PARM_DEFAULT_SYSTEM_SCALE;
+static p_u8 PARM_TX_KEY = PARM_DEFAULT_TX_KEY;
+static p_u16 PARM_TX_POW_LEVEL = PARM_DEFAULT_TX_POW_LEVEL;
+#ifdef USE_WDS
+static p_u16 PARM_TX_RATE1 = PARM_DEFAULT_TX_RATE_2GHZ;
+static p_u16 PARM_TX_RATE2 = PARM_DEFAULT_TX_RATE_2GHZ;
+static p_u16 PARM_TX_RATE3 = PARM_DEFAULT_TX_RATE_2GHZ;
+static p_u16 PARM_TX_RATE4 = PARM_DEFAULT_TX_RATE_2GHZ;
+static p_u16 PARM_TX_RATE5 = PARM_DEFAULT_TX_RATE_2GHZ;
+static p_u16 PARM_TX_RATE6 = PARM_DEFAULT_TX_RATE_2GHZ;
+#endif // USE_WDS
+static p_u16 PARM_TX_RATE = PARM_DEFAULT_TX_RATE_2GHZ;
+#ifdef USE_WDS
+static p_u8 PARM_WDS_ADDRESS1[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u8 PARM_WDS_ADDRESS2[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u8 PARM_WDS_ADDRESS3[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u8 PARM_WDS_ADDRESS4[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u8 PARM_WDS_ADDRESS5[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+static p_u8 PARM_WDS_ADDRESS6[ETH_ALEN] = PARM_DEFAULT_NETWORK_ADDR;
+#endif // USE_WDS
+
+
+#if 0
+MODULE_PARM(PARM_DESIRED_SSID, "s");
+MODULE_PARM_DESC(PARM_DESIRED_SSID, "Network Name (<string>) [ANY]");
+MODULE_PARM(PARM_OWN_SSID, "s");
+MODULE_PARM_DESC(PARM_OWN_SSID, "Network Name (<string>) [ANY]");
+MODULE_PARM(PARM_OWN_CHANNEL, "b");
+MODULE_PARM_DESC(PARM_OWN_CHANNEL, "Channel (0 - 14) [0]");
+MODULE_PARM(PARM_SYSTEM_SCALE, "b");
+MODULE_PARM_DESC(PARM_SYSTEM_SCALE, "Distance Between APs (1 - 3) [1]");
+MODULE_PARM(PARM_TX_RATE, "b");
+MODULE_PARM_DESC(PARM_TX_RATE, "Transmit Rate Control");
+MODULE_PARM(PARM_RTS_THRESHOLD, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD, "Medium Reservation (RTS/CTS Fragment Length) (256 - 2347) [2347]");
+MODULE_PARM(PARM_MICROWAVE_ROBUSTNESS, "s");
+MODULE_PARM_DESC(PARM_MICROWAVE_ROBUSTNESS, "Microwave Oven Robustness Enabled (<string> N or Y) [N]");
+MODULE_PARM(PARM_OWN_NAME, "s");
+MODULE_PARM_DESC(PARM_OWN_NAME, "Station Name (<string>) [Linux]");
+
+MODULE_PARM(PARM_ENABLE_ENCRYPTION, "b");
+MODULE_PARM_DESC(PARM_ENABLE_ENCRYPTION, "Encryption Mode (0 - 7) [0]");
+
+MODULE_PARM(PARM_KEY1, "s");
+MODULE_PARM_DESC(PARM_KEY1, "Data Encryption Key 1 (<string>) []");
+MODULE_PARM(PARM_KEY2, "s");
+MODULE_PARM_DESC(PARM_KEY2, "Data Encryption Key 2 (<string>) []");
+MODULE_PARM(PARM_KEY3, "s");
+MODULE_PARM_DESC(PARM_KEY3, "Data Encryption Key 3 (<string>) []");
+MODULE_PARM(PARM_KEY4, "s");
+MODULE_PARM_DESC(PARM_KEY4, "Data Encryption Key 4 (<string>) []");
+MODULE_PARM(PARM_TX_KEY, "b");
+MODULE_PARM_DESC(PARM_TX_KEY, "Transmit Key ID (1 - 4) [1]");
+MODULE_PARM(PARM_MULTICAST_RATE, "b");
+MODULE_PARM_DESC(PARM_MULTICAST_RATE, "Multicast Rate");
+MODULE_PARM(PARM_DOWNLOAD_FIRMWARE, "s");
+MODULE_PARM_DESC(PARM_DOWNLOAD_FIRMWARE, "filename of firmware image");
+
+MODULE_PARM(PARM_AUTH_KEY_MGMT_SUITE, "b");
+MODULE_PARM_DESC(PARM_AUTH_KEY_MGMT_SUITE, "Authentication Key Management suite (0-4) [0]");
+
+MODULE_PARM(PARM_LOAD_BALANCING, "s");
+MODULE_PARM_DESC(PARM_LOAD_BALANCING, "Load Balancing Enabled (<string> N or Y) [Y]");
+MODULE_PARM(PARM_MEDIUM_DISTRIBUTION, "s");
+MODULE_PARM_DESC(PARM_MEDIUM_DISTRIBUTION, "Medium Distribution Enabled (<string> N or Y) [Y]");
+MODULE_PARM(PARM_TX_POW_LEVEL, "b");
+MODULE_PARM_DESC(PARM_TX_POW_LEVEL, "Transmit Power (0 - 6) [3]");
+MODULE_PARM(PARM_SRSC_2GHZ, "b");
+MODULE_PARM_DESC(PARM_SRSC_2GHZ, "Supported Rate Set Control 2.4 GHz");
+MODULE_PARM(PARM_SRSC_5GHZ, "b");
+MODULE_PARM_DESC(PARM_SRSC_5GHZ, "Supported Rate Set Control 5.0 GHz");
+MODULE_PARM(PARM_BRSC_2GHZ, "b");
+MODULE_PARM_DESC(PARM_BRSC_2GHZ, "Basic Rate Set Control 2.4 GHz");
+MODULE_PARM(PARM_BRSC_5GHZ, "b");
+MODULE_PARM_DESC(PARM_BRSC_5GHZ, "Basic Rate Set Control 5.0 GHz");
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+//;?seems reasonable that even an AP-only driver could afford this small additional footprint
+MODULE_PARM(PARM_PM_ENABLED, "h");
+MODULE_PARM_DESC(PARM_PM_ENABLED, "Power Management State (0 - 2, 8001 - 8002) [0]");
+MODULE_PARM(PARM_PORT_TYPE, "b");
+MODULE_PARM_DESC(PARM_PORT_TYPE, "Port Type (1 - 3) [1]");
+//;?MODULE_PARM(PARM_CREATE_IBSS, "s");
+//;?MODULE_PARM_DESC(PARM_CREATE_IBSS, "Create IBSS (<string> N or Y) [N]");
+//;?MODULE_PARM(PARM_MULTICAST_RX, "s");
+//;?MODULE_PARM_DESC(PARM_MULTICAST_RX, "Multicast Receive Enable (<string> N or Y) [Y]");
+//;?MODULE_PARM(PARM_MAX_SLEEP, "h");
+//;?MODULE_PARM_DESC(PARM_MAX_SLEEP, "Maximum Power Management Sleep Duration (0 - 65535) [100]");
+//;?MODULE_PARM(PARM_NETWORK_ADDR, "6b");
+//;?MODULE_PARM_DESC(PARM_NETWORK_ADDR, "Hardware Ethernet Address ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [<factory value>]");
+//;?MODULE_PARM(PARM_AUTHENTICATION, "b");
+//
+//tracker 12448
+//;?MODULE_PARM_DESC(PARM_AUTHENTICATION, "Authentication Type (0-2) [0] 0=Open 1=SharedKey 2=LEAP");
+//;?MODULE_PARM_DESC(authentication, "Authentication Type (1-2) [1] 1=Open 2=SharedKey");
+//tracker 12448
+//
+//;?MODULE_PARM(PARM_OWN_ATIM_WINDOW, "b");
+//;?MODULE_PARM_DESC(PARM_OWN_ATIM_WINDOW, "ATIM Window time in TU for IBSS creation (0-100) [0]");
+//;?MODULE_PARM(PARM_PM_HOLDOVER_DURATION, "b");
+//;?MODULE_PARM_DESC(PARM_PM_HOLDOVER_DURATION, "Time station remains awake after MAC frame transfer when PM is on (0-65535) [100]");
+//;?MODULE_PARM(PARM_PROMISCUOUS_MODE, "s");
+//;?MODULE_PARM_DESC(PARM_PROMISCUOUS_MODE, "Promiscuous Mode Enable (<string> Y or N ) [N]" );
+//;?
+MODULE_PARM(PARM_CONNECTION_CONTROL, "b");
+MODULE_PARM_DESC(PARM_CONNECTION_CONTROL, "Connection Control (0 - 3) [2]");
+#endif /* HCF_STA */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+MODULE_PARM(PARM_OWN_DTIM_PERIOD, "b");
+MODULE_PARM_DESC(PARM_OWN_DTIM_PERIOD, "DTIM Period (0 - 255) [1]");
+MODULE_PARM(PARM_REJECT_ANY, "s");
+MODULE_PARM_DESC(PARM_REJECT_ANY, "Closed System (<string> N or Y) [N]");
+MODULE_PARM(PARM_EXCLUDE_UNENCRYPTED, "s");
+MODULE_PARM_DESC(PARM_EXCLUDE_UNENCRYPTED, "Deny non-encrypted (<string> N or Y) [Y]");
+MODULE_PARM(PARM_MULTICAST_PM_BUFFERING,"s");
+MODULE_PARM_DESC(PARM_MULTICAST_PM_BUFFERING, "Buffer MAC frames for Tx after DTIM (<string> Y or N) [Y]");
+MODULE_PARM(PARM_INTRA_BSS_RELAY, "s");
+MODULE_PARM_DESC(PARM_INTRA_BSS_RELAY, "IntraBSS Relay (<string> N or Y) [Y]");
+MODULE_PARM(PARM_RTS_THRESHOLD1, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD1, "RTS Threshold, WDS Port 1 (256 - 2347) [2347]");
+MODULE_PARM(PARM_RTS_THRESHOLD2, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD2, "RTS Threshold, WDS Port 2 (256 - 2347) [2347]");
+MODULE_PARM(PARM_RTS_THRESHOLD3, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD3, "RTS Threshold, WDS Port 3 (256 - 2347) [2347]");
+MODULE_PARM(PARM_RTS_THRESHOLD4, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD4, "RTS Threshold, WDS Port 4 (256 - 2347) [2347]");
+MODULE_PARM(PARM_RTS_THRESHOLD5, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD5, "RTS Threshold, WDS Port 5 (256 - 2347) [2347]");
+MODULE_PARM(PARM_RTS_THRESHOLD6, "h");
+MODULE_PARM_DESC(PARM_RTS_THRESHOLD6, "RTS Threshold, WDS Port 6 (256 - 2347) [2347]");
+MODULE_PARM(PARM_TX_RATE1, "b");
+MODULE_PARM_DESC(PARM_TX_RATE1, "Transmit Rate Control, WDS Port 1 (1 - 7) [3]");
+MODULE_PARM(PARM_TX_RATE2, "b");
+MODULE_PARM_DESC(PARM_TX_RATE2, "Transmit Rate Control, WDS Port 2 (1 - 7) [3]");
+MODULE_PARM(PARM_TX_RATE3, "b");
+MODULE_PARM_DESC(PARM_TX_RATE3, "Transmit Rate Control, WDS Port 3 (1 - 7) [3]");
+MODULE_PARM(PARM_TX_RATE4, "b");
+MODULE_PARM_DESC(PARM_TX_RATE4, "Transmit Rate Control, WDS Port 4 (1 - 7) [3]");
+MODULE_PARM(PARM_TX_RATE5, "b");
+MODULE_PARM_DESC(PARM_TX_RATE5, "Transmit Rate Control, WDS Port 5 (1 - 7) [3]");
+MODULE_PARM(PARM_TX_RATE6, "b");
+MODULE_PARM_DESC(PARM_TX_RATE6, "Transmit Rate Control, WDS Port 6 (1 - 7) [3]");
+MODULE_PARM(PARM_WDS_ADDRESS1, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS1, "MAC Address, WDS Port 1 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+MODULE_PARM(PARM_WDS_ADDRESS2, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS2, "MAC Address, WDS Port 2 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+MODULE_PARM(PARM_WDS_ADDRESS3, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS3, "MAC Address, WDS Port 3 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+MODULE_PARM(PARM_WDS_ADDRESS4, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS4, "MAC Address, WDS Port 4 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+MODULE_PARM(PARM_WDS_ADDRESS5, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS5, "MAC Address, WDS Port 5 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+MODULE_PARM(PARM_WDS_ADDRESS6, "6b");
+MODULE_PARM_DESC(PARM_WDS_ADDRESS6, "MAC Address, WDS Port 6 ([0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff],[0x00-0xff]) [{0}]");
+
+MODULE_PARM(PARM_OWN_BEACON_INTERVAL, "b");
+MODULE_PARM_DESC(PARM_OWN_BEACON_INTERVAL, "Own Beacon Interval (20 - 200) [100]");
+MODULE_PARM(PARM_COEXISTENCE, "b");
+MODULE_PARM_DESC(PARM_COEXISTENCE, "Coexistence (0-7) [0]");
+
+#endif /* HCF_AP */
+#endif
+
+/* END NEW PARAMETERS */
+/*******************************************************************************
+ * debugging specifics
+ ******************************************************************************/
+#if DBG
+
+static p_u32 pc_debug = DBG_LVL;
+//MODULE_PARM(pc_debug, "i");
+/*static ;?conflicts with my understanding of CL parameters and breaks now I moved
+ * the correspondig logic to wl_profile
+ */ p_u32 DebugFlag = ~0; //recognizable "undefined value" rather then DBG_DEFAULTS;
+//MODULE_PARM(DebugFlag, "l");
+
+dbg_info_t wl_info = { DBG_MOD_NAME, 0, 0 };
+dbg_info_t *DbgInfo = &wl_info;
+
+#endif /* DBG */
+#ifdef USE_RTS
+
+static p_char *useRTS = "N";
+MODULE_PARM( useRTS, "s" );
+MODULE_PARM_DESC( useRTS, "Use RTS test interface (<string> N or Y) [N]" );
+
+#endif /* USE_RTS */
+/*******************************************************************************
+ * firmware download specifics
+ ******************************************************************************/
+extern struct CFG_RANGE2_STRCT BASED
+ cfg_drv_act_ranges_pri; // describes primary-actor range of HCF
+
+#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
+extern memimage ap; // AP firmware image to be downloaded
+#endif /* HCF_AP */
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+//extern memimage station; // STA firmware image to be downloaded
+extern memimage fw_image; // firmware image to be downloaded
+#endif /* HCF_STA */
+
+
+/*******************************************************************************
+ * wl_insert()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * wl_insert() is scheduled to run after a CARD_INSERTION event is
+ * received, to configure the PCMCIA socket, and to make the ethernet device
+ * available to the system.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the net_device struct of the wireless device
+ *
+ * RETURNS:
+ *
+ * TRUE or FALSE
+ *
+ ******************************************************************************/
+int wl_insert( struct net_device *dev )
+{
+ int result = 0;
+ int hcf_status = HCF_SUCCESS;
+ int i;
+ unsigned long flags = 0;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_insert" );
+ DBG_ENTER( DbgInfo );
+
+ /* Initialize the adapter hardware. */
+ memset( &( lp->hcfCtx ), 0, sizeof( IFB_STRCT ));
+
+ /* Initialize the adapter parameters. */
+ spin_lock_init( &( lp->slock ));
+
+ /* Intialize states */
+ //lp->lockcount = 0; //PE1DNN
+ lp->is_handling_int = WL_NOT_HANDLING_INT;
+ lp->firmware_present = WL_FRIMWARE_NOT_PRESENT;
+
+ lp->dev = dev;
+
+ DBG_PARAM( DbgInfo, "irq_mask", "0x%04x", irq_mask & 0x0FFFF );
+ DBG_PARAM( DbgInfo, "irq_list", "0x%02x 0x%02x 0x%02x 0x%02x",
+ irq_list[0] & 0x0FF, irq_list[1] & 0x0FF,
+ irq_list[2] & 0x0FF, irq_list[3] & 0x0FF );
+ DBG_PARAM( DbgInfo, PARM_NAME_DESIRED_SSID, "\"%s\"", PARM_DESIRED_SSID );
+ DBG_PARAM( DbgInfo, PARM_NAME_OWN_SSID, "\"%s\"", PARM_OWN_SSID );
+ DBG_PARAM( DbgInfo, PARM_NAME_OWN_CHANNEL, "%d", PARM_OWN_CHANNEL);
+ DBG_PARAM( DbgInfo, PARM_NAME_SYSTEM_SCALE, "%d", PARM_SYSTEM_SCALE );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE, "%d", PARM_TX_RATE );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD, "%d", PARM_RTS_THRESHOLD );
+ DBG_PARAM( DbgInfo, PARM_NAME_MICROWAVE_ROBUSTNESS, "\"%s\"", PARM_MICROWAVE_ROBUSTNESS );
+ DBG_PARAM( DbgInfo, PARM_NAME_OWN_NAME, "\"%s\"", PARM_OWN_NAME );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_ENABLE_ENCRYPTION, "\"%s\"", PARM_ENABLE_ENCRYPTION );
+ DBG_PARAM( DbgInfo, PARM_NAME_KEY1, "\"%s\"", PARM_KEY1 );
+ DBG_PARAM( DbgInfo, PARM_NAME_KEY2, "\"%s\"", PARM_KEY2 );
+ DBG_PARAM( DbgInfo, PARM_NAME_KEY3, "\"%s\"", PARM_KEY3 );
+ DBG_PARAM( DbgInfo, PARM_NAME_KEY4, "\"%s\"", PARM_KEY4 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_KEY, "%d", PARM_TX_KEY );
+ DBG_PARAM( DbgInfo, PARM_NAME_MULTICAST_RATE, "%d", PARM_MULTICAST_RATE );
+ DBG_PARAM( DbgInfo, PARM_NAME_DOWNLOAD_FIRMWARE, "\"%s\"", PARM_DOWNLOAD_FIRMWARE );
+ DBG_PARAM( DbgInfo, PARM_NAME_AUTH_KEY_MGMT_SUITE, "%d", PARM_AUTH_KEY_MGMT_SUITE );
+//;?#if (HCF_TYPE) & HCF_TYPE_STA
+ //;?should we make this code conditional depending on in STA mode
+//;? DBG_PARAM( DbgInfo, PARM_NAME_PORT_TYPE, "%d", PARM_PORT_TYPE );
+ DBG_PARAM( DbgInfo, PARM_NAME_PM_ENABLED, "%04x", PARM_PM_ENABLED );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_CREATE_IBSS, "\"%s\"", PARM_CREATE_IBSS );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_MULTICAST_RX, "\"%s\"", PARM_MULTICAST_RX );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_MAX_SLEEP, "%d", PARM_MAX_SLEEP );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_NETWORK_ADDR, "\"%s\"", DbgHwAddr( PARM_NETWORK_ADDR ));
+//;? DBG_PARAM( DbgInfo, PARM_NAME_AUTHENTICATION, "%d", PARM_AUTHENTICATION );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_OWN_ATIM_WINDOW, "%d", PARM_OWN_ATIM_WINDOW );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_PM_HOLDOVER_DURATION, "%d", PARM_PM_HOLDOVER_DURATION );
+//;? DBG_PARAM( DbgInfo, PARM_NAME_PROMISCUOUS_MODE, "\"%s\"", PARM_PROMISCUOUS_MODE );
+//;?#endif /* HCF_STA */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ //;?I guess: no, since this is Debug mode only
+ DBG_PARAM( DbgInfo, PARM_NAME_OWN_DTIM_PERIOD, "%d", PARM_OWN_DTIM_PERIOD );
+ DBG_PARAM( DbgInfo, PARM_NAME_REJECT_ANY, "\"%s\"", PARM_REJECT_ANY );
+ DBG_PARAM( DbgInfo, PARM_NAME_EXCLUDE_UNENCRYPTED, "\"%s\"", PARM_EXCLUDE_UNENCRYPTED );
+ DBG_PARAM( DbgInfo, PARM_NAME_MULTICAST_PM_BUFFERING, "\"%s\"", PARM_MULTICAST_PM_BUFFERING );
+ DBG_PARAM( DbgInfo, PARM_NAME_INTRA_BSS_RELAY, "\"%s\"", PARM_INTRA_BSS_RELAY );
+#ifdef USE_WDS
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD1, "%d", PARM_RTS_THRESHOLD1 );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD2, "%d", PARM_RTS_THRESHOLD2 );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD3, "%d", PARM_RTS_THRESHOLD3 );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD4, "%d", PARM_RTS_THRESHOLD4 );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD5, "%d", PARM_RTS_THRESHOLD5 );
+ DBG_PARAM( DbgInfo, PARM_NAME_RTS_THRESHOLD6, "%d", PARM_RTS_THRESHOLD6 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE1, "%d", PARM_TX_RATE1 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE2, "%d", PARM_TX_RATE2 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE3, "%d", PARM_TX_RATE3 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE4, "%d", PARM_TX_RATE4 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE5, "%d", PARM_TX_RATE5 );
+ DBG_PARAM( DbgInfo, PARM_NAME_TX_RATE6, "%d", PARM_TX_RATE6 );
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS1, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS1 ));
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS2, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS2 ));
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS3, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS3 ));
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS4, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS4 ));
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS5, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS5 ));
+ DBG_PARAM( DbgInfo, PARM_NAME_WDS_ADDRESS6, "\"%s\"", DbgHwAddr( PARM_WDS_ADDRESS6 ));
+#endif /* USE_WDS */
+#endif /* HCF_AP */
+
+ VALID_PARAM( !PARM_DESIRED_SSID || ( strlen( PARM_DESIRED_SSID ) <= PARM_MAX_NAME_LEN ));
+ VALID_PARAM( !PARM_OWN_SSID || ( strlen( PARM_OWN_SSID ) <= PARM_MAX_NAME_LEN ));
+ VALID_PARAM(( PARM_OWN_CHANNEL <= PARM_MAX_OWN_CHANNEL ));
+ VALID_PARAM(( PARM_SYSTEM_SCALE >= PARM_MIN_SYSTEM_SCALE ) && ( PARM_SYSTEM_SCALE <= PARM_MAX_SYSTEM_SCALE ));
+ VALID_PARAM(( PARM_TX_RATE >= PARM_MIN_TX_RATE ) && ( PARM_TX_RATE <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM( !PARM_MICROWAVE_ROBUSTNESS || strchr( "NnYy", PARM_MICROWAVE_ROBUSTNESS[0] ) != NULL );
+ VALID_PARAM( !PARM_OWN_NAME || ( strlen( PARM_NAME_OWN_NAME ) <= PARM_MAX_NAME_LEN ));
+ VALID_PARAM(( PARM_ENABLE_ENCRYPTION <= PARM_MAX_ENABLE_ENCRYPTION ));
+ VALID_PARAM( is_valid_key_string( PARM_KEY1 ));
+ VALID_PARAM( is_valid_key_string( PARM_KEY2 ));
+ VALID_PARAM( is_valid_key_string( PARM_KEY3 ));
+ VALID_PARAM( is_valid_key_string( PARM_KEY4 ));
+ VALID_PARAM(( PARM_TX_KEY >= PARM_MIN_TX_KEY ) && ( PARM_TX_KEY <= PARM_MAX_TX_KEY ));
+
+ VALID_PARAM(( PARM_MULTICAST_RATE >= PARM_MIN_MULTICAST_RATE ) &&
+ ( PARM_MULTICAST_RATE <= PARM_MAX_MULTICAST_RATE ));
+
+ VALID_PARAM( !PARM_DOWNLOAD_FIRMWARE || ( strlen( PARM_DOWNLOAD_FIRMWARE ) <= 255 /*;?*/ ));
+ VALID_PARAM(( PARM_AUTH_KEY_MGMT_SUITE < PARM_MAX_AUTH_KEY_MGMT_SUITE ));
+
+ VALID_PARAM( !PARM_LOAD_BALANCING || strchr( "NnYy", PARM_LOAD_BALANCING[0] ) != NULL );
+ VALID_PARAM( !PARM_MEDIUM_DISTRIBUTION || strchr( "NnYy", PARM_MEDIUM_DISTRIBUTION[0] ) != NULL );
+ VALID_PARAM(( PARM_TX_POW_LEVEL <= PARM_MAX_TX_POW_LEVEL ));
+
+ VALID_PARAM(( PARM_PORT_TYPE >= PARM_MIN_PORT_TYPE ) && ( PARM_PORT_TYPE <= PARM_MAX_PORT_TYPE ));
+ VALID_PARAM( PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD ||
+ ( PARM_PM_ENABLED & 0x7FFF ) <= WVLAN_PM_STATE_STANDARD );
+ VALID_PARAM( !PARM_CREATE_IBSS || strchr( "NnYy", PARM_CREATE_IBSS[0] ) != NULL );
+ VALID_PARAM( !PARM_MULTICAST_RX || strchr( "NnYy", PARM_MULTICAST_RX[0] ) != NULL );
+ VALID_PARAM(( PARM_MAX_SLEEP <= PARM_MAX_MAX_PM_SLEEP ));
+ VALID_PARAM(( PARM_AUTHENTICATION <= PARM_MAX_AUTHENTICATION ));
+ VALID_PARAM(( PARM_OWN_ATIM_WINDOW <= PARM_MAX_OWN_ATIM_WINDOW ));
+ VALID_PARAM(( PARM_PM_HOLDOVER_DURATION <= PARM_MAX_PM_HOLDOVER_DURATION ));
+ VALID_PARAM( !PARM_PROMISCUOUS_MODE || strchr( "NnYy", PARM_PROMISCUOUS_MODE[0] ) != NULL );
+ VALID_PARAM(( PARM_CONNECTION_CONTROL <= PARM_MAX_CONNECTION_CONTROL ));
+
+ VALID_PARAM(( PARM_OWN_DTIM_PERIOD >= PARM_MIN_OWN_DTIM_PERIOD ));
+ VALID_PARAM( !PARM_REJECT_ANY || strchr( "NnYy", PARM_REJECT_ANY[0] ) != NULL );
+ VALID_PARAM( !PARM_EXCLUDE_UNENCRYPTED || strchr( "NnYy", PARM_EXCLUDE_UNENCRYPTED[0] ) != NULL );
+ VALID_PARAM( !PARM_MULTICAST_PM_BUFFERING || strchr( "NnYy", PARM_MULTICAST_PM_BUFFERING[0] ) != NULL );
+ VALID_PARAM( !PARM_INTRA_BSS_RELAY || strchr( "NnYy", PARM_INTRA_BSS_RELAY[0] ) != NULL );
+#ifdef USE_WDS
+ VALID_PARAM(( PARM_RTS_THRESHOLD1 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD2 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD3 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD4 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD5 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_RTS_THRESHOLD6 <= PARM_MAX_RTS_THRESHOLD ));
+ VALID_PARAM(( PARM_TX_RATE1 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE1 <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_TX_RATE2 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE2 <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_TX_RATE3 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE3 <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_TX_RATE4 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE4 <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_TX_RATE5 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE5 <= PARM_MAX_TX_RATE ));
+ VALID_PARAM(( PARM_TX_RATE6 >= PARM_MIN_TX_RATE ) && (PARM_TX_RATE6 <= PARM_MAX_TX_RATE ));
+#endif /* USE_WDS */
+
+ VALID_PARAM(( PARM_OWN_BEACON_INTERVAL >= PARM_MIN_OWN_BEACON_INTERVAL ) && ( PARM_OWN_BEACON_INTERVAL <= PARM_MAX_OWN_BEACON_INTERVAL ));
+ VALID_PARAM(( PARM_COEXISTENCE <= PARM_COEXISTENCE ));
+
+ /* Set the driver parameters from the passed in parameters. */
+
+ /* THESE MODULE PARAMETERS ARE TO BE DEPRECATED IN FAVOR OF A NAMING CONVENTION
+ WHICH IS INLINE WITH THE FORTHCOMING WAVELAN API */
+
+ /* START NEW PARAMETERS */
+
+ lp->Channel = PARM_OWN_CHANNEL;
+ lp->DistanceBetweenAPs = PARM_SYSTEM_SCALE;
+
+ /* Need to determine how to handle the new bands for 5GHz */
+ lp->TxRateControl[0] = PARM_DEFAULT_TX_RATE_2GHZ;
+ lp->TxRateControl[1] = PARM_DEFAULT_TX_RATE_5GHZ;
+
+ lp->RTSThreshold = PARM_RTS_THRESHOLD;
+
+ /* Need to determine how to handle the new bands for 5GHz */
+ lp->MulticastRate[0] = PARM_DEFAULT_MULTICAST_RATE_2GHZ;
+ lp->MulticastRate[1] = PARM_DEFAULT_MULTICAST_RATE_5GHZ;
+
+ if ( strchr( "Yy", PARM_MICROWAVE_ROBUSTNESS[0] ) != NULL ) {
+ lp->MicrowaveRobustness = 1;
+ } else {
+ lp->MicrowaveRobustness = 0;
+ }
+ if ( PARM_DESIRED_SSID && ( strlen( PARM_DESIRED_SSID ) <= HCF_MAX_NAME_LEN )) {
+ strcpy( lp->NetworkName, PARM_DESIRED_SSID );
+ }
+ if ( PARM_OWN_SSID && ( strlen( PARM_OWN_SSID ) <= HCF_MAX_NAME_LEN )) {
+ strcpy( lp->NetworkName, PARM_OWN_SSID );
+ }
+ if ( PARM_OWN_NAME && ( strlen( PARM_OWN_NAME ) <= HCF_MAX_NAME_LEN )) {
+ strcpy( lp->StationName, PARM_OWN_NAME );
+ }
+ lp->EnableEncryption = PARM_ENABLE_ENCRYPTION;
+ if ( PARM_KEY1 && ( strlen( PARM_KEY1 ) <= MAX_KEY_LEN )) {
+ strcpy( lp->Key1, PARM_KEY1 );
+ }
+ if ( PARM_KEY2 && ( strlen( PARM_KEY2 ) <= MAX_KEY_LEN )) {
+ strcpy( lp->Key2, PARM_KEY2 );
+ }
+ if ( PARM_KEY3 && ( strlen( PARM_KEY3 ) <= MAX_KEY_LEN )) {
+ strcpy( lp->Key3, PARM_KEY3 );
+ }
+ if ( PARM_KEY4 && ( strlen( PARM_KEY4 ) <= MAX_KEY_LEN )) {
+ strcpy( lp->Key4, PARM_KEY4 );
+ }
+
+ lp->TransmitKeyID = PARM_TX_KEY;
+
+ key_string2key( lp->Key1, &(lp->DefaultKeys.key[0] ));
+ key_string2key( lp->Key2, &(lp->DefaultKeys.key[1] ));
+ key_string2key( lp->Key3, &(lp->DefaultKeys.key[2] ));
+ key_string2key( lp->Key4, &(lp->DefaultKeys.key[3] ));
+
+ lp->DownloadFirmware = 1 ; //;?to be upgraded PARM_DOWNLOAD_FIRMWARE;
+ lp->AuthKeyMgmtSuite = PARM_AUTH_KEY_MGMT_SUITE;
+
+ if ( strchr( "Yy", PARM_LOAD_BALANCING[0] ) != NULL ) {
+ lp->loadBalancing = 1;
+ } else {
+ lp->loadBalancing = 0;
+ }
+
+ if ( strchr( "Yy", PARM_MEDIUM_DISTRIBUTION[0] ) != NULL ) {
+ lp->mediumDistribution = 1;
+ } else {
+ lp->mediumDistribution = 0;
+ }
+
+ lp->txPowLevel = PARM_TX_POW_LEVEL;
+
+ lp->srsc[0] = PARM_SRSC_2GHZ;
+ lp->srsc[1] = PARM_SRSC_5GHZ;
+ lp->brsc[0] = PARM_BRSC_2GHZ;
+ lp->brsc[1] = PARM_BRSC_5GHZ;
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+//;?seems reasonable that even an AP-only driver could afford this small additional footprint
+ lp->PortType = PARM_PORT_TYPE;
+ lp->MaxSleepDuration = PARM_MAX_SLEEP;
+ lp->authentication = PARM_AUTHENTICATION;
+ lp->atimWindow = PARM_OWN_ATIM_WINDOW;
+ lp->holdoverDuration = PARM_PM_HOLDOVER_DURATION;
+ lp->PMEnabled = PARM_PM_ENABLED; //;?
+ if ( strchr( "Yy", PARM_CREATE_IBSS[0] ) != NULL ) {
+ lp->CreateIBSS = 1;
+ } else {
+ lp->CreateIBSS = 0;
+ }
+ if ( strchr( "Nn", PARM_MULTICAST_RX[0] ) != NULL ) {
+ lp->MulticastReceive = 0;
+ } else {
+ lp->MulticastReceive = 1;
+ }
+ if ( strchr( "Yy", PARM_PROMISCUOUS_MODE[0] ) != NULL ) {
+ lp->promiscuousMode = 1;
+ } else {
+ lp->promiscuousMode = 0;
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->MACAddress[i] = PARM_NETWORK_ADDR[i];
+ }
+
+ lp->connectionControl = PARM_CONNECTION_CONTROL;
+
+#endif /* HCF_STA */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ lp->DTIMPeriod = PARM_OWN_DTIM_PERIOD;
+
+ if ( strchr( "Yy", PARM_REJECT_ANY[0] ) != NULL ) {
+ lp->RejectAny = 1;
+ } else {
+ lp->RejectAny = 0;
+ }
+ if ( strchr( "Nn", PARM_EXCLUDE_UNENCRYPTED[0] ) != NULL ) {
+ lp->ExcludeUnencrypted = 0;
+ } else {
+ lp->ExcludeUnencrypted = 1;
+ }
+ if ( strchr( "Yy", PARM_MULTICAST_PM_BUFFERING[0] ) != NULL ) {
+ lp->multicastPMBuffering = 1;
+ } else {
+ lp->multicastPMBuffering = 0;
+ }
+ if ( strchr( "Yy", PARM_INTRA_BSS_RELAY[0] ) != NULL ) {
+ lp->intraBSSRelay = 1;
+ } else {
+ lp->intraBSSRelay = 0;
+ }
+
+ lp->ownBeaconInterval = PARM_OWN_BEACON_INTERVAL;
+ lp->coexistence = PARM_COEXISTENCE;
+
+#ifdef USE_WDS
+ lp->wds_port[0].rtsThreshold = PARM_RTS_THRESHOLD1;
+ lp->wds_port[1].rtsThreshold = PARM_RTS_THRESHOLD2;
+ lp->wds_port[2].rtsThreshold = PARM_RTS_THRESHOLD3;
+ lp->wds_port[3].rtsThreshold = PARM_RTS_THRESHOLD4;
+ lp->wds_port[4].rtsThreshold = PARM_RTS_THRESHOLD5;
+ lp->wds_port[5].rtsThreshold = PARM_RTS_THRESHOLD6;
+ lp->wds_port[0].txRateCntl = PARM_TX_RATE1;
+ lp->wds_port[1].txRateCntl = PARM_TX_RATE2;
+ lp->wds_port[2].txRateCntl = PARM_TX_RATE3;
+ lp->wds_port[3].txRateCntl = PARM_TX_RATE4;
+ lp->wds_port[4].txRateCntl = PARM_TX_RATE5;
+ lp->wds_port[5].txRateCntl = PARM_TX_RATE6;
+
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[0].wdsAddress[i] = PARM_WDS_ADDRESS1[i];
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[1].wdsAddress[i] = PARM_WDS_ADDRESS2[i];
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[2].wdsAddress[i] = PARM_WDS_ADDRESS3[i];
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[3].wdsAddress[i] = PARM_WDS_ADDRESS4[i];
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[4].wdsAddress[i] = PARM_WDS_ADDRESS5[i];
+ }
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ lp->wds_port[5].wdsAddress[i] = PARM_WDS_ADDRESS6[i];
+ }
+#endif /* USE_WDS */
+#endif /* HCF_AP */
+#ifdef USE_RTS
+ if ( strchr( "Yy", useRTS[0] ) != NULL ) {
+ lp->useRTS = 1;
+ } else {
+ lp->useRTS = 0;
+ }
+#endif /* USE_RTS */
+
+
+ /* END NEW PARAMETERS */
+
+
+ wl_lock( lp, &flags );
+
+ /* Initialize the portState variable */
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+ /* Initialize the ScanResult struct */
+ memset( &( lp->scan_results ), 0, sizeof( lp->scan_results ));
+ lp->scan_results.scan_complete = FALSE;
+
+ /* Initialize the ProbeResult struct */
+ memset( &( lp->probe_results ), 0, sizeof( lp->probe_results ));
+ lp->probe_results.scan_complete = FALSE;
+ lp->probe_num_aps = 0;
+
+
+ /* Initialize Tx queue stuff */
+ memset( lp->txList, 0, sizeof( lp->txList ));
+
+ INIT_LIST_HEAD( &( lp->txFree ));
+
+ lp->txF.skb = NULL;
+ lp->txF.port = 0;
+
+
+ for( i = 0; i < DEFAULT_NUM_TX_FRAMES; i++ ) {
+ list_add_tail( &( lp->txList[i].node ), &( lp->txFree ));
+ }
+
+
+ for( i = 0; i < WVLAN_MAX_TX_QUEUES; i++ ) {
+ INIT_LIST_HEAD( &( lp->txQ[i] ));
+ }
+
+ lp->netif_queue_on = TRUE;
+ lp->txQ_count = 0;
+ /* Initialize the use_dma element in the adapter structure. Not sure if
+ this should be a compile-time or run-time configurable. So for now,
+ implement as run-time and just define here */
+#ifdef WARP
+#ifdef ENABLE_DMA
+ DBG_TRACE( DbgInfo, "HERMES 2.5 BUSMASTER DMA MODE\n" );
+ lp->use_dma = 1;
+#else
+ DBG_TRACE( DbgInfo, "HERMES 2.5 PORT I/O MODE\n" );
+ lp->use_dma = 0;
+#endif // ENABLE_DMA
+#endif // WARP
+
+ /* Register the ISR handler information here, so that it's not done
+ repeatedly in the ISR */
+ tasklet_init(&lp->task, wl_isr_handler, (unsigned long)lp);
+
+ /* Connect to the adapter */
+ DBG_TRACE( DbgInfo, "Calling hcf_connect()...\n" );
+ hcf_status = hcf_connect( &lp->hcfCtx, dev->base_addr );
+ //HCF_ERR_INCOMP_FW is acceptable, because download must still take place
+ //HCF_ERR_INCOMP_PRI is not acceptable
+ if ( hcf_status != HCF_SUCCESS && hcf_status != HCF_ERR_INCOMP_FW ) {
+ DBG_ERROR( DbgInfo, "hcf_connect() failed, status: 0x%x\n", hcf_status );
+ wl_unlock( lp, &flags );
+ goto hcf_failed;
+ }
+
+ //;?should set HCF_version and how about driver_stat
+ lp->driverInfo.IO_address = dev->base_addr;
+ lp->driverInfo.IO_range = HCF_NUM_IO_PORTS; //;?conditionally 0x40 or 0x80 seems better
+ lp->driverInfo.IRQ_number = dev->irq;
+ lp->driverInfo.card_stat = lp->hcfCtx.IFB_CardStat;
+ //;? what happened to frame_type
+
+ /* Fill in the driver identity structure */
+ lp->driverIdentity.len = ( sizeof( lp->driverIdentity ) / sizeof( hcf_16 )) - 1;
+ lp->driverIdentity.typ = CFG_DRV_IDENTITY;
+ lp->driverIdentity.comp_id = DRV_IDENTITY;
+ lp->driverIdentity.variant = DRV_VARIANT;
+ lp->driverIdentity.version_major = DRV_MAJOR_VERSION;
+ lp->driverIdentity.version_minor = DRV_MINOR_VERSION;
+
+
+ /* Start the card here - This needs to be done in order to get the
+ MAC address for the network layer */
+ DBG_TRACE( DbgInfo, "Calling wvlan_go() to perform a card reset...\n" );
+ hcf_status = wl_go( lp );
+
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "wl_go() failed\n" );
+ wl_unlock( lp, &flags );
+ goto hcf_failed;
+ }
+
+ /* Certain RIDs must be set before enabling the ports */
+ wl_put_ltv_init( lp );
+
+#if 0 //;?why was this already commented out in wl_lkm_720
+ /* Enable the ports */
+ if ( wl_adapter_is_open( lp->dev )) {
+ /* Enable the ports */
+ DBG_TRACE( DbgInfo, "Enabling Port 0\n" );
+ hcf_status = wl_enable( lp );
+
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "Enable port 0 failed: 0x%x\n", hcf_status );
+ }
+
+#if (HCF_TYPE) & HCF_TYPE_AP
+ DBG_TRACE( DbgInfo, "Enabling WDS Ports\n" );
+ //wl_enable_wds_ports( lp );
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+ }
+#endif
+
+ /* Fill out the MAC address information in the net_device struct */
+ memcpy( lp->dev->dev_addr, lp->MACAddress, ETH_ALEN );
+ dev->addr_len = ETH_ALEN;
+
+ lp->is_registered = TRUE;
+
+#ifdef USE_PROFILE
+ /* Parse the config file for the sake of creating WDS ports if WDS is
+ configured there but not in the module options */
+ parse_config( dev );
+#endif /* USE_PROFILE */
+
+ /* If we're going into AP Mode, register the "virtual" ethernet devices
+ needed for WDS */
+ WL_WDS_NETDEV_REGISTER( lp );
+
+ /* Reset the DownloadFirmware variable in the private struct. If the
+ config file is not used, this will not matter; if it is used, it
+ will be reparsed in wl_open(). This is done because logic in wl_open
+ used to check if a firmware download is needed is broken by parsing
+ the file here; however, this parsing is needed to register WDS ports
+ in AP mode, if they are configured */
+ lp->DownloadFirmware = WVLAN_DRV_MODE_STA; //;?download_firmware;
+
+#ifdef USE_RTS
+ if ( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "ENTERING RTS MODE...\n" );
+ wl_act_int_off( lp );
+ lp->is_handling_int = WL_NOT_HANDLING_INT; // Not handling interrupts anymore
+
+ wl_disable( lp );
+
+ hcf_connect( &lp->hcfCtx, HCF_DISCONNECT);
+ }
+#endif /* USE_RTS */
+
+ wl_unlock( lp, &flags );
+
+ DBG_TRACE( DbgInfo, "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
+ dev->name, dev->base_addr, dev->irq );
+
+ for( i = 0; i < ETH_ALEN; i++ ) {
+ printk( "%02X%c", dev->dev_addr[i], (( i < ( ETH_ALEN-1 )) ? ':' : '\n' ));
+ }
+
+#if 0 //SCULL_USE_PROC /* don't waste space if unused */
+ create_proc_read_entry( "wlags", 0, NULL, scull_read_procmem, dev );
+ proc_mkdir("driver/wlags49", 0);
+ proc_write("driver/wlags49/wlags49_type", write_int, &lp->wlags49_type);
+#endif /* SCULL_USE_PROC */
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+
+hcf_failed:
+ wl_hcf_error( dev, hcf_status );
+
+failed:
+
+ DBG_ERROR( DbgInfo, "wl_insert() FAILED\n" );
+
+ if ( lp->is_registered == TRUE ) {
+ lp->is_registered = FALSE;
+ }
+
+ WL_WDS_NETDEV_DEREGISTER( lp );
+
+ result = -EFAULT;
+
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wl_insert
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_reset()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Reset the adapter.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the net_device struct of the wireless device
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_reset(struct net_device *dev)
+{
+ struct wl_private *lp = wl_priv(dev);
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_reset" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+ DBG_PARAM( DbgInfo, "dev->base_addr", "(%#03lx)", dev->base_addr );
+
+ /*
+ * The caller should already have a lock and
+ * disable the interrupts, we do not lock here,
+ * nor do we enable/disable interrupts!
+ */
+
+ DBG_TRACE( DbgInfo, "Device Base Address: %#03lx\n", dev->base_addr );
+ if ( dev->base_addr ) {
+ /* Shutdown the adapter. */
+ hcf_connect( &lp->hcfCtx, HCF_DISCONNECT );
+
+ /* Reset the driver information. */
+ lp->txBytes = 0;
+
+ /* Connect to the adapter. */
+ hcf_status = hcf_connect( &lp->hcfCtx, dev->base_addr );
+ if ( hcf_status != HCF_SUCCESS && hcf_status != HCF_ERR_INCOMP_FW ) {
+ DBG_ERROR( DbgInfo, "hcf_connect() failed, status: 0x%x\n", hcf_status );
+ goto out;
+ }
+
+ /* Check if firmware is present, if not change state */
+ if ( hcf_status == HCF_ERR_INCOMP_FW ) {
+ lp->firmware_present = WL_FRIMWARE_NOT_PRESENT;
+ }
+
+ /* Initialize the portState variable */
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+ /* Restart the adapter. */
+ hcf_status = wl_go( lp );
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "wl_go() failed, status: 0x%x\n", hcf_status );
+ goto out;
+ }
+
+ /* Certain RIDs must be set before enabling the ports */
+ wl_put_ltv_init( lp );
+ } else {
+ DBG_ERROR( DbgInfo, "Device Base Address INVALID!!!\n" );
+ }
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_reset
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_go()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Reset the adapter.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the net_device struct of the wireless device
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_go( struct wl_private *lp )
+{
+ int hcf_status = HCF_SUCCESS;
+ char *cp = NULL; //fw_image
+ int retries = 0;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_go" );
+ DBG_ENTER( DbgInfo );
+
+ hcf_status = wl_disable( lp );
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "Disable port 0 failed: 0x%x\n", hcf_status );
+
+ while (( hcf_status != HCF_SUCCESS ) && (retries < 10)) {
+ retries++;
+ hcf_status = wl_disable( lp );
+ }
+ if ( hcf_status == HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "Disable port 0 succes : %d retries\n", retries );
+ } else {
+ DBG_TRACE( DbgInfo, "Disable port 0 failed after: %d retries\n", retries );
+ }
+ }
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //DBG_TRACE( DbgInfo, "Disabling WDS Ports\n" );
+ //wl_disable_wds_ports( lp );
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+//;?what was the purpose of this
+// /* load the appropriate firmware image, depending on driver mode */
+// lp->ltvRecord.len = ( sizeof( CFG_RANGE20_STRCT ) / sizeof( hcf_16 )) - 1;
+// lp->ltvRecord.typ = CFG_DRV_ACT_RANGES_PRI;
+// hcf_get_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+#if BIN_DL
+ if ( strlen( lp->fw_image_filename ) ) {
+mm_segment_t fs;
+int file_desc;
+int rc;
+
+ DBG_TRACE( DbgInfo, "F/W image:%s:\n", lp->fw_image_filename );
+ /* Obtain a user-space process context, storing the original context */
+ fs = get_fs( );
+ set_fs( get_ds( ));
+ file_desc = open( lp->fw_image_filename, O_RDONLY, 0 );
+ if ( file_desc == -1 ) {
+ DBG_ERROR( DbgInfo, "No image file found\n" );
+ } else {
+ DBG_TRACE( DbgInfo, "F/W image file found\n" );
+#define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future
+ cp = (char*)vmalloc( DHF_ALLOC_SIZE );
+ if ( cp == NULL ) {
+ DBG_ERROR( DbgInfo, "error in vmalloc\n" );
+ } else {
+ rc = read( file_desc, cp, DHF_ALLOC_SIZE );
+ if ( rc == DHF_ALLOC_SIZE ) {
+ DBG_ERROR( DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE );
+ } else if ( rc > 0 ) {
+ DBG_TRACE( DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp );
+ rc = read( file_desc, &cp[rc], 1 );
+ if ( rc == 0 ) { //;/change to an until-loop at rc<=0
+ DBG_TRACE( DbgInfo, "no more to read\n" );
+ }
+ }
+ if ( rc != 0 ) {
+ DBG_ERROR( DbgInfo, "file not read in one swoop or other error"\
+ ", give up, too complicated, rc = %0X\n", rc );
+ DBG_ERROR( DbgInfo, "still have to change code to get a real download now !!!!!!!!\n" );
+ } else {
+ DBG_TRACE( DbgInfo, "before dhf_download_binary\n" );
+ hcf_status = dhf_download_binary( (memimage *)cp );
+ DBG_TRACE( DbgInfo, "after dhf_download_binary, before dhf_download_fw\n" );
+ //;?improve error flow/handling
+ hcf_status = dhf_download_fw( &lp->hcfCtx, (memimage *)cp );
+ DBG_TRACE( DbgInfo, "after dhf_download_fw\n" );
+ }
+ vfree( cp );
+ }
+ close( file_desc );
+ }
+ set_fs( fs ); /* Return to the original context */
+ }
+#endif // BIN_DL
+
+ /* If firmware is present but the type is unknown then download anyway */
+ if ( (lp->firmware_present == WL_FRIMWARE_PRESENT)
+ &&
+ ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) != COMP_ID_FW_STA )
+ &&
+ ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) != COMP_ID_FW_AP ) ) {
+ /* Unknown type, download needed. */
+ lp->firmware_present = WL_FRIMWARE_NOT_PRESENT;
+ }
+
+ if(lp->firmware_present == WL_FRIMWARE_NOT_PRESENT)
+ {
+ if ( cp == NULL ) {
+ DBG_TRACE( DbgInfo, "Downloading STA firmware...\n" );
+// hcf_status = dhf_download_fw( &lp->hcfCtx, &station );
+ hcf_status = dhf_download_fw( &lp->hcfCtx, &fw_image );
+ }
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "Firmware Download failed\n" );
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+ }
+ }
+ /* Report the FW versions */
+ //;?obsolete, use the available IFB info:: wl_get_pri_records( lp );
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ DBG_TRACE( DbgInfo, "downloaded station F/W\n" );
+ } else if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ DBG_TRACE( DbgInfo, "downloaded AP F/W\n" );
+ } else {
+ DBG_ERROR( DbgInfo, "unknown F/W type\n" );
+ }
+
+ /*
+ * Downloaded, no need to repeat this next time, assume the
+ * contents stays in the card until it is powered off. Note we
+ * do not switch firmware on the fly, the firmware is fixed in
+ * the driver for now.
+ */
+ lp->firmware_present = WL_FRIMWARE_PRESENT;
+
+ DBG_TRACE( DbgInfo, "ComponentID:%04x variant:%04x major:%04x minor:%04x\n",
+ CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ),
+ CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.variant ),
+ CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.version_major ),
+ CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.version_minor ));
+
+ /* now we wil get the MAC address of the card */
+ lp->ltvRecord.len = 4;
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ lp->ltvRecord.typ = CFG_NIC_MAC_ADDR;
+ } else
+ {
+ lp->ltvRecord.typ = CFG_CNF_OWN_MAC_ADDR;
+ }
+ hcf_status = hcf_get_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "Could not retrieve MAC address\n" );
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+ }
+ memcpy( lp->MACAddress, &lp->ltvRecord.u.u8[0], ETH_ALEN );
+ DBG_TRACE( DbgInfo, "Card MAC Address: %s\n", DbgHwAddr( lp->MACAddress ));
+
+ /* Write out configuration to the device, enable, and reconnect. However,
+ only reconnect if in AP mode. For STA mode, need to wait for passive scan
+ completion before a connect can be issued */
+ wl_put_ltv( lp );
+ /* Enable the ports */
+ hcf_status = wl_enable( lp );
+
+ if ( lp->DownloadFirmware == WVLAN_DRV_MODE_AP ) {
+#ifdef USE_WDS
+ wl_enable_wds_ports( lp );
+#endif // USE_WDS
+ hcf_status = wl_connect( lp );
+ }
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_go
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_set_wep_keys()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Write TxKeyID and WEP keys to the adapter. This is separated from
+ * wl_apply() to allow dynamic WEP key updates through the wireless
+ * extensions.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the wireless adapter's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_set_wep_keys( struct wl_private *lp )
+{
+ int count = 0;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_set_wep_keys" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "lp", "%s (0x%p)", lp->dev->name, lp );
+ if ( lp->EnableEncryption ) {
+ /* NOTE: CFG_CNF_ENCRYPTION is set in wl_put_ltv() as it's a static
+ RID */
+
+ /* set TxKeyID */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_KEY_ID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE(lp->TransmitKeyID - 1);
+
+ hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ DBG_TRACE( DbgInfo, "Key 1 len: %d\n", lp->DefaultKeys.key[0].len );
+ DBG_TRACE( DbgInfo, "Key 2 len: %d\n", lp->DefaultKeys.key[1].len );
+ DBG_TRACE( DbgInfo, "Key 3 len: %d\n", lp->DefaultKeys.key[2].len );
+ DBG_TRACE( DbgInfo, "Key 4 len: %d\n", lp->DefaultKeys.key[3].len );
+
+ /* write keys */
+ lp->DefaultKeys.len = sizeof( lp->DefaultKeys ) / sizeof( hcf_16 ) - 1;
+ lp->DefaultKeys.typ = CFG_DEFAULT_KEYS;
+
+ /* endian translate the appropriate key information */
+ for( count = 0; count < MAX_KEYS; count++ ) {
+ lp->DefaultKeys.key[count].len = CNV_INT_TO_LITTLE( lp->DefaultKeys.key[count].len );
+ }
+
+ hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->DefaultKeys ));
+
+ /* Reverse the above endian translation, since these keys are accessed
+ elsewhere */
+ for( count = 0; count < MAX_KEYS; count++ ) {
+ lp->DefaultKeys.key[count].len = CNV_INT_TO_LITTLE( lp->DefaultKeys.key[count].len );
+ }
+
+ DBG_NOTICE( DbgInfo, "encrypt: %d, ID: %d\n", lp->EnableEncryption, lp->TransmitKeyID );
+ DBG_NOTICE( DbgInfo, "set key: %s(%d) [%d]\n", lp->DefaultKeys.key[lp->TransmitKeyID-1].key, lp->DefaultKeys.key[lp->TransmitKeyID-1].len, lp->TransmitKeyID-1 );
+ }
+
+ DBG_LEAVE( DbgInfo );
+} // wl_set_wep_keys
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_apply()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Write the parameters to the adapter. (re-)enables the card if device is
+ * open. Returns hcf_status of hcf_enable().
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the wireless adapter's private structure
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_apply(struct wl_private *lp)
+{
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_apply" );
+ DBG_ENTER( DbgInfo );
+ DBG_ASSERT( lp != NULL);
+ DBG_PARAM( DbgInfo, "lp", "%s (0x%p)", lp->dev->name, lp );
+
+ if ( !( lp->flags & WVLAN2_UIL_BUSY )) {
+ /* The adapter parameters have changed:
+ disable card
+ reload parameters
+ enable card
+ */
+
+ if ( wl_adapter_is_open( lp->dev )) {
+ /* Disconnect and disable if necessary */
+ hcf_status = wl_disconnect( lp );
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "Disconnect failed\n" );
+ DBG_LEAVE( DbgInfo );
+ return -1;
+ }
+ hcf_status = wl_disable( lp );
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "Disable failed\n" );
+ DBG_LEAVE( DbgInfo );
+ return -1;
+ } else {
+ /* Write out configuration to the device, enable, and reconnect.
+ However, only reconnect if in AP mode. For STA mode, need to
+ wait for passive scan completion before a connect can be
+ issued */
+ hcf_status = wl_put_ltv( lp );
+
+ if ( hcf_status == HCF_SUCCESS ) {
+ hcf_status = wl_enable( lp );
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ hcf_status = wl_connect( lp );
+ }
+ } else {
+ DBG_WARNING( DbgInfo, "wl_put_ltv() failed\n" );
+ }
+ }
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_apply
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_put_ltv_init()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to set basic parameters for card initialization.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the wireless adapter's private structure
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_put_ltv_init( struct wl_private *lp )
+{
+ int i;
+ int hcf_status;
+ CFG_RID_LOG_STRCT *RidLog;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_put_ltv_init" );
+ DBG_ENTER( DbgInfo );
+ if ( lp == NULL ) {
+ DBG_ERROR( DbgInfo, "lp pointer is NULL\n" );
+ DBG_LEAVE( DbgInfo );
+ return -1;
+ }
+ /* DMA/IO */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNTL_OPT;
+
+ /* The Card Services build must ALWAYS configure for 16-bit I/O. PCI or
+ CardBus can be set to either 16/32 bit I/O, or Bus Master DMA, but only
+ for Hermes-2.5 */
+#ifdef BUS_PCMCIA
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( USE_16BIT );
+#else
+ if ( lp->use_dma ) {
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( USE_DMA );
+ } else {
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ }
+
+#endif
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ DBG_TRACE( DbgInfo, "CFG_CNTL_OPT : 0x%04x\n",
+ lp->ltvRecord.u.u16[0] );
+ DBG_TRACE( DbgInfo, "CFG_CNTL_OPT result : 0x%04x\n",
+ hcf_status );
+
+ /* Register the list of RIDs on which asynchronous notification is
+ required. Note that this mechanism replaces the mailbox, so the mailbox
+ can be queried by the host (if desired) without contention from us */
+ i=0;
+
+ lp->RidList[i].len = sizeof( lp->ProbeResp );
+ lp->RidList[i].typ = CFG_ACS_SCAN;
+ lp->RidList[i].bufp = (wci_recordp)&lp->ProbeResp;
+ //lp->ProbeResp.infoType = 0xFFFF;
+ i++;
+
+ lp->RidList[i].len = sizeof( lp->assoc_stat );
+ lp->RidList[i].typ = CFG_ASSOC_STAT;
+ lp->RidList[i].bufp = (wci_recordp)&lp->assoc_stat;
+ lp->assoc_stat.len = 0xFFFF;
+ i++;
+
+ lp->RidList[i].len = 4;
+ lp->RidList[i].typ = CFG_UPDATED_INFO_RECORD;
+ lp->RidList[i].bufp = (wci_recordp)&lp->updatedRecord;
+ lp->updatedRecord.len = 0xFFFF;
+ i++;
+
+ lp->RidList[i].len = sizeof( lp->sec_stat );
+ lp->RidList[i].typ = CFG_SECURITY_STAT;
+ lp->RidList[i].bufp = (wci_recordp)&lp->sec_stat;
+ lp->sec_stat.len = 0xFFFF;
+ i++;
+
+ lp->RidList[i].typ = 0; // Terminate List
+
+ RidLog = (CFG_RID_LOG_STRCT *)&lp->ltvRecord;
+ RidLog->len = 3;
+ RidLog->typ = CFG_REG_INFO_LOG;
+ RidLog->recordp = (RID_LOGP)&lp->RidList[0];
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ DBG_TRACE( DbgInfo, "CFG_REG_INFO_LOG\n" );
+ DBG_TRACE( DbgInfo, "CFG_REG_INFO_LOG result : 0x%04x\n",
+ hcf_status );
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_put_ltv_init
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_put_ltv()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used by wvlan_apply() and wvlan_go to set the card's configuration.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the wireless adapter's private structure
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_put_ltv( struct wl_private *lp )
+{
+ int len;
+ int hcf_status;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_put_ltv" );
+ DBG_ENTER( DbgInfo );
+
+ if ( lp == NULL ) {
+ DBG_ERROR( DbgInfo, "lp pointer is NULL\n" );
+ return -1;
+ }
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ lp->maxPort = 6; //;?why set this here and not as part of download process
+ } else {
+ lp->maxPort = 0;
+ }
+
+ /* Send our configuration to the card. Perform any endian translation
+ necessary */
+ /* Register the Mailbox; VxWorks does this elsewhere; why;? */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_REG_MB;
+ lp->ltvRecord.u.u32[0] = (u_long)&( lp->mailbox );
+ lp->ltvRecord.u.u16[2] = ( MB_SIZE / sizeof( hcf_16 ));
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Max Data Length */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MAX_DATA_LEN;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( HCF_MAX_PACKET_SIZE );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* System Scale / Distance between APs */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_SYSTEM_SCALE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->DistanceBetweenAPs );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Channel */
+ if ( lp->CreateIBSS && ( lp->Channel == 0 )) {
+ DBG_TRACE( DbgInfo, "Create IBSS" );
+ lp->Channel = 10;
+ }
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_OWN_CHANNEL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->Channel );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Microwave Robustness */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MICRO_WAVE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->MicrowaveRobustness );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Load Balancing */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_LOAD_BALANCING;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->loadBalancing );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Medium Distribution */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MEDIUM_DISTRIBUTION;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->mediumDistribution );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ /* Country Code */
+
+#ifdef WARP
+ /* Tx Power Level (for supported cards) */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_TX_POW_LVL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->txPowLevel );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Short Retry Limit */
+ /*lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = 0xFC32;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->shortRetryLimit );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ */
+
+ /* Long Retry Limit */
+ /*lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = 0xFC33;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->longRetryLimit );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ */
+
+ /* Supported Rate Set Control */
+ lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_SUPPORTED_RATE_SET_CNTL; //0xFC88;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->srsc[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->srsc[1] );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Basic Rate Set Control */
+ lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_BASIC_RATE_SET_CNTL; //0xFC89;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->brsc[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->brsc[1] );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Frame Burst Limit */
+ /* Defined, but not currently available in Firmware */
+
+#endif // WARP
+
+#ifdef WARP
+ /* Multicast Rate */
+ lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_CNF_MCAST_RATE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->MulticastRate[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->MulticastRate[1] );
+#else
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MCAST_RATE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->MulticastRate[0] );
+#endif // WARP
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Own Name (Station Nickname) */
+ if (( len = ( strlen( lp->StationName ) + 1 ) & ~0x01 ) != 0 ) {
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_NAME : %s\n",
+ // lp->StationName );
+
+ lp->ltvRecord.len = 2 + ( len / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CNF_OWN_NAME;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( strlen( lp->StationName ));
+
+ memcpy( &( lp->ltvRecord.u.u8[2] ), lp->StationName, len );
+ } else {
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_NAME : EMPTY\n" );
+
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_OWN_NAME;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ }
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_NAME result : 0x%04x\n",
+ // hcf_status );
+
+ /* The following are set in STA mode only */
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+
+ /* RTS Threshold */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->RTSThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Port Type */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_PORT_TYPE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->PortType );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Tx Rate Control */
+#ifdef WARP
+ lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->TxRateControl[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->TxRateControl[1] );
+#else
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->TxRateControl[0] );
+#endif // WARP
+
+//;?skip temporarily to see whether the RID or something else is the probelm hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ DBG_TRACE( DbgInfo, "CFG_TX_RATE_CNTL 2.4GHz : 0x%04x\n",
+ lp->TxRateControl[0] );
+ DBG_TRACE( DbgInfo, "CFG_TX_RATE_CNTL 5.0GHz : 0x%04x\n",
+ lp->TxRateControl[1] );
+ DBG_TRACE( DbgInfo, "CFG_TX_RATE_CNTL result : 0x%04x\n",
+ hcf_status );
+ /* Power Management */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_PM_ENABLED;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->PMEnabled );
+// lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0x8001 );
+ DBG_TRACE( DbgInfo, "CFG_CNF_PM_ENABLED : 0x%04x\n", lp->PMEnabled );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ /* Multicast Receive */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MCAST_RX;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->MulticastReceive );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Max Sleep Duration */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MAX_SLEEP_DURATION;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->MaxSleepDuration );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Create IBSS */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CREATE_IBSS;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->CreateIBSS );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Desired SSID */
+ if ((( len = ( strlen( lp->NetworkName ) + 1 ) & ~0x01 ) != 0 ) &&
+ ( strcmp( lp->NetworkName, "ANY" ) != 0 ) &&
+ ( strcmp( lp->NetworkName, "any" ) != 0 )) {
+ //DBG_TRACE( DbgInfo, "CFG_DESIRED_SSID : %s\n",
+ // lp->NetworkName );
+
+ lp->ltvRecord.len = 2 + (len / sizeof(hcf_16));
+ lp->ltvRecord.typ = CFG_DESIRED_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( strlen( lp->NetworkName ));
+
+ memcpy( &( lp->ltvRecord.u.u8[2] ), lp->NetworkName, len );
+ } else {
+ //DBG_TRACE( DbgInfo, "CFG_DESIRED_SSID : ANY\n" );
+
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_DESIRED_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ }
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ //DBG_TRACE( DbgInfo, "CFG_DESIRED_SSID result : 0x%04x\n",
+ // hcf_status );
+ /* Own ATIM window */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_OWN_ATIM_WINDOW;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->atimWindow );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+
+ /* Holdover Duration */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_HOLDOVER_DURATION;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->holdoverDuration );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Promiscuous Mode */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_PROMISCUOUS_MODE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->promiscuousMode );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Authentication */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_AUTHENTICATION;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->authentication );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+#ifdef WARP
+ /* Connection Control */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_CONNECTION_CNTL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->connectionControl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+
+
+ /* Probe data rate */
+ /*lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_PROBE_DATA_RATE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->probeDataRates[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->probeDataRates[1] );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ DBG_TRACE( DbgInfo, "CFG_PROBE_DATA_RATE 2.4GHz : 0x%04x\n",
+ lp->probeDataRates[0] );
+ DBG_TRACE( DbgInfo, "CFG_PROBE_DATA_RATE 5.0GHz : 0x%04x\n",
+ lp->probeDataRates[1] );
+ DBG_TRACE( DbgInfo, "CFG_PROBE_DATA_RATE result : 0x%04x\n",
+ hcf_status );*/
+#endif // WARP
+ } else {
+ /* The following are set in AP mode only */
+#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ /* DTIM Period */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_OWN_DTIM_PERIOD;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->DTIMPeriod );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Multicast PM Buffering */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_MCAST_PM_BUF;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->multicastPMBuffering );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Reject ANY - Closed System */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_REJECT_ANY;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->RejectAny );
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Exclude Unencrypted */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_EXCL_UNENCRYPTED;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ExcludeUnencrypted );
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* IntraBSS Relay */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_INTRA_BSS_RELAY;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->intraBSSRelay );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* RTS Threshold 0 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH0;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->RTSThreshold );
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Tx Rate Control 0 */
+#ifdef WARP
+ lp->ltvRecord.len = 3;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL0;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->TxRateControl[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->TxRateControl[1] );
+#else
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL0;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->TxRateControl[0] );
+#endif // WARP
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Own Beacon Interval */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = 0xFC31;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ownBeaconInterval );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Co-Existence Behavior */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = 0xFCC7;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->coexistence );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+#ifdef USE_WDS
+
+ /* RTS Threshold 1 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH1;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[0].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* RTS Threshold 2 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH2;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[1].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+
+ /* RTS Threshold 3 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH3;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[2].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+
+ /* RTS Threshold 4 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH4;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[3].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+
+ /* RTS Threshold 5 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH5;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[4].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* RTS Threshold 6 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_RTS_THRH6;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[5].rtsThreshold );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+#if 0
+ /* TX Rate Control 1 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL1;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[0].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* TX Rate Control 2 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL2;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[1].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* TX Rate Control 3 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL3;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[2].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* TX Rate Control 4 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL4;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[3].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* TX Rate Control 5 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL5;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[4].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* TX Rate Control 6 */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_TX_RATE_CNTL6;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->wds_port[5].txRateCntl );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+#endif
+
+ /* WDS addresses. It's okay to blindly send these parameters, because
+ the port needs to be enabled, before anything is done with it. */
+
+ /* WDS Address 1 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR1;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[0].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* WDS Address 2 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR2;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[1].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* WDS Address 3 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR3;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[2].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* WDS Address 4 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR4;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[3].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* WDS Address 5 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR5;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[4].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* WDS Address 6 */
+ lp->ltvRecord.len = 4;
+ lp->ltvRecord.typ = CFG_CNF_WDS_ADDR6;
+
+ memcpy( &lp->ltvRecord.u.u8[0], lp->wds_port[5].wdsAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+#endif /* USE_WDS */
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+ }
+
+ /* Own MAC Address */
+ //DBG_TRACE( DbgInfo, "MAC Address : %s\n",
+ // DbgHwAddr( lp->MACAddress ));
+
+ if ( WVLAN_VALID_MAC_ADDRESS( lp->MACAddress )) {
+ /* Make the MAC address valid by:
+ Clearing the multicast bit
+ Setting the local MAC address bit
+ */
+ //lp->MACAddress[0] &= ~0x03; //;?why is this commented out already in 720
+ //lp->MACAddress[0] |= 0x02;
+
+ lp->ltvRecord.len = 1 + ( ETH_ALEN / sizeof( hcf_16 ));
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ //DBG_TRACE( DbgInfo, "CFG_NIC_MAC_ADDR\n" );
+ lp->ltvRecord.typ = CFG_NIC_MAC_ADDR;
+ } else {
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_MAC_ADDR\n" );
+ lp->ltvRecord.typ = CFG_CNF_OWN_MAC_ADDR;
+ }
+ /* MAC address is byte aligned, no endian conversion needed */
+ memcpy( &( lp->ltvRecord.u.u8[0] ), lp->MACAddress, ETH_ALEN );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ //DBG_TRACE( DbgInfo, "CFG_XXX_MAC_ADDR result : 0x%04x\n",
+ // hcf_status );
+
+ /* Update the MAC address in the netdevice struct */
+ memcpy( lp->dev->dev_addr, lp->MACAddress, ETH_ALEN ); //;?what is the purpose of this seemingly complex logic
+ }
+ /* Own SSID */
+ if ((( len = ( strlen( lp->NetworkName ) + 1 ) & ~0x01 ) != 0 ) &&
+ ( strcmp( lp->NetworkName, "ANY" ) != 0 ) &&
+ ( strcmp( lp->NetworkName, "any" ) != 0 )) {
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_SSID : %s\n",
+ // lp->NetworkName );
+ lp->ltvRecord.len = 2 + (len / sizeof(hcf_16));
+ lp->ltvRecord.typ = CFG_CNF_OWN_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( strlen( lp->NetworkName ));
+
+ memcpy( &( lp->ltvRecord.u.u8[2] ), lp->NetworkName, len );
+ } else {
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_SSID : ANY\n" );
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_OWN_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ }
+
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ //DBG_TRACE( DbgInfo, "CFG_CNF_OWN_SSID result : 0x%04x\n",
+ // hcf_status );
+ /* enable/disable encryption */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_ENCRYPTION;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->EnableEncryption );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ /* Set the Authentication Key Management Suite */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_SET_WPA_AUTH_KEY_MGMT_SUITE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->AuthKeyMgmtSuite );
+ hcf_status = hcf_put_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+ /* WEP Keys */
+ wl_set_wep_keys( lp );
+
+ /* Country Code */
+ /* countryInfo, ltvCountryInfo, CFG_CNF_COUNTRY_INFO */
+
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_put_ltv
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * init_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Load the kernel module.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * an errno value otherwise
+ *
+ ******************************************************************************/
+static int __init wl_module_init( void )
+{
+ int result;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_module_init" );
+
+#if DBG
+ /* Convert "standard" PCMCIA parameter pc_debug to a reasonable DebugFlag value.
+ * NOTE: The values all fall through to the lower values. */
+ DbgInfo->DebugFlag = 0;
+ DbgInfo->DebugFlag = DBG_TRACE_ON; //;?get this mess resolved one day
+ if ( pc_debug ) switch( pc_debug ) {
+ case 8:
+ DbgInfo->DebugFlag |= DBG_DS_ON;
+ case 7:
+ DbgInfo->DebugFlag |= DBG_RX_ON | DBG_TX_ON;
+ case 6:
+ DbgInfo->DebugFlag |= DBG_PARAM_ON;
+ case 5:
+ DbgInfo->DebugFlag |= DBG_TRACE_ON;
+ case 4:
+ DbgInfo->DebugFlag |= DBG_VERBOSE_ON;
+ case 1:
+ DbgInfo->DebugFlag |= DBG_DEFAULTS;
+ default:
+ break;
+ }
+#endif /* DBG */
+
+ DBG_ENTER( DbgInfo );
+ printk(KERN_INFO "%s\n", VERSION_INFO);
+ printk(KERN_INFO "*** Modified for kernel 2.6 by Henk de Groot <pe1dnn@amsat.org>\n");
+ printk(KERN_INFO "*** Based on 7.18 version by Andrey Borzenkov <arvidjaar@mail.ru> $Revision: 39 $\n");
+
+
+// ;?#if (HCF_TYPE) & HCF_TYPE_AP
+// DBG_PRINT( "Access Point Mode (AP) Support: YES\n" );
+// #else
+// DBG_PRINT( "Access Point Mode (AP) Support: NO\n" );
+// #endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+ result = wl_adapter_init_module( );
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // init_module
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * cleanup_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Unload the kernel module.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+static void __exit wl_module_exit( void )
+{
+ DBG_FUNC( "wl_module_exit" );
+ DBG_ENTER(DbgInfo);
+
+ wl_adapter_cleanup_module( );
+#if 0 //SCULL_USE_PROC /* don't waste space if unused */
+ remove_proc_entry( "wlags", NULL ); //;?why so a-symmetric compared to location of create_proc_read_entry
+#endif
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // cleanup_module
+/*============================================================================*/
+
+module_init(wl_module_init);
+module_exit(wl_module_exit);
+
+/*******************************************************************************
+ * wl_isr()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The Interrupt Service Routine for the driver.
+ *
+ * PARAMETERS:
+ *
+ * irq - the irq the interrupt came in on
+ * dev_id - a buffer containing information about the request
+ * regs -
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+irqreturn_t wl_isr( int irq, void *dev_id, struct pt_regs *regs )
+{
+ int events;
+ struct net_device *dev = (struct net_device *) dev_id;
+ struct wl_private *lp = NULL;
+ /*------------------------------------------------------------------------*/
+ if (( dev == NULL ) || ( !netif_device_present( dev ))) {
+ return IRQ_NONE;
+ }
+
+ /* Set the wl_private pointer (lp), now that we know that dev is non-null */
+ lp = wl_priv(dev);
+
+#ifdef USE_RTS
+ if ( lp->useRTS == 1 ) {
+ DBG_PRINT( "EXITING ISR, IN RTS MODE...\n" );
+ return;
+ }
+#endif /* USE_RTS */
+
+ /* If we have interrupts pending, then put them on a system task
+ queue. Otherwise turn interrupts back on */
+ events = hcf_action( &lp->hcfCtx, HCF_ACT_INT_OFF );
+
+ if ( events == HCF_INT_PENDING ) {
+ /* Schedule the ISR handler as a bottom-half task in the
+ tq_immediate queue */
+ tasklet_schedule(&lp->task);
+ } else {
+ //DBG_PRINT( "NOT OUR INTERRUPT\n" );
+ hcf_action( &lp->hcfCtx, HCF_ACT_INT_ON );
+ }
+
+ return IRQ_RETVAL(events == HCF_INT_PENDING);
+} // wl_isr
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_isr_handler()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The ISR handler, scheduled to run in a deferred context by the ISR. This
+ * is where the ISR's work actually gets done.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+#define WVLAN_MAX_INT_SERVICES 50
+
+void wl_isr_handler( unsigned long p )
+{
+ struct net_device *dev;
+ unsigned long flags;
+ bool_t stop = TRUE;
+ int count;
+ int result;
+ struct wl_private *lp = (struct wl_private *)p;
+ /*------------------------------------------------------------------------*/
+
+ if ( lp == NULL ) {
+ DBG_PRINT( "wl_isr_handler lp adapter pointer is NULL!!!\n" );
+ } else {
+ wl_lock( lp, &flags );
+
+ dev = (struct net_device *)lp->dev;
+ if ( dev != NULL && netif_device_present( dev ) ) stop = FALSE;
+ for( count = 0; stop == FALSE && count < WVLAN_MAX_INT_SERVICES; count++ ) {
+ stop = TRUE;
+ result = hcf_service_nic( &lp->hcfCtx,
+ (wci_bufp)lp->lookAheadBuf,
+ sizeof( lp->lookAheadBuf ));
+ if ( result == HCF_ERR_MIC ) {
+ wl_wext_event_mic_failed( dev ); /* Send an event that MIC failed */
+ //;?this seems wrong if HCF_ERR_MIC coincides with another event, stop gets FALSE
+ //so why not do it always ;?
+ }
+
+#ifndef USE_MBOX_SYNC
+ if ( lp->hcfCtx.IFB_MBInfoLen != 0 ) { /* anything in the mailbox */
+ wl_mbx( lp );
+ stop = FALSE;
+ }
+#endif
+ /* Check for a Link status event */
+ if ( ( lp->hcfCtx.IFB_LinkStat & CFG_LINK_STAT_FW ) != 0 ) {
+ wl_process_link_status( lp );
+ stop = FALSE;
+ }
+ /* Check for probe response events */
+ if ( lp->ProbeResp.infoType != 0 &&
+ lp->ProbeResp.infoType != 0xFFFF ) {
+ wl_process_probe_response( lp );
+ memset( &lp->ProbeResp, 0, sizeof( lp->ProbeResp ));
+ lp->ProbeResp.infoType = 0xFFFF;
+ stop = FALSE;
+ }
+ /* Check for updated record events */
+ if ( lp->updatedRecord.len != 0xFFFF ) {
+ wl_process_updated_record( lp );
+ lp->updatedRecord.len = 0xFFFF;
+ stop = FALSE;
+ }
+ /* Check for association status events */
+ if ( lp->assoc_stat.len != 0xFFFF ) {
+ wl_process_assoc_status( lp );
+ lp->assoc_stat.len = 0xFFFF;
+ stop = FALSE;
+ }
+ /* Check for security status events */
+ if ( lp->sec_stat.len != 0xFFFF ) {
+ wl_process_security_status( lp );
+ lp->sec_stat.len = 0xFFFF;
+ stop = FALSE;
+ }
+
+#ifdef ENABLE_DMA
+ if ( lp->use_dma ) {
+ /* Check for DMA Rx packets */
+ if ( lp->hcfCtx.IFB_DmaPackets & HREG_EV_RDMAD ) {
+ wl_rx_dma( dev );
+ stop = FALSE;
+ }
+ /* Return Tx DMA descriptors to host */
+ if ( lp->hcfCtx.IFB_DmaPackets & HREG_EV_TDMAD ) {
+ wl_pci_dma_hcf_reclaim_tx( lp );
+ stop = FALSE;
+ }
+ }
+ else
+#endif // ENABLE_DMA
+ {
+ /* Check for Rx packets */
+ if ( lp->hcfCtx.IFB_RxLen != 0 ) {
+ wl_rx( dev );
+ stop = FALSE;
+ }
+ /* Make sure that queued frames get sent */
+ if ( wl_send( lp )) {
+ stop = FALSE;
+ }
+ }
+ }
+ /* We're done, so turn interrupts which were turned off in wl_isr, back on */
+ hcf_action( &lp->hcfCtx, HCF_ACT_INT_ON );
+ wl_unlock( lp, &flags );
+ }
+ return;
+} // wl_isr_handler
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_remove()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Notify the adapter that it has been removed. Since the adapter is gone,
+ * we should no longer try to talk to it.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_remove( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_remove" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ wl_lock( lp, &flags );
+
+ /* stop handling interrupts */
+ wl_act_int_off( lp );
+ lp->is_handling_int = WL_NOT_HANDLING_INT;
+
+ /*
+ * Disable the ports: just change state: since the
+ * card is gone it is useless to talk to it and at
+ * disconnect all state information is lost anyway.
+ */
+ /* Reset portState */
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
+#ifdef USE_WDS
+ //wl_disable_wds_ports( lp );
+#endif // USE_WDS
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+ /* Mark the device as unregistered */
+ lp->is_registered = FALSE;
+
+ /* Deregister the WDS ports as well */
+ WL_WDS_NETDEV_DEREGISTER( lp );
+#ifdef USE_RTS
+ if ( lp->useRTS == 1 ) {
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+ }
+#endif /* USE_RTS */
+
+ /* Inform the HCF that the card has been removed */
+ hcf_connect( &lp->hcfCtx, HCF_DISCONNECT );
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_remove
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_suspend()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Power-down and halt the adapter.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_suspend( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_suspend" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ /* The adapter is suspended:
+ Stop the adapter
+ Power down
+ */
+ wl_lock( lp, &flags );
+
+ /* Disable interrupt handling */
+ wl_act_int_off( lp );
+
+ /* Disconnect */
+ wl_disconnect( lp );
+
+ /* Disable */
+ wl_disable( lp );
+
+ /* Disconnect from the adapter */
+ hcf_connect( &lp->hcfCtx, HCF_DISCONNECT );
+
+ /* Reset portState to be sure (should have been done by wl_disable */
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_suspend
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_resume()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Resume a previously suspended adapter.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_resume(struct net_device *dev)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_resume" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ wl_lock( lp, &flags );
+
+ /* Connect to the adapter */
+ hcf_connect( &lp->hcfCtx, dev->base_addr );
+
+ /* Reset portState */
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+ /* Power might have been off, assume the card lost the firmware*/
+ lp->firmware_present = WL_FRIMWARE_NOT_PRESENT;
+
+ /* Reload the firmware and restart */
+ wl_reset( dev );
+
+ /* Resume interrupt handling */
+ wl_act_int_on( lp );
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_resume
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_release()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function perfroms a check on the device and calls wl_remove() if
+ * necessary. This function can be used for all bus types, but exists mostly
+ * for the benefit of the Card Services driver, as there are times when
+ * wl_remove() does not get called.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_release( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_release" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+ /* If wl_remove() hasn't been called (i.e. when Card Services is shut
+ down with the card in the slot), then call it */
+ if ( lp->is_registered == TRUE ) {
+ DBG_TRACE( DbgInfo, "Calling unregister_netdev(), as it wasn't called yet\n" );
+ wl_remove( dev );
+
+ lp->is_registered = FALSE;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_release
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_get_irq_mask()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Accessor function to retrieve the irq_mask module parameter
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * The irq_mask module parameter
+ *
+ ******************************************************************************/
+p_u16 wl_get_irq_mask( void )
+{
+ return irq_mask;
+} // wl_get_irq_mask
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_get_irq_list()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Accessor function to retrieve the irq_list module parameter
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * The irq_list module parameter
+ *
+ ******************************************************************************/
+p_s8 * wl_get_irq_list( void )
+{
+ return irq_list;
+} // wl_get_irq_list
+/*============================================================================*/
+
+
+
+/*******************************************************************************
+ * wl_enable()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to enable MAC ports
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_enable( struct wl_private *lp )
+{
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_enable" );
+ DBG_ENTER( DbgInfo );
+
+ if ( lp->portState == WVLAN_PORT_STATE_ENABLED ) {
+ DBG_TRACE( DbgInfo, "No action: Card already enabled\n" );
+ } else if ( lp->portState == WVLAN_PORT_STATE_CONNECTED ) {
+ //;?suspicuous logic, how can you be connected without being enabled so this is probably dead code
+ DBG_TRACE( DbgInfo, "No action: Card already connected\n" );
+ } else {
+ hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_ENABLE );
+ if ( hcf_status == HCF_SUCCESS ) {
+ /* Set the status of the NIC to enabled */
+ lp->portState = WVLAN_PORT_STATE_ENABLED; //;?bad mnemonic, NIC iso PORT
+#ifdef ENABLE_DMA
+ if ( lp->use_dma ) {
+ wl_pci_dma_hcf_supply( lp ); //;?always succes?
+ }
+#endif
+ }
+ }
+ if ( hcf_status != HCF_SUCCESS ) { //;?make this an assert
+ DBG_TRACE( DbgInfo, "failed: 0x%x\n", hcf_status );
+ }
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_enable
+/*============================================================================*/
+
+
+#ifdef USE_WDS
+/*******************************************************************************
+ * wl_enable_wds_ports()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to enable the WDS MAC ports 1-6
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_enable_wds_ports( struct wl_private * lp )
+{
+
+ DBG_FUNC( "wl_enable_wds_ports" );
+ DBG_ENTER( DbgInfo );
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ){
+ DBG_ERROR( DbgInfo, "!!!!;? someone misunderstood something !!!!!\n" );
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_enable_wds_ports
+#endif /* USE_WDS */
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_connect()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to connect a MAC port
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_connect( struct wl_private *lp )
+{
+ int hcf_status;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_connect" );
+ DBG_ENTER( DbgInfo );
+
+ if ( lp->portState != WVLAN_PORT_STATE_ENABLED ) {
+ DBG_TRACE( DbgInfo, "No action: Not in enabled state\n" );
+ DBG_LEAVE( DbgInfo );
+ return HCF_SUCCESS;
+ }
+ hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_CONNECT );
+ if ( hcf_status == HCF_SUCCESS ) {
+ lp->portState = WVLAN_PORT_STATE_CONNECTED;
+ }
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_connect
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_disconnect()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to disconnect a MAC port
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_disconnect( struct wl_private *lp )
+{
+ int hcf_status;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_disconnect" );
+ DBG_ENTER( DbgInfo );
+
+ if ( lp->portState != WVLAN_PORT_STATE_CONNECTED ) {
+ DBG_TRACE( DbgInfo, "No action: Not in connected state\n" );
+ DBG_LEAVE( DbgInfo );
+ return HCF_SUCCESS;
+ }
+ hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_DISCONNECT );
+ if ( hcf_status == HCF_SUCCESS ) {
+ lp->portState = WVLAN_PORT_STATE_ENABLED;
+ }
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_disconnect
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_disable()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to disable MAC ports
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ * port - the MAC port to disable
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_disable( struct wl_private *lp )
+{
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_disable" );
+ DBG_ENTER( DbgInfo );
+
+ if ( lp->portState == WVLAN_PORT_STATE_DISABLED ) {
+ DBG_TRACE( DbgInfo, "No action: Port state is disabled\n" );
+ } else {
+ hcf_status = hcf_cntl( &lp->hcfCtx, HCF_CNTL_DISABLE );
+ if ( hcf_status == HCF_SUCCESS ) {
+ /* Set the status of the port to disabled */ //;?bad mnemonic use NIC iso PORT
+ lp->portState = WVLAN_PORT_STATE_DISABLED;
+
+#ifdef ENABLE_DMA
+ if ( lp->use_dma ) {
+ wl_pci_dma_hcf_reclaim( lp );
+ }
+#endif
+ }
+ }
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "failed: 0x%x\n", hcf_status );
+ }
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_disable
+/*============================================================================*/
+
+
+#ifdef USE_WDS
+/*******************************************************************************
+ * wl_disable_wds_ports()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to disable the WDS MAC ports 1-6
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_disable_wds_ports( struct wl_private * lp )
+{
+
+ DBG_FUNC( "wl_disable_wds_ports" );
+ DBG_ENTER( DbgInfo );
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ){
+ DBG_ERROR( DbgInfo, "!!!!;? someone misunderstood something !!!!!\n" );
+ }
+// if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+// wl_disable( lp, HCF_PORT_1 );
+// wl_disable( lp, HCF_PORT_2 );
+// wl_disable( lp, HCF_PORT_3 );
+// wl_disable( lp, HCF_PORT_4 );
+// wl_disable( lp, HCF_PORT_5 );
+// wl_disable( lp, HCF_PORT_6 );
+// }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_disable_wds_ports
+#endif // USE_WDS
+/*============================================================================*/
+
+
+#ifndef USE_MBOX_SYNC
+/*******************************************************************************
+ * wl_mbx()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ * This function is used to read and process a mailbox message.
+ *
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_mbx( struct wl_private *lp )
+{
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_mbx" );
+ DBG_ENTER( DbgInfo );
+ DBG_TRACE( DbgInfo, "Mailbox Info: IFB_MBInfoLen: %d\n",
+ lp->hcfCtx.IFB_MBInfoLen );
+
+ memset( &( lp->ltvRecord ), 0, sizeof( ltv_t ));
+
+ lp->ltvRecord.len = MB_SIZE;
+ lp->ltvRecord.typ = CFG_MB_INFO;
+ hcf_status = hcf_get_info( &lp->hcfCtx, (LTVP)&( lp->ltvRecord ));
+
+ if ( hcf_status != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "hcf_get_info returned 0x%x\n", hcf_status );
+
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+ }
+
+ if ( lp->ltvRecord.typ == CFG_MB_INFO ) {
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+ }
+ /* Endian translate the mailbox data, then process the message */
+ wl_endian_translate_mailbox( &( lp->ltvRecord ));
+ wl_process_mailbox( lp );
+ DBG_LEAVE( DbgInfo );
+ return hcf_status;
+} // wl_mbx
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_endian_translate_mailbox()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function will perform the tedious task of endian translating all
+ * fields withtin a mailbox message which need translating.
+ *
+ * PARAMETERS:
+ *
+ * ltv - pointer to the LTV to endian translate
+ *
+ * RETURNS:
+ *
+ * none
+ *
+ ******************************************************************************/
+void wl_endian_translate_mailbox( ltv_t *ltv )
+{
+
+ DBG_FUNC( "wl_endian_translate_mailbox" );
+ DBG_ENTER( DbgInfo );
+ switch( ltv->typ ) {
+ case CFG_TALLIES:
+ break;
+
+ case CFG_SCAN:
+ {
+ int num_aps;
+ SCAN_RS_STRCT *aps = (SCAN_RS_STRCT *)&ltv->u.u8[0];
+
+ num_aps = (hcf_16)(( (size_t)(ltv->len - 1 ) * 2 ) /
+ ( sizeof( SCAN_RS_STRCT )));
+
+ while( num_aps >= 1 ) {
+ num_aps--;
+
+ aps[num_aps].channel_id =
+ CNV_LITTLE_TO_INT( aps[num_aps].channel_id );
+
+ aps[num_aps].noise_level =
+ CNV_LITTLE_TO_INT( aps[num_aps].noise_level );
+
+ aps[num_aps].signal_level =
+ CNV_LITTLE_TO_INT( aps[num_aps].signal_level );
+
+ aps[num_aps].beacon_interval_time =
+ CNV_LITTLE_TO_INT( aps[num_aps].beacon_interval_time );
+
+ aps[num_aps].capability =
+ CNV_LITTLE_TO_INT( aps[num_aps].capability );
+
+ aps[num_aps].ssid_len =
+ CNV_LITTLE_TO_INT( aps[num_aps].ssid_len );
+
+ aps[num_aps].ssid_val[aps[num_aps].ssid_len] = 0;
+ }
+ }
+ break;
+
+ case CFG_ACS_SCAN:
+ {
+ PROBE_RESP *probe_resp = (PROBE_RESP *)ltv;
+
+ probe_resp->frameControl = CNV_LITTLE_TO_INT( probe_resp->frameControl );
+ probe_resp->durID = CNV_LITTLE_TO_INT( probe_resp->durID );
+ probe_resp->sequence = CNV_LITTLE_TO_INT( probe_resp->sequence );
+ probe_resp->dataLength = CNV_LITTLE_TO_INT( probe_resp->dataLength );
+#ifndef WARP
+ probe_resp->lenType = CNV_LITTLE_TO_INT( probe_resp->lenType );
+#endif // WARP
+ probe_resp->beaconInterval = CNV_LITTLE_TO_INT( probe_resp->beaconInterval );
+ probe_resp->capability = CNV_LITTLE_TO_INT( probe_resp->capability );
+ probe_resp->flags = CNV_LITTLE_TO_INT( probe_resp->flags );
+ }
+ break;
+
+ case CFG_LINK_STAT:
+#define ls ((LINK_STATUS_STRCT *)ltv)
+ ls->linkStatus = CNV_LITTLE_TO_INT( ls->linkStatus );
+ break;
+#undef ls
+
+ case CFG_ASSOC_STAT:
+ {
+ ASSOC_STATUS_STRCT *as = (ASSOC_STATUS_STRCT *)ltv;
+
+ as->assocStatus = CNV_LITTLE_TO_INT( as->assocStatus );
+ }
+ break;
+
+ case CFG_SECURITY_STAT:
+ {
+ SECURITY_STATUS_STRCT *ss = (SECURITY_STATUS_STRCT *)ltv;
+
+ ss->securityStatus = CNV_LITTLE_TO_INT( ss->securityStatus );
+ ss->reason = CNV_LITTLE_TO_INT( ss->reason );
+ }
+ break;
+
+ case CFG_WMP:
+ break;
+
+ case CFG_NULL:
+ break;
+
+ default:
+ break;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_endian_translate_mailbox
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_process_mailbox()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function will process the mailbox data.
+ *
+ * PARAMETERS:
+ *
+ * ltv - pointer to the LTV to be processed.
+ *
+ * RETURNS:
+ *
+ * none
+ *
+ ******************************************************************************/
+void wl_process_mailbox( struct wl_private *lp )
+{
+ ltv_t *ltv;
+ hcf_16 ltv_val = 0xFFFF;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_process_mailbox" );
+ DBG_ENTER( DbgInfo );
+ ltv = &( lp->ltvRecord );
+
+ switch( ltv->typ ) {
+
+ case CFG_TALLIES:
+ DBG_TRACE( DbgInfo, "CFG_TALLIES\n" );
+ break;
+ case CFG_SCAN:
+ DBG_TRACE( DbgInfo, "CFG_SCAN\n" );
+
+ {
+ int num_aps;
+ SCAN_RS_STRCT *aps = (SCAN_RS_STRCT *)&ltv->u.u8[0];
+
+ num_aps = (hcf_16)(( (size_t)(ltv->len - 1 ) * 2 ) /
+ ( sizeof( SCAN_RS_STRCT )));
+
+ lp->scan_results.num_aps = num_aps;
+
+ DBG_TRACE( DbgInfo, "Number of APs: %d\n", num_aps );
+
+ while( num_aps >= 1 ) {
+ num_aps--;
+
+ DBG_TRACE( DbgInfo, "AP : %d\n", num_aps );
+ DBG_TRACE( DbgInfo, "=========================\n" );
+ DBG_TRACE( DbgInfo, "Channel ID : 0x%04x\n",
+ aps[num_aps].channel_id );
+ DBG_TRACE( DbgInfo, "Noise Level : 0x%04x\n",
+ aps[num_aps].noise_level );
+ DBG_TRACE( DbgInfo, "Signal Level : 0x%04x\n",
+ aps[num_aps].signal_level );
+ DBG_TRACE( DbgInfo, "Beacon Interval : 0x%04x\n",
+ aps[num_aps].beacon_interval_time );
+ DBG_TRACE( DbgInfo, "Capability : 0x%04x\n",
+ aps[num_aps].capability );
+ DBG_TRACE( DbgInfo, "SSID Length : 0x%04x\n",
+ aps[num_aps].ssid_len );
+ DBG_TRACE( DbgInfo, "BSSID : %s\n",
+ DbgHwAddr( aps[num_aps].bssid ));
+
+ if ( aps[num_aps].ssid_len != 0 ) {
+ DBG_TRACE( DbgInfo, "SSID : %s.\n",
+ aps[num_aps].ssid_val );
+ } else {
+ DBG_TRACE( DbgInfo, "SSID : %s.\n", "ANY" );
+ }
+
+ DBG_TRACE( DbgInfo, "\n" );
+
+ /* Copy the info to the ScanResult structure in the private
+ adapter struct */
+ memcpy( &( lp->scan_results.APTable[num_aps]), &( aps[num_aps] ),
+ sizeof( SCAN_RS_STRCT ));
+ }
+
+ /* Set scan result to true so that any scan requests will
+ complete */
+ lp->scan_results.scan_complete = TRUE;
+ }
+
+ break;
+ case CFG_ACS_SCAN:
+ DBG_TRACE( DbgInfo, "CFG_ACS_SCAN\n" );
+
+ {
+ PROBE_RESP *probe_rsp = (PROBE_RESP *)ltv;
+ hcf_8 *wpa_ie = NULL;
+ hcf_16 wpa_ie_len = 0;
+
+ DBG_TRACE( DbgInfo, "(%s) =========================\n",
+ lp->dev->name );
+
+ DBG_TRACE( DbgInfo, "(%s) length : 0x%04x.\n",
+ lp->dev->name, probe_rsp->length );
+
+ if ( probe_rsp->length > 1 ) {
+ DBG_TRACE( DbgInfo, "(%s) infoType : 0x%04x.\n",
+ lp->dev->name, probe_rsp->infoType );
+
+ DBG_TRACE( DbgInfo, "(%s) signal : 0x%02x.\n",
+ lp->dev->name, probe_rsp->signal );
+
+ DBG_TRACE( DbgInfo, "(%s) silence : 0x%02x.\n",
+ lp->dev->name, probe_rsp->silence );
+
+ DBG_TRACE( DbgInfo, "(%s) rxFlow : 0x%02x.\n",
+ lp->dev->name, probe_rsp->rxFlow );
+
+ DBG_TRACE( DbgInfo, "(%s) rate : 0x%02x.\n",
+ lp->dev->name, probe_rsp->rate );
+
+ DBG_TRACE( DbgInfo, "(%s) frame cntl : 0x%04x.\n",
+ lp->dev->name, probe_rsp->frameControl );
+
+ DBG_TRACE( DbgInfo, "(%s) durID : 0x%04x.\n",
+ lp->dev->name, probe_rsp->durID );
+
+ DBG_TRACE( DbgInfo, "(%s) address1 : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->address1 ));
+
+ DBG_TRACE( DbgInfo, "(%s) address2 : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->address2 ));
+
+ DBG_TRACE( DbgInfo, "(%s) BSSID : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->BSSID ));
+
+ DBG_TRACE( DbgInfo, "(%s) sequence : 0x%04x.\n",
+ lp->dev->name, probe_rsp->sequence );
+
+ DBG_TRACE( DbgInfo, "(%s) address4 : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->address4 ));
+
+ DBG_TRACE( DbgInfo, "(%s) datalength : 0x%04x.\n",
+ lp->dev->name, probe_rsp->dataLength );
+
+ DBG_TRACE( DbgInfo, "(%s) DA : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->DA ));
+
+ DBG_TRACE( DbgInfo, "(%s) SA : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->SA ));
+
+ //DBG_TRACE( DbgInfo, "(%s) lenType : 0x%04x.\n",
+ // lp->dev->name, probe_rsp->lenType );
+
+ DBG_TRACE( DbgInfo, "(%s) timeStamp : %s\n",
+ lp->dev->name, DbgHwAddr( probe_rsp->timeStamp ));
+
+ DBG_TRACE( DbgInfo, "(%s) beaconInt : 0x%04x.\n",
+ lp->dev->name, probe_rsp->beaconInterval );
+
+ DBG_TRACE( DbgInfo, "(%s) capability : 0x%04x.\n",
+ lp->dev->name, probe_rsp->capability );
+
+ DBG_TRACE( DbgInfo, "(%s) SSID len : 0x%04x.\n",
+ lp->dev->name, probe_rsp->rawData[1] );
+
+ if ( probe_rsp->rawData[1] > 0 ) {
+ char ssid[HCF_MAX_NAME_LEN];
+
+ memset( ssid, 0, sizeof( ssid ));
+ strncpy( ssid, &probe_rsp->rawData[2],
+ probe_rsp->rawData[1] );
+
+ DBG_TRACE( DbgInfo, "(%s) SSID : %s\n",
+ lp->dev->name, ssid );
+ }
+
+ /* Parse out the WPA-IE, if one exists */
+ wpa_ie = wl_parse_wpa_ie( probe_rsp, &wpa_ie_len );
+ if ( wpa_ie != NULL ) {
+ DBG_TRACE( DbgInfo, "(%s) WPA-IE : %s\n",
+ lp->dev->name, wl_print_wpa_ie( wpa_ie, wpa_ie_len ));
+ }
+
+ DBG_TRACE( DbgInfo, "(%s) flags : 0x%04x.\n",
+ lp->dev->name, probe_rsp->flags );
+ }
+
+ DBG_TRACE( DbgInfo, "\n\n" );
+ /* If probe response length is 1, then the scan is complete */
+ if ( probe_rsp->length == 1 ) {
+ DBG_TRACE( DbgInfo, "SCAN COMPLETE\n" );
+ lp->probe_results.num_aps = lp->probe_num_aps;
+ lp->probe_results.scan_complete = TRUE;
+
+ /* Reset the counter for the next scan request */
+ lp->probe_num_aps = 0;
+
+ /* Send a wireless extensions event that the scan completed */
+ wl_wext_event_scan_complete( lp->dev );
+ } else {
+ /* Only copy to the table if the entry is unique; APs sometimes
+ respond more than once to a probe */
+ if ( lp->probe_num_aps == 0 ) {
+ /* Copy the info to the ScanResult structure in the private
+ adapter struct */
+ memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
+ probe_rsp, sizeof( PROBE_RESP ));
+
+ /* Increment the number of APs detected */
+ lp->probe_num_aps++;
+ } else {
+ int count;
+ int unique = 1;
+
+ for( count = 0; count < lp->probe_num_aps; count++ ) {
+ if ( memcmp( &( probe_rsp->BSSID ),
+ lp->probe_results.ProbeTable[count].BSSID,
+ ETH_ALEN ) == 0 ) {
+ unique = 0;
+ }
+ }
+
+ if ( unique ) {
+ /* Copy the info to the ScanResult structure in the
+ private adapter struct. Only copy if there's room in the
+ table */
+ if ( lp->probe_num_aps < MAX_NAPS )
+ {
+ memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
+ probe_rsp, sizeof( PROBE_RESP ));
+ }
+ else
+ {
+ DBG_WARNING( DbgInfo, "Num of scan results exceeds storage, truncating\n" );
+ }
+
+ /* Increment the number of APs detected. Note I do this
+ here even when I don't copy the probe response to the
+ buffer in order to detect the overflow condition */
+ lp->probe_num_aps++;
+ }
+ }
+ }
+ }
+
+ break;
+
+ case CFG_LINK_STAT:
+#define ls ((LINK_STATUS_STRCT *)ltv)
+ DBG_TRACE( DbgInfo, "CFG_LINK_STAT\n" );
+
+ switch( ls->linkStatus ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Link Status : Connected\n" );
+ wl_wext_event_ap( lp->dev );
+ break;
+
+ case 2:
+ DBG_TRACE( DbgInfo, "Link Status : Disconnected\n" );
+ break;
+
+ case 3:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point Change\n" );
+ break;
+
+ case 4:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point Out of Range\n" );
+ break;
+
+ case 5:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point In Range\n" );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "Link Status : UNKNOWN (0x%04x)\n",
+ ls->linkStatus );
+ break;
+ }
+
+ break;
+#undef ls
+
+ case CFG_ASSOC_STAT:
+ DBG_TRACE( DbgInfo, "CFG_ASSOC_STAT\n" );
+
+ {
+ ASSOC_STATUS_STRCT *as = (ASSOC_STATUS_STRCT *)ltv;
+
+ switch( as->assocStatus ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Association Status : STA Associated\n" );
+ break;
+
+ case 2:
+ DBG_TRACE( DbgInfo, "Association Status : STA Reassociated\n" );
+ break;
+
+ case 3:
+ DBG_TRACE( DbgInfo, "Association Status : STA Disassociated\n" );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "Association Status : UNKNOWN (0x%04x)\n",
+ as->assocStatus );
+ break;
+ }
+
+ DBG_TRACE( DbgInfo, "STA Address : %s\n",
+ DbgHwAddr( as->staAddr ));
+
+ if (( as->assocStatus == 2 ) && ( as->len == 8 )) {
+ DBG_TRACE( DbgInfo, "Old AP Address : %s\n",
+ DbgHwAddr( as->oldApAddr ));
+ }
+ }
+
+ break;
+
+ case CFG_SECURITY_STAT:
+ DBG_TRACE( DbgInfo, "CFG_SECURITY_STAT\n" );
+
+ {
+ SECURITY_STATUS_STRCT *ss = (SECURITY_STATUS_STRCT *)ltv;
+
+ switch( ss->securityStatus ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Security Status : Dissassociate [AP]\n" );
+ break;
+
+ case 2:
+ DBG_TRACE( DbgInfo, "Security Status : Deauthenticate [AP]\n" );
+ break;
+
+ case 3:
+ DBG_TRACE( DbgInfo, "Security Status : Authenticate Fail [STA] or [AP]\n" );
+ break;
+
+ case 4:
+ DBG_TRACE( DbgInfo, "Security Status : MIC Fail\n" );
+ break;
+
+ case 5:
+ DBG_TRACE( DbgInfo, "Security Status : Associate Fail\n" );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "Security Status : UNKNOWN %d\n",
+ ss->securityStatus );
+ break;
+ }
+
+ DBG_TRACE( DbgInfo, "STA Address : %s\n", DbgHwAddr( ss->staAddr ));
+
+ DBG_TRACE( DbgInfo, "Reason : 0x%04x \n", ss->reason );
+ }
+
+ break;
+
+ case CFG_WMP:
+ DBG_TRACE( DbgInfo, "CFG_WMP, size is %d bytes\n", ltv->len );
+ {
+ WMP_RSP_STRCT *wmp_rsp = (WMP_RSP_STRCT *)ltv;
+
+ DBG_TRACE( DbgInfo, "CFG_WMP, pdu type is 0x%x\n",
+ wmp_rsp->wmpRsp.wmpHdr.type );
+
+ switch( wmp_rsp->wmpRsp.wmpHdr.type ) {
+ case WVLAN_WMP_PDU_TYPE_LT_RSP:
+ {
+#if DBG
+ LINKTEST_RSP_STRCT *lt_rsp = (LINKTEST_RSP_STRCT *)ltv;
+#endif // DBG
+ DBG_TRACE( DbgInfo, "LINK TEST RESULT\n" );
+ DBG_TRACE( DbgInfo, "================\n" );
+ DBG_TRACE( DbgInfo, "Length : %d.\n", lt_rsp->len );
+
+ DBG_TRACE( DbgInfo, "Name : %s.\n", lt_rsp->ltRsp.ltRsp.name );
+ DBG_TRACE( DbgInfo, "Signal Level : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.signal );
+ DBG_TRACE( DbgInfo, "Noise Level : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.noise );
+ DBG_TRACE( DbgInfo, "Receive Flow : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.rxFlow );
+ DBG_TRACE( DbgInfo, "Data Rate : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.dataRate );
+ DBG_TRACE( DbgInfo, "Protocol : 0x%04x.\n", lt_rsp->ltRsp.ltRsp.protocol );
+ DBG_TRACE( DbgInfo, "Station : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.station );
+ DBG_TRACE( DbgInfo, "Data Rate Cap : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.dataRateCap );
+
+ DBG_TRACE( DbgInfo, "Power Mgmt : 0x%02x 0x%02x 0x%02x 0x%02x.\n",
+ lt_rsp->ltRsp.ltRsp.powerMgmt[0],
+ lt_rsp->ltRsp.ltRsp.powerMgmt[1],
+ lt_rsp->ltRsp.ltRsp.powerMgmt[2],
+ lt_rsp->ltRsp.ltRsp.powerMgmt[3] );
+
+ DBG_TRACE( DbgInfo, "Robustness : 0x%02x 0x%02x 0x%02x 0x%02x.\n",
+ lt_rsp->ltRsp.ltRsp.robustness[0],
+ lt_rsp->ltRsp.ltRsp.robustness[1],
+ lt_rsp->ltRsp.ltRsp.robustness[2],
+ lt_rsp->ltRsp.ltRsp.robustness[3] );
+
+ DBG_TRACE( DbgInfo, "Scaling : 0x%02x.\n", lt_rsp->ltRsp.ltRsp.scaling );
+ }
+
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ break;
+
+ case CFG_NULL:
+ DBG_TRACE( DbgInfo, "CFG_NULL\n" );
+ break;
+
+ case CFG_UPDATED_INFO_RECORD: // Updated Information Record
+ DBG_TRACE( DbgInfo, "UPDATED INFORMATION RECORD\n" );
+
+ ltv_val = CNV_INT_TO_LITTLE( ltv->u.u16[0] );
+
+ /* Check and see which RID was updated */
+ switch( ltv_val ) {
+ case CFG_CUR_COUNTRY_INFO: // Indicate Passive Scan Completion
+ DBG_TRACE( DbgInfo, "Updated country info\n" );
+
+ /* Do I need to hold off on updating RIDs until the process is
+ complete? */
+ wl_connect( lp );
+ break;
+
+ case CFG_PORT_STAT: // Wait for Connect Event
+ //wl_connect( lp );
+
+ break;
+
+ default:
+ DBG_WARNING( DbgInfo, "Unknown RID: 0x%04x\n", ltv_val );
+ }
+
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "UNKNOWN MESSAGE: 0x%04x\n", ltv->typ );
+ break;
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_mailbox
+/*============================================================================*/
+#endif /* ifndef USE_MBOX_SYNC */
+
+#ifdef USE_WDS
+/*******************************************************************************
+ * wl_wds_netdev_register()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function registers net_device structures with the system's network
+ * layer for use with the WDS ports.
+ *
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netdev_register( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_wds_netdev_register" );
+ DBG_ENTER( DbgInfo );
+ //;?why is there no USE_WDS clause like in wl_enable_wds_ports
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if ( WVLAN_VALID_MAC_ADDRESS( lp->wds_port[count].wdsAddress )) {
+ if ( register_netdev( lp->wds_port[count].dev ) != 0 ) {
+ DBG_WARNING( DbgInfo, "net device for WDS port %d could not be registered\n",
+ ( count + 1 ));
+ }
+ lp->wds_port[count].is_registered = TRUE;
+
+ /* Fill out the net_device structs with the MAC addr */
+ memcpy( lp->wds_port[count].dev->dev_addr, lp->MACAddress, ETH_ALEN );
+ lp->wds_port[count].dev->addr_len = ETH_ALEN;
+ }
+ }
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_wds_netdev_register
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wl_wds_netdev_deregister()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function deregisters the WDS net_device structures used by the
+ * system's network layer.
+ *
+ *
+ * PARAMETERS:
+ *
+ * lp - pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netdev_deregister( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wl_wds_netdev_deregister" );
+ DBG_ENTER( DbgInfo );
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if ( WVLAN_VALID_MAC_ADDRESS( lp->wds_port[count].wdsAddress )) {
+ unregister_netdev( lp->wds_port[count].dev );
+ }
+ lp->wds_port[count].is_registered = FALSE;
+ }
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_wds_netdev_deregister
+/*============================================================================*/
+#endif /* USE_WDS */
+
+
+#if 0 //SCULL_USE_PROC /* don't waste space if unused */
+/*
+ * The proc filesystem: function to read and entry
+ */
+int printf_hcf_16( char *s, char *buf, hcf_16* p, int n );
+int printf_hcf_16( char *s, char *buf, hcf_16* p, int n ) {
+
+int i, len;
+
+ len = sprintf(buf, "%s", s );
+ while ( len < 20 ) len += sprintf(buf+len, " " );
+ len += sprintf(buf+len,": " );
+ for ( i = 0; i < n; i++ ) {
+ if ( len % 80 > 75 ) {
+ len += sprintf(buf+len,"\n" );
+ }
+ len += sprintf(buf+len,"%04X ", p[i] );
+ }
+ len += sprintf(buf+len,"\n" );
+ return len;
+} // printf_hcf_16
+
+int printf_hcf_8( char *s, char *buf, hcf_8* p, int n );
+int printf_hcf_8( char *s, char *buf, hcf_8* p, int n ) {
+
+int i, len;
+
+ len = sprintf(buf, "%s", s );
+ while ( len < 20 ) len += sprintf(buf+len, " " );
+ len += sprintf(buf+len,": " );
+ for ( i = 0; i <= n; i++ ) {
+ if ( len % 80 > 77 ) {
+ len += sprintf(buf+len,"\n" );
+ }
+ len += sprintf(buf+len,"%02X ", p[i] );
+ }
+ len += sprintf(buf+len,"\n" );
+ return len;
+} // printf_hcf8
+
+int printf_strct( char *s, char *buf, hcf_16* p );
+int printf_strct( char *s, char *buf, hcf_16* p ) {
+
+int i, len;
+
+ len = sprintf(buf, "%s", s );
+ while ( len < 20 ) len += sprintf(buf+len, " " );
+ len += sprintf(buf+len,": " );
+ for ( i = 0; i <= *p; i++ ) {
+ if ( len % 80 > 75 ) {
+ len += sprintf(buf+len,"\n" );
+ }
+ len += sprintf(buf+len,"%04X ", p[i] );
+ }
+ len += sprintf(buf+len,"\n" );
+ return len;
+} // printf_strct
+
+int scull_read_procmem(char *buf, char **start, off_t offset, int len, int *eof, void *data )
+{
+ struct wl_private *lp = NULL;
+ IFBP ifbp;
+ CFG_HERMES_TALLIES_STRCT *p;
+
+ #define LIMIT (PAGE_SIZE-80) /* don't print any more after this size */
+
+ len=0;
+
+ if ( ( lp = ((struct net_device *)data)->priv ) == NULL ) {
+ len += sprintf(buf+len,"No wl_private in scull_read_procmem\n" );
+ } else if ( lp->wlags49_type == 0 ){
+ ifbp = &lp->hcfCtx;
+ len += sprintf(buf+len,"Magic: 0x%04X\n", ifbp->IFB_Magic );
+ len += sprintf(buf+len,"IOBase: 0x%04X\n", ifbp->IFB_IOBase );
+ len += sprintf(buf+len,"LinkStat: 0x%04X\n", ifbp->IFB_LinkStat );
+ len += sprintf(buf+len,"DSLinkStat: 0x%04X\n", ifbp->IFB_DSLinkStat );
+ len += sprintf(buf+len,"TickIni: 0x%08lX\n", ifbp->IFB_TickIni );
+ len += sprintf(buf+len,"TickCnt: 0x%04X\n", ifbp->IFB_TickCnt );
+ len += sprintf(buf+len,"IntOffCnt: 0x%04X\n", ifbp->IFB_IntOffCnt );
+ len += printf_hcf_16( "IFB_FWIdentity", &buf[len],
+ &ifbp->IFB_FWIdentity.len, ifbp->IFB_FWIdentity.len + 1 );
+ } else if ( lp->wlags49_type == 1 ) {
+ len += sprintf(buf+len,"Channel: 0x%04X\n", lp->Channel );
+/****** len += sprintf(buf+len,"slock: %d\n", lp->slock ); */
+//x struct tq_struct "task: 0x%04X\n", lp->task );
+//x struct net_device_stats "stats: 0x%04X\n", lp->stats );
+#ifdef WIRELESS_EXT
+//x struct iw_statistics "wstats: 0x%04X\n", lp->wstats );
+//x len += sprintf(buf+len,"spy_number: 0x%04X\n", lp->spy_number );
+//x u_char spy_address[IW_MAX_SPY][ETH_ALEN];
+//x struct iw_quality spy_stat[IW_MAX_SPY];
+#endif // WIRELESS_EXT
+ len += sprintf(buf+len,"IFB: 0x%p\n", &lp->hcfCtx );
+ len += sprintf(buf+len,"flags: %#.8lX\n", lp->flags ); //;?use this format from now on
+ len += sprintf(buf+len,"DebugFlag(wl_private) 0x%04X\n", lp->DebugFlag );
+#if DBG
+ len += sprintf(buf+len,"DebugFlag (DbgInfo): 0x%08lX\n", DbgInfo->DebugFlag );
+#endif // DBG
+ len += sprintf(buf+len,"is_registered: 0x%04X\n", lp->is_registered );
+//x CFG_DRV_INFO_STRCT "driverInfo: 0x%04X\n", lp->driverInfo );
+ len += printf_strct( "driverInfo", &buf[len], (hcf_16*)&lp->driverInfo );
+//x CFG_IDENTITY_STRCT "driverIdentity: 0x%04X\n", lp->driverIdentity );
+ len += printf_strct( "driverIdentity", &buf[len], (hcf_16*)&lp->driverIdentity );
+//x CFG_FW_IDENTITY_STRCT "StationIdentity: 0x%04X\n", lp->StationIdentity );
+ len += printf_strct( "StationIdentity", &buf[len], (hcf_16*)&lp->StationIdentity );
+//x CFG_PRI_IDENTITY_STRCT "PrimaryIdentity: 0x%04X\n", lp->PrimaryIdentity );
+ len += printf_strct( "PrimaryIdentity", &buf[len], (hcf_16*)&lp->hcfCtx.IFB_PRIIdentity );
+ len += printf_strct( "PrimarySupplier", &buf[len], (hcf_16*)&lp->hcfCtx.IFB_PRISup );
+//x CFG_PRI_IDENTITY_STRCT "NICIdentity: 0x%04X\n", lp->NICIdentity );
+ len += printf_strct( "NICIdentity", &buf[len], (hcf_16*)&lp->NICIdentity );
+//x ltv_t "ltvRecord: 0x%04X\n", lp->ltvRecord );
+ len += sprintf(buf+len,"txBytes: 0x%08lX\n", lp->txBytes );
+ len += sprintf(buf+len,"maxPort: 0x%04X\n", lp->maxPort ); /* 0 for STA, 6 for AP */
+ /* Elements used for async notification from hardware */
+//x RID_LOG_STRCT RidList[10];
+//x ltv_t "updatedRecord: 0x%04X\n", lp->updatedRecord );
+//x PROBE_RESP "ProbeResp: 0x%04X\n", lp->ProbeResp );
+//x ASSOC_STATUS_STRCT "assoc_stat: 0x%04X\n", lp->assoc_stat );
+//x SECURITY_STATUS_STRCT "sec_stat: 0x%04X\n", lp->sec_stat );
+//x u_char lookAheadBuf[WVLAN_MAX_LOOKAHEAD];
+ len += sprintf(buf+len,"PortType: 0x%04X\n", lp->PortType ); // 1 - 3 (1 [Normal] | 3 [AdHoc])
+ len += sprintf(buf+len,"Channel: 0x%04X\n", lp->Channel ); // 0 - 14 (0)
+//x hcf_16 TxRateControl[2];
+ len += sprintf(buf+len,"TxRateControl[2]: 0x%04X 0x%04X\n",
+ lp->TxRateControl[0], lp->TxRateControl[1] );
+ len += sprintf(buf+len,"DistanceBetweenAPs: 0x%04X\n", lp->DistanceBetweenAPs ); // 1 - 3 (1)
+ len += sprintf(buf+len,"RTSThreshold: 0x%04X\n", lp->RTSThreshold ); // 0 - 2347 (2347)
+ len += sprintf(buf+len,"PMEnabled: 0x%04X\n", lp->PMEnabled ); // 0 - 2, 8001 - 8002 (0)
+ len += sprintf(buf+len,"MicrowaveRobustness: 0x%04X\n", lp->MicrowaveRobustness );// 0 - 1 (0)
+ len += sprintf(buf+len,"CreateIBSS: 0x%04X\n", lp->CreateIBSS ); // 0 - 1 (0)
+ len += sprintf(buf+len,"MulticastReceive: 0x%04X\n", lp->MulticastReceive ); // 0 - 1 (1)
+ len += sprintf(buf+len,"MaxSleepDuration: 0x%04X\n", lp->MaxSleepDuration ); // 0 - 65535 (100)
+//x hcf_8 MACAddress[ETH_ALEN];
+ len += printf_hcf_8( "MACAddress", &buf[len], lp->MACAddress, ETH_ALEN );
+//x char NetworkName[HCF_MAX_NAME_LEN+1];
+ len += sprintf(buf+len,"NetworkName: %.32s\n", lp->NetworkName );
+//x char StationName[HCF_MAX_NAME_LEN+1];
+ len += sprintf(buf+len,"EnableEncryption: 0x%04X\n", lp->EnableEncryption ); // 0 - 1 (0)
+//x char Key1[MAX_KEY_LEN+1];
+ len += printf_hcf_8( "Key1", &buf[len], lp->Key1, MAX_KEY_LEN );
+//x char Key2[MAX_KEY_LEN+1];
+//x char Key3[MAX_KEY_LEN+1];
+//x char Key4[MAX_KEY_LEN+1];
+ len += sprintf(buf+len,"TransmitKeyID: 0x%04X\n", lp->TransmitKeyID ); // 1 - 4 (1)
+//x CFG_DEFAULT_KEYS_STRCT "DefaultKeys: 0x%04X\n", lp->DefaultKeys );
+//x u_char mailbox[MB_SIZE];
+//x char szEncryption[MAX_ENC_LEN];
+ len += sprintf(buf+len,"driverEnable: 0x%04X\n", lp->driverEnable );
+ len += sprintf(buf+len,"wolasEnable: 0x%04X\n", lp->wolasEnable );
+ len += sprintf(buf+len,"atimWindow: 0x%04X\n", lp->atimWindow );
+ len += sprintf(buf+len,"holdoverDuration: 0x%04X\n", lp->holdoverDuration );
+//x hcf_16 MulticastRate[2];
+ len += sprintf(buf+len,"authentication: 0x%04X\n", lp->authentication ); // is this AP specific?
+ len += sprintf(buf+len,"promiscuousMode: 0x%04X\n", lp->promiscuousMode );
+ len += sprintf(buf+len,"DownloadFirmware: 0x%04X\n", lp->DownloadFirmware ); // 0 - 2 (0 [None] | 1 [STA] | 2 [AP])
+ len += sprintf(buf+len,"AuthKeyMgmtSuite: 0x%04X\n", lp->AuthKeyMgmtSuite );
+ len += sprintf(buf+len,"loadBalancing: 0x%04X\n", lp->loadBalancing );
+ len += sprintf(buf+len,"mediumDistribution: 0x%04X\n", lp->mediumDistribution );
+ len += sprintf(buf+len,"txPowLevel: 0x%04X\n", lp->txPowLevel );
+// len += sprintf(buf+len,"shortRetryLimit: 0x%04X\n", lp->shortRetryLimit );
+// len += sprintf(buf+len,"longRetryLimit: 0x%04X\n", lp->longRetryLimit );
+//x hcf_16 srsc[2];
+//x hcf_16 brsc[2];
+ len += sprintf(buf+len,"connectionControl: 0x%04X\n", lp->connectionControl );
+//x //hcf_16 probeDataRates[2];
+ len += sprintf(buf+len,"ownBeaconInterval: 0x%04X\n", lp->ownBeaconInterval );
+ len += sprintf(buf+len,"coexistence: 0x%04X\n", lp->coexistence );
+//x WVLAN_FRAME "txF: 0x%04X\n", lp->txF );
+//x WVLAN_LFRAME txList[DEFAULT_NUM_TX_FRAMES];
+//x struct list_head "txFree: 0x%04X\n", lp->txFree );
+//x struct list_head txQ[WVLAN_MAX_TX_QUEUES];
+ len += sprintf(buf+len,"netif_queue_on: 0x%04X\n", lp->netif_queue_on );
+ len += sprintf(buf+len,"txQ_count: 0x%04X\n", lp->txQ_count );
+//x DESC_STRCT "desc_rx: 0x%04X\n", lp->desc_rx );
+//x DESC_STRCT "desc_tx: 0x%04X\n", lp->desc_tx );
+//x WVLAN_PORT_STATE "portState: 0x%04X\n", lp->portState );
+//x ScanResult "scan_results: 0x%04X\n", lp->scan_results );
+//x ProbeResult "probe_results: 0x%04X\n", lp->probe_results );
+ len += sprintf(buf+len,"probe_num_aps: 0x%04X\n", lp->probe_num_aps );
+ len += sprintf(buf+len,"use_dma: 0x%04X\n", lp->use_dma );
+//x DMA_STRCT "dma: 0x%04X\n", lp->dma );
+#ifdef USE_RTS
+ len += sprintf(buf+len,"useRTS: 0x%04X\n", lp->useRTS );
+#endif // USE_RTS
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ //;?I guess not. This should be brought under Debug mode only
+ len += sprintf(buf+len,"DTIMPeriod: 0x%04X\n", lp->DTIMPeriod ); // 1 - 255 (1)
+ len += sprintf(buf+len,"multicastPMBuffering: 0x%04X\n", lp->multicastPMBuffering );
+ len += sprintf(buf+len,"RejectAny: 0x%04X\n", lp->RejectAny ); // 0 - 1 (0)
+ len += sprintf(buf+len,"ExcludeUnencrypted: 0x%04X\n", lp->ExcludeUnencrypted ); // 0 - 1 (1)
+ len += sprintf(buf+len,"intraBSSRelay: 0x%04X\n", lp->intraBSSRelay );
+ len += sprintf(buf+len,"wlags49_type: 0x%08lX\n", lp->wlags49_type );
+#ifdef USE_WDS
+//x WVLAN_WDS_IF wds_port[NUM_WDS_PORTS];
+#endif // USE_WDS
+#endif // HCF_AP
+ } else if ( lp->wlags49_type == 2 ){
+ len += sprintf(buf+len,"tallies to be added\n" );
+//Hermes Tallies (IFB substructure) {
+ p = &lp->hcfCtx.IFB_NIC_Tallies;
+ len += sprintf(buf+len,"TxUnicastFrames: %08lX\n", p->TxUnicastFrames );
+ len += sprintf(buf+len,"TxMulticastFrames: %08lX\n", p->TxMulticastFrames );
+ len += sprintf(buf+len,"TxFragments: %08lX\n", p->TxFragments );
+ len += sprintf(buf+len,"TxUnicastOctets: %08lX\n", p->TxUnicastOctets );
+ len += sprintf(buf+len,"TxMulticastOctets: %08lX\n", p->TxMulticastOctets );
+ len += sprintf(buf+len,"TxDeferredTransmissions: %08lX\n", p->TxDeferredTransmissions );
+ len += sprintf(buf+len,"TxSingleRetryFrames: %08lX\n", p->TxSingleRetryFrames );
+ len += sprintf(buf+len,"TxMultipleRetryFrames: %08lX\n", p->TxMultipleRetryFrames );
+ len += sprintf(buf+len,"TxRetryLimitExceeded: %08lX\n", p->TxRetryLimitExceeded );
+ len += sprintf(buf+len,"TxDiscards: %08lX\n", p->TxDiscards );
+ len += sprintf(buf+len,"RxUnicastFrames: %08lX\n", p->RxUnicastFrames );
+ len += sprintf(buf+len,"RxMulticastFrames: %08lX\n", p->RxMulticastFrames );
+ len += sprintf(buf+len,"RxFragments: %08lX\n", p->RxFragments );
+ len += sprintf(buf+len,"RxUnicastOctets: %08lX\n", p->RxUnicastOctets );
+ len += sprintf(buf+len,"RxMulticastOctets: %08lX\n", p->RxMulticastOctets );
+ len += sprintf(buf+len,"RxFCSErrors: %08lX\n", p->RxFCSErrors );
+ len += sprintf(buf+len,"RxDiscardsNoBuffer: %08lX\n", p->RxDiscardsNoBuffer );
+ len += sprintf(buf+len,"TxDiscardsWrongSA: %08lX\n", p->TxDiscardsWrongSA );
+ len += sprintf(buf+len,"RxWEPUndecryptable: %08lX\n", p->RxWEPUndecryptable );
+ len += sprintf(buf+len,"RxMsgInMsgFragments: %08lX\n", p->RxMsgInMsgFragments );
+ len += sprintf(buf+len,"RxMsgInBadMsgFragments: %08lX\n", p->RxMsgInBadMsgFragments );
+ len += sprintf(buf+len,"RxDiscardsWEPICVError: %08lX\n", p->RxDiscardsWEPICVError );
+ len += sprintf(buf+len,"RxDiscardsWEPExcluded: %08lX\n", p->RxDiscardsWEPExcluded );
+#if (HCF_EXT) & HCF_EXT_TALLIES_FW
+ //to be added ;?
+#endif // HCF_EXT_TALLIES_FW
+ } else if ( lp->wlags49_type & 0x8000 ) { //;?kludgy but it is unclear to me were else to place this
+#if DBG
+ DbgInfo->DebugFlag = lp->wlags49_type & 0x7FFF;
+#endif // DBG
+ lp->wlags49_type = 0; //default to IFB again ;?
+ } else {
+ len += sprintf(buf+len,"unknown value for wlags49_type: 0x%08lX\n", lp->wlags49_type );
+ len += sprintf(buf+len,"0x0000 - IFB\n" );
+ len += sprintf(buf+len,"0x0001 - wl_private\n" );
+ len += sprintf(buf+len,"0x0002 - Tallies\n" );
+ len += sprintf(buf+len,"0x8xxx - Change debufflag\n" );
+ len += sprintf(buf+len,"ERROR 0001\nWARNING 0002\nNOTICE 0004\nTRACE 0008\n" );
+ len += sprintf(buf+len,"VERBOSE 0010\nPARAM 0020\nBREAK 0040\nRX 0100\n" );
+ len += sprintf(buf+len,"TX 0200\nDS 0400\n" );
+ }
+ return len;
+} // scull_read_procmem
+
+static void proc_write(const char *name, write_proc_t *w, void *data)
+{
+ struct proc_dir_entry * entry = create_proc_entry(name, S_IFREG | S_IWUSR, NULL);
+ if (entry) {
+ entry->write_proc = w;
+ entry->data = data;
+ }
+} // proc_write
+
+static int write_int(struct file *file, const char *buffer, unsigned long count, void *data)
+{
+ static char proc_number[11];
+ unsigned int nr = 0;
+
+ DBG_FUNC( "write_int" );
+ DBG_ENTER( DbgInfo );
+
+ if (count > 9) {
+ count = -EINVAL;
+ } else if ( copy_from_user(proc_number, buffer, count) ) {
+ count = -EFAULT;
+ }
+ if (count > 0 ) {
+ proc_number[count] = 0;
+ nr = wl_atoi( proc_number );
+ *(unsigned int *)data = nr;
+ if ( nr & 0x8000 ) { //;?kludgy but it is unclear to me were else to place this
+#if DBG
+ DbgInfo->DebugFlag = nr & 0x7FFF;
+#endif // DBG
+ }
+ }
+ DBG_PRINT( "value: %08X\n", nr );
+ DBG_LEAVE( DbgInfo );
+ return count;
+} // write_int
+
+#endif /* SCULL_USE_PROC */
+
+#ifdef DN554
+#define RUN_AT(x) (jiffies+(x)) //"borrowed" from include/pcmcia/k_compat.h
+#define DS_OOR 0x8000 //Deepsleep OutOfRange Status
+
+ lp->timer_oor_cnt = DS_OOR;
+ init_timer( &lp->timer_oor );
+ lp->timer_oor.function = timer_oor;
+ lp->timer_oor.data = (unsigned long)lp;
+ lp->timer_oor.expires = RUN_AT( 3 * HZ );
+ add_timer( &lp->timer_oor );
+ printk( "<5>wl_enable: %ld\n", jiffies ); //;?remove me 1 day
+#endif //DN554
+#ifdef DN554
+/*******************************************************************************
+ * timer_oor()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ *
+ * PARAMETERS:
+ *
+ * arg - a u_long representing a pointer to a dev_link_t structure for the
+ * device to be released.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void timer_oor( u_long arg )
+{
+ struct wl_private *lp = (struct wl_private *)arg;
+
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "timer_oor" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "arg", "0x%08lx", arg );
+
+ printk( "<5>timer_oor: %ld 0x%04X\n", jiffies, lp->timer_oor_cnt ); //;?remove me 1 day
+ lp->timer_oor_cnt += 10;
+ if ( (lp->timer_oor_cnt & ~DS_OOR) > 300 ) {
+ lp->timer_oor_cnt = 300;
+ }
+ lp->timer_oor_cnt |= DS_OOR;
+ init_timer( &lp->timer_oor );
+ lp->timer_oor.function = timer_oor;
+ lp->timer_oor.data = (unsigned long)lp;
+ lp->timer_oor.expires = RUN_AT( (lp->timer_oor_cnt & ~DS_OOR) * HZ );
+ add_timer( &lp->timer_oor );
+
+ DBG_LEAVE( DbgInfo );
+} // timer_oor
+#endif //DN554
+
+MODULE_LICENSE("Dual BSD/GPL");
diff --git a/drivers/staging/wlags49_h2/wl_main.h b/drivers/staging/wlags49_h2/wl_main.h
new file mode 100644
index 000000000000..e57e2cb074bc
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_main.h
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing device specific routines and driver init/un-init.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/23 04:51:21 $
+ * $Revision: 1.4 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_main.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_MAIN_H__
+#define __WL_MAIN_H__
+
+
+
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+int wl_insert( struct net_device *dev );
+
+void wl_set_wep_keys( struct wl_private *lp );
+
+int wl_put_ltv_init( struct wl_private *lp );
+
+int wl_put_ltv( struct wl_private *lp );
+
+p_u16 wl_get_irq_mask( void );
+
+p_s8 * wl_get_irq_list( void );
+
+int wl_reset( struct net_device *dev );
+
+int wl_go( struct wl_private *lp );
+
+int wl_apply( struct wl_private *lp );
+
+irqreturn_t wl_isr( int irq, void *dev_id, struct pt_regs *regs );
+
+void wl_remove( struct net_device *dev );
+
+void wl_suspend( struct net_device *dev );
+
+void wl_resume( struct net_device *dev );
+
+void wl_release( struct net_device *dev );
+
+int wl_enable( struct wl_private *lp );
+
+int wl_connect( struct wl_private *lp );
+
+int wl_disable( struct wl_private *lp );
+
+int wl_disconnect( struct wl_private *lp );
+
+void wl_enable_wds_ports( struct wl_private * lp );
+
+void wl_disable_wds_ports( struct wl_private * lp );
+
+#ifndef USE_MBOX_SYNC
+
+int wl_mbx( struct wl_private *lp );
+void wl_endian_translate_mailbox( ltv_t *ltv );
+void wl_process_mailbox( struct wl_private *lp );
+
+#endif /* USE_MBOX_SYNC */
+
+
+#ifdef USE_WDS
+
+void wl_wds_netdev_register( struct wl_private *lp );
+void wl_wds_netdev_deregister( struct wl_private *lp );
+
+#endif /* USE_WDS */
+
+
+#ifdef USE_WDS
+
+#define WL_WDS_NETDEV_REGISTER( ARG ) wl_wds_netdev_register( ARG )
+#define WL_WDS_NETDEV_DEREGISTER( ARG ) wl_wds_netdev_deregister( ARG )
+
+#else
+
+#define WL_WDS_NETDEV_REGISTER( ARG )
+#define WL_WDS_NETDEV_DEREGISTER( ARG )
+
+#endif /* USE_WDS */
+#endif // __WL_MAIN_H__
diff --git a/drivers/staging/wlags49_h2/wl_netdev.c b/drivers/staging/wlags49_h2/wl_netdev.c
new file mode 100644
index 000000000000..a00207b17d2b
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_netdev.c
@@ -0,0 +1,2085 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains handler functions registered with the net_device
+ * structure.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/03 13:33:44 $
+ * $Revision: 1.8 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_netdev.c,v $
+ *
+ ******************************************************************************/
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+// #include <linux/sched.h>
+// #include <linux/ptrace.h>
+// #include <linux/slab.h>
+// #include <linux/ctype.h>
+// #include <linux/string.h>
+//#include <linux/timer.h>
+// #include <linux/interrupt.h>
+// #include <linux/in.h>
+// #include <linux/delay.h>
+// #include <linux/skbuff.h>
+// #include <asm/io.h>
+// #include <asm/system.h>
+// #include <asm/bitops.h>
+
+#include <linux/netdevice.h>
+#include <linux/ethtool.h>
+#include <linux/etherdevice.h>
+// #include <linux/skbuff.h>
+// #include <linux/if_arp.h>
+// #include <linux/ioport.h>
+
+#include <debug.h>
+
+#include <hcf.h>
+#include <dhf.h>
+// #include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_priv.h>
+#include <wl_main.h>
+#include <wl_netdev.h>
+#include <wl_wext.h>
+
+#ifdef USE_PROFILE
+#include <wl_profile.h>
+#endif /* USE_PROFILE */
+
+#ifdef BUS_PCMCIA
+#include <wl_cs.h>
+#endif /* BUS_PCMCIA */
+
+#ifdef BUS_PCI
+#include <wl_pci.h>
+#endif /* BUS_PCI */
+
+
+/*******************************************************************************
+ * global variables
+ ******************************************************************************/
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif /* DBG */
+
+
+#if HCF_ENCAP
+#define MTU_MAX (HCF_MAX_MSG - ETH_HLEN - 8)
+#else
+#define MTU_MAX (HCF_MAX_MSG - ETH_HLEN)
+#endif
+
+//static int mtu = MTU_MAX;
+//MODULE_PARM(mtu, "i");
+//MODULE_PARM_DESC(mtu, "MTU");
+
+/*******************************************************************************
+ * macros
+ ******************************************************************************/
+#define BLOCK_INPUT(buf, len) \
+ desc->buf_addr = buf; \
+ desc->BUF_SIZE = len; \
+ status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+
+#define BLOCK_INPUT_DMA(buf, len) memcpy( buf, desc_next->buf_addr, pktlen )
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+
+/*******************************************************************************
+ * wl_init()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * We never need to do anything when a "Wireless" device is "initialized"
+ * by the net software, because we only register already-found cards.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_init( struct net_device *dev )
+{
+// unsigned long flags;
+// struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_init" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ /* Nothing to do, but grab the spinlock anyway just in case we ever need
+ this routine */
+// wl_lock( lp, &flags );
+// wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_init
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_config()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Implement the SIOCSIFMAP interface.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ * map - a pointer to the device's ifmap structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno otherwise
+ *
+ ******************************************************************************/
+int wl_config( struct net_device *dev, struct ifmap *map )
+{
+ DBG_FUNC( "wl_config" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+ DBG_PARAM( DbgInfo, "map", "0x%p", map );
+
+ /* The only thing we care about here is a port change. Since this not needed,
+ ignore the request. */
+ DBG_TRACE( DbgInfo, "%s: %s called.\n", dev->name, __FUNC__ );
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_config
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_stats()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return the current device statistics.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * a pointer to a net_device_stats structure containing the network
+ * statistics.
+ *
+ ******************************************************************************/
+struct net_device_stats *wl_stats( struct net_device *dev )
+{
+#ifdef USE_WDS
+ int count;
+#endif /* USE_WDS */
+ unsigned long flags;
+ struct net_device_stats *pStats;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+ //DBG_FUNC( "wl_stats" );
+ //DBG_ENTER( DbgInfo );
+ //DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ pStats = NULL;
+
+ wl_lock( lp, &flags );
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ wl_unlock( lp, &flags );
+
+ //DBG_LEAVE( DbgInfo );
+ return NULL;
+ }
+#endif /* USE_RTS */
+
+ /* Return the statistics for the appropriate device */
+#ifdef USE_WDS
+
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( dev == lp->wds_port[count].dev ) {
+ pStats = &( lp->wds_port[count].stats );
+ }
+ }
+
+#endif /* USE_WDS */
+
+ /* If pStats is still NULL, then the device is not a WDS port */
+ if( pStats == NULL ) {
+ pStats = &( lp->stats );
+ }
+
+ wl_unlock( lp, &flags );
+
+ //DBG_LEAVE( DbgInfo );
+
+ return pStats;
+} // wl_stats
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_open()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Open the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno otherwise
+ *
+ ******************************************************************************/
+int wl_open(struct net_device *dev)
+{
+ int status = HCF_SUCCESS;
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_open" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock( lp, &flags );
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "Skipping device open, in RTS mode\n" );
+ wl_unlock( lp, &flags );
+ DBG_LEAVE( DbgInfo );
+ return -EIO;
+ }
+#endif /* USE_RTS */
+
+#ifdef USE_PROFILE
+ parse_config( dev );
+#endif
+
+ if( lp->portState == WVLAN_PORT_STATE_DISABLED ) {
+ DBG_TRACE( DbgInfo, "Enabling Port 0\n" );
+ status = wl_enable( lp );
+
+ if( status != HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "Enable port 0 failed: 0x%x\n", status );
+ }
+ }
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ if ( strlen( lp->fw_image_filename ) ) {
+ DBG_TRACE( DbgInfo, ";???? Kludgy way to force a download\n" );
+ status = wl_go( lp );
+ } else {
+ status = wl_apply( lp );
+ }
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ if( status != HCF_SUCCESS ) {
+ // Unsuccesfull, try reset of the card to recover
+ status = wl_reset( dev );
+ }
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ if( status == HCF_SUCCESS ) {
+ netif_carrier_on( dev );
+ WL_WDS_NETIF_CARRIER_ON( lp );
+
+ lp->is_handling_int = WL_HANDLING_INT; // Start handling interrupts
+ wl_act_int_on( lp );
+
+ netif_start_queue( dev );
+ WL_WDS_NETIF_START_QUEUE( lp );
+ } else {
+ wl_hcf_error( dev, status ); /* Report the error */
+ netif_device_detach( dev ); /* Stop the device and queue */
+ }
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return status;
+} // wl_open
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_close()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Close the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno otherwise
+ *
+ ******************************************************************************/
+int wl_close( struct net_device *dev )
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC("wl_close");
+ DBG_ENTER(DbgInfo);
+ DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+
+ /* Mark the adapter as busy */
+ netif_stop_queue( dev );
+ WL_WDS_NETIF_STOP_QUEUE( lp );
+
+ netif_carrier_off( dev );
+ WL_WDS_NETIF_CARRIER_OFF( lp );
+
+ /* Shutdown the adapter:
+ Disable adapter interrupts
+ Stop Tx/Rx
+ Update statistics
+ Set low power mode
+ */
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+ lp->is_handling_int = WL_NOT_HANDLING_INT; // Stop handling interrupts
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "Skipping device close, in RTS mode\n" );
+ wl_unlock( lp, &flags );
+ DBG_LEAVE( DbgInfo );
+ return -EIO;
+ }
+#endif /* USE_RTS */
+
+ /* Disable the ports */
+ wl_disable( lp );
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_close
+/*============================================================================*/
+
+static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
+{
+ strncpy(info->driver, DRIVER_NAME, sizeof(info->driver) - 1);
+ strncpy(info->version, DRV_VERSION_STR, sizeof(info->version) - 1);
+// strncpy(info.fw_version, priv->fw_name,
+// sizeof(info.fw_version) - 1);
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
+ if (dev->dev.parent) {
+ dev_set_name(dev->dev.parent, "%s", info->bus_info);
+ //strncpy(info->bus_info, dev->dev.parent->bus_id,
+ // sizeof(info->bus_info) - 1);
+#else
+ if (dev->class_dev.parent) {
+ sizeof(info->bus_info) - 1);
+#endif
+ } else {
+ snprintf(info->bus_info, sizeof(info->bus_info) - 1,
+ "PCMCIA FIXME");
+// "PCMCIA 0x%lx", priv->hw.iobase);
+ }
+} // wl_get_drvinfo
+
+static struct ethtool_ops wl_ethtool_ops = {
+ .get_drvinfo = wl_get_drvinfo,
+ .get_link = ethtool_op_get_link,
+};
+
+
+/*******************************************************************************
+ * wl_ioctl()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The IOCTL handler for the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device struct.
+ * rq - a pointer to the IOCTL request buffer.
+ * cmd - the IOCTL command code.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_ioctl( struct net_device *dev, struct ifreq *rq, int cmd )
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_ioctl" );
+ DBG_ENTER(DbgInfo);
+ DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+ DBG_PARAM(DbgInfo, "rq", "0x%p", rq);
+ DBG_PARAM(DbgInfo, "cmd", "0x%04x", cmd);
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ /* Handle any RTS IOCTL here */
+ if( cmd == WL_IOCTL_RTS ) {
+ DBG_TRACE( DbgInfo, "IOCTL: WL_IOCTL_RTS\n" );
+ ret = wvlan_rts( (struct rtsreq *)rq, dev->base_addr );
+ } else {
+ DBG_TRACE( DbgInfo, "IOCTL not supported in RTS mode: 0x%X\n", cmd );
+ ret = -EOPNOTSUPP;
+ }
+
+ goto out_act_int_on_unlock;
+ }
+#endif /* USE_RTS */
+
+ /* Only handle UIL IOCTL requests when the UIL has the system blocked. */
+ if( !(( lp->flags & WVLAN2_UIL_BUSY ) && ( cmd != WVLAN2_IOCTL_UIL ))) {
+#ifdef USE_UIL
+ struct uilreq *urq = (struct uilreq *)rq;
+#endif /* USE_UIL */
+
+ switch( cmd ) {
+ // ================== Private IOCTLs (up to 16) ==================
+#ifdef USE_UIL
+ case WVLAN2_IOCTL_UIL:
+ DBG_TRACE( DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL\n" );
+ ret = wvlan_uil( urq, lp );
+ break;
+#endif /* USE_UIL */
+
+ default:
+ DBG_TRACE(DbgInfo, "IOCTL CODE NOT SUPPORTED: 0x%X\n", cmd );
+ ret = -EOPNOTSUPP;
+ break;
+ }
+ } else {
+ DBG_WARNING( DbgInfo, "DEVICE IS BUSY, CANNOT PROCESS REQUEST\n" );
+ ret = -EBUSY;
+ }
+
+#ifdef USE_RTS
+out_act_int_on_unlock:
+#endif /* USE_RTS */
+ wl_act_int_on( lp );
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wl_ioctl
+/*============================================================================*/
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+void wl_poll(struct net_device *dev)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ struct pt_regs regs;
+
+ wl_lock( lp, &flags );
+ wl_isr(dev->irq, dev, &regs);
+ wl_unlock( lp, &flags );
+}
+#endif
+
+/*******************************************************************************
+ * wl_tx_timeout()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler called when, for some reason, a Tx request is not completed.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device struct.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_tx_timeout( struct net_device *dev )
+{
+#ifdef USE_WDS
+ int count;
+#endif /* USE_WDS */
+ unsigned long flags;
+ struct wl_private *lp = wl_priv(dev);
+ struct net_device_stats *pStats = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_tx_timeout" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_WARNING( DbgInfo, "%s: Transmit timeout.\n", dev->name );
+
+ wl_lock( lp, &flags );
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "Skipping tx_timeout handler, in RTS mode\n" );
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+ }
+#endif /* USE_RTS */
+
+ /* Figure out which device (the "root" device or WDS port) this timeout
+ is for */
+#ifdef USE_WDS
+
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( dev == lp->wds_port[count].dev ) {
+ pStats = &( lp->wds_port[count].stats );
+
+ /* Break the loop so that we can use the counter to access WDS
+ information in the private structure */
+ break;
+ }
+ }
+
+#endif /* USE_WDS */
+
+ /* If pStats is still NULL, then the device is not a WDS port */
+ if( pStats == NULL ) {
+ pStats = &( lp->stats );
+ }
+
+ /* Accumulate the timeout error */
+ pStats->tx_errors++;
+
+ wl_unlock( lp, &flags );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_tx_timeout
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_send()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The routine which performs data transmits.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's wl_private struct.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * 1 on error
+ *
+ ******************************************************************************/
+int wl_send( struct wl_private *lp )
+{
+
+ int status;
+ DESC_STRCT *desc;
+ WVLAN_LFRAME *txF = NULL;
+ struct list_head *element;
+ int len;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_send" );
+
+ if( lp == NULL ) {
+ DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" );
+ return FALSE;
+ }
+ if( lp->dev == NULL ) {
+ DBG_ERROR( DbgInfo, "net_device struct in wl_private is NULL\n" );
+ return FALSE;
+ }
+
+ /* Check for the availability of FIDs; if none are available, don't take any
+ frames off the txQ */
+ if( lp->hcfCtx.IFB_RscInd == 0 ) {
+ return FALSE;
+ }
+
+ /* Reclaim the TxQ Elements and place them back on the free queue */
+ if( !list_empty( &( lp->txQ[0] ))) {
+ element = lp->txQ[0].next;
+
+ txF = (WVLAN_LFRAME * )list_entry( element, WVLAN_LFRAME, node );
+ if( txF != NULL ) {
+ lp->txF.skb = txF->frame.skb;
+ lp->txF.port = txF->frame.port;
+
+ txF->frame.skb = NULL;
+ txF->frame.port = 0;
+
+ list_del( &( txF->node ));
+ list_add( element, &( lp->txFree ));
+
+ lp->txQ_count--;
+
+ if( lp->txQ_count < TX_Q_LOW_WATER_MARK ) {
+ if( lp->netif_queue_on == FALSE ) {
+ DBG_TX( DbgInfo, "Kickstarting Q: %d\n", lp->txQ_count );
+ netif_wake_queue( lp->dev );
+ WL_WDS_NETIF_WAKE_QUEUE( lp );
+ lp->netif_queue_on = TRUE;
+ }
+ }
+ }
+ }
+
+ if( lp->txF.skb == NULL ) {
+ return FALSE;
+ }
+
+ /* If the device has resources (FIDs) available, then Tx the packet */
+ /* Format the TxRequest and send it to the adapter */
+ len = lp->txF.skb->len < ETH_ZLEN ? ETH_ZLEN : lp->txF.skb->len;
+
+ desc = &( lp->desc_tx );
+ desc->buf_addr = lp->txF.skb->data;
+ desc->BUF_CNT = len;
+ desc->next_desc_addr = NULL;
+
+ status = hcf_send_msg( &( lp->hcfCtx ), desc, lp->txF.port );
+
+ if( status == HCF_SUCCESS ) {
+ lp->dev->trans_start = jiffies;
+
+ DBG_TX( DbgInfo, "Transmit...\n" );
+
+ if( lp->txF.port == HCF_PORT_0 ) {
+ lp->stats.tx_packets++;
+ lp->stats.tx_bytes += lp->txF.skb->len;
+ }
+
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[(( lp->txF.port >> 8 ) - 1)].stats.tx_packets++;
+ lp->wds_port[(( lp->txF.port >> 8 ) - 1)].stats.tx_bytes += lp->txF.skb->len;
+ }
+
+#endif /* USE_WDS */
+
+ /* Free the skb and perform queue cleanup, as the buffer was
+ transmitted successfully */
+ dev_kfree_skb( lp->txF.skb );
+
+ lp->txF.skb = NULL;
+ lp->txF.port = 0;
+ }
+
+ return TRUE;
+} // wl_send
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The Tx handler function for the network layer.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff structure containing the data to transfer.
+ * dev - a pointer to the device's net_device structure.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * 1 on error
+ *
+ ******************************************************************************/
+int wl_tx( struct sk_buff *skb, struct net_device *dev, int port )
+{
+ unsigned long flags;
+ struct wl_private *lp = wl_priv(dev);
+ WVLAN_LFRAME *txF = NULL;
+ struct list_head *element;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_tx" );
+
+ /* Grab the spinlock */
+ wl_lock( lp, &flags );
+
+ if( lp->flags & WVLAN2_UIL_BUSY ) {
+ DBG_WARNING( DbgInfo, "UIL has device blocked\n" );
+ /* Start dropping packets here??? */
+ wl_unlock( lp, &flags );
+ return 1;
+ }
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_PRINT( "RTS: we're getting a Tx...\n" );
+ wl_unlock( lp, &flags );
+ return 1;
+ }
+#endif /* USE_RTS */
+
+ if( !lp->use_dma ) {
+ /* Get an element from the queue */
+ element = lp->txFree.next;
+ txF = (WVLAN_LFRAME *)list_entry( element, WVLAN_LFRAME, node );
+ if( txF == NULL ) {
+ DBG_ERROR( DbgInfo, "Problem with list_entry\n" );
+ wl_unlock( lp, &flags );
+ return 1;
+ }
+ /* Fill out the frame */
+ txF->frame.skb = skb;
+ txF->frame.port = port;
+ /* Move the frame to the txQ */
+ /* NOTE: Here's where we would do priority queueing */
+ list_del( &( txF->node ));
+ list_add( &( txF->node ), &( lp->txQ[0] ));
+
+ lp->txQ_count++;
+ if( lp->txQ_count >= DEFAULT_NUM_TX_FRAMES ) {
+ DBG_TX( DbgInfo, "Q Full: %d\n", lp->txQ_count );
+ if( lp->netif_queue_on == TRUE ) {
+ netif_stop_queue( lp->dev );
+ WL_WDS_NETIF_STOP_QUEUE( lp );
+ lp->netif_queue_on = FALSE;
+ }
+ }
+ }
+ wl_act_int_off( lp ); /* Disable Interrupts */
+
+ /* Send the data to the hardware using the appropriate method */
+#ifdef ENABLE_DMA
+ if( lp->use_dma ) {
+ wl_send_dma( lp, skb, port );
+ }
+ else
+#endif
+ {
+ wl_send( lp );
+ }
+ /* Re-enable Interrupts, release the spinlock and return */
+ wl_act_int_on( lp );
+ wl_unlock( lp, &flags );
+ return 0;
+} // wl_tx
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_rx()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The routine which performs data reception.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * 1 on error
+ *
+ ******************************************************************************/
+int wl_rx(struct net_device *dev)
+{
+ int port;
+ struct sk_buff *skb;
+ struct wl_private *lp = wl_priv(dev);
+ int status;
+ hcf_16 pktlen;
+ hcf_16 hfs_stat;
+ DESC_STRCT *desc;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC("wl_rx")
+ DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+
+ if(!( lp->flags & WVLAN2_UIL_BUSY )) {
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_PRINT( "RTS: We're getting an Rx...\n" );
+ return -EIO;
+ }
+#endif /* USE_RTS */
+
+ /* Read the HFS_STAT register from the lookahead buffer */
+ hfs_stat = (hcf_16)(( lp->lookAheadBuf[HFS_STAT] ) |
+ ( lp->lookAheadBuf[HFS_STAT + 1] << 8 ));
+
+ /* Make sure the frame isn't bad */
+ if(( hfs_stat & HFS_STAT_ERR ) != HCF_SUCCESS ) {
+ DBG_WARNING( DbgInfo, "HFS_STAT_ERROR (0x%x) in Rx Packet\n",
+ lp->lookAheadBuf[HFS_STAT] );
+ return -EIO;
+ }
+
+ /* Determine what port this packet is for */
+ port = ( hfs_stat >> 8 ) & 0x0007;
+ DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
+
+ if(( pktlen = lp->hcfCtx.IFB_RxLen ) != 0 ) {
+ if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
+ /* Set the netdev based on the port */
+ switch( port ) {
+#ifdef USE_WDS
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ skb->dev = lp->wds_port[port-1].dev;
+ break;
+#endif /* USE_WDS */
+
+ case 0:
+ default:
+ skb->dev = dev;
+ break;
+ }
+
+ desc = &( lp->desc_rx );
+
+ desc->next_desc_addr = NULL;
+
+/*
+#define BLOCK_INPUT(buf, len) \
+ desc->buf_addr = buf; \
+ desc->BUF_SIZE = len; \
+ status = hcf_rcv_msg(&(lp->hcfCtx), desc, 0)
+*/
+
+ GET_PACKET( skb->dev, skb, pktlen );
+
+ if( status == HCF_SUCCESS ) {
+ netif_rx( skb );
+
+ if( port == 0 ) {
+ lp->stats.rx_packets++;
+ lp->stats.rx_bytes += pktlen;
+ }
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[port-1].stats.rx_packets++;
+ lp->wds_port[port-1].stats.rx_bytes += pktlen;
+ }
+#endif /* USE_WDS */
+
+ dev->last_rx = jiffies;
+
+#ifdef WIRELESS_EXT
+#ifdef WIRELESS_SPY
+ if( lp->spydata.spy_number > 0 ) {
+ char *srcaddr = skb->mac.raw + MAC_ADDR_SIZE;
+
+ wl_spy_gather( dev, srcaddr );
+ }
+#endif /* WIRELESS_SPY */
+#endif /* WIRELESS_EXT */
+ } else {
+ DBG_ERROR( DbgInfo, "Rx request to card FAILED\n" );
+
+ if( port == 0 ) {
+ lp->stats.rx_dropped++;
+ }
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[port-1].stats.rx_dropped++;
+ }
+#endif /* USE_WDS */
+
+ dev_kfree_skb( skb );
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "Could not alloc skb\n" );
+
+ if( port == 0 ) {
+ lp->stats.rx_dropped++;
+ }
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[port-1].stats.rx_dropped++;
+ }
+#endif /* USE_WDS */
+ }
+ }
+ }
+
+ return 0;
+} // wl_rx
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_multicast()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Function to handle multicast packets
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+#ifdef NEW_MULTICAST
+
+void wl_multicast( struct net_device *dev )
+{
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA //;?should we return an error status in AP mode
+//;?seems reasonable that even an AP-only driver could afford this small additional footprint
+
+ int x;
+ struct dev_mc_list *mclist;
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_multicast" );
+ DBG_ENTER( DbgInfo );
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+
+ if( !wl_adapter_is_open( dev )) {
+ DBG_LEAVE( DbgInfo );
+ return;
+ }
+
+#if DBG
+ if( DBG_FLAGS( DbgInfo ) & DBG_PARAM_ON ) {
+ DBG_PRINT(" flags: %s%s%s\n",
+ ( dev->flags & IFF_PROMISC ) ? "Promiscous " : "",
+ ( dev->flags & IFF_MULTICAST ) ? "Multicast " : "",
+ ( dev->flags & IFF_ALLMULTI ) ? "All-Multicast" : "" );
+
+ DBG_PRINT( " mc_count: %d\n", dev->mc_count );
+
+ for( x = 0, mclist = dev->mc_list; mclist && x < dev->mc_count;
+ x++, mclist = mclist->next ) {
+ DBG_PRINT( " %s (%d)\n", DbgHwAddr(mclist->dmi_addr),
+ mclist->dmi_addrlen );
+ }
+ }
+#endif /* DBG */
+
+ if(!( lp->flags & WVLAN2_UIL_BUSY )) {
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "Skipping multicast, in RTS mode\n" );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+ }
+#endif /* USE_RTS */
+
+ wl_lock( lp, &flags );
+ wl_act_int_off( lp );
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ if( dev->flags & IFF_PROMISC ) {
+ /* Enable promiscuous mode */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_PROMISCUOUS_MODE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 1 );
+ DBG_PRINT( "Enabling Promiscuous mode (IFF_PROMISC)\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ }
+ else if(( dev->mc_count > HCF_MAX_MULTICAST ) ||
+ ( dev->flags & IFF_ALLMULTI )) {
+ /* Shutting off this filter will enable all multicast frames to
+ be sent up from the device; however, this is a static RID, so
+ a call to wl_apply() is needed */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_RX_ALL_GROUP_ADDR;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ DBG_PRINT( "Enabling all multicast mode (IFF_ALLMULTI)\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ wl_apply( lp );
+ }
+ else if( dev->mc_count != 0 ) {
+ /* Set the multicast addresses */
+ lp->ltvRecord.len = ( dev->mc_count * 3 ) + 1;
+ lp->ltvRecord.typ = CFG_GROUP_ADDR;
+
+ for( x = 0, mclist = dev->mc_list;
+ ( x < dev->mc_count ) && ( mclist != NULL );
+ x++, mclist = mclist->next ) {
+ memcpy( &( lp->ltvRecord.u.u8[x * ETH_ALEN] ),
+ mclist->dmi_addr, ETH_ALEN );
+ }
+ DBG_PRINT( "Setting multicast list\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ } else {
+ /* Disable promiscuous mode */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_PROMISCUOUS_MODE;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ DBG_PRINT( "Disabling Promiscuous mode\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ /* Disable multicast mode */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_GROUP_ADDR;
+ DBG_PRINT( "Disabling Multicast mode\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ /* Turning on this filter will prevent all multicast frames from
+ being sent up from the device; however, this is a static RID,
+ so a call to wl_apply() is needed */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CNF_RX_ALL_GROUP_ADDR;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 1 );
+ DBG_PRINT( "Disabling all multicast mode (IFF_ALLMULTI)\n" );
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ wl_apply( lp );
+ }
+ }
+ wl_act_int_on( lp );
+ wl_unlock( lp, &flags );
+ }
+ DBG_LEAVE( DbgInfo );
+#endif /* HCF_STA */
+} // wl_multicast
+/*============================================================================*/
+
+#else /* NEW_MULTICAST */
+
+void wl_multicast( struct net_device *dev, int num_addrs, void *addrs )
+{
+ DBG_FUNC( "wl_multicast");
+ DBG_ENTER(DbgInfo);
+
+ DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
+ DBG_PARAM( DbgInfo, "num_addrs", "%d", num_addrs );
+ DBG_PARAM( DbgInfo, "addrs", "0x%p", addrs );
+
+#error Obsolete set multicast interface!
+
+ DBG_LEAVE( DbgInfo );
+} // wl_multicast
+/*============================================================================*/
+
+#endif /* NEW_MULTICAST */
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
+static const struct net_device_ops wl_netdev_ops =
+{
+ .ndo_start_xmit = &wl_tx_port0,
+
+ .ndo_set_config = &wl_config,
+ .ndo_get_stats = &wl_stats,
+ .ndo_set_multicast_list = &wl_multicast,
+
+ .ndo_init = &wl_insert,
+ .ndo_open = &wl_adapter_open,
+ .ndo_stop = &wl_adapter_close,
+ .ndo_do_ioctl = &wl_ioctl,
+
+#ifdef HAVE_TX_TIMEOUT
+ .ndo_tx_timeout = &wl_tx_timeout,
+#endif
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = wl_poll,
+#endif
+};
+#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
+
+/*******************************************************************************
+ * wl_device_alloc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Create instances of net_device and wl_private for the new adapter
+ * and register the device's entry points in the net_device structure.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * a pointer to an allocated and initialized net_device struct for this
+ * device.
+ *
+ ******************************************************************************/
+struct net_device * wl_device_alloc( void )
+{
+ struct net_device *dev = NULL;
+ struct wl_private *lp = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_device_alloc" );
+ DBG_ENTER( DbgInfo );
+
+ /* Alloc a net_device struct */
+ dev = alloc_etherdev(sizeof(struct wl_private));
+ if (!dev)
+ return NULL;
+
+ /* Initialize the 'next' pointer in the struct. Currently only used for PCI,
+ but do it here just in case it's used for other buses in the future */
+ lp = wl_priv(dev);
+
+
+ /* Check MTU */
+ if( dev->mtu > MTU_MAX )
+ {
+ DBG_WARNING( DbgInfo, "%s: MTU set too high, limiting to %d.\n",
+ dev->name, MTU_MAX );
+ dev->mtu = MTU_MAX;
+ }
+
+ /* Setup the function table in the device structure. */
+
+ dev->wireless_handlers = (struct iw_handler_def *)&wl_iw_handler_def;
+ lp->wireless_data.spy_data = &lp->spy_data;
+ dev->wireless_data = &lp->wireless_data;
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
+ dev->netdev_ops = &wl_netdev_ops;
+#else
+ dev->hard_start_xmit = &wl_tx_port0;
+
+ dev->set_config = &wl_config;
+ dev->get_stats = &wl_stats;
+ dev->set_multicast_list = &wl_multicast;
+
+ dev->init = &wl_insert;
+ dev->open = &wl_adapter_open;
+ dev->stop = &wl_adapter_close;
+ dev->do_ioctl = &wl_ioctl;
+
+#ifdef HAVE_TX_TIMEOUT
+ dev->tx_timeout = &wl_tx_timeout;
+#endif
+
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ dev->poll_controller = wl_poll;
+#endif
+
+#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
+
+#ifdef HAVE_TX_TIMEOUT
+ dev->watchdog_timeo = TX_TIMEOUT;
+#endif
+
+ dev->ethtool_ops = &wl_ethtool_ops;
+
+ netif_stop_queue( dev );
+
+ /* Allocate virutal devices for WDS support if needed */
+ WL_WDS_DEVICE_ALLOC( lp );
+
+ DBG_LEAVE( DbgInfo );
+ return dev;
+} // wl_device_alloc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_device_dealloc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Free instances of net_device and wl_private strcutres for an adapter
+ * and perform basic cleanup.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_device_dealloc( struct net_device *dev )
+{
+// struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_device_dealloc" );
+ DBG_ENTER( DbgInfo );
+
+ /* Dealloc the WDS ports */
+ WL_WDS_DEVICE_DEALLOC( lp );
+
+ free_netdev( dev );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_device_dealloc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port0()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_0.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_0.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port0( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 0\n" );
+
+ return wl_tx( skb, dev, HCF_PORT_0 );
+#ifdef ENABLE_DMA
+ return wl_tx_dma( skb, dev, HCF_PORT_0 );
+#endif
+} // wl_tx_port0
+/*============================================================================*/
+
+#ifdef USE_WDS
+
+/*******************************************************************************
+ * wl_tx_port1()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_1.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_1.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port1( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 1\n" );
+ return wl_tx( skb, dev, HCF_PORT_1 );
+} // wl_tx_port1
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port2()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_2.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_2.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port2( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 2\n" );
+ return wl_tx( skb, dev, HCF_PORT_2 );
+} // wl_tx_port2
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port3()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_3.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_3.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port3( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 3\n" );
+ return wl_tx( skb, dev, HCF_PORT_3 );
+} // wl_tx_port3
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port4()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_4.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_4.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port4( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 4\n" );
+ return wl_tx( skb, dev, HCF_PORT_4 );
+} // wl_tx_port4
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port5()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_5.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_5.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port5( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 5\n" );
+ return wl_tx( skb, dev, HCF_PORT_5 );
+} // wl_tx_port5
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_tx_port6()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler routine for Tx over HCF_PORT_6.
+ *
+ * PARAMETERS:
+ *
+ * skb - a pointer to the sk_buff to transmit.
+ * dev - a pointer to a net_device structure representing HCF_PORT_6.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+int wl_tx_port6( struct sk_buff *skb, struct net_device *dev )
+{
+ DBG_TX( DbgInfo, "Tx on Port 6\n" );
+ return wl_tx( skb, dev, HCF_PORT_6 );
+} // wl_tx_port6
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_device_alloc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Create instances of net_device to represent the WDS ports, and register
+ * the device's entry points in the net_device structure.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A, but will place pointers to the allocated and initialized net_device
+ * structs in the private adapter structure.
+ *
+ ******************************************************************************/
+void wl_wds_device_alloc( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_wds_device_alloc" );
+ DBG_ENTER( DbgInfo );
+
+ /* WDS support requires additional net_device structs to be allocated,
+ so that user space apps can use these virtual devices to specify the
+ port on which to Tx/Rx */
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ struct net_device *dev_wds = NULL;
+
+ dev_wds = kmalloc( sizeof( struct net_device ), GFP_KERNEL );
+ memset( dev_wds, 0, sizeof( struct net_device ));
+
+ ether_setup( dev_wds );
+
+ lp->wds_port[count].dev = dev_wds;
+
+ /* Re-use wl_init for all the devices, as it currently does nothing, but
+ is required. Re-use the stats/tx_timeout handler for all as well; the
+ WDS port which is requesting these operations can be determined by
+ the net_device pointer. Set the private member of all devices to point
+ to the same net_device struct; that way, all information gets
+ funnelled through the one "real" net_device. Name the WDS ports
+ "wds<n>" */
+ lp->wds_port[count].dev->init = &wl_init;
+ lp->wds_port[count].dev->get_stats = &wl_stats;
+ lp->wds_port[count].dev->tx_timeout = &wl_tx_timeout;
+ lp->wds_port[count].dev->watchdog_timeo = TX_TIMEOUT;
+ lp->wds_port[count].dev->priv = lp;
+
+ sprintf( lp->wds_port[count].dev->name, "wds%d", count );
+ }
+
+ /* Register the Tx handlers */
+ lp->wds_port[0].dev->hard_start_xmit = &wl_tx_port1;
+ lp->wds_port[1].dev->hard_start_xmit = &wl_tx_port2;
+ lp->wds_port[2].dev->hard_start_xmit = &wl_tx_port3;
+ lp->wds_port[3].dev->hard_start_xmit = &wl_tx_port4;
+ lp->wds_port[4].dev->hard_start_xmit = &wl_tx_port5;
+ lp->wds_port[5].dev->hard_start_xmit = &wl_tx_port6;
+
+ WL_WDS_NETIF_STOP_QUEUE( lp );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_wds_device_alloc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_device_dealloc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Free instances of net_device structures used to support WDS.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_device_dealloc( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_wds_device_dealloc" );
+ DBG_ENTER( DbgInfo );
+
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ struct net_device *dev_wds = NULL;
+
+ dev_wds = lp->wds_port[count].dev;
+
+ if( dev_wds != NULL ) {
+ if( dev_wds->flags & IFF_UP ) {
+ dev_close( dev_wds );
+ dev_wds->flags &= ~( IFF_UP | IFF_RUNNING );
+ }
+
+ kfree( dev_wds );
+ lp->wds_port[count].dev = NULL;
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_wds_device_dealloc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_netif_start_queue()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to start the netif queues of all the "virtual" network devices
+ * which repesent the WDS ports.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netif_start_queue( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ if( lp != NULL ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( lp->wds_port[count].is_registered &&
+ lp->wds_port[count].netif_queue_on == FALSE ) {
+ netif_start_queue( lp->wds_port[count].dev );
+ lp->wds_port[count].netif_queue_on = TRUE;
+ }
+ }
+ }
+
+ return;
+} // wl_wds_netif_start_queue
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_netif_stop_queue()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to stop the netif queues of all the "virtual" network devices
+ * which repesent the WDS ports.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netif_stop_queue( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ if( lp != NULL ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( lp->wds_port[count].is_registered &&
+ lp->wds_port[count].netif_queue_on == TRUE ) {
+ netif_stop_queue( lp->wds_port[count].dev );
+ lp->wds_port[count].netif_queue_on = FALSE;
+ }
+ }
+ }
+
+ return;
+} // wl_wds_netif_stop_queue
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_netif_wake_queue()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to wake the netif queues of all the "virtual" network devices
+ * which repesent the WDS ports.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netif_wake_queue( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ if( lp != NULL ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( lp->wds_port[count].is_registered &&
+ lp->wds_port[count].netif_queue_on == FALSE ) {
+ netif_wake_queue( lp->wds_port[count].dev );
+ lp->wds_port[count].netif_queue_on = TRUE;
+ }
+ }
+ }
+
+ return;
+} // wl_wds_netif_wake_queue
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_netif_carrier_on()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to signal the network layer that carrier is present on all of the
+ * "virtual" network devices which repesent the WDS ports.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netif_carrier_on( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ if( lp != NULL ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( lp->wds_port[count].is_registered ) {
+ netif_carrier_on( lp->wds_port[count].dev );
+ }
+ }
+ }
+
+ return;
+} // wl_wds_netif_carrier_on
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_wds_netif_carrier_off()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Used to signal the network layer that carrier is NOT present on all of
+ * the "virtual" network devices which repesent the WDS ports.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wds_netif_carrier_off( struct wl_private *lp )
+{
+ int count;
+ /*------------------------------------------------------------------------*/
+
+ if( lp != NULL ) {
+ for( count = 0; count < NUM_WDS_PORTS; count++ ) {
+ if( lp->wds_port[count].is_registered ) {
+ netif_carrier_off( lp->wds_port[count].dev );
+ }
+ }
+ }
+
+ return;
+} // wl_wds_netif_carrier_off
+/*============================================================================*/
+
+#endif /* USE_WDS */
+
+#ifdef ENABLE_DMA
+/*******************************************************************************
+ * wl_send_dma()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The routine which performs data transmits when using busmaster DMA.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's wl_private struct.
+ * skb - a pointer to the network layer's data buffer.
+ * port - the Hermes port on which to transmit.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * 1 on error
+ *
+ ******************************************************************************/
+int wl_send_dma( struct wl_private *lp, struct sk_buff *skb, int port )
+{
+ int len;
+ DESC_STRCT *desc = NULL;
+ DESC_STRCT *desc_next = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_send_dma" );
+
+ if( lp == NULL )
+ {
+ DBG_ERROR( DbgInfo, "Private adapter struct is NULL\n" );
+ return FALSE;
+ }
+
+ if( lp->dev == NULL )
+ {
+ DBG_ERROR( DbgInfo, "net_device struct in wl_private is NULL\n" );
+ return FALSE;
+ }
+
+ /* AGAIN, ALL THE QUEUEING DONE HERE IN I/O MODE IS NOT PERFORMED */
+
+ if( skb == NULL )
+ {
+ DBG_WARNING (DbgInfo, "Nothing to send.\n");
+ return FALSE;
+ }
+
+ len = skb->len;
+
+ /* Get a free descriptor */
+ desc = wl_pci_dma_get_tx_packet( lp );
+
+ if( desc == NULL )
+ {
+ if( lp->netif_queue_on == TRUE ) {
+ netif_stop_queue( lp->dev );
+ WL_WDS_NETIF_STOP_QUEUE( lp );
+ lp->netif_queue_on = FALSE;
+
+ dev_kfree_skb( skb );
+ return 0;
+ }
+ }
+
+ SET_BUF_CNT( desc, /*HCF_DMA_FD_CNT*/HFS_ADDR_DEST );
+ SET_BUF_SIZE( desc, HCF_DMA_TX_BUF1_SIZE );
+
+ desc_next = desc->next_desc_addr;
+
+ if( desc_next->buf_addr == NULL )
+ {
+ DBG_ERROR( DbgInfo, "DMA descriptor buf_addr is NULL\n" );
+ return FALSE;
+ }
+
+ /* Copy the payload into the DMA packet */
+ memcpy( desc_next->buf_addr, skb->data, len );
+
+ SET_BUF_CNT( desc_next, len );
+ SET_BUF_SIZE( desc_next, HCF_MAX_PACKET_SIZE );
+
+ hcf_dma_tx_put( &( lp->hcfCtx ), desc, 0 );
+
+ /* Free the skb and perform queue cleanup, as the buffer was
+ transmitted successfully */
+ dev_kfree_skb( skb );
+
+ return TRUE;
+} // wl_send_dma
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_rx_dma()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The routine which performs data reception when using busmaster DMA.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * 1 on error
+ *
+ ******************************************************************************/
+int wl_rx_dma( struct net_device *dev )
+{
+ int port;
+ hcf_16 pktlen;
+ hcf_16 hfs_stat;
+ struct sk_buff *skb;
+ struct wl_private *lp = NULL;
+ DESC_STRCT *desc, *desc_next;
+ //CFG_MB_INFO_RANGE2_STRCT x;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC("wl_rx")
+ DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+
+ if((( lp = (struct wl_private *)dev->priv ) != NULL ) &&
+ !( lp->flags & WVLAN2_UIL_BUSY )) {
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_PRINT( "RTS: We're getting an Rx...\n" );
+ return -EIO;
+ }
+#endif /* USE_RTS */
+
+ //if( lp->dma.status == 0 )
+ //{
+ desc = hcf_dma_rx_get( &( lp->hcfCtx ));
+
+ if( desc != NULL )
+ {
+ /* Check and see if we rcvd. a WMP frame */
+ /*
+ if((( *(hcf_8 *)&desc->buf_addr[HFS_STAT] ) &
+ ( HFS_STAT_MSG_TYPE | HFS_STAT_ERR )) == HFS_STAT_WMP_MSG )
+ {
+ DBG_TRACE( DbgInfo, "Got a WMP frame\n" );
+
+ x.len = sizeof( CFG_MB_INFO_RANGE2_STRCT ) / sizeof( hcf_16 );
+ x.typ = CFG_MB_INFO;
+ x.base_typ = CFG_WMP;
+ x.frag_cnt = 2;
+ x.frag_buf[0].frag_len = GET_BUF_CNT( descp ) / sizeof( hcf_16 );
+ x.frag_buf[0].frag_addr = (hcf_8 *) descp->buf_addr ;
+ x.frag_buf[1].frag_len = ( GET_BUF_CNT( descp->next_desc_addr ) + 1 ) / sizeof( hcf_16 );
+ x.frag_buf[1].frag_addr = (hcf_8 *) descp->next_desc_addr->buf_addr ;
+
+ hcf_put_info( &( lp->hcfCtx ), (LTVP)&x );
+ }
+ */
+
+ desc_next = desc->next_desc_addr;
+
+ /* Make sure the buffer isn't empty */
+ if( GET_BUF_CNT( desc ) == 0 ) {
+ DBG_WARNING( DbgInfo, "Buffer is empty!\n" );
+
+ /* Give the descriptor back to the HCF */
+ hcf_dma_rx_put( &( lp->hcfCtx ), desc );
+ return -EIO;
+ }
+
+ /* Read the HFS_STAT register from the lookahead buffer */
+ hfs_stat = (hcf_16)( desc->buf_addr[HFS_STAT/2] );
+
+ /* Make sure the frame isn't bad */
+ if(( hfs_stat & HFS_STAT_ERR ) != HCF_SUCCESS )
+ {
+ DBG_WARNING( DbgInfo, "HFS_STAT_ERROR (0x%x) in Rx Packet\n",
+ desc->buf_addr[HFS_STAT/2] );
+
+ /* Give the descriptor back to the HCF */
+ hcf_dma_rx_put( &( lp->hcfCtx ), desc );
+ return -EIO;
+ }
+
+ /* Determine what port this packet is for */
+ port = ( hfs_stat >> 8 ) & 0x0007;
+ DBG_RX( DbgInfo, "Rx frame for port %d\n", port );
+
+ if(( pktlen = GET_BUF_CNT( desc_next )) != 0 ) {
+ if(( skb = ALLOC_SKB( pktlen )) != NULL ) {
+ switch( port ) {
+#ifdef USE_WDS
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ skb->dev = lp->wds_port[port-1].dev;
+ break;
+#endif /* USE_WDS */
+
+ case 0:
+ default:
+ skb->dev = dev;
+ break;
+ }
+
+ GET_PACKET_DMA( skb->dev, skb, pktlen );
+
+ /* Give the descriptor back to the HCF */
+ hcf_dma_rx_put( &( lp->hcfCtx ), desc );
+
+ netif_rx( skb );
+
+ if( port == 0 ) {
+ lp->stats.rx_packets++;
+ lp->stats.rx_bytes += pktlen;
+ }
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[port-1].stats.rx_packets++;
+ lp->wds_port[port-1].stats.rx_bytes += pktlen;
+ }
+#endif /* USE_WDS */
+
+ dev->last_rx = jiffies;
+
+ } else {
+ DBG_ERROR( DbgInfo, "Could not alloc skb\n" );
+
+ if( port == 0 )
+ {
+ lp->stats.rx_dropped++;
+ }
+#ifdef USE_WDS
+ else
+ {
+ lp->wds_port[port-1].stats.rx_dropped++;
+ }
+#endif /* USE_WDS */
+ }
+ }
+ }
+ //}
+ }
+
+ return 0;
+} // wl_rx_dma
+/*============================================================================*/
+#endif // ENABLE_DMA
diff --git a/drivers/staging/wlags49_h2/wl_netdev.h b/drivers/staging/wlags49_h2/wl_netdev.h
new file mode 100644
index 000000000000..ad04c8eedabf
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_netdev.h
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required by the network layerentry points
+ * into the driver.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_netdev.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_NETDEV_H__
+#define __WL_NETDEV_H__
+
+
+
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+int wl_init( struct net_device *dev );
+
+int wl_config( struct net_device *dev, struct ifmap *map );
+
+struct net_device *wl_device_alloc( void );
+
+void wl_device_dealloc( struct net_device *dev );
+
+int wl_open( struct net_device *dev );
+
+int wl_close( struct net_device *dev );
+
+int wl_ioctl( struct net_device *dev, struct ifreq *rq, int cmd );
+
+int wl_tx( struct sk_buff *skb, struct net_device *dev, int port );
+
+int wl_send( struct wl_private *lp );
+
+int wl_rx( struct net_device *dev );
+
+void wl_tx_timeout( struct net_device *dev );
+
+struct net_device_stats *wl_stats( struct net_device *dev );
+
+
+#ifdef ENABLE_DMA
+int wl_send_dma( struct wl_private *lp, struct sk_buff *skb, int port );
+int wl_rx_dma( struct net_device *dev );
+#endif
+
+#ifdef NEW_MULTICAST
+void wl_multicast( struct net_device *dev );
+#else
+void wl_multicast( struct net_device *dev, int num_addrs, void *addrs );
+#endif // NEW_MULTICAST
+
+
+int wl_tx_port0( struct sk_buff *skb, struct net_device *dev );
+
+
+#ifdef USE_WDS
+
+int wl_tx_port1( struct sk_buff *skb, struct net_device *dev );
+int wl_tx_port2( struct sk_buff *skb, struct net_device *dev );
+int wl_tx_port3( struct sk_buff *skb, struct net_device *dev );
+int wl_tx_port4( struct sk_buff *skb, struct net_device *dev );
+int wl_tx_port5( struct sk_buff *skb, struct net_device *dev );
+int wl_tx_port6( struct sk_buff *skb, struct net_device *dev );
+
+void wl_wds_device_alloc( struct wl_private *lp );
+void wl_wds_device_dealloc( struct wl_private *lp );
+void wl_wds_netif_start_queue( struct wl_private *lp );
+void wl_wds_netif_stop_queue( struct wl_private *lp );
+void wl_wds_netif_wake_queue( struct wl_private *lp );
+void wl_wds_netif_carrier_on( struct wl_private *lp );
+void wl_wds_netif_carrier_off( struct wl_private *lp );
+
+#endif /* USE_WDS */
+
+
+#ifdef USE_WDS
+
+#define WL_WDS_DEVICE_ALLOC( ARG ) wl_wds_device_alloc( ARG )
+#define WL_WDS_DEVICE_DEALLOC( ARG ) wl_wds_device_dealloc( ARG )
+#define WL_WDS_NETIF_START_QUEUE( ARG ) wl_wds_netif_start_queue( ARG )
+#define WL_WDS_NETIF_STOP_QUEUE( ARG ) wl_wds_netif_stop_queue( ARG )
+#define WL_WDS_NETIF_WAKE_QUEUE( ARG ) wl_wds_netif_wake_queue( ARG )
+#define WL_WDS_NETIF_CARRIER_ON( ARG ) wl_wds_netif_carrier_on( ARG )
+#define WL_WDS_NETIF_CARRIER_OFF( ARG ) wl_wds_netif_carrier_off( ARG )
+
+#else
+
+#define WL_WDS_DEVICE_ALLOC( ARG )
+#define WL_WDS_DEVICE_DEALLOC( ARG )
+#define WL_WDS_NETIF_START_QUEUE( ARG )
+#define WL_WDS_NETIF_STOP_QUEUE( ARG )
+#define WL_WDS_NETIF_WAKE_QUEUE( ARG )
+#define WL_WDS_NETIF_CARRIER_ON( ARG )
+#define WL_WDS_NETIF_CARRIER_OFF( ARG )
+
+#endif /* USE_WDS */
+
+
+#endif // __WL_NETDEV_H__
diff --git a/drivers/staging/wlags49_h2/wl_pci.c b/drivers/staging/wlags49_h2/wl_pci.c
new file mode 100644
index 000000000000..4567100bcbf6
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_pci.c
@@ -0,0 +1,1596 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file contains processing and initialization specific to PCI/miniPCI
+ * devices.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/06 11:25:37 $
+ * $Revision: 1.7 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_pci.c,v $
+ *
+ ******************************************************************************/
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wireless/wl_version.h>
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include <linux/sched.h>
+#include <linux/ptrace.h>
+#include <linux/slab.h>
+#include <linux/ctype.h>
+#include <linux/string.h>
+//#include <linux/timer.h>
+#include <linux/interrupt.h>
+#include <linux/in.h>
+#include <linux/delay.h>
+#include <asm/system.h>
+#include <asm/io.h>
+#include <asm/irq.h>
+#include <asm/system.h>
+#include <asm/bitops.h>
+#include <asm/uaccess.h>
+
+#include <linux/ethtool.h>
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/skbuff.h>
+#include <linux/if_arp.h>
+#include <linux/ioport.h>
+
+#include <hcf/debug.h>
+
+#include <hcf.h>
+#include <dhf.h>
+#include <hcfdef.h>
+
+#include <wireless/wl_if.h>
+#include <wireless/wl_internal.h>
+#include <wireless/wl_util.h>
+#include <wireless/wl_main.h>
+#include <wireless/wl_netdev.h>
+#include <wireless/wl_pci.h>
+
+
+/*******************************************************************************
+ * global variables
+ ******************************************************************************/
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif // DBG
+
+/* define the PCI device Table Cardname and id tables */
+enum hermes_pci_versions {
+ CH_Agere_Systems_Mini_PCI_V1 = 0,
+};
+
+static struct pci_device_id wl_pci_tbl[] __devinitdata = {
+ { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_0, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
+ { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_1, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
+ { WL_LKM_PCI_VENDOR_ID, WL_LKM_PCI_DEVICE_ID_2, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_Agere_Systems_Mini_PCI_V1 },
+ { } /* Terminating entry */
+};
+
+MODULE_DEVICE_TABLE(pci, wl_pci_tbl);
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+int __devinit wl_pci_probe( struct pci_dev *pdev,
+ const struct pci_device_id *ent );
+void __devexit wl_pci_remove(struct pci_dev *pdev);
+int wl_pci_setup( struct pci_dev *pdev );
+void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev );
+
+#ifdef ENABLE_DMA
+int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp );
+int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp );
+int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc, int size );
+int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc );
+int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT *desc, int size );
+int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT *desc );
+
+void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp );
+#endif // ENABLE_DMA
+
+/*******************************************************************************
+ * PCI module function registration
+ ******************************************************************************/
+static struct pci_driver wl_driver =
+{
+ name: MODULE_NAME,
+ id_table: wl_pci_tbl,
+ probe: wl_pci_probe,
+ remove: __devexit_p(wl_pci_remove),
+ suspend: NULL,
+ resume: NULL,
+};
+
+/*******************************************************************************
+ * wl_adapter_init_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by init_module() to perform PCI-specific driver initialization.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * 0
+ *
+ ******************************************************************************/
+int wl_adapter_init_module( void )
+{
+ int result;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_adapter_init_module()" );
+ DBG_ENTER( DbgInfo );
+ DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCI\n" );
+
+ result = pci_register_driver( &wl_driver ); //;?replace with pci_module_init, Rubini pg 490
+ //;? why not do something with the result
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_adapter_init_module
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_adapter_cleanup_module()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by cleanup_module() to perform PCI-specific driver cleanup.
+ *
+ * PARAMETERS:
+ *
+ * N/A
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_adapter_cleanup_module( void )
+{
+ //;?how comes wl_adapter_cleanup_module is located in a seemingly pci specific module
+ DBG_FUNC( "wl_adapter_cleanup_module" );
+ DBG_ENTER( DbgInfo );
+
+ //;?DBG_TRACE below feels like nearly redundant in the light of DBG_ENTER above
+ DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCI\n" );
+
+ pci_unregister_driver( &wl_driver );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_adapter_cleanup_module
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_adapter_insert()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by wl_pci_probe() to continue the process of device insertion.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * TRUE or FALSE
+ *
+ ******************************************************************************/
+int wl_adapter_insert( struct net_device *dev )
+{
+ int result = FALSE;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_adapter_insert" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_TRACE( DbgInfo, "wl_adapter_insert() -- PCI\n" );
+
+ if( dev == NULL ) {
+ DBG_ERROR( DbgInfo, "net_device pointer is NULL!!!\n" );
+ } else if( dev->priv == NULL ) {
+ DBG_ERROR( DbgInfo, "wl_private pointer is NULL!!!\n" );
+ } else if( wl_insert( dev ) ) { /* Perform remaining device initialization */
+ result = TRUE;
+ } else {
+ DBG_TRACE( DbgInfo, "wl_insert() FAILED\n" );
+ }
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wl_adapter_insert
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_adapter_open()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Open the device.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * an HCF status code
+ *
+ ******************************************************************************/
+int wl_adapter_open( struct net_device *dev )
+{
+ int result = 0;
+ int hcf_status = HCF_SUCCESS;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_adapter_open" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_TRACE( DbgInfo, "wl_adapter_open() -- PCI\n" );
+
+ hcf_status = wl_open( dev );
+
+ if( hcf_status != HCF_SUCCESS ) {
+ result = -ENODEV;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wl_adapter_open
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_adapter_close()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Close the device
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * 0
+ *
+ ******************************************************************************/
+int wl_adapter_close( struct net_device *dev )
+{
+ DBG_FUNC( "wl_adapter_close" );
+ DBG_ENTER( DbgInfo );
+
+ DBG_TRACE( DbgInfo, "wl_adapter_close() -- PCI\n" );
+ DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name );
+
+ wl_close( dev );
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_adapter_close
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_adapter_is_open()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Check whether this device is open. Returns
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * nonzero if device is open.
+ *
+ ******************************************************************************/
+int wl_adapter_is_open( struct net_device *dev )
+{
+ /* This function is used in PCMCIA to check the status of the 'open' field
+ in the dev_link_t structure associated with a network device. There
+ doesn't seem to be an analog to this for PCI, and checking the status
+ contained in the net_device structure doesn't have the same effect.
+ For now, return TRUE, but find out if this is necessary for PCI. */
+
+ return TRUE;
+} // wl_adapter_is_open
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_probe()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Registered in the pci_driver structure, this function is called when the
+ * PCI subsystem finds a new PCI device which matches the infomation contained
+ * in the pci_device_id table.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * ent - this device's entry in the pci_device_id table
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int __devinit wl_pci_probe( struct pci_dev *pdev,
+ const struct pci_device_id *ent )
+{
+ int result;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_probe" );
+ DBG_ENTER( DbgInfo );
+ DBG_PRINT( "%s\n", VERSION_INFO );
+
+ result = wl_pci_setup( pdev );
+
+ DBG_LEAVE( DbgInfo );
+
+ return result;
+} // wl_pci_probe
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_remove()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Registered in the pci_driver structure, this function is called when the
+ * PCI subsystem detects that a PCI device which matches the infomation
+ * contained in the pci_device_id table has been removed.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void __devexit wl_pci_remove(struct pci_dev *pdev)
+{
+ struct net_device *dev = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_remove" );
+ DBG_ENTER( DbgInfo );
+
+ /* Make sure the pci_dev pointer passed in is valid */
+ if( pdev == NULL ) {
+ DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" );
+ return;
+ }
+
+ dev = (struct net_device *)pci_get_drvdata( pdev );
+ if( dev == NULL ) {
+ DBG_ERROR( DbgInfo, "Could not retrieve net_device structure\n" );
+ return;
+ }
+
+ /* Perform device cleanup */
+ wl_remove( dev );
+ free_irq( dev->irq, dev );
+
+#ifdef ENABLE_DMA
+ wl_pci_dma_free( pdev, (struct wl_private *)dev->priv );
+#endif
+
+ wl_device_dealloc( dev );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_pci_remove
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_setup()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by wl_pci_probe() to begin a device's initialization process.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_setup( struct pci_dev *pdev )
+{
+ int result = 0;
+ struct net_device *dev = NULL;
+ struct wl_private *lp = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_setup" );
+ DBG_ENTER( DbgInfo );
+
+ /* Make sure the pci_dev pointer passed in is valid */
+ if( pdev == NULL ) {
+ DBG_ERROR( DbgInfo, "PCI subsys passed in an invalid pci_dev pointer\n" );
+ return -ENODEV;
+ }
+
+ result = pci_enable_device( pdev );
+ if( result != 0 ) {
+ DBG_ERROR( DbgInfo, "pci_enable_device() failed\n" );
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* We found our device! Let's register it with the system */
+ DBG_TRACE( DbgInfo, "Found our device, now registering\n" );
+ dev = wl_device_alloc( );
+ if( dev == NULL ) {
+ DBG_ERROR( DbgInfo, "Could not register device!!!\n" );
+ DBG_LEAVE( DbgInfo );
+ return -ENOMEM;
+ }
+
+ /* Make sure that space was allocated for our private adapter struct */
+ if( dev->priv == NULL ) {
+ DBG_ERROR( DbgInfo, "Private adapter struct was not allocated!!!\n" );
+ DBG_LEAVE( DbgInfo );
+ return -ENOMEM;
+ }
+
+#ifdef ENABLE_DMA
+ /* Allocate DMA Descriptors */
+ if( wl_pci_dma_alloc( pdev, (struct wl_private *)dev->priv ) < 0 ) {
+ DBG_ERROR( DbgInfo, "Could not allocate DMA descriptor memory!!!\n" );
+ DBG_LEAVE( DbgInfo );
+ return -ENOMEM;
+ }
+#endif
+
+ /* Register our private adapter structure with PCI */
+ pci_set_drvdata( pdev, dev );
+
+ /* Fill out bus specific information in the net_device struct */
+ dev->irq = pdev->irq;
+ SET_MODULE_OWNER( dev );
+
+ DBG_TRACE( DbgInfo, "Device Base Address: %#03lx\n", pdev->resource[0].start );
+ dev->base_addr = pdev->resource[0].start;
+
+ /* Initialize our device here */
+ if( !wl_adapter_insert( dev )) {
+ DBG_ERROR( DbgInfo, "wl_adapter_insert() FAILED!!!\n" );
+ wl_device_dealloc( dev );
+ DBG_LEAVE( DbgInfo );
+ return -EINVAL;
+ }
+
+ /* Register our ISR */
+ DBG_TRACE( DbgInfo, "Registering ISR...\n" );
+
+ result = request_irq(dev->irq, wl_isr, SA_SHIRQ, dev->name, dev);
+ if( result ) {
+ DBG_WARNING( DbgInfo, "Could not register ISR!!!\n" );
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Make sure interrupts are enabled properly for CardBus */
+ lp = (struct wl_private *)dev->priv;
+
+ if( lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_CARDBUS ||
+ lp->hcfCtx.IFB_BusType == CFG_NIC_BUS_TYPE_PCI ) {
+ DBG_TRACE( DbgInfo, "This is a PCI/CardBus card, enable interrupts\n" );
+ wl_pci_enable_cardbus_interrupts( pdev );
+ }
+
+ /* Enable bus mastering */
+ pci_set_master( pdev );
+
+ DBG_LEAVE( DbgInfo );
+ return 0;
+} // wl_pci_setup
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_enable_cardbus_interrupts()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Called by wl_pci_setup() to enable interrupts on a CardBus device. This
+ * is done by writing bit 15 to the function event mask register. This
+ * CardBus-specific register is located in BAR2 (counting from BAR0), in memory
+ * space at byte offset 1f4 (7f4 for WARP).
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_pci_enable_cardbus_interrupts( struct pci_dev *pdev )
+{
+ u32 bar2_reg;
+ u32 mem_addr_bus;
+ u32 func_evt_mask_reg;
+ void *mem_addr_kern = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_enable_cardbus_interrupts" );
+ DBG_ENTER( DbgInfo );
+
+ /* Initialize to known bad values */
+ bar2_reg = 0xdeadbeef;
+ mem_addr_bus = 0xdeadbeef;
+
+ /* Read the BAR2 register; this register contains the base address of the
+ memory region where the function event mask register lives */
+ pci_read_config_dword( pdev, PCI_BASE_ADDRESS_2, &bar2_reg );
+ mem_addr_bus = bar2_reg & PCI_BASE_ADDRESS_MEM_MASK;
+
+ /* Once the base address is obtained, remap the memory region to kernel
+ space so we can retrieve the register */
+ mem_addr_kern = ioremap( mem_addr_bus, 0x200 );
+
+#ifdef HERMES25
+#define REG_OFFSET 0x07F4
+#else
+#define REG_OFFSET 0x01F4
+#endif // HERMES25
+
+#define BIT15 0x8000
+
+ /* Retrieve the functional event mask register, enable interrupts by
+ setting Bit 15, and write back the value */
+ func_evt_mask_reg = *(u32 *)( mem_addr_kern + REG_OFFSET );
+ func_evt_mask_reg |= BIT15;
+ *(u32 *)( mem_addr_kern + REG_OFFSET ) = func_evt_mask_reg;
+
+ /* Once complete, unmap the region and exit */
+ iounmap( mem_addr_kern );
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_pci_enable_cardbus_interrupts
+/*============================================================================*/
+
+#ifdef ENABLE_DMA
+/*******************************************************************************
+ * wl_pci_dma_alloc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates all resources needed for PCI/CardBus DMA operation
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc( struct pci_dev *pdev, struct wl_private *lp )
+{
+ int i;
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_alloc" );
+ DBG_ENTER( DbgInfo );
+
+// lp->dma.tx_rsc_ind = lp->dma.rx_rsc_ind = 0;
+//
+// /* Alloc for the Tx chain and its reclaim descriptor */
+// for( i = 0; i < NUM_TX_DESC; i++ ) {
+// status = wl_pci_dma_alloc_tx_packet( pdev, lp, &lp->dma.tx_packet[i] );
+// if( status == 0 ) {
+// DBG_PRINT( "lp->dma.tx_packet[%d] : 0x%p\n", i, lp->dma.tx_packet[i] );
+// DBG_PRINT( "lp->dma.tx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.tx_packet[i]->next_desc_addr );
+// lp->dma.tx_rsc_ind++;
+// } else {
+// DBG_ERROR( DbgInfo, "Could not alloc DMA Tx Packet\n" );
+// break;
+// }
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.tx_reclaim_desc );
+// DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
+// }
+// /* Alloc for the Rx chain and its reclaim descriptor */
+// if( status == 0 ) {
+// for( i = 0; i < NUM_RX_DESC; i++ ) {
+// status = wl_pci_dma_alloc_rx_packet( pdev, lp, &lp->dma.rx_packet[i] );
+// if( status == 0 ) {
+// DBG_PRINT( "lp->dma.rx_packet[%d] : 0x%p\n", i, lp->dma.rx_packet[i] );
+// DBG_PRINT( "lp->dma.rx_packet[%d]->next_desc_addr : 0x%p\n", i, lp->dma.rx_packet[i]->next_desc_addr );
+// lp->dma.rx_rsc_ind++;
+// } else {
+// DBG_ERROR( DbgInfo, "Could not alloc DMA Rx Packet\n" );
+// break;
+// }
+// }
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc( pdev, lp, &lp->dma.rx_reclaim_desc );
+// DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
+// }
+// /* Store status, as host should not call HCF functions if this fails */
+// lp->dma.status = status; //;?all useages of dma.status have been commented out
+// DBG_LEAVE( DbgInfo );
+ return status;
+} // wl_pci_dma_alloc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Deallocated all resources needed for PCI/CardBus DMA operation
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free( struct pci_dev *pdev, struct wl_private *lp )
+{
+ int i;
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_free" );
+ DBG_ENTER( DbgInfo );
+
+ /* Reclaim all Rx packets that were handed over to the HCF */
+ /* Do I need to do this? Before this free is called, I've already disabled
+ the port which will call wl_pci_dma_hcf_reclaim */
+ //if( lp->dma.status == 0 )
+ //{
+ // wl_pci_dma_hcf_reclaim( lp );
+ //}
+
+ /* Free everything needed for DMA Rx */
+ for( i = 0; i < NUM_RX_DESC; i++ ) {
+ if( lp->dma.rx_packet[i] ) {
+ status = wl_pci_dma_free_rx_packet( pdev, lp, &lp->dma.rx_packet[i] );
+ if( status != 0 ) {
+ DBG_WARNING( DbgInfo, "Problem freeing Rx packet\n" );
+ }
+ }
+ }
+ lp->dma.rx_rsc_ind = 0;
+
+ if( lp->dma.rx_reclaim_desc ) {
+ status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.rx_reclaim_desc );
+ if( status != 0 ) {
+ DBG_WARNING( DbgInfo, "Problem freeing Rx reclaim descriptor\n" );
+ }
+ }
+
+ /* Free everything needed for DMA Tx */
+ for( i = 0; i < NUM_TX_DESC; i++ ) {
+ if( lp->dma.tx_packet[i] ) {
+ status = wl_pci_dma_free_tx_packet( pdev, lp, &lp->dma.tx_packet[i] );
+ if( status != 0 ) {
+ DBG_WARNING( DbgInfo, "Problem freeing Tx packet\n" );
+ }
+ }
+ }
+ lp->dma.tx_rsc_ind = 0;
+
+ if( lp->dma.tx_reclaim_desc ) {
+ status = wl_pci_dma_free_desc( pdev, lp, &lp->dma.tx_reclaim_desc );
+ if( status != 0 ) {
+ DBG_WARNING( DbgInfo, "Problem freeing Tx reclaim descriptor\n" );
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return status;
+} // wl_pci_dma_free
+
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_alloc_tx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates a single Tx packet, consisting of several descriptors and
+ * buffers. Data to transmit is first copied into the 'payload' buffer
+ * before being transmitted.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+// int status = 0;
+// /*------------------------------------------------------------------------*/
+//
+// if( desc == NULL ) {
+// status = -EFAULT;
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp, desc,
+// HCF_DMA_TX_BUF1_SIZE );
+//
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc_and_buf( pdev, lp,
+// &( (*desc)->next_desc_addr ),
+// HCF_MAX_PACKET_SIZE );
+// }
+// }
+// if( status == 0 ) {
+// (*desc)->next_desc_phys_addr = (*desc)->next_desc_addr->desc_phys_addr;
+// }
+// return status;
+} // wl_pci_dma_alloc_tx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free_tx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Frees a single Tx packet, described in the corresponding alloc function.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free_tx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ if( *desc == NULL ) {
+ DBG_PRINT( "Null descriptor\n" );
+ status = -EFAULT;
+ }
+ //;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2
+ //descriptors, make this robust
+ if( status == 0 && (*desc)->next_desc_addr ) {
+ status = wl_pci_dma_free_desc_and_buf( pdev, lp, &(*desc)->next_desc_addr );
+ }
+ if( status == 0 ) {
+ status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc );
+ }
+ return status;
+} // wl_pci_dma_free_tx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_alloc_rx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates a single Rx packet, consisting of two descriptors and one
+ * contiguous buffer. THe buffer starts with the hermes-specific header.
+ * One descriptor points at the start, the other at offset 0x3a of the
+ * buffer.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+ int status = 0;
+ DESC_STRCT *p;
+ /*------------------------------------------------------------------------*/
+
+// if( desc == NULL ) {
+// status = -EFAULT;
+// }
+// //;?the "limited" NDIS strategy, assuming a frame consists ALWAYS out of 2
+// //descriptors, make this robust
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc( pdev, lp, desc );
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, HCF_MAX_PACKET_SIZE );
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc( pdev, lp, &p );
+// }
+// if( status == 0 ) {
+// /* Size of 1st descriptor becomes 0x3a bytes */
+// SET_BUF_SIZE( *desc, HCF_DMA_RX_BUF1_SIZE );
+//
+// /* Make 2nd descriptor point at offset 0x3a of the buffer */
+// SET_BUF_SIZE( p, ( HCF_MAX_PACKET_SIZE - HCF_DMA_RX_BUF1_SIZE ));
+// p->buf_addr = (*desc)->buf_addr + HCF_DMA_RX_BUF1_SIZE;
+// p->buf_phys_addr = (*desc)->buf_phys_addr + HCF_DMA_RX_BUF1_SIZE;
+// p->next_desc_addr = NULL;
+//
+// /* Chain 2nd descriptor to 1st descriptor */
+// (*desc)->next_desc_addr = p;
+// (*desc)->next_desc_phys_addr = p->desc_phys_addr;
+// }
+
+ return status;
+} // wl_pci_dma_alloc_rx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free_rx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Frees a single Rx packet, described in the corresponding alloc function.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd.
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free_rx_packet( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+ int status = 0;
+ DESC_STRCT *p;
+ /*------------------------------------------------------------------------*/
+
+ if( *desc == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 ) {
+ p = (*desc)->next_desc_addr;
+
+ /* Free the 2nd descriptor */
+ if( p != NULL ) {
+ p->buf_addr = NULL;
+ p->buf_phys_addr = 0;
+
+ status = wl_pci_dma_free_desc( pdev, lp, &p );
+ }
+ }
+
+ /* Free the buffer and 1st descriptor */
+ if( status == 0 ) {
+ SET_BUF_SIZE( *desc, HCF_MAX_PACKET_SIZE );
+ status = wl_pci_dma_free_desc_and_buf( pdev, lp, desc );
+ }
+ return status;
+} // wl_pci_dma_free_rx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_alloc_desc_and_buf()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates a DMA descriptor and buffer, and associates them with one
+ * another.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc, int size )
+{
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+// if( desc == NULL ) {
+// status = -EFAULT;
+// }
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_desc( pdev, lp, desc );
+//
+// if( status == 0 ) {
+// status = wl_pci_dma_alloc_buf( pdev, lp, *desc, size );
+// }
+// }
+ return status;
+} // wl_pci_dma_alloc_desc_and_buf
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free_desc_and_buf()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Frees a DMA descriptor and associated buffer.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ * desc - a pointer which will reference the descriptor to be alloc'd
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free_desc_and_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ if( desc == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 && *desc == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 ) {
+ status = wl_pci_dma_free_buf( pdev, lp, *desc );
+
+ if( status == 0 ) {
+ status = wl_pci_dma_free_desc( pdev, lp, desc );
+ }
+ }
+ return status;
+} // wl_pci_dma_free_desc_and_buf
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_alloc_desc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates one DMA descriptor in cache coherent memory.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc_desc( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+// int status = 0;
+// dma_addr_t pa;
+// /*------------------------------------------------------------------------*/
+//
+// DBG_FUNC( "wl_pci_dma_alloc_desc" );
+// DBG_ENTER( DbgInfo );
+//
+// if( desc == NULL ) {
+// status = -EFAULT;
+// }
+// if( status == 0 ) {
+// *desc = pci_alloc_consistent( pdev, sizeof( DESC_STRCT ), &pa );
+// }
+// if( *desc == NULL ) {
+// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" );
+// status = -ENOMEM;
+// } else {
+// memset( *desc, 0, sizeof( DESC_STRCT ));
+// (*desc)->desc_phys_addr = cpu_to_le32( pa );
+// }
+// DBG_LEAVE( DbgInfo );
+// return status;
+} // wl_pci_dma_alloc_desc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free_desc()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Frees one DMA descriptor in cache coherent memory.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free_desc( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT **desc )
+{
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ if( *desc == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 ) {
+ pci_free_consistent( pdev, sizeof( DESC_STRCT ), *desc,
+ (*desc)->desc_phys_addr );
+ }
+ *desc = NULL;
+ return status;
+} // wl_pci_dma_free_desc
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_alloc_buf()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates one DMA buffer in cache coherent memory, and associates a DMA
+ * descriptor with this buffer.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_alloc_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT *desc, int size )
+{
+ int status = 0;
+ dma_addr_t pa;
+ /*------------------------------------------------------------------------*/
+
+// DBG_FUNC( "wl_pci_dma_alloc_buf" );
+// DBG_ENTER( DbgInfo );
+//
+// if( desc == NULL ) {
+// status = -EFAULT;
+// }
+// if( status == 0 && desc->buf_addr != NULL ) {
+// status = -EFAULT;
+// }
+// if( status == 0 ) {
+// desc->buf_addr = pci_alloc_consistent( pdev, size, &pa );
+// }
+// if( desc->buf_addr == NULL ) {
+// DBG_ERROR( DbgInfo, "pci_alloc_consistent() failed\n" );
+// status = -ENOMEM;
+// } else {
+// desc->buf_phys_addr = cpu_to_le32( pa );
+// SET_BUF_SIZE( desc, size );
+// }
+// DBG_LEAVE( DbgInfo );
+ return status;
+} // wl_pci_dma_alloc_buf
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_free_buf()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Allocates one DMA buffer in cache coherent memory, and associates a DMA
+ * descriptor with this buffer.
+ *
+ * PARAMETERS:
+ *
+ * pdev - a pointer to the device's pci_dev structure
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wl_pci_dma_free_buf( struct pci_dev *pdev, struct wl_private *lp,
+ DESC_STRCT *desc )
+{
+ int status = 0;
+ /*------------------------------------------------------------------------*/
+
+ if( desc == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 && desc->buf_addr == NULL ) {
+ status = -EFAULT;
+ }
+ if( status == 0 ) {
+ pci_free_consistent( pdev, GET_BUF_SIZE( desc ), desc->buf_addr,
+ desc->buf_phys_addr );
+
+ desc->buf_addr = 0;
+ desc->buf_phys_addr = 0;
+ SET_BUF_SIZE( desc, 0 );
+ }
+ return status;
+} // wl_pci_dma_free_buf
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_hcf_supply()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Supply HCF with DMA-related resources. These consist of:
+ * - buffers and descriptors for receive purposes
+ * - one 'reclaim' descriptor for the transmit path, used to fulfill a
+ * certain H25 DMA engine requirement
+ * - one 'reclaim' descriptor for the receive path, used to fulfill a
+ * certain H25 DMA engine requirement
+ *
+ * This function is called at start-of-day or at re-initialization.
+ *
+ * PARAMETERS:
+ *
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+void wl_pci_dma_hcf_supply( struct wl_private *lp )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_hcf_supply" );
+ DBG_ENTER( DbgInfo );
+
+ //if( lp->dma.status == 0 );
+ //{
+ /* Hand over the Rx/Tx reclaim descriptors to the HCF */
+ if( lp->dma.tx_reclaim_desc ) {
+ DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
+ hcf_dma_tx_put( &lp->hcfCtx, lp->dma.tx_reclaim_desc, 0 );
+ lp->dma.tx_reclaim_desc = NULL;
+ DBG_PRINT( "lp->dma.tx_reclaim_desc: 0x%p\n", lp->dma.tx_reclaim_desc );
+ }
+ if( lp->dma.rx_reclaim_desc ) {
+ DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
+ hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_reclaim_desc );
+ lp->dma.rx_reclaim_desc = NULL;
+ DBG_PRINT( "lp->dma.rx_reclaim_desc: 0x%p\n", lp->dma.rx_reclaim_desc );
+ }
+ /* Hand over the Rx descriptor chain to the HCF */
+ for( i = 0; i < NUM_RX_DESC; i++ ) {
+ DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] );
+ hcf_dma_rx_put( &lp->hcfCtx, lp->dma.rx_packet[i] );
+ lp->dma.rx_packet[i] = NULL;
+ DBG_PRINT( "lp->dma.rx_packet[%d]: 0x%p\n", i, lp->dma.rx_packet[i] );
+ }
+ //}
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_pci_dma_hcf_supply
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_hcf_reclaim()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return DMA-related resources from the HCF. These consist of:
+ * - buffers and descriptors for receive purposes
+ * - buffers and descriptors for transmit purposes
+ * - one 'reclaim' descriptor for the transmit path, used to fulfill a
+ * certain H25 DMA engine requirement
+ * - one 'reclaim' descriptor for the receive path, used to fulfill a
+ * certain H25 DMA engine requirement
+ *
+ * This function is called at end-of-day or at re-initialization.
+ *
+ * PARAMETERS:
+ *
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+void wl_pci_dma_hcf_reclaim( struct wl_private *lp )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_hcf_reclaim" );
+ DBG_ENTER( DbgInfo );
+
+ wl_pci_dma_hcf_reclaim_rx( lp );
+ for( i = 0; i < NUM_RX_DESC; i++ ) {
+ DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] );
+// if( lp->dma.rx_packet[i] == NULL ) {
+// DBG_PRINT( "wl_pci_dma_hcf_reclaim: rx_packet[%d] NULL\n", i );
+// }
+ }
+
+ wl_pci_dma_hcf_reclaim_tx( lp );
+ for( i = 0; i < NUM_TX_DESC; i++ ) {
+ DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] );
+// if( lp->dma.tx_packet[i] == NULL ) {
+// DBG_PRINT( "wl_pci_dma_hcf_reclaim: tx_packet[%d] NULL\n", i );
+// }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_pci_dma_hcf_reclaim
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_hcf_reclaim_rx()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Reclaim Rx packets that have already been processed by the HCF.
+ *
+ * PARAMETERS:
+ *
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+void wl_pci_dma_hcf_reclaim_rx( struct wl_private *lp )
+{
+ int i;
+ DESC_STRCT *p;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_hcf_reclaim_rx" );
+ DBG_ENTER( DbgInfo );
+
+ //if( lp->dma.status == 0 )
+ //{
+ while ( ( p = hcf_dma_rx_get( &lp->hcfCtx ) ) != NULL ) {
+ if( p && p->buf_addr == NULL ) {
+ /* A reclaim descriptor is being given back by the HCF. Reclaim
+ descriptors have a NULL buf_addr */
+ lp->dma.rx_reclaim_desc = p;
+ DBG_PRINT( "reclaim_descriptor: 0x%p\n", p );
+ continue;
+ }
+ for( i = 0; i < NUM_RX_DESC; i++ ) {
+ if( lp->dma.rx_packet[i] == NULL ) {
+ break;
+ }
+ }
+ /* An Rx buffer descriptor is being given back by the HCF */
+ lp->dma.rx_packet[i] = p;
+ lp->dma.rx_rsc_ind++;
+ DBG_PRINT( "rx_packet[%d] 0x%p\n", i, lp->dma.rx_packet[i] );
+ }
+ //}
+ DBG_LEAVE( DbgInfo );
+} // wl_pci_dma_hcf_reclaim_rx
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_get_tx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Obtains a Tx descriptor from the chain to use for Tx.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's wl_private structure.
+ *
+ * RETURNS:
+ *
+ * A pointer to the retrieved descriptor
+ *
+ ******************************************************************************/
+DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp )
+{
+ int i;
+ DESC_STRCT *desc = NULL;
+ /*------------------------------------------------------------------------*/
+
+ for( i = 0; i < NUM_TX_DESC; i++ ) {
+ if( lp->dma.tx_packet[i] ) {
+ break;
+ }
+ }
+
+ if( i != NUM_TX_DESC ) {
+ desc = lp->dma.tx_packet[i];
+
+ lp->dma.tx_packet[i] = NULL;
+ lp->dma.tx_rsc_ind--;
+
+ memset( desc->buf_addr, 0, HCF_DMA_TX_BUF1_SIZE );
+ }
+
+ return desc;
+} // wl_pci_dma_get_tx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_put_tx_packet()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Returns a Tx descriptor to the chain.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's wl_private structure.
+ * desc - a pointer to the descriptor to return.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+ for( i = 0; i < NUM_TX_DESC; i++ ) {
+ if( lp->dma.tx_packet[i] == NULL ) {
+ break;
+ }
+ }
+
+ if( i != NUM_TX_DESC ) {
+ lp->dma.tx_packet[i] = desc;
+ lp->dma.tx_rsc_ind++;
+ }
+} // wl_pci_dma_put_tx_packet
+/*============================================================================*/
+
+/*******************************************************************************
+ * wl_pci_dma_hcf_reclaim_tx()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Reclaim Tx packets that have either been processed by the HCF due to a
+ * port disable or a Tx completion.
+ *
+ * PARAMETERS:
+ *
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp )
+{
+ int i;
+ DESC_STRCT *p;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_pci_dma_hcf_reclaim_tx" );
+ DBG_ENTER( DbgInfo );
+
+ //if( lp->dma.status == 0 )
+ //{
+ while ( ( p = hcf_dma_tx_get( &lp->hcfCtx ) ) != NULL ) {
+
+ if( p != NULL && p->buf_addr == NULL ) {
+ /* A Reclaim descriptor is being given back by the HCF. Reclaim
+ descriptors have a NULL buf_addr */
+ lp->dma.tx_reclaim_desc = p;
+ DBG_PRINT( "reclaim_descriptor: 0x%p\n", p );
+ continue;
+ }
+ for( i = 0; i < NUM_TX_DESC; i++ ) {
+ if( lp->dma.tx_packet[i] == NULL ) {
+ break;
+ }
+ }
+ /* An Rx buffer descriptor is being given back by the HCF */
+ lp->dma.tx_packet[i] = p;
+ lp->dma.tx_rsc_ind++;
+ DBG_PRINT( "tx_packet[%d] 0x%p\n", i, lp->dma.tx_packet[i] );
+ }
+ //}
+
+ if( lp->netif_queue_on == FALSE ) {
+ netif_wake_queue( lp->dev );
+ WL_WDS_NETIF_WAKE_QUEUE( lp );
+ lp->netif_queue_on = TRUE;
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_pci_dma_hcf_reclaim_tx
+/*============================================================================*/
+#endif // ENABLE_DMA
diff --git a/drivers/staging/wlags49_h2/wl_pci.h b/drivers/staging/wlags49_h2/wl_pci.h
new file mode 100644
index 000000000000..32ea7b913ec8
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_pci.h
@@ -0,0 +1,126 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for the driver to support PCI.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_pci.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_PCI_H__
+#define __WL_PCI_H__
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+#define WL_LKM_PCI_VENDOR_ID 0x11C1 // Lucent Microelectronics
+#define WL_LKM_PCI_DEVICE_ID_0 0xAB30 // Mini PCI
+#define WL_LKM_PCI_DEVICE_ID_1 0xAB34 // Mini PCI
+#define WL_LKM_PCI_DEVICE_ID_2 0xAB11 // WARP CardBus
+
+
+
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+int wl_adapter_init_module( void );
+
+void wl_adapter_cleanup_module( void );
+
+int wl_adapter_insert( struct net_device *dev );
+
+int wl_adapter_open( struct net_device *dev );
+
+int wl_adapter_close( struct net_device *dev );
+
+int wl_adapter_is_open( struct net_device *dev );
+
+
+#ifdef ENABLE_DMA
+
+void wl_pci_dma_hcf_supply( struct wl_private *lp );
+
+void wl_pci_dma_hcf_reclaim( struct wl_private *lp );
+
+DESC_STRCT * wl_pci_dma_get_tx_packet( struct wl_private *lp );
+
+void wl_pci_dma_put_tx_packet( struct wl_private *lp, DESC_STRCT *desc );
+
+void wl_pci_dma_hcf_reclaim_tx( struct wl_private *lp );
+
+#endif // ENABLE_DMA
+
+
+#endif // __WL_PCI_H__
diff --git a/drivers/staging/wlags49_h2/wl_priv.c b/drivers/staging/wlags49_h2/wl_priv.c
new file mode 100644
index 000000000000..3a0844582f45
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_priv.c
@@ -0,0 +1,2095 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file defines handling routines for the private IOCTLs
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/03 11:39:39 $
+ * $Revision: 1.5 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_priv.c,v $
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/if_arp.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <asm/uaccess.h>
+
+#include <debug.h>
+#include <hcf.h>
+#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_enc.h>
+#include <wl_main.h>
+#include <wl_priv.h>
+#include <wl_util.h>
+#include <wl_netdev.h>
+
+int wvlan_uil_connect( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_disconnect( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_action( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_block( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_unblock( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp );
+int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp );
+
+int cfg_driver_info( struct uilreq *urq, struct wl_private *lp );
+int cfg_driver_identity( struct uilreq *urq, struct wl_private *lp );
+
+
+/*******************************************************************************
+ * global variables
+ ******************************************************************************/
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif // DBG
+
+
+
+
+/* If USE_UIL is not defined, then none of the UIL Interface code below will
+ be included in the build */
+#ifdef USE_UIL
+
+/*******************************************************************************
+ * wvlan_uil()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * The handler function for the UIL interface.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil( struct uilreq *urq, struct wl_private *lp )
+{
+ int ioctl_ret = 0;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wvlan_uil" );
+ DBG_ENTER( DbgInfo );
+
+ switch( urq->command ) {
+ case UIL_FUN_CONNECT:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_CONNECT\n");
+ ioctl_ret = wvlan_uil_connect( urq, lp );
+ break;
+ case UIL_FUN_DISCONNECT:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_DISCONNECT\n");
+ ioctl_ret = wvlan_uil_disconnect( urq, lp );
+ break;
+ case UIL_FUN_ACTION:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_ACTION\n" );
+ ioctl_ret = wvlan_uil_action( urq, lp );
+ break;
+ case UIL_FUN_SEND_DIAG_MSG:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_SEND_DIAG_MSG\n");
+ ioctl_ret = wvlan_uil_send_diag_msg( urq, lp );
+ break;
+ case UIL_FUN_GET_INFO:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_GET_INFO\n");
+ ioctl_ret = wvlan_uil_get_info( urq, lp );
+ break;
+ case UIL_FUN_PUT_INFO:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- WVLAN2_UIL_PUT_INFO\n");
+ ioctl_ret = wvlan_uil_put_info( urq, lp );
+ break;
+ default:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_UIL -- UNSUPPORTED UIL CODE: 0x%X", urq->command );
+ ioctl_ret = -EOPNOTSUPP;
+ break;
+ }
+ DBG_LEAVE( DbgInfo );
+ return ioctl_ret;
+} // wvlan_uil
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_connect()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Connect to the UIL in order to make a request.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_connect( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_connect" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( !( lp->flags & WVLAN2_UIL_CONNECTED )) {
+ lp->flags |= WVLAN2_UIL_CONNECTED;
+ urq->hcfCtx = &( lp->hcfCtx );
+ urq->result = UIL_SUCCESS;
+ } else {
+ DBG_WARNING( DbgInfo, "UIL_ERR_IN_USE\n" );
+ urq->result = UIL_ERR_IN_USE;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_connect
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_disconnect()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Disonnect from the UIL after a request has been completed.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_disconnect( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_disconnect" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if (lp->flags & WVLAN2_UIL_CONNECTED) {
+ lp->flags &= ~WVLAN2_UIL_CONNECTED;
+ /*
+ if (lp->flags & WVLAN2_UIL_BUSY) {
+ lp->flags &= ~WVLAN2_UIL_BUSY;
+ netif_start_queue(lp->dev);
+ }
+ */
+ }
+
+ urq->hcfCtx = NULL;
+ urq->result = UIL_SUCCESS;
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_disconnect
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_action()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Handler for the UIL_ACT_xxx subcodes associated with UIL_FUN_ACTION
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_action( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ ltv_t *ltv;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_action" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ /* Make sure there's an LTV in the request buffer */
+ ltv = (ltv_t *)urq->data;
+ if( ltv != NULL ) {
+ /* Switch on the Type field of the LTV contained in the request
+ buffer */
+ switch( ltv->typ ) {
+ case UIL_ACT_BLOCK:
+ DBG_TRACE( DbgInfo, "UIL_ACT_BLOCK\n" );
+ result = wvlan_uil_block( urq, lp );
+ break;
+ case UIL_ACT_UNBLOCK:
+ DBG_TRACE( DbgInfo, "UIL_ACT_UNBLOCK\n" );
+ result = wvlan_uil_unblock( urq, lp );
+ break;
+ case UIL_ACT_SCAN:
+ DBG_TRACE( DbgInfo, "UIL_ACT_SCAN\n" );
+ urq->result = hcf_action( &( lp->hcfCtx ), MDD_ACT_SCAN );
+ break;
+ case UIL_ACT_APPLY:
+ DBG_TRACE( DbgInfo, "UIL_ACT_APPLY\n" );
+ urq->result = wl_apply( lp );
+ break;
+ case UIL_ACT_RESET:
+ DBG_TRACE( DbgInfo, "UIL_ACT_RESET\n" );
+ urq->result = wl_go( lp );
+ break;
+ default:
+ DBG_WARNING( DbgInfo, "Unknown action code: 0x%x\n", ltv->typ );
+ break;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "Bad LTV for this action\n" );
+ urq->result = UIL_ERR_LEN;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_action
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_block()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets a block in the driver to prevent access to the card by other
+ * processes.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+
+int wvlan_uil_block( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_block" );
+ DBG_ENTER( DbgInfo );
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if( capable( CAP_NET_ADMIN )) {
+ lp->flags |= WVLAN2_UIL_BUSY;
+ netif_stop_queue(lp->dev);
+ WL_WDS_NETIF_STOP_QUEUE( lp );
+ urq->result = UIL_SUCCESS;
+ } else {
+ DBG_ERROR( DbgInfo, "EPERM\n" );
+ urq->result = UIL_FAILURE;
+ result = -EPERM;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_block
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_unblock()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Unblocks the driver to restore access to the card by other processes.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_unblock( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_unblock" );
+ DBG_ENTER( DbgInfo );
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if( capable( CAP_NET_ADMIN )) {
+ if (lp->flags & WVLAN2_UIL_BUSY) {
+ lp->flags &= ~WVLAN2_UIL_BUSY;
+ netif_wake_queue(lp->dev);
+ WL_WDS_NETIF_WAKE_QUEUE( lp );
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "EPERM\n" );
+ urq->result = UIL_FAILURE;
+ result = -EPERM;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_unblock
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_uil_send_diag_msg()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sends a diagnostic message to the card.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ DESC_STRCT Descp[1];
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_uil_send_diag_msg" );
+ DBG_ENTER( DbgInfo );
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if( capable( CAP_NET_ADMIN )) {
+ if ((urq->data != NULL) && (urq->len != 0)) {
+ if (lp->hcfCtx.IFB_RscInd != 0) {
+ u_char *data;
+
+ // Verify the user buffer
+ result = verify_area(VERIFY_READ, urq->data, urq->len);
+ if (result != 0) {
+ DBG_ERROR( DbgInfo, "verify_area failed, result: %d\n", result );
+ urq->result = UIL_FAILURE;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ if ((data = kmalloc(urq->len, GFP_KERNEL)) != NULL) {
+ memset( Descp, 0, sizeof( DESC_STRCT ));
+ memcpy( data, urq->data, urq->len );
+
+ Descp[0].buf_addr = (wci_bufp)data;
+ Descp[0].BUF_CNT = urq->len;
+ Descp[0].next_desc_addr = 0; // terminate list
+
+ hcf_send_msg( &(lp->hcfCtx), &Descp[0], HCF_PORT_0 );
+ kfree( data );
+ } else {
+ DBG_ERROR( DbgInfo, "ENOMEM\n" );
+ urq->result = UIL_FAILURE;
+ result = -ENOMEM;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ } else {
+ urq->result = UIL_ERR_BUSY;
+ }
+
+ } else {
+ urq->result = UIL_FAILURE;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "EPERM\n" );
+ urq->result = UIL_FAILURE;
+ result = -EPERM;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_send_diag_msg
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wvlan_uil_put_info()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sends a specific RID directly to the driver to set configuration info.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ ltv_t *pLtv;
+ bool_t ltvAllocated = FALSE;
+ ENCSTRCT sEncryption;
+
+#ifdef USE_WDS
+ hcf_16 hcfPort = HCF_PORT_0;
+#endif /* USE_WDS */
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wvlan_uil_put_info" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if( capable( CAP_NET_ADMIN )) {
+ if(( urq->data != NULL ) && ( urq->len != 0 )) {
+ /* Make sure that we have at least a command and length to send. */
+ if( urq->len < ( sizeof( hcf_16 ) * 2 )) {
+ urq->len = sizeof( lp->ltvRecord );
+ urq->result = UIL_ERR_LEN;
+ DBG_ERROR( DbgInfo, "No Length/Type in LTV!!!\n" );
+ DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Verify the user buffer */
+ result = verify_area( VERIFY_READ, urq->data, urq->len );
+ if( result != 0 ) {
+ urq->result = UIL_FAILURE;
+ DBG_ERROR( DbgInfo, "verify_area(), VERIFY_READ FAILED\n" );
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Get only the command and length information. */
+ copy_from_user( &( lp->ltvRecord ), urq->data, sizeof( hcf_16 ) * 2 );
+
+ /* Make sure the incoming LTV record length is within the bounds of the
+ IOCTL length */
+ if((( lp->ltvRecord.len + 1 ) * sizeof( hcf_16 )) > urq->len ) {
+ urq->len = sizeof( lp->ltvRecord );
+ urq->result = UIL_ERR_LEN;
+ DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* If the requested length is greater than the size of our local
+ LTV record, try to allocate it from the kernel stack.
+ Otherwise, we just use our local LTV record. */
+ if( urq->len > sizeof( lp->ltvRecord )) {
+ if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
+ ltvAllocated = TRUE;
+ } else {
+ DBG_ERROR( DbgInfo, "Alloc FAILED\n" );
+ urq->len = sizeof( lp->ltvRecord );
+ urq->result = UIL_ERR_LEN;
+ result = -ENOMEM;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+ } else {
+ pLtv = &( lp->ltvRecord );
+ }
+
+ /* Copy the data from the user's buffer into the local LTV
+ record data area. */
+ copy_from_user( pLtv, urq->data, urq->len );
+
+
+ /* We need to snoop the commands to see if there is anything we
+ need to store for the purposes of a reset or start/stop
+ sequence. Perform endian translation as needed */
+ switch( pLtv->typ ) {
+ case CFG_CNF_PORT_TYPE:
+ lp->PortType = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_OWN_MAC_ADDR:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ case CFG_CNF_OWN_CHANNEL:
+ lp->Channel = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ /* CFG_CNF_OWN_SSID currently same as CNF_DESIRED_SSID. Do we
+ need seperate storage for this? */
+ //case CFG_CNF_OWN_SSID:
+ case CFG_CNF_OWN_ATIM_WINDOW:
+ lp->atimWindow = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_SYSTEM_SCALE:
+ lp->DistanceBetweenAPs = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+
+ case CFG_CNF_MAX_DATA_LEN:
+ /* TODO: determine if we are going to store anything based
+ on this */
+ break;
+ case CFG_CNF_PM_ENABLED:
+ lp->PMEnabled = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_MCAST_RX:
+ lp->MulticastReceive = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_MAX_SLEEP_DURATION:
+ lp->MaxSleepDuration = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_HOLDOVER_DURATION:
+ lp->holdoverDuration = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_OWN_NAME:
+ memset( lp->StationName, 0, sizeof( lp->StationName ));
+ memcpy( (void *)lp->StationName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_LOAD_BALANCING:
+ lp->loadBalancing = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_MEDIUM_DISTRIBUTION:
+ lp->mediumDistribution = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#ifdef WARP
+ case CFG_CNF_TX_POW_LVL:
+ lp->txPowLevel = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ //case CFG_CNF_SHORT_RETRY_LIMIT: // Short Retry Limit
+ //case 0xFC33: // Long Retry Limit
+ case CFG_SUPPORTED_RATE_SET_CNTL: // Supported Rate Set Control
+ lp->srsc[0] = pLtv->u.u16[0];
+ lp->srsc[1] = pLtv->u.u16[1];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
+ break;
+ case CFG_BASIC_RATE_SET_CNTL: // Basic Rate Set Control
+ lp->brsc[0] = pLtv->u.u16[0];
+ lp->brsc[1] = pLtv->u.u16[1];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
+ break;
+ case CFG_CNF_CONNECTION_CNTL:
+ lp->connectionControl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ //case CFG_PROBE_DATA_RATE:
+#endif // HERMES25
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ case CFG_CNF_OWN_DTIM_PERIOD:
+ lp->DTIMPeriod = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#ifdef WARP
+ case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
+ lp->ownBeaconInterval = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#endif // WARP
+ case CFG_COEXISTENSE_BEHAVIOUR: // Coexistence behavior
+ lp->coexistence = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#ifdef USE_WDS
+ case CFG_CNF_WDS_ADDR1:
+ memcpy( &lp->wds_port[0].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_1;
+ break;
+ case CFG_CNF_WDS_ADDR2:
+ memcpy( &lp->wds_port[1].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_2;
+ break;
+ case CFG_CNF_WDS_ADDR3:
+ memcpy( &lp->wds_port[2].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_3;
+ break;
+ case CFG_CNF_WDS_ADDR4:
+ memcpy( &lp->wds_port[3].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_4;
+ break;
+ case CFG_CNF_WDS_ADDR5:
+ memcpy( &lp->wds_port[4].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_5;
+ break;
+ case CFG_CNF_WDS_ADDR6:
+ memcpy( &lp->wds_port[5].wdsAddress, &pLtv->u.u8[0], ETH_ALEN );
+ hcfPort = HCF_PORT_6;
+ break;
+#endif /* USE_WDS */
+
+ case CFG_CNF_MCAST_PM_BUF:
+ lp->multicastPMBuffering = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_REJECT_ANY:
+ lp->RejectAny = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#endif
+
+ case CFG_CNF_ENCRYPTION:
+ lp->EnableEncryption = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_CNF_AUTHENTICATION:
+ lp->authentication = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ //case CFG_CNF_EXCL_UNENCRYPTED:
+ //lp->ExcludeUnencrypted = pLtv->u.u16[0];
+ //pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ //break;
+ case CFG_CNF_MCAST_RATE:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ case CFG_CNF_INTRA_BSS_RELAY:
+ lp->intraBSSRelay = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#endif
+
+ case CFG_CNF_MICRO_WAVE:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ //case CFG_CNF_LOAD_BALANCING:
+ /* TODO: determine if we are going to store anything based on this */
+ //break;
+ //case CFG_CNF_MEDIUM_DISTRIBUTION:
+ /* TODO: determine if we are going to store anything based on this */
+ //break;
+ //case CFG_CNF_RX_ALL_GROUP_ADDRESS:
+ // TODO: determine if we are going to store anything based on this
+ //break;
+ //case CFG_CNF_COUNTRY_INFO:
+ /* TODO: determine if we are going to store anything based on this */
+ //break;
+ case CFG_CNF_OWN_SSID:
+ //case CNF_DESIRED_SSID:
+ case CFG_DESIRED_SSID:
+ memset( lp->NetworkName, 0, sizeof( lp->NetworkName ));
+ memcpy( (void *)lp->NetworkName, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0] );
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+
+ /* take care of the special network name "ANY" case */
+ if(( strlen( &pLtv->u.u8[2] ) == 0 ) ||
+ ( strcmp( &pLtv->u.u8[2], "ANY" ) == 0 ) ||
+ ( strcmp( &pLtv->u.u8[2], "any" ) == 0 )) {
+ /* set the SSID_STRCT llen field (u16[0]) to zero, and the
+ effectually null the string u8[2] */
+ pLtv->u.u16[0] = 0;
+ pLtv->u.u8[2] = 0;
+ }
+ break;
+ case CFG_GROUP_ADDR:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ case CFG_CREATE_IBSS:
+ lp->CreateIBSS = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_RTS_THRH:
+ lp->RTSThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_TX_RATE_CNTL:
+ lp->TxRateControl[0] = pLtv->u.u16[0];
+ lp->TxRateControl[1] = pLtv->u.u16[1];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ pLtv->u.u16[1] = CNV_INT_TO_LITTLE( pLtv->u.u16[1] );
+ break;
+ case CFG_PROMISCUOUS_MODE:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ //case CFG_WAKE_ON_LAN:
+ /* TODO: determine if we are going to store anything based on this */
+ //break;
+#if 1 //;? #if (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ case CFG_RTS_THRH0:
+ lp->RTSThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_TX_RATE_CNTL0:
+//;?no idea what this should be, get going so comment it out lp->TxRateControl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+#ifdef USE_WDS
+ case CFG_RTS_THRH1:
+ lp->wds_port[0].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_1;
+ break;
+ case CFG_RTS_THRH2:
+ lp->wds_port[1].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_2;
+ break;
+ case CFG_RTS_THRH3:
+ lp->wds_port[2].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_3;
+ break;
+ case CFG_RTS_THRH4:
+ lp->wds_port[3].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_4;
+ break;
+ case CFG_RTS_THRH5:
+ lp->wds_port[4].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_5;
+ break;
+ case CFG_RTS_THRH6:
+ lp->wds_port[5].rtsThreshold = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_6;
+ break;
+ case CFG_TX_RATE_CNTL1:
+ lp->wds_port[0].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_1;
+ break;
+ case CFG_TX_RATE_CNTL2:
+ lp->wds_port[1].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_2;
+ break;
+ case CFG_TX_RATE_CNTL3:
+ lp->wds_port[2].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_3;
+ break;
+ case CFG_TX_RATE_CNTL4:
+ lp->wds_port[3].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_4;
+ break;
+ case CFG_TX_RATE_CNTL5:
+ lp->wds_port[4].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_5;
+ break;
+ case CFG_TX_RATE_CNTL6:
+ lp->wds_port[5].txRateCntl = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ hcfPort = HCF_PORT_6;
+ break;
+#endif /* USE_WDS */
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+ case CFG_DEFAULT_KEYS:
+ {
+ CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)pLtv;
+
+ pKeys->key[0].len = CNV_INT_TO_LITTLE( pKeys->key[0].len );
+ pKeys->key[1].len = CNV_INT_TO_LITTLE( pKeys->key[1].len );
+ pKeys->key[2].len = CNV_INT_TO_LITTLE( pKeys->key[2].len );
+ pKeys->key[3].len = CNV_INT_TO_LITTLE( pKeys->key[3].len );
+
+ memcpy( (void *)&(lp->DefaultKeys), (void *)pKeys,
+ sizeof( CFG_DEFAULT_KEYS_STRCT ));
+ }
+ break;
+ case CFG_TX_KEY_ID:
+ lp->TransmitKeyID = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_SCAN_SSID:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ case CFG_TICK_TIME:
+ /* TODO: determine if we are going to store anything based on this */
+ break;
+ /* these RIDS are Info RIDs, and should they be allowed for puts??? */
+ case CFG_MAX_LOAD_TIME:
+ case CFG_DL_BUF:
+ //case CFG_HSI_SUP_RANGE:
+ case CFG_NIC_SERIAL_NUMBER:
+ case CFG_NIC_IDENTITY:
+ case CFG_NIC_MFI_SUP_RANGE:
+ case CFG_NIC_CFI_SUP_RANGE:
+ case CFG_NIC_TEMP_TYPE:
+ case CFG_NIC_PROFILE:
+ case CFG_FW_IDENTITY:
+ case CFG_FW_SUP_RANGE:
+ case CFG_MFI_ACT_RANGES_STA:
+ case CFG_CFI_ACT_RANGES_STA:
+ case CFG_PORT_STAT:
+ case CFG_CUR_SSID:
+ case CFG_CUR_BSSID:
+ case CFG_COMMS_QUALITY:
+ case CFG_CUR_TX_RATE:
+ case CFG_CUR_BEACON_INTERVAL:
+ case CFG_CUR_SCALE_THRH:
+ case CFG_PROTOCOL_RSP_TIME:
+ case CFG_CUR_SHORT_RETRY_LIMIT:
+ case CFG_CUR_LONG_RETRY_LIMIT:
+ case CFG_MAX_TX_LIFETIME:
+ case CFG_MAX_RX_LIFETIME:
+ case CFG_CF_POLLABLE:
+ case CFG_AUTHENTICATION_ALGORITHMS:
+ case CFG_PRIVACY_OPT_IMPLEMENTED:
+ //case CFG_CURRENT_REMOTE_RATES:
+ //case CFG_CURRENT_USED_RATES:
+ //case CFG_CURRENT_SYSTEM_SCALE:
+ //case CFG_CURRENT_TX_RATE1:
+ //case CFG_CURRENT_TX_RATE2:
+ //case CFG_CURRENT_TX_RATE3:
+ //case CFG_CURRENT_TX_RATE4:
+ //case CFG_CURRENT_TX_RATE5:
+ //case CFG_CURRENT_TX_RATE6:
+ case CFG_NIC_MAC_ADDR:
+ case CFG_PCF_INFO:
+ //case CFG_CURRENT_COUNTRY_INFO:
+ case CFG_PHY_TYPE:
+ case CFG_CUR_CHANNEL:
+ //case CFG_CURRENT_POWER_STATE:
+ //case CFG_CCAMODE:
+ case CFG_SUPPORTED_DATA_RATES:
+ break;
+ case CFG_AP_MODE:
+//;? lp->DownloadFirmware = ( pLtv->u.u16[0] ) + 1;
+ DBG_ERROR( DbgInfo, "set CFG_AP_MODE no longer supported\n" );
+ break;
+ case CFG_ENCRYPT_STRING:
+ /* TODO: ENDIAN TRANSLATION HERE??? */
+ memset( lp->szEncryption, 0, sizeof( lp->szEncryption ));
+ memcpy( (void *)lp->szEncryption, (void *)&pLtv->u.u8[0],
+ ( pLtv->len * sizeof( hcf_16 )) );
+ wl_wep_decode( CRYPT_CODE, &sEncryption,
+ lp->szEncryption );
+
+ /* the Linux driver likes to use 1-4 for the key IDs, and then
+ convert to 0-3 when sending to the card. The Windows code
+ base used 0-3 in the API DLL, which was ported to Linux. For
+ the sake of the user experience, we decided to keep 0-3 as the
+ numbers used in the DLL; and will perform the +1 conversion here.
+ We could have converted the entire Linux driver, but this is
+ less obtrusive. This may be a "todo" to convert the whole driver */
+ lp->TransmitKeyID = sEncryption.wTxKeyID + 1;
+ lp->EnableEncryption = sEncryption.wEnabled;
+
+ memcpy( &lp->DefaultKeys, &sEncryption.EncStr,
+ sizeof( CFG_DEFAULT_KEYS_STRCT ));
+ break;
+ /*case CFG_COUNTRY_STRING:
+ memset( lp->countryString, 0, sizeof( lp->countryString ));
+ memcpy( (void *)lp->countryString, (void *)&pLtv->u.u8[2], (size_t)pLtv->u.u16[0]);
+ break;
+ */
+
+ case CFG_DRIVER_ENABLE:
+ lp->driverEnable = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_WOLAS_ENABLE:
+ lp->wolasEnable = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_SET_WPA_AUTH_KEY_MGMT_SUITE:
+ lp->AuthKeyMgmtSuite = pLtv->u.u16[0];
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_DISASSOCIATE_ADDR:
+ pLtv->u.u16[ETH_ALEN / 2] = CNV_INT_TO_LITTLE( pLtv->u.u16[ETH_ALEN / 2] );
+ break;
+ case CFG_ADD_TKIP_DEFAULT_KEY:
+ case CFG_REMOVE_TKIP_DEFAULT_KEY:
+ /* Endian convert the Tx Key Information */
+ pLtv->u.u16[0] = CNV_INT_TO_LITTLE( pLtv->u.u16[0] );
+ break;
+ case CFG_ADD_TKIP_MAPPED_KEY:
+ break;
+ case CFG_REMOVE_TKIP_MAPPED_KEY:
+ break;
+ /* some RIDs just can't be put */
+ case CFG_MB_INFO:
+ case CFG_IFB:
+ default:
+ break;
+ }
+
+ /* This code will prevent Static Configuration Entities from
+ being sent to the card, as they require a call to
+ UIL_ACT_APPLY to take effect. Dynamic Entities will be sent
+ immediately */
+ switch( pLtv->typ ) {
+ case CFG_CNF_PORT_TYPE:
+ case CFG_CNF_OWN_MAC_ADDR:
+ case CFG_CNF_OWN_CHANNEL:
+ case CFG_CNF_OWN_SSID:
+ case CFG_CNF_OWN_ATIM_WINDOW:
+ case CFG_CNF_SYSTEM_SCALE:
+ case CFG_CNF_MAX_DATA_LEN:
+ case CFG_CNF_PM_ENABLED:
+ case CFG_CNF_MCAST_RX:
+ case CFG_CNF_MAX_SLEEP_DURATION:
+ case CFG_CNF_HOLDOVER_DURATION:
+ case CFG_CNF_OWN_NAME:
+ case CFG_CNF_LOAD_BALANCING:
+ case CFG_CNF_MEDIUM_DISTRIBUTION:
+#ifdef WARP
+ case CFG_CNF_TX_POW_LVL:
+ case CFG_CNF_CONNECTION_CNTL:
+ //case CFG_PROBE_DATA_RATE:
+#endif // HERMES25
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ case CFG_CNF_OWN_DTIM_PERIOD:
+#ifdef WARP
+ case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
+#endif // WARP
+#ifdef USE_WDS
+ case CFG_CNF_WDS_ADDR1:
+ case CFG_CNF_WDS_ADDR2:
+ case CFG_CNF_WDS_ADDR3:
+ case CFG_CNF_WDS_ADDR4:
+ case CFG_CNF_WDS_ADDR5:
+ case CFG_CNF_WDS_ADDR6:
+#endif
+ case CFG_CNF_MCAST_PM_BUF:
+ case CFG_CNF_REJECT_ANY:
+#endif
+
+ case CFG_CNF_ENCRYPTION:
+ case CFG_CNF_AUTHENTICATION:
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ case CFG_CNF_EXCL_UNENCRYPTED:
+ case CFG_CNF_MCAST_RATE:
+ case CFG_CNF_INTRA_BSS_RELAY:
+#endif
+
+ case CFG_CNF_MICRO_WAVE:
+ //case CFG_CNF_LOAD_BALANCING:
+ //case CFG_CNF_MEDIUM_DISTRIBUTION:
+ //case CFG_CNF_RX_ALL_GROUP_ADDRESS:
+ //case CFG_CNF_COUNTRY_INFO:
+ //case CFG_COUNTRY_STRING:
+ case CFG_AP_MODE:
+ case CFG_ENCRYPT_STRING:
+ //case CFG_DRIVER_ENABLE:
+ case CFG_WOLAS_ENABLE:
+ case CFG_MB_INFO:
+ case CFG_IFB:
+ break;
+ /* Deal with this dynamic MSF RID, as it's required for WPA */
+ case CFG_DRIVER_ENABLE:
+ if( lp->driverEnable ) {
+ //hcf_cntl_port( &( lp->hcfCtx ),
+ // HCF_PORT_ENABLE | HCF_PORT_0 );
+ // //hcf_cntl( &( lp->hcfCtx ),
+ // // HCF_PORT_ENABLE | HCF_PORT_0 );
+ //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_ENABLE );
+ // //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_CONNECT );
+
+ hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_ENABLE | HCF_PORT_0 );
+ hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_CONNECT );
+ } else {
+ //hcf_cntl_port( &( lp->hcfCtx ),
+ // HCF_PORT_DISABLE | HCF_PORT_0 );
+ // //hcf_cntl( &( lp->hcfCtx ),
+ // // HCF_PORT_DISABLE | HCF_PORT_0 );
+ //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISABLE );
+ // //hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISCONNECT );
+
+ hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISABLE | HCF_PORT_0 );
+ hcf_cntl( &( lp->hcfCtx ), HCF_CNTL_DISCONNECT );
+ }
+ break;
+ default:
+ wl_act_int_off( lp );
+ urq->result = hcf_put_info(&(lp->hcfCtx), (LTVP) pLtv);
+ wl_act_int_on( lp );
+ break;
+ }
+
+ if( ltvAllocated ) {
+ kfree( pLtv );
+ }
+ } else {
+ urq->result = UIL_FAILURE;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "EPERM\n" );
+ urq->result = UIL_FAILURE;
+ result = -EPERM;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_put_info
+/*============================================================================*/
+
+/*******************************************************************************
+ * wvlan_uil_get_info()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sends a specific RID directly to the driver to retrieve configuration
+ * info.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ int i;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wvlan_uil_get_info" );
+ DBG_ENTER( DbgInfo );
+
+ if( urq->hcfCtx == &( lp->hcfCtx )) {
+ if(( urq->data != NULL ) && ( urq->len != 0 )) {
+ ltv_t *pLtv;
+ bool_t ltvAllocated = FALSE;
+
+ /* Make sure that we have at least a command and length */
+ if( urq->len < ( sizeof( hcf_16 ) * 2 )) {
+ urq->len = sizeof( lp->ltvRecord );
+ DBG_ERROR( DbgInfo, "No Length/Type in LTV!!!\n" );
+ DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
+ urq->result = UIL_ERR_LEN;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Verify the user's LTV record header. */
+ result = verify_area( VERIFY_READ, urq->data, sizeof( hcf_16 ) * 2 );
+ if( result != 0 ) {
+ DBG_ERROR( DbgInfo, "verify_area(), VERIFY_READ FAILED\n" );
+ urq->result = UIL_FAILURE;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Get only the command and length information. */
+ result = copy_from_user( &( lp->ltvRecord ), urq->data, sizeof( hcf_16 ) * 2 );
+
+ /* Make sure the incoming LTV record length is within the bounds of
+ the IOCTL length. */
+ if((( lp->ltvRecord.len + 1 ) * sizeof( hcf_16 )) > urq->len ) {
+ DBG_ERROR( DbgInfo, "Incoming LTV too big\n" );
+ urq->len = sizeof( lp->ltvRecord );
+ urq->result = UIL_ERR_LEN;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Determine if hcf_get_info() is needed or not */
+ switch ( lp->ltvRecord.typ ) {
+ case CFG_NIC_IDENTITY:
+ memcpy( &lp->ltvRecord.u.u8[0], &lp->NICIdentity, sizeof( lp->NICIdentity ));
+ break;
+ case CFG_PRI_IDENTITY:
+ memcpy( &lp->ltvRecord.u.u8[0], &lp->PrimaryIdentity, sizeof( lp->PrimaryIdentity ));
+ break;
+ case CFG_AP_MODE:
+ DBG_ERROR( DbgInfo, "set CFG_AP_MODE no longer supported, so is get useful ????\n" );
+ lp->ltvRecord.u.u16[0] =
+ CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP;
+ break;
+ //case CFG_DRV_INFO:
+ case CFG_ENCRYPT_STRING:
+ case CFG_COUNTRY_STRING:
+ case CFG_DRIVER_ENABLE:
+ case CFG_WOLAS_ENABLE:
+ // TODO: determine if we're going to support these
+ urq->result = UIL_FAILURE;
+ break;
+ case CFG_DRV_INFO:
+ DBG_TRACE( DbgInfo, "Intercept CFG_DRV_INFO\n" );
+ result = cfg_driver_info( urq, lp );
+ break;
+ case CFG_DRV_IDENTITY:
+ DBG_TRACE( DbgInfo, "Intercept CFG_DRV_IDENTITY\n" );
+ result = cfg_driver_identity( urq, lp );
+ break;
+ case CFG_IFB:
+ /* IFB can be a security hole */
+ if( !capable( CAP_NET_ADMIN )) {
+ result = -EPERM;
+ break;
+ }
+
+ /* Else fall through to the default */
+
+ case CFG_FW_IDENTITY: // For Hermes-1, this is cached
+ default:
+
+ /* Verify the user buffer */
+ result = verify_area( VERIFY_WRITE, urq->data, urq->len );
+ if( result != 0 ) {
+ DBG_ERROR( DbgInfo, "verify_area(), VERIFY_WRITE FAILED\n" );
+ urq->result = UIL_FAILURE;
+ break;
+ }
+
+ /* If the requested length is greater than the size of our local
+ LTV record, try to allocate it from the kernel stack.
+ Otherwise, we just use our local LTV record. */
+ if( urq->len > sizeof( lp->ltvRecord )) {
+ if(( pLtv = (ltv_t *)kmalloc( urq->len, GFP_KERNEL )) != NULL ) {
+ ltvAllocated = TRUE;
+
+ /* Copy the command/length information into the new buffer. */
+ memcpy( pLtv, &( lp->ltvRecord ), sizeof( hcf_16 ) * 2 );
+ } else {
+ urq->len = sizeof( lp->ltvRecord );
+ urq->result = UIL_ERR_LEN;
+ DBG_ERROR( DbgInfo, "kmalloc FAILED\n" );
+ DBG_ERROR( DbgInfo, "UIL_ERR_LEN\n" );
+ result = -ENOMEM;
+ break;
+ }
+ } else {
+ pLtv = &( lp->ltvRecord );
+ }
+
+ wl_act_int_off( lp );
+ urq->result = hcf_get_info( &( lp->hcfCtx ), (LTVP) pLtv );
+ wl_act_int_on( lp );
+
+ // Copy the LTV into the user's buffer.
+ //copy_to_user( urq->data, pLtv, urq->len );
+
+ //if( ltvAllocated )
+ //{
+ // kfree( pLtv );
+ //}
+
+ //urq->result = UIL_SUCCESS;
+ break;
+ }
+
+ /* Handle endian conversion of special fields */
+ switch( lp->ltvRecord.typ ) {
+ /* simple int gets just need the first hcf_16 byte flipped */
+ case CFG_CNF_PORT_TYPE:
+ case CFG_CNF_OWN_CHANNEL:
+ case CFG_CNF_OWN_ATIM_WINDOW:
+ case CFG_CNF_SYSTEM_SCALE:
+ case CFG_CNF_MAX_DATA_LEN:
+ case CFG_CNF_PM_ENABLED:
+ case CFG_CNF_MCAST_RX:
+ case CFG_CNF_MAX_SLEEP_DURATION:
+ case CFG_CNF_HOLDOVER_DURATION:
+ case CFG_CNF_OWN_DTIM_PERIOD:
+ case CFG_CNF_MCAST_PM_BUF:
+ case CFG_CNF_REJECT_ANY:
+ case CFG_CNF_ENCRYPTION:
+ case CFG_CNF_AUTHENTICATION:
+ case CFG_CNF_EXCL_UNENCRYPTED:
+ case CFG_CNF_INTRA_BSS_RELAY:
+ case CFG_CNF_MICRO_WAVE:
+ case CFG_CNF_LOAD_BALANCING:
+ case CFG_CNF_MEDIUM_DISTRIBUTION:
+#ifdef WARP
+ case CFG_CNF_TX_POW_LVL:
+ case CFG_CNF_CONNECTION_CNTL:
+ case CFG_CNF_OWN_BEACON_INTERVAL: // Own Beacon Interval
+ case CFG_COEXISTENSE_BEHAVIOUR: // Coexistence Behavior
+ //case CFG_CNF_RX_ALL_GROUP_ADDRESS:
+#endif // HERMES25
+ case CFG_CREATE_IBSS:
+ case CFG_RTS_THRH:
+ case CFG_PROMISCUOUS_MODE:
+ //case CFG_WAKE_ON_LAN:
+ case CFG_RTS_THRH0:
+ case CFG_RTS_THRH1:
+ case CFG_RTS_THRH2:
+ case CFG_RTS_THRH3:
+ case CFG_RTS_THRH4:
+ case CFG_RTS_THRH5:
+ case CFG_RTS_THRH6:
+ case CFG_TX_RATE_CNTL0:
+ case CFG_TX_RATE_CNTL1:
+ case CFG_TX_RATE_CNTL2:
+ case CFG_TX_RATE_CNTL3:
+ case CFG_TX_RATE_CNTL4:
+ case CFG_TX_RATE_CNTL5:
+ case CFG_TX_RATE_CNTL6:
+ case CFG_TX_KEY_ID:
+ case CFG_TICK_TIME:
+ case CFG_MAX_LOAD_TIME:
+ case CFG_NIC_TEMP_TYPE:
+ case CFG_PORT_STAT:
+ case CFG_CUR_TX_RATE:
+ case CFG_CUR_BEACON_INTERVAL:
+ case CFG_PROTOCOL_RSP_TIME:
+ case CFG_CUR_SHORT_RETRY_LIMIT:
+ case CFG_CUR_LONG_RETRY_LIMIT:
+ case CFG_MAX_TX_LIFETIME:
+ case CFG_MAX_RX_LIFETIME:
+ case CFG_CF_POLLABLE:
+ case CFG_PRIVACY_OPT_IMPLEMENTED:
+ //case CFG_CURRENT_REMOTE_RATES:
+ //case CFG_CURRENT_USED_RATES:
+ //case CFG_CURRENT_SYSTEM_SCALE:
+ //case CFG_CURRENT_TX_RATE1:
+ //case CFG_CURRENT_TX_RATE2:
+ //case CFG_CURRENT_TX_RATE3:
+ //case CFG_CURRENT_TX_RATE4:
+ //case CFG_CURRENT_TX_RATE5:
+ //case CFG_CURRENT_TX_RATE6:
+ case CFG_PHY_TYPE:
+ case CFG_CUR_CHANNEL:
+ //case CFG_CURRENT_POWER_STATE:
+ //case CFG_CCAMODE:
+ // lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ // break;
+ /* name string gets just need the first hcf_16 byte flipped (length of string) */
+ case CFG_CNF_OWN_SSID:
+ case CFG_CNF_OWN_NAME:
+ //case CNF_DESIRED_SSID:
+ case CFG_DESIRED_SSID:
+ case CFG_SCAN_SSID:
+ case CFG_CUR_SSID:
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ break;
+ /* non-length counted strings need no byte flipping */
+ case CFG_CNF_OWN_MAC_ADDR:
+ /* this case is no longer valid: CFG_CNF_WDS_ADDR */
+ case CFG_CNF_WDS_ADDR1:
+ case CFG_CNF_WDS_ADDR2:
+ case CFG_CNF_WDS_ADDR3:
+ case CFG_CNF_WDS_ADDR4:
+ case CFG_CNF_WDS_ADDR5:
+ case CFG_CNF_WDS_ADDR6:
+ case CFG_GROUP_ADDR:
+ case CFG_NIC_SERIAL_NUMBER:
+ case CFG_CUR_BSSID:
+ case CFG_NIC_MAC_ADDR:
+ case CFG_SUPPORTED_DATA_RATES: /* need to ensure we can treat this as a string */
+ break;
+ //case CFG_CNF_COUNTRY_INFO: /* special case, see page 75 of 022486, Rev C. */
+ //case CFG_CURRENT_COUNTRY_INFO: /* special case, see page 101 of 022486, Rev C. */
+ /*
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
+
+ for( i = 4; i < lp->ltvRecord.len; i++ ) {
+ lp->ltvRecord.u.u16[i] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[i] );
+ }
+ break;
+ */
+
+ case CFG_DEFAULT_KEYS:
+ {
+ CFG_DEFAULT_KEYS_STRCT *pKeys = (CFG_DEFAULT_KEYS_STRCT *)&lp->ltvRecord.u.u8[0];
+
+ pKeys[0].len = CNV_INT_TO_LITTLE( pKeys[0].len );
+ pKeys[1].len = CNV_INT_TO_LITTLE( pKeys[1].len );
+ pKeys[2].len = CNV_INT_TO_LITTLE( pKeys[2].len );
+ pKeys[3].len = CNV_INT_TO_LITTLE( pKeys[3].len );
+ }
+ break;
+ case CFG_CNF_MCAST_RATE:
+ case CFG_TX_RATE_CNTL:
+ case CFG_SUPPORTED_RATE_SET_CNTL: // Supported Rate Set Control
+ case CFG_BASIC_RATE_SET_CNTL: // Basic Rate Set Control
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
+ break;
+ case CFG_DL_BUF:
+ case CFG_NIC_IDENTITY:
+ case CFG_COMMS_QUALITY:
+ case CFG_PCF_INFO:
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
+ lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
+ break;
+ case CFG_FW_IDENTITY:
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
+ lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
+ lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
+ break;
+ //case CFG_HSI_SUP_RANGE:
+ case CFG_NIC_MFI_SUP_RANGE:
+ case CFG_NIC_CFI_SUP_RANGE:
+ case CFG_NIC_PROFILE:
+ case CFG_FW_SUP_RANGE:
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[0] );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[1] );
+ lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[2] );
+ lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[3] );
+ lp->ltvRecord.u.u16[4] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[4] );
+ break;
+ case CFG_MFI_ACT_RANGES_STA:
+ case CFG_CFI_ACT_RANGES_STA:
+ case CFG_CUR_SCALE_THRH:
+ case CFG_AUTHENTICATION_ALGORITHMS:
+ for( i = 0; i < ( lp->ltvRecord.len - 1 ); i++ ) {
+ lp->ltvRecord.u.u16[i] = CNV_INT_TO_LITTLE( lp->ltvRecord.u.u16[i] );
+ }
+ break;
+ /* done at init time, and endian handled then */
+ case CFG_PRI_IDENTITY:
+ break;
+ case CFG_MB_INFO:
+ //wvlanEndianTranslateMailbox( pLtv );
+ break;
+ /* MSF and HCF RIDS */
+ case CFG_IFB:
+ case CFG_DRV_INFO:
+ case CFG_AP_MODE:
+ case CFG_ENCRYPT_STRING:
+ case CFG_COUNTRY_STRING:
+ case CFG_DRIVER_ENABLE:
+ case CFG_WOLAS_ENABLE:
+ default:
+ break;
+ }
+
+ // Copy the LTV into the user's buffer.
+ copy_to_user( urq->data, &( lp->ltvRecord ), urq->len );
+
+ if( ltvAllocated ) {
+ kfree( &( lp->ltvRecord ));
+ }
+
+ urq->result = UIL_SUCCESS;
+ } else {
+ urq->result = UIL_FAILURE;
+ }
+ } else {
+ DBG_ERROR( DbgInfo, "UIL_ERR_WRONG_IFB\n" );
+ urq->result = UIL_ERR_WRONG_IFB;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // wvlan_uil_get_info
+/*============================================================================*/
+
+
+
+
+
+/*******************************************************************************
+ * cfg_driver_info()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Retrieves driver information.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int cfg_driver_info( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "cfg_driver_info" );
+ DBG_ENTER( DbgInfo );
+
+
+ /* Make sure that user buffer can handle the driver information buffer */
+ if( urq->len < sizeof( lp->driverInfo )) {
+ urq->len = sizeof( lp->driverInfo );
+ urq->result = UIL_ERR_LEN;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Verify the user buffer. */
+ result = verify_area( VERIFY_WRITE, urq->data, sizeof( lp->driverInfo ));
+ if( result != 0 ) {
+ urq->result = UIL_FAILURE;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ lp->driverInfo.card_stat = lp->hcfCtx.IFB_CardStat;
+
+ // Copy the driver information into the user's buffer.
+ urq->result = UIL_SUCCESS;
+ copy_to_user( urq->data, &( lp->driverInfo ), sizeof( lp->driverInfo ));
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // cfg_driver_info
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * cfg_driver_identity()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Retrieves ID information from the card.
+ *
+ * PARAMETERS:
+ *
+ * urq - a pointer to the UIL request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * UIL_SUCCESS
+ * UIL_ERR_xxx value otherwise
+ *
+ ******************************************************************************/
+int cfg_driver_identity( struct uilreq *urq, struct wl_private *lp )
+{
+ int result = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_driver_identity" );
+ DBG_ENTER( DbgInfo );
+
+
+ /* Make sure that user buffer can handle the driver identity structure. */
+ if( urq->len < sizeof( lp->driverIdentity )) {
+ urq->len = sizeof( lp->driverIdentity );
+ urq->result = UIL_ERR_LEN;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Verify the user buffer. */
+ result = verify_area( VERIFY_WRITE, urq->data, sizeof( lp->driverIdentity ));
+ if( result != 0 ) {
+ urq->result = UIL_FAILURE;
+ DBG_LEAVE( DbgInfo );
+ return result;
+ }
+
+ /* Copy the driver identity into the user's buffer. */
+ urq->result = UIL_SUCCESS;
+ copy_to_user( urq->data, &( lp->driverIdentity ), sizeof( lp->driverIdentity ));
+
+ DBG_LEAVE( DbgInfo );
+ return result;
+} // cfg_driver_identity
+/*============================================================================*/
+
+
+#endif /* USE_UIL */
+
+
+/* If WIRELESS_EXT is not defined, then the functions that follow will not be
+ included in the build. */
+/* NOTE: Are these still even needed? */
+#ifdef WIRELESS_EXT
+
+
+/*******************************************************************************
+ * wvlan_set_netname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Set the ESSID of the card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_set_netname(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_set_netname" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock(lp, &flags);
+
+ memset( lp->NetworkName, 0, sizeof( lp->NetworkName ));
+ memcpy( lp->NetworkName, extra, wrqu->data.length);
+
+ /* Commit the adapter parameters */
+ wl_apply(lp);
+ wl_unlock(lp, &flags);
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wvlan_set_netname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_get_netname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Get the ESSID of the card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_get_netname(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ wvName_t *pName;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_get_netname" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock(lp, &flags);
+
+ /* Get the current network name */
+ lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CUR_SSID;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
+
+ memset(extra, '\0', HCF_MAX_NAME_LEN);
+ wrqu->data.length = pName->length;
+
+ memcpy(extra, pName->name, pName->length);
+ } else {
+ ret = -EFAULT;
+ }
+
+ wl_unlock(lp, &flags);
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wvlan_get_netname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_set_station_nickname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Set the card's station nickname.
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_set_station_nickname(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_set_station_nickname" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock(lp, &flags);
+
+ memset( lp->StationName, 0, sizeof( lp->StationName ));
+
+ memcpy( lp->StationName, extra, wrqu->data.length);
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+ wl_unlock(lp, &flags);
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wvlan_set_station_nickname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_get_station_nickname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Get the card's station nickname.
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_get_station_nickname(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ wvName_t *pName;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_get_station_nickname" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock( lp, &flags );
+
+ /* Get the current station name */
+ lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CNF_OWN_NAME;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
+
+ memset(extra, '\0', HCF_MAX_NAME_LEN);
+ wrqu->data.length = pName->length;
+ memcpy(extra, pName->name, pName->length);
+ } else {
+ ret = -EFAULT;
+ }
+
+ wl_unlock(lp, &flags);
+
+//out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wvlan_get_station_nickname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wvlan_set_porttype()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Set the card's porttype
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_set_porttype(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ hcf_16 portType;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_set_porttype" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock(lp, &flags);
+
+ /* Validate the new value */
+ portType = *((__u32 *)extra);
+
+ if( !(( portType == 1 ) || ( portType == 3 ))) {
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+
+ lp->PortType = portType;
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+out_unlock:
+ wl_unlock(lp, &flags);
+
+//out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+}
+
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wvlan_get_porttype()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Get the card's porttype
+ *
+ * PARAMETERS:
+ *
+ * wrq - a pointer to the wireless request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_get_porttype(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *wrqu,
+ char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ hcf_16 *pPortType;
+ __u32 *pData = (__u32 *)extra;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_get_porttype" );
+ DBG_ENTER( DbgInfo );
+
+ wl_lock( lp, &flags );
+
+ /* Get the current port type */
+ lp->ltvRecord.len = 1 + ( sizeof( *pPortType ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CNF_PORT_TYPE;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pPortType = (hcf_16 *)&( lp->ltvRecord.u.u32 );
+
+ *pData = CNV_LITTLE_TO_INT( *pPortType );
+ } else {
+ ret = -EFAULT;
+ }
+
+ wl_unlock(lp, &flags);
+
+//out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wvlan_get_porttype
+/*============================================================================*/
+
+#endif // WIRELESS_EXT
+
+
+
+
+#ifdef USE_RTS
+/*******************************************************************************
+ * wvlan_rts()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * IOCTL handler for RTS commands
+ *
+ * PARAMETERS:
+ *
+ * rrq - a pointer to the rts request buffer
+ * lp - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wvlan_rts( struct rtsreq *rrq, __u32 io_base )
+{
+ int ioctl_ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wvlan_rts" );
+ DBG_ENTER( DbgInfo );
+
+
+ DBG_PRINT( "io_base: 0x%08x\n", io_base );
+
+ switch( rrq->typ ) {
+ case WL_IOCTL_RTS_READ:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_READ\n");
+ rrq->data[0] = IN_PORT_WORD( io_base + rrq->reg );
+ DBG_TRACE( DbgInfo, " reg 0x%04x ==> 0x%04x\n", rrq->reg, CNV_LITTLE_TO_SHORT( rrq->data[0] ) );
+ break;
+ case WL_IOCTL_RTS_WRITE:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_WRITE\n");
+ OUT_PORT_WORD( io_base + rrq->reg, rrq->data[0] );
+ DBG_TRACE( DbgInfo, " reg 0x%04x <== 0x%04x\n", rrq->reg, CNV_LITTLE_TO_SHORT( rrq->data[0] ) );
+ break;
+ case WL_IOCTL_RTS_BATCH_READ:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_READ\n");
+ IN_PORT_STRING_16( io_base + rrq->reg, rrq->data, rrq->len );
+ DBG_TRACE( DbgInfo, " reg 0x%04x ==> %d bytes\n", rrq->reg, rrq->len * sizeof (__u16 ) );
+ break;
+ case WL_IOCTL_RTS_BATCH_WRITE:
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- WL_IOCTL_RTS_BATCH_WRITE\n");
+ OUT_PORT_STRING_16( io_base + rrq->reg, rrq->data, rrq->len );
+ DBG_TRACE( DbgInfo, " reg 0x%04x <== %d bytes\n", rrq->reg, rrq->len * sizeof (__u16) );
+ break;
+ default:
+
+ DBG_TRACE(DbgInfo, "IOCTL: WVLAN2_IOCTL_RTS -- UNSUPPORTED RTS CODE: 0x%X", rrq->typ );
+ ioctl_ret = -EOPNOTSUPP;
+ break;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return ioctl_ret;
+} // wvlan_rts
+/*============================================================================*/
+
+#endif /* USE_RTS */
diff --git a/drivers/staging/wlags49_h2/wl_priv.h b/drivers/staging/wlags49_h2/wl_priv.h
new file mode 100644
index 000000000000..039b317d1296
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_priv.h
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for the private IOCTL handlers.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_priv.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_PRIV_H__
+#define __WL_PRIV_H__
+
+
+
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+#ifdef WIRELESS_EXT
+
+
+int wvlan_set_netname( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+int wvlan_get_netname( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+int wvlan_set_station_nickname( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+int wvlan_get_station_nickname( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+int wvlan_set_porttype( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+int wvlan_get_porttype( struct net_device *, struct iw_request_info *, union iwreq_data *, char *extra );
+
+
+#endif // WIRELESS_EXT
+
+
+
+
+#ifdef USE_UIL
+
+int wvlan_uil( struct uilreq *urq, struct wl_private *lp );
+
+// int wvlan_uil_connect( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_disconnect( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_action( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_block( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_unblock( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_send_diag_msg( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_put_info( struct uilreq *urq, struct wl_private *lp );
+// int wvlan_uil_get_info( struct uilreq *urq, struct wl_private *lp );
+
+//int cfg_driver_info( struct uilreq *urq, struct wl_private *lp );
+//int cfg_driver_identity( struct uilreq *urq, struct wl_private *lp );
+
+#endif // USE_UIL
+
+
+#ifdef USE_RTS
+
+int wvlan_rts( struct rtsreq *rrq, __u32 io_base );
+int wvlan_rts_read( __u16 reg, __u16 *val, __u32 io_base );
+int wvlan_rts_write( __u16 reg, __u16 val, __u32 io_base );
+int wvlan_rts_batch_read( struct rtsreq *rrq, __u32 io_base );
+int wvlan_rts_batch_write( struct rtsreq *rrq, __u32 io_base );
+
+#endif // USE_RTS
+
+
+#endif // __WL_PRIV_H__
diff --git a/drivers/staging/wlags49_h2/wl_profile.c b/drivers/staging/wlags49_h2/wl_profile.c
new file mode 100644
index 000000000000..4130e6a0ea76
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_profile.c
@@ -0,0 +1,1128 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file defines routines required to parse configuration parameters
+ * listed in a config file, if that config file exists.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/04 12:36:10 $
+ * $Revision: 1.10 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_profile.c,v $
+ *
+ ******************************************************************************/
+
+
+
+
+/* Only include this file if USE_PROFILE is defined */
+#ifdef USE_PROFILE
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+
+
+/* Allow support for calling system fcns to parse config file */
+#define __KERNEL_SYSCALLS__
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/unistd.h>
+#include <asm/uaccess.h>
+#include <limits.h>
+
+#define BIN_DL 1
+
+#include <debug.h>
+#include <hcf.h>
+//#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_enc.h>
+#include <wl_main.h>
+#include <wl_profile.h>
+
+
+/*******************************************************************************
+ * global variables
+ ******************************************************************************/
+
+/* Definition needed to prevent unresolved external in unistd.h */
+static int errno;
+
+#if DBG
+extern p_u32 DebugFlag;
+extern dbg_info_t *DbgInfo;
+#endif
+
+int parse_yes_no( char* value );
+
+
+int parse_yes_no( char* value ) {
+int rc = 0; //default to NO for invalid parameters
+
+ if ( strlen( value ) == 1 ) {
+ if ( ( value[0] | ('Y'^'y') ) == 'y' ) rc = 1;
+// } else {
+// this should not be debug time info, it is an enduser data entry error ;?
+// DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MICROWAVE_ROBUSTNESS );
+ }
+ return rc;
+} // parse_yes_no
+
+
+/*******************************************************************************
+ * parse_config()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function opens the device's config file and parses the options from
+ * it, so that it can properly configure itself. If no configuration file
+ * or configuration is present, then continue to use the options already
+ * parsed from config.opts or wireless.opts.
+ *
+ * PARAMETERS:
+ *
+ * dev - a pointer to the device's net_device structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void parse_config( struct net_device *dev )
+{
+ int file_desc;
+#if 0 // BIN_DL
+ int rc;
+ char *cp = NULL;
+#endif // BIN_DL
+ char buffer[MAX_LINE_SIZE];
+ char filename[MAX_LINE_SIZE];
+ mm_segment_t fs;
+ struct wl_private *wvlan_config = NULL;
+ ENCSTRCT sEncryption;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "parse_config" );
+ DBG_ENTER( DbgInfo );
+
+ /* Get the wavelan specific info for this device */
+ wvlan_config = (struct wl_private *)dev->priv;
+ if ( wvlan_config == NULL ) {
+ DBG_ERROR( DbgInfo, "Wavelan specific info struct not present?\n" );
+ return;
+ }
+
+ /* setup the default encryption string */
+ strcpy( wvlan_config->szEncryption, DEF_CRYPT_STR );
+
+ /* Obtain a user-space process context, storing the original context */
+ fs = get_fs( );
+ set_fs( get_ds( ));
+
+ /* Determine the filename for this device and attempt to open it */
+ sprintf( filename, "%s%s", ROOT_CONFIG_FILENAME, dev->name );
+ file_desc = open( filename, O_RDONLY, 0 );
+ if ( file_desc != -1 ) {
+ DBG_TRACE( DbgInfo, "Wireless config file found. Parsing options...\n" );
+
+ /* Read out the options */
+ while( readline( file_desc, buffer )) {
+ translate_option( buffer, wvlan_config );
+ }
+ /* Close the file */
+ close( file_desc ); //;?even if file_desc == -1 ???
+ } else {
+ DBG_TRACE( DbgInfo, "No iwconfig file found for this device; "
+ "config.opts or wireless.opts will be used\n" );
+ }
+ /* Return to the original context */
+ set_fs( fs );
+
+ /* convert the WEP keys, if read in as key1, key2, type of data */
+ if ( wvlan_config->EnableEncryption ) {
+ memset( &sEncryption, 0, sizeof( sEncryption ));
+
+ wl_wep_decode( CRYPT_CODE, &sEncryption,
+ wvlan_config->szEncryption );
+
+ /* the Linux driver likes to use 1-4 for the key IDs, and then
+ convert to 0-3 when sending to the card. The Windows code
+ base used 0-3 in the API DLL, which was ported to Linux. For
+ the sake of the user experience, we decided to keep 0-3 as the
+ numbers used in the DLL; and will perform the +1 conversion here.
+ We could have converted the entire Linux driver, but this is
+ less obtrusive. This may be a "todo" to convert the whole driver */
+ sEncryption.wEnabled = wvlan_config->EnableEncryption;
+ sEncryption.wTxKeyID = wvlan_config->TransmitKeyID - 1;
+
+ memcpy( &sEncryption.EncStr, &wvlan_config->DefaultKeys,
+ sizeof( CFG_DEFAULT_KEYS_STRCT ));
+
+ memset( wvlan_config->szEncryption, 0, sizeof( wvlan_config->szEncryption ));
+
+ wl_wep_code( CRYPT_CODE, wvlan_config->szEncryption, &sEncryption,
+ sizeof( sEncryption ));
+ }
+
+ /* decode the encryption string for the call to wl_commit() */
+ wl_wep_decode( CRYPT_CODE, &sEncryption, wvlan_config->szEncryption );
+
+ wvlan_config->TransmitKeyID = sEncryption.wTxKeyID + 1;
+ wvlan_config->EnableEncryption = sEncryption.wEnabled;
+
+ memcpy( &wvlan_config->DefaultKeys, &sEncryption.EncStr,
+ sizeof( CFG_DEFAULT_KEYS_STRCT ));
+
+#if 0 //BIN_DL
+ /* Obtain a user-space process context, storing the original context */
+ fs = get_fs( );
+ set_fs( get_ds( ));
+
+ //;?just to fake something
+ strcpy(/*wvlan_config->fw_image_*/filename, "/etc/agere/fw.bin" );
+ file_desc = open( /*wvlan_config->fw_image_*/filename, 0, 0 );
+ if ( file_desc == -1 ) {
+ DBG_ERROR( DbgInfo, "No image file found\n" );
+ } else {
+ DBG_TRACE( DbgInfo, "F/W image file found\n" );
+#define DHF_ALLOC_SIZE 96000 //just below 96K, let's hope it suffices for now and for the future
+ cp = (char*)vmalloc( DHF_ALLOC_SIZE );
+ if ( cp == NULL ) {
+ DBG_ERROR( DbgInfo, "error in vmalloc\n" );
+ } else {
+ rc = read( file_desc, cp, DHF_ALLOC_SIZE );
+ if ( rc == DHF_ALLOC_SIZE ) {
+ DBG_ERROR( DbgInfo, "buffer too small, %d\n", DHF_ALLOC_SIZE );
+ } else if ( rc > 0 ) {
+ DBG_TRACE( DbgInfo, "read O.K.: %d bytes %.12s\n", rc, cp );
+ rc = read( file_desc, &cp[rc], 1 );
+ if ( rc == 0 ) {
+ DBG_TRACE( DbgInfo, "no more to read\n" );
+ }
+ }
+ if ( rc != 0 ) {
+ DBG_ERROR( DbgInfo, "file not read in one swoop or other error"\
+ ", give up, too complicated, rc = %0X\n", rc );
+ }
+ vfree( cp );
+ }
+ close( file_desc );
+ }
+ set_fs( fs ); /* Return to the original context */
+#endif // BIN_DL
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // parse_config
+
+/*******************************************************************************
+ * readline()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function reads in data from a given file one line at a time,
+ * converting the detected newline character '\n' to a null '\0'. Note that
+ * the file descriptor must be valid before calling this function.
+ *
+ * PARAMETERS:
+ *
+ * filedesc - the file descriptor for the open configuration file
+ * buffer - a buffer pointer, passed in by the caller, to which the
+ * line will be stored.
+ *
+ * RETURNS:
+ *
+ * the number of bytes read
+ * -1 on error
+ *
+ ******************************************************************************/
+int readline( int filedesc, char *buffer )
+{
+ int result = -1;
+ int bytes_read = 0;
+ /*------------------------------------------------------------------------*/
+
+ /* Make sure the file descriptor is good */
+ if ( filedesc != -1 ) {
+ /* Read in from the file byte by byte until a newline is reached */
+ while(( result = read( filedesc, &buffer[bytes_read], 1 )) == 1 ) {
+ if ( buffer[bytes_read] == '\n' ) {
+ buffer[bytes_read] = '\0';
+ bytes_read++;
+ break;
+ }
+ bytes_read++;
+ }
+ }
+
+ /* Return the number of bytes read */
+ if ( result == -1 ) {
+ return result;
+ } else {
+ return bytes_read;
+ }
+} // readline
+/*============================================================================*/
+
+/*******************************************************************************
+ * translate_option()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function takes a line read in from the config file and parses out
+ * the key/value pairs. It then determines which key has been parsed and sets
+ * the card's configuration based on the value given.
+ *
+ * PARAMETERS:
+ *
+ * buffer - a buffer containing a line to translate
+ * config - a pointer to the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void translate_option( char *buffer, struct wl_private *lp )
+{
+ unsigned int value_convert = 0;
+ int string_length = 0;
+ char *key = NULL;
+ char *value = NULL;
+ u_char mac_value[ETH_ALEN];
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "translate_option" );
+
+ if ( buffer == NULL || lp == NULL ) {
+ DBG_ERROR( DbgInfo, "Config file buffer and/or wavelan buffer ptr NULL\n" );
+ return;
+ }
+
+ ParseConfigLine( buffer, &key, &value );
+
+ if ( key == NULL || value == NULL ) {
+ return;
+ }
+
+ /* Determine which key it is and perform the appropriate action */
+
+ /* Configuration parameters used in all scenarios */
+#if DBG
+ /* handle DebugFlag as early as possible so it starts its influence as early
+ * as possible
+ */
+ if ( strcmp( key, PARM_NAME_DEBUG_FLAG ) == 0 ) {
+ if ( DebugFlag == ~0 ) { //if DebugFlag is not specified on the command line
+ if ( DbgInfo->DebugFlag == 0 ) { /* if pc_debug did not set DebugFlag (i.e.pc_debug is
+ * not specified or specified outside the 4-8 range
+ */
+ DbgInfo->DebugFlag |= DBG_DEFAULTS;
+ }
+ } else {
+ DbgInfo->DebugFlag = wl_atoi( value ); //;?DebugFlag;
+ }
+ DbgInfo->DebugFlag = wl_atoi( value ); //;?Delete ASAP
+ }
+#endif /* DBG */
+ if ( strcmp( key, PARM_NAME_AUTH_KEY_MGMT_SUITE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTH_KEY_MGMT_SUITE, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_AUTH_KEY_MGMT_SUITE ) || ( value_convert <= PARM_MAX_AUTH_KEY_MGMT_SUITE )) {
+ lp->AuthKeyMgmtSuite = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTH_KEY_MGMT_SUITE );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_BRSC_2GHZ ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_2GHZ, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) {
+ lp->brsc[0] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_2GHZ );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_BRSC_5GHZ ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_BRSC_5GHZ, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_BRSC ) || ( value_convert <= PARM_MAX_BRSC )) {
+ lp->brsc[1] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_BRSC_5GHZ );
+ }
+ }
+ else if (( strcmp( key, PARM_NAME_DESIRED_SSID ) == 0 ) || ( strcmp( key, PARM_NAME_OWN_SSID ) == 0 )) {
+ DBG_TRACE( DbgInfo, "SSID, value: %s\n", value );
+
+ memset( lp->NetworkName, 0, ( PARM_MAX_NAME_LEN + 1 ));
+
+ /* Make sure the value isn't too long */
+ string_length = strlen( value );
+ if ( string_length > PARM_MAX_NAME_LEN ) {
+ DBG_WARNING( DbgInfo, "SSID too long; will be truncated\n" );
+ string_length = PARM_MAX_NAME_LEN;
+ }
+
+ memcpy( lp->NetworkName, value, string_length );
+ }
+#if 0
+ else if ( strcmp( key, PARM_NAME_DOWNLOAD_FIRMWARE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "DOWNLOAD_FIRMWARE, value: %s\n", value );
+ memset( lp->fw_image_filename, 0, ( MAX_LINE_SIZE + 1 ));
+ /* Make sure the value isn't too long */
+ string_length = strlen( value );
+ if ( string_length > MAX_LINE_SIZE ) {
+ DBG_WARNING( DbgInfo, "F/W image file name too long; will be ignored\n" );
+ } else {
+ memcpy( lp->fw_image_filename, value, string_length );
+ }
+ }
+#endif
+ else if ( strcmp( key, PARM_NAME_ENABLE_ENCRYPTION ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENABLE_ENCRYPTION, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_ENABLE_ENCRYPTION ) && ( value_convert <= PARM_MAX_ENABLE_ENCRYPTION )) {
+ lp->EnableEncryption = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_ENABLE_ENCRYPTION );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_ENCRYPTION ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_ENCRYPTION, value );
+
+ memset( lp->szEncryption, 0, sizeof( lp->szEncryption ));
+
+ /* Make sure the value isn't too long */
+ string_length = strlen( value );
+ if ( string_length > sizeof( lp->szEncryption ) ) {
+ DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_ENCRYPTION );
+ string_length = sizeof( lp->szEncryption );
+ }
+
+ memcpy( lp->szEncryption, value, string_length );
+ }
+ else if ( strcmp( key, PARM_NAME_KEY1 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY1, value );
+
+ if ( is_valid_key_string( value )) {
+ memset( lp->DefaultKeys.key[0].key, 0, MAX_KEY_SIZE );
+
+ key_string2key( value, &lp->DefaultKeys.key[0] );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY1 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_KEY2 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY2, value );
+
+ if ( is_valid_key_string( value )) {
+ memset( lp->DefaultKeys.key[1].key, 0, MAX_KEY_SIZE );
+
+ key_string2key( value, &lp->DefaultKeys.key[1] );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY2 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_KEY3 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY3, value );
+
+ if ( is_valid_key_string( value )) {
+ memset( lp->DefaultKeys.key[2].key, 0, MAX_KEY_SIZE );
+
+ key_string2key( value, &lp->DefaultKeys.key[2] );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY3 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_KEY4 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_KEY4, value );
+
+ if ( is_valid_key_string( value )) {
+ memset( lp->DefaultKeys.key[3].key, 0, MAX_KEY_SIZE );
+
+ key_string2key( value, &lp->DefaultKeys.key[3] );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_KEY4 );
+ }
+ }
+ /* New Parameters for WARP */
+ else if ( strcmp( key, PARM_NAME_LOAD_BALANCING ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_LOAD_BALANCING, value );
+ lp->loadBalancing = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MEDIUM_DISTRIBUTION ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MEDIUM_DISTRIBUTION, value );
+ lp->mediumDistribution = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MICROWAVE_ROBUSTNESS) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MICROWAVE_ROBUSTNESS, value );
+ lp->MicrowaveRobustness = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MULTICAST_RATE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RATE, value );
+
+ value_convert = wl_atoi( value );
+
+ if (( value_convert >= PARM_MIN_MULTICAST_RATE ) && ( value_convert <= PARM_MAX_MULTICAST_RATE )) {
+ lp->MulticastRate[0] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MULTICAST_RATE );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_OWN_CHANNEL ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_CHANNEL, value );
+
+ value_convert = wl_atoi( value );
+ if ( wl_is_a_valid_chan( value_convert )) {
+ if ( value_convert > 14 ) {
+ value_convert = value_convert | 0x100;
+ }
+ lp->Channel = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_CHANNEL );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_OWN_NAME ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_NAME, value );
+
+ memset( lp->StationName, 0, ( PARM_MAX_NAME_LEN + 1 ));
+
+ /* Make sure the value isn't too long */
+ string_length = strlen( value );
+ if ( string_length > PARM_MAX_NAME_LEN ) {
+ DBG_WARNING( DbgInfo, "%s too long; will be truncated\n", PARM_NAME_OWN_NAME );
+ string_length = PARM_MAX_NAME_LEN;
+ }
+
+ memcpy( lp->StationName, value, string_length );
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->RTSThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_SRSC_2GHZ ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_2GHZ, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) {
+ lp->srsc[0] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_2GHZ );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_SRSC_5GHZ ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SRSC_5GHZ, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_SRSC ) || ( value_convert <= PARM_MAX_SRSC )) {
+ lp->srsc[1] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invaid; will be ignored\n", PARM_NAME_SRSC_5GHZ );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_SYSTEM_SCALE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_SYSTEM_SCALE, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_SYSTEM_SCALE ) && ( value_convert <= PARM_MAX_SYSTEM_SCALE )) {
+ lp->DistanceBetweenAPs = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_SYSTEM_SCALE );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_KEY ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_KEY, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_KEY ) && ( value_convert <= PARM_MAX_TX_KEY )) {
+ lp->TransmitKeyID = wl_atoi( value );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_KEY );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->TxRateControl[0] = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_POW_LEVEL ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_POW_LEVEL, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_POW_LEVEL ) || ( value_convert <= PARM_MAX_TX_POW_LEVEL )) {
+ lp->txPowLevel = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_POW_LEVEL );
+ }
+ }
+
+ /* Need to add? : Country code, Short/Long retry */
+
+ /* Configuration parameters specific to STA mode */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+//;?seems reasonable that even an AP-only driver could afford this small additional footprint
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ //;?should we return an error status in AP mode
+ if ( strcmp( key, PARM_NAME_PORT_TYPE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PORT_TYPE, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert == PARM_MIN_PORT_TYPE ) || ( value_convert == PARM_MAX_PORT_TYPE )) {
+ lp->PortType = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PORT_TYPE );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_PM_ENABLED ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_ENABLED, value );
+ value_convert = wl_atoi( value );
+ /* ;? how about wl_main.c containing
+ * VALID_PARAM( PARM_PM_ENABLED <= WVLAN_PM_STATE_STANDARD ||
+ * ( PARM_PM_ENABLED & 0x7FFF ) <= WVLAN_PM_STATE_STANDARD );
+ */
+ if ( ( value_convert & 0x7FFF ) <= PARM_MAX_PM_ENABLED) {
+ lp->PMEnabled = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_ENABLED );
+ //;?this is a data entry error, hence not a DBG_WARNING
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_CREATE_IBSS ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CREATE_IBSS, value );
+ lp->CreateIBSS = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MULTICAST_RX ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_RX, value );
+ lp->MulticastReceive = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MAX_SLEEP ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MAX_SLEEP, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= 0 ) && ( value_convert <= 65535 )) {
+ lp->MaxSleepDuration = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_MAX_SLEEP );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_NETWORK_ADDR ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_NETWORK_ADDR, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->MACAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_NETWORK_ADDR );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_AUTHENTICATION ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_AUTHENTICATION, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_AUTHENTICATION ) && ( value_convert <= PARM_MAX_AUTHENTICATION )) {
+ lp->authentication = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_AUTHENTICATION );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_OWN_ATIM_WINDOW ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_ATIM_WINDOW, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_OWN_ATIM_WINDOW ) && ( value_convert <= PARM_MAX_OWN_ATIM_WINDOW )) {
+ lp->atimWindow = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_ATIM_WINDOW );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_PM_HOLDOVER_DURATION ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PM_HOLDOVER_DURATION, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_PM_HOLDOVER_DURATION ) && ( value_convert <= PARM_MAX_PM_HOLDOVER_DURATION )) {
+ lp->holdoverDuration = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_PM_HOLDOVER_DURATION );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_PROMISCUOUS_MODE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_PROMISCUOUS_MODE, value );
+ lp->promiscuousMode = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_CONNECTION_CONTROL ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_CONNECTION_CONTROL, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_CONNECTION_CONTROL ) && ( value_convert <= PARM_MAX_CONNECTION_CONTROL )) {
+ lp->connectionControl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_CONNECTION_CONTROL );
+ }
+ }
+
+ /* Need to add? : Probe Data Rate */
+ }
+#endif /* (HCF_TYPE) & HCF_TYPE_STA */
+
+ /* Configuration parameters specific to AP mode */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ if ( strcmp( key, PARM_NAME_OWN_DTIM_PERIOD ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_DTIM_PERIOD, value );
+
+ value_convert = wl_atoi( value );
+ if ( value_convert >= PARM_MIN_OWN_DTIM_PERIOD ) {
+ lp->DTIMPeriod = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_DTIM_PERIOD );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_REJECT_ANY ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_REJECT_ANY, value );
+ lp->RejectAny = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_EXCLUDE_UNENCRYPTED ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_EXCLUDE_UNENCRYPTED, value );
+ lp->ExcludeUnencrypted = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_MULTICAST_PM_BUFFERING ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_MULTICAST_PM_BUFFERING, value );
+ lp->ExcludeUnencrypted = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_INTRA_BSS_RELAY ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_INTRA_BSS_RELAY, value );
+ lp->ExcludeUnencrypted = parse_yes_no(value);
+ }
+ else if ( strcmp( key, PARM_NAME_OWN_BEACON_INTERVAL ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_OWN_BEACON_INTERVAL, value );
+
+ value_convert = wl_atoi( value );
+ if ( value_convert >= PARM_MIN_OWN_BEACON_INTERVAL ) {
+ lp->ownBeaconInterval = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_OWN_BEACON_INTERVAL );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_COEXISTENCE ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_COEXISTENCE, value );
+
+ value_convert = wl_atoi( value );
+ if ( value_convert >= PARM_MIN_COEXISTENCE ) {
+ lp->coexistence = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_COEXISTENCE );
+ }
+ }
+
+#ifdef USE_WDS
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD1 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD1, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[0].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD1 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD2 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD2, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[1].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD2 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD3 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD3, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[2].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD3 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD4 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD4, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[3].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD4 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD5 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD5, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[4].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD5 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_RTS_THRESHOLD6 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_RTS_THRESHOLD6, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_RTS_THRESHOLD ) && ( value_convert <= PARM_MAX_RTS_THRESHOLD )) {
+ lp->wds_port[5].rtsThreshold = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_RTS_THRESHOLD6 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE1 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE1, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[0].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE1 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE2 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE2, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[1].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE2 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE3 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE3, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[2].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE3 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE4 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE4, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[3].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE4 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE5 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE5, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[4].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE5 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_TX_RATE6 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_TX_RATE6, value );
+
+ value_convert = wl_atoi( value );
+ if (( value_convert >= PARM_MIN_TX_RATE ) && ( value_convert <= PARM_MAX_TX_RATE )) {
+ lp->wds_port[5].txRateCntl = value_convert;
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_TX_RATE6 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS1 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS1, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[0].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS1 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS2 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS2, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[1].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS2 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS3 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS3, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[2].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS3 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS4 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS4, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[3].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS4 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS5 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS5, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[4].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS5 );
+ }
+ }
+ else if ( strcmp( key, PARM_NAME_WDS_ADDRESS6 ) == 0 ) {
+ DBG_TRACE( DbgInfo, "%s, value: %s\n", PARM_NAME_WDS_ADDRESS6, value );
+
+ if ( parse_mac_address( value, mac_value ) == ETH_ALEN ) {
+ memcpy( lp->wds_port[5].wdsAddress, mac_value, ETH_ALEN );
+ } else {
+ DBG_WARNING( DbgInfo, "%s invalid; will be ignored\n", PARM_NAME_WDS_ADDRESS6 );
+ }
+ }
+#endif /* USE_WDS */
+ }
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+ return;
+} // translate_option
+/*============================================================================*/
+
+/*******************************************************************************
+ * parse_mac_address()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function will parse a mac address string and convert it to a byte
+ * array.
+ *
+ * PARAMETERS:
+ *
+ * value - the MAC address, represented as a string
+ * byte_array - the MAC address, represented as a byte array of length
+ * ETH_ALEN
+ *
+ * RETURNS:
+ *
+ * The number of bytes in the final MAC address, should equal to ETH_ALEN.
+ *
+ ******************************************************************************/
+int parse_mac_address( char *value, u_char *byte_array )
+{
+ int value_offset = 0;
+ int array_offset = 0;
+ int field_offset = 0;
+ char byte_field[3];
+ /*------------------------------------------------------------------------*/
+
+ memset( byte_field, '\0', 3 );
+
+ while( value[value_offset] != '\0' ) {
+ /* Skip over the colon chars seperating the bytes, if they exist */
+ if ( value[value_offset] == ':' ) {
+ value_offset++;
+ continue;
+ }
+
+ byte_field[field_offset] = value[value_offset];
+ field_offset++;
+ value_offset++;
+
+ /* Once the byte_field is filled, convert it and store it */
+ if ( field_offset == 2 ) {
+ byte_field[field_offset] = '\0';
+ byte_array[array_offset] = simple_strtoul( byte_field, NULL, 16 );
+ field_offset = 0;
+ array_offset++;
+ }
+ }
+
+ /* Use the array_offset as a check; 6 bytes should be written to the
+ byte_array */
+ return array_offset;
+} // parse_mac_address
+/*============================================================================*/
+
+/*******************************************************************************
+ * ParseConfigLine()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Parses a line from the configuration file into an L-val and an R-val,
+ * representing a key/value pair.
+ *
+ * PARAMETERS:
+ *
+ * pszLine - the line from the config file to parse
+ * ppszLVal - the resulting L-val (Key)
+ * ppszRVal - the resulting R-val (Value)
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal )
+{
+ int i;
+ int size;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "ParseConfigLine" );
+ DBG_ENTER( DbgInfo );
+
+ /* get a snapshot of our string size */
+ size = strlen( pszLine );
+ *ppszLVal = NULL;
+ *ppszRVal = NULL;
+
+ if ( pszLine[0] != '#' && /* skip the line if it is a comment */
+ pszLine[0] != '\n'&& /* if it's an empty UNIX line, do nothing */
+ !( pszLine[0] == '\r' && pszLine[1] == '\n' ) /* if it's an empty MS-DOS line, do nothing */
+ ) {
+ /* advance past any whitespace, and assign the L-value */
+ for( i = 0; i < size; i++ ) {
+ if ( pszLine[i] != ' ' ) {
+ *ppszLVal = &pszLine[i];
+ break;
+ }
+ }
+ /* advance to the end of the l-value*/
+ for( i++; i < size; i++ ) {
+ if ( pszLine[i] == ' ' || pszLine[i] == '=' ) {
+ pszLine[i] = '\0';
+ break;
+ }
+ }
+ /* make any whitespace and the equal sign a NULL character, and
+ advance to the R-Value */
+ for( i++; i < size; i++ ) {
+ if ( pszLine[i] == ' ' || pszLine[i] == '=' ) {
+ pszLine[i] = '\0';
+ continue;
+ }
+ *ppszRVal = &pszLine[i];
+ break;
+ }
+ /* make the line ending character(s) a NULL */
+ for( i++; i < size; i++ ) {
+ if ( pszLine[i] == '\n' ) {
+ pszLine[i] = '\0';
+ }
+ if (( pszLine[i] == '\r' ) && ( pszLine[i+1] == '\n' )) {
+ pszLine[i] = '\0';
+ }
+ }
+ }
+ DBG_LEAVE( DbgInfo );
+} // ParseConfigLine
+/*============================================================================*/
+
+#endif // USE_PROFILE
diff --git a/drivers/staging/wlags49_h2/wl_profile.h b/drivers/staging/wlags49_h2/wl_profile.h
new file mode 100644
index 000000000000..a6ac4a3277bc
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_profile.h
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for the config parsing routines.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/23 11:46:19 $
+ * $Revision: 1.3 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_profile.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_PROFILE_H__
+#define __WL_PROFILE_H__
+
+
+
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+#define ROOT_CONFIG_FILENAME "/etc/agere/iwconfig-"
+
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+void parse_config( struct net_device *dev );
+
+int readline( int filedesc, char *buffer );
+
+void translate_option( char *buffer, struct wl_private *lp );
+
+int parse_mac_address( char *value, u_char *byte_array );
+
+void ParseConfigLine( char *pszLine, char **ppszLVal, char **ppszRVal );
+
+
+#endif // __WL_PROFILE_H__
diff --git a/drivers/staging/wlags49_h2/wl_sysfs.c b/drivers/staging/wlags49_h2/wl_sysfs.c
new file mode 100644
index 000000000000..864e01a736c8
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_sysfs.c
@@ -0,0 +1,135 @@
+/*
+ * ex: sw=4
+ */
+
+#include <linux/kernel.h>
+#include <linux/netdevice.h>
+#include <linux/if_arp.h>
+#include <net/sock.h>
+#include <linux/rtnetlink.h>
+#include <linux/wireless.h>
+#include <net/iw_handler.h>
+#include <linux/sysfs.h>
+
+#include <debug.h>
+#include <hcf.h>
+#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_main.h>
+#include <wl_wext.h>
+#include <wl_priv.h>
+
+static inline int dev_isalive(const struct net_device *dev)
+{
+ return dev->reg_state == NETREG_REGISTERED;
+}
+
+/*
+ * empirically even if tallies are defined as 32 bits entities, only
+ * high 16 bits are relevant; low half is always zero. It means tallies
+ * are pretty much useless for traffic counting but at least give overview
+ * about where error come from
+ */
+static ssize_t show_tallies(struct device *d, struct device_attribute *attr,
+ char *buf)
+{
+ struct net_device *dev = to_net_dev(d);
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ CFG_HERMES_TALLIES_STRCT tallies;
+ ssize_t ret = -EINVAL;
+
+ read_lock(&dev_base_lock);
+ if (dev_isalive(dev)) {
+ wl_lock(lp, &flags);
+
+ if ((ret = wl_get_tallies(lp, &tallies)) == 0) {
+ wl_unlock(lp, &flags);
+ ret = snprintf(buf, PAGE_SIZE,
+ "TxUnicastFrames: %u\n"
+ "TxMulticastFrames: %u\n"
+ "TxFragments: %u\n"
+ "TxUnicastOctets: %u\n"
+ "TxMulticastOctets: %u\n"
+ "TxDeferredTransmissions: %u\n"
+ "TxSingleRetryFrames: %u\n"
+ "TxMultipleRetryFrames: %u\n"
+ "TxRetryLimitExceeded: %u\n"
+ "TxDiscards: %u\n"
+ "RxUnicastFrames: %u\n"
+ "RxMulticastFrames: %u\n"
+ "RxFragments: %u\n"
+ "RxUnicastOctets: %u\n"
+ "RxMulticastOctets: %u\n"
+ "RxFCSErrors: %u\n"
+ "RxDiscardsNoBuffer: %u\n"
+ "TxDiscardsWrongSA: %u\n"
+ "RxWEPUndecryptable: %u\n"
+ "RxMsgInMsgFragments: %u\n"
+ "RxMsgInBadMsgFragments: %u\n"
+ "RxDiscardsWEPICVError: %u\n"
+ "RxDiscardsWEPExcluded: %u\n"
+ ,
+ (unsigned int)tallies.TxUnicastFrames,
+ (unsigned int)tallies.TxMulticastFrames,
+ (unsigned int)tallies.TxFragments,
+ (unsigned int)tallies.TxUnicastOctets,
+ (unsigned int)tallies.TxMulticastOctets,
+ (unsigned int)tallies.TxDeferredTransmissions,
+ (unsigned int)tallies.TxSingleRetryFrames,
+ (unsigned int)tallies.TxMultipleRetryFrames,
+ (unsigned int)tallies.TxRetryLimitExceeded,
+ (unsigned int)tallies.TxDiscards,
+ (unsigned int)tallies.RxUnicastFrames,
+ (unsigned int)tallies.RxMulticastFrames,
+ (unsigned int)tallies.RxFragments,
+ (unsigned int)tallies.RxUnicastOctets,
+ (unsigned int)tallies.RxMulticastOctets,
+ (unsigned int)tallies.RxFCSErrors,
+ (unsigned int)tallies.RxDiscardsNoBuffer,
+ (unsigned int)tallies.TxDiscardsWrongSA,
+ (unsigned int)tallies.RxWEPUndecryptable,
+ (unsigned int)tallies.RxMsgInMsgFragments,
+ (unsigned int)tallies.RxMsgInBadMsgFragments,
+ (unsigned int)tallies.RxDiscardsWEPICVError,
+ (unsigned int)tallies.RxDiscardsWEPExcluded);
+ } else {
+ wl_unlock( lp, &flags );
+ }
+ }
+
+ read_unlock(&dev_base_lock);
+ return ret;
+}
+
+static DEVICE_ATTR(tallies, S_IRUGO, show_tallies, NULL);
+
+static struct attribute *wlags_attrs[] = {
+ &dev_attr_tallies.attr,
+ NULL
+};
+
+static struct attribute_group wlags_group = {
+ .name = "wlags",
+ .attrs = wlags_attrs,
+};
+
+void register_wlags_sysfs(struct net_device *net)
+{
+ struct device *dev = &(net->dev);
+ struct wl_private *lp = wl_priv(net);
+
+ lp->sysfsCreated = sysfs_create_group(&dev->kobj, &wlags_group);
+}
+
+void unregister_wlags_sysfs(struct net_device *net)
+{
+ struct device *dev = &(net->dev);
+ struct wl_private *lp = wl_priv(net);
+
+ if (lp->sysfsCreated)
+ sysfs_remove_group(&dev->kobj, &wlags_group);
+}
diff --git a/drivers/staging/wlags49_h2/wl_sysfs.h b/drivers/staging/wlags49_h2/wl_sysfs.h
new file mode 100644
index 000000000000..6d96d03cf490
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_sysfs.h
@@ -0,0 +1,7 @@
+#ifdef CONFIG_SYSFS
+extern void register_wlags_sysfs(struct net_device *);
+extern void unregister_wlags_sysfs(struct net_device *);
+#else
+static void register_wlags_sysfs(struct net_device *) { return; };
+static void unregister_wlags_sysfs(struct net_device *) { return; };
+#endif
diff --git a/drivers/staging/wlags49_h2/wl_util.c b/drivers/staging/wlags49_h2/wl_util.c
new file mode 100644
index 000000000000..aba05d29a838
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_util.c
@@ -0,0 +1,1604 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This file defines misc utility functions.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/04 12:36:10 $
+ * $Revision: 1.6 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_util.c,v $
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/kernel.h>
+// #include <linux/sched.h>
+// #include <linux/ptrace.h>
+#include <linux/ctype.h>
+// #include <linux/string.h>
+// #include <linux/timer.h>
+// #include <linux/interrupt.h>
+// #include <linux/in.h>
+// #include <linux/delay.h>
+// #include <asm/io.h>
+// #include <asm/system.h>
+// #include <asm/bitops.h>
+
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+// #include <linux/skbuff.h>
+// #include <linux/if_arp.h>
+// #include <linux/ioport.h>
+
+#include <debug.h>
+#include <hcf.h>
+// #include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_wext.h>
+#include <wl_main.h>
+
+
+
+/*******************************************************************************
+ * global variables
+ ******************************************************************************/
+
+/* A matrix which maps channels to frequencies */
+#define MAX_CHAN_FREQ_MAP_ENTRIES 50
+static const long chan_freq_list[][MAX_CHAN_FREQ_MAP_ENTRIES] =
+{
+ {1,2412},
+ {2,2417},
+ {3,2422},
+ {4,2427},
+ {5,2432},
+ {6,2437},
+ {7,2442},
+ {8,2447},
+ {9,2452},
+ {10,2457},
+ {11,2462},
+ {12,2467},
+ {13,2472},
+ {14,2484},
+ {36,5180},
+ {40,5200},
+ {44,5220},
+ {48,5240},
+ {52,5260},
+ {56,5280},
+ {60,5300},
+ {64,5320},
+ {149,5745},
+ {153,5765},
+ {157,5785},
+ {161,5805}
+};
+
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif /* DBG */
+
+
+
+
+/*******************************************************************************
+ * dbm()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return an energy value in dBm.
+ *
+ * PARAMETERS:
+ *
+ * value - the energy value to be converted
+ *
+ * RETURNS:
+ *
+ * the value in dBm
+ *
+ ******************************************************************************/
+int dbm( int value )
+{
+ /* Truncate the value to be between min and max. */
+ if( value < HCF_MIN_SIGNAL_LEVEL )
+ value = HCF_MIN_SIGNAL_LEVEL;
+
+ if( value > HCF_MAX_SIGNAL_LEVEL )
+ value = HCF_MAX_SIGNAL_LEVEL;
+
+ /* Return the energy value in dBm. */
+ return ( value - HCF_0DBM_OFFSET );
+} // dbm
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * percent()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return a value as a percentage of min to max.
+ *
+ * PARAMETERS:
+ *
+ * value - the value in question
+ * min - the minimum range value
+ * max - the maximum range value
+ *
+ * RETURNS:
+ *
+ * the percentage value
+ *
+ ******************************************************************************/
+int percent( int value, int min, int max )
+{
+ /* Truncate the value to be between min and max. */
+ if( value < min )
+ value = min;
+
+ if( value > max )
+ value = max;
+
+ /* Return the value as a percentage of min to max. */
+ return ((( value - min ) * 100 ) / ( max - min ));
+} // percent
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * is_valid_key_string()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Checks to determine if the WEP key string is valid
+ *
+ * PARAMETERS:
+ *
+ * s - the string in question
+ *
+ * RETURNS:
+ *
+ * non-zero if the string contains a valid key
+ *
+ ******************************************************************************/
+int is_valid_key_string( char *s )
+{
+ int l;
+ int i;
+ /*------------------------------------------------------------------------*/
+
+
+ l = strlen( s );
+
+ /* 0x followed by 5 or 13 hexadecimal digit pairs is valid */
+ if( s[0] == '0' && ( s[1] == 'x' || s[1] == 'X' )) {
+ if( l == 12 || l == 28 ) {
+ for( i = 2; i < l; i++ ) {
+ if( !isxdigit( s[i] ))
+ return 0;
+ }
+
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ /* string with 0, 5, or 13 characters is valid */
+ else
+ {
+ return( l == 0 || l == 5 || l == 13 );
+ }
+} // is_valid_key_string
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * hexdigit2int()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Converts a hexadecimal digit character to an integer
+ *
+ * PARAMETERS:
+ *
+ * c - the hexadecimal digit character
+ *
+ * RETURNS:
+ *
+ * the converted integer
+ *
+ ******************************************************************************/
+int hexdigit2int( char c )
+{
+ if( c >= '0' && c <= '9' )
+ return c - '0';
+
+ if( c >= 'A' && c <= 'F' )
+ return c - 'A' + 10;
+
+ if( c >= 'a' && c <= 'f' )
+ return c - 'a' + 10;
+
+ return 0;
+} // hexdigit2int
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * key_string2key()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Converts a key_string to a key, Assumes the key_string is validated with
+ * is_valid_key_string().
+ *
+ * PARAMETERS:
+ *
+ * ks - the valid key string
+ * key - a pointer to a KEY_STRUCT where the converted key information will
+ * be stored.
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void key_string2key( char *ks, KEY_STRCT *key )
+{
+ int l,i,n;
+ char *p;
+ /*------------------------------------------------------------------------*/
+
+
+ l = strlen( ks );
+
+ /* 0x followed by hexadecimal digit pairs */
+ if( ks[0] == '0' && ( ks[1] == 'x' || ks[1] == 'X' )) {
+ n = 0;
+ p = (char *)key->key;
+
+ for( i = 2; i < l; i+=2 ) {
+ *p++ = ( hexdigit2int( ks[i] ) << 4 ) + hexdigit2int (ks[i+1] );
+ n++;
+ }
+
+ /* Note that endian translation of the length field is not needed here
+ because it's performed in wl_put_ltv() */
+ key->len = n;
+ }
+ /* character string */
+ else
+ {
+ strcpy( (char *)key->key, ks );
+ key->len = l;
+ }
+
+ return;
+} // key_string2key
+/*============================================================================*/
+
+
+
+
+#if DBG
+/*******************************************************************************
+ * DbgHwAddr()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Convert a hardware ethernet address to a character string
+ *
+ * PARAMETERS:
+ *
+ * hwAddr - an ethernet address
+ *
+ * RETURNS:
+ *
+ * a pointer to a string representing the ethernet address
+ *
+ ******************************************************************************/
+const char *DbgHwAddr(unsigned char *hwAddr)
+{
+ static char buffer[18];
+ /*------------------------------------------------------------------------*/
+
+
+ sprintf( buffer, "%02X:%02X:%02X:%02X:%02X:%02X",
+ hwAddr[0], hwAddr[1], hwAddr[2], hwAddr[3], hwAddr[4], hwAddr[5] );
+
+ return buffer;
+} // DbgHwAddr
+/*============================================================================*/
+
+#endif /* DBG */
+
+
+
+
+/*******************************************************************************
+ * wl_has_wep()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Checks to see if the device supports WEP
+ *
+ * PARAMETERS:
+ *
+ * ifbp - the IFB pointer of the device in question
+ *
+ * RETURNS:
+ *
+ * 1 if WEP is known enabled, else 0
+ *
+ ******************************************************************************/
+int wl_has_wep (IFBP ifbp)
+{
+ CFG_PRIVACY_OPT_IMPLEMENTED_STRCT ltv;
+ int rc, privacy;
+ /*------------------------------------------------------------------------*/
+
+
+ /* This function allows us to distiguish bronze cards from other types, to
+ know if WEP exists. Does not distinguish (because there's no way to)
+ between silver and gold cards. */
+ ltv.len = 2;
+ ltv.typ = CFG_PRIVACY_OPT_IMPLEMENTED;
+
+ rc = hcf_get_info( ifbp, (LTVP) &ltv );
+
+ privacy = CNV_LITTLE_TO_INT( ltv.privacy_opt_implemented );
+
+ //return rc ? 0 : privacy;
+ return 1;
+} // wl_has_wep
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_hcf_error()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Report the type of HCF error message
+ *
+ * PARAMETERS:
+ *
+ * none
+ *
+ * RETURNS:
+ *
+ * A descriptive string indicating the error, quiet otherwise.
+ *
+ ******************************************************************************/
+void wl_hcf_error( struct net_device *dev, int hcfStatus )
+{
+ char buffer[64], *pMsg;
+ /*------------------------------------------------------------------------*/
+
+
+ if( hcfStatus != HCF_SUCCESS ) {
+ switch( hcfStatus ) {
+
+ case HCF_ERR_TIME_OUT:
+
+ pMsg = "Expected adapter event did not occur in expected time";
+ break;
+
+
+ case HCF_ERR_NO_NIC:
+
+ pMsg = "Card not found (ejected unexpectedly)";
+ break;
+
+
+ case HCF_ERR_LEN:
+
+ pMsg = "Command buffer size insufficient";
+ break;
+
+
+ case HCF_ERR_INCOMP_PRI:
+
+ pMsg = "Primary functions are not compatible";
+ break;
+
+
+ case HCF_ERR_INCOMP_FW:
+
+ pMsg = "Primary functions are compatible, "
+ "station/ap functions are not";
+ break;
+
+
+ case HCF_ERR_BUSY:
+
+ pMsg = "Inquire cmd while another Inquire in progress";
+ break;
+
+
+ //case HCF_ERR_SEQ_BUG:
+
+ // pMsg = "Unexpected command completed";
+ // break;
+
+
+ case HCF_ERR_DEFUNCT_AUX:
+
+ pMsg = "Timeout on ack for enable/disable of AUX registers";
+ break;
+
+
+ case HCF_ERR_DEFUNCT_TIMER:
+ pMsg = "Timeout on timer calibration during initialization process";
+ break;
+
+
+ case HCF_ERR_DEFUNCT_TIME_OUT:
+ pMsg = "Timeout on Busy bit drop during BAP setup";
+ break;
+
+
+ case HCF_ERR_DEFUNCT_CMD_SEQ:
+ pMsg = "Hermes and HCF are out of sync";
+ break;
+
+
+ default:
+
+ sprintf( buffer, "Error code %d", hcfStatus );
+ pMsg = buffer;
+ break;
+ }
+
+ printk( KERN_INFO "%s: Wireless, HCF failure: \"%s\"\n",
+ dev->name, pMsg );
+ }
+} // wl_hcf_error
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_endian_translate_event()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Determines what type of data is in the mailbox and performs the proper
+ * endian translation.
+ *
+ * PARAMETERS:
+ *
+ * pLtv - an LTV pointer
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_endian_translate_event( ltv_t *pLtv )
+{
+ DBG_FUNC( "wl_endian_translate_event" );
+ DBG_ENTER( DbgInfo );
+
+
+ switch( pLtv->typ ) {
+ case CFG_TALLIES:
+ break;
+
+
+ case CFG_SCAN:
+ {
+ int numAPs;
+ SCAN_RS_STRCT *pAps = (SCAN_RS_STRCT*)&pLtv->u.u8[0];
+
+ numAPs = (hcf_16)(( (size_t)( pLtv->len - 1 ) * 2 ) /
+ (sizeof( SCAN_RS_STRCT )));
+
+ while( numAPs >= 1 ) {
+ numAPs--;
+
+ pAps[numAPs].channel_id =
+ CNV_LITTLE_TO_INT( pAps[numAPs].channel_id );
+
+ pAps[numAPs].noise_level =
+ CNV_LITTLE_TO_INT( pAps[numAPs].noise_level );
+
+ pAps[numAPs].signal_level =
+ CNV_LITTLE_TO_INT( pAps[numAPs].signal_level );
+
+ pAps[numAPs].beacon_interval_time =
+ CNV_LITTLE_TO_INT( pAps[numAPs].beacon_interval_time );
+
+ pAps[numAPs].capability =
+ CNV_LITTLE_TO_INT( pAps[numAPs].capability );
+
+ pAps[numAPs].ssid_len =
+ CNV_LITTLE_TO_INT( pAps[numAPs].ssid_len );
+
+ pAps[numAPs].ssid_val[pAps[numAPs].ssid_len] = 0;
+
+ }
+ }
+ break;
+
+
+ case CFG_ACS_SCAN:
+ {
+ PROBE_RESP *probe_resp = (PROBE_RESP *)pLtv;
+
+ probe_resp->frameControl = CNV_LITTLE_TO_INT( probe_resp->frameControl );
+ probe_resp->durID = CNV_LITTLE_TO_INT( probe_resp->durID );
+ probe_resp->sequence = CNV_LITTLE_TO_INT( probe_resp->sequence );
+ probe_resp->dataLength = CNV_LITTLE_TO_INT( probe_resp->dataLength );
+
+#ifndef WARP
+ probe_resp->lenType = CNV_LITTLE_TO_INT( probe_resp->lenType );
+#endif // WARP
+
+ probe_resp->beaconInterval = CNV_LITTLE_TO_INT( probe_resp->beaconInterval );
+ probe_resp->capability = CNV_LITTLE_TO_INT( probe_resp->capability );
+ probe_resp->flags = CNV_LITTLE_TO_INT( probe_resp->flags );
+ }
+ break;
+
+
+ case CFG_LINK_STAT:
+#define ls ((LINK_STATUS_STRCT *)pLtv)
+ ls->linkStatus = CNV_LITTLE_TO_INT( ls->linkStatus );
+ break;
+#undef ls
+
+ case CFG_ASSOC_STAT:
+ {
+ ASSOC_STATUS_STRCT *pAs = (ASSOC_STATUS_STRCT *)pLtv;
+
+ pAs->assocStatus = CNV_LITTLE_TO_INT( pAs->assocStatus );
+ }
+ break;
+
+
+ case CFG_SECURITY_STAT:
+ {
+ SECURITY_STATUS_STRCT *pSs = (SECURITY_STATUS_STRCT *)pLtv;
+
+ pSs->securityStatus = CNV_LITTLE_TO_INT( pSs->securityStatus );
+ pSs->reason = CNV_LITTLE_TO_INT( pSs->reason );
+ }
+ break;
+
+
+ case CFG_WMP:
+ break;
+
+
+ case CFG_NULL:
+ break;
+
+
+ default:
+ break;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_endian_translate_event
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * msf_assert()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Print statement used to display asserts from within the HCF. Only called
+ * when asserts in the HCF are turned on. See hcfcfg.h for more information.
+ *
+ * PARAMETERS:
+ *
+ * file_namep - the filename in which the assert occurred.
+ * line_number - the line number on which the assert occurred.
+ * trace - a comment associated with the assert.
+ * qual - return code or other value related to the assert
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void msf_assert( unsigned int line_number, hcf_16 trace, hcf_32 qual )
+{
+ DBG_PRINT( "HCF ASSERT: Line %d, VAL: 0x%.8x\n", line_number, /*;?*/(u32)qual );
+} // msf_assert
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_parse_ds_ie()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function parses the Direct Sequence Parameter Set IE, used to
+ * determine channel/frequency information.
+ *
+ * PARAMETERS:
+ *
+ * probe_rsp - a pointer to a PROBE_RESP structure containing the probe
+ * response.
+ *
+ * RETURNS:
+ *
+ * The channel on which the BSS represented by this probe response is
+ * transmitting.
+ *
+ ******************************************************************************/
+hcf_8 wl_parse_ds_ie( PROBE_RESP *probe_rsp )
+{
+ int i;
+ int ie_length = 0;
+ hcf_8 *buf;
+ hcf_8 buf_size;
+ /*------------------------------------------------------------------------*/
+
+
+ if( probe_rsp == NULL ) {
+ return 0;
+ }
+
+ buf = probe_rsp->rawData;
+ buf_size = sizeof( probe_rsp->rawData );
+
+
+ for( i = 0; i < buf_size; i++ ) {
+ if( buf[i] == DS_INFO_ELEM ) {
+ /* Increment by 1 to get the length, and test it; in a DS element,
+ length should always be 1 */
+ i++;
+ ie_length = buf[i];
+
+ if( buf[i] == 1 ) {
+ /* Get the channel information */
+ i++;
+ return buf[i];
+ }
+ }
+ }
+
+ /* If we get here, we didn't find a DS-IE, which is strange */
+ return 0;
+} // wl_parse_ds_ie
+
+
+/*******************************************************************************
+ * wl_parse_wpa_ie()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function parses the Probe Response for a valid WPA-IE.
+ *
+ * PARAMETERS:
+ *
+ * probe_rsp - a pointer to a PROBE_RESP structure containing the probe
+ * response
+ * length - a pointer to an hcf_16 in which the size of the WPA-IE will
+ * be stored (if found).
+ *
+ * RETURNS:
+ *
+ * A pointer to the location in the probe response buffer where a valid
+ * WPA-IE lives. The length of this IE is written back to the 'length'
+ * argument passed to the function.
+ *
+ ******************************************************************************/
+hcf_8 * wl_parse_wpa_ie( PROBE_RESP *probe_rsp, hcf_16 *length )
+{
+ int i;
+ int ie_length = 0;
+ hcf_8 *buf;
+ hcf_8 buf_size;
+ hcf_8 wpa_oui[] = WPA_OUI_TYPE;
+ /*------------------------------------------------------------------------*/
+
+
+ if( probe_rsp == NULL || length == NULL ) {
+ return NULL;
+ }
+
+ buf = probe_rsp->rawData;
+ buf_size = sizeof( probe_rsp->rawData );
+ *length = 0;
+
+
+ for( i = 0; i < buf_size; i++ ) {
+ if( buf[i] == GENERIC_INFO_ELEM ) {
+ /* Increment by one to get the IE length */
+ i++;
+ ie_length = probe_rsp->rawData[i];
+
+ /* Increment by one to point to the IE payload */
+ i++;
+
+ /* Does the IE contain a WPA OUI? If not, it's a proprietary IE */
+ if( memcmp( &buf[i], &wpa_oui, WPA_SELECTOR_LEN ) == 0 ) {
+ /* Pass back length and return a pointer to the WPA-IE */
+ /* NOTE: Length contained in the WPA-IE is only the length of
+ the payload. The entire WPA-IE, including the IE identifier
+ and the length, is 2 bytes larger */
+ *length = ie_length + 2;
+
+ /* Back up the pointer 2 bytes to include the IE identifier and
+ the length in the buffer returned */
+ i -= 2;
+ return &buf[i];
+ }
+
+ /* Increment past this non-WPA IE and continue looking */
+ i += ( ie_length - 1 );
+ }
+ }
+
+ /* If we're here, we didn't find a WPA-IE in the buffer */
+ return NULL;
+} // wl_parse_wpa_ie
+
+
+/*******************************************************************************
+ * wl_print_wpa_ie()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Function used to take a WPA Information Element (WPA-IE) buffer and
+ * display it in a readable format.
+ *
+ * PARAMETERS:
+ *
+ * buffer - the byte buffer containing the WPA-IE
+ * length - the length of the above buffer
+ *
+ * RETURNS:
+ *
+ * A pointer to the formatted WPA-IE string. Note that the format used is
+ * byte-by-byte printing as %02x hex values with no spaces. This is
+ * required for proper operation with some WPA supplicants.
+ *
+ ******************************************************************************/
+hcf_8 * wl_print_wpa_ie( hcf_8 *buffer, int length )
+{
+ int count;
+ int rows;
+ int remainder;
+ int rowsize = 4;
+ hcf_8 row_buf[64];
+ static hcf_8 output[512];
+ /*------------------------------------------------------------------------*/
+
+
+ memset( output, 0, sizeof( output ));
+ memset( row_buf, 0, sizeof( row_buf ));
+
+
+ /* Determine how many rows will be needed, and the remainder */
+ rows = length / rowsize;
+ remainder = length % rowsize;
+
+
+ /* Format the rows */
+ for( count = 0; count < rows; count++ ) {
+ sprintf( row_buf, "%02x%02x%02x%02x",
+ buffer[count*rowsize], buffer[count*rowsize+1],
+ buffer[count*rowsize+2], buffer[count*rowsize+3]);
+ strcat( output, row_buf );
+ }
+
+ memset( row_buf, 0, sizeof( row_buf ));
+
+
+ /* Format the remainder */
+ for( count = 0; count < remainder; count++ ) {
+ sprintf( row_buf, "%02x", buffer[(rows*rowsize)+count]);
+ strcat( output, row_buf );
+ }
+
+ return output;
+} // wl_print_wpa_ie
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_is_a_valid_chan()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Checks if a given channel is valid
+ *
+ * PARAMETERS:
+ *
+ * channel - the channel
+ *
+ * RETURNS:
+ *
+ * 1 if TRUE
+ * 0 if FALSE
+ *
+ ******************************************************************************/
+int wl_is_a_valid_chan( int channel )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+
+ /* Strip out the high bit set by the FW for 802.11a channels */
+ if( channel & 0x100 ) {
+ channel = channel & 0x0FF;
+ }
+
+ /* Iterate through the matrix and retrieve the frequency */
+ for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
+ if( chan_freq_list[i][0] == channel ) {
+ return 1;
+ }
+ }
+
+ return 0;
+} // wl_is_a_valid_chan
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_get_chan_from_freq()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Checks if a given frequency is valid
+ *
+ * PARAMETERS:
+ *
+ * freq - the frequency
+ *
+ * RETURNS:
+ *
+ * 1 if TRUE
+ * 0 if FALSE
+ *
+ ******************************************************************************/
+int wl_is_a_valid_freq( long frequency )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+
+ /* Iterate through the matrix and retrieve the channel */
+ for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
+ if( chan_freq_list[i][1] == frequency ) {
+ return 1;
+ }
+ }
+
+ return 0;
+} // wl_is_a_valid_freq
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_get_freq_from_chan()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Function used to look up the frequency for a given channel on which the
+ * adapter is Tx/Rx.
+ *
+ * PARAMETERS:
+ *
+ * channel - the channel
+ *
+ * RETURNS:
+ *
+ * The corresponding frequency
+ *
+ ******************************************************************************/
+long wl_get_freq_from_chan( int channel )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+
+ /* Strip out the high bit set by the FW for 802.11a channels */
+ if( channel & 0x100 ) {
+ channel = channel & 0x0FF;
+ }
+
+ /* Iterate through the matrix and retrieve the frequency */
+ for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
+ if( chan_freq_list[i][0] == channel ) {
+ return chan_freq_list[i][1];
+ }
+ }
+
+ return 0;
+} // wl_get_freq_from_chan
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_get_chan_from_freq()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Function used to look up the channel for a given frequency on which the
+ * adapter is Tx/Rx.
+ *
+ * PARAMETERS:
+ *
+ * frequency - the frequency
+ *
+ * RETURNS:
+ *
+ * The corresponding channel
+ *
+ ******************************************************************************/
+int wl_get_chan_from_freq( long frequency )
+{
+ int i;
+ /*------------------------------------------------------------------------*/
+
+
+ /* Iterate through the matrix and retrieve the channel */
+ for( i = 0; i < MAX_CHAN_FREQ_MAP_ENTRIES; i++ ) {
+ if( chan_freq_list[i][1] == frequency ) {
+ return chan_freq_list[i][0];
+ }
+ }
+
+ return 0;
+} // wl_get_chan_from_freq
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_process_link_status()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Process the link status message signaled by the device.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_process_link_status( struct wl_private *lp )
+{
+ hcf_16 link_stat;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_process_link_status" );
+ DBG_ENTER( DbgInfo );
+
+ if( lp != NULL ) {
+ //link_stat = lp->hcfCtx.IFB_DSLinkStat & CFG_LINK_STAT_FW;
+ link_stat = lp->hcfCtx.IFB_LinkStat & CFG_LINK_STAT_FW;
+ switch( link_stat ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Link Status : Connected\n" );
+ wl_wext_event_ap( lp->dev );
+ break;
+ case 2:
+ DBG_TRACE( DbgInfo, "Link Status : Disconnected\n" );
+ break;
+ case 3:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point Change\n" );
+ break;
+ case 4:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point Out of Range\n" );
+ break;
+ case 5:
+ DBG_TRACE( DbgInfo, "Link Status : Access Point In Range\n" );
+ break;
+ default:
+ DBG_TRACE( DbgInfo, "Link Status : UNKNOWN (0x%04x)\n", link_stat );
+ break;
+ }
+ }
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_link_status
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_process_probe_response()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Process the probe responses retunred by the device as a result of an
+ * active scan.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_process_probe_response( struct wl_private *lp )
+{
+ PROBE_RESP *probe_rsp;
+ hcf_8 *wpa_ie = NULL;
+ hcf_16 wpa_ie_len = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_process_probe_response" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( lp != NULL ) {
+ probe_rsp = (PROBE_RESP *)&lp->ProbeResp;
+
+ wl_endian_translate_event( (ltv_t *)probe_rsp );
+
+ DBG_TRACE( DbgInfo, "(%s) =========================\n", lp->dev->name );
+ DBG_TRACE( DbgInfo, "(%s) length : 0x%04x.\n", lp->dev->name,
+ probe_rsp->length );
+
+ if( probe_rsp->length > 1 ) {
+ DBG_TRACE( DbgInfo, "(%s) infoType : 0x%04x.\n", lp->dev->name,
+ probe_rsp->infoType );
+
+ DBG_TRACE( DbgInfo, "(%s) signal : 0x%02x.\n", lp->dev->name,
+ probe_rsp->signal );
+
+ DBG_TRACE( DbgInfo, "(%s) silence : 0x%02x.\n", lp->dev->name,
+ probe_rsp->silence );
+
+ DBG_TRACE( DbgInfo, "(%s) rxFlow : 0x%02x.\n", lp->dev->name,
+ probe_rsp->rxFlow );
+
+ DBG_TRACE( DbgInfo, "(%s) rate : 0x%02x.\n", lp->dev->name,
+ probe_rsp->rate );
+
+ DBG_TRACE( DbgInfo, "(%s) frame cntl : 0x%04x.\n", lp->dev->name,
+ probe_rsp->frameControl );
+
+ DBG_TRACE( DbgInfo, "(%s) durID : 0x%04x.\n", lp->dev->name,
+ probe_rsp->durID );
+
+ DBG_TRACE( DbgInfo, "(%s) address1 : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->address1 ));
+
+ DBG_TRACE( DbgInfo, "(%s) address2 : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->address2 ));
+
+ DBG_TRACE( DbgInfo, "(%s) BSSID : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->BSSID ));
+
+ DBG_TRACE( DbgInfo, "(%s) sequence : 0x%04x.\n", lp->dev->name,
+ probe_rsp->sequence );
+
+ DBG_TRACE( DbgInfo, "(%s) address4 : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->address4 ));
+
+ DBG_TRACE( DbgInfo, "(%s) datalength : 0x%04x.\n", lp->dev->name,
+ probe_rsp->dataLength );
+
+ DBG_TRACE( DbgInfo, "(%s) DA : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->DA ));
+
+ DBG_TRACE( DbgInfo, "(%s) SA : %s\n", lp->dev->name,
+ DbgHwAddr( probe_rsp->SA ));
+
+#ifdef WARP
+
+ DBG_TRACE( DbgInfo, "(%s) channel : %d\n", lp->dev->name,
+ probe_rsp->channel );
+
+ DBG_TRACE( DbgInfo, "(%s) band : %d\n", lp->dev->name,
+ probe_rsp->band );
+#else
+ DBG_TRACE( DbgInfo, "(%s) lenType : 0x%04x.\n", lp->dev->name,
+ probe_rsp->lenType );
+#endif // WARP
+
+ DBG_TRACE( DbgInfo, "(%s) timeStamp : %d.%d.%d.%d.%d.%d.%d.%d\n",
+ lp->dev->name,
+ probe_rsp->timeStamp[0],
+ probe_rsp->timeStamp[1],
+ probe_rsp->timeStamp[2],
+ probe_rsp->timeStamp[3],
+ probe_rsp->timeStamp[4],
+ probe_rsp->timeStamp[5],
+ probe_rsp->timeStamp[6],
+ probe_rsp->timeStamp[7]);
+
+ DBG_TRACE( DbgInfo, "(%s) beaconInt : 0x%04x.\n", lp->dev->name,
+ probe_rsp->beaconInterval );
+
+ DBG_TRACE( DbgInfo, "(%s) capability : 0x%04x.\n", lp->dev->name,
+ probe_rsp->capability );
+
+ DBG_TRACE( DbgInfo, "(%s) SSID len : 0x%04x.\n", lp->dev->name,
+ probe_rsp->rawData[1] );
+
+
+ if( probe_rsp->rawData[1] > 0 ) {
+ char ssid[HCF_MAX_NAME_LEN];
+
+ memset( ssid, 0, sizeof( ssid ));
+ strncpy( ssid, &probe_rsp->rawData[2],
+ probe_rsp->rawData[1] );
+
+ DBG_TRACE( DbgInfo, "(%s) SSID : %s\n",
+ lp->dev->name, ssid );
+ }
+
+
+ /* Parse out the WPA-IE, if one exists */
+ wpa_ie = wl_parse_wpa_ie( probe_rsp, &wpa_ie_len );
+ if( wpa_ie != NULL ) {
+ DBG_TRACE( DbgInfo, "(%s) WPA-IE : %s\n",
+ lp->dev->name, wl_print_wpa_ie( wpa_ie, wpa_ie_len ));
+ }
+
+ DBG_TRACE( DbgInfo, "(%s) flags : 0x%04x.\n",
+ lp->dev->name, probe_rsp->flags );
+ }
+
+ DBG_TRACE( DbgInfo, "\n" );
+
+
+ /* If probe response length is 1, then the scan is complete */
+ if( probe_rsp->length == 1 ) {
+ DBG_TRACE( DbgInfo, "SCAN COMPLETE\n" );
+ lp->probe_results.num_aps = lp->probe_num_aps;
+ lp->probe_results.scan_complete = TRUE;
+
+ /* Reset the counter for the next scan request */
+ lp->probe_num_aps = 0;
+
+ /* Send a wireless extensions event that the scan completed */
+ wl_wext_event_scan_complete( lp->dev );
+ } else {
+ /* Only copy to the table if the entry is unique; APs sometimes
+ respond more than once to a probe */
+ if( lp->probe_num_aps == 0 ) {
+ /* Copy the info to the ScanResult structure in the private
+ adapter struct */
+ memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
+ probe_rsp, sizeof( PROBE_RESP ));
+
+ /* Increment the number of APs detected */
+ lp->probe_num_aps++;
+ } else {
+ int count;
+ int unique = 1;
+
+ for( count = 0; count < lp->probe_num_aps; count++ ) {
+ if( memcmp( &( probe_rsp->BSSID ),
+ lp->probe_results.ProbeTable[count].BSSID,
+ ETH_ALEN ) == 0 ) {
+ unique = 0;
+ }
+ }
+
+ if( unique ) {
+ /* Copy the info to the ScanResult structure in the
+ private adapter struct. Only copy if there's room in the
+ table */
+ if( lp->probe_num_aps < MAX_NAPS )
+ {
+ memcpy( &( lp->probe_results.ProbeTable[lp->probe_num_aps] ),
+ probe_rsp, sizeof( PROBE_RESP ));
+ }
+ else
+ {
+ DBG_WARNING( DbgInfo, "Num of scan results exceeds storage, truncating\n" );
+ }
+
+ /* Increment the number of APs detected. Note I do this
+ here even when I don't copy the probe response to the
+ buffer in order to detect the overflow condition */
+ lp->probe_num_aps++;
+ }
+ }
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_probe_response
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_process_updated_record()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Process the updated information record message signaled by the device.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_process_updated_record( struct wl_private *lp )
+{
+ DBG_FUNC( "wl_process_updated_record" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( lp != NULL ) {
+ lp->updatedRecord.u.u16[0] = CNV_LITTLE_TO_INT( lp->updatedRecord.u.u16[0] );
+
+ switch( lp->updatedRecord.u.u16[0] ) {
+ case CFG_CUR_COUNTRY_INFO:
+ DBG_TRACE( DbgInfo, "Updated Record: CFG_CUR_COUNTRY_INFO\n" );
+ wl_connect( lp );
+ break;
+
+ case CFG_PORT_STAT:
+ DBG_TRACE( DbgInfo, "Updated Record: WAIT_FOR_CONNECT (0xFD40)\n" );
+ //wl_connect( lp );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "UNKNOWN: 0x%04x\n",
+ lp->updatedRecord.u.u16[0] );
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_updated_record
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_process_assoc_status()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Process the association status event signaled by the device.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_process_assoc_status( struct wl_private *lp )
+{
+ ASSOC_STATUS_STRCT *assoc_stat;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_process_assoc_status" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( lp != NULL ) {
+ assoc_stat = (ASSOC_STATUS_STRCT *)&lp->assoc_stat;
+
+ wl_endian_translate_event( (ltv_t *)assoc_stat );
+
+ switch( assoc_stat->assocStatus ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Association Status : STA Associated\n" );
+ break;
+
+ case 2:
+ DBG_TRACE( DbgInfo, "Association Status : STA Reassociated\n" );
+ break;
+
+ case 3:
+ DBG_TRACE( DbgInfo, "Association Status : STA Disassociated\n" );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "Association Status : UNKNOWN (0x%04x)\n",
+ assoc_stat->assocStatus );
+ break;
+ }
+
+ DBG_TRACE( DbgInfo, "STA Address : %s\n",
+ DbgHwAddr( assoc_stat->staAddr ));
+
+ if(( assoc_stat->assocStatus == 2 ) && ( assoc_stat->len == 8 )) {
+ DBG_TRACE( DbgInfo, "Old AP Address : %s\n",
+ DbgHwAddr( assoc_stat->oldApAddr ));
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_assoc_status
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_process_security_status()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Process the security status message signaled by the device.
+ *
+ * PARAMETERS:
+ *
+ * lp - a pointer to the device's private structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_process_security_status( struct wl_private *lp )
+{
+ SECURITY_STATUS_STRCT *sec_stat;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_process_security_status" );
+ DBG_ENTER( DbgInfo );
+
+
+ if( lp != NULL ) {
+ sec_stat = (SECURITY_STATUS_STRCT *)&lp->sec_stat;
+
+ wl_endian_translate_event( (ltv_t *)sec_stat );
+
+ switch( sec_stat->securityStatus ) {
+ case 1:
+ DBG_TRACE( DbgInfo, "Security Status : Dissassociate [AP]\n" );
+ break;
+
+ case 2:
+ DBG_TRACE( DbgInfo, "Security Status : Deauthenticate [AP]\n" );
+ break;
+
+ case 3:
+ DBG_TRACE( DbgInfo, "Security Status : Authenticate Fail [STA] or [AP]\n" );
+ break;
+
+ case 4:
+ DBG_TRACE( DbgInfo, "Security Status : MIC Fail\n" );
+ break;
+
+ case 5:
+ DBG_TRACE( DbgInfo, "Security Status : Associate Fail\n" );
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "Security Status : UNKNOWN (0x%04x)\n",
+ sec_stat->securityStatus );
+ break;
+ }
+
+ DBG_TRACE( DbgInfo, "STA Address : %s\n",
+ DbgHwAddr( sec_stat->staAddr ));
+ DBG_TRACE( DbgInfo, "Reason : 0x%04x \n", sec_stat->reason );
+
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return;
+} // wl_process_security_status
+/*============================================================================*/
+
+int wl_get_tallies(struct wl_private *lp,
+ CFG_HERMES_TALLIES_STRCT *tallies)
+{
+ int ret = 0;
+ int status;
+ CFG_HERMES_TALLIES_STRCT *pTallies;
+
+ DBG_FUNC( "wl_get_tallies" );
+ DBG_ENTER(DbgInfo);
+
+ /* Get the current tallies from the adapter */
+ lp->ltvRecord.len = 1 + HCF_TOT_TAL_CNT * sizeof(hcf_16);
+ lp->ltvRecord.typ = CFG_TALLIES;
+
+ status = hcf_get_info(&(lp->hcfCtx), (LTVP)&(lp->ltvRecord));
+
+ if( status == HCF_SUCCESS ) {
+ pTallies = (CFG_HERMES_TALLIES_STRCT *)&(lp->ltvRecord.u.u32);
+ memcpy(tallies, pTallies, sizeof(*tallies));
+ DBG_TRACE( DbgInfo, "Get tallies okay, dixe: %d\n", sizeof(*tallies) );
+ } else {
+ DBG_TRACE( DbgInfo, "Get tallies failed\n" );
+ ret = -EFAULT;
+ }
+
+ DBG_LEAVE( DbgInfo );
+
+ return ret;
+}
+
+/*******************************************************************************
+ * wl_atoi()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Believe it or not, we need our own implementation of atoi in the kernel.
+ *
+ * PARAMETERS:
+ *
+ * string - the ASCII string to convert to an integer
+ *
+ * RETURNS:
+ *
+ * unsigned integer
+ *
+ ******************************************************************************/
+unsigned int wl_atoi( char *string )
+{
+unsigned int base = 10; //default to decimal
+unsigned int value = 0;
+unsigned int c;
+int i = strlen( string );
+
+ if ( i > 2 && string[0] == '0' && ( string[1] | ('X'^'x') ) == 'x' ) {
+ base = 16;
+ string +=2;
+ }
+ while ( ( c = *string++ ) != '\0' ) {
+ if ( value > UINT_MAX / base ) { //test for overrun
+ DBG_FUNC( "wl_atoi" ); //don't overload the log file with good messages
+ DBG_ENTER( DbgInfo );
+ DBG_ERROR( DbgInfo, "string \"%s\", lenght exceeds expectations\n", string );
+ printk( "<1>string \"%s\", lenght exceeds expectations\n", string );
+ DBG_LEAVE( DbgInfo );
+ break;
+ }
+ c -= '0';
+ if ( 0 <= c && c <= 9 ) value = base * value + c;
+ else if ( base == 16 ) {
+ c += '0';
+ c |= 'A'^'a';
+ c = c - 'a'+ 10;
+ if ( 10 <= c && c <= 15 ) value = base * value + c;
+ }
+ }
+ return value;
+} // wl_atoi
+
diff --git a/drivers/staging/wlags49_h2/wl_util.h b/drivers/staging/wlags49_h2/wl_util.h
new file mode 100644
index 000000000000..b7593375480f
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_util.h
@@ -0,0 +1,119 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for utility functions used
+ * throughout the driver.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_util.h,v $
+ *
+ ******************************************************************************/
+
+#ifndef __WL_UTIL_H__
+#define __WL_UTIL_H__
+
+/*******************************************************************************
+ * function prototypes
+ ******************************************************************************/
+int dbm( int value );
+
+int is_valid_key_string( char *s );
+
+void key_string2key( char *ks, KEY_STRCT *key );
+
+int hexdigit2int( char c );
+
+void wl_hcf_error( struct net_device *dev, int hcfStatus );
+
+void wl_endian_translate_event( ltv_t *pLtv );
+
+int wl_has_wep( IFBP ifbp );
+
+
+#if DBG
+const char *DbgHwAddr( unsigned char *hwAddr );
+#endif // DBG
+
+hcf_8 wl_parse_ds_ie( PROBE_RESP *probe_rsp );
+hcf_8 * wl_parse_wpa_ie( PROBE_RESP *probe_rsp, hcf_16 *length );
+hcf_8 * wl_print_wpa_ie( hcf_8 *buffer, int length );
+
+int wl_get_tallies(struct wl_private *, CFG_HERMES_TALLIES_STRCT *);
+int wl_is_a_valid_chan( int channel );
+int wl_is_a_valid_freq( long frequency );
+long wl_get_freq_from_chan( int channel );
+int wl_get_chan_from_freq( long frequency );
+
+void wl_process_link_status( struct wl_private *lp );
+void wl_process_probe_response( struct wl_private *lp );
+void wl_process_updated_record( struct wl_private *lp );
+void wl_process_assoc_status( struct wl_private *lp );
+void wl_process_security_status( struct wl_private *lp );
+
+unsigned int wl_atoi( char *string );
+
+#endif // __WL_UTIL_H__
diff --git a/drivers/staging/wlags49_h2/wl_version.h b/drivers/staging/wlags49_h2/wl_version.h
new file mode 100644
index 000000000000..909a5bc97d01
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_version.h
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * This header file contains version information for the code base, as well as
+ * special definitions and macros needed by certain versions of the code.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/04 12:36:10 $
+ * $Revision: 1.7 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_version.h,v $
+ *
+ ******************************************************************************/
+
+#ifndef __WL_VERSION_H__
+#define __WL_VERSION_H__
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+//#include <linux/config.h>
+#include <linux/version.h>
+
+#ifndef CONFIG_MODVERSIONS
+#define __NO_VERSION__
+#endif // CONFIG_MODVERSIONS
+
+/*******************************************************************************
+ * constant definitions
+ ******************************************************************************/
+
+#define VENDOR_NAME "Agere Systems, http://www.agere.com"
+
+#define DRIVER_NAME "wlags49"
+#define DRV_IDENTITY 49
+
+#define DRV_MAJOR_VERSION 7
+#define DRV_MINOR_VERSION 22
+#define DRV_VERSION_STR "7.22"
+
+
+#if defined BUS_PCMCIA
+#define BUS_TYPE "PCMCIA"
+#elif defined BUS_PCI
+#define BUS_TYPE "PCI"
+#else
+err: define bus type;
+#endif // BUS_XXX
+
+#if defined HERMES25
+#define HW_TYPE "HII.5"
+#else
+#define HW_TYPE "HII"
+#endif // HERMES25
+
+#if defined WARP
+#define FW_TYPE "WARP"
+#else
+#define FW_TYPE "BEAGLE"
+#endif // WARP
+
+#if defined HERMES25
+#if defined WARP
+#define DRV_VARIANT 3
+#else
+#define DRV_VARIANT 4
+#endif // WARP
+#else
+#define DRV_VARIANT 2
+#endif // HERMES25
+
+#ifdef BUS_PCMCIA
+#if defined HERMES25
+#define MODULE_NAME DRIVER_NAME "_h25_cs"
+#else
+#define MODULE_NAME DRIVER_NAME "_h2_cs"
+#endif /* HERMES25 */
+#elif defined BUS_PCI
+#if defined HERMES25
+#define MODULE_NAME DRIVER_NAME "_h25"
+#else
+#define MODULE_NAME DRIVER_NAME "_h2"
+#endif /* HERMES25 */
+#endif /* BUS_XXX */
+
+#ifdef DBG
+#define MODULE_DATE __DATE__ " " __TIME__
+#else
+#define MODULE_DATE "07/18/2004 13:30:00"
+#endif // DBG
+
+//#define STR2(m) #m
+//#define STR1(m) STR2(m)
+//#define MODULE_NAME STR1( MOD_NAME )
+
+#define VERSION_INFO MODULE_NAME " v" DRV_VERSION_STR \
+ " for " BUS_TYPE ", " \
+ MODULE_DATE " by " VENDOR_NAME
+
+#define WIRELESS_SUPPORT 15 // The version of wireless extensions we support
+
+//#define DBG_MOD_NAME DRIVER_NAME ":" BUS_TYPE ":" HW_TYPE ":" FW_TYPE
+#define DBG_MOD_NAME MODULE_NAME
+
+
+
+/*******************************************************************************
+ * bus architechture specific defines, includes, etc.
+ ******************************************************************************/
+/*
+ * There doesn't seem to be a difference for PCMCIA and PCI anymore, at least
+ * for PCMCIA the same defines are needed now as previously only used for PCI
+ */
+#if USE_WEXT
+#define HAS_WIRELESS_EXTENSIONS
+#endif // USE_WEXT
+
+#define NEW_MULTICAST
+#define ALLOC_SKB(len) dev_alloc_skb(len+2)
+#define GET_PACKET(dev, skb, count)\
+ skb_reserve((skb), 2); \
+ BLOCK_INPUT(skb_put((skb), (count)), (count)); \
+ (skb)->protocol = eth_type_trans((skb), (dev))
+#define GET_PACKET_DMA(dev, skb, count)\
+ skb_reserve((skb), 2); \
+ BLOCK_INPUT_DMA(skb_put((skb), (count)), (count)); \
+ (skb)->protocol = eth_type_trans((skb), (dev))
+
+
+
+
+#endif // __WL_VERSION_H__
diff --git a/drivers/staging/wlags49_h2/wl_wext.c b/drivers/staging/wlags49_h2/wl_wext.c
new file mode 100644
index 000000000000..82ae027b5905
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_wext.c
@@ -0,0 +1,4138 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/08/03 11:39:39 $
+ * $Revision: 1.6 $
+ * $Source: /usr/local/cvs/wl_lkm/wireless/wl_wext.c,v $
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * include files
+ ******************************************************************************/
+#include <wl_version.h>
+
+#include <linux/if_arp.h>
+#include <linux/ioport.h>
+#include <linux/delay.h>
+#include <asm/uaccess.h>
+
+#include <debug.h>
+#include <hcf.h>
+#include <hcfdef.h>
+
+#include <wl_if.h>
+#include <wl_internal.h>
+#include <wl_util.h>
+#include <wl_main.h>
+#include <wl_wext.h>
+#include <wl_priv.h>
+
+
+
+/* If WIRELESS_EXT is not defined (as a result of HAS_WIRELESS_EXTENSIONS
+ #including linux/wireless.h), then these functions do not need to be included
+ in the build. */
+#ifdef WIRELESS_EXT
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
+#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
+ iwe_stream_add_event(buf, end, iwe, len)
+#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
+ iwe_stream_add_point(buf, end, iwe, msg)
+#else
+#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
+ iwe_stream_add_event(info, buf, end, iwe, len)
+#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
+ iwe_stream_add_point(info, buf, end, iwe, msg)
+#endif
+
+
+
+/*******************************************************************************
+ * global definitions
+ ******************************************************************************/
+#if DBG
+extern dbg_info_t *DbgInfo;
+#endif // DBG
+
+
+
+
+/*******************************************************************************
+ * wireless_commit()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Commit
+ * protocol used.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+static int wireless_commit(struct net_device *dev,
+ struct iw_request_info *info,
+ union iwreq_data *rqu, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wireless_commit" );
+ DBG_ENTER(DbgInfo);
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ wl_apply(lp);
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_commit
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_protocol()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Returns a vendor-defined string that should identify the wireless
+ * protocol used.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+static int wireless_get_protocol(struct net_device *dev, struct iw_request_info *info, char *name, char *extra)
+{
+ DBG_FUNC( "wireless_get_protocol" );
+ DBG_ENTER( DbgInfo );
+
+ /* Originally, the driver was placing the string "Wireless" here. However,
+ the wireless extensions (/linux/wireless.h) indicate this string should
+ describe the wireless protocol. */
+
+ strcpy(name, "IEEE 802.11b");
+
+ DBG_LEAVE(DbgInfo);
+ return 0;
+} // wireless_get_protocol
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_frequency()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the frequency (channel) on which the card should Tx/Rx.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_frequency(struct net_device *dev, struct iw_request_info *info, struct iw_freq *freq, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int channel = 0;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_frequency" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if( !capable( CAP_NET_ADMIN )) {
+ ret = -EPERM;
+ DBG_LEAVE( DbgInfo );
+ return ret;
+ }
+
+
+ /* If frequency specified, look up channel */
+ if( freq->e == 1 ) {
+ int f = freq->m / 100000;
+ channel = wl_get_chan_from_freq( f );
+ }
+
+
+ /* Channel specified */
+ if( freq->e == 0 ) {
+ channel = freq->m;
+ }
+
+
+ /* If the channel is an 802.11a channel, set Bit 8 */
+ if( channel > 14 ) {
+ channel = channel | 0x100;
+ }
+
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ lp->Channel = channel;
+
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+ /* Send an event that channel/freq has been set */
+ wl_wext_event_freq( lp->dev );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_frequency
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_frequency()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the frequency (channel) on which the card is Tx/Rx.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+static int wireless_get_frequency(struct net_device *dev, struct iw_request_info *info, struct iw_freq *freq, char *extra)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = -1;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_frequency" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CUR_CHANNEL;
+
+ ret = hcf_get_info( &(lp->hcfCtx), (LTVP)&( lp->ltvRecord ));
+ if( ret == HCF_SUCCESS ) {
+ hcf_16 channel = CNV_LITTLE_TO_INT( lp->ltvRecord.u.u16[0] );
+
+#ifdef USE_FREQUENCY
+
+ freq->m = wl_get_freq_from_chan( channel ) * 100000;
+ freq->e = 1;
+#else
+
+ freq->m = channel;
+ freq->e = 0;
+
+#endif /* USE_FREQUENCY */
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+ ret = (ret == HCF_SUCCESS ? 0 : -EFAULT);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_frequency
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_range()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to provide misc info and statistics about the
+ * wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_range(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ struct iw_range *range = (struct iw_range *) extra;
+ int ret = 0;
+ int status = -1;
+ int count;
+ __u16 *pTxRate;
+ int retries = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_range" );
+ DBG_ENTER( DbgInfo );
+
+ /* Set range information */
+ data->length = sizeof(struct iw_range);
+ memset(range, 0, sizeof(struct iw_range));
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Set range information */
+ memset( range, 0, sizeof( struct iw_range ));
+
+retry:
+ /* Get the current transmit rate from the adapter */
+ lp->ltvRecord.len = 1 + (sizeof(*pTxRate) / sizeof(hcf_16));
+ lp->ltvRecord.typ = CFG_CUR_TX_RATE;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ if( status != HCF_SUCCESS ) {
+ /* Recovery action: reset and retry up to 10 times */
+ DBG_TRACE( DbgInfo, "Get CFG_CUR_TX_RATE failed: 0x%x\n", status );
+
+ if (retries < 10) {
+ retries++;
+
+ /* Holding the lock too long, make a gap to allow other processes */
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ status = wl_reset( dev );
+ if ( status != HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "reset failed: 0x%x\n", status );
+
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+
+ /* Holding the lock too long, make a gap to allow other processes */
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ goto retry;
+
+ } else {
+ DBG_TRACE( DbgInfo, "Get CFG_CUR_TX_RATE failed: %d retries\n", retries );
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+ }
+
+ /* Holding the lock too long, make a gap to allow other processes */
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ pTxRate = (__u16 *)&( lp->ltvRecord.u.u32 );
+
+ range->throughput = CNV_LITTLE_TO_INT( *pTxRate ) * MEGABIT;
+
+ if (retries > 0) {
+ DBG_TRACE( DbgInfo, "Get CFG_CUR_TX_RATE succes: %d retries\n", retries );
+ }
+
+ // NWID - NOT SUPPORTED
+
+
+ /* Channel/Frequency Info */
+ range->num_channels = RADIO_CHANNELS;
+
+
+ /* Signal Level Thresholds */
+ range->sensitivity = RADIO_SENSITIVITY_LEVELS;
+
+
+ /* Link quality */
+#ifdef USE_DBM
+
+ range->max_qual.qual = (u_char)HCF_MAX_COMM_QUALITY;
+
+ /* If the value returned in /proc/net/wireless is greater than the maximum range,
+ iwconfig assumes that the value is in dBm. Because an unsigned char is used,
+ it requires a bit of contorsion... */
+
+ range->max_qual.level = (u_char)( dbm( HCF_MIN_SIGNAL_LEVEL ) - 1 );
+ range->max_qual.noise = (u_char)( dbm( HCF_MIN_NOISE_LEVEL ) - 1 );
+#else
+
+ range->max_qual.qual = 100;
+ range->max_qual.level = 100;
+ range->max_qual.noise = 100;
+
+#endif /* USE_DBM */
+
+
+ /* Set available rates */
+ range->num_bitrates = 0;
+
+ lp->ltvRecord.len = 6;
+ lp->ltvRecord.typ = CFG_SUPPORTED_DATA_RATES;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ if( status == HCF_SUCCESS ) {
+ for( count = 0; count < MAX_RATES; count++ )
+ if( lp->ltvRecord.u.u8[count+2] != 0 ) {
+ range->bitrate[count] = lp->ltvRecord.u.u8[count+2] * MEGABIT / 2;
+ range->num_bitrates++;
+ }
+ } else {
+ DBG_TRACE( DbgInfo, "CFG_SUPPORTED_DATA_RATES: 0x%x\n", status );
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+
+ /* RTS Threshold info */
+ range->min_rts = MIN_RTS_BYTES;
+ range->max_rts = MAX_RTS_BYTES;
+
+ // Frag Threshold info - NOT SUPPORTED
+
+ // Power Management info - NOT SUPPORTED
+
+ /* Encryption */
+
+#if WIRELESS_EXT > 8
+
+ /* Holding the lock too long, make a gap to allow other processes */
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ /* Is WEP supported? */
+
+ if( wl_has_wep( &( lp->hcfCtx ))) {
+ /* WEP: RC4 40 bits */
+ range->encoding_size[0] = MIN_KEY_SIZE;
+
+ /* RC4 ~128 bits */
+ range->encoding_size[1] = MAX_KEY_SIZE;
+ range->num_encoding_sizes = 2;
+ range->max_encoding_tokens = MAX_KEYS;
+ }
+
+#endif /* WIRELESS_EXT > 8 */
+
+ /* Tx Power Info */
+ range->txpower_capa = IW_TXPOW_MWATT;
+ range->num_txpower = 1;
+ range->txpower[0] = RADIO_TX_POWER_MWATT;
+
+#if WIRELESS_EXT > 10
+
+ /* Wireless Extension Info */
+ range->we_version_compiled = WIRELESS_EXT;
+ range->we_version_source = WIRELESS_SUPPORT;
+
+ // Retry Limits and Lifetime - NOT SUPPORTED
+
+#endif
+
+
+#if WIRELESS_EXT > 11
+
+ /* Holding the lock too long, make a gap to allow other processes */
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ DBG_TRACE( DbgInfo, "calling wl_wireless_stats\n" );
+ wl_wireless_stats( lp->dev );
+ range->avg_qual = lp->wstats.qual;
+ DBG_TRACE( DbgInfo, "wl_wireless_stats done\n" );
+
+#endif
+
+ /* Event capability (kernel + driver) */
+ range->event_capa[0] = (IW_EVENT_CAPA_K_0 |
+ IW_EVENT_CAPA_MASK(SIOCGIWAP) |
+ IW_EVENT_CAPA_MASK(SIOCGIWSCAN));
+ range->event_capa[1] = IW_EVENT_CAPA_K_1;
+ range->event_capa[4] = (IW_EVENT_CAPA_MASK(IWEVREGISTERED) |
+ IW_EVENT_CAPA_MASK(IWEVCUSTOM) |
+ IW_EVENT_CAPA_MASK(IWEVEXPIRED));
+
+ range->enc_capa = IW_ENC_CAPA_WPA | IW_ENC_CAPA_CIPHER_TKIP;
+
+out_unlock:
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+ DBG_LEAVE(DbgInfo);
+ return ret;
+} // wireless_get_range
+/*============================================================================*/
+
+
+/*******************************************************************************
+ * wireless_get_bssid()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the BSSID the wireless device is currently associated with.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_bssid(struct net_device *dev, struct iw_request_info *info, struct sockaddr *ap_addr, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ int status = -1;
+#endif /* (HCF_TYPE) & HCF_TYPE_STA */
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_bssid" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ memset( &ap_addr->sa_data, 0, ETH_ALEN );
+
+ ap_addr->sa_family = ARPHRD_ETHER;
+
+ /* Assume AP mode here, which means the BSSID is our own MAC address. In
+ STA mode, this address will be overwritten with the actual BSSID using
+ the code below. */
+ memcpy(&ap_addr->sa_data, lp->dev->dev_addr, ETH_ALEN);
+
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ //;?should we return an error status in AP mode
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ /* Get Current BSSID */
+ lp->ltvRecord.typ = CFG_CUR_BSSID;
+ lp->ltvRecord.len = 4;
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ /* Copy info into sockaddr struct */
+ memcpy(&ap_addr->sa_data, lp->ltvRecord.u.u8, ETH_ALEN);
+ } else {
+ ret = -EFAULT;
+ }
+ }
+
+#endif // (HCF_TYPE) & HCF_TYPE_STA
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE(DbgInfo);
+ return ret;
+} // wireless_get_bssid
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_ap_list()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the results of a network scan.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ * NOTE: SIOCGIWAPLIST has been deprecated by SIOCSIWSCAN. This function
+ * implements SIOCGIWAPLIST only to provide backwards compatibility. For
+ * all systems using WIRELESS_EXT v14 and higher, use SIOCSIWSCAN!
+ *
+ ******************************************************************************/
+static int wireless_get_ap_list (struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret;
+ int num_aps = -1;
+ int sec_count = 0;
+ hcf_32 count;
+ struct sockaddr *hwa = NULL;
+ struct iw_quality *qual = NULL;
+#ifdef WARP
+ ScanResult *p = &lp->scan_results;
+#else
+ ProbeResult *p = &lp->probe_results;
+#endif // WARP
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wireless_get_ap_list" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Set the completion state to FALSE */
+ lp->scan_results.scan_complete = FALSE;
+ lp->probe_results.scan_complete = FALSE;
+ /* Channels to scan */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_SCAN_CHANNELS_2GHZ;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0x7FFF );
+ ret = hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ DBG_TRACE( DbgInfo, "CFG_SCAN_CHANNELS_2GHZ result: 0x%x\n", ret );
+
+ /* Set the SCAN_SSID to "ANY". Using this RID for scan prevents the need to
+ disassociate from the network we are currently on */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_SCAN_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ ret = hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ DBG_TRACE( DbgInfo, "CFG_SCAN_SSID to 'any' ret: 0x%x\n", ret );
+
+ /* Initiate the scan */
+#ifdef WARP
+ ret = hcf_action( &( lp->hcfCtx ), MDD_ACT_SCAN );
+#else
+ ret = hcf_action( &( lp->hcfCtx ), HCF_ACT_ACS_SCAN );
+#endif // WARP
+
+ wl_act_int_on( lp );
+
+ //;? unlock? what about the access to lp below? is it broken?
+ wl_unlock(lp, &flags);
+
+ if( ret == HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "SUCCESSFULLY INITIATED SCAN...\n" );
+ while( (*p).scan_complete == FALSE && ret == HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "Waiting for scan results...\n" );
+ /* Abort the scan if we've waited for more than MAX_SCAN_TIME_SEC */
+ if( sec_count++ > MAX_SCAN_TIME_SEC ) {
+ ret = -EIO;
+ } else {
+ /* Wait for 1 sec in 10ms intervals, scheduling the kernel to do
+ other things in the meantime, This prevents system lockups by
+ giving some time back to the kernel */
+ for( count = 0; count < 100; count ++ ) {
+ mdelay( 10 );
+ schedule( );
+ }
+ }
+ }
+
+ rmb();
+
+ if ( ret != HCF_SUCCESS ) {
+ DBG_ERROR( DbgInfo, "timeout waiting for scan results\n" );
+ } else {
+ num_aps = (*p)/*lp->probe_results*/.num_aps;
+ if (num_aps > IW_MAX_AP) {
+ num_aps = IW_MAX_AP;
+ }
+ data->length = num_aps;
+ hwa = (struct sockaddr *)extra;
+ qual = (struct iw_quality *) extra +
+ ( sizeof( struct sockaddr ) * num_aps );
+
+ /* This flag is used to tell the user if we provide quality
+ information. Since we provide signal/noise levels but no
+ quality info on a scan, this is set to 0. Setting to 1 and
+ providing a quality of 0 produces weird results. If we ever
+ provide quality (or can calculate it), this can be changed */
+ data->flags = 0;
+
+ for( count = 0; count < num_aps; count++ ) {
+#ifdef WARP
+ memcpy( hwa[count].sa_data,
+ (*p)/*lp->scan_results*/.APTable[count].bssid, ETH_ALEN );
+#else //;?why use BSSID and bssid as names in seemingly very comparable situations
+ DBG_PRINT( "BSSID: %s\n", DbgHwAddr( (*p)/*lp->probe_results*/.ProbeTable[count].BSSID ));
+ memcpy( hwa[count].sa_data,
+ (*p)/*lp->probe_results*/.ProbeTable[count].BSSID, ETH_ALEN );
+#endif // WARP
+ }
+ /* Once the data is copied to the wireless struct, invalidate the
+ scan result to initiate a rescan on the next request */
+ (*p)/*lp->probe_results*/.scan_complete = FALSE;
+ /* Send the wireless event that the scan has completed, just in case
+ it's needed */
+ wl_wext_event_scan_complete( lp->dev );
+ }
+ }
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_ap_list
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_sensitivity()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the sensitivity (distance between APs) of the wireless card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_sensitivity(struct net_device *dev, struct iw_request_info *info, struct iw_param *sens, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int dens = sens->value;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_sensitivity" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if(( dens < 1 ) || ( dens > 3 )) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ lp->DistanceBetweenAPs = dens;
+ wl_apply( lp );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_sensitivity
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_sensitivity()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the sensitivity (distance between APs) of the wireless card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_sensitivity(struct net_device *dev, struct iw_request_info *info, struct iw_param *sens, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_sensitivity" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ /* not worth locking ... */
+ sens->value = lp->DistanceBetweenAPs;
+ sens->fixed = 0; /* auto */
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_sensitivity
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_essid()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the ESSID (network name) that the wireless device should associate
+ * with.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_essid(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *ssid)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+
+ DBG_FUNC( "wireless_set_essid" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if (data->flags != 0 && data->length > HCF_MAX_NAME_LEN + 1) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ memset( lp->NetworkName, 0, sizeof( lp->NetworkName ));
+
+ /* data->flags is zero to ask for "any" */
+ if( data->flags == 0 ) {
+ /* Need this because in STAP build PARM_DEFAULT_SSID is "LinuxAP"
+ * ;?but there ain't no STAP anymore*/
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ strcpy( lp->NetworkName, "ANY" );
+ } else {
+ //strcpy( lp->NetworkName, "ANY" );
+ strcpy( lp->NetworkName, PARM_DEFAULT_SSID );
+ }
+ } else {
+ memcpy( lp->NetworkName, ssid, data->length );
+ }
+
+ DBG_NOTICE( DbgInfo, "set NetworkName: %s\n", ssid );
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+ /* Send an event that ESSID has been set */
+ wl_wext_event_essid( lp->dev );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_essid
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_essid()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the ESSID (network name) that the wireless device is associated
+ * with.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_essid(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *essid)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ wvName_t *pName;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_essid" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Get the desired network name */
+ lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
+
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ //;?should we return an error status in AP mode
+
+ lp->ltvRecord.typ = CFG_DESIRED_SSID;
+
+#endif
+
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ lp->ltvRecord.typ = CFG_CNF_OWN_SSID;
+ }
+
+#endif // HCF_AP
+
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ if( status == HCF_SUCCESS ) {
+ pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
+
+ /* Endian translate the string length */
+ pName->length = CNV_LITTLE_TO_INT( pName->length );
+
+ /* Copy the information into the user buffer */
+ data->length = pName->length;
+
+ /* NOTE: Null terminating is necessary for proper display of the SSID in
+ the wireless tools */
+ data->length = pName->length + 1;
+ if( pName->length < HCF_MAX_NAME_LEN ) {
+ pName->name[pName->length] = '\0';
+ }
+
+ data->flags = 1;
+
+
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ //;?should we return an error status in AP mode
+#ifdef RETURN_CURRENT_NETWORKNAME
+
+ /* if desired is null ("any"), return current or "any" */
+ if( pName->name[0] == '\0' ) {
+ /* Get the current network name */
+ lp->ltvRecord.len = 1 + ( sizeof(*pName ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CUR_SSID;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
+
+ /* Endian translate the string length */
+ pName->length = CNV_LITTLE_TO_INT( pName->length );
+
+ /* Copy the information into the user buffer */
+ data->length = pName->length + 1;
+ if( pName->length < HCF_MAX_NAME_LEN ) {
+ pName->name[pName->length] = '\0';
+ }
+
+ data->flags = 1;
+ } else {
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+ }
+
+#endif // RETURN_CURRENT_NETWORKNAME
+#endif // HCF_STA
+
+ data->length--;
+
+ if (pName->length > IW_ESSID_MAX_SIZE) {
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+
+ memcpy(essid, pName->name, pName->length);
+ } else {
+ ret = -EFAULT;
+ goto out_unlock;
+ }
+
+out_unlock:
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_essid
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_encode()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the encryption keys and status (enable or disable).
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *keybuf)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+
+#if 1 //;? #if WIRELESS_EXT > 8 - used unconditionally in the rest of the code...
+ hcf_8 encryption_state;
+#endif // WIRELESS_EXT > 8
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_encode" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Is encryption supported? */
+ if( !wl_has_wep( &( lp->hcfCtx ))) {
+ DBG_WARNING( DbgInfo, "WEP not supported on this device\n" );
+ ret = -EOPNOTSUPP;
+ goto out_unlock;
+ }
+
+ DBG_NOTICE( DbgInfo, "pointer: %p, length: %d, flags: %#x\n",
+ keybuf, erq->length,
+ erq->flags);
+
+ /* Save state of Encryption switch */
+ encryption_state = lp->EnableEncryption;
+
+ /* Basic checking: do we have a key to set? */
+ if((erq->length) != 0) {
+ int index = ( erq->flags & IW_ENCODE_INDEX ) - 1;
+ int tk = lp->TransmitKeyID - 1; // current key
+
+
+ /* Check the size of the key */
+ switch(erq->length) {
+ case 0:
+ break;
+
+ case MIN_KEY_SIZE:
+ case MAX_KEY_SIZE:
+
+ /* Check the index */
+ if(( index < 0 ) || ( index >= MAX_KEYS )) {
+ index = tk;
+ }
+
+ /* Cleanup */
+ memset( lp->DefaultKeys.key[index].key, 0, MAX_KEY_SIZE );
+
+ /* Copy the key in the driver */
+ memcpy( lp->DefaultKeys.key[index].key, keybuf, erq->length);
+
+ /* Set the length */
+ lp->DefaultKeys.key[index].len = erq->length;
+
+ DBG_NOTICE( DbgInfo, "encoding.length: %d\n", erq->length );
+ DBG_NOTICE( DbgInfo, "set key: %s(%d) [%d]\n", lp->DefaultKeys.key[index].key,
+ lp->DefaultKeys.key[index].len, index );
+
+ /* Enable WEP (if possible) */
+ if(( index == tk ) && ( lp->DefaultKeys.key[tk].len > 0 )) {
+ lp->EnableEncryption = 1;
+ }
+
+ break;
+
+ default:
+ DBG_WARNING( DbgInfo, "Invalid Key length\n" );
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+ } else {
+ int index = ( erq->flags & IW_ENCODE_INDEX ) - 1;
+
+
+ /* Do we want to just set the current transmit key? */
+ if(( index >= 0 ) && ( index < MAX_KEYS )) {
+ DBG_NOTICE( DbgInfo, "index: %d; len: %d\n", index,
+ lp->DefaultKeys.key[index].len );
+
+ if( lp->DefaultKeys.key[index].len > 0 ) {
+ lp->TransmitKeyID = index + 1;
+ lp->EnableEncryption = 1;
+ } else {
+ DBG_WARNING( DbgInfo, "Problem setting the current TxKey\n" );
+ DBG_LEAVE( DbgInfo );
+ ret = -EINVAL;
+ }
+ }
+ }
+
+ /* Read the flags */
+ if( erq->flags & IW_ENCODE_DISABLED ) {
+ lp->EnableEncryption = 0; // disable encryption
+ } else {
+ lp->EnableEncryption = 1;
+ }
+
+ if( erq->flags & IW_ENCODE_RESTRICTED ) {
+ DBG_WARNING( DbgInfo, "IW_ENCODE_RESTRICTED invalid\n" );
+ ret = -EINVAL; // Invalid
+ }
+
+ DBG_TRACE( DbgInfo, "encryption_state : %d\n", encryption_state );
+ DBG_TRACE( DbgInfo, "lp->EnableEncryption : %d\n", lp->EnableEncryption );
+ DBG_TRACE( DbgInfo, "erq->length : %d\n",
+ erq->length);
+ DBG_TRACE( DbgInfo, "erq->flags : 0x%x\n",
+ erq->flags);
+
+ /* Write the changes to the card */
+ if( ret == 0 ) {
+ DBG_NOTICE( DbgInfo, "encrypt: %d, ID: %d\n", lp->EnableEncryption,
+ lp->TransmitKeyID );
+
+ if( lp->EnableEncryption == encryption_state ) {
+ if( erq->length != 0 ) {
+ /* Dynamic WEP key update */
+ wl_set_wep_keys( lp );
+ }
+ } else {
+ /* To switch encryption on/off, soft reset is required */
+ wl_apply( lp );
+ }
+ }
+
+ /* Send an event that Encryption has been set */
+ wl_wext_event_encode( dev );
+
+out_unlock:
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_encode
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_encode()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the encryption keys and status.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_encode(struct net_device *dev, struct iw_request_info *info, struct iw_point *erq, char *key)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int index;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_encode" );
+ DBG_ENTER( DbgInfo );
+ DBG_NOTICE(DbgInfo, "GIWENCODE: encrypt: %d, ID: %d\n", lp->EnableEncryption, lp->TransmitKeyID);
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ /* Only super-user can see WEP key */
+ if( !capable( CAP_NET_ADMIN )) {
+ ret = -EPERM;
+ DBG_LEAVE( DbgInfo );
+ return ret;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Is it supported? */
+ if( !wl_has_wep( &( lp->hcfCtx ))) {
+ ret = -EOPNOTSUPP;
+ goto out_unlock;
+ }
+
+ /* Basic checking */
+ index = (erq->flags & IW_ENCODE_INDEX ) - 1;
+
+
+ /* Set the flags */
+ erq->flags = 0;
+
+ if( lp->EnableEncryption == 0 ) {
+ erq->flags |= IW_ENCODE_DISABLED;
+ }
+
+ /* Which key do we want */
+ if(( index < 0 ) || ( index >= MAX_KEYS )) {
+ index = lp->TransmitKeyID - 1;
+ }
+
+ erq->flags |= index + 1;
+
+ /* Copy the key to the user buffer */
+ erq->length = lp->DefaultKeys.key[index].len;
+
+ memcpy(key, lp->DefaultKeys.key[index].key, erq->length);
+
+out_unlock:
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_encode
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_nickname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the nickname, or station name, of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_nickname(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *nickname)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_nickname" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+#if 0 //;? Needed, was present in original code but not in 7.18 Linux 2.6 kernel version
+ if( !capable(CAP_NET_ADMIN )) {
+ ret = -EPERM;
+ DBG_LEAVE( DbgInfo );
+ return ret;
+ }
+#endif
+
+ /* Validate the new value */
+ if(data->length > HCF_MAX_NAME_LEN) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ memset( lp->StationName, 0, sizeof( lp->StationName ));
+
+ memcpy( lp->StationName, nickname, data->length );
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_nickname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_nickname()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the nickname, or station name, of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_nickname(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *nickname)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ wvName_t *pName;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_nickname" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Get the current station name */
+ lp->ltvRecord.len = 1 + ( sizeof( *pName ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CNF_OWN_NAME;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pName = (wvName_t *)&( lp->ltvRecord.u.u32 );
+
+ /* Endian translate the length */
+ pName->length = CNV_LITTLE_TO_INT( pName->length );
+
+ if ( pName->length > IW_ESSID_MAX_SIZE ) {
+ ret = -EFAULT;
+ } else {
+ /* Copy the information into the user buffer */
+ data->length = pName->length;
+ memcpy(nickname, pName->name, pName->length);
+ }
+ } else {
+ ret = -EFAULT;
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE(DbgInfo);
+ return ret;
+} // wireless_get_nickname
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_porttype()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the port type of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_porttype(struct net_device *dev, struct iw_request_info *info, __u32 *mode, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ hcf_16 portType;
+ hcf_16 createIBSS;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wireless_set_porttype" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Validate the new value */
+ switch( *mode ) {
+ case IW_MODE_ADHOC:
+
+ /* When user requests ad-hoc, set IBSS mode! */
+ portType = 1;
+ createIBSS = 1;
+
+ lp->DownloadFirmware = WVLAN_DRV_MODE_STA; //1;
+
+ break;
+
+
+ case IW_MODE_AUTO:
+ case IW_MODE_INFRA:
+
+ /* Both automatic and infrastructure set port to BSS/STA mode */
+ portType = 1;
+ createIBSS = 0;
+
+ lp->DownloadFirmware = WVLAN_DRV_MODE_STA; //1;
+
+ break;
+
+
+#if 0 //;? (HCF_TYPE) & HCF_TYPE_AP
+
+ case IW_MODE_MASTER:
+
+ /* Set BSS/AP mode */
+ portType = 1;
+
+ lp->CreateIBSS = 0;
+ lp->DownloadFirmware = WVLAN_DRV_MODE_AP; //2;
+
+ break;
+
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+
+
+ default:
+
+ portType = 0;
+ createIBSS = 0;
+ ret = -EINVAL;
+ }
+
+ if( portType != 0 ) {
+ /* Only do something if there is a mode change */
+ if( ( lp->PortType != portType ) || (lp->CreateIBSS != createIBSS)) {
+ lp->PortType = portType;
+ lp->CreateIBSS = createIBSS;
+
+ /* Commit the adapter parameters */
+ wl_go( lp );
+
+ /* Send an event that mode has been set */
+ wl_wext_event_mode( lp->dev );
+ }
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_porttype
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_porttype()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the port type of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_porttype(struct net_device *dev, struct iw_request_info *info, __u32 *mode, char *extra)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ hcf_16 *pPortType;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_porttype" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Get the current port type */
+ lp->ltvRecord.len = 1 + ( sizeof( *pPortType ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_CNF_PORT_TYPE;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pPortType = (hcf_16 *)&( lp->ltvRecord.u.u32 );
+
+ *pPortType = CNV_LITTLE_TO_INT( *pPortType );
+
+ switch( *pPortType ) {
+ case 1:
+
+#if 0
+#if (HCF_TYPE) & HCF_TYPE_AP
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ *mode = IW_MODE_MASTER;
+ } else {
+ *mode = IW_MODE_INFRA;
+ }
+
+#else
+
+ *mode = IW_MODE_INFRA;
+
+#endif /* (HCF_TYPE) & HCF_TYPE_AP */
+#endif
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ *mode = IW_MODE_MASTER;
+ } else {
+ if( lp->CreateIBSS ) {
+ *mode = IW_MODE_ADHOC;
+ } else {
+ *mode = IW_MODE_INFRA;
+ }
+ }
+
+ break;
+
+
+ case 3:
+ *mode = IW_MODE_ADHOC;
+ break;
+
+ default:
+ ret = -EFAULT;
+ break;
+ }
+ } else {
+ ret = -EFAULT;
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_porttype
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_power()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the power management settings of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *wrq, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_power" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ DBG_PRINT( "THIS CORRUPTS PMEnabled ;?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );
+
+#if 0 //;? Needed, was present in original code but not in 7.18 Linux 2.6 kernel version
+ if( !capable( CAP_NET_ADMIN )) {
+ ret = -EPERM;
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+ }
+#endif
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Set the power management state based on the 'disabled' value */
+ if( wrq->disabled ) {
+ lp->PMEnabled = 0;
+ } else {
+ lp->PMEnabled = 1;
+ }
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_power
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_power()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the power management settings of the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wireless_get_power" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ DBG_PRINT( "THIS IS PROBABLY AN OVER-SIMPLIFICATION ;?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ rrq->flags = 0;
+ rrq->value = 0;
+
+ if( lp->PMEnabled ) {
+ rrq->disabled = 0;
+ } else {
+ rrq->disabled = 1;
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_power
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_tx_power()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the transmit power of the wireless device's radio.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_tx_power(struct net_device *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+ DBG_FUNC( "wireless_get_tx_power" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+#ifdef USE_POWER_DBM
+ rrq->value = RADIO_TX_POWER_DBM;
+ rrq->flags = IW_TXPOW_DBM;
+#else
+ rrq->value = RADIO_TX_POWER_MWATT;
+ rrq->flags = IW_TXPOW_MWATT;
+#endif
+ rrq->fixed = 1;
+ rrq->disabled = 0;
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_tx_power
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_set_rts_threshold()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Sets the RTS threshold for the wireless card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_rts_threshold (struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra)
+{
+ int ret = 0;
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int rthr = rts->value;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_rts_threshold" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if(rts->fixed == 0) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+#if WIRELESS_EXT > 8
+ if( rts->disabled ) {
+ rthr = 2347;
+ }
+#endif /* WIRELESS_EXT > 8 */
+
+ if(( rthr < 256 ) || ( rthr > 2347 )) {
+ ret = -EINVAL;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ lp->RTSThreshold = rthr;
+
+ wl_apply( lp );
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_rts_threshold
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_rts_threshold()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gets the RTS threshold for the wireless card.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_rts_threshold (struct net_device *dev, struct iw_request_info *info, struct iw_param *rts, char *extra)
+{
+ int ret = 0;
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wireless_get_rts_threshold" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ rts->value = lp->RTSThreshold;
+
+#if WIRELESS_EXT > 8
+
+ rts->disabled = ( rts->value == 2347 );
+
+#endif /* WIRELESS_EXT > 8 */
+
+ rts->fixed = 1;
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_rts_threshold
+/*============================================================================*/
+
+
+
+
+
+/*******************************************************************************
+ * wireless_set_rate()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Set the default data rate setting used by the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_rate(struct net_device *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+#ifdef WARP
+ int status = -1;
+ int index = 0;
+#endif // WARP
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_set_rate" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+#ifdef WARP
+
+ /* Determine if the card is operating in the 2.4 or 5.0 GHz band; check
+ if Bit 9 is set in the current channel RID */
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_CUR_CHANNEL;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ index = ( CNV_LITTLE_TO_INT( lp->ltvRecord.u.u16[0] ) & 0x100 ) ? 1 : 0;
+
+ DBG_PRINT( "Index: %d\n", index );
+ } else {
+ DBG_ERROR( DbgInfo, "Could not determine radio frequency\n" );
+ DBG_LEAVE( DbgInfo );
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+
+ if( rrq->value > 0 &&
+ rrq->value <= 1 * MEGABIT ) {
+ lp->TxRateControl[index] = 0x0001;
+ }
+ else if( rrq->value > 1 * MEGABIT &&
+ rrq->value <= 2 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0002;
+ } else {
+ lp->TxRateControl[index] = 0x0003;
+ }
+ }
+ else if( rrq->value > 2 * MEGABIT &&
+ rrq->value <= 5 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0004;
+ } else {
+ lp->TxRateControl[index] = 0x0007;
+ }
+ }
+ else if( rrq->value > 5 * MEGABIT &&
+ rrq->value <= 6 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0010;
+ } else {
+ lp->TxRateControl[index] = 0x0017;
+ }
+ }
+ else if( rrq->value > 6 * MEGABIT &&
+ rrq->value <= 9 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0020;
+ } else {
+ lp->TxRateControl[index] = 0x0037;
+ }
+ }
+ else if( rrq->value > 9 * MEGABIT &&
+ rrq->value <= 11 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0008;
+ } else {
+ lp->TxRateControl[index] = 0x003F;
+ }
+ }
+ else if( rrq->value > 11 * MEGABIT &&
+ rrq->value <= 12 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0040;
+ } else {
+ lp->TxRateControl[index] = 0x007F;
+ }
+ }
+ else if( rrq->value > 12 * MEGABIT &&
+ rrq->value <= 18 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0080;
+ } else {
+ lp->TxRateControl[index] = 0x00FF;
+ }
+ }
+ else if( rrq->value > 18 * MEGABIT &&
+ rrq->value <= 24 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0100;
+ } else {
+ lp->TxRateControl[index] = 0x01FF;
+ }
+ }
+ else if( rrq->value > 24 * MEGABIT &&
+ rrq->value <= 36 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0200;
+ } else {
+ lp->TxRateControl[index] = 0x03FF;
+ }
+ }
+ else if( rrq->value > 36 * MEGABIT &&
+ rrq->value <= 48 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0400;
+ } else {
+ lp->TxRateControl[index] = 0x07FF;
+ }
+ }
+ else if( rrq->value > 48 * MEGABIT &&
+ rrq->value <= 54 * MEGABIT ) {
+ if( rrq->fixed == 1 ) {
+ lp->TxRateControl[index] = 0x0800;
+ } else {
+ lp->TxRateControl[index] = 0x0FFF;
+ }
+ }
+ else if( rrq->fixed == 0 ) {
+ /* In this case, the user has not specified a bitrate, only the "auto"
+ moniker. So, set to all supported rates */
+ lp->TxRateControl[index] = PARM_MAX_TX_RATE;
+ } else {
+ rrq->value = 0;
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+
+
+#else
+
+ if( rrq->value > 0 &&
+ rrq->value <= 1 * MEGABIT ) {
+ lp->TxRateControl[0] = 1;
+ }
+ else if( rrq->value > 1 * MEGABIT &&
+ rrq->value <= 2 * MEGABIT ) {
+ if( rrq->fixed ) {
+ lp->TxRateControl[0] = 2;
+ } else {
+ lp->TxRateControl[0] = 6;
+ }
+ }
+ else if( rrq->value > 2 * MEGABIT &&
+ rrq->value <= 5 * MEGABIT ) {
+ if( rrq->fixed ) {
+ lp->TxRateControl[0] = 4;
+ } else {
+ lp->TxRateControl[0] = 7;
+ }
+ }
+ else if( rrq->value > 5 * MEGABIT &&
+ rrq->value <= 11 * MEGABIT ) {
+ if( rrq->fixed) {
+ lp->TxRateControl[0] = 5;
+ } else {
+ lp->TxRateControl[0] = 3;
+ }
+ }
+ else if( rrq->fixed == 0 ) {
+ /* In this case, the user has not specified a bitrate, only the "auto"
+ moniker. So, set the rate to 11Mb auto */
+ lp->TxRateControl[0] = 3;
+ } else {
+ rrq->value = 0;
+ ret = -EINVAL;
+ goto out_unlock;
+ }
+
+#endif // WARP
+
+
+ /* Commit the adapter parameters */
+ wl_apply( lp );
+
+out_unlock:
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_rate
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_rate()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Get the default data rate setting used by the wireless device.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_rate(struct net_device *dev, struct iw_request_info *info, struct iw_param *rrq, char *extra)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ hcf_16 txRate;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_rate" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* Get the current transmit rate from the adapter */
+ lp->ltvRecord.len = 1 + ( sizeof(txRate)/sizeof(hcf_16));
+ lp->ltvRecord.typ = CFG_CUR_TX_RATE;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+#ifdef WARP
+
+ txRate = CNV_LITTLE_TO_INT( lp->ltvRecord.u.u16[0] );
+
+ if( txRate & 0x0001 ) {
+ txRate = 1;
+ }
+ else if( txRate & 0x0002 ) {
+ txRate = 2;
+ }
+ else if( txRate & 0x0004 ) {
+ txRate = 5;
+ }
+ else if( txRate & 0x0008 ) {
+ txRate = 11;
+ }
+ else if( txRate & 0x00010 ) {
+ txRate = 6;
+ }
+ else if( txRate & 0x00020 ) {
+ txRate = 9;
+ }
+ else if( txRate & 0x00040 ) {
+ txRate = 12;
+ }
+ else if( txRate & 0x00080 ) {
+ txRate = 18;
+ }
+ else if( txRate & 0x00100 ) {
+ txRate = 24;
+ }
+ else if( txRate & 0x00200 ) {
+ txRate = 36;
+ }
+ else if( txRate & 0x00400 ) {
+ txRate = 48;
+ }
+ else if( txRate & 0x00800 ) {
+ txRate = 54;
+ }
+
+#else
+
+ txRate = (hcf_16)CNV_LITTLE_TO_LONG( lp->ltvRecord.u.u32[0] );
+
+#endif // WARP
+
+ rrq->value = txRate * MEGABIT;
+ } else {
+ rrq->value = 0;
+ ret = -EFAULT;
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_rate
+/*============================================================================*/
+
+
+
+
+#if 0 //;? Not used anymore
+/*******************************************************************************
+ * wireless_get_private_interface()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Returns the Linux Wireless Extensions' compatible private interface of
+ * the driver.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+int wireless_get_private_interface( struct iwreq *wrq, struct wl_private *lp )
+{
+ int ret = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_private_interface" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if( wrq->u.data.pointer != NULL ) {
+ struct iw_priv_args priv[] =
+ {
+ { SIOCSIWNETNAME, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, 0, "snetwork_name" },
+ { SIOCGIWNETNAME, 0, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, "gnetwork_name" },
+ { SIOCSIWSTANAME, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, 0, "sstation_name" },
+ { SIOCGIWSTANAME, 0, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, "gstation_name" },
+ { SIOCSIWPORTTYPE, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, 0, "sport_type" },
+ { SIOCGIWPORTTYPE, 0, IW_PRIV_TYPE_BYTE | IW_PRIV_SIZE_FIXED | 1, "gport_type" },
+ };
+
+ /* Verify the user buffer */
+ ret = verify_area( VERIFY_WRITE, wrq->u.data.pointer, sizeof( priv ));
+
+ if( ret != 0 ) {
+ DBG_LEAVE( DbgInfo );
+ return ret;
+ }
+
+ /* Copy the data into the user's buffer */
+ wrq->u.data.length = NELEM( priv );
+ copy_to_user( wrq->u.data.pointer, &priv, sizeof( priv ));
+ }
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_private_interface
+/*============================================================================*/
+#endif
+
+
+
+#if WIRELESS_EXT > 13
+
+/*******************************************************************************
+ * wireless_set_scan()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Instructs the driver to initiate a network scan.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_set_scan(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int status = -1;
+ int retries = 0;
+ /*------------------------------------------------------------------------*/
+
+ //;? Note: shows results as trace, retruns always 0 unless BUSY
+
+ DBG_FUNC( "wireless_set_scan" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /*
+ * This looks like a nice place to test if the HCF is still
+ * communicating with the card. It seems that sometimes BAP_1
+ * gets corrupted. By looking at the comments in HCF the
+ * cause is still a mistery. Okay, the communication to the
+ * card is dead, reset the card to revive.
+ */
+ if((lp->hcfCtx.IFB_CardStat & CARD_STAT_DEFUNCT) != 0)
+ {
+ DBG_TRACE( DbgInfo, "CARD is in DEFUNCT mode, reset it to bring it back to life\n" );
+ wl_reset( dev );
+ }
+
+retry:
+ /* Set the completion state to FALSE */
+ lp->probe_results.scan_complete = FALSE;
+
+
+ /* Channels to scan */
+#ifdef WARP
+ lp->ltvRecord.len = 5;
+ lp->ltvRecord.typ = CFG_SCAN_CHANNEL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0x3FFF ); // 2.4 GHz Band
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( 0xFFFF ); // 5.0 GHz Band
+ lp->ltvRecord.u.u16[2] = CNV_INT_TO_LITTLE( 0xFFFF ); // ..
+ lp->ltvRecord.u.u16[3] = CNV_INT_TO_LITTLE( 0x0007 ); // ..
+#else
+ lp->ltvRecord.len = 2;
+ lp->ltvRecord.typ = CFG_SCAN_CHANNEL;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0x7FFF );
+#endif // WARP
+
+ status = hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ DBG_TRACE( DbgInfo, "CFG_SCAN_CHANNEL result : 0x%x\n", status );
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ if( status != HCF_SUCCESS ) {
+ //Recovery
+ retries++;
+ if(retries <= 10) {
+ DBG_TRACE( DbgInfo, "Reset card to recover, attempt: %d\n", retries );
+ wl_reset( dev );
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ goto retry;
+ }
+ }
+
+ /* Set the SCAN_SSID to "ANY". Using this RID for scan prevents the need to
+ disassociate from the network we are currently on */
+ lp->ltvRecord.len = 18;
+ lp->ltvRecord.typ = CFG_SCAN_SSID;
+ lp->ltvRecord.u.u16[0] = CNV_INT_TO_LITTLE( 0 );
+ lp->ltvRecord.u.u16[1] = CNV_INT_TO_LITTLE( 0 );
+
+ status = hcf_put_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ // Holding the lock too long, make a gap to allow other processes
+ wl_unlock(lp, &flags);
+ wl_lock( lp, &flags );
+
+ DBG_TRACE( DbgInfo, "CFG_SCAN_SSID to 'any' status: 0x%x\n", status );
+
+ /* Initiate the scan */
+ /* NOTE: Using HCF_ACT_SCAN has been removed, as using HCF_ACT_ACS_SCAN to
+ retrieve probe responses must always be used to support WPA */
+ status = hcf_action( &( lp->hcfCtx ), HCF_ACT_ACS_SCAN );
+
+ if( status == HCF_SUCCESS ) {
+ DBG_TRACE( DbgInfo, "SUCCESSFULLY INITIATED SCAN...\n" );
+ } else {
+ DBG_TRACE( DbgInfo, "INITIATE SCAN FAILED...\n" );
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE(DbgInfo);
+ return ret;
+} // wireless_set_scan
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wireless_get_scan()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Instructs the driver to gather and return the results of a network scan.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+static int wireless_get_scan(struct net_device *dev, struct iw_request_info *info, struct iw_point *data, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ int count;
+ char *buf;
+ char *buf_end;
+ struct iw_event iwe;
+ PROBE_RESP *probe_resp;
+ hcf_8 msg[512];
+ hcf_8 *wpa_ie;
+ hcf_16 wpa_ie_len;
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wireless_get_scan" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ /* If the scan is not done, tell the calling process to try again later */
+ if( !lp->probe_results.scan_complete ) {
+ ret = -EAGAIN;
+ goto out_unlock;
+ }
+
+ DBG_TRACE( DbgInfo, "SCAN COMPLETE, Num of APs: %d\n",
+ lp->probe_results.num_aps );
+
+ buf = extra;
+ buf_end = extra + IW_SCAN_MAX_DATA;
+
+ for( count = 0; count < lp->probe_results.num_aps; count++ ) {
+ /* Reference the probe response from the table */
+ probe_resp = (PROBE_RESP *)&lp->probe_results.ProbeTable[count];
+
+
+ /* First entry MUST be the MAC address */
+ memset( &iwe, 0, sizeof( iwe ));
+
+ iwe.cmd = SIOCGIWAP;
+ iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
+ memcpy( iwe.u.ap_addr.sa_data, probe_resp->BSSID, ETH_ALEN);
+ iwe.len = IW_EV_ADDR_LEN;
+
+ buf = IWE_STREAM_ADD_EVENT(info, buf, buf_end, &iwe, IW_EV_ADDR_LEN);
+
+
+ /* Use the mode to indicate if it's a station or AP */
+ /* Won't always be an AP if in IBSS mode */
+ memset( &iwe, 0, sizeof( iwe ));
+
+ iwe.cmd = SIOCGIWMODE;
+
+ if( probe_resp->capability & CAPABILITY_IBSS ) {
+ iwe.u.mode = IW_MODE_INFRA;
+ } else {
+ iwe.u.mode = IW_MODE_MASTER;
+ }
+
+ iwe.len = IW_EV_UINT_LEN;
+
+ buf = IWE_STREAM_ADD_EVENT(info, buf, buf_end, &iwe, IW_EV_UINT_LEN);
+
+
+ /* Any quality information */
+ memset(&iwe, 0, sizeof(iwe));
+
+ iwe.cmd = IWEVQUAL;
+ iwe.u.qual.level = dbm(probe_resp->signal);
+ iwe.u.qual.noise = dbm(probe_resp->silence);
+ iwe.u.qual.qual = iwe.u.qual.level - iwe.u.qual.noise;
+ iwe.u.qual.updated = lp->probe_results.scan_complete;
+ iwe.len = IW_EV_QUAL_LEN;
+
+ buf = IWE_STREAM_ADD_EVENT(info, buf, buf_end, &iwe, IW_EV_QUAL_LEN);
+
+
+ /* ESSID information */
+ if( probe_resp->rawData[1] > 0 ) {
+ memset( &iwe, 0, sizeof( iwe ));
+
+ iwe.cmd = SIOCGIWESSID;
+ iwe.u.data.length = probe_resp->rawData[1];
+ iwe.u.data.flags = 1;
+
+ buf = IWE_STREAM_ADD_POINT(info, buf, buf_end, &iwe, &probe_resp->rawData[2]);
+ }
+
+
+ /* Encryption Information */
+ memset( &iwe, 0, sizeof( iwe ));
+
+ iwe.cmd = SIOCGIWENCODE;
+ iwe.u.data.length = 0;
+
+ /* Check the capabilities field of the Probe Response to see if
+ 'privacy' is supported on the AP in question */
+ if( probe_resp->capability & CAPABILITY_PRIVACY ) {
+ iwe.u.data.flags |= IW_ENCODE_ENABLED;
+ } else {
+ iwe.u.data.flags |= IW_ENCODE_DISABLED;
+ }
+
+ buf = IWE_STREAM_ADD_POINT(info, buf, buf_end, &iwe, NULL);
+
+
+ /* Frequency Info */
+ memset( &iwe, 0, sizeof( iwe ));
+
+ iwe.cmd = SIOCGIWFREQ;
+ iwe.len = IW_EV_FREQ_LEN;
+ iwe.u.freq.m = wl_parse_ds_ie( probe_resp );
+ iwe.u.freq.e = 0;
+
+ buf = IWE_STREAM_ADD_EVENT(info, buf, buf_end, &iwe, IW_EV_FREQ_LEN);
+
+
+#if WIRELESS_EXT > 14
+ /* Custom info (Beacon Interval) */
+ memset( &iwe, 0, sizeof( iwe ));
+ memset( msg, 0, sizeof( msg ));
+
+ iwe.cmd = IWEVCUSTOM;
+ sprintf( msg, "beacon_interval=%d", probe_resp->beaconInterval );
+ iwe.u.data.length = strlen( msg );
+
+ buf = IWE_STREAM_ADD_POINT(info, buf, buf_end, &iwe, msg);
+
+
+ /* Custom info (WPA-IE) */
+ wpa_ie = NULL;
+ wpa_ie_len = 0;
+
+ wpa_ie = wl_parse_wpa_ie( probe_resp, &wpa_ie_len );
+ if( wpa_ie != NULL ) {
+ memset( &iwe, 0, sizeof( iwe ));
+ memset( msg, 0, sizeof( msg ));
+
+ iwe.cmd = IWEVCUSTOM;
+ sprintf( msg, "wpa_ie=%s", wl_print_wpa_ie( wpa_ie, wpa_ie_len ));
+ iwe.u.data.length = strlen( msg );
+
+ buf = IWE_STREAM_ADD_POINT(info, buf, buf_end, &iwe, msg);
+ }
+
+ /* Add other custom info in formatted string format as needed... */
+#endif
+ }
+
+ data->length = buf - extra;
+
+out_unlock:
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_get_scan
+/*============================================================================*/
+
+#endif // WIRELESS_EXT > 13
+
+
+#if WIRELESS_EXT > 17
+
+static int wireless_set_auth(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_param *data, char *extra)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret;
+ int iwa_idx = data->flags & IW_AUTH_INDEX;
+ int iwa_val = data->value;
+
+ DBG_FUNC( "wireless_set_auth" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ switch (iwa_idx) {
+ case IW_AUTH_WPA_VERSION:
+ DBG_TRACE( DbgInfo, "IW_AUTH_WPA_VERSION\n");
+ /* We do support WPA only; how should DISABLED be treated? */
+ if (iwa_val == IW_AUTH_WPA_VERSION_WPA)
+ ret = 0;
+ else
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_WPA_ENABLED:
+ DBG_TRACE( DbgInfo, "IW_AUTH_WPA_ENABLED: val = %d\n", iwa_val);
+ if (iwa_val)
+ lp->EnableEncryption = 2;
+ else
+ lp->EnableEncryption = 0;
+ ret = 0;
+ break;
+
+ case IW_AUTH_TKIP_COUNTERMEASURES:
+ DBG_TRACE( DbgInfo, "IW_AUTH_TKIP_COUNTERMEASURES\n");
+ lp->driverEnable = !iwa_val;
+ if(lp->driverEnable)
+ hcf_cntl(&(lp->hcfCtx), HCF_CNTL_ENABLE | HCF_PORT_0);
+ else
+ hcf_cntl(&(lp->hcfCtx), HCF_CNTL_DISABLE | HCF_PORT_0);
+ ret = 0;
+ break;
+
+ case IW_AUTH_DROP_UNENCRYPTED:
+ DBG_TRACE( DbgInfo, "IW_AUTH_DROP_UNENCRYPTED\n");
+ /* We do not actually do anything here, just to silence
+ * wpa_supplicant */
+ ret = 0;
+ break;
+
+ case IW_AUTH_CIPHER_PAIRWISE:
+ DBG_TRACE( DbgInfo, "IW_AUTH_CIPHER_PAIRWISE\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_CIPHER_GROUP:
+ DBG_TRACE( DbgInfo, "IW_AUTH_CIPHER_GROUP\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_KEY_MGMT:
+ DBG_TRACE( DbgInfo, "IW_AUTH_KEY_MGMT\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_80211_AUTH_ALG:
+ DBG_TRACE( DbgInfo, "IW_AUTH_80211_AUTH_ALG\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_RX_UNENCRYPTED_EAPOL:
+ DBG_TRACE( DbgInfo, "IW_AUTH_RX_UNENCRYPTED_EAPOL\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_ROAMING_CONTROL:
+ DBG_TRACE( DbgInfo, "IW_AUTH_ROAMING_CONTROL\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ case IW_AUTH_PRIVACY_INVOKED:
+ DBG_TRACE( DbgInfo, "IW_AUTH_PRIVACY_INVOKED\n");
+ /* not implemented, return an error */
+ ret = -EINVAL;
+ break;
+
+ default:
+ DBG_TRACE( DbgInfo, "IW_AUTH_?? (%d) unknown\n", iwa_idx);
+ /* return an error */
+ ret = -EINVAL;
+ break;
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_auth
+/*============================================================================*/
+
+
+
+static int hermes_set_key(ltv_t *ltv, int alg, int key_idx, u8 *addr,
+ int set_tx, u8 *seq, u8 *key, size_t key_len)
+{
+ int ret = -EINVAL;
+ // int count = 0;
+ int buf_idx = 0;
+ hcf_8 tsc[IW_ENCODE_SEQ_MAX_SIZE] =
+ { 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00 };
+
+ DBG_FUNC( "hermes_set_key" );
+ DBG_ENTER( DbgInfo );
+
+ /*
+ * Check the key index here; if 0, load as Pairwise Key, otherwise,
+ * load as a group key. Note that for the Hermes, the RIDs for
+ * group/pariwise keys are different from each other and different
+ * than the default WEP keys as well.
+ */
+ switch (alg)
+ {
+ case IW_ENCODE_ALG_TKIP:
+ DBG_TRACE( DbgInfo, "IW_ENCODE_ALG_TKIP: key(%d)\n", key_idx);
+#if 0
+ /*
+ * Make sure that there is no data queued up in the firmware
+ * before setting the TKIP keys. If this check is not
+ * performed, some data may be sent out with incorrect MIC
+ * and cause synchronizarion errors with the AP
+ */
+ /* Check every 1ms for 100ms */
+ for( count = 0; count < 100; count++ )
+ {
+ usleep( 1000 );
+
+ ltv.len = 2;
+ ltv.typ = 0xFD91; // This RID not defined in HCF yet!!!
+ ltv.u.u16[0] = 0;
+
+ wl_get_info( sock, &ltv, ifname );
+
+ if( ltv.u.u16[0] == 0 )
+ {
+ break;
+ }
+ }
+
+ if( count == 100 )
+ {
+ wpa_printf( MSG_DEBUG, "Timed out waiting for TxQ!" );
+ }
+#endif
+
+ switch (key_idx) {
+ case 0:
+ ltv->len = 28;
+ ltv->typ = CFG_ADD_TKIP_MAPPED_KEY;
+
+ /* Load the BSSID */
+ memcpy(&ltv->u.u8[buf_idx], addr, ETH_ALEN);
+ buf_idx += ETH_ALEN;
+
+ /* Load the TKIP key */
+ memcpy(&ltv->u.u8[buf_idx], &key[0], 16);
+ buf_idx += 16;
+
+ /* Load the TSC */
+ memcpy(&ltv->u.u8[buf_idx], tsc, IW_ENCODE_SEQ_MAX_SIZE);
+ buf_idx += IW_ENCODE_SEQ_MAX_SIZE;
+
+ /* Load the RSC */
+ memcpy(&ltv->u.u8[buf_idx], seq, IW_ENCODE_SEQ_MAX_SIZE);
+ buf_idx += IW_ENCODE_SEQ_MAX_SIZE;
+
+ /* Load the TxMIC key */
+ memcpy(&ltv->u.u8[buf_idx], &key[16], 8);
+ buf_idx += 8;
+
+ /* Load the RxMIC key */
+ memcpy(&ltv->u.u8[buf_idx], &key[24], 8);
+
+ ret = 0;
+ break;
+ case 1:
+ case 2:
+ case 3:
+ ltv->len = 26;
+ ltv->typ = CFG_ADD_TKIP_DEFAULT_KEY;
+
+ /* Load the key Index */
+ ltv->u.u16[buf_idx] = key_idx;
+ /* If this is a Tx Key, set bit 8000 */
+ if(set_tx)
+ ltv->u.u16[buf_idx] |= 0x8000;
+ buf_idx += 2;
+
+ /* Load the RSC */
+ memcpy(&ltv->u.u8[buf_idx], seq, IW_ENCODE_SEQ_MAX_SIZE);
+ buf_idx += IW_ENCODE_SEQ_MAX_SIZE;
+
+ /* Load the TKIP, TxMIC, and RxMIC keys in one shot, because in
+ CFG_ADD_TKIP_DEFAULT_KEY they are back-to-back */
+ memcpy(&ltv->u.u8[buf_idx], key, key_len);
+ buf_idx += key_len;
+
+ /* Load the TSC */
+ memcpy(&ltv->u.u8[buf_idx], tsc, IW_ENCODE_SEQ_MAX_SIZE);
+
+ ltv->u.u16[0] = CNV_INT_TO_LITTLE(ltv->u.u16[0]);
+
+ ret = 0;
+ break;
+ default:
+ break;
+ }
+
+ break;
+
+ case IW_ENCODE_ALG_WEP:
+ DBG_TRACE( DbgInfo, "IW_ENCODE_ALG_WEP: key(%d)\n", key_idx);
+ break;
+
+ case IW_ENCODE_ALG_CCMP:
+ DBG_TRACE( DbgInfo, "IW_ENCODE_ALG_CCMP: key(%d)\n", key_idx);
+ break;
+
+ case IW_ENCODE_ALG_NONE:
+ DBG_TRACE( DbgInfo, "IW_ENCODE_ALG_NONE: key(%d)\n", key_idx);
+ switch (key_idx) {
+ case 0:
+ if (memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) != 0) {
+ //if (addr != NULL) {
+ ltv->len = 7;
+ ltv->typ = CFG_REMOVE_TKIP_MAPPED_KEY;
+ memcpy(&ltv->u.u8[0], addr, ETH_ALEN);
+ ret = 0;
+ }
+ break;
+ case 1:
+ case 2:
+ case 3:
+ /* Clear the Group TKIP keys by index */
+ ltv->len = 2;
+ ltv->typ = CFG_REMOVE_TKIP_DEFAULT_KEY;
+ ltv->u.u16[0] = key_idx;
+
+ ret = 0;
+ break;
+ default:
+ break;
+ }
+ break;
+ default:
+ DBG_TRACE( DbgInfo, "IW_ENCODE_??: key(%d)\n", key_idx);
+ break;
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // hermes_set_key
+/*============================================================================*/
+
+
+
+static int wireless_set_encodeext (struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *erq, char *keybuf)
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret;
+ int key_idx = (erq->flags&IW_ENCODE_INDEX) - 1;
+ ltv_t ltv;
+ struct iw_encode_ext *ext = (struct iw_encode_ext *)keybuf;
+
+ DBG_FUNC( "wireless_set_encodeext" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ if (sizeof(ext->rx_seq) != 8) {
+ DBG_TRACE(DbgInfo, "rz_seq size mismatch\n");
+ DBG_LEAVE(DbgInfo);
+ return -EINVAL;
+ }
+
+ /* Handle WEP keys via the old set encode procedure */
+ if(ext->alg == IW_ENCODE_ALG_WEP) {
+ struct iw_point wep_erq;
+ char *wep_keybuf;
+
+ /* Build request structure */
+ wep_erq.flags = erq->flags; // take over flags with key index
+ wep_erq.length = ext->key_len; // take length from extended key info
+ wep_keybuf = ext->key; // pointer to the key text
+
+ /* Call wireless_set_encode tot handle the WEP key */
+ ret = wireless_set_encode(dev, info, &wep_erq, wep_keybuf);
+ goto out;
+ }
+
+ /* Proceed for extended encode functions for WAP and NONE */
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ memset(&ltv, 0, sizeof(ltv));
+ ret = hermes_set_key(&ltv, ext->alg, key_idx, ext->addr.sa_data,
+ ext->ext_flags & IW_ENCODE_EXT_SET_TX_KEY,
+ ext->rx_seq, ext->key, ext->key_len);
+
+ if (ret != 0) {
+ DBG_TRACE( DbgInfo, "hermes_set_key returned != 0, key not set\n");
+ goto out_unlock;
+ }
+
+ /* Put the key in HCF */
+ ret = hcf_put_info(&(lp->hcfCtx), (LTVP)&ltv);
+
+out_unlock:
+ if(ret == HCF_SUCCESS) {
+ DBG_TRACE( DbgInfo, "Put key info succes\n");
+ } else {
+ DBG_TRACE( DbgInfo, "Put key info failed, key not set\n");
+ }
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+} // wireless_set_encodeext
+/*============================================================================*/
+
+
+
+static int wireless_get_genie(struct net_device *dev,
+ struct iw_request_info *info,
+ struct iw_point *data, char *extra)
+
+{
+ struct wl_private *lp = wl_priv(dev);
+ unsigned long flags;
+ int ret = 0;
+ ltv_t ltv;
+
+ DBG_FUNC( "wireless_get_genie" );
+ DBG_ENTER( DbgInfo );
+
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ ret = -EBUSY;
+ goto out;
+ }
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+ memset(&ltv, 0, sizeof(ltv));
+ ltv.len = 2;
+ ltv.typ = CFG_SET_WPA_AUTH_KEY_MGMT_SUITE;
+ lp->AuthKeyMgmtSuite = ltv.u.u16[0] = 4;
+ ltv.u.u16[0] = CNV_INT_TO_LITTLE(ltv.u.u16[0]);
+
+ ret = hcf_put_info(&(lp->hcfCtx), (LTVP)&ltv);
+
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+out:
+ DBG_LEAVE( DbgInfo );
+ return ret;
+}
+/*============================================================================*/
+
+
+#endif // WIRELESS_EXT > 17
+
+/*******************************************************************************
+ * wl_wireless_stats()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return the current device wireless statistics.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+struct iw_statistics * wl_wireless_stats( struct net_device *dev )
+{
+ struct iw_statistics *pStats;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+
+ DBG_FUNC( "wl_wireless_stats" );
+ DBG_ENTER(DbgInfo);
+ DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
+
+ pStats = NULL;
+
+ /* Initialize the statistics */
+ pStats = &( lp->wstats );
+ pStats->qual.updated = 0x00;
+
+ if( !( lp->flags & WVLAN2_UIL_BUSY ))
+ {
+ CFG_COMMS_QUALITY_STRCT *pQual;
+ CFG_HERMES_TALLIES_STRCT tallies;
+ int status;
+
+ /* Update driver status */
+ pStats->status = 0;
+
+ /* Get the current link quality information */
+ lp->ltvRecord.len = 1 + ( sizeof( *pQual ) / sizeof( hcf_16 ));
+ lp->ltvRecord.typ = CFG_COMMS_QUALITY;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+
+ if( status == HCF_SUCCESS ) {
+ pQual = (CFG_COMMS_QUALITY_STRCT *)&( lp->ltvRecord );
+
+#ifdef USE_DBM
+ pStats->qual.qual = (u_char) CNV_LITTLE_TO_INT( pQual->coms_qual );
+ pStats->qual.level = (u_char) dbm( CNV_LITTLE_TO_INT( pQual->signal_lvl ));
+ pStats->qual.noise = (u_char) dbm( CNV_LITTLE_TO_INT( pQual->noise_lvl ));
+#else
+ pStats->qual.qual = percent( CNV_LITTLE_TO_INT( pQual->coms_qual ),
+ HCF_MIN_COMM_QUALITY,
+ HCF_MAX_COMM_QUALITY );
+
+ pStats->qual.level = percent( CNV_LITTLE_TO_INT( pQual->signal_lvl ),
+ HCF_MIN_SIGNAL_LEVEL,
+ HCF_MAX_SIGNAL_LEVEL );
+
+ pStats->qual.noise = percent( CNV_LITTLE_TO_INT( pQual->noise_lvl ),
+ HCF_MIN_NOISE_LEVEL,
+ HCF_MAX_NOISE_LEVEL );
+#endif /* USE_DBM */
+
+ pStats->qual.updated |= 0x07;
+ } else {
+ memset( &( pStats->qual ), 0, sizeof( pStats->qual ));
+ }
+
+ /* Get the current tallies from the adapter */
+ /* Only possible when the device is open */
+ if(lp->portState == WVLAN_PORT_STATE_DISABLED) {
+ if( wl_get_tallies( lp, &tallies ) == 0 ) {
+ /* No endian translation is needed here, as CFG_TALLIES is an
+ MSF RID; all processing is done on the host, not the card! */
+ pStats->discard.nwid = 0L;
+ pStats->discard.code = tallies.RxWEPUndecryptable;
+ pStats->discard.misc = tallies.TxDiscards +
+ tallies.RxFCSErrors +
+ //tallies.RxDiscardsNoBuffer +
+ tallies.TxDiscardsWrongSA;
+ //;? Extra taken over from Linux driver based on 7.18 version
+ pStats->discard.retries = tallies.TxRetryLimitExceeded;
+ pStats->discard.fragment = tallies.RxMsgInBadMsgFragments;
+ } else {
+ memset( &( pStats->discard ), 0, sizeof( pStats->discard ));
+ }
+ } else {
+ memset( &( pStats->discard ), 0, sizeof( pStats->discard ));
+ }
+ }
+
+ DBG_LEAVE( DbgInfo );
+ return pStats;
+} // wl_wireless_stats
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_get_wireless_stats()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Return the current device wireless statistics. This function calls
+ * wl_wireless_stats, but acquires spinlocks first as it can be called
+ * directly by the network layer.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+struct iw_statistics * wl_get_wireless_stats( struct net_device *dev )
+{
+ unsigned long flags;
+ struct wl_private *lp = wl_priv(dev);
+ struct iw_statistics *pStats = NULL;
+ /*------------------------------------------------------------------------*/
+
+ DBG_FUNC( "wl_get_wireless_stats" );
+ DBG_ENTER(DbgInfo);
+
+ wl_lock( lp, &flags );
+
+ wl_act_int_off( lp );
+
+#ifdef USE_RTS
+ if( lp->useRTS == 1 ) {
+ DBG_TRACE( DbgInfo, "Skipping wireless stats, in RTS mode\n" );
+ } else
+#endif
+ {
+ pStats = wl_wireless_stats( dev );
+ }
+ wl_act_int_on( lp );
+
+ wl_unlock(lp, &flags);
+
+ DBG_LEAVE( DbgInfo );
+ return pStats;
+} // wl_get_wireless_stats
+
+
+/*******************************************************************************
+ * wl_spy_gather()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * Gather wireless spy statistics.
+ *
+ * PARAMETERS:
+ *
+ * wrq - the wireless request buffer
+ * lp - the device's private adapter structure
+ *
+ * RETURNS:
+ *
+ * 0 on success
+ * errno value otherwise
+ *
+ ******************************************************************************/
+inline void wl_spy_gather( struct net_device *dev, u_char *mac )
+{
+ struct iw_quality wstats;
+ int status;
+ u_char stats[2];
+ DESC_STRCT desc[1];
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+ /* shortcut */
+ if (!lp->spy_data.spy_number) {
+ return;
+ }
+
+ /* Gather wireless spy statistics: for each packet, compare the source
+ address with out list, and if match, get the stats. */
+ memset( stats, 0, sizeof(stats));
+ memset( desc, 0, sizeof(DESC_STRCT));
+
+ desc[0].buf_addr = stats;
+ desc[0].BUF_SIZE = sizeof(stats);
+ desc[0].next_desc_addr = 0; // terminate list
+
+ status = hcf_rcv_msg( &( lp->hcfCtx ), &desc[0], 0 );
+
+ if( status == HCF_SUCCESS ) {
+ wstats.level = (u_char) dbm(stats[1]);
+ wstats.noise = (u_char) dbm(stats[0]);
+ wstats.qual = wstats.level > wstats.noise ? wstats.level - wstats.noise : 0;
+
+ wstats.updated = 7;
+
+ wireless_spy_update( dev, mac, &wstats );
+ }
+} // wl_spy_gather
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_freq()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that the channel/freq
+ * configuration for a specific device has changed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_freq( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ wrqu.freq.m = lp->Channel;
+ wrqu.freq.e = 0;
+
+ wireless_send_event( dev, SIOCSIWFREQ, &wrqu, NULL );
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_freq
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_mode()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that the mode of operation
+ * for a specific device has changed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_mode( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_STA ) {
+ wrqu.mode = IW_MODE_INFRA;
+ } else {
+ wrqu.mode = IW_MODE_MASTER;
+ }
+
+ wireless_send_event( dev, SIOCSIWMODE, &wrqu, NULL );
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_mode
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_essid()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that the ESSID configuration for
+ * a specific device has changed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_essid( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ /* Fill out the buffer. Note that the buffer doesn't actually contain the
+ ESSID, but a pointer to the contents. In addition, the 'extra' field of
+ the call to wireless_send_event() must also point to where the ESSID
+ lives */
+ wrqu.essid.length = strlen( lp->NetworkName );
+ wrqu.essid.pointer = (caddr_t)lp->NetworkName;
+ wrqu.essid.flags = 1;
+
+ wireless_send_event( dev, SIOCSIWESSID, &wrqu, lp->NetworkName );
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_essid
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_encode()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that the encryption configuration
+ * for a specific device has changed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_encode( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ int index = 0;
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ if( lp->EnableEncryption == 0 ) {
+ wrqu.encoding.flags = IW_ENCODE_DISABLED;
+ } else {
+ wrqu.encoding.flags |= lp->TransmitKeyID;
+
+ index = lp->TransmitKeyID - 1;
+
+ /* Only set IW_ENCODE_RESTRICTED/OPEN flag using lp->ExcludeUnencrypted
+ if we're in AP mode */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_AP
+ //;?should we restore this to allow smaller memory footprint
+
+ if ( CNV_INT_TO_LITTLE( lp->hcfCtx.IFB_FWIdentity.comp_id ) == COMP_ID_FW_AP ) {
+ if( lp->ExcludeUnencrypted ) {
+ wrqu.encoding.flags |= IW_ENCODE_RESTRICTED;
+ } else {
+ wrqu.encoding.flags |= IW_ENCODE_OPEN;
+ }
+ }
+
+#endif // HCF_TYPE_AP
+
+ /* Only provide the key if permissions allow */
+ if( capable( CAP_NET_ADMIN )) {
+ wrqu.encoding.pointer = (caddr_t)lp->DefaultKeys.key[index].key;
+ wrqu.encoding.length = lp->DefaultKeys.key[index].len;
+ } else {
+ wrqu.encoding.flags |= IW_ENCODE_NOKEY;
+ }
+ }
+
+ wireless_send_event( dev, SIOCSIWENCODE, &wrqu,
+ lp->DefaultKeys.key[index].key );
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_encode
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_ap()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that the device has been
+ * associated to a new AP.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_ap( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ int status;
+ /*------------------------------------------------------------------------*/
+
+
+ /* Retrieve the WPA-IEs used by the firmware and send an event. We must send
+ this event BEFORE sending the association event, as there are timing
+ issues with the hostap supplicant. The supplicant will attempt to process
+ an EAPOL-Key frame from an AP before receiving this information, which
+ is required properly process the said frame. */
+ wl_wext_event_assoc_ie( dev );
+
+ /* Get the BSSID */
+ lp->ltvRecord.typ = CFG_CUR_BSSID;
+ lp->ltvRecord.len = 4;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ if( status == HCF_SUCCESS ) {
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ memcpy( wrqu.addr.sa_data, lp->ltvRecord.u.u8, ETH_ALEN );
+
+ wrqu.addr.sa_family = ARPHRD_ETHER;
+
+ wireless_send_event( dev, SIOCGIWAP, &wrqu, NULL );
+ }
+
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_ap
+/*============================================================================*/
+
+
+
+/*******************************************************************************
+ * wl_wext_event_scan_complete()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that a request for a network scan
+ * has completed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_scan_complete( struct net_device *dev )
+{
+#if WIRELESS_EXT > 13
+ union iwreq_data wrqu;
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ wrqu.addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event( dev, SIOCGIWSCAN, &wrqu, NULL );
+#endif /* WIRELESS_EXT > 13 */
+
+ return;
+} // wl_wext_event_scan_complete
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_new_sta()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that an AP has registered a new
+ * station.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_new_sta( struct net_device *dev )
+{
+#if WIRELESS_EXT > 14
+ union iwreq_data wrqu;
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ /* Send the station's mac address here */
+ memcpy( wrqu.addr.sa_data, dev->dev_addr, ETH_ALEN );
+ wrqu.addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event( dev, IWEVREGISTERED, &wrqu, NULL );
+#endif /* WIRELESS_EXT > 14 */
+
+ return;
+} // wl_wext_event_new_sta
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_expired_sta()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that an AP has deregistered a
+ * station.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_expired_sta( struct net_device *dev )
+{
+#if WIRELESS_EXT > 14
+ union iwreq_data wrqu;
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+
+ memcpy( wrqu.addr.sa_data, dev->dev_addr, ETH_ALEN );
+ wrqu.addr.sa_family = ARPHRD_ETHER;
+ wireless_send_event( dev, IWEVEXPIRED, &wrqu, NULL );
+#endif /* WIRELESS_EXT > 14 */
+
+ return;
+} // wl_wext_event_expired_sta
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_mic_failed()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event that MIC calculations failed.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_mic_failed( struct net_device *dev )
+{
+#if WIRELESS_EXT > 14
+ char msg[512];
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ int key_idx;
+ char *addr1;
+ char *addr2;
+ WVLAN_RX_WMP_HDR *hdr;
+ /*------------------------------------------------------------------------*/
+
+
+ key_idx = lp->lookAheadBuf[HFS_STAT+1] >> 3;
+ key_idx &= 0x03;
+
+ /* Cast the lookahead buffer into a RFS format */
+ hdr = (WVLAN_RX_WMP_HDR *)&lp->lookAheadBuf[HFS_STAT];
+
+ /* Cast the addresses to byte buffers, as in the above RFS they are word
+ length */
+ addr1 = (char *)hdr->address1;
+ addr2 = (char *)hdr->address2;
+
+ DBG_PRINT( "MIC FAIL - KEY USED : %d, STATUS : 0x%04x\n", key_idx,
+ hdr->status );
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+ memset( msg, 0, sizeof( msg ));
+
+
+ /* Becuase MIC failures are not part of the Wireless Extensions yet, they
+ must be passed as a string using an IWEVCUSTOM event. In order for the
+ event to be effective, the string format must be known by both the
+ driver and the supplicant. The following is the string format used by the
+ hostap project's WPA supplicant, and will be used here until the Wireless
+ Extensions interface adds this support:
+
+ MLME-MICHAELMICFAILURE.indication(keyid=# broadcast/unicast addr=addr2)
+ */
+
+ /* NOTE: Format of MAC address (using colons to seperate bytes) may cause
+ a problem in future versions of the supplicant, if they ever
+ actually parse these parameters */
+#if DBG
+ sprintf( msg, "MLME-MICHAELMICFAILURE.indication(keyid=%d %scast addr="
+ "%s)", key_idx, addr1[0] & 0x01 ? "broad" : "uni",
+ DbgHwAddr( addr2 ));
+#endif
+ wrqu.data.length = strlen( msg );
+ wireless_send_event( dev, IWEVCUSTOM, &wrqu, msg );
+#endif /* WIRELESS_EXT > 14 */
+
+ return;
+} // wl_wext_event_mic_failed
+/*============================================================================*/
+
+
+
+
+/*******************************************************************************
+ * wl_wext_event_assoc_ie()
+ *******************************************************************************
+ *
+ * DESCRIPTION:
+ *
+ * This function is used to send an event containing the WPA-IE generated
+ * by the firmware in an association request.
+ *
+ *
+ * PARAMETERS:
+ *
+ * dev - the network device for which this event is to be issued
+ *
+ * RETURNS:
+ *
+ * N/A
+ *
+ ******************************************************************************/
+void wl_wext_event_assoc_ie( struct net_device *dev )
+{
+#if WIRELESS_EXT > 14
+ char msg[512];
+ union iwreq_data wrqu;
+ struct wl_private *lp = wl_priv(dev);
+ int status;
+ PROBE_RESP data;
+ hcf_16 length;
+ hcf_8 *wpa_ie;
+ /*------------------------------------------------------------------------*/
+
+
+ memset( &wrqu, 0, sizeof( wrqu ));
+ memset( msg, 0, sizeof( msg ));
+
+ /* Retrieve the Association Request IE */
+ lp->ltvRecord.len = 45;
+ lp->ltvRecord.typ = CFG_CUR_ASSOC_REQ_INFO;
+
+ status = hcf_get_info( &( lp->hcfCtx ), (LTVP)&( lp->ltvRecord ));
+ if( status == HCF_SUCCESS )
+ {
+ length = 0;
+ memcpy( &data.rawData, &( lp->ltvRecord.u.u8[1] ), 88 );
+ wpa_ie = wl_parse_wpa_ie( &data, &length );
+
+ /* Becuase this event (Association WPA-IE) is not part of the Wireless
+ Extensions yet, it must be passed as a string using an IWEVCUSTOM event.
+ In order for the event to be effective, the string format must be known
+ by both the driver and the supplicant. The following is the string format
+ used by the hostap project's WPA supplicant, and will be used here until
+ the Wireless Extensions interface adds this support:
+
+ ASSOCINFO(ReqIEs=WPA-IE RespIEs=WPA-IE)
+ */
+
+ if( length != 0 )
+ {
+ sprintf( msg, "ASSOCINFO(ReqIEs=%s)", wl_print_wpa_ie( wpa_ie, length ));
+ wrqu.data.length = strlen( msg );
+ wireless_send_event( dev, IWEVCUSTOM, &wrqu, msg );
+ }
+ }
+#endif /* WIRELESS_EXT > 14 */
+
+ return;
+} // wl_wext_event_assoc_ie
+/*============================================================================*/
+/* Structures to export the Wireless Handlers */
+
+static const iw_handler wl_handler[] =
+{
+ (iw_handler) wireless_commit, /* SIOCSIWCOMMIT */
+ (iw_handler) wireless_get_protocol, /* SIOCGIWNAME */
+ (iw_handler) NULL, /* SIOCSIWNWID */
+ (iw_handler) NULL, /* SIOCGIWNWID */
+ (iw_handler) wireless_set_frequency, /* SIOCSIWFREQ */
+ (iw_handler) wireless_get_frequency, /* SIOCGIWFREQ */
+ (iw_handler) wireless_set_porttype, /* SIOCSIWMODE */
+ (iw_handler) wireless_get_porttype, /* SIOCGIWMODE */
+ (iw_handler) wireless_set_sensitivity, /* SIOCSIWSENS */
+ (iw_handler) wireless_get_sensitivity, /* SIOCGIWSENS */
+ (iw_handler) NULL , /* SIOCSIWRANGE */
+ (iw_handler) wireless_get_range, /* SIOCGIWRANGE */
+ (iw_handler) NULL , /* SIOCSIWPRIV */
+ (iw_handler) NULL /* kernel code */, /* SIOCGIWPRIV */
+ (iw_handler) NULL , /* SIOCSIWSTATS */
+ (iw_handler) NULL /* kernel code */, /* SIOCGIWSTATS */
+ iw_handler_set_spy, /* SIOCSIWSPY */
+ iw_handler_get_spy, /* SIOCGIWSPY */
+ NULL, /* SIOCSIWTHRSPY */
+ NULL, /* SIOCGIWTHRSPY */
+ (iw_handler) NULL, /* SIOCSIWAP */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ (iw_handler) wireless_get_bssid, /* SIOCGIWAP */
+#else
+ (iw_handler) NULL, /* SIOCGIWAP */
+#endif
+ (iw_handler) NULL, /* SIOCSIWMLME */
+ (iw_handler) wireless_get_ap_list, /* SIOCGIWAPLIST */
+ (iw_handler) wireless_set_scan, /* SIOCSIWSCAN */
+ (iw_handler) wireless_get_scan, /* SIOCGIWSCAN */
+ (iw_handler) wireless_set_essid, /* SIOCSIWESSID */
+ (iw_handler) wireless_get_essid, /* SIOCGIWESSID */
+ (iw_handler) wireless_set_nickname, /* SIOCSIWNICKN */
+ (iw_handler) wireless_get_nickname, /* SIOCGIWNICKN */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) wireless_set_rate, /* SIOCSIWRATE */
+ (iw_handler) wireless_get_rate, /* SIOCGIWRATE */
+ (iw_handler) wireless_set_rts_threshold,/* SIOCSIWRTS */
+ (iw_handler) wireless_get_rts_threshold,/* SIOCGIWRTS */
+ (iw_handler) NULL, /* SIOCSIWFRAG */
+ (iw_handler) NULL, /* SIOCGIWFRAG */
+ (iw_handler) NULL, /* SIOCSIWTXPOW */
+ (iw_handler) wireless_get_tx_power, /* SIOCGIWTXPOW */
+ (iw_handler) NULL, /* SIOCSIWRETRY */
+ (iw_handler) NULL, /* SIOCGIWRETRY */
+ (iw_handler) wireless_set_encode, /* SIOCSIWENCODE */
+ (iw_handler) wireless_get_encode, /* SIOCGIWENCODE */
+ (iw_handler) wireless_set_power, /* SIOCSIWPOWER */
+ (iw_handler) wireless_get_power, /* SIOCGIWPOWER */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) NULL, /* -- hole -- */
+ (iw_handler) wireless_get_genie, /* SIOCSIWGENIE */
+ (iw_handler) NULL, /* SIOCGIWGENIE */
+ (iw_handler) wireless_set_auth, /* SIOCSIWAUTH */
+ (iw_handler) NULL, /* SIOCGIWAUTH */
+ (iw_handler) wireless_set_encodeext, /* SIOCSIWENCODEEXT */
+ (iw_handler) NULL, /* SIOCGIWENCODEEXT */
+ (iw_handler) NULL, /* SIOCSIWPMKSA */
+ (iw_handler) NULL, /* -- hole -- */
+};
+
+static const iw_handler wl_private_handler[] =
+{ /* SIOCIWFIRSTPRIV + */
+ wvlan_set_netname, /* 0: SIOCSIWNETNAME */
+ wvlan_get_netname, /* 1: SIOCGIWNETNAME */
+ wvlan_set_station_nickname, /* 2: SIOCSIWSTANAME */
+ wvlan_get_station_nickname, /* 3: SIOCGIWSTANAME */
+#if 1 //;? (HCF_TYPE) & HCF_TYPE_STA
+ wvlan_set_porttype, /* 4: SIOCSIWPORTTYPE */
+ wvlan_get_porttype, /* 5: SIOCGIWPORTTYPE */
+#endif
+};
+
+struct iw_priv_args wl_priv_args[] = {
+ {SIOCSIWNETNAME, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, 0, "snetwork_name" },
+ {SIOCGIWNETNAME, 0, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, "gnetwork_name" },
+ {SIOCSIWSTANAME, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, 0, "sstation_name" },
+ {SIOCGIWSTANAME, 0, IW_PRIV_TYPE_CHAR | HCF_MAX_NAME_LEN, "gstation_name" },
+#if 1 //;? #if (HCF_TYPE) & HCF_TYPE_STA
+ {SIOCSIWPORTTYPE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "sport_type" },
+ {SIOCGIWPORTTYPE, 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, "gport_type" },
+#endif
+};
+
+const struct iw_handler_def wl_iw_handler_def =
+{
+ .num_private = sizeof(wl_private_handler) / sizeof(iw_handler),
+ .private = (iw_handler *) wl_private_handler,
+ .private_args = (struct iw_priv_args *) wl_priv_args,
+ .num_private_args = sizeof(wl_priv_args) / sizeof(struct iw_priv_args),
+ .num_standard = sizeof(wl_handler) / sizeof(iw_handler),
+ .standard = (iw_handler *) wl_handler,
+ .get_wireless_stats = wl_get_wireless_stats,
+};
+
+#endif // WIRELESS_EXT
diff --git a/drivers/staging/wlags49_h2/wl_wext.h b/drivers/staging/wlags49_h2/wl_wext.h
new file mode 100644
index 000000000000..9d09de8b84fa
--- /dev/null
+++ b/drivers/staging/wlags49_h2/wl_wext.h
@@ -0,0 +1,113 @@
+/*******************************************************************************
+ * Agere Systems Inc.
+ * Wireless device driver for Linux (wlags49).
+ *
+ * Copyright (c) 1998-2003 Agere Systems Inc.
+ * All rights reserved.
+ * http://www.agere.com
+ *
+ * Initially developed by TriplePoint, Inc.
+ * http://www.triplepoint.com
+ *
+ *------------------------------------------------------------------------------
+ *
+ * Header describing information required for the wireless IOCTL handlers.
+ *
+ *------------------------------------------------------------------------------
+ *
+ * SOFTWARE LICENSE
+ *
+ * This software is provided subject to the following terms and conditions,
+ * which you should read carefully before using the software. Using this
+ * software indicates your acceptance of these terms and conditions. If you do
+ * not agree with these terms and conditions, do not use the software.
+ *
+ * Copyright © 2003 Agere Systems Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source or binary forms, with or without
+ * modifications, are permitted provided that the following conditions are met:
+ *
+ * . Redistributions of source code must retain the above copyright notice, this
+ * list of conditions and the following Disclaimer as comments in the code as
+ * well as in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * . Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following Disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ *
+ * . Neither the name of Agere Systems Inc. nor the names of the contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Disclaimer
+ *
+ * THIS SOFTWARE IS PROVIDED “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY
+ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
+ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, INCLUDING, BUT NOT LIMITED TO, CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ ******************************************************************************/
+
+
+
+
+/*******************************************************************************
+ * VERSION CONTROL INFORMATION
+ *******************************************************************************
+ *
+ * $Author: nico $
+ * $Date: 2004/07/19 08:16:15 $
+ * $Revision: 1.2 $
+ * $Source: /usr/local/cvs/wl_lkm/include/wireless/wl_wext.h,v $
+ *
+ ******************************************************************************/
+
+
+
+
+#ifndef __WL_WEXT_H__
+#define __WL_WEXT_H__
+
+
+#ifdef WIRELESS_EXT
+
+
+/*******************************************************************************
+ * function protoypes
+ ******************************************************************************/
+
+struct iw_statistics *wl_wireless_stats( struct net_device *dev );
+
+struct iw_statistics * wl_get_wireless_stats( struct net_device *dev );
+
+inline void wl_spy_gather (struct net_device *dev, u_char *mac);
+
+void wl_wext_event_freq( struct net_device *dev );
+void wl_wext_event_mode( struct net_device *dev );
+void wl_wext_event_essid( struct net_device *dev );
+void wl_wext_event_encode( struct net_device *dev );
+void wl_wext_event_ap( struct net_device *dev );
+void wl_wext_event_scan_complete( struct net_device *dev );
+void wl_wext_event_new_sta( struct net_device *dev );
+void wl_wext_event_expired_sta( struct net_device *dev );
+void wl_wext_event_mic_failed( struct net_device *dev );
+void wl_wext_event_assoc_ie( struct net_device *dev );
+
+extern const struct iw_handler_def wl_iw_handler_def;
+
+#else
+#error WIRELESS_EXT
+#endif // WIRELESS_EXT
+
+
+#endif // __WL_WEXT_H__
diff --git a/drivers/staging/wlags49_h25/Kconfig b/drivers/staging/wlags49_h25/Kconfig
new file mode 100644
index 000000000000..1df08e0b3468
--- /dev/null
+++ b/drivers/staging/wlags49_h25/Kconfig
@@ -0,0 +1,8 @@
+config WLAGS49_H25
+ tristate "Linksys HERMES II.5 WCF54G_Wireless-G_CompactFlash_Card"
+ depends on WLAN_80211 && WIRELESS_EXT
+ ---help---
+ Driver for wireless cards using Agere's HERMES II.5 chipset
+ which are identified with Manufacture ID: 0156,0004
+ The software is a modified version of wl_lkm_722_abg.tar.gz
+ from the Agere Systems website, addapted for Ubuntu 9.04.
diff --git a/drivers/staging/wlags49_h25/Makefile b/drivers/staging/wlags49_h25/Makefile
new file mode 100644
index 000000000000..d0b23d4ff95a
--- /dev/null
+++ b/drivers/staging/wlags49_h25/Makefile
@@ -0,0 +1,81 @@
+#
+# Makefile for wlags49_h2_cs.ko and wlags49_h25_cs.ko
+#
+# Default build for Hermes-II base cards (possibly identified with
+# "manfid: 0x0156, 0x0003" in "pccardctl ident" output), comment
+# -DHERMES25 below
+#
+# If you want to build for Hermes-II.5 base cards (possibly identified with
+# "manfid: 0x0156, 0x0004" in "pccardctl ident" output), uncomment
+# -DHERMES25 below
+#
+# If you want to build AP support (untested), comment out -DSTA_ONLY
+
+INSTALLDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless
+EXTRA_CFLAGS += -I$(KERNELDIR)/include
+EXTRA_CFLAGS += -I$(src) \
+ -DBUS_PCMCIA \
+ -DUSE_WPA \
+ -DUSE_WEXT \
+ -DSTA_ONLY \
+ -DWVLAN_49 \
+ -DHERMES25 \
+# -DDBG \
+# -DDBG_LVL=5 \
+# -DUSE_UIL \
+# -DUSE_PROFILE \
+
+ifeq ($(findstring HERMES25,$(EXTRA_CFLAGS)),)
+WLNAME := wlags49_h2_cs
+$(WLNAME)-y := sta_h2.o
+ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
+$(WLNAME)-y += ap_h2.o
+endif
+else
+WLNAME=wlags49_h25_cs
+$(WLNAME)-y := sta_h25.o
+ifeq ($(findstring STA_ONLY,$(EXTRA_CFLAGS)),)
+$(WLNAME)-y += ap_h25.o
+endif
+endif
+
+# If KERNELRELEASE is defined, we've been invoked from the
+# kernel build system and can use its language.
+ifneq ($(KERNELRELEASE),)
+
+obj-m += $(WLNAME).o
+
+$(WLNAME)-y += wl_profile.o \
+ wl_wext.o \
+ wl_priv.o \
+ wl_main.o \
+ wl_enc.o \
+ wl_util.o \
+ wl_netdev.o \
+ wl_cs.o \
+ mmd.o \
+ hcf.o \
+ dhf.o
+
+$(WLNAME)-$(CONFIG_SYSFS) += wl_sysfs.o
+
+# Otherwise we were called directly from the command
+# line; invoke the kernel build system.
+else
+ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+ PWD := $(shell pwd)
+
+default:
+ $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
+endif
+
+clean:
+ rm -fr *.o *.ko *.mod.c *.mod.o .*.*.cmd Module.symvers \
+ Module.markers modules.order .tmp_versions
+
+install: default
+ -rmmod $(WLNAME)
+ install -d $(INSTALLDIR)
+ install -m 0644 -o root -g root $(WLNAME).ko $(INSTALLDIR)
+ /sbin/depmod -aq
+
diff --git a/drivers/staging/wlags49_h25/README.txt b/drivers/staging/wlags49_h25/README.txt
new file mode 100644
index 000000000000..4c7a836972d7
--- /dev/null
+++ b/drivers/staging/wlags49_h25/README.txt
@@ -0,0 +1,30 @@
+=======================================================================
+WLAN driver for cards using the HERMES II and HERMES II.5 chipset
+
+HERMES II Card
+
+PCMCIA Info: "Agere Systems" "Wireless PC Card Model 0110"
+ Manufacture ID: 0156,0003
+
+HERMES II.5 Card
+
+PCMCIA Info: "Linksys" "WCF54G_Wireless-G_CompactFlash_Card"
+ Manufacture ID: 0156,0004
+
+Based on Agere Systems Linux LKM Wireless Driver Source Code,
+Version 7.22; complies with Open Source BSD License.
+=======================================================================
+
+DESCRIPTION
+
+This directory only contains files that refer to the source in wlags49_h2.
+Only real sourcefiles are the Makefile which has been configured to build
+the driver for the HERMES II.5 chipset and Kconfig to describe the driver.
+
+The wlags49_h2 directory contains the full source, including the files
+exclusively used by this driver.
+
+For more information about the driver look at the wlags49_h2 direcory.
+
+=======================================================================
+
diff --git a/drivers/staging/wlags49_h25/ap_h25.c b/drivers/staging/wlags49_h25/ap_h25.c
new file mode 100644
index 000000000000..0344fa58dda6
--- /dev/null
+++ b/drivers/staging/wlags49_h25/ap_h25.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/ap_h25.c"
diff --git a/drivers/staging/wlags49_h25/debug.h b/drivers/staging/wlags49_h25/debug.h
new file mode 100644
index 000000000000..b5fb136a2d54
--- /dev/null
+++ b/drivers/staging/wlags49_h25/debug.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/debug.h"
diff --git a/drivers/staging/wlags49_h25/dhf.c b/drivers/staging/wlags49_h25/dhf.c
new file mode 100644
index 000000000000..81762c80189c
--- /dev/null
+++ b/drivers/staging/wlags49_h25/dhf.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/dhf.c"
diff --git a/drivers/staging/wlags49_h25/dhf.h b/drivers/staging/wlags49_h25/dhf.h
new file mode 100644
index 000000000000..54181dc70a72
--- /dev/null
+++ b/drivers/staging/wlags49_h25/dhf.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/dhf.h"
diff --git a/drivers/staging/wlags49_h25/dhfcfg.h b/drivers/staging/wlags49_h25/dhfcfg.h
new file mode 100644
index 000000000000..2586e3980214
--- /dev/null
+++ b/drivers/staging/wlags49_h25/dhfcfg.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/dhfcfg.h"
diff --git a/drivers/staging/wlags49_h25/hcf.c b/drivers/staging/wlags49_h25/hcf.c
new file mode 100644
index 000000000000..eeeba1f5553e
--- /dev/null
+++ b/drivers/staging/wlags49_h25/hcf.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/hcf.c"
diff --git a/drivers/staging/wlags49_h25/hcf.h b/drivers/staging/wlags49_h25/hcf.h
new file mode 100644
index 000000000000..d1143d9fce2d
--- /dev/null
+++ b/drivers/staging/wlags49_h25/hcf.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/hcf.h"
diff --git a/drivers/staging/wlags49_h25/hcfcfg.h b/drivers/staging/wlags49_h25/hcfcfg.h
new file mode 100644
index 000000000000..f88c4bcb3ff8
--- /dev/null
+++ b/drivers/staging/wlags49_h25/hcfcfg.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/hcfcfg.h"
diff --git a/drivers/staging/wlags49_h25/hcfdef.h b/drivers/staging/wlags49_h25/hcfdef.h
new file mode 100644
index 000000000000..f6a0060c3a53
--- /dev/null
+++ b/drivers/staging/wlags49_h25/hcfdef.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/hcfdef.h"
diff --git a/drivers/staging/wlags49_h25/mdd.h b/drivers/staging/wlags49_h25/mdd.h
new file mode 100644
index 000000000000..4d8e142ffa34
--- /dev/null
+++ b/drivers/staging/wlags49_h25/mdd.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/mdd.h"
diff --git a/drivers/staging/wlags49_h25/mmd.c b/drivers/staging/wlags49_h25/mmd.c
new file mode 100644
index 000000000000..b20782d334d2
--- /dev/null
+++ b/drivers/staging/wlags49_h25/mmd.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/mmd.c"
diff --git a/drivers/staging/wlags49_h25/mmd.h b/drivers/staging/wlags49_h25/mmd.h
new file mode 100644
index 000000000000..8284dd9155ed
--- /dev/null
+++ b/drivers/staging/wlags49_h25/mmd.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/mmd.h"
diff --git a/drivers/staging/wlags49_h25/sta_h25.c b/drivers/staging/wlags49_h25/sta_h25.c
new file mode 100644
index 000000000000..83c76bbdc6e7
--- /dev/null
+++ b/drivers/staging/wlags49_h25/sta_h25.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/sta_h25.c"
diff --git a/drivers/staging/wlags49_h25/wl_cs.c b/drivers/staging/wlags49_h25/wl_cs.c
new file mode 100644
index 000000000000..e6e1f199ea68
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_cs.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_cs.c"
diff --git a/drivers/staging/wlags49_h25/wl_cs.h b/drivers/staging/wlags49_h25/wl_cs.h
new file mode 100644
index 000000000000..657acee525cb
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_cs.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_cs.h"
diff --git a/drivers/staging/wlags49_h25/wl_enc.c b/drivers/staging/wlags49_h25/wl_enc.c
new file mode 100644
index 000000000000..fe59df145150
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_enc.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_enc.c"
diff --git a/drivers/staging/wlags49_h25/wl_enc.h b/drivers/staging/wlags49_h25/wl_enc.h
new file mode 100644
index 000000000000..f2e860e14be9
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_enc.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_enc.h"
diff --git a/drivers/staging/wlags49_h25/wl_if.h b/drivers/staging/wlags49_h25/wl_if.h
new file mode 100644
index 000000000000..70d86f09f87a
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_if.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_if.h"
diff --git a/drivers/staging/wlags49_h25/wl_internal.h b/drivers/staging/wlags49_h25/wl_internal.h
new file mode 100644
index 000000000000..c1687a3056cd
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_internal.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_internal.h"
diff --git a/drivers/staging/wlags49_h25/wl_main.c b/drivers/staging/wlags49_h25/wl_main.c
new file mode 100644
index 000000000000..d2c06ad8f88a
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_main.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_main.c"
diff --git a/drivers/staging/wlags49_h25/wl_main.h b/drivers/staging/wlags49_h25/wl_main.h
new file mode 100644
index 000000000000..c98376e71957
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_main.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_main.h"
diff --git a/drivers/staging/wlags49_h25/wl_netdev.c b/drivers/staging/wlags49_h25/wl_netdev.c
new file mode 100644
index 000000000000..f7512c3891a8
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_netdev.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_netdev.c"
diff --git a/drivers/staging/wlags49_h25/wl_netdev.h b/drivers/staging/wlags49_h25/wl_netdev.h
new file mode 100644
index 000000000000..519cd5f0461c
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_netdev.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_netdev.h"
diff --git a/drivers/staging/wlags49_h25/wl_priv.c b/drivers/staging/wlags49_h25/wl_priv.c
new file mode 100644
index 000000000000..160c8014051a
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_priv.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_priv.c"
diff --git a/drivers/staging/wlags49_h25/wl_priv.h b/drivers/staging/wlags49_h25/wl_priv.h
new file mode 100644
index 000000000000..28492b362db4
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_priv.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_priv.h"
diff --git a/drivers/staging/wlags49_h25/wl_profile.c b/drivers/staging/wlags49_h25/wl_profile.c
new file mode 100644
index 000000000000..6baa201c132a
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_profile.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_profile.c"
diff --git a/drivers/staging/wlags49_h25/wl_profile.h b/drivers/staging/wlags49_h25/wl_profile.h
new file mode 100644
index 000000000000..5f253a5fb60e
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_profile.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_profile.h"
diff --git a/drivers/staging/wlags49_h25/wl_sysfs.c b/drivers/staging/wlags49_h25/wl_sysfs.c
new file mode 100644
index 000000000000..6458ee63350d
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_sysfs.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_sysfs.c"
diff --git a/drivers/staging/wlags49_h25/wl_sysfs.h b/drivers/staging/wlags49_h25/wl_sysfs.h
new file mode 100644
index 000000000000..eb819a5ef8b5
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_sysfs.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_sysfs.h"
diff --git a/drivers/staging/wlags49_h25/wl_util.c b/drivers/staging/wlags49_h25/wl_util.c
new file mode 100644
index 000000000000..771bebeeac4c
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_util.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_util.c"
diff --git a/drivers/staging/wlags49_h25/wl_util.h b/drivers/staging/wlags49_h25/wl_util.h
new file mode 100644
index 000000000000..ccd74e73a4be
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_util.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_util.h"
diff --git a/drivers/staging/wlags49_h25/wl_version.h b/drivers/staging/wlags49_h25/wl_version.h
new file mode 100644
index 000000000000..ad38e8f7214c
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_version.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_version.h"
diff --git a/drivers/staging/wlags49_h25/wl_wext.c b/drivers/staging/wlags49_h25/wl_wext.c
new file mode 100644
index 000000000000..f660e791b620
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_wext.c
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_wext.c"
diff --git a/drivers/staging/wlags49_h25/wl_wext.h b/drivers/staging/wlags49_h25/wl_wext.h
new file mode 100644
index 000000000000..31d63865c222
--- /dev/null
+++ b/drivers/staging/wlags49_h25/wl_wext.h
@@ -0,0 +1,2 @@
+/* Use common source from wlags49_h2 */
+#include "../wlags49_h2/wl_wext.h"