Commit 97b2ff29 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'staging-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver updates from Greg KH:
 "Here is the large set of staging driver updates for 6.4-rc1. Once
  again, we removed more code than was added, a nice trend.

  It was a calm cycle, mostly all just small coding style cleanups,
  included in here are:

   - removal of the greybus loopback testing tools, userspace code that
     didn't belong in a driver subdirectory and was causing problems for
     some build systems

   - platform remove callback cleanups

   - rtl8192e huge cleanups

   - other small staging driver cleanups.

  All of these have been in linux-next for a while with no reported
  problems"

* tag 'staging-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (185 commits)
  staging: rtl8192e: Fix W_DISABLE# does not work after stop/start
  staging: rtl8192e: Remove unchanged variables bfsync_processing and more
  staging: rtl8192e: Remove unchanged variable frame_sync_monitor
  staging: rtl8192e: Remove unchanged variable chan_forced
  staging: rtl8192e: Remove set to true while true of bfirst_after_down
  staging: rtl8192e: Remove second initialization of bActuallySet
  staging: rtl8192e: Remove unused macro RT_SET_PS_LEVEL
  staging: rtl8192e: Remove unused function rtl92e_disable_nic
  staging: rtl8192e: Remove unchanged variable RegRfPsLevel
  staging: rtl8172: Add blank lines after declarations
  staging: rtl8192e: Remove unused variable RF_Type
  staging: rtl8192e: Remove one of two checks for hardware RTL8192SE
  staging: rtl8192e: Remove unused function _rtl92e_dm_init_wa_broadcom_iot
  staging: rtl8192e: Remove macro IS_HARDWARE_TYPE_8192SE
  staging: greybus: drop loopback test files
  staging: rtl8192e: Add blank lines after declarations
  staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPDecryptErrors>
  staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPReplays>
  staging: rtl8192e: avoid CamelCase <dot11RSNAStatsCCMPFormatErrors>
  staging: rtl8192e: fix alignment to match open parenthesis
  ...
