mirror of
https://github.com/torvalds/linux.git
synced 2024-11-13 23:51:39 +00:00
Staging drivers update for 5.17-rc1
Here's the big set of staging driver updates for 5.17-rc1 Nothing major in here at all, just lots and lots of tiny cleanups. Overall more code was removed than added, which is always nice, but not a huge change. Majority of the work happened in the r8188eu driver, that had hundreds of cleanups happen on it, but almost all other staging drivers had cleanups as well. No new functionality was added, cleanups only. All of these have been in linux-next for a while with no reported problems. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> -----BEGIN PGP SIGNATURE----- iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYd7SrQ8cZ3JlZ0Brcm9h aC5jb20ACgkQMUfUDdst+ymohwCgi8+FwjSwfzLjOB8ZCtqZu0qs5AwAniCR080V 1MhVDTkreXHR8mM+pz/3 =QJRe -----END PGP SIGNATURE----- Merge tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging Pull staging driver updates from Greg KH: "Here's the big set of staging driver updates for 5.17-rc1 Nothing major in here at all, just lots and lots of tiny cleanups. Overall more code was removed than added, which is always nice, but not a huge change. Majority of the work happened in the r8188eu driver, that had hundreds of cleanups happen on it, but almost all other staging drivers had cleanups as well. No new functionality was added, cleanups only. All of these have been in linux-next for a while with no reported problems" * tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (308 commits) staging: r8188eu: rename camelcase variable uintPeerChannel staging: r8188eu: make BW20_24G_Diff a 1-D array staging: r8188eu: make OFDM_24G_Diff a 1-D array staging: r8188eu: BW40_24G_Diff is set but not used staging: r8188eu: CCK_24G_Diff is set but not used staging: r8188eu: make Index24G_BW40_Base a 1-D array staging: r8188eu: make Index24G_CCK_Base a 1-D array staging: r8188eu: rfPath is always 0 staging: r8188eu: remove unneeded parameter from rtl8188e_SetHalODMVar staging: pi433: add comment to rx_lock mutex definition staging: pi433: fix frequency deviation check staging: vc04_services: rename BM2835 to BCM2835 in headers comments staging: vc04_services: rename string literal containing bm2835_* to bcm2835*_ staging: vc04_services: rename variables containing bm2835_* to bcm2835_* staging: vc04_services: rename functions containing bm2835_* to bcm2835_* staging: vc04_services: rename structures bm2835_mmal_dev and bm2835_mmal_v4l2_ctrl staging: greybus: audio: Check null pointer staging: r8188eu: add spaces around P2P_AP_P2P_CH_SWITCH_PROCESS_WK staging: r8188eu: turbo scan is always off for r8188eu staging: r8188eu: cmd_issued_cnt is set but not used ...
This commit is contained in:
commit
22ef12195e
@ -84,10 +84,6 @@ source "drivers/staging/vc04_services/Kconfig"
|
||||
|
||||
source "drivers/staging/pi433/Kconfig"
|
||||
|
||||
source "drivers/staging/mt7621-dma/Kconfig"
|
||||
|
||||
source "drivers/staging/ralink-gdma/Kconfig"
|
||||
|
||||
source "drivers/staging/mt7621-dts/Kconfig"
|
||||
|
||||
source "drivers/staging/axis-fifo/Kconfig"
|
||||
|
@ -32,8 +32,6 @@ obj-$(CONFIG_KS7010) += ks7010/
|
||||
obj-$(CONFIG_GREYBUS) += greybus/
|
||||
obj-$(CONFIG_BCM2835_VCHIQ) += vc04_services/
|
||||
obj-$(CONFIG_PI433) += pi433/
|
||||
obj-$(CONFIG_SOC_MT7621) += mt7621-dma/
|
||||
obj-$(CONFIG_DMA_RALINK) += ralink-gdma/
|
||||
obj-$(CONFIG_SOC_MT7621) += mt7621-dts/
|
||||
obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/
|
||||
obj-$(CONFIG_FIELDBUS_DEV) += fieldbus/
|
||||
|
@ -809,7 +809,6 @@ end:
|
||||
|
||||
static int axis_fifo_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct resource *r_irq; /* interrupt resources */
|
||||
struct resource *r_mem; /* IO mem resources */
|
||||
struct device *dev = &pdev->dev; /* OS device (from device tree) */
|
||||
struct axis_fifo *fifo = NULL;
|
||||
@ -882,16 +881,12 @@ static int axis_fifo_probe(struct platform_device *pdev)
|
||||
*/
|
||||
|
||||
/* get IRQ resource */
|
||||
r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
|
||||
if (!r_irq) {
|
||||
dev_err(fifo->dt_device, "no IRQ found for 0x%pa\n",
|
||||
&r_mem->start);
|
||||
rc = -EIO;
|
||||
rc = platform_get_irq(pdev, 0);
|
||||
if (rc < 0)
|
||||
goto err_initial;
|
||||
}
|
||||
|
||||
/* request IRQ */
|
||||
fifo->irq = r_irq->start;
|
||||
fifo->irq = rc;
|
||||
rc = devm_request_irq(fifo->dt_device, fifo->irq, &axis_fifo_irq, 0,
|
||||
DRIVER_NAME, fifo);
|
||||
if (rc) {
|
||||
|
@ -200,9 +200,3 @@ config FB_TFT_UPD161704
|
||||
depends on FB_TFT
|
||||
help
|
||||
Generic Framebuffer support for uPD161704
|
||||
|
||||
config FB_TFT_WATTEROTT
|
||||
tristate "FB driver for the WATTEROTT LCD Controller"
|
||||
depends on FB_TFT
|
||||
help
|
||||
Generic Framebuffer support for WATTEROTT
|
||||
|
@ -36,4 +36,3 @@ obj-$(CONFIG_FB_TFT_TLS8204) += fb_tls8204.o
|
||||
obj-$(CONFIG_FB_TFT_UC1611) += fb_uc1611.o
|
||||
obj-$(CONFIG_FB_TFT_UC1701) += fb_uc1701.o
|
||||
obj-$(CONFIG_FB_TFT_UPD161704) += fb_upd161704.o
|
||||
obj-$(CONFIG_FB_TFT_WATTEROTT) += fb_watterott.o
|
||||
|
@ -173,12 +173,7 @@ static struct fbtft_display display = {
|
||||
},
|
||||
};
|
||||
|
||||
FBTFT_REGISTER_DRIVER(DRVNAME, "sinowealth,sh1106", &display);
|
||||
|
||||
MODULE_ALIAS("spi:" DRVNAME);
|
||||
MODULE_ALIAS("platform:" DRVNAME);
|
||||
MODULE_ALIAS("spi:sh1106");
|
||||
MODULE_ALIAS("platform:sh1106");
|
||||
FBTFT_REGISTER_SPI_DRIVER(DRVNAME, "sinowealth", "sh1106", &display);
|
||||
|
||||
MODULE_DESCRIPTION("SH1106 OLED Driver");
|
||||
MODULE_AUTHOR("Heiner Kallweit");
|
||||
|
@ -1,302 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* FB driver for the Watterott LCD Controller
|
||||
*
|
||||
* Copyright (C) 2013 Noralf Tronnes
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/delay.h>
|
||||
|
||||
#include "fbtft.h"
|
||||
|
||||
#define DRVNAME "fb_watterott"
|
||||
#define WIDTH 320
|
||||
#define HEIGHT 240
|
||||
#define FPS 5
|
||||
#define TXBUFLEN 1024
|
||||
#define DEFAULT_BRIGHTNESS 50
|
||||
|
||||
#define CMD_VERSION 0x01
|
||||
#define CMD_LCD_LED 0x10
|
||||
#define CMD_LCD_RESET 0x11
|
||||
#define CMD_LCD_ORIENTATION 0x20
|
||||
#define CMD_LCD_DRAWIMAGE 0x27
|
||||
#define COLOR_RGB323 8
|
||||
#define COLOR_RGB332 9
|
||||
#define COLOR_RGB233 10
|
||||
#define COLOR_RGB565 16
|
||||
|
||||
static short mode = 565;
|
||||
module_param(mode, short, 0000);
|
||||
MODULE_PARM_DESC(mode, "RGB color transfer mode: 332, 565 (default)");
|
||||
|
||||
static void write_reg8_bus8(struct fbtft_par *par, int len, ...)
|
||||
{
|
||||
va_list args;
|
||||
int i, ret;
|
||||
u8 *buf = par->buf;
|
||||
|
||||
va_start(args, len);
|
||||
for (i = 0; i < len; i++)
|
||||
*buf++ = (u8)va_arg(args, unsigned int);
|
||||
va_end(args);
|
||||
|
||||
fbtft_par_dbg_hex(DEBUG_WRITE_REGISTER, par,
|
||||
par->info->device, u8, par->buf,
|
||||
len, "%s: ", __func__);
|
||||
|
||||
ret = par->fbtftops.write(par, par->buf, len);
|
||||
if (ret < 0) {
|
||||
dev_err(par->info->device,
|
||||
"write() failed and returned %d\n", ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
|
||||
{
|
||||
unsigned int start_line, end_line;
|
||||
u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset);
|
||||
__be16 *pos = par->txbuf.buf + 1;
|
||||
__be16 *buf16 = par->txbuf.buf + 10;
|
||||
int i, j;
|
||||
int ret = 0;
|
||||
|
||||
start_line = offset / par->info->fix.line_length;
|
||||
end_line = start_line + (len / par->info->fix.line_length) - 1;
|
||||
|
||||
/* Set command header. pos: x, y, w, h */
|
||||
((u8 *)par->txbuf.buf)[0] = CMD_LCD_DRAWIMAGE;
|
||||
pos[0] = 0;
|
||||
pos[2] = cpu_to_be16(par->info->var.xres);
|
||||
pos[3] = cpu_to_be16(1);
|
||||
((u8 *)par->txbuf.buf)[9] = COLOR_RGB565;
|
||||
|
||||
for (i = start_line; i <= end_line; i++) {
|
||||
pos[1] = cpu_to_be16(i);
|
||||
for (j = 0; j < par->info->var.xres; j++)
|
||||
buf16[j] = cpu_to_be16(*vmem16++);
|
||||
ret = par->fbtftops.write(par,
|
||||
par->txbuf.buf, 10 + par->info->fix.line_length);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
udelay(300);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int rgb565_to_rgb332(u16 c)
|
||||
{
|
||||
return ((c & 0xE000) >> 8) | ((c & 000700) >> 6) | ((c & 0x0018) >> 3);
|
||||
}
|
||||
|
||||
static int write_vmem_8bit(struct fbtft_par *par, size_t offset, size_t len)
|
||||
{
|
||||
unsigned int start_line, end_line;
|
||||
u16 *vmem16 = (u16 *)(par->info->screen_buffer + offset);
|
||||
__be16 *pos = par->txbuf.buf + 1;
|
||||
u8 *buf8 = par->txbuf.buf + 10;
|
||||
int i, j;
|
||||
int ret = 0;
|
||||
|
||||
start_line = offset / par->info->fix.line_length;
|
||||
end_line = start_line + (len / par->info->fix.line_length) - 1;
|
||||
|
||||
/* Set command header. pos: x, y, w, h */
|
||||
((u8 *)par->txbuf.buf)[0] = CMD_LCD_DRAWIMAGE;
|
||||
pos[0] = 0;
|
||||
pos[2] = cpu_to_be16(par->info->var.xres);
|
||||
pos[3] = cpu_to_be16(1);
|
||||
((u8 *)par->txbuf.buf)[9] = COLOR_RGB332;
|
||||
|
||||
for (i = start_line; i <= end_line; i++) {
|
||||
pos[1] = cpu_to_be16(i);
|
||||
for (j = 0; j < par->info->var.xres; j++) {
|
||||
buf8[j] = rgb565_to_rgb332(*vmem16);
|
||||
vmem16++;
|
||||
}
|
||||
ret = par->fbtftops.write(par,
|
||||
par->txbuf.buf, 10 + par->info->var.xres);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
udelay(700);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned int firmware_version(struct fbtft_par *par)
|
||||
{
|
||||
u8 rxbuf[4] = {0, };
|
||||
|
||||
write_reg(par, CMD_VERSION);
|
||||
par->fbtftops.read(par, rxbuf, 4);
|
||||
if (rxbuf[1] != '.')
|
||||
return 0;
|
||||
|
||||
return (rxbuf[0] - '0') << 8 | (rxbuf[2] - '0') << 4 | (rxbuf[3] - '0');
|
||||
}
|
||||
|
||||
static int init_display(struct fbtft_par *par)
|
||||
{
|
||||
int ret;
|
||||
unsigned int version;
|
||||
u8 save_mode;
|
||||
|
||||
/* enable SPI interface by having CS and MOSI low during reset */
|
||||
save_mode = par->spi->mode;
|
||||
/*
|
||||
* Set CS active inverse polarity: just setting SPI_CS_HIGH does not
|
||||
* work with GPIO based chip selects that are logically active high
|
||||
* but inverted inside the GPIO library, so enforce inverted
|
||||
* semantics.
|
||||
*/
|
||||
par->spi->mode ^= SPI_CS_HIGH;
|
||||
ret = spi_setup(par->spi);
|
||||
if (ret) {
|
||||
dev_err(par->info->device,
|
||||
"Could not set inverse CS polarity\n");
|
||||
return ret;
|
||||
}
|
||||
write_reg(par, 0x00); /* make sure mode is set */
|
||||
|
||||
mdelay(50);
|
||||
par->fbtftops.reset(par);
|
||||
mdelay(1000);
|
||||
par->spi->mode = save_mode;
|
||||
ret = spi_setup(par->spi);
|
||||
if (ret) {
|
||||
dev_err(par->info->device, "Could not restore SPI mode\n");
|
||||
return ret;
|
||||
}
|
||||
write_reg(par, 0x00);
|
||||
|
||||
version = firmware_version(par);
|
||||
fbtft_par_dbg(DEBUG_INIT_DISPLAY, par, "Firmware version: %x.%02x\n",
|
||||
version >> 8, version & 0xFF);
|
||||
|
||||
if (mode == 332)
|
||||
par->fbtftops.write_vmem = write_vmem_8bit;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void set_addr_win(struct fbtft_par *par, int xs, int ys, int xe, int ye)
|
||||
{
|
||||
/* not used on this controller */
|
||||
}
|
||||
|
||||
static int set_var(struct fbtft_par *par)
|
||||
{
|
||||
u8 rotate;
|
||||
|
||||
/* this controller rotates clock wise */
|
||||
switch (par->info->var.rotate) {
|
||||
case 90:
|
||||
rotate = 27;
|
||||
break;
|
||||
case 180:
|
||||
rotate = 18;
|
||||
break;
|
||||
case 270:
|
||||
rotate = 9;
|
||||
break;
|
||||
default:
|
||||
rotate = 0;
|
||||
}
|
||||
write_reg(par, CMD_LCD_ORIENTATION, rotate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int verify_gpios(struct fbtft_par *par)
|
||||
{
|
||||
if (!par->gpio.reset) {
|
||||
dev_err(par->info->device, "Missing 'reset' gpio. Aborting.\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_FB_BACKLIGHT
|
||||
static int backlight_chip_update_status(struct backlight_device *bd)
|
||||
{
|
||||
struct fbtft_par *par = bl_get_data(bd);
|
||||
int brightness = bd->props.brightness;
|
||||
|
||||
fbtft_par_dbg(DEBUG_BACKLIGHT, par,
|
||||
"%s: brightness=%d, power=%d, fb_blank=%d\n", __func__,
|
||||
bd->props.brightness, bd->props.power,
|
||||
bd->props.fb_blank);
|
||||
|
||||
if (bd->props.power != FB_BLANK_UNBLANK)
|
||||
brightness = 0;
|
||||
|
||||
if (bd->props.fb_blank != FB_BLANK_UNBLANK)
|
||||
brightness = 0;
|
||||
|
||||
write_reg(par, CMD_LCD_LED, brightness);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct backlight_ops bl_ops = {
|
||||
.update_status = backlight_chip_update_status,
|
||||
};
|
||||
|
||||
static void register_chip_backlight(struct fbtft_par *par)
|
||||
{
|
||||
struct backlight_device *bd;
|
||||
struct backlight_properties bl_props = { 0, };
|
||||
|
||||
bl_props.type = BACKLIGHT_RAW;
|
||||
bl_props.power = FB_BLANK_POWERDOWN;
|
||||
bl_props.max_brightness = 100;
|
||||
bl_props.brightness = DEFAULT_BRIGHTNESS;
|
||||
|
||||
bd = backlight_device_register(dev_driver_string(par->info->device),
|
||||
par->info->device, par, &bl_ops,
|
||||
&bl_props);
|
||||
if (IS_ERR(bd)) {
|
||||
dev_err(par->info->device,
|
||||
"cannot register backlight device (%ld)\n",
|
||||
PTR_ERR(bd));
|
||||
return;
|
||||
}
|
||||
par->info->bl_dev = bd;
|
||||
|
||||
if (!par->fbtftops.unregister_backlight)
|
||||
par->fbtftops.unregister_backlight = fbtft_unregister_backlight;
|
||||
}
|
||||
#else
|
||||
#define register_chip_backlight NULL
|
||||
#endif
|
||||
|
||||
static struct fbtft_display display = {
|
||||
.regwidth = 8,
|
||||
.buswidth = 8,
|
||||
.width = WIDTH,
|
||||
.height = HEIGHT,
|
||||
.fps = FPS,
|
||||
.txbuflen = TXBUFLEN,
|
||||
.fbtftops = {
|
||||
.write_register = write_reg8_bus8,
|
||||
.write_vmem = write_vmem,
|
||||
.init_display = init_display,
|
||||
.set_addr_win = set_addr_win,
|
||||
.set_var = set_var,
|
||||
.verify_gpios = verify_gpios,
|
||||
.register_backlight = register_chip_backlight,
|
||||
},
|
||||
};
|
||||
|
||||
FBTFT_REGISTER_DRIVER(DRVNAME, "watterott,openlcd", &display);
|
||||
|
||||
MODULE_ALIAS("spi:" DRVNAME);
|
||||
|
||||
MODULE_DESCRIPTION("FB driver for the Watterott LCD Controller");
|
||||
MODULE_AUTHOR("Noralf Tronnes");
|
||||
MODULE_LICENSE("GPL");
|
@ -346,6 +346,47 @@ static void __exit fbtft_driver_module_exit(void) \
|
||||
module_init(fbtft_driver_module_init); \
|
||||
module_exit(fbtft_driver_module_exit);
|
||||
|
||||
#define FBTFT_REGISTER_SPI_DRIVER(_name, _comp_vend, _comp_dev, _display) \
|
||||
\
|
||||
static int fbtft_driver_probe_spi(struct spi_device *spi) \
|
||||
{ \
|
||||
return fbtft_probe_common(_display, spi, NULL); \
|
||||
} \
|
||||
\
|
||||
static int fbtft_driver_remove_spi(struct spi_device *spi) \
|
||||
{ \
|
||||
struct fb_info *info = spi_get_drvdata(spi); \
|
||||
\
|
||||
fbtft_remove_common(&spi->dev, info); \
|
||||
return 0; \
|
||||
} \
|
||||
\
|
||||
static const struct of_device_id dt_ids[] = { \
|
||||
{ .compatible = _comp_vend "," _comp_dev }, \
|
||||
{}, \
|
||||
}; \
|
||||
\
|
||||
MODULE_DEVICE_TABLE(of, dt_ids); \
|
||||
\
|
||||
static const struct spi_device_id spi_ids[] = { \
|
||||
{ .name = _comp_dev }, \
|
||||
{}, \
|
||||
}; \
|
||||
\
|
||||
MODULE_DEVICE_TABLE(spi, spi_ids); \
|
||||
\
|
||||
static struct spi_driver fbtft_driver_spi_driver = { \
|
||||
.driver = { \
|
||||
.name = _name, \
|
||||
.of_match_table = dt_ids, \
|
||||
}, \
|
||||
.id_table = spi_ids, \
|
||||
.probe = fbtft_driver_probe_spi, \
|
||||
.remove = fbtft_driver_remove_spi, \
|
||||
}; \
|
||||
\
|
||||
module_spi_driver(fbtft_driver_spi_driver);
|
||||
|
||||
/* Debug macros */
|
||||
|
||||
/* shorthand debug levels */
|
||||
|
@ -142,11 +142,12 @@ static struct attribute *gb_audio_module_default_attrs[] = {
|
||||
&gb_audio_module_op_devices_attribute.attr,
|
||||
NULL, /* need to NULL terminate the list of attributes */
|
||||
};
|
||||
ATTRIBUTE_GROUPS(gb_audio_module_default);
|
||||
|
||||
static struct kobj_type gb_audio_module_type = {
|
||||
.sysfs_ops = &gb_audio_module_sysfs_ops,
|
||||
.release = gb_audio_module_release,
|
||||
.default_attrs = gb_audio_module_default_attrs,
|
||||
.default_groups = gb_audio_module_default_groups,
|
||||
};
|
||||
|
||||
static void send_add_uevent(struct gb_audio_manager_module *module)
|
||||
|
@ -147,6 +147,9 @@ static const char **gb_generate_enum_strings(struct gbaudio_module_info *gb,
|
||||
|
||||
items = le32_to_cpu(gbenum->items);
|
||||
strings = devm_kcalloc(gb->dev, items, sizeof(char *), GFP_KERNEL);
|
||||
if (!strings)
|
||||
return NULL;
|
||||
|
||||
data = gbenum->names;
|
||||
|
||||
for (i = 0; i < items; i++) {
|
||||
@ -655,6 +658,8 @@ static int gbaudio_tplg_create_enum_kctl(struct gbaudio_module_info *gb,
|
||||
/* since count=1, and reg is dummy */
|
||||
gbe->items = le32_to_cpu(gb_enum->items);
|
||||
gbe->texts = gb_generate_enum_strings(gb, gb_enum);
|
||||
if (!gbe->texts)
|
||||
return -ENOMEM;
|
||||
|
||||
/* debug enum info */
|
||||
dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items,
|
||||
@ -862,6 +867,8 @@ static int gbaudio_tplg_create_enum_ctl(struct gbaudio_module_info *gb,
|
||||
/* since count=1, and reg is dummy */
|
||||
gbe->items = le32_to_cpu(gb_enum->items);
|
||||
gbe->texts = gb_generate_enum_strings(gb, gb_enum);
|
||||
if (!gbe->texts)
|
||||
return -ENOMEM;
|
||||
|
||||
/* debug enum info */
|
||||
dev_dbg(gb->dev, "Max:%d, name_length:%d\n", gbe->items,
|
||||
@ -974,6 +981,44 @@ static int gbaudio_widget_event(struct snd_soc_dapm_widget *w,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static const struct snd_soc_dapm_widget gbaudio_widgets[] = {
|
||||
[snd_soc_dapm_spk] = SND_SOC_DAPM_SPK(NULL, gbcodec_event_spk),
|
||||
[snd_soc_dapm_hp] = SND_SOC_DAPM_HP(NULL, gbcodec_event_hp),
|
||||
[snd_soc_dapm_mic] = SND_SOC_DAPM_MIC(NULL, gbcodec_event_int_mic),
|
||||
[snd_soc_dapm_output] = SND_SOC_DAPM_OUTPUT(NULL),
|
||||
[snd_soc_dapm_input] = SND_SOC_DAPM_INPUT(NULL),
|
||||
[snd_soc_dapm_switch] = SND_SOC_DAPM_SWITCH_E(NULL, SND_SOC_NOPM,
|
||||
0, 0, NULL,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
[snd_soc_dapm_pga] = SND_SOC_DAPM_PGA_E(NULL, SND_SOC_NOPM,
|
||||
0, 0, NULL, 0,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
[snd_soc_dapm_mixer] = SND_SOC_DAPM_MIXER_E(NULL, SND_SOC_NOPM,
|
||||
0, 0, NULL, 0,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
[snd_soc_dapm_mux] = SND_SOC_DAPM_MUX_E(NULL, SND_SOC_NOPM,
|
||||
0, 0, NULL,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
[snd_soc_dapm_aif_in] = SND_SOC_DAPM_AIF_IN_E(NULL, NULL, 0,
|
||||
SND_SOC_NOPM, 0, 0,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
[snd_soc_dapm_aif_out] = SND_SOC_DAPM_AIF_OUT_E(NULL, NULL, 0,
|
||||
SND_SOC_NOPM, 0, 0,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD),
|
||||
};
|
||||
|
||||
static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
|
||||
struct snd_soc_dapm_widget *dw,
|
||||
struct gb_audio_widget *w, int *w_size)
|
||||
@ -1034,6 +1079,10 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
|
||||
csize += le16_to_cpu(gbenum->names_length);
|
||||
control->texts = (const char * const *)
|
||||
gb_generate_enum_strings(module, gbenum);
|
||||
if (!control->texts) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
control->items = le32_to_cpu(gbenum->items);
|
||||
} else {
|
||||
csize = sizeof(struct gb_audio_control);
|
||||
@ -1052,77 +1101,37 @@ static int gbaudio_tplg_create_widget(struct gbaudio_module_info *module,
|
||||
|
||||
switch (w->type) {
|
||||
case snd_soc_dapm_spk:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_SPK(w->name, gbcodec_event_spk);
|
||||
*dw = gbaudio_widgets[w->type];
|
||||
module->op_devices |= GBAUDIO_DEVICE_OUT_SPEAKER;
|
||||
break;
|
||||
case snd_soc_dapm_hp:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_HP(w->name, gbcodec_event_hp);
|
||||
*dw = gbaudio_widgets[w->type];
|
||||
module->op_devices |= (GBAUDIO_DEVICE_OUT_WIRED_HEADSET
|
||||
| GBAUDIO_DEVICE_OUT_WIRED_HEADPHONE);
|
||||
module->ip_devices |= GBAUDIO_DEVICE_IN_WIRED_HEADSET;
|
||||
break;
|
||||
case snd_soc_dapm_mic:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_MIC(w->name, gbcodec_event_int_mic);
|
||||
*dw = gbaudio_widgets[w->type];
|
||||
module->ip_devices |= GBAUDIO_DEVICE_IN_BUILTIN_MIC;
|
||||
break;
|
||||
case snd_soc_dapm_output:
|
||||
*dw = (struct snd_soc_dapm_widget)SND_SOC_DAPM_OUTPUT(w->name);
|
||||
break;
|
||||
case snd_soc_dapm_input:
|
||||
*dw = (struct snd_soc_dapm_widget)SND_SOC_DAPM_INPUT(w->name);
|
||||
break;
|
||||
case snd_soc_dapm_switch:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_SWITCH_E(w->name, SND_SOC_NOPM, 0, 0,
|
||||
widget_kctls,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
break;
|
||||
case snd_soc_dapm_pga:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_PGA_E(w->name, SND_SOC_NOPM, 0, 0, NULL, 0,
|
||||
gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
break;
|
||||
case snd_soc_dapm_mixer:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_MIXER_E(w->name, SND_SOC_NOPM, 0, 0, NULL,
|
||||
0, gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
break;
|
||||
case snd_soc_dapm_mux:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_MUX_E(w->name, SND_SOC_NOPM, 0, 0,
|
||||
widget_kctls, gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
*dw = gbaudio_widgets[w->type];
|
||||
break;
|
||||
case snd_soc_dapm_aif_in:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_AIF_IN_E(w->name, w->sname, 0,
|
||||
SND_SOC_NOPM,
|
||||
0, 0, gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
break;
|
||||
case snd_soc_dapm_aif_out:
|
||||
*dw = (struct snd_soc_dapm_widget)
|
||||
SND_SOC_DAPM_AIF_OUT_E(w->name, w->sname, 0,
|
||||
SND_SOC_NOPM,
|
||||
0, 0, gbaudio_widget_event,
|
||||
SND_SOC_DAPM_PRE_PMU |
|
||||
SND_SOC_DAPM_POST_PMD);
|
||||
*dw = gbaudio_widgets[w->type];
|
||||
dw->sname = w->sname;
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
dw->name = w->name;
|
||||
|
||||
dev_dbg(module->dev, "%s: widget of type %d created\n", dw->name,
|
||||
dw->id);
|
||||
@ -1183,6 +1192,10 @@ static int gbaudio_tplg_process_kcontrols(struct gbaudio_module_info *module,
|
||||
csize += le16_to_cpu(gbenum->names_length);
|
||||
control->texts = (const char * const *)
|
||||
gb_generate_enum_strings(module, gbenum);
|
||||
if (!control->texts) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
}
|
||||
control->items = le32_to_cpu(gbenum->items);
|
||||
} else {
|
||||
csize = sizeof(struct gb_audio_control);
|
||||
|
@ -971,7 +971,7 @@ static void fsl_mx6_disable(struct platform_device *pdev)
|
||||
clk_disable_unprepare(dev->clk);
|
||||
}
|
||||
|
||||
static int rcar_h2_enable(struct platform_device *pdev)
|
||||
static int rcar_gen2_enable(struct platform_device *pdev)
|
||||
{
|
||||
struct dim2_hdm *dev = platform_get_drvdata(pdev);
|
||||
int ret;
|
||||
@ -1006,7 +1006,7 @@ static int rcar_h2_enable(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rcar_h2_disable(struct platform_device *pdev)
|
||||
static void rcar_gen2_disable(struct platform_device *pdev)
|
||||
{
|
||||
struct dim2_hdm *dev = platform_get_drvdata(pdev);
|
||||
|
||||
@ -1016,7 +1016,7 @@ static void rcar_h2_disable(struct platform_device *pdev)
|
||||
writel(0x0, dev->io_base + 0x600);
|
||||
}
|
||||
|
||||
static int rcar_m3_enable(struct platform_device *pdev)
|
||||
static int rcar_gen3_enable(struct platform_device *pdev)
|
||||
{
|
||||
struct dim2_hdm *dev = platform_get_drvdata(pdev);
|
||||
u32 enable_512fs = dev->clk_speed == CLK_512FS;
|
||||
@ -1046,7 +1046,7 @@ static int rcar_m3_enable(struct platform_device *pdev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rcar_m3_disable(struct platform_device *pdev)
|
||||
static void rcar_gen3_disable(struct platform_device *pdev)
|
||||
{
|
||||
struct dim2_hdm *dev = platform_get_drvdata(pdev);
|
||||
|
||||
@ -1058,20 +1058,20 @@ static void rcar_m3_disable(struct platform_device *pdev)
|
||||
|
||||
/* ]] platform specific functions */
|
||||
|
||||
enum dim2_platforms { FSL_MX6, RCAR_H2, RCAR_M3 };
|
||||
enum dim2_platforms { FSL_MX6, RCAR_GEN2, RCAR_GEN3 };
|
||||
|
||||
static struct dim2_platform_data plat_data[] = {
|
||||
[FSL_MX6] = {
|
||||
.enable = fsl_mx6_enable,
|
||||
.disable = fsl_mx6_disable,
|
||||
},
|
||||
[RCAR_H2] = {
|
||||
.enable = rcar_h2_enable,
|
||||
.disable = rcar_h2_disable,
|
||||
[RCAR_GEN2] = {
|
||||
.enable = rcar_gen2_enable,
|
||||
.disable = rcar_gen2_disable,
|
||||
},
|
||||
[RCAR_M3] = {
|
||||
.enable = rcar_m3_enable,
|
||||
.disable = rcar_m3_disable,
|
||||
[RCAR_GEN3] = {
|
||||
.enable = rcar_gen3_enable,
|
||||
.disable = rcar_gen3_disable,
|
||||
.fcnt = 3,
|
||||
},
|
||||
};
|
||||
@ -1083,11 +1083,11 @@ static const struct of_device_id dim2_of_match[] = {
|
||||
},
|
||||
{
|
||||
.compatible = "renesas,mlp",
|
||||
.data = plat_data + RCAR_H2
|
||||
.data = plat_data + RCAR_GEN2
|
||||
},
|
||||
{
|
||||
.compatible = "rcar,medialb-dim2",
|
||||
.data = plat_data + RCAR_M3
|
||||
.compatible = "renesas,rcar-gen3-mlp",
|
||||
.data = plat_data + RCAR_GEN3
|
||||
},
|
||||
{
|
||||
.compatible = "xlnx,axi4-os62420_3pin-1.00.a",
|
||||
|
@ -1,7 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
config MTK_HSDMA
|
||||
tristate "MTK HSDMA support"
|
||||
depends on RALINK && SOC_MT7621
|
||||
select DMA_ENGINE
|
||||
select DMA_VIRTUAL_CHANNELS
|
||||
|
@ -1,4 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
obj-$(CONFIG_MTK_HSDMA) += hsdma-mt7621.o
|
||||
|
||||
ccflags-y += -I$(srctree)/drivers/dma
|
@ -1,5 +0,0 @@
|
||||
|
||||
- general code review and clean up
|
||||
- ensure device-tree requirements are documented
|
||||
|
||||
Cc: NeilBrown <neil@brown.name>
|
@ -1,758 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2015, Michael Lee <igvtee@gmail.com>
|
||||
* MTK HSDMA support
|
||||
*/
|
||||
|
||||
#include <linux/dmaengine.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/err.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/slab.h>
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/irq.h>
|
||||
#include <linux/of_dma.h>
|
||||
#include <linux/reset.h>
|
||||
#include <linux/of_device.h>
|
||||
|
||||
#include "virt-dma.h"
|
||||
|
||||
#define HSDMA_BASE_OFFSET 0x800
|
||||
|
||||
#define HSDMA_REG_TX_BASE 0x00
|
||||
#define HSDMA_REG_TX_CNT 0x04
|
||||
#define HSDMA_REG_TX_CTX 0x08
|
||||
#define HSDMA_REG_TX_DTX 0x0c
|
||||
#define HSDMA_REG_RX_BASE 0x100
|
||||
#define HSDMA_REG_RX_CNT 0x104
|
||||
#define HSDMA_REG_RX_CRX 0x108
|
||||
#define HSDMA_REG_RX_DRX 0x10c
|
||||
#define HSDMA_REG_INFO 0x200
|
||||
#define HSDMA_REG_GLO_CFG 0x204
|
||||
#define HSDMA_REG_RST_CFG 0x208
|
||||
#define HSDMA_REG_DELAY_INT 0x20c
|
||||
#define HSDMA_REG_FREEQ_THRES 0x210
|
||||
#define HSDMA_REG_INT_STATUS 0x220
|
||||
#define HSDMA_REG_INT_MASK 0x228
|
||||
#define HSDMA_REG_SCH_Q01 0x280
|
||||
#define HSDMA_REG_SCH_Q23 0x284
|
||||
|
||||
#define HSDMA_DESCS_MAX 0xfff
|
||||
#define HSDMA_DESCS_NUM 8
|
||||
#define HSDMA_DESCS_MASK (HSDMA_DESCS_NUM - 1)
|
||||
#define HSDMA_NEXT_DESC(x) (((x) + 1) & HSDMA_DESCS_MASK)
|
||||
|
||||
/* HSDMA_REG_INFO */
|
||||
#define HSDMA_INFO_INDEX_MASK 0xf
|
||||
#define HSDMA_INFO_INDEX_SHIFT 24
|
||||
#define HSDMA_INFO_BASE_MASK 0xff
|
||||
#define HSDMA_INFO_BASE_SHIFT 16
|
||||
#define HSDMA_INFO_RX_MASK 0xff
|
||||
#define HSDMA_INFO_RX_SHIFT 8
|
||||
#define HSDMA_INFO_TX_MASK 0xff
|
||||
#define HSDMA_INFO_TX_SHIFT 0
|
||||
|
||||
/* HSDMA_REG_GLO_CFG */
|
||||
#define HSDMA_GLO_TX_2B_OFFSET BIT(31)
|
||||
#define HSDMA_GLO_CLK_GATE BIT(30)
|
||||
#define HSDMA_GLO_BYTE_SWAP BIT(29)
|
||||
#define HSDMA_GLO_MULTI_DMA BIT(10)
|
||||
#define HSDMA_GLO_TWO_BUF BIT(9)
|
||||
#define HSDMA_GLO_32B_DESC BIT(8)
|
||||
#define HSDMA_GLO_BIG_ENDIAN BIT(7)
|
||||
#define HSDMA_GLO_TX_DONE BIT(6)
|
||||
#define HSDMA_GLO_BT_MASK 0x3
|
||||
#define HSDMA_GLO_BT_SHIFT 4
|
||||
#define HSDMA_GLO_RX_BUSY BIT(3)
|
||||
#define HSDMA_GLO_RX_DMA BIT(2)
|
||||
#define HSDMA_GLO_TX_BUSY BIT(1)
|
||||
#define HSDMA_GLO_TX_DMA BIT(0)
|
||||
|
||||
#define HSDMA_BT_SIZE_16BYTES (0 << HSDMA_GLO_BT_SHIFT)
|
||||
#define HSDMA_BT_SIZE_32BYTES (1 << HSDMA_GLO_BT_SHIFT)
|
||||
#define HSDMA_BT_SIZE_64BYTES (2 << HSDMA_GLO_BT_SHIFT)
|
||||
#define HSDMA_BT_SIZE_128BYTES (3 << HSDMA_GLO_BT_SHIFT)
|
||||
|
||||
#define HSDMA_GLO_DEFAULT (HSDMA_GLO_MULTI_DMA | \
|
||||
HSDMA_GLO_RX_DMA | HSDMA_GLO_TX_DMA | HSDMA_BT_SIZE_32BYTES)
|
||||
|
||||
/* HSDMA_REG_RST_CFG */
|
||||
#define HSDMA_RST_RX_SHIFT 16
|
||||
#define HSDMA_RST_TX_SHIFT 0
|
||||
|
||||
/* HSDMA_REG_DELAY_INT */
|
||||
#define HSDMA_DELAY_INT_EN BIT(15)
|
||||
#define HSDMA_DELAY_PEND_OFFSET 8
|
||||
#define HSDMA_DELAY_TIME_OFFSET 0
|
||||
#define HSDMA_DELAY_TX_OFFSET 16
|
||||
#define HSDMA_DELAY_RX_OFFSET 0
|
||||
|
||||
#define HSDMA_DELAY_INIT(x) (HSDMA_DELAY_INT_EN | \
|
||||
((x) << HSDMA_DELAY_PEND_OFFSET))
|
||||
#define HSDMA_DELAY(x) ((HSDMA_DELAY_INIT(x) << \
|
||||
HSDMA_DELAY_TX_OFFSET) | HSDMA_DELAY_INIT(x))
|
||||
|
||||
/* HSDMA_REG_INT_STATUS */
|
||||
#define HSDMA_INT_DELAY_RX_COH BIT(31)
|
||||
#define HSDMA_INT_DELAY_RX_INT BIT(30)
|
||||
#define HSDMA_INT_DELAY_TX_COH BIT(29)
|
||||
#define HSDMA_INT_DELAY_TX_INT BIT(28)
|
||||
#define HSDMA_INT_RX_MASK 0x3
|
||||
#define HSDMA_INT_RX_SHIFT 16
|
||||
#define HSDMA_INT_RX_Q0 BIT(16)
|
||||
#define HSDMA_INT_TX_MASK 0xf
|
||||
#define HSDMA_INT_TX_SHIFT 0
|
||||
#define HSDMA_INT_TX_Q0 BIT(0)
|
||||
|
||||
/* tx/rx dma desc flags */
|
||||
#define HSDMA_PLEN_MASK 0x3fff
|
||||
#define HSDMA_DESC_DONE BIT(31)
|
||||
#define HSDMA_DESC_LS0 BIT(30)
|
||||
#define HSDMA_DESC_PLEN0(_x) (((_x) & HSDMA_PLEN_MASK) << 16)
|
||||
#define HSDMA_DESC_TAG BIT(15)
|
||||
#define HSDMA_DESC_LS1 BIT(14)
|
||||
#define HSDMA_DESC_PLEN1(_x) ((_x) & HSDMA_PLEN_MASK)
|
||||
|
||||
/* align 4 bytes */
|
||||
#define HSDMA_ALIGN_SIZE 3
|
||||
/* align size 128bytes */
|
||||
#define HSDMA_MAX_PLEN 0x3f80
|
||||
|
||||
struct hsdma_desc {
|
||||
u32 addr0;
|
||||
u32 flags;
|
||||
u32 addr1;
|
||||
u32 unused;
|
||||
};
|
||||
|
||||
struct mtk_hsdma_sg {
|
||||
dma_addr_t src_addr;
|
||||
dma_addr_t dst_addr;
|
||||
u32 len;
|
||||
};
|
||||
|
||||
struct mtk_hsdma_desc {
|
||||
struct virt_dma_desc vdesc;
|
||||
unsigned int num_sgs;
|
||||
struct mtk_hsdma_sg sg[1];
|
||||
};
|
||||
|
||||
struct mtk_hsdma_chan {
|
||||
struct virt_dma_chan vchan;
|
||||
unsigned int id;
|
||||
dma_addr_t desc_addr;
|
||||
int tx_idx;
|
||||
int rx_idx;
|
||||
struct hsdma_desc *tx_ring;
|
||||
struct hsdma_desc *rx_ring;
|
||||
struct mtk_hsdma_desc *desc;
|
||||
unsigned int next_sg;
|
||||
};
|
||||
|
||||
struct mtk_hsdam_engine {
|
||||
struct dma_device ddev;
|
||||
struct device_dma_parameters dma_parms;
|
||||
void __iomem *base;
|
||||
struct tasklet_struct task;
|
||||
volatile unsigned long chan_issued;
|
||||
|
||||
struct mtk_hsdma_chan chan[1];
|
||||
};
|
||||
|
||||
static inline struct mtk_hsdam_engine *mtk_hsdma_chan_get_dev(struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
return container_of(chan->vchan.chan.device, struct mtk_hsdam_engine,
|
||||
ddev);
|
||||
}
|
||||
|
||||
static inline struct mtk_hsdma_chan *to_mtk_hsdma_chan(struct dma_chan *c)
|
||||
{
|
||||
return container_of(c, struct mtk_hsdma_chan, vchan.chan);
|
||||
}
|
||||
|
||||
static inline struct mtk_hsdma_desc *to_mtk_hsdma_desc(struct virt_dma_desc *vdesc)
|
||||
{
|
||||
return container_of(vdesc, struct mtk_hsdma_desc, vdesc);
|
||||
}
|
||||
|
||||
static inline u32 mtk_hsdma_read(struct mtk_hsdam_engine *hsdma, u32 reg)
|
||||
{
|
||||
return readl(hsdma->base + reg);
|
||||
}
|
||||
|
||||
static inline void mtk_hsdma_write(struct mtk_hsdam_engine *hsdma,
|
||||
unsigned int reg, u32 val)
|
||||
{
|
||||
writel(val, hsdma->base + reg);
|
||||
}
|
||||
|
||||
static void mtk_hsdma_reset_chan(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
chan->tx_idx = 0;
|
||||
chan->rx_idx = HSDMA_DESCS_NUM - 1;
|
||||
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx);
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx);
|
||||
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG,
|
||||
0x1 << (chan->id + HSDMA_RST_TX_SHIFT));
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RST_CFG,
|
||||
0x1 << (chan->id + HSDMA_RST_RX_SHIFT));
|
||||
}
|
||||
|
||||
static void hsdma_dump_reg(struct mtk_hsdam_engine *hsdma)
|
||||
{
|
||||
dev_dbg(hsdma->ddev.dev,
|
||||
"tbase %08x, tcnt %08x, tctx %08x, tdtx: %08x, rbase %08x, rcnt %08x, rctx %08x, rdtx %08x\n",
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_TX_BASE),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_TX_CNT),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_TX_CTX),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_TX_DTX),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_RX_BASE),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_RX_CNT),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_RX_CRX),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX));
|
||||
|
||||
dev_dbg(hsdma->ddev.dev,
|
||||
"info %08x, glo %08x, delay %08x, intr_stat %08x, intr_mask %08x\n",
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_INFO),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_DELAY_INT),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS),
|
||||
mtk_hsdma_read(hsdma, HSDMA_REG_INT_MASK));
|
||||
}
|
||||
|
||||
static void hsdma_dump_desc(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
struct hsdma_desc *tx_desc;
|
||||
struct hsdma_desc *rx_desc;
|
||||
int i;
|
||||
|
||||
dev_dbg(hsdma->ddev.dev, "tx idx: %d, rx idx: %d\n",
|
||||
chan->tx_idx, chan->rx_idx);
|
||||
|
||||
for (i = 0; i < HSDMA_DESCS_NUM; i++) {
|
||||
tx_desc = &chan->tx_ring[i];
|
||||
rx_desc = &chan->rx_ring[i];
|
||||
|
||||
dev_dbg(hsdma->ddev.dev,
|
||||
"%d tx addr0: %08x, flags %08x, tx addr1: %08x, rx addr0 %08x, flags %08x\n",
|
||||
i, tx_desc->addr0, tx_desc->flags,
|
||||
tx_desc->addr1, rx_desc->addr0, rx_desc->flags);
|
||||
}
|
||||
}
|
||||
|
||||
static void mtk_hsdma_reset(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
int i;
|
||||
|
||||
/* disable dma */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0);
|
||||
|
||||
/* disable intr */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0);
|
||||
|
||||
/* init desc value */
|
||||
for (i = 0; i < HSDMA_DESCS_NUM; i++) {
|
||||
chan->tx_ring[i].addr0 = 0;
|
||||
chan->tx_ring[i].flags = HSDMA_DESC_LS0 | HSDMA_DESC_DONE;
|
||||
}
|
||||
for (i = 0; i < HSDMA_DESCS_NUM; i++) {
|
||||
chan->rx_ring[i].addr0 = 0;
|
||||
chan->rx_ring[i].flags = 0;
|
||||
}
|
||||
|
||||
/* reset */
|
||||
mtk_hsdma_reset_chan(hsdma, chan);
|
||||
|
||||
/* enable intr */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0);
|
||||
|
||||
/* enable dma */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT);
|
||||
}
|
||||
|
||||
static int mtk_hsdma_terminate_all(struct dma_chan *c)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
|
||||
struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan);
|
||||
unsigned long timeout;
|
||||
LIST_HEAD(head);
|
||||
|
||||
spin_lock_bh(&chan->vchan.lock);
|
||||
chan->desc = NULL;
|
||||
clear_bit(chan->id, &hsdma->chan_issued);
|
||||
vchan_get_all_descriptors(&chan->vchan, &head);
|
||||
spin_unlock_bh(&chan->vchan.lock);
|
||||
|
||||
vchan_dma_desc_free_list(&chan->vchan, &head);
|
||||
|
||||
/* wait dma transfer complete */
|
||||
timeout = jiffies + msecs_to_jiffies(2000);
|
||||
while (mtk_hsdma_read(hsdma, HSDMA_REG_GLO_CFG) &
|
||||
(HSDMA_GLO_RX_BUSY | HSDMA_GLO_TX_BUSY)) {
|
||||
if (time_after_eq(jiffies, timeout)) {
|
||||
hsdma_dump_desc(hsdma, chan);
|
||||
mtk_hsdma_reset(hsdma, chan);
|
||||
dev_err(hsdma->ddev.dev, "timeout, reset it\n");
|
||||
break;
|
||||
}
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int mtk_hsdma_start_transfer(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
dma_addr_t src, dst;
|
||||
size_t len, tlen;
|
||||
struct hsdma_desc *tx_desc, *rx_desc;
|
||||
struct mtk_hsdma_sg *sg;
|
||||
unsigned int i;
|
||||
int rx_idx;
|
||||
|
||||
sg = &chan->desc->sg[0];
|
||||
len = sg->len;
|
||||
chan->desc->num_sgs = DIV_ROUND_UP(len, HSDMA_MAX_PLEN);
|
||||
|
||||
/* tx desc */
|
||||
src = sg->src_addr;
|
||||
for (i = 0; i < chan->desc->num_sgs; i++) {
|
||||
tx_desc = &chan->tx_ring[chan->tx_idx];
|
||||
|
||||
if (len > HSDMA_MAX_PLEN)
|
||||
tlen = HSDMA_MAX_PLEN;
|
||||
else
|
||||
tlen = len;
|
||||
|
||||
if (i & 0x1) {
|
||||
tx_desc->addr1 = src;
|
||||
tx_desc->flags |= HSDMA_DESC_PLEN1(tlen);
|
||||
} else {
|
||||
tx_desc->addr0 = src;
|
||||
tx_desc->flags = HSDMA_DESC_PLEN0(tlen);
|
||||
|
||||
/* update index */
|
||||
chan->tx_idx = HSDMA_NEXT_DESC(chan->tx_idx);
|
||||
}
|
||||
|
||||
src += tlen;
|
||||
len -= tlen;
|
||||
}
|
||||
if (i & 0x1)
|
||||
tx_desc->flags |= HSDMA_DESC_LS0;
|
||||
else
|
||||
tx_desc->flags |= HSDMA_DESC_LS1;
|
||||
|
||||
/* rx desc */
|
||||
rx_idx = HSDMA_NEXT_DESC(chan->rx_idx);
|
||||
len = sg->len;
|
||||
dst = sg->dst_addr;
|
||||
for (i = 0; i < chan->desc->num_sgs; i++) {
|
||||
rx_desc = &chan->rx_ring[rx_idx];
|
||||
if (len > HSDMA_MAX_PLEN)
|
||||
tlen = HSDMA_MAX_PLEN;
|
||||
else
|
||||
tlen = len;
|
||||
|
||||
rx_desc->addr0 = dst;
|
||||
rx_desc->flags = HSDMA_DESC_PLEN0(tlen);
|
||||
|
||||
dst += tlen;
|
||||
len -= tlen;
|
||||
|
||||
/* update index */
|
||||
rx_idx = HSDMA_NEXT_DESC(rx_idx);
|
||||
}
|
||||
|
||||
/* make sure desc and index all up to date */
|
||||
wmb();
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_CTX, chan->tx_idx);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gdma_next_desc(struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
struct virt_dma_desc *vdesc;
|
||||
|
||||
vdesc = vchan_next_desc(&chan->vchan);
|
||||
if (!vdesc) {
|
||||
chan->desc = NULL;
|
||||
return 0;
|
||||
}
|
||||
chan->desc = to_mtk_hsdma_desc(vdesc);
|
||||
chan->next_sg = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void mtk_hsdma_chan_done(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
struct mtk_hsdma_desc *desc;
|
||||
int chan_issued;
|
||||
|
||||
chan_issued = 0;
|
||||
spin_lock_bh(&chan->vchan.lock);
|
||||
desc = chan->desc;
|
||||
if (likely(desc)) {
|
||||
if (chan->next_sg == desc->num_sgs) {
|
||||
list_del(&desc->vdesc.node);
|
||||
vchan_cookie_complete(&desc->vdesc);
|
||||
chan_issued = gdma_next_desc(chan);
|
||||
}
|
||||
} else {
|
||||
dev_dbg(hsdma->ddev.dev, "no desc to complete\n");
|
||||
}
|
||||
|
||||
if (chan_issued)
|
||||
set_bit(chan->id, &hsdma->chan_issued);
|
||||
spin_unlock_bh(&chan->vchan.lock);
|
||||
}
|
||||
|
||||
static irqreturn_t mtk_hsdma_irq(int irq, void *devid)
|
||||
{
|
||||
struct mtk_hsdam_engine *hsdma = devid;
|
||||
u32 status;
|
||||
|
||||
status = mtk_hsdma_read(hsdma, HSDMA_REG_INT_STATUS);
|
||||
if (unlikely(!status))
|
||||
return IRQ_NONE;
|
||||
|
||||
if (likely(status & HSDMA_INT_RX_Q0))
|
||||
tasklet_schedule(&hsdma->task);
|
||||
else
|
||||
dev_dbg(hsdma->ddev.dev, "unhandle irq status %08x\n", status);
|
||||
/* clean intr bits */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_INT_STATUS, status);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void mtk_hsdma_issue_pending(struct dma_chan *c)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
|
||||
struct mtk_hsdam_engine *hsdma = mtk_hsdma_chan_get_dev(chan);
|
||||
|
||||
spin_lock_bh(&chan->vchan.lock);
|
||||
if (vchan_issue_pending(&chan->vchan) && !chan->desc) {
|
||||
if (gdma_next_desc(chan)) {
|
||||
set_bit(chan->id, &hsdma->chan_issued);
|
||||
tasklet_schedule(&hsdma->task);
|
||||
} else {
|
||||
dev_dbg(hsdma->ddev.dev, "no desc to issue\n");
|
||||
}
|
||||
}
|
||||
spin_unlock_bh(&chan->vchan.lock);
|
||||
}
|
||||
|
||||
static struct dma_async_tx_descriptor *mtk_hsdma_prep_dma_memcpy(
|
||||
struct dma_chan *c, dma_addr_t dest, dma_addr_t src,
|
||||
size_t len, unsigned long flags)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan = to_mtk_hsdma_chan(c);
|
||||
struct mtk_hsdma_desc *desc;
|
||||
|
||||
if (len <= 0)
|
||||
return NULL;
|
||||
|
||||
desc = kzalloc(sizeof(*desc), GFP_ATOMIC);
|
||||
if (!desc) {
|
||||
dev_err(c->device->dev, "alloc memcpy decs error\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
desc->sg[0].src_addr = src;
|
||||
desc->sg[0].dst_addr = dest;
|
||||
desc->sg[0].len = len;
|
||||
|
||||
return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags);
|
||||
}
|
||||
|
||||
static enum dma_status mtk_hsdma_tx_status(struct dma_chan *c,
|
||||
dma_cookie_t cookie,
|
||||
struct dma_tx_state *state)
|
||||
{
|
||||
return dma_cookie_status(c, cookie, state);
|
||||
}
|
||||
|
||||
static void mtk_hsdma_free_chan_resources(struct dma_chan *c)
|
||||
{
|
||||
vchan_free_chan_resources(to_virt_chan(c));
|
||||
}
|
||||
|
||||
static void mtk_hsdma_desc_free(struct virt_dma_desc *vdesc)
|
||||
{
|
||||
kfree(container_of(vdesc, struct mtk_hsdma_desc, vdesc));
|
||||
}
|
||||
|
||||
static void mtk_hsdma_tx(struct mtk_hsdam_engine *hsdma)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan;
|
||||
|
||||
if (test_and_clear_bit(0, &hsdma->chan_issued)) {
|
||||
chan = &hsdma->chan[0];
|
||||
if (chan->desc)
|
||||
mtk_hsdma_start_transfer(hsdma, chan);
|
||||
else
|
||||
dev_dbg(hsdma->ddev.dev, "chan 0 no desc to issue\n");
|
||||
}
|
||||
}
|
||||
|
||||
static void mtk_hsdma_rx(struct mtk_hsdam_engine *hsdma)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan;
|
||||
int next_idx, drx_idx, cnt;
|
||||
|
||||
chan = &hsdma->chan[0];
|
||||
next_idx = HSDMA_NEXT_DESC(chan->rx_idx);
|
||||
drx_idx = mtk_hsdma_read(hsdma, HSDMA_REG_RX_DRX);
|
||||
|
||||
cnt = (drx_idx - next_idx) & HSDMA_DESCS_MASK;
|
||||
if (!cnt)
|
||||
return;
|
||||
|
||||
chan->next_sg += cnt;
|
||||
chan->rx_idx = (chan->rx_idx + cnt) & HSDMA_DESCS_MASK;
|
||||
|
||||
/* update rx crx */
|
||||
wmb();
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_CRX, chan->rx_idx);
|
||||
|
||||
mtk_hsdma_chan_done(hsdma, chan);
|
||||
}
|
||||
|
||||
static void mtk_hsdma_tasklet(struct tasklet_struct *t)
|
||||
{
|
||||
struct mtk_hsdam_engine *hsdma = from_tasklet(hsdma, t, task);
|
||||
|
||||
mtk_hsdma_rx(hsdma);
|
||||
mtk_hsdma_tx(hsdma);
|
||||
}
|
||||
|
||||
static int mtk_hsdam_alloc_desc(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
int i;
|
||||
|
||||
chan->tx_ring = dma_alloc_coherent(hsdma->ddev.dev,
|
||||
2 * HSDMA_DESCS_NUM *
|
||||
sizeof(*chan->tx_ring),
|
||||
&chan->desc_addr, GFP_ATOMIC | __GFP_ZERO);
|
||||
if (!chan->tx_ring)
|
||||
goto no_mem;
|
||||
|
||||
chan->rx_ring = &chan->tx_ring[HSDMA_DESCS_NUM];
|
||||
|
||||
/* init tx ring value */
|
||||
for (i = 0; i < HSDMA_DESCS_NUM; i++)
|
||||
chan->tx_ring[i].flags = HSDMA_DESC_LS0 | HSDMA_DESC_DONE;
|
||||
|
||||
return 0;
|
||||
no_mem:
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
static void mtk_hsdam_free_desc(struct mtk_hsdam_engine *hsdma,
|
||||
struct mtk_hsdma_chan *chan)
|
||||
{
|
||||
if (chan->tx_ring) {
|
||||
dma_free_coherent(hsdma->ddev.dev,
|
||||
2 * HSDMA_DESCS_NUM * sizeof(*chan->tx_ring),
|
||||
chan->tx_ring, chan->desc_addr);
|
||||
chan->tx_ring = NULL;
|
||||
chan->rx_ring = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static int mtk_hsdma_init(struct mtk_hsdam_engine *hsdma)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan;
|
||||
int ret;
|
||||
u32 reg;
|
||||
|
||||
/* init desc */
|
||||
chan = &hsdma->chan[0];
|
||||
ret = mtk_hsdam_alloc_desc(hsdma, chan);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* tx */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, chan->desc_addr);
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, HSDMA_DESCS_NUM);
|
||||
/* rx */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, chan->desc_addr +
|
||||
(sizeof(struct hsdma_desc) * HSDMA_DESCS_NUM));
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, HSDMA_DESCS_NUM);
|
||||
/* reset */
|
||||
mtk_hsdma_reset_chan(hsdma, chan);
|
||||
|
||||
/* enable rx intr */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, HSDMA_INT_RX_Q0);
|
||||
|
||||
/* enable dma */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, HSDMA_GLO_DEFAULT);
|
||||
|
||||
/* hardware info */
|
||||
reg = mtk_hsdma_read(hsdma, HSDMA_REG_INFO);
|
||||
dev_info(hsdma->ddev.dev, "rx: %d, tx: %d\n",
|
||||
(reg >> HSDMA_INFO_RX_SHIFT) & HSDMA_INFO_RX_MASK,
|
||||
(reg >> HSDMA_INFO_TX_SHIFT) & HSDMA_INFO_TX_MASK);
|
||||
|
||||
hsdma_dump_reg(hsdma);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void mtk_hsdma_uninit(struct mtk_hsdam_engine *hsdma)
|
||||
{
|
||||
struct mtk_hsdma_chan *chan;
|
||||
|
||||
/* disable dma */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_GLO_CFG, 0);
|
||||
|
||||
/* disable intr */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_INT_MASK, 0);
|
||||
|
||||
/* free desc */
|
||||
chan = &hsdma->chan[0];
|
||||
mtk_hsdam_free_desc(hsdma, chan);
|
||||
|
||||
/* tx */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_BASE, 0);
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_TX_CNT, 0);
|
||||
/* rx */
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_BASE, 0);
|
||||
mtk_hsdma_write(hsdma, HSDMA_REG_RX_CNT, 0);
|
||||
/* reset */
|
||||
mtk_hsdma_reset_chan(hsdma, chan);
|
||||
}
|
||||
|
||||
static const struct of_device_id mtk_hsdma_of_match[] = {
|
||||
{ .compatible = "mediatek,mt7621-hsdma" },
|
||||
{ },
|
||||
};
|
||||
|
||||
static int mtk_hsdma_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct of_device_id *match;
|
||||
struct mtk_hsdma_chan *chan;
|
||||
struct mtk_hsdam_engine *hsdma;
|
||||
struct dma_device *dd;
|
||||
int ret;
|
||||
int irq;
|
||||
void __iomem *base;
|
||||
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
match = of_match_device(mtk_hsdma_of_match, &pdev->dev);
|
||||
if (!match)
|
||||
return -EINVAL;
|
||||
|
||||
hsdma = devm_kzalloc(&pdev->dev, sizeof(*hsdma), GFP_KERNEL);
|
||||
if (!hsdma)
|
||||
return -EINVAL;
|
||||
|
||||
base = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_ERR(base))
|
||||
return PTR_ERR(base);
|
||||
hsdma->base = base + HSDMA_BASE_OFFSET;
|
||||
tasklet_setup(&hsdma->task, mtk_hsdma_tasklet);
|
||||
|
||||
irq = platform_get_irq(pdev, 0);
|
||||
if (irq < 0)
|
||||
return -EINVAL;
|
||||
ret = devm_request_irq(&pdev->dev, irq, mtk_hsdma_irq,
|
||||
0, dev_name(&pdev->dev), hsdma);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to request irq\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
device_reset(&pdev->dev);
|
||||
|
||||
dd = &hsdma->ddev;
|
||||
dma_cap_set(DMA_MEMCPY, dd->cap_mask);
|
||||
dd->copy_align = HSDMA_ALIGN_SIZE;
|
||||
dd->device_free_chan_resources = mtk_hsdma_free_chan_resources;
|
||||
dd->device_prep_dma_memcpy = mtk_hsdma_prep_dma_memcpy;
|
||||
dd->device_terminate_all = mtk_hsdma_terminate_all;
|
||||
dd->device_tx_status = mtk_hsdma_tx_status;
|
||||
dd->device_issue_pending = mtk_hsdma_issue_pending;
|
||||
dd->dev = &pdev->dev;
|
||||
dd->dev->dma_parms = &hsdma->dma_parms;
|
||||
dma_set_max_seg_size(dd->dev, HSDMA_MAX_PLEN);
|
||||
INIT_LIST_HEAD(&dd->channels);
|
||||
|
||||
chan = &hsdma->chan[0];
|
||||
chan->id = 0;
|
||||
chan->vchan.desc_free = mtk_hsdma_desc_free;
|
||||
vchan_init(&chan->vchan, dd);
|
||||
|
||||
/* init hardware */
|
||||
ret = mtk_hsdma_init(hsdma);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to alloc ring descs\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = dma_async_device_register(dd);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register dma device\n");
|
||||
goto err_uninit_hsdma;
|
||||
}
|
||||
|
||||
ret = of_dma_controller_register(pdev->dev.of_node,
|
||||
of_dma_xlate_by_chan_id, hsdma);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to register of dma controller\n");
|
||||
goto err_unregister;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, hsdma);
|
||||
|
||||
return 0;
|
||||
|
||||
err_unregister:
|
||||
dma_async_device_unregister(dd);
|
||||
err_uninit_hsdma:
|
||||
mtk_hsdma_uninit(hsdma);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int mtk_hsdma_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev);
|
||||
|
||||
mtk_hsdma_uninit(hsdma);
|
||||
|
||||
of_dma_controller_free(pdev->dev.of_node);
|
||||
dma_async_device_unregister(&hsdma->ddev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct platform_driver mtk_hsdma_driver = {
|
||||
.probe = mtk_hsdma_probe,
|
||||
.remove = mtk_hsdma_remove,
|
||||
.driver = {
|
||||
.name = KBUILD_MODNAME,
|
||||
.of_match_table = mtk_hsdma_of_match,
|
||||
},
|
||||
};
|
||||
module_platform_driver(mtk_hsdma_driver);
|
||||
|
||||
MODULE_AUTHOR("Michael Lee <igvtee@gmail.com>");
|
||||
MODULE_DESCRIPTION("MTK HSDMA driver");
|
||||
MODULE_LICENSE("GPL v2");
|
@ -146,44 +146,6 @@
|
||||
pinctrl-names = "default";
|
||||
pinctrl-0 = <&spi_pins>;
|
||||
};
|
||||
|
||||
gdma: gdma@2800 {
|
||||
compatible = "ralink,rt3883-gdma";
|
||||
reg = <0x2800 0x800>;
|
||||
|
||||
clocks = <&sysc MT7621_CLK_GDMA>;
|
||||
clock-names = "gdma";
|
||||
resets = <&rstctrl 14>;
|
||||
reset-names = "dma";
|
||||
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
#dma-cells = <1>;
|
||||
#dma-channels = <16>;
|
||||
#dma-requests = <16>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
hsdma: hsdma@7000 {
|
||||
compatible = "mediatek,mt7621-hsdma";
|
||||
reg = <0x7000 0x1000>;
|
||||
|
||||
clocks = <&sysc MT7621_CLK_HSDMA>;
|
||||
clock-names = "hsdma";
|
||||
resets = <&rstctrl 5>;
|
||||
reset-names = "hsdma";
|
||||
|
||||
interrupt-parent = <&gic>;
|
||||
interrupts = <0 11 IRQ_TYPE_LEVEL_HIGH>;
|
||||
|
||||
#dma-cells = <1>;
|
||||
#dma-channels = <1>;
|
||||
#dma-requests = <1>;
|
||||
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
pinctrl: pinctrl {
|
||||
|
@ -92,7 +92,7 @@ struct pi433_device {
|
||||
u32 rx_bytes_to_drop;
|
||||
u32 rx_bytes_dropped;
|
||||
unsigned int rx_position;
|
||||
struct mutex rx_lock;
|
||||
struct mutex rx_lock; /* protects rx_* variable accesses */
|
||||
wait_queue_head_t rx_wait_queue;
|
||||
|
||||
/* fifo wait queue */
|
||||
|
@ -113,7 +113,7 @@ int rf69_set_mode(struct spi_device *spi, enum mode mode)
|
||||
};
|
||||
|
||||
if (unlikely(mode >= ARRAY_SIZE(mode_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal mode %u", mode);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -143,7 +143,7 @@ int rf69_set_modulation(struct spi_device *spi, enum modulation modulation)
|
||||
};
|
||||
|
||||
if (unlikely(modulation >= ARRAY_SIZE(modulation_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal modulation %u", modulation);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -191,7 +191,7 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
|
||||
MASK_DATAMODUL_MODULATION_SHAPE,
|
||||
DATAMODUL_MODULATION_SHAPE_0_3);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal mod shaping for FSK %u", mod_shaping);
|
||||
return -EINVAL;
|
||||
}
|
||||
case OOK:
|
||||
@ -209,7 +209,7 @@ int rf69_set_modulation_shaping(struct spi_device *spi,
|
||||
MASK_DATAMODUL_MODULATION_SHAPE,
|
||||
DATAMODUL_MODULATION_SHAPE_2BR);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal mod shaping for OOK %u", mod_shaping);
|
||||
return -EINVAL;
|
||||
}
|
||||
default:
|
||||
@ -255,13 +255,25 @@ int rf69_set_deviation(struct spi_device *spi, u32 deviation)
|
||||
int retval;
|
||||
u64 f_reg;
|
||||
u64 f_step;
|
||||
u32 bit_rate_reg;
|
||||
u32 bit_rate;
|
||||
u8 msb;
|
||||
u8 lsb;
|
||||
u64 factor = 1000000; // to improve precision of calculation
|
||||
|
||||
// TODO: Dependency to bitrate
|
||||
if (deviation < 600 || deviation > 500000) {
|
||||
dev_dbg(&spi->dev, "set_deviation: illegal input param");
|
||||
// calculate bit rate
|
||||
bit_rate_reg = rf69_read_reg(spi, REG_BITRATE_MSB) << 8;
|
||||
bit_rate_reg |= rf69_read_reg(spi, REG_BITRATE_LSB);
|
||||
bit_rate = F_OSC / bit_rate_reg;
|
||||
|
||||
/*
|
||||
* frequency deviation must exceed 600 Hz but not exceed
|
||||
* 500kHz when taking bitrate dependency into consideration
|
||||
* to ensure proper modulation
|
||||
*/
|
||||
if (deviation < 600 || (deviation + (bit_rate / 2)) > 500000) {
|
||||
dev_dbg(&spi->dev,
|
||||
"set_deviation: illegal input param: %u", deviation);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -392,7 +404,7 @@ int rf69_set_output_power_level(struct spi_device *spi, u8 power_level)
|
||||
return rf69_read_mod_write(spi, REG_PALEVEL, MASK_PALEVEL_OUTPUT_POWER,
|
||||
power_level);
|
||||
failed:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal power level %u", power_level);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -417,7 +429,7 @@ int rf69_set_pa_ramp(struct spi_device *spi, enum pa_ramp pa_ramp)
|
||||
};
|
||||
|
||||
if (unlikely(pa_ramp >= ARRAY_SIZE(pa_ramp_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal pa_ramp %u", pa_ramp);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -433,7 +445,7 @@ int rf69_set_antenna_impedance(struct spi_device *spi,
|
||||
case two_hundred_ohm:
|
||||
return rf69_set_bit(spi, REG_LNA, MASK_LNA_ZIN);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal antenna impedance %u", antenna_impedance);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@ -451,7 +463,7 @@ int rf69_set_lna_gain(struct spi_device *spi, enum lna_gain lna_gain)
|
||||
};
|
||||
|
||||
if (unlikely(lna_gain >= ARRAY_SIZE(lna_gain_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal lna gain %u", lna_gain);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -466,14 +478,14 @@ static int rf69_set_bandwidth_intern(struct spi_device *spi, u8 reg,
|
||||
|
||||
// check value for mantisse and exponent
|
||||
if (exponent > 7) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal bandwidth exponent %u", exponent);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((mantisse != mantisse16) &&
|
||||
(mantisse != mantisse20) &&
|
||||
(mantisse != mantisse24)) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
if (mantisse != mantisse16 &&
|
||||
mantisse != mantisse20 &&
|
||||
mantisse != mantisse24) {
|
||||
dev_dbg(&spi->dev, "set: illegal bandwidth mantisse %u", mantisse);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -531,7 +543,7 @@ int rf69_set_ook_threshold_dec(struct spi_device *spi,
|
||||
};
|
||||
|
||||
if (unlikely(threshold_decrement >= ARRAY_SIZE(td_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal OOK threshold decrement %u", threshold_decrement);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -578,7 +590,7 @@ int rf69_set_dio_mapping(struct spi_device *spi, u8 dio_number, u8 value)
|
||||
dio_addr = REG_DIOMAPPING2;
|
||||
break;
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal dio number %u", dio_number);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -681,7 +693,7 @@ int rf69_set_fifo_fill_condition(struct spi_device *spi,
|
||||
return rf69_clear_bit(spi, REG_SYNC_CONFIG,
|
||||
MASK_SYNC_CONFIG_FIFO_FILL_CONDITION);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal fifo fill condition %u", fifo_fill_condition);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@ -690,7 +702,7 @@ int rf69_set_sync_size(struct spi_device *spi, u8 sync_size)
|
||||
{
|
||||
// check input value
|
||||
if (sync_size > 0x07) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal sync size %u", sync_size);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -727,7 +739,7 @@ int rf69_set_packet_format(struct spi_device *spi,
|
||||
return rf69_clear_bit(spi, REG_PACKETCONFIG1,
|
||||
MASK_PACKETCONFIG1_PACKET_FORMAT_VARIABLE);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal packet format %u", packet_format);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@ -753,7 +765,7 @@ int rf69_set_address_filtering(struct spi_device *spi,
|
||||
};
|
||||
|
||||
if (unlikely(address_filtering >= ARRAY_SIZE(af_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal address filtering %u", address_filtering);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -788,7 +800,7 @@ int rf69_set_tx_start_condition(struct spi_device *spi,
|
||||
return rf69_set_bit(spi, REG_FIFO_THRESH,
|
||||
MASK_FIFO_THRESH_TXSTART);
|
||||
default:
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal tx start condition %u", tx_start_condition);
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
@ -799,7 +811,7 @@ int rf69_set_fifo_threshold(struct spi_device *spi, u8 threshold)
|
||||
|
||||
/* check input value */
|
||||
if (threshold & 0x80) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal fifo threshold %u", threshold);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -826,7 +838,7 @@ int rf69_set_dagc(struct spi_device *spi, enum dagc dagc)
|
||||
};
|
||||
|
||||
if (unlikely(dagc >= ARRAY_SIZE(dagc_map))) {
|
||||
dev_dbg(&spi->dev, "set: illegal input param");
|
||||
dev_dbg(&spi->dev, "set: illegal dagc %u", dagc);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
@ -110,12 +110,24 @@ enum fifo_fill_condition {
|
||||
};
|
||||
|
||||
enum packet_format {
|
||||
/*
|
||||
* Used when the size of payload is fixed in advance. This mode of
|
||||
* operation may be of interest to minimize RF overhead by 1 byte as
|
||||
* no length byte field is required
|
||||
*/
|
||||
packet_length_fix,
|
||||
/*
|
||||
* Used when the size of payload isn't known in advance. It requires the
|
||||
* transmitter to send the length byte in each packet so the receiver
|
||||
* would know how to operate properly
|
||||
*/
|
||||
packet_length_var
|
||||
};
|
||||
|
||||
enum tx_start_condition {
|
||||
/* the number of bytes in the FIFO exceeds FIFO_THRESHOLD */
|
||||
fifo_level,
|
||||
/* at least one byte in the FIFO */
|
||||
fifo_not_empty
|
||||
};
|
||||
|
||||
|
@ -11,7 +11,6 @@ r8188eu-y = \
|
||||
hal/hal_com.o \
|
||||
hal/odm.o \
|
||||
hal/odm_debug.o \
|
||||
hal/odm_interface.o \
|
||||
hal/odm_HWConfig.o \
|
||||
hal/odm_RegConfig8188E.o \
|
||||
hal/odm_RTL8188E.o \
|
||||
@ -21,9 +20,7 @@ r8188eu-y = \
|
||||
hal/rtl8188e_phycfg.o \
|
||||
hal/rtl8188e_rf6052.o \
|
||||
hal/rtl8188e_rxdesc.o \
|
||||
hal/rtl8188e_sreset.o \
|
||||
hal/rtl8188e_xmit.o \
|
||||
hal/rtl8188eu_led.o \
|
||||
hal/rtl8188eu_recv.o \
|
||||
hal/rtl8188eu_xmit.o \
|
||||
hal/usb_halinit.o \
|
||||
|
@ -318,7 +318,6 @@ void expire_timeout_chk(struct adapter *padapter)
|
||||
void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
||||
{
|
||||
int i;
|
||||
u8 rf_type;
|
||||
u32 init_rate = 0;
|
||||
unsigned char sta_band = 0, raid, shortGIrate = false;
|
||||
unsigned char limit;
|
||||
@ -342,11 +341,7 @@ void add_RATid(struct adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
||||
}
|
||||
/* n mode ra_bitmap */
|
||||
if (psta_ht->ht_option) {
|
||||
GetHwReg8188EU(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if (rf_type == RF_2T2R)
|
||||
limit = 16;/* 2R */
|
||||
else
|
||||
limit = 8;/* 1R */
|
||||
limit = 8; /* 1R */
|
||||
|
||||
for (i = 0; i < limit; i++) {
|
||||
if (psta_ht->ht_cap.mcs.rx_mask[i / 8] & BIT(i % 8))
|
||||
@ -452,7 +447,7 @@ void update_bmc_sta(struct adapter *padapter)
|
||||
init_rate = get_highest_rate_idx(tx_ra_bitmap & 0x0fffffff) & 0x3f;
|
||||
|
||||
/* ap mode */
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_STA_INFO, psta, true);
|
||||
rtl8188e_SetHalODMVar(padapter, psta, true);
|
||||
|
||||
{
|
||||
u8 arg = 0;
|
||||
@ -504,7 +499,7 @@ void update_sta_info_apmode(struct adapter *padapter, struct sta_info *psta)
|
||||
DBG_88E("%s\n", __func__);
|
||||
|
||||
/* ap mode */
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_STA_INFO, psta, true);
|
||||
rtl8188e_SetHalODMVar(padapter, psta, true);
|
||||
|
||||
if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
psta->ieee8021x_blocked = true;
|
||||
|
@ -105,19 +105,10 @@ static int skb_pull_and_merge(struct sk_buff *skb, unsigned char *src, int len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned long __nat25_timeout(struct adapter *priv)
|
||||
{
|
||||
unsigned long timeout;
|
||||
|
||||
timeout = jiffies - NAT25_AGEING_TIME*HZ;
|
||||
|
||||
return timeout;
|
||||
}
|
||||
|
||||
static int __nat25_has_expired(struct adapter *priv,
|
||||
struct nat25_network_db_entry *fdb)
|
||||
{
|
||||
if (time_before_eq(fdb->ageing_timer, __nat25_timeout(priv)))
|
||||
if (time_before_eq(fdb->ageing_timer, jiffies - NAT25_AGEING_TIME * HZ))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "../include/rtw_br_ext.h"
|
||||
#include "../include/rtw_mlme_ext.h"
|
||||
#include "../include/rtl8188e_dm.h"
|
||||
#include "../include/rtl8188e_sreset.h"
|
||||
|
||||
/*
|
||||
Caller and the rtw_cmd_thread can protect cmd_q by spin_lock.
|
||||
@ -51,7 +50,6 @@ static int _rtw_init_cmd_priv(struct cmd_priv *pcmdpriv)
|
||||
|
||||
pcmdpriv->rsp_buf = pcmdpriv->rsp_allocated_buf + 4 - ((size_t)(pcmdpriv->rsp_allocated_buf) & 3);
|
||||
|
||||
pcmdpriv->cmd_issued_cnt = 0;
|
||||
pcmdpriv->cmd_done_cnt = 0;
|
||||
pcmdpriv->rsp_cnt = 0;
|
||||
exit:
|
||||
@ -69,7 +67,7 @@ static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
atomic_set(&pevtpriv->event_seq, 0);
|
||||
pevtpriv->evt_done_cnt = 0;
|
||||
|
||||
_init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
|
||||
INIT_WORK(&pevtpriv->c2h_wk, c2h_wk_callback);
|
||||
pevtpriv->c2h_wk_alive = false;
|
||||
pevtpriv->c2h_queue = rtw_cbuf_alloc(C2H_QUEUE_MAX_LEN + 1);
|
||||
|
||||
@ -78,7 +76,7 @@ static int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
|
||||
void rtw_free_evt_priv(struct evt_priv *pevtpriv)
|
||||
{
|
||||
_cancel_workitem_sync(&pevtpriv->c2h_wk);
|
||||
cancel_work_sync(&pevtpriv->c2h_wk);
|
||||
while (pevtpriv->c2h_wk_alive)
|
||||
msleep(10);
|
||||
|
||||
@ -255,8 +253,9 @@ int rtw_cmd_thread(void *context)
|
||||
_next:
|
||||
if (padapter->bDriverStopped ||
|
||||
padapter->bSurpriseRemoved) {
|
||||
DBG_88E("%s: DriverStopped(%d) SurpriseRemoved(%d) break at line %d\n",
|
||||
__func__, padapter->bDriverStopped, padapter->bSurpriseRemoved, __LINE__);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"DriverStopped(%d) SurpriseRemoved(%d) break\n",
|
||||
padapter->bDriverStopped, padapter->bSurpriseRemoved);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -269,8 +268,6 @@ _next:
|
||||
goto post_process;
|
||||
}
|
||||
|
||||
pcmdpriv->cmd_issued_cnt++;
|
||||
|
||||
pcmd->cmdsz = _RND4((pcmd->cmdsz));/* _RND4 */
|
||||
|
||||
memcpy(pcmdbuf, pcmd->parmbuf, pcmd->cmdsz);
|
||||
@ -316,8 +313,6 @@ post_process:
|
||||
if (!pcmd)
|
||||
break;
|
||||
|
||||
/* DBG_88E("%s: leaving... drop cmdcode:%u\n", __func__, pcmd->cmdcode); */
|
||||
|
||||
rtw_free_cmd_obj(pcmd);
|
||||
} while (1);
|
||||
|
||||
@ -579,7 +574,7 @@ u8 rtw_joinbss_cmd(struct adapter *padapter, struct wlan_network *pnetwork)
|
||||
else
|
||||
padapter->pwrctrlpriv.smart_ps = padapter->registrypriv.smart_ps;
|
||||
|
||||
DBG_88E("%s: smart_ps =%d\n", __func__, padapter->pwrctrlpriv.smart_ps);
|
||||
netdev_dbg(padapter->pnetdev, "smart_ps = %d\n", padapter->pwrctrlpriv.smart_ps);
|
||||
|
||||
pcmd->cmdsz = get_wlan_bssid_ex_sz(psecnetwork);/* get cmdsz before endian conversion */
|
||||
|
||||
@ -800,8 +795,6 @@ u8 rtw_addbareq_cmd(struct adapter *padapter, u8 tid, u8 *addr)
|
||||
|
||||
init_h2fwcmd_w_parm_no_rsp(ph2c, paddbareq_parm, GEN_CMD_CODE(_AddBAReq));
|
||||
|
||||
/* DBG_88E("rtw_addbareq_cmd, tid =%d\n", tid); */
|
||||
|
||||
/* rtw_enqueue_cmd(pcmdpriv, ph2c); */
|
||||
res = rtw_enqueue_cmd(pcmdpriv, ph2c);
|
||||
|
||||
@ -953,7 +946,19 @@ static void traffic_status_watchdog(struct adapter *padapter)
|
||||
pmlmepriv->LinkDetectInfo.bHigherBusyTxTraffic = bHigherBusyTxTraffic;
|
||||
}
|
||||
|
||||
static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf, int sz)
|
||||
static void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
||||
{
|
||||
u32 txdma_status;
|
||||
|
||||
txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
|
||||
if (txdma_status != 0x00) {
|
||||
DBG_88E("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status);
|
||||
rtw_write32(padapter, REG_TXDMA_STATUS, txdma_status);
|
||||
}
|
||||
/* total xmit irp = 4 */
|
||||
}
|
||||
|
||||
static void dynamic_chk_wk_hdl(struct adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv;
|
||||
|
||||
@ -1003,7 +1008,6 @@ static void lps_ctrl_wk_hdl(struct adapter *padapter, u8 lps_ctrl_type)
|
||||
SetHwReg8188EU(padapter, HW_VAR_H2C_FW_JOINBSSRPT, (u8 *)(&mstatus));
|
||||
break;
|
||||
case LPS_CTRL_SPECIAL_PACKET:
|
||||
/* DBG_88E("LPS_CTRL_SPECIAL_PACKET\n"); */
|
||||
pwrpriv->DelayLPSLastTimeStamp = jiffies;
|
||||
LPS_Leave(padapter);
|
||||
break;
|
||||
@ -1374,7 +1378,7 @@ u8 rtw_drvextra_cmd_hdl(struct adapter *padapter, unsigned char *pbuf)
|
||||
|
||||
switch (pdrvextra_cmd->ec_id) {
|
||||
case DYNAMIC_CHK_WK_CID:
|
||||
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf, pdrvextra_cmd->type_size);
|
||||
dynamic_chk_wk_hdl(padapter, pdrvextra_cmd->pbuf);
|
||||
break;
|
||||
case POWER_SAVING_CTRL_WK_CID:
|
||||
rtw_ps_processor(padapter);
|
||||
|
@ -6,70 +6,7 @@
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/rtw_efuse.h"
|
||||
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
u8 fakeEfuseBank;
|
||||
u32 fakeEfuseUsedBytes;
|
||||
u8 fakeEfuseContent[EFUSE_MAX_HW_SIZE] = {0};
|
||||
u8 fakeEfuseInitMap[EFUSE_MAX_MAP_LEN] = {0};
|
||||
u8 fakeEfuseModifiedMap[EFUSE_MAX_MAP_LEN] = {0};
|
||||
|
||||
u32 BTEfuseUsedBytes;
|
||||
u8 BTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 BTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
u8 BTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
|
||||
u32 fakeBTEfuseUsedBytes;
|
||||
u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN] = {0};
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
|
||||
#define REG_EFUSE_CTRL 0x0030
|
||||
#define EFUSE_CTRL REG_EFUSE_CTRL /* E-Fuse Control. */
|
||||
|
||||
static bool Efuse_Read1ByteFromFakeContent(u16 Offset, u8 *Value)
|
||||
{
|
||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
||||
return false;
|
||||
if (fakeEfuseBank == 0)
|
||||
*Value = fakeEfuseContent[Offset];
|
||||
else
|
||||
*Value = fakeBTEfuseContent[fakeEfuseBank - 1][Offset];
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
Efuse_Write1ByteToFakeContent(
|
||||
struct adapter *pAdapter,
|
||||
u16 Offset,
|
||||
u8 Value)
|
||||
{
|
||||
if (Offset >= EFUSE_MAX_HW_SIZE)
|
||||
return false;
|
||||
if (fakeEfuseBank == 0) {
|
||||
fakeEfuseContent[Offset] = Value;
|
||||
} else {
|
||||
fakeBTEfuseContent[fakeEfuseBank - 1][Offset] = Value;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/* 11/16/2008 MH Add description. Get current efuse area enabled word!!. */
|
||||
u8
|
||||
Efuse_CalculateWordCnts(u8 word_en)
|
||||
{
|
||||
u8 word_cnts = 0;
|
||||
if (!(word_en & BIT(0)))
|
||||
word_cnts++; /* 0 : write enable */
|
||||
if (!(word_en & BIT(1)))
|
||||
word_cnts++;
|
||||
if (!(word_en & BIT(2)))
|
||||
word_cnts++;
|
||||
if (!(word_en & BIT(3)))
|
||||
word_cnts++;
|
||||
return word_cnts;
|
||||
}
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
/* */
|
||||
/* Description: */
|
||||
@ -86,18 +23,12 @@ void
|
||||
ReadEFuseByte(
|
||||
struct adapter *Adapter,
|
||||
u16 _offset,
|
||||
u8 *pbuf,
|
||||
bool pseudo)
|
||||
u8 *pbuf)
|
||||
{
|
||||
u32 value32;
|
||||
u8 readbyte;
|
||||
u16 retry;
|
||||
|
||||
if (pseudo) {
|
||||
Efuse_Read1ByteFromFakeContent(_offset, pbuf);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Write Address */
|
||||
rtw_write8(Adapter, EFUSE_CTRL + 1, (_offset & 0xff));
|
||||
readbyte = rtw_read8(Adapter, EFUSE_CTRL + 2);
|
||||
@ -125,134 +56,6 @@ ReadEFuseByte(
|
||||
*pbuf = (u8)(value32 & 0xff);
|
||||
}
|
||||
|
||||
/* 11/16/2008 MH Read one byte from real Efuse. */
|
||||
u8 efuse_OneByteRead(struct adapter *pAdapter, u16 addr, u8 *data, bool pseudo)
|
||||
{
|
||||
u8 tmpidx = 0;
|
||||
u8 result;
|
||||
|
||||
if (pseudo) {
|
||||
result = Efuse_Read1ByteFromFakeContent(addr, data);
|
||||
return result;
|
||||
}
|
||||
/* -----------------e-fuse reg ctrl --------------------------------- */
|
||||
/* address */
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 1, (u8)(addr & 0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 2, ((u8)((addr >> 8) & 0x03)) |
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL + 2) & 0xFC));
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 3, 0x72);/* read cmd */
|
||||
|
||||
while (!(0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100))
|
||||
tmpidx++;
|
||||
if (tmpidx < 100) {
|
||||
*data = rtw_read8(pAdapter, EFUSE_CTRL);
|
||||
result = true;
|
||||
} else {
|
||||
*data = 0xff;
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/* 11/16/2008 MH Write one byte to reald Efuse. */
|
||||
u8 efuse_OneByteWrite(struct adapter *pAdapter, u16 addr, u8 data, bool pseudo)
|
||||
{
|
||||
u8 tmpidx = 0;
|
||||
u8 result;
|
||||
|
||||
if (pseudo) {
|
||||
result = Efuse_Write1ByteToFakeContent(pAdapter, addr, data);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* -----------------e-fuse reg ctrl --------------------------------- */
|
||||
/* address */
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 1, (u8)(addr & 0xff));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 2,
|
||||
(rtw_read8(pAdapter, EFUSE_CTRL + 2) & 0xFC) |
|
||||
(u8)((addr >> 8) & 0x03));
|
||||
rtw_write8(pAdapter, EFUSE_CTRL, data);/* data */
|
||||
|
||||
rtw_write8(pAdapter, EFUSE_CTRL + 3, 0xF2);/* write cmd */
|
||||
|
||||
while ((0x80 & rtw_read8(pAdapter, EFUSE_CTRL + 3)) && (tmpidx < 100))
|
||||
tmpidx++;
|
||||
|
||||
if (tmpidx < 100)
|
||||
result = true;
|
||||
else
|
||||
result = false;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: efuse_WordEnableDataRead
|
||||
*
|
||||
* Overview: Read allowed word in current efuse section data.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/16/2008 MHC Create Version 0.
|
||||
* 11/21/2008 MHC Fix Write bug when we only enable late word.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata)
|
||||
{
|
||||
if (!(word_en & BIT(0))) {
|
||||
targetdata[0] = sourdata[0];
|
||||
targetdata[1] = sourdata[1];
|
||||
}
|
||||
if (!(word_en & BIT(1))) {
|
||||
targetdata[2] = sourdata[2];
|
||||
targetdata[3] = sourdata[3];
|
||||
}
|
||||
if (!(word_en & BIT(2))) {
|
||||
targetdata[4] = sourdata[4];
|
||||
targetdata[5] = sourdata[5];
|
||||
}
|
||||
if (!(word_en & BIT(3))) {
|
||||
targetdata[6] = sourdata[6];
|
||||
targetdata[7] = sourdata[7];
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: Efuse_ReadAllMap
|
||||
*
|
||||
* Overview: Read All Efuse content
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 11/11/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse, bool pseudo)
|
||||
{
|
||||
u16 mapLen = 0;
|
||||
|
||||
rtl8188e_EfusePowerSwitch(pAdapter, false, true);
|
||||
|
||||
rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, pseudo);
|
||||
|
||||
rtl8188e_ReadEFuse(pAdapter, efuseType, 0, mapLen, Efuse, pseudo);
|
||||
|
||||
rtl8188e_EfusePowerSwitch(pAdapter, false, false);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: EFUSE_ShadowMapUpdate
|
||||
*
|
||||
@ -269,18 +72,16 @@ static void Efuse_ReadAllMap(struct adapter *pAdapter, u8 efuseType, u8 *Efuse,
|
||||
* 11/13/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
void EFUSE_ShadowMapUpdate(
|
||||
struct adapter *pAdapter,
|
||||
u8 efuseType,
|
||||
bool pseudo)
|
||||
void EFUSE_ShadowMapUpdate(struct adapter *pAdapter)
|
||||
{
|
||||
struct eeprom_priv *pEEPROM = &pAdapter->eeprompriv;
|
||||
u16 mapLen = 0;
|
||||
|
||||
rtl8188e_EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (void *)&mapLen, pseudo);
|
||||
if (pEEPROM->bautoload_fail_flag) {
|
||||
memset(pEEPROM->efuse_eeprom_data, 0xFF, EFUSE_MAP_LEN_88E);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pEEPROM->bautoload_fail_flag)
|
||||
memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
|
||||
else
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, pseudo);
|
||||
} /* EFUSE_ShadowMapUpdate */
|
||||
rtl8188e_EfusePowerSwitch(pAdapter, true);
|
||||
rtl8188e_ReadEFuse(pAdapter, 0, EFUSE_MAP_LEN_88E, pEEPROM->efuse_eeprom_data);
|
||||
rtl8188e_EfusePowerSwitch(pAdapter, false);
|
||||
}
|
||||
|
@ -1160,63 +1160,26 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
||||
}
|
||||
|
||||
/* show MCS rate, unit: 100Kbps */
|
||||
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char *MCS_rate)
|
||||
u16 rtw_mcs_rate(u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char *MCS_rate)
|
||||
{
|
||||
u16 max_rate = 0;
|
||||
|
||||
if (rf_type == RF_1T1R) {
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1500 : 1350) : ((short_GI_20) ? 722 : 650);
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1350 : 1215) : ((short_GI_20) ? 650 : 585);
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1200 : 1080) : ((short_GI_20) ? 578 : 520);
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 900 : 810) : ((short_GI_20) ? 433 : 390);
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 600 : 540) : ((short_GI_20) ? 289 : 260);
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 450 : 405) : ((short_GI_20) ? 217 : 195);
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 300 : 270) : ((short_GI_20) ? 144 : 130);
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 150 : 135) : ((short_GI_20) ? 72 : 65);
|
||||
} else {
|
||||
if (MCS_rate[1]) {
|
||||
if (MCS_rate[1] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 3000 : 2700) : ((short_GI_20) ? 1444 : 1300);
|
||||
else if (MCS_rate[1] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 2700 : 2430) : ((short_GI_20) ? 1300 : 1170);
|
||||
else if (MCS_rate[1] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 2400 : 2160) : ((short_GI_20) ? 1156 : 1040);
|
||||
else if (MCS_rate[1] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1800 : 1620) : ((short_GI_20) ? 867 : 780);
|
||||
else if (MCS_rate[1] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1200 : 1080) : ((short_GI_20) ? 578 : 520);
|
||||
else if (MCS_rate[1] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 900 : 810) : ((short_GI_20) ? 433 : 390);
|
||||
else if (MCS_rate[1] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 600 : 540) : ((short_GI_20) ? 289 : 260);
|
||||
else if (MCS_rate[1] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 300 : 270) : ((short_GI_20) ? 144 : 130);
|
||||
} else {
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1500 : 1350) : ((short_GI_20) ? 722 : 650);
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1350 : 1215) : ((short_GI_20) ? 650 : 585);
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1200 : 1080) : ((short_GI_20) ? 578 : 520);
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 900 : 810) : ((short_GI_20) ? 433 : 390);
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 600 : 540) : ((short_GI_20) ? 289 : 260);
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 450 : 405) : ((short_GI_20) ? 217 : 195);
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 300 : 270) : ((short_GI_20) ? 144 : 130);
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 150 : 135) : ((short_GI_20) ? 72 : 65);
|
||||
}
|
||||
}
|
||||
if (MCS_rate[0] & BIT(7))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1500 : 1350) : ((short_GI_20) ? 722 : 650);
|
||||
else if (MCS_rate[0] & BIT(6))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1350 : 1215) : ((short_GI_20) ? 650 : 585);
|
||||
else if (MCS_rate[0] & BIT(5))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 1200 : 1080) : ((short_GI_20) ? 578 : 520);
|
||||
else if (MCS_rate[0] & BIT(4))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 900 : 810) : ((short_GI_20) ? 433 : 390);
|
||||
else if (MCS_rate[0] & BIT(3))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 600 : 540) : ((short_GI_20) ? 289 : 260);
|
||||
else if (MCS_rate[0] & BIT(2))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 450 : 405) : ((short_GI_20) ? 217 : 195);
|
||||
else if (MCS_rate[0] & BIT(1))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 300 : 270) : ((short_GI_20) ? 144 : 130);
|
||||
else if (MCS_rate[0] & BIT(0))
|
||||
max_rate = (bw_40MHz) ? ((short_GI_40) ? 150 : 135) : ((short_GI_20) ? 72 : 65);
|
||||
|
||||
return max_rate;
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ u8 rtw_set_802_11_bssid(struct adapter *padapter, u8 *bssid)
|
||||
u32 cur_time = 0;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
DBG_88E_LEVEL(_drv_info_, "set bssid:%pM\n", bssid);
|
||||
netdev_dbg(padapter->pnetdev, "set bssid:%pM\n", bssid);
|
||||
|
||||
if ((bssid[0] == 0x00 && bssid[1] == 0x00 && bssid[2] == 0x00 &&
|
||||
bssid[3] == 0x00 && bssid[4] == 0x00 && bssid[5] == 0x00) ||
|
||||
@ -185,8 +185,8 @@ u8 rtw_set_802_11_ssid(struct adapter *padapter, struct ndis_802_11_ssid *ssid)
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct wlan_network *pnetwork = &pmlmepriv->cur_network;
|
||||
|
||||
DBG_88E_LEVEL(_drv_info_, "set ssid [%s] fw_state=0x%08x\n",
|
||||
ssid->Ssid, get_fwstate(pmlmepriv));
|
||||
netdev_dbg(padapter->pnetdev, "set ssid [%s] fw_state=0x%08x\n",
|
||||
ssid->Ssid, get_fwstate(pmlmepriv));
|
||||
|
||||
if (!padapter->hw_init_completed) {
|
||||
status = _FAIL;
|
||||
@ -458,7 +458,6 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
struct wlan_bssid_ex *pcur_bss = &pmlmepriv->cur_network.network;
|
||||
struct ieee80211_ht_cap *pht_capie;
|
||||
u8 rf_type = 0;
|
||||
u8 bw_40MHz = 0, short_GI_20 = 0, short_GI_40 = 0;
|
||||
u16 mcs_rate = 0;
|
||||
u32 ht_ielen = 0;
|
||||
@ -480,14 +479,10 @@ u16 rtw_get_cur_max_rate(struct adapter *adapter)
|
||||
short_GI_20 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & IEEE80211_HT_CAP_SGI_20) ? 1 : 0;
|
||||
short_GI_40 = (le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & IEEE80211_HT_CAP_SGI_40) ? 1 : 0;
|
||||
|
||||
GetHwReg8188EU(adapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
max_rate = rtw_mcs_rate(
|
||||
rf_type,
|
||||
bw_40MHz & (pregistrypriv->cbw40_enable),
|
||||
short_GI_20,
|
||||
short_GI_40,
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate
|
||||
);
|
||||
max_rate = rtw_mcs_rate(bw_40MHz & (pregistrypriv->cbw40_enable),
|
||||
short_GI_20,
|
||||
short_GI_40,
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate);
|
||||
}
|
||||
} else {
|
||||
while ((pcur_bss->SupportedRates[i] != 0) && (pcur_bss->SupportedRates[i] != 0xFF)) {
|
||||
|
@ -3,25 +3,20 @@
|
||||
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/rtw_led.h"
|
||||
#include "../include/rtl8188e_spec.h"
|
||||
|
||||
void BlinkTimerCallback(struct timer_list *t)
|
||||
{
|
||||
struct LED_871x *pLed = from_timer(pLed, t, BlinkTimer);
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
#define LED_BLINK_NO_LINK_INTVL msecs_to_jiffies(1000)
|
||||
#define LED_BLINK_LINK_INTVL msecs_to_jiffies(500)
|
||||
#define LED_BLINK_SCAN_INTVL msecs_to_jiffies(180)
|
||||
#define LED_BLINK_FASTER_INTVL msecs_to_jiffies(50)
|
||||
#define LED_BLINK_WPS_SUCESS_INTVL msecs_to_jiffies(5000)
|
||||
|
||||
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
|
||||
return;
|
||||
#define IS_LED_WPS_BLINKING(l) \
|
||||
((l)->CurrLedState == LED_BLINK_WPS || \
|
||||
(l)->CurrLedState == LED_BLINK_WPS_STOP || \
|
||||
(l)->bLedWPSBlinkInProgress)
|
||||
|
||||
_set_workitem(&pLed->BlinkWorkItem);
|
||||
}
|
||||
|
||||
void BlinkWorkItemCallback(struct work_struct *work)
|
||||
{
|
||||
struct LED_871x *pLed = container_of(work, struct LED_871x, BlinkWorkItem);
|
||||
BlinkHandler(pLed);
|
||||
}
|
||||
|
||||
void ResetLedStatus(struct LED_871x *pLed)
|
||||
static void ResetLedStatus(struct LED_871x *pLed)
|
||||
{
|
||||
pLed->CurrLedState = RTW_LED_OFF; /* Current LED state. */
|
||||
pLed->bLedOn = false; /* true if LED is ON, false if LED is OFF. */
|
||||
@ -34,39 +29,48 @@ void ResetLedStatus(struct LED_871x *pLed)
|
||||
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
pLed->bLedStartToLinkBlinkInProgress = false;
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
|
||||
void InitLed871x(struct adapter *padapter, struct LED_871x *pLed, enum LED_PIN_871x LedPin)
|
||||
static void SwLedOn(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
pLed->padapter = padapter;
|
||||
pLed->LedPin = LedPin;
|
||||
u8 LedCfg;
|
||||
|
||||
ResetLedStatus(pLed);
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
return;
|
||||
|
||||
timer_setup(&pLed->BlinkTimer, BlinkTimerCallback, 0);
|
||||
_init_workitem(&pLed->BlinkWorkItem, BlinkWorkItemCallback, pLed);
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */
|
||||
pLed->bLedOn = true;
|
||||
}
|
||||
|
||||
void DeInitLed871x(struct LED_871x *pLed)
|
||||
static void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
_cancel_workitem_sync(&pLed->BlinkWorkItem);
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
ResetLedStatus(pLed);
|
||||
u8 LedCfg;
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
goto exit;
|
||||
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);/* 0x4E */
|
||||
|
||||
LedCfg &= 0x90; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
|
||||
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
|
||||
LedCfg &= 0xFE;
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
exit:
|
||||
pLed->bLedOn = false;
|
||||
}
|
||||
|
||||
static void SwLedBlink1(struct LED_871x *pLed)
|
||||
static void blink_work(struct work_struct *work)
|
||||
{
|
||||
struct delayed_work *dwork = to_delayed_work(work);
|
||||
struct LED_871x *pLed = container_of(dwork, struct LED_871x, blink_work);
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
u8 bStopBlinking = false;
|
||||
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
SwLedOn(padapter, pLed);
|
||||
else
|
||||
SwLedOff(padapter, pLed);
|
||||
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
|
||||
return;
|
||||
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate != rf_on) {
|
||||
SwLedOff(padapter, pLed);
|
||||
@ -74,81 +78,67 @@ static void SwLedBlink1(struct LED_871x *pLed)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Change LED according to BlinkingLedState specified. */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
SwLedOn(padapter, pLed);
|
||||
else
|
||||
SwLedOff(padapter, pLed);
|
||||
|
||||
switch (pLed->CurrLedState) {
|
||||
case LED_BLINK_SLOWLY:
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
break;
|
||||
case LED_BLINK_NORMAL:
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
break;
|
||||
case LED_BLINK_SCAN:
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0)
|
||||
bStopBlinking = true;
|
||||
if (bStopBlinking) {
|
||||
if (pLed->BlinkTimes == 0) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
}
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
} else {
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_BLINK_TXRX:
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
pLed->BlinkTimes--;
|
||||
if (pLed->BlinkTimes == 0)
|
||||
bStopBlinking = true;
|
||||
if (bStopBlinking) {
|
||||
if (pLed->BlinkTimes == 0) {
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
} else if (!check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
}
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
} else {
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_FASTER_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_BLINK_WPS:
|
||||
@ -156,27 +146,22 @@ static void SwLedBlink1(struct LED_871x *pLed)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
|
||||
break;
|
||||
case LED_BLINK_WPS_STOP: /* WPS success */
|
||||
if (pLed->BlinkingLedState == RTW_LED_ON)
|
||||
bStopBlinking = false;
|
||||
else
|
||||
bStopBlinking = true;
|
||||
|
||||
if (bStopBlinking) {
|
||||
if (pLed->BlinkingLedState != RTW_LED_ON) {
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_LINK_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
} else {
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_WPS_SUCESS_INTVL);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
@ -184,224 +169,32 @@ static void SwLedBlink1(struct LED_871x *pLed)
|
||||
}
|
||||
}
|
||||
|
||||
static void SwLedControlMode1(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
void rtl8188eu_InitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *ledpriv = &padapter->ledpriv;
|
||||
struct led_priv *pledpriv = &padapter->ledpriv;
|
||||
struct LED_871x *pLed = &pledpriv->SwLed0;
|
||||
|
||||
pLed->padapter = padapter;
|
||||
ResetLedStatus(pLed);
|
||||
INIT_DELAYED_WORK(&pLed->blink_work, blink_work);
|
||||
}
|
||||
|
||||
void rtl8188eu_DeInitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *ledpriv = &padapter->ledpriv;
|
||||
struct LED_871x *pLed = &ledpriv->SwLed0;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
switch (LedAction) {
|
||||
case LED_CTL_POWER_ON:
|
||||
case LED_CTL_START_TO_LINK:
|
||||
case LED_CTL_NO_LINK:
|
||||
if (!pLed->bLedNoLinkBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_LINK:
|
||||
if (!pLed->bLedLinkBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_LINK_INTERVAL_ALPHA);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_SITE_SURVEY:
|
||||
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) {
|
||||
;
|
||||
} else if (!pLed->bLedScanBlinkInProgress) {
|
||||
if (IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedScanBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SCAN;
|
||||
pLed->BlinkTimes = 24;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_TX:
|
||||
case LED_CTL_RX:
|
||||
if (!pLed->bLedBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_TXRX;
|
||||
pLed->BlinkTimes = 2;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_FASTER_INTERVAL_ALPHA);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
case LED_CTL_START_WPS_BOTTON:
|
||||
if (!pLed->bLedWPSBlinkInProgress) {
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_WPS;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_SCAN_INTERVAL_ALPHA);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_STOP_WPS:
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
else
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
||||
if (pLed->bLedOn) {
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA);
|
||||
} else {
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, 0);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_STOP_WPS_FAIL:
|
||||
if (pLed->bLedWPSBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
_set_timer(&pLed->BlinkTimer, LED_BLINK_NO_LINK_INTERVAL_ALPHA);
|
||||
break;
|
||||
case LED_CTL_POWER_OFF:
|
||||
pLed->CurrLedState = RTW_LED_OFF;
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedWPSBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
_cancel_timer_ex(&pLed->BlinkTimer);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
SwLedOff(padapter, pLed);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
cancel_delayed_work_sync(&pLed->blink_work);
|
||||
ResetLedStatus(pLed);
|
||||
SwLedOff(padapter, pLed);
|
||||
}
|
||||
|
||||
void BlinkHandler(struct LED_871x *pLed)
|
||||
{
|
||||
struct adapter *padapter = pLed->padapter;
|
||||
|
||||
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped))
|
||||
return;
|
||||
|
||||
SwLedBlink1(pLed);
|
||||
}
|
||||
|
||||
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
{
|
||||
struct led_priv *ledpriv = &padapter->ledpriv;
|
||||
struct registry_priv *registry_par;
|
||||
struct LED_871x *pLed = &ledpriv->SwLed0;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
if ((padapter->bSurpriseRemoved) || (padapter->bDriverStopped) ||
|
||||
(!padapter->hw_init_completed))
|
||||
@ -414,14 +207,198 @@ void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction)
|
||||
if (!registry_par->led_enable)
|
||||
return;
|
||||
|
||||
if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on &&
|
||||
padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) &&
|
||||
(LedAction == LED_CTL_TX || LedAction == LED_CTL_RX ||
|
||||
LedAction == LED_CTL_SITE_SURVEY ||
|
||||
LedAction == LED_CTL_LINK ||
|
||||
LedAction == LED_CTL_NO_LINK ||
|
||||
LedAction == LED_CTL_POWER_ON))
|
||||
return;
|
||||
switch (LedAction) {
|
||||
case LED_CTL_START_TO_LINK:
|
||||
case LED_CTL_NO_LINK:
|
||||
if (!pLed->bLedNoLinkBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
|
||||
SwLedControlMode1(padapter, LedAction);
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_LINK:
|
||||
if (!pLed->bLedLinkBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_NORMAL;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_LINK_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_SITE_SURVEY:
|
||||
if ((pmlmepriv->LinkDetectInfo.bBusyTraffic) && (check_fwstate(pmlmepriv, _FW_LINKED))) {
|
||||
;
|
||||
} else if (!pLed->bLedScanBlinkInProgress) {
|
||||
if (IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedScanBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SCAN;
|
||||
pLed->BlinkTimes = 24;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_TX:
|
||||
case LED_CTL_RX:
|
||||
if (!pLed->bLedBlinkInProgress) {
|
||||
if (pLed->CurrLedState == LED_BLINK_SCAN || IS_LED_WPS_BLINKING(pLed))
|
||||
return;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_TXRX;
|
||||
pLed->BlinkTimes = 2;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_FASTER_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_START_WPS: /* wait until xinpin finish */
|
||||
if (!pLed->bLedWPSBlinkInProgress) {
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_WPS;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_SCAN_INTVL);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_STOP_WPS:
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedWPSBlinkInProgress)
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
else
|
||||
pLed->bLedWPSBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_WPS_STOP;
|
||||
if (pLed->bLedOn) {
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_WPS_SUCESS_INTVL);
|
||||
} else {
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, 0);
|
||||
}
|
||||
break;
|
||||
case LED_CTL_STOP_WPS_FAIL:
|
||||
if (pLed->bLedWPSBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
}
|
||||
pLed->bLedNoLinkBlinkInProgress = true;
|
||||
pLed->CurrLedState = LED_BLINK_SLOWLY;
|
||||
if (pLed->bLedOn)
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
else
|
||||
pLed->BlinkingLedState = RTW_LED_ON;
|
||||
schedule_delayed_work(&pLed->blink_work, LED_BLINK_NO_LINK_INTVL);
|
||||
break;
|
||||
case LED_CTL_POWER_OFF:
|
||||
pLed->CurrLedState = RTW_LED_OFF;
|
||||
pLed->BlinkingLedState = RTW_LED_OFF;
|
||||
if (pLed->bLedNoLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedNoLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedLinkBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedLinkBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedWPSBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedWPSBlinkInProgress = false;
|
||||
}
|
||||
if (pLed->bLedScanBlinkInProgress) {
|
||||
cancel_delayed_work(&pLed->blink_work);
|
||||
pLed->bLedScanBlinkInProgress = false;
|
||||
}
|
||||
SwLedOff(padapter, pLed);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -913,7 +913,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(struct adapter *padapter, str
|
||||
psta->aid = pnetwork->join_res;
|
||||
psta->mac_id = 0;
|
||||
/* sta mode */
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_STA_INFO, psta, true);
|
||||
rtl8188e_SetHalODMVar(padapter, psta, true);
|
||||
/* security related */
|
||||
if (padapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) {
|
||||
padapter->securitypriv.binstallGrpkey = false;
|
||||
@ -1198,7 +1198,7 @@ void rtw_stassoc_event_callback(struct adapter *adapter, u8 *pbuf)
|
||||
psta->mac_id = (uint)pstassoc->cam_id;
|
||||
DBG_88E("%s\n", __func__);
|
||||
/* for ad-hoc mode */
|
||||
rtl8188e_SetHalODMVar(adapter, HAL_ODM_STA_INFO, psta, true);
|
||||
rtl8188e_SetHalODMVar(adapter, psta, true);
|
||||
rtw_sta_media_status_rpt(adapter, psta, 1);
|
||||
if (adapter->securitypriv.dot11AuthAlgrthm == dot11AuthAlgrthm_8021X)
|
||||
psta->dot118021XPrivacy = adapter->securitypriv.dot11PrivacyAlgrthm;
|
||||
@ -1999,17 +1999,11 @@ void rtw_update_ht_cap(struct adapter *padapter, u8 *pie, uint ie_len)
|
||||
(le16_to_cpu(pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info) & BIT(1)) &&
|
||||
(pmlmeinfo->HT_info.infos[0] & BIT(2))) {
|
||||
int i;
|
||||
u8 rf_type;
|
||||
|
||||
GetHwReg8188EU(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
/* update the MCS rates */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
else
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
}
|
||||
for (i = 0; i < 16; i++)
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
|
||||
/* switch to the 40M Hz mode according to the AP */
|
||||
pmlmeext->cur_bwmode = HT_CHANNEL_WIDTH_40;
|
||||
switch ((pmlmeinfo->HT_info.infos[0] & 0x3)) {
|
||||
|
@ -10,7 +10,6 @@
|
||||
#include "../include/wlan_bssdef.h"
|
||||
#include "../include/mlme_osdep.h"
|
||||
#include "../include/recv_osdep.h"
|
||||
#include "../include/rtl8188e_sreset.h"
|
||||
#include "../include/rtl8188e_xmit.h"
|
||||
#include "../include/rtl8188e_dm.h"
|
||||
|
||||
@ -77,7 +76,7 @@ unsigned char MCS_rate_1R[16] = {0xff, 0x00, 0x0, 0x0, 0x01, 0x0, 0x0, 0x0, 0x0,
|
||||
/********************************************************
|
||||
ChannelPlan definitions
|
||||
*********************************************************/
|
||||
static struct rt_channel_plan_2g RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = {
|
||||
static struct rt_channel_plan RTW_ChannelPlan2G[RT_CHANNEL_DOMAIN_2G_MAX] = {
|
||||
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, /* 0x00, RT_CHANNEL_DOMAIN_2G_WORLD , Passive scan CH 12, 13 */
|
||||
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13}, 13}, /* 0x01, RT_CHANNEL_DOMAIN_2G_ETSI1 */
|
||||
{{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, 11}, /* 0x02, RT_CHANNEL_DOMAIN_2G_FCC1 */
|
||||
@ -252,7 +251,8 @@ static void init_mlme_ext_priv_value(struct adapter *padapter)
|
||||
|
||||
static int has_channel(struct rt_channel_info *channel_set,
|
||||
u8 chanset_size,
|
||||
u8 chan) {
|
||||
u8 chan)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < chanset_size; i++) {
|
||||
@ -264,7 +264,8 @@ static int has_channel(struct rt_channel_info *channel_set,
|
||||
|
||||
static void init_channel_list(struct adapter *padapter, struct rt_channel_info *channel_set,
|
||||
u8 chanset_size,
|
||||
struct p2p_channels *channel_list) {
|
||||
struct p2p_channels *channel_list)
|
||||
{
|
||||
struct p2p_oper_class_map op_class[] = {
|
||||
{ IEEE80211G, 81, 1, 13, 1, BW20 },
|
||||
{ IEEE80211G, 82, 14, 14, 1, BW20 },
|
||||
@ -655,9 +656,11 @@ unsigned int OnBeacon(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
if (psta) {
|
||||
ret = rtw_check_bcn_info(padapter, pframe, len);
|
||||
if (!ret) {
|
||||
DBG_88E_LEVEL(_drv_info_, "ap has changed, disconnect now\n ");
|
||||
receive_disconnect(padapter, pmlmeinfo->network.MacAddress, 0);
|
||||
return _SUCCESS;
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"ap has changed, disconnect now\n");
|
||||
receive_disconnect(padapter,
|
||||
pmlmeinfo->network.MacAddress, 0);
|
||||
return _SUCCESS;
|
||||
}
|
||||
/* update WMM, ERP in the beacon */
|
||||
/* todo: the timer is used instead of the number of the beacon received */
|
||||
@ -931,7 +934,7 @@ unsigned int OnAuthClient(struct adapter *padapter, struct recv_frame *precv_fra
|
||||
}
|
||||
|
||||
if (go2asoc) {
|
||||
DBG_88E_LEVEL(_drv_info_, "auth success, start assoc\n");
|
||||
netdev_dbg(padapter->pnetdev, "auth success, start assoc\n");
|
||||
start_clnt_assoc(padapter);
|
||||
return _SUCCESS;
|
||||
}
|
||||
@ -1503,8 +1506,9 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "ap recv deauth reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr2Ptr(pframe));
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"ap recv deauth reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr2Ptr(pframe));
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
|
||||
if (psta) {
|
||||
@ -1540,8 +1544,9 @@ unsigned int OnDeAuth(struct adapter *padapter, struct recv_frame *precv_frame)
|
||||
}
|
||||
}
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "sta recv deauth reason code(%d) sta:%pM, ignore = %d\n",
|
||||
reason, GetAddr3Ptr(pframe), ignore_received_deauth);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"sta recv deauth reason code(%d) sta:%pM, ignore = %d\n",
|
||||
reason, GetAddr3Ptr(pframe), ignore_received_deauth);
|
||||
|
||||
if (!ignore_received_deauth)
|
||||
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
|
||||
@ -1576,8 +1581,9 @@ unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr2Ptr(pframe));
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"ap recv disassoc reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr2Ptr(pframe));
|
||||
|
||||
psta = rtw_get_stainfo(pstapriv, GetAddr2Ptr(pframe));
|
||||
if (psta) {
|
||||
@ -1596,8 +1602,9 @@ unsigned int OnDisassoc(struct adapter *padapter, struct recv_frame *precv_frame
|
||||
|
||||
return _SUCCESS;
|
||||
} else {
|
||||
DBG_88E_LEVEL(_drv_always_, "ap recv disassoc reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr3Ptr(pframe));
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"ap recv disassoc reason code(%d) sta:%pM\n",
|
||||
reason, GetAddr3Ptr(pframe));
|
||||
|
||||
receive_disconnect(padapter, GetAddr3Ptr(pframe), reason);
|
||||
}
|
||||
@ -5062,7 +5069,7 @@ void issue_assocreq(struct adapter *padapter)
|
||||
__le16 *fctrl;
|
||||
__le16 le_tmp;
|
||||
unsigned int i, j, ie_len, index = 0;
|
||||
unsigned char rf_type, bssrate[NumRates], sta_bssrate[NumRates];
|
||||
unsigned char bssrate[NumRates], sta_bssrate[NumRates];
|
||||
struct ndis_802_11_var_ie *pIE;
|
||||
struct registry_priv *pregpriv = &padapter->registrypriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
@ -5187,25 +5194,10 @@ void issue_assocreq(struct adapter *padapter)
|
||||
/* todo: disable SM power save mode */
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x000c);
|
||||
|
||||
GetHwReg8188EU(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
switch (rf_type) {
|
||||
case RF_1T1R:
|
||||
if (pregpriv->rx_stbc)
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */
|
||||
memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_1R, 16);
|
||||
break;
|
||||
case RF_2T2R:
|
||||
case RF_1T2R:
|
||||
default:
|
||||
if ((pregpriv->rx_stbc == 0x3) ||/* enable for 2.4/5 GHz */
|
||||
((pmlmeext->cur_wireless_mode & WIRELESS_11_24N) && (pregpriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */
|
||||
(pregpriv->wifi_spec == 1)) {
|
||||
DBG_88E("declare supporting RX STBC\n");
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0200);/* RX STBC two spatial stream */
|
||||
}
|
||||
memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_2R, 16);
|
||||
break;
|
||||
}
|
||||
if (pregpriv->rx_stbc)
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.HT_caps_info |= cpu_to_le16(0x0100);/* RX STBC One spatial stream */
|
||||
memcpy(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_rate_1R, 16);
|
||||
|
||||
pframe = rtw_set_ie(pframe, _HT_CAPABILITY_IE_, ie_len, (u8 *)(&pmlmeinfo->HT_caps), &pattrib->pktlen);
|
||||
}
|
||||
}
|
||||
@ -6493,7 +6485,7 @@ void start_clnt_auth(struct adapter *padapter)
|
||||
/* For the Win8 P2P connection, it will be hard to have a successful connection if this Wi-Fi doesn't connect to it. */
|
||||
issue_deauth(padapter, (&pmlmeinfo->network)->MacAddress, WLAN_REASON_DEAUTH_LEAVING);
|
||||
|
||||
DBG_88E_LEVEL(_drv_info_, "start auth\n");
|
||||
netdev_dbg(padapter->pnetdev, "start auth\n");
|
||||
issue_auth(padapter, NULL, 0);
|
||||
|
||||
set_link_timer(pmlmeext, REAUTH_TO);
|
||||
@ -7132,8 +7124,7 @@ void mlmeext_sta_del_event_callback(struct adapter *padapter)
|
||||
Following are the functions for the timer handlers
|
||||
|
||||
*****************************************************************************/
|
||||
void _linked_rx_signal_strehgth_display(struct adapter *padapter);
|
||||
void _linked_rx_signal_strehgth_display(struct adapter *padapter)
|
||||
static void _linked_rx_signal_strength_display(struct adapter *padapter)
|
||||
{
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
@ -7167,6 +7158,23 @@ static u8 chk_ap_is_alive(struct adapter *padapter, struct sta_info *psta)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
u32 rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
|
||||
u8 fw_status;
|
||||
|
||||
if (rx_dma_status != 0x00) {
|
||||
DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
|
||||
rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
|
||||
}
|
||||
|
||||
fw_status = rtw_read8(padapter, REG_FMETHR);
|
||||
if (fw_status == 1)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
|
||||
else if (fw_status == 2)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
|
||||
}
|
||||
|
||||
void linked_status_chk(struct adapter *padapter)
|
||||
{
|
||||
u32 i;
|
||||
@ -7177,7 +7185,7 @@ void linked_status_chk(struct adapter *padapter)
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
||||
if (padapter->bRxRSSIDisplay)
|
||||
_linked_rx_signal_strehgth_display(padapter);
|
||||
_linked_rx_signal_strength_display(padapter);
|
||||
|
||||
rtl8188e_sreset_linked_status_check(padapter);
|
||||
|
||||
@ -7238,8 +7246,8 @@ void linked_status_chk(struct adapter *padapter)
|
||||
if (rx_chk == _FAIL) {
|
||||
pmlmeext->retry++;
|
||||
if (pmlmeext->retry > rx_chk_limit) {
|
||||
DBG_88E_LEVEL(_drv_always_, FUNC_ADPT_FMT" disconnect or roaming\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"disconnect or roaming\n");
|
||||
receive_disconnect(padapter, pmlmeinfo->network.MacAddress,
|
||||
WLAN_REASON_EXPIRATION_CHK);
|
||||
return;
|
||||
@ -7764,8 +7772,9 @@ u8 setkey_hdl(struct adapter *padapter, u8 *pbuf)
|
||||
/* write cam */
|
||||
ctrl = BIT(15) | ((pparm->algorithm) << 2) | pparm->keyid;
|
||||
|
||||
DBG_88E_LEVEL(_drv_info_, "set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) "
|
||||
"keyid:%d\n", pparm->algorithm, pparm->keyid);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"set group key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) keyid:%d\n",
|
||||
pparm->algorithm, pparm->keyid);
|
||||
write_cam(padapter, pparm->keyid, ctrl, null_sta, pparm->key);
|
||||
|
||||
return H2C_SUCCESS;
|
||||
@ -7794,8 +7803,9 @@ u8 set_stakey_hdl(struct adapter *padapter, u8 *pbuf)
|
||||
|
||||
cam_id = 4;
|
||||
|
||||
DBG_88E_LEVEL(_drv_info_, "set pairwise key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:%d\n",
|
||||
pparm->algorithm, cam_id);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"set pairwise key to hw: alg:%d(WEP40-1 WEP104-5 TKIP-2 AES-4) camid:%d\n",
|
||||
pparm->algorithm, cam_id);
|
||||
if ((pmlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) {
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
|
@ -1806,8 +1806,6 @@ void reset_global_wifidirect_info(struct adapter *padapter)
|
||||
pwdinfo = &padapter->wdinfo;
|
||||
pwdinfo->persistent_supported = 0;
|
||||
pwdinfo->session_available = true;
|
||||
pwdinfo->wfd_tdls_enable = 0;
|
||||
pwdinfo->wfd_tdls_weaksec = 0;
|
||||
}
|
||||
|
||||
void rtw_init_wifidirect_timers(struct adapter *padapter)
|
||||
@ -1912,7 +1910,6 @@ void init_wifidirect_info(struct adapter *padapter, enum P2P_ROLE role)
|
||||
memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4);
|
||||
memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3);
|
||||
memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));
|
||||
pwdinfo->wfd_tdls_enable = 0;
|
||||
memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN);
|
||||
memset(pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN);
|
||||
|
||||
@ -1944,7 +1941,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
||||
/* Enable P2P function */
|
||||
init_wifidirect_info(padapter, role);
|
||||
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_P2P_STATE, NULL, true);
|
||||
} else if (role == P2P_ROLE_DISABLE) {
|
||||
if (_FAIL == rtw_pwr_wakeup(padapter)) {
|
||||
ret = _FAIL;
|
||||
@ -1963,8 +1959,6 @@ int rtw_p2p_enable(struct adapter *padapter, enum P2P_ROLE role)
|
||||
memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info));
|
||||
}
|
||||
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_P2P_STATE, NULL, false);
|
||||
|
||||
/* Restore to initial setting. */
|
||||
update_tx_basic_rate(padapter, padapter->registrypriv.wireless_mode);
|
||||
}
|
||||
|
@ -15,9 +15,12 @@ void ips_enter(struct adapter *padapter)
|
||||
|
||||
if (pxmit_priv->free_xmitbuf_cnt != NR_XMITBUFF ||
|
||||
pxmit_priv->free_xmit_extbuf_cnt != NR_XMIT_EXTBUFF) {
|
||||
DBG_88E_LEVEL(_drv_info_, "There are some pkts to transmit\n");
|
||||
DBG_88E_LEVEL(_drv_info_, "free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt, pxmit_priv->free_xmit_extbuf_cnt);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"There are some pkts to transmit\n");
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"free_xmitbuf_cnt: %d, free_xmit_extbuf_cnt: %d\n",
|
||||
pxmit_priv->free_xmitbuf_cnt,
|
||||
pxmit_priv->free_xmit_extbuf_cnt);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -32,7 +35,7 @@ void ips_enter(struct adapter *padapter)
|
||||
DBG_88E("==>ips_enter cnts:%d\n", pwrpriv->ips_enter_cnts);
|
||||
if (rf_off == pwrpriv->change_rfpwrstate) {
|
||||
pwrpriv->bpower_saving = true;
|
||||
DBG_88E_LEVEL(_drv_info_, "nolinked power save enter\n");
|
||||
netdev_dbg(padapter->pnetdev, "nolinked power save enter\n");
|
||||
|
||||
if (pwrpriv->ips_mode == IPS_LEVEL_2)
|
||||
pwrpriv->bkeepfwalive = true;
|
||||
@ -65,7 +68,7 @@ int ips_leave(struct adapter *padapter)
|
||||
if (result == _SUCCESS) {
|
||||
pwrpriv->rf_pwrstate = rf_on;
|
||||
}
|
||||
DBG_88E_LEVEL(_drv_info_, "nolinked power save leave\n");
|
||||
netdev_dbg(padapter->pnetdev, "nolinked power save leave\n");
|
||||
|
||||
if ((_WEP40_ == psecuritypriv->dot11PrivacyAlgrthm) || (_WEP104_ == psecuritypriv->dot11PrivacyAlgrthm)) {
|
||||
DBG_88E("==>%s, channel(%d), processing(%x)\n", __func__, padapter->mlmeextpriv.cur_channel, pwrpriv->bips_processing);
|
||||
@ -348,7 +351,6 @@ void rtw_init_pwrctrl_priv(struct adapter *padapter)
|
||||
|
||||
pwrctrlpriv->pwr_state_check_interval = RTW_PWR_STATE_CHK_INTERVAL;
|
||||
pwrctrlpriv->pwr_state_check_cnts = 0;
|
||||
pwrctrlpriv->bInternalAutoSuspend = false;
|
||||
pwrctrlpriv->bInSuspend = false;
|
||||
pwrctrlpriv->bkeepfwalive = false;
|
||||
|
||||
@ -393,7 +395,7 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
||||
}
|
||||
|
||||
/* System suspend is not allowed to wakeup */
|
||||
if ((!pwrpriv->bInternalAutoSuspend) && pwrpriv->bInSuspend) {
|
||||
if (pwrpriv->bInSuspend) {
|
||||
while (pwrpriv->bInSuspend &&
|
||||
(rtw_get_passing_time_ms(start) <= 3000 ||
|
||||
(rtw_get_passing_time_ms(start) <= 500)))
|
||||
@ -404,12 +406,6 @@ int _rtw_pwr_wakeup(struct adapter *padapter, u32 ips_deffer_ms, const char *cal
|
||||
DBG_88E("%s wait bInSuspend done\n", __func__);
|
||||
}
|
||||
|
||||
/* block??? */
|
||||
if ((pwrpriv->bInternalAutoSuspend) && (padapter->net_closed)) {
|
||||
ret = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
/* I think this should be check in IPS, LPS, autosuspend functions... */
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
ret = _SUCCESS;
|
||||
|
@ -35,7 +35,7 @@ static struct ch_freq ch_freq_map[] = {
|
||||
{216, 5080},/* Japan, means J16 */
|
||||
};
|
||||
|
||||
static int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
static int ch_freq_map_num = ARRAY_SIZE(ch_freq_map);
|
||||
|
||||
u32 rtw_ch2freq(u32 channel)
|
||||
{
|
||||
|
@ -545,7 +545,8 @@ u32 rtw_tkip_decrypt(struct adapter *padapter, struct recv_frame *precvframe)
|
||||
if (is_multicast_ether_addr(prxattrib->ra)) {
|
||||
if (!psecuritypriv->binstallGrpkey) {
|
||||
res = _FAIL;
|
||||
DBG_88E("%s:rx bc/mc packets, but didn't install group key!!!!!!!!!!\n", __func__);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"rx bc/mc packets, but didn't install group key!\n");
|
||||
goto exit;
|
||||
}
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
@ -1145,7 +1146,7 @@ u32 rtw_aes_encrypt(struct adapter *padapter, struct xmit_frame *pxmitframe)
|
||||
return res;
|
||||
}
|
||||
|
||||
static int aes_decipher(u8 *key, uint hdrlen,
|
||||
static int aes_decipher(struct adapter *padapter, u8 *key, uint hdrlen,
|
||||
u8 *pframe, uint plen)
|
||||
{
|
||||
static u8 message[MAX_MSG_SIZE];
|
||||
@ -1329,8 +1330,10 @@ static int aes_decipher(u8 *key, uint hdrlen,
|
||||
/* compare the mic */
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (pframe[hdrlen + 8 + plen - 8 + i] != message[hdrlen + 8 + plen - 8 + i]) {
|
||||
DBG_88E("aes_decipher:mic check error mic[%d]: pframe(%x)!=message(%x)\n",
|
||||
i, pframe[hdrlen + 8 + plen - 8 + i], message[hdrlen + 8 + plen - 8 + i]);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"mic check error mic[%d]: pframe(%x)!=message(%x)\n",
|
||||
i, pframe[hdrlen + 8 + plen - 8 + i],
|
||||
message[hdrlen + 8 + plen - 8 + i]);
|
||||
res = _FAIL;
|
||||
}
|
||||
}
|
||||
@ -1358,13 +1361,16 @@ u32 rtw_aes_decrypt(struct adapter *padapter, struct recv_frame *precvframe)
|
||||
/* in concurrent we should use sw descrypt in group key, so we remove this message */
|
||||
if (!psecuritypriv->binstallGrpkey) {
|
||||
res = _FAIL;
|
||||
DBG_88E("%s:rx bc/mc packets, but didn't install group key!!!!!!!!!!\n", __func__);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"rx bc/mc packets, but didn't install group key!\n");
|
||||
goto exit;
|
||||
}
|
||||
prwskey = psecuritypriv->dot118021XGrpKey[prxattrib->key_index].skey;
|
||||
if (psecuritypriv->dot118021XGrpKeyid != prxattrib->key_index) {
|
||||
DBG_88E("not match packet_index=%d, install_index=%d\n",
|
||||
prxattrib->key_index, psecuritypriv->dot118021XGrpKeyid);
|
||||
netdev_dbg(padapter->pnetdev,
|
||||
"not match packet_index=%d, install_index=%d\n",
|
||||
prxattrib->key_index,
|
||||
psecuritypriv->dot118021XGrpKeyid);
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
@ -1372,7 +1378,7 @@ u32 rtw_aes_decrypt(struct adapter *padapter, struct recv_frame *precvframe)
|
||||
prwskey = &stainfo->dot118021x_UncstKey.skey[0];
|
||||
}
|
||||
length = precvframe->len - prxattrib->hdrlen - prxattrib->iv_len;
|
||||
res = aes_decipher(prwskey, prxattrib->hdrlen, pframe, length);
|
||||
res = aes_decipher(padapter, prwskey, prxattrib->hdrlen, pframe, length);
|
||||
} else {
|
||||
res = _FAIL;
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ u32 rtw_free_stainfo(struct adapter *padapter, struct sta_info *psta)
|
||||
}
|
||||
|
||||
if (!(psta->state & WIFI_AP_STATE))
|
||||
rtl8188e_SetHalODMVar(padapter, HAL_ODM_STA_INFO, psta, false);
|
||||
rtl8188e_SetHalODMVar(padapter, psta, false);
|
||||
|
||||
spin_lock_bh(&pstapriv->auth_list_lock);
|
||||
if (!list_empty(&psta->auth_list)) {
|
||||
|
@ -695,7 +695,6 @@ static void bwmode_update_check(struct adapter *padapter, struct ndis_802_11_var
|
||||
void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
|
||||
{
|
||||
unsigned int i;
|
||||
u8 rf_type;
|
||||
u8 max_AMPDU_len, min_MPDU_spacing;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
@ -716,29 +715,19 @@ void HT_caps_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
|
||||
pmlmeinfo->HT_caps.u.HT_cap[i] &= (pIE->data[i]);
|
||||
} else {
|
||||
/* modify from fw by Thomas 2010/11/17 */
|
||||
if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (pIE->data[i] & 0x3))
|
||||
max_AMPDU_len = (pIE->data[i] & 0x3);
|
||||
else
|
||||
max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3);
|
||||
max_AMPDU_len = min(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3,
|
||||
pIE->data[i] & 0x3);
|
||||
|
||||
if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (pIE->data[i] & 0x1c))
|
||||
min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c);
|
||||
else
|
||||
min_MPDU_spacing = (pIE->data[i] & 0x1c);
|
||||
min_MPDU_spacing = max(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c,
|
||||
pIE->data[i] & 0x1c);
|
||||
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing;
|
||||
}
|
||||
}
|
||||
|
||||
GetHwReg8188EU(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
/* update the MCS rates */
|
||||
for (i = 0; i < 16; i++) {
|
||||
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
else
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_2R[i];
|
||||
}
|
||||
for (i = 0; i < 16; i++)
|
||||
pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate[i] &= MCS_rate_1R[i];
|
||||
}
|
||||
|
||||
void HT_info_handler(struct adapter *padapter, struct ndis_802_11_var_ie *pIE)
|
||||
|
@ -461,7 +461,7 @@ static s32 update_attrib(struct adapter *padapter, struct sk_buff *pkt, struct p
|
||||
}
|
||||
}
|
||||
} else if (0x888e == pattrib->ether_type) {
|
||||
DBG_88E_LEVEL(_drv_info_, "send eapol packet\n");
|
||||
netdev_dbg(padapter->pnetdev, "send eapol packet\n");
|
||||
}
|
||||
|
||||
if ((pattrib->ether_type == 0x888e) || (pattrib->dhcp_pkt == 1))
|
||||
|
@ -4,66 +4,42 @@
|
||||
#include "../include/Hal8188EPwrSeq.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
/*
|
||||
drivers should parse below arrays and do the corresponding actions
|
||||
*/
|
||||
/* 3 Power on Array */
|
||||
struct wl_pwr_cfg rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
struct wl_pwr_cfg rtl8188E_power_on_flow[] = {
|
||||
{ 0x0006, PWR_CMD_POLLING, BIT(1), BIT(1) },
|
||||
{ 0x0002, PWR_CMD_WRITE, BIT(0) | BIT(1), 0 }, /* reset BB */
|
||||
{ 0x0026, PWR_CMD_WRITE, BIT(7), BIT(7) }, /* schmitt trigger */
|
||||
{ 0x0005, PWR_CMD_WRITE, BIT(7), 0 }, /* disable HWPDN (control by DRV)*/
|
||||
{ 0x0005, PWR_CMD_WRITE, BIT(4) | BIT(3), 0 }, /* disable WL suspend*/
|
||||
{ 0x0005, PWR_CMD_WRITE, BIT(0), BIT(0) },
|
||||
{ 0x0005, PWR_CMD_POLLING, BIT(0), 0 },
|
||||
{ 0x0023, PWR_CMD_WRITE, BIT(4), 0 },
|
||||
{ 0xFFFF, PWR_CMD_END, 0, 0 },
|
||||
};
|
||||
|
||||
/* 3Radio off Array */
|
||||
struct wl_pwr_cfg rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_END
|
||||
struct wl_pwr_cfg rtl8188E_card_disable_flow[] = {
|
||||
{ 0x001F, PWR_CMD_WRITE, 0xFF, 0 }, /* turn off RF */
|
||||
{ 0x0023, PWR_CMD_WRITE, BIT(4), BIT(4) }, /* LDO Sleep mode */
|
||||
{ 0x0005, PWR_CMD_WRITE, BIT(1), BIT(1) }, /* turn off MAC by HW state machine */
|
||||
{ 0x0005, PWR_CMD_POLLING, BIT(1), 0 },
|
||||
{ 0x0026, PWR_CMD_WRITE, BIT(7), BIT(7) }, /* schmitt trigger */
|
||||
{ 0x0005, PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3) }, /* enable WL suspend */
|
||||
{ 0x0007, PWR_CMD_WRITE, 0xFF, 0 }, /* enable bandgap mbias in suspend */
|
||||
{ 0x0041, PWR_CMD_WRITE, BIT(4), 0 }, /* Clear SIC_EN register */
|
||||
{ 0xfe10, PWR_CMD_WRITE, BIT(4), BIT(4) }, /* Set USB suspend enable local register */
|
||||
{ 0xFFFF, PWR_CMD_END, 0, 0 },
|
||||
};
|
||||
|
||||
/* 3Card Disable Array */
|
||||
struct wl_pwr_cfg rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_CARDDIS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3 Card Enable Array */
|
||||
struct wl_pwr_cfg rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_CARDDIS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3Suspend Array */
|
||||
struct wl_pwr_cfg rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_SUS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3 Resume Array */
|
||||
struct wl_pwr_cfg rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_SUS_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3HWPDN Array */
|
||||
struct wl_pwr_cfg rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS + RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
RTL8188E_TRANS_ACT_TO_CARDEMU
|
||||
RTL8188E_TRANS_CARDEMU_TO_PDN
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3 Enter LPS */
|
||||
struct wl_pwr_cfg rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
/* FW behavior */
|
||||
RTL8188E_TRANS_ACT_TO_LPS
|
||||
RTL8188E_TRANS_END
|
||||
};
|
||||
|
||||
/* 3 Leave LPS */
|
||||
struct wl_pwr_cfg rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS + RTL8188E_TRANS_END_STEPS] = {
|
||||
/* FW behavior */
|
||||
RTL8188E_TRANS_LPS_TO_ACT
|
||||
RTL8188E_TRANS_END
|
||||
/* This is used by driver for LPSRadioOff Procedure, not for FW LPS Step */
|
||||
struct wl_pwr_cfg rtl8188E_enter_lps_flow[] = {
|
||||
{ 0x0522, PWR_CMD_WRITE, 0xFF, 0x7F },/* Tx Pause */
|
||||
{ 0x05F8, PWR_CMD_POLLING, 0xFF, 0 }, /* Should be zero if no packet is transmitted */
|
||||
{ 0x05F9, PWR_CMD_POLLING, 0xFF, 0 }, /* Should be zero if no packet is transmitted */
|
||||
{ 0x05FA, PWR_CMD_POLLING, 0xFF, 0 }, /* Should be zero if no packet is transmitted */
|
||||
{ 0x05FB, PWR_CMD_POLLING, 0xFF, 0 }, /* Should be zero if no packet is transmitted */
|
||||
{ 0x0002, PWR_CMD_WRITE, BIT(0), 0 }, /* CCK and OFDM are disabled, clocks are gated */
|
||||
{ 0x0002, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US },
|
||||
{ 0x0100, PWR_CMD_WRITE, 0xFF, 0x3F }, /* Reset MAC TRX */
|
||||
{ 0x0101, PWR_CMD_WRITE, BIT(1), 0 }, /* check if removed later */
|
||||
{ 0x0553, PWR_CMD_WRITE, BIT(5), BIT(5) }, /* Respond TxOK to scheduler */
|
||||
{ 0xFFFF, PWR_CMD_END, 0, 0 },
|
||||
};
|
||||
|
@ -1,20 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright (c) Realtek Semiconductor Corp.
|
||||
Module Name:
|
||||
RateAdaptive.c
|
||||
/* Copyright (c) Realtek Semiconductor Corp. */
|
||||
|
||||
Abstract:
|
||||
Implement Rate Adaptive functions for common operations.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-08-12 Page Create.
|
||||
|
||||
--*/
|
||||
#include "../include/odm_precomp.h"
|
||||
|
||||
/* Rate adaptive parameters */
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
static u8 RETRY_PENALTY[PERENTRY][RETRYSIZE + 1] = {
|
||||
{5, 4, 3, 2, 0, 3}, /* 92 , idx = 0 */
|
||||
@ -316,19 +303,19 @@ static int odm_ARFBRefresh_8188E(struct odm_dm_struct *dm_odm, struct odm_ra_inf
|
||||
pRaInfo->RAUseRate = (pRaInfo->RateMask) & 0x0000000d;
|
||||
break;
|
||||
case 12:
|
||||
MaskFromReg = ODM_Read4Byte(dm_odm, REG_ARFR0);
|
||||
MaskFromReg = rtw_read32(dm_odm->Adapter, REG_ARFR0);
|
||||
pRaInfo->RAUseRate = (pRaInfo->RateMask) & MaskFromReg;
|
||||
break;
|
||||
case 13:
|
||||
MaskFromReg = ODM_Read4Byte(dm_odm, REG_ARFR1);
|
||||
MaskFromReg = rtw_read32(dm_odm->Adapter, REG_ARFR1);
|
||||
pRaInfo->RAUseRate = (pRaInfo->RateMask) & MaskFromReg;
|
||||
break;
|
||||
case 14:
|
||||
MaskFromReg = ODM_Read4Byte(dm_odm, REG_ARFR2);
|
||||
MaskFromReg = rtw_read32(dm_odm->Adapter, REG_ARFR2);
|
||||
pRaInfo->RAUseRate = (pRaInfo->RateMask) & MaskFromReg;
|
||||
break;
|
||||
case 15:
|
||||
MaskFromReg = ODM_Read4Byte(dm_odm, REG_ARFR3);
|
||||
MaskFromReg = rtw_read32(dm_odm->Adapter, REG_ARFR3);
|
||||
pRaInfo->RAUseRate = (pRaInfo->RateMask) & MaskFromReg;
|
||||
break;
|
||||
default:
|
||||
@ -590,7 +577,7 @@ void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid, u8 Rssi)
|
||||
|
||||
void ODM_RA_Set_TxRPT_Time(struct odm_dm_struct *dm_odm, u16 minRptTime)
|
||||
{
|
||||
ODM_Write2Byte(dm_odm, REG_TX_RPT_TIME, minRptTime);
|
||||
rtw_write16(dm_odm->Adapter, REG_TX_RPT_TIME, minRptTime);
|
||||
}
|
||||
|
||||
void ODM_RA_TxRPT2Handle_8188E(struct odm_dm_struct *dm_odm, u8 *TxRPT_Buf, u16 TxRPT_Len, u32 macid_entry0, u32 macid_entry1)
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/rtw_iol.h"
|
||||
|
||||
#define read_next_pair(array, v1, v2, i) \
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/rtw_iol.h"
|
||||
|
||||
static bool Checkcondition(const u32 condition, const u32 hex)
|
||||
|
@ -1,7 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/rtw_iol.h"
|
||||
|
||||
static bool CheckCondition(const u32 Condition, const u32 Hex)
|
||||
|
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
/*---------------------------Define Local Constant---------------------------*/
|
||||
/* 2010/04/25 MH Define the max tx power tracking tx agc power. */
|
||||
@ -98,7 +98,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
struct adapter *Adapter
|
||||
)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u8 ThermalValue = 0, delta, delta_LCK, delta_IQK, offset;
|
||||
u8 ThermalValue_AVG_count = 0;
|
||||
u32 ThermalValue_AVG = 0;
|
||||
@ -137,7 +137,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
/* <Kordan> RFCalibrateInfo.RegA24 will be initialized when ODM HW configuring, but MP configures with para files. */
|
||||
dm_odm->RFCalibrateInfo.RegA24 = 0x090e1317;
|
||||
|
||||
ThermalValue = (u8)ODM_GetRFReg(dm_odm, RF_PATH_A, RF_T_METER_88E, 0xfc00); /* 0x42: RF Reg[15:10] 88E */
|
||||
ThermalValue = (u8)rtl8188e_PHY_QueryRFReg(Adapter, RF_PATH_A, RF_T_METER_88E, 0xfc00); /* 0x42: RF Reg[15:10] 88E */
|
||||
|
||||
if (is2t)
|
||||
rf = 2;
|
||||
@ -146,7 +146,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
|
||||
if (ThermalValue) {
|
||||
/* Query OFDM path A default setting */
|
||||
ele_D = ODM_GetBBReg(dm_odm, rOFDM0_XATxIQImbalance, bMaskDWord) & bMaskOFDM_D;
|
||||
ele_D = rtl8188e_PHY_QueryBBReg(Adapter, rOFDM0_XATxIQImbalance, bMaskDWord) & bMaskOFDM_D;
|
||||
for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { /* find the index */
|
||||
if (ele_D == (OFDMSwingTable[i] & bMaskOFDM_D)) {
|
||||
OFDM_index_old[0] = (u8)i;
|
||||
@ -157,7 +157,7 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
|
||||
/* Query OFDM path B default setting */
|
||||
if (is2t) {
|
||||
ele_D = ODM_GetBBReg(dm_odm, rOFDM0_XBTxIQImbalance, bMaskDWord) & bMaskOFDM_D;
|
||||
ele_D = rtl8188e_PHY_QueryBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord) & bMaskOFDM_D;
|
||||
for (i = 0; i < OFDM_TABLE_SIZE_92D; i++) { /* find the index */
|
||||
if (ele_D == (OFDMSwingTable[i] & bMaskOFDM_D)) {
|
||||
OFDM_index_old[1] = (u8)i;
|
||||
@ -171,13 +171,13 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
|
||||
for (i = 0; i < CCK_TABLE_SIZE; i++) {
|
||||
if (dm_odm->RFCalibrateInfo.bCCKinCH14) {
|
||||
if (ODM_CompareMemory(dm_odm, (void *)&TempCCk, (void *)&CCKSwingTable_Ch14[i][2], 4) == 0) {
|
||||
if (memcmp((void *)&TempCCk, (void *)&CCKSwingTable_Ch14[i][2], 4)) {
|
||||
CCK_index_old = (u8)i;
|
||||
dm_odm->BbSwingIdxCckBase = (u8)i;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (ODM_CompareMemory(dm_odm, (void *)&TempCCk, (void *)&CCKSwingTable_Ch1_Ch13[i][2], 4) == 0) {
|
||||
if (memcmp((void *)&TempCCk, (void *)&CCKSwingTable_Ch1_Ch13[i][2], 4)) {
|
||||
CCK_index_old = (u8)i;
|
||||
dm_odm->BbSwingIdxCckBase = (u8)i;
|
||||
break;
|
||||
@ -329,17 +329,17 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
|
||||
/* wtite new elements A, C, D to regC88 and regC9C, element B is always 0 */
|
||||
value32 = (ele_D << 22) | ((ele_C & 0x3F) << 16) | ele_A;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XBTxIQImbalance, bMaskDWord, value32);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord, value32);
|
||||
|
||||
value32 = (ele_C & 0x000003C0) >> 6;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XDTxAFE, bMaskH4Bits, value32);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XDTxAFE, bMaskH4Bits, value32);
|
||||
|
||||
value32 = ((X * ele_D) >> 7) & 0x01;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_ECCAThreshold, BIT(28), value32);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT(28), value32);
|
||||
} else {
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XBTxIQImbalance, bMaskDWord, OFDMSwingTable[(u8)OFDM_index[1]]);
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XDTxAFE, bMaskH4Bits, 0x00);
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_ECCAThreshold, BIT(28), 0x00);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XBTxIQImbalance, bMaskDWord, OFDMSwingTable[(u8)OFDM_index[1]]);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_XDTxAFE, bMaskH4Bits, 0x00);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM0_ECCAThreshold, BIT(28), 0x00);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -361,35 +361,33 @@ odm_TXPowerTrackingCallback_ThermalMeter_8188E(
|
||||
#define IQK_DELAY_TIME 1 /* ms */
|
||||
|
||||
static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */
|
||||
phy_PathA_IQK_8188E(struct adapter *adapt, bool configPathB)
|
||||
phy_PathA_IQK_8188E(struct adapter *adapt)
|
||||
{
|
||||
u32 regeac, regE94, regE9C;
|
||||
u8 result = 0x00;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
/* 1 Tx IQK */
|
||||
/* path-A IQK setting */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1c);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_A, bMaskDWord, 0x30008c1c);
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_PI_A, bMaskDWord, 0x8214032a);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_PI_A, bMaskDWord, 0x28160000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_Tone_A, bMaskDWord, 0x30008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_PI_A, bMaskDWord, 0x8214032a);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_PI_A, bMaskDWord, 0x28160000);
|
||||
|
||||
/* LO calibration setting */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Rsp, bMaskDWord, 0x00462911);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Rsp, bMaskDWord, 0x00462911);
|
||||
|
||||
/* One shot, path A LOK & IQK */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
|
||||
/* delay x ms */
|
||||
/* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */
|
||||
ODM_delay_ms(IQK_DELAY_TIME_88E);
|
||||
mdelay(IQK_DELAY_TIME_88E);
|
||||
|
||||
/* Check failed */
|
||||
regeac = ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
regeac = rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
|
||||
if (!(regeac & BIT(28)) &&
|
||||
(((regE94 & 0x03FF0000) >> 16) != 0x142) &&
|
||||
@ -399,51 +397,49 @@ phy_PathA_IQK_8188E(struct adapter *adapt, bool configPathB)
|
||||
}
|
||||
|
||||
static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */
|
||||
phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)
|
||||
phy_PathA_RxIQK(struct adapter *adapt)
|
||||
{
|
||||
u32 regeac, regE94, regE9C, regEA4, u4tmp;
|
||||
u8 result = 0x00;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
/* 1 Get TXIMR setting */
|
||||
/* modify RXIQK mode table */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_WE_LUT, bRFRegOffsetMask, 0x800a0);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x30000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0000f);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xf117B);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_WE_LUT, bRFRegOffsetMask, 0x800a0);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x30000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0000f);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xf117B);
|
||||
|
||||
/* PA,PAD off */
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x980);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, 0x56, bRFRegOffsetMask, 0x51000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x980);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, 0x56, bRFRegOffsetMask, 0x51000);
|
||||
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
|
||||
/* IQK setting */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK, bMaskDWord, 0x01007c00);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK, bMaskDWord, 0x81004800);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK, bMaskDWord, 0x01007c00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK, bMaskDWord, 0x81004800);
|
||||
|
||||
/* path-A IQK setting */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1c);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_A, bMaskDWord, 0x30008c1c);
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_PI_A, bMaskDWord, 0x82160c1f);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_PI_A, bMaskDWord, 0x28160000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x10008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_Tone_A, bMaskDWord, 0x30008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_PI_A, bMaskDWord, 0x82160c1f);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_PI_A, bMaskDWord, 0x28160000);
|
||||
|
||||
/* LO calibration setting */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911);
|
||||
|
||||
/* One shot, path A LOK & IQK */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
|
||||
/* delay x ms */
|
||||
ODM_delay_ms(IQK_DELAY_TIME_88E);
|
||||
mdelay(IQK_DELAY_TIME_88E);
|
||||
|
||||
/* Check failed */
|
||||
regeac = ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
regeac = rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
|
||||
if (!(regeac & BIT(28)) &&
|
||||
(((regE94 & 0x03FF0000) >> 16) != 0x142) &&
|
||||
@ -453,46 +449,46 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)
|
||||
return result;
|
||||
|
||||
u4tmp = 0x80007C00 | (regE94 & 0x3FF0000) | ((regE9C & 0x3FF0000) >> 16);
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK, bMaskDWord, u4tmp);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK, bMaskDWord, u4tmp);
|
||||
|
||||
/* 1 RX IQK */
|
||||
/* modify RXIQK mode table */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_WE_LUT, bRFRegOffsetMask, 0x800a0);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x30000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0000f);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xf7ffa);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_WE_LUT, bRFRegOffsetMask, 0x800a0);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_RCK_OS, bRFRegOffsetMask, 0x30000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_TXPA_G1, bRFRegOffsetMask, 0x0000f);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_TXPA_G2, bRFRegOffsetMask, 0xf7ffa);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
|
||||
/* IQK setting */
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK, bMaskDWord, 0x01004800);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK, bMaskDWord, 0x01004800);
|
||||
|
||||
/* path-A IQK setting */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_A, bMaskDWord, 0x38008c1c);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_A, bMaskDWord, 0x18008c1c);
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_PI_A, bMaskDWord, 0x82160c05);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_PI_A, bMaskDWord, 0x28160c1f);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x38008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_Tone_A, bMaskDWord, 0x18008c1c);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_PI_A, bMaskDWord, 0x82160c05);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_PI_A, bMaskDWord, 0x28160c1f);
|
||||
|
||||
/* LO calibration setting */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Rsp, bMaskDWord, 0x0046a911);
|
||||
|
||||
/* One shot, path A LOK & IQK */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf9000000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rIQK_AGC_Pts, bMaskDWord, 0xf8000000);
|
||||
|
||||
/* delay x ms */
|
||||
/* PlatformStallExecution(IQK_DELAY_TIME_88E*1000); */
|
||||
ODM_delay_ms(IQK_DELAY_TIME_88E);
|
||||
mdelay(IQK_DELAY_TIME_88E);
|
||||
|
||||
/* Check failed */
|
||||
regeac = ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
regEA4 = ODM_GetBBReg(dm_odm, rRx_Power_Before_IQK_A_2, bMaskDWord);
|
||||
regeac = rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regE94 = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_Before_IQK_A, bMaskDWord);
|
||||
regE9C = rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_After_IQK_A, bMaskDWord);
|
||||
regEA4 = rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord);
|
||||
|
||||
/* reload RF 0xdf */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x180);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x00000000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, 0xdf, bRFRegOffsetMask, 0x180);
|
||||
|
||||
if (!(regeac & BIT(27)) && /* if Tx is OK, check whether Rx is OK */
|
||||
(((regEA4 & 0x03FF0000) >> 16) != 0x132) &&
|
||||
@ -502,95 +498,54 @@ phy_PathA_RxIQK(struct adapter *adapt, bool configPathB)
|
||||
return result;
|
||||
}
|
||||
|
||||
static u8 /* bit0 = 1 => Tx OK, bit1 = 1 => Rx OK */
|
||||
phy_PathB_IQK_8188E(struct adapter *adapt)
|
||||
{
|
||||
u32 regeac, regeb4, regebc, regec4, regecc;
|
||||
u8 result = 0x00;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
/* One shot, path B LOK & IQK */
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Cont, bMaskDWord, 0x00000002);
|
||||
ODM_SetBBReg(dm_odm, rIQK_AGC_Cont, bMaskDWord, 0x00000000);
|
||||
|
||||
/* delay x ms */
|
||||
ODM_delay_ms(IQK_DELAY_TIME_88E);
|
||||
|
||||
/* Check failed */
|
||||
regeac = ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_A_2, bMaskDWord);
|
||||
regeb4 = ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_B, bMaskDWord);
|
||||
regebc = ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_B, bMaskDWord);
|
||||
regec4 = ODM_GetBBReg(dm_odm, rRx_Power_Before_IQK_B_2, bMaskDWord);
|
||||
regecc = ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_B_2, bMaskDWord);
|
||||
|
||||
if (!(regeac & BIT(31)) &&
|
||||
(((regeb4 & 0x03FF0000) >> 16) != 0x142) &&
|
||||
(((regebc & 0x03FF0000) >> 16) != 0x42))
|
||||
result |= 0x01;
|
||||
else
|
||||
return result;
|
||||
|
||||
if (!(regeac & BIT(30)) &&
|
||||
(((regec4 & 0x03FF0000) >> 16) != 0x132) &&
|
||||
(((regecc & 0x03FF0000) >> 16) != 0x36))
|
||||
result |= 0x02;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void patha_fill_iqk(struct adapter *adapt, bool iqkok, s32 result[][8], u8 final_candidate, bool txonly)
|
||||
{
|
||||
u32 Oldval_0, X, TX0_A, reg;
|
||||
s32 Y, TX0_C;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
if (final_candidate == 0xFF) {
|
||||
return;
|
||||
} else if (iqkok) {
|
||||
Oldval_0 = (ODM_GetBBReg(dm_odm, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
|
||||
Oldval_0 = (rtl8188e_PHY_QueryBBReg(adapt, rOFDM0_XATxIQImbalance, bMaskDWord) >> 22) & 0x3FF;
|
||||
|
||||
X = result[final_candidate][0];
|
||||
if ((X & 0x00000200) != 0)
|
||||
X = X | 0xFFFFFC00;
|
||||
TX0_A = (X * Oldval_0) >> 8;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_XATxIQImbalance, 0x3FF, TX0_A);
|
||||
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_ECCAThreshold, BIT(31), ((X * Oldval_0 >> 7) & 0x1));
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_ECCAThreshold, BIT(31), ((X * Oldval_0 >> 7) & 0x1));
|
||||
|
||||
Y = result[final_candidate][1];
|
||||
if ((Y & 0x00000200) != 0)
|
||||
Y = Y | 0xFFFFFC00;
|
||||
|
||||
TX0_C = (Y * Oldval_0) >> 8;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XCTxAFE, 0xF0000000, ((TX0_C & 0x3C0) >> 6));
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XATxIQImbalance, 0x003F0000, (TX0_C & 0x3F));
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_XCTxAFE, 0xF0000000, ((TX0_C & 0x3C0) >> 6));
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_XATxIQImbalance, 0x003F0000, (TX0_C & 0x3F));
|
||||
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_ECCAThreshold, BIT(29), ((Y * Oldval_0 >> 7) & 0x1));
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_ECCAThreshold, BIT(29), ((Y * Oldval_0 >> 7) & 0x1));
|
||||
|
||||
if (txonly)
|
||||
return;
|
||||
|
||||
reg = result[final_candidate][2];
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XARxIQImbalance, 0x3FF, reg);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_XARxIQImbalance, 0x3FF, reg);
|
||||
|
||||
reg = result[final_candidate][3] & 0x3F;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_XARxIQImbalance, 0xFC00, reg);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_XARxIQImbalance, 0xFC00, reg);
|
||||
|
||||
reg = (result[final_candidate][3] >> 6) & 0xF;
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_RxIQExtAnta, 0xF0000000, reg);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_RxIQExtAnta, 0xF0000000, reg);
|
||||
}
|
||||
}
|
||||
|
||||
void _PHY_SaveADDARegisters(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup, u32 RegisterNum)
|
||||
{
|
||||
u32 i;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
for (i = 0; i < RegisterNum; i++) {
|
||||
ADDABackup[i] = ODM_GetBBReg(dm_odm, ADDAReg[i], bMaskDWord);
|
||||
ADDABackup[i] = rtl8188e_PHY_QueryBBReg(adapt, ADDAReg[i], bMaskDWord);
|
||||
}
|
||||
}
|
||||
|
||||
@ -601,22 +556,19 @@ static void _PHY_SaveMACRegisters(
|
||||
)
|
||||
{
|
||||
u32 i;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) {
|
||||
MACBackup[i] = ODM_Read1Byte(dm_odm, MACReg[i]);
|
||||
}
|
||||
MACBackup[i] = ODM_Read4Byte(dm_odm, MACReg[i]);
|
||||
|
||||
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++)
|
||||
MACBackup[i] = rtw_read8(adapt, MACReg[i]);
|
||||
|
||||
MACBackup[i] = rtw_read32(adapt, MACReg[i]);
|
||||
}
|
||||
|
||||
static void reload_adda_reg(struct adapter *adapt, u32 *ADDAReg, u32 *ADDABackup, u32 RegiesterNum)
|
||||
{
|
||||
u32 i;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
for (i = 0; i < RegiesterNum; i++)
|
||||
ODM_SetBBReg(dm_odm, ADDAReg[i], bMaskDWord, ADDABackup[i]);
|
||||
rtl8188e_PHY_SetBBReg(adapt, ADDAReg[i], bMaskDWord, ADDABackup[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -627,38 +579,24 @@ _PHY_ReloadMACRegisters(
|
||||
)
|
||||
{
|
||||
u32 i;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++) {
|
||||
ODM_Write1Byte(dm_odm, MACReg[i], (u8)MACBackup[i]);
|
||||
}
|
||||
ODM_Write4Byte(dm_odm, MACReg[i], MACBackup[i]);
|
||||
for (i = 0; i < (IQK_MAC_REG_NUM - 1); i++)
|
||||
rtw_write8(adapt, MACReg[i], (u8)MACBackup[i]);
|
||||
|
||||
rtw_write32(adapt, MACReg[i], MACBackup[i]);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
_PHY_PathADDAOn(
|
||||
struct adapter *adapt,
|
||||
u32 *ADDAReg,
|
||||
bool isPathAOn,
|
||||
bool is2t
|
||||
)
|
||||
u32 *ADDAReg)
|
||||
{
|
||||
u32 pathOn;
|
||||
u32 i;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
pathOn = isPathAOn ? 0x04db25a4 : 0x0b1b25a4;
|
||||
if (!is2t) {
|
||||
pathOn = 0x0bdb25a0;
|
||||
ODM_SetBBReg(dm_odm, ADDAReg[0], bMaskDWord, 0x0b1b25a0);
|
||||
} else {
|
||||
ODM_SetBBReg(dm_odm, ADDAReg[0], bMaskDWord, pathOn);
|
||||
}
|
||||
rtl8188e_PHY_SetBBReg(adapt, ADDAReg[0], bMaskDWord, 0x0b1b25a0);
|
||||
|
||||
for (i = 1; i < IQK_ADDA_REG_NUM; i++)
|
||||
ODM_SetBBReg(dm_odm, ADDAReg[i], bMaskDWord, pathOn);
|
||||
rtl8188e_PHY_SetBBReg(adapt, ADDAReg[i], bMaskDWord, 0x0bdb25a0);
|
||||
}
|
||||
|
||||
void
|
||||
@ -669,28 +607,13 @@ _PHY_MACSettingCalibration(
|
||||
)
|
||||
{
|
||||
u32 i = 0;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
ODM_Write1Byte(dm_odm, MACReg[i], 0x3F);
|
||||
rtw_write8(adapt, MACReg[i], 0x3F);
|
||||
|
||||
for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++) {
|
||||
ODM_Write1Byte(dm_odm, MACReg[i], (u8)(MACBackup[i] & (~BIT(3))));
|
||||
}
|
||||
ODM_Write1Byte(dm_odm, MACReg[i], (u8)(MACBackup[i] & (~BIT(5))));
|
||||
}
|
||||
for (i = 1; i < (IQK_MAC_REG_NUM - 1); i++)
|
||||
rtw_write8(adapt, MACReg[i], (u8)(MACBackup[i] & (~BIT(3))));
|
||||
|
||||
void
|
||||
_PHY_PathAStandBy(
|
||||
struct adapter *adapt
|
||||
)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x0);
|
||||
ODM_SetBBReg(dm_odm, 0x840, bMaskDWord, 0x00010000);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
rtw_write8(adapt, MACReg[i], (u8)(MACBackup[i] & (~BIT(5))));
|
||||
}
|
||||
|
||||
static void _PHY_PIModeSwitch(
|
||||
@ -699,12 +622,10 @@ static void _PHY_PIModeSwitch(
|
||||
)
|
||||
{
|
||||
u32 mode;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
mode = PIMode ? 0x01000100 : 0x01000000;
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XA_HSSIParameter1, bMaskDWord, mode);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XB_HSSIParameter1, bMaskDWord, mode);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XA_HSSIParameter1, bMaskDWord, mode);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XB_HSSIParameter1, bMaskDWord, mode);
|
||||
}
|
||||
|
||||
static bool phy_SimularityCompare_8188E(
|
||||
@ -786,12 +707,12 @@ static bool phy_SimularityCompare_8188E(
|
||||
}
|
||||
}
|
||||
|
||||
static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t, bool is2t)
|
||||
static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *pHalData = &adapt->haldata;
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
u32 i;
|
||||
u8 PathAOK, PathBOK;
|
||||
u8 PathAOK;
|
||||
u32 ADDA_REG[IQK_ADDA_REG_NUM] = {
|
||||
rFPGA0_XCD_SwitchControl, rBlue_Tooth,
|
||||
rRx_Wait_CCA, rTx_CCK_RFON,
|
||||
@ -823,9 +744,9 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t,
|
||||
_PHY_SaveADDARegisters(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM);
|
||||
}
|
||||
|
||||
_PHY_PathADDAOn(adapt, ADDA_REG, true, is2t);
|
||||
_PHY_PathADDAOn(adapt, ADDA_REG);
|
||||
if (t == 0)
|
||||
dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)ODM_GetBBReg(dm_odm, rFPGA0_XA_HSSIParameter1, BIT(8));
|
||||
dm_odm->RFCalibrateInfo.bRfPiEnable = (u8)rtl8188e_PHY_QueryBBReg(adapt, rFPGA0_XA_HSSIParameter1, BIT(8));
|
||||
|
||||
if (!dm_odm->RFCalibrateInfo.bRfPiEnable) {
|
||||
/* Switch BB to PI mode to do IQ Calibration. */
|
||||
@ -833,77 +754,49 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t,
|
||||
}
|
||||
|
||||
/* BB setting */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_RFMOD, BIT(24), 0x00);
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_TRxPathEnable, bMaskDWord, 0x03a05600);
|
||||
ODM_SetBBReg(dm_odm, rOFDM0_TRMuxPar, bMaskDWord, 0x000800e4);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, 0x22204000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_RFMOD, BIT(24), 0x00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_TRxPathEnable, bMaskDWord, 0x03a05600);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rOFDM0_TRMuxPar, bMaskDWord, 0x000800e4);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XCD_RFInterfaceSW, bMaskDWord, 0x22204000);
|
||||
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XAB_RFInterfaceSW, BIT(10), 0x01);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XAB_RFInterfaceSW, BIT(26), 0x01);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XA_RFInterfaceOE, BIT(10), 0x00);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XB_RFInterfaceOE, BIT(10), 0x00);
|
||||
|
||||
if (is2t) {
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00010000);
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00010000);
|
||||
}
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XAB_RFInterfaceSW, BIT(10), 0x01);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XAB_RFInterfaceSW, BIT(26), 0x01);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XA_RFInterfaceOE, BIT(10), 0x00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XB_RFInterfaceOE, BIT(10), 0x00);
|
||||
|
||||
/* MAC settings */
|
||||
_PHY_MACSettingCalibration(adapt, IQK_MAC_REG, dm_odm->RFCalibrateInfo.IQK_MAC_backup);
|
||||
|
||||
/* Page B init */
|
||||
/* AP or IQK */
|
||||
ODM_SetBBReg(dm_odm, rConfig_AntA, bMaskDWord, 0x0f600000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rConfig_AntA, bMaskDWord, 0x0f600000);
|
||||
|
||||
if (is2t)
|
||||
ODM_SetBBReg(dm_odm, rConfig_AntB, bMaskDWord, 0x0f600000);
|
||||
|
||||
/* IQ calibration setting */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK, bMaskDWord, 0x01007c00);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK, bMaskDWord, 0x81004800);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0x80800000);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK, bMaskDWord, 0x01007c00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK, bMaskDWord, 0x81004800);
|
||||
|
||||
for (i = 0; i < retryCount; i++) {
|
||||
PathAOK = phy_PathA_IQK_8188E(adapt, is2t);
|
||||
PathAOK = phy_PathA_IQK_8188E(adapt);
|
||||
if (PathAOK == 0x01) {
|
||||
result[t][0] = (ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_A, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][1] = (ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_A, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][0] = (rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_Before_IQK_A, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][1] = (rtl8188e_PHY_QueryBBReg(adapt, rTx_Power_After_IQK_A, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < retryCount; i++) {
|
||||
PathAOK = phy_PathA_RxIQK(adapt, is2t);
|
||||
PathAOK = phy_PathA_RxIQK(adapt);
|
||||
if (PathAOK == 0x03) {
|
||||
result[t][2] = (ODM_GetBBReg(dm_odm, rRx_Power_Before_IQK_A_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][3] = (ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_A_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][2] = (rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_Before_IQK_A_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][3] = (rtl8188e_PHY_QueryBBReg(adapt, rRx_Power_After_IQK_A_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (is2t) {
|
||||
_PHY_PathAStandBy(adapt);
|
||||
|
||||
/* Turn Path B ADDA on */
|
||||
_PHY_PathADDAOn(adapt, ADDA_REG, false, is2t);
|
||||
|
||||
for (i = 0; i < retryCount; i++) {
|
||||
PathBOK = phy_PathB_IQK_8188E(adapt);
|
||||
if (PathBOK == 0x03) {
|
||||
result[t][4] = (ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_B, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][5] = (ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_B, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][6] = (ODM_GetBBReg(dm_odm, rRx_Power_Before_IQK_B_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][7] = (ODM_GetBBReg(dm_odm, rRx_Power_After_IQK_B_2, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
break;
|
||||
} else if (i == (retryCount - 1) && PathBOK == 0x01) { /* Tx IQK OK */
|
||||
result[t][4] = (ODM_GetBBReg(dm_odm, rTx_Power_Before_IQK_B, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
result[t][5] = (ODM_GetBBReg(dm_odm, rTx_Power_After_IQK_B, bMaskDWord) & 0x3FF0000) >> 16;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Back to BB mode, load original value */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_IQK, bMaskDWord, 0);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_IQK, bMaskDWord, 0);
|
||||
|
||||
if (t != 0) {
|
||||
if (!dm_odm->RFCalibrateInfo.bRfPiEnable) {
|
||||
@ -920,13 +813,11 @@ static void phy_IQCalibrate_8188E(struct adapter *adapt, s32 result[][8], u8 t,
|
||||
reload_adda_reg(adapt, IQK_BB_REG_92C, dm_odm->RFCalibrateInfo.IQK_BB_backup, IQK_BB_REG_NUM);
|
||||
|
||||
/* Restore RX initial gain */
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00032ed3);
|
||||
if (is2t)
|
||||
ODM_SetBBReg(dm_odm, rFPGA0_XB_LSSIParameter, bMaskDWord, 0x00032ed3);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rFPGA0_XA_LSSIParameter, bMaskDWord, 0x00032ed3);
|
||||
|
||||
/* load 0xe30 IQC default value */
|
||||
ODM_SetBBReg(dm_odm, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
ODM_SetBBReg(dm_odm, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rTx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
rtl8188e_PHY_SetBBReg(adapt, rRx_IQK_Tone_A, bMaskDWord, 0x01008c00);
|
||||
}
|
||||
}
|
||||
|
||||
@ -934,62 +825,60 @@ static void phy_LCCalibrate_8188E(struct adapter *adapt, bool is2t)
|
||||
{
|
||||
u8 tmpreg;
|
||||
u32 RF_Amode = 0, RF_Bmode = 0, LC_Cal;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
/* Check continuous TX and Packet TX */
|
||||
tmpreg = ODM_Read1Byte(dm_odm, 0xd03);
|
||||
tmpreg = rtw_read8(adapt, 0xd03);
|
||||
|
||||
if ((tmpreg & 0x70) != 0) /* Deal with contisuous TX case */
|
||||
ODM_Write1Byte(dm_odm, 0xd03, tmpreg & 0x8F); /* disable all continuous TX */
|
||||
rtw_write8(adapt, 0xd03, tmpreg & 0x8F); /* disable all continuous TX */
|
||||
else /* Deal with Packet TX case */
|
||||
ODM_Write1Byte(dm_odm, REG_TXPAUSE, 0xFF); /* block all queues */
|
||||
rtw_write8(adapt, REG_TXPAUSE, 0xFF); /* block all queues */
|
||||
|
||||
if ((tmpreg & 0x70) != 0) {
|
||||
/* 1. Read original RF mode */
|
||||
/* Path-A */
|
||||
RF_Amode = PHY_QueryRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits);
|
||||
RF_Amode = rtl8188e_PHY_QueryRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits);
|
||||
|
||||
/* Path-B */
|
||||
if (is2t)
|
||||
RF_Bmode = PHY_QueryRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits);
|
||||
RF_Bmode = rtl8188e_PHY_QueryRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits);
|
||||
|
||||
/* 2. Set RF mode = standby mode */
|
||||
/* Path-A */
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_AC, bMask12Bits, (RF_Amode & 0x8FFFF) | 0x10000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits, (RF_Amode & 0x8FFFF) | 0x10000);
|
||||
|
||||
/* Path-B */
|
||||
if (is2t)
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_B, RF_AC, bMask12Bits, (RF_Bmode & 0x8FFFF) | 0x10000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits, (RF_Bmode & 0x8FFFF) | 0x10000);
|
||||
}
|
||||
|
||||
/* 3. Read RF reg18 */
|
||||
LC_Cal = PHY_QueryRFReg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits);
|
||||
LC_Cal = rtl8188e_PHY_QueryRFReg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits);
|
||||
|
||||
/* 4. Set LC calibration begin bit15 */
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_CHNLBW, bMask12Bits, LC_Cal | 0x08000);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_CHNLBW, bMask12Bits, LC_Cal | 0x08000);
|
||||
|
||||
ODM_sleep_ms(100);
|
||||
msleep(100);
|
||||
|
||||
/* Restore original situation */
|
||||
if ((tmpreg & 0x70) != 0) {
|
||||
/* Deal with continuous TX case */
|
||||
/* Path-A */
|
||||
ODM_Write1Byte(dm_odm, 0xd03, tmpreg);
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode);
|
||||
rtw_write8(adapt, 0xd03, tmpreg);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_A, RF_AC, bMask12Bits, RF_Amode);
|
||||
|
||||
/* Path-B */
|
||||
if (is2t)
|
||||
ODM_SetRFReg(dm_odm, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode);
|
||||
rtl8188e_PHY_SetRFReg(adapt, RF_PATH_B, RF_AC, bMask12Bits, RF_Bmode);
|
||||
} else {
|
||||
/* Deal with Packet TX case */
|
||||
ODM_Write1Byte(dm_odm, REG_TXPAUSE, 0x00);
|
||||
rtw_write8(adapt, REG_TXPAUSE, 0x00);
|
||||
}
|
||||
}
|
||||
|
||||
void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *pHalData = &adapt->haldata;
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
s32 result[4][8]; /* last is final result */
|
||||
u8 i, final_candidate;
|
||||
@ -1032,7 +921,7 @@ void PHY_IQCalibrate_8188E(struct adapter *adapt, bool recovery)
|
||||
is13simular = false;
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
phy_IQCalibrate_8188E(adapt, result, i, false);
|
||||
phy_IQCalibrate_8188E(adapt, result, i);
|
||||
|
||||
if (i == 1) {
|
||||
is12simular = phy_SimularityCompare_8188E(adapt, result, 0, 1);
|
||||
@ -1101,7 +990,7 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt)
|
||||
{
|
||||
bool singletone = false, carrier_sup = false;
|
||||
u32 timeout = 2000, timecount = 0;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *pHalData = &adapt->haldata;
|
||||
struct odm_dm_struct *dm_odm = &pHalData->odmpriv;
|
||||
|
||||
if (!(dm_odm->SupportAbility & ODM_RF_CALIBRATION))
|
||||
@ -1111,7 +1000,7 @@ void PHY_LCCalibrate_8188E(struct adapter *adapt)
|
||||
return;
|
||||
|
||||
while (*dm_odm->pbScanInProcess && timecount < timeout) {
|
||||
ODM_delay_ms(50);
|
||||
mdelay(50);
|
||||
timecount += 50;
|
||||
}
|
||||
|
||||
|
@ -25,8 +25,7 @@ Major Change History:
|
||||
* Assumption:
|
||||
* We should follow specific format which was released from HW SD.
|
||||
*/
|
||||
u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
|
||||
u8 ifacetype, struct wl_pwr_cfg pwrseqcmd[])
|
||||
u8 HalPwrSeqCmdParsing(struct adapter *padapter, struct wl_pwr_cfg pwrseqcmd[])
|
||||
{
|
||||
struct wl_pwr_cfg pwrcfgcmd = {0};
|
||||
u8 poll_bit = false;
|
||||
@ -39,54 +38,49 @@ u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 cut_vers, u8 fab_vers,
|
||||
do {
|
||||
pwrcfgcmd = pwrseqcmd[aryidx];
|
||||
|
||||
/* 2 Only Handle the command whose FAB, CUT, and Interface are matched */
|
||||
if ((GET_PWR_CFG_FAB_MASK(pwrcfgcmd) & fab_vers) &&
|
||||
(GET_PWR_CFG_CUT_MASK(pwrcfgcmd) & cut_vers) &&
|
||||
(GET_PWR_CFG_INTF_MASK(pwrcfgcmd) & ifacetype)) {
|
||||
switch (GET_PWR_CFG_CMD(pwrcfgcmd)) {
|
||||
case PWR_CMD_WRITE:
|
||||
offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
|
||||
switch (GET_PWR_CFG_CMD(pwrcfgcmd)) {
|
||||
case PWR_CMD_WRITE:
|
||||
offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
|
||||
|
||||
/* Read the value from system register */
|
||||
/* Read the value from system register */
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
|
||||
/* Write the value back to system register */
|
||||
rtw_write8(padapter, offset, value);
|
||||
break;
|
||||
case PWR_CMD_POLLING:
|
||||
poll_bit = false;
|
||||
offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
|
||||
do {
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
value |= (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd));
|
||||
|
||||
/* Write the value back to system register */
|
||||
rtw_write8(padapter, offset, value);
|
||||
break;
|
||||
case PWR_CMD_POLLING:
|
||||
poll_bit = false;
|
||||
offset = GET_PWR_CFG_OFFSET(pwrcfgcmd);
|
||||
do {
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value &= GET_PWR_CFG_MASK(pwrcfgcmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd)))
|
||||
poll_bit = true;
|
||||
else
|
||||
udelay(10);
|
||||
|
||||
if (poll_count++ > max_poll_count) {
|
||||
DBG_88E("Fail to polling Offset[%#x]\n", offset);
|
||||
return false;
|
||||
}
|
||||
} while (!poll_bit);
|
||||
break;
|
||||
case PWR_CMD_DELAY:
|
||||
if (GET_PWR_CFG_VALUE(pwrcfgcmd) == PWRSEQ_DELAY_US)
|
||||
udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd));
|
||||
value &= GET_PWR_CFG_MASK(pwrcfgcmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(pwrcfgcmd) & GET_PWR_CFG_MASK(pwrcfgcmd)))
|
||||
poll_bit = true;
|
||||
else
|
||||
udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd) * 1000);
|
||||
break;
|
||||
case PWR_CMD_END:
|
||||
/* When this command is parsed, end the process */
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
udelay(10);
|
||||
|
||||
if (poll_count++ > max_poll_count) {
|
||||
DBG_88E("Fail to polling Offset[%#x]\n", offset);
|
||||
return false;
|
||||
}
|
||||
} while (!poll_bit);
|
||||
break;
|
||||
case PWR_CMD_DELAY:
|
||||
if (GET_PWR_CFG_VALUE(pwrcfgcmd) == PWRSEQ_DELAY_US)
|
||||
udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd));
|
||||
else
|
||||
udelay(GET_PWR_CFG_OFFSET(pwrcfgcmd) * 1000);
|
||||
break;
|
||||
case PWR_CMD_END:
|
||||
/* When this command is parsed, end the process */
|
||||
return true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
aryidx++;/* Add Array Index */
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
#define READ_AND_CONFIG READ_AND_CONFIG_MP
|
||||
|
||||
@ -251,17 +251,7 @@ static void odm_Process_RSSIForDM(struct odm_dm_struct *dm_odm,
|
||||
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
|
||||
|
||||
/* Smart Antenna Debug Message------------------ */
|
||||
if (dm_odm->AntDivType == CG_TRX_SMART_ANTDIV) {
|
||||
if (pDM_FatTable->FAT_State == FAT_TRAINING_STATE) {
|
||||
if (pPktinfo->bPacketToSelf) {
|
||||
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2 << 2) |
|
||||
(pDM_FatTable->antsel_rx_keep_1 << 1) |
|
||||
pDM_FatTable->antsel_rx_keep_0;
|
||||
pDM_FatTable->antSumRSSI[antsel_tr_mux] += pPhyInfo->RxPWDBAll;
|
||||
pDM_FatTable->antRSSIcnt[antsel_tr_mux]++;
|
||||
}
|
||||
}
|
||||
} else if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
|
||||
if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV)) {
|
||||
if (pPktinfo->bPacketToSelf || pPktinfo->bPacketBeacon) {
|
||||
antsel_tr_mux = (pDM_FatTable->antsel_rx_keep_2 << 2) |
|
||||
(pDM_FatTable->antsel_rx_keep_1 << 1) | pDM_FatTable->antsel_rx_keep_0;
|
||||
@ -368,10 +358,8 @@ void ODM_PhyStatusQuery(struct odm_dm_struct *dm_odm,
|
||||
struct odm_per_pkt_info *pPktinfo,
|
||||
struct adapter *adapt)
|
||||
{
|
||||
odm_RxPhyStatus92CSeries_Parsing(dm_odm, pPhyInfo, pPhyStatus,
|
||||
pPktinfo, adapt);
|
||||
if (!dm_odm->RSSI_test)
|
||||
odm_Process_RSSIForDM(dm_odm, pPhyInfo, pPktinfo);
|
||||
odm_RxPhyStatus92CSeries_Parsing(dm_odm, pPhyInfo, pPhyStatus, pPktinfo, adapt);
|
||||
odm_Process_RSSIForDM(dm_odm, pPhyInfo, pPktinfo);
|
||||
}
|
||||
|
||||
enum HAL_STATUS ODM_ConfigRFWithHeaderFile(struct odm_dm_struct *dm_odm,
|
||||
|
@ -1,130 +1,98 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
static void odm_RX_HWAntDivInit(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
struct adapter *adapter = dm_odm->Adapter;
|
||||
u32 value32;
|
||||
|
||||
/* MAC Setting */
|
||||
value32 = ODM_GetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
|
||||
ODM_SetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
value32 = rtl8188e_PHY_QueryBBReg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
/* Pin Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_PIN_CTRL_11N, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(22), 1); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_PIN_CTRL_11N, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(22), 1); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
/* OFDM Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x000000a0);
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x000000a0);
|
||||
/* CCK Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_BB_PWR_SAV4_11N, BIT(7), 1); /* Fix CCK PHY status report issue */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT(4), 1); /* CCK complete HW AntDiv within 64 samples */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT(7), 1); /* Fix CCK PHY status report issue */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT(4), 1); /* CCK complete HW AntDiv within 64 samples */
|
||||
ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT);
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_ANT_MAPPING1_11N, 0xFFFF, 0x0201); /* antenna mapping table */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANT_MAPPING1_11N, 0xFFFF, 0x0201); /* antenna mapping table */
|
||||
}
|
||||
|
||||
static void odm_TRX_HWAntDivInit(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
struct adapter *adapter = dm_odm->Adapter;
|
||||
u32 value32;
|
||||
|
||||
/* MAC Setting */
|
||||
value32 = ODM_GetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
|
||||
ODM_SetMACReg(dm_odm, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
value32 = rtl8188e_PHY_QueryBBReg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord);
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANTSEL_PIN_11N, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
/* Pin Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_PIN_CTRL_11N, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(22), 0); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_LNA_SWITCH_11N, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_PIN_CTRL_11N, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(22), 0); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_LNA_SWITCH_11N, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
/* OFDM Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x000000a0);
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANTDIV_PARA1_11N, bMaskDWord, 0x000000a0);
|
||||
/* CCK Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_BB_PWR_SAV4_11N, BIT(7), 1); /* Fix CCK PHY status report issue */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT(4), 1); /* CCK complete HW AntDiv within 64 samples */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_BB_PWR_SAV4_11N, BIT(7), 1); /* Fix CCK PHY status report issue */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_CCK_ANTDIV_PARA2_11N, BIT(4), 1); /* CCK complete HW AntDiv within 64 samples */
|
||||
/* Tx Settings */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 0); /* Reg80c[21]=1'b0 from TX Reg */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 0); /* Reg80c[21]=1'b0 from TX Reg */
|
||||
ODM_UpdateRxIdleAnt_88E(dm_odm, MAIN_ANT);
|
||||
|
||||
/* antenna mapping table */
|
||||
if (!dm_odm->bIsMPChip) { /* testchip */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_DEFUALT_A_11N, BIT(10) | BIT(9) | BIT(8), 1); /* Reg858[10:8]=3'b001 */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_DEFUALT_A_11N, BIT(13) | BIT(12) | BIT(11), 2); /* Reg858[13:11]=3'b010 */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_DEFUALT_A_11N, BIT(10) | BIT(9) | BIT(8), 1); /* Reg858[10:8]=3'b001 */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_DEFUALT_A_11N, BIT(13) | BIT(12) | BIT(11), 2); /* Reg858[13:11]=3'b010 */
|
||||
} else { /* MPchip */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_ANT_MAPPING1_11N, bMaskDWord, 0x0201); /* Reg914=3'b010, Reg915=3'b001 */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANT_MAPPING1_11N, bMaskDWord, 0x0201); /* Reg914=3'b010, Reg915=3'b001 */
|
||||
}
|
||||
}
|
||||
|
||||
static void odm_FastAntTrainingInit(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
u32 value32, i;
|
||||
struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
|
||||
u32 AntCombination = 2;
|
||||
|
||||
for (i = 0; i < 6; i++) {
|
||||
dm_fat_tbl->Bssid[i] = 0;
|
||||
dm_fat_tbl->antSumRSSI[i] = 0;
|
||||
dm_fat_tbl->antRSSIcnt[i] = 0;
|
||||
dm_fat_tbl->antAveRSSI[i] = 0;
|
||||
}
|
||||
dm_fat_tbl->TrainIdx = 0;
|
||||
dm_fat_tbl->FAT_State = FAT_NORMAL_STATE;
|
||||
struct adapter *adapter = dm_odm->Adapter;
|
||||
u32 value32;
|
||||
|
||||
/* MAC Setting */
|
||||
value32 = ODM_GetMACReg(dm_odm, 0x4c, bMaskDWord);
|
||||
ODM_SetMACReg(dm_odm, 0x4c, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
value32 = ODM_GetMACReg(dm_odm, 0x7B4, bMaskDWord);
|
||||
ODM_SetMACReg(dm_odm, 0x7b4, bMaskDWord, value32 | (BIT(16) | BIT(17))); /* Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match */
|
||||
value32 = rtl8188e_PHY_QueryBBReg(adapter, 0x4c, bMaskDWord);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x4c, bMaskDWord, value32 | (BIT(23) | BIT(25))); /* Reg4C[25]=1, Reg4C[23]=1 for pin output */
|
||||
value32 = rtl8188e_PHY_QueryBBReg(adapter, 0x7B4, bMaskDWord);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x7b4, bMaskDWord, value32 | (BIT(16) | BIT(17))); /* Reg7B4[16]=1 enable antenna training, Reg7B4[17]=1 enable A2 match */
|
||||
|
||||
/* Match MAC ADDR */
|
||||
ODM_SetMACReg(dm_odm, 0x7b4, 0xFFFF, 0);
|
||||
ODM_SetMACReg(dm_odm, 0x7b0, bMaskDWord, 0);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x7b4, 0xFFFF, 0);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x7b0, bMaskDWord, 0);
|
||||
|
||||
ODM_SetBBReg(dm_odm, 0x870, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
ODM_SetBBReg(dm_odm, 0x864, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
ODM_SetBBReg(dm_odm, 0xb2c, BIT(22), 0); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
ODM_SetBBReg(dm_odm, 0xb2c, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
ODM_SetBBReg(dm_odm, 0xca4, bMaskDWord, 0x000000a0);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x870, BIT(9) | BIT(8), 0);/* Reg870[8]=1'b0, Reg870[9]=1'b0 antsel antselb by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x864, BIT(10), 0); /* Reg864[10]=1'b0 antsel2 by HW */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0xb2c, BIT(22), 0); /* Regb2c[22]=1'b0 disable CS/CG switch */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0xb2c, BIT(31), 1); /* Regb2c[31]=1'b1 output at CG only */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0xca4, bMaskDWord, 0x000000a0);
|
||||
|
||||
/* antenna mapping table */
|
||||
if (AntCombination == 2) {
|
||||
if (!dm_odm->bIsMPChip) { /* testchip */
|
||||
ODM_SetBBReg(dm_odm, 0x858, BIT(10) | BIT(9) | BIT(8), 1); /* Reg858[10:8]=3'b001 */
|
||||
ODM_SetBBReg(dm_odm, 0x858, BIT(13) | BIT(12) | BIT(11), 2); /* Reg858[13:11]=3'b010 */
|
||||
} else { /* MPchip */
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte0, 1);
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte1, 2);
|
||||
}
|
||||
} else if (AntCombination == 7) {
|
||||
if (!dm_odm->bIsMPChip) { /* testchip */
|
||||
ODM_SetBBReg(dm_odm, 0x858, BIT(10) | BIT(9) | BIT(8), 0); /* Reg858[10:8]=3'b000 */
|
||||
ODM_SetBBReg(dm_odm, 0x858, BIT(13) | BIT(12) | BIT(11), 1); /* Reg858[13:11]=3'b001 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(16), 0);
|
||||
ODM_SetBBReg(dm_odm, 0x858, BIT(15) | BIT(14), 2); /* Reg878[0],Reg858[14:15])=3'b010 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(19) | BIT(18) | BIT(17), 3);/* Reg878[3:1]=3b'011 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(22) | BIT(21) | BIT(20), 4);/* Reg878[6:4]=3b'100 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(25) | BIT(24) | BIT(23), 5);/* Reg878[9:7]=3b'101 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(28) | BIT(27) | BIT(26), 6);/* Reg878[12:10]=3b'110 */
|
||||
ODM_SetBBReg(dm_odm, 0x878, BIT(31) | BIT(30) | BIT(29), 7);/* Reg878[15:13]=3b'111 */
|
||||
} else { /* MPchip */
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte0, 0);
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte1, 1);
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte2, 2);
|
||||
ODM_SetBBReg(dm_odm, 0x914, bMaskByte3, 3);
|
||||
ODM_SetBBReg(dm_odm, 0x918, bMaskByte0, 4);
|
||||
ODM_SetBBReg(dm_odm, 0x918, bMaskByte1, 5);
|
||||
ODM_SetBBReg(dm_odm, 0x918, bMaskByte2, 6);
|
||||
ODM_SetBBReg(dm_odm, 0x918, bMaskByte3, 7);
|
||||
}
|
||||
if (!dm_odm->bIsMPChip) { /* testchip */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x858, BIT(10) | BIT(9) | BIT(8), 1); /* Reg858[10:8]=3'b001 */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x858, BIT(13) | BIT(12) | BIT(11), 2); /* Reg858[13:11]=3'b010 */
|
||||
} else { /* MPchip */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x914, bMaskByte0, 1);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x914, bMaskByte1, 2);
|
||||
}
|
||||
|
||||
/* Default Ant Setting when no fast training */
|
||||
ODM_SetBBReg(dm_odm, 0x80c, BIT(21), 1); /* Reg80c[21]=1'b1 from TX Info */
|
||||
ODM_SetBBReg(dm_odm, 0x864, BIT(5) | BIT(4) | BIT(3), 0); /* Default RX */
|
||||
ODM_SetBBReg(dm_odm, 0x864, BIT(8) | BIT(7) | BIT(6), 1); /* Optional RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x80c, BIT(21), 1); /* Reg80c[21]=1'b1 from TX Info */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x864, BIT(5) | BIT(4) | BIT(3), 0); /* Default RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x864, BIT(8) | BIT(7) | BIT(6), 1); /* Optional RX */
|
||||
|
||||
/* Enter Traing state */
|
||||
ODM_SetBBReg(dm_odm, 0x864, BIT(2) | BIT(1) | BIT(0), (AntCombination - 1)); /* Reg864[2:0]=3'd6 ant combination=reg864[2:0]+1 */
|
||||
ODM_SetBBReg(dm_odm, 0xc50, BIT(7), 1); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
/* Enter Training state */
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0x864, BIT(2) | BIT(1) | BIT(0), 1);
|
||||
rtl8188e_PHY_SetBBReg(adapter, 0xc50, BIT(7), 1); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
}
|
||||
|
||||
void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *dm_odm)
|
||||
@ -140,6 +108,7 @@ void ODM_AntennaDiversityInit_88E(struct odm_dm_struct *dm_odm)
|
||||
void ODM_UpdateRxIdleAnt_88E(struct odm_dm_struct *dm_odm, u8 Ant)
|
||||
{
|
||||
struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
|
||||
struct adapter *adapter = dm_odm->Adapter;
|
||||
u32 DefaultAnt, OptionalAnt;
|
||||
|
||||
if (dm_fat_tbl->RxIdleAnt != Ant) {
|
||||
@ -152,13 +121,13 @@ void ODM_UpdateRxIdleAnt_88E(struct odm_dm_struct *dm_odm, u8 Ant)
|
||||
}
|
||||
|
||||
if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV) {
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT(4) | BIT(3), DefaultAnt); /* Default RX */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(8) | BIT(7) | BIT(6), OptionalAnt); /* Optional RX */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_ANTSEL_CTRL_11N, BIT(14) | BIT(13) | BIT(12), DefaultAnt); /* Default TX */
|
||||
ODM_SetMACReg(dm_odm, ODM_REG_RESP_TX_11N, BIT(6) | BIT(7), DefaultAnt); /* Resp Tx */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT(4) | BIT(3), DefaultAnt); /* Default RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(8) | BIT(7) | BIT(6), OptionalAnt); /* Optional RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_ANTSEL_CTRL_11N, BIT(14) | BIT(13) | BIT(12), DefaultAnt); /* Default TX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RESP_TX_11N, BIT(6) | BIT(7), DefaultAnt); /* Resp Tx */
|
||||
} else if (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV) {
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT(4) | BIT(3), DefaultAnt); /* Default RX */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_RX_ANT_CTRL_11N, BIT(8) | BIT(7) | BIT(6), OptionalAnt); /* Optional RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(5) | BIT(4) | BIT(3), DefaultAnt); /* Default RX */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_RX_ANT_CTRL_11N, BIT(8) | BIT(7) | BIT(6), OptionalAnt); /* Optional RX */
|
||||
}
|
||||
}
|
||||
dm_fat_tbl->RxIdleAnt = Ant;
|
||||
@ -267,42 +236,29 @@ static void odm_HWAntDiv(struct odm_dm_struct *dm_odm)
|
||||
void ODM_AntennaDiversity_88E(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
struct fast_ant_train *dm_fat_tbl = &dm_odm->DM_FatTable;
|
||||
struct adapter *adapter = dm_odm->Adapter;
|
||||
|
||||
if (!(dm_odm->SupportAbility & ODM_BB_ANT_DIV))
|
||||
return;
|
||||
if (!dm_odm->bLinked) {
|
||||
if (dm_fat_tbl->bBecomeLinked) {
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_IGI_A_11N, BIT(7), 0); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT(15), 0); /* Enable CCK AntDiv */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_IGI_A_11N, BIT(7), 0); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT(15), 0); /* Enable CCK AntDiv */
|
||||
if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV)
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 0); /* Reg80c[21]=1'b0 from TX Reg */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 0); /* Reg80c[21]=1'b0 from TX Reg */
|
||||
dm_fat_tbl->bBecomeLinked = dm_odm->bLinked;
|
||||
}
|
||||
return;
|
||||
} else {
|
||||
if (!dm_fat_tbl->bBecomeLinked) {
|
||||
/* Because HW AntDiv is disabled before Link, we enable HW AntDiv after link */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_IGI_A_11N, BIT(7), 1); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT(15), 1); /* Enable CCK AntDiv */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_IGI_A_11N, BIT(7), 1); /* RegC50[7]=1'b1 enable HW AntDiv */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_CCK_ANTDIV_PARA1_11N, BIT(15), 1); /* Enable CCK AntDiv */
|
||||
if (dm_odm->AntDivType == CG_TRX_HW_ANTDIV)
|
||||
ODM_SetBBReg(dm_odm, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 1); /* Reg80c[21]=1'b1 from TX Info */
|
||||
rtl8188e_PHY_SetBBReg(adapter, ODM_REG_TX_ANT_CTRL_11N, BIT(21), 1); /* Reg80c[21]=1'b1 from TX Info */
|
||||
dm_fat_tbl->bBecomeLinked = dm_odm->bLinked;
|
||||
}
|
||||
}
|
||||
if ((dm_odm->AntDivType == CG_TRX_HW_ANTDIV) || (dm_odm->AntDivType == CGCS_RX_HW_ANTDIV))
|
||||
odm_HWAntDiv(dm_odm);
|
||||
}
|
||||
|
||||
/* 3============================================================ */
|
||||
/* 3 Dynamic Primary CCA */
|
||||
/* 3============================================================ */
|
||||
|
||||
void odm_PrimaryCCA_Init(struct odm_dm_struct *dm_odm)
|
||||
{
|
||||
struct dyn_primary_cca *PrimaryCCA = &dm_odm->DM_PriCCA;
|
||||
|
||||
PrimaryCCA->dup_rts_flag = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->monitor_flag = 0;
|
||||
PrimaryCCA->pri_cca_flag = 0;
|
||||
}
|
||||
|
@ -1,28 +1,28 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/drv_types.h"
|
||||
|
||||
void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Data, enum rf_radio_path RF_PATH,
|
||||
u32 RegAddr)
|
||||
static void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Data, enum rf_radio_path RF_PATH,
|
||||
u32 RegAddr)
|
||||
{
|
||||
if (Addr == 0xffe) {
|
||||
ODM_sleep_ms(50);
|
||||
if (Addr == 0xffe) {
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
ODM_delay_ms(5);
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
ODM_delay_ms(1);
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
ODM_delay_us(50);
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
ODM_delay_us(5);
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
} else {
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
rtl8188e_PHY_SetRFReg(pDM_Odm->Adapter, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,31 +36,31 @@ void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data
|
||||
|
||||
void odm_ConfigMAC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u8 Data)
|
||||
{
|
||||
ODM_Write1Byte(pDM_Odm, Addr, Data);
|
||||
rtw_write8(pDM_Odm->Adapter, Addr, Data);
|
||||
}
|
||||
|
||||
void odm_ConfigBB_AGC_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
}
|
||||
|
||||
void odm_ConfigBB_PHY_REG_PG_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
u32 Bitmask, u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
ODM_sleep_ms(50);
|
||||
msleep(50);
|
||||
else if (Addr == 0xfd)
|
||||
ODM_delay_ms(5);
|
||||
mdelay(5);
|
||||
else if (Addr == 0xfc)
|
||||
ODM_delay_ms(1);
|
||||
mdelay(1);
|
||||
else if (Addr == 0xfb)
|
||||
ODM_delay_us(50);
|
||||
udelay(50);
|
||||
else if (Addr == 0xfa)
|
||||
ODM_delay_us(5);
|
||||
udelay(5);
|
||||
else if (Addr == 0xf9)
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
else
|
||||
storePwrIndexDiffRateOffset(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
}
|
||||
@ -68,23 +68,23 @@ void odm_ConfigBB_PHY_REG_PG_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr,
|
||||
void odm_ConfigBB_PHY_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Bitmask, u32 Data)
|
||||
{
|
||||
if (Addr == 0xfe) {
|
||||
ODM_sleep_ms(50);
|
||||
msleep(50);
|
||||
} else if (Addr == 0xfd) {
|
||||
ODM_delay_ms(5);
|
||||
mdelay(5);
|
||||
} else if (Addr == 0xfc) {
|
||||
ODM_delay_ms(1);
|
||||
mdelay(1);
|
||||
} else if (Addr == 0xfb) {
|
||||
ODM_delay_us(50);
|
||||
udelay(50);
|
||||
} else if (Addr == 0xfa) {
|
||||
ODM_delay_us(5);
|
||||
udelay(5);
|
||||
} else if (Addr == 0xf9) {
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
} else {
|
||||
if (Addr == 0xa24)
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = Data;
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
rtl8188e_PHY_SetBBReg(pDM_Odm->Adapter, Addr, Bitmask, Data);
|
||||
|
||||
/* Add 1us delay between BB/RF register setting. */
|
||||
ODM_delay_us(1);
|
||||
udelay(1);
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
#include "../include/rtw_debug.h"
|
||||
|
||||
u32 GlobalDebugLevel;
|
||||
|
@ -1,93 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/odm_precomp.h"
|
||||
/* ODM IO Relative API. */
|
||||
|
||||
u8 ODM_Read1Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read8(Adapter, RegAddr);
|
||||
}
|
||||
|
||||
u32 ODM_Read4Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read32(Adapter, RegAddr);
|
||||
}
|
||||
|
||||
void ODM_Write1Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u8 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
rtw_write8(Adapter, RegAddr, Data);
|
||||
}
|
||||
|
||||
void ODM_Write2Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u16 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
rtw_write16(Adapter, RegAddr, Data);
|
||||
}
|
||||
|
||||
void ODM_Write4Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
rtw_write32(Adapter, RegAddr, Data);
|
||||
}
|
||||
|
||||
void ODM_SetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
}
|
||||
|
||||
u32 ODM_GetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
|
||||
}
|
||||
|
||||
void ODM_SetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
}
|
||||
|
||||
u32 ODM_GetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
|
||||
}
|
||||
|
||||
void ODM_SetRFReg(struct odm_dm_struct *pDM_Odm, enum rf_radio_path eRFPath, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetRFReg(Adapter, (enum rf_radio_path)eRFPath, RegAddr, BitMask, Data);
|
||||
}
|
||||
|
||||
u32 ODM_GetRFReg(struct odm_dm_struct *pDM_Odm, enum rf_radio_path eRFPath, u32 RegAddr, u32 BitMask)
|
||||
{
|
||||
struct adapter *Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryRFReg(Adapter, (enum rf_radio_path)eRFPath, RegAddr, BitMask);
|
||||
}
|
||||
|
||||
/* ODM Memory relative API. */
|
||||
s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2, u32 length)
|
||||
{
|
||||
return !memcmp(pBuf1, pBuf2, length);
|
||||
}
|
||||
|
||||
/* ODM Timer relative API. */
|
||||
void ODM_delay_ms(u32 ms)
|
||||
{
|
||||
mdelay(ms);
|
||||
}
|
||||
|
||||
void ODM_delay_us(u32 us)
|
||||
{
|
||||
udelay(us);
|
||||
}
|
||||
|
||||
void ODM_sleep_ms(u32 ms)
|
||||
{
|
||||
msleep(ms);
|
||||
}
|
@ -49,7 +49,7 @@ static s32 FillH2CCmd_88E(struct adapter *adapt, u8 ElementID, u32 CmdLen, u8 *p
|
||||
u8 h2c_box_num;
|
||||
u32 msgbox_addr;
|
||||
u32 msgbox_ex_addr;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
u8 cmd_idx, ext_cmd_len;
|
||||
u32 h2c_cmd = 0;
|
||||
u32 h2c_cmd_ex = 0;
|
||||
@ -104,7 +104,7 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)
|
||||
{
|
||||
u8 buf[3];
|
||||
u8 res = _SUCCESS;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
|
||||
if (haldata->fw_ractrl) {
|
||||
__le32 lmask;
|
||||
@ -128,7 +128,7 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)
|
||||
/* arg[5] = Short GI */
|
||||
void rtl8188e_Add_RateATid(struct adapter *pAdapter, u32 bitmap, u8 arg, u8 rssi_level)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(pAdapter);
|
||||
struct hal_data_8188e *haldata = &pAdapter->haldata;
|
||||
|
||||
u8 macid, raid, short_gi_rate = false;
|
||||
|
||||
@ -440,7 +440,6 @@ void CheckFwRsvdPageContent(struct adapter *Adapter)
|
||||
/* 2009.10.15 by tynli. */
|
||||
static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
{
|
||||
struct hal_data_8188e *haldata;
|
||||
struct xmit_frame *pmgntframe;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_priv *pxmitpriv;
|
||||
@ -461,7 +460,6 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
return;
|
||||
}
|
||||
|
||||
haldata = GET_HAL_DATA(adapt);
|
||||
pxmitpriv = &adapt->xmitpriv;
|
||||
pmlmeext = &adapt->mlmeextpriv;
|
||||
pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
@ -480,7 +478,6 @@ static void SetFwRsvdPagePkt(struct adapter *adapt, bool bDLFinished)
|
||||
if (PageNeed == 1)
|
||||
PageNeed += 1;
|
||||
PageNum += PageNeed;
|
||||
haldata->FwRsvdPageStartOffset = PageNum;
|
||||
|
||||
BufIndex += PageNeed * 128;
|
||||
|
||||
@ -547,7 +544,7 @@ exit:
|
||||
|
||||
void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
bool bSendBeacon = false;
|
||||
@ -642,7 +639,7 @@ void rtl8188e_set_FwJoinBssReport_cmd(struct adapter *adapt, u8 mstatus)
|
||||
|
||||
void rtl8188e_set_p2p_ps_offload_cmd(struct adapter *adapt, u8 p2p_ps_state)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct wifidirect_info *pwdinfo = &adapt->wdinfo;
|
||||
struct P2P_PS_Offload_t *p2p_ps_offload = &haldata->p2p_ps_offload;
|
||||
u8 i;
|
||||
|
@ -24,7 +24,7 @@ static void dm_InitGPIOSetting(struct adapter *Adapter)
|
||||
/* */
|
||||
static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct dm_priv *pdmpriv = &hal_data->dmpriv;
|
||||
struct odm_dm_struct *dm_odm = &hal_data->odmpriv;
|
||||
|
||||
@ -48,18 +48,14 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct odm_dm_struct *dm_odm = &hal_data->odmpriv;
|
||||
struct dm_priv *pdmpriv = &hal_data->dmpriv;
|
||||
int i;
|
||||
|
||||
pdmpriv->InitODMFlag = ODM_BB_DIG |
|
||||
ODM_BB_RA_MASK |
|
||||
ODM_BB_DYNAMIC_TXPWR |
|
||||
ODM_BB_FA_CNT |
|
||||
pdmpriv->InitODMFlag = ODM_BB_FA_CNT |
|
||||
ODM_BB_RSSI_MONITOR |
|
||||
ODM_BB_CCK_PD |
|
||||
ODM_BB_PWR_SAVE |
|
||||
ODM_MAC_EDCA_TURBO |
|
||||
ODM_RF_CALIBRATION |
|
||||
ODM_RF_TX_PWR_TRACK;
|
||||
@ -68,14 +64,10 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
|
||||
|
||||
ODM_CmnInfoUpdate(dm_odm, ODM_CMNINFO_ABILITY, pdmpriv->InitODMFlag);
|
||||
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_TX_UNI, &Adapter->xmitpriv.tx_bytes);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_RX_UNI, &Adapter->recvpriv.rx_bytes);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_WM_MODE, &pmlmeext->cur_wireless_mode);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SEC_CHNL_OFFSET, &hal_data->nCur40MhzPrimeSC);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SEC_MODE, &Adapter->securitypriv.dot11PrivacyAlgrthm);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_BW, &hal_data->CurrentChannelBW);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_CHNL, &hal_data->CurrentChannel);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_NET_CLOSED, &Adapter->net_closed);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_SCAN, &pmlmepriv->bScanInProcess);
|
||||
ODM_CmnInfoHook(dm_odm, ODM_CMNINFO_POWER_SAVING, &pwrctrlpriv->bpower_saving);
|
||||
ODM_CmnInfoInit(dm_odm, ODM_CMNINFO_RF_ANTENNA_TYPE, hal_data->TRxAntDivType);
|
||||
@ -86,19 +78,18 @@ static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
|
||||
|
||||
void rtl8188e_InitHalDm(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct odm_dm_struct *dm_odm = &hal_data->odmpriv;
|
||||
|
||||
dm_InitGPIOSetting(Adapter);
|
||||
Update_ODM_ComInfo_88E(Adapter);
|
||||
ODM_DMInit(dm_odm);
|
||||
Adapter->fix_rate = 0xFF;
|
||||
}
|
||||
|
||||
void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
|
||||
{
|
||||
u8 hw_init_completed = Adapter->hw_init_completed;
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
u8 bLinked = false;
|
||||
|
||||
@ -120,7 +111,7 @@ void rtl8188e_HalDmWatchDog(struct adapter *Adapter)
|
||||
|
||||
void rtl8188e_init_dm_priv(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct dm_priv *pdmpriv = &hal_data->dmpriv;
|
||||
|
||||
memset(pdmpriv, 0, sizeof(struct dm_priv));
|
||||
@ -131,7 +122,7 @@ void rtl8188e_init_dm_priv(struct adapter *Adapter)
|
||||
/* Compare RSSI for deciding antenna */
|
||||
void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
|
||||
{
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
|
||||
if (0 != hal_data->AntDivCfg) {
|
||||
/* select optimum_antenna for before linked =>For antenna diversity */
|
||||
@ -145,7 +136,7 @@ void AntDivCompare8188E(struct adapter *Adapter, struct wlan_bssid_ex *dst, stru
|
||||
/* Add new function to reset the state of antenna diversity before link. */
|
||||
u8 AntDivBeforeLink8188E(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *hal_data = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *hal_data = &Adapter->haldata;
|
||||
struct odm_dm_struct *dm_odm = &hal_data->odmpriv;
|
||||
struct sw_ant_switch *dm_swat_tbl = &dm_odm->DM_SWAT_Table;
|
||||
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -143,7 +143,7 @@ phy_RFSerialRead(
|
||||
)
|
||||
{
|
||||
u32 retValue = 0;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
u32 tmplong, tmplong2;
|
||||
@ -161,31 +161,31 @@ phy_RFSerialRead(
|
||||
/* For 92S LSSI Read RFLSSIRead */
|
||||
/* For RF A/B write 0x824/82c(does not work in the future) */
|
||||
/* We must use 0x824 for RF A and B to execute read trigger */
|
||||
tmplong = PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord);
|
||||
tmplong = rtl8188e_PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord);
|
||||
if (eRFPath == RF_PATH_A)
|
||||
tmplong2 = tmplong;
|
||||
else
|
||||
tmplong2 = PHY_QueryBBReg(Adapter, pPhyReg->rfHSSIPara2, bMaskDWord);
|
||||
tmplong2 = rtl8188e_PHY_QueryBBReg(Adapter, pPhyReg->rfHSSIPara2, bMaskDWord);
|
||||
|
||||
tmplong2 = (tmplong2 & (~bLSSIReadAddress)) | (NewOffset << 23) | bLSSIReadEdge; /* T65 RF */
|
||||
|
||||
PHY_SetBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong & (~bLSSIReadEdge));
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_XA_HSSIParameter2, bMaskDWord, tmplong & (~bLSSIReadEdge));
|
||||
udelay(10);/* PlatformStallExecution(10); */
|
||||
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, bMaskDWord, tmplong2);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, bMaskDWord, tmplong2);
|
||||
udelay(100);/* PlatformStallExecution(100); */
|
||||
|
||||
udelay(10);/* PlatformStallExecution(10); */
|
||||
|
||||
if (eRFPath == RF_PATH_A)
|
||||
RfPiEnable = (u8)PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter1, BIT(8));
|
||||
RfPiEnable = (u8)rtl8188e_PHY_QueryBBReg(Adapter, rFPGA0_XA_HSSIParameter1, BIT(8));
|
||||
else if (eRFPath == RF_PATH_B)
|
||||
RfPiEnable = (u8)PHY_QueryBBReg(Adapter, rFPGA0_XB_HSSIParameter1, BIT(8));
|
||||
RfPiEnable = (u8)rtl8188e_PHY_QueryBBReg(Adapter, rFPGA0_XB_HSSIParameter1, BIT(8));
|
||||
|
||||
if (RfPiEnable) { /* Read from BBreg8b8, 12 bits for 8190, 20bits for T65 RF */
|
||||
retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData);
|
||||
retValue = rtl8188e_PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBackPi, bLSSIReadBackData);
|
||||
} else { /* Read from BBreg8a0, 12 bits for 8190, 20 bits for T65 RF */
|
||||
retValue = PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBack, bLSSIReadBackData);
|
||||
retValue = rtl8188e_PHY_QueryBBReg(Adapter, pPhyReg->rfLSSIReadBack, bLSSIReadBackData);
|
||||
}
|
||||
return retValue;
|
||||
}
|
||||
@ -242,7 +242,7 @@ phy_RFSerialWrite(
|
||||
)
|
||||
{
|
||||
u32 DataAndAddr = 0;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
struct bb_reg_def *pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
u32 NewOffset;
|
||||
|
||||
@ -263,7 +263,7 @@ phy_RFSerialWrite(
|
||||
/* */
|
||||
/* Write Operation */
|
||||
/* */
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, pPhyReg->rf3wireOffset, bMaskDWord, DataAndAddr);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -355,7 +355,7 @@ rtl8188e_PHY_SetRFReg(
|
||||
*---------------------------------------------------------------------------*/
|
||||
s32 PHY_MACConfig8188E(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
int rtStatus = _SUCCESS;
|
||||
|
||||
/* */
|
||||
@ -387,19 +387,15 @@ phy_InitBBRFRegisterDefinition(
|
||||
struct adapter *Adapter
|
||||
)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
/* RF Interface Sowrtware Control */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfintfs = rFPGA0_XAB_RFInterfaceSW; /* 16 LSBs if read 32-bit from 0x870 */
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfintfs = rFPGA0_XAB_RFInterfaceSW; /* 16 MSBs if read 32-bit from 0x870 (16-bit for 0x872) */
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfintfs = rFPGA0_XCD_RFInterfaceSW;/* 16 LSBs if read 32-bit from 0x874 */
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfintfs = rFPGA0_XCD_RFInterfaceSW;/* 16 MSBs if read 32-bit from 0x874 (16-bit for 0x876) */
|
||||
|
||||
/* RF Interface Readback Value */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfintfi = rFPGA0_XAB_RFInterfaceRB; /* 16 LSBs if read 32-bit from 0x8E0 */
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfintfi = rFPGA0_XAB_RFInterfaceRB;/* 16 MSBs if read 32-bit from 0x8E0 (16-bit for 0x8E2) */
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfintfi = rFPGA0_XCD_RFInterfaceRB;/* 16 LSBs if read 32-bit from 0x8E4 */
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfintfi = rFPGA0_XCD_RFInterfaceRB;/* 16 MSBs if read 32-bit from 0x8E4 (16-bit for 0x8E6) */
|
||||
|
||||
/* RF Interface Output (and Enable) */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfintfo = rFPGA0_XA_RFInterfaceOE; /* 16 LSBs if read 32-bit from 0x860 */
|
||||
@ -416,14 +412,10 @@ phy_InitBBRFRegisterDefinition(
|
||||
/* RF parameter */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfLSSI_Select = rFPGA0_XAB_RFParameter; /* BB Band Select */
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfLSSI_Select = rFPGA0_XAB_RFParameter;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfLSSI_Select = rFPGA0_XCD_RFParameter;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfLSSI_Select = rFPGA0_XCD_RFParameter;
|
||||
|
||||
/* Tx AGC Gain Stage (same for all path. Should we remove this?) */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfTxGainStage = rFPGA0_TxGainStage; /* Tx gain stage */
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfTxGainStage = rFPGA0_TxGainStage; /* Tx gain stage */
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfTxGainStage = rFPGA0_TxGainStage; /* Tx gain stage */
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfTxGainStage = rFPGA0_TxGainStage; /* Tx gain stage */
|
||||
|
||||
/* Tranceiver A~D HSSI Parameter-1 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfHSSIPara1 = rFPGA0_XA_HSSIParameter1; /* wire control parameter1 */
|
||||
@ -436,50 +428,34 @@ phy_InitBBRFRegisterDefinition(
|
||||
/* RF switch Control */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfSwitchControl = rFPGA0_XAB_SwitchControl; /* TR/Ant switch control */
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfSwitchControl = rFPGA0_XAB_SwitchControl;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfSwitchControl = rFPGA0_XCD_SwitchControl;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfSwitchControl = rFPGA0_XCD_SwitchControl;
|
||||
|
||||
/* AGC control 1 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfAGCControl1 = rOFDM0_XAAGCCore1;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfAGCControl1 = rOFDM0_XBAGCCore1;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfAGCControl1 = rOFDM0_XCAGCCore1;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfAGCControl1 = rOFDM0_XDAGCCore1;
|
||||
|
||||
/* AGC control 2 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfAGCControl2 = rOFDM0_XAAGCCore2;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfAGCControl2 = rOFDM0_XBAGCCore2;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfAGCControl2 = rOFDM0_XCAGCCore2;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfAGCControl2 = rOFDM0_XDAGCCore2;
|
||||
|
||||
/* RX AFE control 1 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfRxIQImbalance = rOFDM0_XARxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfRxIQImbalance = rOFDM0_XBRxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfRxIQImbalance = rOFDM0_XCRxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfRxIQImbalance = rOFDM0_XDRxIQImbalance;
|
||||
|
||||
/* RX AFE control 1 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfRxAFE = rOFDM0_XARxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfRxAFE = rOFDM0_XBRxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfRxAFE = rOFDM0_XCRxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfRxAFE = rOFDM0_XDRxAFE;
|
||||
|
||||
/* Tx AFE control 1 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfTxIQImbalance = rOFDM0_XATxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfTxIQImbalance = rOFDM0_XBTxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfTxIQImbalance = rOFDM0_XCTxIQImbalance;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfTxIQImbalance = rOFDM0_XDTxIQImbalance;
|
||||
|
||||
/* Tx AFE control 2 */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfTxAFE = rOFDM0_XATxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfTxAFE = rOFDM0_XBTxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfTxAFE = rOFDM0_XCTxAFE;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfTxAFE = rOFDM0_XDTxAFE;
|
||||
|
||||
/* Tranceiver LSSI Readback SI mode */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfLSSIReadBack = rFPGA0_XA_LSSIReadBack;
|
||||
pHalData->PHYRegDef[RF_PATH_B].rfLSSIReadBack = rFPGA0_XB_LSSIReadBack;
|
||||
pHalData->PHYRegDef[RF_PATH_C].rfLSSIReadBack = rFPGA0_XC_LSSIReadBack;
|
||||
pHalData->PHYRegDef[RF_PATH_D].rfLSSIReadBack = rFPGA0_XD_LSSIReadBack;
|
||||
|
||||
/* Tranceiver LSSI Readback PI mode */
|
||||
pHalData->PHYRegDef[RF_PATH_A].rfLSSIReadBackPi = TransceiverA_HSPI_Readback;
|
||||
@ -488,7 +464,7 @@ phy_InitBBRFRegisterDefinition(
|
||||
|
||||
void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMask, u32 Data)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
if (RegAddr == rTxAGC_A_Rate18_06)
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][0] = Data;
|
||||
@ -506,8 +482,7 @@ void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMa
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][4] = Data;
|
||||
if (RegAddr == rTxAGC_A_Mcs15_Mcs12) {
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][5] = Data;
|
||||
if (pHalData->rf_type == RF_1T1R)
|
||||
pHalData->pwrGroupCnt++;
|
||||
pHalData->pwrGroupCnt++;
|
||||
}
|
||||
if (RegAddr == rTxAGC_B_Rate18_06)
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][8] = Data;
|
||||
@ -523,17 +498,14 @@ void storePwrIndexDiffRateOffset(struct adapter *Adapter, u32 RegAddr, u32 BitMa
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][11] = Data;
|
||||
if (RegAddr == rTxAGC_B_Mcs11_Mcs08)
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][12] = Data;
|
||||
if (RegAddr == rTxAGC_B_Mcs15_Mcs12) {
|
||||
if (RegAddr == rTxAGC_B_Mcs15_Mcs12)
|
||||
pHalData->MCSTxPowerLevelOriginalOffset[pHalData->pwrGroupCnt][13] = Data;
|
||||
if (pHalData->rf_type != RF_1T1R)
|
||||
pHalData->pwrGroupCnt++;
|
||||
}
|
||||
}
|
||||
|
||||
static int phy_BB8188E_Config_ParaFile(struct adapter *Adapter)
|
||||
{
|
||||
struct eeprom_priv *pEEPROM = &Adapter->eeprompriv;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
int rtStatus = _SUCCESS;
|
||||
|
||||
/* */
|
||||
@ -574,7 +546,7 @@ PHY_BBConfig8188E(
|
||||
)
|
||||
{
|
||||
int rtStatus = _SUCCESS;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u32 RegVal;
|
||||
u8 CrystalCap;
|
||||
|
||||
@ -595,7 +567,7 @@ PHY_BBConfig8188E(
|
||||
|
||||
/* write 0x24[16:11] = 0x24[22:17] = CrystalCap */
|
||||
CrystalCap = pHalData->CrystalCap & 0x3F;
|
||||
PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6)));
|
||||
rtl8188e_PHY_SetBBReg(Adapter, REG_AFE_XTAL_CTRL, 0x7ff800, (CrystalCap | (CrystalCap << 6)));
|
||||
|
||||
return rtStatus;
|
||||
}
|
||||
@ -613,82 +585,25 @@ static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPower
|
||||
u8 *ofdmPowerLevel, u8 *BW20PowerLevel,
|
||||
u8 *BW40PowerLevel)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u8 index = (channel - 1);
|
||||
u8 TxCount = 0, path_nums;
|
||||
|
||||
if ((RF_1T2R == pHalData->rf_type) || (RF_1T1R == pHalData->rf_type))
|
||||
path_nums = 1;
|
||||
else
|
||||
path_nums = 2;
|
||||
|
||||
for (TxCount = 0; TxCount < path_nums; TxCount++) {
|
||||
if (TxCount == RF_PATH_A) {
|
||||
/* 1. CCK */
|
||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
||||
/* 2. OFDM */
|
||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->OFDM_24G_Diff[TxCount][RF_PATH_A];
|
||||
/* 1. BW20 */
|
||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][RF_PATH_A];
|
||||
/* 2. BW40 */
|
||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
||||
} else if (TxCount == RF_PATH_B) {
|
||||
/* 1. CCK */
|
||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
||||
/* 2. OFDM */
|
||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
/* 1. BW20 */
|
||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][RF_PATH_A] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
/* 2. BW40 */
|
||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
||||
} else if (TxCount == RF_PATH_C) {
|
||||
/* 1. CCK */
|
||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
||||
/* 2. OFDM */
|
||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_B][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
/* 1. BW20 */
|
||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_B][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
/* 2. BW40 */
|
||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
||||
} else if (TxCount == RF_PATH_D) {
|
||||
/* 1. CCK */
|
||||
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index];
|
||||
/* 2. OFDM */
|
||||
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_B][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_C][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
|
||||
/* 1. BW20 */
|
||||
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_B][index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_C][index] +
|
||||
pHalData->BW20_24G_Diff[TxCount][index];
|
||||
|
||||
/* 2. BW40 */
|
||||
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
|
||||
}
|
||||
}
|
||||
/* 1. CCK */
|
||||
cckPowerLevel[RF_PATH_A] = pHalData->Index24G_CCK_Base[index];
|
||||
/* 2. OFDM */
|
||||
ofdmPowerLevel[RF_PATH_A] = pHalData->Index24G_BW40_Base[index] +
|
||||
pHalData->OFDM_24G_Diff[RF_PATH_A];
|
||||
/* 1. BW20 */
|
||||
BW20PowerLevel[RF_PATH_A] = pHalData->Index24G_BW40_Base[index] +
|
||||
pHalData->BW20_24G_Diff[RF_PATH_A];
|
||||
/* 2. BW40 */
|
||||
BW40PowerLevel[RF_PATH_A] = pHalData->Index24G_BW40_Base[index];
|
||||
}
|
||||
|
||||
static void phy_PowerIndexCheck88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel,
|
||||
u8 *ofdmPowerLevel, u8 *BW20PowerLevel, u8 *BW40PowerLevel)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
pHalData->CurrentCckTxPwrIdx = cckPowerLevel[0];
|
||||
pHalData->CurrentOfdm24GTxPwrIdx = ofdmPowerLevel[0];
|
||||
@ -752,17 +667,10 @@ _PHY_SetBWMode92C(
|
||||
struct adapter *Adapter
|
||||
)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u8 regBwOpMode;
|
||||
u8 regRRSR_RSC;
|
||||
|
||||
if (pHalData->rf_chip == RF_PSEUDO_11N)
|
||||
return;
|
||||
|
||||
/* There is no 40MHz mode in RF_8225. */
|
||||
if (pHalData->rf_chip == RF_8225)
|
||||
return;
|
||||
|
||||
if (Adapter->bDriverStopped)
|
||||
return;
|
||||
|
||||
@ -796,17 +704,17 @@ _PHY_SetBWMode92C(
|
||||
switch (pHalData->CurrentChannelBW) {
|
||||
/* 20 MHz channel*/
|
||||
case HT_CHANNEL_WIDTH_20:
|
||||
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bRFMOD, 0x0);
|
||||
PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x0);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bRFMOD, 0x0);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x0);
|
||||
break;
|
||||
/* 40 MHz channel*/
|
||||
case HT_CHANNEL_WIDTH_40:
|
||||
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bRFMOD, 0x1);
|
||||
PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x1);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bRFMOD, 0x1);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA1_RFMOD, bRFMOD, 0x1);
|
||||
/* Set Control channel to upper or lower. These settings are required only for 40MHz */
|
||||
PHY_SetBBReg(Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC >> 1));
|
||||
PHY_SetBBReg(Adapter, rOFDM1_LSTF, 0xC00, pHalData->nCur40MhzPrimeSC);
|
||||
PHY_SetBBReg(Adapter, 0x818, (BIT(26) | BIT(27)),
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rCCK0_System, bCCKSideBand, (pHalData->nCur40MhzPrimeSC >> 1));
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rOFDM1_LSTF, 0xC00, pHalData->nCur40MhzPrimeSC);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, 0x818, (BIT(26) | BIT(27)),
|
||||
(pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) ? 2 : 1);
|
||||
break;
|
||||
default:
|
||||
@ -814,21 +722,7 @@ _PHY_SetBWMode92C(
|
||||
}
|
||||
/* Skip over setting of J-mode in BB register here. Default value is "None J mode". Emily 20070315 */
|
||||
|
||||
/* 3<3>Set RF related register */
|
||||
switch (pHalData->rf_chip) {
|
||||
case RF_8225:
|
||||
break;
|
||||
case RF_8256:
|
||||
/* Please implement this function in Hal8190PciPhy8256.c */
|
||||
break;
|
||||
case RF_PSEUDO_11N:
|
||||
break;
|
||||
case RF_6052:
|
||||
rtl8188e_PHY_RF6052SetBandwidth(Adapter, pHalData->CurrentChannelBW);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
rtl8188e_PHY_RF6052SetBandwidth(Adapter, pHalData->CurrentChannelBW);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
@ -848,7 +742,7 @@ _PHY_SetBWMode92C(
|
||||
void PHY_SetBWMode8188E(struct adapter *Adapter, enum ht_channel_width Bandwidth, /* 20M or 40M */
|
||||
unsigned char Offset) /* Upper, Lower, or Don't care */
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
enum ht_channel_width tmpBW = pHalData->CurrentChannelBW;
|
||||
|
||||
pHalData->CurrentChannelBW = Bandwidth;
|
||||
@ -865,7 +759,7 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel)
|
||||
{
|
||||
u8 eRFPath = 0;
|
||||
u32 param1, param2;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
if (Adapter->bNotifyChannelChange)
|
||||
DBG_88E("[%s] ch = %d\n", __func__, channel);
|
||||
@ -877,16 +771,13 @@ static void _PHY_SwChnl8192C(struct adapter *Adapter, u8 channel)
|
||||
param1 = RF_CHNLBW;
|
||||
param2 = channel;
|
||||
pHalData->RfRegChnlVal[eRFPath] = ((pHalData->RfRegChnlVal[eRFPath] & 0xfffffc00) | param2);
|
||||
PHY_SetRFReg(Adapter, (enum rf_radio_path)eRFPath, param1, bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]);
|
||||
rtl8188e_PHY_SetRFReg(Adapter, (enum rf_radio_path)eRFPath, param1, bRFRegOffsetMask, pHalData->RfRegChnlVal[eRFPath]);
|
||||
}
|
||||
|
||||
void PHY_SwChnl8188E(struct adapter *Adapter, u8 channel)
|
||||
{
|
||||
/* Call after initialization */
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
|
||||
if (pHalData->rf_chip == RF_PSEUDO_11N)
|
||||
return; /* return immediately if it is peudo-phy */
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
if (channel == 0)
|
||||
channel = 1;
|
||||
|
@ -46,16 +46,16 @@
|
||||
void rtl8188e_PHY_RF6052SetBandwidth(struct adapter *Adapter,
|
||||
enum ht_channel_width Bandwidth)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
|
||||
switch (Bandwidth) {
|
||||
case HT_CHANNEL_WIDTH_20:
|
||||
pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff3ff) | BIT(10) | BIT(11));
|
||||
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
|
||||
rtl8188e_PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
|
||||
break;
|
||||
case HT_CHANNEL_WIDTH_40:
|
||||
pHalData->RfRegChnlVal[0] = ((pHalData->RfRegChnlVal[0] & 0xfffff3ff) | BIT(10));
|
||||
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
|
||||
rtl8188e_PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW, bRFRegOffsetMask, pHalData->RfRegChnlVal[0]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -84,31 +84,24 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
||||
struct adapter *Adapter,
|
||||
u8 *pPowerlevel)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
|
||||
u32 TxAGC[2] = {0, 0}, tmpval = 0, pwrtrac_value;
|
||||
bool TurboScanOff = false;
|
||||
u8 idx1, idx2;
|
||||
u8 *ptr;
|
||||
u8 direction;
|
||||
/* FOR CE ,must disable turbo scan */
|
||||
TurboScanOff = true;
|
||||
|
||||
if (pmlmeext->sitesurvey_res.state == SCAN_PROCESS) {
|
||||
TxAGC[RF_PATH_A] = 0x3f3f3f3f;
|
||||
TxAGC[RF_PATH_B] = 0x3f3f3f3f;
|
||||
|
||||
TurboScanOff = true;/* disable turbo scan */
|
||||
|
||||
if (TurboScanOff) {
|
||||
for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
|
||||
TxAGC[idx1] =
|
||||
pPowerlevel[idx1] | (pPowerlevel[idx1] << 8) |
|
||||
(pPowerlevel[idx1] << 16) | (pPowerlevel[idx1] << 24);
|
||||
/* 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20. */
|
||||
if (TxAGC[idx1] > 0x20 && pHalData->ExternalPA)
|
||||
TxAGC[idx1] = 0x20;
|
||||
}
|
||||
for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
|
||||
TxAGC[idx1] =
|
||||
pPowerlevel[idx1] | (pPowerlevel[idx1] << 8) |
|
||||
(pPowerlevel[idx1] << 16) | (pPowerlevel[idx1] << 24);
|
||||
/* 2010/10/18 MH For external PA module. We need to limit power index to be less than 0x20. */
|
||||
if (TxAGC[idx1] > 0x20 && pHalData->ExternalPA)
|
||||
TxAGC[idx1] = 0x20;
|
||||
}
|
||||
} else {
|
||||
for (idx1 = RF_PATH_A; idx1 <= RF_PATH_B; idx1++) {
|
||||
@ -148,15 +141,15 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
||||
|
||||
/* rf-A cck tx power */
|
||||
tmpval = TxAGC[RF_PATH_A] & 0xff;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rTxAGC_A_CCK1_Mcs32, bMaskByte1, tmpval);
|
||||
tmpval = TxAGC[RF_PATH_A] >> 8;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, 0xffffff00, tmpval);
|
||||
|
||||
/* rf-B cck tx power */
|
||||
tmpval = TxAGC[RF_PATH_B] >> 24;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rTxAGC_B_CCK11_A_CCK2_11, bMaskByte0, tmpval);
|
||||
tmpval = TxAGC[RF_PATH_B] & 0x00ffffff;
|
||||
PHY_SetBBReg(Adapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rTxAGC_B_CCK1_55_Mcs32, 0xffffff00, tmpval);
|
||||
} /* PHY_RF6052SetCckTxPower */
|
||||
|
||||
/* */
|
||||
@ -166,7 +159,7 @@ rtl8188e_PHY_RF6052SetCckTxPower(
|
||||
static void getpowerbase88e(struct adapter *Adapter, u8 *pPowerLevelOFDM,
|
||||
u8 *pPowerLevelBW20, u8 *pPowerLevelBW40, u8 Channel, u32 *OfdmBase, u32 *MCSBase)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u32 powerBase0, powerBase1;
|
||||
u8 i;
|
||||
|
||||
@ -190,7 +183,7 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel,
|
||||
u8 index, u32 *powerBase0, u32 *powerBase1,
|
||||
u32 *pOutWriteVal)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u8 i, chnlGroup = 0, pwr_diff_limit[4], customer_pwr_limit;
|
||||
s8 pwr_diff = 0;
|
||||
u32 writeVal, customer_limit, rf;
|
||||
@ -272,7 +265,6 @@ static void get_rx_power_val_by_reg(struct adapter *Adapter, u8 Channel,
|
||||
}
|
||||
static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
u16 regoffset_a[6] = {
|
||||
rTxAGC_A_Rate18_06, rTxAGC_A_Rate54_24,
|
||||
rTxAGC_A_Mcs03_Mcs00, rTxAGC_A_Mcs07_Mcs04,
|
||||
@ -299,13 +291,10 @@ static void writeOFDMPowerReg88E(struct adapter *Adapter, u8 index, u32 *pValue)
|
||||
else
|
||||
regoffset = regoffset_b[index];
|
||||
|
||||
PHY_SetBBReg(Adapter, regoffset, bMaskDWord, writeVal);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, regoffset, bMaskDWord, writeVal);
|
||||
|
||||
/* 201005115 Joseph: Set Tx Power diff for Tx power training mechanism. */
|
||||
if (((pHalData->rf_type == RF_2T2R) &&
|
||||
(regoffset == rTxAGC_A_Mcs15_Mcs12 || regoffset == rTxAGC_B_Mcs15_Mcs12)) ||
|
||||
((pHalData->rf_type != RF_2T2R) &&
|
||||
(regoffset == rTxAGC_A_Mcs07_Mcs04 || regoffset == rTxAGC_B_Mcs07_Mcs04))) {
|
||||
if (regoffset == rTxAGC_A_Mcs07_Mcs04 || regoffset == rTxAGC_B_Mcs07_Mcs04) {
|
||||
writeVal = pwr_val[3];
|
||||
if (regoffset == rTxAGC_A_Mcs15_Mcs12 || regoffset == rTxAGC_A_Mcs07_Mcs04)
|
||||
regoffset = 0xc90;
|
||||
@ -353,7 +342,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
||||
u8 *pPowerLevelBW40,
|
||||
u8 Channel)
|
||||
{
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u32 writeVal[2], powerBase0[2], powerBase1[2], pwrtrac_value;
|
||||
u8 direction;
|
||||
u8 index = 0;
|
||||
@ -383,7 +372,7 @@ rtl8188e_PHY_RF6052SetOFDMTxPower(
|
||||
static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
{
|
||||
struct bb_reg_def *pPhyReg;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *pHalData = &Adapter->haldata;
|
||||
u32 u4RegValue = 0;
|
||||
u8 eRFPath = 0;
|
||||
int rtStatus = _SUCCESS;
|
||||
@ -393,21 +382,21 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
pPhyReg = &pHalData->PHYRegDef[eRFPath];
|
||||
|
||||
/*----Store original RFENV control type----*/
|
||||
u4RegValue = PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
|
||||
u4RegValue = rtl8188e_PHY_QueryBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV);
|
||||
|
||||
/*----Set RF_ENV enable----*/
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfe, bRFSI_RFENV << 16, 0x1);
|
||||
rtl8188e_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);
|
||||
rtl8188e_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 */
|
||||
rtl8188e_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 */
|
||||
rtl8188e_PHY_SetBBReg(Adapter, pPhyReg->rfHSSIPara2, b3WireDataLength, 0x0); /* Set 0 to 12 bits for 8255 */
|
||||
udelay(1);/* PlatformStallExecution(1); */
|
||||
|
||||
/*----Initialize RF fom connfiguration file----*/
|
||||
@ -415,7 +404,7 @@ static int phy_RF6052_Config_ParaFile(struct adapter *Adapter)
|
||||
rtStatus = _FAIL;
|
||||
|
||||
/*----Restore RFENV control type----*/;
|
||||
PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, pPhyReg->rfintfs, bRFSI_RFENV, u4RegValue);
|
||||
|
||||
if (rtStatus != _SUCCESS)
|
||||
goto phy_RF6052_Config_ParaFile_Fail;
|
||||
|
@ -126,7 +126,7 @@ void update_recvframe_phyinfo_88e(struct recv_frame *precvframe, struct phy_stat
|
||||
{
|
||||
struct adapter *padapter = precvframe->adapter;
|
||||
struct rx_pkt_attrib *pattrib = &precvframe->attrib;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
struct hal_data_8188e *pHalData = &padapter->haldata;
|
||||
struct phy_info *pPHYInfo = &pattrib->phy_info;
|
||||
u8 *wlanhdr;
|
||||
struct odm_per_pkt_info pkt_info;
|
||||
|
@ -1,37 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#define _RTL8188E_SRESET_C_
|
||||
|
||||
#include "../include/rtl8188e_sreset.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
|
||||
void rtl8188e_sreset_xmit_status_check(struct adapter *padapter)
|
||||
{
|
||||
u32 txdma_status;
|
||||
|
||||
txdma_status = rtw_read32(padapter, REG_TXDMA_STATUS);
|
||||
if (txdma_status != 0x00) {
|
||||
DBG_88E("%s REG_TXDMA_STATUS:0x%08x\n", __func__, txdma_status);
|
||||
rtw_write32(padapter, REG_TXDMA_STATUS, txdma_status);
|
||||
}
|
||||
/* total xmit irp = 4 */
|
||||
}
|
||||
|
||||
void rtl8188e_sreset_linked_status_check(struct adapter *padapter)
|
||||
{
|
||||
u32 rx_dma_status = 0;
|
||||
u8 fw_status = 0;
|
||||
rx_dma_status = rtw_read32(padapter, REG_RXDMA_STATUS);
|
||||
if (rx_dma_status != 0x00) {
|
||||
DBG_88E("%s REG_RXDMA_STATUS:0x%08x\n", __func__, rx_dma_status);
|
||||
rtw_write32(padapter, REG_RXDMA_STATUS, rx_dma_status);
|
||||
}
|
||||
fw_status = rtw_read8(padapter, REG_FMETHR);
|
||||
if (fw_status != 0x00) {
|
||||
if (fw_status == 1)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Read_Efuse_Fail !!\n", __func__, fw_status);
|
||||
else if (fw_status == 2)
|
||||
DBG_88E("%s REG_FW_STATUS (0x%02x), Condition_No_Match !!\n", __func__, fw_status);
|
||||
}
|
||||
}
|
@ -1,94 +0,0 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
#include "../include/rtl8188e_led.h"
|
||||
|
||||
/* LED object. */
|
||||
|
||||
/* LED_819xUsb routines. */
|
||||
/* Description: */
|
||||
/* Turn on LED according to LedPin specified. */
|
||||
void SwLedOn(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
u8 LedCfg;
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
return;
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_LED0:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0xf0) | BIT(5) | BIT(6)); /* SW control led0 on. */
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg & 0x0f) | BIT(5)); /* SW control led1 on. */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
pLed->bLedOn = true;
|
||||
}
|
||||
|
||||
/* Description: */
|
||||
/* Turn off LED according to LedPin specified. */
|
||||
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed)
|
||||
{
|
||||
u8 LedCfg;
|
||||
struct hal_data_8188e *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
if (padapter->bSurpriseRemoved || padapter->bDriverStopped)
|
||||
goto exit;
|
||||
|
||||
LedCfg = rtw_read8(padapter, REG_LEDCFG2);/* 0x4E */
|
||||
|
||||
switch (pLed->LedPin) {
|
||||
case LED_PIN_LED0:
|
||||
if (pHalData->bLedOpenDrain) {
|
||||
/* Open-drain arrangement for controlling the LED) */
|
||||
LedCfg &= 0x90; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
|
||||
LedCfg = rtw_read8(padapter, REG_MAC_PINMUX_CFG);
|
||||
LedCfg &= 0xFE;
|
||||
rtw_write8(padapter, REG_MAC_PINMUX_CFG, LedCfg);
|
||||
} else {
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3) | BIT(5) | BIT(6)));
|
||||
}
|
||||
break;
|
||||
case LED_PIN_LED1:
|
||||
LedCfg &= 0x0f; /* Set to software control. */
|
||||
rtw_write8(padapter, REG_LEDCFG2, (LedCfg | BIT(3)));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
exit:
|
||||
pLed->bLedOn = false;
|
||||
}
|
||||
|
||||
/* Interface to manipulate LED objects. */
|
||||
/* Default LED behavior. */
|
||||
|
||||
/* Description: */
|
||||
/* Initialize all LED_871x objects. */
|
||||
void rtl8188eu_InitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *pledpriv = &padapter->ledpriv;
|
||||
|
||||
pledpriv->LedControlHandler = LedControl8188eu;
|
||||
|
||||
InitLed871x(padapter, &pledpriv->SwLed0, LED_PIN_LED0);
|
||||
|
||||
InitLed871x(padapter, &pledpriv->SwLed1, LED_PIN_LED1);
|
||||
}
|
||||
|
||||
/* Description: */
|
||||
/* DeInitialize all LED_819xUsb objects. */
|
||||
void rtl8188eu_DeInitSwLeds(struct adapter *padapter)
|
||||
{
|
||||
struct led_priv *ledpriv = &padapter->ledpriv;
|
||||
|
||||
DeInitLed871x(&ledpriv->SwLed0);
|
||||
DeInitLed871x(&ledpriv->SwLed1);
|
||||
}
|
@ -154,7 +154,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz, u8 bag
|
||||
u8 data_rate, pwr_status, offset;
|
||||
struct adapter *adapt = pxmitframe->padapter;
|
||||
struct pkt_attrib *pattrib = &pxmitframe->attrib;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct tx_desc *ptxdesc = (struct tx_desc *)pmem;
|
||||
struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
@ -382,7 +382,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)
|
||||
|
||||
s32 rtl8188eu_xmitframe_complete(struct adapter *adapt, struct xmit_priv *pxmitpriv, struct xmit_buf *pxmitbuf)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct xmit_frame *pxmitframe = NULL;
|
||||
struct xmit_frame *pfirstframe = NULL;
|
||||
|
||||
|
@ -8,10 +8,10 @@
|
||||
#include "../include/rtw_efuse.h"
|
||||
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
#include "../include/rtl8188e_led.h"
|
||||
#include "../include/rtw_iol.h"
|
||||
#include "../include/usb_ops.h"
|
||||
#include "../include/usb_osintf.h"
|
||||
#include "../include/Hal8188EPwrSeq.h"
|
||||
|
||||
#define HAL_MAC_ENABLE 1
|
||||
#define HAL_BB_ENABLE 1
|
||||
@ -19,7 +19,7 @@
|
||||
|
||||
static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
|
||||
switch (NumOutPipe) {
|
||||
case 3:
|
||||
@ -40,29 +40,16 @@ static void _ConfigNormalChipOutEP_8188E(struct adapter *adapt, u8 NumOutPipe)
|
||||
DBG_88E("%s OutEpQueueSel(0x%02x), OutEpNumber(%d)\n", __func__, haldata->OutEpQueueSel, haldata->OutEpNumber);
|
||||
}
|
||||
|
||||
static bool HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumInPipe, u8 NumOutPipe)
|
||||
static bool HalUsbSetQueuePipeMapping8188EUsb(struct adapter *adapt, u8 NumOutPipe)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
bool result = false;
|
||||
|
||||
_ConfigNormalChipOutEP_8188E(adapt, NumOutPipe);
|
||||
|
||||
/* Normal chip with one IN and one OUT doesn't have interrupt IN EP. */
|
||||
if (1 == haldata->OutEpNumber) {
|
||||
if (1 != NumInPipe)
|
||||
return result;
|
||||
}
|
||||
|
||||
/* All config other than above support one Bulk IN and one Interrupt IN. */
|
||||
|
||||
result = Hal_MappingOutPipe(adapt, NumOutPipe);
|
||||
|
||||
return result;
|
||||
return Hal_MappingOutPipe(adapt, NumOutPipe);
|
||||
}
|
||||
|
||||
void rtl8188eu_interface_configure(struct adapter *adapt)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(adapt);
|
||||
|
||||
if (pdvobjpriv->ishighspeed)
|
||||
@ -70,8 +57,6 @@ void rtl8188eu_interface_configure(struct adapter *adapt)
|
||||
else
|
||||
haldata->UsbBulkOutSize = USB_FULL_SPEED_BULK_SIZE;/* 64 bytes */
|
||||
|
||||
haldata->interfaceIndex = pdvobjpriv->InterfaceNumber;
|
||||
|
||||
haldata->UsbTxAggMode = 1;
|
||||
haldata->UsbTxAggDescNum = 0x6; /* only 4 bits */
|
||||
|
||||
@ -81,19 +66,18 @@ void rtl8188eu_interface_configure(struct adapter *adapt)
|
||||
haldata->UsbRxAggPageCount = 48; /* uint :128 b 0x0A; 10 = MAX_RX_DMA_BUFFER_SIZE/2/haldata->UsbBulkOutSize */
|
||||
haldata->UsbRxAggPageTimeout = 0x4; /* 6, absolute time = 34ms/(2^6) */
|
||||
|
||||
HalUsbSetQueuePipeMapping8188EUsb(adapt,
|
||||
pdvobjpriv->RtNumInPipes, pdvobjpriv->RtNumOutPipes);
|
||||
HalUsbSetQueuePipeMapping8188EUsb(adapt, pdvobjpriv->RtNumOutPipes);
|
||||
}
|
||||
|
||||
u32 rtl8188eu_InitPowerOn(struct adapter *adapt)
|
||||
{
|
||||
u16 value16;
|
||||
/* HW Power on sequence */
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
if (haldata->bMacPwrCtrlOn)
|
||||
return _SUCCESS;
|
||||
|
||||
if (!HalPwrSeqCmdParsing(adapt, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_PWR_ON_FLOW)) {
|
||||
if (!HalPwrSeqCmdParsing(adapt, Rtl8188E_NIC_PWR_ON_FLOW)) {
|
||||
DBG_88E(KERN_ERR "%s: run power on flow fail\n", __func__);
|
||||
return _FAIL;
|
||||
}
|
||||
@ -144,7 +128,7 @@ static void _InitInterrupt(struct adapter *Adapter)
|
||||
|
||||
static void _InitQueueReservedPage(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
|
||||
u32 numHQ = 0;
|
||||
u32 numLQ = 0;
|
||||
@ -212,7 +196,7 @@ static void _InitNormalChipRegPriority(struct adapter *Adapter, u16 beQ,
|
||||
|
||||
static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
u16 value = 0;
|
||||
switch (haldata->OutEpQueueSel) {
|
||||
@ -234,7 +218,7 @@ static void _InitNormalChipOneOutEpPriority(struct adapter *Adapter)
|
||||
|
||||
static void _InitNormalChipTwoOutEpPriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
|
||||
u16 beQ, bkQ, viQ, voQ, mgtQ, hiQ;
|
||||
u16 valueHi = 0;
|
||||
@ -300,7 +284,7 @@ static void _InitNormalChipThreeOutEpPriority(struct adapter *Adapter)
|
||||
|
||||
static void _InitQueuePriority(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
switch (haldata->OutEpNumber) {
|
||||
case 1:
|
||||
@ -344,7 +328,7 @@ static void _InitDriverInfoSize(struct adapter *Adapter, u8 drvInfoSize)
|
||||
|
||||
static void _InitWMACSetting(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
haldata->ReceiveConfig = RCR_AAP | RCR_APM | RCR_AM | RCR_AB |
|
||||
RCR_CBSSID_DATA | RCR_CBSSID_BCN |
|
||||
@ -400,13 +384,6 @@ static void _InitEDCA(struct adapter *Adapter)
|
||||
rtw_write32(Adapter, REG_EDCA_VO_PARAM, 0x002FA226);
|
||||
}
|
||||
|
||||
static void _InitRDGSetting(struct adapter *Adapter)
|
||||
{
|
||||
rtw_write8(Adapter, REG_RD_CTRL, 0xFF);
|
||||
rtw_write16(Adapter, REG_RD_NAV_NXT, 0x200);
|
||||
rtw_write8(Adapter, REG_RD_RESP_PKT_TH, 0x05);
|
||||
}
|
||||
|
||||
static void _InitRetryFunction(struct adapter *Adapter)
|
||||
{
|
||||
u8 value8;
|
||||
@ -436,7 +413,7 @@ static void _InitRetryFunction(struct adapter *Adapter)
|
||||
*---------------------------------------------------------------------------*/
|
||||
static void usb_AggSettingTxUpdate(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
u32 value32;
|
||||
|
||||
if (Adapter->registrypriv.wifi_spec)
|
||||
@ -471,7 +448,7 @@ usb_AggSettingRxUpdate(
|
||||
struct adapter *Adapter
|
||||
)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
u8 valueDMA;
|
||||
u8 valueUSB;
|
||||
|
||||
@ -525,16 +502,11 @@ usb_AggSettingRxUpdate(
|
||||
|
||||
static void InitUsbAggregationSetting(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
|
||||
/* Tx aggregation setting */
|
||||
usb_AggSettingTxUpdate(Adapter);
|
||||
|
||||
/* Rx aggregation setting */
|
||||
usb_AggSettingRxUpdate(Adapter);
|
||||
|
||||
/* 201/12/10 MH Add for USB agg mode dynamic switch. */
|
||||
haldata->UsbRxHighSpeedMode = false;
|
||||
}
|
||||
|
||||
static void _InitOperationMode(struct adapter *Adapter)
|
||||
@ -543,7 +515,7 @@ static void _InitOperationMode(struct adapter *Adapter)
|
||||
|
||||
static void _InitBeaconParameters(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
rtw_write16(Adapter, REG_BCN_CTRL, 0x1010);
|
||||
|
||||
@ -572,8 +544,8 @@ static void _BeaconFunctionEnable(struct adapter *Adapter,
|
||||
/* Set CCK and OFDM Block "ON" */
|
||||
static void _BBTurnOnBlock(struct adapter *Adapter)
|
||||
{
|
||||
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bCCKEn, 0x1);
|
||||
PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bCCKEn, 0x1);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_RFMOD, bOFDMEn, 0x1);
|
||||
}
|
||||
|
||||
enum {
|
||||
@ -583,16 +555,16 @@ enum {
|
||||
|
||||
static void _InitAntenna_Selection(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
if (haldata->AntDivCfg == 0)
|
||||
return;
|
||||
DBG_88E("==> %s ....\n", __func__);
|
||||
|
||||
rtw_write32(Adapter, REG_LEDCFG0, rtw_read32(Adapter, REG_LEDCFG0) | BIT(23));
|
||||
PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter, BIT(13), 0x01);
|
||||
rtl8188e_PHY_SetBBReg(Adapter, rFPGA0_XAB_RFParameter, BIT(13), 0x01);
|
||||
|
||||
if (PHY_QueryBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300) == Antenna_A)
|
||||
if (rtl8188e_PHY_QueryBBReg(Adapter, rFPGA0_XA_RFInterfaceOE, 0x300) == Antenna_A)
|
||||
haldata->CurAntenna = Antenna_A;
|
||||
else
|
||||
haldata->CurAntenna = Antenna_B;
|
||||
@ -605,18 +577,12 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
u16 value16;
|
||||
u8 txpktbuf_bndy;
|
||||
u32 status = _SUCCESS;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
|
||||
struct registry_priv *pregistrypriv = &Adapter->registrypriv;
|
||||
u32 init_start_time = jiffies;
|
||||
|
||||
#define HAL_INIT_PROFILE_TAG(stage) do {} while (0)
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BEGIN);
|
||||
|
||||
if (Adapter->pwrctrlpriv.bkeepfwalive) {
|
||||
_ps_open_RF(Adapter);
|
||||
|
||||
if (haldata->odmpriv.RFCalibrateInfo.bIQKInitialized) {
|
||||
PHY_IQCalibrate_8188E(Adapter, true);
|
||||
} else {
|
||||
@ -630,7 +596,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PW_ON);
|
||||
status = rtl8188eu_InitPowerOn(Adapter);
|
||||
if (status == _FAIL)
|
||||
goto exit;
|
||||
@ -653,7 +618,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
txpktbuf_bndy = WMM_NORMAL_TX_PAGE_BOUNDARY_88E;
|
||||
}
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC01);
|
||||
_InitQueueReservedPage(Adapter);
|
||||
_InitQueuePriority(Adapter);
|
||||
_InitPageBoundary(Adapter);
|
||||
@ -661,7 +625,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
|
||||
_InitTxBufferBoundary(Adapter, 0);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_DOWNLOAD_FW);
|
||||
status = rtl8188e_FirmwareDownload(Adapter);
|
||||
|
||||
if (status != _SUCCESS) {
|
||||
@ -675,7 +638,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
}
|
||||
rtl8188e_InitializeFirmwareVars(Adapter);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MAC);
|
||||
#if (HAL_MAC_ENABLE == 1)
|
||||
status = PHY_MACConfig8188E(Adapter);
|
||||
if (status == _FAIL) {
|
||||
@ -687,7 +649,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
/* */
|
||||
/* d. Initialize BB related configurations. */
|
||||
/* */
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_BB);
|
||||
#if (HAL_BB_ENABLE == 1)
|
||||
status = PHY_BBConfig8188E(Adapter);
|
||||
if (status == _FAIL) {
|
||||
@ -696,7 +657,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_RF);
|
||||
#if (HAL_RF_ENABLE == 1)
|
||||
status = PHY_RFConfig8188E(Adapter);
|
||||
if (status == _FAIL) {
|
||||
@ -705,7 +665,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
}
|
||||
#endif
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_EFUSE_PATCH);
|
||||
status = rtl8188e_iol_efuse_patch(Adapter);
|
||||
if (status == _FAIL) {
|
||||
DBG_88E("%s rtl8188e_iol_efuse_patch failed\n", __func__);
|
||||
@ -714,12 +673,10 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
|
||||
_InitTxBufferBoundary(Adapter, txpktbuf_bndy);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_LLTT);
|
||||
status = InitLLTTable(Adapter, txpktbuf_bndy);
|
||||
if (status == _FAIL)
|
||||
goto exit;
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC02);
|
||||
/* Get Rx PHY status in order to report RSSI and others. */
|
||||
_InitDriverInfoSize(Adapter, DRVINFO_SZ);
|
||||
|
||||
@ -743,9 +700,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
value16 |= (MACTXEN | MACRXEN);
|
||||
rtw_write8(Adapter, REG_CR, value16);
|
||||
|
||||
if (haldata->bRDGEnable)
|
||||
_InitRDGSetting(Adapter);
|
||||
|
||||
/* Enable TX Report */
|
||||
/* Enable Tx Report Timer */
|
||||
value8 = rtw_read8(Adapter, REG_TX_RPT_CTRL);
|
||||
@ -761,16 +715,13 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
rtw_write16(Adapter, REG_PKT_BE_BK_LIFE_TIME, 0x0400); /* unit: 256us. 256ms */
|
||||
|
||||
/* Keep RfRegChnlVal for later use. */
|
||||
haldata->RfRegChnlVal[0] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask);
|
||||
haldata->RfRegChnlVal[1] = PHY_QueryRFReg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask);
|
||||
haldata->RfRegChnlVal[0] = rtl8188e_PHY_QueryRFReg(Adapter, (enum rf_radio_path)0, RF_CHNLBW, bRFRegOffsetMask);
|
||||
haldata->RfRegChnlVal[1] = rtl8188e_PHY_QueryRFReg(Adapter, (enum rf_radio_path)1, RF_CHNLBW, bRFRegOffsetMask);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_TURN_ON_BLOCK);
|
||||
_BBTurnOnBlock(Adapter);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_SECURITY);
|
||||
invalidate_cam_all(Adapter);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_MISC11);
|
||||
/* 2010/12/17 MH We need to set TX power according to EFUSE content at first. */
|
||||
PHY_SetTxPowerLevel8188E(Adapter, haldata->CurrentChannel);
|
||||
|
||||
@ -795,7 +746,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
/* Nav limit , suggest by scott */
|
||||
rtw_write8(Adapter, 0x652, 0x0);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_HAL_DM);
|
||||
rtl8188e_InitHalDm(Adapter);
|
||||
|
||||
/* 2010/08/11 MH Merge from 8192SE for Minicard init. We need to confirm current radio status */
|
||||
@ -819,7 +769,6 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
/* enable tx DMA to drop the redundate data of packet */
|
||||
rtw_write16(Adapter, REG_TXDMA_OFFSET_CHK, (rtw_read16(Adapter, REG_TXDMA_OFFSET_CHK) | DROP_DATA_EN));
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_IQK);
|
||||
/* 2010/08/26 MH Merge from 8192CE. */
|
||||
if (pwrctrlpriv->rf_pwrstate == rf_on) {
|
||||
if (haldata->odmpriv.RFCalibrateInfo.bIQKInitialized) {
|
||||
@ -829,15 +778,11 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
haldata->odmpriv.RFCalibrateInfo.bIQKInitialized = true;
|
||||
}
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_PW_TRACK);
|
||||
|
||||
ODM_TXPowerTrackingCheck(&haldata->odmpriv);
|
||||
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_LCK);
|
||||
PHY_LCCalibrate_8188E(Adapter);
|
||||
}
|
||||
|
||||
/* HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_INIT_PABIAS); */
|
||||
/* _InitPABias(Adapter); */
|
||||
rtw_write8(Adapter, REG_USB_HRPWM, 0);
|
||||
|
||||
@ -845,29 +790,15 @@ u32 rtl8188eu_hal_init(struct adapter *Adapter)
|
||||
rtw_write32(Adapter, REG_FWHW_TXQ_CTRL, rtw_read32(Adapter, REG_FWHW_TXQ_CTRL) | BIT(12));
|
||||
|
||||
exit:
|
||||
HAL_INIT_PROFILE_TAG(HAL_INIT_STAGES_END);
|
||||
|
||||
DBG_88E("%s in %dms\n", __func__, rtw_get_passing_time_ms(init_start_time));
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
void _ps_open_RF(struct adapter *adapt)
|
||||
{
|
||||
/* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2 needs to be verified */
|
||||
/* phy_SsPwrSwitch92CU(adapt, rf_on, 1); */
|
||||
}
|
||||
|
||||
static void _ps_close_RF(struct adapter *adapt)
|
||||
{
|
||||
/* here call with bRegSSPwrLvl 1, bRegSSPwrLvl 2 needs to be verified */
|
||||
/* phy_SsPwrSwitch92CU(adapt, rf_off, 1); */
|
||||
}
|
||||
|
||||
static void CardDisableRTL8188EU(struct adapter *Adapter)
|
||||
{
|
||||
u8 val8;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
|
||||
/* Stop Tx Report Timer. 0x4EC[Bit1]=b'0 */
|
||||
val8 = rtw_read8(Adapter, REG_TX_RPT_CTRL);
|
||||
@ -877,7 +808,7 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)
|
||||
rtw_write8(Adapter, REG_CR, 0x0);
|
||||
|
||||
/* Run LPS WL RFOFF flow */
|
||||
HalPwrSeqCmdParsing(Adapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_LPS_ENTER_FLOW);
|
||||
HalPwrSeqCmdParsing(Adapter, Rtl8188E_NIC_LPS_ENTER_FLOW);
|
||||
|
||||
/* 2. 0x1F[7:0] = 0 turn off RF */
|
||||
|
||||
@ -898,7 +829,7 @@ static void CardDisableRTL8188EU(struct adapter *Adapter)
|
||||
rtw_write8(Adapter, REG_32K_CTRL, val8 & (~BIT(0)));
|
||||
|
||||
/* Card disable power action flow */
|
||||
HalPwrSeqCmdParsing(Adapter, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, Rtl8188E_NIC_DISABLE_FLOW);
|
||||
HalPwrSeqCmdParsing(Adapter, Rtl8188E_NIC_DISABLE_FLOW);
|
||||
|
||||
/* Reset MCU IO Wrapper */
|
||||
val8 = rtw_read8(Adapter, REG_RSV_CTRL + 1);
|
||||
@ -929,9 +860,7 @@ u32 rtl8188eu_hal_deinit(struct adapter *Adapter)
|
||||
rtw_write32(Adapter, REG_HIMRE_88E, IMR_DISABLED_88E);
|
||||
|
||||
DBG_88E("bkeepfwalive(%x)\n", Adapter->pwrctrlpriv.bkeepfwalive);
|
||||
if (Adapter->pwrctrlpriv.bkeepfwalive) {
|
||||
_ps_close_RF(Adapter);
|
||||
} else {
|
||||
if (!Adapter->pwrctrlpriv.bkeepfwalive) {
|
||||
if (Adapter->hw_init_completed) {
|
||||
CardDisableRTL8188EU(Adapter);
|
||||
}
|
||||
@ -948,12 +877,10 @@ unsigned int rtl8188eu_inirp_init(struct adapter *Adapter)
|
||||
|
||||
status = _SUCCESS;
|
||||
|
||||
precvpriv->ff_hwaddr = RECV_BULK_IN_ADDR;
|
||||
|
||||
/* issue Rx irp to receive data */
|
||||
precvbuf = (struct recv_buf *)precvpriv->precv_buf;
|
||||
for (i = 0; i < NR_RECVBUFF; i++) {
|
||||
if (!rtw_read_port(Adapter, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf)) {
|
||||
if (!rtw_read_port(Adapter, (unsigned char *)precvbuf)) {
|
||||
status = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
@ -971,39 +898,6 @@ exit:
|
||||
/* EEPROM/EFUSE Content Parsing */
|
||||
/* */
|
||||
/* */
|
||||
static void _ReadLEDSetting(struct adapter *Adapter, u8 *PROMContent, bool AutoloadFail)
|
||||
{
|
||||
struct led_priv *pledpriv = &Adapter->ledpriv;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
|
||||
pledpriv->bRegUseLed = true;
|
||||
haldata->bLedOpenDrain = true;/* Support Open-drain arrangement for controlling the LED. */
|
||||
}
|
||||
|
||||
static void Hal_EfuseParsePIDVID_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
|
||||
if (!AutoLoadFail) {
|
||||
/* VID, PID */
|
||||
haldata->EEPROMVID = EF2BYTE(*(__le16 *)&hwinfo[EEPROM_VID_88EU]);
|
||||
haldata->EEPROMPID = EF2BYTE(*(__le16 *)&hwinfo[EEPROM_PID_88EU]);
|
||||
|
||||
/* Customer ID, 0x00 and 0xff are reserved for Realtek. */
|
||||
haldata->EEPROMCustomerID = *(u8 *)&hwinfo[EEPROM_CUSTOMERID_88E];
|
||||
haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID;
|
||||
} else {
|
||||
haldata->EEPROMVID = EEPROM_Default_VID;
|
||||
haldata->EEPROMPID = EEPROM_Default_PID;
|
||||
|
||||
/* Customer ID, 0x00 and 0xff are reserved for Realtek. */
|
||||
haldata->EEPROMCustomerID = EEPROM_Default_CustomerID;
|
||||
haldata->EEPROMSubCustomerID = EEPROM_Default_SubCustomerID;
|
||||
}
|
||||
|
||||
DBG_88E("VID = 0x%04X, PID = 0x%04X\n", haldata->EEPROMVID, haldata->EEPROMPID);
|
||||
DBG_88E("Customer ID: 0x%02X, SubCustomer ID: 0x%02X\n", haldata->EEPROMCustomerID, haldata->EEPROMSubCustomerID);
|
||||
}
|
||||
|
||||
static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool AutoLoadFail)
|
||||
{
|
||||
@ -1020,76 +914,43 @@ static void Hal_EfuseParseMACAddr_8188EU(struct adapter *adapt, u8 *hwinfo, bool
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
readAdapterInfo_8188EU(
|
||||
struct adapter *adapt
|
||||
)
|
||||
{
|
||||
struct eeprom_priv *eeprom = &adapt->eeprompriv;
|
||||
|
||||
/* parse the eeprom/efuse content */
|
||||
Hal_EfuseParseIDCode88E(adapt, eeprom->efuse_eeprom_data);
|
||||
Hal_EfuseParsePIDVID_8188EU(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseMACAddr_8188EU(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
|
||||
Hal_ReadPowerSavingMode88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadTxPowerInfo88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseEEPROMVer88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
rtl8188e_EfuseParseChnlPlan(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseXtal_8188E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseCustomerID88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadAntennaDiversity88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseBoardType88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadThermalMeter_88E(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
|
||||
_ReadLEDSetting(adapt, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
}
|
||||
|
||||
static void _ReadPROMContent(
|
||||
struct adapter *Adapter
|
||||
)
|
||||
void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
||||
{
|
||||
struct eeprom_priv *eeprom = &Adapter->eeprompriv;
|
||||
struct led_priv *ledpriv = &Adapter->ledpriv;
|
||||
u8 eeValue;
|
||||
|
||||
/* Read EEPROM size before call any EEPROM function */
|
||||
Adapter->EepromAddressSize = GetEEPROMSize8188E(Adapter);
|
||||
|
||||
/* check system boot selection */
|
||||
eeValue = rtw_read8(Adapter, REG_9346CR);
|
||||
eeprom->EepromOrEfuse = (eeValue & BOOT_FROM_EEPROM) ? true : false;
|
||||
eeprom->bautoload_fail_flag = (eeValue & EEPROM_EN) ? false : true;
|
||||
eeprom->EepromOrEfuse = (eeValue & BOOT_FROM_EEPROM);
|
||||
eeprom->bautoload_fail_flag = !(eeValue & EEPROM_EN);
|
||||
|
||||
DBG_88E("Boot from %s, Autoload %s !\n", (eeprom->EepromOrEfuse ? "EEPROM" : "EFUSE"),
|
||||
(eeprom->bautoload_fail_flag ? "Fail" : "OK"));
|
||||
|
||||
Hal_InitPGData88E(Adapter);
|
||||
readAdapterInfo_8188EU(Adapter);
|
||||
}
|
||||
if (!is_boot_from_eeprom(Adapter))
|
||||
EFUSE_ShadowMapUpdate(Adapter);
|
||||
|
||||
static void _ReadRFType(struct adapter *Adapter)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
/* parse the eeprom/efuse content */
|
||||
Hal_EfuseParseIDCode88E(Adapter, eeprom->efuse_eeprom_data);
|
||||
Hal_EfuseParseMACAddr_8188EU(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
|
||||
haldata->rf_chip = RF_6052;
|
||||
}
|
||||
Hal_ReadPowerSavingMode88E(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadTxPowerInfo88E(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
rtl8188e_EfuseParseChnlPlan(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_EfuseParseXtal_8188E(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadAntennaDiversity88E(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
Hal_ReadThermalMeter_88E(Adapter, eeprom->efuse_eeprom_data, eeprom->bautoload_fail_flag);
|
||||
|
||||
static int _ReadAdapterInfo8188EU(struct adapter *Adapter)
|
||||
{
|
||||
_ReadRFType(Adapter);/* rf_chip -> _InitRFType() */
|
||||
_ReadPROMContent(Adapter);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void ReadAdapterInfo8188EU(struct adapter *Adapter)
|
||||
{
|
||||
/* Read EEPROM size before call any EEPROM function */
|
||||
Adapter->EepromAddressSize = GetEEPROMSize8188E(Adapter);
|
||||
|
||||
_ReadAdapterInfo8188EU(Adapter);
|
||||
ledpriv->bRegUseLed = true;
|
||||
}
|
||||
|
||||
static void ResumeTxBeacon(struct adapter *adapt)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
|
||||
/* 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value */
|
||||
/* which should be read from register to a global variable. */
|
||||
@ -1103,7 +964,7 @@ static void ResumeTxBeacon(struct adapter *adapt)
|
||||
|
||||
static void StopTxBeacon(struct adapter *adapt)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
|
||||
/* 2010.03.01. Marked by tynli. No need to call workitem beacause we record the value */
|
||||
/* which should be read from register to a global variable. */
|
||||
@ -1210,7 +1071,7 @@ static void hw_var_set_bcn_func(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
|
||||
void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct dm_priv *pdmpriv = &haldata->dmpriv;
|
||||
struct odm_dm_struct *podmpriv = &haldata->odmpriv;
|
||||
|
||||
@ -1727,7 +1588,7 @@ void SetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
|
||||
void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
struct odm_dm_struct *podmpriv = &haldata->odmpriv;
|
||||
|
||||
switch (variable) {
|
||||
@ -1744,9 +1605,6 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
case HW_VAR_DM_FLAG:
|
||||
val[0] = podmpriv->SupportAbility;
|
||||
break;
|
||||
case HW_VAR_RF_TYPE:
|
||||
val[0] = haldata->rf_type;
|
||||
break;
|
||||
case HW_VAR_FWLPS_RF_ON:
|
||||
{
|
||||
/* When we halt NIC, we should check if FW LPS is leave. */
|
||||
@ -1786,7 +1644,7 @@ void GetHwReg8188EU(struct adapter *Adapter, u8 variable, u8 *val)
|
||||
/* Query setting of specified variable. */
|
||||
u8 GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
u8 bResult = _SUCCESS;
|
||||
|
||||
switch (eVariable) {
|
||||
@ -1871,7 +1729,7 @@ u8 GetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable
|
||||
/* Change default setting of specified variable. */
|
||||
u8 SetHalDefVar8188EUsb(struct adapter *Adapter, enum hal_def_variable eVariable, void *pValue)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(Adapter);
|
||||
struct hal_data_8188e *haldata = &Adapter->haldata;
|
||||
u8 bResult = _SUCCESS;
|
||||
|
||||
switch (eVariable) {
|
||||
@ -1925,7 +1783,7 @@ void UpdateHalRAMask8188EUsb(struct adapter *adapt, u32 mac_id, u8 rssi_level)
|
||||
u8 shortGIrate = false;
|
||||
int supportRateNum = 0;
|
||||
struct sta_info *psta;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct mlme_ext_priv *pmlmeext = &adapt->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &pmlmeext->mlmext_info;
|
||||
struct wlan_bssid_ex *cur_network = &pmlmeinfo->network;
|
||||
@ -2036,11 +1894,10 @@ void SetBeaconRelatedRegisters8188EUsb(struct adapter *adapt)
|
||||
|
||||
void rtl8188eu_init_default_value(struct adapter *adapt)
|
||||
{
|
||||
struct hal_data_8188e *haldata;
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct pwrctrl_priv *pwrctrlpriv;
|
||||
u8 i;
|
||||
|
||||
haldata = GET_HAL_DATA(adapt);
|
||||
pwrctrlpriv = &adapt->pwrctrlpriv;
|
||||
|
||||
/* init default value */
|
||||
@ -2057,11 +1914,3 @@ void rtl8188eu_init_default_value(struct adapter *adapt)
|
||||
for (i = 0; i < HP_THERMAL_NUM; i++)
|
||||
haldata->odmpriv.RFCalibrateInfo.ThermalValue_HP[i] = 0;
|
||||
}
|
||||
|
||||
void rtl8188eu_alloc_haldata(struct adapter *adapt)
|
||||
{
|
||||
adapt->HalData = kzalloc(sizeof(struct hal_data_8188e), GFP_KERNEL);
|
||||
if (!adapt->HalData)
|
||||
DBG_88E("cant not alloc memory for HAL DATA\n");
|
||||
adapt->hal_data_sz = sizeof(struct hal_data_8188e);
|
||||
}
|
||||
|
@ -183,24 +183,6 @@ int rtw_writeN(struct adapter *adapter, u32 addr, u32 length, u8 *data)
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
static void interrupt_handler_8188eu(struct adapter *adapt, u16 pkt_len, u8 *pbuf)
|
||||
{
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
|
||||
if (pkt_len != INTERRUPT_MSG_FORMAT_LEN) {
|
||||
DBG_88E("%s Invalid interrupt content length (%d)!\n", __func__, pkt_len);
|
||||
return;
|
||||
}
|
||||
|
||||
/* HISR */
|
||||
memcpy(&haldata->IntArray[0], &pbuf[USB_INTR_CONTENT_HISR_OFFSET], 4);
|
||||
memcpy(&haldata->IntArray[1], &pbuf[USB_INTR_CONTENT_HISRE_OFFSET], 4);
|
||||
|
||||
/* C2H Event */
|
||||
if (pbuf[0] != 0)
|
||||
memcpy(&haldata->C2hArray[0], &pbuf[USB_INTR_CONTENT_C2H_OFFSET], 16);
|
||||
}
|
||||
|
||||
static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
{
|
||||
u8 *pbuf;
|
||||
@ -213,7 +195,7 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
struct sk_buff *pkt_copy = NULL;
|
||||
struct recv_frame *precvframe = NULL;
|
||||
struct rx_pkt_attrib *pattrib = NULL;
|
||||
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
|
||||
struct hal_data_8188e *haldata = &adapt->haldata;
|
||||
struct recv_priv *precvpriv = &adapt->recvpriv;
|
||||
struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
|
||||
|
||||
@ -342,8 +324,6 @@ static int recvbuf2recvframe(struct adapter *adapt, struct sk_buff *pskb)
|
||||
pattrib->MacIDValidEntry[0],
|
||||
pattrib->MacIDValidEntry[1]
|
||||
);
|
||||
} else if (pattrib->pkt_rpt_type == HIS_REPORT) {
|
||||
interrupt_handler_8188eu(adapt, pattrib->pkt_len, precvframe->rx_data);
|
||||
}
|
||||
rtw_free_recvframe(precvframe, pfree_recv_queue);
|
||||
}
|
||||
@ -401,7 +381,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||
if (purb->status == 0) { /* SUCCESS */
|
||||
if ((purb->actual_length > MAX_RECVBUF_SZ) || (purb->actual_length < RXDESC_SIZE)) {
|
||||
precvbuf->reuse = true;
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, (unsigned char *)precvbuf);
|
||||
DBG_88E("%s()-%d: RX Warning!\n", __func__, __LINE__);
|
||||
} else {
|
||||
rtw_reset_continual_urb_error(adapter_to_dvobj(adapt));
|
||||
@ -415,7 +395,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||
|
||||
precvbuf->pskb = NULL;
|
||||
precvbuf->reuse = false;
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, (unsigned char *)precvbuf);
|
||||
}
|
||||
} else {
|
||||
DBG_88E("###=> usb_read_port_complete => urb status(%d)\n", purb->status);
|
||||
@ -436,7 +416,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||
case -EPROTO:
|
||||
case -EOVERFLOW:
|
||||
precvbuf->reuse = true;
|
||||
rtw_read_port(adapt, precvpriv->ff_hwaddr, 0, (unsigned char *)precvbuf);
|
||||
rtw_read_port(adapt, (unsigned char *)precvbuf);
|
||||
break;
|
||||
case -EINPROGRESS:
|
||||
DBG_88E("ERROR: URB IS IN PROGRESS!/n");
|
||||
@ -447,7 +427,7 @@ static void usb_read_port_complete(struct urb *purb, struct pt_regs *regs)
|
||||
}
|
||||
}
|
||||
|
||||
u32 rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
|
||||
u32 rtw_read_port(struct adapter *adapter, u8 *rmem)
|
||||
{
|
||||
struct urb *purb = NULL;
|
||||
struct recv_buf *precvbuf = (struct recv_buf *)rmem;
|
||||
@ -507,7 +487,7 @@ u32 rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *rmem)
|
||||
purb = precvbuf->purb;
|
||||
|
||||
/* translate DMA FIFO addr to pipehandle */
|
||||
pipe = ffaddr2pipehdl(pdvobj, addr);
|
||||
pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe);
|
||||
|
||||
usb_fill_bulk_urb(purb, pusbd, pipe,
|
||||
precvbuf->pbuf,
|
||||
|
@ -4,37 +4,11 @@
|
||||
#ifndef __INC_HAL8188EPHYCFG_H__
|
||||
#define __INC_HAL8188EPHYCFG_H__
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
#define LOOP_LIMIT 5
|
||||
#define MAX_STALL_TIME 50 /* us */
|
||||
#define AntennaDiversityValue 0x80
|
||||
#define MAX_TXPWR_IDX_NMODE_92S 63
|
||||
#define Reset_Cnt_Limit 3
|
||||
|
||||
#define IQK_MAC_REG_NUM 4
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define HP_THERMAL_NUM 8
|
||||
|
||||
#define MAX_AGGR_NUM 0x07
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
enum hw90_block {
|
||||
HW90_BLOCK_MAC = 0,
|
||||
HW90_BLOCK_PHY0 = 1,
|
||||
HW90_BLOCK_PHY1 = 2,
|
||||
HW90_BLOCK_RF = 3,
|
||||
HW90_BLOCK_MAXIMUM = 4, /* Never use this */
|
||||
};
|
||||
|
||||
enum rf_radio_path {
|
||||
RF_PATH_A = 0, /* Radio Path A */
|
||||
RF_PATH_B = 1, /* Radio Path B */
|
||||
RF_PATH_C = 2, /* Radio Path C */
|
||||
RF_PATH_D = 3, /* Radio Path D */
|
||||
};
|
||||
|
||||
#define MAX_PG_GROUP 13
|
||||
@ -46,17 +20,6 @@ enum rf_radio_path {
|
||||
#define MAX_CHNL_GROUP_24G 6 /* ch1~2, ch3~5, ch6~8,
|
||||
*ch9~11, ch12~13, CH 14
|
||||
* total three groups */
|
||||
#define CHANNEL_GROUP_MAX_88E 6
|
||||
|
||||
/* BB/RF related */
|
||||
enum RF_TYPE_8190P {
|
||||
RF_TYPE_MIN, /* 0 */
|
||||
RF_8225 = 1, /* 1 11b/g RF for verification only */
|
||||
RF_8256 = 2, /* 2 11b/g/n */
|
||||
RF_6052 = 4, /* 4 11b/g/n RF */
|
||||
/* TODO: We should remove this psudo PHY RF after we get new RF. */
|
||||
RF_PSEUDO_11N = 5, /* 5, It is a temporality RF. */
|
||||
};
|
||||
|
||||
struct bb_reg_def {
|
||||
u32 rfintfs; /* set software control: */
|
||||
@ -106,18 +69,7 @@ struct bb_reg_def {
|
||||
* Path A and B */
|
||||
};
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
/* */
|
||||
/* BB and RF register read/write */
|
||||
/* */
|
||||
u32 rtl8188e_PHY_QueryBBReg(struct adapter *adapter, u32 regaddr, u32 mask);
|
||||
void rtl8188e_PHY_SetBBReg(struct adapter *Adapter, u32 RegAddr,
|
||||
u32 mask, u32 data);
|
||||
@ -144,15 +96,5 @@ void PHY_SwChnl8188E(struct adapter *adapter, u8 channel);
|
||||
|
||||
void storePwrIndexDiffRateOffset(struct adapter *adapter, u32 regaddr,
|
||||
u32 mask, u32 data);
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
||||
#define PHY_QueryBBReg(adapt, regaddr, mask) \
|
||||
rtl8188e_PHY_QueryBBReg((adapt), (regaddr), (mask))
|
||||
#define PHY_SetBBReg(adapt, regaddr, bitmask, data) \
|
||||
rtl8188e_PHY_SetBBReg((adapt), (regaddr), (bitmask), (data))
|
||||
#define PHY_QueryRFReg(adapt, rfpath, regaddr, bitmask) \
|
||||
rtl8188e_PHY_QueryRFReg((adapt), (rfpath), (regaddr), (bitmask))
|
||||
#define PHY_SetRFReg(adapt, rfpath, regaddr, bitmask, data) \
|
||||
rtl8188e_PHY_SetRFReg((adapt), (rfpath), (regaddr), (bitmask), (data))
|
||||
|
||||
#endif /* __INC_HAL8192CPHYCFG_H */
|
||||
#endif
|
||||
|
@ -6,150 +6,8 @@
|
||||
|
||||
#include "HalPwrSeqCmd.h"
|
||||
|
||||
/*
|
||||
Check document WM-20110607-Paul-RTL8188E_Power_Architecture-R02.vsd
|
||||
There are 6 HW Power States:
|
||||
0: POFF--Power Off
|
||||
1: PDN--Power Down
|
||||
2: CARDEMU--Card Emulation
|
||||
3: ACT--Active Mode
|
||||
4: LPS--Low Power State
|
||||
5: SUS--Suspend
|
||||
|
||||
The transision from different states are defined below
|
||||
TRANS_CARDEMU_TO_ACT
|
||||
TRANS_ACT_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_SUS
|
||||
TRANS_SUS_TO_CARDEMU
|
||||
TRANS_CARDEMU_TO_PDN
|
||||
TRANS_ACT_TO_LPS
|
||||
TRANS_LPS_TO_ACT
|
||||
|
||||
TRANS_END
|
||||
|
||||
PWR SEQ Version: rtl8188E_PwrSeq_V09.h
|
||||
*/
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS 10
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS 10
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU_STEPS 10
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS_STEPS 15
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT_STEPS 15
|
||||
#define RTL8188E_TRANS_END_STEPS 1
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), BIT(1)},/* wait till 0x04[17] = 1 power ready*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0)|BIT(1), 0}, /* 0x02[1:0] = 0 reset BB*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0}, /* 0x04[15] = 0 disable HWPDN (control by DRV)*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4)|BIT(3), 0}, /*0x04[12:11] = 2b'00 disable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*0x04[8] = 1 polling until return 0*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(0), 0}, /*wait till 0x04[8] = 0*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*LDO normal mode*/ \
|
||||
{0x0074, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*SDIO Driving*/ \
|
||||
|
||||
#define RTL8188E_TRANS_ACT_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x001F, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0},/*0x1F[7:0] = 0 turn off RF*/ \
|
||||
{0x0023, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*LDO Sleep mode*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, /*0x04[9] = 1 turn off MAC by HW state machine*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(1), 0}, /*wait till 0x04[9] = 0 polling until return 0 to disable*/ \
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_SUS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01enable WL suspend*/ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)|BIT(4)}, /*0x04[12:11] = 2b'11enable WL suspend for PCIe*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, BIT(7)}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_SUS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_CARDDIS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0026, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)}, /*0x24[23] = 2b'01 schmit trigger */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), BIT(3)}, /*0x04[12:11] = 2b'01 enable WL suspend*/ \
|
||||
{0x0007, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0}, /* 0x04[31:30] = 2b'10 enable enable bandgap mbias in suspend */ \
|
||||
{0x0041, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK|PWR_INTF_SDIO_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*Clear SIC_EN register 0x40[12] = 1'b0 */ \
|
||||
{0xfe10, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), BIT(4)}, /*Set USB suspend enable local register 0xfe10[4]=1 */ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), BIT(0)}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), 0}, /*wait power state to suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDDIS_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_WRITE, BIT(0), 0}, /*Set SDIO suspend local register*/ \
|
||||
{0x0086, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_POLLING, BIT(1), BIT(1)}, /*wait power state to suspend*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(3)|BIT(4), 0}, /*0x04[12:11] = 2b'01enable WL suspend*/
|
||||
|
||||
#define RTL8188E_TRANS_CARDEMU_TO_PDN \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0x0006, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0},/* 0x04[16] = 0*/\
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), BIT(7)},/* 0x04[15] = 1*/
|
||||
|
||||
#define RTL8188E_TRANS_PDN_TO_CARDEMU \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here */ \
|
||||
{0x0005, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(7), 0},/* 0x04[15] = 0*/
|
||||
|
||||
/* This is used by driver for LPSRadioOff Procedure, not for FW LPS Step */
|
||||
#define RTL8188E_TRANS_ACT_TO_LPS \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here */ \
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x7F},/*Tx Pause*/ \
|
||||
{0x05F8, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05F9, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FA, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x05FB, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, 0xFF, 0},/*Should be zero if no packet is transmitting*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(0), 0},/*CCK and OFDM are disabled,and clock are gated*/ \
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_US},/*Delay 1us*/ \
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x3F},/*Reset MAC TRX*/ \
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), 0},/*check if removed later*/ \
|
||||
{0x0553, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(5), BIT(5)},/*Respond TxOK to scheduler*/ \
|
||||
|
||||
#define RTL8188E_TRANS_LPS_TO_ACT \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here */ \
|
||||
{0x0080, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_SDIO_MSK, PWR_BASEADDR_SDIO, PWR_CMD_WRITE, 0xFF, 0x84}, /*SDIO RPWM*/\
|
||||
{0xFE58, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_USB_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, /*USB RPWM*/\
|
||||
{0x0361, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_PCI_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0x84}, /*PCIe RPWM*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_DELAY, 0, PWRSEQ_DELAY_MS}, /*Delay*/\
|
||||
{0x0008, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(4), 0}, /*. 0x08[4] = 0 switch TSF to 40M*/\
|
||||
{0x0109, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_POLLING, BIT(7), 0}, /*Polling 0x109[7]=0 TSF in 40M*/\
|
||||
{0x0029, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(6)|BIT(7), 0}, /*. 0x29[7:6] = 2b'00 enable BB clock*/\
|
||||
{0x0101, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1), BIT(1)}, /*. 0x101[1] = 1*/\
|
||||
{0x0100, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0xFF}, /*. 0x100[7:0] = 0xFF enable WMAC TRX*/\
|
||||
{0x0002, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, BIT(1)|BIT(0), BIT(1)|BIT(0)}, /*. 0x02[1:0] = 2b'11 enable BB macro*/\
|
||||
{0x0522, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK, PWR_BASEADDR_MAC, PWR_CMD_WRITE, 0xFF, 0}, /*. 0x522 = 0*/
|
||||
|
||||
#define RTL8188E_TRANS_END \
|
||||
/* format */ \
|
||||
/* { offset, cut_msk, fab_msk|interface_msk, base|cmd, msk, value }, comments here*/ \
|
||||
{0xFFFF, PWR_CUT_ALL_MSK, PWR_FAB_ALL_MSK, PWR_INTF_ALL_MSK,0, PWR_CMD_END, 0, 0}, /* */
|
||||
|
||||
extern struct wl_pwr_cfg rtl8188E_power_on_flow[RTL8188E_TRANS_CARDEMU_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_radio_off_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_card_disable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_card_enable_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_suspend_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_resume_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_SUS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_hwpdn_flow[RTL8188E_TRANS_ACT_TO_CARDEMU_STEPS+RTL8188E_TRANS_CARDEMU_TO_PDN_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_enter_lps_flow[RTL8188E_TRANS_ACT_TO_LPS_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_leave_lps_flow[RTL8188E_TRANS_LPS_TO_ACT_STEPS+RTL8188E_TRANS_END_STEPS];
|
||||
extern struct wl_pwr_cfg rtl8188E_power_on_flow[];
|
||||
extern struct wl_pwr_cfg rtl8188E_card_disable_flow[];
|
||||
extern struct wl_pwr_cfg rtl8188E_enter_lps_flow[];
|
||||
|
||||
#endif /* __HAL8188EPWRSEQ_H__ */
|
||||
|
@ -30,12 +30,7 @@ void PHY_DigitalPredistortion_8188E(struct adapter *pAdapter);
|
||||
void _PHY_SaveADDARegisters(struct adapter *pAdapter, u32 *ADDAReg,
|
||||
u32 *ADDABackup, u32 RegisterNum);
|
||||
|
||||
void _PHY_PathADDAOn(struct adapter *pAdapter, u32 *ADDAReg,
|
||||
bool isPathAOn, bool is2T);
|
||||
|
||||
void _PHY_MACSettingCalibration(struct adapter *pAdapter, u32 *MACReg,
|
||||
u32 *MACBackup);
|
||||
|
||||
void _PHY_PathAStandBy(struct adapter *pAdapter);
|
||||
|
||||
#endif /* #ifndef __HAL_PHY_RF_8188E_H__ */
|
||||
|
@ -9,11 +9,6 @@
|
||||
/*---------------------------------------------*/
|
||||
/* 3 The value of cmd: 4 bits */
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CMD_READ 0x00
|
||||
/* offset: the read register offset */
|
||||
/* msk: the mask of the read value */
|
||||
/* value: N/A, left by 0 */
|
||||
/* note: dirver shall implement this function by read & msk */
|
||||
|
||||
#define PWR_CMD_WRITE 0x01
|
||||
/* offset: the read register offset */
|
||||
@ -41,43 +36,6 @@
|
||||
/* msk: N/A */
|
||||
/* value: N/A */
|
||||
|
||||
/*---------------------------------------------*/
|
||||
/* 3 The value of base: 4 bits */
|
||||
/*---------------------------------------------*/
|
||||
/* define the base address of each block */
|
||||
#define PWR_BASEADDR_MAC 0x00
|
||||
#define PWR_BASEADDR_USB 0x01
|
||||
#define PWR_BASEADDR_PCIE 0x02
|
||||
#define PWR_BASEADDR_SDIO 0x03
|
||||
|
||||
/*---------------------------------------------*/
|
||||
/* 3 The value of interface_msk: 4 bits */
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_INTF_SDIO_MSK BIT(0)
|
||||
#define PWR_INTF_USB_MSK BIT(1)
|
||||
#define PWR_INTF_PCI_MSK BIT(2)
|
||||
#define PWR_INTF_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
/* 3 The value of fab_msk: 4 bits */
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_FAB_TSMC_MSK BIT(0)
|
||||
#define PWR_FAB_UMC_MSK BIT(1)
|
||||
#define PWR_FAB_ALL_MSK (BIT(0)|BIT(1)|BIT(2)|BIT(3))
|
||||
|
||||
/*---------------------------------------------*/
|
||||
/* 3 The value of cut_msk: 8 bits */
|
||||
/*---------------------------------------------*/
|
||||
#define PWR_CUT_TESTCHIP_MSK BIT(0)
|
||||
#define PWR_CUT_A_MSK BIT(1)
|
||||
#define PWR_CUT_B_MSK BIT(2)
|
||||
#define PWR_CUT_C_MSK BIT(3)
|
||||
#define PWR_CUT_D_MSK BIT(4)
|
||||
#define PWR_CUT_E_MSK BIT(5)
|
||||
#define PWR_CUT_F_MSK BIT(6)
|
||||
#define PWR_CUT_G_MSK BIT(7)
|
||||
#define PWR_CUT_ALL_MSK 0xFF
|
||||
|
||||
enum pwrseq_cmd_delat_unit {
|
||||
PWRSEQ_DELAY_US,
|
||||
PWRSEQ_DELAY_MS,
|
||||
@ -85,26 +43,17 @@ enum pwrseq_cmd_delat_unit {
|
||||
|
||||
struct wl_pwr_cfg {
|
||||
u16 offset;
|
||||
u8 cut_msk;
|
||||
u8 fab_msk:4;
|
||||
u8 interface_msk:4;
|
||||
u8 base:4;
|
||||
u8 cmd:4;
|
||||
u8 msk;
|
||||
u8 value;
|
||||
};
|
||||
|
||||
#define GET_PWR_CFG_OFFSET(__PWR_CMD) __PWR_CMD.offset
|
||||
#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) __PWR_CMD.cut_msk
|
||||
#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) __PWR_CMD.fab_msk
|
||||
#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) __PWR_CMD.interface_msk
|
||||
#define GET_PWR_CFG_BASE(__PWR_CMD) __PWR_CMD.base
|
||||
#define GET_PWR_CFG_CMD(__PWR_CMD) __PWR_CMD.cmd
|
||||
#define GET_PWR_CFG_MASK(__PWR_CMD) __PWR_CMD.msk
|
||||
#define GET_PWR_CFG_VALUE(__PWR_CMD) __PWR_CMD.value
|
||||
|
||||
/* Prototype of protected function. */
|
||||
u8 HalPwrSeqCmdParsing(struct adapter *padapter, u8 CutVersion, u8 FabVersion,
|
||||
u8 InterfaceType, struct wl_pwr_cfg PwrCfgCmd[]);
|
||||
u8 HalPwrSeqCmdParsing(struct adapter *padapter, struct wl_pwr_cfg PwrCfgCmd[]);
|
||||
|
||||
#endif
|
||||
|
@ -24,22 +24,10 @@ enum HAL_VENDOR {
|
||||
CHIP_VENDOR_UMC = 1,
|
||||
};
|
||||
|
||||
enum HAL_RF_TYPE {
|
||||
RF_TYPE_1T1R = 0,
|
||||
RF_TYPE_1T2R = 1,
|
||||
RF_TYPE_2T2R = 2,
|
||||
RF_TYPE_2T3R = 3,
|
||||
RF_TYPE_2T4R = 4,
|
||||
RF_TYPE_3T3R = 5,
|
||||
RF_TYPE_3T4R = 6,
|
||||
RF_TYPE_4T4R = 7,
|
||||
};
|
||||
|
||||
struct HAL_VERSION {
|
||||
enum HAL_CHIP_TYPE ChipType;
|
||||
enum HAL_CUT_VERSION CUTVersion;
|
||||
enum HAL_VENDOR VendorType;
|
||||
enum HAL_RF_TYPE RFType;
|
||||
u8 ROMVer;
|
||||
};
|
||||
|
||||
@ -47,7 +35,6 @@ struct HAL_VERSION {
|
||||
#define GET_CVID_CHIP_TYPE(version) (((version).ChipType))
|
||||
#define GET_CVID_MANUFACTUER(version) (((version).VendorType))
|
||||
#define GET_CVID_CUT_VERSION(version) (((version).CUTVersion))
|
||||
#define GET_CVID_ROM_VERSION(version) (((version).ROMVer) & ROM_VERSION_MASK)
|
||||
|
||||
/* Common Macro. -- */
|
||||
/* HAL_VERSION VersionID */
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "rtw_p2p.h"
|
||||
#include "rtw_ap.h"
|
||||
#include "rtw_br_ext.h"
|
||||
#include "rtl8188e_hal.h"
|
||||
|
||||
#define DRIVERVERSION "v4.1.4_6773.20130222"
|
||||
|
||||
@ -85,7 +86,6 @@ struct registry_priv {
|
||||
u8 ampdu_amsdu;/* A-MPDU Supports A-MSDU is permitted */
|
||||
u8 lowrate_two_xmit;
|
||||
|
||||
u8 rf_config;
|
||||
u8 low_power;
|
||||
|
||||
u8 wifi_spec;/* !turbo_mode */
|
||||
@ -114,12 +114,6 @@ struct registry_priv {
|
||||
u8 notch_filter;
|
||||
};
|
||||
|
||||
/* For registry parameters */
|
||||
#define RGTRY_OFT(field) ((u32)FIELD_OFFSET(struct registry_priv, field))
|
||||
#define RGTRY_SZ(field) sizeof(((struct registry_priv *)0)->field)
|
||||
#define BSSID_OFT(field) ((u32)FIELD_OFFSET(struct wlan_bssid_ex, field))
|
||||
#define BSSID_SZ(field) sizeof(((struct wlan_bssid_ex *)0)->field)
|
||||
|
||||
#define MAX_CONTINUAL_URB_ERR 4
|
||||
|
||||
struct rt_firmware {
|
||||
@ -129,14 +123,13 @@ struct rt_firmware {
|
||||
|
||||
struct dvobj_priv {
|
||||
struct adapter *if1;
|
||||
struct adapter *if2;
|
||||
|
||||
/* For 92D, DMDP have 2 interface. */
|
||||
u8 InterfaceNumber;
|
||||
u8 NumInterfaces;
|
||||
|
||||
/* In /Out Pipe information */
|
||||
int RtInPipe[2];
|
||||
int RtInPipe;
|
||||
int RtOutPipe[3];
|
||||
u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */
|
||||
|
||||
@ -146,11 +139,8 @@ struct dvobj_priv {
|
||||
|
||||
/*-------- below is for USB INTERFACE --------*/
|
||||
|
||||
u8 nr_endpoint;
|
||||
u8 ishighspeed;
|
||||
u8 RtNumInPipes;
|
||||
u8 RtNumOutPipes;
|
||||
int ep_num[5]; /* endpoint number */
|
||||
int RegUsbSS;
|
||||
struct semaphore usb_suspend_sema;
|
||||
struct mutex usb_vendor_req_mutex;
|
||||
@ -210,8 +200,7 @@ struct adapter {
|
||||
struct hostapd_priv *phostapdpriv;
|
||||
struct wifidirect_info wdinfo;
|
||||
|
||||
void *HalData;
|
||||
u32 hal_data_sz;
|
||||
struct hal_data_8188e haldata;
|
||||
|
||||
s32 bDriverStopped;
|
||||
s32 bSurpriseRemoved;
|
||||
@ -275,8 +264,6 @@ struct adapter {
|
||||
unsigned char br_ip[4];
|
||||
struct br_ext_info ethBrExtInfo;
|
||||
|
||||
u8 fix_rate;
|
||||
|
||||
unsigned char in_cta_test;
|
||||
};
|
||||
|
||||
|
@ -29,7 +29,6 @@ enum hw_variables {
|
||||
HW_VAR_ACK_PREAMBLE,
|
||||
HW_VAR_SEC_CFG,
|
||||
HW_VAR_BCN_VALID,
|
||||
HW_VAR_RF_TYPE,
|
||||
HW_VAR_DM_FLAG,
|
||||
HW_VAR_DM_FUNC_OP,
|
||||
HW_VAR_DM_FUNC_SET,
|
||||
@ -95,40 +94,17 @@ enum hal_def_variable {
|
||||
HAL_DEF_DBG_DUMP_TXPKT,
|
||||
};
|
||||
|
||||
enum hal_odm_variable {
|
||||
HAL_ODM_STA_INFO,
|
||||
HAL_ODM_P2P_STATE,
|
||||
HAL_ODM_WIFI_DISPLAY_STATE,
|
||||
};
|
||||
|
||||
typedef s32 (*c2h_id_filter)(u8 id);
|
||||
|
||||
#define RF_CHANGE_BY_INIT 0
|
||||
#define RF_CHANGE_BY_IPS BIT(28)
|
||||
#define RF_CHANGE_BY_PS BIT(29)
|
||||
#define RF_CHANGE_BY_HW BIT(30)
|
||||
#define RF_CHANGE_BY_SW BIT(31)
|
||||
|
||||
#define is_boot_from_eeprom(adapter) (adapter->eeprompriv.EepromOrEfuse)
|
||||
|
||||
void rtl8188eu_alloc_haldata(struct adapter *adapt);
|
||||
|
||||
void rtl8188eu_interface_configure(struct adapter *adapt);
|
||||
void ReadAdapterInfo8188EU(struct adapter *Adapter);
|
||||
void rtl8188eu_init_default_value(struct adapter *adapt);
|
||||
void rtl8188e_SetHalODMVar(struct adapter *Adapter,
|
||||
enum hal_odm_variable eVariable, void *pValue1, bool bSet);
|
||||
void rtl8188e_SetHalODMVar(struct adapter *Adapter, void *pValue1, bool bSet);
|
||||
u32 rtl8188eu_InitPowerOn(struct adapter *adapt);
|
||||
void rtl8188e_free_hal_data(struct adapter *padapter);
|
||||
void rtl8188e_EfusePowerSwitch(struct adapter *pAdapter, u8 bWrite, u8 PwrState);
|
||||
void rtl8188e_ReadEFuse(struct adapter *Adapter, u8 efuseType,
|
||||
u16 _offset, u16 _size_byte, u8 *pbuf,
|
||||
bool bPseudoTest);
|
||||
void rtl8188e_EFUSE_GetEfuseDefinition(struct adapter *pAdapter, u8 efuseType,
|
||||
u8 type, void *pOut, bool bPseudoTest);
|
||||
u16 rtl8188e_EfuseGetCurrentSize(struct adapter *pAdapter, u8 efuseType, bool bPseudoTest);
|
||||
int rtl8188e_Efuse_PgPacketRead(struct adapter *pAdapter, u8 offset, u8 *data, bool bPseudoTest);
|
||||
int rtl8188e_Efuse_PgPacketWrite(struct adapter *pAdapter, u8 offset, u8 word_en, u8 *data, bool bPseudoTest);
|
||||
void rtl8188e_EfusePowerSwitch(struct adapter *pAdapter, u8 PwrState);
|
||||
void rtl8188e_ReadEFuse(struct adapter *Adapter, u16 _offset, u16 _size_byte, u8 *pbuf);
|
||||
|
||||
void hal_notch_filter_8188e(struct adapter *adapter, bool enable);
|
||||
|
||||
|
@ -1149,7 +1149,6 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork);
|
||||
|
||||
void rtw_macaddr_cfg(u8 *mac_addr);
|
||||
|
||||
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40,
|
||||
unsigned char *MCS_rate);
|
||||
u16 rtw_mcs_rate(u8 bw_40MHz, u8 short_GI_20, u8 short_GI_40, unsigned char *MCS_rate);
|
||||
|
||||
#endif /* IEEE80211_H */
|
||||
|
@ -1,271 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __IEEE80211_EXT_H
|
||||
#define __IEEE80211_EXT_H
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
#define WMM_OUI_TYPE 2
|
||||
#define WMM_OUI_SUBTYPE_INFORMATION_ELEMENT 0
|
||||
#define WMM_OUI_SUBTYPE_PARAMETER_ELEMENT 1
|
||||
#define WMM_OUI_SUBTYPE_TSPEC_ELEMENT 2
|
||||
#define WMM_VERSION 1
|
||||
|
||||
#define WPA_PROTO_WPA BIT(0)
|
||||
#define WPA_PROTO_RSN BIT(1)
|
||||
|
||||
#define WPA_KEY_MGMT_IEEE8021X BIT(0)
|
||||
#define WPA_KEY_MGMT_PSK BIT(1)
|
||||
#define WPA_KEY_MGMT_NONE BIT(2)
|
||||
#define WPA_KEY_MGMT_IEEE8021X_NO_WPA BIT(3)
|
||||
#define WPA_KEY_MGMT_WPA_NONE BIT(4)
|
||||
|
||||
#define WPA_CAPABILITY_PREAUTH BIT(0)
|
||||
#define WPA_CAPABILITY_MGMT_FRAME_PROTECTION BIT(6)
|
||||
#define WPA_CAPABILITY_PEERKEY_ENABLED BIT(9)
|
||||
|
||||
#define PMKID_LEN 16
|
||||
|
||||
struct wpa_ie_hdr {
|
||||
u8 elem_id;
|
||||
u8 len;
|
||||
u8 oui[4]; /* 24-bit OUI followed by 8-bit OUI type */
|
||||
u8 version[2]; /* little endian */
|
||||
} __packed;
|
||||
|
||||
struct rsn_ie_hdr {
|
||||
u8 elem_id; /* WLAN_EID_RSN */
|
||||
u8 len;
|
||||
u8 version[2]; /* little endian */
|
||||
} __packed;
|
||||
|
||||
struct wme_ac_parameter {
|
||||
#if defined(__LITTLE_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 aifsn:4,
|
||||
acm:1,
|
||||
aci:2,
|
||||
reserved:1;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmin:4,
|
||||
eCWmax:4;
|
||||
#elif defined(__BIG_ENDIAN)
|
||||
/* byte 1 */
|
||||
u8 reserved:1,
|
||||
aci:2,
|
||||
acm:1,
|
||||
aifsn:4;
|
||||
|
||||
/* byte 2 */
|
||||
u8 eCWmax:4,
|
||||
eCWmin:4;
|
||||
#else
|
||||
#error "Please fix <endian.h>"
|
||||
#endif
|
||||
|
||||
/* bytes 3 & 4 */
|
||||
u16 txopLimit;
|
||||
} __packed;
|
||||
|
||||
struct wme_parameter_element {
|
||||
/* required fields for WME version 1 */
|
||||
u8 oui[3];
|
||||
u8 oui_type;
|
||||
u8 oui_subtype;
|
||||
u8 version;
|
||||
u8 acInfo;
|
||||
u8 reserved;
|
||||
struct wme_ac_parameter ac[4];
|
||||
|
||||
} __packed;
|
||||
|
||||
#define WPA_PUT_LE16(a, val) \
|
||||
do { \
|
||||
(a)[1] = ((u16) (val)) >> 8; \
|
||||
(a)[0] = ((u16) (val)) & 0xff; \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_BE32(a, val) \
|
||||
do { \
|
||||
(a)[0] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[3] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define WPA_PUT_LE32(a, val) \
|
||||
do { \
|
||||
(a)[3] = (u8) ((((u32) (val)) >> 24) & 0xff); \
|
||||
(a)[2] = (u8) ((((u32) (val)) >> 16) & 0xff); \
|
||||
(a)[1] = (u8) ((((u32) (val)) >> 8) & 0xff); \
|
||||
(a)[0] = (u8) (((u32) (val)) & 0xff); \
|
||||
} while (0)
|
||||
|
||||
#define RSN_SELECTOR_PUT(a, val) WPA_PUT_BE32((u8 *)(a), (val))
|
||||
|
||||
/* Action category code */
|
||||
enum ieee80211_category {
|
||||
WLAN_CATEGORY_SPECTRUM_MGMT = 0,
|
||||
WLAN_CATEGORY_QOS = 1,
|
||||
WLAN_CATEGORY_DLS = 2,
|
||||
WLAN_CATEGORY_BACK = 3,
|
||||
WLAN_CATEGORY_HT = 7,
|
||||
WLAN_CATEGORY_WMM = 17,
|
||||
};
|
||||
|
||||
/* SPECTRUM_MGMT action code */
|
||||
enum ieee80211_spectrum_mgmt_actioncode {
|
||||
WLAN_ACTION_SPCT_MSR_REQ = 0,
|
||||
WLAN_ACTION_SPCT_MSR_RPRT = 1,
|
||||
WLAN_ACTION_SPCT_TPC_REQ = 2,
|
||||
WLAN_ACTION_SPCT_TPC_RPRT = 3,
|
||||
WLAN_ACTION_SPCT_CHL_SWITCH = 4,
|
||||
WLAN_ACTION_SPCT_EXT_CHL_SWITCH = 5,
|
||||
};
|
||||
|
||||
/* BACK action code */
|
||||
enum ieee80211_back_actioncode {
|
||||
WLAN_ACTION_ADDBA_REQ = 0,
|
||||
WLAN_ACTION_ADDBA_RESP = 1,
|
||||
WLAN_ACTION_DELBA = 2,
|
||||
};
|
||||
|
||||
/* HT features action code */
|
||||
enum ieee80211_ht_actioncode {
|
||||
WLAN_ACTION_NOTIFY_CH_WIDTH = 0,
|
||||
WLAN_ACTION_SM_PS = 1,
|
||||
WLAN_ACTION_PSPM = 2,
|
||||
WLAN_ACTION_PCO_PHASE = 3,
|
||||
WLAN_ACTION_MIMO_CSI_MX = 4,
|
||||
WLAN_ACTION_MIMO_NONCP_BF = 5,
|
||||
WLAN_ACTION_MIMP_CP_BF = 6,
|
||||
WLAN_ACTION_ASEL_INDICATES_FB = 7,
|
||||
WLAN_ACTION_HI_INFO_EXCHG = 8,
|
||||
};
|
||||
|
||||
/* BACK (block-ack) parties */
|
||||
enum ieee80211_back_parties {
|
||||
WLAN_BACK_RECIPIENT = 0,
|
||||
WLAN_BACK_INITIATOR = 1,
|
||||
WLAN_BACK_TIMER = 2,
|
||||
};
|
||||
|
||||
struct ieee80211_mgmt {
|
||||
u16 frame_control;
|
||||
u16 duration;
|
||||
u8 da[6];
|
||||
u8 sa[6];
|
||||
u8 bssid[6];
|
||||
u16 seq_ctrl;
|
||||
union {
|
||||
struct {
|
||||
u16 auth_alg;
|
||||
u16 auth_transaction;
|
||||
u16 status_code;
|
||||
/* possibly followed by Challenge text */
|
||||
u8 variable[0];
|
||||
} __packed auth;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __packed deauth;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __packed assoc_req;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 status_code;
|
||||
u16 aid;
|
||||
/* followed by Supported rates */
|
||||
u8 variable[0];
|
||||
} __packed assoc_resp, reassoc_resp;
|
||||
struct {
|
||||
u16 capab_info;
|
||||
u16 listen_interval;
|
||||
u8 current_ap[6];
|
||||
/* followed by SSID and Supported rates */
|
||||
u8 variable[0];
|
||||
} __packed reassoc_req;
|
||||
struct {
|
||||
u16 reason_code;
|
||||
} __packed disassoc;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params, TIM */
|
||||
u8 variable[0];
|
||||
} __packed beacon;
|
||||
struct {
|
||||
/* only variable items: SSID, Supported rates */
|
||||
u8 variable[0];
|
||||
} __packed probe_req;
|
||||
struct {
|
||||
__le64 timestamp;
|
||||
u16 beacon_int;
|
||||
u16 capab_info;
|
||||
/* followed by some of SSID, Supported rates,
|
||||
* FH Params, DS Params, CF Params, IBSS Params */
|
||||
u8 variable[0];
|
||||
} __packed probe_resp;
|
||||
struct {
|
||||
u8 category;
|
||||
union {
|
||||
struct {
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u8 status_code;
|
||||
u8 variable[0];
|
||||
} __packed wme_action;
|
||||
struct {
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
u16 start_seq_num;
|
||||
} __packed addba_req;
|
||||
struct {
|
||||
u8 action_code;
|
||||
u8 dialog_token;
|
||||
u16 status;
|
||||
u16 capab;
|
||||
u16 timeout;
|
||||
} __packed addba_resp;
|
||||
struct {
|
||||
u8 action_code;
|
||||
u16 params;
|
||||
u16 reason_code;
|
||||
} __packed delba;
|
||||
structi {
|
||||
u8 action_code;
|
||||
/* capab_info for open and confirm,
|
||||
* reason for close
|
||||
*/
|
||||
u16 aux;
|
||||
/* Followed in plink_confirm by status
|
||||
* code, AID and supported rates,
|
||||
* and directly by supported rates in
|
||||
* plink_open and plink_close
|
||||
*/
|
||||
u8 variable[0];
|
||||
} __packed plink_action;
|
||||
struct{
|
||||
u8 action_code;
|
||||
u8 variable[0];
|
||||
} __packed mesh_action;
|
||||
} __packed u;
|
||||
} __packed action;
|
||||
} __packed u;
|
||||
} __packed;
|
||||
|
||||
/* mgmt header + 1 byte category code */
|
||||
#define IEEE80211_MIN_ACTION_SIZE \
|
||||
FIELD_OFFSET(struct ieee80211_mgmt, u.action.u)
|
||||
|
||||
#endif
|
@ -4,64 +4,30 @@
|
||||
#ifndef __HALDMOUTSRC_H__
|
||||
#define __HALDMOUTSRC_H__
|
||||
|
||||
/* Add for AP/ADSLpseudo DM structuer requirement. */
|
||||
/* We need to remove to other position??? */
|
||||
struct rtl8192cd_priv {
|
||||
u8 temp;
|
||||
};
|
||||
|
||||
struct rtw_dig {
|
||||
u8 Dig_Enable_Flag;
|
||||
u8 Dig_Ext_Port_Stage;
|
||||
|
||||
int RssiLowThresh;
|
||||
int RssiHighThresh;
|
||||
|
||||
u32 FALowThresh;
|
||||
u32 FAHighThresh;
|
||||
|
||||
u8 CurSTAConnectState;
|
||||
u8 PreSTAConnectState;
|
||||
u8 CurMultiSTAConnectState;
|
||||
|
||||
u8 PreIGValue;
|
||||
u8 CurIGValue;
|
||||
u8 BackupIGValue;
|
||||
|
||||
s8 BackoffVal;
|
||||
s8 BackoffVal_range_max;
|
||||
s8 BackoffVal_range_min;
|
||||
u8 rx_gain_range_max;
|
||||
u8 rx_gain_range_min;
|
||||
u8 Rssi_val_min;
|
||||
|
||||
u8 PreCCK_CCAThres;
|
||||
u8 CurCCK_CCAThres;
|
||||
u8 PreCCKPDState;
|
||||
u8 CurCCKPDState;
|
||||
|
||||
u8 LargeFAHit;
|
||||
u8 ForbiddenIGI;
|
||||
u32 Recover_cnt;
|
||||
|
||||
u8 DIG_Dynamic_MIN_0;
|
||||
u8 DIG_Dynamic_MIN_1;
|
||||
bool bMediaConnect_0;
|
||||
bool bMediaConnect_1;
|
||||
|
||||
u32 AntDiv_RSSI_max;
|
||||
u32 RSSI_max;
|
||||
};
|
||||
|
||||
struct rtl_ps {
|
||||
u8 pre_cca_state;
|
||||
u8 cur_cca_state;
|
||||
|
||||
u8 pre_rf_state;
|
||||
u8 cur_rf_state;
|
||||
|
||||
int rssi_val_min;
|
||||
|
||||
u8 initialize;
|
||||
u32 reg_874;
|
||||
u32 reg_c70;
|
||||
@ -87,59 +53,11 @@ struct false_alarm_stats {
|
||||
u32 Cnt_BW_LSC; /* Gary */
|
||||
};
|
||||
|
||||
struct dyn_primary_cca {
|
||||
u8 pri_cca_flag;
|
||||
u8 intf_flag;
|
||||
u8 intf_type;
|
||||
u8 dup_rts_flag;
|
||||
u8 monitor_flag;
|
||||
};
|
||||
|
||||
struct rx_hpc {
|
||||
u8 RXHP_flag;
|
||||
u8 PSD_func_trigger;
|
||||
u8 PSD_bitmap_RXHP[80];
|
||||
u8 Pre_IGI;
|
||||
u8 Cur_IGI;
|
||||
u8 Pre_pw_th;
|
||||
u8 Cur_pw_th;
|
||||
bool First_time_enter;
|
||||
bool RXHP_enable;
|
||||
u8 TP_Mode;
|
||||
struct timer_list PSDTimer;
|
||||
};
|
||||
|
||||
#define ODM_ASSOCIATE_ENTRY_NUM 32 /* Max size of AsocEntry[]. */
|
||||
|
||||
struct sw_ant_switch {
|
||||
u8 try_flag;
|
||||
s32 PreRSSI;
|
||||
u8 CurAntenna;
|
||||
u8 PreAntenna;
|
||||
u8 RSSI_Trying;
|
||||
u8 TestMode;
|
||||
u8 bTriggerAntennaSwitch;
|
||||
u8 SelectAntennaMap;
|
||||
u8 RSSI_target;
|
||||
|
||||
/* Before link Antenna Switch check */
|
||||
u8 SWAS_NoLink_State;
|
||||
u32 SWAS_NoLink_BK_Reg860;
|
||||
|
||||
s32 RSSI_sum_A;
|
||||
s32 RSSI_sum_B;
|
||||
s32 RSSI_cnt_A;
|
||||
s32 RSSI_cnt_B;
|
||||
u64 lastTxOkCnt;
|
||||
u64 lastRxOkCnt;
|
||||
u64 TXByteCnt_A;
|
||||
u64 TXByteCnt_B;
|
||||
u64 RXByteCnt_A;
|
||||
u64 RXByteCnt_B;
|
||||
u8 TrafficLoad;
|
||||
struct timer_list SwAntennaSwitchTimer;
|
||||
u8 TxAnt[ODM_ASSOCIATE_ENTRY_NUM];
|
||||
u8 TargetSTA;
|
||||
u8 SWAS_NoLink_State; /* Before link Antenna Switch check */
|
||||
u8 RxIdleAnt;
|
||||
};
|
||||
|
||||
@ -182,10 +100,6 @@ struct odm_per_pkt_info {
|
||||
bool bPacketBeacon;
|
||||
};
|
||||
|
||||
struct odm_mac_status_info {
|
||||
u8 test;
|
||||
};
|
||||
|
||||
enum odm_ability {
|
||||
/* BB Team */
|
||||
ODM_DIG = 0x00000001,
|
||||
@ -202,22 +116,6 @@ enum odm_ability {
|
||||
ODM_PSD2AFH = 0x00000800
|
||||
};
|
||||
|
||||
/* 2011/20/20 MH For MP driver RT_WLAN_STA = struct sta_info */
|
||||
/* Please declare below ODM relative info in your STA info structure. */
|
||||
|
||||
struct odm_sta_info {
|
||||
/* Driver Write */
|
||||
bool bUsed; /* record the sta status link or not? */
|
||||
u8 IOTPeer; /* Enum value. HT_IOT_PEER_E */
|
||||
|
||||
/* ODM Write */
|
||||
/* 1 PHY_STATUS_INFO */
|
||||
u8 RSSI_Path[4]; /* */
|
||||
u8 RSSI_Ave;
|
||||
u8 RXEVM[4];
|
||||
u8 RXSNR[4];
|
||||
};
|
||||
|
||||
/* 2011/10/20 MH Define Common info enum for all team. */
|
||||
|
||||
enum odm_common_info_def {
|
||||
@ -230,22 +128,16 @@ enum odm_common_info_def {
|
||||
|
||||
/* Dynamic value: */
|
||||
/* POINTER REFERENCE----------- */
|
||||
ODM_CMNINFO_TX_UNI,
|
||||
ODM_CMNINFO_RX_UNI,
|
||||
ODM_CMNINFO_WM_MODE, /* ODM_WIRELESS_MODE_E */
|
||||
ODM_CMNINFO_SEC_CHNL_OFFSET, /* ODM_SEC_CHNL_OFFSET_E */
|
||||
ODM_CMNINFO_SEC_MODE, /* ODM_SECURITY_E */
|
||||
ODM_CMNINFO_BW, /* ODM_BW_E */
|
||||
ODM_CMNINFO_CHNL,
|
||||
|
||||
ODM_CMNINFO_SCAN,
|
||||
ODM_CMNINFO_POWER_SAVING,
|
||||
ODM_CMNINFO_NET_CLOSED,
|
||||
/* POINTER REFERENCE----------- */
|
||||
|
||||
/* CALL BY VALUE------------- */
|
||||
ODM_CMNINFO_WIFI_DIRECT,
|
||||
ODM_CMNINFO_WIFI_DISPLAY,
|
||||
ODM_CMNINFO_LINK,
|
||||
ODM_CMNINFO_RSSI_MIN,
|
||||
ODM_CMNINFO_RF_ANTENNA_TYPE, /* u8 */
|
||||
@ -256,27 +148,17 @@ enum odm_common_info_def {
|
||||
|
||||
enum odm_ability_def {
|
||||
/* BB ODM section BIT 0-15 */
|
||||
ODM_BB_DIG = BIT(0),
|
||||
ODM_BB_RA_MASK = BIT(1),
|
||||
ODM_BB_DYNAMIC_TXPWR = BIT(2),
|
||||
ODM_BB_FA_CNT = BIT(3),
|
||||
ODM_BB_RSSI_MONITOR = BIT(4),
|
||||
ODM_BB_CCK_PD = BIT(5),
|
||||
ODM_BB_ANT_DIV = BIT(6),
|
||||
ODM_BB_PWR_SAVE = BIT(7),
|
||||
ODM_BB_PWR_TRA = BIT(8),
|
||||
ODM_BB_RATE_ADAPTIVE = BIT(9),
|
||||
ODM_BB_PATH_DIV = BIT(10),
|
||||
ODM_BB_PSD = BIT(11),
|
||||
ODM_BB_RXHP = BIT(12),
|
||||
|
||||
/* MAC DM section BIT 16-23 */
|
||||
ODM_MAC_EDCA_TURBO = BIT(16),
|
||||
ODM_MAC_EARLY_MODE = BIT(17),
|
||||
|
||||
/* RF ODM section BIT 24-31 */
|
||||
ODM_RF_TX_PWR_TRACK = BIT(24),
|
||||
ODM_RF_RX_GAIN_TRACK = BIT(25),
|
||||
ODM_RF_CALIBRATION = BIT(26),
|
||||
};
|
||||
|
||||
@ -424,15 +306,9 @@ struct odm_rf_cal {
|
||||
/* ODM Dynamic common info value definition */
|
||||
|
||||
struct fast_ant_train {
|
||||
u8 Bssid[6];
|
||||
u8 antsel_rx_keep_0;
|
||||
u8 antsel_rx_keep_1;
|
||||
u8 antsel_rx_keep_2;
|
||||
u32 antSumRSSI[7];
|
||||
u32 antRSSIcnt[7];
|
||||
u32 antAveRSSI[7];
|
||||
u8 FAT_State;
|
||||
u32 TrainIdx;
|
||||
u8 antsel_a[ODM_ASSOCIATE_ENTRY_NUM];
|
||||
u8 antsel_b[ODM_ASSOCIATE_ENTRY_NUM];
|
||||
u8 antsel_c[ODM_ASSOCIATE_ENTRY_NUM];
|
||||
@ -444,11 +320,6 @@ struct fast_ant_train {
|
||||
bool bBecomeLinked;
|
||||
};
|
||||
|
||||
enum fat_state {
|
||||
FAT_NORMAL_STATE = 0,
|
||||
FAT_TRAINING_STATE = 1,
|
||||
};
|
||||
|
||||
enum ant_div_type {
|
||||
NO_ANTDIV = 0xFF,
|
||||
CG_TRX_HW_ANTDIV = 0x01,
|
||||
@ -459,13 +330,7 @@ enum ant_div_type {
|
||||
|
||||
/* Copy from SD4 defined structure. We use to support PHY DM integration. */
|
||||
struct odm_dm_struct {
|
||||
/* Add for different team use temporarily */
|
||||
struct adapter *Adapter; /* For CE/NIC team */
|
||||
struct rtl8192cd_priv *priv; /* For AP/ADSL team */
|
||||
/* WHen you use above pointers, they must be initialized. */
|
||||
bool odm_ready;
|
||||
|
||||
struct rtl8192cd_priv *fake_priv;
|
||||
|
||||
/* ODM HANDLE, DRIVER NEEDS NOT TO HOOK------ */
|
||||
bool bCckHighPower;
|
||||
@ -485,55 +350,25 @@ struct odm_dm_struct {
|
||||
|
||||
/* Dynamic Value */
|
||||
/* POINTER REFERENCE----------- */
|
||||
|
||||
u8 u8_temp;
|
||||
bool bool_temp;
|
||||
struct adapter *adapter_temp;
|
||||
|
||||
/* TX Unicast byte count */
|
||||
u64 *pNumTxBytesUnicast;
|
||||
/* RX Unicast byte count */
|
||||
u64 *pNumRxBytesUnicast;
|
||||
/* Wireless mode B/G/A/N = BIT(0)/BIT(1)/BIT(2)/BIT(3) */
|
||||
u8 *pWirelessMode; /* ODM_WIRELESS_MODE_E */
|
||||
/* Secondary channel offset don't_care/below/above = 0/1/2 */
|
||||
u8 *pSecChOffset;
|
||||
/* Security mode Open/WEP/AES/TKIP = 0/1/2/3 */
|
||||
u8 *pSecurity;
|
||||
/* BW info 20M/40M/80M = 0/1/2 */
|
||||
u8 *pBandWidth;
|
||||
/* Central channel location Ch1/Ch2/.... */
|
||||
u8 *pChannel; /* central channel number */
|
||||
/* Common info for 92D DMSP */
|
||||
|
||||
bool *pbGetValueFromOtherMac;
|
||||
struct adapter **pBuddyAdapter;
|
||||
bool *pbMasterOfDMSP; /* MAC0: master, MAC1: slave */
|
||||
/* Common info for Status */
|
||||
bool *pbScanInProcess;
|
||||
bool *pbPowerSaving;
|
||||
/* CCA Path 2-path/path-A/path-B = 0/1/2; using ODM_CCA_PATH_E. */
|
||||
u8 *pOnePathCCA;
|
||||
/* pMgntInfo->AntennaTest */
|
||||
u8 *pAntennaTest;
|
||||
bool *pbNet_closed;
|
||||
/* POINTER REFERENCE----------- */
|
||||
/* */
|
||||
/* CALL BY VALUE------------- */
|
||||
bool bWIFI_Direct;
|
||||
bool bWIFI_Display;
|
||||
bool bLinked;
|
||||
u8 RSSI_Min;
|
||||
u8 InterfaceIndex; /* Add for 92D dual MAC: 0--Mac0 1--Mac1 */
|
||||
bool bIsMPChip;
|
||||
bool bOneEntryOnly;
|
||||
/* Common info for BTDM */
|
||||
bool bBtDisabled; /* BT is disabled */
|
||||
bool bBtHsOperation; /* BT HS mode is under progress */
|
||||
u8 btHsDigVal; /* use BT rssi to decide the DIG value */
|
||||
bool bBtDisableEdcaTurbo;/* Under some condition, don't enable the
|
||||
* EDCA Turbo */
|
||||
bool bBtBusy; /* BT is busy. */
|
||||
/* CALL BY VALUE------------- */
|
||||
|
||||
/* 2 Define STA info. */
|
||||
@ -549,38 +384,16 @@ struct odm_dm_struct {
|
||||
/* Latest packet phy info (ODM write) */
|
||||
struct odm_phy_dbg_info PhyDbgInfo;
|
||||
|
||||
/* Latest packet phy info (ODM write) */
|
||||
struct odm_mac_status_info *pMacInfo;
|
||||
|
||||
/* Different Team independt structure?? */
|
||||
|
||||
/* ODM Structure */
|
||||
struct fast_ant_train DM_FatTable;
|
||||
struct rtw_dig DM_DigTable;
|
||||
struct rtl_ps DM_PSTable;
|
||||
struct dyn_primary_cca DM_PriCCA;
|
||||
struct rx_hpc DM_RXHP_Table;
|
||||
struct false_alarm_stats FalseAlmCnt;
|
||||
struct false_alarm_stats FlaseAlmCntBuddyAdapter;
|
||||
struct sw_ant_switch DM_SWAT_Table;
|
||||
bool RSSI_test;
|
||||
|
||||
struct edca_turbo DM_EDCA_Table;
|
||||
u32 WMMEDCA_BE;
|
||||
/* Copy from SD4 structure */
|
||||
/* */
|
||||
/* ================================================== */
|
||||
/* */
|
||||
|
||||
bool *pbDriverStopped;
|
||||
bool *pbDriverIsGoingToPnpSetPowerSleep;
|
||||
bool *pinit_adpt_in_progress;
|
||||
|
||||
/* PSD */
|
||||
bool bUserAssignLevel;
|
||||
struct timer_list PSDTimer;
|
||||
u8 RSSI_BT; /* come from BT */
|
||||
bool bPSDinProcess;
|
||||
bool bDMInitialGainEnable;
|
||||
|
||||
struct odm_rate_adapt RateAdaptive;
|
||||
@ -596,14 +409,7 @@ struct odm_dm_struct {
|
||||
u8 BbSwingIdxCckCurrent;
|
||||
u8 BbSwingIdxCckBase;
|
||||
bool BbSwingFlagCck;
|
||||
/* ODM system resource. */
|
||||
|
||||
/* ODM relative time. */
|
||||
struct timer_list PathDivSwitchTimer;
|
||||
/* 2011.09.27 add for Path Diversity */
|
||||
struct timer_list CCKPathDiversityTimer;
|
||||
struct timer_list FastAntTrainingTimer;
|
||||
}; /* DM_Dynamic_Mechanism_Structure */
|
||||
};
|
||||
|
||||
enum odm_bb_config_type {
|
||||
CONFIG_BB_PHY_REG,
|
||||
@ -612,12 +418,6 @@ enum odm_bb_config_type {
|
||||
CONFIG_BB_PHY_REG_PG,
|
||||
};
|
||||
|
||||
#define DM_DIG_THRESH_HIGH 40
|
||||
#define DM_DIG_THRESH_LOW 35
|
||||
|
||||
#define DM_false_ALARM_THRESH_LOW 400
|
||||
#define DM_false_ALARM_THRESH_HIGH 1000
|
||||
|
||||
#define DM_DIG_MAX_NIC 0x4e
|
||||
#define DM_DIG_MIN_NIC 0x1e /* 0x22/0x1c */
|
||||
|
||||
@ -629,10 +429,6 @@ enum odm_bb_config_type {
|
||||
#define DM_DIG_FA_TH1 0x300/* 0x100 */
|
||||
#define DM_DIG_FA_TH2 0x400/* 0x200 */
|
||||
|
||||
#define DM_DIG_BACKOFF_MAX 12
|
||||
#define DM_DIG_BACKOFF_MIN -4
|
||||
#define DM_DIG_BACKOFF_DEFAULT 10
|
||||
|
||||
/* 3=========================================================== */
|
||||
/* 3 Rate Adaptive */
|
||||
/* 3=========================================================== */
|
||||
@ -645,12 +441,6 @@ enum odm_bb_config_type {
|
||||
/* 3 BB Power Save */
|
||||
/* 3=========================================================== */
|
||||
|
||||
enum dm_1r_cca {
|
||||
CCA_1R = 0,
|
||||
CCA_2R = 1,
|
||||
CCA_MAX = 2,
|
||||
};
|
||||
|
||||
enum dm_rf {
|
||||
RF_Save = 0,
|
||||
RF_Normal = 1,
|
||||
@ -680,8 +470,6 @@ extern u8 CCKSwingTable_Ch14 [CCK_TABLE_SIZE][8];
|
||||
void ODM_Write_DIG(struct odm_dm_struct *pDM_Odm, u8 CurrentIGI);
|
||||
void ODM_Write_CCK_CCA_Thres(struct odm_dm_struct *pDM_Odm, u8 CurCCK_CCAThres);
|
||||
|
||||
void ODM_SetAntenna(struct odm_dm_struct *pDM_Odm, u8 Antenna);
|
||||
|
||||
void ODM_RF_Saving(struct odm_dm_struct *pDM_Odm, u8 bForceInNormal);
|
||||
|
||||
void ODM_TXPowerTrackingCheck(struct odm_dm_struct *pDM_Odm);
|
||||
|
@ -25,10 +25,4 @@ void ODM_AntselStatistics_88E(struct odm_dm_struct *pDM_Odm, u8 antsel_tr_mux,
|
||||
|
||||
void odm_FastAntTraining(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
void odm_FastAntTrainingCallback(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
void odm_FastAntTrainingWorkItemCallback(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
void odm_PrimaryCCA_Init(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
#endif
|
||||
|
@ -4,9 +4,6 @@
|
||||
#ifndef __INC_ODM_REGCONFIG_H_8188E
|
||||
#define __INC_ODM_REGCONFIG_H_8188E
|
||||
|
||||
void odm_ConfigRFReg_8188E(struct odm_dm_struct *pDM_Odm, u32 Addr, u32 Data,
|
||||
enum rf_radio_path RF_PATH, u32 RegAddr);
|
||||
|
||||
void odm_ConfigRF_RadioA_8188E(struct odm_dm_struct *pDM_Odm,
|
||||
u32 Addr, u32 Data);
|
||||
|
||||
|
@ -1,59 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __ODM_INTERFACE_H__
|
||||
#define __ODM_INTERFACE_H__
|
||||
|
||||
enum odm_h2c_cmd {
|
||||
ODM_H2C_RSSI_REPORT = 0,
|
||||
ODM_H2C_PSD_RESULT= 1,
|
||||
ODM_H2C_PathDiv = 2,
|
||||
ODM_MAX_H2CCMD
|
||||
};
|
||||
|
||||
/* 2012/02/17 MH For non-MP compile pass only. Linux does not support workitem. */
|
||||
/* Suggest HW team to use thread instead of workitem. Windows also support the feature. */
|
||||
typedef void (*RT_WORKITEM_CALL_BACK)(void *pContext);
|
||||
|
||||
/* =========== Extern Variable ??? It should be forbidden. */
|
||||
|
||||
/* =========== EXtern Function Prototype */
|
||||
|
||||
u8 ODM_Read1Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr);
|
||||
|
||||
u32 ODM_Read4Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr);
|
||||
|
||||
void ODM_Write1Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u8 Data);
|
||||
|
||||
void ODM_Write2Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u16 Data);
|
||||
|
||||
void ODM_Write4Byte(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 Data);
|
||||
|
||||
void ODM_SetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr,
|
||||
u32 BitMask, u32 Data);
|
||||
|
||||
u32 ODM_GetMACReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask);
|
||||
|
||||
void ODM_SetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr,
|
||||
u32 BitMask, u32 Data);
|
||||
|
||||
u32 ODM_GetBBReg(struct odm_dm_struct *pDM_Odm, u32 RegAddr, u32 BitMask);
|
||||
|
||||
void ODM_SetRFReg(struct odm_dm_struct *pDM_Odm, enum rf_radio_path eRFPath,
|
||||
u32 RegAddr, u32 BitMask, u32 Data);
|
||||
|
||||
u32 ODM_GetRFReg(struct odm_dm_struct *pDM_Odm, enum rf_radio_path eRFPath,
|
||||
u32 RegAddr, u32 BitMask);
|
||||
|
||||
/* Memory Relative Function. */
|
||||
s32 ODM_CompareMemory(struct odm_dm_struct *pDM_Odm, void *pBuf1, void *pBuf2,
|
||||
u32 length);
|
||||
|
||||
/* ODM Timer relative API. */
|
||||
void ODM_delay_ms(u32 ms);
|
||||
|
||||
void ODM_delay_us(u32 us);
|
||||
|
||||
void ODM_sleep_ms(u32 ms);
|
||||
|
||||
#endif /* __ODM_INTERFACE_H__ */
|
@ -1,54 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. i*/
|
||||
|
||||
#ifndef __ODM_PRECOMP_H__
|
||||
#define __ODM_PRECOMP_H__
|
||||
|
||||
#include "odm_types.h"
|
||||
|
||||
#define TEST_FALG___ 1
|
||||
|
||||
/* 2 Config Flags and Structs - defined by each ODM Type */
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
#include "hal_intf.h"
|
||||
|
||||
/* 2 OutSrc Header Files */
|
||||
|
||||
#include "odm.h"
|
||||
#include "odm_HWConfig.h"
|
||||
#include "odm_RegDefine11N.h"
|
||||
|
||||
#include "HalPhyRf_8188e.h"/* for IQK,LCK,Power-tracking */
|
||||
#include "Hal8188ERateAdaptive.h"/* for RA,Power training */
|
||||
#include "rtl8188e_hal.h"
|
||||
|
||||
#include "odm_interface.h"
|
||||
|
||||
#include "HalHWImg8188E_MAC.h"
|
||||
#include "HalHWImg8188E_RF.h"
|
||||
#include "HalHWImg8188E_BB.h"
|
||||
|
||||
#include "odm_RegConfig8188E.h"
|
||||
#include "odm_RTL8188E.h"
|
||||
|
||||
void odm_DIGInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_RateAdaptiveMaskInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_DynamicBBPowerSavingInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_TXPowerTrackingInit(struct odm_dm_struct *pDM_Odm);
|
||||
void ODM_EdcaTurboInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_SwAntDivInit_NIC(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_CommonInfoSelfUpdate(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_FalseAlarmCounterStatistics(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_DIG(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_CCKPacketDetectionThresh(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_EdcaTurboCheck(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_CommonInfoSelfInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_RSSIMonitorCheck(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_RefreshRateAdaptiveMask(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_TXPowerTrackingThermalMeterInit(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_InitHybridAntDiv(struct odm_dm_struct *pDM_Odm);
|
||||
void odm_HwAntDiv(struct odm_dm_struct *pDM_Odm);
|
||||
|
||||
#endif /* __ODM_PRECOMP_H__ */
|
@ -74,38 +74,6 @@ static inline void _cancel_timer(struct timer_list *ptimer,u8 *bcancelled)
|
||||
#define RTW_TIMER_HDL_NAME(name) rtw_##name##_timer_hdl
|
||||
#define RTW_DECLARE_TIMER_HDL(name) void RTW_TIMER_HDL_NAME(name)(RTW_TIMER_HDL_ARGS)
|
||||
|
||||
static inline void _init_workitem(struct work_struct *pwork, void *pfunc, void * cntx)
|
||||
{
|
||||
INIT_WORK(pwork, pfunc);
|
||||
}
|
||||
|
||||
static inline void _set_workitem(struct work_struct *pwork)
|
||||
{
|
||||
schedule_work(pwork);
|
||||
}
|
||||
|
||||
static inline void _cancel_workitem_sync(struct work_struct *pwork)
|
||||
{
|
||||
cancel_work_sync(pwork);
|
||||
}
|
||||
/* */
|
||||
/* Global Mutex: can only be used at PASSIVE level. */
|
||||
/* */
|
||||
|
||||
#define ACQUIRE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
while (atomic_inc_return((atomic_t *)&(_MutexCounter)) != 1)\
|
||||
{ \
|
||||
atomic_dec((atomic_t *)&(_MutexCounter)); \
|
||||
msleep(10); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define RELEASE_GLOBAL_MUTEX(_MutexCounter) \
|
||||
{ \
|
||||
atomic_dec((atomic_t *)&(_MutexCounter)); \
|
||||
}
|
||||
|
||||
static inline int rtw_netif_queue_stopped(struct net_device *pnetdev)
|
||||
{
|
||||
return netif_tx_queue_stopped(netdev_get_tx_queue(pnetdev, 0)) &&
|
||||
|
@ -8,12 +8,7 @@ enum{
|
||||
UP_LINK,
|
||||
DOWN_LINK,
|
||||
};
|
||||
/* duplicate code,will move to ODM ######### */
|
||||
#define IQK_MAC_REG_NUM 4
|
||||
#define IQK_ADDA_REG_NUM 16
|
||||
#define IQK_BB_REG_NUM 9
|
||||
#define HP_THERMAL_NUM 8
|
||||
/* duplicate code,will move to ODM ######### */
|
||||
|
||||
struct dm_priv {
|
||||
u32 InitODMFlag;
|
||||
|
||||
|
@ -13,11 +13,18 @@
|
||||
#include "rtl8188e_recv.h"
|
||||
#include "rtl8188e_xmit.h"
|
||||
#include "rtl8188e_cmd.h"
|
||||
#include "Hal8188EPwrSeq.h"
|
||||
#include "rtl8188e_sreset.h"
|
||||
#include "rtw_efuse.h"
|
||||
|
||||
#include "odm_precomp.h"
|
||||
#include "odm_types.h"
|
||||
#include "odm.h"
|
||||
#include "odm_HWConfig.h"
|
||||
#include "odm_RegDefine11N.h"
|
||||
#include "HalPhyRf_8188e.h"
|
||||
#include "Hal8188ERateAdaptive.h"
|
||||
#include "HalHWImg8188E_MAC.h"
|
||||
#include "HalHWImg8188E_RF.h"
|
||||
#include "HalHWImg8188E_BB.h"
|
||||
#include "odm_RegConfig8188E.h"
|
||||
#include "odm_RTL8188E.h"
|
||||
|
||||
/* RTL8188E Power Configuration CMDs for USB/SDIO interfaces */
|
||||
#define Rtl8188E_NIC_PWR_ON_FLOW rtl8188E_power_on_flow
|
||||
@ -168,42 +175,15 @@ struct hal_data_8188e {
|
||||
|
||||
u16 BasicRateSet;
|
||||
|
||||
/* rf_ctrl */
|
||||
u8 rf_chip;
|
||||
u8 rf_type;
|
||||
|
||||
u8 BoardType;
|
||||
|
||||
/* EEPROM setting. */
|
||||
u16 EEPROMVID;
|
||||
u16 EEPROMPID;
|
||||
u16 EEPROMSVID;
|
||||
u16 EEPROMSDID;
|
||||
u8 EEPROMCustomerID;
|
||||
u8 EEPROMSubCustomerID;
|
||||
u8 EEPROMVersion;
|
||||
u8 EEPROMRegulatory;
|
||||
|
||||
u8 bTXPowerDataReadFromEEPORM;
|
||||
u8 EEPROMThermalMeter;
|
||||
u8 bAPKThermalMeterIgnore;
|
||||
|
||||
bool EepromOrEfuse;
|
||||
struct efuse_hal EfuseHal;
|
||||
|
||||
u8 Index24G_CCK_Base[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
u8 Index24G_BW40_Base[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
u8 Index24G_CCK_Base[CHANNEL_MAX_NUMBER];
|
||||
u8 Index24G_BW40_Base[CHANNEL_MAX_NUMBER];
|
||||
/* If only one tx, only BW20 and OFDM are used. */
|
||||
s8 CCK_24G_Diff[RF_PATH_MAX][MAX_TX_COUNT];
|
||||
s8 OFDM_24G_Diff[RF_PATH_MAX][MAX_TX_COUNT];
|
||||
s8 BW20_24G_Diff[RF_PATH_MAX][MAX_TX_COUNT];
|
||||
s8 BW40_24G_Diff[RF_PATH_MAX][MAX_TX_COUNT];
|
||||
s8 OFDM_24G_Diff[MAX_TX_COUNT];
|
||||
s8 BW20_24G_Diff[MAX_TX_COUNT];
|
||||
|
||||
u8 TxPwrLevelCck[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
/* For HT 40MHZ pwr */
|
||||
u8 TxPwrLevelHT40_1S[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
/* For HT 40MHZ pwr */
|
||||
u8 TxPwrLevelHT40_2S[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
/* HT 20<->40 Pwr diff */
|
||||
u8 TxPwrHt20Diff[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
/* For HT<->legacy pwr diff */
|
||||
@ -212,7 +192,6 @@ struct hal_data_8188e {
|
||||
u8 PwrGroupHT20[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
u8 PwrGroupHT40[RF_PATH_MAX][CHANNEL_MAX_NUMBER];
|
||||
|
||||
u8 LegacyHTTxPowerDiff;/* Legacy to HT rate power diff */
|
||||
/* The current Tx Power Level */
|
||||
u8 CurrentCckTxPwrIdx;
|
||||
u8 CurrentOfdm24GTxPwrIdx;
|
||||
@ -220,32 +199,18 @@ struct hal_data_8188e {
|
||||
u8 CurrentBW4024GTxPwrIdx;
|
||||
|
||||
/* Read/write are allow for following hardware information variables */
|
||||
u8 framesync;
|
||||
u32 framesyncC34;
|
||||
u8 framesyncMonitor;
|
||||
u8 DefaultInitialGain[4];
|
||||
u8 pwrGroupCnt;
|
||||
u32 MCSTxPowerLevelOriginalOffset[MAX_PG_GROUP][16];
|
||||
u32 CCKTxPowerLevelOriginalOffset;
|
||||
|
||||
u8 CrystalCap;
|
||||
u32 AntennaTxPath; /* Antenna path Tx */
|
||||
u32 AntennaRxPath; /* Antenna path Rx */
|
||||
u8 ExternalPA;
|
||||
|
||||
u8 bLedOpenDrain; /* Open-drain support for controlling the LED.*/
|
||||
|
||||
u8 b1x1RecvCombine; /* for 1T1R receive combining */
|
||||
|
||||
u32 AcParam_BE; /* Original parameter for BE, use for EDCA turbo. */
|
||||
|
||||
struct bb_reg_def PHYRegDef[4]; /* Radio A/B/C/D */
|
||||
struct bb_reg_def PHYRegDef[2]; /* Radio A/B */
|
||||
|
||||
u32 RfRegChnlVal[2];
|
||||
|
||||
/* RDG enable */
|
||||
bool bRDGEnable;
|
||||
|
||||
/* for host message to fw */
|
||||
u8 LastHMEBoxNum;
|
||||
|
||||
@ -263,26 +228,10 @@ struct hal_data_8188e {
|
||||
|
||||
u8 bDumpRxPkt;/* for debug */
|
||||
u8 bDumpTxPkt;/* for debug */
|
||||
u8 FwRsvdPageStartOffset; /* 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;
|
||||
|
||||
/* Add for USB aggreation mode dynamic shceme. */
|
||||
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;
|
||||
|
||||
u16 EfuseUsedBytes;
|
||||
|
||||
struct P2P_PS_Offload_t p2p_ps_offload;
|
||||
@ -293,12 +242,8 @@ struct hal_data_8188e {
|
||||
|
||||
u32 UsbBulkOutSize;
|
||||
|
||||
/* Interrupt relatd register information. */
|
||||
u32 IntArray[3];/* HISR0,HISR1,HSISR */
|
||||
u8 C2hArray[16];
|
||||
u8 UsbTxAggMode;
|
||||
u8 UsbTxAggDescNum;
|
||||
u32 MaxUsbRxAggBlock;
|
||||
|
||||
enum usb_rx_agg_mode UsbRxAggMode;
|
||||
u8 UsbRxAggBlockCount; /* USB Block count. Block size is
|
||||
@ -309,9 +254,6 @@ struct hal_data_8188e {
|
||||
u8 UsbRxAggPageTimeout;
|
||||
};
|
||||
|
||||
#define GET_HAL_DATA(__pAdapter) \
|
||||
((struct hal_data_8188e *)((__pAdapter)->HalData))
|
||||
|
||||
/* rtl8188e_hal_init.c */
|
||||
s32 rtl8188e_FirmwareDownload(struct adapter *padapter);
|
||||
void _8051Reset88E(struct adapter *padapter);
|
||||
@ -321,25 +263,18 @@ s32 InitLLTTable(struct adapter *padapter, u8 txpktbuf_bndy);
|
||||
|
||||
/* EFuse */
|
||||
u8 GetEEPROMSize8188E(struct adapter *padapter);
|
||||
void Hal_InitPGData88E(struct adapter *padapter);
|
||||
void Hal_EfuseParseIDCode88E(struct adapter *padapter, u8 *hwinfo);
|
||||
void Hal_ReadTxPowerInfo88E(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
|
||||
void Hal_EfuseParseEEPROMVer88E(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void rtl8188e_EfuseParseChnlPlan(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseCustomerID88E(struct adapter *padapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_ReadAntennaDiversity88E(struct adapter *pAdapter,u8 *PROMContent,
|
||||
bool AutoLoadFail);
|
||||
void Hal_ReadThermalMeter_88E(struct adapter * dapter, u8 *PROMContent,
|
||||
bool AutoloadFail);
|
||||
void Hal_EfuseParseXtal_8188E(struct adapter *pAdapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_EfuseParseBoardType88E(struct adapter *pAdapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
void Hal_ReadPowerSavingMode88E(struct adapter *pAdapter, u8 *hwinfo,
|
||||
bool AutoLoadFail);
|
||||
|
||||
@ -347,6 +282,5 @@ void rtl8188e_read_chip_version(struct adapter *padapter);
|
||||
|
||||
s32 rtl8188e_iol_efuse_patch(struct adapter *padapter);
|
||||
void rtw_cancel_all_timer(struct adapter *padapter);
|
||||
void _ps_open_RF(struct adapter *adapt);
|
||||
|
||||
#endif /* __RTL8188E_HAL_H__ */
|
||||
|
@ -1,16 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef __RTL8188E_LED_H__
|
||||
#define __RTL8188E_LED_H__
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
/* */
|
||||
/* Interface to manipulate LED objects. */
|
||||
/* */
|
||||
void rtl8188eu_InitSwLeds(struct adapter *padapter);
|
||||
void rtl8188eu_DeInitSwLeds(struct adapter *padapter);
|
||||
|
||||
#endif
|
@ -9,8 +9,6 @@
|
||||
#define RECV_BLK_SZ 512
|
||||
#define RECV_BLK_CNT 16
|
||||
#define RECV_BLK_TH RECV_BLK_CNT
|
||||
#define RECV_BULK_IN_ADDR 0x80
|
||||
#define RECV_INT_IN_ADDR 0x81
|
||||
|
||||
#define NR_PREALLOC_RECV_SKB (8)
|
||||
|
||||
@ -39,7 +37,6 @@ enum rx_packet_type {
|
||||
HIS_REPORT,/* USB HISR RPT */
|
||||
};
|
||||
|
||||
#define INTERRUPT_MSG_FORMAT_LEN 60
|
||||
void rtl8188eu_init_recvbuf(struct recv_buf *buf);
|
||||
s32 rtl8188eu_init_recv_priv(struct adapter *padapter);
|
||||
void rtl8188eu_free_recv_priv(struct adapter * padapter);
|
||||
|
@ -475,13 +475,6 @@ Default: 00b.
|
||||
#define MSR_INFRA 0x02
|
||||
#define MSR_AP 0x03
|
||||
|
||||
/* 88EU (MSR) Media Status Register (Offset 0x4C, 8 bits) */
|
||||
#define USB_INTR_CONTENT_C2H_OFFSET 0
|
||||
#define USB_INTR_CONTENT_CPWM1_OFFSET 16
|
||||
#define USB_INTR_CONTENT_CPWM2_OFFSET 20
|
||||
#define USB_INTR_CONTENT_HISR_OFFSET 48
|
||||
#define USB_INTR_CONTENT_HISRE_OFFSET 52
|
||||
|
||||
/* 88E Driver Initialization Offload REG_FDHM0(Offset 0x88, 8 bits) */
|
||||
/* IOL config for REG_FDHM0(Reg0x88) */
|
||||
#define CMD_INIT_LLT BIT(0)
|
||||
@ -1283,53 +1276,15 @@ Current IOREG MAP
|
||||
|
||||
#define EEPROM_RF_BOARD_OPTION_88E 0xC1
|
||||
#define EEPROM_RF_FEATURE_OPTION_88E 0xC2
|
||||
#define EEPROM_RF_BT_SETTING_88E 0xC3
|
||||
#define EEPROM_VERSION_88E 0xC4
|
||||
#define EEPROM_CUSTOMERID_88E 0xC5
|
||||
#define EEPROM_RF_ANTENNA_OPT_88E 0xC9
|
||||
|
||||
/* RTL88EE */
|
||||
#define EEPROM_MAC_ADDR_88EE 0xD0
|
||||
#define EEPROM_VID_88EE 0xD6
|
||||
#define EEPROM_DID_88EE 0xD8
|
||||
#define EEPROM_SVID_88EE 0xDA
|
||||
#define EEPROM_SMID_88EE 0xDC
|
||||
|
||||
/* RTL88EU */
|
||||
#define EEPROM_MAC_ADDR_88EU 0xD7
|
||||
#define EEPROM_VID_88EU 0xD0
|
||||
#define EEPROM_PID_88EU 0xD2
|
||||
#define EEPROM_USB_OPTIONAL_FUNCTION0 0xD4
|
||||
|
||||
/* RTL88ES */
|
||||
#define EEPROM_MAC_ADDR_88ES 0x11A
|
||||
|
||||
/* EEPROM/Efuse Value Type */
|
||||
#define EETYPE_TX_PWR 0x0
|
||||
|
||||
/* Default Value for EEPROM or EFUSE!!! */
|
||||
#define EEPROM_Default_TSSI 0x0
|
||||
#define EEPROM_Default_TxPowerDiff 0x0
|
||||
#define EEPROM_Default_CrystalCap 0x5
|
||||
/* Default: 2X2, RTL8192CE(QFPN68) */
|
||||
#define EEPROM_Default_BoardType 0x02
|
||||
#define EEPROM_Default_TxPower 0x1010
|
||||
#define EEPROM_Default_HT2T_TxPwr 0x10
|
||||
|
||||
#define EEPROM_Default_LegacyHTTxPowerDiff 0x3
|
||||
#define EEPROM_Default_ThermalMeter 0x12
|
||||
|
||||
#define EEPROM_Default_AntTxPowerDiff 0x0
|
||||
#define EEPROM_Default_TxPwDiff_CrystalCap 0x5
|
||||
#define EEPROM_Default_TxPowerLevel 0x2A
|
||||
|
||||
#define EEPROM_Default_HT40_2SDiff 0x0
|
||||
/* HT20<->40 default Tx Power Index Difference */
|
||||
#define EEPROM_Default_HT20_Diff 2
|
||||
#define EEPROM_Default_LegacyHTTxPowerDiff 0x3
|
||||
#define EEPROM_Default_HT40_PwrMaxOffset 0
|
||||
#define EEPROM_Default_HT20_PwrMaxOffset 0
|
||||
|
||||
#define EEPROM_Default_CrystalCap_88E 0x20
|
||||
#define EEPROM_Default_ThermalMeter_88E 0x18
|
||||
|
||||
@ -1339,18 +1294,7 @@ Current IOREG MAP
|
||||
#define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04
|
||||
|
||||
#define EEPROM_DEFAULT_DIFF 0XFE
|
||||
#define EEPROM_DEFAULT_CHANNEL_PLAN 0x7F
|
||||
#define EEPROM_DEFAULT_BOARD_OPTION 0x00
|
||||
#define EEPROM_DEFAULT_FEATURE_OPTION 0x00
|
||||
#define EEPROM_DEFAULT_BT_OPTION 0x10
|
||||
|
||||
/* For debug */
|
||||
#define EEPROM_Default_PID 0x1234
|
||||
#define EEPROM_Default_VID 0x5678
|
||||
#define EEPROM_Default_CustomerID 0xAB
|
||||
#define EEPROM_Default_CustomerID_8188E 0x00
|
||||
#define EEPROM_Default_SubCustomerID 0xCD
|
||||
#define EEPROM_Default_Version 0
|
||||
|
||||
#define EEPROM_CHANNEL_PLAN_FCC 0x0
|
||||
#define EEPROM_CHANNEL_PLAN_IC 0x1
|
||||
@ -1367,11 +1311,6 @@ Current IOREG MAP
|
||||
#define EEPROM_USB_OPTIONAL1 0xE
|
||||
#define EEPROM_CHANNEL_PLAN_BY_HW_MASK 0x80
|
||||
|
||||
#define EEPROM_CID_DEFAULT 0x0
|
||||
#define EEPROM_CID_TOSHIBA 0x4
|
||||
#define EEPROM_CID_CCX 0x10 /* CCX test. */
|
||||
#define EEPROM_CID_QMI 0x0D
|
||||
#define EEPROM_CID_WHQL 0xFE
|
||||
#define RTL_EEPROM_ID 0x8129
|
||||
|
||||
#endif /* __RTL8188E_SPEC_H__ */
|
||||
|
@ -1,13 +0,0 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
|
||||
/* Copyright(c) 2007 - 2011 Realtek Corporation. */
|
||||
|
||||
#ifndef _RTL8188E_SRESET_H_
|
||||
#define _RTL8188E_SRESET_H_
|
||||
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
void rtl8188e_sreset_xmit_status_check(struct adapter *padapter);
|
||||
void rtl8188e_sreset_linked_status_check(struct adapter *padapter);
|
||||
|
||||
#endif
|
@ -42,7 +42,6 @@ struct cmd_priv {
|
||||
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;
|
||||
u8 cmdthd_running;
|
||||
|
@ -54,22 +54,10 @@
|
||||
|
||||
extern u32 GlobalDebugLevel;
|
||||
|
||||
#define DBG_88E_LEVEL(_level, fmt, arg...) \
|
||||
do { \
|
||||
if (_level <= GlobalDebugLevel) \
|
||||
pr_info(DRIVER_PREFIX"INFO " fmt, ##arg); \
|
||||
} while (0)
|
||||
|
||||
#define DBG_88E(...) \
|
||||
do { \
|
||||
if (_drv_err_ <= GlobalDebugLevel) \
|
||||
pr_info(DRIVER_PREFIX __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#define MSG_88E(...) \
|
||||
do { \
|
||||
if (_drv_err_ <= GlobalDebugLevel) \
|
||||
pr_info(DRIVER_PREFIX __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
#endif /* __RTW_DEBUG_H__ */
|
||||
|
@ -7,38 +7,7 @@
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
#define RTL8712_EEPROM_ID 0x8712
|
||||
|
||||
#define HWSET_MAX_SIZE_512 512
|
||||
#define EEPROM_MAX_SIZE HWSET_MAX_SIZE_512
|
||||
|
||||
#define CLOCK_RATE 50 /* 100us */
|
||||
|
||||
/* EEPROM opcodes */
|
||||
#define EEPROM_READ_OPCODE 06
|
||||
#define EEPROM_WRITE_OPCODE 05
|
||||
#define EEPROM_ERASE_OPCODE 07
|
||||
#define EEPROM_EWEN_OPCODE 19 /* Erase/write enable */
|
||||
#define EEPROM_EWDS_OPCODE 16 /* Erase/write disable */
|
||||
|
||||
/* Country codes */
|
||||
#define USA 0x555320
|
||||
#define EUROPE 0x1 /* temp, should be provided later */
|
||||
#define JAPAN 0x2 /* temp, should be provided later */
|
||||
|
||||
#define EEPROM_CID_DEFAULT 0x0
|
||||
#define EEPROM_CID_ALPHA 0x1
|
||||
#define EEPROM_CID_Senao 0x3
|
||||
#define EEPROM_CID_NetCore 0x5
|
||||
#define EEPROM_CID_CAMEO 0X8
|
||||
#define EEPROM_CID_SITECOM 0x9
|
||||
#define EEPROM_CID_COREGA 0xB
|
||||
#define EEPROM_CID_EDIMAX_BELK 0xC
|
||||
#define EEPROM_CID_SERCOMM_BELK 0xE
|
||||
#define EEPROM_CID_CAMEO1 0xF
|
||||
#define EEPROM_CID_WNC_COREGA 0x12
|
||||
#define EEPROM_CID_CLEVO 0x13
|
||||
#define EEPROM_CID_WHQL 0xFE
|
||||
|
||||
struct eeprom_priv {
|
||||
u8 bautoload_fail_flag;
|
||||
|
@ -4,110 +4,10 @@
|
||||
#ifndef __RTW_EFUSE_H__
|
||||
#define __RTW_EFUSE_H__
|
||||
|
||||
#include "osdep_service.h"
|
||||
|
||||
#define EFUSE_ERROE_HANDLE 1
|
||||
|
||||
#define PG_STATE_HEADER 0x01
|
||||
#define PG_STATE_WORD_0 0x02
|
||||
#define PG_STATE_WORD_1 0x04
|
||||
#define PG_STATE_WORD_2 0x08
|
||||
#define PG_STATE_WORD_3 0x10
|
||||
#define PG_STATE_DATA 0x20
|
||||
|
||||
#define PG_SWBYTE_H 0x01
|
||||
#define PG_SWBYTE_L 0x02
|
||||
|
||||
#define PGPKT_DATA_SIZE 8
|
||||
|
||||
#define EFUSE_WIFI 0
|
||||
#define EFUSE_BT 1
|
||||
|
||||
enum _EFUSE_DEF_TYPE {
|
||||
TYPE_EFUSE_MAX_SECTION = 0,
|
||||
TYPE_EFUSE_REAL_CONTENT_LEN = 1,
|
||||
TYPE_AVAILABLE_EFUSE_BYTES_BANK = 2,
|
||||
TYPE_AVAILABLE_EFUSE_BYTES_TOTAL = 3,
|
||||
TYPE_EFUSE_MAP_LEN = 4,
|
||||
TYPE_EFUSE_PROTECT_BYTES_BANK = 5,
|
||||
TYPE_EFUSE_CONTENT_LEN_BANK = 6,
|
||||
};
|
||||
|
||||
/* E-Fuse */
|
||||
#define EFUSE_MAP_SIZE 512
|
||||
#define EFUSE_MAX_SIZE 256
|
||||
/* end of E-Fuse */
|
||||
|
||||
#define EFUSE_MAX_MAP_LEN 512
|
||||
#define EFUSE_MAX_HW_SIZE 512
|
||||
#define EFUSE_MAX_SECTION_BASE 16
|
||||
|
||||
#define EXT_HEADER(header) ((header & 0x1F) == 0x0F)
|
||||
#define ALL_WORDS_DISABLED(wde) ((wde & 0x0F) == 0x0F)
|
||||
#define GET_HDR_OFFSET_2_0(header) ((header & 0xE0) >> 5)
|
||||
|
||||
#define EFUSE_REPEAT_THRESHOLD_ 3
|
||||
|
||||
/* The following is for BT Efuse definition */
|
||||
#define EFUSE_BT_MAX_MAP_LEN 1024
|
||||
#define EFUSE_MAX_BANK 4
|
||||
#define EFUSE_MAX_BT_BANK (EFUSE_MAX_BANK-1)
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
#define EFUSE_MAX_WORD_UNIT 4
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
struct pgpkt {
|
||||
u8 offset;
|
||||
u8 word_en;
|
||||
u8 data[8];
|
||||
u8 word_cnts;
|
||||
};
|
||||
void ReadEFuseByte(struct adapter *adapter, u16 _offset, u8 *pbuf);
|
||||
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
struct efuse_hal {
|
||||
u8 fakeEfuseBank;
|
||||
u32 fakeEfuseUsedBytes;
|
||||
u8 fakeEfuseContent[EFUSE_MAX_HW_SIZE];
|
||||
u8 fakeEfuseInitMap[EFUSE_MAX_MAP_LEN];
|
||||
u8 fakeEfuseModifiedMap[EFUSE_MAX_MAP_LEN];
|
||||
|
||||
u16 BTEfuseUsedBytes;
|
||||
u8 BTEfuseUsedPercentage;
|
||||
u8 BTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 BTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN];
|
||||
u8 BTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN];
|
||||
|
||||
u16 fakeBTEfuseUsedBytes;
|
||||
u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN];
|
||||
u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN];
|
||||
};
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
extern u8 fakeEfuseBank;
|
||||
extern u32 fakeEfuseUsedBytes;
|
||||
extern u8 fakeEfuseContent[];
|
||||
extern u8 fakeEfuseInitMap[];
|
||||
extern u8 fakeEfuseModifiedMap[];
|
||||
|
||||
extern u32 BTEfuseUsedBytes;
|
||||
extern u8 BTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
extern u8 BTEfuseInitMap[];
|
||||
extern u8 BTEfuseModifiedMap[];
|
||||
|
||||
extern u32 fakeBTEfuseUsedBytes;
|
||||
extern u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
extern u8 fakeBTEfuseInitMap[];
|
||||
extern u8 fakeBTEfuseModifiedMap[];
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
u8 Efuse_CalculateWordCnts(u8 word_en);
|
||||
void ReadEFuseByte(struct adapter *adapter, u16 _offset, u8 *pbuf, bool test);
|
||||
u8 efuse_OneByteRead(struct adapter *adapter, u16 addr, u8 *data, bool test);
|
||||
u8 efuse_OneByteWrite(struct adapter *adapter, u16 addr, u8 data, bool test);
|
||||
|
||||
void efuse_WordEnableDataRead(u8 word_en, u8 *sourdata, u8 *targetdata);
|
||||
|
||||
void EFUSE_ShadowMapUpdate(struct adapter *adapter, u8 efusetype, bool test);
|
||||
void EFUSE_ShadowMapUpdate(struct adapter *adapter);
|
||||
|
||||
#endif
|
||||
|
@ -224,7 +224,7 @@ u8 rtw_read8(struct adapter *adapter, u32 addr);
|
||||
u16 rtw_read16(struct adapter *adapter, u32 addr);
|
||||
u32 rtw_read32(struct adapter *adapter, u32 addr);
|
||||
void _rtw_read_mem(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
|
||||
u32 rtw_read_port(struct adapter *adapter, u32 addr, u32 cnt, u8 *pmem);
|
||||
u32 rtw_read_port(struct adapter *adapter, u8 *pmem);
|
||||
void rtw_read_port_cancel(struct adapter *adapter);
|
||||
|
||||
int rtw_write8(struct adapter *adapter, u32 addr, u8 val);
|
||||
|
@ -7,41 +7,7 @@
|
||||
#include "osdep_service.h"
|
||||
#include "drv_types.h"
|
||||
|
||||
#define MSECS(t) (HZ * ((t) / 1000) + (HZ * ((t) % 1000)) / 1000)
|
||||
|
||||
#define LED_BLINK_NORMAL_INTERVAL 100
|
||||
#define LED_BLINK_SLOWLY_INTERVAL 200
|
||||
#define LED_BLINK_LONG_INTERVAL 400
|
||||
|
||||
#define LED_BLINK_NO_LINK_INTERVAL_ALPHA 1000
|
||||
#define LED_BLINK_LINK_INTERVAL_ALPHA 500 /* 500 */
|
||||
#define LED_BLINK_SCAN_INTERVAL_ALPHA 180 /* 150 */
|
||||
#define LED_BLINK_FASTER_INTERVAL_ALPHA 50
|
||||
#define LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA 5000
|
||||
|
||||
#define LED_BLINK_NORMAL_INTERVAL_NETTRONIX 100
|
||||
#define LED_BLINK_SLOWLY_INTERVAL_NETTRONIX 2000
|
||||
|
||||
#define LED_BLINK_SLOWLY_INTERVAL_PORNET 1000
|
||||
#define LED_BLINK_NORMAL_INTERVAL_PORNET 100
|
||||
|
||||
#define LED_BLINK_FAST_INTERVAL_BITLAND 30
|
||||
|
||||
/* 060403, rcnjko: Customized for AzWave. */
|
||||
#define LED_CM2_BLINK_ON_INTERVAL 250
|
||||
#define LED_CM2_BLINK_OFF_INTERVAL 4750
|
||||
|
||||
#define LED_CM8_BLINK_INTERVAL 500 /* for QMI */
|
||||
#define LED_CM8_BLINK_OFF_INTERVAL 3750 /* for QMI */
|
||||
|
||||
/* 080124, lanhsin: Customized for RunTop */
|
||||
#define LED_RunTop_BLINK_INTERVAL 300
|
||||
|
||||
/* 060421, rcnjko: Customized for Sercomm Printer Server case. */
|
||||
#define LED_CM3_BLINK_INTERVAL 1500
|
||||
|
||||
enum LED_CTL_MODE {
|
||||
LED_CTL_POWER_ON = 1,
|
||||
LED_CTL_LINK = 2,
|
||||
LED_CTL_NO_LINK = 3,
|
||||
LED_CTL_TX = 4,
|
||||
@ -51,10 +17,7 @@ enum LED_CTL_MODE {
|
||||
LED_CTL_START_TO_LINK = 8,
|
||||
LED_CTL_START_WPS = 9,
|
||||
LED_CTL_STOP_WPS = 10,
|
||||
LED_CTL_START_WPS_BOTTON = 11, /* added for runtop */
|
||||
LED_CTL_STOP_WPS_FAIL = 12, /* added for ALPHA */
|
||||
LED_CTL_STOP_WPS_FAIL_OVERLAP = 13, /* added for BELKIN */
|
||||
LED_CTL_CONNECTION_NO_TRANSFER = 14,
|
||||
LED_CTL_STOP_WPS_FAIL = 12,
|
||||
};
|
||||
|
||||
enum LED_STATE_871x {
|
||||
@ -63,99 +26,46 @@ enum LED_STATE_871x {
|
||||
RTW_LED_OFF = 2,
|
||||
LED_BLINK_NORMAL = 3,
|
||||
LED_BLINK_SLOWLY = 4,
|
||||
LED_BLINK_POWER_ON = 5,
|
||||
LED_BLINK_SCAN = 6, /* LED is blinking during scanning period,
|
||||
* the # of times to blink is depend on time
|
||||
* for scanning. */
|
||||
LED_BLINK_NO_LINK = 7, /* LED is blinking during no link state. */
|
||||
LED_BLINK_StartToBlink = 8,/* Customzied for Sercomm Printer
|
||||
* Server case */
|
||||
LED_BLINK_TXRX = 9,
|
||||
LED_BLINK_WPS = 10, /* LED is blinkg during WPS communication */
|
||||
LED_BLINK_WPS_STOP = 11, /* for ALPHA */
|
||||
LED_BLINK_WPS_STOP_OVERLAP = 12, /* for BELKIN */
|
||||
LED_BLINK_WPS_STOP = 11,
|
||||
LED_BLINK_RUNTOP = 13, /* Customized for RunTop */
|
||||
LED_BLINK_CAMEO = 14,
|
||||
LED_BLINK_XAVI = 15,
|
||||
LED_BLINK_ALWAYS_ON = 16,
|
||||
};
|
||||
|
||||
enum LED_PIN_871x {
|
||||
LED_PIN_NULL = 0,
|
||||
LED_PIN_LED0 = 1,
|
||||
LED_PIN_LED1 = 2,
|
||||
LED_PIN_LED2 = 3,
|
||||
LED_PIN_GPIO0 = 4,
|
||||
};
|
||||
|
||||
struct LED_871x {
|
||||
struct adapter *padapter;
|
||||
|
||||
enum LED_PIN_871x LedPin; /* Identify how to implement this
|
||||
* SW led. */
|
||||
enum LED_STATE_871x CurrLedState; /* Current LED state. */
|
||||
enum LED_STATE_871x BlinkingLedState; /* Next state for blinking,
|
||||
* either RTW_LED_ON or RTW_LED_OFF are. */
|
||||
|
||||
u8 bLedOn; /* true if LED is ON, false if LED is OFF. */
|
||||
bool bLedOn; /* true if LED is ON, false if LED is OFF. */
|
||||
|
||||
u8 bLedBlinkInProgress; /* true if it is blinking, false o.w.. */
|
||||
bool bLedBlinkInProgress; /* true if it is blinking, false o.w.. */
|
||||
|
||||
u8 bLedWPSBlinkInProgress;
|
||||
bool bLedWPSBlinkInProgress;
|
||||
|
||||
u32 BlinkTimes; /* Number of times to toggle led state for blinking. */
|
||||
|
||||
struct timer_list BlinkTimer; /* Timer object for led blinking. */
|
||||
|
||||
/* ALPHA, added by chiyoko, 20090106 */
|
||||
u8 bLedNoLinkBlinkInProgress;
|
||||
u8 bLedLinkBlinkInProgress;
|
||||
u8 bLedStartToLinkBlinkInProgress;
|
||||
u8 bLedScanBlinkInProgress;
|
||||
struct work_struct BlinkWorkItem; /* Workitem used by BlinkTimer to
|
||||
* manipulate H/W to blink LED. */
|
||||
bool bLedNoLinkBlinkInProgress;
|
||||
bool bLedLinkBlinkInProgress;
|
||||
bool bLedScanBlinkInProgress;
|
||||
struct delayed_work blink_work;
|
||||
};
|
||||
|
||||
#define IS_LED_WPS_BLINKING(_LED_871x) \
|
||||
(((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS || \
|
||||
((struct LED_871x *)_LED_871x)->CurrLedState == LED_BLINK_WPS_STOP || \
|
||||
((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress)
|
||||
|
||||
#define IS_LED_BLINKING(_LED_871x) \
|
||||
(((struct LED_871x *)_LED_871x)->bLedWPSBlinkInProgress || \
|
||||
((struct LED_871x *)_LED_871x)->bLedScanBlinkInProgress)
|
||||
|
||||
void LedControl8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction);
|
||||
|
||||
struct led_priv{
|
||||
/* add for led control */
|
||||
struct LED_871x SwLed0;
|
||||
struct LED_871x SwLed1;
|
||||
u8 bRegUseLed;
|
||||
void (*LedControlHandler)(struct adapter *padapter,
|
||||
enum LED_CTL_MODE LedAction);
|
||||
/* add for led control */
|
||||
bool bRegUseLed;
|
||||
};
|
||||
|
||||
#define rtw_led_control(adapt, action) \
|
||||
do { \
|
||||
if ((adapt)->ledpriv.LedControlHandler) \
|
||||
(adapt)->ledpriv.LedControlHandler((adapt), (action)); \
|
||||
} while (0)
|
||||
void rtl8188eu_InitSwLeds(struct adapter *padapter);
|
||||
void rtl8188eu_DeInitSwLeds(struct adapter *padapter);
|
||||
|
||||
void BlinkTimerCallback(struct timer_list *t);
|
||||
void BlinkWorkItemCallback(struct work_struct *work);
|
||||
|
||||
void ResetLedStatus(struct LED_871x * pLed);
|
||||
|
||||
void InitLed871x(struct adapter *padapter, struct LED_871x *pLed,
|
||||
enum LED_PIN_871x LedPin);
|
||||
|
||||
void DeInitLed871x(struct LED_871x *pLed);
|
||||
|
||||
/* hal... */
|
||||
void BlinkHandler(struct LED_871x * pLed);
|
||||
void SwLedOn(struct adapter *padapter, struct LED_871x *pLed);
|
||||
void SwLedOff(struct adapter *padapter, struct LED_871x *pLed);
|
||||
void rtw_led_control(struct adapter *padapter, enum LED_CTL_MODE LedAction);
|
||||
|
||||
#endif /* __RTW_LED_H_ */
|
||||
|
@ -243,18 +243,6 @@ struct wifidirect_info {
|
||||
* by using the sta_preset CAPI. */
|
||||
/* 0: disable */
|
||||
/* 1: enable */
|
||||
u8 wfd_tdls_enable; /* Flag to enable or disable the TDLS by WFD Sigma*/
|
||||
/* 0: disable */
|
||||
/* 1: enable */
|
||||
u8 wfd_tdls_weaksec; /* Flag to enable or disable the weak security
|
||||
* function for TDLS by WFD Sigma */
|
||||
/* 0: disable */
|
||||
/* In this case, the driver can't issue the tdsl
|
||||
* setup request frame. */
|
||||
/* 1: enable */
|
||||
/* In this case, the driver can issue the tdls
|
||||
* setup request frame */
|
||||
/* even the current security is weak security. */
|
||||
|
||||
/* This field will store the WPS value (PIN value or PBC) that UI had
|
||||
* got from the user. */
|
||||
|
@ -162,11 +162,6 @@ struct rt_channel_plan {
|
||||
unsigned char Len;
|
||||
};
|
||||
|
||||
struct rt_channel_plan_2g {
|
||||
unsigned char Channel[MAX_CHANNEL_NUM_2G];
|
||||
unsigned char Len;
|
||||
};
|
||||
|
||||
struct rt_channel_plan_map {
|
||||
unsigned char Index2G;
|
||||
};
|
||||
|
@ -19,10 +19,6 @@ enum power_mgnt {
|
||||
PS_MODE_DTIM,
|
||||
PS_MODE_VOIP,
|
||||
PS_MODE_UAPSD_WMM,
|
||||
PS_MODE_UAPSD,
|
||||
PS_MODE_IBSS,
|
||||
PS_MODE_WWLAN,
|
||||
PM_Radio_Off,
|
||||
PM_Card_Disable,
|
||||
PS_MODE_NUM
|
||||
};
|
||||
@ -57,7 +53,6 @@ struct pwrctrl_priv {
|
||||
|
||||
u8 reg_rfoff;
|
||||
u8 reg_pdnmode; /* powerdown mode */
|
||||
u32 rfoff_reason;
|
||||
|
||||
/* RF OFF Level */
|
||||
u32 cur_ps_level;
|
||||
@ -80,7 +75,6 @@ struct pwrctrl_priv {
|
||||
s32 pnp_current_pwr_state;
|
||||
u8 pnp_bstop_trx;
|
||||
|
||||
u8 bInternalAutoSuspend;
|
||||
u8 bInSuspend;
|
||||
u8 bSupportRemoteWakeup;
|
||||
struct timer_list pwr_state_check_timer;
|
||||
@ -93,7 +87,6 @@ struct pwrctrl_priv {
|
||||
enum rt_rf_power_state change_rfpwrstate;
|
||||
|
||||
u8 wepkeymask;
|
||||
u8 bHWPowerdown;/* if support hw power down */
|
||||
u8 bkeepfwalive;
|
||||
};
|
||||
|
||||
|
@ -177,7 +177,6 @@ struct recv_priv {
|
||||
uint rx_smallpacket_crcerr;
|
||||
uint rx_middlepacket_crcerr;
|
||||
struct semaphore allrxreturnevt;
|
||||
uint ff_hwaddr;
|
||||
u8 rx_pending_cnt;
|
||||
|
||||
struct tasklet_struct irq_prepare_beacon_tasklet;
|
||||
|
@ -6,33 +6,16 @@
|
||||
|
||||
#include "rtw_cmd.h"
|
||||
|
||||
#define OFDM_PHY 1
|
||||
#define MIXED_PHY 2
|
||||
#define CCK_PHY 3
|
||||
|
||||
#define NumRates (13)
|
||||
|
||||
/* slot time for 11g */
|
||||
#define SHORT_SLOT_TIME 9
|
||||
#define NON_SHORT_SLOT_TIME 20
|
||||
|
||||
#define RTL8711_RF_MAX_SENS 6
|
||||
#define RTL8711_RF_DEF_SENS 4
|
||||
|
||||
/* We now define the following channels as the max channels in each
|
||||
* channel plan. */
|
||||
/* 2G, total 14 chnls */
|
||||
/* {1,2,3,4,5,6,7,8,9,10,11,12,13,14} */
|
||||
#define MAX_CHANNEL_NUM_2G 14
|
||||
#define MAX_CHANNEL_NUM 14 /* 2.4 GHz only */
|
||||
|
||||
#define NUM_REGULATORYS 1
|
||||
|
||||
/* Country codes */
|
||||
#define USA 0x555320
|
||||
#define EUROPE 0x1 /* temp, should be provided later */
|
||||
#define JAPAN 0x2 /* temp, should be provided later */
|
||||
|
||||
struct regulatory_class {
|
||||
u32 starting_freq; /* MHz, */
|
||||
u8 channel_set[MAX_CHANNEL_NUM];
|
||||
@ -69,13 +52,6 @@ enum _REG_PREAMBLE_MODE {
|
||||
PREAMBLE_SHORT = 3,
|
||||
};
|
||||
|
||||
enum rf90_radio_path {
|
||||
RF90_PATH_A = 0, /* Radio Path A */
|
||||
RF90_PATH_B = 1, /* Radio Path B */
|
||||
RF90_PATH_C = 2, /* Radio Path C */
|
||||
RF90_PATH_D = 3 /* Radio Path D */
|
||||
};
|
||||
|
||||
/* Bandwidth Offset */
|
||||
#define HAL_PRIME_CHNL_OFFSET_DONT_CARE 0
|
||||
#define HAL_PRIME_CHNL_OFFSET_LOWER 1
|
||||
@ -99,16 +75,6 @@ enum ht_extchnl_offset {
|
||||
HT_EXTCHNL_OFFSET_LOWER = 3,
|
||||
};
|
||||
|
||||
/* 2007/11/15 MH Define different RF type. */
|
||||
enum rt_rf_type_def {
|
||||
RF_1T2R = 0,
|
||||
RF_2T4R = 1,
|
||||
RF_2T2R = 2,
|
||||
RF_1T1R = 3,
|
||||
RF_2T2R_GREEN = 4,
|
||||
RF_819X_MAX_TYPE = 5,
|
||||
};
|
||||
|
||||
u32 rtw_ch2freq(u32 ch);
|
||||
|
||||
#endif /* _RTL8711_RF_H_ */
|
||||
|
@ -16,7 +16,6 @@ extern int rtw_mc2u_disable;
|
||||
u8 usbvendorrequest(struct dvobj_priv *pdvobjpriv, enum bt_usb_request brequest,
|
||||
enum rt_usb_wvalue wvalue, u8 windex, void *data,
|
||||
u8 datalen, u8 isdirectionin);
|
||||
int pm_netdev_open(struct net_device *pnetdev, u8 bnormal);
|
||||
void netdev_br_init(struct net_device *netdev);
|
||||
void dhcp_flag_bcast(struct adapter *priv, struct sk_buff *skb);
|
||||
void *scdb_findEntry(struct adapter *priv, unsigned char *ipAddr);
|
||||
|
@ -13,32 +13,9 @@
|
||||
#define BIT(x) (1 << (x))
|
||||
|
||||
#define WLAN_ETHHDR_LEN 14
|
||||
#define WLAN_ETHADDR_LEN 6
|
||||
#define WLAN_IEEE_OUI_LEN 3
|
||||
#define WLAN_ADDR_LEN 6
|
||||
#define WLAN_CRC_LEN 4
|
||||
#define WLAN_BSSID_LEN 6
|
||||
#define WLAN_BSS_TS_LEN 8
|
||||
#define WLAN_HDR_A3_LEN 24
|
||||
#define WLAN_HDR_A4_LEN 30
|
||||
#define WLAN_HDR_A3_QOS_LEN 26
|
||||
#define WLAN_HDR_A4_QOS_LEN 32
|
||||
#define WLAN_SSID_MAXLEN 32
|
||||
#define WLAN_DATA_MAXLEN 2312
|
||||
|
||||
#define WLAN_A3_PN_OFFSET 24
|
||||
#define WLAN_A4_PN_OFFSET 30
|
||||
|
||||
#define WLAN_MIN_ETHFRM_LEN 60
|
||||
#define WLAN_MAX_ETHFRM_LEN 1514
|
||||
#define WLAN_ETHHDR_LEN 14
|
||||
|
||||
#define P80211CAPTURE_VERSION 0x80211001
|
||||
|
||||
/* This value is tested by WiFi 11n Test Plan 5.2.3. */
|
||||
/* This test verifies the WLAN NIC can update the NAV through sending
|
||||
* the CTS with large duration. */
|
||||
#define WiFiNavUpperUs 30000 /* 30 ms */
|
||||
|
||||
enum WIFI_FRAME_TYPE {
|
||||
WIFI_MGT_TYPE = (0),
|
||||
@ -487,13 +464,6 @@ static inline int IsFrameTypeCtrl(unsigned char *pframe)
|
||||
#define _STATUS_CODE_ 2
|
||||
#define _TIMESTAMP_ 8
|
||||
|
||||
#define AUTH_ODD_TO 0
|
||||
#define AUTH_EVEN_TO 1
|
||||
|
||||
#define WLAN_ETHCONV_ENCAP 1
|
||||
#define WLAN_ETHCONV_RFC1042 2
|
||||
#define WLAN_ETHCONV_8021h 3
|
||||
|
||||
#define cap_ESS BIT(0)
|
||||
#define cap_IBSS BIT(1)
|
||||
#define cap_CFPollable BIT(2)
|
||||
@ -632,13 +602,6 @@ enum ht_cap_ampdu_factor {
|
||||
#define HT_INFO_OPERATION_MODE_TRANSMIT_BURST_LIMIT ((u8) BIT(3))
|
||||
#define HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT ((u8) BIT(4))
|
||||
|
||||
#define HT_INFO_STBC_PARAM_DUAL_BEACON ((u16) BIT(6))
|
||||
#define HT_INFO_STBC_PARAM_DUAL_STBC_PROTECT ((u16) BIT(7))
|
||||
#define HT_INFO_STBC_PARAM_SECONDARY_BC ((u16) BIT(8))
|
||||
#define HT_INFO_STBC_PARAM_LSIG_TXOP_PROTECT_ALLOWED ((u16) BIT(9))
|
||||
#define HT_INFO_STBC_PARAM_PCO_ACTIVE ((u16) BIT(10))
|
||||
#define HT_INFO_STBC_PARAM_PCO_PHASE ((u16) BIT(11))
|
||||
|
||||
/* ===============WPS Section=============== */
|
||||
/* For WPSv1.0 */
|
||||
#define WPSOUI 0x0050f204
|
||||
@ -930,7 +893,7 @@ enum P2P_PROTO_WK_ID {
|
||||
P2P_PRE_TX_PROVDISC_PROCESS_WK = 2,
|
||||
P2P_PRE_TX_NEGOREQ_PROCESS_WK = 3,
|
||||
P2P_PRE_TX_INVITEREQ_PROCESS_WK = 4,
|
||||
P2P_AP_P2P_CH_SWITCH_PROCESS_WK =5,
|
||||
P2P_AP_P2P_CH_SWITCH_PROCESS_WK = 5,
|
||||
P2P_RO_CH_WK = 6,
|
||||
};
|
||||
|
||||
@ -949,26 +912,6 @@ enum P2P_PS_MODE {
|
||||
P2P_PS_MIX = 3, /* CTWindow and NoA */
|
||||
};
|
||||
|
||||
/* =====================WFD Section===================== */
|
||||
/* For Wi-Fi Display */
|
||||
#define WFD_ATTR_DEVICE_INFO 0x00
|
||||
#define WFD_ATTR_ASSOC_BSSID 0x01
|
||||
#define WFD_ATTR_COUPLED_SINK_INFO 0x06
|
||||
#define WFD_ATTR_LOCAL_IP_ADDR 0x08
|
||||
#define WFD_ATTR_SESSION_INFO 0x09
|
||||
#define WFD_ATTR_ALTER_MAC 0x0a
|
||||
|
||||
/* For WFD Device Information Attribute */
|
||||
#define WFD_DEVINFO_SOURCE 0x0000
|
||||
#define WFD_DEVINFO_PSINK 0x0001
|
||||
#define WFD_DEVINFO_SSINK 0x0002
|
||||
#define WFD_DEVINFO_DUAL 0x0003
|
||||
|
||||
#define WFD_DEVINFO_SESSION_AVAIL 0x0010
|
||||
#define WFD_DEVINFO_WSD 0x0040
|
||||
#define WFD_DEVINFO_PC_TDLS 0x0080
|
||||
#define WFD_DEVINFO_HDCP_SUPPORT 0x0100
|
||||
|
||||
#define IP_MCAST_MAC(mac) \
|
||||
((mac[0] == 0x01) && (mac[1] == 0x00) && (mac[2] == 0x5e))
|
||||
#define ICMPV6_MCAST_MAC(mac) \
|
||||
|
@ -1,8 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* Copyright(c) 2007 - 2012 Realtek Corporation. */
|
||||
|
||||
#define _IOCTL_LINUX_C_
|
||||
|
||||
#include "../include/osdep_service.h"
|
||||
#include "../include/drv_types.h"
|
||||
#include "../include/wlan_bssdef.h"
|
||||
@ -14,7 +12,7 @@
|
||||
#include "../include/rtw_ioctl_set.h"
|
||||
#include "../include/usb_ops.h"
|
||||
#include "../include/rtl8188e_hal.h"
|
||||
#include "../include/rtl8188e_led.h"
|
||||
#include "../include/rtw_led.h"
|
||||
|
||||
#include "../include/rtw_iol.h"
|
||||
|
||||
@ -60,7 +58,7 @@ void rtw_indicate_wx_assoc_event(struct adapter *padapter)
|
||||
|
||||
memcpy(wrqu.ap_addr.sa_data, pmlmepriv->cur_network.network.MacAddress, ETH_ALEN);
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "assoc success\n");
|
||||
netdev_dbg(padapter->pnetdev, "assoc success\n");
|
||||
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
|
||||
}
|
||||
|
||||
@ -73,7 +71,7 @@ void rtw_indicate_wx_disassoc_event(struct adapter *padapter)
|
||||
wrqu.ap_addr.sa_family = ARPHRD_ETHER;
|
||||
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
|
||||
|
||||
DBG_88E_LEVEL(_drv_always_, "indicate disassoc\n");
|
||||
netdev_dbg(padapter->pnetdev, "indicate disassoc\n");
|
||||
wireless_send_event(padapter->pnetdev, SIOCGIWAP, &wrqu, NULL);
|
||||
}
|
||||
|
||||
@ -2092,18 +2090,6 @@ static int rtw_wx_write_rf(struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_wx_priv_null(struct net_device *dev, struct iw_request_info *a,
|
||||
union iwreq_data *wrqu, char *b)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int dummy(struct net_device *dev, struct iw_request_info *a,
|
||||
union iwreq_data *wrqu, char *b)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int rtw_wx_set_channel_plan(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
@ -2120,37 +2106,6 @@ static int rtw_wx_set_channel_plan(struct net_device *dev,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_wx_set_mtk_wps_probe_ie(struct net_device *dev,
|
||||
struct iw_request_info *a,
|
||||
union iwreq_data *wrqu, char *b)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_wx_get_sensitivity(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *buf)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_wx_set_mtk_wps_ie(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* For all data larger than 16 octets, we need to use a
|
||||
* pointer to memory allocated in user space.
|
||||
*/
|
||||
static int rtw_drvext_hdl(struct net_device *dev, struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_get_ap_info(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
@ -3043,7 +2998,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
||||
struct list_head *plist, *phead;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
uint uintPeerChannel = 0;
|
||||
u32 peer_channel = 0;
|
||||
|
||||
/* Commented by Albert 20110304 */
|
||||
/* The input data contains two informations. */
|
||||
@ -3073,7 +3028,7 @@ static int rtw_p2p_connect(struct net_device *dev,
|
||||
while (phead != plist) {
|
||||
pnetwork = container_of(plist, struct wlan_network, list);
|
||||
if (!memcmp(pnetwork->network.MacAddress, peerMAC, ETH_ALEN)) {
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
peer_channel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -3082,11 +3037,11 @@ static int rtw_p2p_connect(struct net_device *dev,
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
if (uintPeerChannel) {
|
||||
if (peer_channel) {
|
||||
memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info));
|
||||
memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info));
|
||||
|
||||
pwdinfo->nego_req_info.peer_channel_num[0] = uintPeerChannel;
|
||||
pwdinfo->nego_req_info.peer_channel_num[0] = peer_channel;
|
||||
memcpy(pwdinfo->nego_req_info.peerDevAddr, pnetwork->network.MacAddress, ETH_ALEN);
|
||||
pwdinfo->nego_req_info.benable = true;
|
||||
|
||||
@ -3121,7 +3076,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
||||
struct list_head *plist, *phead;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
uint uintPeerChannel = 0;
|
||||
uint peer_channel = 0;
|
||||
u8 attr_content[50] = {0x00};
|
||||
u8 *p2pie;
|
||||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
@ -3177,13 +3132,13 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
||||
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
|
||||
/* Handle the P2P Device ID attribute of Beacon first */
|
||||
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) {
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
peer_channel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
}
|
||||
} else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) {
|
||||
/* Handle the P2P Device Info attribute of probe response */
|
||||
if (!memcmp(attr_content, pinvite_req_info->peer_macaddr, ETH_ALEN)) {
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
peer_channel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3193,7 +3148,7 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
if (uintPeerChannel) {
|
||||
if (peer_channel) {
|
||||
/* Store the GO's bssid */
|
||||
for (jj = 0, kk = 18; jj < ETH_ALEN; jj++, kk += 3)
|
||||
pinvite_req_info->go_bssid[jj] = key_2char2num(extra[kk], extra[kk + 1]);
|
||||
@ -3202,12 +3157,12 @@ static int rtw_p2p_invite_req(struct net_device *dev,
|
||||
pinvite_req_info->ssidlen = wrqu->data.length - 36;
|
||||
memcpy(pinvite_req_info->go_ssid, &extra[36], (u32)pinvite_req_info->ssidlen);
|
||||
pinvite_req_info->benable = true;
|
||||
pinvite_req_info->peer_ch = uintPeerChannel;
|
||||
pinvite_req_info->peer_ch = peer_channel;
|
||||
|
||||
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INVITE_REQ);
|
||||
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
set_channel_bwmode(padapter, peer_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
|
||||
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
|
||||
|
||||
@ -3260,7 +3215,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
||||
struct list_head *plist, *phead;
|
||||
struct __queue *queue = &pmlmepriv->scanned_queue;
|
||||
struct wlan_network *pnetwork = NULL;
|
||||
uint uintPeerChannel = 0;
|
||||
uint peer_channel = 0;
|
||||
u8 attr_content[100] = {0x00};
|
||||
u8 *p2pie;
|
||||
uint p2pielen = 0, attr_contentlen = 0;
|
||||
@ -3310,7 +3265,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
||||
plist = phead->next;
|
||||
|
||||
while (phead != plist) {
|
||||
if (uintPeerChannel != 0)
|
||||
if (peer_channel != 0)
|
||||
break;
|
||||
|
||||
pnetwork = container_of(plist, struct wlan_network, list);
|
||||
@ -3328,13 +3283,13 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
||||
if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) {
|
||||
/* Handle the P2P Device ID attribute of Beacon first */
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
peer_channel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
}
|
||||
} else if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_INFO, attr_content, &attr_contentlen)) {
|
||||
/* Handle the P2P Device Info attribute of probe response */
|
||||
if (!memcmp(attr_content, peerMAC, ETH_ALEN)) {
|
||||
uintPeerChannel = pnetwork->network.Configuration.DSConfig;
|
||||
peer_channel = pnetwork->network.Configuration.DSConfig;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -3349,11 +3304,11 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
||||
|
||||
spin_unlock_bh(&pmlmepriv->scanned_queue.lock);
|
||||
|
||||
if (uintPeerChannel) {
|
||||
DBG_88E("[%s] peer channel: %d!\n", __func__, uintPeerChannel);
|
||||
if (peer_channel) {
|
||||
DBG_88E("[%s] peer channel: %d!\n", __func__, peer_channel);
|
||||
memcpy(pwdinfo->tx_prov_disc_info.peerIFAddr, pnetwork->network.MacAddress, ETH_ALEN);
|
||||
memcpy(pwdinfo->tx_prov_disc_info.peerDevAddr, peerMAC, ETH_ALEN);
|
||||
pwdinfo->tx_prov_disc_info.peer_channel_num[0] = (u16)uintPeerChannel;
|
||||
pwdinfo->tx_prov_disc_info.peer_channel_num[0] = (u16)peer_channel;
|
||||
pwdinfo->tx_prov_disc_info.benable = true;
|
||||
rtw_p2p_set_pre_state(pwdinfo, rtw_p2p_state(pwdinfo));
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_PROVISION_DIS_REQ);
|
||||
@ -3365,7 +3320,7 @@ static int rtw_p2p_prov_disc(struct net_device *dev,
|
||||
pwdinfo->tx_prov_disc_info.ssid.SsidLength = P2P_WILDCARD_SSID_LEN;
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, uintPeerChannel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
set_channel_bwmode(padapter, peer_channel, HAL_PRIME_CHNL_OFFSET_DONT_CARE, HT_CHANNEL_WIDTH_20);
|
||||
|
||||
_set_timer(&pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT);
|
||||
|
||||
@ -3617,27 +3572,18 @@ static void bb_reg_dump(struct adapter *padapter)
|
||||
|
||||
static void rf_reg_dump(struct adapter *padapter)
|
||||
{
|
||||
int i, j = 1, path;
|
||||
int i, j = 1, path = 0;
|
||||
u32 value;
|
||||
u8 rf_type, path_nums = 0;
|
||||
GetHwReg8188EU(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
pr_info("\n ======= RF REG =======\n");
|
||||
if ((RF_1T2R == rf_type) || (RF_1T1R == rf_type))
|
||||
path_nums = 1;
|
||||
else
|
||||
path_nums = 2;
|
||||
|
||||
for (path = 0; path < path_nums; path++) {
|
||||
pr_info("\nRF_Path(%x)\n", path);
|
||||
for (i = 0; i < 0x100; i++) {
|
||||
value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
|
||||
if (j % 4 == 1)
|
||||
pr_info("0x%02x ", i);
|
||||
pr_info(" 0x%08x ", value);
|
||||
if ((j++) % 4 == 0)
|
||||
pr_info("\n");
|
||||
}
|
||||
pr_info("\nRF_Path(%x)\n", path);
|
||||
for (i = 0; i < 0x100; i++) {
|
||||
value = rtl8188e_PHY_QueryRFReg(padapter, path, i, 0xffffffff);
|
||||
if (j % 4 == 1)
|
||||
pr_info("0x%02x ", i);
|
||||
pr_info(" 0x%08x ", value);
|
||||
if ((j++) % 4 == 0)
|
||||
pr_info("\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -4058,12 +4004,6 @@ static int rtw_dbg_port(struct net_device *dev,
|
||||
DBG_88E("turn %s the bShowGetP2PState Variable\n", (extra_arg == 1) ? "on" : "off");
|
||||
padapter->bShowGetP2PState = extra_arg;
|
||||
break;
|
||||
case 0xaa:
|
||||
if (extra_arg > 0x13)
|
||||
extra_arg = 0xFF;
|
||||
DBG_88E("chang data rate to :0x%02x\n", extra_arg);
|
||||
padapter->fix_rate = extra_arg;
|
||||
break;
|
||||
case 0xdd:/* registers dump, 0 for mac reg, 1 for bb reg, 2 for rf reg */
|
||||
if (extra_arg == 0)
|
||||
mac_reg_dump(padapter);
|
||||
@ -4230,81 +4170,21 @@ static int rtw_pm_set(struct net_device *dev,
|
||||
return ret;
|
||||
}
|
||||
|
||||
extern int wifirate2_ratetbl_inx(unsigned char rate);
|
||||
|
||||
static int rtw_tdls(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_tdls_get(struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int rtw_test(
|
||||
struct net_device *dev,
|
||||
struct iw_request_info *info,
|
||||
union iwreq_data *wrqu, char *extra)
|
||||
{
|
||||
u32 len;
|
||||
u8 *pbuf, *pch;
|
||||
char *ptmp;
|
||||
u8 *delim = ",";
|
||||
|
||||
DBG_88E("+%s\n", __func__);
|
||||
len = wrqu->data.length;
|
||||
|
||||
pbuf = kzalloc(len, GFP_KERNEL);
|
||||
if (!pbuf) {
|
||||
DBG_88E("%s: no memory!\n", __func__);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (copy_from_user(pbuf, wrqu->data.pointer, len)) {
|
||||
kfree(pbuf);
|
||||
DBG_88E("%s: copy from user fail!\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
DBG_88E("%s: string =\"%s\"\n", __func__, pbuf);
|
||||
|
||||
ptmp = (char *)pbuf;
|
||||
pch = strsep(&ptmp, delim);
|
||||
if (!pch || strlen(pch) == 0) {
|
||||
kfree(pbuf);
|
||||
DBG_88E("%s: parameter error(level 1)!\n", __func__);
|
||||
return -EFAULT;
|
||||
}
|
||||
kfree(pbuf);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static iw_handler rtw_handlers[] = {
|
||||
IW_HANDLER(SIOCGIWNAME, rtw_wx_get_name),
|
||||
IW_HANDLER(SIOCSIWNWID, dummy),
|
||||
IW_HANDLER(SIOCGIWNWID, dummy),
|
||||
IW_HANDLER(SIOCGIWFREQ, rtw_wx_get_freq),
|
||||
IW_HANDLER(SIOCSIWMODE, rtw_wx_set_mode),
|
||||
IW_HANDLER(SIOCGIWMODE, rtw_wx_get_mode),
|
||||
IW_HANDLER(SIOCSIWSENS, dummy),
|
||||
IW_HANDLER(SIOCGIWSENS, rtw_wx_get_sens),
|
||||
IW_HANDLER(SIOCGIWRANGE, rtw_wx_get_range),
|
||||
IW_HANDLER(SIOCSIWPRIV, rtw_wx_set_priv),
|
||||
IW_HANDLER(SIOCSIWSPY, dummy),
|
||||
IW_HANDLER(SIOCGIWSPY, dummy),
|
||||
IW_HANDLER(SIOCSIWAP, rtw_wx_set_wap),
|
||||
IW_HANDLER(SIOCGIWAP, rtw_wx_get_wap),
|
||||
IW_HANDLER(SIOCSIWMLME, rtw_wx_set_mlme),
|
||||
IW_HANDLER(SIOCGIWAPLIST, dummy),
|
||||
IW_HANDLER(SIOCSIWSCAN, rtw_wx_set_scan),
|
||||
IW_HANDLER(SIOCGIWSCAN, rtw_wx_get_scan),
|
||||
IW_HANDLER(SIOCSIWESSID, rtw_wx_set_essid),
|
||||
IW_HANDLER(SIOCGIWESSID, rtw_wx_get_essid),
|
||||
IW_HANDLER(SIOCSIWNICKN, dummy),
|
||||
IW_HANDLER(SIOCGIWNICKN, rtw_wx_get_nick),
|
||||
IW_HANDLER(SIOCSIWRATE, rtw_wx_set_rate),
|
||||
IW_HANDLER(SIOCGIWRATE, rtw_wx_get_rate),
|
||||
@ -4312,13 +4192,9 @@ static iw_handler rtw_handlers[] = {
|
||||
IW_HANDLER(SIOCGIWRTS, rtw_wx_get_rts),
|
||||
IW_HANDLER(SIOCSIWFRAG, rtw_wx_set_frag),
|
||||
IW_HANDLER(SIOCGIWFRAG, rtw_wx_get_frag),
|
||||
IW_HANDLER(SIOCSIWTXPOW, dummy),
|
||||
IW_HANDLER(SIOCGIWTXPOW, dummy),
|
||||
IW_HANDLER(SIOCSIWRETRY, dummy),
|
||||
IW_HANDLER(SIOCGIWRETRY, rtw_wx_get_retry),
|
||||
IW_HANDLER(SIOCSIWENCODE, rtw_wx_set_enc),
|
||||
IW_HANDLER(SIOCGIWENCODE, rtw_wx_get_enc),
|
||||
IW_HANDLER(SIOCSIWPOWER, dummy),
|
||||
IW_HANDLER(SIOCGIWPOWER, rtw_wx_get_power),
|
||||
IW_HANDLER(SIOCSIWGENIE, rtw_wx_set_gen_ie),
|
||||
IW_HANDLER(SIOCSIWAUTH, rtw_wx_set_auth),
|
||||
@ -4339,9 +4215,6 @@ static const struct iw_priv_args rtw_private_args[] = {
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x2, 0, 0, "driver_ext"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x3, 0, 0, "mp_ioctl"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x4,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "apinfo"
|
||||
@ -4354,19 +4227,6 @@ static const struct iw_priv_args rtw_private_args[] = {
|
||||
SIOCIWFIRSTPRIV + 0x6,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "wps_start"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x7,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "get_sensitivity"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x8,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "wps_prob_req_ie"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x9,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "wps_assoc_req_ie"
|
||||
},
|
||||
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0xA,
|
||||
IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, "channel_plan"
|
||||
@ -4396,33 +4256,18 @@ static const struct iw_priv_args rtw_private_args[] = {
|
||||
SIOCIWFIRSTPRIV + 0x12,
|
||||
IW_PRIV_TYPE_CHAR | P2P_PRIVATE_IOCTL_SET_LEN, IW_PRIV_TYPE_CHAR | IFNAMSIZ, "p2p_get2"
|
||||
},
|
||||
{SIOCIWFIRSTPRIV + 0x13, IW_PRIV_TYPE_CHAR | 128, 0, "NULL"},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x14,
|
||||
IW_PRIV_TYPE_CHAR | 64, 0, "tdls"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x15,
|
||||
IW_PRIV_TYPE_CHAR | P2P_PRIVATE_IOCTL_SET_LEN, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_FIXED | P2P_PRIVATE_IOCTL_SET_LEN, "tdls_get"
|
||||
},
|
||||
{
|
||||
SIOCIWFIRSTPRIV + 0x16,
|
||||
IW_PRIV_TYPE_CHAR | 64, 0, "pm_set"
|
||||
},
|
||||
|
||||
{SIOCIWFIRSTPRIV + 0x18, IW_PRIV_TYPE_CHAR | IFNAMSIZ, 0, "rereg_nd_name"},
|
||||
|
||||
{SIOCIWFIRSTPRIV + 0x1D, IW_PRIV_TYPE_CHAR | 40, IW_PRIV_TYPE_CHAR | 0x7FF, "test"
|
||||
},
|
||||
|
||||
{SIOCIWFIRSTPRIV + 0x0E, IW_PRIV_TYPE_CHAR | 1024, 0, ""}, /* set */
|
||||
{SIOCIWFIRSTPRIV + 0x0F, IW_PRIV_TYPE_CHAR | 1024, IW_PRIV_TYPE_CHAR | IW_PRIV_SIZE_MASK, ""},/* get */
|
||||
};
|
||||
|
||||
static iw_handler rtw_private_handler[] = {
|
||||
rtw_wx_write32, /* 0x00 */
|
||||
rtw_wx_read32, /* 0x01 */
|
||||
rtw_drvext_hdl, /* 0x02 */
|
||||
NULL, /* 0x02 */
|
||||
NULL, /* 0x03 */
|
||||
/* for MM DTV platform */
|
||||
rtw_get_ap_info, /* 0x04 */
|
||||
@ -4430,9 +4275,9 @@ NULL, /* 0x03 */
|
||||
rtw_set_pid, /* 0x05 */
|
||||
rtw_wps_start, /* 0x06 */
|
||||
|
||||
rtw_wx_get_sensitivity, /* 0x07 */
|
||||
rtw_wx_set_mtk_wps_probe_ie, /* 0x08 */
|
||||
rtw_wx_set_mtk_wps_ie, /* 0x09 */
|
||||
NULL, /* 0x07 */
|
||||
NULL, /* 0x08 */
|
||||
NULL, /* 0x09 */
|
||||
|
||||
/* Set Channel depend on the country code */
|
||||
rtw_wx_set_channel_plan, /* 0x0A */
|
||||
@ -4448,18 +4293,12 @@ NULL, /* 0x03 */
|
||||
rtw_p2p_get2, /* 0x12 */
|
||||
|
||||
NULL, /* 0x13 */
|
||||
rtw_tdls, /* 0x14 */
|
||||
rtw_tdls_get, /* 0x15 */
|
||||
NULL, /* 0x14 */
|
||||
NULL, /* 0x15 */
|
||||
|
||||
rtw_pm_set, /* 0x16 */
|
||||
rtw_wx_priv_null, /* 0x17 */
|
||||
NULL, /* 0x17 */
|
||||
rtw_rereg_nd_name, /* 0x18 */
|
||||
rtw_wx_priv_null, /* 0x19 */
|
||||
|
||||
NULL, /* 0x1A */
|
||||
NULL, /* 0x1B */
|
||||
NULL, /* 0x1C is reserved for hostapd */
|
||||
rtw_test, /* 0x1D */
|
||||
};
|
||||
|
||||
static struct iw_statistics *rtw_get_wireless_stats(struct net_device *dev)
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "../include/rtw_ioctl.h"
|
||||
#include "../include/usb_osintf.h"
|
||||
#include "../include/rtw_br_ext.h"
|
||||
#include "../include/rtl8188e_led.h"
|
||||
#include "../include/rtw_led.h"
|
||||
#include "../include/rtl8188e_dm.h"
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
@ -75,7 +75,6 @@ static int rtw_ampdu_amsdu;/* 0: disabled, 1:enabled, 2:auto */
|
||||
|
||||
static int rtw_lowrate_two_xmit = 1;/* Use 2 path Tx to transmit MCS0~7 and legacy mode */
|
||||
|
||||
static int rtw_rf_config = RF_819X_MAX_TYPE; /* auto */
|
||||
static int rtw_low_power;
|
||||
static int rtw_wifi_spec;
|
||||
static int rtw_channel_plan = RT_CHANNEL_DOMAIN_MAX;
|
||||
@ -123,7 +122,6 @@ module_param(rtw_ampdu_enable, int, 0644);
|
||||
module_param(rtw_rx_stbc, int, 0644);
|
||||
module_param(rtw_ampdu_amsdu, int, 0644);
|
||||
module_param(rtw_lowrate_two_xmit, int, 0644);
|
||||
module_param(rtw_rf_config, int, 0644);
|
||||
module_param(rtw_power_mgnt, int, 0644);
|
||||
module_param(rtw_smart_ps, int, 0644);
|
||||
module_param(rtw_low_power, int, 0644);
|
||||
@ -153,7 +151,7 @@ MODULE_PARM_DESC(rtw_notch_filter, "0:Disable, 1:Enable, 2:Enable only for P2P")
|
||||
module_param_named(debug, rtw_debug, int, 0444);
|
||||
MODULE_PARM_DESC(debug, "Set debug level (1-9) (default 1)");
|
||||
|
||||
static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
|
||||
static uint loadparam(struct adapter *padapter)
|
||||
{
|
||||
struct registry_priv *registry_par = &padapter->registrypriv;
|
||||
|
||||
@ -205,7 +203,6 @@ static uint loadparam(struct adapter *padapter, struct net_device *pnetdev)
|
||||
registry_par->rx_stbc = (u8)rtw_rx_stbc;
|
||||
registry_par->ampdu_amsdu = (u8)rtw_ampdu_amsdu;
|
||||
registry_par->lowrate_two_xmit = (u8)rtw_lowrate_two_xmit;
|
||||
registry_par->rf_config = (u8)rtw_rf_config;
|
||||
registry_par->low_power = (u8)rtw_low_power;
|
||||
registry_par->wifi_spec = (u8)rtw_wifi_spec;
|
||||
registry_par->channel_plan = (u8)rtw_channel_plan;
|
||||
@ -371,7 +368,7 @@ struct net_device *rtw_init_netdev(struct adapter *old_padapter)
|
||||
pnetdev->wireless_handlers = (struct iw_handler_def *)&rtw_handlers_def;
|
||||
|
||||
/* step 2. */
|
||||
loadparam(padapter, pnetdev);
|
||||
loadparam(padapter);
|
||||
|
||||
return pnetdev;
|
||||
}
|
||||
@ -399,7 +396,7 @@ void rtw_stop_drv_threads(struct adapter *padapter)
|
||||
wait_for_completion(&padapter->cmdpriv.stop_cmd_thread);
|
||||
}
|
||||
|
||||
static u8 rtw_init_default_value(struct adapter *padapter)
|
||||
static void rtw_init_default_value(struct adapter *padapter)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
@ -444,7 +441,6 @@ static u8 rtw_init_default_value(struct adapter *padapter)
|
||||
padapter->bRxRSSIDisplay = 0;
|
||||
padapter->bNotifyChannelChange = 0;
|
||||
padapter->bShowGetP2PState = 1;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u8 rtw_reset_drv_sw(struct adapter *padapter)
|
||||
@ -478,50 +474,37 @@ u8 rtw_reset_drv_sw(struct adapter *padapter)
|
||||
|
||||
u8 rtw_init_drv_sw(struct adapter *padapter)
|
||||
{
|
||||
u8 ret8 = _SUCCESS;
|
||||
|
||||
if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if ((rtw_init_cmd_priv(&padapter->cmdpriv)) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
padapter->cmdpriv.padapter = padapter;
|
||||
|
||||
if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if ((rtw_init_evt_priv(&padapter->evtpriv)) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
if (rtw_init_mlme_priv(padapter) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (rtw_init_mlme_priv(padapter) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
rtw_init_wifidirect_timers(padapter);
|
||||
init_wifidirect_info(padapter, P2P_ROLE_DISABLE);
|
||||
reset_global_wifidirect_info(padapter);
|
||||
|
||||
if (init_mlme_ext_priv(padapter) == _FAIL) {
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
if (init_mlme_ext_priv(padapter) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
if (_rtw_init_xmit_priv(&padapter->xmitpriv, padapter) == _FAIL) {
|
||||
DBG_88E("Can't _rtw_init_xmit_priv\n");
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (_rtw_init_recv_priv(&padapter->recvpriv, padapter) == _FAIL) {
|
||||
DBG_88E("Can't _rtw_init_recv_priv\n");
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) {
|
||||
DBG_88E("Can't _rtw_init_sta_priv\n");
|
||||
ret8 = _FAIL;
|
||||
goto exit;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
padapter->stapriv.padapter = padapter;
|
||||
@ -530,15 +513,14 @@ u8 rtw_init_drv_sw(struct adapter *padapter)
|
||||
|
||||
rtw_init_pwrctrl_priv(padapter);
|
||||
|
||||
ret8 = rtw_init_default_value(padapter);
|
||||
rtw_init_default_value(padapter);
|
||||
|
||||
rtl8188e_init_dm_priv(padapter);
|
||||
rtl8188eu_InitSwLeds(padapter);
|
||||
|
||||
spin_lock_init(&padapter->br_ext_lock);
|
||||
|
||||
exit:
|
||||
return ret8;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
void rtw_cancel_all_timer(struct adapter *padapter)
|
||||
@ -585,8 +567,6 @@ u8 rtw_free_drv_sw(struct adapter *padapter)
|
||||
|
||||
_rtw_free_recv_priv(&padapter->recvpriv);
|
||||
|
||||
rtl8188e_free_hal_data(padapter);
|
||||
|
||||
/* free the old_pnetdev */
|
||||
if (padapter->rereg_nd_name_priv.old_pnetdev) {
|
||||
free_netdev(padapter->rereg_nd_name_priv.old_pnetdev);
|
||||
@ -775,26 +755,11 @@ void rtw_ips_dev_unload(struct adapter *padapter)
|
||||
rtw_hal_deinit(padapter);
|
||||
}
|
||||
|
||||
int pm_netdev_open(struct net_device *pnetdev, u8 bnormal)
|
||||
{
|
||||
int status;
|
||||
|
||||
if (bnormal)
|
||||
status = netdev_open(pnetdev);
|
||||
else
|
||||
status = (_SUCCESS == ips_netdrv_open((struct adapter *)rtw_netdev_priv(pnetdev))) ? (0) : (-1);
|
||||
return status;
|
||||
}
|
||||
|
||||
int netdev_close(struct net_device *pnetdev)
|
||||
{
|
||||
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(pnetdev);
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(padapter);
|
||||
|
||||
if (padapter->pwrctrlpriv.bInternalAutoSuspend) {
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_off)
|
||||
padapter->pwrctrlpriv.ps_flag = true;
|
||||
}
|
||||
padapter->net_closed = true;
|
||||
|
||||
if (padapter->pwrctrlpriv.rf_pwrstate == rf_on) {
|
||||
|
@ -29,13 +29,12 @@ static struct usb_device_id rtw_usb_id_tbl[] = {
|
||||
/*=== Realtek demoboard ===*/
|
||||
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x8179)}, /* 8188EUS */
|
||||
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0x0179)}, /* 8188ETV */
|
||||
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xf179)}, /* 8188FU */
|
||||
/*=== Customer ID ===*/
|
||||
/****** 8188EUS ********/
|
||||
{USB_DEVICE(0x07B8, 0x8179)}, /* Abocom - Abocom */
|
||||
{USB_DEVICE(0x0DF6, 0x0076)}, /* Sitecom N150 v2 */
|
||||
{USB_DEVICE(0x2001, 0x330F)}, /* DLink DWA-125 REV D1 */
|
||||
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
|
||||
{USB_DEVICE(0x2001, 0x3310)}, /* Dlink DWA-123 REV D1 */
|
||||
{USB_DEVICE(0x2001, 0x3311)}, /* DLink GO-USB-N150 REV B1 */
|
||||
{USB_DEVICE(0x2001, 0x331B)}, /* D-Link DWA-121 rev B1 */
|
||||
{USB_DEVICE(0x056E, 0x4008)}, /* Elecom WDC-150SU2M */
|
||||
@ -70,6 +69,7 @@ static struct rtw_usb_drv *usb_drv = &rtl8188e_usb_drv;
|
||||
static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||
{
|
||||
int i;
|
||||
u8 rt_num_in_pipes = 0;
|
||||
struct dvobj_priv *pdvobjpriv;
|
||||
struct usb_host_config *phost_conf;
|
||||
struct usb_config_descriptor *pconf_desc;
|
||||
@ -80,14 +80,13 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||
|
||||
pdvobjpriv = kzalloc(sizeof(*pdvobjpriv), GFP_KERNEL);
|
||||
if (!pdvobjpriv)
|
||||
goto exit;
|
||||
goto err;
|
||||
|
||||
pdvobjpriv->pusbintf = usb_intf;
|
||||
pusbd = interface_to_usbdev(usb_intf);
|
||||
pdvobjpriv->pusbdev = pusbd;
|
||||
usb_set_intfdata(usb_intf, pdvobjpriv);
|
||||
|
||||
pdvobjpriv->RtNumInPipes = 0;
|
||||
pdvobjpriv->RtNumOutPipes = 0;
|
||||
|
||||
phost_conf = pusbd->actconfig;
|
||||
@ -98,28 +97,26 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||
|
||||
pdvobjpriv->NumInterfaces = pconf_desc->bNumInterfaces;
|
||||
pdvobjpriv->InterfaceNumber = piface_desc->bInterfaceNumber;
|
||||
pdvobjpriv->nr_endpoint = piface_desc->bNumEndpoints;
|
||||
|
||||
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
|
||||
for (i = 0; i < piface_desc->bNumEndpoints; i++) {
|
||||
int ep_num;
|
||||
pendp_desc = &phost_iface->endpoint[i].desc;
|
||||
|
||||
ep_num = usb_endpoint_num(pendp_desc);
|
||||
|
||||
if (usb_endpoint_is_bulk_in(pendp_desc)) {
|
||||
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
||||
pdvobjpriv->RtNumInPipes++;
|
||||
} else if (usb_endpoint_is_int_in(pendp_desc)) {
|
||||
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
|
||||
pdvobjpriv->RtNumInPipes++;
|
||||
pdvobjpriv->RtInPipe = ep_num;
|
||||
rt_num_in_pipes++;
|
||||
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
|
||||
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
|
||||
ep_num;
|
||||
pdvobjpriv->RtNumOutPipes++;
|
||||
}
|
||||
pdvobjpriv->ep_num[i] = ep_num;
|
||||
}
|
||||
|
||||
if (rt_num_in_pipes != 1)
|
||||
goto err;
|
||||
|
||||
if (pusbd->speed == USB_SPEED_HIGH) {
|
||||
pdvobjpriv->ishighspeed = true;
|
||||
DBG_88E("USB_SPEED_HIGH\n");
|
||||
@ -133,9 +130,11 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
|
||||
rtw_reset_continual_urb_error(pdvobjpriv);
|
||||
|
||||
usb_get_dev(pusbd);
|
||||
|
||||
exit:
|
||||
return pdvobjpriv;
|
||||
|
||||
err:
|
||||
kfree(pdvobjpriv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void usb_dvobj_deinit(struct usb_interface *usb_intf)
|
||||
@ -193,8 +192,7 @@ static void rtw_dev_unload(struct adapter *padapter)
|
||||
if (padapter->intf_stop)
|
||||
padapter->intf_stop(padapter);
|
||||
/* s4. */
|
||||
if (!padapter->pwrctrlpriv.bInternalAutoSuspend)
|
||||
rtw_stop_drv_threads(padapter);
|
||||
rtw_stop_drv_threads(padapter);
|
||||
|
||||
/* s5. */
|
||||
if (!padapter->bSurpriseRemoved) {
|
||||
@ -298,7 +296,7 @@ static int rtw_resume(struct usb_interface *pusb_intf)
|
||||
pwrpriv->bkeepfwalive = false;
|
||||
|
||||
DBG_88E("bkeepfwalive(%x)\n", pwrpriv->bkeepfwalive);
|
||||
if (pm_netdev_open(pnetdev, true) != 0) {
|
||||
if (netdev_open(pnetdev) != 0) {
|
||||
mutex_unlock(&pwrpriv->lock);
|
||||
goto exit;
|
||||
}
|
||||
@ -362,9 +360,6 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||
SET_NETDEV_DEV(pnetdev, dvobj_to_dev(dvobj));
|
||||
padapter = rtw_netdev_priv(pnetdev);
|
||||
|
||||
/* step 2. allocate HalData */
|
||||
rtl8188eu_alloc_haldata(padapter);
|
||||
|
||||
padapter->intf_start = &usb_intf_start;
|
||||
padapter->intf_stop = &usb_intf_stop;
|
||||
|
||||
@ -386,7 +381,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||
|
||||
/* step 5. */
|
||||
if (rtw_init_drv_sw(padapter) == _FAIL)
|
||||
goto free_hal_data;
|
||||
goto handle_dualmac;
|
||||
|
||||
#ifdef CONFIG_PM
|
||||
if (padapter->pwrctrlpriv.bSupportRemoteWakeup) {
|
||||
@ -414,7 +409,7 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||
|
||||
/* step 6. Tell the network stack we exist */
|
||||
if (register_netdev(pnetdev) != 0)
|
||||
goto free_hal_data;
|
||||
goto handle_dualmac;
|
||||
|
||||
DBG_88E("bDriverStopped:%d, bSurpriseRemoved:%d, bup:%d, hw_init_completed:%d\n"
|
||||
, padapter->bDriverStopped
|
||||
@ -425,9 +420,6 @@ static struct adapter *rtw_usb_if1_init(struct dvobj_priv *dvobj,
|
||||
|
||||
status = _SUCCESS;
|
||||
|
||||
free_hal_data:
|
||||
if (status != _SUCCESS)
|
||||
kfree(padapter->HalData);
|
||||
handle_dualmac:
|
||||
if (status != _SUCCESS)
|
||||
rtw_handle_dualmac(padapter, 0);
|
||||
|
@ -12,11 +12,7 @@ unsigned int ffaddr2pipehdl(struct dvobj_priv *pdvobj, u32 addr)
|
||||
unsigned int pipe = 0, ep_num = 0;
|
||||
struct usb_device *pusbd = pdvobj->pusbdev;
|
||||
|
||||
if (addr == RECV_BULK_IN_ADDR) {
|
||||
pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[0]);
|
||||
} else if (addr == RECV_INT_IN_ADDR) {
|
||||
pipe = usb_rcvbulkpipe(pusbd, pdvobj->RtInPipe[1]);
|
||||
} else if (addr < HW_QUEUE_ENTRY) {
|
||||
if (addr < HW_QUEUE_ENTRY) {
|
||||
ep_num = pdvobj->Queue2Pipe[addr];
|
||||
pipe = usb_sndbulkpipe(pusbd, ep_num);
|
||||
}
|
||||
|
@ -1,8 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
config DMA_RALINK
|
||||
tristate "RALINK DMA support"
|
||||
depends on RALINK && !SOC_RT288X
|
||||
depends on DMADEVICES
|
||||
select DMA_ENGINE
|
||||
select DMA_VIRTUAL_CHANNELS
|
||||
|
@ -1,4 +0,0 @@
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
obj-$(CONFIG_DMA_RALINK) += ralink-gdma.o
|
||||
|
||||
ccflags-y += -I$(srctree)/drivers/dma
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user