mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 05:04:02 +02:00
Staging driver updates for 7.3-rc1
Here is the big set of drivers/staging/ updates for 7.3-rc1.
Nothing major in here at all, just lots of tiny coding style cleanups,
refactoring, and minor "fixes" as found by some tools. Included in here
- loads of coding style and refactoring in the rtl8723bs wireless
driver
- minor greybus driver cleanups
- minor sm750fb driver cleanups
- other even smaller driver cleanups
All of these have been in linux-next for a weeks with no reported
issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-----BEGIN PGP SIGNATURE-----
iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCao2kLQ8cZ3JlZ0Brcm9h
aC5jb20ACgkQMUfUDdst+ym5DgCfcNXDT1NW9BrzpktehBbt+2xhtdsAoL/oRN9n
6npdA+zvLcvV6hE3kdta
=3AGF
-----END PGP SIGNATURE-----
Merge tag 'staging-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
Pull staging driver updates from Greg KH:
"Here is the big set of drivers/staging/ updates for 7.3-rc1.
Nothing major in here at all, just lots of tiny coding style cleanups,
refactoring, and minor "fixes" as found by some tools. Included in
here
- loads of coding style and refactoring in the rtl8723bs wireless
driver
- minor greybus driver cleanups
- minor sm750fb driver cleanups
- other even smaller driver cleanups
All of these have been in linux-next for a weeks with no reported
issues"
* tag 'staging-7.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (186 commits)
staging: rtl8723bs: add blank line after declaration
staging: rtl8723bs: remove unused enumerations
staging: rtl8723bs: use !psta instead of comparison to NULL
staging: rtl8723bs: Replace custom RotR1 macro with ror16
staging: rtl8723bs: Remove multiple assignments
staging: rtl8723bs: fix several line spaces in wifi.h
staging: rtl8723bs: remove redundant goto in rtw_free_xmitframe()
staging: rtl8723bs: rename Restore_DM_Func_Flag functions to avoid CamelCase
staging: rtl8723bs: rename Save_DM_Func_Flag functions to avoid CamelCase
staging: rtl8723bs: wrap line over 100 characters
staging: rtl8723bs: remove unnecessary whitespace
staging: rtl8723bs: remove extra blank lines in rtw_qos.h
staging: rtl8723bs: remove redundant ReadChipVersion8723B wrapper
staging: rtl8723bs: remove debug fields from hal_com_data
staging: rtl8723bs: remove 'rf_chip' from struct hal_com_data
staging: rtl8723bs: remove unused spinlock 'SdioTxFIFOFreePageLock'
staging: rtl8723bs: remove unused 'UsbRxHighSpeedMode' from hal_com_data
staging: rtl8723bs: hal: remove unused readings from the chip
staging: rtl8723bs: remove unused 'bNeedIQK' from struct hal_com_data
staging: rtl8723bs: remove unused 'bIQKInitialized ' from hal_com_data
...
This commit is contained in:
commit
29b0977977
|
|
@ -15,7 +15,6 @@
|
|||
#include <linux/wait.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/slab.h>
|
||||
|
|
@ -24,7 +23,6 @@
|
|||
#include <linux/fs.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/poll.h>
|
||||
|
|
@ -114,7 +112,7 @@ static void reset_ip_core(struct axis_fifo *fifo)
|
|||
* operations must be executed atomically, in order and one after the other
|
||||
* without missing any.
|
||||
*
|
||||
* Returns the number of bytes read from the device or negative error code
|
||||
* Return: The number of bytes read from the device or negative error code
|
||||
* on failure.
|
||||
*/
|
||||
static ssize_t axis_fifo_read(struct file *f, char __user *buf,
|
||||
|
|
@ -207,7 +205,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
|
|||
* we need to lock before checking if the device has available space to avoid
|
||||
* any concurrency issue.
|
||||
*
|
||||
* Returns the number of bytes written to the device or negative error code
|
||||
* Return: The number of bytes written to the device or negative error code
|
||||
* on failure.
|
||||
*/
|
||||
static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
|
||||
|
|
@ -246,7 +244,8 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
|
|||
mutex_lock(&fifo->write_lock);
|
||||
|
||||
ret = wait_event_interruptible(fifo->write_queue,
|
||||
ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >= words_to_write);
|
||||
ioread32(fifo->base_addr + XLLF_TDFV_OFFSET) >=
|
||||
words_to_write);
|
||||
if (ret)
|
||||
goto end_unlock;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ static int init_display(struct fbtft_par *par)
|
|||
write_reg(par, 0x001D, 0x0000); /* Regulator current setting */
|
||||
write_reg(par, 0x001E, 0x0009); /* VCOM output setting */
|
||||
write_reg(par, 0x001F, 0x0035); /* VCOM amplitude setting */
|
||||
write_reg(par, 0x0020, 0x0015); /* VCOMM cencter setting */
|
||||
write_reg(par, 0x0020, 0x0015); /* VCOMM center setting */
|
||||
write_reg(par, 0x0018, 0x1E7B); /* DC/DC operation setting */
|
||||
|
||||
/* windows setting */
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ sprintf_gamma(struct fbtft_par *par, u32 *curves, char *buf)
|
|||
mutex_lock(&par->gamma.lock);
|
||||
for (i = 0; i < par->gamma.num_curves; i++) {
|
||||
for (j = 0; j < par->gamma.num_values; j++)
|
||||
len += scnprintf(&buf[len], PAGE_SIZE,
|
||||
len += sysfs_emit_at(buf, len,
|
||||
"%04x ", curves[i * par->gamma.num_values + j]);
|
||||
buf[len - 1] = '\n';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -311,8 +311,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
|
|||
}
|
||||
|
||||
/* parse dai_id from AIF widget's stream_name */
|
||||
ret = sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir);
|
||||
if (ret < 3) {
|
||||
if (sscanf(w->sname, "%s %d %s", intf_name, &dai_id, dir) != 3) {
|
||||
dev_err(codec->dev, "Error while parsing dai_id for %s\n", w->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
|
@ -323,7 +322,7 @@ int gbaudio_module_update(struct gbaudio_codec_info *codec,
|
|||
ret = gbaudio_module_enable_tx(codec, module, dai_id);
|
||||
else
|
||||
ret = gbaudio_module_disable_tx(module, dai_id);
|
||||
} else if (w->id == snd_soc_dapm_aif_out) {
|
||||
} else {
|
||||
if (enable)
|
||||
ret = gbaudio_module_enable_rx(codec, module, dai_id);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -178,8 +178,10 @@ int gbaudio_register_module(struct gbaudio_module_info *module);
|
|||
void gbaudio_unregister_module(struct gbaudio_module_info *module);
|
||||
|
||||
/* protocol related */
|
||||
int gb_audio_gb_get_topology_size(struct gb_connection *connection,
|
||||
size_t *size);
|
||||
int gb_audio_gb_get_topology(struct gb_connection *connection,
|
||||
struct gb_audio_topology **topology);
|
||||
struct gb_audio_topology *topology, size_t size);
|
||||
int gb_audio_gb_get_control(struct gb_connection *connection,
|
||||
u8 control_id, u8 index,
|
||||
struct gb_audio_ctl_elem_value *value);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,10 @@
|
|||
#include <linux/greybus.h>
|
||||
#include "audio_codec.h"
|
||||
|
||||
/* TODO: Split into separate calls */
|
||||
int gb_audio_gb_get_topology(struct gb_connection *connection,
|
||||
struct gb_audio_topology **topology)
|
||||
int gb_audio_gb_get_topology_size(struct gb_connection *connection,
|
||||
size_t *size)
|
||||
{
|
||||
struct gb_audio_get_topology_size_response size_resp;
|
||||
struct gb_audio_topology *topo;
|
||||
u16 size;
|
||||
int ret;
|
||||
|
||||
ret = gb_operation_sync(connection, GB_AUDIO_TYPE_GET_TOPOLOGY_SIZE,
|
||||
|
|
@ -22,25 +19,18 @@ int gb_audio_gb_get_topology(struct gb_connection *connection,
|
|||
if (ret)
|
||||
return ret;
|
||||
|
||||
size = le16_to_cpu(size_resp.size);
|
||||
if (size < sizeof(*topo))
|
||||
return -ENODATA;
|
||||
|
||||
topo = kzalloc(size, GFP_KERNEL);
|
||||
if (!topo)
|
||||
return -ENOMEM;
|
||||
|
||||
ret = gb_operation_sync(connection, GB_AUDIO_TYPE_GET_TOPOLOGY, NULL, 0,
|
||||
topo, size);
|
||||
if (ret) {
|
||||
kfree(topo);
|
||||
return ret;
|
||||
}
|
||||
|
||||
*topology = topo;
|
||||
*size = le16_to_cpu(size_resp.size);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gb_audio_gb_get_topology_size);
|
||||
|
||||
int gb_audio_gb_get_topology(struct gb_connection *connection,
|
||||
struct gb_audio_topology *topology, size_t size)
|
||||
{
|
||||
return gb_operation_sync(connection, GB_AUDIO_TYPE_GET_TOPOLOGY, NULL, 0,
|
||||
topology, size);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(gb_audio_gb_get_topology);
|
||||
|
||||
int gb_audio_gb_get_control(struct gb_connection *connection,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ static ssize_t manager_sysfs_add_store(struct kobject *kobj,
|
|||
desc.name, &desc.vid, &desc.pid, &desc.intf_id,
|
||||
&desc.ip_devices, &desc.op_devices);
|
||||
|
||||
if (num != 7)
|
||||
if (num != 6)
|
||||
return -EINVAL;
|
||||
|
||||
num = gb_audio_manager_add(&desc);
|
||||
|
|
|
|||
|
|
@ -239,6 +239,7 @@ static int gb_audio_probe(struct gb_bundle *bundle,
|
|||
struct gb_audio_manager_module_descriptor desc;
|
||||
struct gbaudio_data_connection *dai, *_dai;
|
||||
int ret, i;
|
||||
size_t size;
|
||||
struct gb_audio_topology *topology;
|
||||
|
||||
/* There should be at least one Management and one Data cport */
|
||||
|
|
@ -304,14 +305,28 @@ static int gb_audio_probe(struct gb_bundle *bundle,
|
|||
}
|
||||
gbmodule->dev_id = gbmodule->mgmt_connection->intf->interface_id;
|
||||
|
||||
/*
|
||||
* FIXME: malloc for topology happens via audio_gb driver
|
||||
* should be done within codec driver itself
|
||||
*/
|
||||
ret = gb_audio_gb_get_topology(gbmodule->mgmt_connection, &topology);
|
||||
ret = gb_audio_gb_get_topology_size(gbmodule->mgmt_connection, &size);
|
||||
if (ret) {
|
||||
dev_err(dev, "%d:Error while fetching topology size\n", ret);
|
||||
goto disable_connection;
|
||||
}
|
||||
|
||||
if (size < sizeof(*topology)) {
|
||||
dev_err(dev, "Invalid topology size: %zu\n", size);
|
||||
ret = -EINVAL;
|
||||
goto disable_connection;
|
||||
}
|
||||
|
||||
topology = kzalloc(size, GFP_KERNEL);
|
||||
if (!topology) {
|
||||
ret = -ENOMEM;
|
||||
goto disable_connection;
|
||||
}
|
||||
|
||||
ret = gb_audio_gb_get_topology(gbmodule->mgmt_connection, topology, size);
|
||||
if (ret) {
|
||||
dev_err(dev, "%d:Error while fetching topology\n", ret);
|
||||
goto disable_connection;
|
||||
goto free_topology;
|
||||
}
|
||||
|
||||
/* process topology data */
|
||||
|
|
|
|||
|
|
@ -15,8 +15,6 @@
|
|||
#include "greybus_authentication.h"
|
||||
#include "firmware.h"
|
||||
|
||||
#define CAP_TIMEOUT_MS 1000
|
||||
|
||||
/*
|
||||
* Number of minor devices this driver supports.
|
||||
* There will be exactly one required per Interface.
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ static int __gb_hid_output_raw_report(struct hid_device *hid, __u8 *buf,
|
|||
if (report_id && ret >= 0)
|
||||
ret++; /* add report_id to the number of transferred bytes */
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int gb_hid_raw_request(struct hid_device *hid, unsigned char reportnum,
|
||||
|
|
|
|||
|
|
@ -167,32 +167,6 @@ static DEVICE_ATTR_RO(name##_avg)
|
|||
gb_loopback_ro_stats_attr(field, max, u); \
|
||||
gb_loopback_ro_avg_attr(field)
|
||||
|
||||
#define gb_loopback_attr(field, type) \
|
||||
static ssize_t field##_show(struct device *dev, \
|
||||
struct device_attribute *attr, \
|
||||
char *buf) \
|
||||
{ \
|
||||
struct gb_loopback *gb = dev_get_drvdata(dev); \
|
||||
return sysfs_emit(buf, "%" #type "\n", gb->field); \
|
||||
} \
|
||||
static ssize_t field##_store(struct device *dev, \
|
||||
struct device_attribute *attr, \
|
||||
const char *buf, \
|
||||
size_t len) \
|
||||
{ \
|
||||
int ret; \
|
||||
struct gb_loopback *gb = dev_get_drvdata(dev); \
|
||||
mutex_lock(&gb->mutex); \
|
||||
ret = sscanf(buf, "%"#type, &gb->field); \
|
||||
if (ret != 1) \
|
||||
len = -EINVAL; \
|
||||
else \
|
||||
gb_loopback_check_attr(gb, bundle); \
|
||||
mutex_unlock(&gb->mutex); \
|
||||
return len; \
|
||||
} \
|
||||
static DEVICE_ATTR_RW(field)
|
||||
|
||||
#define gb_dev_loopback_ro_attr(field) \
|
||||
static ssize_t field##_show(struct device *dev, \
|
||||
struct device_attribute *attr, \
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ static int is_psy_prop_writeable(struct gb_power_supply *gbpsy,
|
|||
|
||||
static int is_prop_valint(enum power_supply_property psp)
|
||||
{
|
||||
return ((psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0);
|
||||
return (psp < POWER_SUPPLY_PROP_MODEL_NAME) ? 1 : 0;
|
||||
}
|
||||
|
||||
static void next_interval(struct gb_power_supply *gbpsy)
|
||||
|
|
@ -423,7 +423,7 @@ static void check_changed(struct gb_power_supply *gbpsy,
|
|||
static int total_props(struct gb_power_supply *gbpsy)
|
||||
{
|
||||
/* this return the intval plus the strval properties */
|
||||
return (gbpsy->properties_count + gbpsy->properties_count_str);
|
||||
return gbpsy->properties_count + gbpsy->properties_count_str;
|
||||
}
|
||||
|
||||
static void prop_append(struct gb_power_supply *gbpsy,
|
||||
|
|
|
|||
|
|
@ -951,7 +951,7 @@ static int gb_tty_init(void)
|
|||
TTY_DRIVER_DYNAMIC_DEV);
|
||||
if (IS_ERR(gb_tty_driver)) {
|
||||
pr_err("Can not allocate tty driver\n");
|
||||
retval = -ENOMEM;
|
||||
retval = PTR_ERR(gb_tty_driver);
|
||||
goto fail_unregister_dev;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ static int gb_vibrator_probe(struct gb_bundle *bundle,
|
|||
dev = device_create(&vibrator_class, &bundle->dev,
|
||||
MKDEV(0, 0), vib, "vibrator%d", vib->minor);
|
||||
if (IS_ERR(dev)) {
|
||||
retval = -EINVAL;
|
||||
retval = PTR_ERR(dev);
|
||||
goto err_ida_remove;
|
||||
}
|
||||
vib->dev = dev;
|
||||
|
|
|
|||
|
|
@ -974,10 +974,9 @@ static int rcar_gen2_enable(struct platform_device *pdev)
|
|||
int ret;
|
||||
|
||||
dev->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(dev->clk)) {
|
||||
dev_err(&pdev->dev, "cannot get clock\n");
|
||||
return PTR_ERR(dev->clk);
|
||||
}
|
||||
if (IS_ERR(dev->clk))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(dev->clk),
|
||||
"cannot get clock\n");
|
||||
|
||||
ret = clk_prepare_enable(dev->clk);
|
||||
if (ret) {
|
||||
|
|
@ -1019,10 +1018,9 @@ static int rcar_gen3_enable(struct platform_device *pdev)
|
|||
int ret;
|
||||
|
||||
dev->clk = devm_clk_get(&pdev->dev, NULL);
|
||||
if (IS_ERR(dev->clk)) {
|
||||
dev_err(&pdev->dev, "cannot get clock\n");
|
||||
return PTR_ERR(dev->clk);
|
||||
}
|
||||
if (IS_ERR(dev->clk))
|
||||
return dev_err_probe(&pdev->dev, PTR_ERR(dev->clk),
|
||||
"cannot get clock\n");
|
||||
|
||||
ret = clk_prepare_enable(dev->clk);
|
||||
if (ret) {
|
||||
|
|
|
|||
|
|
@ -464,18 +464,18 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx,
|
|||
struct most_video_dev *mdev = get_comp_dev(iface, channel_idx);
|
||||
|
||||
if (mdev) {
|
||||
pr_err("Channel already linked\n");
|
||||
dev_err(iface->dev, "Channel already linked\n");
|
||||
return -EEXIST;
|
||||
}
|
||||
|
||||
if (ccfg->direction != MOST_CH_RX) {
|
||||
pr_err("Wrong direction, expected rx\n");
|
||||
dev_err(iface->dev, "Wrong direction, expected rx\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (ccfg->data_type != MOST_CH_SYNC &&
|
||||
ccfg->data_type != MOST_CH_ISOC) {
|
||||
pr_err("Wrong channel type, expected sync or isoc\n");
|
||||
dev_err(iface->dev, "Wrong channel type, expected sync or isoc\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
@ -495,7 +495,7 @@ static int comp_probe_channel(struct most_interface *iface, int channel_idx,
|
|||
strscpy(mdev->v4l2_dev.name, name, sizeof(mdev->v4l2_dev.name));
|
||||
ret = v4l2_device_register(NULL, &mdev->v4l2_dev);
|
||||
if (ret) {
|
||||
pr_err("v4l2_device_register() failed\n");
|
||||
dev_err(iface->dev, "v4l2_device_register() failed\n");
|
||||
kfree(mdev);
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -521,7 +521,7 @@ static int comp_disconnect_channel(struct most_interface *iface,
|
|||
struct most_video_dev *mdev = get_comp_dev(iface, channel_idx);
|
||||
|
||||
if (!mdev) {
|
||||
pr_err("no such channel is linked\n");
|
||||
dev_err(iface->dev, "no such channel is linked\n");
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* NVEC: NVIDIA compliant embedded controller interface
|
||||
*
|
||||
* Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.lauchpad.net>
|
||||
* Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.launchpad.net>
|
||||
*
|
||||
* Authors: Pierre-Hugues Husson <phhusson@free.fr>
|
||||
* Ilya Petrov <ilya.muromec@gmail.com>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
* @NVEC_MSG_RX: The message is an incoming message (from EC)
|
||||
* @NVEC_MSG_TX: The message is an outgoing message (to EC)
|
||||
*/
|
||||
enum nvec_msg_category {
|
||||
enum nvec_msg_category {
|
||||
NVEC_MSG_RX,
|
||||
NVEC_MSG_TX,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -377,7 +377,7 @@ static int nvec_power_probe(struct platform_device *pdev)
|
|||
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
|
||||
struct power_supply_config psy_cfg = {};
|
||||
|
||||
power = devm_kzalloc(&pdev->dev, sizeof(struct nvec_power), GFP_NOWAIT);
|
||||
power = devm_kzalloc(&pdev->dev, sizeof(struct nvec_power), GFP_KERNEL);
|
||||
if (!power)
|
||||
return -ENOMEM;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
* Copyright (c) 2003-2010 Cavium Networks
|
||||
*/
|
||||
|
||||
#include <asm-generic/errno-base.h>
|
||||
#include <linux/dev_printk.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
|
|
@ -445,7 +447,7 @@ void cvm_oct_poll_controller(struct net_device *dev)
|
|||
}
|
||||
#endif
|
||||
|
||||
void cvm_oct_rx_initialize(struct platform_device *pdev)
|
||||
int cvm_oct_rx_initialize(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
struct net_device *dev_for_napi = NULL;
|
||||
|
|
@ -459,8 +461,10 @@ void cvm_oct_rx_initialize(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
if (!dev_for_napi)
|
||||
panic("No net_devices were allocated.");
|
||||
if (!dev_for_napi) {
|
||||
dev_err(&pdev->dev, "No net_devices were allocated.");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(plat->rx_group); i++) {
|
||||
int ret;
|
||||
|
|
@ -479,9 +483,10 @@ void cvm_oct_rx_initialize(struct platform_device *pdev)
|
|||
/* Register an IRQ handler to receive POW interrupts */
|
||||
ret = request_irq(rx_group[i].irq, cvm_oct_do_interrupt, 0,
|
||||
"Ethernet", &rx_group[i].napi);
|
||||
if (ret)
|
||||
panic("Could not acquire Ethernet IRQ %d\n",
|
||||
rx_group[i].irq);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "Could not acquire Ethernet IRQ %d\n", rx_group[i].irq);
|
||||
return ret;
|
||||
}
|
||||
|
||||
disable_irq_nosync(rx_group[i].irq);
|
||||
|
||||
|
|
@ -518,6 +523,7 @@ void cvm_oct_rx_initialize(struct platform_device *pdev)
|
|||
napi_schedule(&rx_group[i].napi);
|
||||
}
|
||||
atomic_inc(&oct_rx_ready);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cvm_oct_rx_shutdown(struct platform_device *pdev)
|
||||
|
|
@ -535,6 +541,8 @@ void cvm_oct_rx_shutdown(struct platform_device *pdev)
|
|||
else
|
||||
cvmx_write_csr(CVMX_POW_WQ_INT_THRX(i), 0);
|
||||
|
||||
napi_disable(&plat->rx_group[i].napi);
|
||||
|
||||
/* Free the interrupt handler */
|
||||
free_irq(plat->rx_group[i].irq, &plat->rx_group[i].napi);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
struct platform_device;
|
||||
|
||||
void cvm_oct_poll_controller(struct net_device *dev);
|
||||
void cvm_oct_rx_initialize(struct platform_device *pdev);
|
||||
int cvm_oct_rx_initialize(struct platform_device *pdev);
|
||||
void cvm_oct_rx_shutdown(struct platform_device *pdev);
|
||||
|
||||
static inline void cvm_oct_rx_refill_pool(struct platform_device *pdev,
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
* Copyright (c) 2003-2010 Cavium Networks
|
||||
*/
|
||||
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/netdevice.h>
|
||||
|
|
@ -649,23 +650,25 @@ static irqreturn_t cvm_oct_tx_cleanup_watchdog(int cpl, void *dev_id)
|
|||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
void cvm_oct_tx_initialize(void)
|
||||
int cvm_oct_tx_initialize(struct platform_device *pdev)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
|
||||
/* Disable the interrupt. */
|
||||
cvmx_write_csr(CVMX_CIU_TIMX(1), 0);
|
||||
/* Register an IRQ handler to receive CIU_TIMX(1) interrupts */
|
||||
i = request_irq(OCTEON_IRQ_TIMER1,
|
||||
cvm_oct_tx_cleanup_watchdog, 0,
|
||||
"Ethernet", cvm_oct_device);
|
||||
|
||||
if (i)
|
||||
panic("Could not acquire Ethernet IRQ %d\n", OCTEON_IRQ_TIMER1);
|
||||
ret = request_irq(OCTEON_IRQ_TIMER1, cvm_oct_tx_cleanup_watchdog, 0,
|
||||
"Ethernet", cvm_oct_device);
|
||||
if (ret)
|
||||
dev_warn(&pdev->dev, "Could not acquire Ethernet IRQ %d\n",
|
||||
OCTEON_IRQ_TIMER1);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void cvm_oct_tx_shutdown(void)
|
||||
{
|
||||
/* Free the interrupt handler */
|
||||
free_irq(OCTEON_IRQ_TIMER1, cvm_oct_device);
|
||||
|
||||
tasklet_kill(&cvm_oct_tx_cleanup_tasklet);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ netdev_tx_t cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev);
|
|||
netdev_tx_t cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev);
|
||||
int cvm_oct_transmit_qos(struct net_device *dev, void *work_queue_entry,
|
||||
int do_free, int qos);
|
||||
void cvm_oct_tx_initialize(void);
|
||||
int cvm_oct_tx_initialize(struct platform_device *pdev);
|
||||
void cvm_oct_tx_shutdown(void);
|
||||
void cvm_oct_tx_shutdown_dev(struct net_device *dev);
|
||||
|
|
|
|||
|
|
@ -104,6 +104,21 @@ struct net_device *cvm_oct_device[TOTAL_NUMBER_OF_PORTS];
|
|||
|
||||
u64 cvm_oct_tx_poll_interval;
|
||||
|
||||
static void cvm_oct_remove_device(int port)
|
||||
{
|
||||
if (cvm_oct_device[port]) {
|
||||
struct net_device *dev = cvm_oct_device[port];
|
||||
struct octeon_ethernet *priv = netdev_priv(dev);
|
||||
|
||||
cancel_delayed_work_sync(&priv->port_periodic_work);
|
||||
|
||||
cvm_oct_tx_shutdown_dev(dev);
|
||||
unregister_netdev(dev);
|
||||
free_netdev(dev);
|
||||
cvm_oct_device[port] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void cvm_oct_rx_refill_worker(struct work_struct *work)
|
||||
{
|
||||
struct octeon_ethernet_platform *plat = container_of(work,
|
||||
|
|
@ -673,6 +688,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
|
|||
{
|
||||
int num_interfaces;
|
||||
int interface;
|
||||
int ret = 0;
|
||||
int fau = FAU_NUM_PACKET_BUFFERS_TO_FREE;
|
||||
int qos;
|
||||
struct device_node *pip;
|
||||
|
|
@ -919,8 +935,13 @@ static int cvm_oct_probe(struct platform_device *pdev)
|
|||
}
|
||||
}
|
||||
|
||||
cvm_oct_tx_initialize();
|
||||
cvm_oct_rx_initialize(pdev);
|
||||
ret = cvm_oct_tx_initialize(pdev);
|
||||
if (ret)
|
||||
goto err_tx;
|
||||
|
||||
ret = cvm_oct_rx_initialize(pdev);
|
||||
if (ret)
|
||||
goto err_rx;
|
||||
|
||||
/*
|
||||
* 150 uS: about 10 1500-byte packets at 1GE.
|
||||
|
|
@ -930,6 +951,32 @@ static int cvm_oct_probe(struct platform_device *pdev)
|
|||
schedule_delayed_work(&plat->rx_refill_work, HZ);
|
||||
|
||||
return 0;
|
||||
|
||||
err_rx:
|
||||
cvm_oct_tx_shutdown();
|
||||
err_tx:
|
||||
cvmx_ipd_disable();
|
||||
|
||||
atomic_inc_return(&cvm_oct_poll_queue_stopping);
|
||||
|
||||
/* Free the ethernet devices */
|
||||
for (int port = 0; port < TOTAL_NUMBER_OF_PORTS; port++)
|
||||
cvm_oct_remove_device(port);
|
||||
|
||||
cvmx_pko_shutdown();
|
||||
|
||||
cvmx_ipd_free_ptr();
|
||||
|
||||
/* Free the HW pools */
|
||||
cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_PACKET_POOL, CVMX_FPA_PACKET_POOL_SIZE,
|
||||
num_packet_buffers);
|
||||
cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_WQE_POOL, CVMX_FPA_WQE_POOL_SIZE,
|
||||
num_packet_buffers);
|
||||
if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
|
||||
cvm_oct_mem_empty_fpa(pdev, CVMX_FPA_OUTPUT_BUFFER_POOL,
|
||||
CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void cvm_oct_remove(struct platform_device *pdev)
|
||||
|
|
@ -948,19 +995,8 @@ static void cvm_oct_remove(struct platform_device *pdev)
|
|||
cvmx_pko_disable();
|
||||
|
||||
/* Free the ethernet devices */
|
||||
for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) {
|
||||
if (cvm_oct_device[port]) {
|
||||
struct net_device *dev = cvm_oct_device[port];
|
||||
struct octeon_ethernet *priv = netdev_priv(dev);
|
||||
|
||||
cancel_delayed_work_sync(&priv->port_periodic_work);
|
||||
|
||||
cvm_oct_tx_shutdown_dev(dev);
|
||||
unregister_netdev(dev);
|
||||
free_netdev(dev);
|
||||
cvm_oct_device[port] = NULL;
|
||||
}
|
||||
}
|
||||
for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++)
|
||||
cvm_oct_remove_device(port);
|
||||
|
||||
cvmx_pko_shutdown();
|
||||
|
||||
|
|
|
|||
|
|
@ -232,7 +232,7 @@ void expire_timeout_chk(struct adapter *padapter)
|
|||
|
||||
/* to update bcn with tim_bitmap for this station */
|
||||
pstapriv->tim_bitmap |= BIT(psta->aid);
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
|
||||
if (!pmlmeext->active_keep_alive_check)
|
||||
continue;
|
||||
|
|
@ -447,7 +447,7 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
|
|||
/* ap mode */
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true);
|
||||
|
||||
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
if (psecuritypriv->dot11_auth_algrthm == dot11_auth_algrthm_8021x)
|
||||
psta->ieee8021x_blocked = true;
|
||||
else
|
||||
psta->ieee8021x_blocked = false;
|
||||
|
|
@ -651,8 +651,8 @@ void start_bss_network(struct adapter *padapter)
|
|||
if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */
|
||||
|
||||
/* WEP Key will be set before this function, do not clear CAM. */
|
||||
if ((psecuritypriv->dot11PrivacyAlgrthm != _WEP40_) &&
|
||||
(psecuritypriv->dot11PrivacyAlgrthm != _WEP104_))
|
||||
if ((psecuritypriv->dot11_privacy_algrthm != _WEP40_) &&
|
||||
(psecuritypriv->dot11_privacy_algrthm != _WEP104_))
|
||||
flush_all_cam_entry(padapter); /* clear CAM */
|
||||
}
|
||||
|
||||
|
|
@ -673,18 +673,16 @@ void start_bss_network(struct adapter *padapter)
|
|||
rtw_hal_set_hwreg(padapter, HW_VAR_AC_PARAM_BK, (u8 *)(&acparm));
|
||||
|
||||
/* Set Security */
|
||||
val8 = (psecuritypriv->dot11AuthAlgrthm ==
|
||||
dot11AuthAlgrthm_8021X) ? 0xcc : 0xcf;
|
||||
val8 = (psecuritypriv->dot11_auth_algrthm ==
|
||||
dot11_auth_algrthm_8021x) ? 0xcc : 0xcf;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
|
||||
/* Beacon Control related register */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BEACON_INTERVAL, (u8 *)(&bcn_interval));
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK, NULL);
|
||||
|
||||
if (!pmlmepriv->cur_network.join_res) { /* setting only at first time */
|
||||
/* turn on all dynamic functions */
|
||||
Switch_DM_Func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||
switch_dm_func(padapter, DYNAMIC_ALL_FUNC_ENABLE, true);
|
||||
}
|
||||
|
||||
/* set channel, bwmode */
|
||||
|
|
@ -739,7 +737,7 @@ void start_bss_network(struct adapter *padapter)
|
|||
rtw_get_capability((struct wlan_bssid_ex *)pnetwork));
|
||||
|
||||
if (pmlmeext->bstart_bss) {
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
|
||||
/* issue beacon frame */
|
||||
send_beacon(padapter);
|
||||
|
|
@ -782,7 +780,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
memcpy(ie, pbuf, pbss_network->ie_length);
|
||||
|
||||
if (pbss_network->infrastructure_mode != Ndis802_11APMode)
|
||||
if (pbss_network->infrastructure_mode != NL80211_IFTYPE_AP)
|
||||
return _FAIL;
|
||||
|
||||
pbss_network->rssi = 0;
|
||||
|
|
@ -872,7 +870,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
&group_cipher,
|
||||
&pairwise_cipher,
|
||||
NULL) == _SUCCESS) {
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
|
||||
psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */
|
||||
psecuritypriv->wpa_psk |= BIT(1);
|
||||
|
|
@ -898,7 +896,7 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
&group_cipher,
|
||||
&pairwise_cipher,
|
||||
NULL) == _SUCCESS) {
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
|
||||
psecuritypriv->dot8021xalg = 1;/* psk, todo:802.1x */
|
||||
|
||||
|
|
@ -1009,21 +1007,6 @@ int rtw_check_beacon_data(struct adapter *padapter, u8 *pbuf, int len)
|
|||
if (p && ie_len > 0)
|
||||
ht_info_ie = p;
|
||||
|
||||
switch (network_type) {
|
||||
case WIRELESS_11B:
|
||||
pbss_network->network_type_in_use = Ndis802_11DS;
|
||||
break;
|
||||
case WIRELESS_11G:
|
||||
case WIRELESS_11BG:
|
||||
case WIRELESS_11G_24N:
|
||||
case WIRELESS_11BG_24N:
|
||||
pbss_network->network_type_in_use = Ndis802_11OFDM24;
|
||||
break;
|
||||
default:
|
||||
pbss_network->network_type_in_use = Ndis802_11OFDM24;
|
||||
break;
|
||||
}
|
||||
|
||||
pmlmepriv->cur_network.network_type = network_type;
|
||||
|
||||
pmlmepriv->htpriv.ht_option = false;
|
||||
|
|
@ -1180,7 +1163,7 @@ u8 rtw_ap_set_pairwise_key(struct adapter *padapter, struct sta_info *psta)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, SET_STA_KEY_CMD);
|
||||
|
||||
psetstakey_para->algorithm = (u8)psta->dot118021XPrivacy;
|
||||
|
||||
|
|
@ -1243,7 +1226,7 @@ static int rtw_ap_set_key(struct adapter *padapter,
|
|||
|
||||
memcpy(&psetkeyparm->key[0], key, keylen);
|
||||
|
||||
pcmd->cmdcode = _SetKey_CMD_;
|
||||
pcmd->cmdcode = SET_KEY_CMD;
|
||||
pcmd->parmbuf = (u8 *)psetkeyparm;
|
||||
pcmd->cmdsz = (sizeof(struct setkey_parm));
|
||||
pcmd->rsp = NULL;
|
||||
|
|
@ -1307,20 +1290,21 @@ static void update_bcn_erpinfo_ie(struct adapter *padapter)
|
|||
&len,
|
||||
(pnetwork->ie_length - _BEACON_IE_OFFSET_));
|
||||
if (p && len > 0) {
|
||||
struct ndis_80211_var_ie *ie = (struct ndis_80211_var_ie *)p;
|
||||
struct ndis_80211_var_ie *erp_ie = (struct ndis_80211_var_ie *)p;
|
||||
|
||||
if (pmlmepriv->num_sta_non_erp == 1)
|
||||
ie->data[0] |= RTW_ERP_INFO_NON_ERP_PRESENT | RTW_ERP_INFO_USE_PROTECTION;
|
||||
erp_ie->data[0] |= RTW_ERP_INFO_NON_ERP_PRESENT |
|
||||
RTW_ERP_INFO_USE_PROTECTION;
|
||||
else
|
||||
ie->data[0] &= ~(RTW_ERP_INFO_NON_ERP_PRESENT |
|
||||
RTW_ERP_INFO_USE_PROTECTION);
|
||||
erp_ie->data[0] &= ~(RTW_ERP_INFO_NON_ERP_PRESENT |
|
||||
RTW_ERP_INFO_USE_PROTECTION);
|
||||
|
||||
if (pmlmepriv->num_sta_no_short_preamble > 0)
|
||||
ie->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
|
||||
erp_ie->data[0] |= RTW_ERP_INFO_BARKER_PREAMBLE_MODE;
|
||||
else
|
||||
ie->data[0] &= ~(RTW_ERP_INFO_BARKER_PREAMBLE_MODE);
|
||||
erp_ie->data[0] &= ~(RTW_ERP_INFO_BARKER_PREAMBLE_MODE);
|
||||
|
||||
ERP_IE_handler(padapter, ie);
|
||||
ERP_IE_handler(padapter, erp_ie);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1336,85 +1320,7 @@ static void update_bcn_rsn_ie(struct adapter *padapter)
|
|||
{
|
||||
}
|
||||
|
||||
static void update_bcn_wpa_ie(struct adapter *padapter)
|
||||
{
|
||||
}
|
||||
|
||||
static void update_bcn_wmm_ie(struct adapter *padapter)
|
||||
{
|
||||
}
|
||||
|
||||
static void update_bcn_wps_ie(struct adapter *padapter)
|
||||
{
|
||||
u8 *pwps_ie = NULL;
|
||||
u8 *pwps_ie_src;
|
||||
u8 *premainder_ie;
|
||||
u8 *pbackup_remainder_ie = NULL;
|
||||
|
||||
unsigned int wps_ielen = 0, wps_offset, remainder_ielen;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct wlan_bssid_ex *pnetwork = &pmlmeinfo->network;
|
||||
unsigned char *ie = pnetwork->ies;
|
||||
u32 ielen = pnetwork->ie_length;
|
||||
|
||||
pwps_ie = rtw_get_wps_ie(ie + _FIXED_IE_LENGTH_,
|
||||
ielen - _FIXED_IE_LENGTH_,
|
||||
NULL,
|
||||
&wps_ielen);
|
||||
|
||||
if (!pwps_ie || wps_ielen == 0)
|
||||
return;
|
||||
|
||||
pwps_ie_src = pmlmepriv->wps_beacon_ie;
|
||||
if (!pwps_ie_src)
|
||||
return;
|
||||
|
||||
wps_offset = (unsigned int)(pwps_ie - ie);
|
||||
|
||||
premainder_ie = pwps_ie + wps_ielen;
|
||||
|
||||
remainder_ielen = ielen - wps_offset - wps_ielen;
|
||||
|
||||
if (remainder_ielen)
|
||||
pbackup_remainder_ie = kmemdup(premainder_ie, remainder_ielen, GFP_ATOMIC);
|
||||
|
||||
wps_ielen = (unsigned int)pwps_ie_src[1];/* to get ie data len */
|
||||
if ((wps_offset + wps_ielen + 2 + remainder_ielen) <= MAX_IE_SZ) {
|
||||
memcpy(pwps_ie, pwps_ie_src, wps_ielen + 2);
|
||||
pwps_ie += (wps_ielen + 2);
|
||||
|
||||
if (pbackup_remainder_ie)
|
||||
memcpy(pwps_ie, pbackup_remainder_ie, remainder_ielen);
|
||||
|
||||
/* update ie_length */
|
||||
pnetwork->ie_length = wps_offset + (wps_ielen + 2) + remainder_ielen;
|
||||
}
|
||||
|
||||
kfree(pbackup_remainder_ie);
|
||||
}
|
||||
|
||||
static void update_bcn_p2p_ie(struct adapter *padapter)
|
||||
{
|
||||
}
|
||||
|
||||
static void update_bcn_vendor_spec_ie(struct adapter *padapter, u8 *oui)
|
||||
{
|
||||
if (!memcmp(RTW_WPA_OUI, oui, 4))
|
||||
update_bcn_wpa_ie(padapter);
|
||||
|
||||
else if (!memcmp(WMM_OUI, oui, 4))
|
||||
update_bcn_wmm_ie(padapter);
|
||||
|
||||
else if (!memcmp(WPS_OUI, oui, 4))
|
||||
update_bcn_wps_ie(padapter);
|
||||
|
||||
else if (!memcmp(P2P_OUI, oui, 4))
|
||||
update_bcn_p2p_ie(padapter);
|
||||
}
|
||||
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id, u8 tx)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext;
|
||||
|
|
@ -1467,12 +1373,6 @@ void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx)
|
|||
|
||||
break;
|
||||
|
||||
case WLAN_EID_VENDOR_SPECIFIC:
|
||||
|
||||
update_bcn_vendor_spec_ie(padapter, oui);
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -1597,7 +1497,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_preamble == 1)) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1609,7 +1509,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_preamble == 0)) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1622,7 +1522,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
if (pmlmepriv->num_sta_non_erp == 1) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1633,7 +1533,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
|
||||
if (pmlmepriv->num_sta_non_erp == 0) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1647,7 +1547,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_slot_time == 1)) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1659,7 +1559,7 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_slot_time == 0)) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1694,8 +1594,8 @@ void bss_cap_update_on_sta_join(struct adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
|
||||
if (rtw_ht_operation_update(padapter) > 0) {
|
||||
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
|
||||
update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, false);
|
||||
update_beacon(padapter, WLAN_EID_HT_OPERATION, true);
|
||||
}
|
||||
|
||||
/* update associated stations cap. */
|
||||
|
|
@ -1717,7 +1617,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
|
||||
pmlmepriv->num_sta_no_short_preamble == 0){
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1726,7 +1626,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
pmlmepriv->num_sta_non_erp--;
|
||||
if (pmlmepriv->num_sta_non_erp == 0) {
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_ERP_INFO, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1736,7 +1636,7 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
if (pmlmeext->cur_wireless_mode > WIRELESS_11B &&
|
||||
pmlmepriv->num_sta_no_short_slot_time == 0){
|
||||
beacon_updated = true;
|
||||
update_beacon(padapter, 0xFF, NULL, true);
|
||||
update_beacon(padapter, 0xFF, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1756,8 +1656,8 @@ u8 bss_cap_update_on_sta_leave(struct adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
|
||||
if (rtw_ht_operation_update(padapter) > 0) {
|
||||
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, NULL, false);
|
||||
update_beacon(padapter, WLAN_EID_HT_OPERATION, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_HT_CAPABILITY, false);
|
||||
update_beacon(padapter, WLAN_EID_HT_OPERATION, true);
|
||||
}
|
||||
|
||||
return beacon_updated;
|
||||
|
|
@ -1889,7 +1789,7 @@ void rtw_ap_restore_network(struct adapter *padapter)
|
|||
char chk_alive_list[NUM_STA];
|
||||
int i;
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11APMode, false);
|
||||
rtw_setopmode_cmd(padapter, NL80211_IFTYPE_AP, false);
|
||||
|
||||
set_channel_bwmode(padapter,
|
||||
pmlmeext->cur_channel,
|
||||
|
|
@ -1898,8 +1798,8 @@ void rtw_ap_restore_network(struct adapter *padapter)
|
|||
|
||||
start_bss_network(padapter);
|
||||
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
|
||||
if ((padapter->securitypriv.dot11_privacy_algrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11_privacy_algrthm == _AES_)) {
|
||||
/* restore group key, WEP keys is restored in ips_leave() */
|
||||
rtw_set_key(padapter,
|
||||
psecuritypriv,
|
||||
|
|
@ -1931,11 +1831,11 @@ void rtw_ap_restore_network(struct adapter *padapter)
|
|||
|
||||
if (psta->state & _FW_LINKED) {
|
||||
rtw_sta_media_status_rpt(padapter, psta, 1);
|
||||
Update_RA_Entry(padapter, psta);
|
||||
update_ra_entry(padapter, psta);
|
||||
/* pairwise key */
|
||||
/* per sta pairwise key and settings */
|
||||
if ((psecuritypriv->dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(psecuritypriv->dot11PrivacyAlgrthm == _AES_)) {
|
||||
if ((psecuritypriv->dot11_privacy_algrthm == _TKIP_) ||
|
||||
(psecuritypriv->dot11_privacy_algrthm == _AES_)) {
|
||||
rtw_setstakey_cmd(padapter, psta, true, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,78 +11,78 @@
|
|||
#include <linux/delay.h>
|
||||
|
||||
static struct _cmd_callback rtw_cmd_callback[] = {
|
||||
{GEN_CMD_CODE(_Read_MACREG), NULL}, /*0*/
|
||||
{GEN_CMD_CODE(_Write_MACREG), NULL},
|
||||
{GEN_CMD_CODE(_Read_BBREG), &rtw_getbbrfreg_cmdrsp_callback},
|
||||
{GEN_CMD_CODE(_Write_BBREG), NULL},
|
||||
{GEN_CMD_CODE(_Read_RFREG), &rtw_getbbrfreg_cmdrsp_callback},
|
||||
{GEN_CMD_CODE(_Write_RFREG), NULL}, /*5*/
|
||||
{GEN_CMD_CODE(_Read_EEPROM), NULL},
|
||||
{GEN_CMD_CODE(_Write_EEPROM), NULL},
|
||||
{GEN_CMD_CODE(_Read_EFUSE), NULL},
|
||||
{GEN_CMD_CODE(_Write_EFUSE), NULL},
|
||||
{READ_MACREG_CMD, NULL}, /*0*/
|
||||
{WRITE_MACREG_CMD, NULL},
|
||||
{READ_BBREG_CMD, &rtw_getbbrfreg_cmdrsp_callback},
|
||||
{WRITE_BBREG_CMD, NULL},
|
||||
{READ_RFREG_CMD, &rtw_getbbrfreg_cmdrsp_callback},
|
||||
{WRITE_RFREG_CMD, NULL}, /*5*/
|
||||
{READ_EEPROM_CMD, NULL},
|
||||
{WRITE_EEPROM_CMD, NULL},
|
||||
{READ_EFUSE_CMD, NULL},
|
||||
{WRITE_EFUSE_CMD, NULL},
|
||||
|
||||
{GEN_CMD_CODE(_Read_CAM), NULL}, /*10*/
|
||||
{GEN_CMD_CODE(_Write_CAM), NULL},
|
||||
{GEN_CMD_CODE(_setBCNITV), NULL},
|
||||
{GEN_CMD_CODE(_setMBIDCFG), NULL},
|
||||
{GEN_CMD_CODE(_JoinBss), &rtw_joinbss_cmd_callback}, /*14*/
|
||||
{GEN_CMD_CODE(_DisConnect), &rtw_disassoc_cmd_callback}, /*15*/
|
||||
{GEN_CMD_CODE(_CreateBss), &rtw_createbss_cmd_callback},
|
||||
{GEN_CMD_CODE(_SetOpMode), NULL},
|
||||
{GEN_CMD_CODE(_SiteSurvey), &rtw_survey_cmd_callback}, /*18*/
|
||||
{GEN_CMD_CODE(_SetAuth), NULL},
|
||||
{READ_CAM_CMD, NULL}, /*10*/
|
||||
{WRITE_CAM_CMD, NULL},
|
||||
{SET_BCNITV_CMD, NULL},
|
||||
{SET_MBIDCFG_CMD, NULL},
|
||||
{JOIN_BSS_CMD, &rtw_joinbss_cmd_callback}, /*14*/
|
||||
{DISCONNECT_CMD, &rtw_disassoc_cmd_callback}, /*15*/
|
||||
{CREATE_BSS_CMD, &rtw_createbss_cmd_callback},
|
||||
{SET_OP_MODE_CMD, NULL},
|
||||
{SITE_SURVEY_CMD, &rtw_survey_cmd_callback}, /*18*/
|
||||
{SET_AUTH_CMD, NULL},
|
||||
|
||||
{GEN_CMD_CODE(_SetKey), NULL}, /*20*/
|
||||
{GEN_CMD_CODE(_SetStaKey), &rtw_setstaKey_cmdrsp_callback},
|
||||
{GEN_CMD_CODE(_SetAssocSta), &rtw_setassocsta_cmdrsp_callback},
|
||||
{GEN_CMD_CODE(_DelAssocSta), NULL},
|
||||
{GEN_CMD_CODE(_SetStaPwrState), NULL},
|
||||
{GEN_CMD_CODE(_SetBasicRate), NULL}, /*25*/
|
||||
{GEN_CMD_CODE(_GetBasicRate), NULL},
|
||||
{GEN_CMD_CODE(_SetDataRate), NULL},
|
||||
{GEN_CMD_CODE(_GetDataRate), NULL},
|
||||
{GEN_CMD_CODE(_SetPhyInfo), NULL},
|
||||
{SET_KEY_CMD, NULL}, /*20*/
|
||||
{SET_STA_KEY_CMD, &rtw_setstaKey_cmdrsp_callback},
|
||||
{SET_ASSOC_STA_CMD, &rtw_setassocsta_cmdrsp_callback},
|
||||
{DEL_ASSOC_STA_CMD, NULL},
|
||||
{SET_STA_PWR_STATE_CMD, NULL},
|
||||
{SET_BASIC_RATE_CMD, NULL}, /*25*/
|
||||
{GET_BASIC_RATE_CMD, NULL},
|
||||
{SET_DATA_RATE_CMD, NULL},
|
||||
{GET_DATA_RATE_CMD, NULL},
|
||||
{SET_PHY_INFO_CMD, NULL},
|
||||
|
||||
{GEN_CMD_CODE(_GetPhyInfo), NULL}, /*30*/
|
||||
{GEN_CMD_CODE(_SetPhy), NULL},
|
||||
{GEN_CMD_CODE(_GetPhy), NULL},
|
||||
{GEN_CMD_CODE(_readRssi), NULL},
|
||||
{GEN_CMD_CODE(_readGain), NULL},
|
||||
{GEN_CMD_CODE(_SetAtim), NULL}, /*35*/
|
||||
{GEN_CMD_CODE(_SetPwrMode), NULL},
|
||||
{GEN_CMD_CODE(_JoinbssRpt), NULL},
|
||||
{GEN_CMD_CODE(_SetRaTable), NULL},
|
||||
{GEN_CMD_CODE(_GetRaTable), NULL},
|
||||
{GET_PHY_INFO_CMD, NULL}, /*30*/
|
||||
{SET_PHY_CMD, NULL},
|
||||
{GET_PHY_CMD, NULL},
|
||||
{READ_RSSI_CMD, NULL},
|
||||
{READ_GAIN_CMD, NULL},
|
||||
{SET_ATIM_CMD, NULL}, /*35*/
|
||||
{SET_PWR_MODE_CMD, NULL},
|
||||
{JOIN_BSS_RPT_CMD, NULL},
|
||||
{SET_RA_TABLE_CMD, NULL},
|
||||
{GET_RA_TABLE_CMD, NULL},
|
||||
|
||||
{GEN_CMD_CODE(_GetCCXReport), NULL}, /*40*/
|
||||
{GEN_CMD_CODE(_GetDTMReport), NULL},
|
||||
{GEN_CMD_CODE(_GetTXRateStatistics), NULL},
|
||||
{GEN_CMD_CODE(_SetUsbSuspend), NULL},
|
||||
{GEN_CMD_CODE(_SetH2cLbk), NULL},
|
||||
{GEN_CMD_CODE(_AddBAReq), NULL}, /*45*/
|
||||
{GEN_CMD_CODE(_SetChannel), NULL}, /*46*/
|
||||
{GEN_CMD_CODE(_SetTxPower), NULL},
|
||||
{GEN_CMD_CODE(_SwitchAntenna), NULL},
|
||||
{GEN_CMD_CODE(_SetCrystalCap), NULL},
|
||||
{GEN_CMD_CODE(_SetSingleCarrierTx), NULL}, /*50*/
|
||||
{GET_CCX_REPORT_CMD, NULL}, /*40*/
|
||||
{GET_DTM_REPORT_CMD, NULL},
|
||||
{GET_TX_RATE_STATISTICS_CMD, NULL},
|
||||
{SET_USB_SUSPEND_CMD, NULL},
|
||||
{SET_H2C_LBK_CMD, NULL},
|
||||
{ADD_BA_REQ_CMD, NULL}, /*45*/
|
||||
{SET_CHANNEL_CMD, NULL}, /*46*/
|
||||
{SET_TX_POWER_CMD, NULL},
|
||||
{SWITCH_ANTENNA_CMD, NULL},
|
||||
{SET_CRYSTAL_CAP_CMD, NULL},
|
||||
{SET_SINGLE_CARRIER_TX_CMD, NULL}, /*50*/
|
||||
|
||||
{GEN_CMD_CODE(_SetSingleToneTx), NULL}, /*51*/
|
||||
{GEN_CMD_CODE(_SetCarrierSuppressionTx), NULL},
|
||||
{GEN_CMD_CODE(_SetContinuousTx), NULL},
|
||||
{GEN_CMD_CODE(_SwitchBandwidth), NULL}, /*54*/
|
||||
{GEN_CMD_CODE(_TX_Beacon), NULL},/*55*/
|
||||
{SET_SINGLE_TONE_TX_CMD, NULL}, /*51*/
|
||||
{SET_CARRIER_SUPPRESSION_TX_CMD, NULL},
|
||||
{SET_CONTINUOUS_TX_CMD, NULL},
|
||||
{SWITCH_BANDWIDTH_CMD, NULL}, /*54*/
|
||||
{TX_BEACON_CMD, NULL},/*55*/
|
||||
|
||||
{GEN_CMD_CODE(_Set_MLME_EVT), NULL},/*56*/
|
||||
{GEN_CMD_CODE(_Set_Drv_Extra), NULL},/*57*/
|
||||
{GEN_CMD_CODE(_Set_H2C_MSG), NULL},/*58*/
|
||||
{GEN_CMD_CODE(_SetChannelPlan), NULL},/*59*/
|
||||
{SET_MLME_EVT_CMD, NULL},/*56*/
|
||||
{SET_DRV_EXTRA_CMD, NULL},/*57*/
|
||||
{SET_H2C_MSG_CMD, NULL},/*58*/
|
||||
{SET_CHANNEL_PLAN_CMD, NULL},/*59*/
|
||||
|
||||
{GEN_CMD_CODE(_SetChannelSwitch), NULL},/*60*/
|
||||
{GEN_CMD_CODE(_TDLS), NULL},/*61*/
|
||||
{GEN_CMD_CODE(_ChkBMCSleepq), NULL}, /*62*/
|
||||
{SET_CHANNEL_SWITCH_CMD, NULL},/*60*/
|
||||
{TDLS_CMD, NULL},/*61*/
|
||||
{CHK_BMC_SLEEPQ_CMD, NULL}, /*62*/
|
||||
|
||||
{GEN_CMD_CODE(_RunInThreadCMD), NULL},/*63*/
|
||||
{RUN_IN_THREAD_CMD, NULL},/*63*/
|
||||
};
|
||||
|
||||
static struct cmd_hdl wlancmds[] = {
|
||||
|
|
@ -178,15 +178,12 @@ int rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
|||
|
||||
pcmdpriv->cmd_buf = PTR_ALIGN(pcmdpriv->cmd_allocated_buf, CMDBUFF_ALIGN_SZ);
|
||||
|
||||
pcmdpriv->rsp_allocated_buf = kzalloc(MAX_RSPSZ + 4, GFP_ATOMIC);
|
||||
if (!pcmdpriv->rsp_allocated_buf) {
|
||||
pcmdpriv->rsp_buf = kzalloc(MAX_RSPSZ, GFP_ATOMIC);
|
||||
if (!pcmdpriv->rsp_buf) {
|
||||
kfree(pcmdpriv->cmd_allocated_buf);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 -
|
||||
((SIZE_PTR)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
|
||||
pcmdpriv->cmd_issued_cnt = 0;
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
|
|
@ -232,7 +229,7 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
|
|||
if (pcmdpriv) {
|
||||
kfree(pcmdpriv->cmd_allocated_buf);
|
||||
|
||||
kfree(pcmdpriv->rsp_allocated_buf);
|
||||
kfree(pcmdpriv->rsp_buf);
|
||||
|
||||
mutex_destroy(&pcmdpriv->sctx_mutex);
|
||||
}
|
||||
|
|
@ -299,12 +296,12 @@ void rtw_free_cmd_priv(struct cmd_priv *pcmdpriv)
|
|||
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj);
|
||||
int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj)
|
||||
{
|
||||
u8 bAllow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
|
||||
bool allow = false; /* set to true to allow enqueuing cmd when hw_init_completed is false */
|
||||
|
||||
if (cmd_obj->cmdcode == GEN_CMD_CODE(_SetChannelPlan))
|
||||
bAllow = true;
|
||||
if (cmd_obj->cmdcode == SET_CHANNEL_PLAN_CMD)
|
||||
allow = true;
|
||||
|
||||
if ((!pcmdpriv->padapter->hw_init_completed && !bAllow) ||
|
||||
if ((!pcmdpriv->padapter->hw_init_completed && !allow) ||
|
||||
!atomic_read(&pcmdpriv->cmdthd_running)) /* com_thread not running */
|
||||
return _FAIL;
|
||||
|
||||
|
|
@ -344,8 +341,8 @@ struct cmd_obj *rtw_dequeue_cmd(struct cmd_priv *pcmdpriv)
|
|||
|
||||
void rtw_free_cmd_obj(struct cmd_obj *pcmd)
|
||||
{
|
||||
if ((pcmd->cmdcode != _JoinBss_CMD_) &&
|
||||
(pcmd->cmdcode != _CreateBss_CMD_)) {
|
||||
if ((pcmd->cmdcode != JOIN_BSS_CMD) &&
|
||||
(pcmd->cmdcode != CREATE_BSS_CMD)) {
|
||||
/* free parmbuf in cmd_obj */
|
||||
kfree(pcmd->parmbuf);
|
||||
}
|
||||
|
|
@ -399,10 +396,10 @@ int rtw_cmd_thread(void *context)
|
|||
break;
|
||||
}
|
||||
|
||||
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
|
||||
if (padapter->driver_stopped || padapter->bSurpriseRemoved) {
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
|
||||
__func__, padapter->bDriverStopped,
|
||||
__func__, padapter->driver_stopped,
|
||||
padapter->bSurpriseRemoved, __LINE__);
|
||||
break;
|
||||
}
|
||||
|
|
@ -422,10 +419,10 @@ int rtw_cmd_thread(void *context)
|
|||
continue;
|
||||
|
||||
_next:
|
||||
if (padapter->bDriverStopped || padapter->bSurpriseRemoved) {
|
||||
if (padapter->driver_stopped || padapter->bSurpriseRemoved) {
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
|
||||
__func__, padapter->bDriverStopped,
|
||||
__func__, padapter->driver_stopped,
|
||||
padapter->bSurpriseRemoved, __LINE__);
|
||||
break;
|
||||
}
|
||||
|
|
@ -502,7 +499,7 @@ int rtw_cmd_thread(void *context)
|
|||
break;
|
||||
}
|
||||
|
||||
if (pcmd->cmdcode == GEN_CMD_CODE(_Set_Drv_Extra)) {
|
||||
if (pcmd->cmdcode == SET_DRV_EXTRA_CMD) {
|
||||
extra_parm = (struct drvextra_cmd_parm *)pcmd->parmbuf;
|
||||
if (extra_parm->pbuf && extra_parm->size > 0)
|
||||
kfree(extra_parm->pbuf);
|
||||
|
|
@ -528,7 +525,7 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
|||
{
|
||||
u8 res = _FAIL;
|
||||
struct cmd_obj *ph2c;
|
||||
struct sitesurvey_parm *psurveyPara;
|
||||
struct sitesurvey_parm *survey_para;
|
||||
struct cmd_priv *pcmdpriv = &padapter->cmdpriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
|
|
@ -539,18 +536,18 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
|||
if (!ph2c)
|
||||
return _FAIL;
|
||||
|
||||
psurveyPara = kzalloc_obj(*psurveyPara, GFP_ATOMIC);
|
||||
if (!psurveyPara) {
|
||||
survey_para = kzalloc_obj(*survey_para, GFP_ATOMIC);
|
||||
if (!survey_para) {
|
||||
kfree(ph2c);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
rtw_free_network_queue(padapter, false);
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psurveyPara, GEN_CMD_CODE(_SiteSurvey));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, survey_para, SITE_SURVEY_CMD);
|
||||
|
||||
/* psurveyPara->bsslimit = 48; */
|
||||
psurveyPara->scan_mode = pmlmepriv->scan_mode;
|
||||
survey_para->scan_mode = pmlmepriv->scan_mode;
|
||||
|
||||
/* prepare ssid list */
|
||||
if (ssid) {
|
||||
|
|
@ -558,8 +555,8 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
|||
|
||||
for (i = 0; i < ssid_num && i < RTW_SSID_SCAN_AMOUNT; i++) {
|
||||
if (ssid[i].ssid_length) {
|
||||
memcpy(&psurveyPara->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
|
||||
psurveyPara->ssid_num++;
|
||||
memcpy(&survey_para->ssid[i], &ssid[i], sizeof(struct ndis_802_11_ssid));
|
||||
survey_para->ssid_num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -570,8 +567,8 @@ u8 rtw_sitesurvey_cmd(struct adapter *padapter, struct ndis_802_11_ssid *ssid,
|
|||
|
||||
for (i = 0; i < ch_num && i < RTW_CHANNEL_SCAN_AMOUNT; i++) {
|
||||
if (ch[i].hw_value && !(ch[i].flags & RTW_IEEE80211_CHAN_DISABLED)) {
|
||||
memcpy(&psurveyPara->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
||||
psurveyPara->ch_num++;
|
||||
memcpy(&survey_para->ch[i], &ch[i], sizeof(struct rtw_ieee80211_channel));
|
||||
survey_para->ch_num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -610,7 +607,7 @@ u8 rtw_createbss_cmd(struct adapter *padapter)
|
|||
}
|
||||
|
||||
INIT_LIST_HEAD(&pcmd->list);
|
||||
pcmd->cmdcode = _CreateBss_CMD_;
|
||||
pcmd->cmdcode = CREATE_BSS_CMD;
|
||||
pcmd->parmbuf = (unsigned char *)pdev_network;
|
||||
pcmd->cmdsz = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
|
||||
pcmd->rsp = NULL;
|
||||
|
|
@ -643,7 +640,7 @@ int rtw_startbss_cmd(struct adapter *padapter, int flags)
|
|||
}
|
||||
|
||||
INIT_LIST_HEAD(&pcmd->list);
|
||||
pcmd->cmdcode = GEN_CMD_CODE(_CreateBss);
|
||||
pcmd->cmdcode = CREATE_BSS_CMD;
|
||||
pcmd->parmbuf = NULL;
|
||||
pcmd->cmdsz = 0;
|
||||
pcmd->rsp = NULL;
|
||||
|
|
@ -682,7 +679,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
|||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
enum ndis_802_11_network_infrastructure ndis_network_mode = pnetwork->network.infrastructure_mode;
|
||||
enum nl80211_iftype ndis_network_mode = pnetwork->network.infrastructure_mode;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
u32 tmp_len;
|
||||
|
|
@ -699,17 +696,15 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
|||
/* for hidden ap to set fw_state here */
|
||||
if (!check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_ADHOC_STATE)) {
|
||||
switch (ndis_network_mode) {
|
||||
case Ndis802_11IBSS:
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11Infrastructure:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
set_fwstate(pmlmepriv, WIFI_STATION_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11APMode:
|
||||
case Ndis802_11AutoUnknown:
|
||||
case Ndis802_11InfrastructureMax:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -759,14 +754,16 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
|||
}
|
||||
|
||||
phtpriv->ht_option = false;
|
||||
ptmp = rtw_get_ie(&pnetwork->network.ies[12], WLAN_EID_HT_CAPABILITY, &tmp_len, pnetwork->network.ie_length - 12);
|
||||
ptmp = rtw_get_ie(&pnetwork->network.ies[12], WLAN_EID_HT_CAPABILITY, &tmp_len,
|
||||
pnetwork->network.ie_length - 12);
|
||||
|
||||
if (pregistrypriv->ht_enable && ptmp && tmp_len > 0) {
|
||||
/* Added by Albert 2010/06/23 */
|
||||
/* For the WEP mode, we will use the bg mode to do the connection to avoid some IOT issue. */
|
||||
/* Especially for Realtek 8192u SoftAP. */
|
||||
if ((padapter->securitypriv.dot11PrivacyAlgrthm != _WEP40_) &&
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _WEP104_) &&
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm != _TKIP_)) {
|
||||
if ((padapter->securitypriv.dot11_privacy_algrthm != _WEP40_) &&
|
||||
(padapter->securitypriv.dot11_privacy_algrthm != _WEP104_) &&
|
||||
(padapter->securitypriv.dot11_privacy_algrthm != _TKIP_)) {
|
||||
rtw_ht_use_default_setting(padapter);
|
||||
|
||||
rtw_build_wmm_ie_ht(padapter, &psecnetwork->ies[12], &psecnetwork->ie_length);
|
||||
|
|
@ -785,7 +782,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
|||
pcmd->cmdsz = get_wlan_bssid_ex_sz(psecnetwork);/* get cmdsz before endian conversion */
|
||||
|
||||
INIT_LIST_HEAD(&pcmd->list);
|
||||
pcmd->cmdcode = _JoinBss_CMD_;/* GEN_CMD_CODE(_JoinBss) */
|
||||
pcmd->cmdcode = JOIN_BSS_CMD;
|
||||
pcmd->parmbuf = (unsigned char *)psecnetwork;
|
||||
pcmd->rsp = NULL;
|
||||
pcmd->rspsz = 0;
|
||||
|
|
@ -819,7 +816,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
|
|||
kfree(param);
|
||||
goto exit;
|
||||
}
|
||||
init_h2fwcmd_w_parm_no_rsp(cmdobj, param, _DisConnect_CMD_);
|
||||
init_h2fwcmd_w_parm_no_rsp(cmdobj, param, DISCONNECT_CMD);
|
||||
res = rtw_enqueue_cmd(cmdpriv, cmdobj);
|
||||
} else {
|
||||
/* no need to enqueue, do the cmd hdl directly and free cmd parameter */
|
||||
|
|
@ -832,7 +829,7 @@ u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueu
|
|||
return res;
|
||||
}
|
||||
|
||||
u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrastructure networktype, bool enqueue)
|
||||
u8 rtw_setopmode_cmd(struct adapter *padapter, enum nl80211_iftype networktype, bool enqueue)
|
||||
{
|
||||
struct cmd_obj *ph2c;
|
||||
struct setopmode_parm *psetop;
|
||||
|
|
@ -855,7 +852,7 @@ u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrast
|
|||
goto exit;
|
||||
}
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetop, _SetOpMode_CMD_);
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetop, SET_OP_MODE_CMD);
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
} else {
|
||||
setopmode_hdl(padapter, (u8 *)psetop);
|
||||
|
|
@ -884,7 +881,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
|
|||
memcpy(psetstakey_para->addr, sta->hwaddr, ETH_ALEN);
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE))
|
||||
psetstakey_para->algorithm = (unsigned char)psecuritypriv->dot11PrivacyAlgrthm;
|
||||
psetstakey_para->algorithm = (unsigned char)psecuritypriv->dot11_privacy_algrthm;
|
||||
else
|
||||
GET_ENCRY_ALGO(psecuritypriv, sta, psetstakey_para->algorithm, false);
|
||||
|
||||
|
|
@ -899,7 +896,7 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
|
|||
if (enqueue) {
|
||||
ph2c = kzalloc_obj(*ph2c);
|
||||
if (!ph2c) {
|
||||
kfree(psetstakey_para);
|
||||
kfree_sensitive(psetstakey_para);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -907,18 +904,18 @@ u8 rtw_setstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 unicast_
|
|||
psetstakey_rsp = kzalloc_obj(*psetstakey_rsp);
|
||||
if (!psetstakey_rsp) {
|
||||
kfree(ph2c);
|
||||
kfree(psetstakey_para);
|
||||
kfree_sensitive(psetstakey_para);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, SET_STA_KEY_CMD);
|
||||
ph2c->rsp = (u8 *)psetstakey_rsp;
|
||||
ph2c->rspsz = sizeof(struct set_stakey_rsp);
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
} else {
|
||||
set_stakey_hdl(padapter, (u8 *)psetstakey_para);
|
||||
kfree(psetstakey_para);
|
||||
kfree_sensitive(psetstakey_para);
|
||||
}
|
||||
exit:
|
||||
return res;
|
||||
|
|
@ -958,12 +955,12 @@ u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8 enqueu
|
|||
psetstakey_rsp = kzalloc_obj(*psetstakey_rsp);
|
||||
if (!psetstakey_rsp) {
|
||||
kfree(ph2c);
|
||||
kfree(psetstakey_para);
|
||||
kfree_sensitive(psetstakey_para);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, _SetStaKey_CMD_);
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, psetstakey_para, SET_STA_KEY_CMD);
|
||||
ph2c->rsp = (u8 *)psetstakey_rsp;
|
||||
ph2c->rspsz = sizeof(struct set_stakey_rsp);
|
||||
|
||||
|
|
@ -1001,7 +998,7 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
|
|||
paddbareq_parm->tid = tid;
|
||||
memcpy(paddbareq_parm->addr, addr, ETH_ALEN);
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, ADD_BA_REQ_CMD);
|
||||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
|
@ -1010,7 +1007,6 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
|
|||
return res;
|
||||
}
|
||||
|
||||
/* add for CONFIG_IEEE80211W, none 11w can use it */
|
||||
u8 rtw_reset_securitypriv_cmd(struct adapter *padapter)
|
||||
{
|
||||
struct cmd_obj *ph2c;
|
||||
|
|
@ -1036,7 +1032,7 @@ u8 rtw_reset_securitypriv_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
|
@ -1069,7 +1065,7 @@ u8 rtw_free_assoc_resources_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
|
@ -1102,7 +1098,7 @@ u8 rtw_dynamic_chk_wk_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->type = 0;
|
||||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
|
@ -1351,7 +1347,7 @@ u8 rtw_lps_ctrl_wk_cmd(struct adapter *padapter, u8 lps_ctrl_type, u8 enqueue)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
} else {
|
||||
|
|
@ -1392,7 +1388,7 @@ u8 rtw_dm_in_lps_wk_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
|
|
@ -1454,7 +1450,7 @@ u8 rtw_dm_ra_mask_wk_cmd(struct adapter *padapter, u8 *psta)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = psta;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
|
|
@ -1487,7 +1483,7 @@ u8 rtw_ps_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->type = 0;
|
||||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
init_h2fwcmd_w_parm_no_rsp(ppscmd, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ppscmd, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ppscmd);
|
||||
|
||||
|
|
@ -1526,7 +1522,7 @@ static void rtw_chk_hi_queue_hdl(struct adapter *padapter)
|
|||
pstapriv->sta_dz_bitmap &= ~BIT(0);
|
||||
|
||||
if (update_tim)
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
} else {/* re check again */
|
||||
rtw_chk_hi_queue_cmd(padapter);
|
||||
}
|
||||
|
|
@ -1558,7 +1554,7 @@ u8 rtw_chk_hi_queue_cmd(struct adapter *padapter)
|
|||
pdrvextra_cmd_parm->size = 0;
|
||||
pdrvextra_cmd_parm->pbuf = NULL;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
|
|
@ -1650,7 +1646,7 @@ u8 rtw_c2h_packet_wk_cmd(struct adapter *padapter, u8 *pbuf, u16 length)
|
|||
pdrvextra_cmd_parm->size = length;
|
||||
pdrvextra_cmd_parm->pbuf = pbuf;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
|
|
@ -1685,7 +1681,7 @@ u8 rtw_c2h_wk_cmd(struct adapter *padapter, u8 *c2h_evt)
|
|||
pdrvextra_cmd_parm->size = c2h_evt ? 16 : 0;
|
||||
pdrvextra_cmd_parm->pbuf = c2h_evt;
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, GEN_CMD_CODE(_Set_Drv_Extra));
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, pdrvextra_cmd_parm, SET_DRV_EXTRA_CMD);
|
||||
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
|
|
@ -1716,6 +1712,8 @@ static void c2h_wk_callback(struct work_struct *work)
|
|||
kfree(c2h_evt);
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1769,7 +1767,6 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
|
|||
case CHECK_HIQ_WK_CID:
|
||||
rtw_chk_hi_queue_hdl(padapter);
|
||||
break;
|
||||
/* add for CONFIG_IEEE80211W, none 11w can use it */
|
||||
case RESET_SECURITYPRIV:
|
||||
rtw_reset_securitypriv(padapter);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -41,10 +41,7 @@ rtw_efuse_calculate_word_counts(u8 word_en)
|
|||
* 09/23/2008 MHC Copy from WMAC.
|
||||
*
|
||||
*/
|
||||
u8
|
||||
rtw_efuse_read_1_byte(
|
||||
struct adapter *Adapter,
|
||||
u16 Address)
|
||||
u8 rtw_efuse_read_1_byte(struct adapter *Adapter, u16 Address)
|
||||
{
|
||||
u8 Bytetemp = {0x00};
|
||||
u8 temp = {0x00};
|
||||
|
|
@ -82,11 +79,7 @@ u16 Address)
|
|||
} /* rtw_efuse_read_1_byte */
|
||||
|
||||
/* 11/16/2008 MH Read one byte from real Efuse. */
|
||||
u8
|
||||
rtw_efuse_one_byte_read(
|
||||
struct adapter *padapter,
|
||||
u16 addr,
|
||||
u8 *data)
|
||||
u8 rtw_efuse_one_byte_read(struct adapter *padapter, u16 addr, u8 *data)
|
||||
{
|
||||
u32 tmpidx = 0;
|
||||
u8 bResult;
|
||||
|
|
|
|||
|
|
@ -475,8 +475,9 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
pos += WPA_SELECTOR_LEN;
|
||||
left -= WPA_SELECTOR_LEN;
|
||||
|
||||
} else if (left > 0)
|
||||
} else if (left > 0) {
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
/* pairwise_cipher */
|
||||
if (left >= 2) {
|
||||
|
|
@ -495,8 +496,9 @@ int rtw_parse_wpa_ie(u8 *wpa_ie, int wpa_ie_len, int *group_cipher, int *pairwis
|
|||
left -= WPA_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
} else if (left == 1)
|
||||
} else if (left == 1) {
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (is_8021x) {
|
||||
if (left >= 6) {
|
||||
|
|
@ -535,8 +537,9 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
pos += RSN_SELECTOR_LEN;
|
||||
left -= RSN_SELECTOR_LEN;
|
||||
|
||||
} else if (left > 0)
|
||||
} else if (left > 0) {
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
/* pairwise_cipher */
|
||||
if (left >= 2) {
|
||||
|
|
@ -555,8 +558,9 @@ int rtw_parse_wpa2_ie(u8 *rsn_ie, int rsn_ie_len, int *group_cipher, int *pairwi
|
|||
left -= RSN_SELECTOR_LEN;
|
||||
}
|
||||
|
||||
} else if (left == 1)
|
||||
} else if (left == 1) {
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (is_8021x) {
|
||||
if (left >= 6) {
|
||||
|
|
|
|||
|
|
@ -13,13 +13,6 @@
|
|||
*
|
||||
* c. provides the software interface between caller and the hardware interface
|
||||
*
|
||||
*
|
||||
* Compiler Flag Option:
|
||||
*
|
||||
* 1. CONFIG_SDIO_HCI:
|
||||
* a. USE_SYNC_IRP: Only sync operations are provided.
|
||||
* b. USE_ASYNC_IRP:Both sync/async operations are provided.
|
||||
*
|
||||
* jackson@realtek.com.tw
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -278,15 +278,15 @@ u8 rtw_set_802_11_connect(struct adapter *padapter, u8 *bssid, struct ndis_802_1
|
|||
}
|
||||
|
||||
u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
|
||||
enum ndis_802_11_network_infrastructure networktype)
|
||||
enum nl80211_iftype networktype)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
enum ndis_802_11_network_infrastructure *pold_state = &(cur_network->network.infrastructure_mode);
|
||||
enum nl80211_iftype *pold_state = &(cur_network->network.infrastructure_mode);
|
||||
|
||||
if (*pold_state != networktype) {
|
||||
if (*pold_state == Ndis802_11APMode) {
|
||||
/* change to other mode from Ndis802_11APMode */
|
||||
if (*pold_state == NL80211_IFTYPE_AP) {
|
||||
/* change to other mode from AP mode */
|
||||
cur_network->join_res = -1;
|
||||
|
||||
stop_ap_mode(padapter);
|
||||
|
|
@ -294,14 +294,14 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
|
|||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) || (*pold_state == Ndis802_11IBSS))
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) || (*pold_state == NL80211_IFTYPE_ADHOC))
|
||||
rtw_disassoc_cmd(padapter, 0, true);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED) ||
|
||||
check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
|
||||
rtw_free_assoc_resources(padapter, 1);
|
||||
|
||||
if ((*pold_state == Ndis802_11Infrastructure) || (*pold_state == Ndis802_11IBSS)) {
|
||||
if ((*pold_state == NL80211_IFTYPE_STATION) || (*pold_state == NL80211_IFTYPE_ADHOC)) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
rtw_indicate_disconnect(padapter); /* will clr Linked_state; before this function, we must have checked whether issue dis-assoc_cmd or not */
|
||||
}
|
||||
|
|
@ -311,23 +311,22 @@ u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter,
|
|||
_clr_fwstate_(pmlmepriv, ~WIFI_NULL_STATE);
|
||||
|
||||
switch (networktype) {
|
||||
case Ndis802_11IBSS:
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
set_fwstate(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11Infrastructure:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
set_fwstate(pmlmepriv, WIFI_STATION_STATE);
|
||||
break;
|
||||
|
||||
case Ndis802_11APMode:
|
||||
case NL80211_IFTYPE_AP:
|
||||
set_fwstate(pmlmepriv, WIFI_AP_STATE);
|
||||
start_ap_mode(padapter);
|
||||
/* rtw_indicate_connect(padapter); */
|
||||
|
||||
break;
|
||||
|
||||
case Ndis802_11AutoUnknown:
|
||||
case Ndis802_11InfrastructureMax:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -347,7 +346,6 @@ u8 rtw_set_802_11_disassociate(struct adapter *padapter)
|
|||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
rtw_disassoc_cmd(padapter, 0, true);
|
||||
rtw_indicate_disconnect(padapter);
|
||||
/* modify for CONFIG_IEEE80211W, none 11w can use it */
|
||||
rtw_free_assoc_resources_cmd(padapter);
|
||||
rtw_pwr_wakeup(padapter);
|
||||
}
|
||||
|
|
@ -400,7 +398,7 @@ u8 rtw_set_802_11_authentication_mode(struct adapter *padapter, enum ndis_802_11
|
|||
psecuritypriv->ndisauthtype = authmode;
|
||||
|
||||
if (psecuritypriv->ndisauthtype > 3)
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
|
||||
res = rtw_set_auth(padapter, psecuritypriv);
|
||||
|
||||
|
|
@ -427,13 +425,13 @@ u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep)
|
|||
|
||||
switch (wep->key_length) {
|
||||
case 5:
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP40_;
|
||||
break;
|
||||
case 13:
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP104_;
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,20 +39,20 @@ static void rtw_init_mlme_timer(struct adapter *padapter)
|
|||
_rtw_set_scan_deny_timer_hdl, 0);
|
||||
}
|
||||
|
||||
int rtw_init_mlme_priv(struct adapter *padapter)
|
||||
int rtw_init_mlme_priv(struct adapter *padapter)
|
||||
{
|
||||
int i;
|
||||
int i;
|
||||
u8 *pbuf;
|
||||
struct wlan_network *pnetwork;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int res = _SUCCESS;
|
||||
struct wlan_network *pnetwork;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
int res = _SUCCESS;
|
||||
|
||||
pmlmepriv->nic_hdl = (u8 *)padapter;
|
||||
|
||||
pmlmepriv->pscanned = NULL;
|
||||
pmlmepriv->fw_state = WIFI_STATION_STATE; /* Must sync with rtw_wdev_alloc() */
|
||||
pmlmepriv->cur_network.network.infrastructure_mode = Ndis802_11AutoUnknown;
|
||||
pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this varable to "active_mode" (Jeff) */
|
||||
pmlmepriv->cur_network.network.infrastructure_mode = NL80211_IFTYPE_UNSPECIFIED;
|
||||
pmlmepriv->scan_mode = SCAN_ACTIVE;/* 1: active, 0: passive. Maybe someday we should rename this variable to "active_mode" (Jeff) */
|
||||
|
||||
spin_lock_init(&pmlmepriv->lock);
|
||||
INIT_LIST_HEAD(&pmlmepriv->free_bss_pool.queue);
|
||||
|
|
@ -137,9 +137,9 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv)
|
|||
}
|
||||
}
|
||||
|
||||
struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
|
||||
struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
struct wlan_network *pnetwork;
|
||||
struct wlan_network *pnetwork;
|
||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||
struct list_head *plist = NULL;
|
||||
|
||||
|
|
@ -167,7 +167,7 @@ struct wlan_network *rtw_alloc_network(struct mlme_priv *pmlmepriv)
|
|||
return pnetwork;
|
||||
}
|
||||
|
||||
void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall)
|
||||
void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork, u8 isfreeall)
|
||||
{
|
||||
unsigned int delta_time;
|
||||
u32 lifetime = SCANQUEUE_LIFETIME;
|
||||
|
|
@ -198,7 +198,7 @@ void _rtw_free_network(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwor
|
|||
spin_unlock_bh(&free_queue->lock);
|
||||
}
|
||||
|
||||
void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
|
||||
void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *pnetwork)
|
||||
{
|
||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||
|
||||
|
|
@ -220,8 +220,8 @@ void _rtw_free_network_nolock(struct mlme_priv *pmlmepriv, struct wlan_network *
|
|||
*/
|
||||
struct wlan_network *_rtw_find_network(struct __queue *scanned_queue, u8 *addr)
|
||||
{
|
||||
struct list_head *phead, *plist;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct list_head *phead, *plist;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
|
||||
if (is_zero_ether_addr(addr)) {
|
||||
pnetwork = NULL;
|
||||
|
|
@ -264,8 +264,8 @@ void rtw_free_network_queue(struct adapter *padapter, u8 isfreeall)
|
|||
|
||||
bool rtw_if_up(struct adapter *padapter)
|
||||
{
|
||||
if (padapter->bDriverStopped || padapter->bSurpriseRemoved ||
|
||||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
|
||||
if (padapter->driver_stopped || padapter->bSurpriseRemoved ||
|
||||
!check_fwstate(&padapter->mlmepriv, _FW_LINKED))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
@ -319,9 +319,9 @@ void rtw_free_network_nolock(struct adapter *padapter, struct wlan_network *pnet
|
|||
*
|
||||
* Shall be called under atomic context... to avoid possible racing condition...
|
||||
*/
|
||||
struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
|
||||
struct wlan_network *rtw_find_network(struct __queue *scanned_queue, u8 *addr)
|
||||
{
|
||||
struct wlan_network *pnetwork = _rtw_find_network(scanned_queue, addr);
|
||||
struct wlan_network *pnetwork = _rtw_find_network(scanned_queue, addr);
|
||||
|
||||
return pnetwork;
|
||||
}
|
||||
|
|
@ -330,10 +330,10 @@ bool rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
|
|||
{
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
|
||||
if ((psecuritypriv->dot11PrivacyAlgrthm != _NO_PRIVACY_) &&
|
||||
(pnetwork->network.privacy == 0))
|
||||
if ((psecuritypriv->dot11_privacy_algrthm != _NO_PRIVACY_) &&
|
||||
(pnetwork->network.privacy == 0))
|
||||
return false;
|
||||
else if ((psecuritypriv->dot11PrivacyAlgrthm == _NO_PRIVACY_) &&
|
||||
else if ((psecuritypriv->dot11_privacy_algrthm == _NO_PRIVACY_) &&
|
||||
(pnetwork->network.privacy == 1))
|
||||
return false;
|
||||
|
||||
|
|
@ -342,8 +342,8 @@ bool rtw_is_same_ibss(struct adapter *adapter, struct wlan_network *pnetwork)
|
|||
|
||||
inline int is_same_ess(struct wlan_bssid_ex *a, struct wlan_bssid_ex *b)
|
||||
{
|
||||
return (a->ssid.ssid_length == b->ssid.ssid_length)
|
||||
&& !memcmp(a->ssid.ssid, b->ssid.ssid, a->ssid.ssid_length);
|
||||
return (a->ssid.ssid_length == b->ssid.ssid_length) &&
|
||||
!memcmp(a->ssid.ssid, b->ssid.ssid, a->ssid.ssid_length);
|
||||
}
|
||||
|
||||
int is_same_network(struct wlan_bssid_ex *src, struct wlan_bssid_ex *dst, u8 feature)
|
||||
|
|
@ -385,12 +385,12 @@ struct wlan_network *_rtw_find_same_network(struct __queue *scanned_queue, struc
|
|||
return found;
|
||||
}
|
||||
|
||||
struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
|
||||
struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
|
||||
{
|
||||
struct list_head *plist, *phead;
|
||||
struct list_head *plist, *phead;
|
||||
|
||||
struct wlan_network *pwlan = NULL;
|
||||
struct wlan_network *oldest = NULL;
|
||||
struct wlan_network *pwlan = NULL;
|
||||
struct wlan_network *oldest = NULL;
|
||||
|
||||
phead = get_list_head(scanned_queue);
|
||||
|
||||
|
|
@ -406,7 +406,7 @@ struct wlan_network *rtw_get_oldest_wlan_network(struct __queue *scanned_queue)
|
|||
}
|
||||
|
||||
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
|
||||
struct adapter *padapter, bool update_ie)
|
||||
struct adapter *padapter, bool update_ie)
|
||||
{
|
||||
long rssi_ori = dst->rssi;
|
||||
|
||||
|
|
@ -467,12 +467,12 @@ static void update_current_network(struct adapter *adapter, struct wlan_bssid_ex
|
|||
/* Caller must hold pmlmepriv->lock first. */
|
||||
void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *target)
|
||||
{
|
||||
struct list_head *plist, *phead;
|
||||
struct list_head *plist, *phead;
|
||||
u32 bssid_ex_sz;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *oldest = NULL;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *oldest = NULL;
|
||||
int target_find = 0;
|
||||
u8 feature = 0;
|
||||
|
||||
|
|
@ -566,8 +566,7 @@ void rtw_update_scanned_network(struct adapter *adapter, struct wlan_bssid_ex *t
|
|||
spin_unlock_bh(&queue->lock);
|
||||
}
|
||||
|
||||
void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork);
|
||||
void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
|
||||
static void rtw_add_network(struct adapter *adapter, struct wlan_bssid_ex *pnetwork)
|
||||
{
|
||||
update_current_network(adapter, pnetwork);
|
||||
rtw_update_scanned_network(adapter, pnetwork);
|
||||
|
|
@ -633,16 +632,11 @@ static bool rtw_is_desired_network(struct adapter *adapter, struct wlan_network
|
|||
return bselected;
|
||||
}
|
||||
|
||||
/* TODO: Perry : For Power Management */
|
||||
void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
}
|
||||
|
||||
void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
u32 len;
|
||||
struct wlan_bssid_ex *pnetwork;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
pnetwork = (struct wlan_bssid_ex *)pbuf;
|
||||
|
||||
|
|
@ -681,9 +675,9 @@ void rtw_survey_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
spin_unlock_bh(&pmlmepriv->lock);
|
||||
}
|
||||
|
||||
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
if (pmlmepriv->wps_probe_req_ie) {
|
||||
|
|
@ -710,13 +704,16 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
|
||||
} else {
|
||||
u8 ret = _SUCCESS;
|
||||
struct wlan_bssid_ex *pdev_network = &adapter->registrypriv.dev_network;
|
||||
struct wlan_bssid_ex *pdev_network =
|
||||
&adapter->registrypriv.dev_network;
|
||||
|
||||
u8 *pibss = adapter->registrypriv.dev_network.mac_address;
|
||||
|
||||
/* pmlmepriv->fw_state ^= _FW_UNDER_SURVEY;because don't set assoc_timer */
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
|
||||
memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid, sizeof(struct ndis_802_11_ssid));
|
||||
memcpy(&pdev_network->ssid, &pmlmepriv->assoc_ssid,
|
||||
sizeof(struct ndis_802_11_ssid));
|
||||
|
||||
rtw_update_registrypriv_dev_network(adapter);
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
|
@ -760,8 +757,8 @@ void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
}
|
||||
} else {
|
||||
if (rtw_chk_roam_flags(adapter, RTW_ROAM_ACTIVE)) {
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
|
||||
&& check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
||||
check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
if (rtw_select_roaming_candidate(pmlmepriv) == _SUCCESS) {
|
||||
receive_disconnect(adapter, pmlmepriv->cur_network.network.mac_address
|
||||
, WLAN_REASON_ACTIVE_ROAM);
|
||||
|
|
@ -788,11 +785,11 @@ void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
{
|
||||
}
|
||||
|
||||
static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
||||
static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
struct __queue *free_queue = &pmlmepriv->free_bss_pool;
|
||||
struct __queue *scan_queue = &pmlmepriv->scanned_queue;
|
||||
struct list_head *plist, *phead, *ptemp;
|
||||
struct list_head *plist, *phead, *ptemp;
|
||||
|
||||
spin_lock_bh(&scan_queue->lock);
|
||||
spin_lock_bh(&free_queue->lock);
|
||||
|
|
@ -814,7 +811,7 @@ static void free_scanqueue(struct mlme_priv *pmlmepriv)
|
|||
static void find_network(struct adapter *adapter)
|
||||
{
|
||||
struct wlan_network *pwlan = NULL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
|
||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.mac_address);
|
||||
|
|
@ -831,14 +828,14 @@ static void find_network(struct adapter *adapter)
|
|||
/* rtw_free_assoc_resources: the caller has to lock pmlmepriv->lock */
|
||||
void rtw_free_assoc_resources(struct adapter *adapter, int lock_scanned_queue)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE | WIFI_AP_STATE)) {
|
||||
struct sta_info *psta;
|
||||
|
||||
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.mac_address);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
}
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE | WIFI_ADHOC_MASTER_STATE | WIFI_AP_STATE)) {
|
||||
|
|
@ -900,7 +897,6 @@ void rtw_indicate_disconnect(struct adapter *padapter)
|
|||
|
||||
rtw_cfg80211_indicate_disconnect(padapter);
|
||||
|
||||
/* modify for CONFIG_IEEE80211W, none 11w also can use the same command */
|
||||
rtw_reset_securitypriv_cmd(padapter);
|
||||
|
||||
/* set ips_deny_time to avoid enter IPS before LPS leave */
|
||||
|
|
@ -935,8 +931,8 @@ void rtw_scan_abort(struct adapter *adapter)
|
|||
start = jiffies;
|
||||
pmlmeext->scan_abort = true;
|
||||
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
|
||||
&& jiffies_to_msecs(start) <= 200) {
|
||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
||||
&& jiffies_to_msecs(start) <= 200) {
|
||||
if (adapter->driver_stopped || adapter->bSurpriseRemoved)
|
||||
break;
|
||||
|
||||
msleep(20);
|
||||
|
|
@ -962,7 +958,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
|
||||
if (psta) { /* update ptarget_sta */
|
||||
|
||||
psta->aid = pnetwork->join_res;
|
||||
psta->aid = pnetwork->join_res;
|
||||
|
||||
update_sta_info(padapter, psta);
|
||||
|
||||
|
|
@ -978,13 +974,13 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, true);
|
||||
|
||||
/* security related */
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
if (padapter->securitypriv.dot11_auth_algrthm == dot11_auth_algrthm_8021x) {
|
||||
padapter->securitypriv.binstallGrpkey = false;
|
||||
padapter->securitypriv.busetkipkey = false;
|
||||
padapter->securitypriv.bgrpkey_handshake = false;
|
||||
|
||||
psta->ieee8021x_blocked = true;
|
||||
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
psta->dot118021XPrivacy = padapter->securitypriv.dot11_privacy_algrthm;
|
||||
|
||||
memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype));
|
||||
|
||||
|
|
@ -1032,10 +1028,11 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
|||
|
||||
/* pnetwork : returns from rtw_joinbss_event_callback */
|
||||
/* ptarget_wlan: found from scanned_queue */
|
||||
static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_network *ptarget_wlan, struct wlan_network *pnetwork)
|
||||
static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_network *ptarget_wlan,
|
||||
struct wlan_network *pnetwork)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
|
||||
/* why not use ptarget_wlan?? */
|
||||
memcpy(&cur_network->network, &pnetwork->network, pnetwork->network.length);
|
||||
|
|
@ -1056,7 +1053,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
|
||||
/* update fw_state will clr _FW_UNDER_LINKING here indirectly */
|
||||
switch (pnetwork->network.infrastructure_mode) {
|
||||
case Ndis802_11Infrastructure:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
|
||||
if (pmlmepriv->fw_state & WIFI_UNDER_WPS)
|
||||
pmlmepriv->fw_state = WIFI_STATION_STATE | WIFI_UNDER_WPS;
|
||||
|
|
@ -1064,7 +1061,7 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
pmlmepriv->fw_state = WIFI_STATION_STATE;
|
||||
|
||||
break;
|
||||
case Ndis802_11IBSS:
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_STATE;
|
||||
break;
|
||||
default:
|
||||
|
|
@ -1081,18 +1078,17 @@ static void rtw_joinbss_update_network(struct adapter *padapter, struct wlan_net
|
|||
rtw_update_ht_cap(padapter, cur_network->network.ies, cur_network->network.ie_length, (u8) cur_network->network.configuration.ds_config);
|
||||
}
|
||||
|
||||
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
||||
static struct rt_pmkid_list backupPMKIDList[NUM_PMKID_CACHE];
|
||||
void rtw_reset_securitypriv(struct adapter *adapter)
|
||||
{
|
||||
u8 backupPMKIDIndex = 0;
|
||||
u8 backupTKIPCountermeasure = 0x00;
|
||||
u32 backupTKIPcountermeasure_time = 0;
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
|
||||
spin_lock_bh(&adapter->security_key_mutex);
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
if (adapter->securitypriv.dot11_auth_algrthm == dot11_auth_algrthm_8021x) {
|
||||
/* 802.1x */
|
||||
/* Added by Albert 2009/02/18 */
|
||||
/* We have to backup the PMK information for WiFi PMK Caching test item. */
|
||||
|
|
@ -1126,8 +1122,8 @@ void rtw_reset_securitypriv(struct adapter *adapter)
|
|||
/* */
|
||||
struct security_priv *psec_priv = &adapter->securitypriv;
|
||||
|
||||
psec_priv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psec_priv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
|
||||
psec_priv->dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
psec_priv->dot11PrivacyKeyIndex = 0;
|
||||
|
||||
psec_priv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
|
|
@ -1137,7 +1133,6 @@ void rtw_reset_securitypriv(struct adapter *adapter)
|
|||
psec_priv->ndisencryptstatus = Ndis802_11WEPDisabled;
|
||||
/* */
|
||||
}
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
spin_unlock_bh(&adapter->security_key_mutex);
|
||||
}
|
||||
|
||||
|
|
@ -1151,12 +1146,12 @@ void rtw_reset_securitypriv(struct adapter *adapter)
|
|||
void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
struct sta_info *ptarget_sta = NULL, *pcur_sta = NULL;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
|
||||
unsigned int the_same_macaddr = false;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *pcur_wlan = NULL, *ptarget_wlan = NULL;
|
||||
unsigned int the_same_macaddr = false;
|
||||
|
||||
the_same_macaddr = !memcmp(pnetwork->network.mac_address, cur_network->network.mac_address, ETH_ALEN);
|
||||
|
||||
|
|
@ -1258,7 +1253,7 @@ void rtw_joinbss_event_prehandle(struct adapter *adapter, u8 *pbuf)
|
|||
|
||||
void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
|
||||
struct wlan_network *pnetwork = (struct wlan_network *)pbuf;
|
||||
|
||||
mlmeext_joinbss_event_callback(adapter, pnetwork->join_res);
|
||||
|
||||
|
|
@ -1281,9 +1276,9 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
{
|
||||
struct sta_info *psta;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *ptarget_wlan = NULL;
|
||||
struct stassoc_event *pstassoc = (struct stassoc_event *)pbuf;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct wlan_network *ptarget_wlan = NULL;
|
||||
|
||||
if (!rtw_access_ctrl(adapter, pstassoc->macaddr))
|
||||
return;
|
||||
|
|
@ -1342,8 +1337,8 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
|
||||
rtw_sta_media_status_rpt(adapter, psta, 1);
|
||||
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
if (adapter->securitypriv.dot11_auth_algrthm == dot11_auth_algrthm_8021x)
|
||||
psta->dot118021XPrivacy = adapter->securitypriv.dot11_privacy_algrthm;
|
||||
|
||||
psta->ieee8021x_blocked = false;
|
||||
|
||||
|
|
@ -1375,8 +1370,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
struct wlan_network *pwlan = NULL;
|
||||
struct wlan_bssid_ex *pdev_network = NULL;
|
||||
u8 *pibss = NULL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct stadel_event *pstadel = (struct stadel_event *)pbuf;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct stadel_event *pstadel = (struct stadel_event *)pbuf;
|
||||
struct wlan_network *tgt_network = &pmlmepriv->cur_network;
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
|
@ -1444,8 +1439,8 @@ void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf)
|
|||
}
|
||||
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) ||
|
||||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
|
||||
rtw_free_stainfo(adapter, psta);
|
||||
|
||||
if (adapter->stapriv.asoc_sta_count == 1) {/* a sta + bc/mc_stainfo (not Ibss_stainfo) */
|
||||
u8 ret = _SUCCESS;
|
||||
|
|
@ -1507,9 +1502,9 @@ void _rtw_join_timeout_handler(struct timer_list *t)
|
|||
{
|
||||
struct adapter *adapter = timer_container_of(adapter, t,
|
||||
mlmepriv.assoc_timer);
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
||||
if (adapter->driver_stopped || adapter->bSurpriseRemoved)
|
||||
return;
|
||||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
|
@ -1550,7 +1545,7 @@ void rtw_scan_timeout_handler(struct timer_list *t)
|
|||
{
|
||||
struct adapter *adapter = timer_container_of(adapter, t,
|
||||
mlmepriv.scan_to_timer);
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
spin_lock_bh(&pmlmepriv->lock);
|
||||
|
||||
|
|
@ -1586,8 +1581,8 @@ static void rtw_auto_scan_handler(struct adapter *padapter)
|
|||
|
||||
rtw_mlme_reset_auto_scan_int(padapter);
|
||||
|
||||
if (pmlmepriv->auto_scan_int_ms != 0
|
||||
&& jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
|
||||
if (pmlmepriv->auto_scan_int_ms != 0 &&
|
||||
jiffies_to_msecs(jiffies - pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
|
||||
if (!padapter->registrypriv.wifi_spec) {
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY | _FW_UNDER_LINKING))
|
||||
goto exit;
|
||||
|
|
@ -1611,14 +1606,14 @@ void rtw_dynamic_check_timer_handler(struct adapter *adapter)
|
|||
if (!adapter->hw_init_completed)
|
||||
return;
|
||||
|
||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
||||
if (adapter->driver_stopped || adapter->bSurpriseRemoved)
|
||||
return;
|
||||
|
||||
if (adapter->net_closed)
|
||||
return;
|
||||
|
||||
if ((adapter_to_pwrctl(adapter)->fw_current_in_ps_mode)
|
||||
&& !(hal_btcoex_IsBtControlLps(adapter))
|
||||
if ((adapter_to_pwrctl(adapter)->fw_current_in_ps_mode) &&
|
||||
!(hal_btcoex_IsBtControlLps(adapter))
|
||||
) {
|
||||
bool should_enter_ps;
|
||||
|
||||
|
|
@ -1706,10 +1701,10 @@ static int rtw_check_roaming_candidate(struct mlme_priv *mlme
|
|||
int rtw_select_roaming_candidate(struct mlme_priv *mlme)
|
||||
{
|
||||
int ret = _FAIL;
|
||||
struct list_head *phead;
|
||||
struct __queue *queue = &mlme->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *candidate = NULL;
|
||||
struct list_head *phead;
|
||||
struct __queue *queue = &mlme->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *candidate = NULL;
|
||||
|
||||
if (!mlme->cur_network_scanned) {
|
||||
WARN_ON(1);
|
||||
|
|
@ -1762,8 +1757,8 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
|
|||
|
||||
/* check ssid, if needed */
|
||||
if (mlme->assoc_ssid.ssid[0] && mlme->assoc_ssid.ssid_length) {
|
||||
if (competitor->network.ssid.ssid_length != mlme->assoc_ssid.ssid_length
|
||||
|| memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid, mlme->assoc_ssid.ssid_length)
|
||||
if (competitor->network.ssid.ssid_length != mlme->assoc_ssid.ssid_length ||
|
||||
memcmp(competitor->network.ssid.ssid, mlme->assoc_ssid.ssid, mlme->assoc_ssid.ssid_length)
|
||||
)
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -1797,11 +1792,11 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
|
|||
int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
||||
{
|
||||
int ret;
|
||||
struct list_head *phead;
|
||||
struct list_head *phead;
|
||||
struct adapter *adapter;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *candidate = NULL;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
struct wlan_network *candidate = NULL;
|
||||
|
||||
adapter = (struct adapter *)pmlmepriv->nic_hdl;
|
||||
|
||||
|
|
@ -1847,10 +1842,10 @@ int rtw_select_and_join_from_scanned_queue(struct mlme_priv *pmlmepriv)
|
|||
|
||||
signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecuritypriv)
|
||||
{
|
||||
struct cmd_obj *pcmd;
|
||||
struct setauth_parm *psetauthparm;
|
||||
struct cmd_priv *pcmdpriv = &adapter->cmdpriv;
|
||||
signed int res = _SUCCESS;
|
||||
struct cmd_obj *pcmd;
|
||||
struct setauth_parm *psetauthparm;
|
||||
struct cmd_priv *pcmdpriv = &adapter->cmdpriv;
|
||||
signed int res = _SUCCESS;
|
||||
|
||||
pcmd = kzalloc_obj(*pcmd);
|
||||
if (!pcmd) {
|
||||
|
|
@ -1865,11 +1860,11 @@ signed int rtw_set_auth(struct adapter *adapter, struct security_priv *psecurity
|
|||
goto exit;
|
||||
}
|
||||
|
||||
psetauthparm->mode = (unsigned char)psecuritypriv->dot11AuthAlgrthm;
|
||||
psetauthparm->mode = (unsigned char)psecuritypriv->dot11_auth_algrthm;
|
||||
|
||||
pcmd->cmdcode = _SetAuth_CMD_;
|
||||
pcmd->cmdcode = SET_AUTH_CMD;
|
||||
pcmd->parmbuf = (unsigned char *)psetauthparm;
|
||||
pcmd->cmdsz = (sizeof(struct setauth_parm));
|
||||
pcmd->cmdsz = (sizeof(struct setauth_parm));
|
||||
pcmd->rsp = NULL;
|
||||
pcmd->rspsz = 0;
|
||||
|
||||
|
|
@ -1885,9 +1880,9 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
|
|||
{
|
||||
u8 keylen;
|
||||
struct cmd_obj *pcmd;
|
||||
struct setkey_parm *psetkeyparm;
|
||||
struct setkey_parm *psetkeyparm;
|
||||
struct cmd_priv *pcmdpriv = &adapter->cmdpriv;
|
||||
signed int res = _SUCCESS;
|
||||
signed int res = _SUCCESS;
|
||||
|
||||
psetkeyparm = kzalloc_obj(*psetkeyparm);
|
||||
if (!psetkeyparm) {
|
||||
|
|
@ -1895,10 +1890,10 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
if (psecuritypriv->dot11_auth_algrthm == dot11_auth_algrthm_8021x)
|
||||
psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy;
|
||||
else
|
||||
psetkeyparm->algorithm = (u8)psecuritypriv->dot11PrivacyAlgrthm;
|
||||
psetkeyparm->algorithm = (u8)psecuritypriv->dot11_privacy_algrthm;
|
||||
|
||||
psetkeyparm->keyid = (u8)keyid;/* 0~3 */
|
||||
psetkeyparm->set_tx = set_tx;
|
||||
|
|
@ -1938,9 +1933,9 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
|
|||
goto exit;
|
||||
}
|
||||
|
||||
pcmd->cmdcode = _SetKey_CMD_;
|
||||
pcmd->cmdcode = SET_KEY_CMD;
|
||||
pcmd->parmbuf = (u8 *)psetkeyparm;
|
||||
pcmd->cmdsz = (sizeof(struct setkey_parm));
|
||||
pcmd->cmdsz = (sizeof(struct setkey_parm));
|
||||
pcmd->rsp = NULL;
|
||||
pcmd->rspsz = 0;
|
||||
|
||||
|
|
@ -1958,7 +1953,7 @@ signed int rtw_set_key(struct adapter *adapter, struct security_priv *psecurityp
|
|||
/* adjust ies for rtw_joinbss_cmd in WMM */
|
||||
int rtw_restruct_wmm_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len, uint initial_out_len)
|
||||
{
|
||||
unsigned int ielength = 0;
|
||||
unsigned int ielength = 0;
|
||||
unsigned int i, j;
|
||||
|
||||
i = 12; /* after the fixed IE */
|
||||
|
|
@ -2003,7 +1998,7 @@ static int SecIsInPMKIDList(struct adapter *Adapter, u8 *bssid)
|
|||
|
||||
for (i = 0; i < NUM_PMKID_CACHE; i++)
|
||||
if ((p->PMKIDList[i].bUsed) &&
|
||||
(!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
|
||||
(!memcmp(p->PMKIDList[i].Bssid, bssid, ETH_ALEN)))
|
||||
return i;
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2035,7 +2030,7 @@ static int rtw_append_pmkid(struct adapter *Adapter, int iEntry, u8 *ie, uint ie
|
|||
|
||||
static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
|
||||
{
|
||||
uint len;
|
||||
uint len;
|
||||
u8 *buff, *p;
|
||||
union iwreq_data wrqu;
|
||||
|
||||
|
|
@ -2069,12 +2064,12 @@ static void rtw_report_sec_ie(struct adapter *adapter, u8 authmode, u8 *sec_ie)
|
|||
signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, uint in_len)
|
||||
{
|
||||
u8 authmode = 0x0;
|
||||
uint ielength;
|
||||
uint ielength;
|
||||
int iEntry;
|
||||
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
uint ndisauthmode = psecuritypriv->ndisauthtype;
|
||||
uint ndisauthmode = psecuritypriv->ndisauthtype;
|
||||
|
||||
/* copy fixed ie only */
|
||||
memcpy(out_ie, in_ie, 12);
|
||||
|
|
@ -2109,7 +2104,7 @@ void rtw_init_registrypriv_dev_network(struct adapter *adapter)
|
|||
{
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
struct eeprom_priv *peepriv = &adapter->eeprompriv;
|
||||
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
||||
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
||||
u8 *myhwaddr = myid(peepriv);
|
||||
|
||||
memcpy(pdev_network->mac_address, myhwaddr, ETH_ALEN);
|
||||
|
|
@ -2124,33 +2119,17 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
|
|||
{
|
||||
int sz = 0;
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
|
||||
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
|
||||
struct security_priv *psecuritypriv = &adapter->securitypriv;
|
||||
struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
|
||||
|
||||
pdev_network->privacy = (psecuritypriv->dot11PrivacyAlgrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */
|
||||
pdev_network->privacy = (psecuritypriv->dot11_privacy_algrthm > 0 ? 1 : 0) ; /* adhoc no 802.1x */
|
||||
|
||||
pdev_network->rssi = 0;
|
||||
|
||||
switch (pregistrypriv->wireless_mode) {
|
||||
case WIRELESS_11B:
|
||||
pdev_network->network_type_in_use = (Ndis802_11DS);
|
||||
break;
|
||||
case WIRELESS_11G:
|
||||
case WIRELESS_11BG:
|
||||
case WIRELESS_11_24N:
|
||||
case WIRELESS_11G_24N:
|
||||
case WIRELESS_11BG_24N:
|
||||
pdev_network->network_type_in_use = (Ndis802_11OFDM24);
|
||||
break;
|
||||
default:
|
||||
/* TODO */
|
||||
break;
|
||||
}
|
||||
|
||||
pdev_network->configuration.ds_config = (pregistrypriv->channel);
|
||||
|
||||
if (cur_network->network.infrastructure_mode == Ndis802_11IBSS)
|
||||
if (cur_network->network.infrastructure_mode == NL80211_IFTYPE_ADHOC)
|
||||
pdev_network->configuration.atim_window = (0);
|
||||
|
||||
pdev_network->infrastructure_mode = (cur_network->network.infrastructure_mode);
|
||||
|
|
@ -2163,7 +2142,7 @@ void rtw_update_registrypriv_dev_network(struct adapter *adapter)
|
|||
|
||||
pdev_network->ie_length = sz;
|
||||
|
||||
pdev_network->length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
|
||||
pdev_network->length = get_wlan_bssid_ex_sz((struct wlan_bssid_ex *)pdev_network);
|
||||
|
||||
/* notes: translate ie_length & length after assign the length to cmdsz in createbss_cmd(); */
|
||||
/* pdev_network->ie_length = cpu_to_le32(sz); */
|
||||
|
|
@ -2204,8 +2183,8 @@ void rtw_ht_use_default_setting(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
bool bHwLDPCSupport = false, bHwSTBCSupport = false;
|
||||
bool bHwSupportBeamformer = false, bHwSupportBeamformee = false;
|
||||
bool bHwLDPCSupport = false, bHwSTBCSupport = false;
|
||||
bool bHwSupportBeamformer = false, bHwSupportBeamformee = false;
|
||||
|
||||
if (pregistrypriv->wifi_spec)
|
||||
phtpriv->bss_coexist = 1;
|
||||
|
|
@ -2369,7 +2348,7 @@ unsigned int rtw_restructure_ht_ie(struct adapter *padapter, u8 *in_ie, u8 *out_
|
|||
|
||||
ht_capie.ampdu_params_info = (max_rx_ampdu_factor & 0x03);
|
||||
|
||||
if (padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
|
||||
if (padapter->securitypriv.dot11_privacy_algrthm == _AES_)
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & (0x07 << 2));
|
||||
else
|
||||
ht_capie.ampdu_params_info |= (IEEE80211_HT_CAP_AMPDU_DENSITY & 0x00);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -242,7 +242,7 @@ void rtw_set_rpwm(struct adapter *padapter, u8 pslv)
|
|||
return;
|
||||
}
|
||||
|
||||
if (padapter->bDriverStopped) {
|
||||
if (padapter->driver_stopped) {
|
||||
if (pslv < PS_STATE_S2)
|
||||
return;
|
||||
}
|
||||
|
|
@ -315,7 +315,7 @@ static u8 PS_RDY_CHECK(struct adapter *padapter)
|
|||
)
|
||||
return false;
|
||||
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X &&
|
||||
if (padapter->securitypriv.dot11_auth_algrthm == dot11_auth_algrthm_8021x &&
|
||||
!padapter->securitypriv.binstallGrpkey)
|
||||
return false;
|
||||
|
||||
|
|
@ -389,35 +389,29 @@ void rtw_set_ps_mode(struct adapter *padapter, u8 ps_mode,
|
|||
|
||||
/*
|
||||
* Return:
|
||||
*0: Leave OK
|
||||
*-1: Timeout
|
||||
*-2: Other error
|
||||
* 0: Leave OK
|
||||
* -ETIMEDOUT: Timeout
|
||||
* -ENODEV: Other error
|
||||
*/
|
||||
s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
|
||||
int LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms)
|
||||
{
|
||||
unsigned long start_time;
|
||||
u8 bAwake = false;
|
||||
s32 err = 0;
|
||||
|
||||
start_time = jiffies;
|
||||
while (1) {
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_FWLPS_RF_ON, &bAwake);
|
||||
if (bAwake)
|
||||
break;
|
||||
return 0;
|
||||
|
||||
if (padapter->bSurpriseRemoved) {
|
||||
err = -2;
|
||||
break;
|
||||
}
|
||||
if (padapter->bSurpriseRemoved)
|
||||
return -ENODEV;
|
||||
|
||||
if (jiffies_to_msecs(jiffies - start_time) > delay_ms)
|
||||
return -ETIMEDOUT;
|
||||
|
||||
if (jiffies_to_msecs(jiffies - start_time) > delay_ms) {
|
||||
err = -1;
|
||||
break;
|
||||
}
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/* Description: Enter the leisure power save mode. */
|
||||
|
|
@ -1051,7 +1045,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
|||
}
|
||||
|
||||
/* TODO: the following checking need to be merged... */
|
||||
if (padapter->bDriverStopped || !padapter->bup || !padapter->hw_init_completed) {
|
||||
if (padapter->driver_stopped || !padapter->bup || !padapter->hw_init_completed) {
|
||||
ret = false;
|
||||
goto exit;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *pada
|
|||
|
||||
precvpriv->free_recvframe_cnt = NR_RECVFRAME;
|
||||
|
||||
precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ);
|
||||
precvpriv->pallocated_frame_buf = vzalloc(NR_RECVFRAME * sizeof(union recv_frame)
|
||||
+ RXFRAME_ALIGN_SZ);
|
||||
|
||||
if (!precvpriv->pallocated_frame_buf) {
|
||||
res = _FAIL;
|
||||
|
|
@ -55,7 +56,7 @@ signed int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *pada
|
|||
/* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */
|
||||
/* ((SIZE_PTR) (precvpriv->pallocated_frame_buf) &(RXFRAME_ALIGN_SZ-1)); */
|
||||
|
||||
precvframe = (union recv_frame *) precvpriv->precv_frame_buf;
|
||||
precvframe = (union recv_frame *)precvpriv->precv_frame_buf;
|
||||
|
||||
for (i = 0; i < NR_RECVFRAME; i++) {
|
||||
INIT_LIST_HEAD(&(precvframe->u.list));
|
||||
|
|
@ -494,7 +495,7 @@ static union recv_frame *portctrl(struct adapter *adapter, union recv_frame *pre
|
|||
|
||||
pstapriv = &adapter->stapriv;
|
||||
|
||||
auth_alg = adapter->securitypriv.dot11AuthAlgrthm;
|
||||
auth_alg = adapter->securitypriv.dot11_auth_algrthm;
|
||||
|
||||
ptr = precv_frame->u.hdr.rx_data;
|
||||
pfhdr = &precv_frame->u.hdr;
|
||||
|
|
@ -815,7 +816,7 @@ static signed int ap2sta_data_frame(struct adapter *adapter, union recv_frame *p
|
|||
}
|
||||
|
||||
if (GetFrameSubType(ptr) & BIT(6)) {
|
||||
/* No data, will not indicate to upper layer, temporily count it here */
|
||||
/* No data, will not indicate to upper layer, temporarily count it here */
|
||||
count_rx_stats(adapter, precv_frame, *psta);
|
||||
ret = RTW_RX_HANDLED;
|
||||
goto exit;
|
||||
|
|
@ -895,7 +896,7 @@ static signed int sta2ap_data_frame(struct adapter *adapter, union recv_frame *p
|
|||
process_wmmps_data(adapter, precv_frame);
|
||||
|
||||
if (GetFrameSubType(ptr) & BIT(6)) {
|
||||
/* No data, will not indicate to upper layer, temporily count it here */
|
||||
/* No data, will not indicate to upper layer, temporarily count it here */
|
||||
count_rx_stats(adapter, precv_frame, *psta);
|
||||
ret = RTW_RX_HANDLED;
|
||||
goto exit;
|
||||
|
|
@ -1009,7 +1010,7 @@ static signed int validate_recv_ctrl_frame(struct adapter *padapter, union recv_
|
|||
|
||||
/* update BCN for TIM IE */
|
||||
/* update_BCNTIM(padapter); */
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
}
|
||||
|
||||
/* spin_unlock_bh(&psta->sleep_q.lock); */
|
||||
|
|
@ -1031,7 +1032,7 @@ static signed int validate_recv_ctrl_frame(struct adapter *padapter, union recv_
|
|||
|
||||
/* update BCN for TIM IE */
|
||||
/* update_BCNTIM(padapter); */
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1447,7 +1448,6 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
|
|||
u8 type;
|
||||
u8 subtype;
|
||||
signed int retval = _SUCCESS;
|
||||
u8 bDumpRxPkt;
|
||||
|
||||
struct rx_pkt_attrib *pattrib = &precv_frame->u.hdr.attrib;
|
||||
|
||||
|
|
@ -1473,7 +1473,6 @@ static signed int validate_recv_frame(struct adapter *adapter, union recv_frame
|
|||
pattrib->mdata = GetMData(ptr);
|
||||
pattrib->privacy = GetPrivacy(ptr);
|
||||
pattrib->order = GetOrder(ptr);
|
||||
rtw_hal_get_def_var(adapter, HAL_DEF_DBG_DUMP_RXPKT, &(bDumpRxPkt));
|
||||
|
||||
switch (type) {
|
||||
case WIFI_MGT_TYPE: /* mgnt */
|
||||
|
|
@ -1576,7 +1575,7 @@ static signed int wlanhdr_to_ethhdr(union recv_frame *precvframe)
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubframe_Length, u8 *pdata)
|
||||
static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 subframe_len, u8 *pdata)
|
||||
{
|
||||
u16 eth_type;
|
||||
struct sk_buff *sub_skb;
|
||||
|
|
@ -1584,12 +1583,12 @@ static struct sk_buff *rtw_alloc_msdu_pkt(union recv_frame *prframe, u16 nSubfra
|
|||
|
||||
pattrib = &prframe->u.hdr.attrib;
|
||||
|
||||
sub_skb = __dev_alloc_skb(nSubframe_Length + 12, GFP_ATOMIC);
|
||||
sub_skb = __dev_alloc_skb(subframe_len + 12, GFP_ATOMIC);
|
||||
if (!sub_skb)
|
||||
return NULL;
|
||||
|
||||
skb_reserve(sub_skb, 12);
|
||||
skb_put_data(sub_skb, (pdata + ETH_HLEN), nSubframe_Length);
|
||||
skb_put_data(sub_skb, (pdata + ETH_HLEN), subframe_len);
|
||||
|
||||
eth_type = get_unaligned_be16(&sub_skb->data[6]);
|
||||
|
||||
|
|
@ -1666,7 +1665,7 @@ static void rtw_recv_indicate_pkt(struct adapter *padapter, struct sk_buff *pkt,
|
|||
static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
||||
{
|
||||
int a_len, padding_len;
|
||||
u16 nSubframe_Length;
|
||||
u16 subframe_len;
|
||||
u8 nr_subframes, i;
|
||||
u8 *pdata;
|
||||
struct sk_buff *sub_pkt, *subframes[MAX_SUBFRAME_COUNT];
|
||||
|
|
@ -1686,12 +1685,12 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
|
||||
while (a_len > ETH_HLEN) {
|
||||
/* Offset 12 denote 2 mac address */
|
||||
nSubframe_Length = get_unaligned_be16(pdata + 12);
|
||||
subframe_len = get_unaligned_be16(pdata + 12);
|
||||
|
||||
if (a_len < ETH_HLEN + nSubframe_Length)
|
||||
if (a_len < ETH_HLEN + subframe_len)
|
||||
break;
|
||||
|
||||
sub_pkt = rtw_alloc_msdu_pkt(prframe, nSubframe_Length, pdata);
|
||||
sub_pkt = rtw_alloc_msdu_pkt(prframe, subframe_len, pdata);
|
||||
if (!sub_pkt)
|
||||
break;
|
||||
|
||||
|
|
@ -1704,10 +1703,10 @@ static int amsdu_to_msdu(struct adapter *padapter, union recv_frame *prframe)
|
|||
if (nr_subframes >= MAX_SUBFRAME_COUNT)
|
||||
break;
|
||||
|
||||
pdata += nSubframe_Length;
|
||||
a_len -= nSubframe_Length;
|
||||
pdata += subframe_len;
|
||||
a_len -= subframe_len;
|
||||
if (a_len != 0) {
|
||||
padding_len = 4 - ((nSubframe_Length + ETH_HLEN) & (4 - 1));
|
||||
padding_len = 4 - ((subframe_len + ETH_HLEN) & (4 - 1));
|
||||
if (padding_len == 4)
|
||||
padding_len = 0;
|
||||
|
||||
|
|
@ -1893,7 +1892,7 @@ static int recv_indicatepkts_in_order(struct adapter *padapter, struct recv_reor
|
|||
|
||||
/* indicate this recv_frame */
|
||||
if (!pattrib->amsdu) {
|
||||
if (!padapter->bDriverStopped &&
|
||||
if (!padapter->driver_stopped &&
|
||||
!padapter->bSurpriseRemoved)
|
||||
rtw_recv_indicatepkt(padapter, prframe);/* indicate this recv_frame */
|
||||
|
||||
|
|
@ -1932,7 +1931,7 @@ static int recv_indicatepkt_reorder(struct adapter *padapter, union recv_frame *
|
|||
wlanhdr_to_ethhdr(prframe);
|
||||
|
||||
if (pattrib->qos != 1) {
|
||||
if (!padapter->bDriverStopped &&
|
||||
if (!padapter->driver_stopped &&
|
||||
!padapter->bSurpriseRemoved) {
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
return _SUCCESS;
|
||||
|
|
@ -2010,7 +2009,7 @@ void rtw_reordering_ctrl_timeout_handler(struct timer_list *t)
|
|||
struct adapter *padapter = preorder_ctrl->padapter;
|
||||
struct __queue *ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
|
||||
if (padapter->driver_stopped || padapter->bSurpriseRemoved)
|
||||
return;
|
||||
|
||||
spin_lock_bh(&ppending_recvframe_queue->lock);
|
||||
|
|
@ -2034,7 +2033,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
|
|||
|
||||
if (recv_indicatepkt_reorder(padapter, prframe) != _SUCCESS) { /* including perform A-MPDU Rx Ordering Buffer Control */
|
||||
|
||||
if (!padapter->bDriverStopped &&
|
||||
if (!padapter->driver_stopped &&
|
||||
!padapter->bSurpriseRemoved) {
|
||||
retval = _FAIL;
|
||||
return retval;
|
||||
|
|
@ -2045,7 +2044,7 @@ static int process_recv_indicatepkts(struct adapter *padapter, union recv_frame
|
|||
if (retval != _SUCCESS)
|
||||
return retval;
|
||||
|
||||
if (!padapter->bDriverStopped && !padapter->bSurpriseRemoved) {
|
||||
if (!padapter->driver_stopped && !padapter->bSurpriseRemoved) {
|
||||
/* indicate this recv_frame */
|
||||
rtw_recv_indicatepkt(padapter, prframe);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
******************************************************************************/
|
||||
#include <linux/crc32.h>
|
||||
#include <linux/unaligned.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <drv_types.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/utils.h>
|
||||
|
|
@ -225,7 +226,6 @@ void rtw_seccalctkipmic(u8 *key, u8 *header, u8 *data, u32 data_len, u8 *mic_cod
|
|||
}
|
||||
|
||||
/* macros for extraction/creation of unsigned char/unsigned short values */
|
||||
#define RotR1(v16) ((((v16) >> 1) & 0x7FFF) ^ (((v16) & 1) << 15))
|
||||
#define Lo8(v16) ((u8)((v16) & 0x00FF))
|
||||
#define Hi8(v16) ((u8)(((v16) >> 8) & 0x00FF))
|
||||
#define Lo16(v32) ((u16)((v32) & 0xFFFF))
|
||||
|
|
@ -392,12 +392,12 @@ static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16)
|
|||
PPK[5] += _S_(PPK[4] ^ TK16(5)); /* Total # S-box lookups == 6 */
|
||||
|
||||
/* Final sweep: bijective, "linear". Rotates kill LSB correlations */
|
||||
PPK[0] += RotR1(PPK[5] ^ TK16(6));
|
||||
PPK[1] += RotR1(PPK[0] ^ TK16(7)); /* Use all of TK[] in Phase2 */
|
||||
PPK[2] += RotR1(PPK[1]);
|
||||
PPK[3] += RotR1(PPK[2]);
|
||||
PPK[4] += RotR1(PPK[3]);
|
||||
PPK[5] += RotR1(PPK[4]);
|
||||
PPK[0] += ror16(PPK[5] ^ TK16(6), 1);
|
||||
PPK[1] += ror16(PPK[0] ^ TK16(7), 1); /* Use all of TK[] in Phase2 */
|
||||
PPK[2] += ror16(PPK[1], 1);
|
||||
PPK[3] += ror16(PPK[2], 1);
|
||||
PPK[4] += ror16(PPK[3], 1);
|
||||
PPK[5] += ror16(PPK[4], 1);
|
||||
/* Note: At this point, for a given key TK[0..15], the 96-bit output */
|
||||
/* value PPK[0..5] is guaranteed to be unique, as a function */
|
||||
/* of the 96-bit "input" value {TA, IV32, IV16}. That is, P1K */
|
||||
|
|
@ -409,7 +409,6 @@ static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16)
|
|||
rc4key[2] = Lo8(iv16);
|
||||
rc4key[3] = Lo8((PPK[5] ^ TK16(0)) >> 1);
|
||||
|
||||
|
||||
/* Copy 96 bits of PPK[0..5] to RC4KEY[4..15] (little-endian) */
|
||||
for (i = 0; i < 6; i++) {
|
||||
rc4key[4 + 2 * i] = Lo8(PPK[i]);
|
||||
|
|
@ -417,7 +416,6 @@ static void phase2(u8 *rc4key, const u8 *tk, const u16 *p1k, u16 iv16)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* The hlen isn't include the IV */
|
||||
u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
||||
{ /* exclude ICV */
|
||||
|
|
@ -491,7 +489,6 @@ u32 rtw_tkip_encrypt(struct adapter *padapter, u8 *pxmitframe)
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* The hlen isn't include the IV */
|
||||
u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
|
||||
{ /* exclude ICV */
|
||||
|
|
@ -593,11 +590,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, u8 *precvframe)
|
|||
return res;
|
||||
}
|
||||
|
||||
|
||||
/* 3 =====AES related ===== */
|
||||
|
||||
|
||||
|
||||
#define MAX_MSG_SIZE 2048
|
||||
|
||||
/****************************************/
|
||||
|
|
@ -626,7 +620,7 @@ static void construct_mic_iv(u8 *mic_iv,
|
|||
u8 *mpdu,
|
||||
uint payload_length,
|
||||
u8 *pn_vector,
|
||||
uint frtype) /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
uint frtype)
|
||||
{
|
||||
signed int i;
|
||||
|
||||
|
|
@ -662,7 +656,7 @@ static void construct_mic_iv(u8 *mic_iv,
|
|||
static void construct_mic_header1(u8 *mic_header1,
|
||||
signed int header_length,
|
||||
u8 *mpdu,
|
||||
uint frtype) /* for CONFIG_IEEE80211W, none 11w also can use */
|
||||
uint frtype)
|
||||
{
|
||||
mic_header1[0] = (u8)((header_length - 2) / 256);
|
||||
mic_header1[1] = (u8)((header_length - 2) % 256);
|
||||
|
|
@ -745,7 +739,7 @@ static void construct_ctr_preload(u8 *ctr_preload,
|
|||
u8 *mpdu,
|
||||
u8 *pn_vector,
|
||||
signed int c,
|
||||
uint frtype) /* for CONFIG_IEEE80211W, none 11w also can use */
|
||||
uint frtype)
|
||||
{
|
||||
signed int i = 0;
|
||||
|
||||
|
|
@ -805,7 +799,7 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
|||
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
|
||||
hdrlen += 2;
|
||||
|
||||
} else if ((frtype == WIFI_DATA) && /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
} else if ((frtype == WIFI_DATA) &&
|
||||
((frsubtype == 0x08) ||
|
||||
(frsubtype == 0x09) ||
|
||||
(frsubtype == 0x0a) ||
|
||||
|
|
@ -831,12 +825,12 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
|||
pframe, /* message, */
|
||||
plen,
|
||||
pn_vector,
|
||||
frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
frtype);
|
||||
|
||||
construct_mic_header1(mic_header1,
|
||||
hdrlen,
|
||||
pframe, /* message */
|
||||
frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
frtype);
|
||||
|
||||
construct_mic_header2(mic_header2,
|
||||
pframe, /* message, */
|
||||
|
|
@ -885,7 +879,6 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
|||
for (i = 0; i < num_blocks; i++) {
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, /* message, */
|
||||
pn_vector, i + 1, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16);
|
||||
for (j = 0; j < 16; j++)
|
||||
|
|
@ -897,7 +890,6 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
|||
/* encrypt it and copy the unpadded part back */
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, /* message, */
|
||||
pn_vector, num_blocks + 1, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
|
|
@ -913,7 +905,6 @@ static signed int aes_cipher(u8 *key, uint hdrlen,
|
|||
/* Encrypt the MIC */
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, /* message, */
|
||||
pn_vector, 0, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
|
|
@ -1024,7 +1015,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
if (hdrlen != WLAN_HDR_A3_QOS_LEN)
|
||||
hdrlen += 2;
|
||||
|
||||
} else if ((frtype == WIFI_DATA) && /* only for data packet . add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
} else if ((frtype == WIFI_DATA) &&
|
||||
((frsubtype == 0x08) ||
|
||||
(frsubtype == 0x09) ||
|
||||
(frsubtype == 0x0a) ||
|
||||
|
|
@ -1045,7 +1036,7 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
construct_ctr_preload(ctr_preload, a4_exists,
|
||||
qc_exists, pframe,
|
||||
pn_vector, i + 1,
|
||||
frtype); /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
frtype);
|
||||
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
crypto_xor_cpy(chain_buffer, aes_out, &pframe[payload_index], 16);
|
||||
|
|
@ -1059,7 +1050,6 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
/* encrypt it and copy the unpadded part back */
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, pframe, pn_vector,
|
||||
num_blocks + 1, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
|
|
@ -1084,10 +1074,8 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
pn_vector[5] = pframe[hdrlen + 7];
|
||||
|
||||
construct_mic_iv(mic_iv, qc_exists, a4_exists, message, plen - 8, pn_vector, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
construct_mic_header1(mic_header1, hdrlen, message, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
construct_mic_header2(mic_header2, message, a4_exists, qc_exists);
|
||||
|
||||
payload_remainder = (plen - 8) % 16;
|
||||
|
|
@ -1132,7 +1120,6 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
for (i = 0; i < num_blocks; i++) {
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vector, i + 1,
|
||||
frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
aes128k128d(key, ctr_preload, aes_out);
|
||||
crypto_xor_cpy(chain_buffer, aes_out, &message[payload_index], 16);
|
||||
for (j = 0; j < 16; j++)
|
||||
|
|
@ -1144,7 +1131,6 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
/* encrypt it and copy the unpadded part back */
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vector,
|
||||
num_blocks + 1, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
|
|
@ -1159,7 +1145,6 @@ static signed int aes_decipher(u8 *key, uint hdrlen,
|
|||
|
||||
/* Encrypt the MIC */
|
||||
construct_ctr_preload(ctr_preload, a4_exists, qc_exists, message, pn_vector, 0, frtype);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
|
||||
for (j = 0; j < 16; j++)
|
||||
padded_buffer[j] = 0x00;
|
||||
|
|
@ -1433,7 +1418,6 @@ static int omac1_aes_128_vector(u8 *key, size_t num_elem,
|
|||
* This is a mode for using block cipher (AES in this case) for authentication.
|
||||
* OMAC1 was standardized with the name CMAC by NIST in a Special Publication
|
||||
* (SP) 800-38B.
|
||||
* modify for CONFIG_IEEE80211W
|
||||
*/
|
||||
int omac1_aes_128(u8 *key, u8 *data, size_t data_len, u8 *mac)
|
||||
{
|
||||
|
|
@ -1446,7 +1430,7 @@ void rtw_sec_restore_wep_key(struct adapter *adapter)
|
|||
struct security_priv *securitypriv = &adapter->securitypriv;
|
||||
signed int keyid;
|
||||
|
||||
if ((securitypriv->dot11PrivacyAlgrthm == _WEP40_) || (securitypriv->dot11PrivacyAlgrthm == _WEP104_)) {
|
||||
if ((securitypriv->dot11_privacy_algrthm == _WEP40_) || (securitypriv->dot11_privacy_algrthm == _WEP104_)) {
|
||||
for (keyid = 0; keyid < 4; keyid++) {
|
||||
if (securitypriv->key_mask & BIT(keyid)) {
|
||||
if (keyid == securitypriv->dot11PrivacyKeyIndex)
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
|
||||
/* init recv timer */
|
||||
timer_setup(&preorder_ctrl->reordering_ctrl_timer,
|
||||
rtw_reordering_ctrl_timeout_handler, 0);
|
||||
rtw_reordering_ctrl_timeout_handler, 0);
|
||||
}
|
||||
|
||||
/* init for DM */
|
||||
|
|
@ -256,7 +256,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
|||
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
|
||||
|
||||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
psta->rx_mgmt_frame_seq_num = 0xffff;
|
||||
spin_unlock_bh(&pstapriv->sta_hash_lock);
|
||||
/* alloc mac id for non-bc/mc station, */
|
||||
rtw_alloc_macid(pstapriv->padapter, psta);
|
||||
|
|
@ -454,7 +454,7 @@ void rtw_free_all_stainfo(struct adapter *padapter)
|
|||
/* any station allocated can be searched by hash list */
|
||||
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
struct list_head *plist, *phead;
|
||||
struct list_head *plist, *phead;
|
||||
struct sta_info *psta = NULL;
|
||||
u32 index;
|
||||
u8 *addr;
|
||||
|
|
|
|||
|
|
@ -220,21 +220,21 @@ void update_basic_rate_table_soft_ap(u8 *bssrateset, u32 bssratelen)
|
|||
}
|
||||
}
|
||||
|
||||
void Save_DM_Func_Flag(struct adapter *padapter)
|
||||
void save_dm_func_flag(struct adapter *padapter)
|
||||
{
|
||||
u8 bSaveFlag = true;
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
|
||||
}
|
||||
|
||||
void Restore_DM_Func_Flag(struct adapter *padapter)
|
||||
void restore_dm_func_flag(struct adapter *padapter)
|
||||
{
|
||||
u8 bSaveFlag = false;
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_OP, (u8 *)(&bSaveFlag));
|
||||
}
|
||||
|
||||
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable)
|
||||
void switch_dm_func(struct adapter *padapter, u32 mode, u8 enable)
|
||||
{
|
||||
if (enable)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DM_FUNC_SET, (u8 *)(&mode));
|
||||
|
|
@ -256,9 +256,8 @@ inline void rtw_set_oper_ch(struct adapter *adapter, u8 ch)
|
|||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
|
||||
if (dvobj->oper_channel != ch) {
|
||||
if (dvobj->oper_channel != ch)
|
||||
dvobj->on_oper_ch_time = jiffies;
|
||||
}
|
||||
|
||||
dvobj->oper_channel = ch;
|
||||
}
|
||||
|
|
@ -351,7 +350,7 @@ int is_client_associated_to_ap(struct adapter *padapter)
|
|||
return _FAIL;
|
||||
|
||||
pmlmeext = &padapter->mlmeextpriv;
|
||||
pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_STATION_STATE))
|
||||
return true;
|
||||
|
|
@ -362,7 +361,7 @@ int is_client_associated_to_ap(struct adapter *padapter)
|
|||
int is_client_associated_to_ibss(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if ((pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) && ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE))
|
||||
return true;
|
||||
|
|
@ -374,7 +373,7 @@ int is_IBSS_empty(struct adapter *padapter)
|
|||
{
|
||||
unsigned int i;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
for (i = IBSS_START_MAC_ID; i < NUM_STA; i++) {
|
||||
if (pmlmeinfo->FW_sta_info[i].status == 1)
|
||||
|
|
@ -477,7 +476,7 @@ void clear_cam_cache(struct adapter *adapter, u8 id)
|
|||
|
||||
spin_lock_bh(&cam_ctl->lock);
|
||||
|
||||
memset(&(dvobj->cam_cache[id]), 0, sizeof(struct cam_entry_cache));
|
||||
memset(&dvobj->cam_cache[id], 0, sizeof(struct cam_entry_cache));
|
||||
|
||||
spin_unlock_bh(&cam_ctl->lock);
|
||||
}
|
||||
|
|
@ -629,7 +628,7 @@ int allocate_fw_sta_entry(struct adapter *padapter)
|
|||
{
|
||||
unsigned int mac_id;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
for (mac_id = IBSS_START_MAC_ID; mac_id < NUM_STA; mac_id++) {
|
||||
if (pmlmeinfo->FW_sta_info[mac_id].status == 0) {
|
||||
|
|
@ -645,7 +644,7 @@ int allocate_fw_sta_entry(struct adapter *padapter)
|
|||
void flush_all_cam_entry(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
invalidate_cam_all(padapter);
|
||||
/* clear default key related key search setting */
|
||||
|
|
@ -657,9 +656,9 @@ void flush_all_cam_entry(struct adapter *padapter)
|
|||
int WMM_param_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
||||
{
|
||||
/* struct registry_priv *pregpriv = &padapter->registrypriv; */
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if (pmlmepriv->qospriv.qos_option == 0) {
|
||||
pmlmeinfo->WMM_enable = 0;
|
||||
|
|
@ -669,10 +668,10 @@ int WMM_param_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
|||
if (pIE->length != WLAN_WMM_LEN)
|
||||
return false;
|
||||
|
||||
if (!memcmp(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element)))
|
||||
if (!memcmp(&pmlmeinfo->WMM_param, (pIE->data + 6), sizeof(struct WMM_para_element)))
|
||||
return false;
|
||||
|
||||
memcpy(&(pmlmeinfo->WMM_param), (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
memcpy(&pmlmeinfo->WMM_param, (pIE->data + 6), sizeof(struct WMM_para_element));
|
||||
|
||||
pmlmeinfo->WMM_enable = 1;
|
||||
return true;
|
||||
|
|
@ -712,7 +711,7 @@ void WMMOnAssocRsp(struct adapter *padapter)
|
|||
u32 acParm, i;
|
||||
u32 edca[4], inx[4];
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
|
||||
|
|
@ -813,9 +812,9 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_80211_var_
|
|||
unsigned char new_bwmode;
|
||||
unsigned char new_ch_offset;
|
||||
struct HT_info_element *pHT_info;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
u8 cbw40_enable = 0;
|
||||
|
|
@ -870,7 +869,7 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_80211_var_
|
|||
|
||||
if (true == pmlmeinfo->bwmode_updated) {
|
||||
struct sta_info *psta;
|
||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
/* set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode); */
|
||||
|
|
@ -900,7 +899,7 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
|||
u8 max_AMPDU_len, min_MPDU_spacing;
|
||||
u8 cur_ldpc_cap = 0, cur_stbc_cap = 0;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
|
|
@ -964,7 +963,7 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
|||
void HT_info_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct ht_priv *phtpriv = &pmlmepriv->htpriv;
|
||||
|
||||
|
|
@ -978,7 +977,7 @@ void HT_info_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
|||
return;
|
||||
|
||||
pmlmeinfo->HT_info_enable = 1;
|
||||
memcpy(&(pmlmeinfo->HT_info), pIE->data, pIE->length);
|
||||
memcpy(&pmlmeinfo->HT_info, pIE->data, pIE->length);
|
||||
}
|
||||
|
||||
void HTOnAssocRsp(struct adapter *padapter)
|
||||
|
|
@ -987,7 +986,7 @@ void HTOnAssocRsp(struct adapter *padapter)
|
|||
unsigned char min_MPDU_spacing;
|
||||
/* struct registry_priv *pregpriv = &padapter->registrypriv; */
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable)) {
|
||||
pmlmeinfo->HT_enable = 1;
|
||||
|
|
@ -1014,20 +1013,20 @@ void HTOnAssocRsp(struct adapter *padapter)
|
|||
void ERP_IE_handler(struct adapter *padapter, struct ndis_80211_var_ie *pIE)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if (pIE->length > 1)
|
||||
return;
|
||||
|
||||
pmlmeinfo->ERP_enable = 1;
|
||||
memcpy(&(pmlmeinfo->ERP_IE), pIE->data, pIE->length);
|
||||
memcpy(&pmlmeinfo->ERP_IE, pIE->data, pIE->length);
|
||||
}
|
||||
|
||||
void VCS_update(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
switch (pregpriv->vrtl_carrier_sense) {/* 0:off 1:on 2:auto */
|
||||
case 0: /* off */
|
||||
|
|
@ -1082,7 +1081,7 @@ int rtw_check_bcn_info(struct adapter *Adapter, u8 *pframe, u32 packet_len)
|
|||
unsigned int len;
|
||||
unsigned char *p;
|
||||
unsigned short val16, subtype;
|
||||
struct wlan_network *cur_network = &(Adapter->mlmepriv.cur_network);
|
||||
struct wlan_network *cur_network = &Adapter->mlmepriv.cur_network;
|
||||
/* u8 wpa_ie[255], rsn_ie[255]; */
|
||||
u16 wpa_len = 0, rsn_len = 0;
|
||||
u8 encryp_protocol = 0;
|
||||
|
|
@ -1304,8 +1303,8 @@ unsigned int is_ap_in_tkip(struct adapter *padapter)
|
|||
u32 i;
|
||||
struct ndis_80211_var_ie *pIE;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
|
||||
|
||||
if (rtw_get_capability((struct wlan_bssid_ex *)cur_network) & WLAN_CAPABILITY_PRIVACY) {
|
||||
for (i = sizeof(struct ndis_802_11_fix_ie); i < pmlmeinfo->network.ie_length;) {
|
||||
|
|
@ -1348,7 +1347,7 @@ int support_short_GI(struct adapter *padapter, struct HT_caps_element *pHT_caps,
|
|||
{
|
||||
unsigned char bit_offset;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
if (!(pmlmeinfo->HT_enable))
|
||||
return _FAIL;
|
||||
|
|
@ -1376,7 +1375,7 @@ unsigned char get_highest_rate_idx(u32 mask)
|
|||
return rate_idx;
|
||||
}
|
||||
|
||||
void Update_RA_Entry(struct adapter *padapter, struct sta_info *psta)
|
||||
void update_ra_entry(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
rtw_hal_update_ra_mask(psta, 0);
|
||||
}
|
||||
|
|
@ -1384,7 +1383,7 @@ void Update_RA_Entry(struct adapter *padapter, struct sta_info *psta)
|
|||
void set_sta_rate(struct adapter *padapter, struct sta_info *psta)
|
||||
{
|
||||
/* rate adaptive */
|
||||
Update_RA_Entry(padapter, psta);
|
||||
update_ra_entry(padapter, psta);
|
||||
}
|
||||
|
||||
static u32 get_realtek_assoc_AP_vender(struct ndis_80211_var_ie *pIE)
|
||||
|
|
@ -1454,7 +1453,7 @@ unsigned char check_assoc_AP(u8 *pframe, uint len)
|
|||
void update_IOT_info(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
switch (pmlmeinfo->assoc_AP_vendor) {
|
||||
case HT_IOT_PEER_MARVELL:
|
||||
|
|
@ -1466,13 +1465,13 @@ void update_IOT_info(struct adapter *padapter)
|
|||
pmlmeinfo->turboMode_cts2self = 0;
|
||||
pmlmeinfo->turboMode_rtsen = 1;
|
||||
/* disable high power */
|
||||
Switch_DM_Func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
|
||||
switch_dm_func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
|
||||
break;
|
||||
case HT_IOT_PEER_REALTEK:
|
||||
/* rtw_write16(padapter, 0x4cc, 0xffff); */
|
||||
/* rtw_write16(padapter, 0x546, 0x01c0); */
|
||||
/* disable high power */
|
||||
Switch_DM_Func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
|
||||
switch_dm_func(padapter, ((u32)(~DYNAMIC_BB_DYNAMIC_TXPWR)), false);
|
||||
break;
|
||||
default:
|
||||
pmlmeinfo->turboMode_cts2self = 0;
|
||||
|
|
@ -1484,7 +1483,7 @@ void update_IOT_info(struct adapter *padapter)
|
|||
void update_capinfo(struct adapter *Adapter, u16 updateCap)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
bool ShortPreamble;
|
||||
|
||||
/* Check preamble mode, 2005.01.06, by rcnjko. */
|
||||
|
|
@ -1536,8 +1535,8 @@ void update_wireless_mode(struct adapter *padapter)
|
|||
int network_type = 0;
|
||||
u32 SIFS_Timer;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
|
||||
unsigned char *rate = cur_network->supported_rates;
|
||||
|
||||
if ((pmlmeinfo->HT_info_enable) && (pmlmeinfo->HT_caps_enable))
|
||||
|
|
@ -1560,7 +1559,7 @@ void update_wireless_mode(struct adapter *padapter)
|
|||
|
||||
SetHwReg8723BS(padapter, HW_VAR_RESP_SIFS, (u8 *)&SIFS_Timer);
|
||||
|
||||
SetHwReg8723BS(padapter, HW_VAR_WIRELESS_MODE, (u8 *)&(pmlmeext->cur_wireless_mode));
|
||||
SetHwReg8723BS(padapter, HW_VAR_WIRELESS_MODE, (u8 *)&pmlmeext->cur_wireless_mode);
|
||||
|
||||
if (pmlmeext->cur_wireless_mode & WIRELESS_11B)
|
||||
update_mgnt_tx_rate(padapter, IEEE80211_CCK_RATE_1MB);
|
||||
|
|
@ -1585,8 +1584,8 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
|
|||
unsigned int ie_len;
|
||||
struct ndis_80211_var_ie *pIE;
|
||||
int support_rate_num = 0;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
pIE = (struct ndis_80211_var_ie *)rtw_get_ie(pvar_ie, WLAN_EID_SUPP_RATES, &ie_len, var_ie_len);
|
||||
if (!pIE)
|
||||
|
|
@ -1612,7 +1611,7 @@ void process_addba_req(struct adapter *padapter, u8 *paddba_req, u8 *addr)
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct ADDBA_request *preq = (struct ADDBA_request *)paddba_req;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, addr);
|
||||
|
||||
|
|
@ -1655,7 +1654,7 @@ void adaptive_early_32k(struct mlme_ext_priv *pmlmeext, u8 *pframe, uint len)
|
|||
__le32 *pbuf;
|
||||
u64 tsf = 0;
|
||||
u32 delay_ms;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
pmlmeext->bcn_cnt++;
|
||||
|
||||
|
|
|
|||
|
|
@ -185,7 +185,8 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct adapter *padapter)
|
|||
pxmitbuf->phead = pxmitbuf->pbuf;
|
||||
pxmitbuf->pend = pxmitbuf->pbuf + MAX_XMITBUF_SZ;
|
||||
pxmitbuf->len = 0;
|
||||
pxmitbuf->pdata = pxmitbuf->ptail = pxmitbuf->phead;
|
||||
pxmitbuf->pdata = pxmitbuf->phead;
|
||||
pxmitbuf->ptail = pxmitbuf->phead;
|
||||
|
||||
pxmitbuf->flags = XMIT_VO_QUEUE;
|
||||
|
||||
|
|
@ -419,7 +420,7 @@ static void update_attrib_vcs_info(struct adapter *padapter, struct xmit_frame *
|
|||
/* IOT action */
|
||||
if ((pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_ATHEROS) &&
|
||||
pattrib->ampdu_en &&
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)) {
|
||||
(padapter->securitypriv.dot11_privacy_algrthm == _AES_)) {
|
||||
pattrib->vcs_mode = CTS_TO_SELF;
|
||||
break;
|
||||
}
|
||||
|
|
@ -505,9 +506,8 @@ static void update_attrib_phy_info(struct adapter *padapter, struct pkt_attrib *
|
|||
pattrib->retry_ctrl = false;
|
||||
}
|
||||
|
||||
static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
|
||||
static int update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *pattrib, struct sta_info *psta)
|
||||
{
|
||||
signed int res = _SUCCESS;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
signed int bmcast = is_multicast_ether_addr(pattrib->ra);
|
||||
|
|
@ -519,20 +519,18 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
|
|||
if (psta->ieee8021x_blocked) {
|
||||
pattrib->encrypt = 0;
|
||||
|
||||
if ((pattrib->ether_type != 0x888e) && !check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if ((pattrib->ether_type != 0x888e) && !check_fwstate(pmlmepriv, WIFI_MP_STATE))
|
||||
return -EINVAL;
|
||||
} else {
|
||||
GET_ENCRY_ALGO(psecuritypriv, psta, pattrib->encrypt, bmcast);
|
||||
|
||||
switch (psecuritypriv->dot11AuthAlgrthm) {
|
||||
case dot11AuthAlgrthm_Open:
|
||||
case dot11AuthAlgrthm_Shared:
|
||||
case dot11AuthAlgrthm_Auto:
|
||||
switch (psecuritypriv->dot11_auth_algrthm) {
|
||||
case dot11_auth_algrthm_open:
|
||||
case dot11_auth_algrthm_shared:
|
||||
case dot11_auth_algrthm_auto:
|
||||
pattrib->key_idx = (u8)psecuritypriv->dot11PrivacyKeyIndex;
|
||||
break;
|
||||
case dot11AuthAlgrthm_8021X:
|
||||
case dot11_auth_algrthm_8021x:
|
||||
if (bmcast)
|
||||
pattrib->key_idx = (u8)psecuritypriv->dot118021XGrpKeyid;
|
||||
else
|
||||
|
|
@ -560,10 +558,8 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
|
|||
pattrib->iv_len = 8;
|
||||
pattrib->icv_len = 4;
|
||||
|
||||
if (psecuritypriv->busetkipkey == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (psecuritypriv->busetkipkey == _FAIL)
|
||||
return -EINVAL;
|
||||
|
||||
if (bmcast)
|
||||
TKIP_IV(pattrib->iv, psta->dot11txpn, pattrib->key_idx);
|
||||
|
|
@ -601,9 +597,7 @@ static s32 update_attrib_sec_info(struct adapter *padapter, struct pkt_attrib *p
|
|||
else
|
||||
pattrib->bswenc = false;
|
||||
|
||||
exit:
|
||||
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
u8 qos_acm(u8 acm_mask, u8 priority)
|
||||
|
|
@ -661,7 +655,7 @@ static int set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct pkt_attrib *pattrib)
|
||||
static int update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct pkt_attrib *pattrib)
|
||||
{
|
||||
struct pkt_file pktfile;
|
||||
struct sta_info *psta = NULL;
|
||||
|
|
@ -671,7 +665,6 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
signed int res = _SUCCESS;
|
||||
int ret;
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
|
|
@ -748,29 +741,25 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
psta = rtw_get_bcmc_stainfo(padapter);
|
||||
} else {
|
||||
psta = rtw_get_stainfo(pstapriv, pattrib->ra);
|
||||
if (!psta) { /* if we cannot get psta => drop the pkt */
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
} else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED)) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (!psta) /* if we cannot get psta => drop the pkt */
|
||||
return -EINVAL;
|
||||
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE) && !(psta->state & _FW_LINKED))
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!psta) {
|
||||
/* if we cannot get psta => drop the pkt */
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!(psta->state & _FW_LINKED))
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
|
||||
spin_lock_bh(&psta->lock);
|
||||
if (update_attrib_sec_info(padapter, pattrib, psta) == _FAIL) {
|
||||
ret = update_attrib_sec_info(padapter, pattrib, psta);
|
||||
if (ret) {
|
||||
spin_unlock_bh(&psta->lock);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
return ret;
|
||||
}
|
||||
|
||||
update_attrib_phy_info(padapter, pattrib, psta);
|
||||
|
|
@ -806,12 +795,10 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
|||
}
|
||||
|
||||
/* pattrib->priority = 5; force to used VI queue, for testing */
|
||||
|
||||
exit:
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
static int xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
signed int curfragnum, length;
|
||||
u8 *pframe, *payload, mic[8];
|
||||
|
|
@ -834,12 +821,12 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
|
||||
if (bmcst) {
|
||||
if (!memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16))
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
/* start to calculate the mic code */
|
||||
rtw_secmicsetkey(&micdata, psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey);
|
||||
} else {
|
||||
if (!memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16))
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
/* start to calculate the mic code */
|
||||
rtw_secmicsetkey(&micdata, &pattrib->dot11tkiptxmickey.skey[0]);
|
||||
}
|
||||
|
|
@ -890,7 +877,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, struct xmit_frame *pxmitfr
|
|||
pattrib->last_txcmdsz += 8;
|
||||
}
|
||||
}
|
||||
return _SUCCESS;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
|
|
@ -917,7 +904,7 @@ static s32 xmitframe_swencrypt(struct adapter *padapter, struct xmit_frame *pxmi
|
|||
return _SUCCESS;
|
||||
}
|
||||
|
||||
s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib)
|
||||
int rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib)
|
||||
{
|
||||
u16 *qc;
|
||||
|
||||
|
|
@ -925,7 +912,6 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
u8 qos_option = false;
|
||||
signed int res = _SUCCESS;
|
||||
__le16 *fctrl = &pwlanhdr->frame_control;
|
||||
|
||||
memset(hdr, 0, WLANHDR_OFFSET);
|
||||
|
|
@ -965,8 +951,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
|
|||
if (pattrib->qos_en)
|
||||
qos_option = true;
|
||||
} else {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (pattrib->mdata)
|
||||
|
|
@ -994,13 +979,13 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
|
|||
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, pattrib->ra);
|
||||
if (pattrib->psta != psta)
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
|
||||
if (!psta)
|
||||
return _FAIL;
|
||||
return -ENOENT;
|
||||
|
||||
if (!(psta->state & _FW_LINKED))
|
||||
return _FAIL;
|
||||
return -ENOLINK;
|
||||
|
||||
if (psta) {
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
|
||||
|
|
@ -1040,8 +1025,7 @@ s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattr
|
|||
} else {
|
||||
}
|
||||
|
||||
exit:
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
s32 rtw_txframes_pending(struct adapter *padapter)
|
||||
|
|
@ -1081,7 +1065,7 @@ u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib)
|
|||
* 5. move frag chunk from pframe to pxmitframe->mem
|
||||
* 6. apply sw-encrypt, if necessary.
|
||||
*/
|
||||
s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe)
|
||||
int rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe)
|
||||
{
|
||||
struct pkt_file pktfile;
|
||||
|
||||
|
|
@ -1099,21 +1083,19 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
u8 *pbuf_start;
|
||||
|
||||
s32 bmcst = is_multicast_ether_addr(pattrib->ra);
|
||||
s32 res = _SUCCESS;
|
||||
int ret;
|
||||
|
||||
if (!pxmitframe->buf_addr)
|
||||
return _FAIL;
|
||||
return -EINVAL;
|
||||
|
||||
pbuf_start = pxmitframe->buf_addr;
|
||||
|
||||
hw_hdr_offset = TXDESC_OFFSET;
|
||||
mem_start = pbuf_start + hw_hdr_offset;
|
||||
|
||||
if (rtw_make_wlanhdr(padapter, mem_start, pattrib) == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
ret = rtw_make_wlanhdr(padapter, mem_start, pattrib);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
_rtw_open_pktfile(pkt, &pktfile);
|
||||
ret = _rtw_pktfile_read(&pktfile, NULL, pattrib->pkt_hdrlen);
|
||||
|
|
@ -1191,10 +1173,9 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
memcpy(mem_start, pbuf_start + hw_hdr_offset, pattrib->hdrlen);
|
||||
}
|
||||
|
||||
if (xmitframe_addmic(padapter, pxmitframe) == _FAIL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
ret = xmitframe_addmic(padapter, pxmitframe);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
xmitframe_swencrypt(padapter, pxmitframe);
|
||||
|
||||
|
|
@ -1203,8 +1184,7 @@ s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct
|
|||
else
|
||||
pattrib->vcs_mode = NONE_VCS;
|
||||
|
||||
exit:
|
||||
return res;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* broadcast or multicast management pkt use BIP, unicast management pkt use CCMP encryption */
|
||||
|
|
@ -1761,7 +1741,7 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
|
|||
struct sk_buff *pndis_pkt = NULL;
|
||||
|
||||
if (!pxmitframe)
|
||||
goto exit;
|
||||
return _SUCCESS;
|
||||
|
||||
if (pxmitframe->pkt) {
|
||||
pndis_pkt = pxmitframe->pkt;
|
||||
|
|
@ -1794,7 +1774,6 @@ s32 rtw_free_xmitframe(struct xmit_priv *pxmitpriv, struct xmit_frame *pxmitfram
|
|||
if (pndis_pkt)
|
||||
rtw_os_pkt_complete(padapter, pndis_pkt);
|
||||
|
||||
exit:
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -1969,7 +1948,7 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
|
|||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
struct xmit_frame *pxmitframe = NULL;
|
||||
|
||||
s32 res;
|
||||
int ret;
|
||||
|
||||
if (start == 0)
|
||||
start = jiffies;
|
||||
|
|
@ -1982,9 +1961,8 @@ s32 rtw_xmit(struct adapter *padapter, struct sk_buff **ppkt)
|
|||
if (!pxmitframe)
|
||||
return -1;
|
||||
|
||||
res = update_attrib(padapter, *ppkt, &pxmitframe->attrib);
|
||||
|
||||
if (res != _SUCCESS) {
|
||||
ret = update_attrib(padapter, *ppkt, &pxmitframe->attrib);
|
||||
if (ret) {
|
||||
rtw_free_xmitframe(pxmitpriv, pxmitframe);
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -2083,7 +2061,7 @@ signed int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct x
|
|||
pstapriv->sta_dz_bitmap |= BIT(0);
|
||||
|
||||
if (update_tim)
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
else
|
||||
chk_bmc_sleepq_cmd(padapter);
|
||||
|
||||
|
|
@ -2138,7 +2116,7 @@ signed int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct x
|
|||
|
||||
if (update_tim)
|
||||
/* update BCN for TIM IE */
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
}
|
||||
|
||||
ret = true;
|
||||
|
|
@ -2150,7 +2128,9 @@ signed int xmitframe_enqueue_for_sleeping_sta(struct adapter *padapter, struct x
|
|||
return ret;
|
||||
}
|
||||
|
||||
static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter, struct sta_info *psta, struct __queue *pframequeue)
|
||||
static void dequeue_xmitframes_to_sleeping_queue(struct adapter *padapter,
|
||||
struct sta_info *psta,
|
||||
struct __queue *pframequeue)
|
||||
{
|
||||
signed int ret;
|
||||
struct list_head *plist, *phead, *tmp;
|
||||
|
|
@ -2333,7 +2313,7 @@ void wakeup_sta_to_xmit(struct adapter *padapter, struct sta_info *psta)
|
|||
spin_unlock_bh(&pxmitpriv->lock);
|
||||
|
||||
if (update_mask)
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
}
|
||||
|
||||
void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *psta)
|
||||
|
|
@ -2393,7 +2373,7 @@ void xmit_delivery_enabled_frames(struct adapter *padapter, struct sta_info *pst
|
|||
if ((psta->sleepq_ac_len == 0) && (!psta->has_legacy_ac) && (wmmps_ac)) {
|
||||
pstapriv->tim_bitmap &= ~BIT(psta->aid);
|
||||
|
||||
update_beacon(padapter, WLAN_EID_TIM, NULL, true);
|
||||
update_beacon(padapter, WLAN_EID_TIM, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ static void halbtc8723b2ant_LimitedRx(
|
|||
u8 rxAggSize = aggBufSize;
|
||||
|
||||
/* */
|
||||
/* Rx Aggregation related setting */
|
||||
/* Rx Aggregation related setting */
|
||||
/* */
|
||||
pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg);
|
||||
/* decide BT control aggregation buf size or not */
|
||||
|
|
@ -181,7 +181,7 @@ static void halbtc8723b2ant_LimitedRx(
|
|||
|
||||
static void halbtc8723b2ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
|
||||
{
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
|
||||
pCoexSta->bC2hBtInfoReqSent = true;
|
||||
|
||||
|
|
@ -417,7 +417,7 @@ static void halbtc8723b2ant_SetFwDacSwingLevel(
|
|||
struct btc_coexist *pBtCoexist, u8 dacSwingLvl
|
||||
)
|
||||
{
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
|
||||
/* There are several type of dacswing */
|
||||
/* 0x18/ 0x10/ 0xc/ 0x8/ 0x4/ 0x6 */
|
||||
|
|
@ -430,7 +430,7 @@ static void halbtc8723b2ant_SetFwDecBtPwr(
|
|||
struct btc_coexist *pBtCoexist, u8 decBtPwrLvl
|
||||
)
|
||||
{
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
|
||||
H2C_Parameter[0] = decBtPwrLvl;
|
||||
|
||||
|
|
@ -504,7 +504,7 @@ static void halbtc8723b2ant_SetSwPenaltyTxRateAdaptive(
|
|||
struct btc_coexist *pBtCoexist, bool bLowPenaltyRa
|
||||
)
|
||||
{
|
||||
u8 H2C_Parameter[6] = {0};
|
||||
u8 H2C_Parameter[6] = {0};
|
||||
|
||||
H2C_Parameter[0] = 0x6; /* opCode, 0x6 = Retry_Penalty */
|
||||
|
||||
|
|
@ -743,7 +743,7 @@ static void halbtc8723b2ant_SetFwIgnoreWlanAct(
|
|||
struct btc_coexist *pBtCoexist, bool bEnable
|
||||
)
|
||||
{
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
u8 H2C_Parameter[1] = {0};
|
||||
|
||||
if (bEnable)
|
||||
H2C_Parameter[0] |= BIT(0); /* function enable */
|
||||
|
|
@ -775,7 +775,7 @@ static void halbtc8723b2ant_SetFwPstdma(
|
|||
u8 byte5
|
||||
)
|
||||
{
|
||||
u8 H2C_Parameter[5] = {0};
|
||||
u8 H2C_Parameter[5] = {0};
|
||||
|
||||
H2C_Parameter[0] = byte1;
|
||||
H2C_Parameter[1] = byte2;
|
||||
|
|
@ -824,7 +824,7 @@ static void halbtc8723b2ant_SetAntPath(
|
|||
u32 fwVer = 0, u4Tmp = 0;
|
||||
bool bPgExtSwitch = false;
|
||||
bool bUseExtSwitch = false;
|
||||
u8 H2C_Parameter[2] = {0};
|
||||
u8 H2C_Parameter[2] = {0};
|
||||
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch);
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */
|
||||
|
|
@ -2341,9 +2341,9 @@ void EXhalbtc8723b2ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
|
|||
/* */
|
||||
/* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */
|
||||
/* Local setting bit define */
|
||||
/* BIT0: "0" for no antenna inverse; "1" for antenna inverse */
|
||||
/* BIT1: "0" for internal switch; "1" for external switch */
|
||||
/* BIT2: "0" for one antenna; "1" for two antenna */
|
||||
/* BIT0: "0" for no antenna inverse; "1" for antenna inverse */
|
||||
/* BIT1: "0" for internal switch; "1" for external switch */
|
||||
/* BIT2: "0" for one antenna; "1" for two antenna */
|
||||
/* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */
|
||||
if (pBtCoexist->chipInterface == BTC_INTF_USB) {
|
||||
/* fixed at S0 for USB interface */
|
||||
|
|
@ -2460,8 +2460,8 @@ void EXhalbtc8723b2ant_BtInfoNotify(
|
|||
struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length
|
||||
)
|
||||
{
|
||||
u8 btInfo = 0;
|
||||
u8 i, rspSource = 0;
|
||||
u8 btInfo = 0;
|
||||
u8 i, rspSource = 0;
|
||||
bool bBtBusy = false, bLimitedDig = false;
|
||||
bool bWifiConnected = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -219,13 +219,13 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)
|
|||
pDM_Odm->RFCalibrateInfo.OFDM_index[p];
|
||||
|
||||
/* 4 7.1 Handle boundary conditions of index. */
|
||||
if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM-1)
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM-1;
|
||||
if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM - 1)
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM - 1;
|
||||
else if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] < OFDM_min_index)
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = OFDM_min_index;
|
||||
}
|
||||
if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK-1)
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK-1;
|
||||
if (pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK - 1)
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK - 1;
|
||||
/* else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0) */
|
||||
/* pDM_Odm->RFCalibrateInfo.CCK_index = 0; */
|
||||
} else {
|
||||
|
|
@ -233,10 +233,6 @@ void ODM_TXPowerTrackingCallback_ThermalMeter(struct adapter *Adapter)
|
|||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0;
|
||||
}
|
||||
|
||||
/* Print Swing base & current */
|
||||
for (p = RF_PATH_A; p < c.RfPathCount; p++) {
|
||||
}
|
||||
|
||||
if (
|
||||
(pDM_Odm->RFCalibrateInfo.PowerIndexOffset[RF_PATH_A] != 0 ||
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[RF_PATH_B] != 0) &&
|
||||
|
|
|
|||
|
|
@ -349,17 +349,17 @@ static u8 phy_PathA_IQK_8723B(
|
|||
struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
|
||||
|
||||
/* Save RF Path */
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord);
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord);
|
||||
|
||||
/* leave IQK mode */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000);
|
||||
|
||||
/* enable path A PA in TXIQK mode */
|
||||
/* enable path A PA in TXIQK mode */
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_WE_LUT, 0x80000, 0x1);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0003f);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xc7f87);
|
||||
/* disable path B PA in TXIQK mode */
|
||||
/* disable path B PA in TXIQK mode */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xed, bRFRegOffsetMask, 0x00020); */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0x43, bRFRegOffsetMask, 0x40ec1); */
|
||||
|
||||
|
|
@ -387,10 +387,10 @@ static u8 phy_PathA_IQK_8723B(
|
|||
/* Ant switch */
|
||||
if (configPathB || (RF_Path == 0))
|
||||
/* wifi switch to S1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000000);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000000);
|
||||
else
|
||||
/* wifi switch to S0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800);
|
||||
|
|
@ -404,7 +404,7 @@ static u8 phy_PathA_IQK_8723B(
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -447,7 +447,7 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
|
||||
|
||||
/* Save RF Path */
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord);
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord);
|
||||
|
||||
/* leave IQK mode */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000);
|
||||
|
|
@ -486,10 +486,10 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
/* Ant switch */
|
||||
if (configPathB || (RF_Path == 0))
|
||||
/* wifi switch to S1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000000);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000000);
|
||||
else
|
||||
/* wifi switch to S0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800);
|
||||
|
|
@ -503,7 +503,7 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -572,10 +572,10 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
/* Ant switch */
|
||||
if (configPathB || (RF_Path == 0))
|
||||
/* wifi switch to S1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000000);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000000);
|
||||
else
|
||||
/* wifi switch to S0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00000800);
|
||||
|
|
@ -589,7 +589,7 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -600,7 +600,7 @@ static u8 phy_PathA_RxIQK8723B(
|
|||
regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord);
|
||||
|
||||
/* PA/PAD controlled by 0x0 */
|
||||
/* PA/PAD controlled by 0x0 */
|
||||
/* leave IQK mode */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x780);
|
||||
|
|
@ -632,17 +632,17 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter)
|
|||
struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
|
||||
|
||||
/* Save RF Path */
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord);
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord);
|
||||
|
||||
/* leave IQK mode */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000);
|
||||
|
||||
/* in TXIQK mode */
|
||||
/* in TXIQK mode */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_WE_LUT, 0x80000, 0x1); */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x20000); */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0003f); */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xc7f87); */
|
||||
/* enable path B PA in TXIQK mode */
|
||||
/* enable path B PA in TXIQK mode */
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xed, 0x20, 0x1);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0x43, bRFRegOffsetMask, 0x30fc1);
|
||||
|
||||
|
|
@ -669,7 +669,7 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter)
|
|||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x808000);
|
||||
|
||||
/* switch to path B */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xb0, bRFRegOffsetMask, 0xeffe0); */
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
|
|
@ -684,7 +684,7 @@ static u8 phy_PathB_IQK_8723B(struct adapter *padapter)
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -723,12 +723,12 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
struct dm_odm_t *pDM_Odm = &pHalData->odmpriv;
|
||||
|
||||
/* Save RF Path */
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord);
|
||||
Path_SEL_BB = PHY_QueryBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord);
|
||||
/* leave IQK mode */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x000000);
|
||||
|
||||
/* switch to path B */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
/* modify RXIQK mode table */
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_WE_LUT, 0x80000, 0x1);
|
||||
PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x18000);
|
||||
|
|
@ -761,7 +761,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x808000);
|
||||
|
||||
/* switch to path B */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xb0, bRFRegOffsetMask, 0xeffe0); */
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
|
|
@ -776,7 +776,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -847,7 +847,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, bMaskH3Bytes, 0x808000);
|
||||
|
||||
/* switch to path B */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, 0x00000280);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, 0x00000280);
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_A, 0xb0, bRFRegOffsetMask, 0xeffe0); */
|
||||
|
||||
/* GNT_BT = 0 */
|
||||
|
|
@ -862,7 +862,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
mdelay(IQK_DELAY_TIME_8723B);
|
||||
|
||||
/* restore Ant Path */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x948, bMaskDWord, Path_SEL_BB);
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, rS0S1_PathSwitch, bMaskDWord, Path_SEL_BB);
|
||||
/* GNT_BT = 1 */
|
||||
PHY_SetBBReg(pDM_Odm->Adapter, 0x764, bMaskDWord, 0x00001800);
|
||||
|
||||
|
|
@ -873,7 +873,7 @@ static u8 phy_PathB_RxIQK8723B(struct adapter *padapter, bool configPathB)
|
|||
regEAC = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regEA4 = PHY_QueryBBReg(pDM_Odm->Adapter, rRx_Power_Before_IQK_A_2, bMaskDWord);
|
||||
|
||||
/* PA/PAD controlled by 0x0 */
|
||||
/* PA/PAD controlled by 0x0 */
|
||||
/* leave IQK mode */
|
||||
/* PHY_SetBBReg(pDM_Odm->Adapter, rFPGA0_IQK, 0xffffff00, 0x00000000); */
|
||||
/* PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH_B, 0xdf, bRFRegOffsetMask, 0x180); */
|
||||
|
|
@ -1322,7 +1322,7 @@ static void phy_IQCalibrate_8723B(
|
|||
const u32 retryCount = 2;
|
||||
|
||||
/* Note: IQ calibration must be performed after loading */
|
||||
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
||||
/* PHY_REG.txt , and radio_a, radio_b.txt */
|
||||
|
||||
/* u32 bbvalue; */
|
||||
|
||||
|
|
@ -1554,7 +1554,7 @@ void PHY_IQCalibrate_8723B(
|
|||
rOFDM0_RxIQExtAnta
|
||||
};
|
||||
/* u32 Path_SEL_BB = 0; */
|
||||
u32 GNT_BT_default;
|
||||
u32 GNT_BT_default;
|
||||
|
||||
if (!ODM_CheckPowerStatus(padapter))
|
||||
return;
|
||||
|
|
@ -1745,7 +1745,7 @@ void PHY_IQCalibrate_8723B(
|
|||
void PHY_LCCalibrate_8723B(struct dm_odm_t *pDM_Odm)
|
||||
{
|
||||
bool bSingleTone = false, bCarrierSuppression = false;
|
||||
u32 timeout = 2000, timecount = 0;
|
||||
u32 timeout = 2000, timecount = 0;
|
||||
|
||||
if (!(pDM_Odm->SupportAbility & ODM_RF_CALIBRATION))
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -4,22 +4,22 @@
|
|||
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
|
||||
*
|
||||
******************************************************************************/
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
HalPwrSeqCmd.c
|
||||
|
||||
Abstract:
|
||||
Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
2011-07-07 Roger Create.
|
||||
|
||||
--*/
|
||||
/*
|
||||
* Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
*
|
||||
* Module Name:
|
||||
* HalPwrSeqCmd.c
|
||||
*
|
||||
* Abstract:
|
||||
* Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
*
|
||||
* Major Change History:
|
||||
* When Who What
|
||||
* ---------- --------------- -------------------------------
|
||||
* 2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
* 2011-07-07 Roger Create.
|
||||
*
|
||||
*/
|
||||
#include <drv_types.h>
|
||||
#include <HalPwrSeqCmd.h>
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ u8 HalPwrSeqCmdParsing(
|
|||
value &= (~(GET_PWR_CFG_MASK(PwrCfgCmd)));
|
||||
value |= (
|
||||
GET_PWR_CFG_VALUE(PwrCfgCmd)
|
||||
&GET_PWR_CFG_MASK(PwrCfgCmd)
|
||||
& GET_PWR_CFG_MASK(PwrCfgCmd)
|
||||
);
|
||||
|
||||
/* Write the value back to system register */
|
||||
|
|
@ -105,7 +105,7 @@ u8 HalPwrSeqCmdParsing(
|
|||
else
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value = value&GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
value = value & GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
if (
|
||||
value == (GET_PWR_CFG_VALUE(PwrCfgCmd) &
|
||||
GET_PWR_CFG_MASK(PwrCfgCmd))
|
||||
|
|
@ -125,7 +125,7 @@ u8 HalPwrSeqCmdParsing(
|
|||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
|
||||
udelay(GET_PWR_CFG_OFFSET(PwrCfgCmd) * 1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@
|
|||
#include <hal_btcoex.h>
|
||||
#include <Mp_Precomp.h>
|
||||
|
||||
/* Global variables */
|
||||
/* Global variables */
|
||||
|
||||
struct btc_coexist GLBtCoexist;
|
||||
static u8 GLBtcWiFiInScanState;
|
||||
static u8 GLBtcWiFiInIQKState;
|
||||
|
||||
/* */
|
||||
/* Debug related function */
|
||||
/* Debug related function */
|
||||
/* */
|
||||
static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist)
|
||||
{
|
||||
|
|
@ -316,7 +316,7 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
|
|||
break;
|
||||
|
||||
case BTC_GET_BL_WIFI_ENABLE_ENCRYPTION:
|
||||
*pu8 = padapter->securitypriv.dot11PrivacyAlgrthm != 0;
|
||||
*pu8 = padapter->securitypriv.dot11_privacy_algrthm != 0;
|
||||
break;
|
||||
|
||||
case BTC_GET_BL_WIFI_UNDER_B_MODE:
|
||||
|
|
@ -549,7 +549,7 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
|
|||
}
|
||||
|
||||
/* */
|
||||
/* IO related function */
|
||||
/* IO related function */
|
||||
/* */
|
||||
static u8 halbtcoutsrc_Read1Byte(void *pBtcContext, u32 RegAddr)
|
||||
{
|
||||
|
|
@ -747,7 +747,7 @@ static void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen,
|
|||
}
|
||||
|
||||
/* */
|
||||
/* Extern functions called by other module */
|
||||
/* Extern functions called by other module */
|
||||
/* */
|
||||
static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ static void _TwoOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
|
|||
|
||||
if (bWIFICfg) { /* WMM */
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 0, 1, 0, 1, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:ep_0 num, 1:ep_1 num */
|
||||
|
||||
|
|
@ -359,7 +359,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
|
|||
|
||||
if (bWIFICfg) { /* for WMM */
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 1, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
|
|
@ -375,7 +375,7 @@ static void _ThreeOutPipeMapping(struct adapter *padapter, bool bWIFICfg)
|
|||
|
||||
} else { /* typical setting */
|
||||
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* BK, BE, VI, VO, BCN, CMD, MGT, HIGH, HCCA */
|
||||
/* 2, 2, 1, 0, 0, 0, 0, 0, 0 }; */
|
||||
/* 0:H, 1:N, 2:L */
|
||||
|
||||
|
|
@ -548,7 +548,7 @@ void SetHwReg(struct adapter *adapter, u8 variable, u8 *val)
|
|||
|
||||
if (val) { /* Enable default key related setting */
|
||||
reg_scr |= SCR_TXBCUSEDK;
|
||||
if (sec->dot11AuthAlgrthm != dot11AuthAlgrthm_8021X)
|
||||
if (sec->dot11_auth_algrthm != dot11_auth_algrthm_8021x)
|
||||
reg_scr |= (SCR_RxUseDK|SCR_TxUseDK);
|
||||
} else /* Disable default key related setting */
|
||||
reg_scr &= ~(SCR_RXBCUSEDK|SCR_TXBCUSEDK|SCR_RxUseDK|SCR_TxUseDK);
|
||||
|
|
@ -643,12 +643,6 @@ u8 GetHalDefVar(
|
|||
case HAL_DEF_DBG_DM_FUNC:
|
||||
*((u32 *)value) = hal_data->odmpriv.SupportAbility;
|
||||
break;
|
||||
case HAL_DEF_DBG_DUMP_RXPKT:
|
||||
*((u8 *)value) = hal_data->bDumpRxPkt;
|
||||
break;
|
||||
case HAL_DEF_DBG_DUMP_TXPKT:
|
||||
*((u8 *)value) = hal_data->bDumpTxPkt;
|
||||
break;
|
||||
case HAL_DEF_ANT_DETECT:
|
||||
*((u8 *)value) = hal_data->AntDetection;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -329,16 +329,6 @@ static void PHY_StoreTxPowerByRateNew(struct adapter *padapter, u32 RfPath,
|
|||
}
|
||||
}
|
||||
|
||||
static void PHY_StoreTxPowerByRateOld(
|
||||
struct adapter *padapter, u32 RegAddr, u32 BitMask, u32 Data
|
||||
)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 index = PHY_GetRateSectionIndexOfTxPowerByRate(padapter, RegAddr, BitMask);
|
||||
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][index] = Data;
|
||||
}
|
||||
|
||||
void PHY_InitTxPowerByRate(struct adapter *padapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
|
@ -362,9 +352,6 @@ void PHY_StoreTxPowerByRate(
|
|||
|
||||
if (pDM_Odm->PhyRegPgVersion > 0)
|
||||
PHY_StoreTxPowerByRateNew(padapter, RfPath, RegAddr, BitMask, Data);
|
||||
else if (pDM_Odm->PhyRegPgVersion == 0) {
|
||||
PHY_StoreTxPowerByRateOld(padapter, RegAddr, BitMask, Data);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -459,7 +446,7 @@ u8 PHY_GetTxPowerIndexBase(
|
|||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 txPower = 0;
|
||||
u8 chnlIdx = (Channel-1);
|
||||
u8 chnlIdx = (Channel - 1);
|
||||
|
||||
if (!HAL_IsLegalChannel(padapter, Channel))
|
||||
chnlIdx = 0;
|
||||
|
|
|
|||
|
|
@ -9,18 +9,18 @@
|
|||
|
||||
static void rtw_hal_init_opmode(struct adapter *padapter)
|
||||
{
|
||||
enum ndis_802_11_network_infrastructure networkType = Ndis802_11InfrastructureMax;
|
||||
enum nl80211_iftype networkType = NL80211_IFTYPE_UNSPECIFIED;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
signed int fw_state;
|
||||
|
||||
fw_state = get_fwstate(pmlmepriv);
|
||||
|
||||
if (fw_state & WIFI_ADHOC_STATE)
|
||||
networkType = Ndis802_11IBSS;
|
||||
networkType = NL80211_IFTYPE_ADHOC;
|
||||
else if (fw_state & WIFI_STATION_STATE)
|
||||
networkType = Ndis802_11Infrastructure;
|
||||
networkType = NL80211_IFTYPE_STATION;
|
||||
else if (fw_state & WIFI_AP_STATE)
|
||||
networkType = Ndis802_11APMode;
|
||||
networkType = NL80211_IFTYPE_AP;
|
||||
else
|
||||
return;
|
||||
|
||||
|
|
@ -170,9 +170,8 @@ void rtw_hal_update_ra_mask(struct sta_info *psta, u8 rssi_level)
|
|||
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
|
||||
add_ratid(padapter, psta, rssi_level);
|
||||
else {
|
||||
else
|
||||
UpdateHalRAMask8723B(padapter, psta->mac_id, rssi_level);
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_hal_add_ra_tid(struct adapter *padapter, u32 bitmap, u8 *arg, u8 rssi_level)
|
||||
|
|
@ -216,9 +215,8 @@ void rtw_hal_dm_watchdog(struct adapter *padapter)
|
|||
|
||||
void rtw_hal_dm_watchdog_in_lps(struct adapter *padapter)
|
||||
{
|
||||
if (adapter_to_pwrctl(padapter)->fw_current_in_ps_mode) {
|
||||
if (adapter_to_pwrctl(padapter)->fw_current_in_ps_mode)
|
||||
rtl8723b_HalDmWatchDog_in_LPS(padapter); /* this function caller is in interrupt context */
|
||||
}
|
||||
}
|
||||
|
||||
void beacon_timing_control(struct adapter *padapter)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ u8 rtw_hal_sdio_query_tx_freepage(
|
|||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if ((pHalData->SdioTxFIFOFreePage[PageIdx]+pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]) >= (RequiredPageNum))
|
||||
if ((pHalData->SdioTxFIFOFreePage[PageIdx] + pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX]) >= (RequiredPageNum))
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
|
@ -39,8 +39,6 @@ void rtw_hal_sdio_update_tx_freepage(
|
|||
u8 RequiredPublicFreePgNum = 0;
|
||||
/* _irqL irql; */
|
||||
|
||||
/* spin_lock_bh(&pHalData->SdioTxFIFOFreePageLock); */
|
||||
|
||||
DedicatedPgNum = pHalData->SdioTxFIFOFreePage[PageIdx];
|
||||
if (RequiredPageNum <= DedicatedPgNum) {
|
||||
pHalData->SdioTxFIFOFreePage[PageIdx] -= RequiredPageNum;
|
||||
|
|
@ -49,8 +47,6 @@ void rtw_hal_sdio_update_tx_freepage(
|
|||
RequiredPublicFreePgNum = RequiredPageNum - DedicatedPgNum;
|
||||
pHalData->SdioTxFIFOFreePage[PUBLIC_QUEUE_IDX] -= RequiredPublicFreePgNum;
|
||||
}
|
||||
|
||||
/* spin_unlock_bh(&pHalData->SdioTxFIFOFreePageLock); */
|
||||
}
|
||||
|
||||
void rtw_hal_set_sdio_tx_max_length(
|
||||
|
|
|
|||
|
|
@ -257,7 +257,7 @@ static void odm_RefreshRateAdaptiveMaskCE(struct dm_odm_t *pDM_Odm)
|
|||
u8 i;
|
||||
struct adapter *padapter = pDM_Odm->Adapter;
|
||||
|
||||
if (padapter->bDriverStopped)
|
||||
if (padapter->driver_stopped)
|
||||
return;
|
||||
|
||||
if (!pDM_Odm->bUseRAMask)
|
||||
|
|
|
|||
|
|
@ -942,13 +942,6 @@ struct dm_odm_t { /* DM_Out_Source_Dynamic_Mechanism_Structure */
|
|||
#endif
|
||||
};
|
||||
|
||||
enum odm_rf_content {
|
||||
odm_radioa_txt = 0x1000,
|
||||
odm_radiob_txt = 0x1001,
|
||||
odm_radioc_txt = 0x1002,
|
||||
odm_radiod_txt = 0x1003
|
||||
};
|
||||
|
||||
enum ODM_BB_Config_Type {
|
||||
CONFIG_BB_PHY_REG,
|
||||
CONFIG_BB_AGC_TAB,
|
||||
|
|
|
|||
|
|
@ -590,7 +590,7 @@ void odm_DIGbyRSSI_LPS(void *pDM_VOID)
|
|||
}
|
||||
|
||||
/* 3 ============================================================ */
|
||||
/* 3 FASLE ALARM CHECK */
|
||||
/* 3 FALSE ALARM CHECK */
|
||||
/* 3 ============================================================ */
|
||||
|
||||
void odm_FalseAlarmCounterStatistics(void *pDM_VOID)
|
||||
|
|
|
|||
|
|
@ -77,11 +77,6 @@ struct false_ALARM_STATISTICS {
|
|||
u32 Cnt_BW_LSC; /* Gary */
|
||||
};
|
||||
|
||||
enum ODM_Pause_DIG_TYPE {
|
||||
ODM_PAUSE_DIG = BIT(0),
|
||||
ODM_RESUME_DIG = BIT(1)
|
||||
};
|
||||
|
||||
#define DM_DIG_THRESH_HIGH 40
|
||||
#define DM_DIG_THRESH_LOW 35
|
||||
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ void odm_EdcaTurboCheckCE(void *pDM_VOID)
|
|||
} else {
|
||||
/* Turn Off EDCA turbo here. */
|
||||
/* Restore original EDCA according to the declaration of AP. */
|
||||
if (pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) {
|
||||
if (pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA) {
|
||||
rtw_write32(Adapter, REG_EDCA_BE_PARAM, pHalData->AcParam_BE);
|
||||
pDM_Odm->DM_EDCA_Table.bCurrentTurboEDCA = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -236,9 +236,8 @@ static void odm_rx_phy_status_parsing(struct dm_odm_t *dm_odm,
|
|||
if (is_cck_rate) {
|
||||
phy_info->signal_strength = (u8)(odm_signal_scale_mapping(dm_odm, pwdb_all));
|
||||
} else {
|
||||
if (rf_rx_num != 0) {
|
||||
if (rf_rx_num != 0)
|
||||
phy_info->signal_strength = (u8)(odm_signal_scale_mapping(dm_odm, total_rssi /= rf_rx_num));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -69,24 +69,23 @@ s32 FillH2CCmd8723B(struct adapter *padapter, u8 ElementID, u32 CmdLen, u8 *pCmd
|
|||
if (!_is_fw_read_cmd_down(padapter, h2c_box_num))
|
||||
goto exit;
|
||||
|
||||
if (CmdLen <= 3)
|
||||
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, CmdLen);
|
||||
else {
|
||||
memcpy((u8 *)(&h2c_cmd)+1, pCmdBuffer, 3);
|
||||
memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer+3, CmdLen-3);
|
||||
/* *(u8 *)(&h2c_cmd) |= BIT(7); */
|
||||
if (CmdLen <= 3) {
|
||||
memcpy((u8 *)(&h2c_cmd) + 1, pCmdBuffer, CmdLen);
|
||||
} else {
|
||||
memcpy((u8 *)(&h2c_cmd) + 1, pCmdBuffer, 3);
|
||||
memcpy((u8 *)(&h2c_cmd_ex), pCmdBuffer + 3, CmdLen - 3);
|
||||
}
|
||||
|
||||
*(u8 *)(&h2c_cmd) |= ElementID;
|
||||
|
||||
if (CmdLen > 3) {
|
||||
msgbox_ex_addr = REG_HMEBOX_EXT0_8723B + (h2c_box_num*RTL8723B_EX_MESSAGE_BOX_SIZE);
|
||||
msgbox_ex_addr = REG_HMEBOX_EXT0_8723B + (h2c_box_num * RTL8723B_EX_MESSAGE_BOX_SIZE);
|
||||
rtw_write32(padapter, msgbox_ex_addr, h2c_cmd_ex);
|
||||
}
|
||||
msgbox_addr = REG_HMEBOX_0 + (h2c_box_num*MESSAGE_BOX_SIZE);
|
||||
msgbox_addr = REG_HMEBOX_0 + (h2c_box_num * MESSAGE_BOX_SIZE);
|
||||
rtw_write32(padapter, msgbox_addr, h2c_cmd);
|
||||
|
||||
pHalData->LastHMEBoxNum = (h2c_box_num+1) % MAX_H2C_BOX_NUMS;
|
||||
pHalData->LastHMEBoxNum = (h2c_box_num + 1) % MAX_H2C_BOX_NUMS;
|
||||
|
||||
} while (0);
|
||||
|
||||
|
|
@ -103,21 +102,20 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
struct ieee80211_hdr *pwlanhdr;
|
||||
__le16 *fctrl;
|
||||
u32 rate_len, pktlen;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct wlan_bssid_ex *cur_network = &(pmlmeinfo->network);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
|
||||
|
||||
pwlanhdr = (struct ieee80211_hdr *)pframe;
|
||||
|
||||
fctrl = &(pwlanhdr->frame_control);
|
||||
fctrl = &pwlanhdr->frame_control;
|
||||
*(fctrl) = 0;
|
||||
|
||||
eth_broadcast_addr(pwlanhdr->addr1);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv));
|
||||
ether_addr_copy(pwlanhdr->addr3, get_my_bssid(cur_network));
|
||||
|
||||
SetSeqNum(pwlanhdr, 0/*pmlmeext->mgnt_seq*/);
|
||||
/* pmlmeext->mgnt_seq++; */
|
||||
SetSeqNum(pwlanhdr, 0);
|
||||
SetFrameSubType(pframe, WIFI_BEACON);
|
||||
|
||||
pframe += sizeof(struct ieee80211_hdr_3addr);
|
||||
|
|
@ -139,9 +137,9 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
pframe += 2;
|
||||
pktlen += 2;
|
||||
|
||||
if ((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
||||
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
|
||||
pktlen += cur_network->ie_length - sizeof(struct ndis_802_11_fix_ie);
|
||||
memcpy(pframe, cur_network->ies+sizeof(struct ndis_802_11_fix_ie), pktlen);
|
||||
memcpy(pframe, cur_network->ies + sizeof(struct ndis_802_11_fix_ie), pktlen);
|
||||
|
||||
goto _ConstructBeacon;
|
||||
}
|
||||
|
|
@ -156,12 +154,11 @@ static void ConstructBeacon(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
pframe = rtw_set_ie(pframe, WLAN_EID_SUPP_RATES, ((rate_len > 8) ? 8 : rate_len), cur_network->supported_rates, &pktlen);
|
||||
|
||||
/* DS parameter set */
|
||||
pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&(cur_network->configuration.ds_config), &pktlen);
|
||||
pframe = rtw_set_ie(pframe, WLAN_EID_DS_PARAMS, 1, (unsigned char *)&cur_network->configuration.ds_config, &pktlen);
|
||||
|
||||
if ((pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
|
||||
if ((pmlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE) {
|
||||
u32 ATIMWindow;
|
||||
/* IBSS Parameter Set... */
|
||||
/* ATIMWindow = cur->configuration.ATIMWindow; */
|
||||
ATIMWindow = 0;
|
||||
pframe = rtw_set_ie(pframe, WLAN_EID_IBSS_PARAMS, 2, (unsigned char *)(&ATIMWindow), &pktlen);
|
||||
}
|
||||
|
|
@ -187,13 +184,13 @@ static void ConstructPSPoll(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
{
|
||||
struct ieee80211_hdr *pwlanhdr;
|
||||
__le16 *fctrl;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
pwlanhdr = (struct ieee80211_hdr *)pframe;
|
||||
|
||||
/* Frame control. */
|
||||
fctrl = &(pwlanhdr->frame_control);
|
||||
fctrl = &pwlanhdr->frame_control;
|
||||
*(fctrl) = 0;
|
||||
SetPwrMgt(fctrl);
|
||||
SetFrameSubType(pframe, WIFI_PSPOLL);
|
||||
|
|
@ -202,32 +199,30 @@ static void ConstructPSPoll(struct adapter *padapter, u8 *pframe, u32 *pLength)
|
|||
SetDuration(pframe, (pmlmeinfo->aid | 0xc000));
|
||||
|
||||
/* BSSID. */
|
||||
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)));
|
||||
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&pmlmeinfo->network));
|
||||
|
||||
/* TA. */
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&padapter->eeprompriv));
|
||||
|
||||
*pLength = 16;
|
||||
}
|
||||
|
||||
static void ConstructNullFunctionData(
|
||||
struct adapter *padapter,
|
||||
u8 *pframe,
|
||||
u32 *pLength,
|
||||
u8 *StaAddr,
|
||||
u8 bQoS,
|
||||
u8 AC,
|
||||
u8 bEosp,
|
||||
u8 bForcePowerSave
|
||||
)
|
||||
static void ConstructNullFunctionData(struct adapter *padapter,
|
||||
u8 *pframe,
|
||||
u32 *pLength,
|
||||
u8 *StaAddr,
|
||||
u8 bQoS,
|
||||
u8 AC,
|
||||
u8 bEosp,
|
||||
u8 bForcePowerSave)
|
||||
{
|
||||
struct ieee80211_hdr *pwlanhdr;
|
||||
__le16 *fctrl;
|
||||
u32 pktlen;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *cur_network = &pmlmepriv->cur_network;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
pwlanhdr = (struct ieee80211_hdr *)pframe;
|
||||
|
||||
|
|
@ -237,19 +232,19 @@ static void ConstructNullFunctionData(
|
|||
SetPwrMgt(fctrl);
|
||||
|
||||
switch (cur_network->network.infrastructure_mode) {
|
||||
case Ndis802_11Infrastructure:
|
||||
case NL80211_IFTYPE_STATION:
|
||||
SetToDs(fctrl);
|
||||
ether_addr_copy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)));
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
ether_addr_copy(pwlanhdr->addr3, StaAddr);
|
||||
break;
|
||||
case Ndis802_11APMode:
|
||||
case NL80211_IFTYPE_AP:
|
||||
SetFrDs(fctrl);
|
||||
ether_addr_copy(pwlanhdr->addr1, StaAddr);
|
||||
ether_addr_copy(pwlanhdr->addr2, get_my_bssid(&(pmlmeinfo->network)));
|
||||
ether_addr_copy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)));
|
||||
break;
|
||||
case Ndis802_11IBSS:
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
default:
|
||||
ether_addr_copy(pwlanhdr->addr1, StaAddr);
|
||||
ether_addr_copy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)));
|
||||
|
|
@ -324,7 +319,7 @@ void rtl8723b_set_rssi_cmd(struct adapter *padapter, u8 *param)
|
|||
{
|
||||
u8 u1H2CRssiSettingParm[H2C_RSSI_SETTING_LEN] = {0};
|
||||
u8 mac_id = *param;
|
||||
u8 rssi = *(param+2);
|
||||
u8 rssi = *(param + 2);
|
||||
u8 uldl_state = 0;
|
||||
|
||||
SET_8723B_H2CCMD_RSSI_SETTING_MACID(u1H2CRssiSettingParm, mac_id);
|
||||
|
|
@ -343,9 +338,9 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)
|
|||
u8 PowerState = 0, awake_intvl = 1, byte5 = 0, rlbm = 0;
|
||||
|
||||
if (pwrpriv->dtim > 0 && pwrpriv->dtim < 16)
|
||||
awake_intvl = pwrpriv->dtim+1;/* DTIM = (awake_intvl - 1) */
|
||||
awake_intvl = pwrpriv->dtim + 1;
|
||||
else
|
||||
awake_intvl = 3;/* DTIM =2 */
|
||||
awake_intvl = 3;
|
||||
|
||||
rlbm = 2;
|
||||
|
||||
|
|
@ -394,7 +389,7 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)
|
|||
pmlmeext->DrvBcnTimeOut = 0xff;
|
||||
|
||||
for (i = 0; i < 9; i++) {
|
||||
pmlmeext->bcn_delay_ratio[i] = (pmlmeext->bcn_delay_cnt[i]*100)/pmlmeext->bcn_cnt;
|
||||
pmlmeext->bcn_delay_ratio[i] = (pmlmeext->bcn_delay_cnt[i] * 100) / pmlmeext->bcn_cnt;
|
||||
|
||||
ratio_20_delay += pmlmeext->bcn_delay_ratio[i];
|
||||
ratio_80_delay += pmlmeext->bcn_delay_ratio[i];
|
||||
|
|
@ -416,14 +411,6 @@ void rtl8723b_set_FwPwrMode_cmd(struct adapter *padapter, u8 psmode)
|
|||
|
||||
}
|
||||
|
||||
/* offload to FW if fw version > v15.10
|
||||
pmlmeext->DrvBcnEarly = 0;
|
||||
pmlmeext->DrvBcnTimeOut =7;
|
||||
|
||||
if ((pmlmeext->DrvBcnEarly!= 0Xff) && (pmlmeext->DrvBcnTimeOut!= 0xff))
|
||||
u1H2CPwrModeParm[H2C_PWRMODE_LEN-1] = BIT(0) | ((pmlmeext->DrvBcnEarly<<1)&0x0E) |((pmlmeext->DrvBcnTimeOut<<4)&0xf0) ;
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
hal_btcoex_RecordPwrMode(padapter, u1H2CPwrModeParm, H2C_PWRMODE_LEN);
|
||||
|
|
@ -468,9 +455,7 @@ void rtl8723b_set_FwPwrModeInIPS_cmd(struct adapter *padapter, u8 cmd_param)
|
|||
* to Hw again and set the length in descriptor to the real beacon length.
|
||||
*/
|
||||
/* 2009.10.15 by tynli. */
|
||||
static void rtl8723b_set_FwRsvdPagePkt(
|
||||
struct adapter *padapter, bool bDLFinished
|
||||
)
|
||||
static void rtl8723b_set_FwRsvdPagePkt(struct adapter *padapter, bool bDLFinished)
|
||||
{
|
||||
struct xmit_frame *pcmdframe;
|
||||
struct pkt_attrib *pattrib;
|
||||
|
|
@ -493,7 +478,7 @@ static void rtl8723b_set_FwRsvdPagePkt(
|
|||
pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
|
||||
RsvdPageNum = BCNQ_PAGE_NUM_8723B + WOWLAN_PAGE_NUM_8723B;
|
||||
MaxRsvdPageBufSize = RsvdPageNum*PageSize;
|
||||
MaxRsvdPageBufSize = RsvdPageNum * PageSize;
|
||||
|
||||
pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv);
|
||||
if (!pcmdframe)
|
||||
|
|
@ -515,69 +500,66 @@ static void rtl8723b_set_FwRsvdPagePkt(
|
|||
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
/* 3 (2) ps-poll */
|
||||
RsvdPageLoc.LocPsPoll = TotalPageNum;
|
||||
ConstructPSPoll(padapter, &ReservedPagePacket[BufIndex], &PSPollLength);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], PSPollLength, true, false, false);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex - TxDescLen], PSPollLength, true, false, false);
|
||||
|
||||
CurtPktPageNum = (u8)PageNum_128(TxDescLen + PSPollLength);
|
||||
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
/* 3 (3) null data */
|
||||
RsvdPageLoc.LocNullData = TotalPageNum;
|
||||
ConstructNullFunctionData(
|
||||
padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&NullDataLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
false, 0, 0, false
|
||||
);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], NullDataLength, false, false, false);
|
||||
ConstructNullFunctionData(padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&NullDataLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
false, 0, 0, false);
|
||||
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex - TxDescLen], NullDataLength, false, false, false);
|
||||
|
||||
CurtPktPageNum = (u8)PageNum_128(TxDescLen + NullDataLength);
|
||||
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
/* 3 (5) Qos null data */
|
||||
RsvdPageLoc.LocQosNull = TotalPageNum;
|
||||
ConstructNullFunctionData(
|
||||
padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&QosNullLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
true, 0, 0, false
|
||||
);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], QosNullLength, false, false, false);
|
||||
ConstructNullFunctionData(padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&QosNullLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
true, 0, 0, false);
|
||||
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex - TxDescLen], QosNullLength, false, false, false);
|
||||
|
||||
CurtPktPageNum = (u8)PageNum_128(TxDescLen + QosNullLength);
|
||||
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
/* 3 (6) BT Qos null data */
|
||||
RsvdPageLoc.LocBTQosNull = TotalPageNum;
|
||||
ConstructNullFunctionData(
|
||||
padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&BTQosNullLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
true, 0, 0, false
|
||||
);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], BTQosNullLength, false, true, false);
|
||||
ConstructNullFunctionData(padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&BTQosNullLength,
|
||||
get_my_bssid(&pmlmeinfo->network),
|
||||
true, 0, 0, false);
|
||||
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex - TxDescLen], BTQosNullLength, false, true, false);
|
||||
|
||||
CurtPktPageNum = (u8)PageNum_128(TxDescLen + BTQosNullLength);
|
||||
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
TotalPacketLen = BufIndex + BTQosNullLength;
|
||||
|
||||
|
|
@ -605,8 +587,8 @@ static void rtl8723b_set_FwRsvdPagePkt(
|
|||
void rtl8723b_download_rsvd_page(struct adapter *padapter, u8 mstatus)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
bool bcn_valid = false;
|
||||
u8 DLBcnCount = 0;
|
||||
u32 poll = 0;
|
||||
|
|
@ -618,12 +600,12 @@ void rtl8723b_download_rsvd_page(struct adapter *padapter, u8 mstatus)
|
|||
|
||||
/* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */
|
||||
/* Suggested by filen. Added by tynli. */
|
||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
|
||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000 | pmlmeinfo->aid));
|
||||
|
||||
/* set REG_CR bit 8 */
|
||||
v8 = rtw_read8(padapter, REG_CR+1);
|
||||
v8 = rtw_read8(padapter, REG_CR + 1);
|
||||
v8 |= BIT(0); /* ENSWBCN */
|
||||
rtw_write8(padapter, REG_CR+1, v8);
|
||||
rtw_write8(padapter, REG_CR + 1, v8);
|
||||
|
||||
/* Disable Hw protection for a time which revserd for Hw sending beacon. */
|
||||
/* Fix download reserved page packet fail that access collision with the protection time. */
|
||||
|
|
@ -638,7 +620,7 @@ void rtl8723b_download_rsvd_page(struct adapter *padapter, u8 mstatus)
|
|||
bRecover = true;
|
||||
|
||||
/* To tell Hw the packet is not a real beacon frame. */
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl & ~BIT(6));
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL + 2, pHalData->RegFwHwTxQCtrl & ~BIT(6));
|
||||
pHalData->RegFwHwTxQCtrl &= ~BIT(6);
|
||||
|
||||
/* Clear beacon valid check bit. */
|
||||
|
|
@ -657,11 +639,13 @@ void rtl8723b_download_rsvd_page(struct adapter *padapter, u8 mstatus)
|
|||
/* check rsvd page download OK. */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid));
|
||||
poll++;
|
||||
} while (!bcn_valid && (poll%10) != 0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
} while (!bcn_valid && (poll % 10) != 0 && !padapter->bSurpriseRemoved &&
|
||||
!padapter->driver_stopped);
|
||||
|
||||
} while (!bcn_valid && DLBcnCount <= 100 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
} while (!bcn_valid && DLBcnCount <= 100 && !padapter->bSurpriseRemoved &&
|
||||
!padapter->driver_stopped);
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped) {
|
||||
if (padapter->bSurpriseRemoved || padapter->driver_stopped) {
|
||||
} else {
|
||||
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
|
||||
|
||||
|
|
@ -680,14 +664,14 @@ void rtl8723b_download_rsvd_page(struct adapter *padapter, u8 mstatus)
|
|||
/* the beacon cannot be sent by HW. */
|
||||
/* 2010.06.23. Added by tynli. */
|
||||
if (bRecover) {
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl | BIT(6));
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL + 2, pHalData->RegFwHwTxQCtrl | BIT(6));
|
||||
pHalData->RegFwHwTxQCtrl |= BIT(6);
|
||||
}
|
||||
|
||||
/* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
|
||||
v8 = rtw_read8(padapter, REG_CR+1);
|
||||
v8 = rtw_read8(padapter, REG_CR + 1);
|
||||
v8 &= ~BIT(0); /* ~ENSWBCN */
|
||||
rtw_write8(padapter, REG_CR+1, v8);
|
||||
rtw_write8(padapter, REG_CR + 1, v8);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -701,22 +685,17 @@ void rtl8723b_set_FwJoinBssRpt_cmd(struct adapter *padapter, u8 mstatus)
|
|||
/* arg[1] = raid */
|
||||
/* arg[2] = shortGIrate */
|
||||
/* arg[3] = init_rate */
|
||||
void rtl8723b_Add_RateATid(
|
||||
struct adapter *padapter,
|
||||
u32 bitmap,
|
||||
u8 *arg,
|
||||
u8 rssi_level
|
||||
)
|
||||
void rtl8723b_Add_RateATid(struct adapter *padapter, u32 bitmap, u8 *arg, u8 rssi_level)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct sta_info *psta;
|
||||
u8 mac_id = arg[0];
|
||||
u8 raid = arg[1];
|
||||
u8 shortGI = arg[2];
|
||||
u8 bw;
|
||||
u32 mask = bitmap&0x0FFFFFFF;
|
||||
u32 mask = bitmap & 0x0FFFFFFF;
|
||||
|
||||
psta = pmlmeinfo->FW_sta_info[mac_id].psta;
|
||||
if (!psta)
|
||||
|
|
@ -730,16 +709,14 @@ void rtl8723b_Add_RateATid(
|
|||
rtl8723b_set_FwMacIdConfig_cmd(padapter, mac_id, raid, bw, shortGI, mask);
|
||||
}
|
||||
|
||||
static void ConstructBtNullFunctionData(
|
||||
struct adapter *padapter,
|
||||
u8 *pframe,
|
||||
u32 *pLength,
|
||||
u8 *StaAddr,
|
||||
u8 bQoS,
|
||||
u8 AC,
|
||||
u8 bEosp,
|
||||
u8 bForcePowerSave
|
||||
)
|
||||
static void ConstructBtNullFunctionData(struct adapter *padapter,
|
||||
u8 *pframe,
|
||||
u32 *pLength,
|
||||
u8 *StaAddr,
|
||||
u8 bQoS,
|
||||
u8 AC,
|
||||
u8 bEosp,
|
||||
u8 bForcePowerSave)
|
||||
{
|
||||
struct ieee80211_hdr *pwlanhdr;
|
||||
__le16 *fctrl;
|
||||
|
|
@ -805,7 +782,7 @@ static void SetFwRsvdPagePkt_BTCoex(struct adapter *padapter)
|
|||
PageSize = PAGE_SIZE_TX_8723B;
|
||||
|
||||
RsvdPageNum = BCNQ_PAGE_NUM_8723B;
|
||||
MaxRsvdPageBufSize = RsvdPageNum*PageSize;
|
||||
MaxRsvdPageBufSize = RsvdPageNum * PageSize;
|
||||
|
||||
pcmdframe = rtw_alloc_cmdxmitframe(pxmitpriv);
|
||||
if (!pcmdframe)
|
||||
|
|
@ -826,7 +803,7 @@ static void SetFwRsvdPagePkt_BTCoex(struct adapter *padapter)
|
|||
CurtPktPageNum += 1;
|
||||
TotalPageNum += CurtPktPageNum;
|
||||
|
||||
BufIndex += (CurtPktPageNum*PageSize);
|
||||
BufIndex += (CurtPktPageNum * PageSize);
|
||||
|
||||
/* Jump to lastest page */
|
||||
if (BufIndex < (MaxRsvdPageBufSize - PageSize)) {
|
||||
|
|
@ -836,14 +813,13 @@ static void SetFwRsvdPagePkt_BTCoex(struct adapter *padapter)
|
|||
|
||||
/* 3 (6) BT Qos null data */
|
||||
RsvdPageLoc.LocBTQosNull = TotalPageNum;
|
||||
ConstructBtNullFunctionData(
|
||||
padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&BTQosNullLength,
|
||||
NULL,
|
||||
true, 0, 0, false
|
||||
);
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], BTQosNullLength, false, true, false);
|
||||
ConstructBtNullFunctionData(padapter,
|
||||
&ReservedPagePacket[BufIndex],
|
||||
&BTQosNullLength,
|
||||
NULL,
|
||||
true, 0, 0, false);
|
||||
|
||||
rtl8723b_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex - TxDescLen], BTQosNullLength, false, true, false);
|
||||
|
||||
CurtPktPageNum = (u8)PageNum_128(TxDescLen + BTQosNullLength);
|
||||
|
||||
|
|
@ -885,12 +861,12 @@ void rtl8723b_download_BTCoex_AP_mode_rsvd_page(struct adapter *padapter)
|
|||
|
||||
/* We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C. */
|
||||
/* Suggested by filen. Added by tynli. */
|
||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
|
||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000 | pmlmeinfo->aid));
|
||||
|
||||
/* set REG_CR bit 8 */
|
||||
val8 = rtw_read8(padapter, REG_CR+1);
|
||||
val8 = rtw_read8(padapter, REG_CR + 1);
|
||||
val8 |= BIT(0); /* ENSWBCN */
|
||||
rtw_write8(padapter, REG_CR+1, val8);
|
||||
rtw_write8(padapter, REG_CR + 1, val8);
|
||||
|
||||
/* Disable Hw protection for a time which revserd for Hw sending beacon. */
|
||||
/* Fix download reserved page packet fail that access collision with the protection time. */
|
||||
|
|
@ -906,7 +882,7 @@ void rtl8723b_download_BTCoex_AP_mode_rsvd_page(struct adapter *padapter)
|
|||
|
||||
/* To tell Hw the packet is not a real beacon frame. */
|
||||
pHalData->RegFwHwTxQCtrl &= ~BIT(6);
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl);
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL + 2, pHalData->RegFwHwTxQCtrl);
|
||||
|
||||
/* Clear beacon valid check bit. */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||
|
|
@ -923,8 +899,10 @@ void rtl8723b_download_BTCoex_AP_mode_rsvd_page(struct adapter *padapter)
|
|||
/* check rsvd page download OK. */
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, &bcn_valid);
|
||||
poll++;
|
||||
} while (!bcn_valid && (poll%10) != 0 && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
} while (!bcn_valid && (DLBcnCount <= 100) && !padapter->bSurpriseRemoved && !padapter->bDriverStopped);
|
||||
} while (!bcn_valid && (poll % 10) != 0 && !padapter->bSurpriseRemoved &&
|
||||
!padapter->driver_stopped);
|
||||
} while (!bcn_valid && (DLBcnCount <= 100) && !padapter->bSurpriseRemoved &&
|
||||
!padapter->driver_stopped);
|
||||
|
||||
if (bcn_valid) {
|
||||
struct pwrctrl_priv *pwrctl = adapter_to_pwrctl(padapter);
|
||||
|
|
@ -945,11 +923,11 @@ void rtl8723b_download_BTCoex_AP_mode_rsvd_page(struct adapter *padapter)
|
|||
/* 2010.06.23. Added by tynli. */
|
||||
if (bRecover) {
|
||||
pHalData->RegFwHwTxQCtrl |= BIT(6);
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl);
|
||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL + 2, pHalData->RegFwHwTxQCtrl);
|
||||
}
|
||||
|
||||
/* Clear CR[8] or beacon packet will not be send to TxBuf anymore. */
|
||||
val8 = rtw_read8(padapter, REG_CR+1);
|
||||
val8 = rtw_read8(padapter, REG_CR + 1);
|
||||
val8 &= ~BIT(0); /* ~ENSWBCN */
|
||||
rtw_write8(padapter, REG_CR+1, val8);
|
||||
rtw_write8(padapter, REG_CR + 1, val8);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ static void Init_ODM_ComInfo_8723b(struct adapter *Adapter)
|
|||
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_CUT_VER, cut_ver);
|
||||
|
||||
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_PATCH_ID, pHalData->CustomerID);
|
||||
/* ODM_CMNINFO_BINHCT_TEST only for MP Team */
|
||||
/* ODM_CMNINFO_BINHCT_TEST only for MP Team */
|
||||
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_BWIFI_TEST, Adapter->registrypriv.wifi_spec);
|
||||
|
||||
pdmpriv->InitODMFlag = ODM_RF_CALIBRATION|ODM_RF_TX_PWR_TRACK;
|
||||
|
|
@ -80,7 +80,7 @@ static void Update_ODM_ComInfo_8723b(struct adapter *Adapter)
|
|||
/* Pointer reference */
|
||||
/* */
|
||||
/* ODM_CMNINFO_MAC_PHY_MODE pHalData->MacPhyMode92D */
|
||||
/* ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_MAC_PHY_MODE,&(pDM_Odm->u8_temp)); */
|
||||
/* ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_MAC_PHY_MODE,&(pDM_Odm->u8_temp)); */
|
||||
|
||||
ODM_CmnInfoUpdate(pDM_Odm, ODM_CMNINFO_ABILITY, pdmpriv->InitODMFlag);
|
||||
|
||||
|
|
@ -88,13 +88,12 @@ static void Update_ODM_ComInfo_8723b(struct adapter *Adapter)
|
|||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_RX_UNI, &(dvobj->traffic_stat.rx_bytes));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_WM_MODE, &(pmlmeext->cur_wireless_mode));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_CHNL_OFFSET, &(pHalData->nCur40MhzPrimeSC));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_MODE, &(Adapter->securitypriv.dot11PrivacyAlgrthm));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SEC_MODE, &(Adapter->securitypriv.dot11_privacy_algrthm));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_BW, &(pHalData->CurrentChannelBW));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_CHNL, &(pHalData->CurrentChannel));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_NET_CLOSED, &(Adapter->net_closed));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_MP_MODE, &zero);
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_IGI_LB, &(pHalData->u1ForcedIgiLb));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_FORCED_RATE, &(pHalData->ForcedDataRate));
|
||||
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_SCAN, &(pmlmepriv->bScanInProcess));
|
||||
ODM_CmnInfoHook(pDM_Odm, ODM_CMNINFO_POWER_SAVING, &(pwrctrlpriv->bpower_saving));
|
||||
|
|
|
|||
|
|
@ -189,14 +189,14 @@ static s32 polling_fwdl_chksum(
|
|||
do {
|
||||
cnt++;
|
||||
value32 = rtw_read32(adapter, REG_MCUFWDL);
|
||||
if (value32 & FWDL_ChkSum_rpt || adapter->bSurpriseRemoved || adapter->bDriverStopped)
|
||||
if (value32 & FWDL_ChkSum_rpt || adapter->bSurpriseRemoved ||
|
||||
adapter->driver_stopped)
|
||||
break;
|
||||
yield();
|
||||
} while (jiffies_to_msecs(jiffies-start) < timeout_ms || cnt < min_cnt);
|
||||
|
||||
if (!(value32 & FWDL_ChkSum_rpt)) {
|
||||
if (!(value32 & FWDL_ChkSum_rpt))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (g_fwdl_chksum_fail) {
|
||||
g_fwdl_chksum_fail--;
|
||||
|
|
@ -230,14 +230,13 @@ static s32 _FWFreeToGo(struct adapter *adapter, u32 min_cnt, u32 timeout_ms)
|
|||
do {
|
||||
cnt++;
|
||||
value32 = rtw_read32(adapter, REG_MCUFWDL);
|
||||
if (value32 & WINTINI_RDY || adapter->bSurpriseRemoved || adapter->bDriverStopped)
|
||||
if (value32 & WINTINI_RDY || adapter->bSurpriseRemoved || adapter->driver_stopped)
|
||||
break;
|
||||
yield();
|
||||
} while (jiffies_to_msecs(jiffies - start) < timeout_ms || cnt < min_cnt);
|
||||
|
||||
if (!(value32 & WINTINI_RDY)) {
|
||||
if (!(value32 & WINTINI_RDY))
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (g_fwdl_wintint_rdy_fail) {
|
||||
g_fwdl_wintint_rdy_fail--;
|
||||
|
|
@ -283,8 +282,8 @@ void rtl8723b_FirmwareSelfReset(struct adapter *padapter)
|
|||
}
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
/* Download 8192C firmware code. */
|
||||
/* Description: */
|
||||
/* Download 8192C firmware code. */
|
||||
/* */
|
||||
/* */
|
||||
s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
|
||||
|
|
@ -386,7 +385,7 @@ s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw)
|
|||
_FWDownloadEnable(padapter, true);
|
||||
fwdl_start_time = jiffies;
|
||||
while (
|
||||
!padapter->bDriverStopped &&
|
||||
!padapter->driver_stopped &&
|
||||
!padapter->bSurpriseRemoved &&
|
||||
(write_fw++ < 3 || jiffies_to_msecs(jiffies - fwdl_start_time) < 500)
|
||||
) {
|
||||
|
|
@ -437,7 +436,7 @@ void rtl8723b_InitializeFirmwareVars(struct adapter *padapter)
|
|||
}
|
||||
|
||||
/* */
|
||||
/* Efuse related code */
|
||||
/* Efuse related code */
|
||||
/* */
|
||||
static u8 hal_EfuseSwitchToBank(
|
||||
struct adapter *padapter, u8 bank
|
||||
|
|
@ -820,7 +819,7 @@ void Hal_ReadEFuse(
|
|||
hal_ReadEFuse_BT(padapter, _offset, _size_byte, pbuf);
|
||||
}
|
||||
|
||||
static void ReadChipVersion8723B(struct adapter *padapter)
|
||||
void rtl8723b_read_chip_version(struct adapter *padapter)
|
||||
{
|
||||
u32 value32;
|
||||
struct hal_com_data *pHalData;
|
||||
|
|
@ -830,22 +829,6 @@ static void ReadChipVersion8723B(struct adapter *padapter)
|
|||
|
||||
value32 = rtw_read32(padapter, REG_SYS_CFG);
|
||||
pHalData->chip_normal = ((value32 & RTL_ID) ? false : true);
|
||||
|
||||
/* For regulator mode. by tynli. 2011.01.14 */
|
||||
pHalData->RegulatorMode = ((value32 & SPS_SEL) ? RT_LDO_REGULATOR : RT_SWITCHING_REGULATOR);
|
||||
|
||||
/* For multi-function consideration. Added by Roger, 2010.10.06. */
|
||||
pHalData->MultiFunc = RT_MULTI_FUNC_NONE;
|
||||
value32 = rtw_read32(padapter, REG_MULTI_FUNC_CTRL);
|
||||
pHalData->MultiFunc |= ((value32 & WL_FUNC_EN) ? RT_MULTI_FUNC_WIFI : 0);
|
||||
pHalData->MultiFunc |= ((value32 & BT_FUNC_EN) ? RT_MULTI_FUNC_BT : 0);
|
||||
pHalData->MultiFunc |= ((value32 & GPS_FUNC_EN) ? RT_MULTI_FUNC_GPS : 0);
|
||||
pHalData->PolarityCtl = ((value32 & WL_HWPDN_SL) ? RT_POLARITY_HIGH_ACT : RT_POLARITY_LOW_ACT);
|
||||
}
|
||||
|
||||
void rtl8723b_read_chip_version(struct adapter *padapter)
|
||||
{
|
||||
ReadChipVersion8723B(padapter);
|
||||
}
|
||||
|
||||
void rtl8723b_InitBeaconParameters(struct adapter *padapter)
|
||||
|
|
@ -861,8 +844,7 @@ void rtl8723b_InitBeaconParameters(struct adapter *padapter)
|
|||
|
||||
rtw_write16(padapter, REG_BCN_CTRL, val16);
|
||||
|
||||
/* TODO: Remove these magic number */
|
||||
rtw_write16(padapter, REG_TBTT_PROHIBIT, 0x6404);/* ms */
|
||||
rtw_write16(padapter, REG_TBTT_PROHIBIT, TBTT_PROHIBIT_TIME_8723B);
|
||||
/* Firmware will control REG_DRVERLYINT when power saving is enable, */
|
||||
/* so don't set this register on STA mode. */
|
||||
if (!check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
|
||||
|
|
@ -871,13 +853,10 @@ void rtl8723b_InitBeaconParameters(struct adapter *padapter)
|
|||
|
||||
/* Suggested by designer timchen. Change beacon AIFS to the largest number */
|
||||
/* because test chip does not contension before sending beacon. by tynli. 2009.11.03 */
|
||||
rtw_write16(padapter, REG_BCNTCFG, 0x660F);
|
||||
rtw_write16(padapter, REG_BCNTCFG, BCNTCFG_8723B);
|
||||
|
||||
pHalData->RegBcnCtrlVal = rtw_read8(padapter, REG_BCN_CTRL);
|
||||
pHalData->RegTxPause = rtw_read8(padapter, REG_TXPAUSE);
|
||||
pHalData->RegFwHwTxQCtrl = rtw_read8(padapter, REG_FWHW_TXQ_CTRL+2);
|
||||
pHalData->RegReg542 = rtw_read8(padapter, REG_TBTT_PROHIBIT+2);
|
||||
pHalData->RegCR_1 = rtw_read8(padapter, REG_CR+1);
|
||||
}
|
||||
|
||||
void _InitBurstPktLen_8723BS(struct adapter *Adapter)
|
||||
|
|
@ -1031,9 +1010,8 @@ void UpdateHalRAMask8723B(struct adapter *padapter, u32 mac_id, u8 rssi_level)
|
|||
rate_bitmap = hal_btcoex_GetRaMask(padapter);
|
||||
mask &= ~rate_bitmap;
|
||||
|
||||
if (pHalData->fw_ractrl) {
|
||||
if (pHalData->fw_ractrl)
|
||||
rtl8723b_set_FwMacIdConfig_cmd(padapter, mac_id, psta->raid, psta->bw_mode, short_gi_rate, mask);
|
||||
}
|
||||
|
||||
/* set correct initial date rate for each mac_id */
|
||||
pdmpriv->INIDATA_RATE[mac_id] = psta->init_rate;
|
||||
|
|
@ -1062,12 +1040,9 @@ void rtl8723b_init_default_value(struct adapter *padapter)
|
|||
|
||||
/* init default value */
|
||||
pHalData->fw_ractrl = false;
|
||||
pHalData->bIQKInitialized = false;
|
||||
if (!adapter_to_pwrctl(padapter)->bkeepfwalive)
|
||||
pHalData->LastHMEBoxNum = 0;
|
||||
|
||||
pHalData->bIQKInitialized = false;
|
||||
|
||||
/* init dm default value */
|
||||
pdmpriv->TM_Trigger = 0;/* for IQK */
|
||||
/* pdmpriv->binitialized = false; */
|
||||
|
|
@ -1197,7 +1172,6 @@ static void Hal_ReadPowerValueFromPROM_8723B(
|
|||
bool AutoLoadFail
|
||||
)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
|
||||
u32 rfPath, eeAddr = EEPROM_TX_PWR_INX_8723B, group, TxCount = 0;
|
||||
|
||||
memset(pwrInfo24G, 0, sizeof(struct TxPowerInfo24G));
|
||||
|
|
@ -1229,8 +1203,6 @@ static void Hal_ReadPowerValueFromPROM_8723B(
|
|||
return;
|
||||
}
|
||||
|
||||
pHalData->bTXPowerDataReadFromEEPORM = true; /* YJ, move, 120316 */
|
||||
|
||||
for (rfPath = 0; rfPath < MAX_RF_PATH; rfPath++) {
|
||||
/* 2 2.4G default value */
|
||||
for (group = 0; group < MAX_CHNL_GROUP_24G; group++) {
|
||||
|
|
@ -1310,7 +1282,7 @@ void Hal_EfuseParseTxPowerInfo_8723B(
|
|||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
struct TxPowerInfo24G pwrInfo24G;
|
||||
u8 rfPath, ch, TxCount = 1;
|
||||
u8 rfPath, ch, TxCount = 1;
|
||||
|
||||
Hal_ReadPowerValueFromPROM_8723B(padapter, &pwrInfo24G, PROMContent, AutoLoadFail);
|
||||
for (rfPath = 0 ; rfPath < MAX_RF_PATH ; rfPath++) {
|
||||
|
|
@ -1329,7 +1301,6 @@ void Hal_EfuseParseTxPowerInfo_8723B(
|
|||
}
|
||||
|
||||
for (TxCount = 0; TxCount < MAX_TX_COUNT; TxCount++) {
|
||||
pHalData->CCK_24G_Diff[rfPath][TxCount] = pwrInfo24G.CCK_Diff[rfPath][TxCount];
|
||||
pHalData->OFDM_24G_Diff[rfPath][TxCount] = pwrInfo24G.OFDM_Diff[rfPath][TxCount];
|
||||
pHalData->BW20_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW20_Diff[rfPath][TxCount];
|
||||
pHalData->BW40_24G_Diff[rfPath][TxCount] = pwrInfo24G.BW40_Diff[rfPath][TxCount];
|
||||
|
|
@ -1360,8 +1331,6 @@ void Hal_EfuseParseBTCoexistInfo_8723B(
|
|||
else
|
||||
pHalData->EEPROMBluetoothCoexist = false;
|
||||
|
||||
pHalData->EEPROMBluetoothType = BT_RTL8723B;
|
||||
|
||||
tempval = hwinfo[EEPROM_RF_BT_SETTING_8723B];
|
||||
if (tempval != 0xFF) {
|
||||
pHalData->EEPROMBluetoothAntNum = tempval & BIT(0);
|
||||
|
|
@ -1380,7 +1349,6 @@ void Hal_EfuseParseBTCoexistInfo_8723B(
|
|||
}
|
||||
} else {
|
||||
pHalData->EEPROMBluetoothCoexist = false;
|
||||
pHalData->EEPROMBluetoothType = BT_RTL8723B;
|
||||
pHalData->EEPROMBluetoothAntNum = Ant_x1;
|
||||
pHalData->ant_path = RF_PATH_A;
|
||||
}
|
||||
|
|
@ -1404,18 +1372,6 @@ void Hal_EfuseParseBTCoexistInfo_8723B(
|
|||
hal_btcoex_SetSingleAntPath(padapter, pHalData->ant_path);
|
||||
}
|
||||
|
||||
void Hal_EfuseParseEEPROMVer_8723B(
|
||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||
)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if (!AutoLoadFail)
|
||||
pHalData->EEPROMVersion = hwinfo[EEPROM_VERSION_8723B];
|
||||
else
|
||||
pHalData->EEPROMVersion = 1;
|
||||
}
|
||||
|
||||
void Hal_EfuseParsePackageType_8723B(
|
||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||
)
|
||||
|
|
@ -1474,18 +1430,6 @@ void Hal_EfuseParseChnlPlan_8723B(
|
|||
Hal_ChannelPlanToRegulation(padapter, padapter->mlmepriv.ChannelPlan);
|
||||
}
|
||||
|
||||
void Hal_EfuseParseCustomerID_8723B(
|
||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||
)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if (!AutoLoadFail)
|
||||
pHalData->EEPROMCustomerID = hwinfo[EEPROM_CustomID_8723B];
|
||||
else
|
||||
pHalData->EEPROMCustomerID = 0;
|
||||
}
|
||||
|
||||
void Hal_EfuseParseXtal_8723B(
|
||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||
)
|
||||
|
|
@ -1514,10 +1458,8 @@ void Hal_EfuseParseThermalMeter_8723B(
|
|||
else
|
||||
pHalData->EEPROMThermalMeter = EEPROM_Default_ThermalMeter_8723B;
|
||||
|
||||
if ((pHalData->EEPROMThermalMeter == 0xff) || AutoLoadFail) {
|
||||
pHalData->bAPKThermalMeterIgnore = true;
|
||||
if ((pHalData->EEPROMThermalMeter == 0xff) || AutoLoadFail)
|
||||
pHalData->EEPROMThermalMeter = EEPROM_Default_ThermalMeter_8723B;
|
||||
}
|
||||
}
|
||||
|
||||
void Hal_ReadRFGainOffset(
|
||||
|
|
@ -1596,9 +1538,8 @@ static void rtl8723b_cal_txdesc_chksum(struct tx_desc *ptxdesc)
|
|||
/* Thomas, Lucas@SD4, 20130515 */
|
||||
count = 16;
|
||||
|
||||
for (index = 0; index < count; index++) {
|
||||
for (index = 0; index < count; index++)
|
||||
checksum |= le16_to_cpu(*(__le16 *)(usPtr + index));
|
||||
}
|
||||
|
||||
ptxdesc->txdw7 |= cpu_to_le32(checksum & 0x0000ffff);
|
||||
}
|
||||
|
|
@ -1834,8 +1775,8 @@ void rtl8723b_update_txdesc(struct xmit_frame *pxmitframe, u8 *pbuf)
|
|||
|
||||
/* */
|
||||
/* Description: In normal chip, we should send some packet to Hw which will be used by Fw */
|
||||
/* in FW LPS mode. The function is to fill the Tx descriptor of this packets, then */
|
||||
/* Fw can tell Hw to send these packet derectly. */
|
||||
/* in FW LPS mode. The function is to fill the Tx descriptor of this packets, then */
|
||||
/* Fw can tell Hw to send these packet derectly. */
|
||||
/* Added by tynli. 2009.10.15. */
|
||||
/* */
|
||||
/* type1:pspoll, type2:null */
|
||||
|
|
@ -1867,9 +1808,8 @@ void rtl8723b_fill_fake_txdesc(
|
|||
SET_TX_DESC_HWSEQ_SEL_8723B(pDesc, 0);
|
||||
}
|
||||
|
||||
if (IsBTQosNull) {
|
||||
if (IsBTQosNull)
|
||||
SET_TX_DESC_BT_INT_8723B(pDesc, 1);
|
||||
}
|
||||
|
||||
SET_TX_DESC_USE_RATE_8723B(pDesc, 1); /* use data rate which is set by Sw */
|
||||
SET_TX_DESC_OWN_8723B((u8 *)pDesc, 1);
|
||||
|
|
@ -1880,7 +1820,7 @@ void rtl8723b_fill_fake_txdesc(
|
|||
/* Encrypt the data frame if under security mode excepct null data. Suggested by CCW. */
|
||||
/* */
|
||||
if (bDataFrame) {
|
||||
u32 EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
u32 EncAlg = padapter->securitypriv.dot11_privacy_algrthm;
|
||||
|
||||
switch (EncAlg) {
|
||||
case _NO_PRIVACY_:
|
||||
|
|
@ -2184,9 +2124,9 @@ void CCX_FwC2HTxRpt_8723b(struct adapter *padapter, u8 *pdata, u8 len)
|
|||
#define GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(_Header) LE_BITS_TO_1BYTE((_Header + 0), 6, 1)
|
||||
#define GET_8723B_C2H_TX_RPT_RETRY_OVER(_Header) LE_BITS_TO_1BYTE((_Header + 0), 7, 1)
|
||||
|
||||
if (GET_8723B_C2H_TX_RPT_RETRY_OVER(pdata) | GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(pdata)) {
|
||||
if (GET_8723B_C2H_TX_RPT_RETRY_OVER(pdata) | GET_8723B_C2H_TX_RPT_LIFE_TIME_OVER(pdata))
|
||||
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
}
|
||||
|
||||
/*
|
||||
else if (seq_no != padapter->xmitpriv.seq_no) {
|
||||
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_CCX_PKT_FAIL);
|
||||
|
|
@ -2246,7 +2186,7 @@ s32 c2h_handler_8723b(struct adapter *padapter, u8 *buf)
|
|||
|
||||
/* Clear event to notify FW we have read the command. */
|
||||
/* Note: */
|
||||
/* If this field isn't clear, the FW won't update the next command message. */
|
||||
/* If this field isn't clear, the FW won't update the next command message. */
|
||||
/* rtw_write8(padapter, REG_C2HEVT_CLEAR, C2H_EVT_HOST_CLOSE); */
|
||||
exit:
|
||||
return ret;
|
||||
|
|
@ -2555,9 +2495,8 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
|
|||
|
||||
/* Forece leave RF low power mode for 1T1R to prevent conficting setting in Fw power */
|
||||
/* saving sequence. 2010.06.07. Added by tynli. Suggested by SD3 yschang. */
|
||||
if (psmode != PS_MODE_ACTIVE) {
|
||||
if (psmode != PS_MODE_ACTIVE)
|
||||
ODM_RF_Saving(&pHalData->odmpriv, true);
|
||||
}
|
||||
|
||||
/* if (psmode != PS_MODE_ACTIVE) { */
|
||||
/* rtl8723b_set_lowpwr_lps_cmd(padapter, true); */
|
||||
|
|
@ -2690,10 +2629,6 @@ void SetHwReg8723B(struct adapter *padapter, u8 variable, u8 *val)
|
|||
}
|
||||
break;
|
||||
|
||||
case HW_VAR_DO_IQK:
|
||||
pHalData->bNeedIQK = true;
|
||||
break;
|
||||
|
||||
case HW_VAR_DL_RSVD_PAGE:
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE))
|
||||
rtl8723b_download_BTCoex_AP_mode_rsvd_page(padapter);
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@ int PHY_BBConfig8723B(struct adapter *Adapter)
|
|||
RegVal = rtw_read16(Adapter, REG_SYS_FUNC_EN);
|
||||
rtw_write16(Adapter, REG_SYS_FUNC_EN, (u16)(RegVal | BIT(13) | BIT(0) | BIT(1)));
|
||||
|
||||
rtw_write32(Adapter, 0x948, 0x280); /* Others use Antenna S1 */
|
||||
rtw_write32(Adapter, rS0S1_PathSwitch, 0x280); /* Others use Antenna S1 */
|
||||
|
||||
rtw_write8(Adapter, REG_RF_CTRL, RF_EN | RF_RSTB | RF_SDMRSTB);
|
||||
|
||||
|
|
@ -649,8 +649,6 @@ static void phy_SwChnl8723B(struct adapter *padapter)
|
|||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
u8 channelToSW = pHalData->CurrentChannel;
|
||||
|
||||
if (pHalData->rf_chip == RF_PSEUDO_11N)
|
||||
return;
|
||||
pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff00) | channelToSW);
|
||||
PHY_SetRFReg(padapter, RF_PATH_A, RF_CHNLBW, 0x3FF, pHalData->RfRegChnlVal[0]);
|
||||
PHY_SetRFReg(padapter, RF_PATH_B, RF_CHNLBW, 0x3FF, pHalData->RfRegChnlVal[0]);
|
||||
|
|
@ -660,7 +658,7 @@ static void phy_SwChnlAndSetBwMode8723B(struct adapter *Adapter)
|
|||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
if (Adapter->bDriverStopped || Adapter->bSurpriseRemoved)
|
||||
if (Adapter->driver_stopped || Adapter->bSurpriseRemoved)
|
||||
return;
|
||||
|
||||
if (pHalData->bSwChnl) {
|
||||
|
|
@ -726,7 +724,7 @@ static void PHY_HandleSwChnlAndSetBW8723B(
|
|||
}
|
||||
|
||||
/* Switch workitem or set timer to do switch channel or setbandwidth operation */
|
||||
if ((!Adapter->bDriverStopped) && (!Adapter->bSurpriseRemoved)) {
|
||||
if ((!Adapter->driver_stopped) && (!Adapter->bSurpriseRemoved)) {
|
||||
phy_SwChnlAndSetBwMode8723B(Adapter);
|
||||
} else {
|
||||
if (pHalData->bSwChnl) {
|
||||
|
|
|
|||
|
|
@ -81,62 +81,38 @@ void PHY_RF6052SetBandwidth8723B(
|
|||
static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
{
|
||||
u32 u4RegValue = 0;
|
||||
u8 eRFPath;
|
||||
struct bb_register_def *pPhyReg;
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
/* 3----------------------------------------------------------------- */
|
||||
/* 3 <2> Initialize RF */
|
||||
/* 3----------------------------------------------------------------- */
|
||||
/* for (eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++) */
|
||||
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
|
||||
|
||||
pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
pPhyReg = &pHalData->PHYRegDef[RF_PATH_A];
|
||||
|
||||
/*----Store original RFENV control type----*/
|
||||
switch (eRFPath) {
|
||||
case RF_PATH_A:
|
||||
u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
|
||||
break;
|
||||
case RF_PATH_B:
|
||||
u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16);
|
||||
break;
|
||||
}
|
||||
/*----Store original RFENV control type----*/
|
||||
u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
|
||||
|
||||
/*----Set RF_ENV enable----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
/*----Set RF_ENV enable----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Set RF_ENV output high----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfo, bRFSI_RFENV, 0x1);
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
/*----Set RF_ENV output high----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfo, bRFSI_RFENV, 0x1);
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/* Set bit number of Address and Data for RF register */
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0); /* Set 1 to 4 bits for 8255 */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
/* Set bit number of Address and Data for RF register */
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireAddressLength, 0x0); /* Set 1 to 4 bits for 8255 */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); /* Set 0 to 12 bits for 8255 */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); /* Set 0 to 12 bits for 8255 */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
switch (eRFPath) {
|
||||
case RF_PATH_A:
|
||||
case RF_PATH_B:
|
||||
ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,
|
||||
CONFIG_RF_RADIO, eRFPath);
|
||||
break;
|
||||
}
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv, CONFIG_RF_RADIO, RF_PATH_A);
|
||||
|
||||
/*----Restore RFENV control type----*/
|
||||
switch (eRFPath) {
|
||||
case RF_PATH_A:
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
|
||||
break;
|
||||
case RF_PATH_B:
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV << 16, u4RegValue);
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*----Restore RFENV control type----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
|
||||
|
||||
/* 3 ----------------------------------------------------------------- */
|
||||
/* 3 Configuration of Tx Power Tracking */
|
||||
|
|
@ -149,13 +125,6 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
|||
|
||||
int PHY_RF6052_Config8723B(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
/* */
|
||||
/* Initialize general global value */
|
||||
/* */
|
||||
pHalData->NumTotalRFPath = 1;
|
||||
|
||||
/* */
|
||||
/* Config BB and RF */
|
||||
/* */
|
||||
|
|
|
|||
|
|
@ -267,9 +267,9 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
|
|||
rtw_free_recvframe(precvframe,
|
||||
&precvpriv->free_recv_queue);
|
||||
} else {
|
||||
/* Modified by Albert 20101213 */
|
||||
/* For 8 bytes IP header alignment. */
|
||||
if (pattrib->qos) /* Qos data, wireless lan header length is 26 */
|
||||
/* Modified by Albert 20101213 */
|
||||
/* For 8 bytes IP header alignment. */
|
||||
if (pattrib->qos) /* Qos data, wireless lan header length is 26 */
|
||||
shift_sz = 6;
|
||||
else
|
||||
shift_sz = 0;
|
||||
|
|
@ -285,8 +285,8 @@ static void rtl8723bs_recv_tasklet(struct tasklet_struct *t)
|
|||
alloc_sz = skb_len + 14;
|
||||
} else {
|
||||
alloc_sz = skb_len;
|
||||
/* 6 is for IP header 8 bytes alignment in QoS packet case. */
|
||||
/* 8 is for skb->data 4 bytes alignment. */
|
||||
/* 6 is for IP header 8 bytes alignment in QoS packet case. */
|
||||
/* 8 is for skb->data 4 bytes alignment. */
|
||||
alloc_sz += 14;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ static u8 rtw_sdio_wait_enough_TxOQT_space(struct adapter *padapter, u8 agg_num)
|
|||
while (pHalData->SdioTxOQTFreeSpace < agg_num) {
|
||||
if (
|
||||
(padapter->bSurpriseRemoved) ||
|
||||
(padapter->bDriverStopped)
|
||||
(padapter->driver_stopped)
|
||||
)
|
||||
return false;
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ static s32 rtl8723_dequeue_writeport(struct adapter *padapter)
|
|||
|
||||
if (
|
||||
(padapter->bSurpriseRemoved) ||
|
||||
(padapter->bDriverStopped)
|
||||
(padapter->driver_stopped)
|
||||
)
|
||||
goto free_xmitbuf;
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ s32 rtl8723bs_xmit_buf_handler(struct adapter *padapter)
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
ret = (padapter->bDriverStopped) || (padapter->bSurpriseRemoved);
|
||||
ret = (padapter->driver_stopped) || (padapter->bSurpriseRemoved);
|
||||
if (ret)
|
||||
return _FAIL;
|
||||
|
||||
|
|
@ -285,7 +285,7 @@ static s32 xmit_xmitframes(struct adapter *padapter, struct xmit_priv *pxmitpriv
|
|||
pxmitframe->buf_addr = pxmitbuf->ptail;
|
||||
|
||||
ret = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
|
||||
if (ret != _SUCCESS) {
|
||||
if (ret) {
|
||||
netdev_err(padapter->pnetdev,
|
||||
"%s: coalesce failed with error %d\n",
|
||||
__func__, ret);
|
||||
|
|
@ -362,7 +362,7 @@ static s32 rtl8723bs_xmit_handler(struct adapter *padapter)
|
|||
|
||||
next:
|
||||
if (
|
||||
(padapter->bDriverStopped) ||
|
||||
(padapter->driver_stopped) ||
|
||||
(padapter->bSurpriseRemoved)
|
||||
)
|
||||
return _FAIL;
|
||||
|
|
@ -529,7 +529,6 @@ s32 rtl8723bs_init_xmit_priv(struct adapter *padapter)
|
|||
|
||||
phal = GET_HAL_DATA(padapter);
|
||||
|
||||
spin_lock_init(&phal->SdioTxFIFOFreePageLock);
|
||||
init_completion(&xmitpriv->SdioXmitStart);
|
||||
init_completion(&xmitpriv->SdioXmitTerminate);
|
||||
|
||||
|
|
|
|||
|
|
@ -27,13 +27,18 @@ static u8 CardEnable(struct adapter *padapter)
|
|||
/* unlock ISO/CLK/Power control register */
|
||||
rtw_write8(padapter, REG_RSV_CTRL, 0x0);
|
||||
|
||||
ret = HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_enable_flow);
|
||||
ret = HalPwrSeqCmdParsing(padapter,
|
||||
PWR_CUT_ALL_MSK,
|
||||
PWR_FAB_ALL_MSK,
|
||||
PWR_INTF_SDIO_MSK,
|
||||
rtl8723B_card_enable_flow);
|
||||
if (ret == _SUCCESS) {
|
||||
bMacPwrCtrlOn = true;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
|
||||
}
|
||||
} else
|
||||
} else {
|
||||
ret = _SUCCESS;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -104,7 +109,11 @@ u8 _InitPowerOn_8723BS(struct adapter *padapter)
|
|||
}
|
||||
|
||||
/* Tx Page FIFO threshold */
|
||||
static void _init_available_page_threshold(struct adapter *padapter, u8 numHQ, u8 numNQ, u8 numLQ, u8 numPubQ)
|
||||
static void _init_available_page_threshold(struct adapter *padapter,
|
||||
u8 numHQ,
|
||||
u8 numNQ,
|
||||
u8 numLQ,
|
||||
u8 numPubQ)
|
||||
{
|
||||
u16 HQ_threshold, NQ_threshold, LQ_threshold;
|
||||
|
||||
|
|
@ -469,15 +478,10 @@ static void sdio_AggSettingRxUpdate(struct adapter *padapter)
|
|||
|
||||
static void _initSdioAggregationSetting(struct adapter *padapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
/* Rx aggregation setting */
|
||||
HalRxAggr8723BSdio(padapter);
|
||||
|
||||
sdio_AggSettingRxUpdate(padapter);
|
||||
|
||||
/* 201/12/10 MH Add for USB agg mode dynamic switch. */
|
||||
pHalData->UsbRxHighSpeedMode = false;
|
||||
}
|
||||
|
||||
static void _InitOperationMode(struct adapter *padapter)
|
||||
|
|
@ -529,13 +533,6 @@ static void _InitInterrupt(struct adapter *padapter)
|
|||
InitInterrupt8723BSdio(padapter);
|
||||
}
|
||||
|
||||
static void _InitRFType(struct adapter *padapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
pHalData->rf_chip = RF_6052;
|
||||
}
|
||||
|
||||
static void _RfPowerSave(struct adapter *padapter)
|
||||
{
|
||||
/* YJ, TODO */
|
||||
|
|
@ -639,9 +636,6 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
|
|||
/* HW GPIO pin. Before PHY_RFConfig8192C. */
|
||||
HalDetectPwrDownMode(padapter);
|
||||
|
||||
/* Set RF type for BB/RF configuration */
|
||||
_InitRFType(padapter);
|
||||
|
||||
/* Save target channel */
|
||||
/* <Roger_Notes> Current Channel will be updated again later. */
|
||||
pHalData->CurrentChannel = 6;
|
||||
|
|
@ -781,7 +775,11 @@ u32 rtl8723bs_hal_init(struct adapter *padapter)
|
|||
|
||||
restore_iqk_rst = pwrpriv->bips_processing;
|
||||
b2Ant = pHalData->EEPROMBluetoothAntNum == Ant_x2;
|
||||
PHY_IQCalibrate_8723B(padapter, false, restore_iqk_rst, b2Ant, pHalData->ant_path);
|
||||
PHY_IQCalibrate_8723B(padapter,
|
||||
false,
|
||||
restore_iqk_rst,
|
||||
b2Ant,
|
||||
pHalData->ant_path);
|
||||
pHalData->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
|
||||
|
||||
hal_btcoex_IQKNotify(padapter, false);
|
||||
|
|
@ -812,7 +810,11 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
|
|||
u8 bMacPwrCtrlOn;
|
||||
|
||||
/* Run LPS WL RFOFF flow */
|
||||
HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_enter_lps_flow);
|
||||
HalPwrSeqCmdParsing(padapter,
|
||||
PWR_CUT_ALL_MSK,
|
||||
PWR_FAB_ALL_MSK,
|
||||
PWR_INTF_SDIO_MSK,
|
||||
rtl8723B_enter_lps_flow);
|
||||
|
||||
/* ==== Reset digital sequence ====== */
|
||||
|
||||
|
|
@ -841,7 +843,11 @@ static void CardDisableRTL8723BSdio(struct adapter *padapter)
|
|||
|
||||
bMacPwrCtrlOn = false; /* Disable CMD53 R/W */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_APFM_ON_MAC, &bMacPwrCtrlOn);
|
||||
HalPwrSeqCmdParsing(padapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, rtl8723B_card_disable_flow);
|
||||
HalPwrSeqCmdParsing(padapter,
|
||||
PWR_CUT_ALL_MSK,
|
||||
PWR_FAB_ALL_MSK,
|
||||
PWR_INTF_SDIO_MSK,
|
||||
rtl8723B_card_disable_flow);
|
||||
}
|
||||
|
||||
u32 rtl8723bs_hal_deinit(struct adapter *padapter)
|
||||
|
|
@ -853,7 +859,10 @@ u32 rtl8723bs_hal_deinit(struct adapter *padapter)
|
|||
u8 val8 = 0;
|
||||
|
||||
rtl8723b_set_FwPwrModeInIPS_cmd(padapter, 0x3);
|
||||
/* poll 0x1cc to make sure H2C command already finished by FW; MAC_0x1cc = 0 means H2C done by FW. */
|
||||
/*
|
||||
* poll 0x1cc to make sure H2C command already finished by FW;
|
||||
* MAC_0x1cc = 0 means H2C done by FW.
|
||||
*/
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_HMETFR);
|
||||
cnt++;
|
||||
|
|
@ -862,10 +871,13 @@ u32 rtl8723bs_hal_deinit(struct adapter *padapter)
|
|||
/* H2C done, enter 32k */
|
||||
if (val8 == 0) {
|
||||
/* set rpwm to enter 32k */
|
||||
val8 = rtw_read8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HRPWM1);
|
||||
val8 = rtw_read8(padapter,
|
||||
SDIO_LOCAL_BASE | SDIO_REG_HRPWM1);
|
||||
val8 += 0x80;
|
||||
val8 |= BIT(0);
|
||||
rtw_write8(padapter, SDIO_LOCAL_BASE | SDIO_REG_HRPWM1, val8);
|
||||
rtw_write8(padapter,
|
||||
SDIO_LOCAL_BASE | SDIO_REG_HRPWM1,
|
||||
val8);
|
||||
adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80;
|
||||
cnt = val8 = 0;
|
||||
do {
|
||||
|
|
@ -954,13 +966,6 @@ static void _EfuseCellSel(struct adapter *padapter)
|
|||
rtw_write32(padapter, EFUSE_TEST, value32);
|
||||
}
|
||||
|
||||
static void _ReadRFType(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_com_data *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
pHalData->rf_chip = RF_6052;
|
||||
}
|
||||
|
||||
static void Hal_EfuseParseMACAddr_8723BS(
|
||||
struct adapter *padapter, u8 *hwinfo, bool AutoLoadFail
|
||||
)
|
||||
|
|
@ -985,8 +990,9 @@ static void Hal_EfuseParseBoardType_8723BS(
|
|||
pHalData->BoardType = (hwinfo[EEPROM_RF_BOARD_OPTION_8723B] & 0xE0) >> 5;
|
||||
if (pHalData->BoardType == 0xFF)
|
||||
pHalData->BoardType = (EEPROM_DEFAULT_BOARD_OPTION & 0xE0) >> 5;
|
||||
} else
|
||||
} else {
|
||||
pHalData->BoardType = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void _ReadEfuseInfo8723BS(struct adapter *padapter)
|
||||
|
|
@ -1003,7 +1009,6 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)
|
|||
Hal_InitPGData(padapter, hwinfo);
|
||||
|
||||
Hal_EfuseParseIDCode(padapter, hwinfo);
|
||||
Hal_EfuseParseEEPROMVer_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
|
||||
Hal_EfuseParseMACAddr_8723BS(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
|
||||
|
|
@ -1018,7 +1023,6 @@ static void _ReadEfuseInfo8723BS(struct adapter *padapter)
|
|||
Hal_EfuseParseChnlPlan_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
Hal_EfuseParseXtal_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
Hal_EfuseParseThermalMeter_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
Hal_EfuseParseCustomerID_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
|
||||
Hal_EfuseParseVoltage_8723B(padapter, hwinfo, pEEPROM->bautoload_fail_flag);
|
||||
|
||||
|
|
@ -1059,12 +1063,17 @@ static s32 _ReadAdapterInfo8723BS(struct adapter *padapter)
|
|||
rtw_write8(padapter, 0x4e, val8);
|
||||
|
||||
_EfuseCellSel(padapter);
|
||||
_ReadRFType(padapter);
|
||||
_ReadPROMContent(padapter);
|
||||
|
||||
if (!padapter->hw_init_completed) {
|
||||
rtw_write8(padapter, 0x67, 0x00); /* for BT, Switch Ant control to BT */
|
||||
CardDisableRTL8723BSdio(padapter);/* for the power consumption issue, wifi ko module is loaded during booting, but wifi GUI is off */
|
||||
/* for BT, Switch Ant control to BT */
|
||||
rtw_write8(padapter, 0x67, 0x00);
|
||||
|
||||
/*
|
||||
* for the power consumption issue, wifi ko module is loaded during booting,
|
||||
* but wifi GUI is off
|
||||
*/
|
||||
CardDisableRTL8723BSdio(padapter);
|
||||
}
|
||||
|
||||
return _SUCCESS;
|
||||
|
|
|
|||
|
|
@ -803,7 +803,7 @@ void sd_int_hdl(struct adapter *adapter)
|
|||
struct hal_com_data *hal;
|
||||
|
||||
if (
|
||||
(adapter->bDriverStopped) || (adapter->bSurpriseRemoved)
|
||||
(adapter->driver_stopped) || (adapter->bSurpriseRemoved)
|
||||
)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ struct adapter {
|
|||
struct recv_priv recvpriv;
|
||||
struct sta_priv stapriv;
|
||||
struct security_priv securitypriv;
|
||||
spinlock_t security_key_mutex; /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
spinlock_t security_key_mutex;
|
||||
struct registry_priv registrypriv;
|
||||
struct eeprom_priv eeprompriv;
|
||||
|
||||
|
|
@ -294,7 +294,7 @@ struct adapter {
|
|||
void *HalData;
|
||||
u32 hal_data_sz;
|
||||
|
||||
s32 bDriverStopped;
|
||||
bool driver_stopped;
|
||||
s32 bSurpriseRemoved;
|
||||
s32 bCardDisableWOHSM;
|
||||
|
||||
|
|
@ -389,6 +389,7 @@ struct adapter {
|
|||
static inline void RTW_ENABLE_FUNC(struct adapter *padapter, int func_bit)
|
||||
{
|
||||
int df = atomic_read(&adapter_to_dvobj(padapter)->disable_func);
|
||||
|
||||
df &= ~(func_bit);
|
||||
atomic_set(&adapter_to_dvobj(padapter)->disable_func, df);
|
||||
}
|
||||
|
|
@ -400,12 +401,12 @@ static inline void RTW_ENABLE_FUNC(struct adapter *padapter, int func_bit)
|
|||
RTW_IS_FUNC_DISABLED((padapter), DF_IO_BIT))
|
||||
|
||||
#define RTW_CANNOT_RX(padapter) \
|
||||
((padapter)->bDriverStopped || \
|
||||
((padapter)->driver_stopped || \
|
||||
(padapter)->bSurpriseRemoved || \
|
||||
RTW_IS_FUNC_DISABLED((padapter), DF_RX_BIT))
|
||||
|
||||
#define RTW_CANNOT_TX(padapter) \
|
||||
((padapter)->bDriverStopped || \
|
||||
((padapter)->driver_stopped || \
|
||||
(padapter)->bSurpriseRemoved || \
|
||||
RTW_IS_FUNC_DISABLED((padapter), DF_TX_BIT))
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#define REG_RSV_CTRL 0x001C
|
||||
#define REG_RF_CTRL 0x001F
|
||||
#define REG_AFE_XTAL_CTRL 0x0024
|
||||
#define REG_MAC_PHY_CTRL 0x002c /* for 92d, DMDP, SMSP, DMSP contrl */
|
||||
#define REG_MAC_PHY_CTRL 0x002c /* for 92d, DMDP, SMSP, DMSP control */
|
||||
#define REG_EFUSE_CTRL 0x0030
|
||||
#define REG_EFUSE_TEST 0x0034
|
||||
#define REG_PWR_DATA 0x0038
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
|
||||
/* */
|
||||
/* */
|
||||
/* Redifine 8192C register definition for compatibility */
|
||||
/* Redefine 8192C register definition for compatibility */
|
||||
/* */
|
||||
/* */
|
||||
#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */
|
||||
|
|
@ -273,7 +273,7 @@
|
|||
/* */
|
||||
/* 8192C (RCR) Receive Configuration Register (Offset 0x608, 32 bits) */
|
||||
/* */
|
||||
#define RCR_APPFCS BIT(31) /* WMAC append FCS after pauload */
|
||||
#define RCR_APPFCS BIT(31) /* WMAC append FCS after payload */
|
||||
#define RCR_APP_MIC BIT(30) /* MACRX will retain the MIC at the bottom of the packet. */
|
||||
#define RCR_APP_ICV BIT(29) /* MACRX will retain the ICV at the bottom of the packet. */
|
||||
#define RCR_APP_PHYST_RXFF BIT(28) /* PHY Status is appended before RX packet in RXFF */
|
||||
|
|
@ -342,7 +342,6 @@
|
|||
#define VENDOR_ID BIT(19)
|
||||
|
||||
#define RTL_ID BIT(23) /* TestChip ID, 1:Test(RLE); 0:MP(RL) */
|
||||
#define SPS_SEL BIT(24) /* 1:LDO regulator mode; 0:Switching regulator mode */
|
||||
|
||||
|
||||
#define CHIP_VER_RTL_MASK 0xF000 /* Bit 12 ~ 15 */
|
||||
|
|
@ -590,9 +589,6 @@
|
|||
#define C2H_EVT_FW_CLOSE 0xFF /* Set by FW indicating that FW had set the C2H command message and it's not yet read by driver. */
|
||||
|
||||
/* 2REG_MULTI_FUNC_CTRL(For RTL8723 Only) */
|
||||
#define WL_HWPDN_SL BIT(1) /* WiFi HW PDn polarity control */
|
||||
#define WL_FUNC_EN BIT(2) /* WiFi function enable */
|
||||
#define BT_FUNC_EN BIT(18) /* BT function enable */
|
||||
#define GPS_FUNC_EN BIT(22) /* GPS function enable */
|
||||
|
||||
#endif /* __HAL_COMMON_H__ */
|
||||
|
|
|
|||
|
|
@ -12,29 +12,6 @@
|
|||
|
||||
#include <hal_sdio.h>
|
||||
|
||||
/* */
|
||||
/* <Roger_Notes> For RTL8723 WiFi/BT/GPS multi-function configuration. 2010.10.06. */
|
||||
/* */
|
||||
enum rt_multi_func {
|
||||
RT_MULTI_FUNC_NONE = 0x00,
|
||||
RT_MULTI_FUNC_WIFI = 0x01,
|
||||
RT_MULTI_FUNC_BT = 0x02,
|
||||
RT_MULTI_FUNC_GPS = 0x04,
|
||||
};
|
||||
/* */
|
||||
/* <Roger_Notes> For RTL8723 WiFi PDn/GPIO polarity control configuration. 2010.10.08. */
|
||||
/* */
|
||||
enum rt_polarity_ctl {
|
||||
RT_POLARITY_LOW_ACT = 0,
|
||||
RT_POLARITY_HIGH_ACT = 1,
|
||||
};
|
||||
|
||||
/* For RTL8723 regulator mode. by tynli. 2011.01.14. */
|
||||
enum rt_regulator_mode {
|
||||
RT_SWITCHING_REGULATOR = 0,
|
||||
RT_LDO_REGULATOR = 1,
|
||||
};
|
||||
|
||||
enum rt_ampdu_burst {
|
||||
RT_AMPDU_BURST_NONE = 0,
|
||||
RT_AMPDU_BURST_92D = 1,
|
||||
|
|
@ -162,10 +139,6 @@ struct dm_priv {
|
|||
|
||||
|
||||
struct hal_com_data {
|
||||
enum rt_multi_func MultiFunc; /* For multi-function consideration. */
|
||||
enum rt_polarity_ctl PolarityCtl; /* For Wifi PDn Polarity control. */
|
||||
enum rt_regulator_mode RegulatorMode; /* switching regulator or LDO */
|
||||
|
||||
u16 FirmwareVersion;
|
||||
u16 FirmwareVersionRev;
|
||||
u16 FirmwareSubVersion;
|
||||
|
|
@ -181,35 +154,16 @@ struct hal_com_data {
|
|||
|
||||
u16 CustomerID;
|
||||
u16 BasicRateSet;
|
||||
u16 ForcedDataRate;/* Force Data Rate. 0: Auto, 0x02: 1M ~ 0x6C: 54M. */
|
||||
u32 ReceiveConfig;
|
||||
|
||||
/* rf_ctrl */
|
||||
u8 rf_chip;
|
||||
u8 PackageType;
|
||||
u8 NumTotalRFPath;
|
||||
|
||||
u8 InterfaceSel;
|
||||
u8 framesync;
|
||||
u32 framesyncC34;
|
||||
u8 framesyncMonitor;
|
||||
u8 DefaultInitialGain[4];
|
||||
/* EEPROM setting. */
|
||||
u16 EEPROMVID;
|
||||
u16 EEPROMSVID;
|
||||
|
||||
u8 EEPROMCustomerID;
|
||||
u8 EEPROMSubCustomerID;
|
||||
u8 EEPROMVersion;
|
||||
u8 EEPROMRegulatory;
|
||||
u8 EEPROMThermalMeter;
|
||||
u8 EEPROMBluetoothCoexist;
|
||||
u8 EEPROMBluetoothType;
|
||||
u8 EEPROMBluetoothAntNum;
|
||||
u8 EEPROMBluetoothAntIsolation;
|
||||
u8 EEPROMBluetoothRadioShared;
|
||||
u8 bTXPowerDataReadFromEEPORM;
|
||||
u8 bAPKThermalMeterIgnore;
|
||||
u8 bDisableSWChannelPlan; /* flag of disable software change channel plan */
|
||||
|
||||
bool EepromOrEfuse;
|
||||
|
|
@ -221,31 +175,18 @@ struct hal_com_data {
|
|||
u8 Index24G_CCK_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER];
|
||||
u8 Index24G_BW40_Base[MAX_RF_PATH][CHANNEL_MAX_NUMBER];
|
||||
/* If only one tx, only BW20 and OFDM are used. */
|
||||
s8 CCK_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
|
||||
s8 OFDM_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
|
||||
s8 BW20_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
|
||||
s8 BW40_24G_Diff[MAX_RF_PATH][MAX_TX_COUNT];
|
||||
|
||||
u8 Regulation2_4G;
|
||||
|
||||
u8 TxPwrInPercentage;
|
||||
|
||||
u8 TxPwrCalibrateRate;
|
||||
/* TX power by rate table */
|
||||
/* RF: at most 2 = AB = 0/1 */
|
||||
/* CCK = 0 OFDM = 1 HT-MCS 0-7 = 2 */
|
||||
u8 TxPwrByRateTable;
|
||||
u8 TxPwrByRateBand;
|
||||
s8 TxPwrByRateOffset[MAX_RF_PATH_NUM][TX_PWR_BY_RATE_NUM_RATE];
|
||||
/* */
|
||||
|
||||
/* 2 Power Limit Table */
|
||||
u8 TxPwrLevelCck[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
|
||||
u8 TxPwrLevelHT40_1S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; /* For HT 40MHZ pwr */
|
||||
u8 TxPwrLevelHT40_2S[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER]; /* For HT 40MHZ pwr */
|
||||
s8 TxPwrHt20Diff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];/* HT 20<->40 Pwr diff */
|
||||
u8 TxPwrLegacyHtDiff[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];/* For HT<->legacy pwr diff */
|
||||
|
||||
/* Power Limit Table for 2.4G */
|
||||
s8 TxPwrLimit_2_4G[MAX_REGULATION_NUM]
|
||||
[MAX_2_4G_BANDWIDTH_NUM]
|
||||
|
|
@ -256,52 +197,20 @@ struct hal_com_data {
|
|||
/* Store the original power by rate value of the base of each rate section of rf path A & B */
|
||||
u8 TxPwrByRateBase2_4G[MAX_RF_PATH_NUM][MAX_RATE_SECTION_NUM];
|
||||
|
||||
/* For power group */
|
||||
u8 PwrGroupHT20[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
|
||||
u8 PwrGroupHT40[RF_PATH_MAX_92C_88E][CHANNEL_MAX_NUMBER];
|
||||
|
||||
|
||||
|
||||
|
||||
u8 PGMaxGroup;
|
||||
u8 LegacyHTTxPowerDiff;/* Legacy to HT rate power diff */
|
||||
/* The current Tx Power Level */
|
||||
u8 CurrentCckTxPwrIdx;
|
||||
u8 CurrentOfdm24GTxPwrIdx;
|
||||
u8 CurrentBW2024GTxPwrIdx;
|
||||
u8 CurrentBW4024GTxPwrIdx;
|
||||
|
||||
/* Read/write are allow for following hardware information variables */
|
||||
u8 pwrGroupCnt;
|
||||
u32 MCSTxPowerLevelOriginalOffset[MAX_PG_GROUP][16];
|
||||
u32 CCKTxPowerLevelOriginalOffset;
|
||||
|
||||
u8 CrystalCap;
|
||||
u32 AntennaTxPath; /* Antenna path Tx */
|
||||
u32 AntennaRxPath; /* Antenna path Rx */
|
||||
|
||||
u8 PAType_2G;
|
||||
u8 LNAType_2G;
|
||||
u8 ExternalPA_2G;
|
||||
u8 ExternalLNA_2G;
|
||||
u8 TypeGLNA;
|
||||
u8 TypeGPA;
|
||||
u8 TypeALNA;
|
||||
u8 TypeAPA;
|
||||
u8 RFEType;
|
||||
u8 BoardType;
|
||||
u8 ExternalPA;
|
||||
u8 bIQKInitialized;
|
||||
bool bLCKInProgress;
|
||||
|
||||
bool bSwChnl;
|
||||
bool bSetChnlBW;
|
||||
bool bChnlBWInitialized;
|
||||
bool bNeedIQK;
|
||||
|
||||
u8 bLedOpenDrain; /* Support Open-drain arrangement for controlling the LED. Added by Roger, 2009.10.16. */
|
||||
u8 TxPowerTrackControl; /* for mp mode, turn off txpwrtracking as default */
|
||||
u8 b1x1RecvCombine; /* for 1T1R receive combining */
|
||||
|
||||
u32 AcParam_BE; /* Original parameter for BE, use for EDCA turbo. */
|
||||
|
||||
|
|
@ -309,59 +218,31 @@ struct hal_com_data {
|
|||
|
||||
u32 RfRegChnlVal[2];
|
||||
|
||||
/* RDG enable */
|
||||
bool bRDGEnable;
|
||||
|
||||
/* for host message to fw */
|
||||
u8 LastHMEBoxNum;
|
||||
|
||||
u8 fw_ractrl;
|
||||
u8 RegTxPause;
|
||||
/* Beacon function related global variable. */
|
||||
u8 RegBcnCtrlVal;
|
||||
u8 RegFwHwTxQCtrl;
|
||||
u8 RegReg542;
|
||||
u8 RegCR_1;
|
||||
u8 Reg837;
|
||||
u8 RegRFPathS1;
|
||||
u16 RegRRSR;
|
||||
|
||||
u8 CurAntenna;
|
||||
u8 AntDivCfg;
|
||||
u8 AntDetection;
|
||||
u8 TRxAntDivType;
|
||||
u8 ant_path; /* for 8723B s0/s1 selection */
|
||||
|
||||
u8 u1ForcedIgiLb; /* forced IGI lower bound */
|
||||
|
||||
u8 bDumpRxPkt;/* for debug */
|
||||
u8 bDumpTxPkt;/* for debug */
|
||||
u8 FwRsvdPageStartOffset; /* 2010.06.23. Added by tynli. Reserve page start offset except beacon in TxQ. */
|
||||
|
||||
/* 2010/08/09 MH Add CU power down mode. */
|
||||
bool pwrdown;
|
||||
|
||||
/* Add for dual MAC 0--Mac0 1--Mac1 */
|
||||
u32 interfaceIndex;
|
||||
|
||||
u8 OutEpQueueSel;
|
||||
u8 OutEpNumber;
|
||||
|
||||
/* 2010/12/10 MH Add for USB aggregation mode dynamic scheme. */
|
||||
bool UsbRxHighSpeedMode;
|
||||
|
||||
/* 2010/11/22 MH Add for slim combo debug mode selective. */
|
||||
/* This is used for fix the drawback of CU TSMC-A/UMC-A cut. HW auto suspend ability. Close BT clock. */
|
||||
bool SlimComboDbg;
|
||||
|
||||
/* u8 AMPDUDensity; */
|
||||
|
||||
/* Auto FSM to Turn On, include clock, isolation, power control for MAC only */
|
||||
u8 bMacPwrCtrlOn;
|
||||
|
||||
u8 RegIQKFWOffload;
|
||||
struct submit_ctx iqk_sctx;
|
||||
|
||||
enum rt_ampdu_burst AMPDUBurstMode; /* 92C maybe not use, but for compile successfully */
|
||||
|
||||
u32 sdio_himr;
|
||||
|
|
@ -370,7 +251,6 @@ struct hal_com_data {
|
|||
/* SDIO Tx FIFO related. */
|
||||
/* HIQ, MID, LOW, PUB free pages; padapter->xmitpriv.free_txpg */
|
||||
u8 SdioTxFIFOFreePage[SDIO_TX_FREE_PG_QUEUE];
|
||||
spinlock_t SdioTxFIFOFreePageLock;
|
||||
u8 SdioTxOQTMaxFreeSpace;
|
||||
u8 SdioTxOQTFreeSpace;
|
||||
|
||||
|
|
@ -392,7 +272,5 @@ struct hal_com_data {
|
|||
};
|
||||
|
||||
#define GET_HAL_DATA(__padapter) ((struct hal_com_data *)((__padapter)->HalData))
|
||||
#define GET_HAL_RFPATH_NUM(__padapter) (((struct hal_com_data *)((__padapter)->HalData))->NumTotalRFPath)
|
||||
#define RT_GetInterfaceSelection(_Adapter) (GET_HAL_DATA(_Adapter)->InterfaceSel)
|
||||
|
||||
#endif /* __HAL_DATA_H__ */
|
||||
|
|
|
|||
|
|
@ -97,7 +97,6 @@ enum {
|
|||
HW_VAR_WIRELESS_MODE,
|
||||
HW_VAR_USB_MODE,
|
||||
HW_VAR_PORT_SWITCH,
|
||||
HW_VAR_DO_IQK,
|
||||
HW_VAR_DM_IN_LPS,
|
||||
HW_VAR_SET_REQ_FW_PS,
|
||||
HW_VAR_FW_PS_STATE,
|
||||
|
|
@ -153,11 +152,6 @@ enum hal_odm_variable {
|
|||
HAL_ODM_NOISE_MONITOR,
|
||||
};
|
||||
|
||||
enum hal_intf_ps_func {
|
||||
HAL_USB_SELECT_SUSPEND,
|
||||
HAL_MAX_ID,
|
||||
};
|
||||
|
||||
typedef s32 (*c2h_id_filter)(u8 *c2h_evt);
|
||||
|
||||
#define RF_CHANGE_BY_INIT 0
|
||||
|
|
@ -239,7 +233,7 @@ c2h_id_filter rtw_hal_c2h_id_filter_ccx(struct adapter *adapter);
|
|||
s32 rtw_hal_macid_sleep(struct adapter *padapter, u32 macid);
|
||||
s32 rtw_hal_macid_wakeup(struct adapter *padapter, u32 macid);
|
||||
|
||||
s32 rtw_hal_fill_h2c_cmd(struct adapter *, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
|
||||
s32 rtw_hal_fill_h2c_cmd(struct adapter *adapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer);
|
||||
|
||||
void SetHwReg8723BS(struct adapter *padapter, u8 variable, u8 *val);
|
||||
void GetHwReg8723BS(struct adapter *padapter, u8 variable, u8 *val);
|
||||
|
|
|
|||
|
|
@ -38,8 +38,6 @@
|
|||
|
||||
#define EEPROM_RF_BOARD_OPTION_8723B 0xC1
|
||||
#define EEPROM_RF_BT_SETTING_8723B 0xC3
|
||||
#define EEPROM_VERSION_8723B 0xC4
|
||||
#define EEPROM_CustomID_8723B 0xC5
|
||||
#define EEPROM_DEFAULT_DIFF 0XFE
|
||||
|
||||
/* RTL8723BS */
|
||||
|
|
@ -62,8 +60,4 @@ enum {
|
|||
Ant_x1 = 1
|
||||
};
|
||||
|
||||
enum {
|
||||
BT_RTL8723B = 8,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -529,9 +529,9 @@ enum {
|
|||
RTW_WLAN_CATEGORY_FT = 6,
|
||||
RTW_WLAN_CATEGORY_HT = 7,
|
||||
RTW_WLAN_CATEGORY_SA_QUERY = 8,
|
||||
RTW_WLAN_CATEGORY_UNPROTECTED_WNM = 11, /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
RTW_WLAN_CATEGORY_UNPROTECTED_WNM = 11,
|
||||
RTW_WLAN_CATEGORY_TDLS = 12,
|
||||
RTW_WLAN_CATEGORY_SELF_PROTECTED = 15, /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
RTW_WLAN_CATEGORY_SELF_PROTECTED = 15,
|
||||
RTW_WLAN_CATEGORY_WMM = 17,
|
||||
RTW_WLAN_CATEGORY_P2P = 0x7f,/* P2P action frames */
|
||||
};
|
||||
|
|
@ -623,32 +623,6 @@ struct rtw_ieee80211_channel {
|
|||
/* int orig_mpwr; */
|
||||
};
|
||||
|
||||
#define CHAN_FMT \
|
||||
/*"band:%d, "*/ \
|
||||
/*"center_freq:%u, "*/ \
|
||||
"hw_value:%u, " \
|
||||
"flags:0x%08x" \
|
||||
/*"max_antenna_gain:%d\n"*/ \
|
||||
/*"max_power:%d\n"*/ \
|
||||
/*"max_reg_power:%d\n"*/ \
|
||||
/*"beacon_found:%u\n"*/ \
|
||||
/*"orig_flags:0x%08x\n"*/ \
|
||||
/*"orig_mag:%d\n"*/ \
|
||||
/*"orig_mpwr:%d\n"*/
|
||||
|
||||
#define CHAN_ARG(channel) \
|
||||
/*(channel)->band*/ \
|
||||
/*, (channel)->center_freq*/ \
|
||||
(channel)->hw_value \
|
||||
, (channel)->flags \
|
||||
/*, (channel)->max_antenna_gain*/ \
|
||||
/*, (channel)->max_power*/ \
|
||||
/*, (channel)->max_reg_power*/ \
|
||||
/*, (channel)->beacon_found*/ \
|
||||
/*, (channel)->orig_flags*/ \
|
||||
/*, (channel)->orig_mag*/ \
|
||||
/*, (channel)->orig_mpwr*/ \
|
||||
|
||||
/* Parsed Information Elements */
|
||||
struct rtw_ieee802_11_elems {
|
||||
u8 *ssid;
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ void rtw_cfg80211_indicate_connect(struct adapter *padapter);
|
|||
void rtw_cfg80211_indicate_disconnect(struct adapter *padapter);
|
||||
void rtw_cfg80211_indicate_scan_done(struct adapter *adapter, bool aborted);
|
||||
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len);
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, unsigned int frame_len);
|
||||
void rtw_cfg80211_indicate_sta_disassoc(struct adapter *padapter, unsigned char *da, unsigned short reason);
|
||||
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len, const char *msg);
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, unsigned int frame_len, const char *msg);
|
||||
|
||||
bool rtw_cfg80211_pwr_mgmt(struct adapter *adapter);
|
||||
|
||||
|
|
|
|||
|
|
@ -98,10 +98,7 @@ static inline void rtw_netif_stop_queue(struct net_device *pnetdev)
|
|||
|
||||
#define rtw_signal_process(pid, sig) kill_pid(find_vpid((pid)), (sig), 1)
|
||||
|
||||
#define NDEV_ARG(ndev) ndev->name
|
||||
#define ADPT_ARG(adapter) adapter->pnetdev->name
|
||||
#define FUNC_NDEV_FMT "%s(%s)"
|
||||
#define FUNC_NDEV_ARG(ndev) __func__, ndev->name
|
||||
#define FUNC_ADPT_FMT "%s(%s)"
|
||||
#define FUNC_ADPT_ARG(adapter) __func__, adapter->pnetdev->name
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,4 @@ struct phy_stat {
|
|||
/* Rx smooth factor */
|
||||
#define Rx_Smooth_Factor (20)
|
||||
|
||||
void rtl8192c_translate_rx_signal_stuff(union recv_frame *precvframe, struct phy_stat *pphy_status);
|
||||
void rtl8192c_query_rx_desc_status(union recv_frame *precvframe, struct recv_stat *pdesc);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -72,6 +72,19 @@ struct rt_firmware_hdr {
|
|||
#define DRIVER_EARLY_INT_TIME_8723B 0x05
|
||||
#define BCN_DMA_ATIME_INT_TIME_8723B 0x02
|
||||
|
||||
/* REG_TBTT_PROHIBIT (0x0540) - TBTT prohibit hold/setup in 32us units */
|
||||
#define TBTT_PROHIBIT_SETUP_8723B 0x04
|
||||
#define TBTT_PROHIBIT_HOLD_8723B 0x64
|
||||
#define TBTT_PROHIBIT_TIME_8723B \
|
||||
((TBTT_PROHIBIT_HOLD_8723B << 8) | TBTT_PROHIBIT_SETUP_8723B)
|
||||
|
||||
/* REG_BCNTCFG (0x0510) - beacon AIFS, CWmin, CWmax (EDCA-like layout) */
|
||||
#define BCN_AIFS_8723B 0x0F
|
||||
#define BCN_CW_MIN_8723B 0x06
|
||||
#define BCN_CW_MAX_8723B 0x06
|
||||
#define BCNTCFG_8723B \
|
||||
((BCN_CW_MAX_8723B << 12) | (BCN_CW_MIN_8723B << 8) | BCN_AIFS_8723B)
|
||||
|
||||
/* for 8723B */
|
||||
/* TX 32K, RX 16K, Page size 128B for TX, 8B for RX */
|
||||
#define PAGE_SIZE_TX_8723B 128
|
||||
|
|
@ -180,11 +193,6 @@ enum { /* tag_Package_Definition */
|
|||
PACKAGE_TFBGA79
|
||||
};
|
||||
|
||||
#define INCLUDE_MULTI_FUNC_BT(_Adapter) \
|
||||
(GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_BT)
|
||||
#define INCLUDE_MULTI_FUNC_GPS(_Adapter) \
|
||||
(GET_HAL_DATA(_Adapter)->MultiFunc & RT_MULTI_FUNC_GPS)
|
||||
|
||||
/* rtl8723a_hal_init.c */
|
||||
s32 rtl8723b_FirmwareDownload(struct adapter *padapter, bool bUsedWoWLANFw);
|
||||
void rtl8723b_FirmwareSelfReset(struct adapter *padapter);
|
||||
|
|
@ -203,12 +211,8 @@ void Hal_EfuseParseTxPowerInfo_8723B(struct adapter *padapter, u8 *PROMContent,
|
|||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseBTCoexistInfo_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseEEPROMVer_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseChnlPlan_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseCustomerID_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseXtal_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseThermalMeter_8723B(struct adapter *padapter, u8 *hwinfo,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
void init_mlme_ap_info(struct adapter *padapter);
|
||||
void free_mlme_ap_info(struct adapter *padapter);
|
||||
/* void update_BCNTIM(struct adapter *padapter); */
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id, u8 *oui, u8 tx);
|
||||
void update_beacon(struct adapter *padapter, u8 ie_id, u8 tx);
|
||||
void add_ratid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level);
|
||||
void expire_timeout_chk(struct adapter *padapter);
|
||||
void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta);
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@
|
|||
u8 *cmd_buf; /* shall be non-paged, and 4 bytes aligned */
|
||||
u8 *cmd_allocated_buf;
|
||||
u8 *rsp_buf; /* shall be non-paged, and 4 bytes aligned */
|
||||
u8 *rsp_allocated_buf;
|
||||
u32 cmd_issued_cnt;
|
||||
u32 cmd_done_cnt;
|
||||
u32 rsp_cnt;
|
||||
|
|
@ -133,8 +132,8 @@ enum {
|
|||
INTEl_WIDI_WK_CID,
|
||||
C2H_WK_CID,
|
||||
RTP_TIMER_CFG_WK_CID,
|
||||
RESET_SECURITYPRIV, /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
FREE_ASSOC_RESOURCES, /* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
RESET_SECURITYPRIV,
|
||||
FREE_ASSOC_RESOURCES,
|
||||
DM_IN_LPS_WK_CID,
|
||||
DM_RA_MSK_WK_CID, /* add for STA update RAMask when bandwidth change. */
|
||||
BEAMFORMING_WK_CID,
|
||||
|
|
@ -551,9 +550,6 @@ struct RunInThread_param {
|
|||
};
|
||||
|
||||
|
||||
#define GEN_CMD_CODE(cmd) cmd ## _CMD_
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Result:
|
||||
|
|
@ -586,7 +582,7 @@ extern u8 rtw_clearstakey_cmd(struct adapter *padapter, struct sta_info *sta, u8
|
|||
|
||||
extern u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork);
|
||||
u8 rtw_disassoc_cmd(struct adapter *padapter, u32 deauth_timeout_ms, bool enqueue);
|
||||
extern u8 rtw_setopmode_cmd(struct adapter *padapter, enum ndis_802_11_network_infrastructure networktype, bool enqueue);
|
||||
extern u8 rtw_setopmode_cmd(struct adapter *padapter, enum nl80211_iftype networktype, bool enqueue);
|
||||
extern u8 rtw_setrfintfs_cmd(struct adapter *padapter, u8 mode);
|
||||
|
||||
extern u8 rtw_gettssi_cmd(struct adapter *padapter, u8 offset, u8 *pval);
|
||||
|
|
@ -594,7 +590,6 @@ extern u8 rtw_setfwdig_cmd(struct adapter *padapter, u8 type);
|
|||
extern u8 rtw_setfwra_cmd(struct adapter *padapter, u8 type);
|
||||
|
||||
extern u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr);
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
extern u8 rtw_reset_securitypriv_cmd(struct adapter *padapter);
|
||||
extern u8 rtw_free_assoc_resources_cmd(struct adapter *padapter);
|
||||
extern u8 rtw_dynamic_chk_wk_cmd(struct adapter *adapter);
|
||||
|
|
@ -630,86 +625,81 @@ struct _cmd_callback {
|
|||
};
|
||||
|
||||
enum {
|
||||
GEN_CMD_CODE(_Read_MACREG), /*0*/
|
||||
GEN_CMD_CODE(_Write_MACREG),
|
||||
GEN_CMD_CODE(_Read_BBREG),
|
||||
GEN_CMD_CODE(_Write_BBREG),
|
||||
GEN_CMD_CODE(_Read_RFREG),
|
||||
GEN_CMD_CODE(_Write_RFREG), /*5*/
|
||||
GEN_CMD_CODE(_Read_EEPROM),
|
||||
GEN_CMD_CODE(_Write_EEPROM),
|
||||
GEN_CMD_CODE(_Read_EFUSE),
|
||||
GEN_CMD_CODE(_Write_EFUSE),
|
||||
READ_MACREG_CMD, /*0*/
|
||||
WRITE_MACREG_CMD,
|
||||
READ_BBREG_CMD,
|
||||
WRITE_BBREG_CMD,
|
||||
READ_RFREG_CMD,
|
||||
WRITE_RFREG_CMD, /*5*/
|
||||
READ_EEPROM_CMD,
|
||||
WRITE_EEPROM_CMD,
|
||||
READ_EFUSE_CMD,
|
||||
WRITE_EFUSE_CMD,
|
||||
|
||||
GEN_CMD_CODE(_Read_CAM), /*10*/
|
||||
GEN_CMD_CODE(_Write_CAM),
|
||||
GEN_CMD_CODE(_setBCNITV),
|
||||
GEN_CMD_CODE(_setMBIDCFG),
|
||||
GEN_CMD_CODE(_JoinBss), /*14*/
|
||||
GEN_CMD_CODE(_DisConnect), /*15*/
|
||||
GEN_CMD_CODE(_CreateBss),
|
||||
GEN_CMD_CODE(_SetOpMode),
|
||||
GEN_CMD_CODE(_SiteSurvey), /*18*/
|
||||
GEN_CMD_CODE(_SetAuth),
|
||||
READ_CAM_CMD, /*10*/
|
||||
WRITE_CAM_CMD,
|
||||
SET_BCNITV_CMD,
|
||||
SET_MBIDCFG_CMD,
|
||||
JOIN_BSS_CMD, /*14*/
|
||||
DISCONNECT_CMD, /*15*/
|
||||
CREATE_BSS_CMD,
|
||||
SET_OP_MODE_CMD,
|
||||
SITE_SURVEY_CMD, /*18*/
|
||||
SET_AUTH_CMD,
|
||||
|
||||
GEN_CMD_CODE(_SetKey), /*20*/
|
||||
GEN_CMD_CODE(_SetStaKey),
|
||||
GEN_CMD_CODE(_SetAssocSta),
|
||||
GEN_CMD_CODE(_DelAssocSta),
|
||||
GEN_CMD_CODE(_SetStaPwrState),
|
||||
GEN_CMD_CODE(_SetBasicRate), /*25*/
|
||||
GEN_CMD_CODE(_GetBasicRate),
|
||||
GEN_CMD_CODE(_SetDataRate),
|
||||
GEN_CMD_CODE(_GetDataRate),
|
||||
GEN_CMD_CODE(_SetPhyInfo),
|
||||
SET_KEY_CMD, /*20*/
|
||||
SET_STA_KEY_CMD,
|
||||
SET_ASSOC_STA_CMD,
|
||||
DEL_ASSOC_STA_CMD,
|
||||
SET_STA_PWR_STATE_CMD,
|
||||
SET_BASIC_RATE_CMD, /*25*/
|
||||
GET_BASIC_RATE_CMD,
|
||||
SET_DATA_RATE_CMD,
|
||||
GET_DATA_RATE_CMD,
|
||||
SET_PHY_INFO_CMD,
|
||||
|
||||
GEN_CMD_CODE(_GetPhyInfo), /*30*/
|
||||
GEN_CMD_CODE(_SetPhy),
|
||||
GEN_CMD_CODE(_GetPhy),
|
||||
GEN_CMD_CODE(_readRssi),
|
||||
GEN_CMD_CODE(_readGain),
|
||||
GEN_CMD_CODE(_SetAtim), /*35*/
|
||||
GEN_CMD_CODE(_SetPwrMode),
|
||||
GEN_CMD_CODE(_JoinbssRpt),
|
||||
GEN_CMD_CODE(_SetRaTable),
|
||||
GEN_CMD_CODE(_GetRaTable),
|
||||
GET_PHY_INFO_CMD, /*30*/
|
||||
SET_PHY_CMD,
|
||||
GET_PHY_CMD,
|
||||
READ_RSSI_CMD,
|
||||
READ_GAIN_CMD,
|
||||
SET_ATIM_CMD, /*35*/
|
||||
SET_PWR_MODE_CMD,
|
||||
JOIN_BSS_RPT_CMD,
|
||||
SET_RA_TABLE_CMD,
|
||||
GET_RA_TABLE_CMD,
|
||||
|
||||
GEN_CMD_CODE(_GetCCXReport), /*40*/
|
||||
GEN_CMD_CODE(_GetDTMReport),
|
||||
GEN_CMD_CODE(_GetTXRateStatistics),
|
||||
GEN_CMD_CODE(_SetUsbSuspend),
|
||||
GEN_CMD_CODE(_SetH2cLbk),
|
||||
GEN_CMD_CODE(_AddBAReq), /*45*/
|
||||
GEN_CMD_CODE(_SetChannel), /*46*/
|
||||
GEN_CMD_CODE(_SetTxPower),
|
||||
GEN_CMD_CODE(_SwitchAntenna),
|
||||
GEN_CMD_CODE(_SetCrystalCap),
|
||||
GEN_CMD_CODE(_SetSingleCarrierTx), /*50*/
|
||||
GET_CCX_REPORT_CMD, /*40*/
|
||||
GET_DTM_REPORT_CMD,
|
||||
GET_TX_RATE_STATISTICS_CMD,
|
||||
SET_USB_SUSPEND_CMD,
|
||||
SET_H2C_LBK_CMD,
|
||||
ADD_BA_REQ_CMD, /*45*/
|
||||
SET_CHANNEL_CMD, /*46*/
|
||||
SET_TX_POWER_CMD,
|
||||
SWITCH_ANTENNA_CMD,
|
||||
SET_CRYSTAL_CAP_CMD,
|
||||
SET_SINGLE_CARRIER_TX_CMD, /*50*/
|
||||
|
||||
GEN_CMD_CODE(_SetSingleToneTx),/*51*/
|
||||
GEN_CMD_CODE(_SetCarrierSuppressionTx),
|
||||
GEN_CMD_CODE(_SetContinuousTx),
|
||||
GEN_CMD_CODE(_SwitchBandwidth), /*54*/
|
||||
GEN_CMD_CODE(_TX_Beacon), /*55*/
|
||||
SET_SINGLE_TONE_TX_CMD, /*51*/
|
||||
SET_CARRIER_SUPPRESSION_TX_CMD,
|
||||
SET_CONTINUOUS_TX_CMD,
|
||||
SWITCH_BANDWIDTH_CMD, /*54*/
|
||||
TX_BEACON_CMD, /*55*/
|
||||
|
||||
GEN_CMD_CODE(_Set_MLME_EVT), /*56*/
|
||||
GEN_CMD_CODE(_Set_Drv_Extra), /*57*/
|
||||
GEN_CMD_CODE(_Set_H2C_MSG), /*58*/
|
||||
SET_MLME_EVT_CMD, /*56*/
|
||||
SET_DRV_EXTRA_CMD, /*57*/
|
||||
SET_H2C_MSG_CMD, /*58*/
|
||||
|
||||
GEN_CMD_CODE(_SetChannelPlan), /*59*/
|
||||
SET_CHANNEL_PLAN_CMD, /*59*/
|
||||
|
||||
GEN_CMD_CODE(_SetChannelSwitch), /*60*/
|
||||
GEN_CMD_CODE(_TDLS), /*61*/
|
||||
GEN_CMD_CODE(_ChkBMCSleepq), /*62*/
|
||||
SET_CHANNEL_SWITCH_CMD, /*60*/
|
||||
TDLS_CMD, /*61*/
|
||||
CHK_BMC_SLEEPQ_CMD, /*62*/
|
||||
|
||||
GEN_CMD_CODE(_RunInThreadCMD), /*63*/
|
||||
RUN_IN_THREAD_CMD, /*63*/
|
||||
|
||||
MAX_H2CCMD
|
||||
};
|
||||
|
||||
#define _GetBBReg_CMD_ _Read_BBREG_CMD_
|
||||
#define _SetBBReg_CMD_ _Write_BBREG_CMD_
|
||||
#define _GetRFReg_CMD_ _Read_RFREG_CMD_
|
||||
#define _SetRFReg_CMD_ _Write_RFREG_CMD_
|
||||
|
||||
#endif /* __RTW_CMD_H_ */
|
||||
|
|
|
|||
|
|
@ -64,10 +64,6 @@ struct wmm_event {
|
|||
unsigned char wmm;
|
||||
};
|
||||
|
||||
#define GEN_EVT_CODE(event) event ## _EVT_
|
||||
|
||||
|
||||
|
||||
struct fwevent {
|
||||
u32 parmsize;
|
||||
void (*event_callback)(struct adapter *dev, u8 *pbuf);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ u8 rtw_set_802_11_authentication_mode(struct adapter *pdapter, enum ndis_802_11_
|
|||
u8 rtw_set_802_11_add_wep(struct adapter *padapter, struct ndis_802_11_wep *wep);
|
||||
u8 rtw_set_802_11_disassociate(struct adapter *padapter);
|
||||
u8 rtw_set_802_11_bssid_list_scan(struct adapter *padapter, struct ndis_802_11_ssid *pssid, int ssid_max_num);
|
||||
u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, enum ndis_802_11_network_infrastructure networktype);
|
||||
u8 rtw_set_802_11_infrastructure_mode(struct adapter *padapter, enum nl80211_iftype networktype);
|
||||
u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid);
|
||||
u8 rtw_set_802_11_connect(struct adapter *padapter, u8 *bssid, struct ndis_802_11_ssid *ssid);
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@
|
|||
/* define MAX_JOIN_TIMEOUT 2500 */
|
||||
#define MAX_JOIN_TIMEOUT 6500
|
||||
|
||||
/* Commented by Albert 20101105 */
|
||||
/* Increase the scanning timeout because of increasing the SURVEY_TO value. */
|
||||
/* Commented by Albert 20101105 */
|
||||
/* Increase the scanning timeout because of increasing the SURVEY_TO value. */
|
||||
|
||||
#define SCANNING_TIMEOUT 8000
|
||||
|
||||
|
|
@ -44,15 +44,15 @@
|
|||
|
||||
|
||||
enum {
|
||||
dot11AuthAlgrthm_Open = 0,
|
||||
dot11AuthAlgrthm_Shared,
|
||||
dot11AuthAlgrthm_8021X,
|
||||
dot11AuthAlgrthm_Auto,
|
||||
dot11AuthAlgrthm_WAPI,
|
||||
dot11AuthAlgrthm_MaxNum
|
||||
dot11_auth_algrthm_open = 0,
|
||||
dot11_auth_algrthm_shared,
|
||||
dot11_auth_algrthm_8021x,
|
||||
dot11_auth_algrthm_auto,
|
||||
dot11_auth_algrthm_wapi,
|
||||
dot11_auth_algrthm_maxnum
|
||||
};
|
||||
|
||||
/* Scan type including active and passive scan. */
|
||||
/* Scan type including active and passive scan. */
|
||||
enum rt_scan_type {
|
||||
SCAN_PASSIVE,
|
||||
SCAN_ACTIVE,
|
||||
|
|
@ -67,23 +67,22 @@ enum {
|
|||
};
|
||||
|
||||
/*
|
||||
|
||||
there are several "locks" in mlme_priv,
|
||||
since mlme_priv is a shared resource between many threads,
|
||||
like ISR/Call-Back functions, the OID handlers, and even timer functions.
|
||||
|
||||
Each struct __queue has its own locks, already.
|
||||
Other items in mlme_priv are protected by mlme_priv.lock, while items in
|
||||
xmit_priv are protected by xmit_priv.lock.
|
||||
|
||||
To avoid possible dead lock, any thread trying to modifying mlme_priv
|
||||
SHALL not lock up more than one locks at a time!
|
||||
|
||||
The only exception is that queue functions which take the __queue.lock
|
||||
may be called with the xmit_priv.lock held. In this case the order
|
||||
MUST always be first lock xmit_priv.lock and then call any queue functions
|
||||
which take __queue.lock.
|
||||
*/
|
||||
* There are several "locks" in mlme_priv,
|
||||
* since mlme_priv is a shared resource between many threads,
|
||||
* like ISR/Call-Back functions, the OID handlers, and even timer functions.
|
||||
*
|
||||
* Each struct __queue has its own locks, already.
|
||||
* Other items in mlme_priv are protected by mlme_priv.lock, while items in
|
||||
* xmit_priv are protected by xmit_priv.lock.
|
||||
*
|
||||
* To avoid possible dead lock, any thread trying to modifying mlme_priv
|
||||
* SHALL not lock up more than one locks at a time!
|
||||
*
|
||||
* The only exception is that queue functions which take the __queue.lock
|
||||
* may be called with the xmit_priv.lock held. In this case the order
|
||||
* MUST always be first lock xmit_priv.lock and then call any queue functions
|
||||
* which take __queue.lock.
|
||||
*/
|
||||
|
||||
struct sitesurvey_ctrl {
|
||||
u64 last_tx_pkts;
|
||||
|
|
@ -184,7 +183,8 @@ struct mlme_priv {
|
|||
u32 wps_probe_req_ie_len;
|
||||
|
||||
/* Number of associated Non-ERP stations (i.e., stations using 802.11b
|
||||
* in 802.11g BSS) */
|
||||
* in 802.11g BSS)
|
||||
*/
|
||||
int num_sta_non_erp;
|
||||
|
||||
/* Number of associated stations that do not support Short Slot Time */
|
||||
|
|
@ -217,12 +217,12 @@ struct mlme_priv {
|
|||
u8 *wps_beacon_ie;
|
||||
/* u8 *wps_probe_req_ie; */
|
||||
u8 *wps_probe_resp_ie;
|
||||
u8 *wps_assoc_resp_ie; /* for CONFIG_IOCTL_CFG80211, this IE could include p2p ie / wfd ie */
|
||||
u8 *wps_assoc_resp_ie; /* this IE could include p2p ie / wfd ie */
|
||||
|
||||
u32 wps_beacon_ie_len;
|
||||
/* u32 wps_probe_req_ie_len; */
|
||||
u32 wps_probe_resp_ie_len;
|
||||
u32 wps_assoc_resp_ie_len; /* for CONFIG_IOCTL_CFG80211, this IE len could include p2p ie / wfd ie */
|
||||
u32 wps_assoc_resp_ie_len; /* this IE len could include p2p ie / wfd ie */
|
||||
|
||||
u8 *p2p_beacon_ie;
|
||||
u8 *p2p_probe_req_ie;
|
||||
|
|
@ -258,7 +258,6 @@ extern void rtw_surveydone_event_callback(struct adapter *adapter, u8 *pbuf);
|
|||
extern void rtw_joinbss_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
extern void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
extern void rtw_stadel_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
extern void rtw_atimdone_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
extern void rtw_cpwm_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
extern void rtw_wmm_event_callback(struct adapter *padapter, u8 *pbuf);
|
||||
|
||||
|
|
@ -279,7 +278,7 @@ extern signed int rtw_set_auth(struct adapter *adapter, struct security_priv *ps
|
|||
|
||||
static inline u8 *get_bssid(struct mlme_priv *pmlmepriv)
|
||||
{ /* if sta_mode:pmlmepriv->cur_network.network.mac_address => bssid */
|
||||
/* if adhoc_mode:pmlmepriv->cur_network.network.mac_address => ibss mac address */
|
||||
/* if adhoc_mode:pmlmepriv->cur_network.network.mac_address => ibss mac address */
|
||||
return pmlmepriv->cur_network.network.mac_address;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -322,8 +322,8 @@ struct mlme_ext_info {
|
|||
|
||||
/* The channel information about this channel including joining, scanning, and power constraints. */
|
||||
struct rt_channel_info {
|
||||
u8 ChannelNum; /* The channel number. */
|
||||
enum rt_scan_type ScanType; /* Scan type such as passive or active scan. */
|
||||
u8 channel_num; /* The channel number. */
|
||||
enum rt_scan_type scan_type; /* Scan type such as passive or active scan. */
|
||||
};
|
||||
|
||||
int rtw_ch_set_search_ch(struct rt_channel_info *ch_set, const u32 ch);
|
||||
|
|
@ -433,9 +433,9 @@ void set_mcs_rate_by_mask(u8 *mcs_set, u32 mask);
|
|||
void update_basic_rate_table(struct adapter *padapter, u8 *mBratesOS);
|
||||
void update_basic_rate_table_soft_ap(u8 *bssrateset, u32 bssratelen);
|
||||
|
||||
void Save_DM_Func_Flag(struct adapter *padapter);
|
||||
void Restore_DM_Func_Flag(struct adapter *padapter);
|
||||
void Switch_DM_Func(struct adapter *padapter, u32 mode, u8 enable);
|
||||
void save_dm_func_flag(struct adapter *padapter);
|
||||
void restore_dm_func_flag(struct adapter *padapter);
|
||||
void switch_dm_func(struct adapter *padapter, u32 mode, u8 enable);
|
||||
|
||||
void set_msr(struct adapter *padapter, u8 type);
|
||||
|
||||
|
|
@ -503,7 +503,7 @@ int update_sta_support_rate(struct adapter *padapter, u8 *pvar_ie, uint var_ie_l
|
|||
|
||||
/* for sta/adhoc mode */
|
||||
void update_sta_info(struct adapter *padapter, struct sta_info *psta);
|
||||
void Update_RA_Entry(struct adapter *padapter, struct sta_info *psta);
|
||||
void update_ra_entry(struct adapter *padapter, struct sta_info *psta);
|
||||
void set_sta_rate(struct adapter *padapter, struct sta_info *psta);
|
||||
|
||||
unsigned int receive_disconnect(struct adapter *padapter, unsigned char *MacAddr, unsigned short reason);
|
||||
|
|
@ -675,33 +675,33 @@ void rtw_dummy_event_callback(struct adapter *adapter, u8 *pbuf);
|
|||
void rtw_fwdbg_event_callback(struct adapter *adapter, u8 *pbuf);
|
||||
|
||||
enum {
|
||||
GEN_EVT_CODE(_Read_MACREG) = 0, /*0*/
|
||||
GEN_EVT_CODE(_Read_BBREG),
|
||||
GEN_EVT_CODE(_Read_RFREG),
|
||||
GEN_EVT_CODE(_Read_EEPROM),
|
||||
GEN_EVT_CODE(_Read_EFUSE),
|
||||
GEN_EVT_CODE(_Read_CAM), /*5*/
|
||||
GEN_EVT_CODE(_Get_BasicRate),
|
||||
GEN_EVT_CODE(_Get_DataRate),
|
||||
GEN_EVT_CODE(_Survey), /*8*/
|
||||
GEN_EVT_CODE(_SurveyDone), /*9*/
|
||||
READ_MACREG_EVENT = 0, /*0*/
|
||||
READ_BBREG_EVENT,
|
||||
READ_RFREG_EVENT,
|
||||
READ_EEPROM_EVENT,
|
||||
READ_EFUSE_EVENT,
|
||||
READ_CAM_EVENT, /*5*/
|
||||
GET_BASICRATE_EVENT,
|
||||
GET_DATARATE_EVENT,
|
||||
SURVEY_EVENT, /*8*/
|
||||
SURVEY_DONE_EVENT, /*9*/
|
||||
|
||||
GEN_EVT_CODE(_JoinBss), /*10*/
|
||||
GEN_EVT_CODE(_AddSTA),
|
||||
GEN_EVT_CODE(_DelSTA),
|
||||
GEN_EVT_CODE(_AtimDone),
|
||||
GEN_EVT_CODE(_TX_Report),
|
||||
GEN_EVT_CODE(_CCX_Report), /*15*/
|
||||
GEN_EVT_CODE(_DTM_Report),
|
||||
GEN_EVT_CODE(_TX_Rate_Statistics),
|
||||
GEN_EVT_CODE(_C2HLBK),
|
||||
GEN_EVT_CODE(_FWDBG),
|
||||
GEN_EVT_CODE(_C2HFEEDBACK), /*20*/
|
||||
GEN_EVT_CODE(_ADDBA),
|
||||
GEN_EVT_CODE(_C2HBCN),
|
||||
GEN_EVT_CODE(_ReportPwrState), /* filen: only for PCIE, USB */
|
||||
GEN_EVT_CODE(_CloseRF), /* filen: only for PCIE, work around ASPM */
|
||||
GEN_EVT_CODE(_WMM), /*25*/
|
||||
JOIN_BSS_EVENT, /*10*/
|
||||
ADD_STA_EVENT,
|
||||
DEL_STA_EVENT,
|
||||
ATIM_DONE_EVENT,
|
||||
TX_REPORT_EVENT,
|
||||
CCX_REPORT_EVENT, /*15*/
|
||||
DTM_REPORT_EVENT,
|
||||
TX_RATE_STATISTICS_EVENT,
|
||||
C2HLBK_EVENT,
|
||||
FWDBG_EVENT,
|
||||
C2HFEEDBACK_EVENT, /*20*/
|
||||
ADDBA_EVENT,
|
||||
C2HBCN_EVENT,
|
||||
REPORT_PWR_STATE_EVENT, /* filen: only for PCIE, USB */
|
||||
CLOSE_RF_EVENT, /* filen: only for PCIE, work around ASPM */
|
||||
WMM_EVENT, /*25*/
|
||||
MAX_C2HEVT
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ struct pwrctrl_priv {
|
|||
extern void rtw_init_pwrctrl_priv(struct adapter *adapter);
|
||||
extern void rtw_free_pwrctrl_priv(struct adapter *adapter);
|
||||
|
||||
s32 rtw_register_task_alive(struct adapter *, u32 task);
|
||||
void rtw_unregister_task_alive(struct adapter *, u32 task);
|
||||
s32 rtw_register_task_alive(struct adapter *adapter, u32 task);
|
||||
void rtw_unregister_task_alive(struct adapter *adapter, u32 task);
|
||||
extern s32 rtw_register_tx_alive(struct adapter *padapter);
|
||||
extern void rtw_unregister_tx_alive(struct adapter *padapter);
|
||||
extern s32 rtw_register_cmd_alive(struct adapter *padapter);
|
||||
|
|
@ -233,7 +233,7 @@ int ips_leave(struct adapter *padapter);
|
|||
|
||||
void rtw_ps_processor(struct adapter *padapter);
|
||||
|
||||
s32 LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms);
|
||||
int LPS_RF_ON_check(struct adapter *padapter, u32 delay_ms);
|
||||
void LPS_Enter(struct adapter *padapter, const char *msg);
|
||||
void LPS_Leave(struct adapter *padapter, const char *msg);
|
||||
void traffic_check_for_leave_lps(struct adapter *padapter, u8 tx, u32 tx_packets);
|
||||
|
|
|
|||
|
|
@ -5,15 +5,11 @@
|
|||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef _RTW_QOS_H_
|
||||
#define _RTW_QOS_H_
|
||||
|
||||
|
||||
|
||||
struct qos_priv {
|
||||
unsigned int qos_option; /* bit mask option: u-apsd, s-apsd, ts, block ack... */
|
||||
};
|
||||
|
||||
|
||||
#endif /* _RTL871X_QOS_H_ */
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ struct rt_pmkid_list {
|
|||
|
||||
|
||||
struct security_priv {
|
||||
u32 dot11AuthAlgrthm; /* 802.11 auth, could be open, shared, 8021x and authswitch */
|
||||
u32 dot11PrivacyAlgrthm; /* This specify the privacy for shared auth. algorithm. */
|
||||
u32 dot11_auth_algrthm; /* 802.11 auth, could be open, shared, 8021x and authswitch */
|
||||
u32 dot11_privacy_algrthm; /* This specify the privacy for shared auth. algorithm. */
|
||||
|
||||
/* WEP */
|
||||
u32 dot11PrivacyKeyIndex; /* this is only valid for legendary wep, 0~3 for key id. (tx key index) */
|
||||
|
|
@ -170,20 +170,20 @@ struct security_priv {
|
|||
|
||||
#define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
|
||||
do {\
|
||||
switch (psecuritypriv->dot11AuthAlgrthm) {\
|
||||
case dot11AuthAlgrthm_Open:\
|
||||
case dot11AuthAlgrthm_Shared:\
|
||||
case dot11AuthAlgrthm_Auto:\
|
||||
encry_algo = (u8)psecuritypriv->dot11PrivacyAlgrthm;\
|
||||
switch (psecuritypriv->dot11_auth_algrthm) {\
|
||||
case dot11_auth_algrthm_open:\
|
||||
case dot11_auth_algrthm_shared:\
|
||||
case dot11_auth_algrthm_auto:\
|
||||
encry_algo = (u8)psecuritypriv->dot11_privacy_algrthm;\
|
||||
break;\
|
||||
case dot11AuthAlgrthm_8021X:\
|
||||
case dot11_auth_algrthm_8021x:\
|
||||
if (bmcst)\
|
||||
encry_algo = (u8)psecuritypriv->dot118021XGrpPrivacy;\
|
||||
else\
|
||||
encry_algo = (u8)psta->dot118021XPrivacy;\
|
||||
break;\
|
||||
case dot11AuthAlgrthm_WAPI:\
|
||||
encry_algo = (u8)psecuritypriv->dot11PrivacyAlgrthm;\
|
||||
case dot11_auth_algrthm_wapi:\
|
||||
encry_algo = (u8)psecuritypriv->dot11_privacy_algrthm;\
|
||||
break;\
|
||||
} \
|
||||
} while (0)
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ extern s32 rtw_free_xmitbuf(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitb
|
|||
|
||||
void rtw_count_tx_stats(struct adapter *padapter, struct xmit_frame *pxmitframe, int sz);
|
||||
extern void rtw_update_protection(struct adapter *padapter, u8 *ie, uint ie_len);
|
||||
extern s32 rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib);
|
||||
extern int rtw_make_wlanhdr(struct adapter *padapter, u8 *hdr, struct pkt_attrib *pattrib);
|
||||
extern s32 rtw_put_snap(u8 *data, u16 h_proto);
|
||||
|
||||
extern struct xmit_frame *rtw_alloc_xmitframe(struct xmit_priv *pxmitpriv);
|
||||
|
|
@ -423,7 +423,7 @@ int rtw_xmitframe_enqueue(struct adapter *padapter, struct xmit_frame *pxmitfram
|
|||
|
||||
extern u32 rtw_calculate_wlan_pkt_size_by_attribue(struct pkt_attrib *pattrib);
|
||||
#define rtw_wlan_pkt_size(f) rtw_calculate_wlan_pkt_size_by_attribue(&f->attrib)
|
||||
extern s32 rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe);
|
||||
extern int rtw_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe);
|
||||
extern s32 rtw_mgmt_xmitframe_coalesce(struct adapter *padapter, struct sk_buff *pkt, struct xmit_frame *pxmitframe);
|
||||
s32 _rtw_init_hw_txqueue(struct hw_txqueue *phw_txqueue, u8 ac_tag);
|
||||
void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv);
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ struct sta_info {
|
|||
/* */
|
||||
|
||||
/* To store the sequence number of received management frame */
|
||||
u16 RxMgmtFrameSeqNum;
|
||||
u16 rx_mgmt_frame_seq_num;
|
||||
};
|
||||
|
||||
#define sta_rx_pkts(sta) \
|
||||
|
|
|
|||
|
|
@ -163,7 +163,6 @@ enum {
|
|||
#define SetDuration(pbuf, dur) \
|
||||
(*(__le16 *)((size_t)(pbuf) + 2) = cpu_to_le16(0xffff & (dur)))
|
||||
|
||||
|
||||
#define SetPriority(pbuf, tid) \
|
||||
(*(__le16 *)(pbuf) |= cpu_to_le16(tid & 0xf))
|
||||
|
||||
|
|
@ -192,12 +191,15 @@ enum {
|
|||
static inline unsigned char *rtl8723bs_get_ra(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *ra;
|
||||
|
||||
ra = GetAddr1Ptr(pframe);
|
||||
return ra;
|
||||
}
|
||||
|
||||
static inline unsigned char *get_ta(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *ta;
|
||||
|
||||
ta = GetAddr2Ptr(pframe);
|
||||
return ta;
|
||||
}
|
||||
|
|
@ -225,7 +227,6 @@ static inline unsigned char *get_da(unsigned char *pframe)
|
|||
return da;
|
||||
}
|
||||
|
||||
|
||||
static inline unsigned char *get_sa(unsigned char *pframe)
|
||||
{
|
||||
unsigned char *sa;
|
||||
|
|
@ -272,11 +273,11 @@ static inline unsigned char *get_hdr_bssid(unsigned char *pframe)
|
|||
return sa;
|
||||
}
|
||||
|
||||
|
||||
static inline int IsFrameTypeCtrl(unsigned char *pframe)
|
||||
{
|
||||
return GetFrameType(pframe) == WIFI_CTRL_TYPE;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
Below is for the security related definition
|
||||
------------------------------------------------------------------------------*/
|
||||
|
|
@ -329,21 +330,20 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
|
|||
*/
|
||||
struct ieee80211_ht_addt_info {
|
||||
unsigned char control_chan;
|
||||
unsigned char ht_param;
|
||||
__le16 operation_mode;
|
||||
__le16 stbc_param;
|
||||
unsigned char basic_set[16];
|
||||
unsigned char ht_param;
|
||||
__le16 operation_mode;
|
||||
__le16 stbc_param;
|
||||
unsigned char basic_set[16];
|
||||
} __packed;
|
||||
|
||||
|
||||
struct HT_caps_element {
|
||||
union {
|
||||
struct {
|
||||
__le16 HT_caps_info;
|
||||
__le16 HT_caps_info;
|
||||
unsigned char AMPDU_para;
|
||||
unsigned char MCS_rate[16];
|
||||
__le16 HT_ext_caps;
|
||||
__le16 Beamforming_caps;
|
||||
__le16 HT_ext_caps;
|
||||
__le16 Beamforming_caps;
|
||||
unsigned char ASEL_caps;
|
||||
} HT_cap_element;
|
||||
unsigned char HT_cap[26];
|
||||
|
|
@ -357,22 +357,22 @@ struct HT_info_element {
|
|||
} __packed;
|
||||
|
||||
struct AC_param {
|
||||
unsigned char ACI_AIFSN;
|
||||
unsigned char CW;
|
||||
__le16 TXOP_limit;
|
||||
unsigned char ACI_AIFSN;
|
||||
unsigned char CW;
|
||||
__le16 TXOP_limit;
|
||||
} __packed;
|
||||
|
||||
struct WMM_para_element {
|
||||
unsigned char QoS_info;
|
||||
unsigned char reserved;
|
||||
struct AC_param ac_param[4];
|
||||
unsigned char QoS_info;
|
||||
unsigned char reserved;
|
||||
struct AC_param ac_param[4];
|
||||
} __packed;
|
||||
|
||||
struct ADDBA_request {
|
||||
unsigned char dialog_token;
|
||||
__le16 BA_para_set;
|
||||
__le16 BA_timeout_value;
|
||||
__le16 BA_starting_seqctrl;
|
||||
unsigned char dialog_token;
|
||||
__le16 BA_para_set;
|
||||
__le16 BA_timeout_value;
|
||||
__le16 BA_starting_seqctrl;
|
||||
} __packed;
|
||||
|
||||
/* 802.11n HT capabilities masks */
|
||||
|
|
@ -397,47 +397,6 @@ struct ADDBA_request {
|
|||
/* WPS attribute ID */
|
||||
#define WPS_ATTR_SELECTED_REGISTRAR 0x1041
|
||||
|
||||
/* =====================P2P Section ===================== */
|
||||
enum p2p_role {
|
||||
P2P_ROLE_DISABLE = 0,
|
||||
P2P_ROLE_DEVICE = 1,
|
||||
P2P_ROLE_CLIENT = 2,
|
||||
P2P_ROLE_GO = 3
|
||||
};
|
||||
|
||||
enum p2p_state {
|
||||
P2P_STATE_NONE = 0, /* P2P disable */
|
||||
P2P_STATE_IDLE = 1, /* P2P had enabled and do nothing */
|
||||
P2P_STATE_LISTEN = 2, /* In pure listen state */
|
||||
P2P_STATE_SCAN = 3, /* In scan phase */
|
||||
P2P_STATE_FIND_PHASE_LISTEN = 4, /* In the listen state of find phase */
|
||||
P2P_STATE_FIND_PHASE_SEARCH = 5, /* In the search state of find phase */
|
||||
P2P_STATE_TX_PROVISION_DIS_REQ = 6, /* In P2P provisioning discovery */
|
||||
P2P_STATE_RX_PROVISION_DIS_RSP = 7,
|
||||
P2P_STATE_RX_PROVISION_DIS_REQ = 8,
|
||||
P2P_STATE_GONEGO_ING = 9, /* Doing the group owner negotiation handshake */
|
||||
P2P_STATE_GONEGO_OK = 10, /* finish the group negotiation handshake with success */
|
||||
P2P_STATE_GONEGO_FAIL = 11, /* finish the group negotiation handshake with failure */
|
||||
P2P_STATE_RECV_INVITE_REQ_MATCH = 12, /* receiving the P2P Invitation request and match with the profile. */
|
||||
P2P_STATE_PROVISIONING_ING = 13, /* Doing the P2P WPS */
|
||||
P2P_STATE_PROVISIONING_DONE = 14, /* Finish the P2P WPS */
|
||||
P2P_STATE_TX_INVITE_REQ = 15, /* Transmit the P2P Invitation request */
|
||||
P2P_STATE_RX_INVITE_RESP_OK = 16, /* Receiving the P2P Invitation response */
|
||||
P2P_STATE_RECV_INVITE_REQ_DISMATCH = 17, /* receiving the P2P Invitation request and mismatch with the profile. */
|
||||
P2P_STATE_RECV_INVITE_REQ_GO = 18, /* receiving the P2P Invitation request and this wifi is GO. */
|
||||
P2P_STATE_RECV_INVITE_REQ_JOIN = 19, /* receiving the P2P Invitation request to join an existing P2P Group. */
|
||||
P2P_STATE_RX_INVITE_RESP_FAIL = 20, /* recveing the P2P Invitation response with failure */
|
||||
P2P_STATE_RX_INFOR_NOREADY = 21, /* receiving p2p negotiation response with information is not available */
|
||||
P2P_STATE_TX_INFOR_NOREADY = 22, /* sending p2p negotiation response with information is not available */
|
||||
};
|
||||
|
||||
enum p2p_wpsinfo {
|
||||
P2P_NO_WPSINFO = 0,
|
||||
P2P_GOT_WPSINFO_PEER_DISPLAY_PIN = 1,
|
||||
P2P_GOT_WPSINFO_SELF_DISPLAY_PIN = 2,
|
||||
P2P_GOT_WPSINFO_PBC = 3,
|
||||
};
|
||||
|
||||
#define IP_MCAST_MAC(mac) ((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e))
|
||||
#define ICMPV6_MCAST_MAC(mac) ((mac[0] == 0x33) && (mac[1] == 0x33) && (mac[2] != 0xff))
|
||||
|
||||
|
|
|
|||
|
|
@ -19,22 +19,14 @@ typedef unsigned char NDIS_802_11_RATES[NDIS_802_11_LENGTH_RATES]; /*
|
|||
typedef unsigned char NDIS_802_11_RATES_EX[NDIS_802_11_LENGTH_RATES_EX]; /* Set of 16 data rates */
|
||||
|
||||
struct ndis_802_11_ssid {
|
||||
u32 ssid_length;
|
||||
u8 ssid[32];
|
||||
};
|
||||
|
||||
enum ndis_802_11_network_type {
|
||||
Ndis802_11FH,
|
||||
Ndis802_11DS,
|
||||
Ndis802_11OFDM5,
|
||||
Ndis802_11OFDM24,
|
||||
Ndis802_11NetworkTypeMax /* not a real type, defined as an upper bound */
|
||||
u32 ssid_length;
|
||||
u8 ssid[32];
|
||||
};
|
||||
|
||||
/*
|
||||
FW will only save the channel number in DSConfig.
|
||||
ODI Handler will convert the channel number to freq. number.
|
||||
*/
|
||||
* FW will only save the channel number in DSConfig.
|
||||
* ODI Handler will convert the channel number to freq. number.
|
||||
*/
|
||||
struct ndis_802_11_conf {
|
||||
u32 length; /* Length of structure */
|
||||
u32 beacon_period; /* units are Kusec */
|
||||
|
|
@ -42,30 +34,22 @@ struct ndis_802_11_conf {
|
|||
u32 ds_config; /* Frequency, units are kHz */
|
||||
};
|
||||
|
||||
enum ndis_802_11_network_infrastructure {
|
||||
Ndis802_11IBSS,
|
||||
Ndis802_11Infrastructure,
|
||||
Ndis802_11AutoUnknown,
|
||||
Ndis802_11InfrastructureMax, /* Not a real value, defined as upper bound */
|
||||
Ndis802_11APMode,
|
||||
};
|
||||
|
||||
struct ndis_802_11_fix_ie {
|
||||
u8 time_stamp[8];
|
||||
u16 beacon_interval;
|
||||
u16 capabilities;
|
||||
u8 time_stamp[8];
|
||||
u16 beacon_interval;
|
||||
u16 capabilities;
|
||||
};
|
||||
|
||||
struct ndis_80211_var_ie {
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
u8 data[];
|
||||
u8 element_id;
|
||||
u8 length;
|
||||
u8 data[];
|
||||
};
|
||||
|
||||
/* Length is the 4 bytes multiples of the sum of
|
||||
* ETH_ALEN + 2 +
|
||||
* sizeof (struct ndis_802_11_ssid) + sizeof (u32) +
|
||||
* sizeof (long) + sizeof (enum ndis_802_11_network_type) +
|
||||
* sizeof (long) +
|
||||
* sizeof (struct ndis_802_11_conf) + sizeof (NDIS_802_11_RATES_EX) + ie_length
|
||||
*
|
||||
* Except for ie_length, all other fields are fixed length. Therefore, we can
|
||||
|
|
@ -125,10 +109,6 @@ struct ndis_802_11_wep {
|
|||
/* MIC check time, 60 seconds. */
|
||||
#define MIC_CHECK_TIME 60000000
|
||||
|
||||
#ifndef Ndis802_11APMode
|
||||
#define Ndis802_11APMode (Ndis802_11InfrastructureMax + 1)
|
||||
#endif
|
||||
|
||||
struct wlan_phy_info {
|
||||
u8 signal_strength;/* in percentage) */
|
||||
u8 signal_quality;/* in percentage) */
|
||||
|
|
@ -138,34 +118,34 @@ struct wlan_phy_info {
|
|||
|
||||
struct wlan_bcn_info {
|
||||
/* these infor get from rtw_get_encrypt_info when
|
||||
* * translate scan to UI */
|
||||
* translate scan to UI
|
||||
*/
|
||||
u8 encryp_protocol;/* ENCRYP_PROTOCOL_E: OPEN/WEP/WPA/WPA2/WAPI */
|
||||
int group_cipher; /* WPA/WPA2 group cipher */
|
||||
int pairwise_cipher;/* WPA/WPA2/WEP pairwise cipher */
|
||||
int is_8021x;
|
||||
|
||||
/* bwmode 20/40 and ch_offset UP/LOW */
|
||||
unsigned short ht_cap_info;
|
||||
unsigned short ht_cap_info;
|
||||
unsigned char ht_info_infos_0;
|
||||
};
|
||||
|
||||
/* temporally add #pragma pack for structure alignment issue of
|
||||
* struct wlan_bssid_ex and get_wlan_bssid_ex_sz()
|
||||
*/
|
||||
* struct wlan_bssid_ex and get_wlan_bssid_ex_sz()
|
||||
*/
|
||||
struct wlan_bssid_ex {
|
||||
u32 length;
|
||||
u32 length;
|
||||
u8 mac_address[ETH_ALEN];
|
||||
u8 reserved[2];/* 0]: IS beacon frame */
|
||||
struct ndis_802_11_ssid ssid;
|
||||
u32 privacy;
|
||||
long rssi;/* in dBM, raw data , get from PHY) */
|
||||
enum ndis_802_11_network_type network_type_in_use;
|
||||
struct ndis_802_11_conf configuration;
|
||||
enum ndis_802_11_network_infrastructure infrastructure_mode;
|
||||
NDIS_802_11_RATES_EX supported_rates;
|
||||
u8 reserved[2];/* 0]: IS beacon frame */
|
||||
struct ndis_802_11_ssid ssid;
|
||||
u32 privacy;
|
||||
long rssi;/* in dBM, raw data , get from PHY) */
|
||||
struct ndis_802_11_conf configuration;
|
||||
enum nl80211_iftype infrastructure_mode;
|
||||
NDIS_802_11_RATES_EX supported_rates;
|
||||
struct wlan_phy_info phy_info;
|
||||
u32 ie_length;
|
||||
u8 ies[MAX_IE_SZ]; /* timestamp, beacon interval, and capability information) */
|
||||
u32 ie_length;
|
||||
u8 ies[MAX_IE_SZ]; /* timestamp, beacon interval, and capability information) */
|
||||
} __packed;
|
||||
|
||||
static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
|
||||
|
|
@ -173,15 +153,15 @@ static inline uint get_wlan_bssid_ex_sz(struct wlan_bssid_ex *bss)
|
|||
return (sizeof(struct wlan_bssid_ex) - MAX_IE_SZ + bss->ie_length);
|
||||
}
|
||||
|
||||
struct wlan_network {
|
||||
struct list_head list;
|
||||
int network_type; /* refer to ieee80211.h for WIRELESS_11A/B/G */
|
||||
int fixed; /* set to fixed when not to be removed as site-surveying */
|
||||
unsigned long last_scanned; /* timestamp for the network */
|
||||
int aid; /* will only be valid when a BSS is joinned. */
|
||||
int join_res;
|
||||
struct wlan_bssid_ex network; /* must be the last item */
|
||||
struct wlan_bcn_info bcn_info;
|
||||
struct wlan_network {
|
||||
struct list_head list;
|
||||
int network_type; /* refer to ieee80211.h for WIRELESS_11A/B/G */
|
||||
int fixed; /* set to fixed when not to be removed as site-surveying */
|
||||
unsigned long last_scanned; /* timestamp for the network */
|
||||
int aid; /* will only be valid when a BSS is joinned. */
|
||||
int join_res;
|
||||
struct wlan_bssid_ex network; /* must be the last item */
|
||||
struct wlan_bcn_info bcn_info;
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ void rtw_os_xmit_schedule(struct adapter *padapter);
|
|||
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag);
|
||||
|
||||
extern uint rtw_remainder_len(struct pkt_file *pfile);
|
||||
extern unsigned int rtw_remainder_len(struct pkt_file *pfile);
|
||||
extern void _rtw_open_pktfile(struct sk_buff *pkt, struct pkt_file *pfile);
|
||||
int _rtw_pktfile_read(struct pkt_file *pfile, u8 *rmem, unsigned int rlen);
|
||||
extern signed int rtw_endofpktfile(struct pkt_file *pfile);
|
||||
|
|
|
|||
|
|
@ -110,33 +110,26 @@ static struct ieee80211_supported_band *rtw_spt_band_alloc(
|
|||
)
|
||||
{
|
||||
struct ieee80211_supported_band *spt_band = NULL;
|
||||
int n_channels, n_bitrates;
|
||||
size_t alloc_sz;
|
||||
size_t channels_sz, bitrate_size;
|
||||
|
||||
if (band == NL80211_BAND_2GHZ) {
|
||||
n_channels = RTW_2G_CHANNELS_NUM;
|
||||
n_bitrates = RTW_G_RATES_NUM;
|
||||
} else {
|
||||
if (band != NL80211_BAND_2GHZ)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
alloc_sz = sizeof(*spt_band);
|
||||
alloc_sz = size_add(alloc_sz, array_size(n_channels, sizeof(struct ieee80211_channel)));
|
||||
alloc_sz = size_add(alloc_sz, array_size(n_bitrates, sizeof(struct ieee80211_rate)));
|
||||
spt_band = kzalloc(alloc_sz, GFP_KERNEL);
|
||||
channels_sz = array_size(RTW_2G_CHANNELS_NUM, sizeof(struct ieee80211_channel));
|
||||
bitrate_size = array_size(RTW_G_RATES_NUM, sizeof(struct ieee80211_rate));
|
||||
|
||||
spt_band = kzalloc(sizeof(*spt_band) + channels_sz + bitrate_size, GFP_KERNEL);
|
||||
if (!spt_band)
|
||||
goto exit;
|
||||
|
||||
spt_band->channels = (struct ieee80211_channel *)(((u8 *)spt_band) + sizeof(struct ieee80211_supported_band));
|
||||
spt_band->bitrates = (struct ieee80211_rate *)(((u8 *)spt_band->channels) + sizeof(struct ieee80211_channel) * n_channels);
|
||||
spt_band->channels = (void *)spt_band + sizeof(*spt_band);
|
||||
spt_band->bitrates = (void *)spt_band + sizeof(*spt_band) + channels_sz;
|
||||
spt_band->band = band;
|
||||
spt_band->n_channels = n_channels;
|
||||
spt_band->n_bitrates = n_bitrates;
|
||||
spt_band->n_channels = RTW_2G_CHANNELS_NUM;
|
||||
spt_band->n_bitrates = RTW_G_RATES_NUM;
|
||||
|
||||
if (band == NL80211_BAND_2GHZ) {
|
||||
rtw_2g_channels_init(spt_band->channels);
|
||||
rtw_2g_rates_init(spt_band->bitrates);
|
||||
}
|
||||
rtw_2g_channels_init(spt_band->channels);
|
||||
rtw_2g_rates_init(spt_band->bitrates);
|
||||
|
||||
/* spt_band.ht_cap */
|
||||
|
||||
|
|
@ -546,13 +539,13 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
|
|||
if (psecuritypriv->bWepDefaultKeyIdxSet == 0) {
|
||||
/* wep default key has not been set, so use this key index as default key. */
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_auto;
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP40_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
|
||||
|
||||
if (wep_key_len == 13) {
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP104_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
|
||||
}
|
||||
|
||||
|
|
@ -602,7 +595,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
|
|||
|
||||
psecuritypriv->binstallGrpkey = true;
|
||||
|
||||
psecuritypriv->dot11PrivacyAlgrthm = psecuritypriv->dot118021XGrpPrivacy;/* */
|
||||
psecuritypriv->dot11_privacy_algrthm = psecuritypriv->dot118021XGrpPrivacy;/* */
|
||||
|
||||
rtw_ap_set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot118021XGrpPrivacy, param->u.crypt.idx);
|
||||
|
||||
|
|
@ -616,7 +609,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X && psta) { /* psk/802_1x */
|
||||
if (psecuritypriv->dot11_auth_algrthm == dot11_auth_algrthm_8021x && psta) {/* psk/802_1x */
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
|
||||
if (param->u.crypt.set_tx == 1) { /* pairwise key */
|
||||
memcpy(psta->dot118021x_UncstKey.skey, param->u.crypt.key, (param->u.crypt.key_len > 16 ? 16 : param->u.crypt.key_len));
|
||||
|
|
@ -676,7 +669,7 @@ static int rtw_cfg80211_ap_set_encryption(struct net_device *dev, struct ieee_pa
|
|||
|
||||
psecuritypriv->binstallGrpkey = true;
|
||||
|
||||
psecuritypriv->dot11PrivacyAlgrthm = psecuritypriv->dot118021XGrpPrivacy;/* */
|
||||
psecuritypriv->dot11_privacy_algrthm = psecuritypriv->dot118021XGrpPrivacy;/* */
|
||||
|
||||
rtw_ap_set_group_key(padapter, param->u.crypt.key, psecuritypriv->dot118021XGrpPrivacy, param->u.crypt.idx);
|
||||
|
||||
|
|
@ -744,11 +737,11 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
|||
wep_key_len = wep_key_len <= 5 ? 5 : 13;
|
||||
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP40_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
|
||||
|
||||
if (wep_key_len == 13) {
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP104_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
|
||||
}
|
||||
|
||||
|
|
@ -764,7 +757,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { /* 802_1x */
|
||||
if (padapter->securitypriv.dot11_auth_algrthm == dot11_auth_algrthm_8021x) { /* 802_1x */
|
||||
struct sta_info *psta, *pbcmc_sta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
|
|
@ -777,7 +770,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
|||
|
||||
if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) ||
|
||||
(padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) {
|
||||
psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
psta->dot118021XPrivacy = padapter->securitypriv.dot11_privacy_algrthm;
|
||||
}
|
||||
|
||||
if (param->u.crypt.set_tx == 1) { /* pairwise key */
|
||||
|
|
@ -819,7 +812,7 @@ static int rtw_cfg80211_set_encryption(struct net_device *dev, struct ieee_param
|
|||
|
||||
if ((padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption2Enabled) ||
|
||||
(padapter->securitypriv.ndisencryptstatus == Ndis802_11Encryption3Enabled)) {
|
||||
pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
pbcmc_sta->dot118021XPrivacy = padapter->securitypriv.dot11_privacy_algrthm;
|
||||
}
|
||||
}
|
||||
} else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) { /* adhoc mode */
|
||||
|
|
@ -942,15 +935,15 @@ static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
|
|||
struct adapter *padapter = rtw_netdev_priv(ndev);
|
||||
struct security_priv *psecuritypriv = &padapter->securitypriv;
|
||||
|
||||
if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11PrivacyAlgrthm == _WEP40_) || (psecuritypriv->dot11PrivacyAlgrthm == _WEP104_))) { /* set wep default key */
|
||||
if ((key_index < WEP_KEYS) && ((psecuritypriv->dot11_privacy_algrthm == _WEP40_) || (psecuritypriv->dot11_privacy_algrthm == _WEP104_))) { /* set wep default key */
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
|
||||
psecuritypriv->dot11PrivacyKeyIndex = key_index;
|
||||
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP40_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP40_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP40_;
|
||||
if (psecuritypriv->dot11DefKeylen[key_index] == 13) {
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _WEP104_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _WEP104_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _WEP104_;
|
||||
}
|
||||
|
||||
|
|
@ -1027,7 +1020,6 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
|||
struct vif_params *params)
|
||||
{
|
||||
enum nl80211_iftype old_type;
|
||||
enum ndis_802_11_network_infrastructure networkType;
|
||||
struct adapter *padapter = rtw_netdev_priv(ndev);
|
||||
struct wireless_dev *rtw_wdev = padapter->rtw_wdev;
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
|
|
@ -1057,30 +1049,22 @@ static int cfg80211_rtw_change_iface(struct wiphy *wiphy,
|
|||
pmlmeext->action_public_dialog_token = 0xff;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case NL80211_IFTYPE_ADHOC:
|
||||
networkType = Ndis802_11IBSS;
|
||||
break;
|
||||
case NL80211_IFTYPE_STATION:
|
||||
networkType = Ndis802_11Infrastructure;
|
||||
break;
|
||||
case NL80211_IFTYPE_AP:
|
||||
networkType = Ndis802_11APMode;
|
||||
break;
|
||||
default:
|
||||
if (type != NL80211_IFTYPE_ADHOC &&
|
||||
type != NL80211_IFTYPE_STATION &&
|
||||
type != NL80211_IFTYPE_AP) {
|
||||
ret = -EOPNOTSUPP;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rtw_wdev->iftype = type;
|
||||
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, networkType)) {
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, type)) {
|
||||
rtw_wdev->iftype = old_type;
|
||||
ret = -EPERM;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
rtw_setopmode_cmd(padapter, networkType, true);
|
||||
rtw_setopmode_cmd(padapter, type, true);
|
||||
|
||||
exit:
|
||||
|
||||
|
|
@ -1152,7 +1136,7 @@ void rtw_cfg80211_surveydone_event_callback(struct adapter *padapter)
|
|||
static int rtw_cfg80211_set_probe_req_wpsp2pie(struct adapter *padapter, char *buf, int len)
|
||||
{
|
||||
int ret = 0;
|
||||
uint wps_ielen = 0;
|
||||
unsigned int wps_ielen = 0;
|
||||
u8 *wps_ie;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
|
||||
|
|
@ -1326,26 +1310,26 @@ static int rtw_cfg80211_set_auth_type(struct security_priv *psecuritypriv,
|
|||
switch (sme_auth_type) {
|
||||
case NL80211_AUTHTYPE_AUTOMATIC:
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Auto;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_auto;
|
||||
|
||||
break;
|
||||
case NL80211_AUTHTYPE_OPEN_SYSTEM:
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open;
|
||||
|
||||
if (psecuritypriv->ndisauthtype > Ndis802_11AuthModeWPA)
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
|
||||
break;
|
||||
case NL80211_AUTHTYPE_SHARED_KEY:
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Shared;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_shared;
|
||||
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
|
||||
break;
|
||||
default:
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open;
|
||||
/* return -ENOTSUPP; */
|
||||
}
|
||||
|
||||
|
|
@ -1356,7 +1340,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
|
|||
{
|
||||
u32 ndisencryptstatus = Ndis802_11EncryptionDisabled;
|
||||
|
||||
u32 *profile_cipher = ucast ? &psecuritypriv->dot11PrivacyAlgrthm :
|
||||
u32 *profile_cipher = ucast ? &psecuritypriv->dot11_privacy_algrthm :
|
||||
&psecuritypriv->dot118021XGrpPrivacy;
|
||||
|
||||
if (!cipher) {
|
||||
|
|
@ -1393,7 +1377,7 @@ static int rtw_cfg80211_set_cipher(struct security_priv *psecuritypriv, u32 ciph
|
|||
if (ucast) {
|
||||
psecuritypriv->ndisencryptstatus = ndisencryptstatus;
|
||||
|
||||
/* if (psecuritypriv->dot11PrivacyAlgrthm >= _AES_) */
|
||||
/* if (psecuritypriv->dot11_privacy_algrthm >= _AES_) */
|
||||
/* psecuritypriv->ndisauthtype = Ndis802_11AuthModeWPA2PSK; */
|
||||
}
|
||||
|
||||
|
|
@ -1404,9 +1388,9 @@ static int rtw_cfg80211_set_key_mgt(struct security_priv *psecuritypriv, u32 key
|
|||
{
|
||||
if (key_mgt == WLAN_AKM_SUITE_8021X)
|
||||
/* auth_type = UMAC_AUTH_TYPE_8021X; */
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
else if (key_mgt == WLAN_AKM_SUITE_PSK) {
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
@ -1451,7 +1435,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
|
|||
goto exit;
|
||||
}
|
||||
if (rtw_parse_wpa_ie(pwpa, wpa_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
|
||||
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
padapter->securitypriv.dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPAPSK;
|
||||
memcpy(padapter->securitypriv.supplicant_ie, &pwpa[0], wpa_ielen + 2);
|
||||
}
|
||||
|
|
@ -1464,7 +1448,7 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
|
|||
goto exit;
|
||||
}
|
||||
if (rtw_parse_wpa2_ie(pwpa2, wpa2_ielen + 2, &group_cipher, &pairwise_cipher, NULL) == _SUCCESS) {
|
||||
padapter->securitypriv.dot11AuthAlgrthm = dot11AuthAlgrthm_8021X;
|
||||
padapter->securitypriv.dot11_auth_algrthm = dot11_auth_algrthm_8021x;
|
||||
padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeWPA2PSK;
|
||||
memcpy(padapter->securitypriv.supplicant_ie, &pwpa2[0], wpa2_ielen + 2);
|
||||
}
|
||||
|
|
@ -1501,34 +1485,34 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
|
|||
|
||||
switch (pairwise_cipher) {
|
||||
case WPA_CIPHER_NONE:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11EncryptionDisabled;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP40_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _WEP40_;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _TKIP_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _TKIP_;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption2Enabled;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _AES_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _AES_;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption3Enabled;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _WEP104_;
|
||||
padapter->securitypriv.ndisencryptstatus = Ndis802_11Encryption1Enabled;
|
||||
break;
|
||||
}
|
||||
|
||||
{/* handle wps_ie */
|
||||
uint wps_ielen;
|
||||
unsigned int wps_ielen;
|
||||
u8 *wps_ie;
|
||||
|
||||
wps_ie = rtw_get_wps_ie(buf, ielen, NULL, &wps_ielen);
|
||||
if (wps_ie && wps_ielen > 0) {
|
||||
padapter->securitypriv.wps_ie_len = min_t(uint, wps_ielen, MAX_WPS_IE_LEN);
|
||||
padapter->securitypriv.wps_ie_len = min_t(unsigned int, wps_ielen, MAX_WPS_IE_LEN);
|
||||
memcpy(padapter->securitypriv.wps_ie, wps_ie, padapter->securitypriv.wps_ie_len);
|
||||
set_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS);
|
||||
} else {
|
||||
|
|
@ -1537,9 +1521,9 @@ static int rtw_cfg80211_set_wpa_ie(struct adapter *padapter, u8 *pie, size_t iel
|
|||
}
|
||||
|
||||
/* TKIP and AES disallow multicast packets until installing group key */
|
||||
if (padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_
|
||||
|| padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_WTMIC_
|
||||
|| padapter->securitypriv.dot11PrivacyAlgrthm == _AES_)
|
||||
if (padapter->securitypriv.dot11_privacy_algrthm == _TKIP_
|
||||
|| padapter->securitypriv.dot11_privacy_algrthm == _TKIP_WTMIC_
|
||||
|| padapter->securitypriv.dot11_privacy_algrthm == _AES_)
|
||||
/* WPS open need to enable multicast */
|
||||
/* check_fwstate(&padapter->mlmepriv, WIFI_UNDER_WPS) == true) */
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_OFF_RCR_AM, null_addr);
|
||||
|
|
@ -1585,9 +1569,9 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev,
|
|||
memcpy(ndis_ssid.ssid, (u8 *)params->ssid, params->ssid_len);
|
||||
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
|
||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
|
||||
ret = rtw_cfg80211_set_auth_type(psecuritypriv, NL80211_AUTHTYPE_OPEN_SYSTEM);
|
||||
|
|
@ -1619,12 +1603,12 @@ static int cfg80211_rtw_leave_ibss(struct wiphy *wiphy, struct net_device *ndev)
|
|||
|
||||
rtw_wdev->iftype = NL80211_IFTYPE_STATION;
|
||||
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, Ndis802_11Infrastructure)) {
|
||||
if (!rtw_set_802_11_infrastructure_mode(padapter, NL80211_IFTYPE_STATION)) {
|
||||
rtw_wdev->iftype = old_type;
|
||||
ret = -EPERM;
|
||||
goto leave_ibss;
|
||||
}
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure, true);
|
||||
rtw_setopmode_cmd(padapter, NL80211_IFTYPE_STATION, true);
|
||||
}
|
||||
|
||||
leave_ibss:
|
||||
|
|
@ -1681,9 +1665,9 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
rtw_scan_abort(padapter);
|
||||
|
||||
psecuritypriv->ndisencryptstatus = Ndis802_11EncryptionDisabled;
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot118021XGrpPrivacy = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
|
||||
psecuritypriv->ndisauthtype = Ndis802_11AuthModeOpen;
|
||||
|
||||
ret = rtw_cfg80211_set_wpa_version(psecuritypriv, sme->crypto.wpa_versions);
|
||||
|
|
@ -1706,8 +1690,8 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
}
|
||||
|
||||
/* For WEP Shared auth */
|
||||
if ((psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Shared ||
|
||||
psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_Auto) && sme->key) {
|
||||
if ((psecuritypriv->dot11_auth_algrthm == dot11_auth_algrthm_shared ||
|
||||
psecuritypriv->dot11_auth_algrthm == dot11_auth_algrthm_auto) && sme->key) {
|
||||
u32 wep_key_idx, wep_key_len, wep_total_len;
|
||||
struct ndis_802_11_wep *pwep = NULL;
|
||||
|
||||
|
|
@ -1733,7 +1717,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev,
|
|||
pwep->length = wep_total_len;
|
||||
|
||||
if (wep_key_len == 13) {
|
||||
padapter->securitypriv.dot11PrivacyAlgrthm = _WEP104_;
|
||||
padapter->securitypriv.dot11_privacy_algrthm = _WEP104_;
|
||||
padapter->securitypriv.dot118021XGrpPrivacy = _WEP104_;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -1919,7 +1903,7 @@ static int cfg80211_rtw_flush_pmksa(struct wiphy *wiphy,
|
|||
return 0;
|
||||
}
|
||||
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, uint frame_len)
|
||||
void rtw_cfg80211_indicate_sta_assoc(struct adapter *padapter, u8 *pmgmt_frame, unsigned int frame_len)
|
||||
{
|
||||
struct wireless_dev *wdev = padapter->rtw_wdev;
|
||||
|
||||
|
|
@ -2259,7 +2243,7 @@ static int rtw_add_beacon(struct adapter *adapter, const u8 *head, size_t head_l
|
|||
{
|
||||
int ret = 0;
|
||||
u8 *pbuf = NULL;
|
||||
uint len, wps_ielen = 0;
|
||||
unsigned int len, wps_ielen = 0;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
|
||||
if (!check_fwstate(pmlmepriv, WIFI_AP_STATE))
|
||||
|
|
@ -2454,7 +2438,7 @@ static int cfg80211_rtw_dump_station(struct wiphy *wiphy,
|
|||
return ret;
|
||||
}
|
||||
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, uint frame_len, const char *msg)
|
||||
void rtw_cfg80211_rx_action(struct adapter *adapter, u8 *frame, unsigned int frame_len, const char *msg)
|
||||
{
|
||||
s32 freq;
|
||||
int channel;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ static int rtw_rfintfs = HWPI;
|
|||
static int rtw_lbkmode;/* RTL8712_AIR_TRX; */
|
||||
|
||||
|
||||
static int rtw_network_mode = Ndis802_11IBSS;/* Ndis802_11Infrastructure;infra, ad-hoc, auto */
|
||||
static int rtw_network_mode = NL80211_IFTYPE_ADHOC;/* infra, ad-hoc, auto */
|
||||
/* struct ndis_802_11_ssid ssid; */
|
||||
static int rtw_channel = 1;/* ad-hoc support requirement */
|
||||
static int rtw_wireless_mode = WIRELESS_11BG_24N;
|
||||
|
|
@ -143,7 +143,6 @@ module_param(rtw_wifi_spec, int, 0644);
|
|||
module_param(rtw_antdiv_cfg, int, 0644);
|
||||
module_param(rtw_antdiv_type, int, 0644);
|
||||
|
||||
|
||||
module_param(rtw_hw_wps_pbc, int, 0644);
|
||||
|
||||
static uint rtw_max_roaming_times = 2;
|
||||
|
|
@ -176,7 +175,7 @@ MODULE_PARM_DESC(rtw_tx_pwr_by_rate, "0:Disable, 1:Enable, 2: Depend on efuse");
|
|||
|
||||
static int netdev_close(struct net_device *pnetdev);
|
||||
|
||||
static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
|
||||
static void loadparam(struct adapter *padapter)
|
||||
{
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
|
|
@ -238,7 +237,6 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev)
|
|||
registry_par->lowrate_two_xmit = (u8)rtw_lowrate_two_xmit;
|
||||
registry_par->low_power = (u8)rtw_low_power;
|
||||
|
||||
|
||||
registry_par->wifi_spec = (u8)rtw_wifi_spec;
|
||||
|
||||
registry_par->channel_plan = (u8)rtw_channel_plan;
|
||||
|
|
@ -335,7 +333,6 @@ static unsigned int rtw_classify8021d(struct sk_buff *skb)
|
|||
return dscp >> 5;
|
||||
}
|
||||
|
||||
|
||||
static u16 rtw_select_queue(struct net_device *dev, struct sk_buff *skb,
|
||||
struct net_device *sb_dev)
|
||||
{
|
||||
|
|
@ -442,7 +439,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
|
|||
pnetdev->watchdog_timeo = HZ * 3; /* 3 second timeout */
|
||||
|
||||
/* step 2. */
|
||||
loadparam(padapter, pnetdev);
|
||||
loadparam(padapter);
|
||||
|
||||
return pnetdev;
|
||||
}
|
||||
|
|
@ -534,8 +531,8 @@ static void rtw_init_default_value(struct adapter *padapter)
|
|||
psecuritypriv->sw_encrypt = pregistrypriv->software_encrypt;
|
||||
psecuritypriv->sw_decrypt = pregistrypriv->software_decrypt;
|
||||
|
||||
psecuritypriv->dot11AuthAlgrthm = dot11AuthAlgrthm_Open; /* open system */
|
||||
psecuritypriv->dot11PrivacyAlgrthm = _NO_PRIVACY_;
|
||||
psecuritypriv->dot11_auth_algrthm = dot11_auth_algrthm_open; /* open system */
|
||||
psecuritypriv->dot11_privacy_algrthm = _NO_PRIVACY_;
|
||||
|
||||
psecuritypriv->dot11PrivacyKeyIndex = 0;
|
||||
|
||||
|
|
@ -633,7 +630,6 @@ void rtw_reset_drv_sw(struct adapter *padapter)
|
|||
rtw_set_signal_stat_timer(&padapter->recvpriv);
|
||||
}
|
||||
|
||||
|
||||
u8 rtw_init_drv_sw(struct adapter *padapter)
|
||||
{
|
||||
int res;
|
||||
|
|
@ -661,7 +657,6 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
|
|||
|
||||
if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL)
|
||||
goto free_xmit_priv;
|
||||
/* add for CONFIG_IEEE80211W, none 11w also can use */
|
||||
spin_lock_init(&padapter->security_key_mutex);
|
||||
|
||||
/* We don't need to memset padapter->XXX to zero, because adapter is allocated by vzalloc(). */
|
||||
|
|
@ -791,7 +786,7 @@ int rtw_drv_register_netdev(struct adapter *if1)
|
|||
|
||||
static int _netdev_open(struct net_device *pnetdev)
|
||||
{
|
||||
uint status;
|
||||
unsigned int status;
|
||||
struct adapter *padapter = rtw_netdev_priv(pnetdev);
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
|
|
@ -803,7 +798,7 @@ static int _netdev_open(struct net_device *pnetdev)
|
|||
}
|
||||
|
||||
if (!padapter->bup) {
|
||||
padapter->bDriverStopped = false;
|
||||
padapter->driver_stopped = false;
|
||||
padapter->bSurpriseRemoved = false;
|
||||
padapter->bCardDisableWOHSM = false;
|
||||
|
||||
|
|
@ -871,7 +866,7 @@ static int ips_netdrv_open(struct adapter *padapter)
|
|||
|
||||
padapter->net_closed = false;
|
||||
|
||||
padapter->bDriverStopped = false;
|
||||
padapter->driver_stopped = false;
|
||||
padapter->bCardDisableWOHSM = false;
|
||||
/* padapter->bup = true; */
|
||||
|
||||
|
|
@ -891,7 +886,6 @@ static int ips_netdrv_open(struct adapter *padapter)
|
|||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
int rtw_ips_pwr_up(struct adapter *padapter)
|
||||
{
|
||||
return ips_netdrv_open(padapter);
|
||||
|
|
@ -978,7 +972,7 @@ void rtw_dev_unload(struct adapter *padapter)
|
|||
u8 cnt = 0;
|
||||
|
||||
if (padapter->bup) {
|
||||
padapter->bDriverStopped = true;
|
||||
padapter->driver_stopped = true;
|
||||
if (padapter->xmitpriv.ack_tx)
|
||||
rtw_ack_tx_done(&padapter->xmitpriv, RTW_SCTX_DONE_DRV_STOP);
|
||||
|
||||
|
|
@ -1024,8 +1018,8 @@ static int rtw_suspend_free_assoc_resource(struct adapter *padapter)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
if (rtw_chk_roam_flags(padapter, RTW_ROAM_ON_RESUME)) {
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)
|
||||
&& check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
||||
check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
rtw_set_to_roam(padapter, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -1094,7 +1088,7 @@ void rtw_suspend_common(struct adapter *padapter)
|
|||
while (pwrpriv->bips_processing)
|
||||
msleep(1);
|
||||
|
||||
if ((!padapter->bup) || (padapter->bDriverStopped) || (padapter->bSurpriseRemoved))
|
||||
if ((!padapter->bup) || (padapter->driver_stopped) || (padapter->bSurpriseRemoved))
|
||||
return;
|
||||
|
||||
rtw_ps_deny(padapter, PS_DENY_SUSPEND);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ static int sdio_alloc_irq(struct dvobj_priv *dvobj)
|
|||
|
||||
sdio_release_host(func);
|
||||
|
||||
return err?_FAIL:_SUCCESS;
|
||||
return err ? _FAIL : _SUCCESS;
|
||||
}
|
||||
|
||||
static void sdio_free_irq(struct dvobj_priv *dvobj)
|
||||
|
|
@ -215,7 +215,7 @@ static void sd_intf_stop(struct adapter *padapter)
|
|||
}
|
||||
|
||||
|
||||
static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct sdio_device_id *pdid)
|
||||
static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int status = _FAIL;
|
||||
struct net_device *pnetdev;
|
||||
|
|
@ -229,7 +229,7 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
|
|||
padapter->dvobj = dvobj;
|
||||
dvobj->if1 = padapter;
|
||||
|
||||
padapter->bDriverStopped = true;
|
||||
padapter->driver_stopped = true;
|
||||
|
||||
dvobj->padapters = padapter;
|
||||
padapter->iface_id = 0;
|
||||
|
|
@ -285,8 +285,8 @@ static struct adapter *rtw_sdio_if1_init(struct dvobj_priv *dvobj, const struct
|
|||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if (status != _SUCCESS && padapter->HalData)
|
||||
kfree(padapter->HalData);
|
||||
if (status != _SUCCESS)
|
||||
rtw_hal_data_deinit(padapter);
|
||||
|
||||
if (status != _SUCCESS) {
|
||||
rtw_wdev_unregister(padapter->rtw_wdev);
|
||||
|
|
@ -334,9 +334,8 @@ static void rtw_sdio_if1_deinit(struct adapter *if1)
|
|||
* notes: drv_init() is called when the bus driver has located a card for us to support.
|
||||
* We accept the new device by returning 0.
|
||||
*/
|
||||
static int rtw_drv_init(
|
||||
struct sdio_func *func,
|
||||
const struct sdio_device_id *id)
|
||||
static int rtw_drv_init(struct sdio_func *func,
|
||||
const struct sdio_device_id *id)
|
||||
{
|
||||
int status = _FAIL;
|
||||
struct adapter *if1 = NULL;
|
||||
|
|
@ -346,7 +345,7 @@ static int rtw_drv_init(
|
|||
if (!dvobj)
|
||||
goto exit;
|
||||
|
||||
if1 = rtw_sdio_if1_init(dvobj, id);
|
||||
if1 = rtw_sdio_if1_init(dvobj);
|
||||
if (!if1)
|
||||
goto free_dvobj;
|
||||
|
||||
|
|
@ -357,10 +356,13 @@ static int rtw_drv_init(
|
|||
|
||||
status = sdio_alloc_irq(dvobj);
|
||||
if (status != _SUCCESS)
|
||||
goto free_if1;
|
||||
goto free_netdev;
|
||||
|
||||
status = _SUCCESS;
|
||||
|
||||
free_netdev:
|
||||
if (status != _SUCCESS)
|
||||
rtw_unregister_netdevs(dvobj);
|
||||
free_if1:
|
||||
if (status != _SUCCESS && if1)
|
||||
rtw_sdio_if1_deinit(if1);
|
||||
|
|
@ -413,7 +415,7 @@ static int rtw_sdio_suspend(struct device *dev)
|
|||
struct pwrctrl_priv *pwrpriv = dvobj_to_pwrctl(psdpriv);
|
||||
struct adapter *padapter = psdpriv->if1;
|
||||
|
||||
if (padapter->bDriverStopped)
|
||||
if (padapter->driver_stopped)
|
||||
return 0;
|
||||
|
||||
if (pwrpriv->bInSuspend)
|
||||
|
|
|
|||
|
|
@ -70,11 +70,11 @@ static void _rtw_reg_apply_flags(struct wiphy *wiphy)
|
|||
|
||||
/* channels apply by channel plans. */
|
||||
for (i = 0; i < max_chan_nums; i++) {
|
||||
channel = channel_set[i].ChannelNum;
|
||||
channel = channel_set[i].channel_num;
|
||||
freq = rtw_ieee80211_channel_to_frequency(channel);
|
||||
ch = ieee80211_get_channel(wiphy, freq);
|
||||
if (ch) {
|
||||
if (channel_set[i].ScanType == SCAN_PASSIVE)
|
||||
if (channel_set[i].scan_type == SCAN_PASSIVE)
|
||||
ch->flags = IEEE80211_CHAN_NO_IR;
|
||||
else
|
||||
ch->flags = 0;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
#include <drv_types.h>
|
||||
|
||||
|
||||
uint rtw_remainder_len(struct pkt_file *pfile)
|
||||
unsigned int rtw_remainder_len(struct pkt_file *pfile)
|
||||
{
|
||||
return (pfile->buf_len - ((SIZE_PTR)(pfile->cur_addr) - (SIZE_PTR)(pfile->buf_start)));
|
||||
}
|
||||
|
|
@ -15,8 +15,10 @@ uint rtw_remainder_len(struct pkt_file *pfile)
|
|||
void _rtw_open_pktfile(struct sk_buff *pktptr, struct pkt_file *pfile)
|
||||
{
|
||||
pfile->pkt = pktptr;
|
||||
pfile->cur_addr = pfile->buf_start = pktptr->data;
|
||||
pfile->pkt_len = pfile->buf_len = pktptr->len;
|
||||
pfile->buf_start = pktptr->data;
|
||||
pfile->cur_addr = pktptr->data;
|
||||
pfile->buf_len = pktptr->len;
|
||||
pfile->pkt_len = pktptr->len;
|
||||
|
||||
pfile->cur_buffer = pfile->buf_start;
|
||||
}
|
||||
|
|
@ -48,7 +50,9 @@ signed int rtw_endofpktfile(struct pkt_file *pfile)
|
|||
return false;
|
||||
}
|
||||
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter, struct xmit_buf *pxmitbuf, u32 free_sz, u8 flag)
|
||||
void rtw_os_xmit_resource_free(struct adapter *padapter,
|
||||
struct xmit_buf *pxmitbuf,
|
||||
u32 free_sz, u8 flag)
|
||||
{
|
||||
if (free_sz > 0)
|
||||
kfree(pxmitbuf->pallocated_buf);
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ config FB_SM750
|
|||
select FB_CFB_FILLRECT
|
||||
select FB_CFB_COPYAREA
|
||||
select FB_CFB_IMAGEBLIT
|
||||
select FB_IOMEM_FOPS
|
||||
help
|
||||
Frame buffer driver for the Silicon Motion SM750 chip
|
||||
with 2D acceleration and dual head support.
|
||||
|
|
|
|||
|
|
@ -263,33 +263,6 @@ int ddk750_init_hw(struct initchip_param *p_init_param)
|
|||
poke32(MISC_CTRL, reg);
|
||||
}
|
||||
|
||||
if (p_init_param->set_all_eng_off == 1) {
|
||||
sm750_enable_2d_engine(0);
|
||||
|
||||
/* Disable Overlay, if a former application left it on */
|
||||
reg = peek32(VIDEO_DISPLAY_CTRL);
|
||||
reg &= ~DISPLAY_CTRL_PLANE;
|
||||
poke32(VIDEO_DISPLAY_CTRL, reg);
|
||||
|
||||
/* Disable video alpha, if a former application left it on */
|
||||
reg = peek32(VIDEO_ALPHA_DISPLAY_CTRL);
|
||||
reg &= ~DISPLAY_CTRL_PLANE;
|
||||
poke32(VIDEO_ALPHA_DISPLAY_CTRL, reg);
|
||||
|
||||
/* Disable alpha plane, if a former application left it on */
|
||||
reg = peek32(ALPHA_DISPLAY_CTRL);
|
||||
reg &= ~DISPLAY_CTRL_PLANE;
|
||||
poke32(ALPHA_DISPLAY_CTRL, reg);
|
||||
|
||||
/* Disable DMA Channel, if a former application left it on */
|
||||
reg = peek32(DMA_ABORT_INTERRUPT);
|
||||
reg |= DMA_ABORT_INTERRUPT_ABORT_1;
|
||||
poke32(DMA_ABORT_INTERRUPT, reg);
|
||||
|
||||
/* Disable DMA Power, if a former application left it on */
|
||||
sm750_enable_dma(0);
|
||||
}
|
||||
|
||||
/* We can add more initialization as needed. */
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -76,13 +76,6 @@ struct initchip_param {
|
|||
*/
|
||||
unsigned short master_clock;
|
||||
|
||||
/*
|
||||
* 0 = leave all engine state untouched.
|
||||
* 1 = make sure they are off: 2D, Overlay,
|
||||
* video alpha, alpha, hardware cursors
|
||||
*/
|
||||
unsigned short set_all_eng_off;
|
||||
|
||||
/*
|
||||
* 0 = Do not reset the memory controller
|
||||
* 1 = Reset the memory controller
|
||||
|
|
|
|||
|
|
@ -96,20 +96,6 @@ void sm750_enable_2d_engine(unsigned int enable)
|
|||
sm750_set_current_gate(gate);
|
||||
}
|
||||
|
||||
void sm750_enable_dma(unsigned int enable)
|
||||
{
|
||||
u32 gate;
|
||||
|
||||
/* Enable DMA Gate */
|
||||
gate = peek32(CURRENT_GATE);
|
||||
if (enable)
|
||||
gate |= CURRENT_GATE_DMA;
|
||||
else
|
||||
gate &= ~CURRENT_GATE_DMA;
|
||||
|
||||
sm750_set_current_gate(gate);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function enable/disable the GPIO Engine
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@ void sm750_set_current_gate(unsigned int gate);
|
|||
*/
|
||||
void sm750_enable_2d_engine(unsigned int enable);
|
||||
|
||||
/*
|
||||
* This function enable/disable the DMA Engine
|
||||
*/
|
||||
void sm750_enable_dma(unsigned int enable);
|
||||
|
||||
/*
|
||||
* This function enable/disable the GPIO Engine
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -8,15 +8,6 @@
|
|||
#include "sm750_accel.h"
|
||||
#include "sm750_cursor.h"
|
||||
|
||||
/*
|
||||
* #ifdef __BIG_ENDIAN
|
||||
* ssize_t lynxfb_ops_write(struct fb_info *info, const char __user *buf,
|
||||
* size_t count, loff_t *ppos);
|
||||
* ssize_t lynxfb_ops_read(struct fb_info *info, char __user *buf,
|
||||
* size_t count, loff_t *ppos);
|
||||
* #endif
|
||||
*/
|
||||
|
||||
/* common var for all device */
|
||||
static int g_hwcursor = 1;
|
||||
static int g_noaccel __ro_after_init;
|
||||
|
|
@ -352,7 +343,6 @@ static int lynxfb_ops_set_par(struct fb_info *info)
|
|||
if (!info)
|
||||
return -EINVAL;
|
||||
|
||||
ret = 0;
|
||||
par = info->par;
|
||||
crtc = &par->crtc;
|
||||
output = &par->output;
|
||||
|
|
@ -472,7 +462,6 @@ static int lynxfb_ops_check_var(struct fb_var_screeninfo *var,
|
|||
if (!var->pixclock)
|
||||
return -EINVAL;
|
||||
|
||||
ret = 0;
|
||||
par = info->par;
|
||||
crtc = &par->crtc;
|
||||
|
||||
|
|
@ -591,7 +580,7 @@ static int sm750fb_set_drv(struct lynxfb_par *par)
|
|||
crtc = &par->crtc;
|
||||
|
||||
crtc->vidmem_size = sm750_dev->vidmem_size;
|
||||
if (sm750_dev->fb_count > 1)
|
||||
if (g_dualview)
|
||||
crtc->vidmem_size >>= 1;
|
||||
|
||||
/* setup crtc and output member */
|
||||
|
|
@ -743,7 +732,7 @@ static int lynxfb_set_fbinfo(struct fb_info *info, int index)
|
|||
* must be set after crtc member initialized
|
||||
*/
|
||||
crtc->cursor.offset = crtc->o_screen + crtc->vidmem_size - 1024;
|
||||
crtc->cursor.mmio = sm750_dev->pvReg +
|
||||
crtc->cursor.mmio = sm750_dev->mmio +
|
||||
0x800f0 + (int)crtc->channel * 0x140;
|
||||
|
||||
crtc->cursor.max_h = 64;
|
||||
|
|
@ -844,11 +833,10 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
|
|||
|
||||
swap = 0;
|
||||
|
||||
sm750_dev->init_parm.chip_clk = 0;
|
||||
sm750_dev->init_parm.mem_clk = 0;
|
||||
sm750_dev->init_parm.master_clk = 0;
|
||||
sm750_dev->init_parm.chip_clock = 0;
|
||||
sm750_dev->init_parm.mem_clock = 0;
|
||||
sm750_dev->init_parm.master_clock = 0;
|
||||
sm750_dev->init_parm.power_mode = 0;
|
||||
sm750_dev->init_parm.setAllEngOff = 0;
|
||||
sm750_dev->init_parm.reset_memory = 1;
|
||||
|
||||
/* defaultly turn g_hwcursor on for both view */
|
||||
|
|
@ -896,7 +884,7 @@ static void sm750fb_setup(struct sm750_dev *sm750_dev, char *src)
|
|||
|
||||
NO_PARAM:
|
||||
if (sm750_dev->revid != SM750LE_REVISION_ID) {
|
||||
if (sm750_dev->fb_count > 1) {
|
||||
if (g_dualview) {
|
||||
if (swap)
|
||||
sm750_dev->dataflow = sm750_dual_swap;
|
||||
else
|
||||
|
|
@ -1047,7 +1035,7 @@ static void lynxfb_pci_remove(struct pci_dev *pdev)
|
|||
sm750fb_framebuffer_release(sm750_dev);
|
||||
arch_phys_wc_del(sm750_dev->mtrr.vram);
|
||||
|
||||
iounmap(sm750_dev->pvReg);
|
||||
iounmap(sm750_dev->mmio);
|
||||
iounmap(sm750_dev->vmem);
|
||||
pci_release_region(pdev, 1);
|
||||
kfree(g_settings);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
#ifndef LYNXDRV_H_
|
||||
#define LYNXDRV_H_
|
||||
#include "ddk750_chip.h"
|
||||
|
||||
#define FB_ACCEL_SMI 0xab
|
||||
|
||||
|
|
@ -38,16 +39,6 @@ enum sm750_path {
|
|||
sm750_pnc = 3, /* panel and crt */
|
||||
};
|
||||
|
||||
struct init_status {
|
||||
ushort power_mode;
|
||||
/* below three clocks are in unit of MHZ*/
|
||||
ushort chip_clk;
|
||||
ushort mem_clk;
|
||||
ushort master_clk;
|
||||
ushort setAllEngOff;
|
||||
ushort reset_memory;
|
||||
};
|
||||
|
||||
struct lynx_accel {
|
||||
/* base virtual address of DPR registers */
|
||||
unsigned char __iomem *dpr_base;
|
||||
|
|
@ -57,7 +48,7 @@ struct lynx_accel {
|
|||
/* function pointers */
|
||||
void (*de_init)(struct lynx_accel *accel);
|
||||
|
||||
int (*de_wait)(void);/* see if hardware ready to work */
|
||||
int (*de_wait)(void); /* see if hardware ready to work */
|
||||
|
||||
int (*de_fillrect)(struct lynx_accel *accel,
|
||||
u32 base, u32 pitch, u32 bpp,
|
||||
|
|
@ -97,12 +88,12 @@ struct sm750_dev {
|
|||
unsigned long vidreg_start;
|
||||
__u32 vidmem_size;
|
||||
__u32 vidreg_size;
|
||||
void __iomem *pvReg;
|
||||
void __iomem *mmio;
|
||||
unsigned char __iomem *vmem;
|
||||
/* locks*/
|
||||
spinlock_t slock;
|
||||
|
||||
struct init_status init_parm;
|
||||
struct initchip_param init_parm;
|
||||
enum sm750_pnltype pnltype;
|
||||
enum sm750_dataflow dataflow;
|
||||
int nocrt;
|
||||
|
|
@ -145,8 +136,6 @@ struct lynxfb_crtc {
|
|||
u16 ypanstep;
|
||||
u16 ywrapstep;
|
||||
|
||||
void *priv;
|
||||
|
||||
/* cursor information */
|
||||
struct lynx_cursor cursor;
|
||||
};
|
||||
|
|
@ -168,7 +157,6 @@ struct lynxfb_output {
|
|||
* *channel=1 means secondary channel
|
||||
* output->channel ==> &crtc->channel
|
||||
*/
|
||||
void *priv;
|
||||
};
|
||||
|
||||
struct lynxfb_par {
|
||||
|
|
|
|||
|
|
@ -5,16 +5,16 @@
|
|||
#define HW_ROP2_COPY 0xc
|
||||
#define HW_ROP2_XOR 0x6
|
||||
|
||||
/* notes: below address are the offset value from de_base_address (0x100000)*/
|
||||
/* notes: below address are the offset value from de_base_address (0x100000) */
|
||||
|
||||
/* for sm718/750/502 de_base is at mmreg_1mb*/
|
||||
/* for sm718/750/502 de_base is at mmreg_1mb */
|
||||
#define DE_BASE_ADDR_TYPE1 0x100000
|
||||
/* for sm712,de_base is at mmreg_32kb */
|
||||
#define DE_BASE_ADDR_TYPE2 0x8000
|
||||
/* for sm722,de_base is at mmreg_0 */
|
||||
#define DE_BASE_ADDR_TYPE3 0
|
||||
|
||||
/* type1 data port address is at mmreg_0x110000*/
|
||||
/* type1 data port address is at mmreg_0x110000 */
|
||||
#define DE_PORT_ADDR_TYPE1 0x110000
|
||||
/* for sm712,data port address is at mmreg_0 */
|
||||
#define DE_PORT_ADDR_TYPE2 0x100000
|
||||
|
|
@ -25,7 +25,7 @@
|
|||
#define DE_SOURCE_WRAP BIT(31)
|
||||
#define DE_SOURCE_X_K1_SHIFT 16
|
||||
#define DE_SOURCE_X_K1_MASK (0x3fff << 16)
|
||||
#define DE_SOURCE_X_K1_MONO_MASK (0x1f << 16)
|
||||
#define DE_SOURCE_X_K1_MONO_MASK (0x1f << 16)
|
||||
#define DE_SOURCE_Y_K2_MASK 0xffff
|
||||
|
||||
#define DE_DESTINATION 0x4
|
||||
|
|
@ -196,12 +196,12 @@ int sm750_hw_fillrect(struct lynx_accel *accel,
|
|||
|
||||
/**
|
||||
* sm750_hm_copyarea
|
||||
* @sBase: Address of source: offset in frame buffer
|
||||
* @sPitch: Pitch value of source surface in BYTE
|
||||
* @source_base: Address of source: offset in frame buffer
|
||||
* @source_pitch: Pitch value of source surface in BYTE
|
||||
* @sx: Starting x coordinate of source surface
|
||||
* @sy: Starting y coordinate of source surface
|
||||
* @dBase: Address of destination: offset in frame buffer
|
||||
* @dPitch: Pitch value of destination surface in BYTE
|
||||
* @dest_base: Address of destination: offset in frame buffer
|
||||
* @dest_pitch: Pitch value of destination surface in BYTE
|
||||
* @bpp: Color depth of destination surface
|
||||
* @dx: Starting x coordinate of destination surface
|
||||
* @dy: Starting y coordinate of destination surface
|
||||
|
|
@ -210,34 +210,34 @@ int sm750_hw_fillrect(struct lynx_accel *accel,
|
|||
* @rop2: ROP value
|
||||
*/
|
||||
int sm750_hw_copyarea(struct lynx_accel *accel,
|
||||
unsigned int sBase, unsigned int sPitch,
|
||||
unsigned int source_base, unsigned int source_pitch,
|
||||
unsigned int sx, unsigned int sy,
|
||||
unsigned int dBase, unsigned int dPitch,
|
||||
unsigned int dest_base, unsigned int dest_pitch,
|
||||
unsigned int bpp, unsigned int dx, unsigned int dy,
|
||||
unsigned int width, unsigned int height,
|
||||
unsigned int rop2);
|
||||
|
||||
/**
|
||||
* sm750_hw_imageblit
|
||||
* @pSrcbuf: pointer to start of source buffer in system memory
|
||||
* @srcDelta: Pitch value (in bytes) of the source buffer, +ive means top down
|
||||
* @src_buf: pointer to start of source buffer in system memory
|
||||
* @src_delta: Pitch value (in bytes) of the source buffer, +ive means top down
|
||||
*>----- and -ive mean button up
|
||||
* @startBit: Mono data can start at any bit in a byte, this value should be
|
||||
* @start_bit: Mono data can start at any bit in a byte, this value should be
|
||||
*>----- 0 to 7
|
||||
* @dBase: Address of destination: offset in frame buffer
|
||||
* @dPitch: Pitch value of destination surface in BYTE
|
||||
* @bytePerPixel: Color depth of destination surface
|
||||
* @dest_base: Address of destination: offset in frame buffer
|
||||
* @dest_pitch: Pitch value of destination surface in BYTE
|
||||
* @byte_per_pixel: Color depth of destination surface
|
||||
* @dx: Starting x coordinate of destination surface
|
||||
* @dy: Starting y coordinate of destination surface
|
||||
* @width: width of rectangle in pixel value
|
||||
* @height: height of rectangle in pixel value
|
||||
* @fColor: Foreground color (corresponding to a 1 in the monochrome data
|
||||
* @bColor: Background color (corresponding to a 0 in the monochrome data
|
||||
* @fg_color: Foreground color (corresponding to a 1 in the monochrome data
|
||||
* @bg_color: Background color (corresponding to a 0 in the monochrome data
|
||||
* @rop2: ROP value
|
||||
*/
|
||||
int sm750_hw_imageblit(struct lynx_accel *accel, const char *pSrcbuf,
|
||||
u32 srcDelta, u32 startBit, u32 dBase, u32 dPitch,
|
||||
u32 bytePerPixel, u32 dx, u32 dy, u32 width,
|
||||
u32 height, u32 fColor, u32 bColor, u32 rop2);
|
||||
int sm750_hw_imageblit(struct lynx_accel *accel, const char *src_buf,
|
||||
u32 src_delta, u32 start_bit, u32 dest_base, u32 dest_pitch,
|
||||
u32 byte_per_pixel, u32 dx, u32 dy, u32 width,
|
||||
u32 height, u32 fg_color, u32 bg_color, u32 rop2);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -23,18 +23,18 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
|
|||
}
|
||||
|
||||
/* now map mmio and vidmem */
|
||||
sm750_dev->pvReg =
|
||||
sm750_dev->mmio =
|
||||
ioremap(sm750_dev->vidreg_start, sm750_dev->vidreg_size);
|
||||
if (!sm750_dev->pvReg) {
|
||||
if (!sm750_dev->mmio) {
|
||||
dev_err(&pdev->dev, "mmio failed\n");
|
||||
ret = -EFAULT;
|
||||
goto err_release_region;
|
||||
}
|
||||
|
||||
sm750_dev->accel.dpr_base = sm750_dev->pvReg + DE_BASE_ADDR_TYPE1;
|
||||
sm750_dev->accel.dp_port_base = sm750_dev->pvReg + DE_PORT_ADDR_TYPE1;
|
||||
sm750_dev->accel.dpr_base = sm750_dev->mmio + DE_BASE_ADDR_TYPE1;
|
||||
sm750_dev->accel.dp_port_base = sm750_dev->mmio + DE_PORT_ADDR_TYPE1;
|
||||
|
||||
mmio750 = sm750_dev->pvReg;
|
||||
mmio750 = sm750_dev->mmio;
|
||||
sm750_set_chip_type(sm750_dev->devid, sm750_dev->revid);
|
||||
|
||||
sm750_dev->vidmem_start = pci_resource_start(pdev, 0);
|
||||
|
|
@ -58,7 +58,7 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
|
|||
return 0;
|
||||
|
||||
err_unmap_reg:
|
||||
iounmap(sm750_dev->pvReg);
|
||||
iounmap(sm750_dev->mmio);
|
||||
err_release_region:
|
||||
pci_release_region(pdev, 1);
|
||||
return ret;
|
||||
|
|
@ -66,20 +66,20 @@ int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
|
|||
|
||||
int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev)
|
||||
{
|
||||
struct init_status *parm;
|
||||
struct initchip_param *parm;
|
||||
|
||||
parm = &sm750_dev->init_parm;
|
||||
if (parm->chip_clk == 0)
|
||||
parm->chip_clk = (sm750_get_chip_type() == SM750LE) ?
|
||||
if (parm->chip_clock == 0)
|
||||
parm->chip_clock = (sm750_get_chip_type() == SM750LE) ?
|
||||
DEFAULT_SM750LE_CHIP_CLOCK :
|
||||
DEFAULT_SM750_CHIP_CLOCK;
|
||||
|
||||
if (parm->mem_clk == 0)
|
||||
parm->mem_clk = parm->chip_clk;
|
||||
if (parm->master_clk == 0)
|
||||
parm->master_clk = parm->chip_clk / 3;
|
||||
if (parm->mem_clock == 0)
|
||||
parm->mem_clock = parm->chip_clock;
|
||||
if (parm->master_clock == 0)
|
||||
parm->master_clock = parm->chip_clock / 3;
|
||||
|
||||
ddk750_init_hw((struct initchip_param *)&sm750_dev->init_parm);
|
||||
ddk750_init_hw(&sm750_dev->init_parm);
|
||||
/* for sm718, open pci burst */
|
||||
if (sm750_dev->devid == 0x718) {
|
||||
poke32(SYSTEM_CTRL,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user