parents b39667ab 3fac2397
......@@ -103,17 +103,17 @@
* globals
* ----------------------------
*/
static int read_timeout = 1000; /* ms to wait before read() times out */
static int write_timeout = 1000; /* ms to wait before write() times out */
static long read_timeout = 1000; /* ms to wait before read() times out */
static long write_timeout = 1000; /* ms to wait before write() times out */
/* ----------------------------
* module command-line arguments
* ----------------------------
*/
module_param(read_timeout, int, 0444);
module_param(read_timeout, long, 0444);
MODULE_PARM_DESC(read_timeout, "ms to wait before blocking read() timing out; set to -1 for no timeout");
module_param(write_timeout, int, 0444);
module_param(write_timeout, long, 0444);
MODULE_PARM_DESC(write_timeout, "ms to wait before blocking write() timing out; set to -1 for no timeout");
/* ----------------------------
......@@ -384,9 +384,7 @@ static ssize_t axis_fifo_read(struct file *f, char __user *buf,
mutex_lock(&fifo->read_lock);
ret = wait_event_interruptible_timeout(fifo->read_queue,
ioread32(fifo->base_addr + XLLF_RDFO_OFFSET),
(read_timeout >= 0) ?
msecs_to_jiffies(read_timeout) :
MAX_SCHEDULE_TIMEOUT);
read_timeout);
if (ret <= 0) {
if (ret == 0) {
......@@ -528,9 +526,7 @@ static ssize_t axis_fifo_write(struct file *f, const char __user *buf,
ret = wait_event_interruptible_timeout(fifo->write_queue,
ioread32(fifo->base_addr + XLLF_TDFV_OFFSET)
>= words_to_write,
(write_timeout >= 0) ?
msecs_to_jiffies(write_timeout) :
MAX_SCHEDULE_TIMEOUT);
write_timeout);
if (ret <= 0) {
if (ret == 0) {
......@@ -920,15 +916,13 @@ static int axis_fifo_probe(struct platform_device *pdev)
return rc;
}
static int axis_fifo_remove(struct platform_device *pdev)
static void axis_fifo_remove(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct axis_fifo *fifo = dev_get_drvdata(dev);
misc_deregister(&fifo->miscdev);
dev_set_drvdata(dev, NULL);
return 0;
}
static const struct of_device_id axis_fifo_of_match[] = {
......@@ -943,12 +937,22 @@ static struct platform_driver axis_fifo_driver = {
.of_match_table = axis_fifo_of_match,
},
.probe = axis_fifo_probe,
.remove = axis_fifo_remove,
.remove_new = axis_fifo_remove,
};
static int __init axis_fifo_init(void)
{
pr_info("axis-fifo driver loaded with parameters read_timeout = %i, write_timeout = %i\n",
if (read_timeout >= 0)
read_timeout = msecs_to_jiffies(read_timeout);
else
read_timeout = MAX_SCHEDULE_TIMEOUT;
if (write_timeout >= 0)
write_timeout = msecs_to_jiffies(write_timeout);
else
write_timeout = MAX_SCHEDULE_TIMEOUT;
pr_info("axis-fifo driver loaded with parameters read_timeout = %li, write_timeout = %li\n",
read_timeout, write_timeout);
return platform_driver_register(&axis_fifo_driver);
}
......
......@@ -3137,7 +3137,7 @@ static void nbu2ss_drv_shutdown(struct platform_device *pdev)
}
/*-------------------------------------------------------------------------*/
static int nbu2ss_drv_remove(struct platform_device *pdev)
static void nbu2ss_drv_remove(struct platform_device *pdev)
{
struct nbu2ss_udc *udc;
struct nbu2ss_ep *ep;
......@@ -3154,8 +3154,6 @@ static int nbu2ss_drv_remove(struct platform_device *pdev)
/* Interrupt Handler - Release */
free_irq(vbus_irq, udc);
return 0;
}
/*-------------------------------------------------------------------------*/
......@@ -3210,7 +3208,7 @@ static int nbu2ss_drv_resume(struct platform_device *pdev)
static struct platform_driver udc_driver = {
.probe = nbu2ss_drv_probe,
.shutdown = nbu2ss_drv_shutdown,
.remove = nbu2ss_drv_remove,
.remove_new = nbu2ss_drv_remove,
.suspend = nbu2ss_drv_suspend,
.resume = nbu2ss_drv_resume,
.driver = {
......
......@@ -321,7 +321,7 @@ static int controller_probe(struct platform_device *pdev)
return err;
}
static int controller_remove(struct platform_device *pdev)
static void controller_remove(struct platform_device *pdev)
{
struct controller_priv *cd = platform_get_drvdata(pdev);
int id = cd->class_dev->id;
......@@ -329,7 +329,6 @@ static int controller_remove(struct platform_device *pdev)
device_unregister(cd->class_dev);
ida_simple_remove(&controller_index_ida, id);
gpiod_set_value_cansleep(cd->reset_gpiod, 1);
return 0;
}
static const struct of_device_id controller_of_match[] = {
......@@ -341,7 +340,7 @@ MODULE_DEVICE_TABLE(of, controller_of_match);
static struct platform_driver controller_driver = {
.probe = controller_probe,
.remove = controller_remove,
.remove_new = controller_remove,
.driver = {
.name = "arcx-anybus-controller",
.of_match_table = of_match_ptr(controller_of_match),
......
......@@ -419,13 +419,11 @@ static int arche_apb_ctrl_probe(struct platform_device *pdev)
return 0;
}
static int arche_apb_ctrl_remove(struct platform_device *pdev)
static void arche_apb_ctrl_remove(struct platform_device *pdev)
{
device_remove_file(&pdev->dev, &dev_attr_state);
poweroff_seq(pdev);
platform_set_drvdata(pdev, NULL);
return 0;
}
static int __maybe_unused arche_apb_ctrl_suspend(struct device *dev)
......@@ -471,7 +469,7 @@ static const struct of_device_id arche_apb_ctrl_of_match[] = {
static struct platform_driver arche_apb_ctrl_device_driver = {
.probe = arche_apb_ctrl_probe,
.remove = arche_apb_ctrl_remove,
.remove_new = arche_apb_ctrl_remove,
.shutdown = arche_apb_ctrl_shutdown,
.driver = {
.name = "arche-apb-ctrl",
......
......@@ -559,7 +559,7 @@ static int arche_remove_child(struct device *dev, void *unused)
return 0;
}
static int arche_platform_remove(struct platform_device *pdev)
static void arche_platform_remove(struct platform_device *pdev)
{
struct arche_platform_drvdata *arche_pdata = platform_get_drvdata(pdev);
......@@ -570,8 +570,6 @@ static int arche_platform_remove(struct platform_device *pdev)
if (usb3613_hub_mode_ctrl(false))
dev_warn(arche_pdata->dev, "failed to control hub device\n");
/* TODO: Should we do anything more here ?? */
return 0;
}
static __maybe_unused int arche_platform_suspend(struct device *dev)
......@@ -631,7 +629,7 @@ MODULE_DEVICE_TABLE(of, arche_combined_id);
static struct platform_driver arche_platform_device_driver = {
.probe = arche_platform_probe,
.remove = arche_platform_remove,
.remove_new = arche_platform_remove,
.shutdown = arche_platform_shutdown,
.driver = {
.name = "arche-platform-ctrl",
......
......@@ -12,8 +12,11 @@
#define to_gb_audio_module_attr(x) \
container_of(x, struct gb_audio_manager_module_attribute, attr)
#define to_gb_audio_module(x) \
container_of(x, struct gb_audio_manager_module, kobj)
static inline struct gb_audio_manager_module *to_gb_audio_module(struct kobject *kobj)
{
return container_of(kobj, struct gb_audio_manager_module, kobj);
}
struct gb_audio_manager_module_attribute {
struct attribute attr;
......@@ -70,9 +73,8 @@ static void gb_audio_module_release(struct kobject *kobj)
kfree(module);
}
static ssize_t gb_audio_module_name_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_name_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
return sprintf(buf, "%s", module->desc.name);
}
......@@ -80,9 +82,8 @@ static ssize_t gb_audio_module_name_show(
static struct gb_audio_manager_module_attribute gb_audio_module_name_attribute =
__ATTR(name, 0664, gb_audio_module_name_show, NULL);
static ssize_t gb_audio_module_vid_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_vid_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
return sprintf(buf, "%d", module->desc.vid);
}
......@@ -90,9 +91,8 @@ static ssize_t gb_audio_module_vid_show(
static struct gb_audio_manager_module_attribute gb_audio_module_vid_attribute =
__ATTR(vid, 0664, gb_audio_module_vid_show, NULL);
static ssize_t gb_audio_module_pid_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_pid_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
{
return sprintf(buf, "%d", module->desc.pid);
}
......@@ -100,9 +100,9 @@ static ssize_t gb_audio_module_pid_show(
static struct gb_audio_manager_module_attribute gb_audio_module_pid_attribute =
__ATTR(pid, 0664, gb_audio_module_pid_show, NULL);
static ssize_t gb_audio_module_intf_id_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_intf_id_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
return sprintf(buf, "%d", module->desc.intf_id);
}
......@@ -111,9 +111,9 @@ static struct gb_audio_manager_module_attribute
gb_audio_module_intf_id_attribute =
__ATTR(intf_id, 0664, gb_audio_module_intf_id_show, NULL);
static ssize_t gb_audio_module_ip_devices_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_ip_devices_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
return sprintf(buf, "0x%X", module->desc.ip_devices);
}
......@@ -122,9 +122,9 @@ static struct gb_audio_manager_module_attribute
gb_audio_module_ip_devices_attribute =
__ATTR(ip_devices, 0664, gb_audio_module_ip_devices_show, NULL);
static ssize_t gb_audio_module_op_devices_show(
struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr, char *buf)
static ssize_t gb_audio_module_op_devices_show(struct gb_audio_manager_module *module,
struct gb_audio_manager_module_attribute *attr,
char *buf)
{
return sprintf(buf, "0x%X", module->desc.op_devices);
}
......@@ -181,10 +181,9 @@ static void send_add_uevent(struct gb_audio_manager_module *module)
kobject_uevent_env(&module->kobj, KOBJ_ADD, envp);
}
int gb_audio_manager_module_create(
struct gb_audio_manager_module **module,
struct kset *manager_kset,
int id, struct gb_audio_manager_module_descriptor *desc)
int gb_audio_manager_module_create(struct gb_audio_manager_module **module,
struct kset *manager_kset,
int id, struct gb_audio_manager_module_descriptor *desc)
{
int err;
struct gb_audio_manager_module *m;
......
......@@ -24,9 +24,8 @@ struct gbaudio_ctl_pvt {
struct gb_audio_ctl_elem_info *info;
};
static struct gbaudio_module_info *find_gb_module(
struct gbaudio_codec_info *codec,
char const *name)
static struct gbaudio_module_info *find_gb_module(struct gbaudio_codec_info *codec,
char const *name)
{
int dev_id;
char begin[NAME_SIZE];
......
......@@ -41,8 +41,11 @@ struct gb_gpio_controller {
struct irq_chip irqc;
struct mutex irq_lock;
};
#define gpio_chip_to_gb_gpio_controller(chip) \
container_of(chip, struct gb_gpio_controller, chip)
static inline struct gb_gpio_controller *gpio_chip_to_gb_gpio_controller(struct gpio_chip *chip)
{
return container_of(chip, struct gb_gpio_controller, chip);
}
static struct gpio_chip *irq_data_to_gpio_chip(struct irq_data *d)
{
......
......@@ -41,7 +41,6 @@
#define CAP_AUTH_RESULT_CR_NO_KEY 0x03
#define CAP_AUTH_RESULT_CR_SIG_FAIL 0x04
/* IOCTL support */
struct cap_ioc_get_endpoint_uid {
__u8 uid[8];
......
......@@ -21,9 +21,11 @@ struct gb_pwm_chip {
struct pwm_chip chip;
struct pwm_chip *pwm;
};
#define pwm_chip_to_gb_pwm_chip(chip) \
container_of(chip, struct gb_pwm_chip, chip)
static inline struct gb_pwm_chip *pwm_chip_to_gb_pwm_chip(struct pwm_chip *chip)
{
return container_of(chip, struct gb_pwm_chip, chip);
}
static int gb_pwm_count_operation(struct gb_pwm_chip *pwmc)
{
......
# SPDX-License-Identifier: GPL-2.0-only
loopback_test
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES:= loopback_test.c
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := gb_loopback_test
include $(BUILD_EXECUTABLE)
# SPDX-License-Identifier: GPL-2.0
ifeq ($(strip $(V)), 1)
Q =
else
Q = @
endif
CFLAGS += -std=gnu99 -Wall -Wextra -g \
-D_GNU_SOURCE \
-Wno-unused-parameter \
-Wmaybe-uninitialized \
-Wredundant-decls \
-Wcast-align \
-Wsign-compare \
-Wno-missing-field-initializers \
-Wno-shift-negative-value
CC := $(CROSS_COMPILE)gcc
TOOLS = loopback_test
all: $(TOOLS)
%.o: %.c ../greybus_protocols.h
@echo ' TARGET_CC $@'
$(Q)$(CC) $(CFLAGS) -c $< -o $@
loopback_%: loopback_%.o
@echo ' TARGET_LD $@'
$(Q)$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@
clean::
rm -f *.o $(TOOLS)
1 - LOOPBACK DRIVER
The driver implements the main logic of the loopback test and provides
sysfs files to configure the test and retrieve the results.
A user could run a test without the need of the test application given
that he understands the sysfs interface of the loopback driver.
The loopback kernel driver needs to be loaded and at least one module
with the loopback feature enabled must be present for the sysfs files to be
created and for the loopback test application to be able to run.
To load the module:
# modprobe gb-loopback
When the module is probed, New files are available on the sysfs
directory of the detected loopback device.
(typically under "/sys/bus/graybus/devices").
Here is a short summary of the sysfs interface files that should be visible:
* Loopback Configuration Files:
async - Use asynchronous operations.
iteration_max - Number of tests iterations to perform.
size - payload size of the transfer.
timeout - The number of microseconds to give an individual
asynchronous request before timing out.
us_wait - Time to wait between 2 messages
type - By writing the test type to this file, the test starts.
Valid tests are:
0 stop the test
2 - ping
3 - transfer
4 - sink
* Loopback feedback files:
error - number of errors that have occurred.
iteration_count - Number of iterations performed.
requests_completed - Number of requests successfully completed.
requests_timedout - Number of requests that have timed out.
timeout_max - Max allowed timeout
timeout_min - Min allowed timeout.
* Loopback result files:
apbridge_unipro_latency_avg
apbridge_unipro_latency_max
apbridge_unipro_latency_min
gpbridge_firmware_latency_avg
gpbridge_firmware_latency_max
gpbridge_firmware_latency_min
requests_per_second_avg
requests_per_second_max
requests_per_second_min
latency_avg
latency_max
latency_min
throughput_avg
throughput_max
throughput_min
2 - LOOPBACK TEST APPLICATION
The loopback test application manages and formats the results provided by
the loopback kernel module. The purpose of this application
is to:
- Start and manage multiple loopback device tests concurrently.
- Calculate the aggregate results for multiple devices.
- Gather and format test results (csv or human readable).
The best way to get up to date usage information for the application is
usually to pass the "-h" parameter.
Here is the summary of the available options:
Mandatory arguments
-t must be one of the test names - sink, transfer or ping
-i iteration count - the number of iterations to run the test over
Optional arguments
-S sysfs location - location for greybus 'endo' entries default /sys/bus/greybus/devices/
-D debugfs location - location for loopback debugfs entries default /sys/kernel/debug/gb_loopback/
-s size of data packet to send during test - defaults to zero
-m mask - a bit mask of connections to include example: -m 8 = 4th connection -m 9 = 1st and 4th connection etc
default is zero which means broadcast to all connections
-v verbose output
-d debug output
-r raw data output - when specified the full list of latency values are included in the output CSV
-p porcelain - when specified printout is in a user-friendly non-CSV format. This option suppresses writing to CSV file
-a aggregate - show aggregation of all enabled devies
-l list found loopback devices and exit.
-x Async - Enable async transfers.
-o Timeout - Timeout in microseconds for async operations.
3 - REAL WORLD EXAMPLE USAGES
3.1 - Using the driver sysfs files to run a test on a single device:
* Run a 1000 transfers of a 100 byte packet. Each transfer is started only
after the previous one finished successfully:
echo 0 > /sys/bus/greybus/devices/1-2.17/type
echo 0 > /sys/bus/greybus/devices/1-2.17/async
echo 2000 > /sys/bus/greybus/devices/1-2.17/us_wait
echo 100 > /sys/bus/greybus/devices/1-2.17/size
echo 1000 > /sys/bus/greybus/devices/1-2.17/iteration_max
echo 0 > /sys/bus/greybus/devices/1-2.17/mask
echo 200000 > /sys/bus/greybus/devices/1-2.17/timeout
echo 3 > /sys/bus/greybus/devices/1-2.17/type
* Run a 1000 transfers of a 100 byte packet. Transfers are started without
waiting for the previous one to finish:
echo 0 > /sys/bus/greybus/devices/1-2.17/type
echo 3 > /sys/bus/greybus/devices/1-2.17/async
echo 0 > /sys/bus/greybus/devices/1-2.17/us_wait
echo 100 > /sys/bus/greybus/devices/1-2.17/size
echo 1000 > /sys/bus/greybus/devices/1-2.17/iteration_max
echo 0 > /sys/bus/greybus/devices/1-2.17/mask
echo 200000 > /sys/bus/greybus/devices/1-2.17/timeout
echo 3 > /sys/bus/greybus/devices/1-2.17/type
* Read the results from sysfs:
cat /sys/bus/greybus/devices/1-2.17/requests_per_second_min
cat /sys/bus/greybus/devices/1-2.17/requests_per_second_max
cat /sys/bus/greybus/devices/1-2.17/requests_per_second_avg
cat /sys/bus/greybus/devices/1-2.17/latency_min
cat /sys/bus/greybus/devices/1-2.17/latency_max
cat /sys/bus/greybus/devices/1-2.17/latency_avg
cat /sys/bus/greybus/devices/1-2.17/apbridge_unipro_latency_min
cat /sys/bus/greybus/devices/1-2.17/apbridge_unipro_latency_max
cat /sys/bus/greybus/devices/1-2.17/apbridge_unipro_latency_avg
cat /sys/bus/greybus/devices/1-2.17/gpbridge_firmware_latency_min
cat /sys/bus/greybus/devices/1-2.17/gpbridge_firmware_latency_max
cat /sys/bus/greybus/devices/1-2.17/gpbridge_firmware_latency_avg
cat /sys/bus/greybus/devices/1-2.17/error
cat /sys/bus/greybus/devices/1-2.17/requests_completed
cat /sys/bus/greybus/devices/1-2.17/requests_timedout
3.2 - using the test application:
* Run a transfer test 10 iterations of size 100 bytes on all available devices
#/loopback_test -t transfer -i 10 -s 100
1970-1-1 0:10:7,transfer,1-4.17,100,10,0,443,509,471.700012,66,1963,2256,2124.600098,293,102776,118088,109318.898438,15312,1620,1998,1894.099976,378,56,57,56.799999,1
1970-1-1 0:10:7,transfer,1-5.17,100,10,0,399,542,463.399994,143,1845,2505,2175.800049,660,92568,125744,107393.296875,33176,1469,2305,1806.500000,836,56,57,56.799999,1
* Show the aggregate results of both devices. ("-a")
#/loopback_test -t transfer -i 10 -s 100 -a
1970-1-1 0:10:35,transfer,1-4.17,100,10,0,448,580,494.100006,132,1722,2230,2039.400024,508,103936,134560,114515.703125,30624,1513,1980,1806.900024,467,56,57,57.299999,1
1970-1-1 0:10:35,transfer,1-5.17,100,10,0,383,558,478.600006,175,1791,2606,2115.199951,815,88856,129456,110919.703125,40600,1457,2246,1773.599976,789,56,57,57.099998,1
1970-1-1 0:10:35,transfer,aggregate,100,10,0,383,580,486.000000,197,1722,2606,2077.000000,884,88856,134560,112717.000000,45704,1457,2246,1789.000000,789,56,57,57.000000,1
* Example usage of the mask option to select which devices will
run the test (1st, 2nd, or both devices):
# /loopback_test -t transfer -i 10 -s 100 -m 1
1970-1-1 0:11:56,transfer,1-4.17,100,10,0,514,558,544.900024,44,1791,1943,1836.599976,152,119248,129456,126301.296875,10208,1600,1001609,101613.601562,1000009,56,57,56.900002,1
# /loopback_test -t transfer -i 10 -s 100 -m 2
1970-1-1 0:12:0,transfer,1-5.17,100,10,0,468,554,539.000000,86,1804,2134,1859.500000,330,108576,128528,124932.500000,19952,1606,1626,1619.300049,20,56,57,57.400002,1
# /loopback_test -t transfer -i 10 -s 100 -m 3
1970-1-1 0:12:3,transfer,1-4.17,100,10,0,432,510,469.399994,78,1959,2313,2135.800049,354,100224,118320,108785.296875,18096,1610,2024,1893.500000,414,56,57,57.200001,1
1970-1-1 0:12:3,transfer,1-5.17,100,10,0,404,542,468.799988,138,1843,2472,2152.500000,629,93728,125744,108646.101562,32016,1504,2247,1853.099976,743,56,57,57.099998,1
* Show output in human readable format ("-p")
# /loopback_test -t transfer -i 10 -s 100 -m 3 -p
1970-1-1 0:12:37
test: transfer
path: 1-4.17
size: 100
iterations: 10
errors: 0
async: Disabled
requests per-sec: min=390, max=547, average=469.299988, jitter=157
ap-throughput B/s: min=90480 max=126904 average=108762.101562 jitter=36424
ap-latency usec: min=1826 max=2560 average=2146.000000 jitter=734
apbridge-latency usec: min=1620 max=1982 average=1882.099976 jitter=362
gpbridge-latency usec: min=56 max=57 average=57.099998 jitter=1
1970-1-1 0:12:37
test: transfer
path: 1-5.17
size: 100
iterations: 10
errors: 0
async: Disabled
requests per-sec: min=397, max=538, average=461.700012, jitter=141
ap-throughput B/s: min=92104 max=124816 average=106998.898438 jitter=32712
ap-latency usec: min=1856 max=2514 average=2185.699951 jitter=658
apbridge-latency usec: min=1460 max=2296 average=1828.599976 jitter=836
gpbridge-latency usec: min=56 max=57 average=57.099998 jitter=1
#!/usr/bin/env python
# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2015 Google, Inc.
# Copyright (c) 2015 Linaro, Ltd.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from this
# software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
from __future__ import print_function
import csv
import datetime
import sys
import time
dict = {'ping': '2', 'transfer': '3', 'sink': '4'}
verbose = 1
def abort():
sys.exit(1)
def usage():
print('Usage: looptest TEST SIZE ITERATIONS PATH\n\n'
' Run TEST for a number of ITERATIONS with operation data SIZE bytes\n'
' TEST may be \'ping\' \'transfer\' or \'sink\'\n'
' SIZE indicates the size of transfer <= greybus max payload bytes\n'
' ITERATIONS indicates the number of times to execute TEST at SIZE bytes\n'
' Note if ITERATIONS is set to zero then this utility will\n'
' initiate an infinite (non terminating) test and exit\n'
' without logging any metrics data\n'
' PATH indicates the sysfs path for the loopback greybus entries e.g.\n'
' /sys/bus/greybus/devices/endo0:1:1:1:1/\n'
'Examples:\n'
' looptest transfer 128 10000\n'
' looptest ping 0 128\n'
' looptest sink 2030 32768\n'
.format(sys.argv[0]), file=sys.stderr)
abort()
def read_sysfs_int(path):
try:
f = open(path, "r");
val = f.read();
f.close()
return int(val)
except IOError as e:
print("I/O error({0}): {1}".format(e.errno, e.strerror))
print("Invalid path %s" % path)
def write_sysfs_val(path, val):
try:
f = open(path, "r+")
f.write(val)
f.close()
except IOError as e:
print("I/O error({0}): {1}".format(e.errno, e.strerror))
print("Invalid path %s" % path)
def log_csv(test_name, size, iteration_max, sys_pfx):
# file name will test_name_size_iteration_max.csv
# every time the same test with the same parameters is run we will then
# append to the same CSV with datestamp - representing each test dataset
fname = test_name + '_' + size + '_' + str(iteration_max) + '.csv'
try:
# gather data set
date = str(datetime.datetime.now())
error = read_sysfs_int(sys_pfx + 'error')
request_min = read_sysfs_int(sys_pfx + 'requests_per_second_min')
request_max = read_sysfs_int(sys_pfx + 'requests_per_second_max')
request_avg = read_sysfs_int(sys_pfx + 'requests_per_second_avg')
latency_min = read_sysfs_int(sys_pfx + 'latency_min')
latency_max = read_sysfs_int(sys_pfx + 'latency_max')
latency_avg = read_sysfs_int(sys_pfx + 'latency_avg')
throughput_min = read_sysfs_int(sys_pfx + 'throughput_min')
throughput_max = read_sysfs_int(sys_pfx + 'throughput_max')
throughput_avg = read_sysfs_int(sys_pfx + 'throughput_avg')
# derive jitter
request_jitter = request_max - request_min
latency_jitter = latency_max - latency_min
throughput_jitter = throughput_max - throughput_min
# append data set to file
with open(fname, 'a') as csvf:
row = csv.writer(csvf, delimiter=",", quotechar="'",
quoting=csv.QUOTE_MINIMAL)
row.writerow([date, test_name, size, iteration_max, error,
request_min, request_max, request_avg, request_jitter,
latency_min, latency_max, latency_avg, latency_jitter,
throughput_min, throughput_max, throughput_avg, throughput_jitter])
except IOError as e:
print("I/O error({0}): {1}".format(e.errno, e.strerror))
def loopback_run(test_name, size, iteration_max, sys_pfx):
test_id = dict[test_name]
try:
# Terminate any currently running test
write_sysfs_val(sys_pfx + 'type', '0')
# Set parameter for no wait between messages
write_sysfs_val(sys_pfx + 'ms_wait', '0')
# Set operation size
write_sysfs_val(sys_pfx + 'size', size)
# Set iterations
write_sysfs_val(sys_pfx + 'iteration_max', str(iteration_max))
# Initiate by setting loopback operation type
write_sysfs_val(sys_pfx + 'type', test_id)
time.sleep(1)
if iteration_max == 0:
print ("Infinite test initiated CSV won't be logged\n")
return
previous = 0
err = 0
while True:
# get current count bail out if it hasn't changed
iteration_count = read_sysfs_int(sys_pfx + 'iteration_count')
if previous == iteration_count:
err = 1
break
elif iteration_count == iteration_max:
break
previous = iteration_count
if verbose:
print('%02d%% complete %d of %d ' %
(100 * iteration_count / iteration_max,
iteration_count, iteration_max))
time.sleep(1)
if err:
print ('\nError executing test\n')
else:
log_csv(test_name, size, iteration_max, sys_pfx)
except ValueError as ve:
print("Error: %s " % format(e.strerror), file=sys.stderr)
abort()
def main():
if len(sys.argv) < 5:
usage()
if sys.argv[1] in dict.keys():
loopback_run(sys.argv[1], sys.argv[2], int(sys.argv[3]), sys.argv[4])
else:
usage()
if __name__ == '__main__':
main()
This diff is collapsed.
......@@ -102,7 +102,7 @@ struct ad2s1210_state {
static const int ad2s1210_mode_vals[4][2] = {
[MOD_POS] = { 0, 0 },
[MOD_VEL] = { 0, 1 },
[MOD_CONFIG] = { 1, 0 },
[MOD_CONFIG] = { 1, 1 },
};
static inline void ad2s1210_set_mode(enum ad2s1210_mode mode,
......
......@@ -75,9 +75,8 @@ static void ks_wlan_hw_wakeup_task(struct work_struct *work)
if (ps_status == PS_SNOOZE) {
ks_wlan_hw_wakeup_request(priv);
time_left = wait_for_completion_interruptible_timeout(
&priv->psstatus.wakeup_wait,
msecs_to_jiffies(20));
time_left = wait_for_completion_interruptible_timeout(&priv->psstatus.wakeup_wait,
msecs_to_jiffies(20));
if (time_left <= 0) {
netdev_dbg(priv->net_dev, "wake up timeout or interrupted !!!\n");
schedule_work(&priv->wakeup_work);
......
......@@ -108,7 +108,10 @@ struct dim2_platform_data {
u8 fcnt;
};
#define iface_to_hdm(iface) container_of(iface, struct dim2_hdm, most_iface)
static inline struct dim2_hdm *iface_to_hdm(struct most_interface *iface)
{
return container_of(iface, struct dim2_hdm, most_iface);
}
/* Macro to identify a network status message */
#define PACKET_IS_NET_INFO(p) \
......@@ -775,8 +778,7 @@ static int dim2_probe(struct platform_device *pdev)
goto err_free_dev;
}
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
dev->io_base = devm_ioremap_resource(&pdev->dev, res);
dev->io_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
if (IS_ERR(dev->io_base)) {
ret = PTR_ERR(dev->io_base);
goto err_free_dev;
......@@ -906,13 +908,11 @@ static int dim2_probe(struct platform_device *pdev)
*
* Unregister the interface from mostcore
*/
static int dim2_remove(struct platform_device *pdev)
static void dim2_remove(struct platform_device *pdev)
{
struct dim2_hdm *dev = platform_get_drvdata(pdev);
most_deregister_interface(&dev->most_iface);
return 0;
}
/* platform specific functions [[ */
......@@ -987,7 +987,6 @@ static int rcar_gen2_enable(struct platform_device *pdev)
writel(0x04, dev->io_base + 0x600);
}
/* BBCR = 0b11 */
writel(0x03, dev->io_base + 0x500);
writel(0x0002FF02, dev->io_base + 0x508);
......@@ -1091,7 +1090,7 @@ MODULE_DEVICE_TABLE(of, dim2_of_match);
static struct platform_driver dim2_driver = {
.probe = dim2_probe,
.remove = dim2_remove,
.remove_new = dim2_remove,
.driver = {
.name = "hdm_dim2",
.of_match_table = dim2_of_match,
......
......@@ -346,9 +346,8 @@ static void dim2_clear_ctram(void)
dim2_clear_ctr(ctr_addr);
}
static void dim2_configure_channel(
u8 ch_addr, u8 type, u8 is_tx, u16 dbr_address, u16 hw_buffer_size,
u16 packet_length)
static void dim2_configure_channel(u8 ch_addr, u8 type, u8 is_tx, u16 dbr_address,
u16 hw_buffer_size, u16 packet_length)
{
dim2_configure_cdt(ch_addr, dbr_address, hw_buffer_size, packet_length);
dim2_configure_cat(MLB_CAT, ch_addr, type, is_tx ? 1 : 0);
......
......@@ -44,7 +44,10 @@ struct hdm_i2c {
char name[64];
};
#define to_hdm(iface) container_of(iface, struct hdm_i2c, most_iface)
static inline struct hdm_i2c *to_hdm(struct most_interface *iface)
{
return container_of(iface, struct hdm_i2c, most_iface);
}
static irqreturn_t most_irq_handler(int, void *);
static void pending_rx_work(struct work_struct *);
......
......@@ -365,8 +365,7 @@ static const struct video_device comp_videodev_template = {
/**************************************************************************/
static struct most_video_dev *get_comp_dev(
struct most_interface *iface, int channel_idx)
static struct most_video_dev *get_comp_dev(struct most_interface *iface, int channel_idx)
{
struct most_video_dev *mdev;
unsigned long flags;
......
......@@ -882,7 +882,7 @@ static int tegra_nvec_probe(struct platform_device *pdev)
return 0;
}
static int tegra_nvec_remove(struct platform_device *pdev)
static void tegra_nvec_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = platform_get_drvdata(pdev);
......@@ -893,8 +893,6 @@ static int tegra_nvec_remove(struct platform_device *pdev)
cancel_work_sync(&nvec->tx_work);
/* FIXME: needs check whether nvec is responsible for power off */
pm_power_off = NULL;
return 0;
}
#ifdef CONFIG_PM_SLEEP
......@@ -942,7 +940,7 @@ MODULE_DEVICE_TABLE(of, nvidia_nvec_of_match);
static struct platform_driver nvec_device_driver = {
.probe = tegra_nvec_probe,
.remove = tegra_nvec_remove,
.remove_new = tegra_nvec_remove,
.driver = {
.name = "nvec",
.pm = &nvec_pm_ops,
......
......@@ -161,7 +161,7 @@ static int nvec_kbd_probe(struct platform_device *pdev)
return 0;
}
static int nvec_kbd_remove(struct platform_device *pdev)
static void nvec_kbd_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
char disable_kbd[] = { NVEC_KBD, DISABLE_KBD },
......@@ -170,13 +170,11 @@ static int nvec_kbd_remove(struct platform_device *pdev)
nvec_write_async(nvec, uncnfg_wake_key_reporting, 3);
nvec_write_async(nvec, disable_kbd, 2);
nvec_unregister_notifier(nvec, &keys_dev.notifier);
return 0;
}
static struct platform_driver nvec_kbd_driver = {
.probe = nvec_kbd_probe,
.remove = nvec_kbd_remove,
.remove_new = nvec_kbd_remove,
.driver = {
.name = "nvec-kbd",
},
......
......@@ -14,9 +14,6 @@
#include <linux/platform_device.h>
#include "nvec.h"
#define to_nvec_led(led_cdev) \
container_of(led_cdev, struct nvec_led, cdev)
#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
#define NVEC_LED_MAX 8
......@@ -29,7 +26,7 @@ struct nvec_led {
static void nvec_led_brightness_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
struct nvec_led *led = to_nvec_led(led_cdev);
struct nvec_led *led = container_of(led_cdev, struct nvec_led, cdev);
unsigned char buf[] = NVEC_LED_REQ;
buf[4] = value;
......
......@@ -416,7 +416,7 @@ static int nvec_power_probe(struct platform_device *pdev)
return PTR_ERR_OR_ZERO(*psy);
}
static int nvec_power_remove(struct platform_device *pdev)
static void nvec_power_remove(struct platform_device *pdev)
{
struct nvec_power *power = platform_get_drvdata(pdev);
......@@ -429,13 +429,11 @@ static int nvec_power_remove(struct platform_device *pdev)
case BAT:
power_supply_unregister(nvec_bat_psy);
}
return 0;
}
static struct platform_driver nvec_power_driver = {
.probe = nvec_power_probe,
.remove = nvec_power_remove,
.remove_new = nvec_power_remove,
.driver = {
.name = "nvec-power",
}
......
......@@ -125,7 +125,7 @@ static int nvec_mouse_probe(struct platform_device *pdev)
return 0;
}
static int nvec_mouse_remove(struct platform_device *pdev)
static void nvec_mouse_remove(struct platform_device *pdev)
{
struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
......@@ -133,8 +133,6 @@ static int nvec_mouse_remove(struct platform_device *pdev)
ps2_stopstreaming(ps2_dev.ser_dev);
nvec_unregister_notifier(nvec, &ps2_dev.notifier);
serio_unregister_port(ps2_dev.ser_dev);
return 0;
}
#ifdef CONFIG_PM_SLEEP
......@@ -166,7 +164,7 @@ static SIMPLE_DEV_PM_OPS(nvec_mouse_pm_ops, nvec_mouse_suspend,
static struct platform_driver nvec_mouse_driver = {
.probe = nvec_mouse_probe,
.remove = nvec_mouse_remove,
.remove_new = nvec_mouse_remove,
.driver = {
.name = "nvec-mouse",
.pm = &nvec_mouse_pm_ops,
......
......@@ -924,7 +924,7 @@ static int cvm_oct_probe(struct platform_device *pdev)
return 0;
}
static int cvm_oct_remove(struct platform_device *pdev)
static void cvm_oct_remove(struct platform_device *pdev)
{
int port;
......@@ -965,7 +965,6 @@ static int cvm_oct_remove(struct platform_device *pdev)
if (CVMX_FPA_OUTPUT_BUFFER_POOL != CVMX_FPA_PACKET_POOL)
cvm_oct_mem_empty_fpa(CVMX_FPA_OUTPUT_BUFFER_POOL,
CVMX_FPA_OUTPUT_BUFFER_POOL_SIZE, 128);
return 0;
}
static const struct of_device_id cvm_oct_match[] = {
......@@ -978,7 +977,7 @@ MODULE_DEVICE_TABLE(of, cvm_oct_match);
static struct platform_driver cvm_oct_driver = {
.probe = cvm_oct_probe,
.remove = cvm_oct_remove,
.remove_new = cvm_oct_remove,
.driver = {
.name = KBUILD_MODNAME,
.of_match_table = cvm_oct_match,
......
......@@ -1372,9 +1372,7 @@ static inline void cvmx_fau_async_fetch_and_add32(uint64_t scraddr,
int32_t value)
{ }
static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed(
int interface,
int port)
static inline union cvmx_gmxx_rxx_rx_inbnd cvmx_spi4000_check_speed(int interface, int port)
{
union cvmx_gmxx_rxx_rx_inbnd r;
......
......@@ -351,26 +351,23 @@ static int qlge_get_xgmac_regs(struct qlge_adapter *qdev, u32 *buf,
/* We're reading 400 xgmac registers, but we filter out
* several locations that are non-responsive to reads.
*/
if ((i == 0x00000114) ||
(i == 0x00000118) ||
(i == 0x0000013c) ||
(i == 0x00000140) ||
(i > 0x00000150 && i < 0x000001fc) ||
(i > 0x00000278 && i < 0x000002a0) ||
(i > 0x000002c0 && i < 0x000002cf) ||
(i > 0x000002dc && i < 0x000002f0) ||
(i > 0x000003c8 && i < 0x00000400) ||
(i > 0x00000400 && i < 0x00000410) ||
(i > 0x00000410 && i < 0x00000420) ||
(i > 0x00000420 && i < 0x00000430) ||
(i > 0x00000430 && i < 0x00000440) ||
(i > 0x00000440 && i < 0x00000450) ||
(i > 0x00000450 && i < 0x00000500) ||
(i > 0x0000054c && i < 0x00000568) ||
(i > 0x000005c8 && i < 0x00000600)) {
if ((i == 0x00000114) || (i == 0x00000118) ||
(i == 0x0000013c) || (i == 0x00000140) ||
(i > 0x00000150 && i < 0x000001fc) ||
(i > 0x00000278 && i < 0x000002a0) ||
(i > 0x000002c0 && i < 0x000002cf) ||
(i > 0x000002dc && i < 0x000002f0) ||
(i > 0x000003c8 && i < 0x00000400) ||
(i > 0x00000400 && i < 0x00000410) ||
(i > 0x00000410 && i < 0x00000420) ||
(i > 0x00000420 && i < 0x00000430) ||
(i > 0x00000430 && i < 0x00000440) ||
(i > 0x00000440 && i < 0x00000450) ||
(i > 0x00000450 && i < 0x00000500) ||
(i > 0x0000054c && i < 0x00000568) ||
(i > 0x000005c8 && i < 0x00000600)) {
if (other_function)
status =
qlge_read_other_func_xgmac_reg(qdev, i, buf);
status = qlge_read_other_func_xgmac_reg(qdev, i, buf);
else
status = qlge_read_xgmac_reg(qdev, i, buf);
......
......@@ -4,7 +4,7 @@ r8192e_pci-objs := \
r8192E_phy.o \
r8192E_firmware.o \
r8192E_cmdpkt.o \
r8192E_hwimg.o \
table.o \
r8190P_rtl8256.o \
rtl_cam.o \
rtl_core.o \
......
......@@ -103,21 +103,10 @@ enum rf_optype {
struct bb_reg_definition {
u32 rfintfs;
u32 rfintfi;
u32 rfintfo;
u32 rfintfe;
u32 rf3wireOffset;
u32 rfLSSI_Select;
u32 rfTxGainStage;
u32 rfHSSIPara1;
u32 rfHSSIPara2;
u32 rfSwitchControl;
u32 rfAGCControl1;
u32 rfAGCControl2;
u32 rfRxIQImbalance;
u32 rfRxAFE;
u32 rfTxIQImbalance;
u32 rfTxAFE;
u32 rfLSSIReadBack;
u32 rfLSSIReadBackPi;
};
......
......@@ -22,9 +22,6 @@ void rtl92e_set_bandwidth(struct net_device *dev,
}
for (eRFPath = 0; eRFPath < priv->num_total_rf_path; eRFPath++) {
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
continue;
switch (bandwidth) {
case HT_CHANNEL_WIDTH_20:
rtl92e_set_rf_reg(dev, (enum rf90_radio_path)eRFPath,
......@@ -67,19 +64,14 @@ bool rtl92e_config_rf(struct net_device *dev)
for (eRFPath = (enum rf90_radio_path)RF90_PATH_A;
eRFPath < priv->num_total_rf_path; eRFPath++) {
if (!rtl92e_is_legal_rf_path(dev, eRFPath))
continue;
pPhyReg = &priv->phy_reg_def[eRFPath];
switch (eRFPath) {
case RF90_PATH_A:
case RF90_PATH_C:
u4RegValue = rtl92e_get_bb_reg(dev, pPhyReg->rfintfs,
bRFSI_RFENV);
break;
case RF90_PATH_B:
case RF90_PATH_D:
u4RegValue = rtl92e_get_bb_reg(dev, pPhyReg->rfintfs,
bRFSI_RFENV<<16);
break;
......@@ -120,12 +112,10 @@ bool rtl92e_config_rf(struct net_device *dev)
switch (eRFPath) {
case RF90_PATH_A:
case RF90_PATH_C:
rtl92e_set_bb_reg(dev, pPhyReg->rfintfs, bRFSI_RFENV,
u4RegValue);
break;
case RF90_PATH_B:
case RF90_PATH_D:
rtl92e_set_bb_reg(dev, pPhyReg->rfintfs,
bRFSI_RFENV<<16, u4RegValue);
break;
......
......@@ -343,18 +343,11 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
else
priv->tx_pwr_data_read_from_eeprom = false;
priv->rf_type = RTL819X_DEFAULT_RF_TYPE;
if (priv->card_8192_version > VERSION_8190_BD) {
if (!priv->autoload_fail_flag) {
tempval = (rtl92e_eeprom_read(dev,
(EEPROM_RFInd_PowerDiff >> 1))) & 0xff;
priv->eeprom_legacy_ht_tx_pwr_diff = tempval & 0xf;
if (tempval&0x80)
priv->rf_type = RF_1T2R;
else
priv->rf_type = RF_2T4R;
} else {
priv->eeprom_legacy_ht_tx_pwr_diff = 0x04;
}
......@@ -433,26 +426,12 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
rtl92e_init_adaptive_rate(dev);
priv->rf_chip = RF_8256;
if (priv->reg_chnl_plan == 0xf)
priv->chnl_plan = priv->eeprom_chnl_plan;
else
priv->chnl_plan = priv->reg_chnl_plan;
if (priv->eeprom_vid == 0x1186 && priv->eeprom_did == 0x3304)
priv->customer_id = RT_CID_DLINK;
switch (priv->eeprom_customer_id) {
case EEPROM_CID_DEFAULT:
priv->customer_id = RT_CID_DEFAULT;
break;
case EEPROM_CID_CAMEO:
priv->customer_id = RT_CID_819x_CAMEO;
break;
case EEPROM_CID_RUNTOP:
priv->customer_id = RT_CID_819x_RUNTOP;
break;
case EEPROM_CID_NetCore:
priv->customer_id = RT_CID_819X_NETCORE;
break;
......@@ -463,20 +442,6 @@ static void _rtl92e_read_eeprom_info(struct net_device *dev)
else
priv->chnl_plan = 0x0;
break;
case EEPROM_CID_Nettronix:
priv->customer_id = RT_CID_Nettronix;
break;
case EEPROM_CID_Pronet:
priv->customer_id = RT_CID_PRONET;
break;
case EEPROM_CID_DLINK:
priv->customer_id = RT_CID_DLINK;
break;
case EEPROM_CID_WHQL:
break;
default:
break;
}
if (priv->chnl_plan > CHANNEL_PLAN_LEN - 1)
......@@ -512,16 +477,6 @@ static void _rtl92e_hwconfig(struct net_device *dev)
regRATR = RATE_ALL_CCK;
regRRSR = RATE_ALL_CCK;
break;
case WIRELESS_MODE_A:
regBwOpMode = BW_OPMODE_5G | BW_OPMODE_20MHZ;
regRATR = RATE_ALL_OFDM_AG;
regRRSR = RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_G:
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_AUTO:
case WIRELESS_MODE_N_24G:
regBwOpMode = BW_OPMODE_20MHZ;
......@@ -529,12 +484,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)
RATE_ALL_OFDM_1SS | RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_N_5G:
regBwOpMode = BW_OPMODE_5G;
regRATR = RATE_ALL_OFDM_AG | RATE_ALL_OFDM_1SS |
RATE_ALL_OFDM_2SS;
regRRSR = RATE_ALL_OFDM_AG;
break;
case WIRELESS_MODE_G:
default:
regBwOpMode = BW_OPMODE_20MHZ;
regRATR = RATE_ALL_CCK | RATE_ALL_OFDM_AG;
......@@ -547,8 +497,7 @@ static void _rtl92e_hwconfig(struct net_device *dev)
u32 ratr_value;
ratr_value = regRATR;
if (priv->rf_type == RF_1T2R)
ratr_value &= ~(RATE_ALL_OFDM_2SS);
ratr_value &= ~(RATE_ALL_OFDM_2SS);
rtl92e_writel(dev, RATR0, ratr_value);
rtl92e_writeb(dev, UFWP, 1);
}
......@@ -701,7 +650,7 @@ bool rtl92e_start_adapter(struct net_device *dev)
}
if (priv->rst_progress == RESET_TYPE_NORESET) {
rtStatus = rtl92e_config_phy(dev);
rtStatus = rtl92e_config_rf(dev);
if (!rtStatus) {
netdev_info(dev, "RF Config failed\n");
return rtStatus;
......@@ -806,7 +755,7 @@ void rtl92e_link_change(struct net_device *dev)
if (ieee->state == RTLLIB_LINKED) {
_rtl92e_net_update(dev);
priv->ops->update_ratr_table(dev);
rtl92e_update_ratr_table(dev);
if ((ieee->pairwise_key_type == KEY_TYPE_WEP40) ||
(ieee->pairwise_key_type == KEY_TYPE_WEP104))
rtl92e_enable_hw_security_config(dev);
......@@ -1515,9 +1464,7 @@ static void _rtl92e_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
return;
if (!prev_st->bIsCCK && prev_st->bPacketToSelf) {
for (rfpath = RF90_PATH_A; rfpath < RF90_PATH_C; rfpath++) {
if (!rtl92e_is_legal_rf_path(priv->rtllib->dev, rfpath))
continue;
for (rfpath = RF90_PATH_A; rfpath < priv->num_total_rf_path; rfpath++) {
if (priv->stats.rx_rssi_percentage[rfpath] == 0) {
priv->stats.rx_rssi_percentage[rfpath] =
prev_st->RxMIMOSignalStrength[rfpath];
......@@ -1895,14 +1842,10 @@ void rtl92e_update_ratr_table(struct net_device *dev)
break;
case IEEE_N_24G:
case IEEE_N_5G:
if (ieee->ht_info->peer_mimo_ps == 0) {
if (ieee->ht_info->peer_mimo_ps == 0)
ratr_value &= 0x0007F007;
} else {
if (priv->rf_type == RF_1T2R)
ratr_value &= 0x000FF007;
else
ratr_value &= 0x0F81F007;
}
else
ratr_value &= 0x000FF007;
break;
default:
break;
......@@ -1970,15 +1913,6 @@ void rtl92e_disable_irq(struct net_device *dev)
priv->irq_enabled = 0;
}
void rtl92e_clear_irq(struct net_device *dev)
{
u32 tmp;
tmp = rtl92e_readl(dev, ISR);
rtl92e_writel(dev, ISR, tmp);
}
void rtl92e_enable_rx(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
......
......@@ -18,7 +18,6 @@ void rtl92e_enable_rx(struct net_device *dev);
void rtl92e_enable_tx(struct net_device *dev);
void rtl92e_enable_irq(struct net_device *dev);
void rtl92e_disable_irq(struct net_device *dev);
void rtl92e_clear_irq(struct net_device *dev);
void rtl92e_init_variables(struct net_device *dev);
void rtl92e_start_beacon(struct net_device *dev);
void rtl92e_set_reg(struct net_device *dev, u8 variable, u8 *val);
......
......@@ -6,7 +6,7 @@
*/
#include "rtl_core.h"
#include "r8192E_hw.h"
#include "r8192E_hwimg.h"
#include "table.h"
#include "r8192E_firmware.h"
#include "r8192E_cmdpkt.h"
#include <linux/firmware.h>
......
......@@ -30,15 +30,8 @@ enum baseband_config {
#define EEPROM_TxPwIndex_CCK 0x2C
#define EEPROM_TxPwIndex_OFDM_24G 0x3A
#define EEPROM_CID_DEFAULT 0x0
#define EEPROM_CID_CAMEO 0x1
#define EEPROM_CID_RUNTOP 0x2
#define EEPROM_CID_TOSHIBA 0x4
#define EEPROM_CID_NetCore 0x5
#define EEPROM_CID_Nettronix 0x6
#define EEPROM_CID_Pronet 0x7
#define EEPROM_CID_DLINK 0x8
#define EEPROM_CID_WHQL 0xFE
enum _RTL8192PCI_HW {
MAC0 = 0x000,
MAC4 = 0x004,
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
*
* Contact Information: wlanfae <wlanfae@realtek.com>
*/
#ifndef __INC_HAL8192PciE_FW_IMG_H
#define __INC_HAL8192PciE_FW_IMG_H
/*Created on 2008/11/18, 3: 7*/
#include <linux/types.h>
#define PHY_REGArrayLengthPciE 1
extern u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE];
#define PHY_REG_1T2RArrayLengthPciE 296
extern u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE];
#define RadioA_ArrayLengthPciE 246
extern u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE];
#define RadioB_ArrayLengthPciE 78
extern u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE];
#define RadioC_ArrayLengthPciE 2
extern u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE];
#define RadioD_ArrayLengthPciE 2
extern u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE];
#define MACPHY_ArrayLengthPciE 18
extern u32 Rtl8192PciEMACPHY_Array[MACPHY_ArrayLengthPciE];
#define MACPHY_Array_PGLengthPciE 30
extern u32 Rtl8192PciEMACPHY_Array_PG[MACPHY_Array_PGLengthPciE];
#define AGCTAB_ArrayLengthPciE 384
extern u32 Rtl8192PciEAGCTAB_Array[AGCTAB_ArrayLengthPciE];
#endif
......@@ -9,28 +9,6 @@
#define MAX_DOZE_WAITING_TIMES_9x 64
#define AGCTAB_ArrayLength AGCTAB_ArrayLengthPciE
#define MACPHY_ArrayLength MACPHY_ArrayLengthPciE
#define RadioA_ArrayLength RadioA_ArrayLengthPciE
#define RadioB_ArrayLength RadioB_ArrayLengthPciE
#define MACPHY_Array_PGLength MACPHY_Array_PGLengthPciE
#define RadioC_ArrayLength RadioC_ArrayLengthPciE
#define RadioD_ArrayLength RadioD_ArrayLengthPciE
#define PHY_REGArrayLength PHY_REGArrayLengthPciE
#define PHY_REG_1T2RArrayLength PHY_REG_1T2RArrayLengthPciE
#define Rtl819XMACPHY_Array_PG Rtl8192PciEMACPHY_Array_PG
#define Rtl819XMACPHY_Array Rtl8192PciEMACPHY_Array
#define Rtl819XRadioA_Array Rtl8192PciERadioA_Array
#define Rtl819XRadioB_Array Rtl8192PciERadioB_Array
#define Rtl819XRadioC_Array Rtl8192PciERadioC_Array
#define Rtl819XRadioD_Array Rtl8192PciERadioD_Array
#define Rtl819XAGCTAB_Array Rtl8192PciEAGCTAB_Array
#define Rtl819XPHY_REGArray Rtl8192PciEPHY_REGArray
#define Rtl819XPHY_REG_1T2RArray Rtl8192PciEPHY_REG_1T2RArray
extern u32 rtl819XAGCTAB_Array[];
enum hw90_block {
HW90_BLOCK_MAC = 0,
HW90_BLOCK_PHY0 = 1,
......@@ -47,15 +25,6 @@ enum rf90_radio_path {
RF90_PATH_MAX
};
#define bMaskByte0 0xff
#define bMaskByte1 0xff00
#define bMaskByte2 0xff0000
#define bMaskByte3 0xff000000
#define bMaskHWord 0xffff0000
#define bMaskLWord 0x0000ffff
#define bMaskDWord 0xffffffff
u8 rtl92e_is_legal_rf_path(struct net_device *dev, u32 eRFPath);
void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr,
u32 dwBitMask, u32 dwData);
u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask);
......@@ -70,7 +39,6 @@ bool rtl92e_check_bb_and_rf(struct net_device *dev,
bool rtl92e_config_bb(struct net_device *dev);
void rtl92e_get_tx_power(struct net_device *dev);
void rtl92e_set_tx_power(struct net_device *dev, u8 channel);
bool rtl92e_config_phy(struct net_device *dev);
u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath);
u8 rtl92e_set_channel(struct net_device *dev, u8 channel);
......
......@@ -48,41 +48,22 @@
#define rFPGA0_TxGainStage 0x80c
#define rFPGA0_RFTiming1 0x810
#define rFPGA0_RFTiming2 0x814
#define rFPGA0_XA_HSSIParameter1 0x820
#define rFPGA0_XA_HSSIParameter2 0x824
#define rFPGA0_XB_HSSIParameter1 0x828
#define rFPGA0_XB_HSSIParameter2 0x82c
#define rFPGA0_XC_HSSIParameter1 0x830
#define rFPGA0_XC_HSSIParameter2 0x834
#define rFPGA0_XD_HSSIParameter1 0x838
#define rFPGA0_XD_HSSIParameter2 0x83c
#define rFPGA0_XA_LSSIParameter 0x840
#define rFPGA0_XB_LSSIParameter 0x844
#define rFPGA0_XC_LSSIParameter 0x848
#define rFPGA0_XD_LSSIParameter 0x84c
#define rFPGA0_RFWakeUpParameter 0x850
#define rFPGA0_RFSleepUpParameter 0x854
#define rFPGA0_XAB_SwitchControl 0x858
#define rFPGA0_XCD_SwitchControl 0x85c
#define rFPGA0_XA_RFInterfaceOE 0x860
#define rFPGA0_XB_RFInterfaceOE 0x864
#define rFPGA0_XC_RFInterfaceOE 0x868
#define rFPGA0_XD_RFInterfaceOE 0x86c
#define rFPGA0_XAB_RFInterfaceSW 0x870
#define rFPGA0_XCD_RFInterfaceSW 0x874
#define rFPGA0_XAB_RFParameter 0x878
#define rFPGA0_XCD_RFParameter 0x87c
#define rFPGA0_AnalogParameter1 0x880
#define rFPGA0_AnalogParameter2 0x884
#define rFPGA0_AnalogParameter3 0x888
#define rFPGA0_AnalogParameter4 0x88c
#define rFPGA0_XA_LSSIReadBack 0x8a0
#define rFPGA0_XB_LSSIReadBack 0x8a4
#define rFPGA0_XC_LSSIReadBack 0x8a8
#define rFPGA0_XD_LSSIReadBack 0x8ac
#define rFPGA0_PSDReport 0x8b4
#define rFPGA0_XAB_RFInterfaceRB 0x8e0
#define rFPGA0_XCD_RFInterfaceRB 0x8e4
/* Page 9 - RF mode & OFDM TxSC */
#define rFPGA1_RFMOD 0x900
......@@ -113,15 +94,6 @@
#define rOFDM0_TRxPathEnable 0xc04
#define rOFDM0_TRMuxPar 0xc08
#define rOFDM0_TRSWIsolation 0xc0c
/* RxIQ DC offset, Rx digital filter, DC notch filter */
#define rOFDM0_XARxAFE 0xc10
#define rOFDM0_XARxIQImbalance 0xc14 /* RxIQ imbalance matrix */
#define rOFDM0_XBRxAFE 0xc18
#define rOFDM0_XBRxIQImbalance 0xc1c
#define rOFDM0_XCRxAFE 0xc20
#define rOFDM0_XCRxIQImbalance 0xc24
#define rOFDM0_XDRxAFE 0xc28
#define rOFDM0_XDRxIQImbalance 0xc2c
#define rOFDM0_RxDetector1 0xc30 /* PD, BW & SBD */
#define rOFDM0_RxDetector2 0xc34 /* SBD */
#define rOFDM0_RxDetector3 0xc38 /* Frame Sync */
......@@ -132,25 +104,16 @@
#define rOFDM0_CCADropThreshold 0xc48
#define rOFDM0_ECCAThreshold 0xc4c /* Energy CCA */
#define rOFDM0_XAAGCCore1 0xc50
#define rOFDM0_XAAGCCore2 0xc54
#define rOFDM0_XBAGCCore1 0xc58
#define rOFDM0_XBAGCCore2 0xc5c
#define rOFDM0_XCAGCCore1 0xc60
#define rOFDM0_XCAGCCore2 0xc64
#define rOFDM0_XDAGCCore1 0xc68
#define rOFDM0_XDAGCCore2 0xc6c
#define rOFDM0_AGCParameter1 0xc70
#define rOFDM0_AGCParameter2 0xc74
#define rOFDM0_AGCRSSITable 0xc78
#define rOFDM0_HTSTFAGC 0xc7c
#define rOFDM0_XATxIQImbalance 0xc80
#define rOFDM0_XATxAFE 0xc84
#define rOFDM0_XBTxIQImbalance 0xc88
#define rOFDM0_XBTxAFE 0xc8c
#define rOFDM0_XCTxIQImbalance 0xc90
#define rOFDM0_XCTxAFE 0xc94
#define rOFDM0_XDTxIQImbalance 0xc98
#define rOFDM0_XDTxAFE 0xc9c
#define rOFDM0_RxHPParameter 0xce0
#define rOFDM0_TxPseudoNoiseWgt 0xce4
#define rOFDM0_FrameSync 0xcf0
......
......@@ -52,22 +52,12 @@
#define DRV_AUTHOR "<wlanfae@realtek.com>"
#define DRV_VERSION "0014.0401.2010"
#define IS_HARDWARE_TYPE_8192SE(_priv) \
(((struct r8192_priv *)rtllib_priv(dev))->card_8192 == NIC_8192SE)
#define RTL_PCI_DEVICE(vend, dev, cfg) \
.vendor = (vend), .device = (dev), \
.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, \
.driver_data = (kernel_ulong_t)&(cfg)
#define TOTAL_CAM_ENTRY 32
#define CAM_CONTENT_COUNT 8
#define HAL_HW_PCI_REVISION_ID_8192PCIE 0x01
#define HAL_HW_PCI_REVISION_ID_8192SE 0x10
#define RTL819X_DEFAULT_RF_TYPE RF_1T2R
#define RTLLIB_WATCH_DOG_TIME 2000
#define MAX_DEV_ADDR_SIZE 8 /*support till 64 bit bus width OS*/
......@@ -134,24 +124,10 @@ enum dcmg_txcmd_op {
TXCMD_XXXX_CTRL,
};
enum rt_rf_type_819xu {
RF_TYPE_MIN = 0,
RF_8225,
RF_8256,
RF_8258,
RF_6052 = 4,
RF_PSEUDO_11N = 5,
};
enum rt_customer_id {
RT_CID_DEFAULT = 0,
RT_CID_819x_CAMEO = 6,
RT_CID_819x_RUNTOP = 7,
RT_CID_TOSHIBA = 9,
RT_CID_819X_NETCORE = 10,
RT_CID_Nettronix = 11,
RT_CID_DLINK = 12,
RT_CID_PRONET = 13,
};
enum reset_type {
......@@ -203,41 +179,6 @@ struct rtl8192_tx_ring {
struct sk_buff_head queue;
};
struct rtl819x_ops {
enum nic_t nic_type;
void (*get_eeprom_size)(struct net_device *dev);
void (*init_adapter_variable)(struct net_device *dev);
void (*init_before_adapter_start)(struct net_device *dev);
bool (*initialize_adapter)(struct net_device *dev);
void (*link_change)(struct net_device *dev);
void (*tx_fill_descriptor)(struct net_device *dev,
struct tx_desc *tx_desc,
struct cb_desc *cb_desc,
struct sk_buff *skb);
void (*tx_fill_cmd_descriptor)(struct net_device *dev,
struct tx_desc_cmd *entry,
struct cb_desc *cb_desc,
struct sk_buff *skb);
bool (*rx_query_status_descriptor)(struct net_device *dev,
struct rtllib_rx_stats *stats,
struct rx_desc *pdesc,
struct sk_buff *skb);
bool (*rx_command_packet_handler)(struct net_device *dev,
struct sk_buff *skb,
struct rx_desc *pdesc);
void (*stop_adapter)(struct net_device *dev, bool reset);
void (*update_ratr_table)(struct net_device *dev);
void (*irq_enable)(struct net_device *dev);
void (*irq_disable)(struct net_device *dev);
void (*irq_clear)(struct net_device *dev);
void (*rx_enable)(struct net_device *dev);
void (*tx_enable)(struct net_device *dev);
void (*interrupt_recognized)(struct net_device *dev,
u32 *p_inta, u32 *p_intb);
bool (*tx_check_stuck_handler)(struct net_device *dev);
bool (*rx_check_stuck_handler)(struct net_device *dev);
};
struct r8192_priv {
struct pci_dev *pdev;
struct pci_dev *bridge_pdev;
......@@ -255,14 +196,12 @@ struct r8192_priv {
struct delayed_work txpower_tracking_wq;
struct delayed_work rfpath_check_wq;
struct delayed_work gpio_change_rf_wq;
struct rtl819x_ops *ops;
struct rtllib_device *rtllib;
struct work_struct reset_wq;
enum rt_customer_id customer_id;
enum rt_rf_type_819xu rf_chip;
enum ht_channel_width current_chnl_bw;
struct bb_reg_definition phy_reg_def[4];
struct rate_adaptive rate_adaptive;
......@@ -342,7 +281,6 @@ struct r8192_priv {
enum nic_t card_8192;
u8 card_8192_version;
u8 rf_type;
u8 ic_cut;
char nick[IW_ESSID_MAX_SIZE + 1];
u8 check_roaming_cnt;
......@@ -419,7 +357,6 @@ struct r8192_priv {
u8 rfa_txpowertrackingindex_real;
u8 rfa_txpowertracking_default;
u8 rfc_txpowertrackingindex;
u8 rfc_txpowertrackingindex_real;
bool btxpower_tracking;
bool bcck_in_ch14;
......@@ -438,14 +375,11 @@ struct r8192_priv {
bool bcurrent_turbo_EDCA;
bool bis_cur_rdlstate;
bool bfsync_processing;
u32 rate_record;
u32 rate_count_diff_rec;
u32 continue_diff_count;
bool bswitch_fsync;
u8 framesync;
u8 frame_sync_monitor;
u32 reset_count;
enum reset_type rst_progress;
......@@ -454,8 +388,6 @@ struct r8192_priv {
bool reset_in_progress;
bool force_reset;
bool force_lps;
bool chan_forced;
};
extern const struct ethtool_ops rtl819x_ethtool_ops;
......@@ -495,7 +427,6 @@ u8 rtl92e_rx_db_to_percent(s8 antpower);
void rtl92e_copy_mpdu_stats(struct rtllib_rx_stats *psrc_stats,
struct rtllib_rx_stats *ptarget_stats);
bool rtl92e_enable_nic(struct net_device *dev);
bool rtl92e_disable_nic(struct net_device *dev);
bool rtl92e_set_rf_state(struct net_device *dev,
enum rt_rf_power_state state_to_set,
......
This diff is collapsed.
......@@ -39,7 +39,7 @@ bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
revision_id = pdev->revision;
pci_read_config_word(pdev, 0x3C, &irq_line);
priv->card_8192 = priv->ops->nic_type;
priv->card_8192 = NIC_8192E;
if (device_id == 0x8192) {
switch (revision_id) {
......@@ -64,10 +64,10 @@ bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
}
}
if (priv->ops->nic_type != priv->card_8192) {
if (priv->card_8192 != NIC_8192E) {
dev_info(&pdev->dev,
"Detect info(%x) and hardware info(%x) not match!\n",
priv->ops->nic_type, priv->card_8192);
NIC_8192E, priv->card_8192);
dev_info(&pdev->dev,
"Please select proper driver before install!!!!\n");
return false;
......
......@@ -142,8 +142,7 @@ void rtl92e_ips_leave(struct net_device *dev)
void rtl92e_ips_leave_wq(void *data)
{
struct rtllib_device *ieee = container_of_work_rsl(data,
struct rtllib_device, ips_leave_wq);
struct rtllib_device *ieee = container_of(data, struct rtllib_device, ips_leave_wq);
struct net_device *dev = ieee->dev;
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
......
......@@ -432,15 +432,11 @@ static int _rtl92e_wx_set_scan(struct net_device *dev,
if (priv->rtllib->rf_power_state != rf_off) {
priv->rtllib->actscanning = true;
if (ieee->ScanOperationBackupHandler)
ieee->ScanOperationBackupHandler(ieee->dev,
SCAN_OPT_BACKUP);
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
rtllib_start_scan_syncro(priv->rtllib, 0);
if (ieee->ScanOperationBackupHandler)
ieee->ScanOperationBackupHandler(ieee->dev,
SCAN_OPT_RESTORE);
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
}
ret = 0;
} else {
......
......@@ -4,11 +4,9 @@
*
* Contact Information: wlanfae <wlanfae@realtek.com>
*/
#include "r8192E_hwimg.h"
#include "table.h"
u32 Rtl8192PciEPHY_REGArray[PHY_REGArrayLengthPciE] = {0x0,};
u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE] = {
u32 RTL8192E_PHY_REG_1T2R_ARR[RTL8192E_PHY_REG_1T2R_ARR_LEN] = {
0x800, 0x00000000,
0x804, 0x00000001,
0x808, 0x0000fc00,
......@@ -159,7 +157,7 @@ u32 Rtl8192PciEPHY_REG_1T2RArray[PHY_REG_1T2RArrayLengthPciE] = {
0xe1c, 0x12121416,
};
u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE] = {
u32 RTL8192E_RADIO_A_ARR[RTL8192E_RADIO_A_ARR_LEN] = {
0x019, 0x00000003,
0x000, 0x000000bf,
0x001, 0x00000ee0,
......@@ -285,7 +283,7 @@ u32 Rtl8192PciERadioA_Array[RadioA_ArrayLengthPciE] = {
0x007, 0x00000700,
};
u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
u32 RTL8192E_RADIO_B_ARR[RTL8192E_RADIO_B_ARR_LEN] = {
0x019, 0x00000003,
0x000, 0x000000bf,
0x001, 0x000006e0,
......@@ -327,13 +325,7 @@ u32 Rtl8192PciERadioB_Array[RadioB_ArrayLengthPciE] = {
0x007, 0x00000700,
};
u32 Rtl8192PciERadioC_Array[RadioC_ArrayLengthPciE] = {
0x0, };
u32 Rtl8192PciERadioD_Array[RadioD_ArrayLengthPciE] = {
0x0, };
u32 Rtl8192PciEMACPHY_Array[] = {
u32 RTL8192E_MACPHY_ARR[] = {
0x03c, 0xffff0000, 0x00000f0f,
0x340, 0xffffffff, 0x161a1a1a,
0x344, 0xffffffff, 0x12121416,
......@@ -342,7 +334,7 @@ u32 Rtl8192PciEMACPHY_Array[] = {
0x318, 0x00000fff, 0x00000100,
};
u32 Rtl8192PciEMACPHY_Array_PG[] = {
u32 RTL8192E_MACPHY_ARR_PG[] = {
0x03c, 0xffff0000, 0x00000f0f,
0xe00, 0xffffffff, 0x06090909,
0xe04, 0xffffffff, 0x00030306,
......@@ -355,7 +347,7 @@ u32 Rtl8192PciEMACPHY_Array_PG[] = {
0x318, 0x00000fff, 0x00000800,
};
u32 Rtl8192PciEAGCTAB_Array[AGCTAB_ArrayLengthPciE] = {
u32 RTL8192E_AGCTAB_ARR[RTL8192E_AGCTAB_ARR_LEN] = {
0xc78, 0x7d000001,
0xc78, 0x7d010001,
0xc78, 0x7d020001,
......
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
*
* Contact Information: wlanfae <wlanfae@realtek.com>
*/
#ifndef __INC_HAL8192PciE_FW_IMG_H
#define __INC_HAL8192PciE_FW_IMG_H
/*Created on 2008/11/18, 3: 7*/
#include <linux/types.h>
#define RTL8192E_PHY_REG_1T2R_ARR_LEN 296
extern u32 RTL8192E_PHY_REG_1T2R_ARR[RTL8192E_PHY_REG_1T2R_ARR_LEN];
#define RTL8192E_RADIO_A_ARR_LEN 246
extern u32 RTL8192E_RADIO_A_ARR[RTL8192E_RADIO_A_ARR_LEN];
#define RTL8192E_RADIO_B_ARR_LEN 78
extern u32 RTL8192E_RADIO_B_ARR[RTL8192E_RADIO_B_ARR_LEN];
#define RTL8192E_MACPHY_ARR_LEN 18
extern u32 RTL8192E_MACPHY_ARR[RTL8192E_MACPHY_ARR_LEN];
#define RTL8192E_MACPHY_ARR_PG_LEN 30
extern u32 RTL8192E_MACPHY_ARR_PG[RTL8192E_MACPHY_ARR_PG_LEN];
#define RTL8192E_AGCTAB_ARR_LEN 384
extern u32 RTL8192E_AGCTAB_ARR[RTL8192E_AGCTAB_ARR_LEN];
#endif
......@@ -162,9 +162,6 @@ struct rt_hi_throughput {
u8 IOTPeer;
u32 iot_action;
u8 iot_ra_func;
u8 bWAIotBroadcom;
u8 WAIotTH;
} __packed;
struct bss_ht {
......
......@@ -517,6 +517,7 @@ void TsStartAddBaProcess(struct rtllib_device *ieee, struct tx_ts_record *pTxTS)
netdev_dbg(ieee->dev, "Immediately Start ADDBA\n");
mod_timer(&pTxTS->TsAddBaTimer, jiffies + 10);
}
} else
} else {
netdev_dbg(ieee->dev, "BA timer is already added\n");
}
}
......@@ -62,24 +62,9 @@
#define IW_CUSTOM_MAX 256 /* In bytes */
#endif
#define skb_tail_pointer_rsl(skb) skb_tail_pointer(skb)
#define queue_delayed_work_rsl(x, y, z) queue_delayed_work(x, y, z)
#define INIT_DELAYED_WORK_RSL(x, y, z) INIT_DELAYED_WORK(x, y)
#define queue_work_rsl(x, y) queue_work(x, y)
#define INIT_WORK_RSL(x, y, z) INIT_WORK(x, y)
#define container_of_work_rsl(x, y, z) container_of(x, y, z)
#define container_of_dwork_rsl(x, y, z) \
container_of(to_delayed_work(x), y, z)
#define iwe_stream_add_event_rsl(info, start, stop, iwe, len) \
iwe_stream_add_event(info, start, stop, iwe, len)
#define iwe_stream_add_point_rsl(info, start, stop, iwe, p) \
iwe_stream_add_point(info, start, stop, iwe, p)
static inline void *netdev_priv_rsl(struct net_device *dev)
{
return netdev_priv(dev);
......@@ -115,7 +100,6 @@ static inline void *netdev_priv_rsl(struct net_device *dev)
((psc->CurPsLevel & _PS_FLAG) ? true : false)
#define RT_CLEAR_PS_LEVEL(psc, _PS_FLAG) \
(psc->CurPsLevel &= (~(_PS_FLAG)))
#define RT_SET_PS_LEVEL(psc, _PS_FLAG) (psc->CurPsLevel |= _PS_FLAG)
/* defined for skb cb field */
/* At most 28 byte */
......@@ -323,7 +307,6 @@ enum rt_op_mode {
RT_OP_MODE_NO_LINK,
};
#define aSifsTime \
(((priv->rtllib->current_network.mode == IEEE_A) \
|| (priv->rtllib->current_network.mode == IEEE_N_24G) \
......@@ -449,11 +432,6 @@ enum led_ctl_mode {
LED_CTL_START_TO_LINK = 8,
};
enum rt_rf_type_def {
RF_1T2R = 0,
RF_2T4R,
};
enum wireless_mode {
WIRELESS_MODE_UNKNOWN = 0x00,
WIRELESS_MODE_A = 0x01,
......@@ -669,7 +647,6 @@ struct rtllib_security {
u16 flags;
} __packed;
/* 802.11 data frame from AP
* ,-------------------------------------------------------------------.
* Bytes | 2 | 2 | 6 | 6 | 6 | 2 | 0..2312 | 4 |
......@@ -989,6 +966,7 @@ static inline const char *eap_get_type(int type)
return ((u32)type >= ARRAY_SIZE(eap_types)) ? "Unknown" :
eap_types[type];
}
static inline u8 Frame_QoSTID(u8 *buf)
{
struct rtllib_hdr_3addr *hdr;
......@@ -1000,7 +978,6 @@ static inline u8 Frame_QoSTID(u8 *buf)
(fc & RTLLIB_FCTL_FROMDS)) ? 30 : 24)))->field.tid;
}
struct eapol {
u8 snap[6];
u16 ethertype;
......@@ -1215,8 +1192,6 @@ struct bandwidth_autoswitch {
bool bautoswitch_enable;
};
#define REORDER_WIN_SIZE 128
#define REORDER_ENTRY_NUM 128
struct rx_reorder_entry {
......@@ -1224,6 +1199,7 @@ struct rx_reorder_entry {
u16 SeqNum;
struct rtllib_rxb *prxb;
};
enum fsync_state {
Default_Fsync,
HW_Fsync,
......@@ -1260,7 +1236,6 @@ struct rt_pwr_save_ctrl {
u8 LPSAwakeIntvl;
u32 CurPsLevel;
u32 RegRfPsLevel;
};
#define RT_RF_CHANGE_SOURCE u32
......@@ -1350,6 +1325,7 @@ struct sw_cam_table {
u8 key_index;
};
#define TOTAL_CAM_ENTRY 32
struct rate_adaptive {
u8 rate_adaptive_disabled;
......@@ -1388,7 +1364,6 @@ struct rt_intel_promisc_mode {
bool fltr_src_sta_frame;
};
/*************** DRIVER STATUS *****/
#define STATUS_SCANNING 0
/*************** DRIVER STATUS *****/
......@@ -1416,7 +1391,6 @@ struct rtllib_device {
size_t assocreq_ies_len, assocresp_ies_len;
bool bForcedBgMode;
u8 RF_Type;
u8 hwsec_active;
bool is_silent_reset;
......@@ -1457,7 +1431,6 @@ struct rtllib_device {
struct rx_reorder_entry RxReorderEntry[128];
struct list_head RxReorder_Unused_List;
/* Bookkeeping structures */
struct net_device_stats stats;
struct rtllib_softmac_stats softmac_stats;
......@@ -1754,7 +1727,6 @@ struct rtllib_device {
struct rtllib_assoc_response_frame *resp,
struct rtllib_network *network);
/* check whether Tx hw resource available */
short (*check_nic_enough_desc)(struct net_device *dev, int queue_index);
void (*SetBWModeHandler)(struct net_device *dev,
......@@ -1827,7 +1799,6 @@ struct rtllib_device {
*/
#define IEEE_SOFTMAC_BEACONS (1<<6)
static inline void *rtllib_priv(struct net_device *dev)
{
return ((struct rtllib_device *)netdev_priv(dev))->priv;
......@@ -1919,17 +1890,15 @@ static inline int rtllib_is_cck_rate(u8 rate)
return 0;
}
/* rtllib.c */
void free_rtllib(struct net_device *dev);
struct net_device *alloc_rtllib(int sizeof_priv);
/* rtllib_tx.c */
int rtllib_encrypt_fragment(
struct rtllib_device *ieee,
struct sk_buff *frag,
int hdr_len);
int rtllib_encrypt_fragment(struct rtllib_device *ieee,
struct sk_buff *frag,
int hdr_len);
netdev_tx_t rtllib_xmit(struct sk_buff *skb, struct net_device *dev);
void rtllib_txb_free(struct rtllib_txb *txb);
......@@ -2129,7 +2098,6 @@ static inline const char *escape_essid(const char *essid, u8 essid_len)
/* fun with the built-in rtllib stack... */
bool rtllib_MgntDisconnect(struct rtllib_device *rtllib, u8 asRsn);
/* For the function is more related to hardware setting, it's better to use the
* ieee handler to refer to it.
*/
......
......@@ -34,9 +34,9 @@ struct rtllib_ccmp_data {
u8 tx_pn[CCMP_PN_LEN];
u8 rx_pn[CCMP_PN_LEN];
u32 dot11RSNAStatsCCMPFormatErrors;
u32 dot11RSNAStatsCCMPReplays;
u32 dot11RSNAStatsCCMPDecryptErrors;
u32 dot11rsna_stats_ccmp_format_errors;
u32 dot11rsna_stats_ccmp_replays;
u32 dot11rsna_stats_ccmp_decrypt_errors;
int key_idx;
......@@ -74,7 +74,6 @@ static void *rtllib_ccmp_init(int key_idx)
return NULL;
}
static void rtllib_ccmp_deinit(void *priv)
{
struct rtllib_ccmp_data *_priv = priv;
......@@ -84,7 +83,6 @@ static void rtllib_ccmp_deinit(void *priv)
kfree(priv);
}
static int ccmp_init_iv_and_aad(struct rtllib_hdr_4addr *hdr,
u8 *pn, u8 *iv, u8 *aad)
{
......@@ -150,8 +148,6 @@ static int ccmp_init_iv_and_aad(struct rtllib_hdr_4addr *hdr,
return aad_len;
}
static int rtllib_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
struct rtllib_ccmp_data *key = priv;
......@@ -220,7 +216,6 @@ static int rtllib_ccmp_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
return 0;
}
static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
{
struct rtllib_ccmp_data *key = priv;
......@@ -231,7 +226,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
u8 pn[6];
if (skb->len < hdr_len + CCMP_HDR_LEN + CCMP_MIC_LEN) {
key->dot11RSNAStatsCCMPFormatErrors++;
key->dot11rsna_stats_ccmp_format_errors++;
return -1;
}
......@@ -243,7 +238,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pr_debug("CCMP: received packet without ExtIV flag from %pM\n",
hdr->addr2);
}
key->dot11RSNAStatsCCMPFormatErrors++;
key->dot11rsna_stats_ccmp_format_errors++;
return -2;
}
keyidx >>= 6;
......@@ -268,7 +263,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pn[5] = pos[0];
pos += 8;
if (memcmp(pn, key->rx_pn, CCMP_PN_LEN) <= 0) {
key->dot11RSNAStatsCCMPReplays++;
key->dot11rsna_stats_ccmp_replays++;
return -4;
}
if (!tcb_desc->bHwSec) {
......@@ -301,7 +296,7 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
pr_debug("CCMP: decrypt failed: STA= %pM\n",
hdr->addr2);
}
key->dot11RSNAStatsCCMPDecryptErrors++;
key->dot11rsna_stats_ccmp_decrypt_errors++;
return -5;
}
......@@ -315,7 +310,6 @@ static int rtllib_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
return keyidx;
}
static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
{
struct rtllib_ccmp_data *data = priv;
......@@ -338,7 +332,7 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
data->rx_pn[5] = seq[0];
}
if (crypto_aead_setauthsize(data->tfm, CCMP_MIC_LEN) ||
crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
crypto_aead_setkey(data->tfm, data->key, CCMP_TK_LEN))
return -1;
} else if (len == 0) {
data->key_set = 0;
......@@ -349,7 +343,6 @@ static int rtllib_ccmp_set_key(void *key, int len, u8 *seq, void *priv)
return 0;
}
static int rtllib_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
{
struct rtllib_ccmp_data *data = priv;
......@@ -373,7 +366,6 @@ static int rtllib_ccmp_get_key(void *key, int len, u8 *seq, void *priv)
return CCMP_TK_LEN;
}
static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
{
struct rtllib_ccmp_data *ccmp = priv;
......@@ -382,9 +374,9 @@ static void rtllib_ccmp_print_stats(struct seq_file *m, void *priv)
"key[%d] alg=CCMP key_set=%d tx_pn=%pM rx_pn=%pM format_errors=%d replays=%d decrypt_errors=%d\n",
ccmp->key_idx, ccmp->key_set,
ccmp->tx_pn, ccmp->rx_pn,
ccmp->dot11RSNAStatsCCMPFormatErrors,
ccmp->dot11RSNAStatsCCMPReplays,
ccmp->dot11RSNAStatsCCMPDecryptErrors);
ccmp->dot11rsna_stats_ccmp_format_errors,
ccmp->dot11rsna_stats_ccmp_replays,
ccmp->dot11rsna_stats_ccmp_decrypt_errors);
}
static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
......@@ -403,13 +395,11 @@ static struct lib80211_crypto_ops rtllib_crypt_ccmp = {
.owner = THIS_MODULE,
};
static int __init rtllib_crypto_ccmp_init(void)
{
return lib80211_register_crypto_ops(&rtllib_crypt_ccmp);
}
static void __exit rtllib_crypto_ccmp_exit(void)
{
lib80211_unregister_crypto_ops(&rtllib_crypt_ccmp);
......
......@@ -154,7 +154,6 @@ rtllib_frag_cache_get(struct rtllib_device *ieee,
return skb;
}
/* Called only as a tasklet (software IRQ) */
static int rtllib_frag_cache_invalidate(struct rtllib_device *ieee,
struct rtllib_hdr_4addr *hdr)
......@@ -232,10 +231,12 @@ rtllib_rx_frame_mgmt(struct rtllib_device *ieee, struct sk_buff *skb,
static unsigned char rfc1042_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static unsigned char bridge_tunnel_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
};
/* No encapsulation header if EtherType < 0x600 (=length) */
/* Called by rtllib_rx_frame_decrypt */
......@@ -318,7 +319,6 @@ rtllib_rx_frame_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
return res;
}
/* Called only as a tasklet (software IRQ), by rtllib_rx */
static inline int
rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
......@@ -355,9 +355,8 @@ rtllib_rx_frame_decrypt_msdu(struct rtllib_device *ieee, struct sk_buff *skb,
return 0;
}
/* this function is stolen from ipw2200 driver*/
#define IEEE_PACKET_RETRY_TIME (5*HZ)
#define IEEE_PACKET_RETRY_TIME (5 * HZ)
static int is_duplicate_packet(struct rtllib_device *ieee,
struct rtllib_hdr_4addr *header)
{
......@@ -887,7 +886,6 @@ static u8 parse_subframe(struct rtllib_device *ieee, struct sk_buff *skb,
return rxb->nr_subframes;
}
static size_t rtllib_rx_get_hdrlen(struct rtllib_device *ieee,
struct sk_buff *skb,
struct rtllib_rx_stats *rx_stats)
......@@ -938,7 +936,7 @@ static int rtllib_rx_check_duplicate(struct rtllib_device *ieee,
if (GetTs(ieee, (struct ts_common_info **)&pRxTS, hdr->addr2,
(u8)Frame_QoSTID((u8 *)(skb->data)), RX_DIR, true)) {
if ((fc & (1<<11)) && (frag == pRxTS->rx_last_frag_num) &&
if ((fc & (1 << 11)) && (frag == pRxTS->rx_last_frag_num) &&
(WLAN_GET_SEQ_SEQ(sc) == pRxTS->rx_last_seq_num))
return -1;
pRxTS->rx_last_frag_num = frag;
......@@ -1169,7 +1167,6 @@ static int rtllib_rx_decrypt(struct rtllib_device *ieee, struct sk_buff *skb,
if (crypt && !(fc & RTLLIB_FCTL_WEP) && !ieee->open_wep) {
if (/*ieee->ieee802_1x &&*/
rtllib_is_eapol_frame(ieee, skb, hdrlen)) {
/* pass unencrypted EAPOL frames even if encryption is
* configured
*/
......@@ -1209,13 +1206,11 @@ static void rtllib_rx_check_leave_lps(struct rtllib_device *ieee, u8 unicast,
u8 nr_subframes)
{
if (unicast) {
if (ieee->state == RTLLIB_LINKED) {
if (((ieee->link_detect_info.NumRxUnicastOkInPeriod +
ieee->link_detect_info.NumTxOkInPeriod) > 8) ||
(ieee->link_detect_info.NumRxUnicastOkInPeriod > 2)) {
if (ieee->LeisurePSLeave)
ieee->LeisurePSLeave(ieee->dev);
ieee->LeisurePSLeave(ieee->dev);
}
}
}
......@@ -1555,7 +1550,6 @@ static u8 qos_oui[QOS_OUI_LEN] = { 0x00, 0x50, 0xF2 };
static int rtllib_verify_qos_info(struct rtllib_qos_information_element
*info_element, int sub_type)
{
if (info_element->elementID != QOS_ELEMENT_ID)
return -1;
if (info_element->qui_subtype != sub_type)
......@@ -1570,7 +1564,6 @@ static int rtllib_verify_qos_info(struct rtllib_qos_information_element
return 0;
}
/* Parse a QoS parameter element */
static int rtllib_read_qos_param_element(
struct rtllib_qos_parameter_info *element_param,
......@@ -1600,7 +1593,6 @@ static int rtllib_read_qos_info_element(
return rtllib_verify_qos_info(element_info, QOS_OUI_INFO_SUB_TYPE);
}
/* Write QoS parameters from the ac parameters. */
static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info *param_elm,
struct rtllib_qos_data *qos_data)
......@@ -1624,23 +1616,23 @@ static int rtllib_qos_convert_ac_to_parameters(struct rtllib_qos_parameter_info
case 1:
/* BIT(0) | BIT(3) */
if (acm)
qos_data->wmm_acm |= (0x01<<0)|(0x01<<3);
qos_data->wmm_acm |= (0x01 << 0) | (0x01 << 3);
break;
case 2:
/* BIT(4) | BIT(5) */
if (acm)
qos_data->wmm_acm |= (0x01<<4)|(0x01<<5);
qos_data->wmm_acm |= (0x01 << 4) | (0x01 << 5);
break;
case 3:
/* BIT(6) | BIT(7) */
if (acm)
qos_data->wmm_acm |= (0x01<<6)|(0x01<<7);
qos_data->wmm_acm |= (0x01 << 6) | (0x01 << 7);
break;
case 0:
default:
/* BIT(1) | BIT(2) */
if (acm)
qos_data->wmm_acm |= (0x01<<1)|(0x01<<2);
qos_data->wmm_acm |= (0x01 << 1) | (0x01 << 2);
break;
}
......@@ -1844,7 +1836,6 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
}
}
if (*tmp_htinfo_len == 0) {
if (info_element->len >= 4 &&
info_element->data[0] == 0x00 &&
......@@ -1933,7 +1924,6 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
info_element->data[2] == 0x96)
network->cisco_cap_exist = true;
if (info_element->len >= 3 &&
info_element->data[0] == 0x00 &&
info_element->data[1] == 0x0a &&
......@@ -1986,7 +1976,7 @@ static void rtllib_parse_mife_generic(struct rtllib_device *ieee,
info_element->data[3] == 0x04) {
netdev_dbg(ieee->dev, "MFIE_TYPE_WZC: %d bytes\n",
info_element->len);
network->wzc_ie_len = min(info_element->len+2, MAX_WZC_IE_LEN);
network->wzc_ie_len = min(info_element->len + 2, MAX_WZC_IE_LEN);
memcpy(network->wzc_ie, info_element, network->wzc_ie_len);
}
}
......@@ -2143,15 +2133,13 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
network->dtim_data = RTLLIB_DTIM_VALID;
if (info_element->data[2] & 1)
network->dtim_data |= RTLLIB_DTIM_MBCAST;
offset = (info_element->data[2] >> 1)*2;
offset = (info_element->data[2] >> 1) * 2;
if (ieee->assoc_id < 8*offset ||
ieee->assoc_id > 8*(offset + info_element->len - 3))
if (ieee->assoc_id < 8 * offset ||
ieee->assoc_id > 8 * (offset + info_element->len - 3))
break;
offset = (ieee->assoc_id / 8) - offset;
......@@ -2204,7 +2192,6 @@ int rtllib_parse_info_param(struct rtllib_device *ieee,
&tmp_htcap_len);
break;
case MFIE_TYPE_HT_INFO:
netdev_dbg(ieee->dev, "MFIE_TYPE_HT_INFO: %d bytes\n",
info_element->len);
......@@ -2367,7 +2354,7 @@ static inline int rtllib_network_init(
if (rtllib_is_empty_essid(network->ssid, network->ssid_len))
network->flags |= NETWORK_EMPTY_ESSID;
stats->signal = 30 + (stats->SignalStrength * 70) / 100;
stats->noise = rtllib_translate_todbm((u8)(100-stats->signal)) - 25;
stats->noise = rtllib_translate_todbm((u8)(100 - stats->signal)) - 25;
memcpy(&network->stats, stats, sizeof(network->stats));
......@@ -2393,7 +2380,6 @@ static inline int is_same_network(struct rtllib_network *src,
(dst->capability & WLAN_CAPABILITY_ESS)));
}
static inline void update_network(struct rtllib_device *ieee,
struct rtllib_network *dst,
struct rtllib_network *src)
......@@ -2556,22 +2542,22 @@ static inline void rtllib_process_probe_response(
"'%s' ( %pM ): %c%c%c%c %c%c%c%c-%c%c%c%c %c%c%c%c\n",
escape_essid(info_element->data, info_element->len),
beacon->header.addr3,
(le16_to_cpu(beacon->capability) & (1<<0xf)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0xe)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0xd)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0xc)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0xb)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0xa)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x9)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x8)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x7)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x6)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x5)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x4)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x3)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x2)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x1)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1<<0x0)) ? '1' : '0');
(le16_to_cpu(beacon->capability) & (1 << 0xf)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0xe)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0xd)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0xc)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0xb)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0xa)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x9)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x8)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x7)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x6)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x5)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x4)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x3)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x2)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x1)) ? '1' : '0',
(le16_to_cpu(beacon->capability) & (1 << 0x0)) ? '1' : '0');
if (rtllib_network_init(ieee, beacon, network, stats)) {
netdev_dbg(ieee->dev, "Dropped '%s' ( %pM) via %s.\n",
......@@ -2581,7 +2567,6 @@ static inline void rtllib_process_probe_response(
goto free_network;
}
if (!rtllib_legal_channel(ieee, network->channel))
goto free_network;
......@@ -2689,9 +2674,7 @@ static inline void rtllib_process_probe_response(
is_same_network(&ieee->current_network, network,
(network->ssid_len ? 1 : 0)) &&
(ieee->state == RTLLIB_LINKED)) {
if (ieee->handle_beacon != NULL)
ieee->handle_beacon(ieee->dev, beacon,
&ieee->current_network);
ieee->handle_beacon(ieee->dev, beacon, &ieee->current_network);
}
free_network:
kfree(network);
......@@ -2710,7 +2693,6 @@ static void rtllib_rx_mgt(struct rtllib_device *ieee,
ieee->last_rx_ps_time = jiffies;
switch (WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl))) {
case RTLLIB_STYPE_BEACON:
netdev_dbg(ieee->dev, "received BEACON (%d)\n",
WLAN_FC_GET_STYPE(le16_to_cpu(header->frame_ctl)));
......
......@@ -659,8 +659,7 @@ static void rtllib_beacons_stop(struct rtllib_device *ieee)
void rtllib_stop_send_beacons(struct rtllib_device *ieee)
{
if (ieee->stop_send_beacons)
ieee->stop_send_beacons(ieee->dev);
ieee->stop_send_beacons(ieee->dev);
if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
rtllib_beacons_stop(ieee);
}
......@@ -669,8 +668,7 @@ EXPORT_SYMBOL(rtllib_stop_send_beacons);
void rtllib_start_send_beacons(struct rtllib_device *ieee)
{
if (ieee->start_send_beacons)
ieee->start_send_beacons(ieee->dev);
ieee->start_send_beacons(ieee->dev);
if (ieee->softmac_features & IEEE_SOFTMAC_BEACONS)
rtllib_beacons_start(ieee);
}
......@@ -729,8 +727,7 @@ EXPORT_SYMBOL(rtllib_act_scanning);
/* called with ieee->lock held */
static void rtllib_start_scan(struct rtllib_device *ieee)
{
if (ieee->rtllib_ips_leave_wq != NULL)
ieee->rtllib_ips_leave_wq(ieee->dev);
ieee->rtllib_ips_leave_wq(ieee->dev);
if (IS_DOT11D_ENABLE(ieee)) {
if (IS_COUNTRY_IE_VALID(ieee))
......@@ -1501,7 +1498,7 @@ static void rtllib_associate_step2(struct rtllib_device *ieee)
static void rtllib_associate_complete_wq(void *data)
{
struct rtllib_device *ieee = (struct rtllib_device *)
container_of_work_rsl(data,
container_of(data,
struct rtllib_device,
associate_complete_wq);
struct rt_pwr_save_ctrl *psc = &ieee->pwr_save_ctrl;
......@@ -1575,8 +1572,7 @@ static void rtllib_associate_procedure_wq(void *data)
struct rtllib_device,
associate_procedure_wq);
rtllib_stop_scan_syncro(ieee);
if (ieee->rtllib_ips_leave != NULL)
ieee->rtllib_ips_leave(ieee->dev);
ieee->rtllib_ips_leave(ieee->dev);
mutex_lock(&ieee->wx_mutex);
if (ieee->data_hard_stop)
......@@ -1585,8 +1581,7 @@ static void rtllib_associate_procedure_wq(void *data)
rtllib_stop_scan(ieee);
HTSetConnectBwMode(ieee, HT_CHANNEL_WIDTH_20, HT_EXTCHNL_OFFSET_NO_EXT);
if (ieee->rf_power_state == rf_off) {
if (ieee->rtllib_ips_leave_wq != NULL)
ieee->rtllib_ips_leave_wq(ieee->dev);
ieee->rtllib_ips_leave_wq(ieee->dev);
mutex_unlock(&ieee->wx_mutex);
return;
}
......@@ -2241,10 +2236,8 @@ rtllib_rx_assoc_resp(struct rtllib_device *ieee, struct sk_buff *skb,
memcpy(ieee->ht_info->PeerHTInfoBuf,
network->bssht.bd_ht_info_buf,
network->bssht.bd_ht_info_len);
if (ieee->handle_assoc_response != NULL)
ieee->handle_assoc_response(ieee->dev,
(struct rtllib_assoc_response_frame *)header,
network);
ieee->handle_assoc_response(ieee->dev,
(struct rtllib_assoc_response_frame *)header, network);
}
kfree(network);
......@@ -2856,8 +2849,7 @@ void rtllib_stop_protocol(struct rtllib_device *ieee, u8 shutdown)
if (shutdown) {
ieee->proto_started = 0;
ieee->proto_stoppping = 1;
if (ieee->rtllib_ips_leave != NULL)
ieee->rtllib_ips_leave(ieee->dev);
ieee->rtllib_ips_leave(ieee->dev);
}
rtllib_stop_send_beacons(ieee);
......@@ -3004,20 +2996,13 @@ int rtllib_softmac_init(struct rtllib_device *ieee)
timer_setup(&ieee->beacon_timer, rtllib_send_beacon_cb, 0);
INIT_DELAYED_WORK_RSL(&ieee->link_change_wq,
(void *)rtllib_link_change_wq, ieee);
INIT_DELAYED_WORK_RSL(&ieee->start_ibss_wq,
(void *)rtllib_start_ibss_wq, ieee);
INIT_WORK_RSL(&ieee->associate_complete_wq,
(void *)rtllib_associate_complete_wq, ieee);
INIT_DELAYED_WORK_RSL(&ieee->associate_procedure_wq,
(void *)rtllib_associate_procedure_wq, ieee);
INIT_DELAYED_WORK_RSL(&ieee->softmac_scan_wq,
(void *)rtllib_softmac_scan_wq, ieee);
INIT_DELAYED_WORK_RSL(&ieee->associate_retry_wq,
(void *)rtllib_associate_retry_wq, ieee);
INIT_WORK_RSL(&ieee->wx_sync_scan_wq, (void *)rtllib_wx_sync_scan_wq,
ieee);
INIT_DELAYED_WORK(&ieee->link_change_wq, (void *)rtllib_link_change_wq);
INIT_DELAYED_WORK(&ieee->start_ibss_wq, (void *)rtllib_start_ibss_wq);
INIT_WORK(&ieee->associate_complete_wq, (void *)rtllib_associate_complete_wq);
INIT_DELAYED_WORK(&ieee->associate_procedure_wq, (void *)rtllib_associate_procedure_wq);
INIT_DELAYED_WORK(&ieee->softmac_scan_wq, (void *)rtllib_softmac_scan_wq);
INIT_DELAYED_WORK(&ieee->associate_retry_wq, (void *)rtllib_associate_retry_wq);
INIT_WORK(&ieee->wx_sync_scan_wq, (void *)rtllib_wx_sync_scan_wq);
mutex_init(&ieee->wx_mutex);
mutex_init(&ieee->scan_mutex);
......
......@@ -326,8 +326,7 @@ EXPORT_SYMBOL(rtllib_wx_set_mode);
void rtllib_wx_sync_scan_wq(void *data)
{
struct rtllib_device *ieee = container_of_work_rsl(data,
struct rtllib_device, wx_sync_scan_wq);
struct rtllib_device *ieee = container_of(data, struct rtllib_device, wx_sync_scan_wq);
short chan;
enum ht_extchnl_offset chan_offset = 0;
enum ht_channel_width bandwidth = 0;
......@@ -340,8 +339,7 @@ void rtllib_wx_sync_scan_wq(void *data)
chan = ieee->current_network.channel;
if (ieee->LeisurePSLeave)
ieee->LeisurePSLeave(ieee->dev);
ieee->LeisurePSLeave(ieee->dev);
/* notify AP to be in PS mode */
rtllib_sta_ps_send_null_frame(ieee, 1);
rtllib_sta_ps_send_null_frame(ieee, 1);
......@@ -356,8 +354,7 @@ void rtllib_wx_sync_scan_wq(void *data)
/* wait for ps packet to be kicked out successfully */
msleep(50);
if (ieee->ScanOperationBackupHandler)
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_BACKUP);
if (ieee->ht_info->bCurrentHTSupport && ieee->ht_info->enable_ht &&
ieee->ht_info->bCurBW40MHz) {
......@@ -382,8 +379,7 @@ void rtllib_wx_sync_scan_wq(void *data)
ieee->set_chan(ieee->dev, chan);
}
if (ieee->ScanOperationBackupHandler)
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
ieee->ScanOperationBackupHandler(ieee->dev, SCAN_OPT_RESTORE);
ieee->state = RTLLIB_LINKED;
ieee->link_change(ieee->dev);
......
This diff is collapsed.
This diff is collapsed.
......@@ -168,7 +168,6 @@ void dm_rf_operation_test_callback(unsigned long data);
void dm_rf_pathcheck_workitemcallback(struct work_struct *work);
void dm_fsync_work_callback(struct work_struct *work);
void dm_cck_txpower_adjust(struct net_device *dev, bool binch14);
void dm_shadow_init(struct net_device *dev);
void dm_initialize_txpower_tracking(struct net_device *dev);
/*--------------------------Exported Function prototype---------------------*/
......
This diff is collapsed.
......@@ -74,8 +74,6 @@ void rtl8192_SetBWMode(struct net_device *dev,
enum ht_extension_chan_offset offset);
void rtl8192_SwChnl_WorkItem(struct net_device *dev);
void rtl8192_SetBWModeWorkItem(struct net_device *dev);
bool rtl8192_SetRFPowerState(struct net_device *dev,
RT_RF_POWER_STATE eRFPowerState);
void InitialGain819xUsb(struct net_device *dev, u8 Operation);
void InitialGainOperateWorkItemCallBack(struct work_struct *work);
......
......@@ -23,6 +23,7 @@ struct PGPKT_STRUCT {
u8 word_en;
u8 data[PGPKT_DATA_SIZE];
};
/*--------------------------------------------------------------------------*/
u8 r8712_efuse_reg_init(struct _adapter *padapter);
void r8712_efuse_reg_uninit(struct _adapter *padapter);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment